zhihao-ui 1.2.10 → 1.2.11
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 B, useModel as H, ref as E, openBlock as s, createBlock as c, unref as o, withCtx as p, createVNode as g, createElementBlock as f, Fragment as N, renderList as Z, normalizeClass as D, toDisplayString as
|
|
1
|
+
import { defineComponent as B, useModel as H, ref as E, openBlock as s, createBlock as c, unref as o, withCtx as p, createVNode as g, createElementBlock as f, Fragment as N, renderList as Z, normalizeClass as D, toDisplayString as v, createCommentVNode as x, createElementVNode as y, createTextVNode as w, mergeModels as z } from "vue";
|
|
2
2
|
import { D as X } from "./DatePicker-CWQoV03Q.js";
|
|
3
3
|
import { d as _, e as V, f as j, g as K, i as k, j as C, k as P, l as T, E as L } from "./vendor-BY-fHNA3.js";
|
|
4
4
|
import { _ as G } from "./Button-DBbUF88w.js";
|
|
5
5
|
import { w as J } from "./utils-DZ8-2Fg2.js";
|
|
6
|
-
var
|
|
6
|
+
var m = /* @__PURE__ */ ((u) => (u.AUTOCOMPLETE = "autocomplete", u.FORMAT = "format", u.TEXT = "text", u))(m || {});
|
|
7
7
|
const Q = { key: 0 }, W = {
|
|
8
8
|
key: 1,
|
|
9
9
|
class: "col-edit-header"
|
|
@@ -29,7 +29,7 @@ const Q = { key: 0 }, W = {
|
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
31
|
n.value.push({});
|
|
32
|
-
},
|
|
32
|
+
}, A = () => {
|
|
33
33
|
if (i.value.filter((e) => e.isAdd).length >= h.maxColLength) {
|
|
34
34
|
_({
|
|
35
35
|
message: `最多添加${h.maxColLength}列`,
|
|
@@ -46,20 +46,20 @@ const Q = { key: 0 }, W = {
|
|
|
46
46
|
maxlength: 15,
|
|
47
47
|
headerMaxlength: 15
|
|
48
48
|
});
|
|
49
|
-
},
|
|
50
|
-
i.value.splice(
|
|
49
|
+
}, U = (a, l) => {
|
|
50
|
+
i.value.splice(a, 1), n.value.forEach((e) => {
|
|
51
51
|
delete e[l.prop];
|
|
52
52
|
});
|
|
53
|
-
}, F = (
|
|
54
|
-
n.value.splice(
|
|
55
|
-
}, S = (
|
|
53
|
+
}, F = (a) => {
|
|
54
|
+
n.value.splice(a, 1);
|
|
55
|
+
}, S = (a, l, e) => {
|
|
56
56
|
l(
|
|
57
|
-
e.completeList.filter((r) => r.includes(
|
|
57
|
+
e.completeList.filter((r) => r.includes(a)).map((r) => ({ value: r }))
|
|
58
58
|
);
|
|
59
|
-
},
|
|
59
|
+
}, O = (a) => [
|
|
60
60
|
{
|
|
61
61
|
validator: (l, e, r) => {
|
|
62
|
-
if (!i.value[
|
|
62
|
+
if (!i.value[a].label) {
|
|
63
63
|
r(new Error("请输入表头"));
|
|
64
64
|
return;
|
|
65
65
|
}
|
|
@@ -68,45 +68,45 @@ const Q = { key: 0 }, W = {
|
|
|
68
68
|
message: "请输入表头",
|
|
69
69
|
trigger: ["blur", "change"]
|
|
70
70
|
}
|
|
71
|
-
],
|
|
71
|
+
], q = (a) => {
|
|
72
72
|
const l = [];
|
|
73
|
-
return
|
|
73
|
+
return a.required && l.push({
|
|
74
74
|
required: !0,
|
|
75
|
-
message: "请输入" +
|
|
75
|
+
message: "请输入" + a.label,
|
|
76
76
|
trigger: "blur"
|
|
77
|
-
}),
|
|
78
|
-
validator: (e, r,
|
|
79
|
-
const d =
|
|
80
|
-
d !== !0 ?
|
|
77
|
+
}), a.varidate && l.push({
|
|
78
|
+
validator: (e, r, t) => {
|
|
79
|
+
const d = a.varidate(r);
|
|
80
|
+
d !== !0 ? t(new Error(d)) : t();
|
|
81
81
|
},
|
|
82
82
|
trigger: "blur"
|
|
83
83
|
}), l;
|
|
84
84
|
}, b = E();
|
|
85
85
|
return R({
|
|
86
86
|
/** 初始化数据 */
|
|
87
|
-
initData: (
|
|
88
|
-
console.log("initData",
|
|
89
|
-
for (const e in
|
|
87
|
+
initData: (a, l) => {
|
|
88
|
+
console.log("initData", a, l), a = V(a) || [], a.length === 0 && a.push({}), l = [...l];
|
|
89
|
+
for (const e in a[0])
|
|
90
90
|
if (!l.some(
|
|
91
91
|
(r) => r.prop === e
|
|
92
92
|
)) {
|
|
93
|
-
const r = Date.now() + e,
|
|
94
|
-
if (
|
|
93
|
+
const r = Date.now() + e, t = e.split(M);
|
|
94
|
+
if (t.length !== 2) {
|
|
95
95
|
console.log("keySplit 失败", e);
|
|
96
96
|
continue;
|
|
97
97
|
}
|
|
98
|
-
const d = Number(
|
|
98
|
+
const d = Number(t[1]);
|
|
99
99
|
l[d] = {
|
|
100
100
|
prop: e,
|
|
101
101
|
isEditHeader: !0,
|
|
102
|
-
label:
|
|
102
|
+
label: t[0],
|
|
103
103
|
key: r,
|
|
104
104
|
isAdd: !0,
|
|
105
105
|
maxlength: 15,
|
|
106
106
|
headerMaxlength: 15
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
n.value =
|
|
109
|
+
n.value = a, i.value = l;
|
|
110
110
|
},
|
|
111
111
|
/** 获取数据 */
|
|
112
112
|
getData: async () => {
|
|
@@ -122,33 +122,33 @@ const Q = { key: 0 }, W = {
|
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
const
|
|
126
|
-
for (const l in
|
|
127
|
-
const e =
|
|
125
|
+
const a = V(n.value);
|
|
126
|
+
for (const l in a) {
|
|
127
|
+
const e = a[l];
|
|
128
128
|
for (const r in i.value) {
|
|
129
|
-
const
|
|
130
|
-
if (
|
|
129
|
+
const t = i.value[r];
|
|
130
|
+
if (t.isSameData && l !== "0" && (e[t.prop] = a[0][t.prop]), t.varidate && !t.varidate(e[t.prop]))
|
|
131
131
|
return;
|
|
132
|
-
if (
|
|
133
|
-
const d =
|
|
134
|
-
e[d] = e[
|
|
132
|
+
if (t.isAdd) {
|
|
133
|
+
const d = t.label + M + r;
|
|
134
|
+
e[d] = e[t.prop], delete e[t.prop];
|
|
135
135
|
}
|
|
136
|
-
|
|
136
|
+
t.formatter && t.type === m.FORMAT && (e[t.prop] = t.formatter(e));
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
return console.log("DiyDataTable 获取数据",
|
|
140
|
-
data:
|
|
139
|
+
return console.log("DiyDataTable 获取数据", a, i.value), {
|
|
140
|
+
data: a,
|
|
141
141
|
columns: i.value
|
|
142
142
|
};
|
|
143
143
|
},
|
|
144
144
|
/** 更新列配置数据 */
|
|
145
|
-
updateColumn: (
|
|
146
|
-
const e = i.value[
|
|
147
|
-
if (i.value[
|
|
145
|
+
updateColumn: (a, l) => {
|
|
146
|
+
const e = i.value[a].prop;
|
|
147
|
+
if (i.value[a] = l, e !== l.prop)
|
|
148
148
|
for (const r of n.value)
|
|
149
149
|
r[l.prop] = r[e], delete r[e];
|
|
150
150
|
}
|
|
151
|
-
}), (
|
|
151
|
+
}), (a, l) => (s(), c(o(j), {
|
|
152
152
|
class: "diy-data-table",
|
|
153
153
|
model: u.rawData,
|
|
154
154
|
ref_key: "formRef",
|
|
@@ -171,15 +171,15 @@ const Q = { key: 0 }, W = {
|
|
|
171
171
|
fixed: e.fixed
|
|
172
172
|
}, {
|
|
173
173
|
header: p(() => [
|
|
174
|
-
|
|
174
|
+
a.isEdit ? e.isEditHeader ? (s(), f("div", W, [
|
|
175
175
|
g(o(C), {
|
|
176
176
|
prop: `columns.${r}`,
|
|
177
|
-
rules:
|
|
177
|
+
rules: O(r)
|
|
178
178
|
}, {
|
|
179
179
|
default: p(() => [
|
|
180
180
|
g(o(T), {
|
|
181
181
|
modelValue: e.label,
|
|
182
|
-
"onUpdate:modelValue": (
|
|
182
|
+
"onUpdate:modelValue": (t) => e.label = t,
|
|
183
183
|
maxlength: e.headerMaxlength || 20,
|
|
184
184
|
placeholder: "请输入表头"
|
|
185
185
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "maxlength"])
|
|
@@ -189,32 +189,32 @@ const Q = { key: 0 }, W = {
|
|
|
189
189
|
e.isAdd ? (s(), f("i", {
|
|
190
190
|
key: 0,
|
|
191
191
|
class: "iconfont icon-close",
|
|
192
|
-
onClick: (
|
|
192
|
+
onClick: (t) => U(r, e)
|
|
193
193
|
}, null, 8, Y)) : x("", !0)
|
|
194
194
|
])) : (s(), f("div", {
|
|
195
195
|
key: 2,
|
|
196
196
|
class: D({ "is-required-label": e.required })
|
|
197
|
-
},
|
|
197
|
+
}, v(e.label), 3)) : (s(), f("div", Q, v(e.label), 1))
|
|
198
198
|
]),
|
|
199
|
-
default: p((
|
|
200
|
-
h.isEdit && (!e.isSameData ||
|
|
199
|
+
default: p((t) => [
|
|
200
|
+
h.isEdit && (!e.isSameData || t.$index === 0) && e.type !== o(m).TEXT ? (s(), c(o(C), {
|
|
201
201
|
key: 0,
|
|
202
|
-
prop: `${
|
|
203
|
-
rules:
|
|
202
|
+
prop: `${t.$index}.${e.prop}`,
|
|
203
|
+
rules: q(e),
|
|
204
204
|
class: D(["col-edit-container", { "close-padding": e.isAdd }])
|
|
205
205
|
}, {
|
|
206
206
|
default: p(() => [
|
|
207
|
-
e.type === o(
|
|
207
|
+
e.type === o(m).FORMAT && e.formatter ? (s(), f("div", ee, v(e.formatter(t.row)), 1)) : e.type === o(m).AUTOCOMPLETE ? (s(), c(o(P), {
|
|
208
208
|
key: 1,
|
|
209
|
-
modelValue:
|
|
210
|
-
"onUpdate:modelValue": (d) =>
|
|
209
|
+
modelValue: t.row[e.prop],
|
|
210
|
+
"onUpdate:modelValue": (d) => t.row[e.prop] = d,
|
|
211
211
|
placeholder: e.placeholder || "请输入",
|
|
212
|
-
"fetch-suggestions": (d,
|
|
212
|
+
"fetch-suggestions": (d, I) => S(d, I, e),
|
|
213
213
|
maxlength: e.maxlength || 20
|
|
214
214
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "fetch-suggestions", "maxlength"])) : (s(), c(o(T), {
|
|
215
215
|
key: 2,
|
|
216
|
-
modelValue:
|
|
217
|
-
"onUpdate:modelValue": (d) =>
|
|
216
|
+
modelValue: t.row[e.prop],
|
|
217
|
+
"onUpdate:modelValue": (d) => t.row[e.prop] = d,
|
|
218
218
|
placeholder: e.placeholder || "请输入",
|
|
219
219
|
formatter: e.formatter,
|
|
220
220
|
parser: e.parser,
|
|
@@ -222,7 +222,7 @@ const Q = { key: 0 }, W = {
|
|
|
222
222
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "formatter", "parser", "maxlength"]))
|
|
223
223
|
]),
|
|
224
224
|
_: 2
|
|
225
|
-
}, 1032, ["prop", "rules", "class"])) : (s(), f("div", te,
|
|
225
|
+
}, 1032, ["prop", "rules", "class"])) : (s(), f("div", te, v((e.isSameData ? n.value[0][e.prop] : t.row[e.prop]) || o(X)), 1))
|
|
226
226
|
]),
|
|
227
227
|
_: 2
|
|
228
228
|
}, 1032, ["prop", "label", "width", "fixed"]))), 128)),
|
|
@@ -232,14 +232,14 @@ const Q = { key: 0 }, W = {
|
|
|
232
232
|
fixed: "right"
|
|
233
233
|
}, {
|
|
234
234
|
header: p(() => [
|
|
235
|
-
|
|
235
|
+
y("div", ae, [
|
|
236
236
|
g(o(L), {
|
|
237
237
|
type: "primary",
|
|
238
238
|
link: "",
|
|
239
239
|
onClick: $
|
|
240
240
|
}, {
|
|
241
241
|
default: p(() => l[0] || (l[0] = [
|
|
242
|
-
|
|
242
|
+
y("i", { class: "iconfont icon-Frame1" }, null, -1),
|
|
243
243
|
w("增行")
|
|
244
244
|
])),
|
|
245
245
|
_: 1
|
|
@@ -247,10 +247,10 @@ const Q = { key: 0 }, W = {
|
|
|
247
247
|
g(o(L), {
|
|
248
248
|
type: "primary",
|
|
249
249
|
link: "",
|
|
250
|
-
onClick:
|
|
250
|
+
onClick: A
|
|
251
251
|
}, {
|
|
252
252
|
default: p(() => l[1] || (l[1] = [
|
|
253
|
-
|
|
253
|
+
y("i", { class: "iconfont icon-Frame-11" }, null, -1),
|
|
254
254
|
w("增列")
|
|
255
255
|
])),
|
|
256
256
|
_: 1
|
|
@@ -258,7 +258,7 @@ const Q = { key: 0 }, W = {
|
|
|
258
258
|
])
|
|
259
259
|
]),
|
|
260
260
|
default: p(({ $index: e }) => [
|
|
261
|
-
|
|
261
|
+
y("div", le, [
|
|
262
262
|
n.value.length > 1 ? (s(), f("i", {
|
|
263
263
|
key: 0,
|
|
264
264
|
class: "iconfont icon-close",
|
|
@@ -275,8 +275,8 @@ const Q = { key: 0 }, W = {
|
|
|
275
275
|
_: 1
|
|
276
276
|
}, 8, ["model"]));
|
|
277
277
|
}
|
|
278
|
-
}), ie = /* @__PURE__ */ G(oe, [["__scopeId", "data-v-
|
|
278
|
+
}), ie = /* @__PURE__ */ G(oe, [["__scopeId", "data-v-bf341535"]]), fe = J(ie);
|
|
279
279
|
export {
|
|
280
|
-
|
|
280
|
+
m as D,
|
|
281
281
|
fe as Z
|
|
282
282
|
};
|
package/dist/es/index.js
CHANGED
|
@@ -16,8 +16,8 @@ import { Z as u } from "./PageHeadPanel-_mKu2rMQ.js";
|
|
|
16
16
|
import { Z as D } from "./ToolTips-BTCP0N--.js";
|
|
17
17
|
import { Z as I } from "./BaseInfo-Dv-eon6t.js";
|
|
18
18
|
import { Z as d } from "./DetailHeader-C_mAB8-2.js";
|
|
19
|
-
import { Z as P } from "./DiyDataTable-
|
|
20
|
-
import { D as J } from "./DiyDataTable-
|
|
19
|
+
import { Z as P } from "./DiyDataTable-CpkKeWkY.js";
|
|
20
|
+
import { D as J } from "./DiyDataTable-CpkKeWkY.js";
|
|
21
21
|
import { Z as T } from "./Map-B8_d8utt.js";
|
|
22
22
|
const b = [
|
|
23
23
|
I,
|