From 159c95cafb4f0eb3955c9e4adc3134585512455d Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期五, 08 十二月 2023 11:44:56 +0800 Subject: [PATCH] 业务类型和链接类型整合代码 --- Source/UBCS-WEB/src/views/modeling/LinkType.vue | 5 ++++- Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue | 9 ++++++--- Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue | 5 ++++- Source/UBCS-WEB/src/views/modeling/Business.vue | 5 ++++- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Source/UBCS-WEB/src/views/modeling/Business.vue b/Source/UBCS-WEB/src/views/modeling/Business.vue index fb9fdec..775856c 100644 --- a/Source/UBCS-WEB/src/views/modeling/Business.vue +++ b/Source/UBCS-WEB/src/views/modeling/Business.vue @@ -144,7 +144,7 @@ </el-dialog> </el-container> </el-container> - <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons" + <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons" :type="type" @refreshTable="initTreeOnLoad"> </business-add> </el-container> @@ -163,6 +163,7 @@ name: "Business", data() { return { + type:"", //鐢熷懡鍛ㄦ湡瀵硅瘽妗嗙姸鎬� packageLifeBox: false, //鐗堟湰瑙勫垯鐘舵�� @@ -362,6 +363,7 @@ businessAdd() { this.$refs.btmAdd.showSubmitDialog = true; this.$refs.btmAdd.btmType = {}; + this.type = 'add'; this.ifRefreshBtmAddRefresh(); }, businessEdit() { @@ -372,6 +374,7 @@ const json = JSON.stringify(this.obj); this.$refs.btmAdd.btmType = JSON.parse(json); this.$refs.btmAdd.showSubmitDialog = true; + this.type = 'edit' this.ifRefreshBtmAddRefresh(); }, ifRefreshBtmAddRefresh() { diff --git a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue index c2b4b6f..c662081 100644 --- a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue +++ b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue @@ -11,7 +11,7 @@ <el-form ref="form" :model="btmType" show-message="true" inline size="medium" label-suffix=":" class="btmTypeForm" :rules="rules" @resetFields="resetForm" status-icon="true"> <el-form-item label="鑻辨枃鍚嶇О" label-width="100px" required="true" prop="id"> - <el-input v-model="btmType.id" :prefix-icon="icons.key" :disabled="Object.keys(this.btmType).length !== 0 "></el-input> + <el-input v-model="btmType.id" :prefix-icon="icons.key" :disabled="type !== 'add'"></el-input> </el-form-item> <el-form-item label="涓枃鍚嶇О" label-width="100px"> <el-input v-model="btmType.name" :prefix-icon="icons.name"></el-input> @@ -199,12 +199,15 @@ }, icons: { type: Array + }, + type: { + type:String, } }, watch: { - btmType: { + type: { handler(newval, oldval) { - // console.log('鐩戝惉', newval, oldval) + // console.log('鐩戝惉', newval) }, deep: true, immediate: true diff --git a/Source/UBCS-WEB/src/views/modeling/LinkType.vue b/Source/UBCS-WEB/src/views/modeling/LinkType.vue index d28d2bc..e0f13fd 100644 --- a/Source/UBCS-WEB/src/views/modeling/LinkType.vue +++ b/Source/UBCS-WEB/src/views/modeling/LinkType.vue @@ -134,7 +134,7 @@ </el-main> </el-container> </el-container> - <link-type-add ref="linkAdd" :linkType="addOption.linkType" :domainOption="domainOptions" :icons="icons" + <link-type-add ref="linkAdd" :linkType="addOption.linkType" :domainOption="domainOptions" :icons="icons" :linkStatus="linkStatus" @refreshTable="initTreeOnLoad"> </link-type-add> @@ -154,6 +154,7 @@ name: "LinkType", data() { return { + linkStatus:'', addOption: { linkType: { attributes:[] @@ -252,6 +253,7 @@ // 娣诲姞鎸夐挳鐐瑰嚮浜嬩欢 linkTypeAdd() { this.$refs.linkAdd.linkType = {}; + this.linkStatus = 'add'; this.$refs.linkAdd.showSubmitDialog = true; }, // 缂栬緫鎸夐挳鐐瑰嚮浜嬩欢 @@ -263,6 +265,7 @@ var json = JSON.stringify(linktype); this.addOption.linkType = JSON.parse(json); this.$refs.linkAdd.linkType = this.addOption.linkType; + this.linkStatus = 'edit'; this.$refs.linkAdd.showSubmitDialog = true; }, // 浠庡凡鏈変腑鑾峰彇鎸夐挳鐐瑰嚮浜嬩欢 diff --git a/Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue b/Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue index 8f1dce1..e502c19 100644 --- a/Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue +++ b/Source/UBCS-WEB/src/views/modeling/LinkTypeAdd.vue @@ -5,7 +5,7 @@ <el-form ref="form" :model="linkType" :rules="rules" class="linkTypeForm" inline label-suffix=":" show-message="true" size="medium" status-icon="true" @resetFields="resetForm"> <el-form-item label="鑻辨枃鍚嶇О" label-width="100px" prop="id" required="true"> - <el-input v-model="linkType.id" :disabled="this.linkType.hasOwnProperty('id')" :prefix-icon="icons.id" maxlength="15" show-word-limit + <el-input v-model="linkType.id" :disabled="linkStatus !== 'add'" :prefix-icon="icons.id" maxlength="15" show-word-limit type="text"></el-input> </el-form-item> <el-form-item label="涓枃鍚嶇О" label-width="100px"> @@ -95,6 +95,9 @@ }, icons: { type: Array + }, + linkStatus: { + type:String } }, watch: { -- Gitblit v1.9.3