Commit 1a970622 by Lin

refactor: 移除冗余代码,优化短课程组件逻辑,增强用户交互体验

1 parent 0b53f038
...@@ -286,7 +286,7 @@ export default { ...@@ -286,7 +286,7 @@ export default {
finishTime: this.configData.finishTime, finishTime: this.configData.finishTime,
effectiveType: this.configData.effectiveType, effectiveType: this.configData.effectiveType,
openFlag: this.configData.openFlag === "Y" ? 1 : 0, openFlag: this.configData.openFlag === "Y" ? 1 : 0,
staffList: [], staffList: [{ staffName: "陆汉林", phone: "13800138000" }],
}; };
console.log(params, "params"); console.log(params, "params");
updateLightChangeConfig(params) updateLightChangeConfig(params)
......
...@@ -44,44 +44,6 @@ ...@@ -44,44 +44,6 @@
</template> </template>
</div> </div>
</template> </template>
<template #mainBrand="scope">
<div>
<template v-if="
scope.scope.mainBrand
&& scope.scope.mainBrand.split(',').length > 1
">
<span>
{{
scope.scope.mainBrand.split(",").slice(0, 1).join("")
}}
</span>
<el-popover placement="top"
trigger="hover"
width="fit-content">
<div :class="{
serverHeight: scope.scope.mainBrand.split(',').length >= 10,
}">
<div v-for="(item, index) in scope.scope.mainBrand.split(',')"
:key="index">
{{ item }}
</div>
</div>
<template #reference>
<span class="more-info">
...({{ scope.scope.mainBrand.split(",").length }})
</span>
</template>
</el-popover>
</template>
<template v-else>
<span>
{{
scope.scope.mainBrand ? scope.scope.mainBrand : "--"
}}
</span>
</template>
</div>
</template>
<template #tagNamesHtml="scope"> <template #tagNamesHtml="scope">
<div> <div>
<template v-if="scope.scope.tagNames"> <template v-if="scope.scope.tagNames">
...@@ -147,7 +109,7 @@ ...@@ -147,7 +109,7 @@
</template> </template>
<script> <script>
import { getLightChangePage, importLightChangePhone, switchLightChange } from "@api/serviceCentre"; import { getLightChangePage, switchLightChange } from "@api/serviceCentre";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { mapActions, mapState } from "vuex"; import { mapActions, mapState } from "vuex";
import { import {
...@@ -209,12 +171,6 @@ export default { ...@@ -209,12 +171,6 @@ export default {
// prop: "tagNames", // prop: "tagNames",
// width: "200px", // width: "200px",
// }, // },
// {
// label: "主营品牌",
// prop: "mainBrand",
// width: "120px",
// addHtml: "mainBrand",
// },
{ {
label: "能力短板维度", label: "能力短板维度",
prop: "tagNames", prop: "tagNames",
...@@ -231,16 +187,6 @@ export default { ...@@ -231,16 +187,6 @@ export default {
// prop: "recordingInfoCount", // prop: "recordingInfoCount",
// width: "120", // width: "120",
// }, // },
// {
// label: "课程结束时间",
// prop: "deadline",
// width: "180",
// formatter: (cellValue) => {
// return cellValue.deadline
// ? Util.dateFormate(cellValue.deadline, "YYYY-MM-DD HH:mm:ss")
// : "";
// },
// },
{ {
label: "完成情况", label: "完成情况",
prop: "taskStatus", prop: "taskStatus",
...@@ -324,7 +270,19 @@ export default { ...@@ -324,7 +270,19 @@ export default {
&& this.$refs.lightTable.refreshTable(first, second); && this.$refs.lightTable.refreshTable(first, second);
}, },
handlePenalty(row) { handlePenalty(row) {
console.log(row, "handlePenalty"); const taskStatusOk = Number(row?.taskStatus) === 1;
const completeTimeEmpty
= row?.completeTime === null
|| row?.completeTime === undefined
|| row?.completeTime === "";
const punishTypeOk = Number(row?.punishType) !== 0;
if (!(taskStatusOk && completeTimeEmpty && punishTypeOk)) {
this.$message.warning("当前任务不允许修改处罚开关");
// 由于开关是受控的(:value),这里刷新表格确保状态立即回滚
return;
}
const { id, punishFlag } = row; const { id, punishFlag } = row;
const punishFlagTemp = punishFlag === 1 ? 0 : 1; const punishFlagTemp = punishFlag === 1 ? 0 : 1;
switchLightChange({ switchLightChange({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!