sooyie-task 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,481 @@
1
+ import { defineComponent as Z, getCurrentInstance as ee, ref as C, onActivated as te, resolveComponent as r, resolveDirective as ae, createElementBlock as y, openBlock as p, createElementVNode as c, createVNode as l, withCtx as a, withKeys as _, unref as o, Fragment as oe, renderList as se, createBlock as V, createTextVNode as I, toDisplayString as d, withDirectives as N, createCommentVNode as le, isRef as E } from "vue";
2
+ import { RedirectPage as ne, Layout as T, LoginPage as re, ProfilePage as ue, DashboardPage as de, Error401Page as ie, Error404Page as me, useUserStore as R, clearEmpty as L, request as U, useTableHooks as pe } from "jmash-core";
3
+ import { useI18n as ce } from "vue-i18n";
4
+ import { D as m, C as z } from "./index-DvawPwK3.mjs";
5
+ import { createRouter as fe, createWebHistory as ke } from "vue-router";
6
+ import { t as he } from "./index-CEvxhWYT.mjs";
7
+ const be = [
8
+ {
9
+ path: "/redirect",
10
+ component: T,
11
+ meta: { hidden: !0 },
12
+ children: [
13
+ {
14
+ path: "/redirect/:path(.*)",
15
+ component: ne
16
+ }
17
+ ]
18
+ },
19
+ {
20
+ path: "/login",
21
+ component: re,
22
+ meta: { hidden: !0 }
23
+ },
24
+ {
25
+ path: "/my",
26
+ component: T,
27
+ meta: { hidden: !0 },
28
+ redirect: "noredirect",
29
+ children: [
30
+ {
31
+ path: "profile",
32
+ component: ue,
33
+ name: "Profile",
34
+ meta: { title: "个人中心", icon: "user" }
35
+ }
36
+ ]
37
+ },
38
+ {
39
+ path: "/",
40
+ name: "/",
41
+ component: T,
42
+ redirect: "/dashboard",
43
+ children: [
44
+ {
45
+ path: "/dashboard",
46
+ component: de,
47
+ name: "Dashboard",
48
+ // 用于 keep-alive, 必须与SFC自动推导或者显示声明的组件name一致
49
+ // https://cn.vuejs.org/guide/built-ins/keep-alive.html#include-exclude
50
+ meta: {
51
+ title: "Dashboard",
52
+ icon: "homepage",
53
+ affix: !0,
54
+ keepAlive: !0,
55
+ alwaysShow: !1
56
+ }
57
+ },
58
+ {
59
+ path: "401",
60
+ component: ie,
61
+ meta: { hidden: !0 }
62
+ },
63
+ {
64
+ path: "404",
65
+ component: me,
66
+ meta: { hidden: !0 }
67
+ }
68
+ ]
69
+ }
70
+ ], ve = fe({
71
+ history: ke(void 0),
72
+ routes: be,
73
+ // 刷新时,滚动条位置还原
74
+ scrollBehavior: () => ({ left: 0, top: 0 })
75
+ });
76
+ class ge {
77
+ getKey() {
78
+ return {};
79
+ }
80
+ // 查询翻页信息任务实例
81
+ findPage(u) {
82
+ const f = R().user.tenant;
83
+ return L(u), u && (u.hasStatus = u.status !== void 0, u.hasSort = u.sort !== void 0), U({
84
+ url: "/v1/front/task/sooyie/task/page/" + f,
85
+ method: "get",
86
+ params: u
87
+ });
88
+ }
89
+ // 查询列表信息任务实例
90
+ findList(u) {
91
+ const f = R().user.tenant;
92
+ return L(u), U({
93
+ url: "/v1/front/task/sooyie/task/list/" + f,
94
+ method: "get",
95
+ params: u
96
+ });
97
+ }
98
+ }
99
+ const ye = new ge(), Ie = { class: "app-container" }, we = { class: "search-container" }, _e = { key: 0 }, Se = { key: 1 }, De = ["onClick"], Re = /* @__PURE__ */ Z({
100
+ __name: "index",
101
+ setup(B) {
102
+ const { proxy: u } = ee(), { t: f } = ce();
103
+ m.OrgBizDict.useValues(), m.UserExtBizDict.useValues(), m.itemBizLayDict.useValues();
104
+ const n = C({}), {
105
+ tableHooks: i,
106
+ multipleTableRef: j,
107
+ queryFormRef: K,
108
+ listLoading: A,
109
+ tableData: Q,
110
+ total: w
111
+ } = pe(f, ye, n), k = C([]);
112
+ function x(s) {
113
+ k.value.length === 0 && he.getEnum({ className: z.TASKSORT_TYPE, type: 1 }).then((b) => {
114
+ k.value = b.data.values;
115
+ });
116
+ const t = k.value.find((b) => b.key === s);
117
+ return t ? t.value : "";
118
+ }
119
+ let h = C([
120
+ // 任务主题
121
+ {
122
+ label: "taskInst.taskName",
123
+ prop: "taskName",
124
+ minWidth: "150",
125
+ sortable: "custom",
126
+ isColumn: !0
127
+ },
128
+ // 任务类型
129
+ {
130
+ label: "taskInst.sort",
131
+ prop: "sort",
132
+ slotName: "sort",
133
+ columnType: "slot",
134
+ minWidth: "150",
135
+ sortable: "custom",
136
+ isColumn: !0
137
+ },
138
+ // 服务对象
139
+ {
140
+ label: "taskInst.customerTagId",
141
+ prop: "customerTagId",
142
+ slotName: "customerTagId",
143
+ columnType: "slot",
144
+ minWidth: "150",
145
+ sortable: "custom",
146
+ isColumn: !0
147
+ },
148
+ // 开始日期
149
+ {
150
+ label: "taskInst.startDate",
151
+ prop: "startDate",
152
+ width: "105",
153
+ sortable: "custom",
154
+ isColumn: !0
155
+ },
156
+ // 截止日期
157
+ {
158
+ label: "taskInst.endDate",
159
+ prop: "endDate",
160
+ width: "105",
161
+ sortable: "custom",
162
+ isColumn: !0
163
+ },
164
+ // 执行人员
165
+ {
166
+ label: "taskInst.userId",
167
+ prop: "userId",
168
+ slotName: "userId",
169
+ columnType: "slot",
170
+ width: "105",
171
+ sortable: "custom",
172
+ isColumn: !0
173
+ },
174
+ // 已读状态
175
+ {
176
+ label: "taskInst.readStatus",
177
+ prop: "readStatus",
178
+ slotName: "readStatus",
179
+ columnType: "slot",
180
+ width: "105",
181
+ sortable: "custom",
182
+ isColumn: !0
183
+ },
184
+ // 完成状态
185
+ {
186
+ label: "taskInst.status",
187
+ prop: "status",
188
+ slotName: "status",
189
+ columnType: "slot",
190
+ width: "105",
191
+ sortable: "custom",
192
+ isColumn: !0
193
+ },
194
+ // 完成进度
195
+ {
196
+ label: "taskInst.percent",
197
+ prop: "percent",
198
+ slotName: "percent",
199
+ columnType: "slot",
200
+ width: "105",
201
+ sortable: "custom",
202
+ isColumn: !0
203
+ },
204
+ // 完成时间
205
+ {
206
+ label: "taskInst.finishDate",
207
+ prop: "finishDate",
208
+ slotName: "finishDate",
209
+ columnType: "slot",
210
+ width: "160",
211
+ sortable: "custom",
212
+ isColumn: !0
213
+ },
214
+ {
215
+ label: "common.operate",
216
+ width: "60",
217
+ slotName: "operation",
218
+ columnType: "slot",
219
+ fixed: "right",
220
+ isColumn: !0
221
+ }
222
+ ]);
223
+ function H(s) {
224
+ ve.push({
225
+ path: "/task/task-inst/info",
226
+ query: {
227
+ taskInstId: s.taskInstId,
228
+ taskSort: s.sort,
229
+ taskDefineId: s.taskDefineId
230
+ }
231
+ });
232
+ }
233
+ function Y(s) {
234
+ i.selectionRows.value = s;
235
+ }
236
+ function O(s) {
237
+ i.handleSort(s.prop, s.order);
238
+ }
239
+ return te(() => {
240
+ i.getList();
241
+ }), (s, t) => {
242
+ const b = r("el-input"), v = r("el-form-item"), g = r("el-col"), W = r("el-option"), F = r("el-select"), $ = r("jmash-select"), S = r("el-row"), D = r("el-button"), M = r("el-form"), q = r("jmash-column-select"), G = r("jmash-table"), J = r("jmash-pagination"), X = r("el-card"), P = ae("hasPerm");
243
+ return p(), y("div", Ie, [
244
+ c("div", we, [
245
+ l(M, {
246
+ ref_key: "queryFormRef",
247
+ ref: K,
248
+ model: n.value,
249
+ inline: !0
250
+ }, {
251
+ default: a(() => [
252
+ l(S, null, {
253
+ default: a(() => [
254
+ l(g, { span: 6 }, {
255
+ default: a(() => [
256
+ l(v, {
257
+ label: s.$t("taskInst.keyword"),
258
+ prop: "keyword"
259
+ }, {
260
+ default: a(() => [
261
+ l(b, {
262
+ modelValue: n.value.keyword,
263
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => n.value.keyword = e),
264
+ placeholder: s.$t("taskInst.keywordRequired"),
265
+ onKeyup: t[1] || (t[1] = _((e) => o(i).handleQuery(), ["enter"])),
266
+ class: "!w-[203px]"
267
+ }, null, 8, ["modelValue", "placeholder"])
268
+ ]),
269
+ _: 1
270
+ }, 8, ["label"])
271
+ ]),
272
+ _: 1
273
+ }),
274
+ l(g, { span: 6 }, {
275
+ default: a(() => [
276
+ l(v, {
277
+ label: s.$t("taskDefine.taskSort"),
278
+ prop: "sort"
279
+ }, {
280
+ default: a(() => [
281
+ l(F, {
282
+ modelValue: n.value.sort,
283
+ "onUpdate:modelValue": t[2] || (t[2] = (e) => n.value.sort = e),
284
+ data: k.value,
285
+ placeholder: s.$t("taskDefine.taskSort"),
286
+ onKeyup: t[3] || (t[3] = _((e) => o(i).handleQuery(), ["enter"])),
287
+ class: "!w-[203px]"
288
+ }, {
289
+ default: a(() => [
290
+ (p(!0), y(oe, null, se(k.value, (e) => (p(), V(W, {
291
+ key: e.key,
292
+ label: e.value,
293
+ value: e.key
294
+ }, null, 8, ["label", "value"]))), 128))
295
+ ]),
296
+ _: 1
297
+ }, 8, ["modelValue", "data", "placeholder"])
298
+ ]),
299
+ _: 1
300
+ }, 8, ["label"])
301
+ ]),
302
+ _: 1
303
+ }),
304
+ l(g, { span: 6 }, {
305
+ default: a(() => [
306
+ l(v, {
307
+ label: s.$t("taskInst.readStatus"),
308
+ prop: "readStatus"
309
+ }, {
310
+ default: a(() => [
311
+ l($, {
312
+ modelValue: n.value.readStatus,
313
+ "onUpdate:modelValue": t[4] || (t[4] = (e) => n.value.readStatus = e),
314
+ data: o(m).readStatusDict.values,
315
+ placeholder: s.$t("taskInst.readStatus"),
316
+ onKeyup: t[5] || (t[5] = _((e) => o(i).handleQuery(), ["enter"])),
317
+ class: "!w-[203px]"
318
+ }, null, 8, ["modelValue", "data", "placeholder"])
319
+ ]),
320
+ _: 1
321
+ }, 8, ["label"])
322
+ ]),
323
+ _: 1
324
+ }),
325
+ l(g, { span: 6 }, {
326
+ default: a(() => [
327
+ l(v, {
328
+ label: s.$t("taskInst.status"),
329
+ prop: "status"
330
+ }, {
331
+ default: a(() => [
332
+ l($, {
333
+ modelValue: n.value.status,
334
+ "onUpdate:modelValue": t[6] || (t[6] = (e) => n.value.status = e),
335
+ data: o(m).taskStatusEnum.values,
336
+ placeholder: s.$t("taskInst.statusRequired"),
337
+ onKeyup: t[7] || (t[7] = _((e) => o(i).handleQuery(), ["enter"])),
338
+ class: "!w-[203px]"
339
+ }, null, 8, ["modelValue", "data", "placeholder"])
340
+ ]),
341
+ _: 1
342
+ }, 8, ["label"])
343
+ ]),
344
+ _: 1
345
+ })
346
+ ]),
347
+ _: 1
348
+ }),
349
+ l(S),
350
+ l(v, { class: "search-btn" }, {
351
+ default: a(() => [
352
+ l(D, {
353
+ type: "primary",
354
+ onClick: t[8] || (t[8] = (e) => o(i).handleQuery())
355
+ }, {
356
+ default: a(() => [
357
+ I(d(s.$t("common.search")), 1)
358
+ ]),
359
+ _: 1
360
+ }),
361
+ l(D, {
362
+ onClick: t[9] || (t[9] = (e) => o(i).resetQuery())
363
+ }, {
364
+ default: a(() => [
365
+ I(d(s.$t("common.reset")), 1)
366
+ ]),
367
+ _: 1
368
+ })
369
+ ]),
370
+ _: 1
371
+ })
372
+ ]),
373
+ _: 1
374
+ }, 8, ["model"]),
375
+ t[16] || (t[16] = c("div", { class: "clear" }, null, -1))
376
+ ]),
377
+ l(X, {
378
+ shadow: "never",
379
+ class: "table-container"
380
+ }, {
381
+ header: a(() => [
382
+ l(S, null, {
383
+ default: a(() => [
384
+ l(g, {
385
+ span: 24,
386
+ class: "container-float"
387
+ }, {
388
+ default: a(() => [
389
+ N((p(), V(D, {
390
+ plain: "",
391
+ type: "primary",
392
+ onClick: t[10] || (t[10] = (e) => o(i).handleExport(o(f)("task.taskInst.name")))
393
+ }, {
394
+ default: a(() => [
395
+ I(d(s.$t("common.export")), 1)
396
+ ]),
397
+ _: 1
398
+ })), [
399
+ [P, ["task:task:export"]]
400
+ ]),
401
+ l(q, {
402
+ modelValue: o(h),
403
+ "onUpdate:modelValue": t[11] || (t[11] = (e) => E(h) ? h.value = e : h = e),
404
+ "label-name": "task/task"
405
+ }, null, 8, ["modelValue"])
406
+ ]),
407
+ _: 1
408
+ })
409
+ ]),
410
+ _: 1
411
+ })
412
+ ]),
413
+ footer: a(() => [
414
+ o(w) > 0 ? (p(), V(J, {
415
+ key: 0,
416
+ total: o(w),
417
+ "onUpdate:total": t[12] || (t[12] = (e) => E(w) ? w.value = e : null),
418
+ "current-page": n.value.curPage,
419
+ "onUpdate:currentPage": t[13] || (t[13] = (e) => n.value.curPage = e),
420
+ "page-size": n.value.pageSize,
421
+ "onUpdate:pageSize": t[14] || (t[14] = (e) => n.value.pageSize = e),
422
+ onPagination: t[15] || (t[15] = (e) => o(i).getList())
423
+ }, null, 8, ["total", "current-page", "page-size"])) : le("", !0)
424
+ ]),
425
+ default: a(() => [
426
+ l(G, {
427
+ ref_key: "multipleTableRef",
428
+ ref: j,
429
+ "row-key": "taskInstId",
430
+ "list-loading": o(A),
431
+ data: o(Q),
432
+ "table-label": o(h),
433
+ onSelectionChange: Y,
434
+ onSortChange: O
435
+ }, {
436
+ sort: a((e) => [
437
+ c("span", null, d(x(e.data.row.sort)), 1)
438
+ ]),
439
+ customerTagId: a((e) => [
440
+ e.data.row.sort === o(z).CUSTOMER ? (p(), y("span", _e, d(o(m).OrgBizDict.getValue(e.data.row.annivCustomerId)), 1)) : (p(), y("span", Se, d(o(m).itemBizLayDict.getValue(e.data.row.annivCustomerId)), 1))
441
+ ]),
442
+ readStatus: a((e) => [
443
+ c("span", null, d(o(m).readStatusDict.getValue(e.data.row.readStatus)), 1)
444
+ ]),
445
+ status: a((e) => [
446
+ c("span", null, d(o(m).taskStatusEnum.getEnumValue(e.data.row.status)), 1)
447
+ ]),
448
+ percent: a((e) => [
449
+ c("span", null, d(e.data.row.percent) + "% ", 1)
450
+ ]),
451
+ finishDate: a((e) => [
452
+ I(d(o(u).$moment.formatDate(
453
+ e.data.row.finishDate,
454
+ "YYYY-MM-DD HH:mm:ss"
455
+ )), 1)
456
+ ]),
457
+ userId: a((e) => [
458
+ c("span", null, d(o(m).UserExtBizDict.getValue(e.data.row.userId)), 1)
459
+ ]),
460
+ operation: a((e) => [
461
+ N((p(), y("span", {
462
+ class: "el-button-color",
463
+ onClick: (Ce) => H(e.data.row)
464
+ }, [
465
+ I(d(s.$t("common.view")), 1)
466
+ ], 8, De)), [
467
+ [P, ["task:task:delete"]]
468
+ ])
469
+ ]),
470
+ _: 1
471
+ }, 8, ["list-loading", "data", "table-label"])
472
+ ]),
473
+ _: 1
474
+ })
475
+ ]);
476
+ };
477
+ }
478
+ });
479
+ export {
480
+ Re as default
481
+ };