sooyie-task 0.0.11 → 0.0.13

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