fec-dev-designer 1.1.2 → 5.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/es/node_modules/element-plus/{dist/locale → es/locale/lang}/zh-cn.js +0 -1
  2. package/es/package.json.js +66 -0
  3. package/es/src/assets/approvalHistory.png.js +4 -0
  4. package/es/src/assets/logo.png.js +4 -0
  5. package/es/src/components/DataSourceSelect.vue.js +2 -1
  6. package/es/src/components/FieldSetMapping.vue.js +245 -108
  7. package/es/src/components/OptionConfig.vue.js +3 -2
  8. package/es/src/components/OptionConfig.vue2.js +2 -2
  9. package/es/src/components/ParamsConfig.vue.js +2 -2
  10. package/es/src/components/ParamsConfig.vue2.js +31 -32
  11. package/es/src/components/TemplateSelector.vue.js +101 -81
  12. package/es/src/components/ValueSelector.vue2.js +49 -39
  13. package/es/src/layout/aside/HiddenFieldDialog.vue.js +313 -0
  14. package/es/src/{packages/form → layout/aside}/fieldRecycleBin.vue.js +72 -64
  15. package/es/src/layout/aside/index.vue.js +47 -50
  16. package/es/src/layout/header/index.vue.js +95 -84
  17. package/es/src/layout/index.vue.js +81 -76
  18. package/es/src/packages/advancedFilter/ValueInput.vue2.js +57 -60
  19. package/es/src/packages/dataSource/dataSource.vue.js +98 -105
  20. package/es/src/packages/dialog/index.vue.js +446 -322
  21. package/es/src/packages/event/index.vue2.js +44 -44
  22. package/es/src/packages/event/useEventDialog.js +2 -2
  23. package/es/src/packages/eventFlow/dialog/action/FormSubmit.vue2.js +47 -54
  24. package/es/src/packages/eventFlow/dialog/action/Page.vue.js +42 -49
  25. package/es/src/packages/form/aside/index.js +28 -2
  26. package/es/src/packages/form/aside/roleSelect.js +156 -0
  27. package/es/src/packages/form/aside/userSelect.js +206 -0
  28. package/es/src/packages/form/components/ApprovalHistory.vue.js +73 -0
  29. package/es/src/packages/form/components/ApprovalHistory.vue2.js +4 -0
  30. package/es/src/packages/form/components/ComponentPreviewWrapper.vue.js +51 -41
  31. package/es/src/packages/form/components/H2Wrapper.vue.js +13 -10
  32. package/es/src/packages/form/demo.js +8064 -0
  33. package/es/src/packages/form/headerBtn.vue.js +120 -99
  34. package/es/src/packages/form/index.vue.js +206 -180
  35. package/es/src/packages/form/property/approvalHistory.vue.js +178 -0
  36. package/es/src/packages/form/property/index.vue.js +23 -22
  37. package/es/src/packages/form/property/subTable.vue.js +37 -43
  38. package/es/src/packages/form/property/widgets.vue.js +258 -202
  39. package/es/src/packages/table/aside/index.js +2 -1
  40. package/es/src/packages/table/default.js +24 -21
  41. package/es/src/packages/table/index.vue.js +191 -155
  42. package/es/src/packages/table/property/widgets.vue.js +63 -47
  43. package/es/src/packages/table/queryModule/FixedModeConfig.vue.js +76 -77
  44. package/es/src/packages/table/queryModule/index.vue.js +108 -91
  45. package/es/src/packages/utils/common.js +33 -29
  46. package/es/style.css +1 -1
  47. package/package.json +1 -1
  48. package/es/src/packages/form/HiddenFieldDialog.vue.js +0 -258
  49. /package/es/src/{packages/form → layout/aside}/HiddenFieldDialog.vue2.js +0 -0
  50. /package/es/src/{packages/form → layout/aside}/fieldRecycleBin.vue2.js +0 -0
@@ -1,17 +1,17 @@
1
1
  import "../../node_modules/element-plus/theme-chalk/base.css.js";
2
2
  import "../../node_modules/element-plus/theme-chalk/el-input.css.js";
3
3
  import "../../node_modules/element-plus/theme-chalk/el-button.css.js";
4
- import { computed as g, openBlock as o, createElementBlock as d, unref as t, createBlock as C, withCtx as u, createTextVNode as v, createElementVNode as e, Fragment as x, renderList as z, createVNode as n } from "vue";
5
- import { Plus as _, Delete as P } from "../../node_modules/@element-plus/icons-vue/dist/index.js";
4
+ import { computed as C, openBlock as o, createElementBlock as d, unref as t, createBlock as x, withCtx as p, createTextVNode as u, createElementVNode as e, Fragment as z, renderList as P, createVNode as i } from "vue";
5
+ import { Plus as _, Delete as b } from "../../node_modules/@element-plus/icons-vue/dist/index.js";
6
6
  import B from "./ValueSelector.vue2.js";
7
7
  import "./ParamsConfig.vue.js";
8
8
  import E from "../../_virtual/_plugin-vue_export-helper.js";
9
9
  import { ElButton as U } from "../../node_modules/element-plus/es/components/button/index.js";
10
10
  import { ElInput as w } from "../../node_modules/element-plus/es/components/input/index.js";
11
- const F = { class: "params-config-container" }, N = {
11
+ const N = { class: "params-config-container" }, A = {
12
12
  key: 1,
13
13
  class: "params-table"
14
- }, A = { class: "params-body" }, D = { class: "params-cell key-params" }, I = { class: "params-cell value-params" }, L = { class: "params-cell action-cell" }, S = { class: "params-footer" }, T = {
14
+ }, D = { class: "params-body" }, F = { class: "params-cell key-params" }, I = { class: "params-cell value-params" }, L = { class: "params-cell action-cell" }, S = { class: "params-footer" }, T = {
15
15
  __name: "ParamsConfig",
16
16
  props: {
17
17
  modelValue: {
@@ -24,12 +24,12 @@ const F = { class: "params-config-container" }, N = {
24
24
  }
25
25
  },
26
26
  emits: ["update:modelValue"],
27
- setup(c, { emit: f }) {
28
- const y = c, s = g({
27
+ setup(f, { emit: v }) {
28
+ const y = f, s = C({
29
29
  get: () => y.modelValue,
30
30
  set: (r) => k("update:modelValue", r)
31
- }), k = f;
32
- function p() {
31
+ }), k = v;
32
+ function c() {
33
33
  s.value.push({
34
34
  id: Date.now(),
35
35
  key: "",
@@ -41,68 +41,67 @@ const F = { class: "params-config-container" }, N = {
41
41
  }
42
42
  return (r, a) => {
43
43
  const m = U, h = w;
44
- return o(), d("div", F, [
45
- t(s).length === 0 ? (o(), C(m, {
44
+ return o(), d("div", N, [
45
+ t(s).length === 0 ? (o(), x(m, {
46
46
  key: 0,
47
47
  type: "primary",
48
48
  size: "small",
49
49
  icon: t(_),
50
50
  link: "",
51
- onClick: p
51
+ onClick: c
52
52
  }, {
53
- default: u(() => [...a[0] || (a[0] = [
54
- v(" 新增参数 ", -1)
53
+ default: p(() => [...a[0] || (a[0] = [
54
+ u(" 新增参数 ", -1)
55
55
  ])]),
56
56
  _: 1
57
- }, 8, ["icon"])) : (o(), d("div", N, [
57
+ }, 8, ["icon"])) : (o(), d("div", A, [
58
58
  a[2] || (a[2] = e("div", { class: "params-header" }, [
59
59
  e("div", { class: "params-cell key-header" }, "键名"),
60
60
  e("div", { class: "params-cell value-header" }, "值"),
61
61
  e("div", { class: "params-cell action-header" })
62
62
  ], -1)),
63
- e("div", A, [
64
- (o(!0), d(x, null, z(t(s), (l, b) => (o(), d("div", {
63
+ e("div", D, [
64
+ (o(!0), d(z, null, P(t(s), (l, g) => (o(), d("div", {
65
65
  key: l.id,
66
66
  class: "params-row"
67
67
  }, [
68
- e("div", D, [
69
- n(h, {
68
+ e("div", F, [
69
+ i(h, {
70
70
  modelValue: l.key,
71
- "onUpdate:modelValue": (i) => l.key = i,
71
+ "onUpdate:modelValue": (n) => l.key = n,
72
72
  placeholder: "参数名",
73
73
  size: "small"
74
74
  }, null, 8, ["modelValue", "onUpdate:modelValue"])
75
75
  ]),
76
76
  e("div", I, [
77
- n(B, {
77
+ i(B, {
78
78
  modelValue: l.value,
79
- "onUpdate:modelValue": (i) => l.value = i,
79
+ "onUpdate:modelValue": (n) => l.value = n,
80
80
  placeholder: "参数值",
81
- size: "small",
82
- "available-fields": c.availableFields
83
- }, null, 8, ["modelValue", "onUpdate:modelValue", "available-fields"])
81
+ size: "small"
82
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
84
83
  ]),
85
84
  e("div", L, [
86
- n(m, {
85
+ i(m, {
87
86
  type: "danger",
88
87
  size: "small",
89
- icon: t(P),
88
+ icon: t(b),
90
89
  text: "",
91
- onClick: (i) => V(b)
90
+ onClick: (n) => V(g)
92
91
  }, null, 8, ["icon", "onClick"])
93
92
  ])
94
93
  ]))), 128))
95
94
  ]),
96
95
  e("div", S, [
97
- n(m, {
96
+ i(m, {
98
97
  type: "primary",
99
98
  size: "small",
100
99
  icon: t(_),
101
100
  link: "",
102
- onClick: p
101
+ onClick: c
103
102
  }, {
104
- default: u(() => [...a[1] || (a[1] = [
105
- v(" 新增参数 ", -1)
103
+ default: p(() => [...a[1] || (a[1] = [
104
+ u(" 新增参数 ", -1)
106
105
  ])]),
107
106
  _: 1
108
107
  }, 8, ["icon"])
@@ -111,7 +110,7 @@ const F = { class: "params-config-container" }, N = {
111
110
  ]);
112
111
  };
113
112
  }
114
- }, R = /* @__PURE__ */ E(T, [["__scopeId", "data-v-25e36c19"]]);
113
+ }, R = /* @__PURE__ */ E(T, [["__scopeId", "data-v-097f1353"]]);
115
114
  export {
116
115
  R as default
117
116
  };
@@ -14,20 +14,20 @@ import "../../node_modules/element-plus/theme-chalk/el-checkbox.css.js";
14
14
  import "../../node_modules/element-plus/theme-chalk/el-tooltip.css.js";
15
15
  import "../../node_modules/element-plus/theme-chalk/el-table-column.css.js";
16
16
  import "../../node_modules/element-plus/theme-chalk/el-button.css.js";
17
- import { computed as P, ref as r, openBlock as U, createElementBlock as B, Fragment as j, createVNode as a, withCtx as p, unref as V, createElementVNode as C, createTextVNode as z, withKeys as D } from "vue";
18
- import { Setting as L, Search as F } from "../../node_modules/@element-plus/icons-vue/dist/index.js";
19
- import J from "../api/index.js";
17
+ import { computed as P, ref as r, openBlock as B, createElementBlock as j, Fragment as L, createVNode as a, createSlots as D, withCtx as i, unref as w, createElementVNode as z, createTextVNode as C, withKeys as O } from "vue";
18
+ import { Setting as R, Edit as F, Search as J } from "../../node_modules/@element-plus/icons-vue/dist/index.js";
19
+ import M from "../api/index.js";
20
20
  import "../../node_modules/element-plus/theme-chalk/el-badge.css.js";
21
21
  import "../../node_modules/element-plus/theme-chalk/el-message.css.js";
22
22
  import "./TemplateSelector.vue2.js";
23
- import M from "../../_virtual/_plugin-vue_export-helper.js";
24
- import { ElMessage as O } from "../../node_modules/element-plus/es/components/message/index.js";
25
- import { ElButton as Q } from "../../node_modules/element-plus/es/components/button/index.js";
26
- import { ElInput as R } from "../../node_modules/element-plus/es/components/input/index.js";
27
- import { ElTableColumn as $, ElTable as q } from "../../node_modules/element-plus/es/components/table/index.js";
28
- import { ElPagination as A } from "../../node_modules/element-plus/es/components/pagination/index.js";
29
- import { ElDialog as G } from "../../node_modules/element-plus/es/components/dialog/index.js";
30
- const H = { class: "search-bar" }, W = { class: "dialog-footer" }, X = {
23
+ import Q from "../../_virtual/_plugin-vue_export-helper.js";
24
+ import { ElMessage as $ } from "../../node_modules/element-plus/es/components/message/index.js";
25
+ import { ElButton as q } from "../../node_modules/element-plus/es/components/button/index.js";
26
+ import { ElInput as A } from "../../node_modules/element-plus/es/components/input/index.js";
27
+ import { ElTableColumn as G, ElTable as H } from "../../node_modules/element-plus/es/components/table/index.js";
28
+ import { ElPagination as W } from "../../node_modules/element-plus/es/components/pagination/index.js";
29
+ import { ElDialog as X } from "../../node_modules/element-plus/es/components/dialog/index.js";
30
+ const Y = { class: "search-bar" }, Z = { class: "dialog-footer" }, ee = {
31
31
  __name: "TemplateSelector",
32
32
  props: {
33
33
  modelValue: {
@@ -53,137 +53,157 @@ const H = { class: "search-bar" }, W = { class: "dialog-footer" }, X = {
53
53
  "update:templateId",
54
54
  "confirm"
55
55
  ],
56
- setup(c, { emit: b }) {
57
- const _ = c, u = b, g = P({
58
- get: () => _.modelValue,
59
- set: (t) => u("update:modelValue", t)
60
- }), i = r(!1), m = r(""), f = r([]), v = r(0), n = r(null), l = r({
56
+ setup(v, { emit: V }) {
57
+ const y = v, d = V, s = P({
58
+ get: () => y.modelValue,
59
+ set: (t) => d("update:modelValue", t)
60
+ }), u = r(!1), c = r(""), _ = r([]), S = r(0), n = r(null), l = r({
61
61
  pageNo: 1,
62
62
  pageSize: 10
63
63
  });
64
+ function b() {
65
+ u.value = !0, n.value = null, f();
66
+ }
64
67
  function x() {
65
- i.value = !0, n.value = null, d();
68
+ var m;
69
+ const t = ((m = n.value) == null ? void 0 : m.pkId) || y.templateId, e = window.location.href, p = new URL(e);
70
+ p.searchParams.set("pkId", t);
71
+ const g = p.toString();
72
+ window.open(g, "_blank");
66
73
  }
67
- async function d() {
74
+ async function f() {
68
75
  try {
69
76
  const t = {
70
77
  pageNo: l.value.pageNo,
71
78
  pageSize: l.value.pageSize,
72
- type: _.templateType
79
+ type: y.templateType
73
80
  };
74
- m.value && (t.dynamicQuery = m.value);
75
- const e = await J.findTemplateByPagePop(t);
76
- f.value = e.records || e.list || [], v.value = e.total || 0;
81
+ c.value && (t.dynamicQuery = c.value);
82
+ const e = await M.findTemplateByPagePop(t);
83
+ _.value = e.records || e.list || [], S.value = e.total || 0;
77
84
  } catch (t) {
78
- console.error("加载表单列表失败:", t), f.value = [], v.value = 0;
85
+ console.error("加载表单列表失败:", t), _.value = [], S.value = 0;
79
86
  } finally {
80
87
  }
81
88
  }
82
- function y() {
83
- l.value.pageNo = 1, d();
89
+ function h() {
90
+ l.value.pageNo = 1, f();
84
91
  }
85
92
  function N(t) {
86
93
  n.value = t;
87
94
  }
88
- function w(t) {
89
- l.value.pageSize = t, l.value.pageNo = 1, d();
95
+ function k(t) {
96
+ l.value.pageSize = t, l.value.pageNo = 1, f();
90
97
  }
91
98
  function T(t) {
92
- l.value.pageNo = t, d();
99
+ l.value.pageNo = t, f();
93
100
  }
94
- function E() {
101
+ function I() {
95
102
  if (!n.value) {
96
- O.warning("请先选择表单");
103
+ $.warning("请先选择表单");
97
104
  return;
98
105
  }
99
- g.value = n.value.templateName, u("update:templateKey", n.value.templateKey), u("update:templateId", n.value.pkId), i.value = !1;
106
+ s.value = n.value.templateName, d("update:templateKey", n.value.templateKey), d("update:templateId", n.value.pkId), u.value = !1;
100
107
  const t = JSON.parse(n.value.context);
101
- u("confirm", t);
108
+ d("confirm", t);
102
109
  }
103
110
  return (t, e) => {
104
- const s = Q, S = R, h = $, k = q, I = A, K = G;
105
- return U(), B(j, null, [
106
- a(S, {
107
- modelValue: g.value,
108
- "onUpdate:modelValue": e[0] || (e[0] = (o) => g.value = o),
109
- placeholder: c.templateType == "table" ? "请选择列表" : "请选择表单",
111
+ const p = q, g = A, m = G, E = H, U = W, K = X;
112
+ return B(), j(L, null, [
113
+ a(g, {
114
+ modelValue: s.value,
115
+ "onUpdate:modelValue": e[0] || (e[0] = (o) => s.value = o),
116
+ placeholder: v.templateType == "table" ? "请选择列表" : "请选择表单",
110
117
  readonly: ""
111
- }, {
112
- append: p(() => [
113
- a(s, {
114
- icon: V(L),
115
- onClick: x
118
+ }, D({
119
+ append: i(() => [
120
+ a(p, {
121
+ icon: w(R),
122
+ onClick: b
116
123
  }, null, 8, ["icon"])
117
124
  ]),
118
- _: 1
119
- }, 8, ["modelValue", "placeholder"]),
125
+ _: 2
126
+ }, [
127
+ s.value ? {
128
+ name: "prepend",
129
+ fn: i(() => [
130
+ a(p, {
131
+ icon: w(F),
132
+ onClick: x
133
+ }, null, 8, ["icon"])
134
+ ]),
135
+ key: "0"
136
+ } : void 0
137
+ ]), 1032, ["modelValue", "placeholder"]),
120
138
  a(K, {
121
- modelValue: i.value,
122
- "onUpdate:modelValue": e[5] || (e[5] = (o) => i.value = o),
139
+ modelValue: u.value,
140
+ "onUpdate:modelValue": e[5] || (e[5] = (o) => u.value = o),
123
141
  width: "50%",
124
- title: c.templateType == "table" ? "选择列表" : "选择表单",
142
+ title: v.templateType == "table" ? "选择列表" : "选择表单",
125
143
  draggable: "",
126
144
  overflow: "",
127
145
  "append-to-body": "",
128
146
  class: "fec-dev-designer-dialog"
129
147
  }, {
130
- footer: p(() => [
131
- C("div", W, [
132
- a(s, {
133
- onClick: e[4] || (e[4] = (o) => i.value = !1),
148
+ footer: i(() => [
149
+ z("div", Z, [
150
+ a(p, {
151
+ onClick: e[4] || (e[4] = (o) => u.value = !1),
134
152
  size: "default"
135
153
  }, {
136
- default: p(() => [...e[6] || (e[6] = [
137
- z("取消", -1)
154
+ default: i(() => [...e[6] || (e[6] = [
155
+ C("取消", -1)
138
156
  ])]),
139
157
  _: 1
140
158
  }),
141
- a(s, {
159
+ a(p, {
142
160
  type: "primary",
143
- onClick: E,
161
+ onClick: I,
144
162
  size: "default"
145
163
  }, {
146
- default: p(() => [...e[7] || (e[7] = [
147
- z("确定", -1)
164
+ default: i(() => [...e[7] || (e[7] = [
165
+ C("确定", -1)
148
166
  ])]),
149
167
  _: 1
150
168
  })
151
169
  ])
152
170
  ]),
153
- default: p(() => [
154
- C("div", H, [
155
- a(S, {
156
- modelValue: m.value,
157
- "onUpdate:modelValue": e[1] || (e[1] = (o) => m.value = o),
171
+ default: i(() => [
172
+ z("div", Y, [
173
+ a(g, {
174
+ modelValue: c.value,
175
+ "onUpdate:modelValue": e[1] || (e[1] = (o) => c.value = o),
158
176
  placeholder: "搜索表单名称/表单标识",
159
177
  clearable: "",
160
- onClear: y,
161
- onKeyup: D(y, ["enter"]),
162
- style: { width: "300px" }
178
+ onClear: h,
179
+ onKeyup: O(h, ["enter"]),
180
+ style: { width: "300px" },
181
+ size: "default"
163
182
  }, {
164
- append: p(() => [
165
- a(s, {
166
- icon: V(F),
167
- onClick: y
183
+ append: i(() => [
184
+ a(p, {
185
+ icon: w(J),
186
+ onClick: h
168
187
  }, null, 8, ["icon"])
169
188
  ]),
170
189
  _: 1
171
190
  }, 8, ["modelValue"])
172
191
  ]),
173
- a(k, {
174
- data: f.value,
192
+ a(E, {
193
+ data: _.value,
175
194
  "highlight-current-row": "",
176
195
  "max-height": "500",
177
196
  onCurrentChange: N,
178
- style: { width: "100%", "margin-top": "10px" }
197
+ style: { width: "100%", "margin-top": "10px" },
198
+ size: "default"
179
199
  }, {
180
- default: p(() => [
181
- a(h, {
200
+ default: i(() => [
201
+ a(m, {
182
202
  prop: "templateName",
183
203
  label: "表单名称",
184
204
  "min-width": "200"
185
205
  }),
186
- a(h, {
206
+ a(m, {
187
207
  prop: "templateKey",
188
208
  label: "表单标识",
189
209
  "min-width": "200"
@@ -191,16 +211,16 @@ const H = { class: "search-bar" }, W = { class: "dialog-footer" }, X = {
191
211
  ]),
192
212
  _: 1
193
213
  }, 8, ["data"]),
194
- a(I, {
214
+ a(U, {
195
215
  size: "small",
196
216
  "current-page": l.value.pageNo,
197
217
  "onUpdate:currentPage": e[2] || (e[2] = (o) => l.value.pageNo = o),
198
218
  "page-size": l.value.pageSize,
199
219
  "onUpdate:pageSize": e[3] || (e[3] = (o) => l.value.pageSize = o),
200
220
  "page-sizes": [10, 20, 50, 100],
201
- total: v.value,
221
+ total: S.value,
202
222
  layout: "total, sizes, prev, pager, next, jumper",
203
- onSizeChange: w,
223
+ onSizeChange: k,
204
224
  onCurrentChange: T,
205
225
  style: { "margin-top": "20px", "justify-content": "flex-end" }
206
226
  }, null, 8, ["current-page", "page-size", "total"])
@@ -210,7 +230,7 @@ const H = { class: "search-bar" }, W = { class: "dialog-footer" }, X = {
210
230
  ], 64);
211
231
  };
212
232
  }
213
- }, we = /* @__PURE__ */ M(X, [["__scopeId", "data-v-376296cc"]]);
233
+ }, Ie = /* @__PURE__ */ Q(ee, [["__scopeId", "data-v-eb9c3061"]]);
214
234
  export {
215
- we as default
235
+ Ie as default
216
236
  };
@@ -1,10 +1,10 @@
1
- import { computed as o, openBlock as V, createBlock as g, resolveDynamicComponent as A, withCtx as x, createVNode as C } from "vue";
2
- import { ElInputTag as F, ElInput as N } from "element-plus";
3
- import h from "./ValueSelectorPopover.vue2.js";
4
- import { getEditConfigData as I } from "../packages/utils/common.js";
1
+ import { computed as o, openBlock as g, createBlock as A, resolveDynamicComponent as N, withCtx as x, createVNode as C } from "vue";
2
+ import { ElInputTag as h, ElInput as I } from "element-plus";
3
+ import B from "./ValueSelectorPopover.vue2.js";
4
+ import { getEditConfigData as S, getEditConfigDataFields as $ } from "../packages/utils/common.js";
5
5
  import "./ValueSelector.vue.js";
6
- import B from "../../_virtual/_plugin-vue_export-helper.js";
7
- const $ = {
6
+ import z from "../../_virtual/_plugin-vue_export-helper.js";
7
+ const E = {
8
8
  __name: "ValueSelector",
9
9
  props: {
10
10
  // modelValue 的格式:
@@ -30,65 +30,75 @@ const $ = {
30
30
  type: Boolean,
31
31
  default: !1
32
32
  },
33
- // 可选的字段列表(从父组件传入)
34
- availableFields: {
35
- type: Array,
36
- default: () => [],
37
- validator: (r) => Array.isArray(r)
33
+ size: {
34
+ type: String,
35
+ default: "small"
38
36
  }
37
+ // // 可选的字段列表(从父组件传入)
38
+ // availableFields: {
39
+ // type: Array,
40
+ // default: () => [],
41
+ // validator: (value) => Array.isArray(value),
42
+ // },
39
43
  },
40
44
  emits: ["update:modelValue"],
41
- setup(r, { emit: m }) {
42
- const a = r, i = m, p = o(() => a.multiple ? F : N), f = o(() => {
43
- const e = I();
45
+ setup(r, { emit: f }) {
46
+ const a = r, i = f, c = o(() => a.multiple ? h : I), s = o(() => {
47
+ const e = S();
44
48
  return (e == null ? void 0 : e.hiddenFields) || [];
45
- }), c = o(() => {
49
+ }), n = o(() => ($() || []).map((l) => ({
50
+ id: l.id,
51
+ label: l.label,
52
+ fieldName: l.fieldName,
53
+ fieldType: l.fieldType
54
+ }))), v = o(() => {
46
55
  if (!a.modelValue)
47
56
  return "";
48
57
  if (!a.multiple && typeof a.modelValue == "object" && !Array.isArray(a.modelValue)) {
49
58
  const e = a.modelValue;
50
59
  if (e.label)
51
60
  return e.label;
52
- const l = a.availableFields.find((t) => t.id === e.value);
61
+ const l = n.value.find((t) => t.id === e.value);
53
62
  return (l == null ? void 0 : l.label) || (l == null ? void 0 : l.fieldName) || e.value;
54
63
  } else if (!a.multiple && typeof a.modelValue == "string")
55
64
  return a.modelValue;
56
65
  return "";
57
- }), s = o({
66
+ }), m = o({
58
67
  get() {
59
68
  return !a.multiple || !Array.isArray(a.modelValue) ? [] : a.modelValue.map((e) => {
60
69
  if (e.label)
61
70
  return e.label;
62
- const l = a.availableFields.find((t) => t.id === e.value);
71
+ const l = n.value.find((t) => t.id === e.value);
63
72
  return (l == null ? void 0 : l.label) || (l == null ? void 0 : l.fieldName) || e.value;
64
73
  }).filter(Boolean);
65
74
  },
66
75
  set(e) {
67
76
  if (Array.isArray(a.modelValue)) {
68
77
  const l = a.modelValue.filter((t) => {
69
- const n = t.label || (() => {
70
- const u = a.availableFields.find(
71
- (y) => y.id === t.value
72
- );
78
+ const d = t.label || (() => {
79
+ const u = [
80
+ ...n.value,
81
+ ...s.value
82
+ ].find((V) => V.id === t.value);
73
83
  return (u == null ? void 0 : u.label) || (u == null ? void 0 : u.fieldName) || t.value;
74
84
  })();
75
- return e.includes(n);
85
+ return e.includes(d);
76
86
  });
77
87
  i("update:modelValue", l);
78
88
  }
79
89
  }
80
- }), d = o({
90
+ }), p = o({
81
91
  get() {
82
- return a.multiple ? s.value : c.value;
92
+ return a.multiple ? m.value : v.value;
83
93
  },
84
94
  set(e) {
85
- a.multiple && Array.isArray(e) ? s.value = e : !a.multiple && typeof e == "string" && i("update:modelValue", e);
95
+ a.multiple && Array.isArray(e) ? m.value = e : !a.multiple && typeof e == "string" && i("update:modelValue", e);
86
96
  }
87
- }), v = (e) => {
97
+ }), y = (e) => {
88
98
  let l = null;
89
99
  if (e.type === "field") {
90
- const t = [...a.availableFields, ...f.value].find(
91
- (n) => n.id === e.value
100
+ const t = [...n.value, ...s.value].find(
101
+ (d) => d.id === e.value
92
102
  );
93
103
  l = {
94
104
  label: `\${${(t == null ? void 0 : t.label) || (t == null ? void 0 : t.fieldName) || e.value}}`,
@@ -119,9 +129,9 @@ const $ = {
119
129
  orgCode: "机构编号",
120
130
  orgName: "机构名称"
121
131
  })[e] || e;
122
- return (e, l) => (V(), g(A(p.value), {
123
- modelValue: d.value,
124
- "onUpdate:modelValue": l[0] || (l[0] = (t) => d.value = t),
132
+ return (e, l) => (g(), A(N(c.value), {
133
+ modelValue: p.value,
134
+ "onUpdate:modelValue": l[0] || (l[0] = (t) => p.value = t),
125
135
  placeholder: r.placeholder,
126
136
  disabled: r.disabled,
127
137
  readonly: r.readOnly,
@@ -130,19 +140,19 @@ const $ = {
130
140
  "collapse-tags-tooltip": "",
131
141
  "max-collapse-tags": 1,
132
142
  class: "value-selector-input",
133
- size: "small"
143
+ size: r.size
134
144
  }, {
135
145
  suffix: x(() => [
136
- C(h, {
137
- "available-fields": r.availableFields,
146
+ C(B, {
147
+ "available-fields": n.value,
138
148
  disabled: r.disabled,
139
- onConfirm: v
149
+ onConfirm: y
140
150
  }, null, 8, ["available-fields", "disabled"])
141
151
  ]),
142
152
  _: 1
143
- }, 8, ["modelValue", "placeholder", "disabled", "readonly", "trigger"]));
153
+ }, 8, ["modelValue", "placeholder", "disabled", "readonly", "trigger", "size"]));
144
154
  }
145
- }, D = /* @__PURE__ */ B($, [["__scopeId", "data-v-a452b81a"]]);
155
+ }, w = /* @__PURE__ */ z(E, [["__scopeId", "data-v-ab1b3ad7"]]);
146
156
  export {
147
- D as default
157
+ w as default
148
158
  };