sooyie-task 0.0.14 → 0.0.15

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,335 @@
1
+ import { defineComponent as Q, mergeModels as W, ref as B, reactive as $, useModel as X, watch as Z, resolveComponent as i, createBlock as z, openBlock as M, withCtx as u, createVNode as o, unref as d, createSlots as w, createCommentVNode as ee, createTextVNode as V, toDisplayString as h, createElementVNode as te } from "vue";
2
+ import { ElMessage as le } from "element-plus";
3
+ import { useI18n as oe } from "vue-i18n";
4
+ import { D as _, O as A, U as x, C as I } from "./index-BUfsHvCP.mjs";
5
+ import { useUserStore as C, clearEmpty as b, request as R } from "jmash-core";
6
+ import { d as ae, p as se } from "./index-DaJ5KrbS.mjs";
7
+ import { useRoute as ne } from "vue-router";
8
+ import { _ as re } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
9
+ class ue {
10
+ getKey() {
11
+ return {};
12
+ }
13
+ // 任务定义查询接口
14
+ findTaskRelById(n) {
15
+ const m = C().user.tenant;
16
+ return b(n), R({
17
+ url: "/v1/front/task/sooyie/task_define_rel/id/" + m + "/" + (n == null ? void 0 : n.taskDefineId),
18
+ method: "get",
19
+ params: n
20
+ });
21
+ }
22
+ // 删除任务关系
23
+ deleteTaskRelById(n) {
24
+ return n.tenant = C().user.tenant, b(n), R({
25
+ url: "/v1/front/task/sooyie/task_define_rel/id",
26
+ method: "delete",
27
+ params: n
28
+ });
29
+ }
30
+ //创建任务关系
31
+ addTaskRel(n) {
32
+ return n.tenant = C().user.tenant, b(n), R({
33
+ url: "/v1/front/task/sooyie/task_define_rel",
34
+ method: "post",
35
+ data: n
36
+ });
37
+ }
38
+ }
39
+ const de = new ue(), ce = { class: "dialog-footer" }, ie = /* @__PURE__ */ Q({
40
+ __name: "add",
41
+ props: {
42
+ modelValue: { type: Boolean },
43
+ modelModifiers: {}
44
+ },
45
+ emits: /* @__PURE__ */ W(["refresh"], ["update:modelValue"]),
46
+ setup(U, { emit: n }) {
47
+ _.itemBizLayDict.useValues();
48
+ const m = new A({
49
+ orgType: "HALL"
50
+ });
51
+ m.useValues();
52
+ const y = new x({
53
+ userType: "COMPANY_MANAGER"
54
+ });
55
+ y.useValues();
56
+ const v = new x({
57
+ userType: "OUTSOURCE_OPS"
58
+ });
59
+ v.useValues();
60
+ const O = new A({
61
+ orgType: "OUTSOURCE"
62
+ });
63
+ O.useValues();
64
+ const { t: S } = oe(), k = ne();
65
+ _.taskInspectTypeDict.useValues();
66
+ const T = B();
67
+ let g = $({
68
+ taskDefineId: k.query.taskDefineId
69
+ });
70
+ const N = $({}), f = X(U, "modelValue"), L = n, p = B([
71
+ {
72
+ customerId: "",
73
+ userId: "",
74
+ customerDept: "",
75
+ userCompany: ""
76
+ }
77
+ ]);
78
+ function j(t, r) {
79
+ if (!t) return "";
80
+ if (r === I.CUSTOMER) {
81
+ const e = m.values.find((l) => l.key === t);
82
+ return e ? e.value : "";
83
+ } else {
84
+ const e = _.itemBizLayDict.values.find(
85
+ (a) => a.key === t
86
+ );
87
+ if (!e || !e.orgId) return "";
88
+ const l = m.values.find(
89
+ (a) => a.key === e.orgId
90
+ );
91
+ return l ? l.value : "";
92
+ }
93
+ }
94
+ function F(t, r) {
95
+ if (!t) return "";
96
+ if (r === I.CUSTOMER) {
97
+ const e = y.values.find(
98
+ (a) => a.key === t
99
+ );
100
+ if (!e || !e.orgId) return "";
101
+ const l = m.values.find(
102
+ (a) => a.key === e.orgId
103
+ );
104
+ return l ? l.value : "";
105
+ } else {
106
+ const e = v.values.find(
107
+ (a) => a.key === t
108
+ );
109
+ if (!e || !e.orgId) return "";
110
+ const l = O.values.find(
111
+ (a) => a.key === e.orgId
112
+ );
113
+ return l ? l.value : "";
114
+ }
115
+ }
116
+ Z(
117
+ p,
118
+ (t) => {
119
+ const r = k.query.taskSort;
120
+ t.forEach((e) => {
121
+ const l = j(e.customerId, r), a = F(e.userId, r);
122
+ e.customerDept !== l && (e.customerDept = l), e.userCompany !== a && (e.userCompany = a);
123
+ });
124
+ },
125
+ { deep: !0 }
126
+ );
127
+ function P() {
128
+ p.value.push({
129
+ customerId: "",
130
+ userId: "",
131
+ customerDept: "",
132
+ userCompany: ""
133
+ });
134
+ }
135
+ function q(t) {
136
+ const r = p.value.indexOf(t.row);
137
+ r !== 0 && p.value.splice(r, 1);
138
+ }
139
+ const G = async () => {
140
+ var t;
141
+ await ((t = T.value) == null ? void 0 : t.validate((r) => {
142
+ r && (g.taskDefineRel = p.value.map((e) => ({
143
+ customerId: e.customerId,
144
+ userId: e.userId
145
+ })), de.addTaskRel(g).then((e) => {
146
+ console.log(e), e.status === 200 && (le({
147
+ message: S("common.submitSuccess"),
148
+ type: "success"
149
+ }), f.value && (f.value = !1), L("refresh", e.status === 200));
150
+ }));
151
+ }));
152
+ };
153
+ function E() {
154
+ f.value && (f.value = !1);
155
+ }
156
+ return (t, r) => {
157
+ const e = i("el-table-column"), l = i("jmash-select"), a = i("el-icon"), H = i("el-table"), D = i("el-button"), K = i("el-row"), Y = i("el-form"), J = i("el-dialog");
158
+ return M(), z(J, {
159
+ modelValue: f.value,
160
+ "onUpdate:modelValue": r[0] || (r[0] = (s) => f.value = s),
161
+ "close-on-click-modal": !1,
162
+ "close-on-press-escape": !1,
163
+ onClose: E
164
+ }, {
165
+ footer: u(() => [
166
+ te("div", ce, [
167
+ o(D, { onClick: E }, {
168
+ default: u(() => [
169
+ V(h(t.$t("common.cancel")), 1)
170
+ ]),
171
+ _: 1
172
+ }),
173
+ o(D, {
174
+ type: "primary",
175
+ onClick: G
176
+ }, {
177
+ default: u(() => [
178
+ V(h(t.$t("common.confirm")), 1)
179
+ ]),
180
+ _: 1
181
+ })
182
+ ])
183
+ ]),
184
+ default: u(() => [
185
+ o(Y, {
186
+ ref_key: "taskDefineRelFormRef",
187
+ ref: T,
188
+ model: d(g),
189
+ "label-width": "150px",
190
+ rules: N,
191
+ class: "custom-table-form custom-form"
192
+ }, {
193
+ default: u(() => [
194
+ o(K, null, {
195
+ default: u(() => [
196
+ o(H, {
197
+ data: p.value,
198
+ border: "",
199
+ style: { width: "100%" }
200
+ }, {
201
+ default: u(() => [
202
+ o(e, {
203
+ type: "index",
204
+ label: t.$t("taskDefine.index"),
205
+ width: "60",
206
+ align: "center"
207
+ }, null, 8, ["label"]),
208
+ o(e, {
209
+ prop: "customerId",
210
+ label: t.$t("taskDefine.customerId"),
211
+ "header-align": "center"
212
+ }, w({ _: 2 }, [
213
+ d(k).query.taskSort === d(I).CUSTOMER ? {
214
+ name: "default",
215
+ fn: u(({ row: s }) => [
216
+ o(l, {
217
+ modelValue: s.customerId,
218
+ "onUpdate:modelValue": (c) => s.customerId = c,
219
+ data: d(m).values,
220
+ placeholder: t.$t("taskDefine.customerIdRequired"),
221
+ class: "w-full"
222
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "data", "placeholder"])
223
+ ]),
224
+ key: "0"
225
+ } : {
226
+ name: "default",
227
+ fn: u(({ row: s }) => [
228
+ o(l, {
229
+ modelValue: s.customerId,
230
+ "onUpdate:modelValue": (c) => s.customerId = c,
231
+ data: d(_).itemBizLayDict.values,
232
+ placeholder: t.$t("taskDefine.customerIdRequired"),
233
+ class: "w-full"
234
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "data", "placeholder"])
235
+ ]),
236
+ key: "1"
237
+ }
238
+ ]), 1032, ["label"]),
239
+ o(e, {
240
+ prop: "customerDept",
241
+ label: "所属厅局",
242
+ "header-align": "center",
243
+ align: "center"
244
+ }),
245
+ o(e, {
246
+ prop: "userId",
247
+ label: t.$t("taskDefine.userId"),
248
+ "header-align": "center"
249
+ }, w({ _: 2 }, [
250
+ d(k).query.taskSort === d(I).CUSTOMER ? {
251
+ name: "default",
252
+ fn: u(({ row: s }) => [
253
+ o(l, {
254
+ modelValue: s.userId,
255
+ "onUpdate:modelValue": (c) => s.userId = c,
256
+ data: d(y).values,
257
+ placeholder: t.$t("taskDefine.userIdRequired"),
258
+ class: "w-full"
259
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "data", "placeholder"])
260
+ ]),
261
+ key: "0"
262
+ } : {
263
+ name: "default",
264
+ fn: u(({ row: s }) => [
265
+ o(l, {
266
+ modelValue: s.userId,
267
+ "onUpdate:modelValue": (c) => s.userId = c,
268
+ data: d(v).values,
269
+ placeholder: t.$t("taskDefine.userIdRequired"),
270
+ class: "w-full"
271
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "data", "placeholder"])
272
+ ]),
273
+ key: "1"
274
+ }
275
+ ]), 1032, ["label"]),
276
+ o(e, {
277
+ prop: "userCompany",
278
+ label: "外协人员所属公司",
279
+ "header-align": "center",
280
+ align: "center"
281
+ }),
282
+ o(e, {
283
+ label: t.$t("common.operate"),
284
+ width: "60",
285
+ align: "center"
286
+ }, {
287
+ default: u((s) => [
288
+ s.$index !== 0 ? (M(), z(a, {
289
+ key: 0,
290
+ onClick: (c) => q(s),
291
+ size: "18",
292
+ style: { cursor: "pointer", color: "inherit" },
293
+ class: "hover-blue"
294
+ }, {
295
+ default: u(() => [
296
+ o(d(ae))
297
+ ]),
298
+ _: 1
299
+ }, 8, ["onClick"])) : ee("", !0)
300
+ ]),
301
+ _: 1
302
+ }, 8, ["label"])
303
+ ]),
304
+ _: 1
305
+ }, 8, ["data"]),
306
+ o(D, {
307
+ icon: d(se),
308
+ class: "addButton",
309
+ onClick: P
310
+ }, {
311
+ default: u(() => [
312
+ V(h(d(S)("common.add")), 1)
313
+ ]),
314
+ _: 1
315
+ }, 8, ["icon"])
316
+ ]),
317
+ _: 1
318
+ })
319
+ ]),
320
+ _: 1
321
+ }, 8, ["model", "rules"])
322
+ ]),
323
+ _: 1
324
+ }, 8, ["modelValue"]);
325
+ };
326
+ }
327
+ }), me = /* @__PURE__ */ re(ie, [["__scopeId", "data-v-ad956193"]]), De = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
328
+ __proto__: null,
329
+ default: me
330
+ }, Symbol.toStringTag, { value: "Module" }));
331
+ export {
332
+ de as a,
333
+ De as b,
334
+ me as t
335
+ };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./add.vue_vue_type_script_setup_true_lang-DTf6YjPZ.mjs";
1
+ import { _ as f } from "./add.vue_vue_type_script_setup_true_lang-C7iqLsd8.mjs";
2
2
  export {
3
3
  f as default
4
4
  };