feat: 优化拉取接口

This commit is contained in:
2026-10-10 15:06:54 +08:00
parent 24f7267fbc
commit 426c389d5b
5 changed files with 172 additions and 60 deletions
@@ -48,8 +48,8 @@ layout("/layouts/platform.html"){
<el-card shadow="never">
<table-tool label="系统当前用户数据">
<!--<el-button type="primary" size="mini" @click="updateDataDict" icon="el-icon-refresh">更新【码表】数据</el-button>-->
<el-button type="primary" size="mini" @click="updateUnits" icon="el-icon-refresh">更新【单位】数据</el-button>
<el-button type="primary" size="mini" @click="openUpdate" icon="el-icon-refresh">更新【人员】数据</el-button>
<el-button type="primary" size="mini" @click="updateUnits" icon="el-icon-refresh" :loading="unitUpdateLoading" :disabled="unitUpdateLoading || updateLoading">更新【单位】数据</el-button>
<el-button type="primary" size="mini" @click="openUpdate" icon="el-icon-refresh" :loading="updateLoading" :disabled="unitUpdateLoading || updateLoading">更新【人员】数据</el-button>
</table-tool>
<el-table :key="tableKey" :data="tableData" @sort-change="pageOrder" header-align="center">
<el-table-column type="index" width="70" label="序号" fixed="left"></el-table-column>
@@ -147,6 +147,7 @@ layout("/layouts/platform.html"){
}
},
updateLoading: false,
unitUpdateLoading: false,
unitOptions: [],
changeTypeData: [],
enableAdvancedConditions: false,
@@ -174,12 +175,22 @@ layout("/layouts/platform.html"){
methods: {
// 更新单位数据
updateUnits() {
if (this.unitUpdateLoading || this.updateLoading) return
this.$confirm("确定要更新单位数据吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post("/platform/sys/data/user/update/updateUnits")
if (this.unitUpdateLoading || this.updateLoading) return
this.$set(this, "unitUpdateLoading", true)
const loading = this.$loading({
fullscreen: true,
lock: true,
text: "正在更新单位数据,请稍候",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.5)"
})
return this.$axios.post("/platform/sys/data/user/update/updateUnits")
.then((resp) => {
if (resp.code === 0) {
this.$message.success("更新成功")
@@ -187,7 +198,11 @@ layout("/layouts/platform.html"){
this.$message.error(resp.msg)
}
})
})
.finally(() => {
loading.close()
this.$set(this, "unitUpdateLoading", false)
})
}).catch(() => {})
},
// 更新码表数据
@@ -226,6 +241,7 @@ layout("/layouts/platform.html"){
return null
},
openUpdate() {
if (this.unitUpdateLoading || this.updateLoading) return
this.updateDialog = true
this.updateLoading = false
this.$nextTick(() => {
@@ -250,7 +266,7 @@ layout("/layouts/platform.html"){
},
execUpdate() {
// 人员更新未结束时不再打开确认框或提交重复请求。
if (this.updateLoading) return
if (this.unitUpdateLoading || this.updateLoading) return
if (!this.updateFromData.pullTime) {
this.$message.warning("请选择数据源时间")
return
@@ -271,7 +287,7 @@ layout("/layouts/platform.html"){
type: "warning"
})
.then(() => {
if (this.updateLoading) return
if (this.unitUpdateLoading || this.updateLoading) return
this.$set(this, "updateLoading", true)
// 遮罩覆盖人员更新弹窗及页面,明确提示处理中并阻止重复操作。
const loading = this.$loading({