@skyfox2000/webui 0.1.2 → 0.1.4

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.
Files changed (64) hide show
  1. package/lib/AceEditor.d.ts +0 -3
  2. package/lib/BasicLayout.d.ts +0 -3
  3. package/lib/Error403.d.ts +0 -3
  4. package/lib/Error404.d.ts +0 -3
  5. package/lib/ExcelForm.d.ts +0 -3
  6. package/lib/UploadForm.d.ts +0 -3
  7. package/lib/assets/modules/index-BEWJ_qAH.js +50 -0
  8. package/lib/assets/modules/{excelForm-Dzndz-SG.js → index-BoKIa2sr.js} +1 -1
  9. package/lib/assets/modules/{index-FzWSvscZ.js → index-D47Ci-T3.js} +2 -2
  10. package/lib/assets/modules/menuTabs-JxjPoyCD.js +639 -0
  11. package/lib/assets/modules/uploadList-Dzlg47V0.js +182 -0
  12. package/lib/components/common/icon/layoutIcon.vue.d.ts.map +1 -1
  13. package/lib/components/common/icon/projectIcon.vue.d.ts.map +1 -1
  14. package/lib/components/common/icon/toolIcon.vue.d.ts.map +1 -1
  15. package/lib/components/content/index.d.ts +0 -4
  16. package/lib/components/content/index.d.ts.map +1 -1
  17. package/lib/components/form/autoComplete/index.vue.d.ts +3 -3
  18. package/lib/components/form/cascader/index.vue.d.ts +3 -3
  19. package/lib/components/form/checkbox/index.vue.d.ts +1 -1
  20. package/lib/components/form/index.d.ts +0 -2
  21. package/lib/components/form/index.d.ts.map +1 -1
  22. package/lib/components/form/radio/index.vue.d.ts +3 -3
  23. package/lib/components/form/select/index.vue.d.ts +3 -3
  24. package/lib/components/form/transfer/index.vue.d.ts +2 -2
  25. package/lib/components/form/treeSelect/index.vue.d.ts +2 -2
  26. package/lib/components/index.d.ts +3 -6
  27. package/lib/components/index.d.ts.map +1 -1
  28. package/lib/components/layout/index.d.ts +0 -2
  29. package/lib/components/layout/index.d.ts.map +1 -1
  30. package/lib/es/AceEditor/index.js +9 -11
  31. package/lib/es/BasicLayout/index.js +94 -2
  32. package/lib/es/Error403/index.js +31 -2
  33. package/lib/es/Error404/index.js +31 -2
  34. package/lib/es/ExcelForm/index.js +315 -3
  35. package/lib/es/UploadForm/index.js +133 -3
  36. package/lib/webui.css +1 -1
  37. package/lib/webui.es.js +1568 -1575
  38. package/package.json +2 -2
  39. package/src/components/common/icon/layoutIcon.vue +1 -1
  40. package/src/components/common/icon/projectIcon.vue +1 -1
  41. package/src/components/common/icon/toolIcon.vue +2 -2
  42. package/src/components/content/index.ts +4 -4
  43. package/src/components/form/index.ts +2 -2
  44. package/src/components/index.ts +1 -10
  45. package/src/components/layout/index.ts +2 -2
  46. package/lib/assets/modules/basicLayout-YP_-EySb.js +0 -726
  47. package/lib/assets/modules/error403-Bi0E2twj.js +0 -33
  48. package/lib/assets/modules/error404-BF7vasR_.js +0 -33
  49. package/lib/assets/modules/excelForm-WJVQmaDT.js +0 -317
  50. package/lib/assets/modules/index-ekkaExvB.js +0 -49
  51. package/lib/assets/modules/uploadForm-CwXiG05t.js +0 -309
  52. package/lib/components/content/dialog/excelForm.vue.d.ts +0 -31
  53. package/lib/components/content/dialog/excelForm.vue.d.ts.map +0 -1
  54. package/lib/components/content/dialog/uploadForm.vue.d.ts +0 -25
  55. package/lib/components/content/dialog/uploadForm.vue.d.ts.map +0 -1
  56. package/lib/components/error/error403.vue.d.ts +0 -4
  57. package/lib/components/error/error403.vue.d.ts.map +0 -1
  58. package/lib/components/error/error404.vue.d.ts +0 -4
  59. package/lib/components/error/error404.vue.d.ts.map +0 -1
  60. package/lib/components/form/aceEditor/index.vue.d.ts +0 -13
  61. package/lib/components/form/aceEditor/index.vue.d.ts.map +0 -1
  62. package/lib/components/layout/page/basicLayout.vue.d.ts +0 -7
  63. package/lib/components/layout/page/basicLayout.vue.d.ts.map +0 -1
  64. /package/lib/assets/modules/{uploadForm-BahGnrAq.js → index-BahGnrAq.js} +0 -0
package/lib/webui.es.js CHANGED
@@ -1,27 +1,24 @@
1
- import { _ as Oe, a as Ee, b as ze, c as Ke } from "./assets/modules/uploadForm-BahGnrAq.js";
2
- import { _ as O } from "./assets/modules/excelForm-Dzndz-SG.js";
3
- import { _ as Y } from "./assets/modules/index-ekkaExvB.js";
4
- import { a as La } from "./assets/modules/index-ekkaExvB.js";
5
- import { _ as V } from "./assets/modules/basicLayout-YP_-EySb.js";
6
- import { a as Ra, h as ja, c as qa, d as Qa, e as Va, I as Ha, f as Wa, g as Ja, b as Ga } from "./assets/modules/basicLayout-YP_-EySb.js";
7
- import { defineComponent as k, createBlock as h, openBlock as p, withModifiers as J, unref as e, useAttrs as W, withCtx as m, createElementVNode as S, createVNode as b, mergeProps as B, renderSlot as I, normalizeStyle as se, toDisplayString as D, createCommentVNode as C, ref as g, watch as $, onMounted as E, onUnmounted as he, createElementBlock as w, normalizeClass as N, createSlots as ge, Fragment as M, renderList as L, createTextVNode as F, computed as pe, withKeys as fe, provide as xe, inject as ne, resolveDirective as q, withDirectives as Q, useSlots as Ae, resolveDynamicComponent as Ye, onActivated as Le } from "vue";
8
- import { useSettingInfo as ye, onFullscreenClick as Ue, createFromIconfont as Re, OptionCommProps as je, useInputFactory as z, loadOption as be, unloadOption as Ce, circleLoading as qe, formValidate as R, OPTIONS as ke, doQuery as we, queryTree as $e, ProviderKeys as X, onFormClose as ae, onFormSaveAs as Qe, onFormSave as Se, useFormItemFactory as Te, getToolGroup as De, onGridRowEdit as Ve, onGridRowDelete as He, getToolVisible as H, onToolClicked as U, getToolStatus as j, useToolFactory as We, getToolByKey as Z, filterColumns as Ie, onColumnVisibleChanged as Je, AppRouter as Ge, openNewForm as Xe, gridQueryFind as ve, gridQueryList as Ze, gridStatusUpdate as et } from "@skyfox2000/webbase";
9
- import { Popover as tt, Cascader as at, DatePicker as lt, Input as re, InputPassword as rt, InputNumber as ot, Button as Be, RangePicker as st, Switch as nt, Textarea as ut, Transfer as it, Table as Pe, TreeSelect as dt, theme as Fe, Drawer as ct, Space as G, Form as Me, FormItem as Ne, ConfigProvider as me, Popconfirm as pt, DropdownButton as ft, Menu as ue, MenuItem as ie, Dropdown as oe, Checkbox as vt, Tree as mt, LayoutContent as _t } from "ant-design-vue";
10
- import { SERVER_HOST as ht, fieldMapping as ee } from "@skyfox2000/fapi";
11
- import { _ as Za } from "./assets/modules/index-FzWSvscZ.js";
12
- import { _ as tl, a as al } from "./assets/modules/uploadForm-CwXiG05t.js";
13
- import { _ as rl } from "./assets/modules/excelForm-WJVQmaDT.js";
14
- import { VueDraggableNext as gt } from "vue-draggable-next";
15
- import xt from "vue-m-message";
16
- import { _ as sl } from "./assets/modules/error403-Bi0E2twj.js";
17
- import { _ as ul } from "./assets/modules/error404-BF7vasR_.js";
1
+ import { _ as La } from "./assets/modules/index-D47Ci-T3.js";
2
+ import { _ as O } from "./assets/modules/index-BoKIa2sr.js";
3
+ import { _ as Y } from "./assets/modules/index-BEWJ_qAH.js";
4
+ import { a as Ua } from "./assets/modules/index-BEWJ_qAH.js";
5
+ import { _ as V } from "./assets/modules/menuTabs-JxjPoyCD.js";
6
+ import { a as qa, c as Qa, d as Va, e as Ha, I as Wa, f as Ja, g as Ga, b as Xa } from "./assets/modules/menuTabs-JxjPoyCD.js";
7
+ import { defineComponent as k, createBlock as h, openBlock as p, withModifiers as J, unref as e, useAttrs as W, withCtx as m, createElementVNode as S, createVNode as b, mergeProps as B, renderSlot as I, normalizeStyle as se, toDisplayString as D, createCommentVNode as C, ref as g, provide as he, watch as $, onMounted as z, createTextVNode as M, inject as ne, resolveDirective as q, withDirectives as Q, createElementBlock as w, normalizeClass as N, createSlots as ge, useSlots as Oe, Fragment as F, renderList as L, resolveDynamicComponent as ze, onUnmounted as xe, onActivated as Ke, computed as pe, withKeys as fe } from "vue";
8
+ import { useSettingInfo as ye, onFullscreenClick as Ae, createFromIconfont as Ee, ProviderKeys as X, onFormClose as ae, onFormSaveAs as Ye, onFormSave as be, useFormItemFactory as Ce, getToolGroup as ke, onGridRowEdit as Le, onGridRowDelete as Re, getToolVisible as H, onToolClicked as R, getToolStatus as j, useToolFactory as Ue, getToolByKey as Z, filterColumns as we, onColumnVisibleChanged as je, AppRouter as qe, openNewForm as Qe, useInputFactory as K, loadOption as $e, unloadOption as Se, formValidate as U, gridQueryFind as ve, gridQueryList as Ve, gridStatusUpdate as He, OPTIONS as Te, queryTree as De, OptionCommProps as We, circleLoading as Je, doQuery as Ie } from "@skyfox2000/webbase";
9
+ import { Popover as Ge, theme as Be, Drawer as Xe, Space as G, Form as Pe, FormItem as Me, ConfigProvider as me, Popconfirm as Ze, Button as Fe, DropdownButton as et, Menu as ue, MenuItem as ie, Dropdown as re, Checkbox as tt, Switch as at, Table as Ne, Tree as lt, Cascader as rt, DatePicker as ot, Input as oe, InputPassword as st, InputNumber as nt, RangePicker as ut, Textarea as it, Transfer as dt, TreeSelect as ct, LayoutContent as pt } from "ant-design-vue";
10
+ import { SERVER_HOST as ft, fieldMapping as ee } from "@skyfox2000/fapi";
11
+ import { VueDraggableNext as vt } from "vue-draggable-next";
12
+ import mt from "vue-m-message";
13
+ import { _ as _t, a as ht, b as gt, c as xt } from "./assets/modules/index-BahGnrAq.js";
18
14
  import _e from "dayjs";
15
+ import { _ as el } from "./assets/modules/uploadList-Dzlg47V0.js";
19
16
  const ma = /* @__PURE__ */ k({
20
17
  __name: "fullscreen",
21
18
  setup(v) {
22
19
  const o = ye();
23
20
  return (a, t) => (p(), h(Y, {
24
- onClick: J(e(Ue), ["stop"]),
21
+ onClick: J(e(Ae), ["stop"]),
25
22
  icon: e(o).fullscreen ? "icon-exitscreen" : "icon-fullscreen",
26
23
  class: "w-[17px] h-[17px]"
27
24
  }, null, 8, ["onClick", "icon"]));
@@ -35,7 +32,7 @@ const ma = /* @__PURE__ */ k({
35
32
  },
36
33
  setup(v) {
37
34
  const o = W();
38
- return (a, t) => (p(), h(e(tt), { placement: "topRight" }, {
35
+ return (a, t) => (p(), h(e(Ge), { placement: "topRight" }, {
39
36
  content: m(() => [
40
37
  I(a.$slots, "default", {}, () => [
41
38
  S("div", {
@@ -66,8 +63,8 @@ const ma = /* @__PURE__ */ k({
66
63
  }
67
64
  },
68
65
  setup(v) {
69
- const o = v, t = Re({
70
- iconUrl: `${ht.MICROLAYOUT_ICONS}`,
66
+ const o = v, t = Ee({
67
+ iconUrl: `${ft.MICROLAYOUT_ICONS}`,
71
68
  monoColor: !0,
72
69
  icon: o.icon,
73
70
  icons: o.icons
@@ -75,1656 +72,1657 @@ const ma = /* @__PURE__ */ k({
75
72
  return (r, n) => v.icon || v.icons ? (p(), h(e(t), B({
76
73
  key: 0,
77
74
  icon: v.icon,
78
- icons: v.icons
75
+ icons: v.icons,
76
+ class: ["align-middle"]
79
77
  }, r.$attrs), null, 16, ["icon", "icons"])) : C("", !0);
80
78
  }
81
- }), ha = /* @__PURE__ */ V(Oe, [["__scopeId", "data-v-1e39ad49"]]), Ct = {
82
- key: 0,
83
- class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
84
- }, kt = /* @__PURE__ */ k({
85
- inheritAttrs: !1,
79
+ }), Ct = { class: "hover:bg-gray-200 w-[24px] h-[24px] rounded-md" }, ha = /* @__PURE__ */ k({
86
80
  __name: "index",
87
- props: je,
88
- emits: ["change", "update:labels", "update:value"],
89
- setup(v, { emit: o }) {
90
- var _, x, T;
91
- const a = v, t = W(), r = g({
92
- ...a.url,
93
- url: ((_ = a.url) == null ? void 0 : _.url) || "",
94
- fieldMap: a.fieldMap || ((x = a.url) == null ? void 0 : x.fieldMap),
95
- params: a.params || ((T = a.url) == null ? void 0 : T.params),
96
- loadingText: !1
97
- }), n = z(), { editorCtrl: c, errInfo: d, labelText: f } = n, s = g(t.placeholder);
98
- $(
99
- () => r.value.loading,
100
- (P) => {
101
- P ? s.value = "" : s.value || (s.value = "请选择" + f.value);
102
- },
103
- { immediate: !0 }
104
- );
105
- const u = o;
106
- n.inputEmit = u;
107
- const l = g([]), i = (P, y) => {
108
- if (!y || y.length === 0) {
109
- u("update:labels", []), u("update:value", []);
110
- return;
81
+ props: {
82
+ saveText: {},
83
+ saveAsText: {},
84
+ cancelText: {},
85
+ editorCtrl: {}
86
+ },
87
+ setup(v) {
88
+ const { useToken: o } = Be, { token: a } = o(), t = g(!1), n = v.editorCtrl;
89
+ he(X.EditorControl, n), $(
90
+ () => n.visible.value,
91
+ (d) => {
92
+ t.value = d ?? !1;
111
93
  }
112
- const K = y.map((A) => A.label);
113
- u("update:labels", K), u(
114
- "update:value",
115
- y.map((A) => A.value)
116
- ), d != null && d.value.errClass && c && R(c);
117
- };
118
- return E(() => {
119
- r.value && !r.value.fieldMap && (r.value.fieldMap = {
120
- title: "Name",
121
- label: "Name",
122
- value: "Id",
123
- key: "Id"
124
- }), be(a.autoload, a, l, n, r.value, r.value.params);
125
- }), he(() => {
126
- Ce(a, n);
127
- }), (P, y) => {
128
- var K;
129
- return p(), w("div", null, [
130
- l.value.length ? C("", !0) : (p(), w("div", Ct, [
131
- b(e(qe), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
132
- y[0] || (y[0] = S("span", null, "数据加载中...", -1))
133
- ])),
134
- b(e(at), B({
135
- options: l.value,
136
- class: [(K = e(d)) == null ? void 0 : K.errClass],
137
- "allow-clear": !0,
138
- placeholder: l.value.length > 0 ? "请选择" + e(f) : "",
139
- onChange: i
140
- }, e(t)), null, 16, ["options", "class", "placeholder"])
141
- ]);
94
+ ), z(() => {
95
+ t.value = n.visible.value ?? !1;
96
+ });
97
+ const c = () => {
98
+ ae(n);
142
99
  };
100
+ return (d, f) => (p(), h(e(Xe), {
101
+ open: t.value,
102
+ "onUpdate:open": f[4] || (f[4] = (s) => t.value = s),
103
+ "get-container": !1,
104
+ closable: !1,
105
+ "header-style": {
106
+ height: "40px",
107
+ padding: "10px 6px 10px 16px",
108
+ backgroundColor: e(a).colorBgLayout
109
+ },
110
+ "body-style": {
111
+ padding: "10px 16px"
112
+ },
113
+ "footer-style": {
114
+ textAlign: "right"
115
+ },
116
+ style: {
117
+ position: "absolute",
118
+ boxShadow: "rgba(0, 0, 0, 0.3) -2px 0px 8px"
119
+ },
120
+ width: "420px",
121
+ onClose: c
122
+ }, {
123
+ extra: m(() => [
124
+ S("div", Ct, [
125
+ b(e(Y), {
126
+ class: "top-[-2px] left-[2px] w-6 h-6",
127
+ icon: "icon-new",
128
+ angle: 45,
129
+ fontsize: "24px",
130
+ clickable: "",
131
+ color: "#666",
132
+ position: [0, 0],
133
+ onClick: f[0] || (f[0] = () => e(ae)(e(n)))
134
+ })
135
+ ])
136
+ ]),
137
+ default: m(() => [
138
+ I(d.$slots, "default")
139
+ ]),
140
+ footer: m(() => [
141
+ b(e(G), null, {
142
+ default: m(() => [
143
+ d.cancelText !== "" ? (p(), h(e(O), {
144
+ key: 0,
145
+ onClick: f[1] || (f[1] = () => e(ae)(e(n)))
146
+ }, {
147
+ default: m(() => [
148
+ M(D(d.cancelText ?? "取消"), 1)
149
+ ]),
150
+ _: 1
151
+ })) : C("", !0),
152
+ d.saveAsText !== "" && e(n).saveAsBtnVisible !== !1 ? (p(), h(e(O), {
153
+ key: 1,
154
+ onClick: f[2] || (f[2] = () => e(Ye)(e(n))),
155
+ type: "primary",
156
+ loading: e(n).isFormSaving.value
157
+ }, {
158
+ default: m(() => [
159
+ M(D(d.saveAsText ?? "另存为"), 1)
160
+ ]),
161
+ _: 1
162
+ }, 8, ["loading"])) : C("", !0),
163
+ d.saveText !== "" && e(n).saveBtnVisible !== !1 ? (p(), h(e(O), {
164
+ key: 2,
165
+ onClick: f[3] || (f[3] = () => e(be)(e(n))),
166
+ type: "primary",
167
+ loading: e(n).isFormSaving.value
168
+ }, {
169
+ default: m(() => [
170
+ M(D(d.saveText ?? "保存"), 1)
171
+ ]),
172
+ _: 1
173
+ }, 8, ["loading"])) : C("", !0)
174
+ ]),
175
+ _: 1
176
+ })
177
+ ]),
178
+ _: 3
179
+ }, 8, ["open", "header-style"]));
143
180
  }
144
- }), ga = /* @__PURE__ */ V(kt, [["__scopeId", "data-v-05e57a52"]]), xa = /* @__PURE__ */ V(Ee, [["__scopeId", "data-v-dc59fe7f"]]);
145
- function te() {
146
- return te = Object.assign ? Object.assign.bind() : function(v) {
147
- for (var o = 1; o < arguments.length; o++) {
148
- var a = arguments[o];
149
- for (var t in a) ({}).hasOwnProperty.call(a, t) && (v[t] = a[t]);
150
- }
151
- return v;
152
- }, te.apply(null, arguments);
153
- }
154
- const wt = {
155
- locale: "zh_CN",
156
- today: "今天",
157
- now: "此刻",
158
- backToToday: "返回今天",
159
- ok: "确定",
160
- timeSelect: "选择时间",
161
- dateSelect: "选择日期",
162
- weekSelect: "选择周",
163
- clear: "清除",
164
- month: "月",
165
- year: "年",
166
- previousMonth: "上个月 (翻页上键)",
167
- nextMonth: "下个月 (翻页下键)",
168
- monthSelect: "选择月份",
169
- yearSelect: "选择年份",
170
- decadeSelect: "选择年代",
171
- yearFormat: "YYYY年",
172
- dayFormat: "D日",
173
- dateFormat: "YYYY年M月D日",
174
- dateTimeFormat: "YYYY年M月D日 HH时mm分ss秒",
175
- previousYear: "上一年 (Control键加左方向键)",
176
- nextYear: "下一年 (Control键加右方向键)",
177
- previousDecade: "上一年代",
178
- nextDecade: "下一年代",
179
- previousCentury: "上一世纪",
180
- nextCentury: "下一世纪"
181
- }, $t = {
182
- placeholder: "请选择时间",
183
- rangePlaceholder: ["开始时间", "结束时间"]
184
- }, de = {
185
- lang: te({
186
- placeholder: "请选择日期",
187
- yearPlaceholder: "请选择年份",
188
- quarterPlaceholder: "请选择季度",
189
- monthPlaceholder: "请选择月份",
190
- weekPlaceholder: "请选择周",
191
- rangePlaceholder: ["开始日期", "结束日期"],
192
- rangeYearPlaceholder: ["开始年份", "结束年份"],
193
- rangeMonthPlaceholder: ["开始月份", "结束月份"],
194
- rangeQuarterPlaceholder: ["开始季度", "结束季度"],
195
- rangeWeekPlaceholder: ["开始周", "结束周"]
196
- }, wt),
197
- timePickerLocale: te({}, $t)
198
- };
199
- de.lang.ok = "确定";
200
- const ya = /* @__PURE__ */ k({
181
+ }), ga = /* @__PURE__ */ k({
201
182
  __name: "index",
202
183
  props: {
203
- valueFormat: {}
184
+ labelWidth: {},
185
+ wrapperWidth: {},
186
+ editorCtrl: {}
204
187
  },
205
188
  setup(v) {
206
- const o = v, { editorCtrl: a, labelText: t, errInfo: r } = z(), n = () => {
207
- r != null && r.value.errClass && a && R(a);
208
- }, c = g(o.valueFormat ?? "YYYY-MM-DD");
209
- return (d, f) => {
210
- var s;
211
- return p(), h(e(lt), {
212
- class: N([[((s = e(r)) == null ? void 0 : s.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : ""], "w-full"]),
213
- placeholder: "请选择" + e(t),
214
- locale: e(de),
215
- valueFormat: c.value,
216
- onBlur: n
217
- }, null, 8, ["class", "placeholder", "locale", "valueFormat"]);
189
+ const o = v, a = o.editorCtrl ?? ne(X.EditorControl, void 0);
190
+ return (t, r) => {
191
+ const n = q("submit");
192
+ return Q((p(), h(e(Pe), {
193
+ "label-col": { flex: o.labelWidth ?? "85px" },
194
+ "wrapper-col": {
195
+ flex: o.wrapperWidth ?? "1"
196
+ },
197
+ style: {
198
+ display: "flex",
199
+ flexWrap: "wrap"
200
+ }
201
+ }, {
202
+ default: m(() => [
203
+ I(t.$slots, "default")
204
+ ]),
205
+ _: 3
206
+ }, 8, ["label-col", "wrapper-col"])), [
207
+ [
208
+ n,
209
+ () => {
210
+ e(a) && e(be)(e(a));
211
+ }
212
+ ]
213
+ ]);
218
214
  };
219
215
  }
220
- }), St = /* @__PURE__ */ k({
221
- __name: "index",
216
+ }), kt = { class: "w-full flex items-center" }, wt = { class: "flex-grow" }, $t = { class: "w-8 mt-[-2px]" }, St = {
217
+ key: 1,
218
+ class: "absolute bottom-[3px] left-[85px] text-[12px] text-[#ff4d4fcc] block"
219
+ }, xa = /* @__PURE__ */ k({
220
+ inheritAttrs: !1,
221
+ __name: "formItem",
222
222
  props: {
223
- value: {}
223
+ label: {},
224
+ rule: {},
225
+ helper: {},
226
+ width: {}
224
227
  },
225
- emits: ["update:value"],
226
- setup(v, { emit: o }) {
227
- const { editorCtrl: a, labelText: t, errInfo: r } = z(), n = () => {
228
- r != null && r.value.errClass && a && R(a);
229
- }, c = v, d = o, f = g(c.value);
230
- $(
231
- () => c.value,
232
- (u) => {
233
- f.value = u;
234
- },
235
- { immediate: !0 }
236
- // 立即同步初始值
237
- ), $(
238
- () => f.value,
239
- (u) => {
240
- if (f.value === "") {
241
- d("update:value", void 0);
242
- return;
243
- }
244
- d("update:value", u);
245
- }
246
- );
247
- const s = () => {
248
- f.value === "" && (f.value = void 0);
249
- };
250
- return (u, l) => {
251
- var i, _;
252
- return p(), h(e(re), B({
253
- class: [
254
- (i = e(r)) == null ? void 0 : i.errClass,
255
- ((_ = e(r)) == null ? void 0 : _.errClass) === "error" && !u.$slots.addonBefore && !u.$slots.addonAfter ? "!border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : ""
256
- ],
257
- value: f.value,
258
- "onUpdate:value": l[0] || (l[0] = (x) => f.value = x),
259
- autocomplete: "new-password",
260
- "allow-clear": !0,
261
- placeholder: "请输入" + e(t),
262
- onBlur: n,
263
- onChange: s
264
- }, u.$attrs), ge({ _: 2 }, [
265
- u.$slots.addonBefore ? {
266
- name: "addonBefore",
267
- fn: m(() => [
268
- I(u.$slots, "addonBefore")
228
+ setup(v) {
229
+ const o = v, a = W(), t = ne(X.EditorControl, void 0), r = Ce(o, t), n = g(!1);
230
+ return setTimeout(() => {
231
+ n.value = !0;
232
+ }, 30), (c, d) => {
233
+ var f, s, u, l;
234
+ return p(), w("div", {
235
+ class: N(["w-full relative mb-1", c.width])
236
+ }, [
237
+ n.value ? (p(), h(e(Me), B({
238
+ key: 0,
239
+ required: !!c.rule && ((l = (u = (s = (f = e(t)) == null ? void 0 : f.formRules) == null ? void 0 : s.value) == null ? void 0 : u[c.rule]) == null ? void 0 : l.required),
240
+ class: "!w-[95%] relative"
241
+ }, e(a), {
242
+ class: [c.rule ? "" : "mb-3"]
243
+ }), {
244
+ label: m(() => [
245
+ S("span", {
246
+ class: N([e(r).errClass ? "text-[#ff4d4f]" : "", "w-full"])
247
+ }, D(c.label), 3)
269
248
  ]),
270
- key: "0"
271
- } : void 0,
272
- u.$slots.addonAfter ? {
273
- name: "addonAfter",
274
- fn: m(() => [
275
- I(u.$slots, "addonAfter")
249
+ default: m(() => [
250
+ S("div", kt, [
251
+ S("div", wt, [
252
+ I(c.$slots, "default")
253
+ ]),
254
+ S("div", $t, [
255
+ I(c.$slots, "helper", {}, () => [
256
+ c.helper ? (p(), h(e(bt), {
257
+ key: 0,
258
+ text: c.helper
259
+ }, null, 8, ["text"])) : C("", !0)
260
+ ])
261
+ ])
262
+ ])
276
263
  ]),
277
- key: "1"
278
- } : void 0
279
- ]), 1040, ["class", "value", "placeholder"]);
264
+ _: 3
265
+ }, 16, ["required", "class"])) : C("", !0),
266
+ e(r).errClass ? (p(), w("span", St, D(e(r).msg), 1)) : C("", !0)
267
+ ], 2);
280
268
  };
281
269
  }
282
- }), Tt = /* @__PURE__ */ k({
283
- __name: "inputIcon",
270
+ }), Tt = { class: "w-1/3 relative mb-1" }, Dt = { class: "flex items-center" }, It = { class: "flex-grow pl-1" }, Bt = {
271
+ key: 0,
272
+ class: "absolute bottom-[3px] left-[85px] text-[12px] text-[#ff4d4fcc] block"
273
+ }, le = /* @__PURE__ */ k({
274
+ inheritAttrs: !1,
275
+ __name: "searchItem",
284
276
  props: {
285
- value: {}
277
+ label: {},
278
+ width: {},
279
+ rule: {}
286
280
  },
287
- emits: ["update:value"],
288
- setup(v, { emit: o }) {
289
- const a = v, t = o, r = g(void 0);
290
- return $(
291
- () => a.value,
292
- (n) => {
293
- r.value = n ?? void 0;
294
- },
295
- { immediate: !0 }
296
- ), $(
297
- () => r.value,
298
- (n) => {
299
- t("update:value", n);
300
- }
301
- ), (n, c) => (p(), h(St, B({
302
- class: ["w-[80%]"],
303
- value: r.value,
304
- "onUpdate:value": c[0] || (c[0] = (d) => r.value = d)
305
- }, n.$attrs), {
306
- addonBefore: m(() => [
307
- b(e(Y), {
308
- class: "!w-4 !h-4",
309
- icon: r.value
310
- }, null, 8, ["icon"])
311
- ]),
312
- _: 1
313
- }, 16, ["value"]));
314
- }
315
- }), ba = /* @__PURE__ */ V(Tt, [["__scopeId", "data-v-f7b3ed74"]]), Ca = /* @__PURE__ */ k({
316
- __name: "inputPassword",
317
- setup(v) {
318
- const { editorCtrl: o, labelText: a, errInfo: t } = z(), r = () => {
319
- t != null && t.value.errClass && o && R(o);
320
- };
321
- return (n, c) => {
322
- var d;
323
- return p(), h(e(rt), B({
324
- class: ((d = e(t)) == null ? void 0 : d.errClass) === "error" ? ["error", "!border-red-300", "shadow-[0_0_3px_0px_#ff4d4f]"] : "",
325
- "allow-clear": !0,
326
- autocomplete: "new-password",
327
- placeholder: "请输入" + e(a),
328
- onBlur: r
329
- }, n.$attrs), null, 16, ["class", "placeholder"]);
330
- };
331
- }
332
- }), ka = /* @__PURE__ */ k({
333
- __name: "inputNumber",
334
281
  setup(v) {
335
- const { editorCtrl: o, labelText: a, errInfo: t } = z(), r = () => {
336
- t != null && t.value.errClass && o && R(o);
337
- };
338
- return (n, c) => {
339
- var d;
340
- return p(), h(e(ot), B({
341
- class: [[((d = e(t)) == null ? void 0 : d.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : ""], "w-[50%]"],
342
- onBlur: r,
343
- "allow-clear": !1,
344
- placeholder: "请输入" + e(a)
345
- }, n.$attrs), null, 16, ["class", "placeholder"]);
346
- };
347
- }
348
- }), Dt = { class: "flex flex-col gap-2" }, It = { class: "w-[33%]" }, Bt = { class: "w-[64%]" }, wa = /* @__PURE__ */ k({
349
- __name: "index",
350
- props: {
351
- value: {},
352
- labelHolder: {},
353
- valueHolder: {}
354
- },
355
- emits: ["update:value"],
356
- setup(v, { emit: o }) {
357
- const a = v, t = o, r = g([]);
358
- let n = !1;
359
- const c = () => {
360
- r.value = Object.entries(a.value).map(([u, l]) => ({
361
- id: Date.now() + Math.random(),
362
- field: u,
363
- value: l
364
- }));
365
- };
366
- $(() => a.value, () => {
367
- n || c(), n = !1;
368
- }, { immediate: !0 });
369
- const d = () => {
370
- const u = r.value.reduce((l, i) => (i.field && (l[i.field] = i.value), l), {});
371
- n = !0, t("update:value", u);
372
- }, f = () => {
373
- r.value.push({
374
- id: Date.now() + Math.random(),
375
- field: "",
376
- value: ""
377
- });
378
- }, s = () => {
379
- d();
380
- };
381
- return (u, l) => (p(), w("div", Dt, [
382
- (p(!0), w(M, null, L(r.value, (i) => (p(), w("div", {
383
- key: i.id,
384
- class: "flex items-center gap-2"
385
- }, [
386
- S("div", It, [
387
- b(e(re), {
388
- value: i.field,
389
- "onUpdate:value": (_) => i.field = _,
390
- title: i.field,
391
- class: "w-full",
392
- placeholder: u.labelHolder || "配置名",
393
- onInput: s
394
- }, null, 8, ["value", "onUpdate:value", "title", "placeholder"])
282
+ const o = v, a = W(), t = ne(X.EditorControl, void 0), r = Ce(o, t);
283
+ return (n, c) => (p(), w("div", Tt, [
284
+ b(e(Me), B({
285
+ required: n.rule !== void 0,
286
+ class: "w-[90%] relative"
287
+ }, e(a), {
288
+ class: [n.rule ? "" : "mb-3", n.width],
289
+ labelCol: { span: 6 }
290
+ }), ge({
291
+ default: m(() => [
292
+ S("div", Dt, [
293
+ S("div", It, [
294
+ I(n.$slots, "default")
295
+ ])
296
+ ])
395
297
  ]),
396
- l[0] || (l[0] = S("div", { class: "w-[3%]" }, " = ", -1)),
397
- S("div", Bt, [
398
- b(e(re), {
399
- value: i.value,
400
- "onUpdate:value": (_) => i.value = _,
401
- placeholder: u.valueHolder,
402
- onInput: s,
403
- title: i.value
404
- }, null, 8, ["value", "onUpdate:value", "placeholder", "title"])
405
- ])
406
- ]))), 128)),
407
- b(e(Be), {
408
- onClick: f,
409
- class: "mt-1 w-[80px] !text-[12px] text-[#666] bg-[#e6f7ff] border-[#b3e0ff] hover:bg-[#b3e0ff] hover:border-[#8abeff]",
410
- size: "small"
411
- }, {
412
- default: m(() => l[1] || (l[1] = [
413
- F(" 新增配置行 ")
414
- ])),
415
- _: 1,
416
- __: [1]
417
- })
298
+ _: 2
299
+ }, [
300
+ n.label ? {
301
+ name: "label",
302
+ fn: m(() => [
303
+ S("span", {
304
+ class: N([e(r).errClass ? "text-[#ff4d4f]" : "", "w-full"])
305
+ }, D(n.label), 3)
306
+ ]),
307
+ key: "0"
308
+ } : void 0
309
+ ]), 1040, ["required", "class"]),
310
+ e(r).msg ? (p(), w("span", Bt, D(e(r).msg), 1)) : C("", !0)
418
311
  ]));
419
312
  }
420
- }), Pt = /* @__PURE__ */ V(ze, [["__scopeId", "data-v-f9b2ac3d"]]), $a = /* @__PURE__ */ k({
421
- __name: "radioStatus",
422
- props: {
423
- /**
424
- * 数据源OPTIONS的key
425
- */
426
- dataKey: {
427
- type: String,
428
- default: "EnableDisable"
429
- },
430
- /**
431
- * 是否显示全部选项
432
- */
433
- all: {
434
- type: Boolean,
435
- required: !1
436
- },
437
- /**
438
- * 自定义全部选项的值
439
- * 如果all为true,则显示全部选项
440
- * 未设置allValue,则默认[0, 1]
441
- */
442
- allValue: {
443
- type: [String, Number, Array],
444
- required: !1
445
- }
446
- },
447
- setup(v) {
448
- const o = v, a = g(JSON.parse(JSON.stringify(ke.getOptions(o.dataKey))));
449
- return o.all === !0 && a.value.unshift({
450
- label: "全部",
451
- value: o.allValue || [0, 1]
452
- }), (t, r) => (p(), h(Pt, { data: a.value }, null, 8, ["data"]));
453
- }
454
- }), Sa = /* @__PURE__ */ k({
313
+ }), ya = /* @__PURE__ */ k({
455
314
  __name: "index",
456
315
  props: {
457
- startDate: {},
458
- endDate: {},
459
- valueFormat: { default: "YYYY-MM-DD" }
316
+ search: {},
317
+ gridCtrl: {}
460
318
  },
461
- emits: ["update:startDate", "update:endDate"],
319
+ emits: ["update:search"],
462
320
  setup(v, { emit: o }) {
463
- const a = v, t = o, r = z(), { errInfo: n } = r, c = pe(() => a.valueFormat), d = pe(() => {
464
- const s = a.startDate, u = a.endDate;
465
- if (!(!s || !u))
466
- try {
467
- const l = _e(s), i = _e(u);
468
- return !l.isValid() || !i.isValid() ? void 0 : [l, i];
469
- } catch {
470
- return;
471
- }
472
- }), f = (s, u) => {
473
- if (!s || !u || u.length !== 2) {
474
- t("update:startDate", null), t("update:endDate", null);
475
- return;
476
- }
477
- t("update:startDate", u[0] || null), t("update:endDate", u[1] || null);
321
+ const a = v, t = o, r = g(0), n = g(0), c = g(0), d = (_) => {
322
+ let x = 0;
323
+ for (let T = 0; T < _.length; T++)
324
+ typeof _[T].type == "object" && x++;
325
+ return x;
326
+ }, f = Oe(), s = () => {
327
+ n.value = 0, c.value = 0, f.default && (n.value = d(f.default({}))), a.gridCtrl.searchBar && f.control && (c.value = d(f.control({}))), r.value = 2 - (n.value + c.value) % 3;
478
328
  };
479
- return (s, u) => {
480
- var l;
481
- return p(), h(e(st), {
482
- class: N([((l = e(n)) == null ? void 0 : l.errClass) === "error" ? ["error", "!border-red-300", "shadow-[0_0_3px_0px_#ff4d4f]"] : "", "w-full"]),
483
- locale: e(de),
484
- "value-format": c.value,
485
- value: d.value,
486
- onChange: f
487
- }, null, 8, ["class", "locale", "value-format", "value"]);
488
- };
489
- }
490
- }), Ta = /* @__PURE__ */ V(Ke, [["__scopeId", "data-v-bf782acb"]]), Ft = /* @__PURE__ */ k({
491
- __name: "index",
492
- props: {
493
- /**
494
- * 选择项数据
495
- */
496
- data: {
497
- type: Array,
498
- required: !0
499
- }
500
- },
501
- emits: ["change"],
502
- setup(v, { emit: o }) {
503
- const a = v, t = g([]), r = o, { editorCtrl: n, errInfo: c } = z(), d = (f) => {
504
- c != null && c.value.errClass && n && R(n), r("change", f);
505
- };
506
- return E(() => {
507
- if (!a.data || a.data.length != 2) {
508
- console.error("Switch组件: ", a.data), xt.error("Switch组件必须有且只有两个选项");
509
- return;
510
- }
511
- be(!1, a, t);
512
- }), he(() => {
513
- Ce(a);
514
- }), (f, s) => {
515
- var u;
516
- return t.value.length === 2 ? (p(), h(e(nt), B({
517
- key: 0,
518
- class: [((u = e(c)) == null ? void 0 : u.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "", "bg-blue-300", "w-[58px]"],
519
- checkedChildren: t.value[0].label,
520
- checkedValue: t.value[0].value,
521
- unCheckedChildren: t.value[1].label,
522
- unCheckedValue: t.value[1].value,
523
- onChange: d
524
- }, f.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) : C("", !0);
525
- };
526
- }
527
- }), Da = /* @__PURE__ */ k({
528
- __name: "index",
529
- setup(v) {
530
- const { editorCtrl: o, labelText: a, errInfo: t } = z(), r = () => {
531
- t != null && t.value.errClass && o && R(o);
532
- };
533
- return (n, c) => {
534
- var d;
535
- return p(), h(e(ut), B({
536
- class: ((d = e(t)) == null ? void 0 : d.errClass) === "error" ? ["error", "!border-red-300", "shadow-[0_0_3px_0px_#ff4d4f]"] : "",
537
- "allow-clear": !0,
538
- placeholder: "请输入" + e(a),
539
- onBlur: r,
540
- onKeyup: c[0] || (c[0] = fe(J(() => {
541
- }, ["stop"]), ["enter", "native"])),
542
- onKeydown: c[1] || (c[1] = fe(J(() => {
543
- }, ["stop"]), ["enter", "native"]))
544
- }, n.$attrs), null, 16, ["class", "placeholder"]);
545
- };
546
- }
547
- }), Mt = /* @__PURE__ */ k({
548
- __name: "index",
549
- props: {
550
- autoload: { type: Boolean },
551
- url: {},
552
- params: {},
553
- value: {}
554
- },
555
- emits: ["change", "update:value"],
556
- setup(v, { emit: o }) {
557
- const a = v, t = g({ ...a.url }), { editorCtrl: r, labelText: n, errInfo: c } = z(), d = o, f = g([]), s = g([]);
558
- a.value && a.value.every((l) => {
559
- s.value.push(l.toString());
560
- }), $(
561
- () => a.value,
562
- (l) => {
563
- l && (s.value = l);
329
+ $(
330
+ () => a.gridCtrl.searchBar,
331
+ () => {
332
+ s();
564
333
  }
565
334
  );
566
- const u = (l) => {
567
- d("update:value", l), d("change", l), s.value = l, c != null && c.value.errClass && r && R(r);
568
- };
569
- return E(async () => {
570
- if (t.value) {
571
- const l = r == null ? void 0 : r.page;
572
- if (t.value.api || (t.value.api = l == null ? void 0 : l.api), t.value.authorize === void 0 && (t.value.authorize = l == null ? void 0 : l.authorize), a.autoload) {
573
- const i = await we(r, {
574
- urlKey: "list",
575
- url: { ...t.value, url: t.value.url },
576
- loadingText: !1,
577
- params: a.params
578
- });
579
- f.value = (i == null ? void 0 : i.data) ?? [];
335
+ const u = JSON.parse(JSON.stringify(a.search));
336
+ z(() => {
337
+ var x;
338
+ s();
339
+ let _ = { ...a.search };
340
+ a.gridCtrl.gridQuery = {
341
+ ...a.gridCtrl.gridQuery,
342
+ Query: {
343
+ ...(x = a.gridCtrl.gridQuery) == null ? void 0 : x.Query,
344
+ ..._
580
345
  }
581
- }
582
- }), (l, i) => {
583
- var _;
584
- return p(), h(e(it), B({
585
- class: ((_ = e(c)) == null ? void 0 : _.errClass) === "error" ? ["error", "!border-red-300", "shadow-[0_0_3px_0px_#ff4d4f]"] : "",
586
- placeholder: "请输入" + e(n),
587
- targetKeys: s.value,
588
- onChange: u
589
- }, l.$attrs), {
590
- children: m(({ direction: x, disabled: T, filteredItems: P, onItemSelectAll: y, onItemSelect: K, selectedKeys: A }) => [
591
- I(l.$slots, "children", {
592
- direction: x,
593
- disabled: T,
594
- filteredItems: P,
595
- onItemSelectAll: y,
596
- onItemSelect: K,
597
- selectedKeys: A
598
- })
346
+ };
347
+ });
348
+ const l = () => {
349
+ var x;
350
+ let _ = { ...a.search };
351
+ a.gridCtrl.gridQuery = {
352
+ ...a.gridCtrl.gridQuery,
353
+ Query: {
354
+ ...(x = a.gridCtrl.gridQuery) == null ? void 0 : x.Query,
355
+ ..._
356
+ }
357
+ }, a.gridCtrl.reload.value = !0;
358
+ }, i = () => {
359
+ const _ = JSON.parse(JSON.stringify(u));
360
+ for (const x in a.search)
361
+ _[x] === void 0 && (_[x] = void 0);
362
+ t("update:search", _);
363
+ };
364
+ return (_, x) => {
365
+ const T = q("submit");
366
+ return n.value + c.value > 0 ? Q((p(), h(e(Pe), {
367
+ key: 0,
368
+ "label-col": { flex: "60px" },
369
+ style: {
370
+ flexWrap: "wrap",
371
+ borderBottom: "1px solid #e9e9e9"
372
+ },
373
+ class: "flex mb-[10px]"
374
+ }, {
375
+ default: m(() => [
376
+ I(_.$slots, "default"),
377
+ _.gridCtrl.searchBar ? I(_.$slots, "control", { key: 0 }) : C("", !0),
378
+ r.value >= 1 ? (p(), h(le, {
379
+ key: 1,
380
+ class: "w-1/3"
381
+ })) : C("", !0),
382
+ r.value >= 2 ? (p(), h(le, {
383
+ key: 2,
384
+ class: "w-1/3"
385
+ })) : C("", !0),
386
+ n.value || _.gridCtrl.searchBar ? (p(), h(le, {
387
+ key: 3,
388
+ class: "w-1/3 flex justify-end text-right pr-5",
389
+ "wrapper-col": { flex: "auto" }
390
+ }, {
391
+ default: m(() => [
392
+ b(e(G), null, {
393
+ default: m(() => [
394
+ b(e(O), {
395
+ type: "primary",
396
+ onClick: l,
397
+ icon: "icon-search"
398
+ }, {
399
+ default: m(() => x[0] || (x[0] = [
400
+ M("搜索")
401
+ ])),
402
+ _: 1,
403
+ __: [0]
404
+ }),
405
+ b(e(O), {
406
+ onClick: i,
407
+ icon: "icon-reset"
408
+ }, {
409
+ default: m(() => x[1] || (x[1] = [
410
+ M("重置")
411
+ ])),
412
+ _: 1,
413
+ __: [1]
414
+ })
415
+ ]),
416
+ _: 1
417
+ })
418
+ ]),
419
+ _: 1
420
+ })) : C("", !0)
599
421
  ]),
600
422
  _: 3
601
- }, 16, ["class", "placeholder", "targetKeys"]);
423
+ })), [
424
+ [T, l]
425
+ ]) : C("", !0);
602
426
  };
603
427
  }
604
- }), Ia = /* @__PURE__ */ k({
605
- __name: "transferTable",
428
+ }), Pt = /* @__PURE__ */ k({
429
+ __name: "tableOperate",
606
430
  props: {
607
- /**
608
- * 是否自动加载
609
- */
610
- autoload: {
611
- type: Boolean,
612
- default: !0
613
- },
614
- /**
615
- * 表格控制器
616
- */
617
- gridCtrl: {
618
- type: Object,
619
- required: !0
620
- },
621
- /**
622
- * 选择结果
623
- */
624
- value: {
625
- type: Array,
626
- default: () => []
627
- }
431
+ record: {},
432
+ gridCtrl: {}
628
433
  },
629
- emits: ["update:value"],
630
- setup(v, { emit: o }) {
631
- const a = v, t = o, r = g(a.autoload), n = g(a.value), c = g(a.gridCtrl.primaryKey);
632
- $(
633
- () => n.value,
634
- (s) => {
635
- t("update:value", s);
636
- }
637
- ), $(
638
- () => a.value,
639
- (s) => {
640
- s && (n.value = s);
641
- }
642
- ), a.gridCtrl.autoload = !1, a.gridCtrl.remotePage = !1, a.gridCtrl.selectable = g(!0), a.gridCtrl.buttons = g([]), a.gridCtrl.tools = [];
643
- const d = ({ disabled: s, selectedKeys: u, onItemSelectAll: l, onItemSelect: i }) => ({
644
- getCheckboxProps: (_) => ({
645
- // 控制是否禁止
646
- disabled: s || _.disabled
647
- }),
648
- onSelectAll(_, x) {
649
- const T = x.filter((P) => !P.disabled).map(({ [c.value]: P }) => P);
650
- l(T, _);
651
- },
652
- onSelect({ [c.value]: _ }, x) {
653
- i(_, x);
434
+ setup(v) {
435
+ const o = v, a = o.gridCtrl, t = [
436
+ {
437
+ key: "Edit",
438
+ label: "编辑",
439
+ type: "primary",
440
+ visible: !0,
441
+ permit: ":edit",
442
+ click: () => Le(a, o.record)
654
443
  },
655
- selectedRowKeys: u
656
- }), f = g([]);
657
- return E(async () => {
658
- if (r.value) {
659
- const s = await we(a.gridCtrl, {
660
- urlKey: "list",
661
- url: { ...a.gridCtrl.gridUrl, url: a.gridCtrl.gridUrl.url },
662
- params: a.gridCtrl.gridQuery,
663
- loadingText: !1
664
- });
665
- f.value = (s == null ? void 0 : s.data) ?? [];
666
- }
667
- }), (s, u) => (p(), h(Mt, B({
668
- "data-source": f.value,
669
- "row-key": (l) => l[c.value],
670
- value: n.value,
671
- "onUpdate:value": u[0] || (u[0] = (l) => n.value = l),
672
- "list-style": {
673
- width: "300px",
674
- height: "500px"
675
- },
676
- "show-select-all": !1,
677
- "show-search": !0,
678
- "filter-option": (l, i) => {
679
- for (const _ of a.gridCtrl.columns.value)
680
- if (i[_.dataIndex].toString().indexOf(l) !== -1)
681
- return !0;
682
- return !1;
444
+ {
445
+ key: "Delete",
446
+ label: "删除",
447
+ type: "primary",
448
+ visible: !0,
449
+ danger: !0,
450
+ permit: ":delete",
451
+ confirm: !0,
452
+ confirmText: "是否删除此记录?",
453
+ click: () => Re(a, o.record)
683
454
  }
684
- }, s.$attrs), {
685
- children: m(({ filteredItems: l, onItemSelectAll: i, onItemSelect: _, selectedKeys: x }) => [
686
- b(e(Pe), {
687
- columns: v.gridCtrl.columns.value,
688
- "row-key": c.value,
689
- "row-selection": d({
690
- disabled: !1,
691
- selectedKeys: x,
692
- onItemSelectAll: i,
693
- onItemSelect: _
694
- }),
695
- bordered: !1,
696
- size: "small",
697
- "data-source": l,
698
- scroll: { x: 300 },
699
- "custom-row": (T) => ({
700
- onClick: () => {
701
- const P = T[c.value];
702
- _(P, !x.includes(P));
703
- }
704
- })
705
- }, null, 8, ["columns", "row-key", "row-selection", "data-source", "custom-row"])
706
- ]),
707
- _: 1
708
- }, 16, ["data-source", "row-key", "value", "filter-option"]));
709
- }
710
- }), Nt = /* @__PURE__ */ k({
711
- __name: "index",
712
- props: {
713
- multiple: {
714
- type: Boolean,
715
- default: !1
716
- },
717
- treeCtrl: {
718
- type: Object,
719
- required: !0
720
- },
721
- value: {
722
- type: [String, Number, Array],
723
- required: !0
724
- }
725
- },
726
- emits: ["change", "update:value"],
727
- setup(v, { emit: o }) {
728
- const a = v, t = a.treeCtrl, r = z(), { errInfo: n, labelText: c } = r, d = o;
729
- r.inputEmit = d;
730
- const f = g([]), s = g();
731
- $(
732
- () => a.value,
733
- (l) => {
734
- s.value = l ?? null;
735
- },
736
- { immediate: !0 }
737
- ), $(
738
- () => t.data.value,
739
- (l) => {
740
- l && (f.value = t.fieldMap ? ee(t.fieldMap, l) : l);
741
- },
742
- { immediate: !0 }
743
- );
744
- const u = (l) => {
745
- a.multiple ? s.value = l ?? [] : s.value = l ?? "", d("change", s.value), d("update:value", s.value);
455
+ ], { buttons: r, menus: n } = ke(t, 0, a.operates), c = (d) => {
456
+ if (typeof d.disabled == "boolean")
457
+ return d.disabled;
458
+ if (typeof d.disabled == "function")
459
+ return j(d, o.record) ?? !1;
460
+ if (o.record.hasOwnProperty("Enabled"))
461
+ switch (d.key) {
462
+ case "Edit":
463
+ return !o.record.Enabled;
464
+ case "Delete":
465
+ return !!o.record.Enabled;
466
+ }
467
+ return !1;
746
468
  };
747
- return E(() => {
748
- t.fieldMap || (t.fieldMap = {
749
- label: "Name",
750
- key: "Id",
751
- value: "Id"
752
- }), t.data.value ? f.value = t.fieldMap ? ee(t.fieldMap, t.data.value) : t.data.value : a.treeCtrl.autoload && $e(a.treeCtrl);
753
- }), (l, i) => {
754
- var _;
755
- return p(), h(e(dt), B({
756
- class: [[(_ = e(n)) == null ? void 0 : _.errClass], "w-full"],
757
- "tree-line": "",
758
- multiple: v.multiple,
759
- "tree-default-expanded-keys": ["-"],
760
- value: s.value,
761
- "onUpdate:value": i[0] || (i[0] = (x) => s.value = x),
762
- "tree-data": f.value,
763
- placeholder: "请选择" + e(c),
764
- "allow-clear": !0,
765
- onChange: u
766
- }, l.$attrs), null, 16, ["class", "multiple", "value", "tree-data", "placeholder"]);
469
+ return (d, f) => {
470
+ const s = q("role"), u = q("permit");
471
+ return p(), h(e(me), { theme: {
472
+ token: {
473
+ fontSize: 13
474
+ }
475
+ } }, {
476
+ default: m(() => [
477
+ b(e(G), null, {
478
+ default: m(() => [
479
+ (p(!0), w(F, null, L(e(r), (l) => (p(), w(F, {
480
+ key: l.key
481
+ }, [
482
+ e(H)(l, o.record) ? (p(), h(e(Ze), {
483
+ key: 0,
484
+ disabled: c(l) || !l.confirm,
485
+ cancelText: "",
486
+ okText: "",
487
+ title: l.confirmText,
488
+ okButtonProps: { size: "small" },
489
+ cancelButtonProps: { size: "small" },
490
+ onConfirm: (i) => e(R)(l, e(a).page, e(a), o.record, !0)
491
+ }, {
492
+ default: m(() => [
493
+ e(H)(l, o.record) ? Q((p(), h(e(Fe), {
494
+ key: l.key,
495
+ type: l.type ?? "text",
496
+ danger: l.danger,
497
+ disabled: c(l),
498
+ onClick: (i) => e(R)(l, e(a).page, e(a), o.record),
499
+ size: "small",
500
+ style: se({
501
+ padding: l.type ?? "0px 4px"
502
+ })
503
+ }, {
504
+ default: m(() => [
505
+ M(D(l.label), 1)
506
+ ]),
507
+ _: 2
508
+ }, 1032, ["type", "danger", "disabled", "onClick", "style"])), [
509
+ [s, l.role],
510
+ [u, l.permit]
511
+ ]) : C("", !0)
512
+ ]),
513
+ _: 2
514
+ }, 1032, ["disabled", "title", "onConfirm"])) : C("", !0)
515
+ ], 64))), 128)),
516
+ d.record.Enabled == 1 ? (p(), h(e(me), {
517
+ key: 0,
518
+ autoInsertSpaceInButton: !1
519
+ }, {
520
+ default: m(() => [
521
+ e(n).length > 0 ? (p(), h(e(et), {
522
+ key: 0,
523
+ size: "small"
524
+ }, {
525
+ overlay: m(() => [
526
+ b(e(ue), null, {
527
+ default: m(() => [
528
+ (p(!0), w(F, null, L(e(n), (l) => (p(), w(F, {
529
+ key: l.key
530
+ }, [
531
+ e(H)(l, o.record) ? Q((p(), h(e(ie), {
532
+ key: 0,
533
+ disabled: c(l),
534
+ onClick: (i) => e(R)(l, e(a).page, e(a), o.record)
535
+ }, {
536
+ default: m(() => [
537
+ M(D(l.label), 1)
538
+ ]),
539
+ _: 2
540
+ }, 1032, ["disabled", "onClick"])), [
541
+ [s, l.role],
542
+ [u, l.permit]
543
+ ]) : C("", !0)
544
+ ], 64))), 128))
545
+ ]),
546
+ _: 1
547
+ })
548
+ ]),
549
+ default: m(() => [
550
+ f[0] || (f[0] = M(" 更多 "))
551
+ ]),
552
+ _: 1,
553
+ __: [0]
554
+ })) : C("", !0)
555
+ ]),
556
+ _: 1
557
+ })) : C("", !0)
558
+ ]),
559
+ _: 1
560
+ })
561
+ ]),
562
+ _: 1
563
+ });
767
564
  };
768
565
  }
769
- }), Ba = /* @__PURE__ */ V(Nt, [["__scopeId", "data-v-64be74cc"]]), Ot = { class: "hover:bg-gray-200 w-[24px] h-[24px] rounded-md" }, Pa = /* @__PURE__ */ k({
770
- __name: "index",
566
+ }), Mt = { class: "inline-flex [&>div]:ml-[-1px] first:[&>div]:ml-0" }, Ft = /* @__PURE__ */ k({
567
+ __name: "icontool",
771
568
  props: {
772
- saveText: {},
773
- saveAsText: {},
774
- cancelText: {},
775
- editorCtrl: {}
569
+ gridCtrl: {}
776
570
  },
777
571
  setup(v) {
778
- const { useToken: o } = Fe, { token: a } = o(), t = g(!1), n = v.editorCtrl;
779
- xe(X.EditorControl, n), $(
780
- () => n.visible.value,
572
+ const o = v, a = o.gridCtrl, { tools: t } = Ue(o.gridCtrl), r = ye();
573
+ $(
574
+ () => a.selectable.value,
781
575
  (d) => {
782
- t.value = d ?? !1;
576
+ Z(t, "tool.export.excel.selected") && (Z(t, "tool.export.excel.selected").disabled = !d), Z(t, "tool.export.pdf.selected") && (Z(t, "tool.export.pdf.selected").disabled = !d);
783
577
  }
784
- ), E(() => {
785
- t.value = n.visible.value ?? !1;
786
- });
578
+ );
579
+ const n = g([]);
580
+ $(
581
+ () => a.columns.value,
582
+ (d) => {
583
+ n.value = we(d, !0);
584
+ },
585
+ { deep: !0, immediate: !0 }
586
+ );
787
587
  const c = () => {
788
- ae(n);
588
+ a.columns.value.splice(0, a.columns.value.length, ...n.value), r.setTableColumns(qe.currentRoute.value.path, a.columns.value);
789
589
  };
790
- return (d, f) => (p(), h(e(ct), {
791
- open: t.value,
792
- "onUpdate:open": f[4] || (f[4] = (s) => t.value = s),
793
- "get-container": !1,
794
- closable: !1,
795
- "header-style": {
796
- height: "40px",
797
- padding: "10px 6px 10px 16px",
798
- backgroundColor: e(a).colorBgLayout
799
- },
800
- "body-style": {
801
- padding: "10px 16px"
802
- },
803
- "footer-style": {
804
- textAlign: "right"
805
- },
806
- style: {
807
- position: "absolute",
808
- boxShadow: "rgba(0, 0, 0, 0.3) -2px 0px 8px"
809
- },
810
- width: "420px",
811
- onClose: c
812
- }, {
813
- extra: m(() => [
814
- S("div", Ot, [
815
- b(e(Y), {
816
- class: "top-[-2px] left-[2px] w-6 h-6",
817
- icon: "icon-new",
818
- angle: 45,
819
- fontsize: "24px",
820
- clickable: "",
821
- color: "#666",
822
- position: [0, 0],
823
- onClick: f[0] || (f[0] = () => e(ae)(e(n)))
824
- })
825
- ])
826
- ]),
827
- default: m(() => [
828
- I(d.$slots, "default")
829
- ]),
830
- footer: m(() => [
831
- b(e(G), null, {
832
- default: m(() => [
833
- d.cancelText !== "" ? (p(), h(e(O), {
834
- key: 0,
835
- onClick: f[1] || (f[1] = () => e(ae)(e(n)))
590
+ return (d, f) => (p(), w("div", Mt, [
591
+ (p(!0), w(F, null, L(e(t), (s, u) => (p(), w(F, {
592
+ key: s.key
593
+ }, [
594
+ e(H)(s) && s.dropdown ? (p(), h(e(re), {
595
+ key: 0,
596
+ placement: "bottomRight",
597
+ class: "p-0 rounded-none"
598
+ }, {
599
+ overlay: m(() => [
600
+ S("div", {
601
+ class: N(["min-w-[100px] bg-white rounded shadow-md p-4", s.dropdownClass])
602
+ }, [
603
+ s.dropdown === "headset" ? (p(), h(e(vt), {
604
+ key: 0,
605
+ modelValue: n.value,
606
+ "onUpdate:modelValue": f[1] || (f[1] = (l) => n.value = l),
607
+ "item-key": "dataIndex",
608
+ onEnd: c,
609
+ handle: ".drag-handle"
610
+ }, {
611
+ default: m(() => [
612
+ (p(!0), w(F, null, L(n.value, (l) => (p(), w("div", {
613
+ key: l.name,
614
+ onClick: f[0] || (f[0] = J(() => {
615
+ }, ["stop"])),
616
+ class: "flex items-center mb-2 last:mb-0 select-none"
617
+ }, [
618
+ f[2] || (f[2] = S("span", { class: "drag-handle mr-2 text-gray-400 hover:text-gray-600 cursor-move" }, "⋮⋮", -1)),
619
+ b(e(tt), {
620
+ checked: l.visible !== !1,
621
+ onChange: J(
622
+ (i) => {
623
+ e(je)(l, i.target.checked);
624
+ },
625
+ ["stop", "prevent"]
626
+ ),
627
+ class: "text-gray-700 hover:text-gray-900 select-none"
628
+ }, {
629
+ default: m(() => [
630
+ M(D(l.title), 1)
631
+ ]),
632
+ _: 2
633
+ }, 1032, ["checked", "onChange"])
634
+ ]))), 128))
635
+ ]),
636
+ _: 1
637
+ }, 8, ["modelValue"])) : C("", !0)
638
+ ], 2)
639
+ ]),
640
+ default: m(() => [
641
+ b(e(O), {
642
+ class: N([
643
+ "px-[8px] py-[2px] relative border-[#ccc] bg-[#fcfcfc] rounded-none text-[#666] hover:z-10",
644
+ u === 0 ? "rounded-l-[5px]" : "",
645
+ u === e(t).length - 1 ? "rounded-r-[5px]" : ""
646
+ ]),
647
+ disabled: e(j)(s),
648
+ tiptext: s.label,
649
+ onClick: (l) => e(R)(s, e(a).page, e(a))
836
650
  }, {
837
651
  default: m(() => [
838
- F(D(d.cancelText ?? "取消"), 1)
652
+ b(e(Y), {
653
+ icon: s.icon,
654
+ class: "w-[18px] h-[18.5px]",
655
+ clickable: ""
656
+ }, null, 8, ["icon"])
839
657
  ]),
840
- _: 1
841
- })) : C("", !0),
842
- d.saveAsText !== "" && e(n).saveAsBtnVisible !== !1 ? (p(), h(e(O), {
843
- key: 1,
844
- onClick: f[2] || (f[2] = () => e(Qe)(e(n))),
845
- type: "primary",
846
- loading: e(n).isFormSaving.value
847
- }, {
658
+ _: 2
659
+ }, 1032, ["class", "disabled", "tiptext", "onClick"])
660
+ ]),
661
+ _: 2
662
+ }, 1024)) : !s.children && e(H)(s) ? (p(), h(e(O), {
663
+ key: 1,
664
+ class: N([
665
+ "px-[8px] py-[2px] relative border-[#ccc] bg-[#fcfcfc] rounded-none text-[#666] hover:z-10",
666
+ u === 0 ? "rounded-l-[5px]" : "",
667
+ u === e(t).length - 1 ? "rounded-r-[5px]" : ""
668
+ ]),
669
+ disabled: e(j)(s),
670
+ tiptext: s.label,
671
+ onClick: (l) => e(R)(s, e(a).page, e(a))
672
+ }, {
673
+ default: m(() => [
674
+ b(e(Y), {
675
+ icon: s.icon,
676
+ class: "w-[18px] h-[18.5px]",
677
+ clickable: ""
678
+ }, null, 8, ["icon"])
679
+ ]),
680
+ _: 2
681
+ }, 1032, ["class", "disabled", "tiptext", "onClick"])) : e(H)(s) ? (p(), h(e(re), {
682
+ key: 2,
683
+ placement: "bottomRight",
684
+ class: "p-0 rounded-none"
685
+ }, {
686
+ overlay: m(() => [
687
+ b(e(ue), null, {
848
688
  default: m(() => [
849
- F(D(d.saveAsText ?? "另存为"), 1)
689
+ (p(!0), w(F, null, L(s.children, (l) => (p(), h(e(ie), {
690
+ key: l.key,
691
+ disabled: e(j)(l)
692
+ }, {
693
+ default: m(() => [
694
+ M(D(l.label), 1)
695
+ ]),
696
+ _: 2
697
+ }, 1032, ["disabled"]))), 128))
850
698
  ]),
851
- _: 1
852
- }, 8, ["loading"])) : C("", !0),
853
- d.saveText !== "" && e(n).saveBtnVisible !== !1 ? (p(), h(e(O), {
854
- key: 2,
855
- onClick: f[3] || (f[3] = () => e(Se)(e(n))),
856
- type: "primary",
857
- loading: e(n).isFormSaving.value
699
+ _: 2
700
+ }, 1024)
701
+ ]),
702
+ default: m(() => [
703
+ b(e(O), {
704
+ class: N([
705
+ "!w-[46px] px-[5px] py-[2px] relative border-[#ccc] bg-[#fcfcfc] rounded-none text-[#666] hover:z-10",
706
+ u === 0 ? "rounded-l-[5px]" : ""
707
+ ]),
708
+ disabled: e(j)(s),
709
+ tiptext: s.label,
710
+ icon: s.icon,
711
+ iconProps: { class: "w-[19px] h-[19px]" },
712
+ onClick: (l) => e(R)(s, e(a).page, e(a))
858
713
  }, {
859
714
  default: m(() => [
860
- F(D(d.saveText ?? "保存"), 1)
715
+ b(e(Y), {
716
+ icon: "icon-down-arrow",
717
+ class: "w-[12px] h-[12px]"
718
+ })
861
719
  ]),
862
- _: 1
863
- }, 8, ["loading"])) : C("", !0)
720
+ _: 2
721
+ }, 1032, ["class", "disabled", "tiptext", "icon", "onClick"])
864
722
  ]),
865
- _: 1
866
- })
867
- ]),
868
- _: 3
869
- }, 8, ["open", "header-style"]));
723
+ _: 2
724
+ }, 1024)) : C("", !0)
725
+ ], 64))), 128))
726
+ ]));
870
727
  }
871
- }), Fa = /* @__PURE__ */ k({
728
+ }), Nt = { class: "flex justify-between mb-[10px]" }, Ot = { key: 1 }, zt = 3, Kt = /* @__PURE__ */ k({
872
729
  __name: "index",
873
730
  props: {
874
- labelWidth: {},
875
- wrapperWidth: {},
731
+ gridCtrl: {},
876
732
  editorCtrl: {}
877
733
  },
878
734
  setup(v) {
879
- const o = v, a = o.editorCtrl ?? ne(X.EditorControl, void 0);
880
- return (t, r) => {
881
- const n = q("submit");
882
- return Q((p(), h(e(Me), {
883
- "label-col": { flex: o.labelWidth ?? "85px" },
884
- "wrapper-col": {
885
- flex: o.wrapperWidth ?? "1"
886
- },
887
- style: {
888
- display: "flex",
889
- flexWrap: "wrap"
890
- }
891
- }, {
892
- default: m(() => [
893
- I(t.$slots, "default")
894
- ]),
895
- _: 3
896
- }, 8, ["label-col", "wrapper-col"])), [
897
- [
735
+ const o = v, a = o.gridCtrl, t = a.page, r = o.editorCtrl, n = [
736
+ {
737
+ key: "New",
738
+ label: "新增",
739
+ type: "primary",
740
+ icon: "icon-new",
741
+ danger: !0,
742
+ permit: ":new",
743
+ // 默认仅受权限码控制
744
+ click: () => Qe(r)
745
+ }
746
+ ], c = g([]), d = g([]);
747
+ return $(
748
+ () => {
749
+ var f;
750
+ return (f = a.buttons) == null ? void 0 : f.value;
751
+ },
752
+ () => {
753
+ var u;
754
+ const { buttons: f, menus: s } = ke(
898
755
  n,
899
- () => {
900
- e(a) && e(Se)(e(a));
901
- }
902
- ]
756
+ a.flat !== void 0 ? a.flat : zt,
757
+ (u = a.buttons) == null ? void 0 : u.value
758
+ );
759
+ c.value.splice(0, c.value.length, ...f), d.value.splice(0, d.value.length, ...s);
760
+ },
761
+ {
762
+ deep: !0,
763
+ immediate: !0
764
+ }
765
+ ), (f, s) => {
766
+ const u = q("role"), l = q("permit");
767
+ return p(), w("div", Nt, [
768
+ b(e(G), null, {
769
+ default: m(() => [
770
+ (p(!0), w(F, null, L(c.value, (i) => Q((p(), h(e(O), {
771
+ key: i.key,
772
+ type: i.type,
773
+ danger: i.danger,
774
+ disabled: e(j)(i),
775
+ icon: i.icon,
776
+ onClick: (_) => e(R)(i, e(t), e(a))
777
+ }, {
778
+ default: m(() => [
779
+ M(D(i.label), 1)
780
+ ]),
781
+ _: 2
782
+ }, 1032, ["type", "danger", "disabled", "icon", "onClick"])), [
783
+ [u, i.role],
784
+ [l, i.permit]
785
+ ])), 128)),
786
+ d.value.length > 0 ? (p(), h(e(re), { key: 0 }, {
787
+ overlay: m(() => [
788
+ b(e(ue), null, {
789
+ default: m(() => [
790
+ (p(!0), w(F, null, L(d.value, (i) => Q((p(), h(e(ie), {
791
+ key: i.key,
792
+ disabled: e(j)(i),
793
+ onClick: (_) => e(R)(i, e(t), e(a))
794
+ }, {
795
+ default: m(() => [
796
+ M(D(i.label), 1)
797
+ ]),
798
+ _: 2
799
+ }, 1032, ["disabled", "onClick"])), [
800
+ [u, i.role],
801
+ [l, i.permit]
802
+ ])), 128))
803
+ ]),
804
+ _: 1
805
+ })
806
+ ]),
807
+ default: m(() => [
808
+ b(e(O), null, {
809
+ default: m(() => s[0] || (s[0] = [
810
+ M(" 更多操作 ")
811
+ ])),
812
+ _: 1,
813
+ __: [0]
814
+ })
815
+ ]),
816
+ _: 1
817
+ })) : C("", !0),
818
+ c.value.length === 0 && d.value.length === 0 ? (p(), w("span", Ot)) : C("", !0)
819
+ ]),
820
+ _: 1
821
+ }),
822
+ b(e(G), { class: "mr-1" }, {
823
+ default: m(() => [
824
+ (p(), h(ze(Ft), { "grid-ctrl": e(a) }, null, 8, ["grid-ctrl"]))
825
+ ]),
826
+ _: 1
827
+ })
903
828
  ]);
904
829
  };
905
830
  }
906
- }), Et = { class: "w-full flex items-center" }, zt = { class: "flex-grow" }, Kt = { class: "w-8 mt-[-2px]" }, At = {
907
- key: 1,
908
- class: "absolute bottom-[3px] left-[85px] text-[12px] text-[#ff4d4fcc] block"
909
- }, Ma = /* @__PURE__ */ k({
910
- inheritAttrs: !1,
911
- __name: "formItem",
831
+ }), At = /* @__PURE__ */ k({
832
+ __name: "index",
912
833
  props: {
913
- label: {},
914
- rule: {},
915
- helper: {},
916
- width: {}
834
+ /**
835
+ * 选择项数据
836
+ */
837
+ data: {
838
+ type: Array,
839
+ required: !0
840
+ }
917
841
  },
918
- setup(v) {
919
- const o = v, a = W(), t = ne(X.EditorControl, void 0), r = Te(o, t), n = g(!1);
920
- return setTimeout(() => {
921
- n.value = !0;
922
- }, 30), (c, d) => {
923
- var f, s, u, l;
924
- return p(), w("div", {
925
- class: N(["w-full relative mb-1", c.width])
926
- }, [
927
- n.value ? (p(), h(e(Ne), B({
928
- key: 0,
929
- required: !!c.rule && ((l = (u = (s = (f = e(t)) == null ? void 0 : f.formRules) == null ? void 0 : s.value) == null ? void 0 : u[c.rule]) == null ? void 0 : l.required),
930
- class: "!w-[95%] relative"
931
- }, e(a), {
932
- class: [c.rule ? "" : "mb-3"]
933
- }), {
934
- label: m(() => [
935
- S("span", {
936
- class: N([e(r).errClass ? "text-[#ff4d4f]" : "", "w-full"])
937
- }, D(c.label), 3)
938
- ]),
939
- default: m(() => [
940
- S("div", Et, [
941
- S("div", zt, [
942
- I(c.$slots, "default")
943
- ]),
944
- S("div", Kt, [
945
- I(c.$slots, "helper", {}, () => [
946
- c.helper ? (p(), h(e(bt), {
947
- key: 0,
948
- text: c.helper
949
- }, null, 8, ["text"])) : C("", !0)
950
- ])
951
- ])
952
- ])
953
- ]),
954
- _: 3
955
- }, 16, ["required", "class"])) : C("", !0),
956
- e(r).errClass ? (p(), w("span", At, D(e(r).msg), 1)) : C("", !0)
957
- ], 2);
842
+ emits: ["change"],
843
+ setup(v, { emit: o }) {
844
+ const a = v, t = g([]), r = o, { editorCtrl: n, errInfo: c } = K(), d = (f) => {
845
+ c != null && c.value.errClass && n && U(n), r("change", f);
846
+ };
847
+ return z(() => {
848
+ if (!a.data || a.data.length != 2) {
849
+ console.error("Switch组件: ", a.data), mt.error("Switch组件必须有且只有两个选项");
850
+ return;
851
+ }
852
+ $e(!1, a, t);
853
+ }), xe(() => {
854
+ Se(a);
855
+ }), (f, s) => {
856
+ var u;
857
+ return t.value.length === 2 ? (p(), h(e(at), B({
858
+ key: 0,
859
+ class: [((u = e(c)) == null ? void 0 : u.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : "", "bg-blue-300", "w-[58px]"],
860
+ checkedChildren: t.value[0].label,
861
+ checkedValue: t.value[0].value,
862
+ unCheckedChildren: t.value[1].label,
863
+ unCheckedValue: t.value[1].value,
864
+ onChange: d
865
+ }, f.$attrs), null, 16, ["class", "checkedChildren", "checkedValue", "unCheckedChildren", "unCheckedValue"])) : C("", !0);
958
866
  };
959
867
  }
960
- }), Yt = { class: "w-1/3 relative mb-1" }, Lt = { class: "flex items-center" }, Ut = { class: "flex-grow pl-1" }, Rt = {
961
- key: 0,
962
- class: "absolute bottom-[3px] left-[85px] text-[12px] text-[#ff4d4fcc] block"
963
- }, le = /* @__PURE__ */ k({
868
+ }), ba = /* @__PURE__ */ k({
964
869
  inheritAttrs: !1,
965
- __name: "searchItem",
870
+ __name: "index",
966
871
  props: {
967
- label: {},
968
- width: {},
969
- rule: {}
872
+ gridCtrl: {},
873
+ primaryKey: {},
874
+ tableData: {},
875
+ rowSelection: {},
876
+ pagination: { type: [Boolean, Object] },
877
+ scroll: {},
878
+ statusDisabled: { type: Function }
970
879
  },
971
880
  setup(v) {
972
- const o = v, a = W(), t = ne(X.EditorControl, void 0), r = Te(o, t);
973
- return (n, c) => (p(), w("div", Yt, [
974
- b(e(Ne), B({
975
- required: n.rule !== void 0,
976
- class: "w-[90%] relative"
977
- }, e(a), {
978
- class: [n.rule ? "" : "mb-3", n.width],
979
- labelCol: { span: 6 }
980
- }), ge({
981
- default: m(() => [
982
- S("div", Lt, [
983
- S("div", Ut, [
984
- I(n.$slots, "default")
985
- ])
986
- ])
987
- ]),
988
- _: 2
989
- }, [
990
- n.label ? {
991
- name: "label",
992
- fn: m(() => [
993
- S("span", {
994
- class: N([e(r).errClass ? "text-[#ff4d4f]" : "", "w-full"])
995
- }, D(n.label), 3)
996
- ]),
997
- key: "0"
998
- } : void 0
999
- ]), 1040, ["required", "class"]),
1000
- e(r).msg ? (p(), w("span", Rt, D(e(r).msg), 1)) : C("", !0)
1001
- ]));
881
+ const o = v, a = W(), t = o.gridCtrl;
882
+ t && (t.pageNo.value = 1, t.total.value = 0, t.pageSize.value = t.pageSize.value);
883
+ const r = g(t.pageSize.value), n = g(t.pageNo.value), c = g([]), d = g({
884
+ total: 0,
885
+ current: 1,
886
+ pageSize: r.value,
887
+ showTotal: (i) => `共 ${i} 条记录`,
888
+ onChange: (i, _) => {
889
+ d.value.current = i, d.value.pageSize = _, r.value = _, n.value = i, t && (t.pageNo.value = i, t.pageSize.value = _, t.remotePage && ve(t));
890
+ },
891
+ ...o.pagination
892
+ });
893
+ $(
894
+ () => t.tableData.value,
895
+ (i) => {
896
+ i && (c.value = i, d.value.total = t.total.value ?? 0);
897
+ },
898
+ { immediate: !0 }
899
+ ), $(
900
+ () => o.tableData,
901
+ (i) => {
902
+ i && (c.value = i, d.value.total = i.length);
903
+ },
904
+ { immediate: !0 }
905
+ );
906
+ const f = g(t.columns.value), s = {
907
+ onChange: (i, _) => {
908
+ t && (t.selectKeys.value = i, t.selectRows.value = _);
909
+ },
910
+ columnWidth: "30px",
911
+ getCheckboxProps: (i) => ({
912
+ disabled: i.Enabled === 0
913
+ }),
914
+ ...o.rowSelection
915
+ }, u = g(s);
916
+ $(
917
+ () => t.selectable.value,
918
+ (i) => {
919
+ t && (u.value = i ? s : void 0);
920
+ },
921
+ { immediate: !0 }
922
+ ), $(
923
+ () => t.columns.value,
924
+ () => {
925
+ f.value = we(t.columns.value);
926
+ },
927
+ { deep: !0, immediate: !0 }
928
+ );
929
+ const l = g(!1);
930
+ return Ke(() => {
931
+ l.value && t && (t.reload.value = !0);
932
+ }), z(async () => {
933
+ he(X.GridControl, t), t.tableData.value ? (c.value = t.tableData.value, t.total.value = c.value.length, d.value.total = t.total.value ?? 0) : t.autoload !== !1 && (t.remotePage ? c.value = (await ve(t)).rows : c.value = await Ve(t)), setTimeout(() => {
934
+ l.value = !0;
935
+ }, 50);
936
+ }), (i, _) => {
937
+ var T, P;
938
+ const x = q("permit");
939
+ return p(), w(F, null, [
940
+ (T = e(t).buttons) != null && T.value.length || (P = e(t).tools) != null && P.length ? (p(), h(Kt, {
941
+ key: 0,
942
+ "grid-ctrl": e(t),
943
+ "editor-ctrl": e(t).editor
944
+ }, null, 8, ["grid-ctrl", "editor-ctrl"])) : C("", !0),
945
+ l.value ? (p(), h(e(Ne), B({
946
+ key: 1,
947
+ class: "w-full",
948
+ "row-key": o.primaryKey ?? e(t).primaryKey ?? "Id",
949
+ "data-source": c.value,
950
+ loading: e(t).isGridLoading.value,
951
+ columns: f.value,
952
+ pagination: d.value,
953
+ "row-selection": u.value,
954
+ scroll: o.scroll || { x: 700, y: 1e3 },
955
+ size: e(t).tableSize.value,
956
+ bordered: ""
957
+ }, e(a)), {
958
+ bodyCell: m((y) => {
959
+ var A, E;
960
+ return [
961
+ I(i.$slots, "bodyCell", {
962
+ column: y == null ? void 0 : y.column,
963
+ record: y == null ? void 0 : y.record
964
+ }),
965
+ e(t) && ((A = y == null ? void 0 : y.column) == null ? void 0 : A.dataIndex) === "enabled" ? Q((p(), h(At, {
966
+ key: 0,
967
+ checked: y.record.Enabled,
968
+ "onUpdate:checked": (ce) => y.record.Enabled = ce,
969
+ disabled: i.statusDisabled ? i.statusDisabled(y.record) : !1,
970
+ data: e(Te).EnableDisable,
971
+ onClick: (ce) => e(He)(e(t), y.record),
972
+ class: N([
973
+ "w-[58px]",
974
+ i.statusDisabled && i.statusDisabled(y.record) ? "cursor-not-allowed disabled" : ""
975
+ ]),
976
+ loading: y == null ? void 0 : y.record.isLoading
977
+ }, null, 8, ["checked", "onUpdate:checked", "disabled", "data", "onClick", "class", "loading"])), [
978
+ [x, ":enabled", "disable"]
979
+ ]) : C("", !0),
980
+ e(t) && ((E = y == null ? void 0 : y.column) == null ? void 0 : E.dataIndex) === "operation" ? I(i.$slots, "operate", {
981
+ key: 1,
982
+ record: y == null ? void 0 : y.record
983
+ }, () => [
984
+ b(Pt, {
985
+ record: y == null ? void 0 : y.record,
986
+ "grid-ctrl": e(t)
987
+ }, null, 8, ["record", "grid-ctrl"])
988
+ ]) : C("", !0)
989
+ ];
990
+ }),
991
+ _: 3
992
+ }, 16, ["row-key", "data-source", "loading", "columns", "pagination", "row-selection", "scroll", "size"])) : C("", !0)
993
+ ], 64);
994
+ };
1002
995
  }
1003
- }), Na = /* @__PURE__ */ k({
996
+ }), Et = { class: "flex items-center gap-1" }, Yt = { class: "text-nowrap" }, Ca = /* @__PURE__ */ k({
1004
997
  __name: "index",
1005
998
  props: {
1006
- search: {},
1007
- gridCtrl: {}
999
+ treeCtrl: {},
1000
+ selectedKeys: {},
1001
+ expandedKeys: {}
1008
1002
  },
1009
- emits: ["update:search"],
1003
+ emits: ["select", "update:selectedKeys"],
1010
1004
  setup(v, { emit: o }) {
1011
- const a = v, t = o, r = g(0), n = g(0), c = g(0), d = (_) => {
1012
- let x = 0;
1013
- for (let T = 0; T < _.length; T++)
1014
- typeof _[T].type == "object" && x++;
1015
- return x;
1016
- }, f = Ae(), s = () => {
1017
- n.value = 0, c.value = 0, f.default && (n.value = d(f.default({}))), a.gridCtrl.searchBar && f.control && (c.value = d(f.control({}))), r.value = 2 - (n.value + c.value) % 3;
1018
- };
1005
+ const a = v, t = W(), r = a.treeCtrl, n = g([]);
1019
1006
  $(
1020
- () => a.gridCtrl.searchBar,
1021
- () => {
1022
- s();
1007
+ () => r.data.value,
1008
+ (u) => {
1009
+ u && (n.value = r.fieldMap ? ee(r.fieldMap, u) : u, s(a.selectedKeys ?? []));
1023
1010
  }
1024
1011
  );
1025
- const u = JSON.parse(JSON.stringify(a.search));
1026
- E(() => {
1027
- var x;
1028
- s();
1029
- let _ = { ...a.search };
1030
- a.gridCtrl.gridQuery = {
1031
- ...a.gridCtrl.gridQuery,
1032
- Query: {
1033
- ...(x = a.gridCtrl.gridQuery) == null ? void 0 : x.Query,
1034
- ..._
1035
- }
1036
- };
1037
- });
1038
- const l = () => {
1039
- var x;
1040
- let _ = { ...a.search };
1041
- a.gridCtrl.gridQuery = {
1042
- ...a.gridCtrl.gridQuery,
1043
- Query: {
1044
- ...(x = a.gridCtrl.gridQuery) == null ? void 0 : x.Query,
1045
- ..._
1046
- }
1047
- }, a.gridCtrl.reload.value = !0;
1048
- }, i = () => {
1049
- const _ = JSON.parse(JSON.stringify(u));
1050
- for (const x in a.search)
1051
- _[x] === void 0 && (_[x] = void 0);
1052
- t("update:search", _);
1012
+ const c = o, d = g([]);
1013
+ $(
1014
+ () => a.selectedKeys,
1015
+ (u) => {
1016
+ u && (d.value = u);
1017
+ },
1018
+ { immediate: !0 }
1019
+ );
1020
+ const f = g(["-"]);
1021
+ $(
1022
+ () => a.expandedKeys,
1023
+ (u) => {
1024
+ u && (f.value = u);
1025
+ },
1026
+ { immediate: !0 }
1027
+ );
1028
+ const s = (u, l) => {
1029
+ u.length === 0 && u.push(...d.value), u.length > 0 && (r.node.value = l == null ? void 0 : l.node.dataRef), d.value = u, c("update:selectedKeys", u), c("select", u, l);
1053
1030
  };
1054
- return (_, x) => {
1055
- const T = q("submit");
1056
- return n.value + c.value > 0 ? Q((p(), h(e(Me), {
1057
- key: 0,
1058
- "label-col": { flex: "60px" },
1059
- style: {
1060
- flexWrap: "wrap",
1061
- borderBottom: "1px solid #e9e9e9"
1062
- },
1063
- class: "flex mb-[10px]"
1064
- }, {
1065
- default: m(() => [
1066
- I(_.$slots, "default"),
1067
- _.gridCtrl.searchBar ? I(_.$slots, "control", { key: 0 }) : C("", !0),
1068
- r.value >= 1 ? (p(), h(le, {
1069
- key: 1,
1070
- class: "w-1/3"
1071
- })) : C("", !0),
1072
- r.value >= 2 ? (p(), h(le, {
1073
- key: 2,
1074
- class: "w-1/3"
1075
- })) : C("", !0),
1076
- n.value || _.gridCtrl.searchBar ? (p(), h(le, {
1077
- key: 3,
1078
- class: "w-1/3 flex justify-end text-right pr-5",
1079
- "wrapper-col": { flex: "auto" }
1080
- }, {
1081
- default: m(() => [
1082
- b(e(G), null, {
1083
- default: m(() => [
1084
- b(e(O), {
1085
- type: "primary",
1086
- onClick: l,
1087
- icon: "icon-search"
1088
- }, {
1089
- default: m(() => x[0] || (x[0] = [
1090
- F("搜索")
1091
- ])),
1092
- _: 1,
1093
- __: [0]
1094
- }),
1095
- b(e(O), {
1096
- onClick: i,
1097
- icon: "icon-reset"
1098
- }, {
1099
- default: m(() => x[1] || (x[1] = [
1100
- F("重置")
1101
- ])),
1102
- _: 1,
1103
- __: [1]
1104
- })
1105
- ]),
1106
- _: 1
1107
- })
1108
- ]),
1109
- _: 1
1110
- })) : C("", !0)
1111
- ]),
1112
- _: 3
1113
- })), [
1114
- [T, l]
1115
- ]) : C("", !0);
1031
+ return z(() => {
1032
+ r.fieldMap || (r.fieldMap = {
1033
+ label: "Name",
1034
+ key: "Id",
1035
+ value: "Id",
1036
+ icon: "Icon"
1037
+ }), r.data.value ? n.value = ee(r.fieldMap, r.data.value) : r.autoload && De(r);
1038
+ }), (u, l) => (p(), h(e(lt), B({
1039
+ class: "w-full",
1040
+ "show-line": !0,
1041
+ "tree-data": n.value,
1042
+ "expanded-keys": f.value,
1043
+ "onUpdate:expandedKeys": l[0] || (l[0] = (i) => f.value = i),
1044
+ "selected-keys": d.value,
1045
+ loading: e(r).isTreeLoading,
1046
+ onSelect: s
1047
+ }, e(t)), {
1048
+ title: m(({ key: i, label: _, icon: x }) => [
1049
+ I(u.$slots, "title", {
1050
+ label: _,
1051
+ key: i,
1052
+ icon: x
1053
+ }, () => [
1054
+ S("div", Et, [
1055
+ b(e(Y), { icon: x }, null, 8, ["icon"]),
1056
+ S("span", Yt, D(_), 1)
1057
+ ])
1058
+ ])
1059
+ ]),
1060
+ _: 3
1061
+ }, 16, ["tree-data", "expanded-keys", "selected-keys", "loading"]));
1062
+ }
1063
+ }), ka = /* @__PURE__ */ V(_t, [["__scopeId", "data-v-1e39ad49"]]), Lt = {
1064
+ key: 0,
1065
+ class: "absolute z-10 mt-[5px] mr-[10px] text-[#999] flex items-center"
1066
+ }, Rt = /* @__PURE__ */ k({
1067
+ inheritAttrs: !1,
1068
+ __name: "index",
1069
+ props: We,
1070
+ emits: ["change", "update:labels", "update:value"],
1071
+ setup(v, { emit: o }) {
1072
+ var _, x, T;
1073
+ const a = v, t = W(), r = g({
1074
+ ...a.url,
1075
+ url: ((_ = a.url) == null ? void 0 : _.url) || "",
1076
+ fieldMap: a.fieldMap || ((x = a.url) == null ? void 0 : x.fieldMap),
1077
+ params: a.params || ((T = a.url) == null ? void 0 : T.params),
1078
+ loadingText: !1
1079
+ }), n = K(), { editorCtrl: c, errInfo: d, labelText: f } = n, s = g(t.placeholder);
1080
+ $(
1081
+ () => r.value.loading,
1082
+ (P) => {
1083
+ P ? s.value = "" : s.value || (s.value = "请选择" + f.value);
1084
+ },
1085
+ { immediate: !0 }
1086
+ );
1087
+ const u = o;
1088
+ n.inputEmit = u;
1089
+ const l = g([]), i = (P, y) => {
1090
+ if (!y || y.length === 0) {
1091
+ u("update:labels", []), u("update:value", []);
1092
+ return;
1093
+ }
1094
+ const A = y.map((E) => E.label);
1095
+ u("update:labels", A), u(
1096
+ "update:value",
1097
+ y.map((E) => E.value)
1098
+ ), d != null && d.value.errClass && c && U(c);
1099
+ };
1100
+ return z(() => {
1101
+ r.value && !r.value.fieldMap && (r.value.fieldMap = {
1102
+ title: "Name",
1103
+ label: "Name",
1104
+ value: "Id",
1105
+ key: "Id"
1106
+ }), $e(a.autoload, a, l, n, r.value, r.value.params);
1107
+ }), xe(() => {
1108
+ Se(a, n);
1109
+ }), (P, y) => {
1110
+ var A;
1111
+ return p(), w("div", null, [
1112
+ l.value.length ? C("", !0) : (p(), w("div", Lt, [
1113
+ b(e(Je), { class: "text-[#555] mx-[5px] !ml-[10px] !w-4 !h-4" }),
1114
+ y[0] || (y[0] = S("span", null, "数据加载中...", -1))
1115
+ ])),
1116
+ b(e(rt), B({
1117
+ options: l.value,
1118
+ class: [(A = e(d)) == null ? void 0 : A.errClass],
1119
+ "allow-clear": !0,
1120
+ placeholder: l.value.length > 0 ? "请选择" + e(f) : "",
1121
+ onChange: i
1122
+ }, e(t)), null, 16, ["options", "class", "placeholder"])
1123
+ ]);
1116
1124
  };
1117
1125
  }
1118
- }), jt = /* @__PURE__ */ k({
1119
- __name: "tableOperate",
1126
+ }), wa = /* @__PURE__ */ V(Rt, [["__scopeId", "data-v-05e57a52"]]), $a = /* @__PURE__ */ V(ht, [["__scopeId", "data-v-dc59fe7f"]]);
1127
+ function te() {
1128
+ return te = Object.assign ? Object.assign.bind() : function(v) {
1129
+ for (var o = 1; o < arguments.length; o++) {
1130
+ var a = arguments[o];
1131
+ for (var t in a) ({}).hasOwnProperty.call(a, t) && (v[t] = a[t]);
1132
+ }
1133
+ return v;
1134
+ }, te.apply(null, arguments);
1135
+ }
1136
+ const Ut = {
1137
+ locale: "zh_CN",
1138
+ today: "今天",
1139
+ now: "此刻",
1140
+ backToToday: "返回今天",
1141
+ ok: "确定",
1142
+ timeSelect: "选择时间",
1143
+ dateSelect: "选择日期",
1144
+ weekSelect: "选择周",
1145
+ clear: "清除",
1146
+ month: "月",
1147
+ year: "年",
1148
+ previousMonth: "上个月 (翻页上键)",
1149
+ nextMonth: "下个月 (翻页下键)",
1150
+ monthSelect: "选择月份",
1151
+ yearSelect: "选择年份",
1152
+ decadeSelect: "选择年代",
1153
+ yearFormat: "YYYY年",
1154
+ dayFormat: "D日",
1155
+ dateFormat: "YYYY年M月D日",
1156
+ dateTimeFormat: "YYYY年M月D日 HH时mm分ss秒",
1157
+ previousYear: "上一年 (Control键加左方向键)",
1158
+ nextYear: "下一年 (Control键加右方向键)",
1159
+ previousDecade: "上一年代",
1160
+ nextDecade: "下一年代",
1161
+ previousCentury: "上一世纪",
1162
+ nextCentury: "下一世纪"
1163
+ }, jt = {
1164
+ placeholder: "请选择时间",
1165
+ rangePlaceholder: ["开始时间", "结束时间"]
1166
+ }, de = {
1167
+ lang: te({
1168
+ placeholder: "请选择日期",
1169
+ yearPlaceholder: "请选择年份",
1170
+ quarterPlaceholder: "请选择季度",
1171
+ monthPlaceholder: "请选择月份",
1172
+ weekPlaceholder: "请选择周",
1173
+ rangePlaceholder: ["开始日期", "结束日期"],
1174
+ rangeYearPlaceholder: ["开始年份", "结束年份"],
1175
+ rangeMonthPlaceholder: ["开始月份", "结束月份"],
1176
+ rangeQuarterPlaceholder: ["开始季度", "结束季度"],
1177
+ rangeWeekPlaceholder: ["开始周", "结束周"]
1178
+ }, Ut),
1179
+ timePickerLocale: te({}, jt)
1180
+ };
1181
+ de.lang.ok = "确定";
1182
+ const Sa = /* @__PURE__ */ k({
1183
+ __name: "index",
1120
1184
  props: {
1121
- record: {},
1122
- gridCtrl: {}
1185
+ valueFormat: {}
1123
1186
  },
1124
1187
  setup(v) {
1125
- const o = v, a = o.gridCtrl, t = [
1126
- {
1127
- key: "Edit",
1128
- label: "编辑",
1129
- type: "primary",
1130
- visible: !0,
1131
- permit: ":edit",
1132
- click: () => Ve(a, o.record)
1133
- },
1134
- {
1135
- key: "Delete",
1136
- label: "删除",
1137
- type: "primary",
1138
- visible: !0,
1139
- danger: !0,
1140
- permit: ":delete",
1141
- confirm: !0,
1142
- confirmText: "是否删除此记录?",
1143
- click: () => He(a, o.record)
1144
- }
1145
- ], { buttons: r, menus: n } = De(t, 0, a.operates), c = (d) => {
1146
- if (typeof d.disabled == "boolean")
1147
- return d.disabled;
1148
- if (typeof d.disabled == "function")
1149
- return j(d, o.record) ?? !1;
1150
- if (o.record.hasOwnProperty("Enabled"))
1151
- switch (d.key) {
1152
- case "Edit":
1153
- return !o.record.Enabled;
1154
- case "Delete":
1155
- return !!o.record.Enabled;
1156
- }
1157
- return !1;
1158
- };
1188
+ const o = v, { editorCtrl: a, labelText: t, errInfo: r } = K(), n = () => {
1189
+ r != null && r.value.errClass && a && U(a);
1190
+ }, c = g(o.valueFormat ?? "YYYY-MM-DD");
1159
1191
  return (d, f) => {
1160
- const s = q("role"), u = q("permit");
1161
- return p(), h(e(me), { theme: {
1162
- token: {
1163
- fontSize: 13
1192
+ var s;
1193
+ return p(), h(e(ot), {
1194
+ class: N([[((s = e(r)) == null ? void 0 : s.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : ""], "w-full"]),
1195
+ placeholder: "请选择" + e(t),
1196
+ locale: e(de),
1197
+ valueFormat: c.value,
1198
+ onBlur: n
1199
+ }, null, 8, ["class", "placeholder", "locale", "valueFormat"]);
1200
+ };
1201
+ }
1202
+ }), qt = /* @__PURE__ */ k({
1203
+ __name: "index",
1204
+ props: {
1205
+ value: {}
1206
+ },
1207
+ emits: ["update:value"],
1208
+ setup(v, { emit: o }) {
1209
+ const { editorCtrl: a, labelText: t, errInfo: r } = K(), n = () => {
1210
+ r != null && r.value.errClass && a && U(a);
1211
+ }, c = v, d = o, f = g(c.value);
1212
+ $(
1213
+ () => c.value,
1214
+ (u) => {
1215
+ f.value = u;
1216
+ },
1217
+ { immediate: !0 }
1218
+ // 立即同步初始值
1219
+ ), $(
1220
+ () => f.value,
1221
+ (u) => {
1222
+ if (f.value === "") {
1223
+ d("update:value", void 0);
1224
+ return;
1164
1225
  }
1165
- } }, {
1166
- default: m(() => [
1167
- b(e(G), null, {
1168
- default: m(() => [
1169
- (p(!0), w(M, null, L(e(r), (l) => (p(), w(M, {
1170
- key: l.key
1171
- }, [
1172
- e(H)(l, o.record) ? (p(), h(e(pt), {
1173
- key: 0,
1174
- disabled: c(l) || !l.confirm,
1175
- cancelText: "否",
1176
- okText: "",
1177
- title: l.confirmText,
1178
- okButtonProps: { size: "small" },
1179
- cancelButtonProps: { size: "small" },
1180
- onConfirm: (i) => e(U)(l, e(a).page, e(a), o.record, !0)
1181
- }, {
1182
- default: m(() => [
1183
- e(H)(l, o.record) ? Q((p(), h(e(Be), {
1184
- key: l.key,
1185
- type: l.type ?? "text",
1186
- danger: l.danger,
1187
- disabled: c(l),
1188
- onClick: (i) => e(U)(l, e(a).page, e(a), o.record),
1189
- size: "small",
1190
- style: se({
1191
- padding: l.type ?? "0px 4px"
1192
- })
1193
- }, {
1194
- default: m(() => [
1195
- F(D(l.label), 1)
1196
- ]),
1197
- _: 2
1198
- }, 1032, ["type", "danger", "disabled", "onClick", "style"])), [
1199
- [s, l.role],
1200
- [u, l.permit]
1201
- ]) : C("", !0)
1202
- ]),
1203
- _: 2
1204
- }, 1032, ["disabled", "title", "onConfirm"])) : C("", !0)
1205
- ], 64))), 128)),
1206
- d.record.Enabled == 1 ? (p(), h(e(me), {
1207
- key: 0,
1208
- autoInsertSpaceInButton: !1
1209
- }, {
1210
- default: m(() => [
1211
- e(n).length > 0 ? (p(), h(e(ft), {
1212
- key: 0,
1213
- size: "small"
1214
- }, {
1215
- overlay: m(() => [
1216
- b(e(ue), null, {
1217
- default: m(() => [
1218
- (p(!0), w(M, null, L(e(n), (l) => (p(), w(M, {
1219
- key: l.key
1220
- }, [
1221
- e(H)(l, o.record) ? Q((p(), h(e(ie), {
1222
- key: 0,
1223
- disabled: c(l),
1224
- onClick: (i) => e(U)(l, e(a).page, e(a), o.record)
1225
- }, {
1226
- default: m(() => [
1227
- F(D(l.label), 1)
1228
- ]),
1229
- _: 2
1230
- }, 1032, ["disabled", "onClick"])), [
1231
- [s, l.role],
1232
- [u, l.permit]
1233
- ]) : C("", !0)
1234
- ], 64))), 128))
1235
- ]),
1236
- _: 1
1237
- })
1238
- ]),
1239
- default: m(() => [
1240
- f[0] || (f[0] = F(" 更多 "))
1241
- ]),
1242
- _: 1,
1243
- __: [0]
1244
- })) : C("", !0)
1245
- ]),
1246
- _: 1
1247
- })) : C("", !0)
1248
- ]),
1249
- _: 1
1250
- })
1251
- ]),
1252
- _: 1
1253
- });
1226
+ d("update:value", u);
1227
+ }
1228
+ );
1229
+ const s = () => {
1230
+ f.value === "" && (f.value = void 0);
1231
+ };
1232
+ return (u, l) => {
1233
+ var i, _;
1234
+ return p(), h(e(oe), B({
1235
+ class: [
1236
+ (i = e(r)) == null ? void 0 : i.errClass,
1237
+ ((_ = e(r)) == null ? void 0 : _.errClass) === "error" && !u.$slots.addonBefore && !u.$slots.addonAfter ? "!border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : ""
1238
+ ],
1239
+ value: f.value,
1240
+ "onUpdate:value": l[0] || (l[0] = (x) => f.value = x),
1241
+ autocomplete: "new-password",
1242
+ "allow-clear": !0,
1243
+ placeholder: "请输入" + e(t),
1244
+ onBlur: n,
1245
+ onChange: s
1246
+ }, u.$attrs), ge({ _: 2 }, [
1247
+ u.$slots.addonBefore ? {
1248
+ name: "addonBefore",
1249
+ fn: m(() => [
1250
+ I(u.$slots, "addonBefore")
1251
+ ]),
1252
+ key: "0"
1253
+ } : void 0,
1254
+ u.$slots.addonAfter ? {
1255
+ name: "addonAfter",
1256
+ fn: m(() => [
1257
+ I(u.$slots, "addonAfter")
1258
+ ]),
1259
+ key: "1"
1260
+ } : void 0
1261
+ ]), 1040, ["class", "value", "placeholder"]);
1254
1262
  };
1255
1263
  }
1256
- }), qt = { class: "inline-flex [&>div]:ml-[-1px] first:[&>div]:ml-0" }, Qt = /* @__PURE__ */ k({
1257
- __name: "icontool",
1264
+ }), Qt = /* @__PURE__ */ k({
1265
+ __name: "inputIcon",
1258
1266
  props: {
1259
- gridCtrl: {}
1267
+ value: {}
1260
1268
  },
1261
- setup(v) {
1262
- const o = v, a = o.gridCtrl, { tools: t } = We(o.gridCtrl), r = ye();
1263
- $(
1264
- () => a.selectable.value,
1265
- (d) => {
1266
- Z(t, "tool.export.excel.selected") && (Z(t, "tool.export.excel.selected").disabled = !d), Z(t, "tool.export.pdf.selected") && (Z(t, "tool.export.pdf.selected").disabled = !d);
1267
- }
1268
- );
1269
- const n = g([]);
1270
- $(
1271
- () => a.columns.value,
1272
- (d) => {
1273
- n.value = Ie(d, !0);
1269
+ emits: ["update:value"],
1270
+ setup(v, { emit: o }) {
1271
+ const a = v, t = o, r = g(void 0);
1272
+ return $(
1273
+ () => a.value,
1274
+ (n) => {
1275
+ r.value = n ?? void 0;
1274
1276
  },
1275
- { deep: !0, immediate: !0 }
1276
- );
1277
+ { immediate: !0 }
1278
+ ), $(
1279
+ () => r.value,
1280
+ (n) => {
1281
+ t("update:value", n);
1282
+ }
1283
+ ), (n, c) => (p(), h(qt, B({
1284
+ class: ["w-[80%]"],
1285
+ value: r.value,
1286
+ "onUpdate:value": c[0] || (c[0] = (d) => r.value = d)
1287
+ }, n.$attrs), {
1288
+ addonBefore: m(() => [
1289
+ b(e(Y), {
1290
+ class: "!w-4 !h-4",
1291
+ icon: r.value
1292
+ }, null, 8, ["icon"])
1293
+ ]),
1294
+ _: 1
1295
+ }, 16, ["value"]));
1296
+ }
1297
+ }), Ta = /* @__PURE__ */ V(Qt, [["__scopeId", "data-v-f7b3ed74"]]), Da = /* @__PURE__ */ k({
1298
+ __name: "inputPassword",
1299
+ setup(v) {
1300
+ const { editorCtrl: o, labelText: a, errInfo: t } = K(), r = () => {
1301
+ t != null && t.value.errClass && o && U(o);
1302
+ };
1303
+ return (n, c) => {
1304
+ var d;
1305
+ return p(), h(e(st), B({
1306
+ class: ((d = e(t)) == null ? void 0 : d.errClass) === "error" ? ["error", "!border-red-300", "shadow-[0_0_3px_0px_#ff4d4f]"] : "",
1307
+ "allow-clear": !0,
1308
+ autocomplete: "new-password",
1309
+ placeholder: "请输入" + e(a),
1310
+ onBlur: r
1311
+ }, n.$attrs), null, 16, ["class", "placeholder"]);
1312
+ };
1313
+ }
1314
+ }), Ia = /* @__PURE__ */ k({
1315
+ __name: "inputNumber",
1316
+ setup(v) {
1317
+ const { editorCtrl: o, labelText: a, errInfo: t } = K(), r = () => {
1318
+ t != null && t.value.errClass && o && U(o);
1319
+ };
1320
+ return (n, c) => {
1321
+ var d;
1322
+ return p(), h(e(nt), B({
1323
+ class: [[((d = e(t)) == null ? void 0 : d.errClass) === "error" ? "error !border-red-300 shadow-[0_0_3px_0px_#ff4d4f]" : ""], "w-[50%]"],
1324
+ onBlur: r,
1325
+ "allow-clear": !1,
1326
+ placeholder: "请输入" + e(a)
1327
+ }, n.$attrs), null, 16, ["class", "placeholder"]);
1328
+ };
1329
+ }
1330
+ }), Vt = { class: "flex flex-col gap-2" }, Ht = { class: "w-[33%]" }, Wt = { class: "w-[64%]" }, Ba = /* @__PURE__ */ k({
1331
+ __name: "index",
1332
+ props: {
1333
+ value: {},
1334
+ labelHolder: {},
1335
+ valueHolder: {}
1336
+ },
1337
+ emits: ["update:value"],
1338
+ setup(v, { emit: o }) {
1339
+ const a = v, t = o, r = g([]);
1340
+ let n = !1;
1277
1341
  const c = () => {
1278
- a.columns.value.splice(0, a.columns.value.length, ...n.value), r.setTableColumns(Ge.currentRoute.value.path, a.columns.value);
1342
+ r.value = Object.entries(a.value).map(([u, l]) => ({
1343
+ id: Date.now() + Math.random(),
1344
+ field: u,
1345
+ value: l
1346
+ }));
1279
1347
  };
1280
- return (d, f) => (p(), w("div", qt, [
1281
- (p(!0), w(M, null, L(e(t), (s, u) => (p(), w(M, {
1282
- key: s.key
1348
+ $(() => a.value, () => {
1349
+ n || c(), n = !1;
1350
+ }, { immediate: !0 });
1351
+ const d = () => {
1352
+ const u = r.value.reduce((l, i) => (i.field && (l[i.field] = i.value), l), {});
1353
+ n = !0, t("update:value", u);
1354
+ }, f = () => {
1355
+ r.value.push({
1356
+ id: Date.now() + Math.random(),
1357
+ field: "",
1358
+ value: ""
1359
+ });
1360
+ }, s = () => {
1361
+ d();
1362
+ };
1363
+ return (u, l) => (p(), w("div", Vt, [
1364
+ (p(!0), w(F, null, L(r.value, (i) => (p(), w("div", {
1365
+ key: i.id,
1366
+ class: "flex items-center gap-2"
1283
1367
  }, [
1284
- e(H)(s) && s.dropdown ? (p(), h(e(oe), {
1285
- key: 0,
1286
- placement: "bottomRight",
1287
- class: "p-0 rounded-none"
1288
- }, {
1289
- overlay: m(() => [
1290
- S("div", {
1291
- class: N(["min-w-[100px] bg-white rounded shadow-md p-4", s.dropdownClass])
1292
- }, [
1293
- s.dropdown === "headset" ? (p(), h(e(gt), {
1294
- key: 0,
1295
- modelValue: n.value,
1296
- "onUpdate:modelValue": f[1] || (f[1] = (l) => n.value = l),
1297
- "item-key": "dataIndex",
1298
- onEnd: c,
1299
- handle: ".drag-handle"
1300
- }, {
1301
- default: m(() => [
1302
- (p(!0), w(M, null, L(n.value, (l) => (p(), w("div", {
1303
- key: l.name,
1304
- onClick: f[0] || (f[0] = J(() => {
1305
- }, ["stop"])),
1306
- class: "flex items-center mb-2 last:mb-0 select-none"
1307
- }, [
1308
- f[2] || (f[2] = S("span", { class: "drag-handle mr-2 text-gray-400 hover:text-gray-600 cursor-move" }, "⋮⋮", -1)),
1309
- b(e(vt), {
1310
- checked: l.visible !== !1,
1311
- onChange: J(
1312
- (i) => {
1313
- e(Je)(l, i.target.checked);
1314
- },
1315
- ["stop", "prevent"]
1316
- ),
1317
- class: "text-gray-700 hover:text-gray-900 select-none"
1318
- }, {
1319
- default: m(() => [
1320
- F(D(l.title), 1)
1321
- ]),
1322
- _: 2
1323
- }, 1032, ["checked", "onChange"])
1324
- ]))), 128))
1325
- ]),
1326
- _: 1
1327
- }, 8, ["modelValue"])) : C("", !0)
1328
- ], 2)
1329
- ]),
1330
- default: m(() => [
1331
- b(e(O), {
1332
- class: N([
1333
- "px-[8px] py-[2px] relative border-[#ccc] bg-[#fcfcfc] rounded-none text-[#666] hover:z-10",
1334
- u === 0 ? "rounded-l-[5px]" : "",
1335
- u === e(t).length - 1 ? "rounded-r-[5px]" : ""
1336
- ]),
1337
- disabled: e(j)(s),
1338
- tiptext: s.label,
1339
- onClick: (l) => e(U)(s, e(a).page, e(a))
1340
- }, {
1341
- default: m(() => [
1342
- b(e(Y), {
1343
- icon: s.icon,
1344
- class: "w-[18px] h-[18.5px]",
1345
- clickable: ""
1346
- }, null, 8, ["icon"])
1347
- ]),
1348
- _: 2
1349
- }, 1032, ["class", "disabled", "tiptext", "onClick"])
1350
- ]),
1351
- _: 2
1352
- }, 1024)) : !s.children && e(H)(s) ? (p(), h(e(O), {
1353
- key: 1,
1354
- class: N([
1355
- "px-[8px] py-[2px] relative border-[#ccc] bg-[#fcfcfc] rounded-none text-[#666] hover:z-10",
1356
- u === 0 ? "rounded-l-[5px]" : "",
1357
- u === e(t).length - 1 ? "rounded-r-[5px]" : ""
1358
- ]),
1359
- disabled: e(j)(s),
1360
- tiptext: s.label,
1361
- onClick: (l) => e(U)(s, e(a).page, e(a))
1362
- }, {
1363
- default: m(() => [
1364
- b(e(Y), {
1365
- icon: s.icon,
1366
- class: "w-[18px] h-[18.5px]",
1367
- clickable: ""
1368
- }, null, 8, ["icon"])
1369
- ]),
1370
- _: 2
1371
- }, 1032, ["class", "disabled", "tiptext", "onClick"])) : e(H)(s) ? (p(), h(e(oe), {
1372
- key: 2,
1373
- placement: "bottomRight",
1374
- class: "p-0 rounded-none"
1375
- }, {
1376
- overlay: m(() => [
1377
- b(e(ue), null, {
1378
- default: m(() => [
1379
- (p(!0), w(M, null, L(s.children, (l) => (p(), h(e(ie), {
1380
- key: l.key,
1381
- disabled: e(j)(l)
1382
- }, {
1383
- default: m(() => [
1384
- F(D(l.label), 1)
1385
- ]),
1386
- _: 2
1387
- }, 1032, ["disabled"]))), 128))
1388
- ]),
1389
- _: 2
1390
- }, 1024)
1391
- ]),
1392
- default: m(() => [
1393
- b(e(O), {
1394
- class: N([
1395
- "!w-[46px] px-[5px] py-[2px] relative border-[#ccc] bg-[#fcfcfc] rounded-none text-[#666] hover:z-10",
1396
- u === 0 ? "rounded-l-[5px]" : ""
1397
- ]),
1398
- disabled: e(j)(s),
1399
- tiptext: s.label,
1400
- icon: s.icon,
1401
- iconProps: { class: "w-[19px] h-[19px]" },
1402
- onClick: (l) => e(U)(s, e(a).page, e(a))
1403
- }, {
1404
- default: m(() => [
1405
- b(e(Y), {
1406
- icon: "icon-down-arrow",
1407
- class: "w-[12px] h-[12px]"
1408
- })
1409
- ]),
1410
- _: 2
1411
- }, 1032, ["class", "disabled", "tiptext", "icon", "onClick"])
1412
- ]),
1413
- _: 2
1414
- }, 1024)) : C("", !0)
1415
- ], 64))), 128))
1368
+ S("div", Ht, [
1369
+ b(e(oe), {
1370
+ value: i.field,
1371
+ "onUpdate:value": (_) => i.field = _,
1372
+ title: i.field,
1373
+ class: "w-full",
1374
+ placeholder: u.labelHolder || "配置名",
1375
+ onInput: s
1376
+ }, null, 8, ["value", "onUpdate:value", "title", "placeholder"])
1377
+ ]),
1378
+ l[0] || (l[0] = S("div", { class: "w-[3%]" }, " = ", -1)),
1379
+ S("div", Wt, [
1380
+ b(e(oe), {
1381
+ value: i.value,
1382
+ "onUpdate:value": (_) => i.value = _,
1383
+ placeholder: u.valueHolder,
1384
+ onInput: s,
1385
+ title: i.value
1386
+ }, null, 8, ["value", "onUpdate:value", "placeholder", "title"])
1387
+ ])
1388
+ ]))), 128)),
1389
+ b(e(Fe), {
1390
+ onClick: f,
1391
+ class: "mt-1 w-[80px] !text-[12px] text-[#666] bg-[#e6f7ff] border-[#b3e0ff] hover:bg-[#b3e0ff] hover:border-[#8abeff]",
1392
+ size: "small"
1393
+ }, {
1394
+ default: m(() => l[1] || (l[1] = [
1395
+ M(" 新增配置行 ")
1396
+ ])),
1397
+ _: 1,
1398
+ __: [1]
1399
+ })
1416
1400
  ]));
1417
1401
  }
1418
- }), Vt = { class: "flex justify-between mb-[10px]" }, Ht = { key: 1 }, Wt = 3, Jt = /* @__PURE__ */ k({
1402
+ }), Jt = /* @__PURE__ */ V(gt, [["__scopeId", "data-v-f9b2ac3d"]]), Pa = /* @__PURE__ */ k({
1403
+ __name: "radioStatus",
1404
+ props: {
1405
+ /**
1406
+ * 数据源OPTIONS的key
1407
+ */
1408
+ dataKey: {
1409
+ type: String,
1410
+ default: "EnableDisable"
1411
+ },
1412
+ /**
1413
+ * 是否显示全部选项
1414
+ */
1415
+ all: {
1416
+ type: Boolean,
1417
+ required: !1
1418
+ },
1419
+ /**
1420
+ * 自定义全部选项的值
1421
+ * 如果all为true,则显示全部选项
1422
+ * 未设置allValue,则默认[0, 1]
1423
+ */
1424
+ allValue: {
1425
+ type: [String, Number, Array],
1426
+ required: !1
1427
+ }
1428
+ },
1429
+ setup(v) {
1430
+ const o = v, a = g(JSON.parse(JSON.stringify(Te.getOptions(o.dataKey))));
1431
+ return o.all === !0 && a.value.unshift({
1432
+ label: "全部",
1433
+ value: o.allValue || [0, 1]
1434
+ }), (t, r) => (p(), h(Jt, { data: a.value }, null, 8, ["data"]));
1435
+ }
1436
+ }), Ma = /* @__PURE__ */ k({
1419
1437
  __name: "index",
1420
1438
  props: {
1421
- gridCtrl: {},
1422
- editorCtrl: {}
1439
+ startDate: {},
1440
+ endDate: {},
1441
+ valueFormat: { default: "YYYY-MM-DD" }
1423
1442
  },
1443
+ emits: ["update:startDate", "update:endDate"],
1444
+ setup(v, { emit: o }) {
1445
+ const a = v, t = o, r = K(), { errInfo: n } = r, c = pe(() => a.valueFormat), d = pe(() => {
1446
+ const s = a.startDate, u = a.endDate;
1447
+ if (!(!s || !u))
1448
+ try {
1449
+ const l = _e(s), i = _e(u);
1450
+ return !l.isValid() || !i.isValid() ? void 0 : [l, i];
1451
+ } catch {
1452
+ return;
1453
+ }
1454
+ }), f = (s, u) => {
1455
+ if (!s || !u || u.length !== 2) {
1456
+ t("update:startDate", null), t("update:endDate", null);
1457
+ return;
1458
+ }
1459
+ t("update:startDate", u[0] || null), t("update:endDate", u[1] || null);
1460
+ };
1461
+ return (s, u) => {
1462
+ var l;
1463
+ return p(), h(e(ut), {
1464
+ class: N([((l = e(n)) == null ? void 0 : l.errClass) === "error" ? ["error", "!border-red-300", "shadow-[0_0_3px_0px_#ff4d4f]"] : "", "w-full"]),
1465
+ locale: e(de),
1466
+ "value-format": c.value,
1467
+ value: d.value,
1468
+ onChange: f
1469
+ }, null, 8, ["class", "locale", "value-format", "value"]);
1470
+ };
1471
+ }
1472
+ }), Fa = /* @__PURE__ */ V(xt, [["__scopeId", "data-v-bf782acb"]]), Na = /* @__PURE__ */ k({
1473
+ __name: "index",
1424
1474
  setup(v) {
1425
- const o = v, a = o.gridCtrl, t = a.page, r = o.editorCtrl, n = [
1426
- {
1427
- key: "New",
1428
- label: "新增",
1429
- type: "primary",
1430
- icon: "icon-new",
1431
- danger: !0,
1432
- permit: ":new",
1433
- // 默认仅受权限码控制
1434
- click: () => Xe(r)
1475
+ const { editorCtrl: o, labelText: a, errInfo: t } = K(), r = () => {
1476
+ t != null && t.value.errClass && o && U(o);
1477
+ };
1478
+ return (n, c) => {
1479
+ var d;
1480
+ return p(), h(e(it), B({
1481
+ class: ((d = e(t)) == null ? void 0 : d.errClass) === "error" ? ["error", "!border-red-300", "shadow-[0_0_3px_0px_#ff4d4f]"] : "",
1482
+ "allow-clear": !0,
1483
+ placeholder: "请输入" + e(a),
1484
+ onBlur: r,
1485
+ onKeyup: c[0] || (c[0] = fe(J(() => {
1486
+ }, ["stop"]), ["enter", "native"])),
1487
+ onKeydown: c[1] || (c[1] = fe(J(() => {
1488
+ }, ["stop"]), ["enter", "native"]))
1489
+ }, n.$attrs), null, 16, ["class", "placeholder"]);
1490
+ };
1491
+ }
1492
+ }), Gt = /* @__PURE__ */ k({
1493
+ __name: "index",
1494
+ props: {
1495
+ autoload: { type: Boolean },
1496
+ url: {},
1497
+ params: {},
1498
+ value: {}
1499
+ },
1500
+ emits: ["change", "update:value"],
1501
+ setup(v, { emit: o }) {
1502
+ const a = v, t = g({ ...a.url }), { editorCtrl: r, labelText: n, errInfo: c } = K(), d = o, f = g([]), s = g([]);
1503
+ a.value && a.value.every((l) => {
1504
+ s.value.push(l.toString());
1505
+ }), $(
1506
+ () => a.value,
1507
+ (l) => {
1508
+ l && (s.value = l);
1435
1509
  }
1436
- ], c = g([]), d = g([]);
1437
- return $(
1438
- () => {
1439
- var f;
1440
- return (f = a.buttons) == null ? void 0 : f.value;
1441
- },
1442
- () => {
1443
- var u;
1444
- const { buttons: f, menus: s } = De(
1445
- n,
1446
- a.flat !== void 0 ? a.flat : Wt,
1447
- (u = a.buttons) == null ? void 0 : u.value
1448
- );
1449
- c.value.splice(0, c.value.length, ...f), d.value.splice(0, d.value.length, ...s);
1450
- },
1451
- {
1452
- deep: !0,
1453
- immediate: !0
1510
+ );
1511
+ const u = (l) => {
1512
+ d("update:value", l), d("change", l), s.value = l, c != null && c.value.errClass && r && U(r);
1513
+ };
1514
+ return z(async () => {
1515
+ if (t.value) {
1516
+ const l = r == null ? void 0 : r.page;
1517
+ if (t.value.api || (t.value.api = l == null ? void 0 : l.api), t.value.authorize === void 0 && (t.value.authorize = l == null ? void 0 : l.authorize), a.autoload) {
1518
+ const i = await Ie(r, {
1519
+ urlKey: "list",
1520
+ url: { ...t.value, url: t.value.url },
1521
+ loadingText: !1,
1522
+ params: a.params
1523
+ });
1524
+ f.value = (i == null ? void 0 : i.data) ?? [];
1525
+ }
1454
1526
  }
1455
- ), (f, s) => {
1456
- const u = q("role"), l = q("permit");
1457
- return p(), w("div", Vt, [
1458
- b(e(G), null, {
1459
- default: m(() => [
1460
- (p(!0), w(M, null, L(c.value, (i) => Q((p(), h(e(O), {
1461
- key: i.key,
1462
- type: i.type,
1463
- danger: i.danger,
1464
- disabled: e(j)(i),
1465
- icon: i.icon,
1466
- onClick: (_) => e(U)(i, e(t), e(a))
1467
- }, {
1468
- default: m(() => [
1469
- F(D(i.label), 1)
1470
- ]),
1471
- _: 2
1472
- }, 1032, ["type", "danger", "disabled", "icon", "onClick"])), [
1473
- [u, i.role],
1474
- [l, i.permit]
1475
- ])), 128)),
1476
- d.value.length > 0 ? (p(), h(e(oe), { key: 0 }, {
1477
- overlay: m(() => [
1478
- b(e(ue), null, {
1479
- default: m(() => [
1480
- (p(!0), w(M, null, L(d.value, (i) => Q((p(), h(e(ie), {
1481
- key: i.key,
1482
- disabled: e(j)(i),
1483
- onClick: (_) => e(U)(i, e(t), e(a))
1484
- }, {
1485
- default: m(() => [
1486
- F(D(i.label), 1)
1487
- ]),
1488
- _: 2
1489
- }, 1032, ["disabled", "onClick"])), [
1490
- [u, i.role],
1491
- [l, i.permit]
1492
- ])), 128))
1493
- ]),
1494
- _: 1
1495
- })
1496
- ]),
1497
- default: m(() => [
1498
- b(e(O), null, {
1499
- default: m(() => s[0] || (s[0] = [
1500
- F(" 更多操作 ")
1501
- ])),
1502
- _: 1,
1503
- __: [0]
1504
- })
1505
- ]),
1506
- _: 1
1507
- })) : C("", !0),
1508
- c.value.length === 0 && d.value.length === 0 ? (p(), w("span", Ht)) : C("", !0)
1509
- ]),
1510
- _: 1
1511
- }),
1512
- b(e(G), { class: "mr-1" }, {
1513
- default: m(() => [
1514
- (p(), h(Ye(Qt), { "grid-ctrl": e(a) }, null, 8, ["grid-ctrl"]))
1515
- ]),
1516
- _: 1
1517
- })
1518
- ]);
1527
+ }), (l, i) => {
1528
+ var _;
1529
+ return p(), h(e(dt), B({
1530
+ class: ((_ = e(c)) == null ? void 0 : _.errClass) === "error" ? ["error", "!border-red-300", "shadow-[0_0_3px_0px_#ff4d4f]"] : "",
1531
+ placeholder: "请输入" + e(n),
1532
+ targetKeys: s.value,
1533
+ onChange: u
1534
+ }, l.$attrs), {
1535
+ children: m(({ direction: x, disabled: T, filteredItems: P, onItemSelectAll: y, onItemSelect: A, selectedKeys: E }) => [
1536
+ I(l.$slots, "children", {
1537
+ direction: x,
1538
+ disabled: T,
1539
+ filteredItems: P,
1540
+ onItemSelectAll: y,
1541
+ onItemSelect: A,
1542
+ selectedKeys: E
1543
+ })
1544
+ ]),
1545
+ _: 3
1546
+ }, 16, ["class", "placeholder", "targetKeys"]);
1519
1547
  };
1520
1548
  }
1521
1549
  }), Oa = /* @__PURE__ */ k({
1522
- inheritAttrs: !1,
1523
- __name: "index",
1550
+ __name: "transferTable",
1524
1551
  props: {
1525
- gridCtrl: {},
1526
- primaryKey: {},
1527
- tableData: {},
1528
- rowSelection: {},
1529
- pagination: { type: [Boolean, Object] },
1530
- scroll: {},
1531
- statusDisabled: { type: Function }
1552
+ /**
1553
+ * 是否自动加载
1554
+ */
1555
+ autoload: {
1556
+ type: Boolean,
1557
+ default: !0
1558
+ },
1559
+ /**
1560
+ * 表格控制器
1561
+ */
1562
+ gridCtrl: {
1563
+ type: Object,
1564
+ required: !0
1565
+ },
1566
+ /**
1567
+ * 选择结果
1568
+ */
1569
+ value: {
1570
+ type: Array,
1571
+ default: () => []
1572
+ }
1532
1573
  },
1533
- setup(v) {
1534
- const o = v, a = W(), t = o.gridCtrl;
1535
- t && (t.pageNo.value = 1, t.total.value = 0, t.pageSize.value = t.pageSize.value);
1536
- const r = g(t.pageSize.value), n = g(t.pageNo.value), c = g([]), d = g({
1537
- total: 0,
1538
- current: 1,
1539
- pageSize: r.value,
1540
- showTotal: (i) => `共 ${i} 条记录`,
1541
- onChange: (i, _) => {
1542
- d.value.current = i, d.value.pageSize = _, r.value = _, n.value = i, t && (t.pageNo.value = i, t.pageSize.value = _, t.remotePage && ve(t));
1543
- },
1544
- ...o.pagination
1545
- });
1574
+ emits: ["update:value"],
1575
+ setup(v, { emit: o }) {
1576
+ const a = v, t = o, r = g(a.autoload), n = g(a.value), c = g(a.gridCtrl.primaryKey);
1546
1577
  $(
1547
- () => t.tableData.value,
1548
- (i) => {
1549
- i && (c.value = i, d.value.total = t.total.value ?? 0);
1550
- },
1551
- { immediate: !0 }
1578
+ () => n.value,
1579
+ (s) => {
1580
+ t("update:value", s);
1581
+ }
1552
1582
  ), $(
1553
- () => o.tableData,
1554
- (i) => {
1555
- i && (c.value = i, d.value.total = i.length);
1556
- },
1557
- { immediate: !0 }
1558
- );
1559
- const f = g(t.columns.value), s = {
1560
- onChange: (i, _) => {
1561
- t && (t.selectKeys.value = i, t.selectRows.value = _);
1562
- },
1563
- columnWidth: "30px",
1564
- getCheckboxProps: (i) => ({
1565
- disabled: i.Enabled === 0
1583
+ () => a.value,
1584
+ (s) => {
1585
+ s && (n.value = s);
1586
+ }
1587
+ ), a.gridCtrl.autoload = !1, a.gridCtrl.remotePage = !1, a.gridCtrl.selectable = g(!0), a.gridCtrl.buttons = g([]), a.gridCtrl.tools = [];
1588
+ const d = ({ disabled: s, selectedKeys: u, onItemSelectAll: l, onItemSelect: i }) => ({
1589
+ getCheckboxProps: (_) => ({
1590
+ // 控制是否禁止
1591
+ disabled: s || _.disabled
1566
1592
  }),
1567
- ...o.rowSelection
1568
- }, u = g(s);
1569
- $(
1570
- () => t.selectable.value,
1571
- (i) => {
1572
- t && (u.value = i ? s : void 0);
1593
+ onSelectAll(_, x) {
1594
+ const T = x.filter((P) => !P.disabled).map(({ [c.value]: P }) => P);
1595
+ l(T, _);
1573
1596
  },
1574
- { immediate: !0 }
1575
- ), $(
1576
- () => t.columns.value,
1577
- () => {
1578
- f.value = Ie(t.columns.value);
1597
+ onSelect({ [c.value]: _ }, x) {
1598
+ i(_, x);
1579
1599
  },
1580
- { deep: !0, immediate: !0 }
1581
- );
1582
- const l = g(!1);
1583
- return Le(() => {
1584
- l.value && t && (t.reload.value = !0);
1585
- }), E(async () => {
1586
- xe(X.GridControl, t), t.tableData.value ? (c.value = t.tableData.value, t.total.value = c.value.length, d.value.total = t.total.value ?? 0) : t.autoload !== !1 && (t.remotePage ? c.value = (await ve(t)).rows : c.value = await Ze(t)), setTimeout(() => {
1587
- l.value = !0;
1588
- }, 50);
1589
- }), (i, _) => {
1590
- var T, P;
1591
- const x = q("permit");
1592
- return p(), w(M, null, [
1593
- (T = e(t).buttons) != null && T.value.length || (P = e(t).tools) != null && P.length ? (p(), h(Jt, {
1594
- key: 0,
1595
- "grid-ctrl": e(t),
1596
- "editor-ctrl": e(t).editor
1597
- }, null, 8, ["grid-ctrl", "editor-ctrl"])) : C("", !0),
1598
- l.value ? (p(), h(e(Pe), B({
1599
- key: 1,
1600
- class: "w-full",
1601
- "row-key": o.primaryKey ?? e(t).primaryKey ?? "Id",
1602
- "data-source": c.value,
1603
- loading: e(t).isGridLoading.value,
1604
- columns: f.value,
1605
- pagination: d.value,
1606
- "row-selection": u.value,
1607
- scroll: o.scroll || { x: 700, y: 1e3 },
1608
- size: e(t).tableSize.value,
1609
- bordered: ""
1610
- }, e(a)), {
1611
- bodyCell: m((y) => {
1612
- var K, A;
1613
- return [
1614
- I(i.$slots, "bodyCell", {
1615
- column: y == null ? void 0 : y.column,
1616
- record: y == null ? void 0 : y.record
1617
- }),
1618
- e(t) && ((K = y == null ? void 0 : y.column) == null ? void 0 : K.dataIndex) === "enabled" ? Q((p(), h(Ft, {
1619
- key: 0,
1620
- checked: y.record.Enabled,
1621
- "onUpdate:checked": (ce) => y.record.Enabled = ce,
1622
- disabled: i.statusDisabled ? i.statusDisabled(y.record) : !1,
1623
- data: e(ke).EnableDisable,
1624
- onClick: (ce) => e(et)(e(t), y.record),
1625
- class: N([
1626
- "w-[58px]",
1627
- i.statusDisabled && i.statusDisabled(y.record) ? "cursor-not-allowed disabled" : ""
1628
- ]),
1629
- loading: y == null ? void 0 : y.record.isLoading
1630
- }, null, 8, ["checked", "onUpdate:checked", "disabled", "data", "onClick", "class", "loading"])), [
1631
- [x, ":enabled", "disable"]
1632
- ]) : C("", !0),
1633
- e(t) && ((A = y == null ? void 0 : y.column) == null ? void 0 : A.dataIndex) === "operation" ? I(i.$slots, "operate", {
1634
- key: 1,
1635
- record: y == null ? void 0 : y.record
1636
- }, () => [
1637
- b(jt, {
1638
- record: y == null ? void 0 : y.record,
1639
- "grid-ctrl": e(t)
1640
- }, null, 8, ["record", "grid-ctrl"])
1641
- ]) : C("", !0)
1642
- ];
1600
+ selectedRowKeys: u
1601
+ }), f = g([]);
1602
+ return z(async () => {
1603
+ if (r.value) {
1604
+ const s = await Ie(a.gridCtrl, {
1605
+ urlKey: "list",
1606
+ url: { ...a.gridCtrl.gridUrl, url: a.gridCtrl.gridUrl.url },
1607
+ params: a.gridCtrl.gridQuery,
1608
+ loadingText: !1
1609
+ });
1610
+ f.value = (s == null ? void 0 : s.data) ?? [];
1611
+ }
1612
+ }), (s, u) => (p(), h(Gt, B({
1613
+ "data-source": f.value,
1614
+ "row-key": (l) => l[c.value],
1615
+ value: n.value,
1616
+ "onUpdate:value": u[0] || (u[0] = (l) => n.value = l),
1617
+ "list-style": {
1618
+ width: "300px",
1619
+ height: "500px"
1620
+ },
1621
+ "show-select-all": !1,
1622
+ "show-search": !0,
1623
+ "filter-option": (l, i) => {
1624
+ for (const _ of a.gridCtrl.columns.value)
1625
+ if (i[_.dataIndex].toString().indexOf(l) !== -1)
1626
+ return !0;
1627
+ return !1;
1628
+ }
1629
+ }, s.$attrs), {
1630
+ children: m(({ filteredItems: l, onItemSelectAll: i, onItemSelect: _, selectedKeys: x }) => [
1631
+ b(e(Ne), {
1632
+ columns: v.gridCtrl.columns.value,
1633
+ "row-key": c.value,
1634
+ "row-selection": d({
1635
+ disabled: !1,
1636
+ selectedKeys: x,
1637
+ onItemSelectAll: i,
1638
+ onItemSelect: _
1643
1639
  }),
1644
- _: 3
1645
- }, 16, ["row-key", "data-source", "loading", "columns", "pagination", "row-selection", "scroll", "size"])) : C("", !0)
1646
- ], 64);
1647
- };
1640
+ bordered: !1,
1641
+ size: "small",
1642
+ "data-source": l,
1643
+ scroll: { x: 300 },
1644
+ "custom-row": (T) => ({
1645
+ onClick: () => {
1646
+ const P = T[c.value];
1647
+ _(P, !x.includes(P));
1648
+ }
1649
+ })
1650
+ }, null, 8, ["columns", "row-key", "row-selection", "data-source", "custom-row"])
1651
+ ]),
1652
+ _: 1
1653
+ }, 16, ["data-source", "row-key", "value", "filter-option"]));
1648
1654
  }
1649
- }), Gt = { class: "flex items-center gap-1" }, Xt = { class: "text-nowrap" }, Ea = /* @__PURE__ */ k({
1655
+ }), Xt = /* @__PURE__ */ k({
1650
1656
  __name: "index",
1651
1657
  props: {
1652
- treeCtrl: {},
1653
- selectedKeys: {},
1654
- expandedKeys: {}
1658
+ multiple: {
1659
+ type: Boolean,
1660
+ default: !1
1661
+ },
1662
+ treeCtrl: {
1663
+ type: Object,
1664
+ required: !0
1665
+ },
1666
+ value: {
1667
+ type: [String, Number, Array],
1668
+ required: !0
1669
+ }
1655
1670
  },
1656
- emits: ["select", "update:selectedKeys"],
1671
+ emits: ["change", "update:value"],
1657
1672
  setup(v, { emit: o }) {
1658
- const a = v, t = W(), r = a.treeCtrl, n = g([]);
1659
- $(
1660
- () => r.data.value,
1661
- (u) => {
1662
- u && (n.value = r.fieldMap ? ee(r.fieldMap, u) : u, s(a.selectedKeys ?? []));
1663
- }
1664
- );
1665
- const c = o, d = g([]);
1673
+ const a = v, t = a.treeCtrl, r = K(), { errInfo: n, labelText: c } = r, d = o;
1674
+ r.inputEmit = d;
1675
+ const f = g([]), s = g();
1666
1676
  $(
1667
- () => a.selectedKeys,
1668
- (u) => {
1669
- u && (d.value = u);
1677
+ () => a.value,
1678
+ (l) => {
1679
+ s.value = l ?? null;
1670
1680
  },
1671
1681
  { immediate: !0 }
1672
- );
1673
- const f = g(["-"]);
1674
- $(
1675
- () => a.expandedKeys,
1676
- (u) => {
1677
- u && (f.value = u);
1682
+ ), $(
1683
+ () => t.data.value,
1684
+ (l) => {
1685
+ l && (f.value = t.fieldMap ? ee(t.fieldMap, l) : l);
1678
1686
  },
1679
1687
  { immediate: !0 }
1680
1688
  );
1681
- const s = (u, l) => {
1682
- u.length === 0 && u.push(...d.value), u.length > 0 && (r.node.value = l == null ? void 0 : l.node.dataRef), d.value = u, c("update:selectedKeys", u), c("select", u, l);
1689
+ const u = (l) => {
1690
+ a.multiple ? s.value = l ?? [] : s.value = l ?? "", d("change", s.value), d("update:value", s.value);
1683
1691
  };
1684
- return E(() => {
1685
- r.fieldMap || (r.fieldMap = {
1692
+ return z(() => {
1693
+ t.fieldMap || (t.fieldMap = {
1686
1694
  label: "Name",
1687
1695
  key: "Id",
1688
- value: "Id",
1689
- icon: "Icon"
1690
- }), r.data.value ? n.value = ee(r.fieldMap, r.data.value) : r.autoload && $e(r);
1691
- }), (u, l) => (p(), h(e(mt), B({
1692
- class: "w-full",
1693
- "show-line": !0,
1694
- "tree-data": n.value,
1695
- "expanded-keys": f.value,
1696
- "onUpdate:expandedKeys": l[0] || (l[0] = (i) => f.value = i),
1697
- "selected-keys": d.value,
1698
- loading: e(r).isTreeLoading,
1699
- onSelect: s
1700
- }, e(t)), {
1701
- title: m(({ key: i, label: _, icon: x }) => [
1702
- I(u.$slots, "title", {
1703
- label: _,
1704
- key: i,
1705
- icon: x
1706
- }, () => [
1707
- S("div", Gt, [
1708
- b(e(Y), { icon: x }, null, 8, ["icon"]),
1709
- S("span", Xt, D(_), 1)
1710
- ])
1711
- ])
1712
- ]),
1713
- _: 3
1714
- }, 16, ["tree-data", "expanded-keys", "selected-keys", "loading"]));
1696
+ value: "Id"
1697
+ }), t.data.value ? f.value = t.fieldMap ? ee(t.fieldMap, t.data.value) : t.data.value : a.treeCtrl.autoload && De(a.treeCtrl);
1698
+ }), (l, i) => {
1699
+ var _;
1700
+ return p(), h(e(ct), B({
1701
+ class: [[(_ = e(n)) == null ? void 0 : _.errClass], "w-full"],
1702
+ "tree-line": "",
1703
+ multiple: v.multiple,
1704
+ "tree-default-expanded-keys": ["-"],
1705
+ value: s.value,
1706
+ "onUpdate:value": i[0] || (i[0] = (x) => s.value = x),
1707
+ "tree-data": f.value,
1708
+ placeholder: "请选择" + e(c),
1709
+ "allow-clear": !0,
1710
+ onChange: u
1711
+ }, l.$attrs), null, 16, ["class", "multiple", "value", "tree-data", "placeholder"]);
1712
+ };
1715
1713
  }
1716
- }), Zt = { class: "relative h-[calc(100vh-80px)] overflow-y-auto" }, ea = { class: "flex w-full h-full min-h-full" }, ta = {
1714
+ }), za = /* @__PURE__ */ V(Xt, [["__scopeId", "data-v-64be74cc"]]), Zt = { class: "relative h-[calc(100vh-80px)] overflow-y-auto" }, ea = { class: "flex w-full h-full min-h-full" }, ta = {
1717
1715
  key: 0,
1718
1716
  class: "w-1/4 pr-4 min-h-full min-w-[170px] max-w-[200px]"
1719
- }, aa = { class: "flex-1 h-full overflow-y-auto" }, za = /* @__PURE__ */ k({
1717
+ }, aa = { class: "flex-1 h-full overflow-y-auto" }, Ka = /* @__PURE__ */ k({
1720
1718
  __name: "index",
1721
1719
  props: {
1722
1720
  left: { type: Boolean }
1723
1721
  },
1724
1722
  setup(v) {
1725
- const { useToken: o } = Fe, { token: a } = o();
1723
+ const { useToken: o } = Be, { token: a } = o();
1726
1724
  return (t, r) => (p(), w("div", Zt, [
1727
- b(e(_t), {
1725
+ b(e(pt), {
1728
1726
  class: "m-[10px] p-[10px] h-[calc(100vh-100px)] !min-h-[calc(100vh-100px)]",
1729
1727
  style: se({
1730
1728
  backgroundColor: e(a).colorBgContainer
@@ -1744,11 +1742,11 @@ const ya = /* @__PURE__ */ k({
1744
1742
  }, 8, ["style"])
1745
1743
  ]));
1746
1744
  }
1747
- }), la = { class: "font-['Courier'] text-[#666]" }, Ka = /* @__PURE__ */ k({
1745
+ }), la = { class: "font-['Courier'] text-[#666]" }, Aa = /* @__PURE__ */ k({
1748
1746
  __name: "index",
1749
1747
  setup(v) {
1750
1748
  const o = g("");
1751
- return E(() => {
1749
+ return z(() => {
1752
1750
  setInterval(() => {
1753
1751
  const a = /* @__PURE__ */ new Date(), t = { month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit" }, r = a.toLocaleString(void 0, t).replace(/\//g, "-").replace(",", "");
1754
1752
  o.value = a.getFullYear() + "-" + r;
@@ -1757,55 +1755,50 @@ const ya = /* @__PURE__ */ k({
1757
1755
  }
1758
1756
  });
1759
1757
  export {
1760
- Ra as AppIcon,
1761
- ha as AutoComplete,
1762
- ja as BasicLayout,
1763
- qa as Breadcrumb,
1758
+ qa as AppIcon,
1759
+ ka as AutoComplete,
1760
+ Qa as Breadcrumb,
1764
1761
  O as Button,
1765
- ga as Cascader,
1766
- xa as Checkbox,
1767
- za as Content,
1768
- ya as DatePicker,
1769
- Ka as Datetime,
1770
- Za as Dialog,
1771
- Pa as Drawer,
1772
- sl as Error403,
1773
- ul as Error404,
1774
- rl as ExcelForm,
1775
- Fa as Form,
1776
- Ma as FormItem,
1762
+ wa as Cascader,
1763
+ $a as Checkbox,
1764
+ Ka as Content,
1765
+ Sa as DatePicker,
1766
+ Aa as Datetime,
1767
+ La as Dialog,
1768
+ ha as Drawer,
1769
+ ga as Form,
1770
+ xa as FormItem,
1777
1771
  ma as Fullscreen,
1778
- Qa as Header,
1779
- Va as HeaderExits,
1772
+ Va as Header,
1773
+ Ha as HeaderExits,
1780
1774
  bt as Helper,
1781
- Ha as Icon,
1782
- Qt as Icontool,
1783
- St as Input,
1784
- ba as InputIcon,
1785
- ka as InputNumber,
1786
- Ca as InputPassword,
1775
+ Wa as Icon,
1776
+ Ft as Icontool,
1777
+ qt as Input,
1778
+ Ta as InputIcon,
1779
+ Ia as InputNumber,
1780
+ Da as InputPassword,
1787
1781
  _a as LayoutIcon,
1788
- Wa as Menu,
1789
- Ja as MenuTabs,
1790
- Ga as ProjectIcon,
1791
- wa as PropEditor,
1792
- Pt as Radio,
1793
- $a as RadioStatus,
1794
- Sa as RangePicker,
1795
- Na as Search,
1782
+ Ja as Menu,
1783
+ Ga as MenuTabs,
1784
+ Xa as ProjectIcon,
1785
+ Ba as PropEditor,
1786
+ Jt as Radio,
1787
+ Pa as RadioStatus,
1788
+ Ma as RangePicker,
1789
+ ya as Search,
1796
1790
  le as SearchItem,
1797
- Ta as Select,
1798
- Ft as Switch,
1799
- Oa as Table,
1800
- jt as TableOperate,
1801
- Da as Textarea,
1791
+ Fa as Select,
1792
+ At as Switch,
1793
+ ba as Table,
1794
+ Pt as TableOperate,
1795
+ Na as Textarea,
1802
1796
  Y as ToolIcon,
1803
- Jt as Toolbar,
1804
- La as Tooltip,
1805
- Mt as Transfer,
1806
- Ia as TransferTable,
1807
- Ea as Tree,
1808
- Ba as TreeSelect,
1809
- tl as UploadForm,
1810
- al as UploadList
1797
+ Kt as Toolbar,
1798
+ Ua as Tooltip,
1799
+ Gt as Transfer,
1800
+ Oa as TransferTable,
1801
+ Ca as Tree,
1802
+ za as TreeSelect,
1803
+ el as UploadList
1811
1804
  };