From e1beaf409dca5c236dd42bc9f3f3619eeb3e5ae2 Mon Sep 17 00:00:00 2001
From: ludc
Date: 星期一, 17 七月 2023 14:23:22 +0800
Subject: [PATCH] 代码整合
---
Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue | 40 ++++++++++++++++++++++++----------------
1 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue b/Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue
index f797efb..e888918 100644
--- a/Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue
+++ b/Source/UBCS-WEB/src/components/BatchImport/ShowImportData.vue
@@ -57,11 +57,12 @@
border
:data="tab1Table"
style="width: 100%"
- height="400px"
+ height="40vh"
highlight-current-row
@current-change="resembleRowChange"
@selection-change="tab1TableSelectChange"
v-if="cloNamesList.length > 1"
+ v-loading="tab1Loading"
>
<el-table-column
v-if="type !== 'batchApplyCode'"
@@ -103,7 +104,8 @@
border
:data="currentSelectedResemble"
style="width: 100%"
- height="200px"
+ height="20vh"
+ v-loading="tab1BottomTableLoading"
>
<el-table-column
v-for="item in resembleColumList"
@@ -138,12 +140,9 @@
<el-tab-pane :label="tab2Name" name="tab2">
<el-table
border
+ v-loading="tab2Loading"
:data="tab2Table"
- :height="
- type === 'batchApplyCode' && tab2Table.length > 0
- ? '400px'
- : '700px'
- "
+ height="60vh"
>
<el-table-column
v-for="item in successTableColumns"
@@ -179,7 +178,7 @@
</div>
<template #footer>
<div>
- <el-button size="small" type="primary" @click="submit"
+ <el-button size="small" type="primary" @click="submit" :loading="submitLoading"
>纭畾瀵煎叆</el-button
>
<el-button size="small" @click="dialogVisible = false">鍙栨秷</el-button>
@@ -284,6 +283,10 @@
},
batchApplyCodeTableData: {},
savedList: [],
+ tab1Loading: false,
+ tab2Loading: false,
+ tab1BottomTableLoading: false,
+ submitLoading: false
};
},
@@ -302,10 +305,7 @@
},
async treeNodeClick(data, first) {
if (this.type === "batchApplyCode") {
- if (
- first === true ||
- this.localCodeClassifyOid === data.codeClassifyOid
- ) {
+ if (first === true) {
this.codeRuleOid = data.codeRuleOid;
// 绗竴娆℃墦寮�鐩存帴璧嬪�间笉鏍¢獙
this.batchApplyCodeTableData[data.codeRuleOid] = {
@@ -316,6 +316,8 @@
codeRuleOid: data.codeRuleOid,
};
// 涓嶆槸绗竴娆℃墦寮�闇�瑕佷紭鍏堟牎楠�
+ } else if (this.localCodeClassifyOid === data.codeClassifyOid) {
+ console.log("閲嶅鐐瑰嚮");
} else {
if (this.$refs.CodeApply) {
if (!(await this.$refs.CodeApply.validate())) {
@@ -326,7 +328,6 @@
}
}
}
- // 绗竴娆℃墦寮�鐩存帴璧嬪�间笉鏍¢獙
if (!this.batchApplyCodeTableData[data.codeRuleOid]) {
this.batchApplyCodeTableData[data.codeRuleOid] = {
name: data.name,
@@ -340,11 +341,13 @@
this.localCodeClassifyOid = data.codeClassifyOid;
this.cloNamesList = data.cloNamesList;
this.templateOid = data.oid;
+ this.tab1Loading = true
getResembleTable({
codeClassifyOid:
this.type === "batchApplyCode" ? data.codeRuleOid : this.templateOid,
redisOid: this.redisOid + "-resemble",
}).then((res) => {
+ this.tab1Loading = false
this.tab1Table = res.data.data.filter(
(item) => !this.savedList.includes(item.oid)
);
@@ -353,12 +356,14 @@
this.tab1Table;
}
});
+ this.tab2Loading = true
// 鑾峰彇姝g‘鏁版嵁
getSuccessTable({
codeClassifyOid:
this.type === "batchApplyCode" ? data.codeRuleOid : this.templateOid,
redisOid: this.redisOid + "-ok",
}).then((res) => {
+ this.tab2Loading = false
this.tab2Table = res.data.data;
if (this.tab2Table.length > 0 && this.type === "batchApplyCode") {
this.batchApplyCodeTableData[data.codeRuleOid]["codeApply"] = {};
@@ -384,10 +389,12 @@
if (!row || !row.oid) {
return;
}
+ this.tab1BottomTableLoading = true
getCurretnSelectedRowResemble({
redisOid: this.redisOid + "-resemble-data",
dataOid: row.oid,
}).then((res) => {
+ this.tab1BottomTableLoading = false
this.currentSelectedResemble = res.data.data;
});
},
@@ -485,12 +492,12 @@
},
];
}
+ this.submitLoading = true
submitHistoryimport(params).then((res) => {
- console.log(res);
+ this.submitLoading = false
+ console.log(res);
if (res.data.code === 200) {
this.$message.success(res.data.msg);
- } else {
- this.$message.error(res.data.msg);
}
});
},
@@ -574,6 +581,7 @@
}
}
.right {
+ transition: all 0.5s;
margin-left: 20px;
margin-top: 30px;
}
--
Gitblit v1.9.3