From db860f9c08a23fe916121a2c76001e05d2acee3e Mon Sep 17 00:00:00 2001 From: wangting <675591594@qq.com> Date: 星期一, 07 八月 2023 15:17:16 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue | 177 +++++++++++++++++++++++++++++++--------------------------- 1 files changed, 95 insertions(+), 82 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue index 54d9a47..2868e1a 100644 --- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue +++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue @@ -26,7 +26,7 @@ <!-- 鏍戣妭鐐规坊鍔犲璇濇--> <el-dialog :title="this.TreeFlag ? '娣诲姞鍒嗙被' :'娣诲姞涓婚搴�'" :before-close="TreeEscHandler" :visible.sync="TreeAddFormVisible" v-loading="AddLoading" append-to-body style="width: 1700px;margin: auto"> - <el-form :model="TreeAddform" :rules="rules"> + <el-form ref="myForm" :model="TreeAddform" :rules="rules"> <el-form-item :label="this.TreeFlag ? '鍒嗙被缂栧彿锛�' :'涓婚搴撶紪鍙凤細'" label-width="150px" style="display: inline-block" prop="id"> <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input> </el-form-item> @@ -121,12 +121,12 @@ </div> </el-dialog> <!-- 妯℃澘鍏嬮殕 --> - <el-dialog :visible.sync="CloneVisible" append-to-body title="鍏嬮殕妯℃澘"> + <el-dialog :visible.sync="CloneVisible" append-to-body title="鍏嬮殕妯℃澘" :before-close="cloneClose"> <el-container> <el-aside width="300px"> <div style="margin-bottom: 5px"><el-tag>涓婚搴撳垎绫�</el-tag></div> <!-- 鍏嬮殕妯℃澘鐨勬爲 娌跨敤棣栭〉鏍戠殑loading鍜宱ption锛屼絾鏄痙ata鍜寁-model缁戝畾鐨勬暟鎹垱寤轰竴涓柊鐨勫彉閲忥紝鍙﹀鐐瑰嚮鏂规硶涔熸槸閲嶆柊鑾峰彇鏉ユ搷浣滃厠闅嗘ā鏉跨殑鏁版嵁--> - <avue-tree v-model="TreeAvueform" v-loading="loading" :data="Treedata" + <avue-tree ref="cloneTree" v-model="TreeAvueform" v-loading="loading" :data="Treedata" :defaultExpandAll="false" :option="Treeoption" style="height: 50.5vh;margin-right: 10px" @@ -160,7 +160,7 @@ </el-container > <div style="display: flex; justify-content: flex-end; align-items: center;margin-top: 10px" > <el-button size="small " type="primary" @click="Clonehandler">纭畾</el-button> - <el-button size="small" @click="CloneVisible=false" >鍙栨秷</el-button> + <el-button size="small" @click="cloneClose" >鍙栨秷</el-button> </div> <el-dialog width="30%" @@ -231,7 +231,11 @@ <el-input style="width: 260px;margin-left: 15px" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" v-model="SelectFInd"></el-input> <el-button size="small" type="primary" plain @click="SelectFindeHandler" style="margin-left: 20px">鏌ヨ</el-button> </template> - <avue-crud :data="masterData" :option="masterOption" @select="masterSelect"></avue-crud> + <avue-crud :data="masterData" :option="masterOption" @row-click="masterSelect"> + <template slot="radio" slot-scope="{row}"> + <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio> + </template> + </avue-crud> <div style="height: 30px"> <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >宸茶缃殑鍊间负:[{{this.TreeAddform.coderuleoidName ==''?'鏈缃��':this.TreeAddform.coderuleoidName}}]</div> <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" > @@ -255,7 +259,11 @@ <el-input style="width: 260px;margin-left: 15px" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" v-model="SelectFInd"></el-input> <el-button size="small" type="primary" plain @click="KeySelectFindeHandler" style="margin-left: 20px">鏌ヨ</el-button> </template> - <avue-crud :data="KeyData" :option="masterOption" @select="KeySelect"></avue-crud> + <avue-crud :data="KeyData" :option="masterOption" @row-click="KeySelect"> + <template slot="radio" slot-scope="{row}"> + <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio> + </template> + </avue-crud> <div style="height: 30px"> <div style="display: inline-block;float: left;border: 1px solid #eeeeee;padding: 5px;margin-top: 5px;font-size: 14px " >宸茶缃殑鍊间负:[{{this.TreeAddform.codeKeyAttrRepeatOidName ==''?'鏈缃��':this.TreeAddform.codekeyattrrepeatoidName}}]</div> <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" > @@ -279,7 +287,11 @@ <el-input style="width: 260px;margin-left: 15px" placeholder="杈撳叆鍊煎悗杩涜妯$硦鏌ヨ" v-model="SelectFInd"></el-input> <el-button size="small" type="primary" plain @click="SimSelectFindeHandler" style="margin-left: 20px">鏌ヨ</el-button> </template> - <avue-crud :data="simData" :option="masterOption" @select="simSelect"></avue-crud> + <avue-crud :data="simData" :option="masterOption" @row-click="simSelect"> + <template slot="radio" slot-scope="{row}"> + <el-radio v-model="masterRow" :label="row.$index" style="padding-left: 10px !important;">{{''}}</el-radio> + </template> + </avue-crud> <div style="height: 30px"> <div style="display: inline-block;float: left;border: 1px solid #eee;padding: 5px;margin-top: 5px;font-size: 14px " >宸茶缃殑鍊间负:[{{this.TreeAddform.codeResembleRuleOidName ==''?'鏈缃��':this.TreeAddform.codeResembleRuleOidName}}]</div> <div style="padding-top: 10px;display: flex; justify-content: flex-end;float: right;overflow: hidden" > @@ -427,7 +439,7 @@ label: '鑻辨枃鍚嶇О' } ], - SelectValue:"", + SelectValue:"id", SelectFInd:"", addFlag:false, // 琛ㄦ牸褰撳墠琛宨d @@ -672,11 +684,7 @@ } }, watch:{ - TreeFlagCode:{ - handler(newval,oldval){ - console.log('TreeFlagCode',newval) - } - } + }, //tab鏍忛粯璁ゆ槸琛ㄦ牸 mounted() { @@ -753,6 +761,8 @@ }, methods: { + // 鍏抽棴寮圭獥 + /** 瀵煎叆 */ ImportExcel(){ this.ThemeImportVisible=true; @@ -774,11 +784,11 @@ }, //缂栫爜澶氶�� masterSelect(row){ - if(row.length>0){ + this.masterRow=row.$index; this.masterSelectList=row; - this.masterName=row[0].name; - this.masterOid=row[0].oid; - } + this.masterName=row.name; + this.masterOid=row.oid; + }, //缂栫爜瑙勫垯鏌ヨ SelectFindeHandler(){ @@ -787,15 +797,11 @@ 'conditionMap[id]':this.SelectFInd } this.MasterdefaultRend(masterParameter); - this.SelectValue="" - this.SelectFInd="" }else if(this.SelectValue == 'name'){ const masterParameter={ 'conditionMap[name]':this.SelectFInd } this.MasterdefaultRend(masterParameter) - this.SelectValue="" - this.SelectFInd="" } }, //缂栫爜瑙勫垯纭畾 @@ -846,15 +852,11 @@ 'conditionMap[id]':this.SelectFInd } this.KeydefaultRend(masterParameter); - this.SelectValue=""; - this.SelectFInd=""; }else if(this.SelectValue == 'name'){ const masterParameter={ 'conditionMap[name]':this.SelectFInd } this.KeydefaultRend(masterParameter) - this.SelectValue="" - this.SelectFInd="" } }, //鍏抽敭灞炴�ф帴鍙� @@ -869,9 +871,10 @@ }, // 鍏抽敭澶氶�� KeySelect(row){ + this.masterRow=row.$index; this.KeySelectLIst=row; - this.KeyName=row[0].name; - this.KeyOid=row[0].oid; + this.KeyName=row.name; + this.KeyOid=row.oid; }, //鍏抽敭澶辩劍 simFouce(){ @@ -899,22 +902,19 @@ 'conditionMap[id]':this.SelectFInd } this.simdefaultRend(masterParameter); - this.SelectValue="" - this.SelectFInd="" }else if(this.SelectValue == 'name'){ const masterParameter={ 'conditionMap[name]':this.SelectFInd } this.simdefaultRend(masterParameter) - this.SelectValue="" - this.SelectFInd="" } }, // 鐩镐技椤瑰閫� simSelect(row){ + this.masterRow=row.$index; this.simSelectList=row; - this.simName=row[0].name; - this.simOid=row[0].oid; + this.simName=row.name; + this.simOid=row.oid; }, //鐩镐技椤归」鎺ュ彛 simdefaultRend(){ @@ -952,15 +952,11 @@ 'conditionMap[id]':this.SelectFInd } this.btmdefaultRend(masterParameter); - this.SelectValue="" - this.SelectFInd="" }else if(this.SelectValue == 'name'){ const masterParameter={ 'conditionMap[name]':this.SelectFInd } this.btmdefaultRend(masterParameter); - this.SelectValue=""; - this.SelectFInd=""; } }, //涓氬姟绫诲瀷澶氶�� @@ -1045,34 +1041,40 @@ //鏍戣妭鐐瑰彇娑堜簨浠� TreeEscHandler(){ this.TreeAddform={}; - this.TreeAddFormVisible=false + this.TreeAddFormVisible=false; + // 鍏抽棴寮圭獥娓呯┖鏍¢獙 + this.$refs.myForm.clearValidate(); }, //鏍戣妭鐐规坊鍔犱簨浠� TreeAddHandler() { - const data = this.TreeAddform; - // data.btmtypename= this.TreeList.btmtypename - this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid); - TreeSave(data) - .then(() => { - this.$message({ - type: "success", - message: "娣诲姞鎴愬姛!", + if ((!this.TreeAddform.id || !this.TreeAddform.name) || (this.TreeFlagCode && !this.TreeAddform.btmTypeName)) { + this.$message.warning('璇疯緭鍏ュ唴瀹癸紒'); + }else { + const data = this.TreeAddform; + // data.btmtypename= this.TreeList.btmtypename + this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid); + TreeSave(data) + .then(() => { + this.$message({ + type: "success", + message: "娣诲姞鎴愬姛!", + }); + Object.keys(this.TreeAddform).forEach(key => { + this.TreeAddform[key] = ""; + }); + this.getAttr(); + this.TreeAddFormVisible = false; + //娣诲姞瀹屾垚鍚庡彸渚ф竻绌� + this.ProData=[]; + this.Formlist=[]; + }) + .catch((res) => { + this.$message({ + type: "warning", + message: res, + }); }); - Object.keys(this.TreeAddform).forEach(key => { - this.TreeAddform[key] = ""; - }); - this.getAttr(); - this.TreeAddFormVisible = false; - //娣诲姞瀹屾垚鍚庡彸渚ф竻绌� - this.ProData=[]; - this.Formlist=[]; - }) - .catch((res) => { - this.$message({ - type: "warning", - message: res, - }); - }); + } }, //鏍戣妭鐐瑰垹闄ゆ寜閽� TreeDel() { @@ -1226,6 +1228,7 @@ this.editTreeFLagCode = !data.parentId; this.nodeClickList = data; this.selectRow = 0; + this.crudArray=[] try { this.requestCount += 1; const [res1, res2, res3] = await Promise.all([ @@ -1378,6 +1381,13 @@ }); }) }, + //鍏嬮殕鍙栨秷 + cloneClose(){ + this.$refs.cloneTree.setCurrentKey(null) + this.ClonenodeClickList = {} + this.CloneFormlist=[] + this.CloneVisible=false; + }, //鍏嬮殕妯℃澘鏌ヨ CloneEnterFind(){ gridCodeClassifyTemplate().then(res => { @@ -1426,29 +1436,32 @@ } }, //鍏嬮殕妯℃澘鍗曢�夋鏀瑰彉 - selectionChange(row){ - this.CloneSelect=row; - //鍙屽悜缁戝畾锛屾彁浜よ〃鍗曡緭鍏ユ鍥炲~涓婂綋鍓嶉�夋嫨鐨勬暟鎹� - this.CloneModel.id=row[0].id; - this.CloneModel.name=row[0].name; - //杩欓噷鏈夌偣缁曪紝CloneSelect鏄垜閫夋嫨妗嗛�夋嫨鐨勬暟鎹�傜瓑浜巘his.nodeClickList.oid鏄洜涓猴紝鍏嬮殕妯℃澘浼犻�掓暟鎹鎶婂綋鍓嶉�夋嫨鏍戠殑oid浼犻�掔粰鍚庣銆傝�屼笉鏄綋鍓嶈鍏嬮殕妯℃澘鐨刼id - this.CloneSelect[0].codeclassifyoid=this.nodeClickList.oid + selectionChange(row) { + this.CloneSelect = row; + const { id, name } = row[0]; + this.CloneModel = { id, name }; + this.CloneSelect[0].codeclassifyoid = this.nodeClickList.oid; + console.log('row',row) + console.log('CloneSelect',this.CloneSelect) + console.log('CloneModel',this.CloneModel) }, //鍏嬮殕琛ㄥ崟鎻愪氦 - Clonesubmit(row,done){ - //閲嶆柊璧嬪�糃loneSelect浼犻�掔殑鏁版嵁涓鸿緭鍏ユ鍙互淇敼鐨勬暟鎹紝CloneModel鎻愪氦琛ㄥ崟杈撳叆妗嗗弻鍚戠粦瀹氭暟鎹� - this.CloneSelect[0].id=this.CloneModel.id; - this.CloneSelect[0].name=this.CloneModel.name; - copy(this.CloneSelect[0]).then(()=>{ - //鍥犱负鏄祵濂楀脊绐楁墍浠ユ墜鍔ㄥ叧闂瑿loneinnerVisible锛孋loneVisible涓や釜寮圭獥銆� - this.CloneinnerVisible=false - this.CloneVisible=false - this.$message.success("澶嶅埗鎴愬姛") - this.CrudRend() - done(row) - }).catch(res=>{ - done(res) - }) + Clonesubmit(row, done) { + // 閲嶆柊璧嬪�糃loneSelect浼犻�掔殑鏁版嵁涓鸿緭鍏ユ鍙互淇敼鐨勬暟鎹紝CloneModel鎻愪氦琛ㄥ崟杈撳叆妗嗗弻鍚戠粦瀹氭暟鎹� + Object.assign(this.CloneSelect[0], this.CloneModel); + // CloneSelect鏁扮粍绗竴椤� 鍖归厤CloneModel瀵硅薄 + copy(this.CloneSelect[0]) + .then(() => { + // 鍥犱负鏄祵濂楀脊绐楁墍浠ユ墜鍔ㄥ叧闂瑿loneinnerVisible锛孋loneVisible涓や釜寮圭獥銆� + this.CloneinnerVisible = false; + this.CloneVisible = false; + this.$message.success("澶嶅埗鎴愬姛"); + this.TemRefresh(); + done(row); + }) + .catch((error) => { + done(error); + }); }, //鍒锋柊 TemRefresh() { -- Gitblit v1.9.3