Commit dbb081d1 by wangzhihui

```

feat(warningBaseLine): 添加预警基线配置功能

- 新增updateFlag字段区分新增和更新操作
- 实现指标选择时自动更新指标名称
- 增加个人客单价和转化率指标选项
- 完善删除功能,添加确认提示和API调用
- 优化页面布局样式

refactor(outstandingCase): 重构优秀案例页面

- 移除未使用的Vuex mapActions和mapState
- 移除reportTrackPageMixin混入
- 清理无用的computed属性和track_event_code
- 移除冗余的时间范围处理逻辑
- 优化页面初始化流程
```
1 parent abb6e0f8
...@@ -78,14 +78,11 @@ ...@@ -78,14 +78,11 @@
</template> </template>
<script> <script>
import { mapActions, mapState } from "vuex";
import { approveExcellentCase, downloadExcellentCaseAudio, listExcellentCase, rejectExcellentCase } from "@/api/resident"; import { approveExcellentCase, downloadExcellentCaseAudio, listExcellentCase, rejectExcellentCase } from "@/api/resident";
import { reviewCaseStatusOpt, reviewCaseStatusOptMap } from "@/common/constants.js"; import { reviewCaseStatusOpt, reviewCaseStatusOptMap } from "@/common/constants.js";
import { deepClone, downLoadFile, Util } from "@/common/util"; import { deepClone, downLoadFile, Util } from "@/common/util";
import reportTrackPageMixin from "@/mixins/reportTrackPageMixin";
export default { export default {
mixins: [reportTrackPageMixin],
data() { data() {
return { return {
activeName: "0", activeName: "0",
...@@ -213,18 +210,12 @@ export default { ...@@ -213,18 +210,12 @@ export default {
reviewCaseStatusOptMap: deepClone(reviewCaseStatusOptMap), reviewCaseStatusOptMap: deepClone(reviewCaseStatusOptMap),
clientTypeOpt: deepClone([]), clientTypeOpt: deepClone([]),
}, },
track_event_code: "recruitment_management",
}; };
}, },
mounted() { mounted() {
this.onPageShow();
this.fetchOnboardingPlans(); this.fetchOnboardingPlans();
}, },
computed: {
...mapState({
dowloadList: state => state.d2admin.user.dowloadList,
}),
},
methods: { methods: {
handleClick() { handleClick() {
this.searchForm.reviewStatus = this.activeName; this.searchForm.reviewStatus = this.activeName;
...@@ -346,7 +337,7 @@ export default { ...@@ -346,7 +337,7 @@ export default {
let item = baseData[optKey].find(item => item.confId == row[rowKey]); let item = baseData[optKey].find(item => item.confId == row[rowKey]);
return (item && item.confValue) || "-"; return (item && item.confValue) || "-";
}, },
...mapActions("d2admin/user", ["actionSetDownloadList"]),
// 下载录音 // 下载录音
handleDownload(row) { handleDownload(row) {
const params = { const params = {
...@@ -361,14 +352,6 @@ export default { ...@@ -361,14 +352,6 @@ export default {
getParams() { getParams() {
let params = deepClone(this.searchForm); let params = deepClone(this.searchForm);
// 申请时间
if (params?.createdDate?.length) {
let [start, end] = params.createdDate;
params.createdDateBegin = Util.dateFormate(start, "YYYY-MM-DD");
params.createdDateEnd = Util.dateFormate(end, "YYYY-MM-DD");
}
delete params.createdDate;
return params; return params;
}, },
beforeSearchFn() { beforeSearchFn() {
...@@ -380,7 +363,6 @@ export default { ...@@ -380,7 +363,6 @@ export default {
handleSearch() { handleSearch() {
this.page = this.$options.data.call(this).page; this.page = this.$options.data.call(this).page;
this.$refs.table.refreshTable(true, true); this.$refs.table.refreshTable(true, true);
this.getRecruitmentSummaryData();
}, },
handleReset() { handleReset() {
this.searchForm = this.$options.data.call(this).searchForm; this.searchForm = this.$options.data.call(this).searchForm;
......
...@@ -77,6 +77,7 @@ export default { ...@@ -77,6 +77,7 @@ export default {
data() { data() {
return { return {
addForm: { addForm: {
updateFlag: 0, // 0是新增,1是更新
indicatorCode: "A036", indicatorCode: "A036",
indicatorName: "个人产值", indicatorName: "个人产值",
timeDimension: 1, timeDimension: 1,
...@@ -97,7 +98,9 @@ export default { ...@@ -97,7 +98,9 @@ export default {
optionId: "confId", optionId: "confId",
optionLabel: "confValue", optionLabel: "confValue",
optionsName: "indicatorOpt", optionsName: "indicatorOpt",
handleRadioChange: (val) => {}, handleRadioChange: (val) => {
this.addForm.indicatorName = this.baseData.indicatorOpt.find(item => item.confId === val).confValue;
},
}, },
{ {
label: "时间维度", label: "时间维度",
...@@ -122,6 +125,14 @@ export default { ...@@ -122,6 +125,14 @@ export default {
confId: "A036", confId: "A036",
confValue: "个人产值", confValue: "个人产值",
}, },
{
confId: "A076",
confValue: "个人客单价",
},
{
confId: "A085",
confValue: "转化率",
},
], ],
timeDimensionOpt: [ timeDimensionOpt: [
{ confId: 1, confValue: "日" }, { confId: 1, confValue: "日" },
...@@ -169,9 +180,9 @@ export default { ...@@ -169,9 +180,9 @@ export default {
maxValue: item.maxValueInf == 1 ? "+∞" : item.maxValue, maxValue: item.maxValueInf == 1 ? "+∞" : item.maxValue,
})); }));
} }
this.addForm.updateFlag = 1;
this.editFormData[this.findAttrIdx("editFormData", "indicatorCode")].isDisabled = true; // this.editFormData[this.findAttrIdx("editFormData", "indicatorCode")].isDisabled = true;
this.editFormData[this.findAttrIdx("editFormData", "timeDimension")].isDisabled = true; // this.editFormData[this.findAttrIdx("editFormData", "timeDimension")].isDisabled = true;
} else { } else {
const obj = { const obj = {
warningLevel: 0, warningLevel: 0,
...@@ -186,6 +197,7 @@ export default { ...@@ -186,6 +197,7 @@ export default {
obj.maxValueInf = i === 2 ? 1 : 0; obj.maxValueInf = i === 2 ? 1 : 0;
this.addForm.configList.push(deepClone(obj)); this.addForm.configList.push(deepClone(obj));
} }
this.addForm.updateFlag = 0;
} }
}, },
// 预警级别文字 // 预警级别文字
...@@ -312,12 +324,14 @@ export default { ...@@ -312,12 +324,14 @@ export default {
maxValue: item.maxValueInf == 1 ? null : item.maxValue, maxValue: item.maxValueInf == 1 ? null : item.maxValue,
maxValueInf: item.maxValueInf, maxValueInf: item.maxValueInf,
id: item.id, id: item.id,
}; };
}); });
const params = { const params = {
indicatorCode: this.addForm.indicatorCode, indicatorCode: this.addForm.indicatorCode,
indicatorName: this.addForm.indicatorName, indicatorName: this.addForm.indicatorName,
timeDimension: this.addForm.timeDimension, timeDimension: this.addForm.timeDimension,
updateFlag: this.addForm.updateFlag,
configList, configList,
}; };
createOrUpdateBaselineConfig(params).then((res) => { createOrUpdateBaselineConfig(params).then((res) => {
......
...@@ -252,22 +252,27 @@ export default { ...@@ -252,22 +252,27 @@ export default {
// 删除操作 // 删除操作
handleDelete(row) { handleDelete(row) {
this.$confirm(`确定删除"${row.indicatorName}"的${this.getLevelText(row.warningLevel)}配置吗?`, "提示", { console.log(row);
this.$confirm(`确定删除该预警配置吗?`, "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}).then(() => { }).then(() => {
// 实际项目中这里会发请求,然后更新originalData let params = {
this.$message({ indicatorCode: row.indicatorCode,
type: "success", timeDimension: row.timeDimension,
message: "删除成功!", };
deleteBaselineConfig(params).then((res) => {
if (res) {
this.$message({
type: "success",
message: "删除成功!",
});
this.getBaseLineConfigList();
}
}); });
console.log("删除配置:", row);
}).catch(() => { }).catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
}); });
}, },
handleConfig(row) { handleConfig(row) {
...@@ -287,6 +292,8 @@ export default { ...@@ -287,6 +292,8 @@ export default {
<style scoped lang="scss"> <style scoped lang="scss">
.warning-baseline-container { .warning-baseline-container {
height: calc(100vh - 200px);
overflow: auto;
background: #ffffff; background: #ffffff;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
margin: 0 20px; margin: 0 20px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!