xyvcard-itsmsys 0.0.10 → 0.0.12

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.
Files changed (53) hide show
  1. package/dist/FileSaver.min-BeKvLuyk.mjs +73 -0
  2. package/dist/{edit-DG_Iw1-J.mjs → edit-BSgQ7aTw.mjs} +1 -1
  3. package/dist/{edit-DdUUCXSa.mjs → edit-BSllWdRO.mjs} +1 -1
  4. package/dist/{edit-RSO388mB.mjs → edit-C-Ddf0UV.mjs} +115 -115
  5. package/dist/{edit-BNe0hNw4.mjs → edit-CNw8JPUb.mjs} +108 -108
  6. package/dist/{edit-BqPZHwxi.mjs → edit-Cd4dWFsH.mjs} +1 -1
  7. package/dist/{edit-CyM6IuLb.mjs → edit-aqBMKpoJ.mjs} +118 -118
  8. package/dist/{edit-CwV1OVfe.mjs → edit-q5TFAMBm.mjs} +1 -1
  9. package/dist/edit.vue_vue_type_script_setup_true_lang-BA39WCu3.mjs +463 -0
  10. package/dist/edit.vue_vue_type_script_setup_true_lang-BJcLgzvH.mjs +463 -0
  11. package/dist/edit.vue_vue_type_script_setup_true_lang-BV_YHrlE.mjs +482 -0
  12. package/dist/{edit.vue_vue_type_script_setup_true_lang-DGAgGwVY.mjs → edit.vue_vue_type_script_setup_true_lang-D1lAHFeM.mjs} +79 -56
  13. package/dist/import-upload-BIT504-g.mjs +4 -0
  14. package/dist/import-upload-pZG8yku3.mjs +4 -0
  15. package/dist/import-upload.vue_vue_type_script_setup_true_lang-pjSs3v9e.mjs +162 -0
  16. package/dist/import-upload.vue_vue_type_script_setup_true_lang-tjMLoB_W.mjs +162 -0
  17. package/dist/index-B2xwBTw-.mjs +20 -0
  18. package/dist/{index-NugT80P7.mjs → index-BY5Djw_C.mjs} +7 -7
  19. package/dist/{index-CI8Z4rNf.mjs → index-BaixQptZ.mjs} +7 -7
  20. package/dist/index-CoMhbtrg.mjs +449 -0
  21. package/dist/{index-DirPUdCN.mjs → index-Cz9Xj4Mn.mjs} +1 -1
  22. package/dist/{index-CNGaGeE7.mjs → index-DPz8be3T.mjs} +32 -32
  23. package/dist/index-Dno_3GpX.mjs +145 -0
  24. package/dist/{index-CMBtB1kH.mjs → index-DrBtW9Aj.mjs} +185 -134
  25. package/dist/{index-DxILUznW.mjs → index-LOMCvxtf.mjs} +1 -1
  26. package/dist/index.mjs +654 -623
  27. package/dist/{index.vue_vue_type_script_setup_true_lang-r7jQEFkS.mjs → index.vue_vue_type_script_setup_true_lang-C67sXgs5.mjs} +41 -34
  28. package/dist/{info-BFZTqoY3.mjs → info-BUDmirQy.mjs} +1 -1
  29. package/dist/{info-DReeRuaA.mjs → info-BivxW-qV.mjs} +1 -1
  30. package/dist/{info-Dilg-bji.mjs → info-Bn-BseIm.mjs} +1 -1
  31. package/dist/{info-C0OHjgoS.mjs → info-C-ga_8K9.mjs} +11 -11
  32. package/dist/{info-DvYUiSRY.mjs → info-C3knY6l_.mjs} +58 -47
  33. package/dist/{info-CXx2899k.mjs → info-D0Pwnmsu.mjs} +71 -60
  34. package/dist/style.css +1 -1
  35. package/dts/api/dict.d.ts +0 -6
  36. package/dts/api/index.d.ts +4 -2
  37. package/dts/api/itsm-sys-org/types.d.ts +0 -2
  38. package/dts/api/itsm-sys-org-invoice/types.d.ts +3 -1
  39. package/dts/api/itsm-sys-user-ext/index.d.ts +3 -1
  40. package/dts/api/itsm-sys-user-ext/types.d.ts +15 -2
  41. package/dts/constant.d.ts +14 -0
  42. package/dts/index.d.ts +1 -1
  43. package/dts/lang/itsmsys/zh-cn.d.ts +22 -11
  44. package/dts/views/itsmsys/itsm-sys-user-ops/import-upload.vue.d.ts +31 -0
  45. package/dts/views/itsmsys/itsm-sys-user-out/import-upload.vue.d.ts +31 -0
  46. package/package.json +4 -4
  47. package/dist/common-B2PCBCJ2.mjs +0 -13
  48. package/dist/edit.vue_vue_type_script_setup_true_lang-BQeZknmJ.mjs +0 -440
  49. package/dist/edit.vue_vue_type_script_setup_true_lang-CX_5__mh.mjs +0 -438
  50. package/dist/edit.vue_vue_type_script_setup_true_lang-DsN204D0.mjs +0 -440
  51. package/dist/index-BRupqW34.mjs +0 -96
  52. package/dist/index-CQ5Bo5a2.mjs +0 -135
  53. package/dist/index-w2SWNZRB.mjs +0 -397
@@ -1,12 +1,12 @@
1
- import { defineComponent as D, mergeModels as _, ref as I, useModel as B, reactive as O, resolveComponent as u, openBlock as K, createBlock as E, withCtx as o, createElementVNode as F, createVNode as e, createTextVNode as h, toDisplayString as q, unref as r } from "vue";
2
- import { ElMessage as T } from "element-plus";
3
- import { useI18n as S } from "vue-i18n";
4
- import { useRoute as A } from "vue-router";
1
+ import { defineComponent as B, mergeModels as k, ref as I, useModel as K, reactive as O, resolveComponent as i, openBlock as E, createBlock as F, withCtx as o, createElementVNode as S, createVNode as e, createTextVNode as h, toDisplayString as R, unref as r } from "vue";
2
+ import { ElMessage as q } from "element-plus";
3
+ import { useI18n as A } from "vue-i18n";
4
+ import { useRoute as L } from "vue-router";
5
5
  import { s as b } from "./index-B6vJj_z6.mjs";
6
- import { D as L } from "./index-CQ5Bo5a2.mjs";
7
- const z = { class: "dialog-footer" }, X = /* @__PURE__ */ D({
6
+ import { D as z } from "./index-Dno_3GpX.mjs";
7
+ const G = { class: "dialog-footer" }, Y = /* @__PURE__ */ B({
8
8
  __name: "edit",
9
- props: /* @__PURE__ */ _({
9
+ props: /* @__PURE__ */ k({
10
10
  entityKey: {
11
11
  type: Object,
12
12
  default: () => {
@@ -16,13 +16,13 @@ const z = { class: "dialog-footer" }, X = /* @__PURE__ */ D({
16
16
  modelValue: { type: Boolean },
17
17
  modelModifiers: {}
18
18
  }),
19
- emits: /* @__PURE__ */ _(["refresh"], ["update:modelValue"]),
20
- setup(f, { emit: w }) {
21
- const { t: s } = S(), R = A(), g = I(), n = B(f, "modelValue"), v = w;
22
- let t = O({
19
+ emits: /* @__PURE__ */ k(["refresh"], ["update:modelValue"]),
20
+ setup(f, { emit: T }) {
21
+ const { t: s } = A(), w = L(), g = I(), u = K(f, "modelValue"), v = T;
22
+ let a = O({
23
23
  requestId: Math.random() * 10 + "",
24
- updateMask: "invoiceType,invoiceTitle,taxNumber,bankName,backNumber",
25
- orgId: R.query.entityKey
24
+ updateMask: "invoiceType,invoiceTitle,taxNumber,bankName,backNumber,taxRate",
25
+ orgId: w.query.entityKey
26
26
  });
27
27
  const $ = O({
28
28
  invoiceType: [
@@ -68,65 +68,65 @@ const z = { class: "dialog-footer" }, X = /* @__PURE__ */ D({
68
68
  ]
69
69
  }), y = f, x = Object.keys(y.entityKey), N = I(x.length >= 1);
70
70
  N.value && b.findById(y.entityKey).then(({ data: l }) => {
71
- Object.assign(t, l);
71
+ Object.assign(a, l);
72
72
  });
73
- const C = async () => {
73
+ const U = async () => {
74
74
  var l;
75
- await ((l = g.value) == null ? void 0 : l.validate((a) => {
76
- a && (N.value ? b.update(t).then((m) => {
77
- m.status === 200 && (T({
75
+ await ((l = g.value) == null ? void 0 : l.validate((t) => {
76
+ t && (N.value ? b.update(a).then((m) => {
77
+ m.status === 200 && (q({
78
78
  message: s("common.submitSuccess"),
79
79
  type: "success"
80
- }), n.value && (n.value = !1), v("refresh", m.status === 200));
81
- }) : b.create(t).then((m) => {
82
- m.status === 200 && (T({
80
+ }), u.value && (u.value = !1), v("refresh", m.status === 200));
81
+ }) : b.create(a).then((m) => {
82
+ m.status === 200 && (q({
83
83
  message: s("common.submitSuccess"),
84
84
  type: "success"
85
- }), n.value && (n.value = !1), v("refresh", m.status === 200));
85
+ }), u.value && (u.value = !1), v("refresh", m.status === 200));
86
86
  }));
87
87
  }));
88
88
  };
89
- function k() {
90
- n.value && (n.value = !1);
89
+ function V() {
90
+ u.value && (u.value = !1);
91
91
  }
92
- return (l, a) => {
93
- const m = u("jmash-select"), d = u("el-form-item"), c = u("el-col"), p = u("el-input"), M = u("el-row"), U = u("el-form"), V = u("el-button"), j = u("el-dialog");
94
- return K(), E(j, {
95
- modelValue: n.value,
96
- "onUpdate:modelValue": a[5] || (a[5] = (i) => n.value = i),
97
- onClose: k
92
+ return (l, t) => {
93
+ const m = i("jmash-select"), d = i("el-form-item"), c = i("el-col"), p = i("el-input"), C = i("el-input-number"), M = i("el-row"), j = i("el-form"), _ = i("el-button"), D = i("el-dialog");
94
+ return E(), F(D, {
95
+ modelValue: u.value,
96
+ "onUpdate:modelValue": t[6] || (t[6] = (n) => u.value = n),
97
+ onClose: V
98
98
  }, {
99
99
  footer: o(() => [
100
- F("div", z, [
101
- e(V, { onClick: k }, {
100
+ S("div", G, [
101
+ e(_, { onClick: V }, {
102
102
  default: o(() => [
103
- h(q(l.$t("common.cancel")), 1)
103
+ h(R(l.$t("common.cancel")), 1)
104
104
  ]),
105
105
  _: 1
106
106
  }),
107
- e(V, {
107
+ e(_, {
108
108
  type: "primary",
109
- onClick: C
109
+ onClick: U
110
110
  }, {
111
111
  default: o(() => [
112
- h(q(l.$t("common.confirm")), 1)
112
+ h(R(l.$t("common.confirm")), 1)
113
113
  ]),
114
114
  _: 1
115
115
  })
116
116
  ])
117
117
  ]),
118
118
  default: o(() => [
119
- e(U, {
119
+ e(j, {
120
120
  ref_key: "sysOrgInvoiceFormRef",
121
121
  ref: g,
122
- model: r(t),
123
- "label-width": "100px",
122
+ model: r(a),
123
+ "label-width": "120px",
124
124
  rules: $
125
125
  }, {
126
126
  default: o(() => [
127
127
  e(M, null, {
128
128
  default: o(() => [
129
- e(c, { span: 24 }, {
129
+ e(c, { span: 12 }, {
130
130
  default: o(() => [
131
131
  e(d, {
132
132
  label: l.$t("sysOrgInvoice.invoiceType"),
@@ -134,10 +134,10 @@ const z = { class: "dialog-footer" }, X = /* @__PURE__ */ D({
134
134
  }, {
135
135
  default: o(() => [
136
136
  e(m, {
137
- modelValue: r(t).invoiceType,
138
- "onUpdate:modelValue": a[0] || (a[0] = (i) => r(t).invoiceType = i),
137
+ modelValue: r(a).invoiceType,
138
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => r(a).invoiceType = n),
139
139
  placeholder: l.$t("sysOrgInvoice.invoiceTypeRequired"),
140
- data: r(L).invoiceTypeDictEnum.values,
140
+ data: r(z).invoiceTypeDictEnum.values,
141
141
  class: "w-full",
142
142
  clearable: ""
143
143
  }, null, 8, ["modelValue", "placeholder", "data"])
@@ -147,7 +147,7 @@ const z = { class: "dialog-footer" }, X = /* @__PURE__ */ D({
147
147
  ]),
148
148
  _: 1
149
149
  }),
150
- e(c, { span: 24 }, {
150
+ e(c, { span: 12 }, {
151
151
  default: o(() => [
152
152
  e(d, {
153
153
  label: l.$t("sysOrgInvoice.invoiceTitle"),
@@ -155,8 +155,8 @@ const z = { class: "dialog-footer" }, X = /* @__PURE__ */ D({
155
155
  }, {
156
156
  default: o(() => [
157
157
  e(p, {
158
- modelValue: r(t).invoiceTitle,
159
- "onUpdate:modelValue": a[1] || (a[1] = (i) => r(t).invoiceTitle = i),
158
+ modelValue: r(a).invoiceTitle,
159
+ "onUpdate:modelValue": t[1] || (t[1] = (n) => r(a).invoiceTitle = n),
160
160
  placeholder: l.$t("sysOrgInvoice.invoiceTitleRequired"),
161
161
  maxlength: "50",
162
162
  "show-word-limit": "",
@@ -168,7 +168,7 @@ const z = { class: "dialog-footer" }, X = /* @__PURE__ */ D({
168
168
  ]),
169
169
  _: 1
170
170
  }),
171
- e(c, { span: 24 }, {
171
+ e(c, { span: 12 }, {
172
172
  default: o(() => [
173
173
  e(d, {
174
174
  label: l.$t("sysOrgInvoice.taxNumber"),
@@ -176,8 +176,8 @@ const z = { class: "dialog-footer" }, X = /* @__PURE__ */ D({
176
176
  }, {
177
177
  default: o(() => [
178
178
  e(p, {
179
- modelValue: r(t).taxNumber,
180
- "onUpdate:modelValue": a[2] || (a[2] = (i) => r(t).taxNumber = i),
179
+ modelValue: r(a).taxNumber,
180
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => r(a).taxNumber = n),
181
181
  placeholder: l.$t("sysOrgInvoice.taxNumberRequired"),
182
182
  maxlength: "50",
183
183
  "show-word-limit": "",
@@ -189,7 +189,7 @@ const z = { class: "dialog-footer" }, X = /* @__PURE__ */ D({
189
189
  ]),
190
190
  _: 1
191
191
  }),
192
- e(c, { span: 24 }, {
192
+ e(c, { span: 12 }, {
193
193
  default: o(() => [
194
194
  e(d, {
195
195
  label: l.$t("sysOrgInvoice.bankName"),
@@ -197,8 +197,8 @@ const z = { class: "dialog-footer" }, X = /* @__PURE__ */ D({
197
197
  }, {
198
198
  default: o(() => [
199
199
  e(p, {
200
- modelValue: r(t).bankName,
201
- "onUpdate:modelValue": a[3] || (a[3] = (i) => r(t).bankName = i),
200
+ modelValue: r(a).bankName,
201
+ "onUpdate:modelValue": t[3] || (t[3] = (n) => r(a).bankName = n),
202
202
  placeholder: l.$t("sysOrgInvoice.bankNameRequired"),
203
203
  maxlength: "50",
204
204
  "show-word-limit": "",
@@ -210,7 +210,7 @@ const z = { class: "dialog-footer" }, X = /* @__PURE__ */ D({
210
210
  ]),
211
211
  _: 1
212
212
  }),
213
- e(c, { span: 24 }, {
213
+ e(c, { span: 12 }, {
214
214
  default: o(() => [
215
215
  e(d, {
216
216
  label: l.$t("sysOrgInvoice.backNumber"),
@@ -218,8 +218,8 @@ const z = { class: "dialog-footer" }, X = /* @__PURE__ */ D({
218
218
  }, {
219
219
  default: o(() => [
220
220
  e(p, {
221
- modelValue: r(t).backNumber,
222
- "onUpdate:modelValue": a[4] || (a[4] = (i) => r(t).backNumber = i),
221
+ modelValue: r(a).backNumber,
222
+ "onUpdate:modelValue": t[4] || (t[4] = (n) => r(a).backNumber = n),
223
223
  placeholder: l.$t("sysOrgInvoice.backNumberRequired"),
224
224
  maxlength: "20",
225
225
  "show-word-limit": "",
@@ -230,6 +230,29 @@ const z = { class: "dialog-footer" }, X = /* @__PURE__ */ D({
230
230
  }, 8, ["label"])
231
231
  ]),
232
232
  _: 1
233
+ }),
234
+ e(c, { span: 12 }, {
235
+ default: o(() => [
236
+ e(d, {
237
+ label: l.$t("sysOrgInvoice.taxRate"),
238
+ prop: "taxRate"
239
+ }, {
240
+ default: o(() => [
241
+ e(C, {
242
+ modelValue: r(a).taxRate,
243
+ "onUpdate:modelValue": t[5] || (t[5] = (n) => r(a).taxRate = n),
244
+ placeholder: l.$t("sysOrgInvoice.taxRateRequired"),
245
+ precision: 2,
246
+ min: 0,
247
+ max: 1,
248
+ step: 0.01,
249
+ class: "w-full"
250
+ }, null, 8, ["modelValue", "placeholder"])
251
+ ]),
252
+ _: 1
253
+ }, 8, ["label"])
254
+ ]),
255
+ _: 1
233
256
  })
234
257
  ]),
235
258
  _: 1
@@ -244,5 +267,5 @@ const z = { class: "dialog-footer" }, X = /* @__PURE__ */ D({
244
267
  }
245
268
  });
246
269
  export {
247
- X as _
270
+ Y as _
248
271
  };
@@ -0,0 +1,4 @@
1
+ import { _ as f } from "./import-upload.vue_vue_type_script_setup_true_lang-tjMLoB_W.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,4 @@
1
+ import { _ as f } from "./import-upload.vue_vue_type_script_setup_true_lang-pjSs3v9e.mjs";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,162 @@
1
+ import { defineComponent as z, ref as c, reactive as V, toRefs as A, resolveComponent as l, openBlock as H, createBlock as G, unref as h, isRef as J, withCtx as e, createElementVNode as s, createVNode as t, createTextVNode as u, toDisplayString as d } from "vue";
2
+ import { useI18n as K } from "vue-i18n";
3
+ import { ElMessage as m } from "element-plus";
4
+ import { fileApi as C, useUserStore as D } from "jmash-core";
5
+ import { D as I } from "./index-Dno_3GpX.mjs";
6
+ const L = { class: "el-upload__text" }, P = { style: { color: "var(--el-color-primary)" } }, Q = { class: "dialog-footer" }, oe = /* @__PURE__ */ z({
7
+ __name: "import-upload",
8
+ props: {
9
+ uploadVisible: {
10
+ type: Boolean,
11
+ default: () => !1
12
+ },
13
+ templateTitle: {
14
+ type: String,
15
+ default: ""
16
+ }
17
+ },
18
+ emits: ["templateDown", "importEvents", "uploadClosed"],
19
+ setup(f, { emit: w }) {
20
+ const { t: _ } = K();
21
+ I.sysOutBizDict.useValues();
22
+ const k = c(C.uploadUrl()), U = c(C.authHeader()), b = V({
23
+ tenant: D().user.tenant
24
+ }), $ = c(), a = V({
25
+ tenant: D().user.tenant,
26
+ requestId: Math.random() * 10 + "",
27
+ fileNames: "",
28
+ updateMask: "",
29
+ addFlag: !0,
30
+ // 必填项,true新增,false修改
31
+ orgId: ""
32
+ }), E = f, r = w, { uploadVisible: i } = A(E);
33
+ function N() {
34
+ r("templateDown");
35
+ }
36
+ function R(o) {
37
+ a.fileNames = o.fileSrc, a.addFlag = o.addFlag, a.fileNames && m({
38
+ message: _("common.uploadSuccess"),
39
+ type: "success"
40
+ });
41
+ }
42
+ const S = () => {
43
+ m.warning("当前限制选择 1 个文件");
44
+ };
45
+ function q() {
46
+ if (!a.orgId) {
47
+ m({
48
+ message: _("sysUserOps.orgIdRequired"),
49
+ type: "error"
50
+ });
51
+ return;
52
+ }
53
+ r("importEvents", a);
54
+ }
55
+ function g() {
56
+ r("uploadClosed");
57
+ }
58
+ return (o, n) => {
59
+ const y = l("el-col"), B = l("jmash-select"), F = l("el-form-item"), O = l("el-row"), x = l("upload-filled"), M = l("el-icon"), T = l("el-upload"), v = l("el-button"), j = l("el-dialog");
60
+ return H(), G(j, {
61
+ modelValue: h(i),
62
+ "onUpdate:modelValue": n[1] || (n[1] = (p) => J(i) ? i.value = p : null),
63
+ title: o.$t("common.uploadFiles"),
64
+ width: "500px",
65
+ onClose: g
66
+ }, {
67
+ footer: e(() => [
68
+ s("div", Q, [
69
+ t(v, { onClick: g }, {
70
+ default: e(() => [
71
+ u(d(o.$t("common.cancel")), 1)
72
+ ]),
73
+ _: 1
74
+ }),
75
+ t(v, {
76
+ type: "primary",
77
+ onClick: q
78
+ }, {
79
+ default: e(() => [
80
+ u(d(o.$t("common.confirm")), 1)
81
+ ]),
82
+ _: 1
83
+ })
84
+ ])
85
+ ]),
86
+ default: e(() => [
87
+ t(O, null, {
88
+ default: e(() => [
89
+ t(y, { span: 24 }, {
90
+ default: e(() => [
91
+ t(F, { prop: "orgId" }, {
92
+ default: e(() => [
93
+ t(y, { span: 4 }, {
94
+ default: e(() => [
95
+ n[2] || (n[2] = s("span", { class: "required_red" }, "*", -1)),
96
+ s("span", null, d(o.$t("sysUserOps.orgId")), 1)
97
+ ]),
98
+ _: 1
99
+ }),
100
+ t(B, {
101
+ modelValue: a.orgId,
102
+ "onUpdate:modelValue": n[0] || (n[0] = (p) => a.orgId = p),
103
+ data: h(I).sysOutBizDict.values,
104
+ filterable: "",
105
+ "check-strictly": "",
106
+ clearable: "",
107
+ "render-after-expand": !1,
108
+ placeholder: o.$t("sysUserOps.orgIdRequired"),
109
+ class: "w-80"
110
+ }, null, 8, ["modelValue", "data", "placeholder"])
111
+ ]),
112
+ _: 1
113
+ })
114
+ ]),
115
+ _: 1
116
+ })
117
+ ]),
118
+ _: 1
119
+ }),
120
+ t(T, {
121
+ ref_key: "uploadRef",
122
+ ref: $,
123
+ drag: "",
124
+ action: k.value,
125
+ headers: U.value,
126
+ data: b,
127
+ limit: 1,
128
+ "on-success": R,
129
+ "on-exceed": S,
130
+ style: { "margin-top": "20px" }
131
+ }, {
132
+ tip: e(() => [
133
+ s("div", {
134
+ class: "el-upload__tip",
135
+ onClick: N
136
+ }, [
137
+ s("a", P, d(f.templateTitle), 1)
138
+ ])
139
+ ]),
140
+ default: e(() => [
141
+ t(M, { class: "el-icon--upload" }, {
142
+ default: e(() => [
143
+ t(x)
144
+ ]),
145
+ _: 1
146
+ }),
147
+ s("div", L, [
148
+ u(d(o.$t("common.dragFiles")) + " ", 1),
149
+ s("em", null, d(o.$t("common.uploadEvent")), 1)
150
+ ])
151
+ ]),
152
+ _: 1
153
+ }, 8, ["action", "headers", "data"])
154
+ ]),
155
+ _: 1
156
+ }, 8, ["modelValue", "title"]);
157
+ };
158
+ }
159
+ });
160
+ export {
161
+ oe as _
162
+ };
@@ -0,0 +1,162 @@
1
+ import { defineComponent as z, ref as c, reactive as V, toRefs as A, resolveComponent as l, openBlock as H, createBlock as G, unref as h, isRef as J, withCtx as e, createElementVNode as s, createVNode as t, createTextVNode as u, toDisplayString as d } from "vue";
2
+ import { useI18n as K } from "vue-i18n";
3
+ import { ElMessage as m } from "element-plus";
4
+ import { fileApi as C, useUserStore as D } from "jmash-core";
5
+ import { D as I } from "./index-Dno_3GpX.mjs";
6
+ const L = { class: "el-upload__text" }, P = { style: { color: "var(--el-color-primary)" } }, Q = { class: "dialog-footer" }, oe = /* @__PURE__ */ z({
7
+ __name: "import-upload",
8
+ props: {
9
+ uploadVisible: {
10
+ type: Boolean,
11
+ default: () => !1
12
+ },
13
+ templateTitle: {
14
+ type: String,
15
+ default: ""
16
+ }
17
+ },
18
+ emits: ["templateDown", "importEvents", "uploadClosed"],
19
+ setup(f, { emit: w }) {
20
+ const { t: _ } = K();
21
+ I.sysOrgBizDict.useValues();
22
+ const k = c(C.uploadUrl()), U = c(C.authHeader()), b = V({
23
+ tenant: D().user.tenant
24
+ }), $ = c(), a = V({
25
+ tenant: D().user.tenant,
26
+ requestId: Math.random() * 10 + "",
27
+ fileNames: "",
28
+ updateMask: "",
29
+ addFlag: !0,
30
+ // 必填项,true新增,false修改
31
+ orgId: ""
32
+ }), E = f, r = w, { uploadVisible: i } = A(E);
33
+ function N() {
34
+ r("templateDown");
35
+ }
36
+ function R(o) {
37
+ a.fileNames = o.fileSrc, a.addFlag = o.addFlag, a.fileNames && m({
38
+ message: _("common.uploadSuccess"),
39
+ type: "success"
40
+ });
41
+ }
42
+ const S = () => {
43
+ m.warning("当前限制选择 1 个文件");
44
+ };
45
+ function q() {
46
+ if (!a.orgId) {
47
+ m({
48
+ message: _("sysUserOps.orgIdRequired"),
49
+ type: "error"
50
+ });
51
+ return;
52
+ }
53
+ r("importEvents", a);
54
+ }
55
+ function g() {
56
+ r("uploadClosed");
57
+ }
58
+ return (o, n) => {
59
+ const y = l("el-col"), B = l("jmash-select"), F = l("el-form-item"), O = l("el-row"), x = l("upload-filled"), M = l("el-icon"), T = l("el-upload"), v = l("el-button"), j = l("el-dialog");
60
+ return H(), G(j, {
61
+ modelValue: h(i),
62
+ "onUpdate:modelValue": n[1] || (n[1] = (p) => J(i) ? i.value = p : null),
63
+ title: o.$t("common.uploadFiles"),
64
+ width: "500px",
65
+ onClose: g
66
+ }, {
67
+ footer: e(() => [
68
+ s("div", Q, [
69
+ t(v, { onClick: g }, {
70
+ default: e(() => [
71
+ u(d(o.$t("common.cancel")), 1)
72
+ ]),
73
+ _: 1
74
+ }),
75
+ t(v, {
76
+ type: "primary",
77
+ onClick: q
78
+ }, {
79
+ default: e(() => [
80
+ u(d(o.$t("common.confirm")), 1)
81
+ ]),
82
+ _: 1
83
+ })
84
+ ])
85
+ ]),
86
+ default: e(() => [
87
+ t(O, null, {
88
+ default: e(() => [
89
+ t(y, { span: 24 }, {
90
+ default: e(() => [
91
+ t(F, { prop: "orgId" }, {
92
+ default: e(() => [
93
+ t(y, { span: 4 }, {
94
+ default: e(() => [
95
+ n[2] || (n[2] = s("span", { class: "required_red" }, "*", -1)),
96
+ s("span", null, d(o.$t("sysUserOps.orgId")), 1)
97
+ ]),
98
+ _: 1
99
+ }),
100
+ t(B, {
101
+ modelValue: a.orgId,
102
+ "onUpdate:modelValue": n[0] || (n[0] = (p) => a.orgId = p),
103
+ data: h(I).sysOrgBizDict.values,
104
+ filterable: "",
105
+ "check-strictly": "",
106
+ clearable: "",
107
+ "render-after-expand": !1,
108
+ placeholder: o.$t("sysUserOps.orgIdRequired"),
109
+ class: "w-80"
110
+ }, null, 8, ["modelValue", "data", "placeholder"])
111
+ ]),
112
+ _: 1
113
+ })
114
+ ]),
115
+ _: 1
116
+ })
117
+ ]),
118
+ _: 1
119
+ }),
120
+ t(T, {
121
+ ref_key: "uploadRef",
122
+ ref: $,
123
+ drag: "",
124
+ action: k.value,
125
+ headers: U.value,
126
+ data: b,
127
+ limit: 1,
128
+ "on-success": R,
129
+ "on-exceed": S,
130
+ style: { "margin-top": "20px" }
131
+ }, {
132
+ tip: e(() => [
133
+ s("div", {
134
+ class: "el-upload__tip",
135
+ onClick: N
136
+ }, [
137
+ s("a", P, d(f.templateTitle), 1)
138
+ ])
139
+ ]),
140
+ default: e(() => [
141
+ t(M, { class: "el-icon--upload" }, {
142
+ default: e(() => [
143
+ t(x)
144
+ ]),
145
+ _: 1
146
+ }),
147
+ s("div", L, [
148
+ u(d(o.$t("common.dragFiles")) + " ", 1),
149
+ s("em", null, d(o.$t("common.uploadEvent")), 1)
150
+ ])
151
+ ]),
152
+ _: 1
153
+ }, 8, ["action", "headers", "data"])
154
+ ]),
155
+ _: 1
156
+ }, 8, ["modelValue", "title"]);
157
+ };
158
+ }
159
+ });
160
+ export {
161
+ oe as _
162
+ };
@@ -0,0 +1,20 @@
1
+ import { defineComponent as e, openBlock as r, createElementBlock as t, createElementVNode as a } from "vue";
2
+ /*! Element Plus Icons Vue v2.3.1 */
3
+ var _ = /* @__PURE__ */ e({
4
+ name: "Search",
5
+ __name: "search",
6
+ setup(o) {
7
+ return (c, n) => (r(), t("svg", {
8
+ xmlns: "http://www.w3.org/2000/svg",
9
+ viewBox: "0 0 1024 1024"
10
+ }, [
11
+ a("path", {
12
+ fill: "currentColor",
13
+ d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"
14
+ })
15
+ ]));
16
+ }
17
+ }), s = _;
18
+ export {
19
+ s
20
+ };