实现项目打标状态联动并执行前后端适配
This commit is contained in:
@@ -98,7 +98,7 @@
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-if="scope.row.status === '0'"
|
||||
v-if="scope.row.status === '0' || scope.row.status === '3'"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-right"
|
||||
@@ -192,6 +192,7 @@ export default {
|
||||
0: "#1890ff",
|
||||
1: "#52c41a",
|
||||
2: "#8c8c8c",
|
||||
3: "#fa8c16",
|
||||
};
|
||||
return colorMap[status] || "#8c8c8c";
|
||||
},
|
||||
|
||||
@@ -39,7 +39,8 @@ export default {
|
||||
all: 0,
|
||||
'0': 0,
|
||||
'1': 0,
|
||||
'2': 0
|
||||
'2': 0,
|
||||
'3': 0
|
||||
})
|
||||
}
|
||||
},
|
||||
@@ -51,7 +52,8 @@ export default {
|
||||
{ label: '全部项目', value: 'all', count: 0 },
|
||||
{ label: '进行中', value: '0', count: 0 },
|
||||
{ label: '已完成', value: '1', count: 0 },
|
||||
{ label: '已归档', value: '2', count: 0 }
|
||||
{ label: '已归档', value: '2', count: 0 },
|
||||
{ label: '打标中', value: '3', count: 0 }
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
<template>
|
||||
<div class="param-config-container" v-loading="loading" element-loading-text="加载中...">
|
||||
<div v-if="isProjectTagging" class="readonly-tip">
|
||||
项目正在进行银行流水打标,参数暂不可修改。
|
||||
</div>
|
||||
|
||||
<!-- 模型参数卡片组(垂直堆叠) -->
|
||||
<div class="model-cards-container" v-if="!loading && modelGroups.length > 0">
|
||||
<div
|
||||
@@ -20,6 +24,7 @@
|
||||
<template #default="{ row }">
|
||||
<el-input
|
||||
v-model="row.paramValue"
|
||||
:disabled="isProjectTagging"
|
||||
placeholder="请输入阈值"
|
||||
@input="markAsModified(model.modelCode, row)"
|
||||
/>
|
||||
@@ -37,7 +42,7 @@
|
||||
|
||||
<!-- 统一保存按钮 -->
|
||||
<div class="button-section" v-if="!loading && modelGroups.length > 0">
|
||||
<el-button type="primary" @click="handleSaveAll" :loading="saving">
|
||||
<el-button type="primary" :disabled="isProjectTagging || saving" @click="handleSaveAll" :loading="saving">
|
||||
保存所有修改
|
||||
</el-button>
|
||||
<span v-if="modifiedCount > 0" class="modified-tip">
|
||||
@@ -74,6 +79,9 @@ export default {
|
||||
computed: {
|
||||
modifiedCount() {
|
||||
return Object.keys(this.modifiedParams).length;
|
||||
},
|
||||
isProjectTagging() {
|
||||
return String(this.projectInfo.projectStatus) === "3";
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -151,6 +159,10 @@ export default {
|
||||
},
|
||||
|
||||
async handleSaveAll() {
|
||||
if (this.isProjectTagging) {
|
||||
this.$message.warning("项目正在进行银行流水打标,参数暂不可修改");
|
||||
return;
|
||||
}
|
||||
if (this.modifiedCount === 0) {
|
||||
this.$message.info('没有需要保存的修改');
|
||||
return;
|
||||
@@ -201,6 +213,15 @@ export default {
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
.readonly-tip {
|
||||
margin-bottom: 16px;
|
||||
padding: 12px 16px;
|
||||
color: #ad6800;
|
||||
background: #fff7e6;
|
||||
border: 1px solid #ffd591;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.model-cards-container {
|
||||
margin-bottom: 20px;
|
||||
min-height: 300px;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<el-button
|
||||
size="small"
|
||||
icon="el-icon-download"
|
||||
:disabled="isProjectTagging"
|
||||
@click="handleFetchBankInfo"
|
||||
>
|
||||
拉取本行信息
|
||||
@@ -24,6 +25,10 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="isProjectTagging" class="tagging-lock-tip">
|
||||
项目正在进行银行流水打标,暂不可上传或拉取数据。
|
||||
</div>
|
||||
|
||||
<!-- 上传模块 -->
|
||||
<div class="upload-section">
|
||||
<div class="upload-cards">
|
||||
@@ -165,6 +170,7 @@
|
||||
class="upload-area"
|
||||
drag
|
||||
action="#"
|
||||
:disabled="isProjectTagging"
|
||||
:auto-upload="false"
|
||||
:on-change="handleFileChange"
|
||||
:file-list="fileList"
|
||||
@@ -179,6 +185,7 @@
|
||||
<el-button @click="showUploadDialog = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="isProjectTagging"
|
||||
@click="handleConfirmUpload"
|
||||
:loading="uploading"
|
||||
>确定</el-button
|
||||
@@ -231,6 +238,7 @@
|
||||
v-model="pullBankInfoForm.idCardText"
|
||||
type="textarea"
|
||||
:rows="5"
|
||||
:disabled="isProjectTagging"
|
||||
placeholder="支持逗号、中文逗号、换行分隔"
|
||||
/>
|
||||
<div class="pull-bank-field-tip">
|
||||
@@ -248,6 +256,7 @@
|
||||
:show-file-list="false"
|
||||
:file-list="idCardFileList"
|
||||
accept=".xls,.xlsx"
|
||||
:disabled="isProjectTagging"
|
||||
:on-change="handleIdCardFileChange"
|
||||
:on-remove="handleIdCardFileRemove"
|
||||
>
|
||||
@@ -279,6 +288,7 @@
|
||||
<el-date-picker
|
||||
class="pull-bank-range-picker"
|
||||
v-model="pullBankInfoForm.dateRange"
|
||||
:disabled="isProjectTagging"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd"
|
||||
:picker-options="pullBankInfoDatePickerOptions"
|
||||
@@ -292,6 +302,7 @@
|
||||
<el-button @click="pullBankInfoDialogVisible = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="isProjectTagging"
|
||||
:loading="pullBankInfoLoading"
|
||||
@click="handleConfirmPullBankInfo"
|
||||
>
|
||||
@@ -312,6 +323,7 @@
|
||||
drag
|
||||
action="#"
|
||||
multiple
|
||||
:disabled="isProjectTagging"
|
||||
:auto-upload="false"
|
||||
:on-change="handleBatchFileChange"
|
||||
:show-file-list="false"
|
||||
@@ -350,8 +362,8 @@
|
||||
<el-button @click="batchUploadDialogVisible = false">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
:disabled="isProjectTagging || selectedFiles.length === 0"
|
||||
:loading="uploadLoading"
|
||||
:disabled="selectedFiles.length === 0"
|
||||
@click="handleBatchUpload"
|
||||
>开始上传</el-button
|
||||
>
|
||||
@@ -518,6 +530,7 @@ export default {
|
||||
pollingTimer: null,
|
||||
pollingEnabled: false,
|
||||
pollingInterval: 5000,
|
||||
lastFileStatusSignature: "",
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -526,12 +539,21 @@ export default {
|
||||
disabledDate: (time) => this.isPullBankInfoDateDisabled(time),
|
||||
};
|
||||
},
|
||||
isProjectTagging() {
|
||||
return String(this.projectInfo.projectStatus) === "3";
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
"projectInfo.projectStatus"() {
|
||||
this.syncUploadCardDisabledState();
|
||||
},
|
||||
},
|
||||
created() {
|
||||
// 加载初始数据
|
||||
// this.loadInitialData();
|
||||
// 监听路由变化更新选中菜单
|
||||
this.updateActiveMenu();
|
||||
this.syncUploadCardDisabledState();
|
||||
},
|
||||
mounted() {
|
||||
// 组件挂载后监听项目ID变化
|
||||
@@ -597,6 +619,19 @@ export default {
|
||||
: card.btnText;
|
||||
}
|
||||
});
|
||||
|
||||
this.syncUploadCardDisabledState();
|
||||
},
|
||||
syncUploadCardDisabledState() {
|
||||
this.uploadCards = this.uploadCards.map((card) => {
|
||||
if (card.key === "transaction") {
|
||||
return {
|
||||
...card,
|
||||
disabled: this.isProjectTagging,
|
||||
};
|
||||
}
|
||||
return card;
|
||||
});
|
||||
},
|
||||
|
||||
/** 更新质量指标 */
|
||||
@@ -660,6 +695,10 @@ export default {
|
||||
},
|
||||
/** 确认上传 */
|
||||
async handleConfirmUpload() {
|
||||
if (this.isProjectTagging) {
|
||||
this.$message.warning("项目正在进行银行流水打标,暂不可上传或拉取数据");
|
||||
return;
|
||||
}
|
||||
if (this.fileList.length === 0) {
|
||||
this.$message.warning("请选择要上传的文件");
|
||||
return;
|
||||
@@ -919,6 +958,10 @@ export default {
|
||||
return this.parseIdCardText(this.pullBankInfoForm.idCardText);
|
||||
},
|
||||
async handleConfirmPullBankInfo() {
|
||||
if (this.isProjectTagging) {
|
||||
this.$message.warning("项目正在进行银行流水打标,暂不可上传或拉取数据");
|
||||
return;
|
||||
}
|
||||
const idCards = this.buildFinalIdCardList();
|
||||
const [startDate, endDate] = this.pullBankInfoForm.dateRange || [];
|
||||
|
||||
@@ -953,6 +996,8 @@ export default {
|
||||
this.$message.success((res && res.msg) || "拉取任务已提交");
|
||||
|
||||
await Promise.all([this.loadStatistics(), this.loadFileList()]);
|
||||
this.lastFileStatusSignature = this.buildFileStatusSignature();
|
||||
this.$emit("refresh-project");
|
||||
|
||||
const hasPollingRecords =
|
||||
this.statistics.uploading > 0 ||
|
||||
@@ -973,6 +1018,10 @@ export default {
|
||||
},
|
||||
/** 拉取本行信息 */
|
||||
handleFetchBankInfo() {
|
||||
if (this.isProjectTagging) {
|
||||
this.$message.warning("项目正在进行银行流水打标,暂不可上传或拉取数据");
|
||||
return;
|
||||
}
|
||||
this.resetPullBankInfoForm();
|
||||
this.openPullBankInfoDialog();
|
||||
},
|
||||
@@ -1009,6 +1058,7 @@ export default {
|
||||
0: "processing",
|
||||
1: "success",
|
||||
2: "archived",
|
||||
3: "tagging",
|
||||
};
|
||||
return statusMap[status] || "processing";
|
||||
},
|
||||
@@ -1019,6 +1069,7 @@ export default {
|
||||
0: "进行中",
|
||||
1: "已完成",
|
||||
2: "已归档",
|
||||
3: "打标中",
|
||||
};
|
||||
return statusMap[status] || "未知";
|
||||
},
|
||||
@@ -1059,6 +1110,10 @@ export default {
|
||||
|
||||
/** 开始批量上传 */
|
||||
async handleBatchUpload() {
|
||||
if (this.isProjectTagging) {
|
||||
this.$message.warning("项目正在进行银行流水打标,暂不可上传或拉取数据");
|
||||
return;
|
||||
}
|
||||
if (this.selectedFiles.length === 0) {
|
||||
this.$message.warning("请选择要上传的文件");
|
||||
return;
|
||||
@@ -1079,6 +1134,8 @@ export default {
|
||||
|
||||
// 刷新数据并启动轮询
|
||||
await Promise.all([this.loadStatistics(), this.loadFileList()]);
|
||||
this.lastFileStatusSignature = this.buildFileStatusSignature();
|
||||
this.$emit("refresh-project");
|
||||
|
||||
this.startPolling();
|
||||
} catch (error) {
|
||||
@@ -1118,6 +1175,9 @@ export default {
|
||||
const res = await getFileUploadList(params);
|
||||
this.fileUploadList = res.rows || [];
|
||||
this.total = res.total || 0;
|
||||
if (!this.lastFileStatusSignature) {
|
||||
this.lastFileStatusSignature = this.buildFileStatusSignature();
|
||||
}
|
||||
} catch (error) {
|
||||
this.$message.error("加载文件列表失败");
|
||||
console.error(error);
|
||||
@@ -1138,6 +1198,11 @@ export default {
|
||||
|
||||
Promise.all([this.loadStatistics(), this.loadFileList()])
|
||||
.then(() => {
|
||||
const currentSignature = this.buildFileStatusSignature();
|
||||
if (currentSignature !== this.lastFileStatusSignature) {
|
||||
this.lastFileStatusSignature = currentSignature;
|
||||
this.$emit("refresh-project");
|
||||
}
|
||||
if (
|
||||
this.statistics.uploading === 0 &&
|
||||
this.statistics.parsing === 0
|
||||
@@ -1168,6 +1233,8 @@ export default {
|
||||
/** 手动刷新 */
|
||||
async handleManualRefresh() {
|
||||
await Promise.all([this.loadStatistics(), this.loadFileList()]);
|
||||
this.lastFileStatusSignature = this.buildFileStatusSignature();
|
||||
this.$emit("refresh-project");
|
||||
|
||||
this.$message.success("刷新成功");
|
||||
|
||||
@@ -1183,6 +1250,11 @@ export default {
|
||||
this.queryParams.pageNum = pageNum;
|
||||
this.loadFileList();
|
||||
},
|
||||
buildFileStatusSignature() {
|
||||
return (this.fileUploadList || [])
|
||||
.map((item) => `${item.id || ""}:${item.fileStatus || ""}`)
|
||||
.join("|");
|
||||
},
|
||||
|
||||
getRowAction(row) {
|
||||
return getUploadFileAction(row.fileStatus);
|
||||
@@ -1401,6 +1473,15 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.tagging-lock-tip {
|
||||
margin-bottom: 16px;
|
||||
padding: 12px 16px;
|
||||
color: #ad6800;
|
||||
background: #fff7e6;
|
||||
border: 1px solid #ffd591;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
// 上传模块
|
||||
.upload-section {
|
||||
background: #ffffff;
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
:project-id="projectId"
|
||||
:project-info="projectInfo"
|
||||
@menu-change="handleMenuChange"
|
||||
@refresh-project="handleRefreshProject"
|
||||
@data-uploaded="handleDataUploaded"
|
||||
@name-selected="handleNameSelected"
|
||||
@generate-report="handleGenerateReport"
|
||||
@@ -215,6 +216,7 @@ export default {
|
||||
0: "primary", // 进行中
|
||||
1: "success", // 已完成
|
||||
2: "info", // 已归档
|
||||
3: "warning", // 打标中
|
||||
};
|
||||
return statusMap[status] || "info";
|
||||
},
|
||||
@@ -224,6 +226,7 @@ export default {
|
||||
0: "进行中",
|
||||
1: "已完成",
|
||||
2: "已归档",
|
||||
3: "打标中",
|
||||
};
|
||||
return statusMap[status] || "未知";
|
||||
},
|
||||
@@ -292,6 +295,9 @@ export default {
|
||||
this.initPageData();
|
||||
this.$message.success("刷新成功");
|
||||
},
|
||||
handleRefreshProject() {
|
||||
this.initPageData();
|
||||
},
|
||||
/** 导出报告 */
|
||||
handleExport() {
|
||||
console.log("导出报告");
|
||||
|
||||
@@ -101,7 +101,8 @@ export default {
|
||||
all: 0,
|
||||
'0': 0,
|
||||
'1': 0,
|
||||
'2': 0
|
||||
'2': 0,
|
||||
'3': 0
|
||||
},
|
||||
// 新增/编辑弹窗
|
||||
addDialogVisible: false,
|
||||
@@ -137,7 +138,8 @@ export default {
|
||||
all: counts.all || 0,
|
||||
'0': counts.status0 || 0,
|
||||
'1': counts.status1 || 0,
|
||||
'2': counts.status2 || 0
|
||||
'2': counts.status2 || 0,
|
||||
'3': counts.status3 || 0
|
||||
}
|
||||
|
||||
this.loading = false
|
||||
|
||||
Reference in New Issue
Block a user