xiejun
2023-07-19 ded6e8d2312e139e8ce770c7f1d5830bf2db4af6
Source/UBCS-WEB/src/components/template/FlowPath.vue
@@ -1,40 +1,29 @@
<template>
    <el-dialog title="模板流程" width="90%" append-to-body="true" :visible.sync="dialogVisible">
        <avue-crud ref="crud" :table-loading="loading" :data="data" v-model="form" :option="option" :page.sync="page"
        <avue-crud ref="crud" :table-loading="loading" :data="data" v-model="form" :option="option" :page.sync="page"   :permission="permissionList"
            :search.sync="search" @on-load="getDataList" @row-save="handleSave" @row-del="handleDelete"
            @row-update="handleEdit" @refresh-change="handleRefresh" @size-change="handleSizePage"
            @current-change="handleCurrentPage">
        </avue-crud>
    </el-dialog>
</template>
<script>
import { getFlowpathList, getStartList, flowpathSave, flowpathDelete } from '@/api/template/flowpath.js'
import {mapGetters} from "vuex";
export default {
    name: 'FlowPath',
    props: {
        // 是否打开
        visible: {
            typeof: Boolean,
            default: false
        },
        code: {
            typeof: String,
            required: true,
            default: ""
        }
    },
    watch: {
        visible(n) {
            this.dialogVisible = n;
        },
        dialogVisible(n) {
            this.$emit('update:visible', n)
        },
      code: {
        typeof: String,
        required: true,
        default: ""
      },
      crudLCStatus: {
        type: String,
        default: 'Editing'
      }
    },
    data() {
        return {
            dialogVisible: this.visible,
            loading: false,
            page: {
                currentPage: 1,
@@ -64,6 +53,7 @@
                    {
                        label: '模板key',
                        prop: 'modelKey',
                        width:120,
                        sortable: true,
                        type: 'tree',
                        dicData: [],
@@ -85,19 +75,26 @@
                        label: '模板名称',
                        prop: 'modelName',
                        sortable: true,
                        width:220,
                        addDisabled: true,
                        editDisabled: true,
                    },
                    {
                        label: '流程模板用途',
                        label: '模板用途',
                        prop: 'buttonTypeKey',
                        type: 'tree',
                        width:120,
                        dicUrl: '/api/ubcs-flow/processTS/tt',
                        dicMethod: 'post',
                        props: {
                            value: "codee",
                            label: "namee",
                        },
                    },
                    {
                        label: '模板描述',
                        prop: 'description',
                        type:'textarea'
                    },
                ]
            },
@@ -106,6 +103,17 @@
    created() {
        this.getStart()
    },
  computed:{
    ...mapGetters([ "permission"]),
    permissionList() {
      return {
        addBtn: this.crudLCStatus=='Editing',
        viewBtn: false,
        delBtn: this.crudLCStatus=='Editing',
        editBtn: this.crudLCStatus=='Editing'
      };
    },
  },
    methods: {
        async getStart() {
            const response = await getStartList()
@@ -154,8 +162,8 @@
        // 编辑
        async handleEdit(row, index, done, loading) {
            console.log(row)
            const { modelName, modelKey, buttonTypeKey, id } = row
            let param = { modelName, modelKey, buttonTypeKey, id }
            const { modelName, modelKey, buttonTypeKey, id ,description} = row
            let param = { modelName, modelKey, buttonTypeKey, id,description }
            const response = await flowpathSave({ ...param, ...{ templateId: this.code } })
            if (response.status === 200) {
                loading()
@@ -214,4 +222,4 @@
        },
    }
}
</script>
</script>