From 48eac8e527776b318298b11b7651216ec68bdab1 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期五, 04 八月 2023 16:19:26 +0800 Subject: [PATCH] 主题库克隆模板改动 --- Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue | 58 ++++++++++++++++++++++++++++++++++------------------------ 1 files changed, 34 insertions(+), 24 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue index 1496c26..9738222 100644 --- a/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue +++ b/Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue @@ -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%" @@ -1361,6 +1361,13 @@ }); }) }, + //鍏嬮殕鍙栨秷 + cloneClose(){ + this.$refs.cloneTree.setCurrentKey(null) + this.ClonenodeClickList = {} + this.CloneFormlist=[] + this.CloneVisible=false; + }, //鍏嬮殕妯℃澘鏌ヨ CloneEnterFind(){ gridCodeClassifyTemplate().then(res => { @@ -1409,29 +1416,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