更改问题
This commit is contained in:
parent
b205eda476
commit
d423f16696
|
|
@ -93,8 +93,10 @@ export default {
|
|||
const seriesData = sortedDateData.map((item) => item.count);
|
||||
|
||||
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 seriesData1 = sortedDateData1.map((item) => item.count);
|
||||
this.chartData = res.data;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,9 @@
|
|||
@changePage="handlePageChange"
|
||||
@selectionChange="handleSelectionChange"
|
||||
>
|
||||
<template #whitTime="{ data }">
|
||||
{{ data.createTime }} - {{ data.endTime }}
|
||||
</template>
|
||||
<template #operate="{ data }">
|
||||
<el-link
|
||||
type="primary"
|
||||
|
|
@ -112,19 +115,13 @@ export default {
|
|||
prop: "allDay"
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
label: "所属单位",
|
||||
prop: "company"
|
||||
slot: "whitTime",
|
||||
label: "白名单生效的起止日期"
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
label: "机型",
|
||||
prop: "model"
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
label: "备注",
|
||||
prop: "mark"
|
||||
label: "状态",
|
||||
prop: "status"
|
||||
},
|
||||
{
|
||||
slot: "operate",
|
||||
|
|
@ -268,10 +265,21 @@ export default {
|
|||
whitListList(params).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.tableData = res.data.items.map((item) => {
|
||||
return item.allDay
|
||||
? { ...item, allDay: "是" }
|
||||
: { ...item, allDay: "否" };
|
||||
let status = "未启用";
|
||||
if (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;
|
||||
}
|
||||
});
|
||||
|
|
@ -340,11 +348,11 @@ export default {
|
|||
this.isType = "edit";
|
||||
this.title = "编辑白名单";
|
||||
this.isEditFlag = false;
|
||||
this.fromItem = { ...value };
|
||||
this.fromItem.positionId = value.positionIds;
|
||||
this.fromItem = JSON.parse(JSON.stringify(value));
|
||||
this.fromItem.positionId = this.fromItem.positionIds;
|
||||
this.formDrawerList = this.getDefaultFormDrawerList();
|
||||
value.allDay = value.allDay ? "0" : "1";
|
||||
this.changeSelect(value.allDay); // 根据 allDay 调整时间日期字段
|
||||
this.fromItem.allDay = this.fromItem.allDay ? "0" : "1";
|
||||
this.changeSelect(this.fromItem.allDay); // 根据 allDay 调整时间日期字段
|
||||
this.initPosition();
|
||||
this.drawer = true;
|
||||
} else if (type === "delete") {
|
||||
|
|
|
|||
Loading…
Reference in New Issue