xyvcard-paper-buyer 0.0.59 → 0.0.60

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,268 +0,0 @@
1
- import { defineComponent as S, mergeModels as V, ref as f, reactive as A, useModel as T, resolveComponent as m, createBlock as D, openBlock as J, withCtx as a, createVNode as l, unref as d, createElementVNode as L, createTextVNode as R, toDisplayString as q } from "vue";
2
- import { ElMessage as w } from "element-plus";
3
- import { JmashRegionTree as z, dictRegionApi as C } from "jmash-region";
4
- import { useI18n as G } from "vue-i18n";
5
- import { o as h } from "./index-BP8zUjOw.mjs";
6
- import { validatePhoneOrLandline as H } from "jmash-core";
7
- import { _ as Q } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
8
- const W = { class: "dialog-footer" }, X = /* @__PURE__ */ S({
9
- __name: "edit",
10
- props: /* @__PURE__ */ V({
11
- entityKey: {
12
- type: Object,
13
- default: () => {
14
- }
15
- }
16
- }, {
17
- modelValue: { type: Boolean },
18
- modelModifiers: {}
19
- }),
20
- emits: /* @__PURE__ */ V(["refresh"], ["update:modelValue"]),
21
- setup(g, { emit: I }) {
22
- const { t: i } = G(), v = f();
23
- let t = A({
24
- requestId: Math.random() * 10 + "",
25
- updateMask: "note,userName,mobilePhone,provinceName,detailInfo,cityName"
26
- });
27
- const P = (e, r, o) => {
28
- r && (H(r) || o(new Error(i("orderUserAddress.mobilePhoneTrueRequired")))), o();
29
- }, $ = A({
30
- note: [
31
- {
32
- required: !0,
33
- message: i("orderUserAddress.noteRequired"),
34
- trigger: "change"
35
- }
36
- ],
37
- userName: [
38
- {
39
- required: !0,
40
- message: i("orderUserAddress.userNameRequired"),
41
- trigger: "change"
42
- }
43
- ],
44
- mobilePhone: [
45
- {
46
- validator: P,
47
- trigger: "blur"
48
- }
49
- ],
50
- detailInfo: [
51
- {
52
- required: !0,
53
- message: i("orderUserAddress.detailInfoRequired"),
54
- trigger: "change"
55
- }
56
- ],
57
- provinceName: [
58
- {
59
- required: !0,
60
- message: i("orderUserAddress.provinceNameRequired"),
61
- trigger: "change"
62
- }
63
- ]
64
- }), u = T(g, "modelValue"), b = g, N = I, M = Object.keys(b.entityKey), _ = f(M.length >= 1);
65
- _.value && h.findById(b.entityKey).then(({ data: e }) => {
66
- Object.assign(t, e), t.provinceName = e.cityName;
67
- });
68
- function k() {
69
- t.provinceName && B(t.provinceName).then((e) => {
70
- t.cityName = e;
71
- });
72
- }
73
- const c = f(/* @__PURE__ */ new Map());
74
- async function B(e) {
75
- if (!e)
76
- return "";
77
- if (c.value.has(e))
78
- return c.value.get(e) || e;
79
- try {
80
- const r = await C.findByCode({
81
- regionCode: e
82
- });
83
- if (r.data) {
84
- const o = F(r.data);
85
- return c.value.set(e, o), o;
86
- }
87
- return e;
88
- } catch {
89
- return c.value.set(e, e), e;
90
- }
91
- }
92
- function F(e) {
93
- const r = [];
94
- function o(s) {
95
- s && s.regionName && r.push(s.regionName), s && s.children && s.children.length > 0 && o(s.children[0]);
96
- }
97
- return o(e), r.join("");
98
- }
99
- const j = async () => {
100
- var e;
101
- await ((e = v.value) == null ? void 0 : e.validate((r) => {
102
- r && (_.value ? h.update(t).then((o) => {
103
- o.status === 200 && (w({
104
- message: i("common.submitSuccess"),
105
- type: "success"
106
- }), u.value && (u.value = !1), N("refresh", o.status === 200));
107
- }) : h.create(t).then((o) => {
108
- o.status === 200 && (w({
109
- message: i("common.submitSuccess"),
110
- type: "success"
111
- }), u.value && (u.value = !1), N("refresh", o.status === 200));
112
- }));
113
- }));
114
- };
115
- function y() {
116
- u.value && (u.value = !1);
117
- }
118
- return (e, r) => {
119
- const o = m("el-input"), s = m("el-form-item"), p = m("el-col"), E = m("el-row"), O = m("el-form"), U = m("el-button"), K = m("el-dialog");
120
- return J(), D(K, {
121
- modelValue: u.value,
122
- "onUpdate:modelValue": r[5] || (r[5] = (n) => u.value = n),
123
- onClose: y
124
- }, {
125
- footer: a(() => [
126
- L("div", W, [
127
- l(U, { onClick: y }, {
128
- default: a(() => [
129
- R(q(e.$t("common.cancel")), 1)
130
- ]),
131
- _: 1
132
- }),
133
- l(U, {
134
- type: "primary",
135
- onClick: j
136
- }, {
137
- default: a(() => [
138
- R(q(e.$t("common.confirm")), 1)
139
- ]),
140
- _: 1
141
- })
142
- ])
143
- ]),
144
- default: a(() => [
145
- l(O, {
146
- ref_key: "orderUserAddressFormRef",
147
- ref: v,
148
- model: d(t),
149
- "label-position": "top",
150
- rules: $
151
- }, {
152
- default: a(() => [
153
- l(E, { gutter: 20 }, {
154
- default: a(() => [
155
- l(p, { span: 24 }, {
156
- default: a(() => [
157
- l(s, {
158
- label: e.$t("orderUserAddress.note"),
159
- prop: "note"
160
- }, {
161
- default: a(() => [
162
- l(o, {
163
- modelValue: d(t).note,
164
- "onUpdate:modelValue": r[0] || (r[0] = (n) => d(t).note = n),
165
- placeholder: e.$t("orderUserAddress.noteRequired"),
166
- "show-word-limit": "",
167
- clearable: ""
168
- }, null, 8, ["modelValue", "placeholder"])
169
- ]),
170
- _: 1
171
- }, 8, ["label"])
172
- ]),
173
- _: 1
174
- }),
175
- l(p, { span: 24 }, {
176
- default: a(() => [
177
- l(s, {
178
- label: e.$t("orderUserAddress.userName"),
179
- prop: "userName"
180
- }, {
181
- default: a(() => [
182
- l(o, {
183
- modelValue: d(t).userName,
184
- "onUpdate:modelValue": r[1] || (r[1] = (n) => d(t).userName = n),
185
- placeholder: e.$t("orderUserAddress.userNameRequired"),
186
- "show-word-limit": "",
187
- clearable: ""
188
- }, null, 8, ["modelValue", "placeholder"])
189
- ]),
190
- _: 1
191
- }, 8, ["label"])
192
- ]),
193
- _: 1
194
- }),
195
- l(p, { span: 24 }, {
196
- default: a(() => [
197
- l(s, {
198
- label: e.$t("orderUserAddress.mobilePhone"),
199
- prop: "mobilePhone"
200
- }, {
201
- default: a(() => [
202
- l(o, {
203
- modelValue: d(t).mobilePhone,
204
- "onUpdate:modelValue": r[2] || (r[2] = (n) => d(t).mobilePhone = n),
205
- placeholder: e.$t("orderUserAddress.mobilePhoneRequired"),
206
- "show-word-limit": "",
207
- clearable: ""
208
- }, null, 8, ["modelValue", "placeholder"])
209
- ]),
210
- _: 1
211
- }, 8, ["label"])
212
- ]),
213
- _: 1
214
- }),
215
- l(p, { span: 24 }, {
216
- default: a(() => [
217
- l(s, {
218
- prop: "provinceName",
219
- label: d(i)("orderUserAddress.detailInfo"),
220
- class: "form-item"
221
- }, {
222
- default: a(() => [
223
- l(d(z), {
224
- modelValue: d(t).provinceName,
225
- "onUpdate:modelValue": r[3] || (r[3] = (n) => d(t).provinceName = n),
226
- placeholder: e.$t("orderUserAddress.provinceNameRequired"),
227
- clearable: "",
228
- onChange: k
229
- }, null, 8, ["modelValue", "placeholder"])
230
- ]),
231
- _: 1
232
- }, 8, ["label"])
233
- ]),
234
- _: 1
235
- }),
236
- l(p, { span: 24 }, {
237
- default: a(() => [
238
- l(s, { prop: "detailInfo" }, {
239
- default: a(() => [
240
- l(o, {
241
- modelValue: d(t).detailInfo,
242
- "onUpdate:modelValue": r[4] || (r[4] = (n) => d(t).detailInfo = n),
243
- placeholder: e.$t("orderUserAddress.detailInfoRequired"),
244
- "show-word-limit": "",
245
- clearable: "",
246
- type: "textarea"
247
- }, null, 8, ["modelValue", "placeholder"])
248
- ]),
249
- _: 1
250
- })
251
- ]),
252
- _: 1
253
- })
254
- ]),
255
- _: 1
256
- })
257
- ]),
258
- _: 1
259
- }, 8, ["model", "rules"])
260
- ]),
261
- _: 1
262
- }, 8, ["modelValue"]);
263
- };
264
- }
265
- }), te = /* @__PURE__ */ Q(X, [["__scopeId", "data-v-3de299e3"]]);
266
- export {
267
- te as default
268
- };