From e9f139bd71644a2cffdfbff44c12915a5780e56a Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期三, 05 七月 2023 19:35:28 +0800 Subject: [PATCH] 主题库定义bug --- Source/UBCS-WEB/src/components/Tree/classifyTreeform.vue | 322 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 309 insertions(+), 13 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Tree/classifyTreeform.vue b/Source/UBCS-WEB/src/components/Tree/classifyTreeform.vue index 90996f3..593fc18 100644 --- a/Source/UBCS-WEB/src/components/Tree/classifyTreeform.vue +++ b/Source/UBCS-WEB/src/components/Tree/classifyTreeform.vue @@ -1,25 +1,122 @@ <template> - <avue-form v-model="TreeNewForm" :option="option" @submit="submit"> - </avue-form> + <div> + <avue-form v-model="loneTreeNewForm" :option="option" v-if="flag == 'renonly'"> + </avue-form> + <avue-form v-model="loneTreeNewForm" :option="options" @submit="submits" v-else-if="flag == 'edit'"> + </avue-form> + <div> +<!-- 瀛樺偍涓氬姟绫诲瀷--> + <el-dialog :visible.sync="BtmdialogVisible" title="涓恒�愬瓨鍌ㄤ笟鍔$被鍨嬨�戦�夊彇鍊�" append-to-body> + <avue-crud :data="BtmData" :option="btmOption" @select="btmSelect"></avue-crud> + <div style="padding-top: 10px;display: flex; justify-content: flex-end" > + <el-button type="primary" size="small" @click="MasterHandlerClick">纭畾</el-button> + <el-button size="small" @click="MasterdialogVisible=false">鍙栨秷</el-button> + </div> + </el-dialog> +<!-- 鍏抽敭灞炴�ф煡璇㈣鍒�--> + <el-dialog :visible.sync="KeydialogVisible" title="涓恒�愬叧閿睘鎬ф煡璇㈣鍒欍�戦�夊彇鍊�" append-to-body> + <avue-crud :data="KeyData" :option="masterOption" @select="KeySelect"></avue-crud> + <div style="padding-top: 10px;display: flex; justify-content: flex-end" > + <el-button type="primary" size="small" @click="KeyHandlerClick">纭畾</el-button> + <el-button size="small" @click="KeydialogVisible=false">鍙栨秷</el-button> + </div> + </el-dialog> + <!-- 鐩镐技椤规煡璇㈣鍒�--> + <el-dialog :visible.sync="SimidialogVisible" title="涓恒�愮浉浼奸」鏌ヨ瑙勫垯銆戦�夊彇鍊�" append-to-body> + <avue-crud :data="simData" :option="masterOption" @select="simSelect"></avue-crud> + <div style="padding-top: 10px;display: flex; justify-content: flex-end" > + <el-button type="primary" size="small" @click="simHandlerClick">纭畾</el-button> + <el-button size="small" @click="SimidialogVisible=false">鍙栨秷</el-button> + </div> + </el-dialog> + </div> + </div> </template> <script> +import {defaultReferDataGrid,referDataGrid} from '@/api/MasterData/master' +import {TreeEditSave} from '@/api/template/templateAttr' export default { name: "classifyTreeform.vue", - props: ["TreeNewForm"], + props: ['loneTreeNewForm','flag','Editclose'], data() { return { + masterName:"", + masterOid:"", + KeyName:"", + KeyOid:"", + simName:"", + simOid:"", + btmName:"", + btmOid:"", + masterInput:'', + MasterSearchSelects:"", + masterData:[], + KeyData:[], + simData:[], + BtmData:[], + btmOption:{ + addBtn:false, + index:true, + border:true, + selection:true, + menu:false, + height:380, + column:[ + { + label:'涓氬姟绫诲瀷缂栧彿', + prop:'id' + }, + { + label:'涓氬姟绫诲瀷鍚嶇О', + prop:'name' + }, + { + label:'鎻忚堪', + prop:'description' + } + ] + }, + masterOption:{ + addBtn:false, + index:true, + border:true, + selection:true, + menu:false, + height:380, + column:[ + { + label:'鑻辨枃鍚嶇О', + prop:'id' + }, + { + label:'涓枃鍚嶇О', + prop:'name' + }, + { + label:'鎻忚堪', + prop:'description' + } + ] + }, + MasterdialogVisible:false, + KeydialogVisible:false, + SimidialogVisible:false, + BtmdialogVisible:false, form: { name: "鍝堝搱", sex: "鐢�" }, option: { + submitBtn:false, + emptyBtn:false, + column: [ { label: '涓婚搴�/鍒嗙被缂栧彿', prop: 'btmtypeid', - labelWidth:128, + labelWidth:135, readonly: true, rules: [{ required: true, @@ -31,7 +128,7 @@ label: '涓婚搴�/鍒嗙被鍚嶇О', prop: 'name', readonly: true, - labelWidth:128, + labelWidth:135, rules: [{ required: true, message: "涓婚搴�/鍒嗙被鍚嶇О", @@ -40,7 +137,9 @@ }, { label:"鎻忚堪", - prop:"description" + prop:"description", + labelWidth:128, + readonly: true, }, { label: '瀛樺偍鐨勪笟鍔$被鍨�', @@ -55,31 +154,228 @@ }, { label:"缂栫爜瑙勫垯", - prop:"coderuleoidName" + prop:"coderuleoidName", + labelWidth:128, + readonly: true, }, { - label:"蹇界暐澶у皬鍐欐煡閲�", + label:"鍏抽敭灞炴�ф煡璇㈣鍒�", prop:"codekeyattrrepeatoidName", labelWidth:128, + readonly: true, }, { label:"鐩镐技鏌ヨ瑙勫垯", prop:"codeResembleRuleOidName", - labelWidth:100, + labelWidth:128, + readonly: true, }, ] }, - FormList: {} + options: { + column: [ + { + label: '涓婚搴�/鍒嗙被缂栧彿', + prop: 'btmtypeid', + labelWidth:128, + rules: [{ + required: true, + message: "涓婚搴�/鍒嗙被缂栧彿", + trigger: "blur" + }] + }, + { + label: '涓婚搴�/鍒嗙被鍚嶇О', + prop: 'name', + labelWidth:128, + rules: [{ + required: true, + message: "涓婚搴�/鍒嗙被鍚嶇О", + trigger: "blur" + }] + }, + { + label:"鎻忚堪", + prop:"description", + labelWidth:128, + }, + { + label: '瀛樺偍鐨勪笟鍔$被鍨�', + prop: 'btmtypename', + labelWidth:128, + focus:this.btmFoucus, + rules: [{ + required: true, + message: "瀛樺偍鐨勪笟鍔$被鍨�", + trigger: "blur" + }] + }, + { + label:"缂栫爜瑙勫垯", + prop:"coderuleoidName", + labelWidth:128, + focus:this.CodeFoucus + }, + { + label:"鍏抽敭灞炴�ф煡璇㈣鍒�", + prop:"codekeyattrrepeatoidName", + labelWidth:128, + focus:this.Keyfouce + }, + { + label:"鐩镐技鏌ヨ瑙勫垯", + prop:"codeResembleRuleOidName", + labelWidth:128, + focus: this.simFouce + }, + + ] + }, + FormList: {}, + masterSelectList:[], + KeySelectLIst:[], + simSelectList:[], + btmSelectList:[] } }, + created() { + }, methods: { - submit(form, done) { - this.$message.success(JSON.stringify(form)); - done() + submits(form,done){ + TreeEditSave(this.loneTreeNewForm).then(res=>{ + this.$message.success('淇敼鎴愬姛'); + this.Editclose() + done() + }) }, error(err) { this.$message.success('璇锋煡鐪嬫帶鍒跺彴'); console.log(err) + }, + //缂栫爜瑙勫垯澶辩劍 + CodeFoucus(){ + this.MasterdialogVisible=true; + this.MasterdefaultRend() + }, + //缂栫爜瑙勫垯纭畾 + MasterHandlerClick(){ + if(this.masterSelectList.length>1){ + this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹�') + }else if(this.masterSelectList.length<=0){ + this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�') + }else { + this.MasterdialogVisible=false; + this.masterSelectList=[] + this.$set(this.loneTreeNewForm,'coderuleoidName',this.masterName) + this.$set(this.loneTreeNewForm,'coderuleOid',this.masterOid) + this.$emit('MasterHandler',this.loneTreeNewForm) + console.log(this.loneTreeNewForm) + } + }, + //缂栫爜澶氶�� + masterSelect(row){ + this.masterSelectList=row; + this.masterName=row[0].name; + this.masterOid=row[0].oid; + console.log('oid',this.oid) + }, + //缂栫爜鎺ュ彛 + MasterdefaultRend(){ + defaultReferDataGrid({ + referType:'coderule', + isMuti:'false', + 'conditionMap["lcstatus"]':'Released' + }).then(res=>{ + this.masterData=res.data.records; + }) + }, + // 鍏抽敭灞炴�уけ鐒� + Keyfouce(){ + this.KeydialogVisible=true; + this.KeydefaultRend() + }, + //鍏抽敭灞炴�х‘瀹� + KeyHandlerClick(){ + if(this.KeySelectLIst.length>1){ + this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹�') + }else if(this.KeySelectLIst.length<=0){ + this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�') + }else { + this.KeydialogVisible=false; + this.KeySelectLIst=[] + this.$set(this.loneTreeNewForm,'codeResembleRuleOidName',this.simName) + this.$set(this.loneTreeNewForm,'codeResembleRuleOid',this.simOid) + this.$emit('MasterHandler',this.loneTreeNewForm) + } + }, + //鍏抽敭灞炴�ф帴鍙� + KeydefaultRend(){ + defaultReferDataGrid({ + referType:'codekeyattrrepeat', + isMuti:'false', + 'conditionMap["lcstatus"]':'Enabled' + }).then(res=>{ + this.KeyData=res.data.records; + }) + }, + // 鍏抽敭澶氶�� + KeySelect(row){ + this.KeySelectLIst=row; + this.KeyName=row[0].name; + this.KeyOid=row[0].oid; + }, + // 鐩镐技椤瑰け鐒� + simFouce(){ + this.SimidialogVisible=true; + this.simdefaultRend() + }, + //鐩镐技椤圭‘瀹� + simHandlerClick(){ + if(this.simSelectList.length>1){ + this.$message.warning('鍙兘閫夋嫨涓�鏉℃暟鎹�') + }else if(this.simSelectList.length<=0){ + this.$message.warning('璇烽�夋嫨涓�鏉℃暟鎹�') + }else { + this.SimidialogVisible=false; + this.simSelectList=[] + this.$set(this.loneTreeNewForm,'codeResembleRuleOidName',this.simName) + this.$set(this.loneTreeNewForm,'codeResembleRuleOid',this.simOid) + this.$emit('MasterHandler',this.loneTreeNewForm) + } + }, + // 鐩镐技椤瑰閫� + simSelect(row){ + this.simSelectList=row; + this.simName=row[0].name; + this.simOid=row[0].oid; + console.log('oid',this.oid) + }, + //鐩镐技椤归」鎺ュ彛 + simdefaultRend(){ + defaultReferDataGrid({ + referType:'coderesemblerule', + isMuti:'false', + 'conditionMap["lcstatus"]':'Enabled' + }).then(res=>{ + this.simData=res.data.records; + }) + }, + //涓氬姟绫诲瀷澶辩劍 + btmFoucus(){ + this.BtmdialogVisible=true; + this.btmdefaultRend() + }, + // 涓氬姟绫诲瀷澶氶�� + btmSelect(row){ + this.btmSelectList=row; + this.btmName=row[0].name; + this.btmOid=row[0].oid; + }, + //涓氬姟绫诲瀷鎺ュ彛 + btmdefaultRend(){ + referDataGrid({valueField:'id',isMuti:'false'}).then(res=>{ + console.log(res) + }) } } } -- Gitblit v1.9.3