@unizhen/ui 0.1.29 → 0.1.31
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.
- package/lib/ui.js +94 -92
- package/package.json +14 -14
package/lib/ui.js
CHANGED
|
@@ -5028,11 +5028,11 @@ var fp = () => new Promise((e) => {
|
|
|
5028
5028
|
function gp() {
|
|
5029
5029
|
hp.clear();
|
|
5030
5030
|
}
|
|
5031
|
-
async function _p(e) {
|
|
5032
|
-
let
|
|
5033
|
-
return
|
|
5034
|
-
sourceData:
|
|
5035
|
-
n
|
|
5031
|
+
async function _p(e, t = !0) {
|
|
5032
|
+
let n = e.split("."), r = !1;
|
|
5033
|
+
return n.length > 1 && (hp.has(n[0]) && t ? r = H(hp.get(n[0])) : (r = await xd({ tableId: n[0] }), hp.set(n[0], r))), {
|
|
5034
|
+
sourceData: r,
|
|
5035
|
+
n
|
|
5036
5036
|
};
|
|
5037
5037
|
}
|
|
5038
5038
|
async function vp(e) {
|
|
@@ -5380,11 +5380,11 @@ async function Ep(e, t = !1, n = 0, r = () => {}, i = {}) {
|
|
|
5380
5380
|
})) : (u.push(e), d.push(e.key));
|
|
5381
5381
|
for await (let e of u) {
|
|
5382
5382
|
if (e.source && !e.table.render && (e.input === "select" || e.input === "cascader")) if (e.table.render = (t) => t[`${e.key}Str`], t || e.params.immediately || e.search.defaultValue) {
|
|
5383
|
-
let { sourceData:
|
|
5384
|
-
if (
|
|
5385
|
-
let
|
|
5386
|
-
e.params.options = r(
|
|
5387
|
-
} else e.params.options = mp(e,
|
|
5383
|
+
let { sourceData: n, n: r } = await _p(e.source, !t);
|
|
5384
|
+
if (n && Array.isArray(n)) if (e.sourceFn) {
|
|
5385
|
+
let t = e.sourceFn, r = Function("sourceData", t);
|
|
5386
|
+
e.params.options = r(n);
|
|
5387
|
+
} else e.params.options = mp(e, n, r);
|
|
5388
5388
|
} else e.params.options = [{
|
|
5389
5389
|
label: "加载中......",
|
|
5390
5390
|
value: "loading",
|
|
@@ -6510,14 +6510,14 @@ var zp = /*#__PURE__*/ U(Ap, [["render", Rp]]), Bp = d({
|
|
|
6510
6510
|
}
|
|
6511
6511
|
},
|
|
6512
6512
|
emits: ["update:value"],
|
|
6513
|
-
setup(e, { emit:
|
|
6514
|
-
let
|
|
6513
|
+
setup(e, { emit: n, expose: r }) {
|
|
6514
|
+
let i = p("emitSuffix"), a = p("modules"), o = p("mainFormValue"), s = p("childFormReload"), c = t(() => s()), { t: l } = Ye(), u = w(), d = w(), m = w(), g = w(!1), _ = w(!0), y = w([]), b = w({ child: [] }), x = w(""), S = w({}), C = w([]), T = w(void 0), E = async (t, n) => {
|
|
6515
6515
|
let { formDefaultValue: r, fillingDefaultArray: i } = await Tp(H(n ?? e.item.params.columns), t, void 0, !0);
|
|
6516
|
-
return
|
|
6517
|
-
},
|
|
6518
|
-
if (
|
|
6519
|
-
|
|
6520
|
-
let n = await
|
|
6516
|
+
return S.value = r, i;
|
|
6517
|
+
}, D = async (t) => {
|
|
6518
|
+
if (g.value) return;
|
|
6519
|
+
g.value = !0;
|
|
6520
|
+
let n = await E(t), r = H(t).map((e, t) => ({
|
|
6521
6521
|
...e,
|
|
6522
6522
|
...n[t]
|
|
6523
6523
|
}));
|
|
@@ -6529,21 +6529,21 @@ var zp = /*#__PURE__*/ U(Ap, [["render", Rp]]), Bp = d({
|
|
|
6529
6529
|
t.forEach((t) => {
|
|
6530
6530
|
e[t] && typeof e[t] == "string" && (e[t] = JSON.parse(e[t]));
|
|
6531
6531
|
});
|
|
6532
|
-
}), e.item.params.init && r.length === 0 && e.status === 0 && (r = [
|
|
6532
|
+
}), e.item.params.init && r.length === 0 && e.status === 0 && (r = [S.value]), e.item.params.merge && typeof e.item.params.merge == "string") try {
|
|
6533
6533
|
let t = e.item.params.merge;
|
|
6534
|
-
r = await Function("formValue", "mainFormValue", "POST", t)(r,
|
|
6534
|
+
r = await Function("formValue", "mainFormValue", "POST", t)(r, o, Z);
|
|
6535
6535
|
} catch (e) {
|
|
6536
6536
|
q(e);
|
|
6537
6537
|
}
|
|
6538
|
-
|
|
6539
|
-
|
|
6538
|
+
b.value.child = r, g.value = !1, h(() => {
|
|
6539
|
+
F();
|
|
6540
6540
|
});
|
|
6541
6541
|
} else h(() => {
|
|
6542
|
-
|
|
6542
|
+
F();
|
|
6543
6543
|
});
|
|
6544
|
-
},
|
|
6545
|
-
e.item._suffix && (
|
|
6546
|
-
let { tableColumns: n, tableWidth: r } = await Ep(H(t ?? e.item.params.columns), !0, e.status, () =>
|
|
6544
|
+
}, ee = (e) => e.delete ? "uz-table-child-delete" : "", O = async (t) => {
|
|
6545
|
+
e.item._suffix && (C.value = e.item._suffix.filter((e) => e.sub)), await E(e.value, t);
|
|
6546
|
+
let { tableColumns: n, tableWidth: r } = await Ep(H(t ?? e.item.params.columns), !0, e.status, () => b.value.child, a), i = r;
|
|
6547
6547
|
n.unshift({
|
|
6548
6548
|
title: " ",
|
|
6549
6549
|
key: "index",
|
|
@@ -6551,7 +6551,7 @@ var zp = /*#__PURE__*/ U(Ap, [["render", Rp]]), Bp = d({
|
|
|
6551
6551
|
titleAlign: "center",
|
|
6552
6552
|
width: 10,
|
|
6553
6553
|
show: !0
|
|
6554
|
-
}),
|
|
6554
|
+
}), i += 60, e.item.params.draggable && e.status !== 2 && (n.unshift({
|
|
6555
6555
|
title: " ",
|
|
6556
6556
|
key: "draggable",
|
|
6557
6557
|
align: "center",
|
|
@@ -6564,8 +6564,8 @@ var zp = /*#__PURE__*/ U(Ap, [["render", Rp]]), Bp = d({
|
|
|
6564
6564
|
render() {
|
|
6565
6565
|
return f("div", { class: "flex justify-center" }, f(B, {}, { default: () => f(Xo) }));
|
|
6566
6566
|
}
|
|
6567
|
-
}),
|
|
6568
|
-
title: () =>
|
|
6567
|
+
}), i += 40), e.status !== 2 && e.item.params.showActions && n.push({
|
|
6568
|
+
title: () => l("Common.action"),
|
|
6569
6569
|
key: "action",
|
|
6570
6570
|
align: "center",
|
|
6571
6571
|
fixed: "right",
|
|
@@ -6578,7 +6578,7 @@ var zp = /*#__PURE__*/ U(Ap, [["render", Rp]]), Bp = d({
|
|
|
6578
6578
|
let r = [];
|
|
6579
6579
|
return e.item.params.childActions && e.item.params.actions && Rd(e.item.params.actions).forEach((e) => {
|
|
6580
6580
|
e.disabled && typeof e.disabled == "string" && (e.disabled = Function("rowData", "rowIndex", e.disabled)(t, n)), r.push(e);
|
|
6581
|
-
}), e.item.params.showDelete && e.status !== 2 && (
|
|
6581
|
+
}), e.item.params.showDelete && e.status !== 2 && (b.value.child.length > 1 && e.item.form.edit ? !e.item.form.edit.readonly : !e.item.form.readonly) && r.push({
|
|
6582
6582
|
type: "normal",
|
|
6583
6583
|
color: "error",
|
|
6584
6584
|
key: "delete",
|
|
@@ -6586,7 +6586,7 @@ var zp = /*#__PURE__*/ U(Ap, [["render", Rp]]), Bp = d({
|
|
|
6586
6586
|
confirmText: "确认删除?",
|
|
6587
6587
|
onClick: () => {
|
|
6588
6588
|
let n = e.item.params.deleteFn;
|
|
6589
|
-
n && typeof n == "string" ? t = Function("rowData", "mainFormValue", n)(t,
|
|
6589
|
+
n && typeof n == "string" ? t = Function("rowData", "mainFormValue", n)(t, o) : t.delete = !0;
|
|
6590
6590
|
}
|
|
6591
6591
|
}), Ad({
|
|
6592
6592
|
buttons: r,
|
|
@@ -6594,11 +6594,11 @@ var zp = /*#__PURE__*/ U(Ap, [["render", Rp]]), Bp = d({
|
|
|
6594
6594
|
});
|
|
6595
6595
|
}
|
|
6596
6596
|
});
|
|
6597
|
-
let
|
|
6597
|
+
let s = [];
|
|
6598
6598
|
n.forEach((e) => {
|
|
6599
|
-
e.show &&
|
|
6600
|
-
}),
|
|
6601
|
-
},
|
|
6599
|
+
e.show && s.push(e);
|
|
6600
|
+
}), y.value = s, i += 180, T.value = i;
|
|
6601
|
+
}, k = (t) => {
|
|
6602
6602
|
if (e.item.params.summary) {
|
|
6603
6603
|
if (typeof e.item.params.summary == "function") return e.item.params.summary(t);
|
|
6604
6604
|
try {
|
|
@@ -6609,65 +6609,65 @@ var zp = /*#__PURE__*/ U(Ap, [["render", Rp]]), Bp = d({
|
|
|
6609
6609
|
}
|
|
6610
6610
|
}
|
|
6611
6611
|
return [];
|
|
6612
|
-
},
|
|
6613
|
-
|
|
6614
|
-
|
|
6612
|
+
}, A = async () => {
|
|
6613
|
+
x.value = "", b.value.child.push(H(S.value)), h(() => {
|
|
6614
|
+
F();
|
|
6615
6615
|
});
|
|
6616
|
-
},
|
|
6617
|
-
|
|
6616
|
+
}, M = async () => {
|
|
6617
|
+
x.value = "";
|
|
6618
6618
|
try {
|
|
6619
6619
|
let t = e.item.params.options;
|
|
6620
6620
|
if (t) {
|
|
6621
6621
|
let n = Function("formValue", "mainFormValue", "POST", t);
|
|
6622
|
-
e.item.params.optionsType &&
|
|
6622
|
+
e.item.params.optionsType && i({
|
|
6623
6623
|
open: e.item.params.optionsType,
|
|
6624
|
-
mainFormValue:
|
|
6625
|
-
children: () =>
|
|
6624
|
+
mainFormValue: o,
|
|
6625
|
+
children: () => b.value.child,
|
|
6626
6626
|
callback: async (e) => {
|
|
6627
|
-
let t = await n(e,
|
|
6628
|
-
|
|
6629
|
-
|
|
6627
|
+
let t = await n(e, o, Z);
|
|
6628
|
+
b.value.child = [...b.value.child, ...t], h(() => {
|
|
6629
|
+
F();
|
|
6630
6630
|
});
|
|
6631
6631
|
}
|
|
6632
6632
|
});
|
|
6633
|
-
} else e.item.params.optionsType &&
|
|
6633
|
+
} else e.item.params.optionsType && i({
|
|
6634
6634
|
open: e.item.params.optionsType,
|
|
6635
|
-
mainFormValue:
|
|
6636
|
-
children: () =>
|
|
6635
|
+
mainFormValue: o,
|
|
6636
|
+
children: () => b.value.child,
|
|
6637
6637
|
callback: async (e) => {
|
|
6638
|
-
|
|
6639
|
-
|
|
6638
|
+
b.value.child = [...b.value.child, ...e], h(() => {
|
|
6639
|
+
F();
|
|
6640
6640
|
});
|
|
6641
6641
|
}
|
|
6642
6642
|
});
|
|
6643
6643
|
} catch (e) {
|
|
6644
6644
|
q(e);
|
|
6645
6645
|
}
|
|
6646
|
-
},
|
|
6647
|
-
|
|
6648
|
-
},
|
|
6649
|
-
let r =
|
|
6646
|
+
}, N = () => {
|
|
6647
|
+
m.value?.restoreValidation();
|
|
6648
|
+
}, P = () => (x.value = "", new Promise((t, n) => {
|
|
6649
|
+
let r = b.value.child.filter((e) => !e.delete).length;
|
|
6650
6650
|
if (e.item.form.rule.required && r === 0) {
|
|
6651
|
-
|
|
6651
|
+
x.value = e.item.form.rule.message, n();
|
|
6652
6652
|
return;
|
|
6653
6653
|
}
|
|
6654
|
-
|
|
6655
|
-
r ? (
|
|
6654
|
+
m.value?.validate((r) => {
|
|
6655
|
+
r ? (x.value = e.item.form.rule.message, n()) : t();
|
|
6656
6656
|
});
|
|
6657
|
-
})),
|
|
6658
|
-
if (e.item.params.draggable && e.status !== 2 &&
|
|
6659
|
-
let e =
|
|
6660
|
-
e && (
|
|
6657
|
+
})), F = () => {
|
|
6658
|
+
if (e.item.params.draggable && e.status !== 2 && u.value && !d.value) {
|
|
6659
|
+
let e = u.value.$el.querySelector(".n-data-table-tbody");
|
|
6660
|
+
e && (d.value = rt.create(e, {
|
|
6661
6661
|
handle: ".uz-drag-handle",
|
|
6662
6662
|
onEnd: ({ oldIndex: e, newIndex: t }) => {
|
|
6663
|
-
|
|
6664
|
-
let n = H(
|
|
6663
|
+
d.value?.destroy(), d.value = null, _.value = !1;
|
|
6664
|
+
let n = H(b.value.child), r = n.splice(e, 1)[0];
|
|
6665
6665
|
n.splice(t, 0, r), n = n.map((e, t) => ({
|
|
6666
6666
|
...e,
|
|
6667
6667
|
sort_index: t
|
|
6668
|
-
})),
|
|
6669
|
-
|
|
6670
|
-
|
|
6668
|
+
})), b.value.child = n, h(() => {
|
|
6669
|
+
_.value = !0, setTimeout(() => {
|
|
6670
|
+
F();
|
|
6671
6671
|
}, 0);
|
|
6672
6672
|
});
|
|
6673
6673
|
}
|
|
@@ -6675,43 +6675,45 @@ var zp = /*#__PURE__*/ U(Ap, [["render", Rp]]), Bp = d({
|
|
|
6675
6675
|
}
|
|
6676
6676
|
};
|
|
6677
6677
|
return v(() => {
|
|
6678
|
-
|
|
6679
|
-
}),
|
|
6680
|
-
validate:
|
|
6681
|
-
restoreValidation:
|
|
6678
|
+
d.value?.destroy(), d.value = null;
|
|
6679
|
+
}), r({
|
|
6680
|
+
validate: P,
|
|
6681
|
+
restoreValidation: N
|
|
6682
6682
|
}), j(() => e.item.params.columns, (e, t) => {
|
|
6683
|
-
JSON.stringify(e) !== JSON.stringify(t) &&
|
|
6683
|
+
JSON.stringify(e) !== JSON.stringify(t) && O(e);
|
|
6684
6684
|
}, {
|
|
6685
6685
|
deep: !0,
|
|
6686
6686
|
immediate: !0
|
|
6687
6687
|
}), j(() => e.value, (e) => {
|
|
6688
|
-
JSON.stringify(e) !== JSON.stringify(
|
|
6688
|
+
JSON.stringify(e) !== JSON.stringify(b.value.child) && D(e);
|
|
6689
6689
|
}, {
|
|
6690
6690
|
deep: !0,
|
|
6691
6691
|
immediate: !0
|
|
6692
|
-
}), j(() =>
|
|
6693
|
-
e.status !== 2 &&
|
|
6694
|
-
}, { deep: !0 }), {
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6692
|
+
}), j(() => b.value.child, (t) => {
|
|
6693
|
+
e.status !== 2 && n("update:value", t);
|
|
6694
|
+
}, { deep: !0 }), j(() => c.value, async () => {
|
|
6695
|
+
await O();
|
|
6696
|
+
}), {
|
|
6697
|
+
loading: g,
|
|
6698
|
+
formRef: m,
|
|
6699
|
+
tableRef: u,
|
|
6700
|
+
columns: y,
|
|
6701
|
+
tableData: b,
|
|
6702
|
+
summaryData: k,
|
|
6703
|
+
message: x,
|
|
6704
|
+
tableScrollX: T,
|
|
6705
|
+
tableShow: _,
|
|
6706
|
+
suffixes: C,
|
|
6707
|
+
onAdd: A,
|
|
6708
|
+
onAddFormData: M,
|
|
6709
|
+
rowClassName: ee,
|
|
6708
6710
|
doSuffixClick: (e) => {
|
|
6709
|
-
|
|
6711
|
+
i({
|
|
6710
6712
|
open: e.optionsType,
|
|
6711
|
-
mainFormValue:
|
|
6713
|
+
mainFormValue: o,
|
|
6712
6714
|
onClick: e.onClick,
|
|
6713
6715
|
optionsSource: e.optionsSource,
|
|
6714
|
-
children: () =>
|
|
6716
|
+
children: () => b.value.child,
|
|
6715
6717
|
callback: () => null
|
|
6716
6718
|
});
|
|
6717
6719
|
}
|
|
@@ -7977,7 +7979,7 @@ function Zm(e, t, n) {
|
|
|
7977
7979
|
}
|
|
7978
7980
|
//#endregion
|
|
7979
7981
|
//#region package.json
|
|
7980
|
-
var Qm = "0.1.
|
|
7982
|
+
var Qm = "0.1.31", $m;
|
|
7981
7983
|
async function eh() {
|
|
7982
7984
|
let e = await fetch(`${window.location.protocol}//${window.location.host}`, {
|
|
7983
7985
|
method: "HEAD",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unizhen/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.31",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Donovan"
|
|
6
6
|
},
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"pub": "npm publish"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"axios": "^1.
|
|
43
|
+
"axios": "^1.16.1",
|
|
44
44
|
"csstype": "^3.2.3",
|
|
45
45
|
"md5": "^2.3.0",
|
|
46
46
|
"naive-ui": "^2.44.1",
|
|
47
|
-
"vue": "^3.5.
|
|
47
|
+
"vue": "^3.5.34",
|
|
48
48
|
"vue-demi": "^0.14.10",
|
|
49
|
-
"vue-i18n": "^11.4.
|
|
50
|
-
"vue-router": "^5.
|
|
49
|
+
"vue-i18n": "^11.4.4",
|
|
50
|
+
"vue-router": "^5.0.7"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@guolao/vue-monaco-editor": "^1.6.0",
|
|
@@ -55,17 +55,17 @@
|
|
|
55
55
|
"@tsconfig/node20": "^20.1.9",
|
|
56
56
|
"@types/lodash": "^4.17.24",
|
|
57
57
|
"@types/md5": "^2.3.6",
|
|
58
|
-
"@types/node": "^25.
|
|
58
|
+
"@types/node": "^25.8.0",
|
|
59
59
|
"@types/sortablejs": "^1.15.9",
|
|
60
60
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
61
61
|
"@vitejs/plugin-vue-jsx": "^5.1.5",
|
|
62
62
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
63
|
-
"@vue/eslint-config-typescript": "^14.
|
|
63
|
+
"@vue/eslint-config-typescript": "^14.7.0",
|
|
64
64
|
"@vue/tsconfig": "^0.9.1",
|
|
65
65
|
"autoprefixer": "^10.5.0",
|
|
66
|
-
"dayjs": "^1.11.
|
|
67
|
-
"eslint": "^10.4.
|
|
68
|
-
"eslint-plugin-vue": "^10.9.
|
|
66
|
+
"dayjs": "^1.11.20",
|
|
67
|
+
"eslint": "^10.4.0",
|
|
68
|
+
"eslint-plugin-vue": "^10.9.1",
|
|
69
69
|
"highlight.js": "^11.11.1",
|
|
70
70
|
"json5": "^2.2.3",
|
|
71
71
|
"jsqr": "^1.4.0",
|
|
@@ -79,13 +79,13 @@
|
|
|
79
79
|
"sass": "^1.99.0",
|
|
80
80
|
"sortablejs": "^1.15.7",
|
|
81
81
|
"typescript": "~6.0.3",
|
|
82
|
-
"vite": "^8.0.
|
|
82
|
+
"vite": "^8.0.13",
|
|
83
83
|
"vite-plugin-compression": "^0.5.1",
|
|
84
|
-
"vite-plugin-dts": "^5.0.
|
|
84
|
+
"vite-plugin-dts": "^5.0.0",
|
|
85
85
|
"vue-clipboard3": "^2.0.0",
|
|
86
|
-
"vue-draggable-plus": "^0.6.1",
|
|
87
86
|
"vue-global-api": "^0.4.1",
|
|
88
|
-
"vue-tsc": "^3.
|
|
87
|
+
"vue-tsc": "^3.2.9",
|
|
88
|
+
"vue-draggable-plus": "^0.6.1"
|
|
89
89
|
},
|
|
90
90
|
"engines": {
|
|
91
91
|
"node": ">=22.14.0",
|