sooyie-task 0.0.4 → 0.0.5

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.
@@ -1,564 +0,0 @@
1
- import { defineComponent as H, ref as R, toRefs as ie, watchEffect as de, computed as ue, resolveComponent as u, createBlock as k, openBlock as _, withCtx as n, createElementBlock as D, createVNode as t, unref as a, mergeModels as G, useModel as me, reactive as ce, watch as pe, Fragment as X, createCommentVNode as V, createTextVNode as O, toDisplayString as E, createElementVNode as x, renderList as fe } from "vue";
2
- import { p as _e, u as ye } from "./index-DaJ5KrbS.mjs";
3
- import { useUserStore as C, clearEmpty as N, request as U, fileApi as $, useUserStoreHook as ge } from "jmash-core";
4
- import { E as K } from "./el-message-Bod6C9wB.mjs";
5
- import { useI18n as Ie } from "vue-i18n";
6
- import { D as h, R as ve, C as f } from "./index-DvawPwK3.mjs";
7
- import { t as he } from "./index-BYV5ylFn.mjs";
8
- import { _ as ke } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
9
- class be {
10
- getKey(s) {
11
- return {
12
- taskInstId: s.taskInstId
13
- };
14
- }
15
- // 查询翻页信息任务实例
16
- findPage(s) {
17
- const g = C().user.tenant;
18
- return N(s), s && (s.hasStatus = s.status !== void 0), U({
19
- url: "/v1/front/task/sooyie/my_task/page/" + g,
20
- method: "get",
21
- params: s
22
- });
23
- }
24
- // 查询列表信息任务实例
25
- findList(s) {
26
- const g = C().user.tenant;
27
- return N(s), U({
28
- url: "/v1/task/task_inst/list/" + g,
29
- method: "get",
30
- params: s
31
- });
32
- }
33
- // 查询列表信息任务实例
34
- findMyTaskList(s) {
35
- const g = C().user.tenant;
36
- return N(s), U({
37
- url: "/v1/front/task/sooyie/my_task/list/" + g,
38
- method: "get",
39
- params: s
40
- });
41
- }
42
- // 查询任务实例
43
- findById(s) {
44
- const g = C().user.tenant;
45
- return N(s), U({
46
- url: "/v1/front/task/sooyie/task_inst/id/" + g + "/" + s.taskInstId,
47
- method: "get",
48
- params: s
49
- });
50
- }
51
- // 设置我的任务已读状态
52
- setReadStatus(s) {
53
- return s.tenant = C().user.tenant, N(s), U({
54
- url: "/v1/front/task/sooyie/my_task/read_status",
55
- method: "put",
56
- data: s
57
- });
58
- }
59
- // 导出任务记录Excel文件
60
- // exportExcel(queryParams: TaskRecordExportReq): AxiosPromise {
61
- // const tenant = useUserStore().user.tenant;
62
- // clearEmpty(queryParams);
63
- // const query = qs.stringify(queryParams, {
64
- // arrayFormat: "brackets",
65
- // allowDots: true,
66
- // });
67
- // return request({
68
- // url: "/v1/task/task_record/" + tenant + "/task_records.xlsx?" + query,
69
- // method: "get",
70
- // responseType: "blob",
71
- // });
72
- // }
73
- }
74
- const Ve = new be(), Se = ["src"], Re = /* @__PURE__ */ H({
75
- __name: "index",
76
- props: {
77
- pictureUrl: {
78
- type: String,
79
- default: ""
80
- },
81
- // 宽
82
- width: {
83
- type: Number,
84
- default: 80
85
- },
86
- // 高
87
- height: {
88
- type: Number,
89
- default: 80
90
- },
91
- // 类型
92
- type: {
93
- type: String,
94
- default: "resize"
95
- }
96
- },
97
- emits: ["imageSrc"],
98
- setup(w, { emit: s }) {
99
- const g = R($.uploadUrl()), M = R($.authHeader()), I = w, { pictureUrl: L } = ie(I), b = R("");
100
- b.value = L.value;
101
- const i = s;
102
- function o(S) {
103
- S.fileId && (K({
104
- message: "上传成功",
105
- type: "success"
106
- }), b.value = S.fileId, i("imageSrc", S));
107
- }
108
- de(() => {
109
- b.value = I.pictureUrl;
110
- });
111
- const B = ue(
112
- () => $.imageUrl(b.value, I.width, I.height, I.type)
113
- );
114
- return (S, A) => {
115
- const T = u("el-icon"), Y = u("el-upload");
116
- return _(), k(Y, {
117
- class: "avatar-uploader",
118
- action: g.value,
119
- headers: M.value,
120
- "show-file-list": !1,
121
- "on-success": o
122
- }, {
123
- default: n(() => [
124
- b.value ? (_(), D("img", {
125
- key: 0,
126
- src: B.value,
127
- class: "avatar",
128
- alt: ""
129
- }, null, 8, Se)) : (_(), k(T, {
130
- key: 1,
131
- class: "avatar-uploader-icon"
132
- }, {
133
- default: n(() => [
134
- t(a(_e))
135
- ]),
136
- _: 1
137
- }))
138
- ]),
139
- _: 1
140
- }, 8, ["action", "headers"]);
141
- };
142
- }
143
- }), we = {
144
- key: 0,
145
- class: "margin-top"
146
- }, Oe = { class: "dialog-footer" }, Ee = /* @__PURE__ */ H({
147
- __name: "report",
148
- props: /* @__PURE__ */ G({
149
- entityKey: {
150
- type: Object,
151
- default: () => {
152
- }
153
- }
154
- }, {
155
- modelValue: { type: Boolean },
156
- modelModifiers: {}
157
- }),
158
- emits: /* @__PURE__ */ G(["refresh"], ["update:modelValue"]),
159
- setup(w, { emit: s }) {
160
- const g = ge(), { t: M } = Ie(), I = me(w, "modelValue"), L = R(), b = ({ rowIndex: r, columnIndex: e }) => {
161
- if (e === 1) {
162
- if (r === 0)
163
- return { rowspan: 3, colspan: 1 };
164
- if (r < 3)
165
- return { rowspan: 0, colspan: 0 };
166
- }
167
- return e === 7 ? { rowspan: 1, colspan: 1 } : { rowspan: 1, colspan: 1 };
168
- }, i = w;
169
- let o = ce({
170
- requestId: Math.random() * 10 + "",
171
- records: [],
172
- govOrgId: "",
173
- itsmId: "",
174
- type: i.entityKey.sort,
175
- taskInstId: i.entityKey.taskInstId,
176
- file: [],
177
- date: (/* @__PURE__ */ new Date()).toISOString()
178
- });
179
- console.log(i.entityKey, "=> props.entityKey.taskDefineId"), Promise.all([
180
- h.itemBizLayDict.useValues(),
181
- h.OrgBizDict.useValues()
182
- ]).then(() => {
183
- Ve.findById({ taskInstId: i.entityKey.taskInstId }).then((r) => {
184
- const e = r.data.annivCustomerId;
185
- e && (o.itsmId = e), ve.findList({ inspectId: r.data.actionId }).then((m) => {
186
- o.records = m.data.results.map((y) => ({
187
- ...y,
188
- mattersResult: "",
189
- problem: "",
190
- proposal: "",
191
- file: {}
192
- }));
193
- });
194
- });
195
- }), pe(
196
- () => o.itsmId,
197
- (r) => {
198
- if (!r) {
199
- o.govOrgId = "";
200
- return;
201
- }
202
- const e = h.itemBizLayDict.values.find(
203
- // itsmId对应Dict.itemBizLayDict的key
204
- (m) => m.key === r
205
- );
206
- if (e) {
207
- const m = e.orgId, y = h.OrgBizDict.values.find(
208
- // 省直单位ID对应Dict.OrgBizDict的key
209
- (v) => v.key === m
210
- );
211
- y ? o.govOrgId = y.key : (o.govOrgId = "", K.warning("未找到对应的省直单位"));
212
- } else
213
- o.govOrgId = "", K.warning("未找到对应的运维项目");
214
- },
215
- { immediate: !0 }
216
- );
217
- function B(r, e) {
218
- console.log(r, e, "=>row ");
219
- const m = {
220
- fileId: e.fileId,
221
- fileSrc: e.fileSrc,
222
- fileName: e.fileName
223
- };
224
- console.log(m, "=>file "), r.file = m;
225
- }
226
- const S = (r) => {
227
- r.mattersResult === "true" && (r.problem = "", r.proposal = "");
228
- }, A = R(!1), T = R();
229
- function Y() {
230
- A.value = !0, T.value.clearFileList();
231
- }
232
- function J(r) {
233
- const e = {
234
- fileName: r.name,
235
- fileId: r.response.fileId,
236
- fileSort: i.entityKey.sort
237
- };
238
- o.file || (o.file = []), o.file.push(e);
239
- }
240
- function Q(r) {
241
- var e;
242
- (e = o.file) == null || e.splice(r, 1);
243
- }
244
- const Z = s, q = async () => {
245
- var y, v, F;
246
- if (!await ((y = L.value) == null ? void 0 : y.validate())) return;
247
- let e = !0;
248
- const m = [];
249
- if ((v = o.records) == null || v.forEach((d, c) => {
250
- d.mattersResult === "true" && i.entityKey.sort !== f.LOG_ANALYSIS && (!d.file || !d.file.fileId) && (e = !1, m.push(`第 ${c + 1} 行:请上传截图`)), d.mattersResult === "false" && i.entityKey.sort !== f.LOG_ANALYSIS && (d.problem || (e = !1, m.push(`第 ${c + 1} 行:请填写问题记录`)), d.proposal || (e = !1, m.push(`第 ${c + 1} 行:请填写处置建议`)));
251
- }), !e) {
252
- m.forEach((d) => {
253
- K.error(d);
254
- });
255
- return;
256
- }
257
- o.records = (F = o.records) == null ? void 0 : F.map((d) => ({
258
- mattersId: d.mattersId,
259
- mattersResult: d.mattersResult,
260
- problem: d.problem,
261
- proposal: d.proposal,
262
- file: d.file || {}
263
- })), he.create(o).then((d) => {
264
- d.status === 200 && (K.success(M("common.submitSuccess")), I.value = !1, Z("refresh", !0));
265
- });
266
- };
267
- function z() {
268
- I.value && (I.value = !1);
269
- }
270
- return (r, e) => {
271
- const m = u("jmash-select"), y = u("el-form-item"), v = u("el-col"), F = u("el-date-picker"), d = u("el-input"), c = u("el-table-column"), j = u("jmash-enum-radio"), ee = Re, te = u("el-table"), le = u("el-row"), ae = u("el-form"), P = u("el-button"), oe = u("CircleClose"), se = u("el-icon"), re = u("el-dialog"), ne = u("jmash-multi-upload");
272
- return _(), D(X, null, [
273
- t(re, {
274
- modelValue: I.value,
275
- "onUpdate:modelValue": e[3] || (e[3] = (l) => I.value = l),
276
- onClose: z,
277
- width: "1300px"
278
- }, {
279
- footer: n(() => [
280
- x("div", Oe, [
281
- t(P, { onClick: z }, {
282
- default: n(() => [
283
- O(E(r.$t("common.cancel")), 1)
284
- ]),
285
- _: 1
286
- }),
287
- t(P, {
288
- type: "primary",
289
- onClick: q
290
- }, {
291
- default: n(() => [
292
- O(E(r.$t("common.confirm")), 1)
293
- ]),
294
- _: 1
295
- })
296
- ])
297
- ]),
298
- default: n(() => [
299
- t(ae, {
300
- ref_key: "taskReportFormRef",
301
- ref: L,
302
- model: a(o),
303
- "label-width": "120",
304
- "label-position": "top"
305
- }, {
306
- default: n(() => [
307
- t(le, null, {
308
- default: n(() => [
309
- t(v, { span: 6 }, {
310
- default: n(() => [
311
- t(y, {
312
- label: "省直单位名称:",
313
- prop: "govOrgId"
314
- }, {
315
- default: n(() => [
316
- t(m, {
317
- modelValue: a(o).govOrgId,
318
- "onUpdate:modelValue": e[0] || (e[0] = (l) => a(o).govOrgId = l),
319
- data: a(h).OrgBizDict.values,
320
- "show-word-limit": "",
321
- clearable: "",
322
- required: "",
323
- disabled: !0
324
- }, null, 8, ["modelValue", "data"])
325
- ]),
326
- _: 1
327
- })
328
- ]),
329
- _: 1
330
- }),
331
- t(v, { span: 6 }, {
332
- default: n(() => [
333
- t(y, {
334
- label: "运维项目:",
335
- prop: "itsmId"
336
- }, {
337
- default: n(() => [
338
- t(m, {
339
- modelValue: a(o).itsmId,
340
- "onUpdate:modelValue": e[1] || (e[1] = (l) => a(o).itsmId = l),
341
- data: a(h).itemBizLayDict.values,
342
- "show-word-limit": "",
343
- clearable: "",
344
- required: "",
345
- disabled: !0
346
- }, null, 8, ["modelValue", "data"])
347
- ]),
348
- _: 1
349
- })
350
- ]),
351
- _: 1
352
- }),
353
- t(v, { span: 6 }, {
354
- default: n(() => [
355
- t(y, {
356
- label: "巡检日期:",
357
- prop: "date"
358
- }, {
359
- default: n(() => [
360
- t(F, {
361
- modelValue: a(o).date,
362
- "onUpdate:modelValue": e[2] || (e[2] = (l) => a(o).date = l),
363
- type: "date",
364
- format: "YYYY-MM-DD",
365
- "value-format": "YYYY-MM-DD",
366
- disabled: !0
367
- }, null, 8, ["modelValue"])
368
- ]),
369
- _: 1
370
- })
371
- ]),
372
- _: 1
373
- }),
374
- t(v, { span: 6 }, {
375
- default: n(() => [
376
- t(y, {
377
- label: "巡检人:",
378
- prop: "realName"
379
- }, {
380
- default: n(() => [
381
- t(d, {
382
- value: a(g).user.realName,
383
- "show-word-limit": "",
384
- clearable: "",
385
- disabled: !0,
386
- class: "!w-[203px]"
387
- }, null, 8, ["value"])
388
- ]),
389
- _: 1
390
- })
391
- ]),
392
- _: 1
393
- }),
394
- t(te, {
395
- data: a(o).records,
396
- "span-method": b,
397
- border: "",
398
- style: { width: "100%", "margin-top": "20px" }
399
- }, {
400
- default: n(() => [
401
- t(c, {
402
- type: "index",
403
- label: "序号",
404
- width: "60"
405
- }),
406
- t(c, {
407
- prop: "mattersDimension",
408
- label: "检查维度"
409
- }),
410
- t(c, {
411
- prop: "mattersItem",
412
- label: "检查项目"
413
- }),
414
- t(c, {
415
- prop: "mattersWay",
416
- label: "检查内容与方法"
417
- }),
418
- t(c, {
419
- prop: "mattersStandard",
420
- label: "达标标准"
421
- }),
422
- i.entityKey.sort === a(f).HARDWARE ? (_(), k(c, {
423
- key: 0,
424
- prop: "riskLevel",
425
- label: "风险等级"
426
- }, {
427
- default: n((l) => [
428
- O(E(a(h).riskLevelEnum.getEnumValue(l.row.riskLevel)), 1)
429
- ]),
430
- _: 1
431
- })) : V("", !0),
432
- i.entityKey.sort === a(f).EXPERT_INSPECTION || i.entityKey.sort === a(f).SOFTWARE ? (_(), k(c, {
433
- key: 1,
434
- label: "巡检结果",
435
- width: "180"
436
- }, {
437
- default: n((l) => [
438
- t(j, {
439
- modelValue: l.row.mattersResult,
440
- "onUpdate:modelValue": (p) => l.row.mattersResult = p,
441
- data: a(h).mattersResultDict.values,
442
- onChange: (p) => S(l.row)
443
- }, null, 8, ["modelValue", "onUpdate:modelValue", "data", "onChange"])
444
- ]),
445
- _: 1
446
- })) : V("", !0),
447
- i.entityKey.sort === a(f).LOG_ANALYSIS ? (_(), k(c, {
448
- key: 2,
449
- label: "结果",
450
- width: "180"
451
- }, {
452
- default: n((l) => [
453
- t(j, {
454
- modelValue: l.row.mattersResult,
455
- "onUpdate:modelValue": (p) => l.row.mattersResult = p,
456
- data: a(h).logResultDict.values
457
- }, null, 8, ["modelValue", "onUpdate:modelValue", "data"])
458
- ]),
459
- _: 1
460
- })) : V("", !0),
461
- i.entityKey.sort === a(f).EXPERT_INSPECTION || i.entityKey.sort === a(f).SOFTWARE ? (_(), k(c, {
462
- key: 3,
463
- label: "截图/拍照"
464
- }, {
465
- default: n((l) => {
466
- var p;
467
- return [
468
- t(ee, {
469
- "picture-url": (p = l.row.file) == null ? void 0 : p.fileSrc,
470
- onImageSrc: (W) => B(l.row, W),
471
- width: 80,
472
- type: "trans"
473
- }, null, 8, ["picture-url", "onImageSrc"])
474
- ];
475
- }),
476
- _: 1
477
- })) : V("", !0),
478
- i.entityKey.sort === a(f).EXPERT_INSPECTION || i.entityKey.sort === a(f).SOFTWARE ? (_(), k(c, {
479
- key: 4,
480
- label: "问题记录"
481
- }, {
482
- default: n((l) => [
483
- t(d, {
484
- modelValue: l.row.problem,
485
- "onUpdate:modelValue": (p) => l.row.problem = p,
486
- placeholder: l.row.mattersResult === "false" ? "请输入问题记录" : ""
487
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
488
- ]),
489
- _: 1
490
- })) : V("", !0),
491
- i.entityKey.sort === a(f).EXPERT_INSPECTION || i.entityKey.sort === a(f).SOFTWARE ? (_(), k(c, {
492
- key: 5,
493
- label: "处置建议"
494
- }, {
495
- default: n((l) => [
496
- t(d, {
497
- modelValue: l.row.proposal,
498
- "onUpdate:modelValue": (p) => l.row.proposal = p,
499
- placeholder: l.row.mattersResult === "false" ? "请输入处置建议" : ""
500
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
501
- ]),
502
- _: 1
503
- })) : V("", !0)
504
- ]),
505
- _: 1
506
- }, 8, ["data"])
507
- ]),
508
- _: 1
509
- })
510
- ]),
511
- _: 1
512
- }, 8, ["model"]),
513
- i.entityKey.sort === a(f).LOG_ANALYSIS ? (_(), D("div", we, [
514
- e[5] || (e[5] = x("span", null, "日志附件:", -1)),
515
- t(P, {
516
- type: "primary",
517
- icon: a(ye),
518
- onClick: Y,
519
- class: "margin-left"
520
- }, {
521
- default: n(() => [
522
- O(E(r.$t("common.uploadFiles")), 1)
523
- ]),
524
- _: 1
525
- }, 8, ["icon"]),
526
- (_(!0), D(X, null, fe(a(o).file, (l, p) => (_(), D("div", {
527
- key: p,
528
- class: "files-list"
529
- }, [
530
- O(E(l.fileName) + " ", 1),
531
- t(se, {
532
- size: "16",
533
- class: "icon-right",
534
- onClick: (W) => Q(p)
535
- }, {
536
- default: n(() => [
537
- t(oe)
538
- ]),
539
- _: 1
540
- }, 8, ["onClick"])
541
- ]))), 128))
542
- ])) : V("", !0)
543
- ]),
544
- _: 1
545
- }, 8, ["modelValue"]),
546
- t(ne, {
547
- ref_key: "uploadRef",
548
- ref: T,
549
- modelValue: A.value,
550
- "onUpdate:modelValue": e[4] || (e[4] = (l) => A.value = l),
551
- onUploadFileList: J
552
- }, null, 8, ["modelValue"])
553
- ], 64);
554
- };
555
- }
556
- }), Ce = /* @__PURE__ */ ke(Ee, [["__scopeId", "data-v-38d5ac41"]]), Me = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
557
- __proto__: null,
558
- default: Ce
559
- }, Symbol.toStringTag, { value: "Module" }));
560
- export {
561
- Ce as a,
562
- Me as r,
563
- Ve as t
564
- };