From fe35627e29ba5604e8c7fb3af3c8e82becd7c144 Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期三, 06 十二月 2023 10:48:00 +0800 Subject: [PATCH] 主数据表格loading加载优化 --- Source/UBCS-WEB/src/components/Master/MasterTree.vue | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Source/UBCS-WEB/src/components/Master/MasterTree.vue b/Source/UBCS-WEB/src/components/Master/MasterTree.vue index 7eb9ae4..4957ea4 100644 --- a/Source/UBCS-WEB/src/components/Master/MasterTree.vue +++ b/Source/UBCS-WEB/src/components/Master/MasterTree.vue @@ -1,12 +1,14 @@ <template> - <div class="app" style="display: flex;"> + <div class="app" style="position: relative;"> <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="Treedata" :defaultExpandAll="false" :option="Treeoption" style="width: fit-content;" @node-click="nodeClick"> <template slot-scope="{ node }"> <span v-html="node.label"></span> </template> </avue-tree> - <div style="display: inline-block;"><el-link icon="el-icon-refresh" class="refresh-icon" @click="getTreeLists"></el-link></div> + <div style="position: absolute; right: 0px; top: -1px;"> + <el-link class="refresh-icon" icon="el-icon-refresh" @click="getTreeLists"></el-link> + </div> </div> </template> @@ -34,6 +36,7 @@ return { TreeValue: '', idData: '', + referTreeId: '', masterVrBtnList: [], tableHeadFindData: [], tableHeadDataFateher: [], @@ -56,11 +59,15 @@ // console.log(node) // console.log(resolve) // } - treeLoad: function (node, resolve) { + treeLoad: (node, resolve) => { if (node.data != false) { const parentId = (node.level === 0) ? 0 : node.data.oid; - const parentBtmName = node.data.attributes.btmname - getTreeList({parentOid: parentId, parentBtmName: parentBtmName}).then(res => { + const parentBtmName = node.data.attributes.btmname; + getTreeList({ + parentOid: parentId, + parentBtmName: parentBtmName, + 'conditionMap[btmTypeId]': this.referTreeId + }).then(res => { resolve(res.data.map(item => { return { ...item, @@ -103,8 +110,11 @@ this.$message.error("涓绘暟鎹垎绫绘煡璇负绌猴紒"); } else { this.Treedata = res.data; + const [firstProperty] = res.data; this.ModifyProperties(this.Treedata, 'text', 'label'); + this.referTreeId = firstProperty.attributes.btmTypeId; + // console.log(this.referTreeId) this.codeClassifyOid = firstProperty.oid; this.coderuleoid = firstProperty.attributes.coderuleoid; this.$emit("coderuleoid", this.coderuleoid) @@ -137,12 +147,16 @@ }, //琛ㄦ牸鍒锋柊 TableRend() { + this.loading = true; + this.$emit('loading', this.loading) TableData({ templateOid: this.templateOids, codeClassifyOid: this.nodeClickList.oid, page: this.currentPage, limit: this.pageSize, }).then(res => { + this.loading = false; + this.$emit('loading', this.loading) this.tableDataArray = res.data.data; this.$emit('tableDataArray', this.tableDataArray) this.$emit('total', res.data.total) @@ -199,8 +213,9 @@ this.tableHeadFindData = [] await this.TableHeadRend(); // 鍏堟墽琛� TableHeadRend() this.TableRend(); // TableHeadRend() 鏂规硶瀹屾垚鍚庡啀鎵ц TableRend() - this.$emit('nodeClick', this.templateOids) + this.$emit('nodeClickTemplateOids', this.templateOids) this.$emit("codeClassifyOid", this.nodeClickList.oid) + this.$emit("nodeClickList", this.nodeClickList) } catch (error) { // 澶勭悊閿欒 this.$message.error(error) -- Gitblit v1.9.3