xiejun
2023-08-12 a19d26e88360c9760b2286bac4dfb1710fd2fa21
Source/UBCS-WEB/src/components/template/Stage.vue
@@ -1,30 +1,33 @@
<template>
    <div>
        <avue-crud ref="crud" :table-loading="loading" :data="data" :option="option" :page.sync="page"
  <div v-if="Formlist.length>0">
    <avue-crud ref="crud" :data="data" :option="option" :page.sync="page" :table-loading="loading"
            @on-load="getDataList" @size-change="handleSizePage" @current-change="handleCurrentPage"
            @row-click="handleRowClick">
            <template slot-scope="{type,size,row,index}" slot="menu">
                <el-button icon="el-icon-check" :size="size" :type="type"
                    @click="handleMaintenance(row, index)">维护</el-button>
      <template slot="menu" slot-scope="{type,size,row,index}">
        <el-button :size="size" :type="type" icon="el-icon-check"
                   @click="handleMaintenance(row, index)">维护
        </el-button>
            </template>
        </avue-crud>
        <el-dialog title="模板阶段" width="50%"  append-to-body="true" :visible.sync="dialogNode">
            <avue-crud ref="crud" :table-loading="loading" :data="stageData" :option="stageOption" @on-load="getStagelist"
    <el-dialog :visible.sync="dialogNode" append-to-body="true" title="模板阶段" width="50%">
      <avue-crud ref="crud" :data="stageData" :option="stageOption" :table-loading="loading" @on-load="getStagelist"
                @row-click="handleRowStageClick">
                <template slot-scope="{type,size,row,index}" slot="menu">
                    <el-button icon="el-icon-check" :size="size" :type="type"
                        @click="handleMaintenanceTransfer(row, index)">维护</el-button>
        <template slot="menu" slot-scope="{type,size,row,index}">
          <el-button :size="size" :type="type" icon="el-icon-check"
                     @click="handleMaintenanceTransfer(row, index)">维护
          </el-button>
                </template>
            </avue-crud>
        </el-dialog>
        <table-transfer v-if="flag" :visible.sync="dialogTransfer" v-model="attributeValue" :dataList="attributeData"
            :columns="columns" keyName="oid" @save="handleSave" @close="handelClose"></table-transfer>
    <table-transfer v-if="flag" v-model="attributeValue" :columns="columns" :dataList="attributeData"
                    :visible.sync="dialogTransfer" keyName="oid" @close="handelClose" @save="handleSave"></table-transfer>
    </div>
</template>
<script>
import { getFlowpathList, stagelist, attributeListRight, attributeList, attributeSave } from '@/api/template/flowpath.js'
import TableTransfer from '@/components/template/TableTransfer'
export default {
    name: 'Stage',
    components: {
@@ -35,6 +38,10 @@
            typeof: String,
            required: true,
            default: ""
    },
    Formlist: {
      type: Array,
      default: []
        }
    },
    watch: {
@@ -102,6 +109,7 @@
            ],
            option: {
                ...options,
        height: 383,
                column: [
                    { label: '模板编号', prop: 'modelKey' },
                    { label: '模板名称', prop: 'modelName' },
@@ -143,6 +151,8 @@
              this.data = data.records
              this.page.total = data.total
            } else this.loading = false
      } else {
        this.data = []
          }
        },
        // 获取阶段列表
@@ -159,7 +169,11 @@
        // 获取全部属性
        async getAttributeList() {
            const response = await attributeList({ 'conditionMap[classifyTemplateOid]': this.code })
            const responseRight = await attributeListRight({ templateId: this.code, modelKey: this.modelKey, taskId: this.saveParam.taskId })
      const responseRight = await attributeListRight({
        templateId: this.code,
        modelKey: this.modelKey,
        taskId: this.saveParam.taskId
      })
            if (response.status === 200 && responseRight.status === 200) {
                let datas = response.data.data.records
                let dataRight = responseRight.data.data
@@ -167,7 +181,9 @@
                    const { oid, id, name, attributeGroup } = item
                    item = { oid, id, name, attributeGroup, ...{ checked: false } }
                    if (dataRight.length !== 0) {
                        dataRight.forEach(element => { if (item.id === element.attrId) item.checked = true });
            dataRight.forEach(element => {
              if (item.id === element.attrId) item.checked = true
            });
                    }
                    return item
                })
@@ -180,7 +196,11 @@
        },
        // 获取已保存属性
        async getAttributeListRight() {
            const response = await attributeListRight({ templateId: this.code, modelKey: this.modelKey, taskId: this.saveParam.taskId })
      const response = await attributeListRight({
        templateId: this.code,
        modelKey: this.modelKey,
        taskId: this.saveParam.taskId
      })
            if (response.status === 200) {
                let data = response.data.data
                data = data.map(item => {