From ca420bd9c09b51a404ade3e0106257725df727be Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期三, 01 十一月 2023 11:32:28 +0800 Subject: [PATCH] 整合代码 --- Source/UBCS-WEB/src/views/modeling/cycle.vue | 160 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 153 insertions(+), 7 deletions(-) diff --git a/Source/UBCS-WEB/src/views/modeling/cycle.vue b/Source/UBCS-WEB/src/views/modeling/cycle.vue index 5df55c7..0fc23e9 100644 --- a/Source/UBCS-WEB/src/views/modeling/cycle.vue +++ b/Source/UBCS-WEB/src/views/modeling/cycle.vue @@ -5,6 +5,7 @@ :option="option" :page="page" :table-loading="loading" + :permission="permissionList" selection @size-change="search('size', ...arguments)" @current-change="search('current', ...arguments)" @@ -18,6 +19,7 @@ type="primary" icon="el-icon-plus" size="small" + v-if="permissionList.addBtn" @click="openDialog('add', {})" >鏂板</el-button > @@ -36,6 +38,7 @@ type="text" icon="el-icon-edit" size="mini" + v-if="permissionList.editBtn" :loading="row.editLoading" @click="openDialog('edit', row)" >缂栬緫</el-button @@ -44,6 +47,7 @@ type="text" icon="el-icon-view" size="mini" + v-if="permissionList.openBtn" :loading="row.detailLoading" @click="openDialog('detail', row)" >棰勮</el-button @@ -53,6 +57,7 @@ type="text" icon="el-icon-delete" size="mini" + v-if="permissionList.delBtn" :loading="row.delLoading" @click="rowDel(row)" >鍒犻櫎</el-button @@ -98,17 +103,13 @@ <script> import API from "@/api/modeling/cycle"; import CycleFlow from "@/components/flow-cycle/flowchartEditor.vue"; +import {mapGetters} from "vuex"; export default { name: "cycle.vue", components: { CycleFlow }, data() { return { - form: { - // 'contionMap[id]': 'qwe' - // contionMap: [ - // {id: 'qwe'} - // ] - }, + form: {}, page: { pageSize: 10, total: 0, @@ -116,6 +117,10 @@ layout: "total, sizes, prev, pager, next, jumper", }, option: { + height:'auto', + calcHeight:20, + columnBtn:false, + tip:false, selection: true, searchMenuSpan: 6, searchMenuPosition: "right", @@ -161,6 +166,17 @@ submitLoading: false, selectedData: [], }; + }, + computed:{ + ...mapGetters(["permission"]), + permissionList(){ + return{ + addBtn: this.vaildData(this.permission.modeling_cycle.cycle_add,false), + delBtn: this.vaildData(this.permission.modeling_cycle.cycle_delete,false), + editBtn: this.vaildData(this.permission.modeling_cycle.cycle_edit,false), + openBtn: this.vaildData(this.permission.modeling_cycle.cycle_open,false), + } + }, }, created() { this.search("search", {}); @@ -286,10 +302,138 @@ }); }, async submit() { + // const data = { + // startStatus: "Auditing", + // name: "22", + // id: "asas", + // nodes: [ + // { + // type: "node", + // size: "80*48", + // shape: "flow-rect", + // color: "#1890FF", + // label: "Auditing", + // x: 278.60856031183397, + // y: 84.12841612613737, + // id: "Auditing", + // change: true, + // index: 0, + // name: "Auditing", + // indexNum: 0, + // }, + // { + // type: "node", + // size: "80*48", + // shape: "flow-rect", + // color: "#1890FF", + // label: "Editing", + // x: 294.17388658989535, + // y: 299.9676071819219, + // id: "Editing", + // change: true, + // index: 1, + // name: "Editing", + // indexNum: 1, + // }, + // { + // type: "node", + // size: "80*48", + // shape: "flow-rect", + // color: "#1890FF", + // label: "drg", + // x: 278.60856031183397, + // y: 463.92237731083515, + // id: "drg", + // change: true, + // index: 3, + // name: "drg", + // indexNum: 3, + // }, + // ], + // edges: [ + // { + // source: "Auditing", + // sourceAnchor: 2, + // target: "Editing", + // targetAnchor: 0, + // id: "3083896f", + // index: 2, + // indexNum: 2, + // events: [ + // { + // eventFullName: + // "plm.bs.omd.lifecycle.server.pubimpl.TransationEvente", + // eventShowName: "TransationEventE", + // description: "", + // bizDomain: "mdm", + // oid: "5", + // creator: "", + // createTime: "", + // lastModifier: "", + // lastModifyTime: "", + // ts: "", + // }, + // ], + // }, + // { + // source: "Editing", + // sourceAnchor: 2, + // target: "drg", + // targetAnchor: 0, + // id: "b941a21d", + // index: 4, + // indexNum: 4, + // events: [ + // { + // eventFullName: + // "plm.bs.omd.lifecycle.server.pubimpl.TransationEventf", + // eventShowName: "TransationEventF", + // description: "", + // bizDomain: "mdm", + // oid: "6", + // creator: "", + // createTime: "", + // lastModifier: "", + // lastModifyTime: "", + // ts: "", + // }, + // { + // eventFullName: + // "plm.bs.omd.lifecycle.server.pubimpl.TransationEvente", + // eventShowName: "TransationEventE", + // description: "", + // bizDomain: "mdm", + // oid: "5", + // creator: "", + // createTime: "", + // lastModifier: "", + // lastModifyTime: "", + // ts: "", + // }, + // ], + // }, + // ], + // }; + // API.add(data) + // .then((res) => { + // this.submitLoading = false; + // if (res.data.code === 200) { + // this.$message.success( + // this.type === "edit" ? "淇敼鎴愬姛锛�" : "鏂板鎴愬姛锛�" + // ); + // this.visible = false; + // this.search(); + // } + // }) + // .catch(() => { + // this.submitLoading = false; + // }); + // return; const newRowData = await this.$refs.vueFlowchartEditor.getNewRowData(); if (!newRowData) { return; } + // const edgeEvents = this.$refs.vueFlowchartEditor.getEdgesEvents(); const flowData = await this.$refs.vueFlowchartEditor.getFlowData(); if (Array.isArray(flowData.nodes)) { flowData.nodes = flowData.nodes.map((item) => { @@ -302,6 +446,7 @@ flowData.edges = flowData.edges.map((item) => { item.name = item.label; item.indexNum = item.index; + // item.events = edgeEvents[item.id] || []; return item; }); } @@ -310,11 +455,12 @@ ...flowData, }; + console.log('params',params) this.submitLoading = true; let APIFun = API.add; if (this.type === "edit") { APIFun = API.edit; - this.$delete(params, "id"); + // this.$delete(params, "id"); } APIFun(params) .then((res) => { -- Gitblit v1.9.3