zjh-web-ui 1.0.10
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/README.md +1 -0
- package/config/resolver.js +21 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/components/AMapConfig.js +23 -0
- package/dist/components/HuiAMapMassMarkers/HuiAMapMassMarkers.vue.js +82 -0
- package/dist/components/HuiAMapMassMarkers/HuiAMapMassMarkers.vue2.js +4 -0
- package/dist/components/HuiAMapMassMarkers/index.js +7 -0
- package/dist/components/HuiAMapSearchAddress/HuiAMapSearchAddress.vue.js +7 -0
- package/dist/components/HuiAMapSearchAddress/HuiAMapSearchAddress.vue2.js +190 -0
- package/dist/components/HuiAMapSearchAddress/index.js +7 -0
- package/dist/components/HuiAMapSearchAddressDialog/HuiAMapSearchAddressDialog.vue.js +83 -0
- package/dist/components/HuiAMapSearchAddressDialog/HuiAMapSearchAddressDialog.vue2.js +4 -0
- package/dist/components/HuiAMapSearchAddressDialog/index.js +7 -0
- package/dist/components/HuiAMapSelectAddress/HuiAMapSelectAddress.vue.js +7 -0
- package/dist/components/HuiAMapSelectAddress/HuiAMapSelectAddress.vue2.js +178 -0
- package/dist/components/HuiAMapSelectAddress/index.js +7 -0
- package/dist/components/HuiAMapSelectAddressDialog/HuiAMapSelectAddressDialog.vue.js +83 -0
- package/dist/components/HuiAMapSelectAddressDialog/HuiAMapSelectAddressDialog.vue2.js +4 -0
- package/dist/components/HuiAMapSelectAddressDialog/index.js +7 -0
- package/dist/components/HuiCountDownButton/HuiCountDownButton.vue.js +63 -0
- package/dist/components/HuiCountDownButton/HuiCountDownButton.vue2.js +4 -0
- package/dist/components/HuiCountDownButton/index.js +7 -0
- package/dist/components/HuiDataView/HuiDataView.vue.js +7 -0
- package/dist/components/HuiDataView/HuiDataView.vue2.js +84 -0
- package/dist/components/HuiDataView/index.js +7 -0
- package/dist/components/HuiGridForm/HuiGridForm.vue.js +7 -0
- package/dist/components/HuiGridForm/HuiGridForm.vue2.js +223 -0
- package/dist/components/HuiGridForm/HuiGridFormHooks.js +21 -0
- package/dist/components/HuiGridForm/index.js +7 -0
- package/dist/components/HuiLineEditDialog/HuiLineEditDialog.vue.js +7 -0
- package/dist/components/HuiLineEditDialog/HuiLineEditDialog.vue2.js +167 -0
- package/dist/components/HuiLineEditDialog/index.js +7 -0
- package/dist/components/HuiLineEditPopover/HuiLineEditPopover.vue.js +7 -0
- package/dist/components/HuiLineEditPopover/HuiLineEditPopover.vue2.js +128 -0
- package/dist/components/HuiLineEditPopover/index.js +7 -0
- package/dist/components/HuiPreviewRichTextDialog/HuiPreviewRichTextDialog.vue.js +65 -0
- package/dist/components/HuiPreviewRichTextDialog/HuiPreviewRichTextDialog.vue2.js +4 -0
- package/dist/components/HuiPreviewRichTextDialog/index.js +7 -0
- package/dist/components/HuiRegionTreeDialog/HuiRegionTreeDialog.vue.js +118 -0
- package/dist/components/HuiRegionTreeDialog/HuiRegionTreeDialog.vue2.js +4 -0
- package/dist/components/HuiRegionTreeDialog/index.js +7 -0
- package/dist/components/HuiRegionTreeSelect/HuiRegionTreeSelect.vue.js +7 -0
- package/dist/components/HuiRegionTreeSelect/HuiRegionTreeSelect.vue2.js +59 -0
- package/dist/components/HuiRegionTreeSelect/index.js +7 -0
- package/dist/components/HuiSelectLoadStatus/HuiSelectLoadStatus.vue.js +44 -0
- package/dist/components/HuiSelectLoadStatus/HuiSelectLoadStatus.vue2.js +4 -0
- package/dist/components/HuiSelectLoadStatus/index.js +7 -0
- package/dist/components/HuiShowUrlDialog/HuiShowUrlDialog.vue.js +50 -0
- package/dist/components/HuiShowUrlDialog/HuiShowUrlDialog.vue2.js +4 -0
- package/dist/components/HuiShowUrlDialog/index.js +7 -0
- package/dist/components/HuiStringArrayInputDialog/HuiStringArrayInputDialog.vue.js +118 -0
- package/dist/components/HuiStringArrayInputDialog/HuiStringArrayInputDialog.vue2.js +4 -0
- package/dist/components/HuiStringArrayInputDialog/index.js +7 -0
- package/dist/components/HuiTags/HuiTags.vue.js +7 -0
- package/dist/components/HuiTags/HuiTags.vue2.js +28 -0
- package/dist/components/HuiTags/index.js +7 -0
- package/dist/components/HuiTagsMore/HuiTagsMore.vue.js +188 -0
- package/dist/components/HuiTagsMore/HuiTagsMore.vue2.js +4 -0
- package/dist/components/HuiTagsMore/index.js +7 -0
- package/dist/components/HuiTinymce/HuiTinymce.vue.js +37 -0
- package/dist/components/HuiTinymce/HuiTinymce.vue3.js +5 -0
- package/dist/components/HuiTinymce/HuiTinymceLinkHooks.js +99 -0
- package/dist/components/HuiTinymce/HuiTinymceSettingHooks.js +104 -0
- package/dist/components/HuiTinymce/index.js +8 -0
- package/dist/components/HuiTinymceDialog/HuiTinymceDialog.vue.js +96 -0
- package/dist/components/HuiTinymceDialog/HuiTinymceDialog.vue2.js +4 -0
- package/dist/components/HuiTinymceDialog/index.js +7 -0
- package/dist/components/HuiTip/HuiTip.vue.js +52 -0
- package/dist/components/HuiTip/HuiTip.vue2.js +4 -0
- package/dist/components/HuiTip/index.js +7 -0
- package/dist/components-install-list.js +47 -0
- package/dist/delegate.js +13 -0
- package/dist/directives/install-loadmore.js +7 -0
- package/dist/directives/select-loadmore.js +25 -0
- package/dist/hooks/useHuiDialog/useHuiDialog.js +20 -0
- package/dist/hooks/useHuiFormDialog/formDialogPropsDef.js +6 -0
- package/dist/hooks/useHuiFormDialog/useHuiFormDialog.js +109 -0
- package/dist/index.js +62 -0
- package/dist/install-helper/install.js +21 -0
- package/dist/style.css +1 -0
- package/dist/utils/hui-rules.js +142 -0
- package/dist/utils/hui-tool/index.js +7 -0
- package/dist/utils/hui-tool/message-box/index.js +33 -0
- package/dist/utils/hui-tool/message-box/message-box.vue.js +112 -0
- package/dist/utils/hui-tool/message-box/message-box.vue3.js +5 -0
- package/dist/utils/hui-tool/msg-tool.js +39 -0
- package/global.d.ts +40 -0
- package/package.json +44 -0
- package/src/css/common-font.scss +104 -0
- package/src/css/index.scss +1 -0
- package/types/components/AMapConfig.d.ts +2 -0
- package/types/components/HuiAMapMassMarkers/HuiAMapMassMarkers.vue.d.ts +105 -0
- package/types/components/HuiAMapMassMarkers/index.d.ts +107 -0
- package/types/components/HuiAMapMassMarkers/type.d.ts +58 -0
- package/types/components/HuiAMapSearchAddress/HuiAMapSearchAddress.vue.d.ts +76 -0
- package/types/components/HuiAMapSearchAddress/index.d.ts +77 -0
- package/types/components/HuiAMapSearchAddress/type.d.ts +19 -0
- package/types/components/HuiAMapSearchAddressDialog/HuiAMapSearchAddressDialog.vue.d.ts +38 -0
- package/types/components/HuiAMapSearchAddressDialog/index.d.ts +71 -0
- package/types/components/HuiAMapSearchAddressDialog/type.d.ts +17 -0
- package/types/components/HuiAMapSelectAddress/HuiAMapSelectAddress.vue.d.ts +76 -0
- package/types/components/HuiAMapSelectAddress/index.d.ts +77 -0
- package/types/components/HuiAMapSelectAddress/type.d.ts +19 -0
- package/types/components/HuiAMapSelectAddressDialog/HuiAMapSelectAddressDialog.vue.d.ts +38 -0
- package/types/components/HuiAMapSelectAddressDialog/index.d.ts +71 -0
- package/types/components/HuiAMapSelectAddressDialog/type.d.ts +17 -0
- package/types/components/HuiCountDownButton/HuiCountDownButton.vue.d.ts +44 -0
- package/types/components/HuiCountDownButton/index.d.ts +76 -0
- package/types/components/HuiCountDownButton/type.d.ts +20 -0
- package/types/components/HuiDataView/HuiDataView.vue.d.ts +60 -0
- package/types/components/HuiDataView/index.d.ts +109 -0
- package/types/components/HuiDataView/type.d.ts +49 -0
- package/types/components/HuiGridForm/HuiGridForm.vue.d.ts +77 -0
- package/types/components/HuiGridForm/HuiGridFormHooks.d.ts +4 -0
- package/types/components/HuiGridForm/index.d.ts +175 -0
- package/types/components/HuiGridForm/type.d.ts +67 -0
- package/types/components/HuiLineEditDialog/HuiLineEditDialog.vue.d.ts +75 -0
- package/types/components/HuiLineEditDialog/index.d.ts +173 -0
- package/types/components/HuiLineEditDialog/type.d.ts +86 -0
- package/types/components/HuiLineEditPopover/HuiLineEditPopover.vue.d.ts +74 -0
- package/types/components/HuiLineEditPopover/index.d.ts +133 -0
- package/types/components/HuiLineEditPopover/type.d.ts +23 -0
- package/types/components/HuiPreviewRichTextDialog/HuiPreviewRichTextDialog.vue.d.ts +31 -0
- package/types/components/HuiPreviewRichTextDialog/index.d.ts +22 -0
- package/types/components/HuiPreviewRichTextDialog/type.d.ts +4 -0
- package/types/components/HuiRegionTreeDialog/HuiRegionTreeDialog.vue.d.ts +53 -0
- package/types/components/HuiRegionTreeDialog/index.d.ts +68 -0
- package/types/components/HuiRegionTreeDialog/type.d.ts +24 -0
- package/types/components/HuiRegionTreeSelect/HuiRegionTreeSelect.vue.d.ts +25 -0
- package/types/components/HuiRegionTreeSelect/index.d.ts +29 -0
- package/types/components/HuiRegionTreeSelect/type.d.ts +6 -0
- package/types/components/HuiSelectLoadStatus/HuiSelectLoadStatus.vue.d.ts +14 -0
- package/types/components/HuiSelectLoadStatus/index.d.ts +33 -0
- package/types/components/HuiSelectLoadStatus/type.d.ts +11 -0
- package/types/components/HuiShowUrlDialog/HuiShowUrlDialog.vue.d.ts +37 -0
- package/types/components/HuiShowUrlDialog/index.d.ts +40 -0
- package/types/components/HuiShowUrlDialog/type.d.ts +11 -0
- package/types/components/HuiStringArrayInputDialog/HuiStringArrayInputDialog.vue.d.ts +44 -0
- package/types/components/HuiStringArrayInputDialog/index.d.ts +67 -0
- package/types/components/HuiStringArrayInputDialog/type.d.ts +33 -0
- package/types/components/HuiTags/HuiTags.vue.d.ts +37 -0
- package/types/components/HuiTags/index.d.ts +36 -0
- package/types/components/HuiTagsMore/HuiTagsMore.vue.d.ts +93 -0
- package/types/components/HuiTagsMore/index.d.ts +92 -0
- package/types/components/HuiTinymce/HuiTinymce.vue.d.ts +62 -0
- package/types/components/HuiTinymce/HuiTinymceLinkHooks.d.ts +3 -0
- package/types/components/HuiTinymce/HuiTinymceSettingHooks.d.ts +3 -0
- package/types/components/HuiTinymce/index.d.ts +66 -0
- package/types/components/HuiTinymce/type.d.ts +51 -0
- package/types/components/HuiTinymceDialog/HuiTinymceDialog.vue.d.ts +53 -0
- package/types/components/HuiTinymceDialog/index.d.ts +78 -0
- package/types/components/HuiTinymceDialog/type.d.ts +12 -0
- package/types/components/HuiTip/HuiTip.vue.d.ts +22 -0
- package/types/components/HuiTip/index.d.ts +99 -0
- package/types/components/HuiTip/type.d.ts +14 -0
- package/types/components-install-list.d.ts +3328 -0
- package/types/components.d.ts +21 -0
- package/types/delegate.d.ts +41 -0
- package/types/directives/index.d.ts +4 -0
- package/types/directives/install-loadmore.d.ts +7 -0
- package/types/directives/select-loadmore.d.ts +7 -0
- package/types/hooks/index.d.ts +3 -0
- package/types/hooks/useHuiDialog/useHuiDialog.d.ts +18 -0
- package/types/hooks/useHuiFormDialog/formDialogPropsDef.d.ts +3 -0
- package/types/hooks/useHuiFormDialog/type.d.ts +90 -0
- package/types/hooks/useHuiFormDialog/useHuiFormDialog.d.ts +32 -0
- package/types/index.d.ts +13 -0
- package/types/install-helper/install.d.ts +18 -0
- package/types/install-helper/typescript.d.ts +14 -0
- package/types/utils/hui-rules.d.ts +80 -0
- package/types/utils/hui-tool/index.d.ts +8 -0
- package/types/utils/hui-tool/message-box/index.d.ts +18 -0
- package/types/utils/hui-tool/message-box/message-box.vue.d.ts +36 -0
- package/types/utils/hui-tool/msg-tool.d.ts +26 -0
- package/types/utils/index.d.ts +2 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { defineComponent as C, ref as r, openBlock as S, createBlock as h, unref as o, isRef as k, withCtx as l, createVNode as s, createTextVNode as p, toValue as H } from "vue";
|
|
2
|
+
import { useHuiDialog as M } from "../../hooks/useHuiDialog/useHuiDialog.js";
|
|
3
|
+
import { ElDialog as B, ElButton as m } from "element-plus";
|
|
4
|
+
import "@hua5/hua5-utils";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import D from "../HuiAMapSelectAddress/HuiAMapSelectAddress.vue.js";
|
|
7
|
+
const _ = /* @__PURE__ */ C({
|
|
8
|
+
name: "HuiAMapSelectAddressDialog",
|
|
9
|
+
__name: "HuiAMapSelectAddressDialog",
|
|
10
|
+
props: {
|
|
11
|
+
disabled: { type: Boolean },
|
|
12
|
+
value: {},
|
|
13
|
+
width: { default: "80%" },
|
|
14
|
+
height: {},
|
|
15
|
+
showInput: { type: Boolean },
|
|
16
|
+
iconPath: {},
|
|
17
|
+
iconClass: {},
|
|
18
|
+
title: { default: "选择位置" }
|
|
19
|
+
},
|
|
20
|
+
emits: ["onSubmit"],
|
|
21
|
+
setup(x, { expose: f, emit: c }) {
|
|
22
|
+
const b = c, n = r(null), { show: a, open: v, close: i, payload: w, confirmLoading: y } = M(), t = r(null);
|
|
23
|
+
async function A() {
|
|
24
|
+
n.value.loadMap(), t.value = H(w) || "";
|
|
25
|
+
}
|
|
26
|
+
function V() {
|
|
27
|
+
t.value = "";
|
|
28
|
+
}
|
|
29
|
+
function g() {
|
|
30
|
+
n.value.submitInfo() && (b("onSubmit", t.value), i());
|
|
31
|
+
}
|
|
32
|
+
return f({
|
|
33
|
+
open: v,
|
|
34
|
+
close: i
|
|
35
|
+
}), (u, e) => (S(), h(o(B), {
|
|
36
|
+
modelValue: o(a),
|
|
37
|
+
"onUpdate:modelValue": e[1] || (e[1] = (d) => k(a) ? a.value = d : null),
|
|
38
|
+
title: u.title,
|
|
39
|
+
width: u.width,
|
|
40
|
+
top: "5vh",
|
|
41
|
+
"modal-append-to-body": !1,
|
|
42
|
+
"append-to-body": "",
|
|
43
|
+
"destroy-on-close": "",
|
|
44
|
+
onOpen: A,
|
|
45
|
+
onClose: V
|
|
46
|
+
}, {
|
|
47
|
+
footer: l(() => [
|
|
48
|
+
s(o(m), { onClick: o(i) }, {
|
|
49
|
+
default: l(() => e[2] || (e[2] = [
|
|
50
|
+
p("取 消")
|
|
51
|
+
])),
|
|
52
|
+
_: 1
|
|
53
|
+
}, 8, ["onClick"]),
|
|
54
|
+
s(o(m), {
|
|
55
|
+
type: "primary",
|
|
56
|
+
class: "w-100",
|
|
57
|
+
loading: o(y),
|
|
58
|
+
onClick: g
|
|
59
|
+
}, {
|
|
60
|
+
default: l(() => e[3] || (e[3] = [
|
|
61
|
+
p("确定")
|
|
62
|
+
])),
|
|
63
|
+
_: 1
|
|
64
|
+
}, 8, ["loading"])
|
|
65
|
+
]),
|
|
66
|
+
default: l(() => [
|
|
67
|
+
s(D, {
|
|
68
|
+
ref_key: "HuiAMapSelectAddressRef",
|
|
69
|
+
ref: n,
|
|
70
|
+
modelValue: t.value,
|
|
71
|
+
"onUpdate:modelValue": e[0] || (e[0] = (d) => t.value = d),
|
|
72
|
+
class: "m-b-40",
|
|
73
|
+
"show-input": !0,
|
|
74
|
+
width: "100%"
|
|
75
|
+
}, null, 8, ["modelValue"])
|
|
76
|
+
]),
|
|
77
|
+
_: 1
|
|
78
|
+
}, 8, ["modelValue", "title", "width"]));
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
export {
|
|
82
|
+
_ as default
|
|
83
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { defineComponent as w, ref as i, onUnmounted as y, openBlock as o, createElementBlock as r, normalizeClass as n, createElementVNode as B, toDisplayString as c, createCommentVNode as d, createBlock as D, unref as N, withCtx as h, createTextVNode as g } from "vue";
|
|
2
|
+
import { ElButton as E } from "element-plus";
|
|
3
|
+
const S = /* @__PURE__ */ w({
|
|
4
|
+
name: "HuiCountDownButton",
|
|
5
|
+
__name: "HuiCountDownButton",
|
|
6
|
+
props: {
|
|
7
|
+
title: {},
|
|
8
|
+
baseClass: {},
|
|
9
|
+
timeCount: { default: 60 },
|
|
10
|
+
enableClass: { default: "!bg-special !text-white" },
|
|
11
|
+
disableClass: { default: "!bg-normal !text-disabled" },
|
|
12
|
+
type: { default: "text" }
|
|
13
|
+
},
|
|
14
|
+
emits: ["click"],
|
|
15
|
+
setup(m, { expose: v, emit: f }) {
|
|
16
|
+
const u = m, C = f, t = i(!1), l = i(0);
|
|
17
|
+
let a = null;
|
|
18
|
+
function b() {
|
|
19
|
+
C("click", p);
|
|
20
|
+
}
|
|
21
|
+
function p(e = !0) {
|
|
22
|
+
e && k();
|
|
23
|
+
}
|
|
24
|
+
function k() {
|
|
25
|
+
a || (l.value = Number(u.timeCount), t.value = !0, a = setInterval(() => {
|
|
26
|
+
l.value > 0 && l.value <= Number(u.timeCount) ? l.value-- : s();
|
|
27
|
+
}, 1e3));
|
|
28
|
+
}
|
|
29
|
+
function s() {
|
|
30
|
+
t.value = !1, l.value = 0, clearInterval(a), a = null;
|
|
31
|
+
}
|
|
32
|
+
return v({
|
|
33
|
+
resetState: s
|
|
34
|
+
}), y(() => {
|
|
35
|
+
s();
|
|
36
|
+
}), (e, V) => (o(), r("div", {
|
|
37
|
+
class: n(["inline-block", { "cursor-not-allowed": t.value }])
|
|
38
|
+
}, [
|
|
39
|
+
B("div", {
|
|
40
|
+
class: n(["inline-block", t.value ? "pointer-events-none" : "cursor-pointer"]),
|
|
41
|
+
onClick: b
|
|
42
|
+
}, [
|
|
43
|
+
e.type === "text" ? (o(), r("div", {
|
|
44
|
+
key: 0,
|
|
45
|
+
class: n([t.value ? e.disableClass : e.enableClass, e.baseClass])
|
|
46
|
+
}, c(t.value ? l.value + "s" : e.title), 3)) : d("", !0),
|
|
47
|
+
e.type === "button" ? (o(), D(N(E), {
|
|
48
|
+
key: 1,
|
|
49
|
+
disabled: t.value,
|
|
50
|
+
class: n([t.value ? e.disableClass : e.enableClass, e.baseClass])
|
|
51
|
+
}, {
|
|
52
|
+
default: h(() => [
|
|
53
|
+
g(c(t.value ? l.value + "s" : e.title), 1)
|
|
54
|
+
]),
|
|
55
|
+
_: 1
|
|
56
|
+
}, 8, ["disabled", "class"])) : d("", !0)
|
|
57
|
+
], 2)
|
|
58
|
+
], 2));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
export {
|
|
62
|
+
S as default
|
|
63
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { defineComponent as k, watch as _, computed as x, openBlock as l, createElementBlock as n, Fragment as d, renderList as h, normalizeStyle as v, createElementVNode as t, normalizeClass as i, unref as g, renderSlot as u, mergeProps as c, toDisplayString as f, createBlock as C } from "vue";
|
|
2
|
+
import { webUtils as B, addUnit as V } from "zjh-web-lib";
|
|
3
|
+
import { ElImage as $ } from "element-plus";
|
|
4
|
+
const D = { class: "flex flex-wrap" }, E = { class: "flex justify-between lh-32 p-x-10" }, L = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "flex flex-wrap"
|
|
7
|
+
}, S = { class: "flex-shrink-0" }, T = ["onClick"], z = /* @__PURE__ */ k({
|
|
8
|
+
name: "HuiDataView",
|
|
9
|
+
__name: "HuiDataView",
|
|
10
|
+
props: {
|
|
11
|
+
lineCount: { default: 1 },
|
|
12
|
+
titleWidth: { default: "100" },
|
|
13
|
+
config: {},
|
|
14
|
+
data: {}
|
|
15
|
+
},
|
|
16
|
+
setup(b) {
|
|
17
|
+
const a = b;
|
|
18
|
+
_(
|
|
19
|
+
() => a.data,
|
|
20
|
+
(r, y) => {
|
|
21
|
+
if (!a.data) return;
|
|
22
|
+
const e = r || {};
|
|
23
|
+
for (const o of a.config)
|
|
24
|
+
o.value = e[o.prop];
|
|
25
|
+
},
|
|
26
|
+
{ immediate: !0 }
|
|
27
|
+
);
|
|
28
|
+
const w = x(() => 100 / (B.isMobile() ? 1 : a.lineCount) + "%");
|
|
29
|
+
return (r, y) => (l(), n("div", D, [
|
|
30
|
+
(l(!0), n(d, null, h(r.config, (e, o) => (l(), n("div", {
|
|
31
|
+
key: e.prop,
|
|
32
|
+
class: "flex",
|
|
33
|
+
style: v({ width: w.value })
|
|
34
|
+
}, [
|
|
35
|
+
t("div", {
|
|
36
|
+
class: i(["text-center bg-normal flex-center flex-shrink-0 text-14 b-1px b-solid b-lighter lh-32 text-regular !c-info noBorderTop", [
|
|
37
|
+
o + 1 <= r.lineCount ? "!b-t-1px !b-t-solid !b-t-lighter" : "",
|
|
38
|
+
o % r.lineCount != 0 ? "noBorderLeft" : ""
|
|
39
|
+
]]),
|
|
40
|
+
style: v({ width: g(V)(r.titleWidth) })
|
|
41
|
+
}, [
|
|
42
|
+
u(r.$slots, e.prop + "-title", c({ ref_for: !0 }, e), () => [
|
|
43
|
+
t("div", null, f(e.title), 1)
|
|
44
|
+
], !0)
|
|
45
|
+
], 6),
|
|
46
|
+
t("div", {
|
|
47
|
+
class: i(["flex-1 b-1px b-solid b-lighter noBorderLeft text-regular", o + 1 > r.lineCount ? "noBorderTop" : ""])
|
|
48
|
+
}, [
|
|
49
|
+
t("div", E, [
|
|
50
|
+
(e == null ? void 0 : e.type) === "img" ? (l(), n("div", L, [
|
|
51
|
+
(l(!0), n(d, null, h(e.value, (p, s) => (l(), C(g($), {
|
|
52
|
+
key: s,
|
|
53
|
+
class: i([s !== e.value.length ? "mr-10" : "", "w-43 h-43 m-y-5"]),
|
|
54
|
+
src: p,
|
|
55
|
+
"preview-src-list": [e.value[s]],
|
|
56
|
+
fit: "cover"
|
|
57
|
+
}, null, 8, ["class", "src", "preview-src-list"]))), 128))
|
|
58
|
+
])) : (l(), n(d, { key: 1 }, [
|
|
59
|
+
u(r.$slots, e.prop + "-left", c({ ref_for: !0 }, e), () => [
|
|
60
|
+
t("div", {
|
|
61
|
+
class: i(e.class)
|
|
62
|
+
}, f(e.value), 3)
|
|
63
|
+
], !0),
|
|
64
|
+
t("div", S, [
|
|
65
|
+
u(r.$slots, e.prop + "-right", c({ ref_for: !0 }, e), () => [
|
|
66
|
+
t("div", {
|
|
67
|
+
class: "c-primary hand",
|
|
68
|
+
onClick: (p) => {
|
|
69
|
+
var s;
|
|
70
|
+
return (s = e.handler) == null ? void 0 : s.call(e, e);
|
|
71
|
+
}
|
|
72
|
+
}, f(e.rightText), 9, T)
|
|
73
|
+
], !0)
|
|
74
|
+
])
|
|
75
|
+
], 64))
|
|
76
|
+
])
|
|
77
|
+
], 2)
|
|
78
|
+
], 4))), 128))
|
|
79
|
+
]));
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
export {
|
|
83
|
+
z as default
|
|
84
|
+
};
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { defineComponent as W, ref as w, watch as $, onMounted as X, openBlock as l, createElementBlock as s, Fragment as m, createElementVNode as I, normalizeClass as _, renderList as k, normalizeStyle as B, toDisplayString as C, renderSlot as T, mergeProps as E, createBlock as b, unref as v, withCtx as y, withDirectives as Y, vShow as Z, createCommentVNode as p, createSlots as ee, createTextVNode as F } from "vue";
|
|
2
|
+
import { ElSelect as te, ElOption as oe, ElInput as ne, ElButton as le } from "element-plus";
|
|
3
|
+
import { objectUtils as g, testUtils as f } from "@hua5/hua5-utils";
|
|
4
|
+
import { useDynamicList as ae } from "./HuiGridFormHooks.js";
|
|
5
|
+
const se = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "flex"
|
|
8
|
+
}, re = { key: 1 }, ie = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "h-25 flex items-center justify-center c-disabled"
|
|
11
|
+
}, ue = {
|
|
12
|
+
key: 2,
|
|
13
|
+
class: "c-danger lh-20"
|
|
14
|
+
}, de = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "w-58 flex-shrink-0 h-32 lh-32 hand"
|
|
17
|
+
}, ce = ["onClick"], pe = ["onClick"], fe = ["onClick"], ke = /* @__PURE__ */ W({
|
|
18
|
+
name: "HuiGridForm",
|
|
19
|
+
__name: "HuiGridForm",
|
|
20
|
+
props: {
|
|
21
|
+
isCanAppend: { type: Boolean, default: !1 },
|
|
22
|
+
handSort: { type: Boolean, default: !1 },
|
|
23
|
+
handDelete: { type: Boolean, default: !1 },
|
|
24
|
+
config: {},
|
|
25
|
+
listData: { default: () => [] },
|
|
26
|
+
gridFromClass: { default: "mt-10" },
|
|
27
|
+
isCanDeleteItem: {},
|
|
28
|
+
btnText: { default: "添加" }
|
|
29
|
+
},
|
|
30
|
+
emits: ["onRemoveItem"],
|
|
31
|
+
setup(x, { expose: N, emit: R }) {
|
|
32
|
+
const q = R, { moveItem: A, removeItem: H } = ae(), i = x, S = w(!1), V = {}, u = w(g.deepClone(i.listData)), d = w(g.deepClone(i.config));
|
|
33
|
+
$(
|
|
34
|
+
() => i.listData,
|
|
35
|
+
(t, o) => {
|
|
36
|
+
u.value = t, h();
|
|
37
|
+
},
|
|
38
|
+
{ immediate: !0 }
|
|
39
|
+
), $(
|
|
40
|
+
() => i.config,
|
|
41
|
+
(t) => {
|
|
42
|
+
d.value = g.deepClone(t), h();
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
immediate: !0
|
|
46
|
+
}
|
|
47
|
+
), X(() => {
|
|
48
|
+
for (const t in d.value) {
|
|
49
|
+
const o = d.value[t];
|
|
50
|
+
V[o.prop] = "";
|
|
51
|
+
}
|
|
52
|
+
f.isEmpty(i.listData) && i.isCanAppend && U();
|
|
53
|
+
});
|
|
54
|
+
function U() {
|
|
55
|
+
u.value.push(g.deepClone(V));
|
|
56
|
+
}
|
|
57
|
+
function j(t, o, n) {
|
|
58
|
+
n && A(u.value, t, o);
|
|
59
|
+
}
|
|
60
|
+
async function O(t) {
|
|
61
|
+
const o = u.value[t];
|
|
62
|
+
let n = !0;
|
|
63
|
+
i.isCanDeleteItem && (n = await i.isCanDeleteItem(o, t)), !(!n || !await H(u.value, t)) && (q("onRemoveItem", o), h());
|
|
64
|
+
}
|
|
65
|
+
function M(t = !0) {
|
|
66
|
+
const o = u.value.filter((n) => !L(n));
|
|
67
|
+
return t ? (S.value = !0, z(o) ? o : null) : o;
|
|
68
|
+
}
|
|
69
|
+
function z(t) {
|
|
70
|
+
for (const o of t)
|
|
71
|
+
for (const n of d.value)
|
|
72
|
+
if ((n.required ?? !0) && f.isEmpty(o[n.prop]))
|
|
73
|
+
return !1;
|
|
74
|
+
return !0;
|
|
75
|
+
}
|
|
76
|
+
function L(t) {
|
|
77
|
+
return Object.values(t).every((o) => f.isEmpty(o));
|
|
78
|
+
}
|
|
79
|
+
function G(t, o) {
|
|
80
|
+
return S.value && f.isEmpty(o[t.prop]) && !L(o) && (t.required ?? !0);
|
|
81
|
+
}
|
|
82
|
+
function h() {
|
|
83
|
+
const t = {};
|
|
84
|
+
for (const o of d.value)
|
|
85
|
+
o.type === "select" && (o.reselected || (t[o.prop] = {
|
|
86
|
+
configItem: o,
|
|
87
|
+
valueList: []
|
|
88
|
+
}));
|
|
89
|
+
for (const o of u.value)
|
|
90
|
+
for (const n in o) {
|
|
91
|
+
const a = o[n];
|
|
92
|
+
if (f.isEmpty(a)) continue;
|
|
93
|
+
const e = t[n];
|
|
94
|
+
e && e.valueList.push(a);
|
|
95
|
+
}
|
|
96
|
+
for (const o in t) {
|
|
97
|
+
const n = t[o], a = n.valueList, e = n.configItem.dict, r = i.config.find((c) => c.prop == o), K = (r == null ? void 0 : r.dict) || [];
|
|
98
|
+
for (const c of e) {
|
|
99
|
+
const J = a.includes(c.value), D = K.find((Q) => Q.value == c.value);
|
|
100
|
+
c.disabled = D == null ? void 0 : D.disabled, c.isUsed = J && !c.disabled;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function P(t) {
|
|
105
|
+
return !t.some((o) => o.disabled || !o.isUsed);
|
|
106
|
+
}
|
|
107
|
+
return N({ getData: M }), (t, o) => (l(), s(m, null, [
|
|
108
|
+
I("div", {
|
|
109
|
+
class: _(["flex w-100% hui-grid-form-title", t.gridFromClass]),
|
|
110
|
+
style: { width: "100%" }
|
|
111
|
+
}, [
|
|
112
|
+
(l(!0), s(m, null, k(d.value, (n, a) => (l(), s("div", {
|
|
113
|
+
key: a,
|
|
114
|
+
class: "font-bold pr-10",
|
|
115
|
+
style: B({ width: n.width })
|
|
116
|
+
}, C(n.title), 5))), 128))
|
|
117
|
+
], 2),
|
|
118
|
+
(l(!0), s(m, null, k(u.value, (n, a) => (l(), s("div", {
|
|
119
|
+
key: a,
|
|
120
|
+
class: "flex mt-10 w-100% hui-grid-form-content"
|
|
121
|
+
}, [
|
|
122
|
+
(l(!0), s(m, null, k(d.value, (e) => (l(), s("div", {
|
|
123
|
+
key: e.prop,
|
|
124
|
+
class: "flex-y pr-10",
|
|
125
|
+
style: B({ width: e.width })
|
|
126
|
+
}, [
|
|
127
|
+
t.$slots[e.prop] ? (l(), s("div", se, [
|
|
128
|
+
T(t.$slots, e.prop, E({ ref_for: !0 }, { dataItem: n, el: e, prop: e.prop }), void 0, !0)
|
|
129
|
+
])) : (l(), s("div", re, [
|
|
130
|
+
e.type === "select" ? (l(), b(v(te), E({
|
|
131
|
+
key: 0,
|
|
132
|
+
ref_for: !0
|
|
133
|
+
}, e.attr, {
|
|
134
|
+
modelValue: n[e.prop],
|
|
135
|
+
"onUpdate:modelValue": (r) => n[e.prop] = r,
|
|
136
|
+
disabled: e.readonly,
|
|
137
|
+
clearable: e.clearable ?? !0,
|
|
138
|
+
placeholder: e.placeholder || "请选择",
|
|
139
|
+
onChange: h
|
|
140
|
+
}), {
|
|
141
|
+
default: y(() => [
|
|
142
|
+
(l(!0), s(m, null, k(e.dict, (r) => Y((l(), b(v(oe), {
|
|
143
|
+
key: r.value,
|
|
144
|
+
label: r.label,
|
|
145
|
+
value: r.value,
|
|
146
|
+
disabled: r.disabled
|
|
147
|
+
}, {
|
|
148
|
+
default: y(() => [
|
|
149
|
+
T(t.$slots, `${e.prop}-option`, {
|
|
150
|
+
option: r,
|
|
151
|
+
prop: e.prop,
|
|
152
|
+
propConfig: e
|
|
153
|
+
}, void 0, !0)
|
|
154
|
+
]),
|
|
155
|
+
_: 2
|
|
156
|
+
}, 1032, ["label", "value", "disabled"])), [
|
|
157
|
+
[Z, !r.isUsed]
|
|
158
|
+
])), 128)),
|
|
159
|
+
P(e.dict) ? (l(), s("div", ie, o[0] || (o[0] = [
|
|
160
|
+
I("div", null, "暂无数据", -1)
|
|
161
|
+
]))) : p("", !0)
|
|
162
|
+
]),
|
|
163
|
+
_: 2
|
|
164
|
+
}, 1040, ["modelValue", "onUpdate:modelValue", "disabled", "clearable", "placeholder"])) : (l(), b(v(ne), E({
|
|
165
|
+
key: 1,
|
|
166
|
+
ref_for: !0
|
|
167
|
+
}, e.attr, {
|
|
168
|
+
modelValue: n[e.prop],
|
|
169
|
+
"onUpdate:modelValue": (r) => n[e.prop] = r,
|
|
170
|
+
type: e.dataType ? e.dataType : "number",
|
|
171
|
+
readonly: e.readonly,
|
|
172
|
+
placeholder: e.placeholder || "请输入",
|
|
173
|
+
class: "inputFund",
|
|
174
|
+
"input-style": e.style
|
|
175
|
+
}), ee({ _: 2 }, [
|
|
176
|
+
v(f).isNotEmpty(e.append) ? {
|
|
177
|
+
name: "append",
|
|
178
|
+
fn: y(() => [
|
|
179
|
+
F(C(e.append), 1)
|
|
180
|
+
]),
|
|
181
|
+
key: "0"
|
|
182
|
+
} : void 0
|
|
183
|
+
]), 1040, ["modelValue", "onUpdate:modelValue", "type", "readonly", "placeholder", "input-style"]))
|
|
184
|
+
])),
|
|
185
|
+
G(e, n) ? (l(), s("div", ue, C(e.errMsg || `请输入${e.title}`), 1)) : p("", !0)
|
|
186
|
+
], 4))), 128)),
|
|
187
|
+
t.handSort || t.handDelete ? (l(), s("div", de, [
|
|
188
|
+
t.handSort ? (l(), s("i", {
|
|
189
|
+
key: 0,
|
|
190
|
+
class: _([a === u.value.length - 1 ? "!text-[theme(backgroundColor.normal)]" : "", "icon-com i-com-jiantou-xia-shixin text-disabled ml-5 !text-13"]),
|
|
191
|
+
onClick: (e) => j(a, "down", a !== u.value.length - 1)
|
|
192
|
+
}, null, 10, ce)) : p("", !0),
|
|
193
|
+
t.handSort ? (l(), s("i", {
|
|
194
|
+
key: 1,
|
|
195
|
+
class: _([a === 0 ? "!text-[theme(backgroundColor.normal)]" : "", "icon-com i-com-jiantou-shang-shixin text-disabled ml-5 !text-13"]),
|
|
196
|
+
onClick: (e) => j(a, "up", a !== 0)
|
|
197
|
+
}, null, 10, pe)) : p("", !0),
|
|
198
|
+
t.handDelete ? (l(), s("i", {
|
|
199
|
+
key: 2,
|
|
200
|
+
class: "icon-com i-com-lajitong text-disabled ml-5 !text-13",
|
|
201
|
+
onClick: (e) => O(a)
|
|
202
|
+
}, null, 8, fe)) : p("", !0)
|
|
203
|
+
])) : p("", !0)
|
|
204
|
+
]))), 128)),
|
|
205
|
+
t.isCanAppend ? (l(), b(v(le), {
|
|
206
|
+
key: 0,
|
|
207
|
+
class: "mt-10",
|
|
208
|
+
onClick: U
|
|
209
|
+
}, {
|
|
210
|
+
icon: y(() => o[1] || (o[1] = [
|
|
211
|
+
I("i", { class: "icon-com i-com-jiahao" }, null, -1)
|
|
212
|
+
])),
|
|
213
|
+
default: y(() => [
|
|
214
|
+
F(C(i.btnText) + " ", 1)
|
|
215
|
+
]),
|
|
216
|
+
_: 1
|
|
217
|
+
})) : p("", !0)
|
|
218
|
+
], 64));
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
export {
|
|
222
|
+
ke as default
|
|
223
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HuiTool as m } from "../../utils/hui-tool/index.js";
|
|
2
|
+
import "@hua5/hua5-utils";
|
|
3
|
+
const f = () => {
|
|
4
|
+
function s(t, e, o) {
|
|
5
|
+
const n = o === "up" ? e - 1 : e + 1;
|
|
6
|
+
if (n < 0 || n > t.length) return;
|
|
7
|
+
const c = t[e];
|
|
8
|
+
return t[e] = t[n], t[n] = c, t;
|
|
9
|
+
}
|
|
10
|
+
async function u(t, e) {
|
|
11
|
+
const [, o] = await m.msgBox("确定删除吗?");
|
|
12
|
+
return o ? (t.splice(e, 1), !0) : !1;
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
moveItem: s,
|
|
16
|
+
removeItem: u
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
f as useDynamicList
|
|
21
|
+
};
|