@guodun/antdv 1.4.4 → 1.4.5

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 (93) hide show
  1. package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +85 -85
  2. package/dist/es/components/dept-selector/src/dept.mjs +170 -142
  3. package/dist/es/components/index.mjs +1 -0
  4. package/dist/es/components/pro-contract-template-designer/index.mjs +1 -0
  5. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +372 -185
  6. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +59 -42
  7. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs +218 -85
  8. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.mjs +5 -0
  9. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.mjs +97 -0
  10. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +914 -853
  11. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +550 -245
  12. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +214 -139
  13. package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs +53 -35
  14. package/dist/es/components/pro-contract-template-designer/src/types.mjs +15 -2
  15. package/dist/es/components/pro-contract-template-designer/src/utils/advanced-controls.mjs +91 -0
  16. package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +96 -65
  17. package/dist/es/components/pro-contract-template-designer/src/utils/template-tool-icons.mjs +23 -16
  18. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  19. package/dist/es/components/pro-selector/src/components/org-tree.mjs +130 -89
  20. package/dist/es/components/pro-selector/src/components/user.mjs +34 -26
  21. package/dist/es/components/pro-selector/src/pro-user.mjs +86 -72
  22. package/dist/es/components/pro-selector/src/types.mjs +4 -1
  23. package/dist/es/components/pro-selector/src/utils/orgTree.mjs +5 -2
  24. package/dist/es/components/pro-selector-group/src/compoents/dept-tree.vue.mjs +92 -65
  25. package/dist/es/components/pro-selector-group/src/compoents/dept.vue.mjs +3 -3
  26. package/dist/es/components/pro-selector-group/src/compoents/role.vue.mjs +98 -73
  27. package/dist/es/components/pro-selector-group/src/compoents/select-box.vue.mjs +12 -9
  28. package/dist/es/components/pro-selector-group/src/compoents/user.vue.mjs +101 -72
  29. package/dist/es/components/pro-selector-group/src/hooks/useApi.mjs +39 -22
  30. package/dist/es/components/pro-selector-group/src/index.vue.mjs +105 -83
  31. package/dist/es/components/pro-selector-group/src/utils/index.mjs +36 -0
  32. package/dist/es/components/role-selector/src/role.mjs +134 -120
  33. package/dist/es/index.mjs +50 -49
  34. package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
  35. package/dist/lib/components/dept-selector/src/dept.cjs +1 -1
  36. package/dist/lib/components/index.cjs +1 -1
  37. package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
  38. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +2 -1
  39. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -1
  40. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.cjs +1 -1
  41. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.cjs +1 -0
  42. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.cjs +1 -0
  43. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  44. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
  45. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
  46. package/dist/lib/components/pro-contract-template-designer/src/extensions/template-variable.cjs +1 -1
  47. package/dist/lib/components/pro-contract-template-designer/src/types.cjs +1 -1
  48. package/dist/lib/components/pro-contract-template-designer/src/utils/advanced-controls.cjs +1 -0
  49. package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
  50. package/dist/lib/components/pro-contract-template-designer/src/utils/template-tool-icons.cjs +1 -1
  51. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  52. package/dist/lib/components/pro-selector/src/components/org-tree.cjs +1 -1
  53. package/dist/lib/components/pro-selector/src/components/user.cjs +1 -1
  54. package/dist/lib/components/pro-selector/src/pro-user.cjs +1 -1
  55. package/dist/lib/components/pro-selector/src/types.cjs +1 -1
  56. package/dist/lib/components/pro-selector/src/utils/orgTree.cjs +1 -1
  57. package/dist/lib/components/pro-selector-group/src/compoents/dept-tree.vue.cjs +1 -1
  58. package/dist/lib/components/pro-selector-group/src/compoents/dept.vue.cjs +1 -1
  59. package/dist/lib/components/pro-selector-group/src/compoents/role.vue.cjs +1 -1
  60. package/dist/lib/components/pro-selector-group/src/compoents/select-box.vue.cjs +1 -1
  61. package/dist/lib/components/pro-selector-group/src/compoents/user.vue.cjs +1 -1
  62. package/dist/lib/components/pro-selector-group/src/hooks/useApi.cjs +1 -1
  63. package/dist/lib/components/pro-selector-group/src/index.vue.cjs +1 -1
  64. package/dist/lib/components/pro-selector-group/src/utils/index.cjs +1 -0
  65. package/dist/lib/components/role-selector/src/role.cjs +1 -1
  66. package/dist/lib/index.cjs +1 -1
  67. package/dist/theme/dept-selector.css +1 -1
  68. package/dist/theme/icon.css +1 -1
  69. package/dist/theme/index.css +1 -1
  70. package/dist/theme/pro-selector-group.css +1 -1
  71. package/dist/theme/pro-selector.css +1 -1
  72. package/dist/theme/role-selector.css +1 -1
  73. package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +3 -3
  74. package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
  75. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +1 -0
  76. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +3 -0
  77. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.d.ts +7 -1
  78. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.d.ts +14 -0
  79. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +13 -1
  80. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +11 -1
  81. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +4 -0
  82. package/dist/types/components/pro-contract-template-designer/src/extensions/template-variable.d.ts +11 -1
  83. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +131 -2
  84. package/dist/types/components/pro-contract-template-designer/src/utils/advanced-controls.d.ts +15 -0
  85. package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +10 -2
  86. package/dist/types/components/pro-selector/index.d.ts +9 -0
  87. package/dist/types/components/pro-selector/src/components/user.d.ts +9 -0
  88. package/dist/types/components/pro-selector/src/types.d.ts +2 -0
  89. package/dist/types/components/pro-selector/src/utils/orgTree.d.ts +4 -1
  90. package/dist/types/components/pro-selector-group/src/compoents/select-box.vue.d.ts +4 -4
  91. package/dist/types/components/pro-selector-group/src/hooks/useApi.d.ts +6 -1
  92. package/dist/types/components/pro-selector-group/src/utils/index.d.ts +8 -0
  93. package/package.json +3 -1
@@ -1,8 +1,8 @@
1
1
  import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, normalizeClass as s, openBlock as c, ref as l, toDisplayString as u, unref as d, withCtx as f } from "vue";
2
2
  import { Button as p, Tooltip as m } from "ant-design-vue";
3
- import { AuditOutlined as h, BgColorsOutlined as g, ColumnWidthOutlined as _, DatabaseOutlined as v, DeleteOutlined as y, EyeOutlined as b, FormOutlined as x, FullscreenExitOutlined as S, FullscreenOutlined as C, ReloadOutlined as w, UpOutlined as T, ZoomInOutlined as E, ZoomOutOutlined as D } from "@ant-design/icons-vue";
3
+ import { AuditOutlined as h, BgColorsOutlined as g, ColumnWidthOutlined as _, CopyOutlined as v, DatabaseOutlined as y, DeleteOutlined as b, EyeOutlined as x, FormOutlined as S, FullscreenExitOutlined as C, FullscreenOutlined as w, ReloadOutlined as T, UpOutlined as E, ZoomInOutlined as D, ZoomOutOutlined as O } from "@ant-design/icons-vue";
4
4
  //#region src/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue?vue&type=script&setup=true&lang.ts
5
- var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class: "gd-contract-template-designer__workspace-actions" }, A = { class: "gd-contract-template-designer__workspace-controls" }, j = { class: "gd-contract-template-designer__zoom" }, M = { class: "gd-contract-template-designer__workspace-buttons" }, N = { class: "gd-contract-template-designer__page-decorations-trigger-copy" }, P = /* @__PURE__ */ o({
5
+ var k = { class: "gd-contract-template-designer__workspace-meta" }, A = { class: "gd-contract-template-designer__workspace-actions" }, j = { class: "gd-contract-template-designer__workspace-controls" }, M = { class: "gd-contract-template-designer__zoom" }, N = { class: "gd-contract-template-designer__workspace-buttons" }, P = { class: "gd-contract-template-designer__page-decorations-trigger-copy" }, F = /* @__PURE__ */ o({
6
6
  __name: "ContractTemplateDesignerWorkspaceHeader",
7
7
  props: {
8
8
  summary: {},
@@ -11,6 +11,7 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
11
11
  showDraftCacheStatus: { type: Boolean },
12
12
  showClearButton: { type: Boolean },
13
13
  showSubmitDataViewer: { type: Boolean },
14
+ showVariableDataViewer: { type: Boolean },
14
15
  readonly: { type: Boolean },
15
16
  zoomPercent: {},
16
17
  zoomOutDisabled: { type: Boolean },
@@ -35,49 +36,50 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
35
36
  "validate",
36
37
  "preview",
37
38
  "submitData",
39
+ "variableData",
38
40
  "togglePageDecorations",
39
41
  "toggleChrome"
40
42
  ],
41
- setup(o, { expose: P, emit: F }) {
42
- let I = o, L = F, R = l(), z = e(() => [
43
+ setup(o, { expose: F, emit: I }) {
44
+ let L = o, R = I, z = l(), B = e(() => [
43
45
  {
44
46
  key: "header",
45
47
  label: "页眉",
46
- enabled: I.pageDecorationsEnabledStates.header
48
+ enabled: L.pageDecorationsEnabledStates.header
47
49
  },
48
50
  {
49
51
  key: "footer",
50
52
  label: "页脚",
51
- enabled: I.pageDecorationsEnabledStates.footer
53
+ enabled: L.pageDecorationsEnabledStates.footer
52
54
  },
53
55
  {
54
56
  key: "watermark",
55
57
  label: "水印",
56
- enabled: I.pageDecorationsEnabledStates.watermark
58
+ enabled: L.pageDecorationsEnabledStates.watermark
57
59
  }
58
- ]), B = e(() => `页面装饰 · ${I.pageDecorationsPresetLabel} · 启用 ${I.pageDecorationsEnabledCount}/3`), V = e(() => `页面装饰,${I.pageDecorationsPresetLabel},已启用 ${I.pageDecorationsEnabledCount}/3;${z.value.map((e) => `${e.label}${e.enabled ? "已启用" : "未启用"}`).join(",")}`);
59
- return P({
60
- focusPageDecorations: () => R.value?.querySelector(".gd-contract-template-designer__page-decorations-trigger")?.focus(),
61
- focusImmersive: () => R.value?.querySelector(".gd-contract-template-designer__immersive-trigger")?.focus(),
62
- focusChromeToggle: () => R.value?.querySelector(".gd-contract-template-designer__workspace-chrome-toggle")?.focus()
60
+ ]), V = e(() => `页面装饰 · ${L.pageDecorationsPresetLabel} · 启用 ${L.pageDecorationsEnabledCount}/3`), H = e(() => `页面装饰,${L.pageDecorationsPresetLabel},已启用 ${L.pageDecorationsEnabledCount}/3;${B.value.map((e) => `${e.label}${e.enabled ? "已启用" : "未启用"}`).join(",")}`);
61
+ return F({
62
+ focusPageDecorations: () => z.value?.querySelector(".gd-contract-template-designer__page-decorations-trigger")?.focus(),
63
+ focusImmersive: () => z.value?.querySelector(".gd-contract-template-designer__immersive-trigger")?.focus(),
64
+ focusChromeToggle: () => z.value?.querySelector(".gd-contract-template-designer__workspace-chrome-toggle")?.focus()
63
65
  }), (e, l) => (c(), r("header", {
64
66
  ref_key: "workspaceHeader",
65
- ref: R,
67
+ ref: z,
66
68
  class: "gd-contract-template-designer__workspace-header"
67
- }, [i("div", O, [i("strong", null, u(o.summary), 1), o.showDraftCacheStatus && o.draftCacheStatusText ? (c(), r("small", {
69
+ }, [i("div", k, [i("strong", null, u(o.summary), 1), o.showDraftCacheStatus && o.draftCacheStatusText ? (c(), r("small", {
68
70
  key: 0,
69
71
  class: s(["gd-contract-template-designer__draft-cache-status", o.draftCacheStatusClass])
70
- }, u(o.draftCacheStatusText), 3)) : n("", !0)]), i("div", k, [
71
- i("div", A, [i("div", j, [
72
+ }, u(o.draftCacheStatusText), 3)) : n("", !0)]), i("div", A, [
73
+ i("div", j, [i("div", M, [
72
74
  a(d(m), { title: "缩小" }, {
73
75
  default: f(() => [a(d(p), {
74
76
  size: "small",
75
77
  class: "gd-contract-template-designer__icon-button",
76
78
  disabled: o.zoomOutDisabled,
77
79
  "aria-label": "缩小",
78
- onClick: l[0] ||= (e) => L("zoomOut")
80
+ onClick: l[0] ||= (e) => R("zoomOut")
79
81
  }, {
80
- default: f(() => [a(d(D), { "aria-hidden": "true" })]),
82
+ default: f(() => [a(d(O), { "aria-hidden": "true" })]),
81
83
  _: 1
82
84
  }, 8, ["disabled"])]),
83
85
  _: 1
@@ -89,9 +91,9 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
89
91
  class: "gd-contract-template-designer__icon-button",
90
92
  disabled: o.zoomInDisabled,
91
93
  "aria-label": "放大",
92
- onClick: l[1] ||= (e) => L("zoomIn")
94
+ onClick: l[1] ||= (e) => R("zoomIn")
93
95
  }, {
94
- default: f(() => [a(d(E), { "aria-hidden": "true" })]),
96
+ default: f(() => [a(d(D), { "aria-hidden": "true" })]),
95
97
  _: 1
96
98
  }, 8, ["disabled"])]),
97
99
  _: 1
@@ -101,7 +103,7 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
101
103
  size: "small",
102
104
  class: "gd-contract-template-designer__icon-button",
103
105
  "aria-label": "适应宽度",
104
- onClick: l[2] ||= (e) => L("fitWidth")
106
+ onClick: l[2] ||= (e) => R("fitWidth")
105
107
  }, {
106
108
  default: f(() => [a(d(_), { "aria-hidden": "true" })]),
107
109
  _: 1
@@ -113,9 +115,9 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
113
115
  size: "small",
114
116
  class: "gd-contract-template-designer__icon-button",
115
117
  "aria-label": "重置缩放",
116
- onClick: l[3] ||= (e) => L("resetZoom")
118
+ onClick: l[3] ||= (e) => R("resetZoom")
117
119
  }, {
118
- default: f(() => [a(d(w), { "aria-hidden": "true" })]),
120
+ default: f(() => [a(d(T), { "aria-hidden": "true" })]),
119
121
  _: 1
120
122
  })]),
121
123
  _: 1
@@ -125,12 +127,12 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
125
127
  size: "small",
126
128
  class: "gd-contract-template-designer__icon-button",
127
129
  "aria-label": o.isFullscreen ? "退出全屏" : "全屏显示",
128
- onClick: l[4] ||= (e) => L("toggleFullscreen")
130
+ onClick: l[4] ||= (e) => R("toggleFullscreen")
129
131
  }, {
130
- default: f(() => [o.isFullscreen ? (c(), t(d(S), {
132
+ default: f(() => [o.isFullscreen ? (c(), t(d(C), {
131
133
  key: 0,
132
134
  "aria-hidden": "true"
133
- })) : (c(), t(d(C), {
135
+ })) : (c(), t(d(w), {
134
136
  key: 1,
135
137
  "aria-hidden": "true"
136
138
  }))]),
@@ -144,15 +146,15 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
144
146
  class: s(["gd-contract-template-designer__icon-button gd-contract-template-designer__immersive-trigger", { "is-selected": o.immersive }]),
145
147
  "aria-pressed": o.immersive,
146
148
  "aria-label": "沉浸写作",
147
- onClick: l[5] ||= (e) => L("toggleImmersive")
149
+ onClick: l[5] ||= (e) => R("toggleImmersive")
148
150
  }, {
149
- default: f(() => [a(d(x), { "aria-hidden": "true" })]),
151
+ default: f(() => [a(d(S), { "aria-hidden": "true" })]),
150
152
  _: 1
151
153
  }, 8, ["class", "aria-pressed"])]),
152
154
  _: 1
153
155
  })
154
156
  ])]),
155
- i("div", M, [
157
+ i("div", N, [
156
158
  o.showClearButton ? (c(), t(d(m), {
157
159
  key: 0,
158
160
  title: "清空合同"
@@ -163,24 +165,24 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
163
165
  class: "gd-contract-template-designer__icon-button",
164
166
  disabled: o.readonly,
165
167
  "aria-label": "清空合同",
166
- onClick: l[6] ||= (e) => L("clear")
168
+ onClick: l[6] ||= (e) => R("clear")
167
169
  }, {
168
- default: f(() => [a(d(y), { "aria-hidden": "true" })]),
170
+ default: f(() => [a(d(b), { "aria-hidden": "true" })]),
169
171
  _: 1
170
172
  }, 8, ["disabled"])]),
171
173
  _: 1
172
174
  })) : n("", !0),
173
- a(d(m), { title: B.value }, {
175
+ a(d(m), { title: V.value }, {
174
176
  default: f(() => [a(d(p), {
175
177
  size: "small",
176
178
  class: s(["gd-contract-template-designer__page-decorations-trigger", { "is-selected": o.pageDecorationsOpen }]),
177
179
  "aria-pressed": o.pageDecorationsOpen,
178
180
  "aria-expanded": o.pageDecorationsOpen,
179
181
  "aria-controls": o.pageDecorationsStudioId,
180
- "aria-label": V.value,
181
- onClick: l[7] ||= (e) => L("togglePageDecorations")
182
+ "aria-label": H.value,
183
+ onClick: l[7] ||= (e) => R("togglePageDecorations")
182
184
  }, {
183
- default: f(() => [a(d(g), { "aria-hidden": "true" }), i("span", N, [l[12] ||= i("span", null, "页面装饰", -1), i("small", null, u(o.pageDecorationsPresetLabel) + " · 启用 " + u(o.pageDecorationsEnabledCount) + "/3", 1)])]),
185
+ default: f(() => [a(d(g), { "aria-hidden": "true" }), i("span", P, [l[13] ||= i("span", null, "页面装饰", -1), i("small", null, u(o.pageDecorationsPresetLabel) + " · 启用 " + u(o.pageDecorationsEnabledCount) + "/3", 1)])]),
184
186
  _: 1
185
187
  }, 8, [
186
188
  "class",
@@ -196,7 +198,7 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
196
198
  size: "small",
197
199
  class: "gd-contract-template-designer__icon-button",
198
200
  "aria-label": "校验",
199
- onClick: l[8] ||= (e) => L("validate")
201
+ onClick: l[8] ||= (e) => R("validate")
200
202
  }, {
201
203
  default: f(() => [a(d(h), { "aria-hidden": "true" })]),
202
204
  _: 1
@@ -209,9 +211,9 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
209
211
  type: "primary",
210
212
  class: "gd-contract-template-designer__icon-button",
211
213
  "aria-label": "预览",
212
- onClick: l[9] ||= (e) => L("preview")
214
+ onClick: l[9] ||= (e) => R("preview")
213
215
  }, {
214
- default: f(() => [a(d(b), { "aria-hidden": "true" })]),
216
+ default: f(() => [a(d(x), { "aria-hidden": "true" })]),
215
217
  _: 1
216
218
  })]),
217
219
  _: 1
@@ -224,7 +226,22 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
224
226
  size: "small",
225
227
  class: "gd-contract-template-designer__icon-button",
226
228
  "aria-label": "数据查看",
227
- onClick: l[10] ||= (e) => L("submitData")
229
+ onClick: l[10] ||= (e) => R("submitData")
230
+ }, {
231
+ default: f(() => [a(d(y), { "aria-hidden": "true" })]),
232
+ _: 1
233
+ })]),
234
+ _: 1
235
+ })) : n("", !0),
236
+ o.showVariableDataViewer ? (c(), t(d(m), {
237
+ key: 2,
238
+ title: "控件变量"
239
+ }, {
240
+ default: f(() => [a(d(p), {
241
+ size: "small",
242
+ class: "gd-contract-template-designer__icon-button",
243
+ "aria-label": "控件变量",
244
+ onClick: l[11] ||= (e) => R("variableData")
228
245
  }, {
229
246
  default: f(() => [a(d(v), { "aria-hidden": "true" })]),
230
247
  _: 1
@@ -239,9 +256,9 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
239
256
  "aria-label": "收起工具区",
240
257
  "aria-expanded": !0,
241
258
  "aria-controls": o.chromeControlsId,
242
- onClick: l[11] ||= (e) => L("toggleChrome")
259
+ onClick: l[12] ||= (e) => R("toggleChrome")
243
260
  }, {
244
- default: f(() => [a(d(T), { "aria-hidden": "true" })]),
261
+ default: f(() => [a(d(E), { "aria-hidden": "true" })]),
245
262
  _: 1
246
263
  }, 8, ["aria-controls"])]),
247
264
  _: 1
@@ -250,4 +267,4 @@ var O = { class: "gd-contract-template-designer__workspace-meta" }, k = { class:
250
267
  }
251
268
  });
252
269
  //#endregion
253
- export { P as default };
270
+ export { F as default };
@@ -1,31 +1,40 @@
1
- import { isContractTemplateFieldType as e } from "./types.mjs";
2
- import { getFieldOption as t } from "./composables/use-template-designer.mjs";
3
- import { isSafeContractImageUrl as n } from "./utils/image-url.mjs";
4
- import { resolveFieldTypeIcon as r } from "./utils/template-tool-icons.mjs";
5
- import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, openBlock as m, renderList as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, withCtx as y, withModifiers as b } from "vue";
6
- import { Button as x, Checkbox as S, DatePicker as C, Image as w, Input as T, InputNumber as E, Tooltip as D } from "ant-design-vue";
7
- import { DeleteOutlined as O, EyeOutlined as k } from "@ant-design/icons-vue";
1
+ import e from "../../pro-selector-group/index.mjs";
2
+ import { isContractTemplateFieldType as t } from "./types.mjs";
3
+ import { formatContractTemplateRenderValue as n, normalizeContractTemplateJsonObject as r, normalizeContractTemplateSelectionValues as i } from "./utils/advanced-controls.mjs";
4
+ import { getFieldOption as ee } from "./composables/use-template-designer.mjs";
5
+ import { isSafeContractImageUrl as te } from "./utils/image-url.mjs";
6
+ import { resolveFieldTypeIcon as a } from "./utils/template-tool-icons.mjs";
7
+ import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, mergeProps as h, normalizeClass as ne, openBlock as g, ref as _, renderList as v, resolveDynamicComponent as y, toDisplayString as b, unref as x, withCtx as S, withModifiers as C } from "vue";
8
+ import { Alert as w, Button as T, Checkbox as E, DatePicker as re, Image as ie, Input as D, InputNumber as ae, Radio as oe, RadioGroup as se, Select as ce, Tooltip as O } from "ant-design-vue";
9
+ import { DeleteOutlined as le, EyeOutlined as ue } from "@ant-design/icons-vue";
8
10
  //#region src/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue?vue&type=script&setup=true&lang.ts
9
- var A = { class: "gd-contract-template-renderer__field-head" }, j = { class: "gd-contract-template-renderer__field-title" }, M = {
11
+ var k = { class: "gd-contract-template-renderer__field-head" }, de = { class: "gd-contract-template-renderer__field-title" }, fe = {
10
12
  class: "gd-contract-template-renderer__field-type-icon",
11
13
  "aria-hidden": "true"
12
- }, N = { class: "gd-contract-template-renderer__field-title-text" }, P = {
14
+ }, pe = { class: "gd-contract-template-renderer__field-title-text" }, me = {
13
15
  key: 0,
14
16
  class: "gd-contract-template-renderer__field-required",
15
17
  "aria-label": "必填"
16
- }, F = {
18
+ }, A = {
17
19
  key: 4,
20
+ class: "gd-contract-template-renderer__selector-field"
21
+ }, j = {
22
+ key: 1,
23
+ class: "gd-contract-template-renderer__selector-placeholder",
24
+ role: "status"
25
+ }, M = {
26
+ key: 9,
18
27
  class: "gd-contract-template-renderer__field-checkbox"
19
- }, I = {
20
- key: 5,
28
+ }, N = {
29
+ key: 10,
21
30
  class: "gd-contract-template-renderer__image-field"
22
- }, L = {
31
+ }, P = {
23
32
  key: 0,
24
33
  class: "gd-contract-template-renderer__image-preview"
25
- }, R = {
26
- key: 7,
34
+ }, F = {
35
+ key: 12,
27
36
  class: "gd-contract-template-renderer__field-errors"
28
- }, z = /* @__PURE__ */ f({
37
+ }, I = /* @__PURE__ */ m({
29
38
  name: "ContractTemplateRendererField",
30
39
  __name: "ContractTemplateRendererField",
31
40
  props: {
@@ -33,138 +42,262 @@ var A = { class: "gd-contract-template-renderer__field-head" }, j = { class: "gd
33
42
  value: { type: [
34
43
  String,
35
44
  Number,
36
- Boolean
45
+ Boolean,
46
+ Object,
47
+ Array,
48
+ null
37
49
  ] },
38
50
  errors: {},
39
51
  active: { type: Boolean },
40
52
  readonly: { type: Boolean },
41
- disabled: { type: Boolean }
53
+ disabled: { type: Boolean },
54
+ options: {},
55
+ loading: { type: Boolean },
56
+ loadError: {},
57
+ registration: {},
58
+ selectorHttp: {},
59
+ selectorUrlPrefix: {}
42
60
  },
43
61
  emits: ["updateValue", "focusVariable"],
44
- setup(f, { emit: z }) {
45
- let B = f, V = z, H = a(() => B.readonly || B.disabled), U = a(() => B.value === void 0 || B.value === null ? "" : String(B.value)), W = a(() => {
46
- if (B.value === void 0 || B.value === null || B.value === "") return;
47
- let e = Number(B.value);
62
+ setup(m, { emit: I }) {
63
+ let L = m, R = I, z = s(() => L.readonly || L.disabled), B = s(() => L.value === void 0 || L.value === null ? "" : String(L.value)), V = s(() => n(L.value)), he = s(() => {
64
+ if (L.value === void 0 || L.value === null || L.value === "") return;
65
+ let e = Number(L.value);
48
66
  return Number.isFinite(e) ? e : void 0;
49
- }), G = a(() => B.value === !0 || B.value === "true" || B.value === "1" || B.value === "是" || B.value === "已选"), K = a(() => B.errors.length > 0), q = a(() => U.value && n(U.value) ? U.value : ""), J = a(() => e(B.variable.type) ? B.variable.type : "text"), Y = a(() => r(J.value)), X = a(() => t(J.value).label);
67
+ }), H = s(() => L.value === !0 || L.value === "true" || L.value === "1" || L.value === "是" || L.value === "已选"), U = s(() => L.errors.length > 0), W = s(() => B.value && te(B.value) ? B.value : ""), G = s(() => t(L.variable.type) ? L.variable.type : "text"), ge = s(() => a(G.value)), _e = s(() => ee(G.value).label), K = _(!1), q = s(() => L.variable.type === "user-selector" ? "user" : L.variable.type === "role-selector" ? "role" : "dept"), ve = s(() => (Array.isArray(L.value) ? L.value : L.value ? [L.value] : []).flatMap((e) => {
68
+ if (!e || typeof e != "object") return [];
69
+ let t = e;
70
+ return [{
71
+ value: String(t.value),
72
+ label: t.label,
73
+ type: q.value
74
+ }];
75
+ })), J = s(() => (L.options ?? L.variable.options ?? []).map((e) => ({
76
+ ...e,
77
+ value: e.value,
78
+ label: e.label
79
+ }))), Y = s(() => {
80
+ if (Array.isArray(L.value)) return L.value.map((e) => e.value);
81
+ if (L.value && typeof L.value == "object") return L.value.value;
82
+ }), X = s(() => ({
83
+ modelValue: L.value,
84
+ variable: L.variable,
85
+ config: r(L.variable.componentConfig),
86
+ readonly: L.readonly,
87
+ disabled: z.value,
88
+ options: J.value,
89
+ loading: !!L.loading,
90
+ error: L.loadError,
91
+ ...L.registration?.resolveProps?.({
92
+ variable: L.variable,
93
+ config: r(L.variable.componentConfig)
94
+ }) ?? {}
95
+ }));
50
96
  function Z(e) {
51
- V("updateValue", e);
97
+ R("updateValue", e);
52
98
  }
53
- function Q(e) {
99
+ function ye(e) {
54
100
  if (e === null || e === "") {
55
- V("updateValue", void 0);
101
+ R("updateValue", void 0);
56
102
  return;
57
103
  }
58
104
  let t = Number(e);
59
- V("updateValue", Number.isFinite(t) ? t : void 0);
105
+ R("updateValue", Number.isFinite(t) ? t : void 0);
106
+ }
107
+ function be(e) {
108
+ R("updateValue", e);
109
+ }
110
+ function Q(e) {
111
+ let t = (e == null ? [] : Array.isArray(e) ? e : [e]).flatMap((e) => {
112
+ let t = e && typeof e == "object" && "value" in e ? e.value : e, n = J.value.find((e) => e.value === t);
113
+ return n ? [{
114
+ value: n.value,
115
+ label: n.label,
116
+ type: n.type || G.value
117
+ }] : [];
118
+ });
119
+ R("updateValue", L.variable.multiple && G.value === "select" ? t : t[0]);
120
+ }
121
+ function xe(e) {
122
+ R("updateValue", i(e, G.value, !!L.variable.multiple));
60
123
  }
61
124
  function $(e) {
62
- V("updateValue", e);
125
+ let t = {
126
+ variable: L.variable,
127
+ config: r(L.variable.componentConfig)
128
+ };
129
+ R("updateValue", L.registration?.normalizeValue ? L.registration.normalizeValue(e, t) : e);
63
130
  }
64
- function ee(e) {
65
- V("updateValue", typeof e == "string" ? e : "");
131
+ function Se(e) {
132
+ R("updateValue", typeof e == "string" ? e : "");
66
133
  }
67
- return (e, t) => (m(), c("section", {
68
- class: p(["gd-contract-template-renderer__field", {
69
- "is-active": f.active,
70
- "has-error": K.value
134
+ return (t, n) => (g(), u("section", {
135
+ class: ne(["gd-contract-template-renderer__field", {
136
+ "is-active": m.active,
137
+ "has-error": U.value
71
138
  }]),
72
- onClick: t[1] ||= (e) => V("focusVariable"),
73
- onFocusin: t[2] ||= (e) => V("focusVariable")
139
+ onClick: n[3] ||= (e) => R("focusVariable"),
140
+ onFocusin: n[4] ||= (e) => R("focusVariable")
74
141
  }, [
75
- l("div", A, [l("strong", null, [l("span", j, [d(v(D), { title: X.value }, {
76
- default: y(() => [l("span", M, [(m(), o(g(Y.value)))])]),
142
+ d("div", k, [d("strong", null, [d("span", de, [p(x(O), { title: _e.value }, {
143
+ default: S(() => [d("span", fe, [(g(), c(y(ge.value)))])]),
77
144
  _: 1
78
- }, 8, ["title"]), l("span", N, [u(_(f.variable.label || f.variable.key) + " ", 1), f.variable.required ? (m(), c("span", P, "*")) : s("", !0)])])]), l("small", null, _(f.variable.key), 1)]),
79
- f.variable.type === "text" && f.variable.multiline ? (m(), o(v(T).TextArea, {
145
+ }, 8, ["title"]), d("span", pe, [f(b(m.variable.label || m.variable.key) + " ", 1), m.variable.required ? (g(), u("span", me, "*")) : l("", !0)])])]), d("small", null, b(m.variable.key), 1)]),
146
+ m.variable.type === "text" && m.variable.multiline ? (g(), c(x(D).TextArea, {
80
147
  key: 0,
81
- value: U.value,
82
- rows: f.variable.rows || 3,
83
- placeholder: f.variable.placeholder || "",
84
- disabled: H.value,
148
+ value: B.value,
149
+ rows: m.variable.rows || 3,
150
+ placeholder: m.variable.placeholder || "",
151
+ disabled: z.value,
85
152
  "onUpdate:value": Z
86
153
  }, null, 8, [
87
154
  "value",
88
155
  "rows",
89
156
  "placeholder",
90
157
  "disabled"
91
- ])) : !f.variable.type || f.variable.type === "text" ? (m(), o(v(T), {
158
+ ])) : !m.variable.type || m.variable.type === "text" ? (g(), c(x(D), {
92
159
  key: 1,
93
- value: U.value,
94
- placeholder: f.variable.placeholder || "",
95
- disabled: H.value,
160
+ value: B.value,
161
+ placeholder: m.variable.placeholder || "",
162
+ disabled: z.value,
96
163
  "onUpdate:value": Z
97
164
  }, null, 8, [
98
165
  "value",
99
166
  "placeholder",
100
167
  "disabled"
101
- ])) : f.variable.type === "date" ? (m(), o(v(C), {
168
+ ])) : m.variable.type === "select" ? (g(), c(x(ce), {
102
169
  key: 2,
103
- "value-format": "YYYY-MM-DD",
104
- value: U.value,
105
- placeholder: f.variable.placeholder || "",
106
- disabled: H.value,
107
- "onUpdate:value": ee
170
+ value: Y.value,
171
+ options: J.value,
172
+ mode: m.variable.multiple ? "multiple" : void 0,
173
+ placeholder: m.variable.placeholder || "请选择",
174
+ disabled: z.value,
175
+ loading: m.loading,
176
+ "allow-clear": "",
177
+ "onUpdate:value": Q
108
178
  }, null, 8, [
109
179
  "value",
180
+ "options",
181
+ "mode",
110
182
  "placeholder",
111
- "disabled"
112
- ])) : f.variable.type === "number" ? (m(), o(v(E), {
183
+ "disabled",
184
+ "loading"
185
+ ])) : m.variable.type === "radio" ? (g(), c(x(se), {
113
186
  key: 3,
114
- value: W.value,
115
- precision: f.variable.precision,
116
- placeholder: f.variable.placeholder || "",
117
- disabled: H.value,
187
+ value: Y.value,
188
+ disabled: z.value,
118
189
  "onUpdate:value": Q
190
+ }, {
191
+ default: S(() => [(g(!0), u(o, null, v(J.value, (e) => (g(), c(x(oe), {
192
+ key: e.value,
193
+ value: e.value,
194
+ disabled: e.disabled
195
+ }, {
196
+ default: S(() => [f(b(e.label), 1)]),
197
+ _: 2
198
+ }, 1032, ["value", "disabled"]))), 128))]),
199
+ _: 1
200
+ }, 8, ["value", "disabled"])) : m.variable.type === "user-selector" || m.variable.type === "dept-selector" || m.variable.type === "role-selector" || m.variable.type === "org-selector" ? (g(), u("div", A, [m.registration ? (g(), c(y(m.registration?.component), h({ key: 0 }, X.value, { "onUpdate:modelValue": $ }), null, 16)) : m.variable.type === "org-selector" ? (g(), u("span", j, b(V.value || m.variable.placeholder || "组织架构占位(由宿主提供组件)"), 1)) : (g(), u(o, { key: 2 }, [p(x(T), {
201
+ disabled: z.value || !m.selectorHttp,
202
+ title: m.selectorHttp ? void 0 : "请注入 selectorHttp 后使用内置选择器",
203
+ onClick: n[0] ||= C((e) => K.value = !0, ["stop"])
204
+ }, {
205
+ default: S(() => [f(b(V.value || m.variable.placeholder || "请选择"), 1)]),
206
+ _: 1
207
+ }, 8, ["disabled", "title"]), p(x(e), {
208
+ "model-value": ve.value,
209
+ visible: K.value,
210
+ "onUpdate:visible": n[1] ||= (e) => K.value = e,
211
+ http: m.selectorHttp,
212
+ "url-prefix": m.selectorUrlPrefix,
213
+ type: q.value,
214
+ "is-single": !0,
215
+ "hide-slot": "",
216
+ "onUpdate:modelValue": xe
217
+ }, null, 8, [
218
+ "model-value",
219
+ "visible",
220
+ "http",
221
+ "url-prefix",
222
+ "type"
223
+ ])], 64))])) : m.variable.type === "custom" && m.registration ? (g(), c(y(m.registration?.component), h({ key: 5 }, X.value, { "onUpdate:modelValue": $ }), null, 16)) : m.variable.type === "custom" ? (g(), c(x(w), {
224
+ key: 6,
225
+ type: "warning",
226
+ "show-icon": "",
227
+ message: `未注册自定义控件 ${m.variable.componentKey || "(空)"}`
228
+ }, null, 8, ["message"])) : m.variable.type === "date" ? (g(), c(x(re), {
229
+ key: 7,
230
+ "value-format": "YYYY-MM-DD",
231
+ value: B.value,
232
+ placeholder: m.variable.placeholder || "",
233
+ disabled: z.value,
234
+ "onUpdate:value": Se
235
+ }, null, 8, [
236
+ "value",
237
+ "placeholder",
238
+ "disabled"
239
+ ])) : m.variable.type === "number" ? (g(), c(x(ae), {
240
+ key: 8,
241
+ value: he.value,
242
+ precision: m.variable.precision,
243
+ placeholder: m.variable.placeholder || "",
244
+ disabled: z.value,
245
+ "onUpdate:value": ye
119
246
  }, null, 8, [
120
247
  "value",
121
248
  "precision",
122
249
  "placeholder",
123
250
  "disabled"
124
- ])) : f.variable.type === "checkbox" ? (m(), c("label", F, [d(v(S), {
125
- checked: G.value,
126
- disabled: H.value,
127
- "onUpdate:checked": $
128
- }, null, 8, ["checked", "disabled"]), l("span", null, _(G.value ? f.variable.checkedText || "已选" : f.variable.uncheckedText || "未选"), 1)])) : f.variable.type === "image" ? (m(), c("div", I, [
129
- d(v(T), {
130
- value: U.value,
131
- placeholder: f.variable.placeholder || "请输入图片 URL",
132
- disabled: H.value,
251
+ ])) : m.variable.type === "checkbox" ? (g(), u("label", M, [p(x(E), {
252
+ checked: H.value,
253
+ disabled: z.value,
254
+ "onUpdate:checked": be
255
+ }, null, 8, ["checked", "disabled"]), d("span", null, b(H.value ? m.variable.checkedText || "已选" : m.variable.uncheckedText || "未选"), 1)])) : m.variable.type === "image" ? (g(), u("div", N, [
256
+ p(x(D), {
257
+ value: B.value,
258
+ placeholder: m.variable.placeholder || "请输入图片 URL",
259
+ disabled: z.value,
133
260
  "onUpdate:value": Z
134
261
  }, null, 8, [
135
262
  "value",
136
263
  "placeholder",
137
264
  "disabled"
138
265
  ]),
139
- d(v(D), { title: "清除图片地址" }, {
140
- default: y(() => [d(v(x), {
266
+ p(x(O), { title: "清除图片地址" }, {
267
+ default: S(() => [p(x(T), {
141
268
  "aria-label": "清除图片地址",
142
- disabled: H.value || !U.value,
143
- onClick: t[0] ||= b((e) => Z(""), ["stop"])
269
+ disabled: z.value || !B.value,
270
+ onClick: n[2] ||= C((e) => Z(""), ["stop"])
144
271
  }, {
145
- icon: y(() => [d(v(O))]),
272
+ icon: S(() => [p(x(le))]),
146
273
  _: 1
147
274
  }, 8, ["disabled"])]),
148
275
  _: 1
149
276
  }),
150
- q.value ? (m(), c("div", L, [d(v(w), {
151
- src: q.value,
152
- alt: f.variable.label || f.variable.key
153
- }, null, 8, ["src", "alt"]), l("span", null, [d(v(k)), t[3] ||= u(" 点击图片预览", -1)])])) : s("", !0)
154
- ])) : (m(), o(v(T), {
155
- key: 6,
156
- value: U.value,
157
- placeholder: f.variable.placeholder || "",
158
- disabled: H.value,
277
+ W.value ? (g(), u("div", P, [p(x(ie), {
278
+ src: W.value,
279
+ alt: m.variable.label || m.variable.key
280
+ }, null, 8, ["src", "alt"]), d("span", null, [p(x(ue)), n[5] ||= f(" 点击图片预览", -1)])])) : l("", !0)
281
+ ])) : (g(), c(x(D), {
282
+ key: 11,
283
+ value: B.value,
284
+ placeholder: m.variable.placeholder || "",
285
+ disabled: z.value,
159
286
  "onUpdate:value": Z
160
287
  }, null, 8, [
161
288
  "value",
162
289
  "placeholder",
163
290
  "disabled"
164
291
  ])),
165
- K.value ? (m(), c("div", R, [(m(!0), c(i, null, h(f.errors, (e) => (m(), c("span", { key: `${e.id}-${e.message}` }, _(e.message), 1))), 128))])) : s("", !0)
292
+ U.value ? (g(), u("div", F, [(g(!0), u(o, null, v(m.errors, (e) => (g(), u("span", { key: `${e.id}-${e.message}` }, b(e.message), 1))), 128))])) : l("", !0),
293
+ m.loadError ? (g(), c(x(w), {
294
+ key: 13,
295
+ type: "warning",
296
+ "show-icon": "",
297
+ message: m.loadError
298
+ }, null, 8, ["message"])) : l("", !0)
166
299
  ], 34));
167
300
  }
168
301
  });
169
302
  //#endregion
170
- export { z as default };
303
+ export { I as default };
@@ -0,0 +1,5 @@
1
+ import e from "./ContractTemplateVariableDataModal.vue.mjs";
2
+ //#region src/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };