@skyfox2000/webui 0.1.0
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/.eslintrc.js +23 -0
- package/.prettierrc +11 -0
- package/.vscode/settings.json +25 -0
- package/README.md +104 -0
- package/env.d.ts +11 -0
- package/index.html +19 -0
- package/lib/AceEditor.d.ts +4 -0
- package/lib/BasicLayout.d.ts +4 -0
- package/lib/Error403.d.ts +4 -0
- package/lib/Error404.d.ts +4 -0
- package/lib/ExcelForm.d.ts +4 -0
- package/lib/UploadForm.d.ts +4 -0
- package/lib/assets/modules/basicLayout-YP_-EySb.js +726 -0
- package/lib/assets/modules/error403-Bi0E2twj.js +33 -0
- package/lib/assets/modules/error404-BF7vasR_.js +33 -0
- package/lib/assets/modules/excelForm-Dzndz-SG.js +109 -0
- package/lib/assets/modules/excelForm-WJVQmaDT.js +317 -0
- package/lib/assets/modules/index-FzWSvscZ.js +107 -0
- package/lib/assets/modules/index-ekkaExvB.js +49 -0
- package/lib/assets/modules/uploadForm-BahGnrAq.js +415 -0
- package/lib/assets/modules/uploadForm-DEnOjhwc.js +308 -0
- package/lib/components/common/button/index.vue.d.ts +42 -0
- package/lib/components/common/button/index.vue.d.ts.map +1 -0
- package/lib/components/common/icon/appicon.vue.d.ts +12 -0
- package/lib/components/common/icon/appicon.vue.d.ts.map +1 -0
- package/lib/components/common/icon/fullscreen.vue.d.ts +4 -0
- package/lib/components/common/icon/fullscreen.vue.d.ts.map +1 -0
- package/lib/components/common/icon/helper.vue.d.ts +23 -0
- package/lib/components/common/icon/helper.vue.d.ts.map +1 -0
- package/lib/components/common/icon/index.vue.d.ts +244 -0
- package/lib/components/common/icon/index.vue.d.ts.map +1 -0
- package/lib/components/common/icon/layoutIcon.vue.d.ts +44 -0
- package/lib/components/common/icon/layoutIcon.vue.d.ts.map +1 -0
- package/lib/components/common/icon/projectIcon.vue.d.ts +60 -0
- package/lib/components/common/icon/projectIcon.vue.d.ts.map +1 -0
- package/lib/components/common/icon/toolIcon.vue.d.ts +44 -0
- package/lib/components/common/icon/toolIcon.vue.d.ts.map +1 -0
- package/lib/components/common/index.d.ts +19 -0
- package/lib/components/common/index.d.ts.map +1 -0
- package/lib/components/common/tooltip/index.vue.d.ts +22 -0
- package/lib/components/common/tooltip/index.vue.d.ts.map +1 -0
- package/lib/components/content/dialog/excelForm.vue.d.ts +31 -0
- package/lib/components/content/dialog/excelForm.vue.d.ts.map +1 -0
- package/lib/components/content/dialog/index.vue.d.ts +35 -0
- package/lib/components/content/dialog/index.vue.d.ts.map +1 -0
- package/lib/components/content/dialog/uploadForm.vue.d.ts +25 -0
- package/lib/components/content/dialog/uploadForm.vue.d.ts.map +1 -0
- package/lib/components/content/drawer/index.vue.d.ts +27 -0
- package/lib/components/content/drawer/index.vue.d.ts.map +1 -0
- package/lib/components/content/form/formItem.vue.d.ts +26 -0
- package/lib/components/content/form/formItem.vue.d.ts.map +1 -0
- package/lib/components/content/form/index.vue.d.ts +26 -0
- package/lib/components/content/form/index.vue.d.ts.map +1 -0
- package/lib/components/content/index.d.ts +27 -0
- package/lib/components/content/index.d.ts.map +1 -0
- package/lib/components/content/search/index.vue.d.ts +30 -0
- package/lib/components/content/search/index.vue.d.ts.map +1 -0
- package/lib/components/content/search/searchItem.vue.d.ts +24 -0
- package/lib/components/content/search/searchItem.vue.d.ts.map +1 -0
- package/lib/components/content/table/index.vue.d.ts +37 -0
- package/lib/components/content/table/index.vue.d.ts.map +1 -0
- package/lib/components/content/table/tableOperate.vue.d.ts +19 -0
- package/lib/components/content/table/tableOperate.vue.d.ts.map +1 -0
- package/lib/components/content/toolbar/icontool.vue.d.ts +8 -0
- package/lib/components/content/toolbar/icontool.vue.d.ts.map +1 -0
- package/lib/components/content/toolbar/index.vue.d.ts +19 -0
- package/lib/components/content/toolbar/index.vue.d.ts.map +1 -0
- package/lib/components/content/tree/index.vue.d.ts +47 -0
- package/lib/components/content/tree/index.vue.d.ts.map +1 -0
- package/lib/components/error/error403.vue.d.ts +4 -0
- package/lib/components/error/error403.vue.d.ts.map +1 -0
- package/lib/components/error/error404.vue.d.ts +4 -0
- package/lib/components/error/error404.vue.d.ts.map +1 -0
- package/lib/components/form/aceEditor/aceConfig.d.ts +9 -0
- package/lib/components/form/aceEditor/aceConfig.d.ts.map +1 -0
- package/lib/components/form/aceEditor/index.vue.d.ts +13 -0
- package/lib/components/form/aceEditor/index.vue.d.ts.map +1 -0
- package/lib/components/form/autoComplete/index.vue.d.ts +140 -0
- package/lib/components/form/autoComplete/index.vue.d.ts.map +1 -0
- package/lib/components/form/cascader/index.vue.d.ts +110 -0
- package/lib/components/form/cascader/index.vue.d.ts.map +1 -0
- package/lib/components/form/checkbox/index.vue.d.ts +129 -0
- package/lib/components/form/checkbox/index.vue.d.ts.map +1 -0
- package/lib/components/form/datePicker/index.vue.d.ts +7 -0
- package/lib/components/form/datePicker/index.vue.d.ts.map +1 -0
- package/lib/components/form/index.d.ts +41 -0
- package/lib/components/form/index.d.ts.map +1 -0
- package/lib/components/form/input/index.vue.d.ts +27 -0
- package/lib/components/form/input/index.vue.d.ts.map +1 -0
- package/lib/components/form/input/inputIcon.vue.d.ts +11 -0
- package/lib/components/form/input/inputIcon.vue.d.ts.map +1 -0
- package/lib/components/form/input/inputNumber.vue.d.ts +4 -0
- package/lib/components/form/input/inputNumber.vue.d.ts.map +1 -0
- package/lib/components/form/input/inputPassword.vue.d.ts +4 -0
- package/lib/components/form/input/inputPassword.vue.d.ts.map +1 -0
- package/lib/components/form/propEditor/index.vue.d.ts +13 -0
- package/lib/components/form/propEditor/index.vue.d.ts.map +1 -0
- package/lib/components/form/radio/index.vue.d.ts +134 -0
- package/lib/components/form/radio/index.vue.d.ts.map +1 -0
- package/lib/components/form/radio/radioStatus.vue.d.ts +32 -0
- package/lib/components/form/radio/radioStatus.vue.d.ts.map +1 -0
- package/lib/components/form/rangePicker/index.vue.d.ts +17 -0
- package/lib/components/form/rangePicker/index.vue.d.ts.map +1 -0
- package/lib/components/form/select/index.vue.d.ts +143 -0
- package/lib/components/form/select/index.vue.d.ts.map +1 -0
- package/lib/components/form/switch/index.vue.d.ts +44 -0
- package/lib/components/form/switch/index.vue.d.ts.map +1 -0
- package/lib/components/form/textarea/index.vue.d.ts +4 -0
- package/lib/components/form/textarea/index.vue.d.ts.map +1 -0
- package/lib/components/form/transfer/index.vue.d.ts +39 -0
- package/lib/components/form/transfer/index.vue.d.ts.map +1 -0
- package/lib/components/form/transfer/transferTable.vue.d.ts +39 -0
- package/lib/components/form/transfer/transferTable.vue.d.ts.map +1 -0
- package/lib/components/form/treeSelect/index.vue.d.ts +39 -0
- package/lib/components/form/treeSelect/index.vue.d.ts.map +1 -0
- package/lib/components/form/upload/uploadList.vue.d.ts +477 -0
- package/lib/components/form/upload/uploadList.vue.d.ts.map +1 -0
- package/lib/components/index.d.ts +9 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/layout/breadcrumb/index.vue.d.ts +4 -0
- package/lib/components/layout/breadcrumb/index.vue.d.ts.map +1 -0
- package/lib/components/layout/content/index.vue.d.ts +23 -0
- package/lib/components/layout/content/index.vue.d.ts.map +1 -0
- package/lib/components/layout/datetime/index.vue.d.ts +4 -0
- package/lib/components/layout/datetime/index.vue.d.ts.map +1 -0
- package/lib/components/layout/header/headerExits.vue.d.ts +4 -0
- package/lib/components/layout/header/headerExits.vue.d.ts.map +1 -0
- package/lib/components/layout/header/index.vue.d.ts +4 -0
- package/lib/components/layout/header/index.vue.d.ts.map +1 -0
- package/lib/components/layout/index.d.ts +17 -0
- package/lib/components/layout/index.d.ts.map +1 -0
- package/lib/components/layout/menu/index.vue.d.ts +7 -0
- package/lib/components/layout/menu/index.vue.d.ts.map +1 -0
- package/lib/components/layout/menu/menuTabs.vue.d.ts +4 -0
- package/lib/components/layout/menu/menuTabs.vue.d.ts.map +1 -0
- package/lib/components/layout/page/basicLayout.vue.d.ts +7 -0
- package/lib/components/layout/page/basicLayout.vue.d.ts.map +1 -0
- package/lib/es/AceEditor/index.js +168 -0
- package/lib/es/BasicLayout/index.js +4 -0
- package/lib/es/Error403/index.js +4 -0
- package/lib/es/Error404/index.js +4 -0
- package/lib/es/ExcelForm/index.js +5 -0
- package/lib/es/UploadForm/index.js +5 -0
- package/lib/index.d.ts +2 -0
- package/lib/webui.css +1 -0
- package/lib/webui.es.js +3349 -0
- package/package.json +66 -0
- package/plugins/vite-plugin-auto-generate-vue.ts +105 -0
- package/postcss.config.ts +6 -0
- package/src/assets/global.css +9 -0
- package/src/components/common/button/index.vue +126 -0
- package/src/components/common/icon/appicon.vue +28 -0
- package/src/components/common/icon/fullscreen.vue +13 -0
- package/src/components/common/icon/helper.vue +30 -0
- package/src/components/common/icon/index.vue +426 -0
- package/src/components/common/icon/layoutIcon.vue +33 -0
- package/src/components/common/icon/projectIcon.vue +41 -0
- package/src/components/common/icon/toolIcon.vue +33 -0
- package/src/components/common/index.ts +19 -0
- package/src/components/common/tooltip/index.vue +25 -0
- package/src/components/content/dialog/excelForm.vue +479 -0
- package/src/components/content/dialog/index.vue +149 -0
- package/src/components/content/dialog/uploadForm.vue +228 -0
- package/src/components/content/drawer/index.vue +93 -0
- package/src/components/content/form/formItem.vue +76 -0
- package/src/components/content/form/index.vue +48 -0
- package/src/components/content/index.ts +32 -0
- package/src/components/content/search/index.vue +135 -0
- package/src/components/content/search/searchItem.vue +52 -0
- package/src/components/content/table/index.vue +215 -0
- package/src/components/content/table/tableOperate.vue +131 -0
- package/src/components/content/toolbar/icontool.vue +151 -0
- package/src/components/content/toolbar/index.vue +107 -0
- package/src/components/content/tree/index.vue +140 -0
- package/src/components/error/error403.vue +14 -0
- package/src/components/error/error404.vue +14 -0
- package/src/components/form/aceEditor/aceConfig.ts +90 -0
- package/src/components/form/aceEditor/index.vue +175 -0
- package/src/components/form/autoComplete/index.vue +171 -0
- package/src/components/form/cascader/index.vue +110 -0
- package/src/components/form/checkbox/index.vue +108 -0
- package/src/components/form/datePicker/index.vue +29 -0
- package/src/components/form/index.ts +54 -0
- package/src/components/form/input/index.vue +70 -0
- package/src/components/form/input/inputIcon.vue +39 -0
- package/src/components/form/input/inputNumber.vue +23 -0
- package/src/components/form/input/inputPassword.vue +22 -0
- package/src/components/form/propEditor/index.vue +81 -0
- package/src/components/form/radio/index.vue +132 -0
- package/src/components/form/radio/radioStatus.vue +42 -0
- package/src/components/form/rangePicker/index.vue +64 -0
- package/src/components/form/select/index.vue +186 -0
- package/src/components/form/switch/index.vue +58 -0
- package/src/components/form/textarea/index.vue +23 -0
- package/src/components/form/transfer/index.vue +95 -0
- package/src/components/form/transfer/transferTable.vue +124 -0
- package/src/components/form/treeSelect/index.vue +108 -0
- package/src/components/form/upload/uploadList.vue +235 -0
- package/src/components/index.ts +97 -0
- package/src/components/layout/breadcrumb/index.vue +38 -0
- package/src/components/layout/content/index.vue +28 -0
- package/src/components/layout/datetime/index.vue +16 -0
- package/src/components/layout/header/headerExits.vue +28 -0
- package/src/components/layout/header/index.vue +43 -0
- package/src/components/layout/index.ts +16 -0
- package/src/components/layout/menu/index.vue +64 -0
- package/src/components/layout/menu/menuTabs.vue +56 -0
- package/src/components/layout/page/basicLayout.vue +67 -0
- package/src/vite-env.d.ts +8 -0
- package/tailwind.config.ts +11 -0
- package/tsconfig.json +53 -0
- package/vite.config.ts +117 -0
- package//344/273/243/347/240/201/350/247/204/350/214/203/345/217/212/351/243/216/346/240/274/346/214/207/345/215/227.md +116 -0
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
import { defineComponent as V, useAttrs as $, ref as y, watch as S, onMounted as E, onUnmounted as T, createElementBlock as g, openBlock as f, createVNode as w, unref as o, mergeProps as B, withCtx as _, createCommentVNode as F, Fragment as I, renderList as Q, createBlock as j, normalizeClass as G, createTextVNode as z, toDisplayString as A, createElementVNode as H } from "vue";
|
|
2
|
+
import { AutoComplete as W, CheckboxGroup as X, Checkbox as Y, RadioGroup as Z, Radio as ee, Select as ae, SelectOption as le } from "ant-design-vue";
|
|
3
|
+
import { OptionCommProps as q, outFormDataFields as te, useInputFactory as D, unloadOption as J, onOptionChanged as U, getSelectedLabels as K, formValidate as R, loadOption as L, isEmpty as P, OPTIONS as ue, circleLoading as re } from "@skyfox2000/webbase";
|
|
4
|
+
const fe = /* @__PURE__ */ V({
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
__name: "index",
|
|
7
|
+
props: {
|
|
8
|
+
...q,
|
|
9
|
+
autoload: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: !1
|
|
12
|
+
},
|
|
13
|
+
value: {
|
|
14
|
+
type: [String, Number, null, Array],
|
|
15
|
+
default: void 0
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* 查询字段
|
|
19
|
+
* - 模糊查询
|
|
20
|
+
*/
|
|
21
|
+
searchField: {
|
|
22
|
+
type: String
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* 自定义查询参数
|
|
26
|
+
* - 查询参数
|
|
27
|
+
* - query参数
|
|
28
|
+
*/
|
|
29
|
+
onsearch: {
|
|
30
|
+
type: Function
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* 修改输入数据则自动清空关联数据
|
|
34
|
+
*/
|
|
35
|
+
autoClean: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: !0
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
emits: ["update:value", "select", "change", "update:labels"],
|
|
41
|
+
setup(c, { emit: M }) {
|
|
42
|
+
var k, l, s;
|
|
43
|
+
const e = c, C = $(), t = y({
|
|
44
|
+
...e.url,
|
|
45
|
+
url: ((k = e.url) == null ? void 0 : k.url) || "",
|
|
46
|
+
fieldMap: e.fieldMap || ((l = e.url) == null ? void 0 : l.fieldMap),
|
|
47
|
+
params: e.params || ((s = e.url) == null ? void 0 : s.params),
|
|
48
|
+
loadingText: !1
|
|
49
|
+
}), r = y(void 0);
|
|
50
|
+
S(
|
|
51
|
+
() => e.value,
|
|
52
|
+
() => {
|
|
53
|
+
r.value = e.value;
|
|
54
|
+
},
|
|
55
|
+
{ immediate: !0 }
|
|
56
|
+
), S(
|
|
57
|
+
() => r.value,
|
|
58
|
+
(u) => {
|
|
59
|
+
e.autoClean && e.formData && e.outFields && u !== e.value && te(e.formData, e.outFields, null);
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
const i = D(), { editorCtrl: b, errInfo: d, labelText: m } = i, p = M;
|
|
63
|
+
i.inputEmit = p;
|
|
64
|
+
const v = y([]), h = (u) => {
|
|
65
|
+
var N;
|
|
66
|
+
if (v.value = [], u === "") return;
|
|
67
|
+
let a = u.trim(), n = {
|
|
68
|
+
...t.value.params,
|
|
69
|
+
Query: {
|
|
70
|
+
...(N = t.value.params) == null ? void 0 : N.Query
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
e.searchField && (n.Query[e.searchField] = {
|
|
74
|
+
$like: "%" + a + "%"
|
|
75
|
+
}), e.onsearch && e.onsearch(a, n), L(!0, e, v, i, t.value, n);
|
|
76
|
+
}, x = (u) => {
|
|
77
|
+
const a = U(e, u, v, i);
|
|
78
|
+
p("update:value", u), p("select", u);
|
|
79
|
+
const n = K(a);
|
|
80
|
+
p("update:labels", n), d != null && d.value.errClass && b && R(b);
|
|
81
|
+
};
|
|
82
|
+
return E(() => {
|
|
83
|
+
t.value && !t.value.fieldMap && (t.value.fieldMap = {
|
|
84
|
+
title: "Name",
|
|
85
|
+
label: "Name",
|
|
86
|
+
value: "Name",
|
|
87
|
+
key: "Id"
|
|
88
|
+
});
|
|
89
|
+
}), T(() => {
|
|
90
|
+
J(e, i);
|
|
91
|
+
}), (u, a) => {
|
|
92
|
+
var n;
|
|
93
|
+
return f(), g("div", null, [
|
|
94
|
+
w(o(W), B({
|
|
95
|
+
value: r.value,
|
|
96
|
+
"onUpdate:value": a[0] || (a[0] = (N) => r.value = N),
|
|
97
|
+
class: [(n = o(d)) == null ? void 0 : n.errClass, "error w-full"],
|
|
98
|
+
options: v.value,
|
|
99
|
+
onSearch: h,
|
|
100
|
+
onSelect: x,
|
|
101
|
+
placeholder: e.url && !e.url.loading ? "请输入并选择" + o(m) : ""
|
|
102
|
+
}, o(C)), null, 16, ["value", "class", "options", "placeholder"])
|
|
103
|
+
]);
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
}), se = { class: "min-h-[32px] pt-[5px]" }, ne = {
|
|
107
|
+
key: 1,
|
|
108
|
+
class: "text-center text-gray-500"
|
|
109
|
+
}, me = /* @__PURE__ */ V({
|
|
110
|
+
inheritAttrs: !1,
|
|
111
|
+
__name: "index",
|
|
112
|
+
props: {
|
|
113
|
+
...q,
|
|
114
|
+
nodata: {
|
|
115
|
+
type: String,
|
|
116
|
+
default: ""
|
|
117
|
+
},
|
|
118
|
+
/**
|
|
119
|
+
* 换行数量
|
|
120
|
+
*/
|
|
121
|
+
wrap: {
|
|
122
|
+
type: Number
|
|
123
|
+
},
|
|
124
|
+
disabledItems: {
|
|
125
|
+
type: Array
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
emits: ["change", "update:labels"],
|
|
129
|
+
setup(c, { emit: M }) {
|
|
130
|
+
var p, v, h;
|
|
131
|
+
const e = c, C = $(), t = y({
|
|
132
|
+
...e.url,
|
|
133
|
+
url: ((p = e.url) == null ? void 0 : p.url) || "",
|
|
134
|
+
fieldMap: e.fieldMap || ((v = e.url) == null ? void 0 : v.fieldMap),
|
|
135
|
+
params: e.params || ((h = e.url) == null ? void 0 : h.params),
|
|
136
|
+
loadingText: !1
|
|
137
|
+
}), r = D(), { errInfo: i } = r, b = M;
|
|
138
|
+
r.inputEmit = b;
|
|
139
|
+
const d = y([]), m = (x) => {
|
|
140
|
+
const l = U(e, x, d, r), s = K(l);
|
|
141
|
+
b("update:labels", s);
|
|
142
|
+
};
|
|
143
|
+
return E(() => {
|
|
144
|
+
t.value && !t.value.fieldMap && (t.value.fieldMap = {
|
|
145
|
+
title: "Name",
|
|
146
|
+
label: "Name",
|
|
147
|
+
value: "Id",
|
|
148
|
+
key: "Id"
|
|
149
|
+
}), L(e.autoload, e, d, r, t.value, t.value.params);
|
|
150
|
+
}), T(() => {
|
|
151
|
+
J(e, r);
|
|
152
|
+
}), (x, k) => (f(), g("div", se, [
|
|
153
|
+
w(o(X), B({
|
|
154
|
+
onChange: m,
|
|
155
|
+
class: "w-full mb-[-3px]"
|
|
156
|
+
}, o(C)), {
|
|
157
|
+
default: _(() => [
|
|
158
|
+
d.value.length > 0 ? (f(!0), g(I, { key: 0 }, Q(d.value, (l) => {
|
|
159
|
+
var s;
|
|
160
|
+
return f(), j(o(Y), {
|
|
161
|
+
key: l.value,
|
|
162
|
+
value: l.value,
|
|
163
|
+
disabled: l.disabled || l.value && c.disabledItems && c.disabledItems.indexOf(l.value.toString()) > -1,
|
|
164
|
+
class: G([
|
|
165
|
+
((s = o(i)) == null ? void 0 : s.errClass) === "error" ? "error !text-red-400" : "",
|
|
166
|
+
"text-nowrap",
|
|
167
|
+
"pb-1",
|
|
168
|
+
c.wrap ? `w-1/${e.wrap}` : ""
|
|
169
|
+
])
|
|
170
|
+
}, {
|
|
171
|
+
default: _(() => [
|
|
172
|
+
z(A(l.label), 1)
|
|
173
|
+
]),
|
|
174
|
+
_: 2
|
|
175
|
+
}, 1032, ["value", "disabled", "class"]);
|
|
176
|
+
}), 128)) : c.nodata ? (f(), g("div", ne, A(c.nodata), 1)) : F("", !0)
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
}, 16)
|
|
180
|
+
]));
|
|
181
|
+
}
|
|
182
|
+
}), oe = { class: "min-h-[32px] pt-1" }, ie = {
|
|
183
|
+
key: 1,
|
|
184
|
+
class: "text-center text-gray-500"
|
|
185
|
+
}, ye = /* @__PURE__ */ V({
|
|
186
|
+
inheritAttrs: !1,
|
|
187
|
+
__name: "index",
|
|
188
|
+
props: {
|
|
189
|
+
...q,
|
|
190
|
+
value: {
|
|
191
|
+
type: [String, Number, null, Array],
|
|
192
|
+
default: void 0
|
|
193
|
+
},
|
|
194
|
+
nodata: {
|
|
195
|
+
type: String,
|
|
196
|
+
default: "无数据"
|
|
197
|
+
},
|
|
198
|
+
/**
|
|
199
|
+
* 换行数量
|
|
200
|
+
*/
|
|
201
|
+
wrap: {
|
|
202
|
+
type: Number
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
emits: ["change", "update:value", "update:labels"],
|
|
206
|
+
setup(c, { emit: M }) {
|
|
207
|
+
var h, x, k;
|
|
208
|
+
const e = c, C = $(), t = y({
|
|
209
|
+
...e.url,
|
|
210
|
+
url: ((h = e.url) == null ? void 0 : h.url) || "",
|
|
211
|
+
fieldMap: e.fieldMap || ((x = e.url) == null ? void 0 : x.fieldMap),
|
|
212
|
+
params: e.params || ((k = e.url) == null ? void 0 : k.params),
|
|
213
|
+
loadingText: !1
|
|
214
|
+
}), r = y(e.value), i = D(), { errInfo: b } = i, d = y([]), m = M;
|
|
215
|
+
i.inputEmit = m, S(
|
|
216
|
+
() => r.value,
|
|
217
|
+
(l) => {
|
|
218
|
+
m("update:value", l);
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
const p = (l, s) => {
|
|
222
|
+
if (typeof l == "object" && typeof s == "object") {
|
|
223
|
+
const u = JSON.stringify(l) === JSON.stringify(s);
|
|
224
|
+
return u && (r.value = l), u;
|
|
225
|
+
}
|
|
226
|
+
return l === s;
|
|
227
|
+
}, v = (l) => {
|
|
228
|
+
const s = l.target.value, u = U(e, s, d, i), a = K(u);
|
|
229
|
+
m("update:labels", a);
|
|
230
|
+
};
|
|
231
|
+
return E(() => {
|
|
232
|
+
var l;
|
|
233
|
+
t.value && !t.value.fieldMap && (t.value.fieldMap = {
|
|
234
|
+
label: "Name",
|
|
235
|
+
value: "Id",
|
|
236
|
+
key: "Id"
|
|
237
|
+
}), L(e.autoload, e, d, i, t.value, (l = t.value) == null ? void 0 : l.params);
|
|
238
|
+
}), T(() => {
|
|
239
|
+
J(e, i);
|
|
240
|
+
}), (l, s) => (f(), g("div", oe, [
|
|
241
|
+
w(o(Z), B({
|
|
242
|
+
value: r.value,
|
|
243
|
+
"onUpdate:value": s[0] || (s[0] = (u) => r.value = u),
|
|
244
|
+
autocheck: !1,
|
|
245
|
+
onChange: v,
|
|
246
|
+
class: "w-full flex align-items flex-wrap mb-[-3px]"
|
|
247
|
+
}, o(C)), {
|
|
248
|
+
default: _(() => [
|
|
249
|
+
d.value.length > 0 ? (f(!0), g(I, { key: 0 }, Q(d.value, (u) => {
|
|
250
|
+
var a;
|
|
251
|
+
return f(), g(I, {
|
|
252
|
+
key: u.value
|
|
253
|
+
}, [
|
|
254
|
+
u.visible !== !1 ? (f(), j(o(ee), {
|
|
255
|
+
key: 0,
|
|
256
|
+
checked: p(u.value, e.value),
|
|
257
|
+
value: u.value,
|
|
258
|
+
class: G([
|
|
259
|
+
((a = o(b)) == null ? void 0 : a.errClass) === "error" ? "error !text-red-400" : "",
|
|
260
|
+
"text-nowrap",
|
|
261
|
+
"pb-1",
|
|
262
|
+
c.wrap ? `w-1/${e.wrap}` : ""
|
|
263
|
+
])
|
|
264
|
+
}, {
|
|
265
|
+
default: _(() => [
|
|
266
|
+
z(A(u.label), 1)
|
|
267
|
+
]),
|
|
268
|
+
_: 2
|
|
269
|
+
}, 1032, ["checked", "value", "class"])) : F("", !0)
|
|
270
|
+
], 64);
|
|
271
|
+
}), 128)) : c.nodata ? (f(), g("div", ie, A(c.nodata), 1)) : F("", !0)
|
|
272
|
+
]),
|
|
273
|
+
_: 1
|
|
274
|
+
}, 16, ["value"])
|
|
275
|
+
]));
|
|
276
|
+
}
|
|
277
|
+
}), de = {
|
|
278
|
+
key: 0,
|
|
279
|
+
class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
|
|
280
|
+
}, be = /* @__PURE__ */ V({
|
|
281
|
+
inheritAttrs: !1,
|
|
282
|
+
__name: "index",
|
|
283
|
+
props: {
|
|
284
|
+
...q,
|
|
285
|
+
value: {
|
|
286
|
+
type: [String, Number, Array, null],
|
|
287
|
+
default: void 0
|
|
288
|
+
},
|
|
289
|
+
/**
|
|
290
|
+
* 自动选择第一个选项
|
|
291
|
+
*/
|
|
292
|
+
selectFirst: {
|
|
293
|
+
type: Boolean,
|
|
294
|
+
default: !1
|
|
295
|
+
},
|
|
296
|
+
/**
|
|
297
|
+
* 数据源OPTIONS的key
|
|
298
|
+
*/
|
|
299
|
+
dataKey: {
|
|
300
|
+
type: String,
|
|
301
|
+
required: !1
|
|
302
|
+
},
|
|
303
|
+
/**
|
|
304
|
+
* 是否显示全部选项
|
|
305
|
+
*/
|
|
306
|
+
all: {
|
|
307
|
+
type: Boolean,
|
|
308
|
+
default: !1
|
|
309
|
+
},
|
|
310
|
+
/**
|
|
311
|
+
* 自定义全部选项的值
|
|
312
|
+
* 如果all为true,则显示全部选项
|
|
313
|
+
* 未设置allValue,则默认[0, 1]
|
|
314
|
+
*/
|
|
315
|
+
allValue: {
|
|
316
|
+
type: [String, Number, Array],
|
|
317
|
+
required: !1
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
emits: ["change", "update:value", "update:labels"],
|
|
321
|
+
setup(c, { emit: M }) {
|
|
322
|
+
var l, s, u;
|
|
323
|
+
const e = c, C = $(), t = y({
|
|
324
|
+
...e.url,
|
|
325
|
+
url: ((l = e.url) == null ? void 0 : l.url) || "",
|
|
326
|
+
fieldMap: e.fieldMap || ((s = e.url) == null ? void 0 : s.fieldMap),
|
|
327
|
+
params: e.params || ((u = e.url) == null ? void 0 : u.params),
|
|
328
|
+
loadingText: !1
|
|
329
|
+
}), r = D(), { editorCtrl: i, errInfo: b, labelText: d } = r, m = y(void 0), p = M;
|
|
330
|
+
r.inputEmit = p;
|
|
331
|
+
const v = y([]);
|
|
332
|
+
S(
|
|
333
|
+
() => v.value,
|
|
334
|
+
(a) => {
|
|
335
|
+
a.length > 0 && P(e.value) && e.selectFirst ? (m.value = a[0].value, k(a[0].value)) : m.value = e.value === null ? void 0 : e.value;
|
|
336
|
+
}
|
|
337
|
+
);
|
|
338
|
+
const h = y(C.placeholder);
|
|
339
|
+
S(
|
|
340
|
+
() => t.value.loading,
|
|
341
|
+
(a) => {
|
|
342
|
+
a ? h.value = "" : h.value || (h.value = "请选择" + d.value);
|
|
343
|
+
},
|
|
344
|
+
{ immediate: !0 }
|
|
345
|
+
);
|
|
346
|
+
const x = y(e.value);
|
|
347
|
+
S(
|
|
348
|
+
() => m.value,
|
|
349
|
+
(a) => {
|
|
350
|
+
if (C.mode === "multiple" && P(a) && P(x.value)) {
|
|
351
|
+
p("update:value", x.value);
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
p("update:value", a);
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
const k = (a) => {
|
|
358
|
+
const n = U(e, a, v, r), N = K(n);
|
|
359
|
+
m.value = a, p("update:labels", N), p("change", a), b != null && b.value.errClass && i && R(i);
|
|
360
|
+
};
|
|
361
|
+
return E(() => {
|
|
362
|
+
var a;
|
|
363
|
+
if (t.value && !t.value.fieldMap && (t.value.fieldMap = {
|
|
364
|
+
label: "Name",
|
|
365
|
+
value: "Id",
|
|
366
|
+
key: "Id"
|
|
367
|
+
}), e.dataKey) {
|
|
368
|
+
const n = JSON.parse(JSON.stringify(ue.getOptions(e.dataKey)));
|
|
369
|
+
v.value = n;
|
|
370
|
+
} else L(e.autoload, e, v, r, t.value, (a = t.value) == null ? void 0 : a.params);
|
|
371
|
+
}), T(() => {
|
|
372
|
+
J(e, r);
|
|
373
|
+
}), (a, n) => {
|
|
374
|
+
var N;
|
|
375
|
+
return f(), g("div", null, [
|
|
376
|
+
e.url && e.url.loading === !0 ? (f(), g("div", de, [
|
|
377
|
+
w(o(re), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
|
|
378
|
+
n[1] || (n[1] = H("span", null, "数据加载中...", -1))
|
|
379
|
+
])) : F("", !0),
|
|
380
|
+
w(o(ae), B({
|
|
381
|
+
class: [(N = o(b)) == null ? void 0 : N.errClass, "w-full"],
|
|
382
|
+
value: m.value,
|
|
383
|
+
"onUpdate:value": n[0] || (n[0] = (O) => m.value = O),
|
|
384
|
+
"allow-clear": !0,
|
|
385
|
+
onChange: k,
|
|
386
|
+
placeholder: h.value,
|
|
387
|
+
"label-in-value": !1
|
|
388
|
+
}, o(C)), {
|
|
389
|
+
default: _(() => [
|
|
390
|
+
(f(!0), g(I, null, Q(v.value, (O) => (f(), g(I, {
|
|
391
|
+
key: O.value
|
|
392
|
+
}, [
|
|
393
|
+
O.visible !== !1 ? (f(), j(o(le), {
|
|
394
|
+
key: 0,
|
|
395
|
+
value: O.value
|
|
396
|
+
}, {
|
|
397
|
+
default: _(() => [
|
|
398
|
+
z(A(O.label), 1)
|
|
399
|
+
]),
|
|
400
|
+
_: 2
|
|
401
|
+
}, 1032, ["value"])) : F("", !0)
|
|
402
|
+
], 64))), 128))
|
|
403
|
+
]),
|
|
404
|
+
_: 1
|
|
405
|
+
}, 16, ["class", "value", "placeholder"])
|
|
406
|
+
]);
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
});
|
|
410
|
+
export {
|
|
411
|
+
fe as _,
|
|
412
|
+
me as a,
|
|
413
|
+
ye as b,
|
|
414
|
+
be as c
|
|
415
|
+
};
|