table.data.js
3.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
import dayjs from "dayjs";
import { keyBy } from "lodash-es";
import { getTaskCenterBizCategoryListApi } from "@/views/residentManage/taskCenter/api/index.js";
import { overdueFlagOptions, priorityOptions, statusOptions } from "@/views/residentManage/taskCenter/constant/index.js";
export async function getTableFormSchema() {
const bizTypesList = await getTaskCenterBizCategoryListApi();
return [
{
label: "任务编号",
name: "condition.taskNo",
type: "input",
maxlength: 20,
},
{
label: "任务标题",
name: "condition.title",
type: "input",
maxlength: 100,
},
{
label: "优先级",
name: "condition.priorities",
type: "select",
isClear: true,
optionList: priorityOptions,
optionId: "value",
optionLabel: "label",
multiple: true,
},
{
label: "完成状态",
name: "condition.status",
type: "select",
isClear: true,
optionList: statusOptions,
optionId: "value",
optionLabel: "label",
},
{
label: "任务分类",
name: "condition.bizTypes",
type: "select",
isClear: true,
optionList: bizTypesList,
optionId: "bizType",
optionLabel: "categoryName",
multiple: true,
},
{
label: "执行人",
name: "condition.assigneeName",
type: "input",
maxlength: 20,
},
{
label: "创建人",
name: "condition.creatorName",
type: "input",
maxlength: 20,
},
{
label: "是否逾期",
name: "condition.overdueFlag",
type: "select",
isClear: true,
optionList: overdueFlagOptions,
optionId: "value",
optionLabel: "label",
},
];
} ;
export async function getTableColumns() {
return [
{
label: "任务编号",
prop: "taskNo",
width: "180px",
align: "left",
},
{
label: "任务标题",
prop: "title",
minWidth: "200px",
align: "left",
},
{
label: "任务分类",
prop: "bizTypeName",
width: "180px",
align: "left",
},
{
label: "优先级",
prop: "priority",
width: "100px",
useTag: true,
align: "left",
tagOptions: keyBy(priorityOptions, "value"),
},
{
label: "执行人",
prop: "assignees",
width: "120px",
align: "left",
formatter: (row) => {
return (row?.assignees || []).map(item => item.assigneeName).join(",") || "-";
},
},
{
label: "完成状态",
prop: "status",
align: "left",
width: "120px",
formatter: (row) => {
return statusOptions.find(item => item.value === row.status)?.label || "-";
},
valueClass: (cellValue) => {
return { UNFINISHED: "yellow-dot", FINISHED: "green-dot" }[cellValue.status];
},
},
{
label: "完成时间",
prop: "completeTime",
width: "180px",
align: "left",
formatter: (row) => {
return row.completeTime || "-";
},
},
{
label: "截止时间",
prop: "dueTime",
width: "180px",
align: "left",
formatter: (row) => {
return row.dueTime || "-";
},
valueClass: ({ dueTime, completeTime }) => {
if (!dueTime)
return "";
if (!completeTime) {
if (dayjs(dueTime).isBefore(dayjs())) {
return "color-red";
}
}
if (completeTime) {
if (dayjs(dueTime).isBefore(dayjs(completeTime))) {
return "color-red";
}
}
},
},
{
label: "创建人",
prop: "createdBy",
width: "140px",
align: "left",
formatter: (row) => {
return row.createdBy || "-";
},
},
{
label: "创建时间",
prop: "createdDate",
width: "180px",
align: "left",
formatter: (row) => {
return row.createdDate || "-";
},
},
];
}