From db78e86024c5cc3928bdd837e148204d59bd4fbb Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期四, 07 十一月 2024 12:10:13 +0800 Subject: [PATCH] 业务类型和链接类型添加修改调整 --- Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue | 397 ++++++++++++++++++++++++++++++-------------------------- 1 files changed, 212 insertions(+), 185 deletions(-) diff --git a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue index 646a7e6..6885a07 100644 --- a/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue +++ b/Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/businessType/index.vue @@ -215,31 +215,32 @@ :props="{label: 'id', value: 'id'}" :dic="lifeData"></avue-select> </el-form-item> - <el-form-item label="澶囬�夌敓鍛藉懆鏈熷垪琛細" label-width="138px"> <avue-select multiple :filterable="true" - v-model="form.subLifeCycleId" + v-model="form.subLifeCycleIdList" placeholder="璇烽�夋嫨鐢熷懡鍛ㄦ湡" :props="{label: 'id', value: 'id'}" type="tree" - :dic="lifeData"></avue-select> + :dic="subLifeData" + @change="subLifeChange"></avue-select> </el-form-item> </div> </div> </el-form> <div class="bottomForm"> - <h3 style="margin-bottom: 10px;">灞炴�ф睜鍒楄〃</h3> <avue-crud + size="mini" :data="dialogAttrData" :option="dialogAttrOption" @row-del="dialogBottomAttrDel"> <template slot="menuLeft"> - <el-button icon="el-icon-plus" size="small" type="primary" @click="addDialogClickHandler">鍒涘缓</el-button> + <h3 style="display: inline-block;margin-right: 20px;margin-bottom: 10px;">灞炴�ф睜鍒楄〃</h3> + <el-button icon="el-icon-plus" size="mini" type="primary" @click="addDialogClickHandler">鍒涘缓</el-button> </template> </avue-crud> </div> - <span slot="footer" class="dialog-footer avue-dialog__footer"> + <span slot="footer" class="dialog-footer"> <el-button type="primary" @click="addDialogSavaHandler">纭� 瀹�</el-button> <el-button @click="addDialogClose">鍙� 娑�</el-button> </span> @@ -271,8 +272,8 @@ > </avue-crud> <span slot="footer" class="dialog-footer"> - <el-button @click="dialogAttrClose">鍙� 娑�</el-button> <el-button type="primary" @click="dialogAttrAddClickHandler">纭� 瀹�</el-button> + <el-button @click="dialogAttrClose">鍙� 娑�</el-button> </span> </el-dialog> @@ -496,6 +497,7 @@ index: false, selection: false, refreshBtn: false, + header:false, column: [ { label: '绫诲瀷鍚�', @@ -554,6 +556,8 @@ versionAddFlag: false, inheritTreeData: [], lifeData: [],//鐢熷懡鍛ㄦ湡涓嬫媺鏁版嵁 + subLifeData:[],//澶囬�夌敓鍛藉懆鏈熶笅鎷夋暟鎹� + allLifeData:[], versionData: [],//鐗堟湰瑙勫垯鏁版嵁 dialogAttrSelectList: [], searchAttrParams: {}, @@ -575,12 +579,16 @@ height: 450, searchMenuSpan: 8, header: false, + selectable:function(row){ + return row.selectable; + }, column: [ { label: '灞炴�у悕', prop: 'id', sortable: true, search: true, + width:260 }, { label: '灞炴�х被鍨�', @@ -592,6 +600,7 @@ label: '鍒濆鍊�', prop: 'defaultValue', sortable: true, + width: 200 }, { label: '璇存槑', @@ -621,8 +630,10 @@ editBtn: false, refreshBtn: false, selection: false, - height: 210, + height: 220, addBtn: false, + gridBtn:false, + columnBtn:false, menuWidth:100, // index:false, column: [ @@ -630,12 +641,14 @@ label: '灞炴�у悕', prop: 'id', sortable: true, + width:260, }, { prop: 'btmTypeId', label: '涓氬姟绫诲瀷', - sortable: true + sortable: true, + width: 200 }, { label: '灞炴�х被鍨�', @@ -647,7 +660,7 @@ label: '鍒濆鍊�', prop: 'defaultValue', sortable: true, - width:150, + width:200, }, { label: '璇存槑', @@ -671,22 +684,26 @@ { prop: 'id', label: '灞炴�у悕', - sortable: true + sortable: true, + width:260 }, { prop: 'btmTypeId', label: '涓氬姟绫诲瀷', - sortable: true + sortable: true, + width:200 }, { prop: 'attributeDataType', label: '灞炴�х被鍨�', - sortable: true + sortable: true, + width:150 }, { prop: 'defaultValue', label: '榛樿鍊�', - sortable: true + sortable: true, + width: 200 }, { prop: 'description', @@ -707,7 +724,8 @@ delimiter: '', // 鍒嗛殧绗� versionRule: '0', // 鐗堟鍙疯鍒� lifeCycleId: '', // 鐢熷懡鍛ㄦ湡 - subLifeCycleId: [], // 鐢熷懡鍛ㄦ湡澶囬�夊垪琛�, + subLifeCycleId: '', // 鐢熷懡鍛ㄦ湡澶囬�夊垪琛�, + subLifeCycleIdList:[], apNameArray: "", // 灞炴�ф睜鍒楄〃鈥欙紝鈥樺垎闅� }, nodeRow: {}, @@ -748,6 +766,19 @@ this.getLifeCycle(); }, mounted() { + }, + watch:{ + 'form.lifeCycleId':{ + handler(newval) { + if(this.form.lifeCycleId){ + this.subLifeData = this.allLifeData.filter(item=>{ + return item.id!=this.form.lifeCycleId + }); + }else { + this.subLifeData = this.allLifeData + } + }, + } }, methods: { //鏍戣〃鏌ヨ @@ -790,7 +821,7 @@ //鑾峰彇鐢熷懡鍛ㄦ湡鏁版嵁 getLifeCycle(){ gridLifeCycle().then(res => { - this.lifeData = res.data.data; + this.allLifeData=res.data.data; }); }, // 鍒涘缓鎸夐挳 @@ -801,173 +832,10 @@ } this.title = 'add'; this.form.fName = this.nodeRow.id === 'topNode' ? "" : this.nodeRow.id; + this.lifeData = this.allLifeData; + this.subLifeData = this.allLifeData; this.form.inputRevisionFlag = JSON.parse(this.form.inputRevisionFlag); // 瀛楃涓瞗alse杞崲涓哄竷灏斿�� this.visible = true; - }, - - // 瀵硅瘽妗� 灞炴�ф睜鍒楄〃澧炲姞鎸夐挳 - addDialogClickHandler() { - this.dialogAttrLoading = true; - this.attrPollDialogVisible = true; - this.dialogAttrReload = Math.random(); // 寮哄埗鍒锋柊琛ㄦ牸 瑙e喅琛ㄦ牸閿欒 - this.getAttrDialogDta(); - }, - - // 鏌ヨ灞炴�ф睜鍒楄〃鏁版嵁 - getAttrDialogDta() { - gridAttribute(this.attrPage.currentPage, this.attrPage.pageSize, this.searchAttrParams).then(res => { - const data = res.data.data; - this.dialogAttrSaveData = data; - this.attrPage.total = res.data.total; - this.dialogAttrLoading = false; - }).catch(err => { - this.$message.error(err); - }); - }, - - // 鏂板灞炴�ф睜鍒楄〃鍏抽棴瀵硅瘽妗� - dialogAttrClose() { - this.attrPollDialogVisible = false; - this.searchAttrParams = {}; - }, - - // 娣诲姞灞炴�ф睜琛ㄦ牸閫夋嫨妗� - dialogAttrSelectChange(row) { - this.dialogAttrSelectList = row; - }, - - // 娣诲姞灞炴�ф睜 琛岀偣鍑� - dialogAttrRowClickHandler(row) { - - func.rowClickHandler( - row, - this.$refs.dialogAttrCrud, - this.attrLastIndex, - (newIndex) => { - this.attrLastIndex = newIndex; - }, - () => { - this.selectList = []; - } - ); - }, - - //娣诲姞灞炴�ф睜 鏉℃暟 - attrSizeChange(val) { - this.attrPage.pageSize = val; - this.getAttrDialogDta() - }, - - //娣诲姞灞炴�ф睜 椤电爜 - attrCurrentChange(val) { - this.attrPage.currentPage = val; - this.getAttrDialogDta(); - }, - - //娣诲姞灞炴�ф睜 鎼滅储 - attrHandleSearch(params, done) { - if (func.isEmptyObject(params)) { - this.searchAttrParams = {}; - } else { - this.searchAttrParams = { - "conditionMap[id]": "*" + params.id + "*" - }; - } - - this.getAttrDialogDta(); - done(); - }, - - //娣诲姞灞炴�ф睜 娓呯┖鎼滅储 - attrHandleReset() { - this.searchAttrParams = {}; - this.getAttrDialogDta(); - }, - - // 娣诲姞灞炴�ф睜 淇濆瓨 - dialogAttrAddClickHandler() { - let hasDuplicate = false; - - // 鍏堝垱寤轰竴涓复鏃舵暟缁勬潵瀛樺偍涓嶉噸澶嶇殑椤� - const newItems = []; - - this.dialogAttrSelectList.forEach(item => { - const exists = this.dialogAttrData.some(existingItem => existingItem.id === item.id); - - if (exists) { - hasDuplicate = true; - return; - } - - // 濡傛灉娌℃湁閲嶅椤癸紝鍒欏皢璇ラ」娣诲姞鍒颁复鏃舵暟缁勪腑 - newItems.push({ - id: item.id, - attributeDataType: item.attributeDataType, - defaultValue: item.defaultValue, - description: item.description - }); - }); - - if (hasDuplicate) { - this.$message.error('璇锋鏌ユ槸鍚︽湁娣诲姞閲嶅椤癸紒'); - } else { - // 濡傛灉娌℃湁閲嶅椤癸紝灏嗘柊椤规坊鍔犲埌 dialogAttrData - this.dialogAttrData.push(...newItems); - this.attrPollDialogVisible = false; - } - }, - - // 灞炴�ф睜鍒犻櫎 - dialogBottomAttrDel(form, index) { - this.dialogAttrData.splice(index, 1); - }, - - // 鍙兘杈撳叆鑻辨枃姝e垯鏍¢獙 - validateEnglishOnly(rule, value, callback) { - if (!value) { - return callback(new Error('璇疯緭鍏ョ被鍨嬪悕绉�')); - } - if (!/^[A-Za-z]+$/.test(value)) { - return callback(new Error('鍙兘杈撳叆鑻辨枃瀛楁瘝')); - } - callback(); // 楠岃瘉閫氳繃 - }, - - // 娓呯┖琛ㄥ崟 - resetForm() { - const form = { - id: '', // 绫诲瀷鍚嶇О - name: '', // 鏍囩 - fName: '', // 缁ф壙鑷� - implClass: '', // 瀹炵幇绫� - description: '', // 鎻忚堪 - revLevel: '2', // 鐗堟湰瑙勫垯 - revisionRuleId: '',// 鐗堟湰鍙疯鍒� - inputRevisionFlag: 'false', // 鎵嬪伐杈撳叆 - delimiter: '', // 鍒嗛殧绗� - versionRule: '0', // 鐗堟鍙疯鍒� - lifeCycleId: '', // 鐢熷懡鍛ㄦ湡 - subLifeCycleId: [], // 鐢熷懡鍛ㄦ湡澶囬�夊垪琛�, - lifeCycleIds:'', - apNameArray: "", // 灞炴�ф睜鍒楄〃鈥欙紝鈥樺垎闅� - }; - this.dialogAttrData = []; // 灏嗗睘鎬ф睜琛ㄦ牸缃┖ - this.form = {...form}; - this.$refs.form.clearValidate(); - }, - - // 鏂板缂栬緫瀵硅瘽妗嗗彇娑� - addDialogClose() { - this.resetForm(); - this.visible = false; - }, - - // 鐗堟湰瑙勫垯鍒囨崲 缃┖鍏朵粬鏉′欢 - revLevelChange() { - this.form.inputRevisionFlag = false; - this.form.delimiter = ""; - this.form.versionRule = "0"; - this.form.revisionRuleId = ""; }, // 鏂板缂栬緫淇濆瓨 @@ -976,7 +844,8 @@ this.$message.error('璇锋鏌ョ増鏈彿瑙勫垯涓嶈兘涓虹┖'); return; } - this.form.lifeCycleIds=this.form.subLifeCycleId.join(','); + this.form.lifeCycleIds=this.form.subLifeCycleIdList.join(','); + this.form.subLifeCycleId=this.form.subLifeCycleIdList.join(','); this.form.apNameArray = this.dialogAttrData ? this.dialogAttrData.map(item => item.id).join(',') : ""; this.$refs.form.validate((valid) => { const saveFunction = this.title === 'add' ? addLifeCycle : updateLifeCycle; @@ -1026,9 +895,7 @@ this.form = {...this.nodeRow}; this.form.inputRevisionFlag = JSON.parse(this.form.inputRevisionFlag); // 瀛楃涓瞗alse杞崲涓哄竷灏斿�� // this.form.fName = this.nodeRow.id === 'topNode' ? "" : this.nodeRow.id; - this.form.subLifeCycleId = (this.nodeRow.lifeCycleIds && this.nodeRow.lifeCycleIds.trim()) - ? this.nodeRow.lifeCycleIds.split(',').map(item => ({id: item.trim()})) - : []; + this.form.subLifeCycleIdList = this.nodeRow.lifeCycleIds.split(','); this.dialogAttrData = this.nodeRow.attributes ? JSON.parse(this.nodeRow.attributes) : []; function processChildren(item,fName) { if (item.children && item.children.length > 0) { @@ -1057,6 +924,166 @@ this.visible = true; }, + subLifeChange(data){ + if (data.value.length == 0) { + this.lifeData = this.allLifeData + } else { + this.lifeData = this.allLifeData.filter(item => { + return !data.value.includes(item.id) + }); + } + }, + // 瀵硅瘽妗� 灞炴�ф睜鍒楄〃澧炲姞鎸夐挳 + addDialogClickHandler() { + this.dialogAttrLoading = true; + this.attrPollDialogVisible = true; + this.dialogAttrReload = Math.random(); // 寮哄埗鍒锋柊琛ㄦ牸 瑙e喅琛ㄦ牸閿欒 + this.getAttrDialogDta(); + }, + + // 鏌ヨ灞炴�ф睜鍒楄〃鏁版嵁 + getAttrDialogDta() { + gridAttribute(this.attrPage.currentPage, this.attrPage.pageSize, this.searchAttrParams).then(res => { + const data = res.data.data.map(item=>{ + item.selectable=!this.dialogAttrData.some(existingItem => existingItem.id === item.id); + return item; + }); + this.dialogAttrSaveData=data; + this.attrPage.total = res.data.total; + this.dialogAttrLoading = false; + }).catch(err => { + this.$message.error(err); + }); + }, + + // 鏂板灞炴�ф睜鍒楄〃鍏抽棴瀵硅瘽妗� + dialogAttrClose() { + this.attrPollDialogVisible = false; + this.searchAttrParams = {}; + }, + + // 娣诲姞灞炴�ф睜琛ㄦ牸閫夋嫨妗� + dialogAttrSelectChange(row) { + this.dialogAttrSelectList = row; + }, + + // 娣诲姞灞炴�ф睜 琛岀偣鍑� + dialogAttrRowClickHandler(row) { + if(!row.selectable){ + return; + } + func.rowClickHandler( + row, + this.$refs.dialogAttrCrud, + this.attrLastIndex, + (newIndex) => { + this.attrLastIndex = newIndex; + }, + () => { + this.selectList = []; + } + ); + }, + + //娣诲姞灞炴�ф睜 鏉℃暟 + attrSizeChange(val) { + this.attrPage.pageSize = val; + this.getAttrDialogDta() + }, + + //娣诲姞灞炴�ф睜 椤电爜 + attrCurrentChange(val) { + this.attrPage.currentPage = val; + this.getAttrDialogDta(); + }, + + //娣诲姞灞炴�ф睜 鎼滅储 + attrHandleSearch(params, done) { + if (func.isEmptyObject(params)) { + this.searchAttrParams = {}; + } else { + this.searchAttrParams = { + "conditionMap[id]": "*" + params.id + "*" + }; + } + + this.getAttrDialogDta(); + done(); + }, + + //娣诲姞灞炴�ф睜 娓呯┖鎼滅储 + attrHandleReset() { + this.searchAttrParams = {}; + this.getAttrDialogDta(); + }, + + // 娣诲姞灞炴�ф睜 淇濆瓨 + dialogAttrAddClickHandler() { + this.dialogAttrSelectList.forEach(item => { + this.dialogAttrData.push({ + id: item.id, + attributeDataType: item.attributeDataType, + defaultValue: item.defaultValue, + description: item.description + }); + }); + this.attrPollDialogVisible = false; + }, + + // 灞炴�ф睜鍒犻櫎 + dialogBottomAttrDel(form, index) { + this.dialogAttrData.splice(index, 1); + }, + + // 鍙兘杈撳叆鑻辨枃姝e垯鏍¢獙 + validateEnglishOnly(rule, value, callback) { + if (!value) { + return callback(new Error('璇疯緭鍏ョ被鍨嬪悕绉�')); + } + if (!/^[A-Za-z]+$/.test(value)) { + return callback(new Error('鍙兘杈撳叆鑻辨枃瀛楁瘝')); + } + callback(); // 楠岃瘉閫氳繃 + }, + + // 娓呯┖琛ㄥ崟 + resetForm() { + const form = { + id: '', // 绫诲瀷鍚嶇О + name: '', // 鏍囩 + fName: '', // 缁ф壙鑷� + implClass: '', // 瀹炵幇绫� + description: '', // 鎻忚堪 + revLevel: '2', // 鐗堟湰瑙勫垯 + revisionRuleId: '',// 鐗堟湰鍙疯鍒� + inputRevisionFlag: 'false', // 鎵嬪伐杈撳叆 + delimiter: '', // 鍒嗛殧绗� + versionRule: '0', // 鐗堟鍙疯鍒� + lifeCycleId: '', // 鐢熷懡鍛ㄦ湡 + subLifeCycleId: '', // 鐢熷懡鍛ㄦ湡澶囬�夊垪琛�, + subLifeCycleIdList:[], + lifeCycleIds:'', + apNameArray: "", // 灞炴�ф睜鍒楄〃鈥欙紝鈥樺垎闅� + }; + this.dialogAttrData = []; // 灏嗗睘鎬ф睜琛ㄦ牸缃┖ + this.form = {...form}; + this.$refs.form.clearValidate(); + }, + + // 鏂板缂栬緫瀵硅瘽妗嗗彇娑� + addDialogClose() { + this.resetForm(); + this.visible = false; + }, + + // 鐗堟湰瑙勫垯鍒囨崲 缃┖鍏朵粬鏉′欢 + revLevelChange() { + this.form.inputRevisionFlag = false; + this.form.delimiter = ""; + this.form.versionRule = "0"; + this.form.revisionRuleId = ""; + }, + // 鍒犻櫎鎸夐挳 deleteClickHandler() { if (func.isEmptyObject(this.nodeRow)) { -- Gitblit v1.9.3