更改问题

This commit is contained in:
zengmingjie 2025-08-21 21:41:11 +08:00
parent b205eda476
commit d423f16696
2 changed files with 28 additions and 18 deletions

View File

@ -93,8 +93,10 @@ export default {
const seriesData = sortedDateData.map((item) => item.count); const seriesData = sortedDateData.map((item) => item.count);
const sortedDateData1 = res.data.time.sort( const sortedDateData1 = res.data.time.sort(
(a, b) => new Date(a.key) - new Date(b.key) (a, b) => Number(a.key) - Number(b.key)
); );
console.log(sortedDateData1, "sortedDateData1");
const xAxisData1 = sortedDateData1.map((item) => item.key); const xAxisData1 = sortedDateData1.map((item) => item.key);
const seriesData1 = sortedDateData1.map((item) => item.count); const seriesData1 = sortedDateData1.map((item) => item.count);
this.chartData = res.data; this.chartData = res.data;

View File

@ -36,6 +36,9 @@
@changePage="handlePageChange" @changePage="handlePageChange"
@selectionChange="handleSelectionChange" @selectionChange="handleSelectionChange"
> >
<template #whitTime="{ data }">
{{ data.createTime }} - {{ data.endTime }}
</template>
<template #operate="{ data }"> <template #operate="{ data }">
<el-link <el-link
type="primary" type="primary"
@ -112,19 +115,13 @@ export default {
prop: "allDay" prop: "allDay"
}, },
{ {
type: "text", slot: "whitTime",
label: "所属单位", label: "白名单生效的起止日期"
prop: "company"
}, },
{ {
type: "text", type: "text",
label: "机型", label: "状态",
prop: "model" prop: "status"
},
{
type: "text",
label: "备注",
prop: "mark"
}, },
{ {
slot: "operate", slot: "operate",
@ -268,10 +265,21 @@ export default {
whitListList(params).then((res) => { whitListList(params).then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.tableData = res.data.items.map((item) => { this.tableData = res.data.items.map((item) => {
return item.allDay let status = "未启用";
? { ...item, allDay: "是" } if (item.allDay) {
: { ...item, allDay: "否" }; status = "启用中";
} else {
const now = new Date();
const endTime = new Date(item.endTime);
status = endTime > now ? "启用中" : "未启用";
}
return {
...item,
allDay: item.allDay ? "是" : "否",
status
};
}); });
this.paginationParam.total = res.data.total; this.paginationParam.total = res.data.total;
} }
}); });
@ -340,11 +348,11 @@ export default {
this.isType = "edit"; this.isType = "edit";
this.title = "编辑白名单"; this.title = "编辑白名单";
this.isEditFlag = false; this.isEditFlag = false;
this.fromItem = { ...value }; this.fromItem = JSON.parse(JSON.stringify(value));
this.fromItem.positionId = value.positionIds; this.fromItem.positionId = this.fromItem.positionIds;
this.formDrawerList = this.getDefaultFormDrawerList(); this.formDrawerList = this.getDefaultFormDrawerList();
value.allDay = value.allDay ? "0" : "1"; this.fromItem.allDay = this.fromItem.allDay ? "0" : "1";
this.changeSelect(value.allDay); // allDay this.changeSelect(this.fromItem.allDay); // allDay
this.initPosition(); this.initPosition();
this.drawer = true; this.drawer = true;
} else if (type === "delete") { } else if (type === "delete") {