zhihao-ui 1.2.63 → 1.2.65

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,9 +1,9 @@
1
- import { defineComponent as Z, useModel as P, ref as R, openBlock as i, createBlock as h, unref as s, withCtx as p, createVNode as c, mergeProps as z, createElementBlock as m, Fragment as _, renderList as X, normalizeClass as T, toDisplayString as v, renderSlot as V, createTextVNode as x, createCommentVNode as w, createElementVNode as k, mergeModels as j } from "vue";
1
+ import { defineComponent as Z, useModel as P, ref as V, openBlock as i, createBlock as v, unref as n, withCtx as p, createVNode as c, mergeProps as z, createElementBlock as u, Fragment as b, renderList as X, normalizeClass as _, toDisplayString as m, renderSlot as E, createTextVNode as x, createCommentVNode as w, createElementVNode as k, mergeModels as j } from "vue";
2
2
  import { D as $ } from "./BaseItem-BtsARxvz.js";
3
- import { g as b, i as F, j as K, k as G, l as E, m as M, n as J, o as L, b as S } from "./vendor-DaYdW1_n.js";
3
+ import { g as C, i as F, j as K, k as G, l as D, m as M, n as J, o as L, b as S } from "./vendor-DaYdW1_n.js";
4
4
  import { _ as Q } from "./Button-Dw3i74l2.js";
5
5
  import { w as Y } from "./utils-BSQSj8Ii.js";
6
- var g = /* @__PURE__ */ ((u) => (u.AUTOCOMPLETE = "autocomplete", u.FORMAT = "format", u.TEXT = "text", u))(g || {});
6
+ var g = /* @__PURE__ */ ((f) => (f.AUTOCOMPLETE = "autocomplete", f.FORMAT = "format", f.TEXT = "text", f))(g || {});
7
7
  const ee = { key: 0 }, te = {
8
8
  key: 1,
9
9
  class: "col-edit-header"
@@ -25,21 +25,21 @@ const ee = { key: 0 }, te = {
25
25
  rawDataModifiers: {}
26
26
  }),
27
27
  emits: ["update:rawData"],
28
- setup(u, { expose: I }) {
29
- const f = u, n = P(u, "rawData"), l = R([]), C = () => {
30
- if (n.value.length === f.maxRowLength) {
31
- b({
32
- message: `最多添加${f.maxRowLength}行`,
28
+ setup(f, { expose: I }) {
29
+ const h = f, s = P(f, "rawData"), l = V([]), A = () => {
30
+ if (s.value.length === h.maxRowLength) {
31
+ C({
32
+ message: `最多添加${h.maxRowLength}行`,
33
33
  type: "warning"
34
34
  });
35
35
  return;
36
36
  }
37
37
  let t = {};
38
- f.beforeAddRow && (t = f.beforeAddRow(n.value)), n.value.push(t);
39
- }, D = () => {
40
- if (l.value.filter((e) => e.isAdd).length >= f.maxColLength) {
41
- b({
42
- message: `最多添加${f.maxColLength}列`,
38
+ h.beforeAddRow && (t = h.beforeAddRow(s.value)), s.value.push(t);
39
+ }, R = () => {
40
+ if (l.value.filter((e) => e.isAdd).length >= h.maxColLength) {
41
+ C({
42
+ message: `最多添加${h.maxColLength}列`,
43
43
  type: "warning"
44
44
  });
45
45
  return;
@@ -55,13 +55,13 @@ const ee = { key: 0 }, te = {
55
55
  headerMaxlength: 15
56
56
  });
57
57
  }, O = (t, a) => {
58
- l.value.splice(t, 1), n.value.forEach((e) => {
58
+ l.value.splice(t, 1), s.value.forEach((e) => {
59
59
  delete e[a.prop];
60
60
  });
61
61
  }, B = (t) => {
62
62
  t === 0 && l.value.forEach((a) => {
63
- a.isSameData && (n.value[1][a.prop] = n.value[0][a.prop]);
64
- }), n.value.splice(t, 1);
63
+ a.isSameData && (s.value[1][a.prop] = s.value[0][a.prop]);
64
+ }), s.value.splice(t, 1);
65
65
  }, q = (t, a, e) => {
66
66
  a(
67
67
  e.completeList.filter((o) => o.includes(t)).map((o) => ({ value: o }))
@@ -93,8 +93,8 @@ const ee = { key: 0 }, te = {
93
93
  }), a;
94
94
  }, W = (t, a) => {
95
95
  let e = t;
96
- return a.isSameData && (e = n.value[0] || $), a.formatter ? a.showFormatter ? a.type === g.FORMAT ? a.showFormatter(a.formatter(e)) : a.showFormatter(e[a.prop]) : a.formatter(e[a.prop]) : e[a.prop] || $;
97
- }, A = R();
96
+ return a.isSameData && (e = s.value[0] || $), a.formatter ? a.showFormatter ? a.type === g.FORMAT ? a.showFormatter(a.formatter(e)) : a.showFormatter(e[a.prop]) : a.formatter(e[a.prop]) : e[a.prop] || $;
97
+ }, T = V();
98
98
  return I({
99
99
  /** 初始化数据 */
100
100
  initData: (t, a) => {
@@ -119,23 +119,23 @@ const ee = { key: 0 }, te = {
119
119
  headerMaxlength: 15
120
120
  };
121
121
  }
122
- n.value = t, l.value = a;
122
+ s.value = t, l.value = a;
123
123
  },
124
124
  /** 获取数据 */
125
125
  getData: async () => {
126
- await A.value.validate();
126
+ await T.value.validate();
127
127
  for (const a in l.value) {
128
128
  const e = l.value[a];
129
129
  for (const o of l.value)
130
130
  if (e.prop !== o.prop && e.label === o.label) {
131
- b({
131
+ C({
132
132
  message: "所有列的表头不可重复",
133
133
  type: "warning"
134
134
  });
135
135
  return;
136
136
  }
137
137
  }
138
- const t = F(n.value);
138
+ const t = F(s.value);
139
139
  for (const a in t) {
140
140
  const e = t[a];
141
141
  for (const o in l.value) {
@@ -160,13 +160,13 @@ const ee = { key: 0 }, te = {
160
160
  updateColumn: (t, a) => {
161
161
  const e = l.value[t].prop;
162
162
  if (l.value[t] = a, e !== a.prop)
163
- for (const o of n.value)
163
+ for (const o of s.value)
164
164
  o[a.prop] = o[e], delete o[e];
165
165
  },
166
166
  /** 重置默认列配置数据 */
167
167
  resetColumns: (t) => {
168
168
  const e = l.value.filter((r) => !r.isAdd).reduce((r, d) => (t.some((y) => y.prop === d.prop) || r.push(d.prop), r), []);
169
- n.value.forEach((r) => {
169
+ s.value.forEach((r) => {
170
170
  e.forEach((d) => {
171
171
  delete r[d];
172
172
  });
@@ -174,24 +174,24 @@ const ee = { key: 0 }, te = {
174
174
  const o = t.filter((r) => r.isAdd);
175
175
  l.value = [...t, ...o];
176
176
  },
177
- onAddRow: C,
178
- onAddColumn: D
179
- }), (t, a) => (i(), h(s(K), {
177
+ onAddRow: A,
178
+ onAddColumn: R
179
+ }), (t, a) => (i(), v(n(K), {
180
180
  class: "diy-data-table",
181
- model: u.rawData,
181
+ model: f.rawData,
182
182
  ref_key: "formRef",
183
- ref: A
183
+ ref: T
184
184
  }, {
185
185
  default: p(() => [
186
- c(s(G), z({ data: n.value }, t.$attrs), {
186
+ c(n(G), z({ data: s.value }, t.$attrs), {
187
187
  default: p(() => [
188
- c(s(E), {
188
+ c(n(D), {
189
189
  type: "index",
190
190
  label: "序号",
191
191
  width: "132",
192
192
  fixed: "left"
193
193
  }),
194
- (i(!0), m(_, null, X(l.value, (e, o) => (i(), h(s(E), {
194
+ (i(!0), u(b, null, X(l.value, (e, o) => (i(), v(n(D), {
195
195
  key: e.key || o,
196
196
  prop: e.prop,
197
197
  label: e.label,
@@ -200,13 +200,13 @@ const ee = { key: 0 }, te = {
200
200
  fixed: e.fixed
201
201
  }, {
202
202
  header: p(() => [
203
- t.isEdit ? e.isEditHeader ? (i(), m("div", te, [
204
- c(s(M), {
203
+ t.isEdit ? e.isEditHeader ? (i(), u("div", te, [
204
+ c(n(M), {
205
205
  prop: `columns.${o}`,
206
206
  rules: H(o)
207
207
  }, {
208
208
  default: p(() => [
209
- c(s(L), {
209
+ c(n(L), {
210
210
  modelValue: e.label,
211
211
  "onUpdate:modelValue": (r) => e.label = r,
212
212
  maxlength: e.headerMaxlength || 20,
@@ -215,38 +215,38 @@ const ee = { key: 0 }, te = {
215
215
  ]),
216
216
  _: 2
217
217
  }, 1032, ["prop", "rules"]),
218
- e.isAdd ? (i(), m("i", {
218
+ e.isAdd ? (i(), u("i", {
219
219
  key: 0,
220
220
  class: "iconfont icon-close",
221
221
  onClick: (r) => O(o, e)
222
222
  }, null, 8, ae)) : w("", !0)
223
- ])) : (i(), m("div", {
223
+ ])) : (i(), u("div", {
224
224
  key: 2,
225
- class: T({ "is-required-label": e.required })
226
- }, v(e.label), 3)) : (i(), m("div", ee, v(e.label), 1))
225
+ class: _({ "is-required-label": e.required })
226
+ }, m(e.label), 3)) : (i(), u("div", ee, m(e.label), 1))
227
227
  ]),
228
228
  default: p((r) => [
229
- f.isEdit && (!e.isSameData || r.$index === 0) && e.type !== s(g).TEXT ? (i(), h(s(M), {
229
+ h.isEdit && (!e.isSameData || r.$index === 0) && e.type !== n(g).TEXT ? (i(), v(n(M), {
230
230
  key: 0,
231
231
  prop: `${r.$index}.${e.prop}`,
232
232
  rules: N(e),
233
- class: T(["col-edit-container", { "close-padding": e.isAdd }])
233
+ class: _(["col-edit-container", { "close-padding": e.isAdd }])
234
234
  }, {
235
235
  default: p(() => [
236
- e.type === s(g).FORMAT && e.formatter ? (i(), m("div", re, v(e.showFormatter ? e.showFormatter(
236
+ e.type === n(g).FORMAT && e.formatter ? (i(), u("div", re, m(e.showFormatter ? e.showFormatter(
237
237
  e.formatter(r.row)
238
- ) : e.formatter(r.row)), 1)) : e.type === s(g).AUTOCOMPLETE ? (i(), h(s(J), {
238
+ ) : e.formatter(r.row)), 1)) : e.type === n(g).AUTOCOMPLETE ? (i(), v(n(J), {
239
239
  key: 1,
240
240
  modelValue: r.row[e.prop],
241
241
  "onUpdate:modelValue": (d) => r.row[e.prop] = d,
242
242
  placeholder: e.placeholder || "请输入",
243
243
  "fetch-suggestions": (d, y) => q(d, y, e),
244
244
  maxlength: e.maxlength || 20
245
- }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "fetch-suggestions", "maxlength"])) : e.slot ? V(t.$slots, e.slot, {
245
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "fetch-suggestions", "maxlength"])) : e.slot ? E(t.$slots, e.slot, {
246
246
  key: 2,
247
247
  row: r.row,
248
248
  $index: r.$index
249
- }, void 0, !0) : (i(), h(s(L), {
249
+ }, void 0, !0) : (i(), v(n(L), {
250
250
  key: 3,
251
251
  modelValue: r.row[e.prop],
252
252
  "onUpdate:modelValue": (d) => r.row[e.prop] = d,
@@ -257,44 +257,44 @@ const ee = { key: 0 }, te = {
257
257
  }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "formatter", "parser", "maxlength"]))
258
258
  ]),
259
259
  _: 2
260
- }, 1032, ["prop", "rules", "class"])) : e.slot ? V(t.$slots, e.slot, {
260
+ }, 1032, ["prop", "rules", "class"])) : e.slot ? E(t.$slots, e.slot, {
261
261
  key: 1,
262
262
  row: r.row,
263
263
  $index: r.$index
264
- }, void 0, !0) : (i(), m(_, { key: 2 }, [
265
- x(v(W(r.row, e)), 1)
264
+ }, void 0, !0) : (i(), u(b, { key: 2 }, [
265
+ x(m(W(r.row, e)), 1)
266
266
  ], 64))
267
267
  ]),
268
268
  _: 2
269
269
  }, 1032, ["prop", "label", "width", "min-width", "fixed"]))), 128)),
270
- f.isEdit ? (i(), h(s(E), {
270
+ h.isEdit ? (i(), v(n(D), {
271
271
  key: 0,
272
272
  width: "150",
273
273
  fixed: "right"
274
274
  }, {
275
275
  header: p(() => [
276
276
  k("div", oe, [
277
- t.customAddRow ? (i(), h(s(S), {
277
+ t.customAddRow ? (i(), v(n(S), {
278
278
  key: 0,
279
279
  type: "primary",
280
280
  link: "",
281
- onClick: C
281
+ onClick: A
282
282
  }, {
283
283
  default: p(() => [
284
284
  a[0] || (a[0] = k("i", { class: "iconfont icon-Frame1" }, null, -1)),
285
- x(v(t.addRowText), 1)
285
+ x(m(t.addRowText), 1)
286
286
  ]),
287
287
  _: 1
288
288
  })) : w("", !0),
289
- t.customAddColumn ? (i(), h(s(S), {
289
+ t.customAddColumn ? (i(), v(n(S), {
290
290
  key: 1,
291
291
  type: "primary",
292
292
  link: "",
293
- onClick: D
293
+ onClick: R
294
294
  }, {
295
295
  default: p(() => [
296
296
  a[1] || (a[1] = k("i", { class: "iconfont icon-Frame-11" }, null, -1)),
297
- x(v(t.addColumnText), 1)
297
+ x(m(t.addColumnText), 1)
298
298
  ]),
299
299
  _: 1
300
300
  })) : w("", !0)
@@ -302,14 +302,20 @@ const ee = { key: 0 }, te = {
302
302
  ]),
303
303
  default: p(({ $index: e }) => [
304
304
  k("div", le, [
305
- n.value.length > 1 ? (i(), m("i", {
305
+ t.$slots.operation ? E(t.$slots, "operation", {
306
306
  key: 0,
307
- class: "iconfont icon-close",
308
- onClick: (o) => B(e)
309
- }, null, 8, de)) : w("", !0)
307
+ row: s.value[e],
308
+ $index: e
309
+ }, void 0, !0) : (i(), u(b, { key: 1 }, [
310
+ s.value.length > 1 ? (i(), u("i", {
311
+ key: 0,
312
+ class: "iconfont icon-close",
313
+ onClick: (o) => B(e)
314
+ }, null, 8, de)) : w("", !0)
315
+ ], 64))
310
316
  ])
311
317
  ]),
312
- _: 1
318
+ _: 3
313
319
  })) : w("", !0)
314
320
  ]),
315
321
  _: 3
@@ -318,8 +324,8 @@ const ee = { key: 0 }, te = {
318
324
  _: 3
319
325
  }, 8, ["model"]));
320
326
  }
321
- }), se = /* @__PURE__ */ Q(ie, [["__scopeId", "data-v-a3491e94"]]), me = Y(se);
327
+ }), se = /* @__PURE__ */ Q(ie, [["__scopeId", "data-v-048d82d3"]]), ve = Y(se);
322
328
  export {
323
329
  g as D,
324
- me as Z
330
+ ve as Z
325
331
  };
package/dist/es/index.js CHANGED
@@ -15,8 +15,8 @@ import { Z as b } from "./PageHeadPanel-d3ponlDx.js";
15
15
  import { Z as _ } from "./ToolTips-D0FAOOvm.js";
16
16
  import { Z as A } from "./BaseInfo-VzgiaCKn.js";
17
17
  import { Z as E } from "./DetailHeader-C5LjDuTv.js";
18
- import { Z as c } from "./DiyDataTable-Ctu1CHM9.js";
19
- import { D as Q } from "./DiyDataTable-Ctu1CHM9.js";
18
+ import { Z as c } from "./DiyDataTable-Cgqys5z_.js";
19
+ import { D as Q } from "./DiyDataTable-Cgqys5z_.js";
20
20
  import { Z as B } from "./Map-BpqtL7_q.js";
21
21
  import { B as $, C as aa, c as oa, D as ra, L as ma, S as sa, b as ta, a as Za, m as ea, p as ia, r as pa, t as fa, z as ha } from "./Map-BpqtL7_q.js";
22
22
  import { Z as L } from "./Table-BufcZ4Wy.js";