ling-yun-custom-components 0.0.33 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/SearchBar.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { w as a } from "./chunks/index.bCzIhWFw.js";
2
- import { S as r } from "./chunks/layout.CDiqT-qG.js";
2
+ import { S as r } from "./chunks/layout.9WADm5Lv.js";
3
3
  const s = a(r);
4
4
  export {
5
5
  s as SearchBar,
@@ -1,7 +1,7 @@
1
1
  import { w as h } from "./chunks/index.bCzIhWFw.js";
2
2
  import { ref as P, computed as v, createBlock as x, openBlock as C, withCtx as I, createVNode as D, unref as f, isRef as b } from "vue";
3
3
  import { C as E } from "./chunks/layout.DXw3haOP.js";
4
- import { S as k } from "./chunks/layout.CDiqT-qG.js";
4
+ import { S as k } from "./chunks/layout.9WADm5Lv.js";
5
5
  import { componentType as w, emitsMap as u, codeMap as y, messageSuccess as A, AESCrypto as M } from "ling-yun-methods";
6
6
  import { _ as S } from "./chunks/_plugin-vue_export-helper.CHgC5LLL.js";
7
7
  import './assets/UpdatePasswordDialog.css';const U = () => {
@@ -1 +1 @@
1
- .filter-form[data-v-09890bac]{grid-template-columns:repeat(2,1fr);gap:10px}.filter-preview-form[data-v-09890bac]{display:flex}.filter-preview-form .el-form-item[data-v-09890bac]{width:var(--v21d4c185);margin-right:10px}.search-bar-form[data-v-09890bac]{grid-template-columns:repeat(auto-fit,minmax(var(--v21d4c185),1fr));gap:10px}.search-bar-form.el-form--inline .el-form-item[data-v-09890bac]{margin-right:0;margin-bottom:10px}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-09890bac]{display:flex;padding:0 14px;background:var(--neutral-color-18);border-radius:8px;border:1px solid var(--parting-line)}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-09890bac] .el-form-item__content{justify-content:end}.search-bar-form.el-form--inline.el-form--label-top[data-v-09890bac]{display:grid}.search-bar-item--wide[data-v-09890bac]{grid-column:span 2}.is-collapsed[data-v-fd5ceec9]{max-height:var(--v2e56a75a)}.operation-buttons[data-v-fd5ceec9]{width:var(--v63e17c4e);z-index:1}.h-32[data-v-fd5ceec9]{height:32px}.drawer-header[data-v-fd5ceec9]{display:flex;justify-content:space-between;align-items:center;width:100%}.drawer-header .shrink-button[data-v-fd5ceec9]{margin-left:auto}.border-top[data-v-fd5ceec9]{border-top:1px solid var(--parting-line)}[data-v-fd5ceec9] .el-drawer__body{padding:16px 0;display:flex;flex-direction:column;overflow:hidden}.filter-form-popover[data-v-fd5ceec9]{max-height:400px}[data-v-fd5ceec9] .el-drawer__header{margin-bottom:0;padding:16px 16px 0}
1
+ .filter-form[data-v-6092c6e2]{grid-template-columns:repeat(2,1fr);gap:10px}.filter-preview-form[data-v-6092c6e2]{display:flex}.filter-preview-form .el-form-item[data-v-6092c6e2]{width:var(--v21117ed0);margin-right:10px}.search-bar-form[data-v-6092c6e2]{grid-template-columns:repeat(auto-fit,minmax(var(--v21117ed0),1fr));gap:10px}.search-bar-form.el-form--inline .el-form-item[data-v-6092c6e2]{margin-right:0;margin-bottom:10px}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-6092c6e2]{display:flex;padding:0 14px;background:var(--neutral-color-18);border-radius:8px;border:1px solid var(--parting-line)}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-6092c6e2] .el-form-item__content{justify-content:end}.search-bar-form.el-form--inline.el-form--label-top[data-v-6092c6e2]{display:grid}.search-bar-item--wide[data-v-6092c6e2]{grid-column:span 2}.is-collapsed[data-v-fd5ceec9]{max-height:var(--v2e56a75a)}.operation-buttons[data-v-fd5ceec9]{width:var(--v63e17c4e);z-index:1}.h-32[data-v-fd5ceec9]{height:32px}.drawer-header[data-v-fd5ceec9]{display:flex;justify-content:space-between;align-items:center;width:100%}.drawer-header .shrink-button[data-v-fd5ceec9]{margin-left:auto}.border-top[data-v-fd5ceec9]{border-top:1px solid var(--parting-line)}[data-v-fd5ceec9] .el-drawer__body{padding:16px 0;display:flex;flex-direction:column;overflow:hidden}.filter-form-popover[data-v-fd5ceec9]{max-height:400px}[data-v-fd5ceec9] .el-drawer__header{margin-bottom:0;padding:16px 16px 0}
@@ -1,10 +1,10 @@
1
- import { renderSlot as p, createElementBlock as $, openBlock as r, Fragment as x, renderList as E, createBlock as m, unref as t, withCtx as n, createTextVNode as V, toDisplayString as M, useCssVars as le, defineAsyncComponent as Y, ref as w, computed as U, normalizeClass as N, mergeProps as b, createCommentVNode as O, withKeys as pe, onMounted as ke, watch as be, createElementVNode as g, createVNode as f, createSlots as F, normalizeProps as A, guardReactiveProps as H, normalizeStyle as ge } from "vue";
2
- import { ElButton as z, ElForm as we, ElFormItem as oe, ElInput as Z, ElDatePicker as Ve, ElInputNumber as De, ElSwitch as Ce, ElRadioGroup as $e, ElRadio as Ee, ElCheckboxGroup as Fe, ElCheckbox as Ue, ElAutoResizer as _, ElPopover as xe, ElIcon as ee, ElDrawer as Me } from "element-plus";
3
- import { IconMagnify as Le, IconCheck as Pe, IconUp as Se, IconDown as We, IconShrink as Be } from "color-message-lingyun-vue";
4
- import { operationConfigMap as C, labelPositionMap as I, componentType as h, dateParamsMap as Ie, dateFormat as ae, emitsMap as B } from "ling-yun-methods";
1
+ import { renderSlot as k, createElementBlock as $, openBlock as r, Fragment as x, renderList as E, createBlock as m, unref as t, withCtx as n, createTextVNode as D, toDisplayString as M, useCssVars as le, defineAsyncComponent as Y, ref as V, computed as U, withModifiers as pe, normalizeClass as N, mergeProps as g, createCommentVNode as O, withKeys as ke, onMounted as be, watch as ge, createElementVNode as w, createVNode as f, createSlots as F, normalizeProps as A, guardReactiveProps as H, normalizeStyle as we } from "vue";
2
+ import { ElButton as z, ElForm as Ve, ElFormItem as oe, ElInput as Z, ElDatePicker as De, ElInputNumber as Ce, ElSwitch as $e, ElRadioGroup as Ee, ElRadio as Fe, ElCheckboxGroup as Ue, ElCheckbox as xe, ElAutoResizer as _, ElPopover as Me, ElIcon as ee, ElDrawer as Se } from "element-plus";
3
+ import { IconMagnify as Le, IconCheck as Pe, IconUp as We, IconDown as Be, IconShrink as Ie } from "color-message-lingyun-vue";
4
+ import { operationConfigMap as C, labelPositionMap as I, componentType as p, dateParamsMap as Ne, dateFormat as ae, emitsMap as B } from "ling-yun-methods";
5
5
  import { _ as ne } from "./_plugin-vue_export-helper.CHgC5LLL.js";
6
6
  import { C as te } from "./layout.BKJPyxR8.js";
7
- import '../assets/layout3.css';const Ne = [
7
+ import '../assets/layout3.css';const Oe = [
8
8
  {
9
9
  type: "primary",
10
10
  label: "查询",
@@ -24,11 +24,11 @@ import '../assets/layout3.css';const Ne = [
24
24
  }
25
25
  },
26
26
  emits: ["operation"],
27
- setup(a, { emit: L }) {
28
- const P = L, y = (v) => {
29
- P("operation", v);
27
+ setup(a, { emit: S }) {
28
+ const L = S, y = (v) => {
29
+ L("operation", v);
30
30
  };
31
- return (v, i) => v.$slots.operation ? p(v.$slots, "operation", {
31
+ return (v, i) => v.$slots.operation ? k(v.$slots, "operation", {
32
32
  key: 0,
33
33
  operationList: a.operationList
34
34
  }) : (r(!0), $(x, { key: 1 }, E(a.operationList, (c) => (r(), m(t(z), {
@@ -38,12 +38,12 @@ import '../assets/layout3.css';const Ne = [
38
38
  onClick: (u) => y(c.value)
39
39
  }, {
40
40
  default: n(() => [
41
- V(M(c.label), 1)
41
+ D(M(c.label), 1)
42
42
  ]),
43
43
  _: 2
44
44
  }, 1032, ["type", "icon", "onClick"]))), 128));
45
45
  }
46
- }, Oe = /* @__PURE__ */ Object.assign({
46
+ }, ze = /* @__PURE__ */ Object.assign({
47
47
  name: "FormWrapper"
48
48
  }, {
49
49
  __name: "FormWrapper",
@@ -99,12 +99,12 @@ import '../assets/layout3.css';const Ne = [
99
99
  }
100
100
  },
101
101
  emits: ["change", "enter"],
102
- setup(a, { expose: L }) {
102
+ setup(a, { expose: S }) {
103
103
  le((u) => ({
104
- v21d4c185: a.minWidth + "px"
104
+ v21117ed0: a.minWidth + "px"
105
105
  }));
106
- const P = Y(() => import("./layout.2Mabaug0.js")), y = Y(() => import("./layout.BHroZ9U9.js")), v = a, i = w(null), c = U(() => v.isFilter ? "filter-form" : v.isFilterPreview ? "filter-preview-form" : "search-bar-form");
107
- return L({
106
+ const L = Y(() => import("./layout.2Mabaug0.js")), y = Y(() => import("./layout.BHroZ9U9.js")), v = a, i = V(null), c = U(() => v.isFilter ? "filter-form" : v.isFilterPreview ? "filter-preview-form" : "search-bar-form");
107
+ return S({
108
108
  validate: (u) => i.value ? i.value.validate(u) : Promise.resolve(!0),
109
109
  resetFields: () => {
110
110
  i.value && i.value.resetFields();
@@ -115,7 +115,7 @@ import '../assets/layout3.css';const Ne = [
115
115
  scrollToField: (u) => {
116
116
  i.value && i.value.scrollToField(u);
117
117
  }
118
- }), (u, D) => (r(), m(t(we), {
118
+ }), (u, h) => (r(), m(t(Ve), {
119
119
  ref_key: "formRef",
120
120
  ref: i,
121
121
  model: a.formData,
@@ -126,10 +126,12 @@ import '../assets/layout3.css';const Ne = [
126
126
  class: N({
127
127
  [c.value]: !0,
128
128
  "items-end display-grid": !a.isFilterPreview
129
- })
129
+ }),
130
+ onSubmit: h[0] || (h[0] = pe(() => {
131
+ }, ["prevent", "stop"]))
130
132
  }, {
131
133
  default: n(() => [
132
- (r(!0), $(x, null, E(a.items, (e) => (r(), m(t(oe), b({
134
+ (r(!0), $(x, null, E(a.items, (e) => (r(), m(t(oe), g({
133
135
  key: e.key,
134
136
  label: a.showLabel ? e.label : "",
135
137
  prop: e.key,
@@ -141,19 +143,19 @@ import '../assets/layout3.css';const Ne = [
141
143
  ]
142
144
  }, { ref_for: !0 }, e), {
143
145
  default: n(() => [
144
- p(u.$slots, e.key, {
146
+ k(u.$slots, e.key, {
145
147
  item: e,
146
148
  formData: a.formData
147
149
  }, () => [
148
- e.type === t(h).text ? (r(), m(t(Z), b({
150
+ e.type === t(p).text ? (r(), m(t(Z), g({
149
151
  key: 0,
150
152
  modelValue: a.formData[e.key],
151
153
  "onUpdate:modelValue": (l) => a.formData[e.key] = l
152
154
  }, { ref_for: !0 }, e, {
153
155
  class: "w-full",
154
156
  onChange: (l) => u.$emit("change", e.key, a.formData[e.key]),
155
- onKeyup: pe((l) => u.$emit("enter", e.key, a.formData[e.key]), ["enter"])
156
- }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange", "onKeyup"])) : e.type === t(h).select ? (r(), m(t(P), b({
157
+ onKeyup: ke((l) => u.$emit("enter", e.key, a.formData[e.key]), ["enter"])
158
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange", "onKeyup"])) : e.type === t(p).select ? (r(), m(t(L), g({
157
159
  key: 1,
158
160
  modelValue: a.formData[e.key],
159
161
  "onUpdate:modelValue": (l) => a.formData[e.key] = l,
@@ -161,72 +163,72 @@ import '../assets/layout3.css';const Ne = [
161
163
  }, { ref_for: !0 }, e, {
162
164
  onChange: (l) => u.$emit("change", e.key, a.formData[e.key]),
163
165
  class: "w-full"
164
- }), null, 16, ["modelValue", "onUpdate:modelValue", "static-options", "onChange"])) : e.type === t(h).date ? (r(), m(t(Ve), b({
166
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "static-options", "onChange"])) : e.type === t(p).date ? (r(), m(t(De), g({
165
167
  key: 2,
166
168
  modelValue: a.formData[e.key],
167
169
  "onUpdate:modelValue": (l) => a.formData[e.key] = l
168
170
  }, { ref_for: !0 }, {
169
171
  ...e,
170
- ...t(Ie)[e.dateType]
172
+ ...t(Ne)[e.dateType]
171
173
  }, {
172
174
  type: e.dateType,
173
175
  format: e.format || t(ae).date,
174
176
  "value-format": e.valueFormat || t(ae).dateTime,
175
177
  class: "w-full",
176
178
  onChange: (l) => u.$emit("change", e.key, a.formData[e.key])
177
- }), null, 16, ["modelValue", "onUpdate:modelValue", "type", "format", "value-format", "onChange"])) : e.type === t(h).inputNumber ? (r(), m(t(De), b({
179
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "type", "format", "value-format", "onChange"])) : e.type === t(p).inputNumber ? (r(), m(t(Ce), g({
178
180
  key: 3,
179
181
  modelValue: a.formData[e.key],
180
182
  "onUpdate:modelValue": (l) => a.formData[e.key] = l
181
183
  }, { ref_for: !0 }, e, {
182
184
  class: "w-full",
183
185
  onChange: (l) => u.$emit("change", e.key, a.formData[e.key])
184
- }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).switch ? (r(), m(t(Ce), b({
186
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(p).switch ? (r(), m(t($e), g({
185
187
  key: 4,
186
188
  modelValue: a.formData[e.key],
187
189
  "onUpdate:modelValue": (l) => a.formData[e.key] = l
188
190
  }, { ref_for: !0 }, e, {
189
191
  onChange: (l) => u.$emit("change", e.key, a.formData[e.key])
190
- }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).radio ? (r(), m(t($e), {
192
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(p).radio ? (r(), m(t(Ee), {
191
193
  key: 5,
192
194
  modelValue: a.formData[e.key],
193
195
  "onUpdate:modelValue": (l) => a.formData[e.key] = l,
194
196
  onChange: (l) => u.$emit("change", e.key, a.formData[e.key])
195
197
  }, {
196
198
  default: n(() => [
197
- (r(!0), $(x, null, E(e.options, (l) => (r(), m(t(Ee), {
199
+ (r(!0), $(x, null, E(e.options, (l) => (r(), m(t(Fe), {
198
200
  key: l.value,
199
201
  label: l.value,
200
202
  value: l.value,
201
203
  disabled: l.disabled
202
204
  }, {
203
205
  default: n(() => [
204
- V(M(l.label), 1)
206
+ D(M(l.label), 1)
205
207
  ]),
206
208
  _: 2
207
209
  }, 1032, ["label", "value", "disabled"]))), 128))
208
210
  ]),
209
211
  _: 2
210
- }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).checkbox ? (r(), m(t(Fe), {
212
+ }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(p).checkbox ? (r(), m(t(Ue), {
211
213
  key: 6,
212
214
  modelValue: a.formData[e.key],
213
215
  "onUpdate:modelValue": (l) => a.formData[e.key] = l,
214
216
  onChange: (l) => u.$emit("change", e.key, a.formData[e.key])
215
217
  }, {
216
218
  default: n(() => [
217
- (r(!0), $(x, null, E(e.options, (l) => (r(), m(t(Ue), {
219
+ (r(!0), $(x, null, E(e.options, (l) => (r(), m(t(xe), {
218
220
  key: l.value,
219
221
  label: l.value,
220
222
  value: l.value
221
223
  }, {
222
224
  default: n(() => [
223
- V(M(l.label), 1)
225
+ D(M(l.label), 1)
224
226
  ]),
225
227
  _: 2
226
228
  }, 1032, ["label", "value"]))), 128))
227
229
  ]),
228
230
  _: 2
229
- }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).textarea ? (r(), m(t(Z), b({
231
+ }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(p).textarea ? (r(), m(t(Z), g({
230
232
  key: 7,
231
233
  modelValue: a.formData[e.key],
232
234
  "onUpdate:modelValue": (l) => a.formData[e.key] = l
@@ -234,7 +236,7 @@ import '../assets/layout3.css';const Ne = [
234
236
  class: "w-full",
235
237
  type: "textarea",
236
238
  onChange: (l) => u.$emit("change", e.key, a.formData[e.key])
237
- }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).upload ? (r(), m(t(y), b({
239
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(p).upload ? (r(), m(t(y), g({
238
240
  key: 8,
239
241
  modelValue: a.formData[e.key],
240
242
  "onUpdate:modelValue": (l) => a.formData[e.key] = l
@@ -243,12 +245,12 @@ import '../assets/layout3.css';const Ne = [
243
245
  ]),
244
246
  _: 2
245
247
  }, 1040, ["label", "prop", "show-label", "class"]))), 128)),
246
- p(u.$slots, "default", {}, void 0, !0)
248
+ k(u.$slots, "default", {}, void 0, !0)
247
249
  ]),
248
250
  _: 3
249
251
  }, 8, ["model", "label-width", "label-position", "inline", "rules", "class"]));
250
252
  }
251
- }), q = /* @__PURE__ */ ne(Oe, [["__scopeId", "data-v-09890bac"]]), ze = { class: "h-32 w-full" }, Re = { class: "flex items-center justify-between pd-b-20" }, Te = { class: "text-right" }, je = { class: "drawer-header" }, Ae = { class: "flex-1 pd-l-16 pd-r-16 overflow-y-auto" }, He = { class: "text-right border-top pd-t-16 pd-l-16 pd-r-16" }, Ke = /* @__PURE__ */ Object.assign({
253
+ }), q = /* @__PURE__ */ ne(ze, [["__scopeId", "data-v-6092c6e2"]]), Re = { class: "h-32 w-full" }, Te = { class: "flex items-center justify-between pd-b-20" }, je = { class: "text-right" }, Ae = { class: "drawer-header" }, He = { class: "flex-1 pd-l-16 pd-r-16 overflow-y-auto" }, Ke = { class: "text-right border-top pd-t-16 pd-l-16 pd-r-16" }, qe = /* @__PURE__ */ Object.assign({
252
254
  name: "SearchBar"
253
255
  }, {
254
256
  __name: "layout",
@@ -291,7 +293,7 @@ import '../assets/layout3.css';const Ne = [
291
293
  },
292
294
  operationList: {
293
295
  type: Array,
294
- default: Ne
296
+ default: Oe
295
297
  },
296
298
  // 是否为筛选器模式
297
299
  filterMode: {
@@ -300,12 +302,12 @@ import '../assets/layout3.css';const Ne = [
300
302
  }
301
303
  },
302
304
  emits: [B.updateModelValue, B.operation],
303
- setup(a, { expose: L, emit: P }) {
305
+ setup(a, { expose: S, emit: L }) {
304
306
  le((o) => ({
305
307
  v2e56a75a: a.maxHeight + "px",
306
308
  v63e17c4e: j.value ? j.value + "px" : "100%"
307
309
  }));
308
- const y = a, v = P, i = w({}), c = w(!y.isExpand), u = w(null), D = w(!1), e = w(!1), l = U(() => {
310
+ const y = a, v = L, i = V({}), c = V(!y.isExpand), u = V(null), h = V(!1), e = V(!1), l = U(() => {
309
311
  const o = {};
310
312
  return y.items.forEach((s) => {
311
313
  if (s.required) {
@@ -313,7 +315,7 @@ import '../assets/layout3.css';const Ne = [
313
315
  typeof s.validator == "function" && d.push({ validator: s.validator, trigger: "blur" }), o[s.key] = d;
314
316
  }
315
317
  }), o;
316
- }), R = U(() => y.items?.filter((o) => !o.hidden) || []), G = U(() => y.filterMode ? R.value?.slice(0, 2) || [] : R.value), S = U(() => y.filterMode ? R.value.slice(2) : []), J = (o) => {
318
+ }), R = U(() => y.items?.filter((o) => !o.hidden) || []), G = U(() => y.filterMode ? R.value?.slice(0, 2) || [] : R.value), P = U(() => y.filterMode ? R.value.slice(2) : []), J = (o) => {
317
319
  i.value = { ...o };
318
320
  }, ue = () => {
319
321
  v(B.updateModelValue, { ...i.value });
@@ -322,27 +324,27 @@ import '../assets/layout3.css';const Ne = [
322
324
  }, de = () => i.value, T = (o, s) => {
323
325
  v(B.operation, C.search, i.value);
324
326
  }, W = (o) => {
325
- ue(), v(B.operation, o, i.value), (o === C.search || o === C.reset) && (D.value = !1, e.value = !1);
326
- }, se = (o) => u.value.validate(o), j = w(0), fe = (o) => {
327
+ ue(), v(B.operation, o, i.value), (o === C.search || o === C.reset) && (h.value = !1, e.value = !1);
328
+ }, se = (o) => u.value.validate(o), j = V(0), fe = (o) => {
327
329
  j.value = o + 32;
328
330
  }, me = () => {
329
331
  c.value = !c.value;
330
332
  }, ce = () => {
331
- D.value = !1, e.value = !0;
333
+ h.value = !1, e.value = !0;
332
334
  }, ye = () => {
333
- e.value = !1, D.value = !0;
334
- }, Q = w(!1), X = (o) => {
335
+ e.value = !1, h.value = !0;
336
+ }, Q = V(!1), X = (o) => {
335
337
  Q.value = o > y.maxHeight;
336
338
  }, ve = U(() => y.filterMode || c.value ? "10px" : "0");
337
- return ke(() => {
339
+ return be(() => {
338
340
  J(y.modelValue), X();
339
- }), be(
341
+ }), ge(
340
342
  () => y.modelValue,
341
343
  (o) => {
342
344
  J(o);
343
345
  },
344
346
  { immediate: !0, deep: !0 }
345
- ), L({
347
+ ), S({
346
348
  validate: se,
347
349
  getFormData: de,
348
350
  // clearValidate,
@@ -352,14 +354,14 @@ import '../assets/layout3.css';const Ne = [
352
354
  }), (o, s) => (r(), $("div", {
353
355
  class: N(["relative overflow-hidden w-full", { flex: a.filterMode }])
354
356
  }, [
355
- g("div", {
357
+ w("div", {
356
358
  class: N({
357
359
  "is-collapsed overflow-hidden": !c.value
358
360
  })
359
361
  }, [
360
362
  f(t(_), null, {
361
363
  default: n(({ height: d }) => [
362
- V(M(X(d)) + " ", 1),
364
+ D(M(X(d)) + " ", 1),
363
365
  f(q, {
364
366
  ref_key: "formRef",
365
367
  ref: u,
@@ -378,10 +380,10 @@ import '../assets/layout3.css';const Ne = [
378
380
  default: n(() => [
379
381
  a.isExpand && !a.filterMode ? (r(), m(t(oe), { key: 0 }, {
380
382
  default: n(() => [
381
- g("div", ze, [
383
+ w("div", Re, [
382
384
  f(t(_), null, {
383
- default: n(({ width: k }) => [
384
- V(M(fe(k)), 1)
385
+ default: n(({ width: b }) => [
386
+ D(M(fe(b)), 1)
385
387
  ]),
386
388
  _: 1
387
389
  })
@@ -392,10 +394,10 @@ import '../assets/layout3.css';const Ne = [
392
394
  ]),
393
395
  _: 2
394
396
  }, [
395
- E(G.value, (k) => ({
396
- name: k.key,
397
+ E(G.value, (b) => ({
398
+ name: b.key,
397
399
  fn: n((he) => [
398
- p(o.$slots, k.key, A(H(he)), void 0, !0)
400
+ k(o.$slots, b.key, A(H(he)), void 0, !0)
399
401
  ])
400
402
  }))
401
403
  ]), 1032, ["items", "form-data", "rules", "label-width", "label-position", "show-label", "min-width", "is-filter-preview"])
@@ -403,12 +405,12 @@ import '../assets/layout3.css';const Ne = [
403
405
  _: 3
404
406
  })
405
407
  ], 2),
406
- g("div", {
408
+ w("div", {
407
409
  class: N(["operation-buttons", {
408
410
  "absolute right-0 bg-fff text-right": a.isExpand && !a.filterMode,
409
411
  "text-left": a.filterMode
410
412
  }]),
411
- style: ge({ bottom: ve.value })
413
+ style: we({ bottom: ve.value })
412
414
  }, [
413
415
  a.filterMode ? (r(), $(x, { key: 0 }, [
414
416
  f(t(z), {
@@ -416,31 +418,31 @@ import '../assets/layout3.css';const Ne = [
416
418
  type: "default"
417
419
  }, {
418
420
  default: n(() => [...s[3] || (s[3] = [
419
- V("重置", -1)
421
+ D("重置", -1)
420
422
  ])]),
421
423
  _: 1
422
424
  }),
423
- S.value?.length ? (r(), m(t(xe), {
425
+ P.value?.length ? (r(), m(t(Me), {
424
426
  key: 0,
425
- visible: D.value,
427
+ visible: h.value,
426
428
  placement: "bottom-start",
427
429
  width: 628,
428
430
  trigger: "click"
429
431
  }, {
430
432
  reference: n(() => [
431
433
  f(t(z), {
432
- onClick: s[1] || (s[1] = (d) => D.value = !D.value),
434
+ onClick: s[1] || (s[1] = (d) => h.value = !h.value),
433
435
  icon: t(Pe),
434
436
  type: "default"
435
437
  }, {
436
438
  default: n(() => [...s[4] || (s[4] = [
437
- V(" 筛选器 ", -1)
439
+ D(" 筛选器 ", -1)
438
440
  ])]),
439
441
  _: 1
440
442
  }, 8, ["icon"])
441
443
  ]),
442
444
  default: n(() => [
443
- g("div", Re, [
445
+ w("div", Te, [
444
446
  f(te, {
445
447
  content: "筛选器",
446
448
  fontSize: 16
@@ -456,7 +458,7 @@ import '../assets/layout3.css';const Ne = [
456
458
  })
457
459
  ]),
458
460
  f(q, {
459
- items: S.value,
461
+ items: P.value,
460
462
  "form-data": i.value,
461
463
  "label-width": "auto",
462
464
  "label-position": "top",
@@ -467,14 +469,14 @@ import '../assets/layout3.css';const Ne = [
467
469
  class: "filter-form-popover overflow-y-auto",
468
470
  onEnter: T
469
471
  }, F({ _: 2 }, [
470
- E(S.value, (d) => ({
472
+ E(P.value, (d) => ({
471
473
  name: d.key,
472
- fn: n((k) => [
473
- p(o.$slots, d.key, A(H(k)), void 0, !0)
474
+ fn: n((b) => [
475
+ k(o.$slots, d.key, A(H(b)), void 0, !0)
474
476
  ])
475
477
  }))
476
478
  ]), 1032, ["items", "form-data", "min-width"]),
477
- g("div", Te, [
479
+ w("div", je, [
478
480
  f(K, {
479
481
  "operation-list": a.operationList,
480
482
  onOperation: W
@@ -482,7 +484,7 @@ import '../assets/layout3.css';const Ne = [
482
484
  o.$slots.operation ? {
483
485
  name: "operation",
484
486
  fn: n(({ operationList: d }) => [
485
- p(o.$slots, "operation", { operationList: d }, void 0, !0)
487
+ k(o.$slots, "operation", { operationList: d }, void 0, !0)
486
488
  ]),
487
489
  key: "0"
488
490
  } : void 0
@@ -494,12 +496,12 @@ import '../assets/layout3.css';const Ne = [
494
496
  ], 64)) : (r(), $(x, { key: 1 }, [
495
497
  Q.value && a.isExpand ? (r(), m(t(z), {
496
498
  key: 0,
497
- icon: c.value ? t(Se) : t(We),
499
+ icon: c.value ? t(We) : t(Be),
498
500
  text: "",
499
501
  onClick: me
500
502
  }, {
501
503
  default: n(() => [
502
- V(M(c.value ? "收起" : "展开"), 1)
504
+ D(M(c.value ? "收起" : "展开"), 1)
503
505
  ]),
504
506
  _: 1
505
507
  }, 8, ["icon"])) : O("", !0),
@@ -510,21 +512,21 @@ import '../assets/layout3.css';const Ne = [
510
512
  o.$slots.operation ? {
511
513
  name: "operation",
512
514
  fn: n(({ operationList: d }) => [
513
- p(o.$slots, "operation", { operationList: d }, void 0, !0)
515
+ k(o.$slots, "operation", { operationList: d }, void 0, !0)
514
516
  ]),
515
517
  key: "0"
516
518
  } : void 0
517
519
  ]), 1032, ["operation-list"])
518
520
  ], 64))
519
521
  ], 6),
520
- f(t(Me), {
522
+ f(t(Se), {
521
523
  modelValue: e.value,
522
524
  "onUpdate:modelValue": s[2] || (s[2] = (d) => e.value = d),
523
525
  size: "628",
524
526
  "show-close": !1
525
527
  }, {
526
528
  header: n(() => [
527
- g("div", je, [
529
+ w("div", Ae, [
528
530
  f(te, {
529
531
  content: "筛选器",
530
532
  fontSize: 16
@@ -535,16 +537,16 @@ import '../assets/layout3.css';const Ne = [
535
537
  class: "shrink-button"
536
538
  }, {
537
539
  default: n(() => [
538
- f(t(Be))
540
+ f(t(Ie))
539
541
  ]),
540
542
  _: 1
541
543
  })
542
544
  ])
543
545
  ]),
544
546
  default: n(() => [
545
- g("div", Ae, [
547
+ w("div", He, [
546
548
  f(q, {
547
- items: S.value,
549
+ items: P.value,
548
550
  "form-data": i.value,
549
551
  "label-width": "auto",
550
552
  "label-position": "top",
@@ -554,15 +556,15 @@ import '../assets/layout3.css';const Ne = [
554
556
  "min-width": a.minWidth,
555
557
  onEnter: T
556
558
  }, F({ _: 2 }, [
557
- E(S.value, (d) => ({
559
+ E(P.value, (d) => ({
558
560
  name: d.key,
559
- fn: n((k) => [
560
- p(o.$slots, d.key, A(H(k)), void 0, !0)
561
+ fn: n((b) => [
562
+ k(o.$slots, d.key, A(H(b)), void 0, !0)
561
563
  ])
562
564
  }))
563
565
  ]), 1032, ["items", "form-data", "min-width"])
564
566
  ]),
565
- g("div", He, [
567
+ w("div", Ke, [
566
568
  f(K, {
567
569
  "operation-list": a.operationList,
568
570
  onOperation: W
@@ -570,7 +572,7 @@ import '../assets/layout3.css';const Ne = [
570
572
  o.$slots.operation ? {
571
573
  name: "operation",
572
574
  fn: n(({ operationList: d }) => [
573
- p(o.$slots, "operation", { operationList: d }, void 0, !0)
575
+ k(o.$slots, "operation", { operationList: d }, void 0, !0)
574
576
  ]),
575
577
  key: "0"
576
578
  } : void 0
@@ -581,7 +583,7 @@ import '../assets/layout3.css';const Ne = [
581
583
  }, 8, ["modelValue"])
582
584
  ], 2));
583
585
  }
584
- }), Ze = /* @__PURE__ */ ne(Ke, [["__scopeId", "data-v-fd5ceec9"]]);
586
+ }), _e = /* @__PURE__ */ ne(qe, [["__scopeId", "data-v-fd5ceec9"]]);
585
587
  export {
586
- Ze as S
588
+ _e as S
587
589
  };
package/lib/SearchBar.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./chunks/index.CkihWzK6.js"),t=require("./chunks/layout.BJubstyS.js"),e=r.withInstall(t.SearchBar);exports.SearchBar=e;exports.default=e;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./chunks/index.CkihWzK6.js"),t=require("./chunks/layout.D4arET4r.js"),e=r.withInstall(t.SearchBar);exports.SearchBar=e;exports.default=e;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/UpdatePasswordDialog.css');const P=require("./chunks/index.CkihWzK6.js"),e=require("vue"),_=require("./chunks/layout.B9EVVV-O.js"),M=require("./chunks/layout.BJubstyS.js"),o=require("ling-yun-methods"),V=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),h=()=>{const u=e.ref({password:"",confirmPassword:""}),p=e.computed(()=>[{label:"请输入新密码",key:"password",type:o.componentType.text,placeholder:"请输入6-20位,需包含大小写字母、数字",wide:!0,required:!0,showPassword:!0,validator:d},{label:"请再次输入新密码",key:"confirmPassword",type:o.componentType.text,placeholder:"请输入6-20位,需包含大小写字母、数字",wide:!0,required:!0,showPassword:!0,validator:i}]),d=(l,s,t)=>{!s||!/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,20}$/.test(s)?t(new Error("请输入6-20位,需包含大小写字母、数字")):t()},i=(l,s,t)=>{s===""?t(new Error("两次密码不一致")):s!==u.value.password?t(new Error("两次密码不一致")):t()};return{formData:u,userFromItems:p}},x={__name:"layout",props:{modelValue:{type:Boolean,default:!1},nowUserData:{type:Object,default:()=>{}},apiConfig:{type:Object,default:()=>{}}},emits:[o.emitsMap.updateModelValue,o.emitsMap.change],setup(u,{emit:p}){const d=u,i=p,l=e.computed({get:()=>d.modelValue,set:r=>i(o.emitsMap.updateModelValue,r)}),s=e.ref(null),{formData:t,userFromItems:y}=h(),g=async()=>{const r=await d.apiConfig.getSecretKeyApi();if(r.code!==o.codeMap.success)return{};const{key:a,iv:n,keyId:c}=r.data,{password:f}=s.value.getFormData(),m=o.AESCrypto.encrypt(f,a,n);return{keyId:c,encryptedPassword:m}},v=async()=>{let r=!1;return await s.value.validate(async a=>{if(!a)return;const{keyId:n,encryptedPassword:c}=await g();if(!n||!c)return;const f={userId:d.nowUserData.id,newPassword:c,aesKeyId:n};(await d.apiConfig.updatePasswordApi(f)).code===o.codeMap.success&&(o.messageSuccess("修改成功"),l.value=!1,r=!0,i(o.emitsMap.change))}),r};return(r,a)=>(e.openBlock(),e.createBlock(_.CustomDialog,{modelValue:l.value,"onUpdate:modelValue":a[1]||(a[1]=n=>l.value=n),title:"修改密码",buttons:{confirmText:"确定",onConfirm:v},top:"30vh",width:"568px","destroy-on-close":""},{default:e.withCtx(()=>[e.createVNode(M.SearchBar,{modelValue:e.unref(t),"onUpdate:modelValue":a[0]||(a[0]=n=>e.isRef(t)?t.value=n:null),ref_key:"formRef",ref:s,items:e.unref(y),isExpand:!1,operationList:[],filterMode:!1,labelPosition:"top"},null,8,["modelValue","items"])]),_:1},8,["modelValue","buttons"]))}},b=V._export_sfc(x,[["__scopeId","data-v-0088227a"]]),w=P.withInstall(b);exports.UpdatePasswordDialog=w;exports.default=w;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./assets/UpdatePasswordDialog.css');const P=require("./chunks/index.CkihWzK6.js"),e=require("vue"),_=require("./chunks/layout.B9EVVV-O.js"),M=require("./chunks/layout.D4arET4r.js"),o=require("ling-yun-methods"),V=require("./chunks/_plugin-vue_export-helper.BHFhmbuH.js"),h=()=>{const u=e.ref({password:"",confirmPassword:""}),p=e.computed(()=>[{label:"请输入新密码",key:"password",type:o.componentType.text,placeholder:"请输入6-20位,需包含大小写字母、数字",wide:!0,required:!0,showPassword:!0,validator:d},{label:"请再次输入新密码",key:"confirmPassword",type:o.componentType.text,placeholder:"请输入6-20位,需包含大小写字母、数字",wide:!0,required:!0,showPassword:!0,validator:i}]),d=(l,s,t)=>{!s||!/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,20}$/.test(s)?t(new Error("请输入6-20位,需包含大小写字母、数字")):t()},i=(l,s,t)=>{s===""?t(new Error("两次密码不一致")):s!==u.value.password?t(new Error("两次密码不一致")):t()};return{formData:u,userFromItems:p}},x={__name:"layout",props:{modelValue:{type:Boolean,default:!1},nowUserData:{type:Object,default:()=>{}},apiConfig:{type:Object,default:()=>{}}},emits:[o.emitsMap.updateModelValue,o.emitsMap.change],setup(u,{emit:p}){const d=u,i=p,l=e.computed({get:()=>d.modelValue,set:r=>i(o.emitsMap.updateModelValue,r)}),s=e.ref(null),{formData:t,userFromItems:y}=h(),g=async()=>{const r=await d.apiConfig.getSecretKeyApi();if(r.code!==o.codeMap.success)return{};const{key:a,iv:n,keyId:c}=r.data,{password:f}=s.value.getFormData(),m=o.AESCrypto.encrypt(f,a,n);return{keyId:c,encryptedPassword:m}},v=async()=>{let r=!1;return await s.value.validate(async a=>{if(!a)return;const{keyId:n,encryptedPassword:c}=await g();if(!n||!c)return;const f={userId:d.nowUserData.id,newPassword:c,aesKeyId:n};(await d.apiConfig.updatePasswordApi(f)).code===o.codeMap.success&&(o.messageSuccess("修改成功"),l.value=!1,r=!0,i(o.emitsMap.change))}),r};return(r,a)=>(e.openBlock(),e.createBlock(_.CustomDialog,{modelValue:l.value,"onUpdate:modelValue":a[1]||(a[1]=n=>l.value=n),title:"修改密码",buttons:{confirmText:"确定",onConfirm:v},top:"30vh",width:"568px","destroy-on-close":""},{default:e.withCtx(()=>[e.createVNode(M.SearchBar,{modelValue:e.unref(t),"onUpdate:modelValue":a[0]||(a[0]=n=>e.isRef(t)?t.value=n:null),ref_key:"formRef",ref:s,items:e.unref(y),isExpand:!1,operationList:[],filterMode:!1,labelPosition:"top"},null,8,["modelValue","items"])]),_:1},8,["modelValue","buttons"]))}},b=V._export_sfc(x,[["__scopeId","data-v-0088227a"]]),w=P.withInstall(b);exports.UpdatePasswordDialog=w;exports.default=w;
@@ -1 +1 @@
1
- .filter-form[data-v-09890bac]{grid-template-columns:repeat(2,1fr);gap:10px}.filter-preview-form[data-v-09890bac]{display:flex}.filter-preview-form .el-form-item[data-v-09890bac]{width:var(--v21d4c185);margin-right:10px}.search-bar-form[data-v-09890bac]{grid-template-columns:repeat(auto-fit,minmax(var(--v21d4c185),1fr));gap:10px}.search-bar-form.el-form--inline .el-form-item[data-v-09890bac]{margin-right:0;margin-bottom:10px}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-09890bac]{display:flex;padding:0 14px;background:var(--neutral-color-18);border-radius:8px;border:1px solid var(--parting-line)}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-09890bac] .el-form-item__content{justify-content:end}.search-bar-form.el-form--inline.el-form--label-top[data-v-09890bac]{display:grid}.search-bar-item--wide[data-v-09890bac]{grid-column:span 2}.is-collapsed[data-v-fd5ceec9]{max-height:var(--v2e56a75a)}.operation-buttons[data-v-fd5ceec9]{width:var(--v63e17c4e);z-index:1}.h-32[data-v-fd5ceec9]{height:32px}.drawer-header[data-v-fd5ceec9]{display:flex;justify-content:space-between;align-items:center;width:100%}.drawer-header .shrink-button[data-v-fd5ceec9]{margin-left:auto}.border-top[data-v-fd5ceec9]{border-top:1px solid var(--parting-line)}[data-v-fd5ceec9] .el-drawer__body{padding:16px 0;display:flex;flex-direction:column;overflow:hidden}.filter-form-popover[data-v-fd5ceec9]{max-height:400px}[data-v-fd5ceec9] .el-drawer__header{margin-bottom:0;padding:16px 16px 0}
1
+ .filter-form[data-v-6092c6e2]{grid-template-columns:repeat(2,1fr);gap:10px}.filter-preview-form[data-v-6092c6e2]{display:flex}.filter-preview-form .el-form-item[data-v-6092c6e2]{width:var(--v21117ed0);margin-right:10px}.search-bar-form[data-v-6092c6e2]{grid-template-columns:repeat(auto-fit,minmax(var(--v21117ed0),1fr));gap:10px}.search-bar-form.el-form--inline .el-form-item[data-v-6092c6e2]{margin-right:0;margin-bottom:10px}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-6092c6e2]{display:flex;padding:0 14px;background:var(--neutral-color-18);border-radius:8px;border:1px solid var(--parting-line)}.search-bar-form.el-form--inline .el-form-item.el-form-item--label-left[data-v-6092c6e2] .el-form-item__content{justify-content:end}.search-bar-form.el-form--inline.el-form--label-top[data-v-6092c6e2]{display:grid}.search-bar-item--wide[data-v-6092c6e2]{grid-column:span 2}.is-collapsed[data-v-fd5ceec9]{max-height:var(--v2e56a75a)}.operation-buttons[data-v-fd5ceec9]{width:var(--v63e17c4e);z-index:1}.h-32[data-v-fd5ceec9]{height:32px}.drawer-header[data-v-fd5ceec9]{display:flex;justify-content:space-between;align-items:center;width:100%}.drawer-header .shrink-button[data-v-fd5ceec9]{margin-left:auto}.border-top[data-v-fd5ceec9]{border-top:1px solid var(--parting-line)}[data-v-fd5ceec9] .el-drawer__body{padding:16px 0;display:flex;flex-direction:column;overflow:hidden}.filter-form-popover[data-v-fd5ceec9]{max-height:400px}[data-v-fd5ceec9] .el-drawer__header{margin-bottom:0;padding:16px 16px 0}
@@ -0,0 +1 @@
1
+ "use strict";require('../assets/layout3.css');const e=require("vue"),i=require("element-plus"),V=require("color-message-lingyun-vue"),r=require("ling-yun-methods"),S=require("./_plugin-vue_export-helper.BHFhmbuH.js"),M=require("./layout.B-T_NE6r.js"),A=[{type:"primary",label:"查询",value:r.operationConfigMap.search},{type:"default",label:"重置",value:r.operationConfigMap.reset}],P=320,B={__name:"OperationButtons",props:{operationList:{type:Array,default:()=>[]}},emits:["operation"],setup(a,{emit:h}){const k=h,c=m=>{k("operation",m)};return(m,u)=>m.$slots.operation?e.renderSlot(m.$slots,"operation",{key:0,operationList:a.operationList}):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.operationList,f=>(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:f.value,type:f.type,icon:f.icon,onClick:n=>c(f.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),_:2},1032,["type","icon","onClick"]))),128))}},j=Object.assign({name:"FormWrapper"},{__name:"FormWrapper",props:{items:{type:Array,default:()=>[]},formData:{type:Object,default:()=>({})},rules:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:"auto"},labelPosition:{type:String,default:r.labelPositionMap.right},showLabel:{type:Boolean,default:!0},inline:{type:Boolean,default:!1},isFilter:{type:Boolean,default:!1},isFilterPreview:{type:Boolean,default:!1},minWidth:{type:Number,default:P}},emits:["change","enter"],setup(a,{expose:h}){e.useCssVars(n=>({v21117ed0:a.minWidth+"px"}));const k=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./layout.BSF3ruxz.js"))),c=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./layout.DWbm8gXV.js"))),m=a,u=e.ref(null),f=e.computed(()=>m.isFilter?"filter-form":m.isFilterPreview?"filter-preview-form":"search-bar-form");return h({validate:n=>u.value?u.value.validate(n):Promise.resolve(!0),resetFields:()=>{u.value&&u.value.resetFields()},clearValidate:n=>{u.value&&u.value.clearValidate(n)},scrollToField:n=>{u.value&&u.value.scrollToField(n)}}),(n,p)=>(e.openBlock(),e.createBlock(e.unref(i.ElForm),{ref_key:"formRef",ref:u,model:a.formData,"label-width":a.labelWidth,"label-position":a.labelPosition,inline:a.inline,rules:a.rules,class:e.normalizeClass({[f.value]:!0,"items-end display-grid":!a.isFilterPreview}),onSubmit:p[0]||(p[0]=e.withModifiers(()=>{},["prevent","stop"]))},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,t=>(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),e.mergeProps({key:t.key,label:a.showLabel?t.label:"",prop:t.key,"show-label":a.showLabel,class:[{"search-bar-item--wide":t.wide}]},{ref_for:!0},t),{default:e.withCtx(()=>[e.renderSlot(n.$slots,t.key,{item:t,formData:a.formData},()=>[t.type===e.unref(r.componentType).text?(e.openBlock(),e.createBlock(e.unref(i.ElInput),e.mergeProps({key:0,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t,{class:"w-full",onChange:o=>n.$emit("change",t.key,a.formData[t.key]),onKeyup:e.withKeys(o=>n.$emit("enter",t.key,a.formData[t.key]),["enter"])}),null,16,["modelValue","onUpdate:modelValue","onChange","onKeyup"])):t.type===e.unref(r.componentType).select?(e.openBlock(),e.createBlock(e.unref(k),e.mergeProps({key:1,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o,"static-options":t.options},{ref_for:!0},t,{onChange:o=>n.$emit("change",t.key,a.formData[t.key]),class:"w-full"}),null,16,["modelValue","onUpdate:modelValue","static-options","onChange"])):t.type===e.unref(r.componentType).date?(e.openBlock(),e.createBlock(e.unref(i.ElDatePicker),e.mergeProps({key:2,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},{...t,...e.unref(r.dateParamsMap)[t.dateType]},{type:t.dateType,format:t.format||e.unref(r.dateFormat).date,"value-format":t.valueFormat||e.unref(r.dateFormat).dateTime,class:"w-full",onChange:o=>n.$emit("change",t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","type","format","value-format","onChange"])):t.type===e.unref(r.componentType).inputNumber?(e.openBlock(),e.createBlock(e.unref(i.ElInputNumber),e.mergeProps({key:3,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t,{class:"w-full",onChange:o=>n.$emit("change",t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(r.componentType).switch?(e.openBlock(),e.createBlock(e.unref(i.ElSwitch),e.mergeProps({key:4,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t,{onChange:o=>n.$emit("change",t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(r.componentType).radio?(e.openBlock(),e.createBlock(e.unref(i.ElRadioGroup),{key:5,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o,onChange:o=>n.$emit("change",t.key,a.formData[t.key])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,o=>(e.openBlock(),e.createBlock(e.unref(i.ElRadio),{key:o.value,label:o.value,value:o.value,disabled:o.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1032,["label","value","disabled"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(r.componentType).checkbox?(e.openBlock(),e.createBlock(e.unref(i.ElCheckboxGroup),{key:6,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o,onChange:o=>n.$emit("change",t.key,a.formData[t.key])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,o=>(e.openBlock(),e.createBlock(e.unref(i.ElCheckbox),{key:o.value,label:o.value,value:o.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1032,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(r.componentType).textarea?(e.openBlock(),e.createBlock(e.unref(i.ElInput),e.mergeProps({key:7,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t,{class:"w-full",type:"textarea",onChange:o=>n.$emit("change",t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(r.componentType).upload?(e.openBlock(),e.createBlock(e.unref(c),e.mergeProps({key:8,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],!0)]),_:2},1040,["label","prop","show-label","class"]))),128)),e.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3},8,["model","label-width","label-position","inline","rules","class"]))}}),x=S._export_sfc(j,[["__scopeId","data-v-6092c6e2"]]),H={class:"h-32 w-full"},K={class:"flex items-center justify-between pd-b-20"},G={class:"text-right"},Y={class:"drawer-header"},J={class:"flex-1 pd-l-16 pd-r-16 overflow-y-auto"},Q={class:"text-right border-top pd-t-16 pd-l-16 pd-r-16"},X=Object.assign({name:"SearchBar"},{__name:"layout",props:{items:{type:Array,default:()=>[]},modelValue:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:"auto"},labelPosition:{type:String,default:r.labelPositionMap.right,validator:a=>[r.labelPositionMap.left,r.labelPositionMap.right,r.labelPositionMap.top].includes(a)},isExpand:{type:Boolean,default:!0},maxHeight:{type:Number,default:84},minWidth:{type:Number,default:P},operationList:{type:Array,default:A},filterMode:{type:Boolean,default:!0}},emits:[r.emitsMap.updateModelValue,r.emitsMap.operation],setup(a,{expose:h,emit:k}){e.useCssVars(l=>({v2e56a75a:a.maxHeight+"px",v63e17c4e:C.value?C.value+"px":"100%"}));const c=a,m=k,u=e.ref({}),f=e.ref(!c.isExpand),n=e.ref(null),p=e.ref(!1),t=e.ref(!1),o=e.computed(()=>{const l={};return c.items.forEach(s=>{if(s.required){const d=[{required:!0,message:`${s.label}不能为空`,trigger:"blur"}];typeof s.validator=="function"&&d.push({validator:s.validator,trigger:"blur"}),l[s.key]=d}}),l}),b=e.computed(()=>c.items?.filter(l=>!l.hidden)||[]),E=e.computed(()=>c.filterMode?b.value?.slice(0,2)||[]:b.value),v=e.computed(()=>c.filterMode?b.value.slice(2):[]),D=l=>{u.value={...l}},F=()=>{m(r.emitsMap.updateModelValue,{...u.value})},T=(l,s)=>{u.value[l]=s,g(r.operationConfigMap.search)},L=()=>u.value,w=(l,s)=>{m(r.emitsMap.operation,r.operationConfigMap.search,u.value)},g=l=>{F(),m(r.emitsMap.operation,l,u.value),(l===r.operationConfigMap.search||l===r.operationConfigMap.reset)&&(p.value=!1,t.value=!1)},U=l=>n.value.validate(l),C=e.ref(0),I=l=>{C.value=l+32},W=()=>{f.value=!f.value},z=()=>{p.value=!1,t.value=!0},R=()=>{t.value=!1,p.value=!0},N=e.ref(!1),$=l=>{N.value=l>c.maxHeight},O=e.computed(()=>c.filterMode||f.value?"10px":"0");return e.onMounted(()=>{D(c.modelValue),$()}),e.watch(()=>c.modelValue,l=>{D(l)},{immediate:!0,deep:!0}),h({validate:U,getFormData:L,formRef:n}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative overflow-hidden w-full",{flex:a.filterMode}])},[e.createElementVNode("div",{class:e.normalizeClass({"is-collapsed overflow-hidden":!f.value})},[e.createVNode(e.unref(i.ElAutoResizer),null,{default:e.withCtx(({height:d})=>[e.createTextVNode(e.toDisplayString($(d))+" ",1),e.createVNode(x,{ref_key:"formRef",ref:n,items:E.value,"form-data":u.value,rules:o.value,"label-width":a.labelWidth,"label-position":a.labelPosition,inline:!0,"show-label":!a.filterMode,"min-width":a.minWidth,"is-filter-preview":a.filterMode,onChange:T,onEnter:w},e.createSlots({default:e.withCtx(()=>[a.isExpand&&!a.filterMode?(e.openBlock(),e.createBlock(e.unref(i.ElFormItem),{key:0},{default:e.withCtx(()=>[e.createElementVNode("div",H,[e.createVNode(e.unref(i.ElAutoResizer),null,{default:e.withCtx(({width:y})=>[e.createTextVNode(e.toDisplayString(I(y)),1)]),_:1})])]),_:1})):e.createCommentVNode("",!0)]),_:2},[e.renderList(E.value,y=>({name:y.key,fn:e.withCtx(q=>[e.renderSlot(l.$slots,y.key,e.normalizeProps(e.guardReactiveProps(q)),void 0,!0)])}))]),1032,["items","form-data","rules","label-width","label-position","show-label","min-width","is-filter-preview"])]),_:3})],2),e.createElementVNode("div",{class:e.normalizeClass(["operation-buttons",{"absolute right-0 bg-fff text-right":a.isExpand&&!a.filterMode,"text-left":a.filterMode}]),style:e.normalizeStyle({bottom:O.value})},[a.filterMode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(i.ElButton),{onClick:s[0]||(s[0]=d=>g(e.unref(r.operationConfigMap).reset)),type:"default"},{default:e.withCtx(()=>[...s[3]||(s[3]=[e.createTextVNode("重置",-1)])]),_:1}),v.value?.length?(e.openBlock(),e.createBlock(e.unref(i.ElPopover),{key:0,visible:p.value,placement:"bottom-start",width:628,trigger:"click"},{reference:e.withCtx(()=>[e.createVNode(e.unref(i.ElButton),{onClick:s[1]||(s[1]=d=>p.value=!p.value),icon:e.unref(V.IconCheck),type:"default"},{default:e.withCtx(()=>[...s[4]||(s[4]=[e.createTextVNode(" 筛选器 ",-1)])]),_:1},8,["icon"])]),default:e.withCtx(()=>[e.createElementVNode("div",K,[e.createVNode(M.CustomTitle,{content:"筛选器",fontSize:16}),e.createVNode(e.unref(i.ElIcon),{size:16,onClick:z},{default:e.withCtx(()=>[e.createVNode(e.unref(V.IconMagnify))]),_:1})]),e.createVNode(x,{items:v.value,"form-data":u.value,"label-width":"auto","label-position":"top",inline:!1,"show-label":!0,"is-filter":!0,"min-width":a.minWidth,class:"filter-form-popover overflow-y-auto",onEnter:w},e.createSlots({_:2},[e.renderList(v.value,d=>({name:d.key,fn:e.withCtx(y=>[e.renderSlot(l.$slots,d.key,e.normalizeProps(e.guardReactiveProps(y)),void 0,!0)])}))]),1032,["items","form-data","min-width"]),e.createElementVNode("div",G,[e.createVNode(B,{"operation-list":a.operationList,onOperation:g},e.createSlots({_:2},[l.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:d})=>[e.renderSlot(l.$slots,"operation",{operationList:d},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])])]),_:3},8,["visible"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[N.value&&a.isExpand?(e.openBlock(),e.createBlock(e.unref(i.ElButton),{key:0,icon:f.value?e.unref(V.IconUp):e.unref(V.IconDown),text:"",onClick:W},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value?"收起":"展开"),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0),e.createVNode(B,{"operation-list":a.operationList,onOperation:g},e.createSlots({_:2},[l.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:d})=>[e.renderSlot(l.$slots,"operation",{operationList:d},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])],64))],6),e.createVNode(e.unref(i.ElDrawer),{modelValue:t.value,"onUpdate:modelValue":s[2]||(s[2]=d=>t.value=d),size:"628","show-close":!1},{header:e.withCtx(()=>[e.createElementVNode("div",Y,[e.createVNode(M.CustomTitle,{content:"筛选器",fontSize:16}),e.createVNode(e.unref(i.ElIcon),{size:16,onClick:R,class:"shrink-button"},{default:e.withCtx(()=>[e.createVNode(e.unref(V.IconShrink))]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",J,[e.createVNode(x,{items:v.value,"form-data":u.value,"label-width":"auto","label-position":"top",inline:!1,"show-label":!0,"is-filter":!0,"min-width":a.minWidth,onEnter:w},e.createSlots({_:2},[e.renderList(v.value,d=>({name:d.key,fn:e.withCtx(y=>[e.renderSlot(l.$slots,d.key,e.normalizeProps(e.guardReactiveProps(y)),void 0,!0)])}))]),1032,["items","form-data","min-width"])]),e.createElementVNode("div",Q,[e.createVNode(B,{"operation-list":a.operationList,onOperation:g},e.createSlots({_:2},[l.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:d})=>[e.renderSlot(l.$slots,"operation",{operationList:d},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])])]),_:3},8,["modelValue"])],2))}}),Z=S._export_sfc(X,[["__scopeId","data-v-fd5ceec9"]]);exports.SearchBar=Z;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ling-yun-custom-components",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "keywords": [
5
5
  "component library",
6
6
  "ui framework",
@@ -140,7 +140,7 @@
140
140
  "element-plus": "^2.11.5",
141
141
  "element-tree-line": "^0.2.1",
142
142
  "js-cookie": "^3.0.5",
143
- "ling-yun-methods": "^0.0.21",
143
+ "ling-yun-methods": "^0.0.27",
144
144
  "lodash.debounce": "^4.0.8",
145
145
  "lottie-web": "^5.13.0",
146
146
  "moment": "^2.30.1",
@@ -185,7 +185,7 @@
185
185
  "peerDependencies": {
186
186
  "axios": "^1.8.2",
187
187
  "vue": "^3.5.13",
188
- "color-message-lingyun-vue": "^0.0.10"
188
+ "color-message-lingyun-vue": "^0.0.11"
189
189
  },
190
190
  "optionalDependencies": {
191
191
  "@ast-grep/napi-linux-x64-musl": "^0.39.6",
@@ -1,586 +0,0 @@
1
- import { renderSlot as p, createElementBlock as $, openBlock as r, Fragment as x, renderList as E, createBlock as m, unref as t, withCtx as n, createTextVNode as V, toDisplayString as M, useCssVars as le, defineAsyncComponent as Y, ref as w, computed as U, normalizeClass as N, mergeProps as b, createCommentVNode as O, withKeys as pe, onMounted as ke, watch as be, createElementVNode as g, createVNode as f, createSlots as F, normalizeProps as A, guardReactiveProps as H, normalizeStyle as ge } from "vue";
2
- import { ElButton as z, ElForm as we, ElFormItem as oe, ElInput as Z, ElDatePicker as Ve, ElInputNumber as De, ElSwitch as Ce, ElRadioGroup as $e, ElRadio as Ee, ElCheckboxGroup as Fe, ElCheckbox as Ue, ElAutoResizer as _, ElPopover as xe, ElIcon as ee, ElDrawer as Me } from "element-plus";
3
- import { IconMagnify as Le, IconCheck as Pe, IconUp as Se, IconDown as We, IconShrink as Be } from "color-message-lingyun-vue";
4
- import { operationConfigMap as C, labelPositionMap as I, componentType as h, dateParamsMap as Ie, dateFormat as ae, emitsMap as B } from "ling-yun-methods";
5
- import { _ as ne } from "./_plugin-vue_export-helper.CHgC5LLL.js";
6
- import { C as te } from "./layout.BKJPyxR8.js";
7
- import '../assets/layout3.css';const Ne = [
8
- {
9
- type: "primary",
10
- label: "查询",
11
- value: C.search
12
- },
13
- {
14
- type: "default",
15
- label: "重置",
16
- value: C.reset
17
- }
18
- ], re = 320, K = {
19
- __name: "OperationButtons",
20
- props: {
21
- operationList: {
22
- type: Array,
23
- default: () => []
24
- }
25
- },
26
- emits: ["operation"],
27
- setup(a, { emit: L }) {
28
- const P = L, y = (v) => {
29
- P("operation", v);
30
- };
31
- return (v, i) => v.$slots.operation ? p(v.$slots, "operation", {
32
- key: 0,
33
- operationList: a.operationList
34
- }) : (r(!0), $(x, { key: 1 }, E(a.operationList, (c) => (r(), m(t(z), {
35
- key: c.value,
36
- type: c.type,
37
- icon: c.icon,
38
- onClick: (u) => y(c.value)
39
- }, {
40
- default: n(() => [
41
- V(M(c.label), 1)
42
- ]),
43
- _: 2
44
- }, 1032, ["type", "icon", "onClick"]))), 128));
45
- }
46
- }, Oe = /* @__PURE__ */ Object.assign({
47
- name: "FormWrapper"
48
- }, {
49
- __name: "FormWrapper",
50
- props: {
51
- // 表单项配置
52
- items: {
53
- type: Array,
54
- default: () => []
55
- },
56
- // 表单数据
57
- formData: {
58
- type: Object,
59
- default: () => ({})
60
- },
61
- // 表单验证规则
62
- rules: {
63
- type: Object,
64
- default: () => ({})
65
- },
66
- // 标签宽度
67
- labelWidth: {
68
- type: [String, Number],
69
- default: "auto"
70
- },
71
- // 标签位置
72
- labelPosition: {
73
- type: String,
74
- default: I.right
75
- },
76
- // 是否显示标签
77
- showLabel: {
78
- type: Boolean,
79
- default: !0
80
- },
81
- // 是否内联布局
82
- inline: {
83
- type: Boolean,
84
- default: !1
85
- },
86
- // 是否为筛选器模式
87
- isFilter: {
88
- type: Boolean,
89
- default: !1
90
- },
91
- // 是否为筛选器预览模式
92
- isFilterPreview: {
93
- type: Boolean,
94
- default: !1
95
- },
96
- minWidth: {
97
- type: Number,
98
- default: re
99
- }
100
- },
101
- emits: ["change", "enter"],
102
- setup(a, { expose: L }) {
103
- le((u) => ({
104
- v6636f7d5: a.minWidth + "px"
105
- }));
106
- const P = Y(() => import("./layout.2Mabaug0.js")), y = Y(() => import("./layout.BHroZ9U9.js")), v = a, i = w(null), c = U(() => v.isFilter ? "filter-form" : v.isFilterPreview ? "filter-preview-form" : "search-bar-form");
107
- return L({
108
- validate: (u) => i.value ? i.value.validate(u) : Promise.resolve(!0),
109
- resetFields: () => {
110
- i.value && i.value.resetFields();
111
- },
112
- clearValidate: (u) => {
113
- i.value && i.value.clearValidate(u);
114
- },
115
- scrollToField: (u) => {
116
- i.value && i.value.scrollToField(u);
117
- }
118
- }), (u, D) => (r(), m(t(we), {
119
- ref_key: "formRef",
120
- ref: i,
121
- model: a.formData,
122
- "label-width": a.labelWidth,
123
- "label-position": a.labelPosition,
124
- inline: a.inline,
125
- rules: a.rules,
126
- class: N({
127
- [c.value]: !0,
128
- "items-end display-grid": !a.isFilterPreview
129
- })
130
- }, {
131
- default: n(() => [
132
- (r(!0), $(x, null, E(a.items, (e) => (r(), m(t(oe), b({
133
- key: e.key,
134
- label: a.showLabel ? e.label : "",
135
- prop: e.key,
136
- "show-label": a.showLabel,
137
- class: [
138
- {
139
- "search-bar-item--wide": e.wide
140
- }
141
- ]
142
- }, { ref_for: !0 }, e), {
143
- default: n(() => [
144
- p(u.$slots, e.key, {
145
- item: e,
146
- formData: a.formData
147
- }, () => [
148
- e.type === t(h).text ? (r(), m(t(Z), b({
149
- key: 0,
150
- modelValue: a.formData[e.key],
151
- "onUpdate:modelValue": (l) => a.formData[e.key] = l
152
- }, { ref_for: !0 }, e, {
153
- class: "w-full",
154
- onChange: (l) => u.$emit("change", e.key, a.formData[e.key]),
155
- onKeyup: pe((l) => u.$emit("enter", e.key, a.formData[e.key]), ["enter"])
156
- }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange", "onKeyup"])) : e.type === t(h).select ? (r(), m(t(P), b({
157
- key: 1,
158
- modelValue: a.formData[e.key],
159
- "onUpdate:modelValue": (l) => a.formData[e.key] = l,
160
- "static-options": e.options
161
- }, { ref_for: !0 }, e, {
162
- onChange: (l) => u.$emit("change", e.key, a.formData[e.key]),
163
- class: "w-full"
164
- }), null, 16, ["modelValue", "onUpdate:modelValue", "static-options", "onChange"])) : e.type === t(h).date ? (r(), m(t(Ve), b({
165
- key: 2,
166
- modelValue: a.formData[e.key],
167
- "onUpdate:modelValue": (l) => a.formData[e.key] = l
168
- }, { ref_for: !0 }, {
169
- ...e,
170
- ...t(Ie)[e.dateType]
171
- }, {
172
- type: e.dateType,
173
- format: e.format || t(ae).date,
174
- "value-format": e.valueFormat || t(ae).dateTime,
175
- class: "w-full",
176
- onChange: (l) => u.$emit("change", e.key, a.formData[e.key])
177
- }), null, 16, ["modelValue", "onUpdate:modelValue", "type", "format", "value-format", "onChange"])) : e.type === t(h).inputNumber ? (r(), m(t(De), b({
178
- key: 3,
179
- modelValue: a.formData[e.key],
180
- "onUpdate:modelValue": (l) => a.formData[e.key] = l
181
- }, { ref_for: !0 }, e, {
182
- class: "w-full",
183
- onChange: (l) => u.$emit("change", e.key, a.formData[e.key])
184
- }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).switch ? (r(), m(t(Ce), b({
185
- key: 4,
186
- modelValue: a.formData[e.key],
187
- "onUpdate:modelValue": (l) => a.formData[e.key] = l
188
- }, { ref_for: !0 }, e, {
189
- onChange: (l) => u.$emit("change", e.key, a.formData[e.key])
190
- }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).radio ? (r(), m(t($e), {
191
- key: 5,
192
- modelValue: a.formData[e.key],
193
- "onUpdate:modelValue": (l) => a.formData[e.key] = l,
194
- onChange: (l) => u.$emit("change", e.key, a.formData[e.key])
195
- }, {
196
- default: n(() => [
197
- (r(!0), $(x, null, E(e.options, (l) => (r(), m(t(Ee), {
198
- key: l.value,
199
- label: l.value,
200
- value: l.value
201
- }, {
202
- default: n(() => [
203
- V(M(l.label), 1)
204
- ]),
205
- _: 2
206
- }, 1032, ["label", "value"]))), 128))
207
- ]),
208
- _: 2
209
- }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).checkbox ? (r(), m(t(Fe), {
210
- key: 6,
211
- modelValue: a.formData[e.key],
212
- "onUpdate:modelValue": (l) => a.formData[e.key] = l,
213
- onChange: (l) => u.$emit("change", e.key, a.formData[e.key])
214
- }, {
215
- default: n(() => [
216
- (r(!0), $(x, null, E(e.options, (l) => (r(), m(t(Ue), {
217
- key: l.value,
218
- label: l.value,
219
- value: l.value
220
- }, {
221
- default: n(() => [
222
- V(M(l.label), 1)
223
- ]),
224
- _: 2
225
- }, 1032, ["label", "value"]))), 128))
226
- ]),
227
- _: 2
228
- }, 1032, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).textarea ? (r(), m(t(Z), b({
229
- key: 7,
230
- modelValue: a.formData[e.key],
231
- "onUpdate:modelValue": (l) => a.formData[e.key] = l
232
- }, { ref_for: !0 }, e, {
233
- class: "w-full",
234
- type: "textarea",
235
- onChange: (l) => u.$emit("change", e.key, a.formData[e.key])
236
- }), null, 16, ["modelValue", "onUpdate:modelValue", "onChange"])) : e.type === t(h).upload ? (r(), m(t(y), b({
237
- key: 8,
238
- modelValue: a.formData[e.key],
239
- "onUpdate:modelValue": (l) => a.formData[e.key] = l
240
- }, { ref_for: !0 }, e), null, 16, ["modelValue", "onUpdate:modelValue"])) : O("", !0)
241
- ], !0)
242
- ]),
243
- _: 2
244
- }, 1040, ["label", "prop", "show-label", "class"]))), 128)),
245
- p(u.$slots, "default", {}, void 0, !0)
246
- ]),
247
- _: 3
248
- }, 8, ["model", "label-width", "label-position", "inline", "rules", "class"]));
249
- }
250
- }), q = /* @__PURE__ */ ne(Oe, [["__scopeId", "data-v-bdd1bd85"]]), ze = { class: "h-32 w-full" }, Re = { class: "flex items-center justify-between pd-b-20" }, Te = { class: "text-right" }, je = { class: "drawer-header" }, Ae = { class: "flex-1 pd-l-16 pd-r-16 overflow-y-auto" }, He = { class: "text-right border-top pd-t-16 pd-l-16 pd-r-16" }, Ke = /* @__PURE__ */ Object.assign({
251
- name: "SearchBar"
252
- }, {
253
- __name: "layout",
254
- props: {
255
- // 搜索项配置
256
- items: {
257
- type: Array,
258
- default: () => []
259
- },
260
- // 初始值
261
- modelValue: {
262
- type: Object,
263
- default: () => ({})
264
- },
265
- // 标签宽度
266
- labelWidth: {
267
- type: [String, Number],
268
- default: "auto"
269
- },
270
- // 标签位置
271
- labelPosition: {
272
- type: String,
273
- default: I.right,
274
- validator: (a) => [I.left, I.right, I.top].includes(a)
275
- },
276
- // 是否可以展开
277
- isExpand: {
278
- type: Boolean,
279
- default: !0
280
- },
281
- // 最大的高度
282
- maxHeight: {
283
- type: Number,
284
- default: 84
285
- },
286
- // 每项最小宽度
287
- minWidth: {
288
- type: Number,
289
- default: re
290
- },
291
- operationList: {
292
- type: Array,
293
- default: Ne
294
- },
295
- // 是否为筛选器模式
296
- filterMode: {
297
- type: Boolean,
298
- default: !0
299
- }
300
- },
301
- emits: [B.updateModelValue, B.operation],
302
- setup(a, { expose: L, emit: P }) {
303
- le((o) => ({
304
- v2e56a75a: a.maxHeight + "px",
305
- v63e17c4e: j.value ? j.value + "px" : "100%"
306
- }));
307
- const y = a, v = P, i = w({}), c = w(!y.isExpand), u = w(null), D = w(!1), e = w(!1), l = U(() => {
308
- const o = {};
309
- return y.items.forEach((s) => {
310
- if (s.required) {
311
- const d = [{ required: !0, message: `${s.label}不能为空`, trigger: "blur" }];
312
- typeof s.validator == "function" && d.push({ validator: s.validator, trigger: "blur" }), o[s.key] = d;
313
- }
314
- }), o;
315
- }), R = U(() => y.items?.filter((o) => !o.hidden) || []), G = U(() => y.filterMode ? R.value?.slice(0, 2) || [] : R.value), S = U(() => y.filterMode ? R.value.slice(2) : []), J = (o) => {
316
- i.value = { ...o };
317
- }, ue = () => {
318
- v(B.updateModelValue, { ...i.value });
319
- }, ie = (o, s) => {
320
- i.value[o] = s, W(C.search);
321
- }, de = () => i.value, T = (o, s) => {
322
- v(B.operation, C.search, i.value);
323
- }, W = (o) => {
324
- ue(), v(B.operation, o, i.value), (o === C.search || o === C.reset) && (D.value = !1, e.value = !1);
325
- }, se = (o) => u.value.validate(o), j = w(0), fe = (o) => {
326
- j.value = o + 32;
327
- }, me = () => {
328
- c.value = !c.value;
329
- }, ce = () => {
330
- D.value = !1, e.value = !0;
331
- }, ye = () => {
332
- e.value = !1, D.value = !0;
333
- }, Q = w(!1), X = (o) => {
334
- Q.value = o > y.maxHeight;
335
- }, ve = U(() => y.filterMode || c.value ? "10px" : "0");
336
- return ke(() => {
337
- J(y.modelValue), X();
338
- }), be(
339
- () => y.modelValue,
340
- (o) => {
341
- J(o);
342
- },
343
- { immediate: !0, deep: !0 }
344
- ), L({
345
- validate: se,
346
- getFormData: de,
347
- // clearValidate,
348
- // resetFields,
349
- // scrollToField,
350
- formRef: u
351
- }), (o, s) => (r(), $("div", {
352
- class: N(["relative overflow-hidden w-full", { flex: a.filterMode }])
353
- }, [
354
- g("div", {
355
- class: N({
356
- "is-collapsed overflow-hidden": !c.value
357
- })
358
- }, [
359
- f(t(_), null, {
360
- default: n(({ height: d }) => [
361
- V(M(X(d)) + " ", 1),
362
- f(q, {
363
- ref_key: "formRef",
364
- ref: u,
365
- items: G.value,
366
- "form-data": i.value,
367
- rules: l.value,
368
- "label-width": a.labelWidth,
369
- "label-position": a.labelPosition,
370
- inline: !0,
371
- "show-label": !a.filterMode,
372
- "min-width": a.minWidth,
373
- "is-filter-preview": a.filterMode,
374
- onChange: ie,
375
- onEnter: T
376
- }, F({
377
- default: n(() => [
378
- a.isExpand && !a.filterMode ? (r(), m(t(oe), { key: 0 }, {
379
- default: n(() => [
380
- g("div", ze, [
381
- f(t(_), null, {
382
- default: n(({ width: k }) => [
383
- V(M(fe(k)), 1)
384
- ]),
385
- _: 1
386
- })
387
- ])
388
- ]),
389
- _: 1
390
- })) : O("", !0)
391
- ]),
392
- _: 2
393
- }, [
394
- E(G.value, (k) => ({
395
- name: k.key,
396
- fn: n((he) => [
397
- p(o.$slots, k.key, A(H(he)), void 0, !0)
398
- ])
399
- }))
400
- ]), 1032, ["items", "form-data", "rules", "label-width", "label-position", "show-label", "min-width", "is-filter-preview"])
401
- ]),
402
- _: 3
403
- })
404
- ], 2),
405
- g("div", {
406
- class: N(["operation-buttons", {
407
- "absolute right-0 bg-fff text-right": a.isExpand && !a.filterMode,
408
- "text-left": a.filterMode
409
- }]),
410
- style: ge({ bottom: ve.value })
411
- }, [
412
- a.filterMode ? (r(), $(x, { key: 0 }, [
413
- f(t(z), {
414
- onClick: s[0] || (s[0] = (d) => W(t(C).reset)),
415
- type: "default"
416
- }, {
417
- default: n(() => [...s[3] || (s[3] = [
418
- V("重置", -1)
419
- ])]),
420
- _: 1
421
- }),
422
- S.value?.length ? (r(), m(t(xe), {
423
- key: 0,
424
- visible: D.value,
425
- placement: "bottom-start",
426
- width: 628,
427
- trigger: "click"
428
- }, {
429
- reference: n(() => [
430
- f(t(z), {
431
- onClick: s[1] || (s[1] = (d) => D.value = !D.value),
432
- icon: t(Pe),
433
- type: "default"
434
- }, {
435
- default: n(() => [...s[4] || (s[4] = [
436
- V(" 筛选器 ", -1)
437
- ])]),
438
- _: 1
439
- }, 8, ["icon"])
440
- ]),
441
- default: n(() => [
442
- g("div", Re, [
443
- f(te, {
444
- content: "筛选器",
445
- fontSize: 16
446
- }),
447
- f(t(ee), {
448
- size: 16,
449
- onClick: ce
450
- }, {
451
- default: n(() => [
452
- f(t(Le))
453
- ]),
454
- _: 1
455
- })
456
- ]),
457
- f(q, {
458
- items: S.value,
459
- "form-data": i.value,
460
- "label-width": "auto",
461
- "label-position": "top",
462
- inline: !1,
463
- "show-label": !0,
464
- "is-filter": !0,
465
- "min-width": a.minWidth,
466
- class: "filter-form-popover overflow-y-auto",
467
- onEnter: T
468
- }, F({ _: 2 }, [
469
- E(S.value, (d) => ({
470
- name: d.key,
471
- fn: n((k) => [
472
- p(o.$slots, d.key, A(H(k)), void 0, !0)
473
- ])
474
- }))
475
- ]), 1032, ["items", "form-data", "min-width"]),
476
- g("div", Te, [
477
- f(K, {
478
- "operation-list": a.operationList,
479
- onOperation: W
480
- }, F({ _: 2 }, [
481
- o.$slots.operation ? {
482
- name: "operation",
483
- fn: n(({ operationList: d }) => [
484
- p(o.$slots, "operation", { operationList: d }, void 0, !0)
485
- ]),
486
- key: "0"
487
- } : void 0
488
- ]), 1032, ["operation-list"])
489
- ])
490
- ]),
491
- _: 3
492
- }, 8, ["visible"])) : O("", !0)
493
- ], 64)) : (r(), $(x, { key: 1 }, [
494
- Q.value && a.isExpand ? (r(), m(t(z), {
495
- key: 0,
496
- icon: c.value ? t(Se) : t(We),
497
- text: "",
498
- onClick: me
499
- }, {
500
- default: n(() => [
501
- V(M(c.value ? "收起" : "展开"), 1)
502
- ]),
503
- _: 1
504
- }, 8, ["icon"])) : O("", !0),
505
- f(K, {
506
- "operation-list": a.operationList,
507
- onOperation: W
508
- }, F({ _: 2 }, [
509
- o.$slots.operation ? {
510
- name: "operation",
511
- fn: n(({ operationList: d }) => [
512
- p(o.$slots, "operation", { operationList: d }, void 0, !0)
513
- ]),
514
- key: "0"
515
- } : void 0
516
- ]), 1032, ["operation-list"])
517
- ], 64))
518
- ], 6),
519
- f(t(Me), {
520
- modelValue: e.value,
521
- "onUpdate:modelValue": s[2] || (s[2] = (d) => e.value = d),
522
- size: "628",
523
- "show-close": !1
524
- }, {
525
- header: n(() => [
526
- g("div", je, [
527
- f(te, {
528
- content: "筛选器",
529
- fontSize: 16
530
- }),
531
- f(t(ee), {
532
- size: 16,
533
- onClick: ye,
534
- class: "shrink-button"
535
- }, {
536
- default: n(() => [
537
- f(t(Be))
538
- ]),
539
- _: 1
540
- })
541
- ])
542
- ]),
543
- default: n(() => [
544
- g("div", Ae, [
545
- f(q, {
546
- items: S.value,
547
- "form-data": i.value,
548
- "label-width": "auto",
549
- "label-position": "top",
550
- inline: !1,
551
- "show-label": !0,
552
- "is-filter": !0,
553
- "min-width": a.minWidth,
554
- onEnter: T
555
- }, F({ _: 2 }, [
556
- E(S.value, (d) => ({
557
- name: d.key,
558
- fn: n((k) => [
559
- p(o.$slots, d.key, A(H(k)), void 0, !0)
560
- ])
561
- }))
562
- ]), 1032, ["items", "form-data", "min-width"])
563
- ]),
564
- g("div", He, [
565
- f(K, {
566
- "operation-list": a.operationList,
567
- onOperation: W
568
- }, F({ _: 2 }, [
569
- o.$slots.operation ? {
570
- name: "operation",
571
- fn: n(({ operationList: d }) => [
572
- p(o.$slots, "operation", { operationList: d }, void 0, !0)
573
- ]),
574
- key: "0"
575
- } : void 0
576
- ]), 1032, ["operation-list"])
577
- ])
578
- ]),
579
- _: 3
580
- }, 8, ["modelValue"])
581
- ], 2));
582
- }
583
- }), Ze = /* @__PURE__ */ ne(Ke, [["__scopeId", "data-v-fd5ceec9"]]);
584
- export {
585
- Ze as S
586
- };
@@ -1 +0,0 @@
1
- "use strict";require('../assets/layout3.css');const e=require("vue"),u=require("element-plus"),V=require("color-message-lingyun-vue"),r=require("ling-yun-methods"),P=require("./_plugin-vue_export-helper.BHFhmbuH.js"),M=require("./layout.B-T_NE6r.js"),A=[{type:"primary",label:"查询",value:r.operationConfigMap.search},{type:"default",label:"重置",value:r.operationConfigMap.reset}],S=320,B={__name:"OperationButtons",props:{operationList:{type:Array,default:()=>[]}},emits:["operation"],setup(a,{emit:h}){const k=h,c=m=>{k("operation",m)};return(m,i)=>m.$slots.operation?e.renderSlot(m.$slots,"operation",{key:0,operationList:a.operationList}):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.operationList,f=>(e.openBlock(),e.createBlock(e.unref(u.ElButton),{key:f.value,type:f.type,icon:f.icon,onClick:n=>c(f.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),_:2},1032,["type","icon","onClick"]))),128))}},j=Object.assign({name:"FormWrapper"},{__name:"FormWrapper",props:{items:{type:Array,default:()=>[]},formData:{type:Object,default:()=>({})},rules:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:"auto"},labelPosition:{type:String,default:r.labelPositionMap.right},showLabel:{type:Boolean,default:!0},inline:{type:Boolean,default:!1},isFilter:{type:Boolean,default:!1},isFilterPreview:{type:Boolean,default:!1},minWidth:{type:Number,default:S}},emits:["change","enter"],setup(a,{expose:h}){e.useCssVars(n=>({v21d4c185:a.minWidth+"px"}));const k=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./layout.BSF3ruxz.js"))),c=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./layout.DWbm8gXV.js"))),m=a,i=e.ref(null),f=e.computed(()=>m.isFilter?"filter-form":m.isFilterPreview?"filter-preview-form":"search-bar-form");return h({validate:n=>i.value?i.value.validate(n):Promise.resolve(!0),resetFields:()=>{i.value&&i.value.resetFields()},clearValidate:n=>{i.value&&i.value.clearValidate(n)},scrollToField:n=>{i.value&&i.value.scrollToField(n)}}),(n,y)=>(e.openBlock(),e.createBlock(e.unref(u.ElForm),{ref_key:"formRef",ref:i,model:a.formData,"label-width":a.labelWidth,"label-position":a.labelPosition,inline:a.inline,rules:a.rules,class:e.normalizeClass({[f.value]:!0,"items-end display-grid":!a.isFilterPreview})},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,t=>(e.openBlock(),e.createBlock(e.unref(u.ElFormItem),e.mergeProps({key:t.key,label:a.showLabel?t.label:"",prop:t.key,"show-label":a.showLabel,class:[{"search-bar-item--wide":t.wide}]},{ref_for:!0},t),{default:e.withCtx(()=>[e.renderSlot(n.$slots,t.key,{item:t,formData:a.formData},()=>[t.type===e.unref(r.componentType).text?(e.openBlock(),e.createBlock(e.unref(u.ElInput),e.mergeProps({key:0,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t,{class:"w-full",onChange:o=>n.$emit("change",t.key,a.formData[t.key]),onKeyup:e.withKeys(o=>n.$emit("enter",t.key,a.formData[t.key]),["enter"])}),null,16,["modelValue","onUpdate:modelValue","onChange","onKeyup"])):t.type===e.unref(r.componentType).select?(e.openBlock(),e.createBlock(e.unref(k),e.mergeProps({key:1,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o,"static-options":t.options},{ref_for:!0},t,{onChange:o=>n.$emit("change",t.key,a.formData[t.key]),class:"w-full"}),null,16,["modelValue","onUpdate:modelValue","static-options","onChange"])):t.type===e.unref(r.componentType).date?(e.openBlock(),e.createBlock(e.unref(u.ElDatePicker),e.mergeProps({key:2,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},{...t,...e.unref(r.dateParamsMap)[t.dateType]},{type:t.dateType,format:t.format||e.unref(r.dateFormat).date,"value-format":t.valueFormat||e.unref(r.dateFormat).dateTime,class:"w-full",onChange:o=>n.$emit("change",t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","type","format","value-format","onChange"])):t.type===e.unref(r.componentType).inputNumber?(e.openBlock(),e.createBlock(e.unref(u.ElInputNumber),e.mergeProps({key:3,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t,{class:"w-full",onChange:o=>n.$emit("change",t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(r.componentType).switch?(e.openBlock(),e.createBlock(e.unref(u.ElSwitch),e.mergeProps({key:4,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t,{onChange:o=>n.$emit("change",t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(r.componentType).radio?(e.openBlock(),e.createBlock(e.unref(u.ElRadioGroup),{key:5,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o,onChange:o=>n.$emit("change",t.key,a.formData[t.key])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,o=>(e.openBlock(),e.createBlock(e.unref(u.ElRadio),{key:o.value,label:o.value,value:o.value,disabled:o.disabled},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1032,["label","value","disabled"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(r.componentType).checkbox?(e.openBlock(),e.createBlock(e.unref(u.ElCheckboxGroup),{key:6,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o,onChange:o=>n.$emit("change",t.key,a.formData[t.key])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,o=>(e.openBlock(),e.createBlock(e.unref(u.ElCheckbox),{key:o.value,label:o.value,value:o.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1032,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(r.componentType).textarea?(e.openBlock(),e.createBlock(e.unref(u.ElInput),e.mergeProps({key:7,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t,{class:"w-full",type:"textarea",onChange:o=>n.$emit("change",t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(r.componentType).upload?(e.openBlock(),e.createBlock(e.unref(c),e.mergeProps({key:8,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],!0)]),_:2},1040,["label","prop","show-label","class"]))),128)),e.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3},8,["model","label-width","label-position","inline","rules","class"]))}}),x=P._export_sfc(j,[["__scopeId","data-v-09890bac"]]),H={class:"h-32 w-full"},K={class:"flex items-center justify-between pd-b-20"},G={class:"text-right"},Y={class:"drawer-header"},J={class:"flex-1 pd-l-16 pd-r-16 overflow-y-auto"},Q={class:"text-right border-top pd-t-16 pd-l-16 pd-r-16"},X=Object.assign({name:"SearchBar"},{__name:"layout",props:{items:{type:Array,default:()=>[]},modelValue:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:"auto"},labelPosition:{type:String,default:r.labelPositionMap.right,validator:a=>[r.labelPositionMap.left,r.labelPositionMap.right,r.labelPositionMap.top].includes(a)},isExpand:{type:Boolean,default:!0},maxHeight:{type:Number,default:84},minWidth:{type:Number,default:S},operationList:{type:Array,default:A},filterMode:{type:Boolean,default:!0}},emits:[r.emitsMap.updateModelValue,r.emitsMap.operation],setup(a,{expose:h,emit:k}){e.useCssVars(l=>({v2e56a75a:a.maxHeight+"px",v63e17c4e:C.value?C.value+"px":"100%"}));const c=a,m=k,i=e.ref({}),f=e.ref(!c.isExpand),n=e.ref(null),y=e.ref(!1),t=e.ref(!1),o=e.computed(()=>{const l={};return c.items.forEach(s=>{if(s.required){const d=[{required:!0,message:`${s.label}不能为空`,trigger:"blur"}];typeof s.validator=="function"&&d.push({validator:s.validator,trigger:"blur"}),l[s.key]=d}}),l}),b=e.computed(()=>c.items?.filter(l=>!l.hidden)||[]),E=e.computed(()=>c.filterMode?b.value?.slice(0,2)||[]:b.value),v=e.computed(()=>c.filterMode?b.value.slice(2):[]),D=l=>{i.value={...l}},F=()=>{m(r.emitsMap.updateModelValue,{...i.value})},T=(l,s)=>{i.value[l]=s,g(r.operationConfigMap.search)},L=()=>i.value,w=(l,s)=>{m(r.emitsMap.operation,r.operationConfigMap.search,i.value)},g=l=>{F(),m(r.emitsMap.operation,l,i.value),(l===r.operationConfigMap.search||l===r.operationConfigMap.reset)&&(y.value=!1,t.value=!1)},U=l=>n.value.validate(l),C=e.ref(0),I=l=>{C.value=l+32},W=()=>{f.value=!f.value},z=()=>{y.value=!1,t.value=!0},R=()=>{t.value=!1,y.value=!0},N=e.ref(!1),$=l=>{N.value=l>c.maxHeight},O=e.computed(()=>c.filterMode||f.value?"10px":"0");return e.onMounted(()=>{D(c.modelValue),$()}),e.watch(()=>c.modelValue,l=>{D(l)},{immediate:!0,deep:!0}),h({validate:U,getFormData:L,formRef:n}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative overflow-hidden w-full",{flex:a.filterMode}])},[e.createElementVNode("div",{class:e.normalizeClass({"is-collapsed overflow-hidden":!f.value})},[e.createVNode(e.unref(u.ElAutoResizer),null,{default:e.withCtx(({height:d})=>[e.createTextVNode(e.toDisplayString($(d))+" ",1),e.createVNode(x,{ref_key:"formRef",ref:n,items:E.value,"form-data":i.value,rules:o.value,"label-width":a.labelWidth,"label-position":a.labelPosition,inline:!0,"show-label":!a.filterMode,"min-width":a.minWidth,"is-filter-preview":a.filterMode,onChange:T,onEnter:w},e.createSlots({default:e.withCtx(()=>[a.isExpand&&!a.filterMode?(e.openBlock(),e.createBlock(e.unref(u.ElFormItem),{key:0},{default:e.withCtx(()=>[e.createElementVNode("div",H,[e.createVNode(e.unref(u.ElAutoResizer),null,{default:e.withCtx(({width:p})=>[e.createTextVNode(e.toDisplayString(I(p)),1)]),_:1})])]),_:1})):e.createCommentVNode("",!0)]),_:2},[e.renderList(E.value,p=>({name:p.key,fn:e.withCtx(q=>[e.renderSlot(l.$slots,p.key,e.normalizeProps(e.guardReactiveProps(q)),void 0,!0)])}))]),1032,["items","form-data","rules","label-width","label-position","show-label","min-width","is-filter-preview"])]),_:3})],2),e.createElementVNode("div",{class:e.normalizeClass(["operation-buttons",{"absolute right-0 bg-fff text-right":a.isExpand&&!a.filterMode,"text-left":a.filterMode}]),style:e.normalizeStyle({bottom:O.value})},[a.filterMode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(u.ElButton),{onClick:s[0]||(s[0]=d=>g(e.unref(r.operationConfigMap).reset)),type:"default"},{default:e.withCtx(()=>[...s[3]||(s[3]=[e.createTextVNode("重置",-1)])]),_:1}),v.value?.length?(e.openBlock(),e.createBlock(e.unref(u.ElPopover),{key:0,visible:y.value,placement:"bottom-start",width:628,trigger:"click"},{reference:e.withCtx(()=>[e.createVNode(e.unref(u.ElButton),{onClick:s[1]||(s[1]=d=>y.value=!y.value),icon:e.unref(V.IconCheck),type:"default"},{default:e.withCtx(()=>[...s[4]||(s[4]=[e.createTextVNode(" 筛选器 ",-1)])]),_:1},8,["icon"])]),default:e.withCtx(()=>[e.createElementVNode("div",K,[e.createVNode(M.CustomTitle,{content:"筛选器",fontSize:16}),e.createVNode(e.unref(u.ElIcon),{size:16,onClick:z},{default:e.withCtx(()=>[e.createVNode(e.unref(V.IconMagnify))]),_:1})]),e.createVNode(x,{items:v.value,"form-data":i.value,"label-width":"auto","label-position":"top",inline:!1,"show-label":!0,"is-filter":!0,"min-width":a.minWidth,class:"filter-form-popover overflow-y-auto",onEnter:w},e.createSlots({_:2},[e.renderList(v.value,d=>({name:d.key,fn:e.withCtx(p=>[e.renderSlot(l.$slots,d.key,e.normalizeProps(e.guardReactiveProps(p)),void 0,!0)])}))]),1032,["items","form-data","min-width"]),e.createElementVNode("div",G,[e.createVNode(B,{"operation-list":a.operationList,onOperation:g},e.createSlots({_:2},[l.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:d})=>[e.renderSlot(l.$slots,"operation",{operationList:d},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])])]),_:3},8,["visible"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[N.value&&a.isExpand?(e.openBlock(),e.createBlock(e.unref(u.ElButton),{key:0,icon:f.value?e.unref(V.IconUp):e.unref(V.IconDown),text:"",onClick:W},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value?"收起":"展开"),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0),e.createVNode(B,{"operation-list":a.operationList,onOperation:g},e.createSlots({_:2},[l.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:d})=>[e.renderSlot(l.$slots,"operation",{operationList:d},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])],64))],6),e.createVNode(e.unref(u.ElDrawer),{modelValue:t.value,"onUpdate:modelValue":s[2]||(s[2]=d=>t.value=d),size:"628","show-close":!1},{header:e.withCtx(()=>[e.createElementVNode("div",Y,[e.createVNode(M.CustomTitle,{content:"筛选器",fontSize:16}),e.createVNode(e.unref(u.ElIcon),{size:16,onClick:R,class:"shrink-button"},{default:e.withCtx(()=>[e.createVNode(e.unref(V.IconShrink))]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",J,[e.createVNode(x,{items:v.value,"form-data":i.value,"label-width":"auto","label-position":"top",inline:!1,"show-label":!0,"is-filter":!0,"min-width":a.minWidth,onEnter:w},e.createSlots({_:2},[e.renderList(v.value,d=>({name:d.key,fn:e.withCtx(p=>[e.renderSlot(l.$slots,d.key,e.normalizeProps(e.guardReactiveProps(p)),void 0,!0)])}))]),1032,["items","form-data","min-width"])]),e.createElementVNode("div",Q,[e.createVNode(B,{"operation-list":a.operationList,onOperation:g},e.createSlots({_:2},[l.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:d})=>[e.renderSlot(l.$slots,"operation",{operationList:d},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])])]),_:3},8,["modelValue"])],2))}}),Z=P._export_sfc(X,[["__scopeId","data-v-fd5ceec9"]]);exports.SearchBar=Z;
@@ -1 +0,0 @@
1
- "use strict";require('../assets/layout3.css');const e=require("vue"),u=require("element-plus"),V=require("color-message-lingyun-vue"),n=require("ling-yun-methods"),P=require("./_plugin-vue_export-helper.BHFhmbuH.js"),M=require("./layout.B-T_NE6r.js"),A=[{type:"primary",label:"查询",value:n.operationConfigMap.search},{type:"default",label:"重置",value:n.operationConfigMap.reset}],S=320,B={__name:"OperationButtons",props:{operationList:{type:Array,default:()=>[]}},emits:["operation"],setup(a,{emit:h}){const k=h,c=m=>{k("operation",m)};return(m,i)=>m.$slots.operation?e.renderSlot(m.$slots,"operation",{key:0,operationList:a.operationList}):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(a.operationList,f=>(e.openBlock(),e.createBlock(e.unref(u.ElButton),{key:f.value,type:f.type,icon:f.icon,onClick:r=>c(f.value)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.label),1)]),_:2},1032,["type","icon","onClick"]))),128))}},j=Object.assign({name:"FormWrapper"},{__name:"FormWrapper",props:{items:{type:Array,default:()=>[]},formData:{type:Object,default:()=>({})},rules:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:"auto"},labelPosition:{type:String,default:n.labelPositionMap.right},showLabel:{type:Boolean,default:!0},inline:{type:Boolean,default:!1},isFilter:{type:Boolean,default:!1},isFilterPreview:{type:Boolean,default:!1},minWidth:{type:Number,default:S}},emits:["change","enter"],setup(a,{expose:h}){e.useCssVars(r=>({v6636f7d5:a.minWidth+"px"}));const k=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./layout.BSF3ruxz.js"))),c=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./layout.DWbm8gXV.js"))),m=a,i=e.ref(null),f=e.computed(()=>m.isFilter?"filter-form":m.isFilterPreview?"filter-preview-form":"search-bar-form");return h({validate:r=>i.value?i.value.validate(r):Promise.resolve(!0),resetFields:()=>{i.value&&i.value.resetFields()},clearValidate:r=>{i.value&&i.value.clearValidate(r)},scrollToField:r=>{i.value&&i.value.scrollToField(r)}}),(r,y)=>(e.openBlock(),e.createBlock(e.unref(u.ElForm),{ref_key:"formRef",ref:i,model:a.formData,"label-width":a.labelWidth,"label-position":a.labelPosition,inline:a.inline,rules:a.rules,class:e.normalizeClass({[f.value]:!0,"items-end display-grid":!a.isFilterPreview})},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,t=>(e.openBlock(),e.createBlock(e.unref(u.ElFormItem),e.mergeProps({key:t.key,label:a.showLabel?t.label:"",prop:t.key,"show-label":a.showLabel,class:[{"search-bar-item--wide":t.wide}]},{ref_for:!0},t),{default:e.withCtx(()=>[e.renderSlot(r.$slots,t.key,{item:t,formData:a.formData},()=>[t.type===e.unref(n.componentType).text?(e.openBlock(),e.createBlock(e.unref(u.ElInput),e.mergeProps({key:0,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t,{class:"w-full",onChange:o=>r.$emit("change",t.key,a.formData[t.key]),onKeyup:e.withKeys(o=>r.$emit("enter",t.key,a.formData[t.key]),["enter"])}),null,16,["modelValue","onUpdate:modelValue","onChange","onKeyup"])):t.type===e.unref(n.componentType).select?(e.openBlock(),e.createBlock(e.unref(k),e.mergeProps({key:1,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o,"static-options":t.options},{ref_for:!0},t,{onChange:o=>r.$emit("change",t.key,a.formData[t.key]),class:"w-full"}),null,16,["modelValue","onUpdate:modelValue","static-options","onChange"])):t.type===e.unref(n.componentType).date?(e.openBlock(),e.createBlock(e.unref(u.ElDatePicker),e.mergeProps({key:2,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},{...t,...e.unref(n.dateParamsMap)[t.dateType]},{type:t.dateType,format:t.format||e.unref(n.dateFormat).date,"value-format":t.valueFormat||e.unref(n.dateFormat).dateTime,class:"w-full",onChange:o=>r.$emit("change",t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","type","format","value-format","onChange"])):t.type===e.unref(n.componentType).inputNumber?(e.openBlock(),e.createBlock(e.unref(u.ElInputNumber),e.mergeProps({key:3,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t,{class:"w-full",onChange:o=>r.$emit("change",t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(n.componentType).switch?(e.openBlock(),e.createBlock(e.unref(u.ElSwitch),e.mergeProps({key:4,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t,{onChange:o=>r.$emit("change",t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(n.componentType).radio?(e.openBlock(),e.createBlock(e.unref(u.ElRadioGroup),{key:5,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o,onChange:o=>r.$emit("change",t.key,a.formData[t.key])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,o=>(e.openBlock(),e.createBlock(e.unref(u.ElRadio),{key:o.value,label:o.value,value:o.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1032,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(n.componentType).checkbox?(e.openBlock(),e.createBlock(e.unref(u.ElCheckboxGroup),{key:6,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o,onChange:o=>r.$emit("change",t.key,a.formData[t.key])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,o=>(e.openBlock(),e.createBlock(e.unref(u.ElCheckbox),{key:o.value,label:o.value,value:o.value},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.label),1)]),_:2},1032,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(n.componentType).textarea?(e.openBlock(),e.createBlock(e.unref(u.ElInput),e.mergeProps({key:7,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t,{class:"w-full",type:"textarea",onChange:o=>r.$emit("change",t.key,a.formData[t.key])}),null,16,["modelValue","onUpdate:modelValue","onChange"])):t.type===e.unref(n.componentType).upload?(e.openBlock(),e.createBlock(e.unref(c),e.mergeProps({key:8,modelValue:a.formData[t.key],"onUpdate:modelValue":o=>a.formData[t.key]=o},{ref_for:!0},t),null,16,["modelValue","onUpdate:modelValue"])):e.createCommentVNode("",!0)],!0)]),_:2},1040,["label","prop","show-label","class"]))),128)),e.renderSlot(r.$slots,"default",{},void 0,!0)]),_:3},8,["model","label-width","label-position","inline","rules","class"]))}}),x=P._export_sfc(j,[["__scopeId","data-v-bdd1bd85"]]),H={class:"h-32 w-full"},K={class:"flex items-center justify-between pd-b-20"},G={class:"text-right"},Y={class:"drawer-header"},J={class:"flex-1 pd-l-16 pd-r-16 overflow-y-auto"},Q={class:"text-right border-top pd-t-16 pd-l-16 pd-r-16"},X=Object.assign({name:"SearchBar"},{__name:"layout",props:{items:{type:Array,default:()=>[]},modelValue:{type:Object,default:()=>({})},labelWidth:{type:[String,Number],default:"auto"},labelPosition:{type:String,default:n.labelPositionMap.right,validator:a=>[n.labelPositionMap.left,n.labelPositionMap.right,n.labelPositionMap.top].includes(a)},isExpand:{type:Boolean,default:!0},maxHeight:{type:Number,default:84},minWidth:{type:Number,default:S},operationList:{type:Array,default:A},filterMode:{type:Boolean,default:!0}},emits:[n.emitsMap.updateModelValue,n.emitsMap.operation],setup(a,{expose:h,emit:k}){e.useCssVars(l=>({v2e56a75a:a.maxHeight+"px",v63e17c4e:C.value?C.value+"px":"100%"}));const c=a,m=k,i=e.ref({}),f=e.ref(!c.isExpand),r=e.ref(null),y=e.ref(!1),t=e.ref(!1),o=e.computed(()=>{const l={};return c.items.forEach(s=>{if(s.required){const d=[{required:!0,message:`${s.label}不能为空`,trigger:"blur"}];typeof s.validator=="function"&&d.push({validator:s.validator,trigger:"blur"}),l[s.key]=d}}),l}),b=e.computed(()=>c.items?.filter(l=>!l.hidden)||[]),E=e.computed(()=>c.filterMode?b.value?.slice(0,2)||[]:b.value),v=e.computed(()=>c.filterMode?b.value.slice(2):[]),D=l=>{i.value={...l}},F=()=>{m(n.emitsMap.updateModelValue,{...i.value})},T=(l,s)=>{i.value[l]=s,g(n.operationConfigMap.search)},L=()=>i.value,w=(l,s)=>{m(n.emitsMap.operation,n.operationConfigMap.search,i.value)},g=l=>{F(),m(n.emitsMap.operation,l,i.value),(l===n.operationConfigMap.search||l===n.operationConfigMap.reset)&&(y.value=!1,t.value=!1)},U=l=>r.value.validate(l),C=e.ref(0),I=l=>{C.value=l+32},W=()=>{f.value=!f.value},z=()=>{y.value=!1,t.value=!0},R=()=>{t.value=!1,y.value=!0},N=e.ref(!1),$=l=>{N.value=l>c.maxHeight},O=e.computed(()=>c.filterMode||f.value?"10px":"0");return e.onMounted(()=>{D(c.modelValue),$()}),e.watch(()=>c.modelValue,l=>{D(l)},{immediate:!0,deep:!0}),h({validate:U,getFormData:L,formRef:r}),(l,s)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["relative overflow-hidden w-full",{flex:a.filterMode}])},[e.createElementVNode("div",{class:e.normalizeClass({"is-collapsed overflow-hidden":!f.value})},[e.createVNode(e.unref(u.ElAutoResizer),null,{default:e.withCtx(({height:d})=>[e.createTextVNode(e.toDisplayString($(d))+" ",1),e.createVNode(x,{ref_key:"formRef",ref:r,items:E.value,"form-data":i.value,rules:o.value,"label-width":a.labelWidth,"label-position":a.labelPosition,inline:!0,"show-label":!a.filterMode,"min-width":a.minWidth,"is-filter-preview":a.filterMode,onChange:T,onEnter:w},e.createSlots({default:e.withCtx(()=>[a.isExpand&&!a.filterMode?(e.openBlock(),e.createBlock(e.unref(u.ElFormItem),{key:0},{default:e.withCtx(()=>[e.createElementVNode("div",H,[e.createVNode(e.unref(u.ElAutoResizer),null,{default:e.withCtx(({width:p})=>[e.createTextVNode(e.toDisplayString(I(p)),1)]),_:1})])]),_:1})):e.createCommentVNode("",!0)]),_:2},[e.renderList(E.value,p=>({name:p.key,fn:e.withCtx(q=>[e.renderSlot(l.$slots,p.key,e.normalizeProps(e.guardReactiveProps(q)),void 0,!0)])}))]),1032,["items","form-data","rules","label-width","label-position","show-label","min-width","is-filter-preview"])]),_:3})],2),e.createElementVNode("div",{class:e.normalizeClass(["operation-buttons",{"absolute right-0 bg-fff text-right":a.isExpand&&!a.filterMode,"text-left":a.filterMode}]),style:e.normalizeStyle({bottom:O.value})},[a.filterMode?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(e.unref(u.ElButton),{onClick:s[0]||(s[0]=d=>g(e.unref(n.operationConfigMap).reset)),type:"default"},{default:e.withCtx(()=>[...s[3]||(s[3]=[e.createTextVNode("重置",-1)])]),_:1}),v.value?.length?(e.openBlock(),e.createBlock(e.unref(u.ElPopover),{key:0,visible:y.value,placement:"bottom-start",width:628,trigger:"click"},{reference:e.withCtx(()=>[e.createVNode(e.unref(u.ElButton),{onClick:s[1]||(s[1]=d=>y.value=!y.value),icon:e.unref(V.IconCheck),type:"default"},{default:e.withCtx(()=>[...s[4]||(s[4]=[e.createTextVNode(" 筛选器 ",-1)])]),_:1},8,["icon"])]),default:e.withCtx(()=>[e.createElementVNode("div",K,[e.createVNode(M.CustomTitle,{content:"筛选器",fontSize:16}),e.createVNode(e.unref(u.ElIcon),{size:16,onClick:z},{default:e.withCtx(()=>[e.createVNode(e.unref(V.IconMagnify))]),_:1})]),e.createVNode(x,{items:v.value,"form-data":i.value,"label-width":"auto","label-position":"top",inline:!1,"show-label":!0,"is-filter":!0,"min-width":a.minWidth,class:"filter-form-popover overflow-y-auto",onEnter:w},e.createSlots({_:2},[e.renderList(v.value,d=>({name:d.key,fn:e.withCtx(p=>[e.renderSlot(l.$slots,d.key,e.normalizeProps(e.guardReactiveProps(p)),void 0,!0)])}))]),1032,["items","form-data","min-width"]),e.createElementVNode("div",G,[e.createVNode(B,{"operation-list":a.operationList,onOperation:g},e.createSlots({_:2},[l.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:d})=>[e.renderSlot(l.$slots,"operation",{operationList:d},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])])]),_:3},8,["visible"])):e.createCommentVNode("",!0)],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[N.value&&a.isExpand?(e.openBlock(),e.createBlock(e.unref(u.ElButton),{key:0,icon:f.value?e.unref(V.IconUp):e.unref(V.IconDown),text:"",onClick:W},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(f.value?"收起":"展开"),1)]),_:1},8,["icon"])):e.createCommentVNode("",!0),e.createVNode(B,{"operation-list":a.operationList,onOperation:g},e.createSlots({_:2},[l.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:d})=>[e.renderSlot(l.$slots,"operation",{operationList:d},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])],64))],6),e.createVNode(e.unref(u.ElDrawer),{modelValue:t.value,"onUpdate:modelValue":s[2]||(s[2]=d=>t.value=d),size:"628","show-close":!1},{header:e.withCtx(()=>[e.createElementVNode("div",Y,[e.createVNode(M.CustomTitle,{content:"筛选器",fontSize:16}),e.createVNode(e.unref(u.ElIcon),{size:16,onClick:R,class:"shrink-button"},{default:e.withCtx(()=>[e.createVNode(e.unref(V.IconShrink))]),_:1})])]),default:e.withCtx(()=>[e.createElementVNode("div",J,[e.createVNode(x,{items:v.value,"form-data":i.value,"label-width":"auto","label-position":"top",inline:!1,"show-label":!0,"is-filter":!0,"min-width":a.minWidth,onEnter:w},e.createSlots({_:2},[e.renderList(v.value,d=>({name:d.key,fn:e.withCtx(p=>[e.renderSlot(l.$slots,d.key,e.normalizeProps(e.guardReactiveProps(p)),void 0,!0)])}))]),1032,["items","form-data","min-width"])]),e.createElementVNode("div",Q,[e.createVNode(B,{"operation-list":a.operationList,onOperation:g},e.createSlots({_:2},[l.$slots.operation?{name:"operation",fn:e.withCtx(({operationList:d})=>[e.renderSlot(l.$slots,"operation",{operationList:d},void 0,!0)]),key:"0"}:void 0]),1032,["operation-list"])])]),_:3},8,["modelValue"])],2))}}),Z=P._export_sfc(X,[["__scopeId","data-v-fd5ceec9"]]);exports.SearchBar=Z;