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