xyvcard-paper-buyer 0.0.15 → 0.0.17

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,236 +0,0 @@
1
- import { defineComponent as E, mergeModels as v, ref as y, reactive as A, useModel as j, resolveComponent as u, createBlock as F, openBlock as K, withCtx as l, createVNode as e, unref as s, createElementVNode as O, createTextVNode as N, toDisplayString as q } from "vue";
2
- import { ElMessage as w } from "element-plus";
3
- import { JmashRegionTree as S } from "jmash-region";
4
- import { useI18n as T } from "vue-i18n";
5
- import { o as f } from "./index-CIhWvEaK.mjs";
6
- import { _ as D } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
7
- const J = { class: "dialog-footer" }, z = /* @__PURE__ */ E({
8
- __name: "edit",
9
- props: /* @__PURE__ */ v({
10
- entityKey: {
11
- type: Object,
12
- default: () => {
13
- }
14
- }
15
- }, {
16
- modelValue: { type: Boolean },
17
- modelModifiers: {}
18
- }),
19
- emits: /* @__PURE__ */ v(["refresh"], ["update:modelValue"]),
20
- setup(c, { emit: R }) {
21
- const { t: n } = T(), g = y();
22
- let d = A({
23
- requestId: Math.random() * 10 + "",
24
- updateMask: "note,userName,mobilePhone,provinceName,detailInfo"
25
- });
26
- const I = (r, o, t) => {
27
- o && !/^(((\d{3,4}-)?[0-9]{7,8})|(1(3|4|5|6|7|8|9)\d{9}))$/.test(o) ? t(new Error(n("orderUserAddress.mobilePhoneTrueRequired"))) : t();
28
- }, $ = A({
29
- note: [
30
- {
31
- required: !0,
32
- message: n("orderUserAddress.noteRequired"),
33
- trigger: "change"
34
- }
35
- ],
36
- userName: [
37
- {
38
- required: !0,
39
- message: n("orderUserAddress.userNameRequired"),
40
- trigger: "change"
41
- }
42
- ],
43
- mobilePhone: [
44
- {
45
- required: !0,
46
- validator: I,
47
- trigger: "blur"
48
- }
49
- ],
50
- detailInfo: [
51
- {
52
- required: !0,
53
- message: n("orderUserAddress.detailInfoRequired"),
54
- trigger: "change"
55
- }
56
- ],
57
- provinceName: [
58
- {
59
- required: !0,
60
- message: n("orderUserAddress.provinceNameRequired"),
61
- trigger: "change"
62
- }
63
- ]
64
- }), m = j(c, "modelValue"), b = c, _ = R, P = Object.keys(b.entityKey), h = y(P.length >= 1);
65
- h.value && f.findById(b.entityKey).then(({ data: r }) => {
66
- Object.assign(d, r);
67
- });
68
- const k = async () => {
69
- var r;
70
- await ((r = g.value) == null ? void 0 : r.validate((o) => {
71
- o && (h.value ? f.update(d).then((t) => {
72
- console.log(t), t.status === 200 && (w({
73
- message: n("common.submitSuccess"),
74
- type: "success"
75
- }), m.value && (m.value = !1), _("refresh", t.status === 200));
76
- }) : f.create(d).then((t) => {
77
- console.log(t), t.status === 200 && (w({
78
- message: n("common.submitSuccess"),
79
- type: "success"
80
- }), m.value && (m.value = !1), _("refresh", t.status === 200));
81
- }));
82
- }));
83
- };
84
- function V() {
85
- m.value && (m.value = !1);
86
- }
87
- return (r, o) => {
88
- const t = u("el-input"), i = u("el-form-item"), p = u("el-col"), C = u("el-row"), M = u("el-form"), U = u("el-button"), B = u("el-dialog");
89
- return K(), F(B, {
90
- modelValue: m.value,
91
- "onUpdate:modelValue": o[5] || (o[5] = (a) => m.value = a),
92
- onClose: V
93
- }, {
94
- footer: l(() => [
95
- O("div", J, [
96
- e(U, { onClick: V }, {
97
- default: l(() => [
98
- N(q(r.$t("common.cancel")), 1)
99
- ]),
100
- _: 1
101
- }),
102
- e(U, {
103
- type: "primary",
104
- onClick: k
105
- }, {
106
- default: l(() => [
107
- N(q(r.$t("common.confirm")), 1)
108
- ]),
109
- _: 1
110
- })
111
- ])
112
- ]),
113
- default: l(() => [
114
- e(M, {
115
- ref_key: "orderUserAddressFormRef",
116
- ref: g,
117
- model: s(d),
118
- "label-position": "top",
119
- rules: $
120
- }, {
121
- default: l(() => [
122
- e(C, { gutter: 20 }, {
123
- default: l(() => [
124
- e(p, { span: 24 }, {
125
- default: l(() => [
126
- e(i, {
127
- label: r.$t("orderUserAddress.note"),
128
- prop: "note"
129
- }, {
130
- default: l(() => [
131
- e(t, {
132
- modelValue: s(d).note,
133
- "onUpdate:modelValue": o[0] || (o[0] = (a) => s(d).note = a),
134
- placeholder: r.$t("orderUserAddress.noteRequired"),
135
- "show-word-limit": "",
136
- clearable: ""
137
- }, null, 8, ["modelValue", "placeholder"])
138
- ]),
139
- _: 1
140
- }, 8, ["label"])
141
- ]),
142
- _: 1
143
- }),
144
- e(p, { span: 24 }, {
145
- default: l(() => [
146
- e(i, {
147
- label: r.$t("orderUserAddress.userName"),
148
- prop: "userName"
149
- }, {
150
- default: l(() => [
151
- e(t, {
152
- modelValue: s(d).userName,
153
- "onUpdate:modelValue": o[1] || (o[1] = (a) => s(d).userName = a),
154
- placeholder: r.$t("orderUserAddress.userNameRequired"),
155
- "show-word-limit": "",
156
- clearable: ""
157
- }, null, 8, ["modelValue", "placeholder"])
158
- ]),
159
- _: 1
160
- }, 8, ["label"])
161
- ]),
162
- _: 1
163
- }),
164
- e(p, { span: 24 }, {
165
- default: l(() => [
166
- e(i, {
167
- label: r.$t("orderUserAddress.mobilePhone"),
168
- prop: "mobilePhone"
169
- }, {
170
- default: l(() => [
171
- e(t, {
172
- modelValue: s(d).mobilePhone,
173
- "onUpdate:modelValue": o[2] || (o[2] = (a) => s(d).mobilePhone = a),
174
- placeholder: r.$t("orderUserAddress.mobilePhoneRequired"),
175
- "show-word-limit": "",
176
- clearable: ""
177
- }, null, 8, ["modelValue", "placeholder"])
178
- ]),
179
- _: 1
180
- }, 8, ["label"])
181
- ]),
182
- _: 1
183
- }),
184
- e(p, { span: 24 }, {
185
- default: l(() => [
186
- e(i, {
187
- prop: "provinceName",
188
- label: s(n)("orderUserAddress.detailInfo"),
189
- class: "form-item"
190
- }, {
191
- default: l(() => [
192
- e(s(S), {
193
- modelValue: s(d).provinceName,
194
- "onUpdate:modelValue": o[3] || (o[3] = (a) => s(d).provinceName = a),
195
- placeholder: r.$t("orderUserAddress.provinceNameRequired"),
196
- clearable: ""
197
- }, null, 8, ["modelValue", "placeholder"])
198
- ]),
199
- _: 1
200
- }, 8, ["label"])
201
- ]),
202
- _: 1
203
- }),
204
- e(p, { span: 24 }, {
205
- default: l(() => [
206
- e(i, { prop: "detailInfo" }, {
207
- default: l(() => [
208
- e(t, {
209
- modelValue: s(d).detailInfo,
210
- "onUpdate:modelValue": o[4] || (o[4] = (a) => s(d).detailInfo = a),
211
- placeholder: r.$t("orderUserAddress.detailInfoRequired"),
212
- "show-word-limit": "",
213
- clearable: "",
214
- type: "textarea"
215
- }, null, 8, ["modelValue", "placeholder"])
216
- ]),
217
- _: 1
218
- })
219
- ]),
220
- _: 1
221
- })
222
- ]),
223
- _: 1
224
- })
225
- ]),
226
- _: 1
227
- }, 8, ["model", "rules"])
228
- ]),
229
- _: 1
230
- }, 8, ["modelValue"]);
231
- };
232
- }
233
- }), Y = /* @__PURE__ */ D(z, [["__scopeId", "data-v-f17c5e2b"]]);
234
- export {
235
- Y as default
236
- };
@@ -1,355 +0,0 @@
1
- import { defineComponent as le, ref as g, reactive as T, onActivated as oe, resolveComponent as a, resolveDirective as ne, createElementBlock as R, openBlock as c, createElementVNode as A, createVNode as n, createBlock as U, createCommentVNode as C, withCtx as o, withKeys as j, unref as r, createTextVNode as b, toDisplayString as p, withDirectives as $, isRef as S } from "vue";
2
- import { useTableHooks as re } from "jmash-core";
3
- import { useI18n as ae } from "vue-i18n";
4
- import { o as se } from "./index-CIhWvEaK.mjs";
5
- import ie from "./edit-DT79EUCr.mjs";
6
- import { useRouter as de } from "vue-router";
7
- import { dictRegionApi as ue } from "jmash-region";
8
- const me = { class: "app-container" }, pe = { class: "search-container" }, ce = ["onClick"], fe = ["onClick"], ge = /* @__PURE__ */ le({
9
- __name: "index",
10
- setup(be) {
11
- const { t: y } = ae();
12
- de();
13
- const d = g({}), {
14
- tableHooks: s,
15
- multipleTableRef: z,
16
- queryFormRef: B,
17
- listLoading: D,
18
- tableData: I,
19
- total: h
20
- } = re(y, se, d);
21
- let v = g([
22
- {
23
- label: "orderUserAddress.note",
24
- prop: "note",
25
- minWidth: "150",
26
- sortable: "custom",
27
- isColumn: !0
28
- },
29
- {
30
- label: "orderUserAddress.userName",
31
- prop: "userName",
32
- width: "150",
33
- sortable: "custom",
34
- isColumn: !0
35
- },
36
- {
37
- label: "orderUserAddress.mobilePhone",
38
- prop: "mobilePhoneIns",
39
- slotName: "mobileIns",
40
- columnType: "slot",
41
- width: "150",
42
- sortable: "custom",
43
- isColumn: !0
44
- },
45
- {
46
- label: "orderUserAddress.detailInfo",
47
- prop: "detailInfo",
48
- minWidth: "150",
49
- sortable: "custom",
50
- isColumn: !0,
51
- slotName: "detailInfo",
52
- columnType: "slot"
53
- },
54
- {
55
- label: "orderUserAddress.listOrder",
56
- width: "60",
57
- columnType: "slot",
58
- slotName: "listOrder",
59
- isColumn: !0
60
- },
61
- {
62
- label: "common.operate",
63
- width: "100",
64
- slotName: "operation",
65
- columnType: "slot",
66
- fixed: "right",
67
- isColumn: !0
68
- }
69
- ]);
70
- const u = g({
71
- title: y("common.edit"),
72
- visible: !1
73
- });
74
- function q(e) {
75
- e.mobileEncrypt = !e.mobileEncrypt;
76
- }
77
- let V = T({});
78
- function L() {
79
- V = T({}), u.value.title = y("common.add"), u.value.visible = !0;
80
- }
81
- function F(e) {
82
- V.addressId = e.addressId, u.value.title = y("common.edit"), u.value.visible = !0;
83
- }
84
- function K(e) {
85
- s.selectionRows.value = e;
86
- }
87
- function M(e) {
88
- s.handleSort(e.prop, e.order);
89
- }
90
- const f = g(/* @__PURE__ */ new Map());
91
- async function Q(e) {
92
- if (!e)
93
- return "";
94
- if (f.value.has(e))
95
- return f.value.get(e) || e;
96
- try {
97
- const t = await ue.findByCode({
98
- regionCode: e
99
- });
100
- if (t.data) {
101
- const m = O(t.data);
102
- return f.value.set(e, m), I.value = [...I.value], m;
103
- }
104
- return e;
105
- } catch (t) {
106
- return console.error(`获取地区编码 ${e} 的信息失败:`, t), f.value.set(e, e), e;
107
- }
108
- }
109
- function O(e) {
110
- const t = [];
111
- function m(i) {
112
- i && i.regionName && t.push(i.regionName), i && i.children && i.children.length > 0 && m(i.children[0]);
113
- }
114
- return m(e), t.join("");
115
- }
116
- function H(e) {
117
- return f.value.has(e) ? f.value.get(e) || e : e ? (Q(e), e) : "";
118
- }
119
- function W(e) {
120
- e && s.getList();
121
- }
122
- return oe(() => {
123
- s.getList();
124
- }), (e, t) => {
125
- const m = a("el-input"), i = a("el-form-item"), _ = a("el-col"), k = a("el-button"), P = a("el-row"), G = a("el-form"), J = a("jmash-column-select"), X = a("jmash-mobileIns-component"), Y = a("Bottom"), E = a("el-icon"), Z = a("Top"), x = a("jmash-table"), ee = a("jmash-pagination"), te = a("el-card"), w = ne("hasPerm");
126
- return c(), R("div", me, [
127
- A("div", pe, [
128
- n(G, {
129
- ref_key: "queryFormRef",
130
- ref: B,
131
- model: d.value,
132
- inline: !0
133
- }, {
134
- default: o(() => [
135
- n(P, null, {
136
- default: o(() => [
137
- n(_, { span: 6 }, {
138
- default: o(() => [
139
- n(i, {
140
- label: e.$t("orderUserAddress.note"),
141
- prop: "likeNote"
142
- }, {
143
- default: o(() => [
144
- n(m, {
145
- modelValue: d.value.likeNote,
146
- "onUpdate:modelValue": t[0] || (t[0] = (l) => d.value.likeNote = l),
147
- placeholder: e.$t("orderUserAddress.noteRequired"),
148
- onKeyup: t[1] || (t[1] = j((l) => r(s).handleQuery(), ["enter"])),
149
- class: "!w-[203px]"
150
- }, null, 8, ["modelValue", "placeholder"])
151
- ]),
152
- _: 1
153
- }, 8, ["label"])
154
- ]),
155
- _: 1
156
- }),
157
- n(_, { span: 6 }, {
158
- default: o(() => [
159
- n(i, {
160
- label: e.$t("orderUserAddress.userName"),
161
- prop: "likeUserName"
162
- }, {
163
- default: o(() => [
164
- n(m, {
165
- modelValue: d.value.likeUserName,
166
- "onUpdate:modelValue": t[2] || (t[2] = (l) => d.value.likeUserName = l),
167
- placeholder: e.$t("orderUserAddress.userNameRequired"),
168
- onKeyup: t[3] || (t[3] = j((l) => r(s).handleQuery(), ["enter"])),
169
- class: "!w-[203px]"
170
- }, null, 8, ["modelValue", "placeholder"])
171
- ]),
172
- _: 1
173
- }, 8, ["label"])
174
- ]),
175
- _: 1
176
- }),
177
- n(_, { span: 12 }, {
178
- default: o(() => [
179
- n(i, { class: "search-btn" }, {
180
- default: o(() => [
181
- n(k, {
182
- type: "primary",
183
- onClick: t[4] || (t[4] = (l) => r(s).handleQuery())
184
- }, {
185
- default: o(() => [
186
- b(p(e.$t("common.search")), 1)
187
- ]),
188
- _: 1
189
- }),
190
- n(k, {
191
- onClick: t[5] || (t[5] = (l) => r(s).resetQuery())
192
- }, {
193
- default: o(() => [
194
- b(p(e.$t("common.reset")), 1)
195
- ]),
196
- _: 1
197
- })
198
- ]),
199
- _: 1
200
- })
201
- ]),
202
- _: 1
203
- })
204
- ]),
205
- _: 1
206
- })
207
- ]),
208
- _: 1
209
- }, 8, ["model"]),
210
- t[13] || (t[13] = A("div", { class: "clear" }, null, -1))
211
- ]),
212
- n(te, {
213
- shadow: "never",
214
- class: "table-container"
215
- }, {
216
- header: o(() => [
217
- n(P, null, {
218
- default: o(() => [
219
- n(_, { span: 17 }, {
220
- default: o(() => [
221
- $((c(), U(k, {
222
- type: "primary",
223
- onClick: L
224
- }, {
225
- default: o(() => [
226
- b(p(e.$t("common.add")), 1)
227
- ]),
228
- _: 1
229
- })), [
230
- [w, ["order:order_user_address:add"]]
231
- ]),
232
- $((c(), U(k, {
233
- type: "primary",
234
- onClick: t[6] || (t[6] = (l) => r(s).deleteRecords())
235
- }, {
236
- default: o(() => [
237
- b(p(e.$t("common.batchDelete")), 1)
238
- ]),
239
- _: 1
240
- })), [
241
- [w, ["order:order_user_address:delete"]]
242
- ])
243
- ]),
244
- _: 1
245
- }),
246
- n(_, {
247
- span: 7,
248
- class: "container-float"
249
- }, {
250
- default: o(() => [
251
- n(J, {
252
- modelValue: r(v),
253
- "onUpdate:modelValue": t[7] || (t[7] = (l) => S(v) ? v.value = l : v = l),
254
- "label-name": "order/order-user-address"
255
- }, null, 8, ["modelValue"])
256
- ]),
257
- _: 1
258
- })
259
- ]),
260
- _: 1
261
- })
262
- ]),
263
- footer: o(() => [
264
- r(h) > 0 ? (c(), U(ee, {
265
- key: 0,
266
- total: r(h),
267
- "onUpdate:total": t[8] || (t[8] = (l) => S(h) ? h.value = l : null),
268
- "current-page": d.value.curPage,
269
- "onUpdate:currentPage": t[9] || (t[9] = (l) => d.value.curPage = l),
270
- "page-size": d.value.pageSize,
271
- "onUpdate:pageSize": t[10] || (t[10] = (l) => d.value.pageSize = l),
272
- onPagination: t[11] || (t[11] = (l) => r(s).getList())
273
- }, null, 8, ["total", "current-page", "page-size"])) : C("", !0)
274
- ]),
275
- default: o(() => [
276
- n(x, {
277
- ref_key: "multipleTableRef",
278
- ref: z,
279
- "row-key": "addressId",
280
- "list-loading": r(D),
281
- data: r(I),
282
- "table-label": r(v),
283
- onSelectionChange: K,
284
- onSortChange: M
285
- }, {
286
- mobileIns: o((l) => [
287
- n(X, {
288
- mobilePhoneIns: l.data.row.mobilePhoneIns,
289
- mobilePhone: l.data.row.mobilePhone,
290
- mobileEncrypt: l.data.row.mobileEncrypt,
291
- onToggleEncrypt: (N) => q(l.data.row)
292
- }, null, 8, ["mobilePhoneIns", "mobilePhone", "mobileEncrypt", "onToggleEncrypt"])
293
- ]),
294
- detailInfo: o((l) => [
295
- A("span", null, p(H(l.data.row.provinceName)) + " " + p(l.data.row.detailInfo), 1)
296
- ]),
297
- listOrder: o((l) => [
298
- n(E, {
299
- size: "16",
300
- onClick: (N) => r(s).handleMove(l.data.row, !1)
301
- }, {
302
- default: o(() => [
303
- n(Y)
304
- ]),
305
- _: 2
306
- }, 1032, ["onClick"]),
307
- n(E, {
308
- size: "16",
309
- onClick: (N) => r(s).handleMove(l.data.row, !0)
310
- }, {
311
- default: o(() => [
312
- n(Z)
313
- ]),
314
- _: 2
315
- }, 1032, ["onClick"])
316
- ]),
317
- operation: o((l) => [
318
- $((c(), R("span", {
319
- class: "el-button-color",
320
- onClick: (N) => F(l.data.row)
321
- }, [
322
- b(p(e.$t("common.edit")), 1)
323
- ], 8, ce)), [
324
- [w, ["order:order_user_address:update"]]
325
- ]),
326
- $((c(), R("span", {
327
- class: "el-button-color dropdown-left",
328
- onClick: (N) => r(s).deleteRecord(l.data.row)
329
- }, [
330
- b(p(e.$t("common.delete")), 1)
331
- ], 8, fe)), [
332
- [w, ["order:order_user_address:delete"]]
333
- ])
334
- ]),
335
- _: 1
336
- }, 8, ["list-loading", "data", "table-label"])
337
- ]),
338
- _: 1
339
- }),
340
- u.value.visible ? (c(), U(ie, {
341
- key: 0,
342
- modelValue: u.value.visible,
343
- "onUpdate:modelValue": t[12] || (t[12] = (l) => u.value.visible = l),
344
- title: u.value.title,
345
- "entity-key": r(V),
346
- onRefresh: W,
347
- width: "500px"
348
- }, null, 8, ["modelValue", "title", "entity-key"])) : C("", !0)
349
- ]);
350
- };
351
- }
352
- });
353
- export {
354
- ge as default
355
- };