@guodun/antdv 1.4.3 → 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 (118) hide show
  1. package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +85 -85
  2. package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +1 -1
  3. package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +66 -13
  4. package/dist/es/components/contract-signing-location/src/constants.mjs +27 -17
  5. package/dist/es/components/contract-signing-location/src/location-rules.mjs +2 -2
  6. package/dist/es/components/contract-signing-location/src/template-source.mjs +52 -36
  7. package/dist/es/components/contract-signing-location/style/index.css +1 -1
  8. package/dist/es/components/dept-selector/src/dept.mjs +170 -142
  9. package/dist/es/components/index.mjs +2 -1
  10. package/dist/es/components/pro-contract-template-designer/index.mjs +2 -1
  11. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +372 -185
  12. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +59 -42
  13. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +4 -4
  14. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs +218 -85
  15. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.mjs +5 -0
  16. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.mjs +97 -0
  17. package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +50 -50
  18. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +948 -887
  19. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +550 -245
  20. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +225 -150
  21. package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs +53 -35
  22. package/dist/es/components/pro-contract-template-designer/src/types.mjs +15 -2
  23. package/dist/es/components/pro-contract-template-designer/src/utils/advanced-controls.mjs +91 -0
  24. package/dist/es/components/pro-contract-template-designer/src/utils/page-decorations.mjs +17 -17
  25. package/dist/es/components/pro-contract-template-designer/src/utils/signing-placement.mjs +14 -14
  26. package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +168 -137
  27. package/dist/es/components/pro-contract-template-designer/src/utils/template-tool-icons.mjs +23 -16
  28. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  29. package/dist/es/components/pro-selector/src/components/org-tree.mjs +130 -89
  30. package/dist/es/components/pro-selector/src/components/user.mjs +34 -26
  31. package/dist/es/components/pro-selector/src/pro-user.mjs +86 -72
  32. package/dist/es/components/pro-selector/src/types.mjs +4 -1
  33. package/dist/es/components/pro-selector/src/utils/orgTree.mjs +5 -2
  34. package/dist/es/components/pro-selector-group/src/compoents/dept-tree.vue.mjs +92 -65
  35. package/dist/es/components/pro-selector-group/src/compoents/dept.vue.mjs +3 -3
  36. package/dist/es/components/pro-selector-group/src/compoents/role.vue.mjs +98 -73
  37. package/dist/es/components/pro-selector-group/src/compoents/select-box.vue.mjs +12 -9
  38. package/dist/es/components/pro-selector-group/src/compoents/user.vue.mjs +101 -72
  39. package/dist/es/components/pro-selector-group/src/hooks/useApi.mjs +39 -22
  40. package/dist/es/components/pro-selector-group/src/index.vue.mjs +105 -83
  41. package/dist/es/components/pro-selector-group/src/utils/index.mjs +36 -0
  42. package/dist/es/components/role-selector/src/role.mjs +134 -120
  43. package/dist/es/index.mjs +50 -49
  44. package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
  45. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
  46. package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.vue.cjs +1 -1
  47. package/dist/lib/components/contract-signing-location/src/constants.cjs +1 -1
  48. package/dist/lib/components/contract-signing-location/src/location-rules.cjs +1 -1
  49. package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -1
  50. package/dist/lib/components/contract-signing-location/style/index.css +1 -1
  51. package/dist/lib/components/dept-selector/src/dept.cjs +1 -1
  52. package/dist/lib/components/index.cjs +1 -1
  53. package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
  54. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +2 -1
  55. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -1
  56. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
  57. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.cjs +1 -1
  58. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.cjs +1 -0
  59. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.cjs +1 -0
  60. package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
  61. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  62. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
  63. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
  64. package/dist/lib/components/pro-contract-template-designer/src/extensions/template-variable.cjs +1 -1
  65. package/dist/lib/components/pro-contract-template-designer/src/types.cjs +1 -1
  66. package/dist/lib/components/pro-contract-template-designer/src/utils/advanced-controls.cjs +1 -0
  67. package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -1
  68. package/dist/lib/components/pro-contract-template-designer/src/utils/signing-placement.cjs +1 -1
  69. package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
  70. package/dist/lib/components/pro-contract-template-designer/src/utils/template-tool-icons.cjs +1 -1
  71. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  72. package/dist/lib/components/pro-selector/src/components/org-tree.cjs +1 -1
  73. package/dist/lib/components/pro-selector/src/components/user.cjs +1 -1
  74. package/dist/lib/components/pro-selector/src/pro-user.cjs +1 -1
  75. package/dist/lib/components/pro-selector/src/types.cjs +1 -1
  76. package/dist/lib/components/pro-selector/src/utils/orgTree.cjs +1 -1
  77. package/dist/lib/components/pro-selector-group/src/compoents/dept-tree.vue.cjs +1 -1
  78. package/dist/lib/components/pro-selector-group/src/compoents/dept.vue.cjs +1 -1
  79. package/dist/lib/components/pro-selector-group/src/compoents/role.vue.cjs +1 -1
  80. package/dist/lib/components/pro-selector-group/src/compoents/select-box.vue.cjs +1 -1
  81. package/dist/lib/components/pro-selector-group/src/compoents/user.vue.cjs +1 -1
  82. package/dist/lib/components/pro-selector-group/src/hooks/useApi.cjs +1 -1
  83. package/dist/lib/components/pro-selector-group/src/index.vue.cjs +1 -1
  84. package/dist/lib/components/pro-selector-group/src/utils/index.cjs +1 -0
  85. package/dist/lib/components/role-selector/src/role.cjs +1 -1
  86. package/dist/lib/index.cjs +1 -1
  87. package/dist/theme/contract-signing-location.css +1 -1
  88. package/dist/theme/dept-selector.css +1 -1
  89. package/dist/theme/icon.css +1 -1
  90. package/dist/theme/index.css +1 -1
  91. package/dist/theme/pro-selector-group.css +1 -1
  92. package/dist/theme/pro-selector.css +1 -1
  93. package/dist/theme/role-selector.css +1 -1
  94. package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +3 -3
  95. package/dist/types/components/contract-signing-location/src/ContractSigningTemplatePage.vue.d.ts +3 -1
  96. package/dist/types/components/contract-signing-location/src/constants.d.ts +18 -0
  97. package/dist/types/components/contract-signing-location/src/coordinates.d.ts +6 -0
  98. package/dist/types/components/contract-signing-location/src/template-source.d.ts +17 -0
  99. package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
  100. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +1 -0
  101. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +3 -0
  102. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.d.ts +7 -1
  103. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.d.ts +14 -0
  104. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +13 -1
  105. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +11 -1
  106. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +4 -0
  107. package/dist/types/components/pro-contract-template-designer/src/extensions/template-variable.d.ts +11 -1
  108. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +131 -2
  109. package/dist/types/components/pro-contract-template-designer/src/utils/advanced-controls.d.ts +15 -0
  110. package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +10 -2
  111. package/dist/types/components/pro-selector/index.d.ts +9 -0
  112. package/dist/types/components/pro-selector/src/components/user.d.ts +9 -0
  113. package/dist/types/components/pro-selector/src/types.d.ts +2 -0
  114. package/dist/types/components/pro-selector/src/utils/orgTree.d.ts +4 -1
  115. package/dist/types/components/pro-selector-group/src/compoents/select-box.vue.d.ts +4 -4
  116. package/dist/types/components/pro-selector-group/src/hooks/useApi.d.ts +6 -1
  117. package/dist/types/components/pro-selector-group/src/utils/index.d.ts +8 -0
  118. package/package.json +5 -1
@@ -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 };
@@ -0,0 +1,97 @@
1
+ import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, openBlock as s, ref as c, toDisplayString as l, unref as u, watch as d, withCtx as f } from "vue";
2
+ import { Button as p, Modal as m, Tooltip as h, message as g } from "ant-design-vue";
3
+ import { CheckOutlined as _, CopyOutlined as v } from "@ant-design/icons-vue";
4
+ //#region src/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue?vue&type=script&setup=true&lang.ts
5
+ var y = { class: "gd-contract-template-designer__variable-data-grid" }, b = { class: "gd-contract-template-designer__variable-data-section" }, x = { class: "gd-contract-template-designer__variable-data-section-head" }, S = { class: "gd-contract-template-designer__variable-data-code" }, C = {
6
+ key: 0,
7
+ class: "gd-contract-template-designer__variable-data-error"
8
+ }, w = { class: "gd-contract-template-designer__variable-data-section" }, T = { class: "gd-contract-template-designer__variable-data-section-head" }, E = { class: "gd-contract-template-designer__variable-data-code" }, D = {
9
+ key: 0,
10
+ class: "gd-contract-template-designer__variable-data-error"
11
+ }, O = /* @__PURE__ */ o({
12
+ __name: "ContractTemplateVariableDataModal",
13
+ props: {
14
+ open: { type: Boolean },
15
+ data: {},
16
+ fileName: {}
17
+ },
18
+ emits: ["update:open", "cancel"],
19
+ setup(o, { emit: O }) {
20
+ let k = o, A = O, j = c(), M = c(), N = c(""), P = c(), F = e(() => JSON.stringify(k.data.values, null, 2)), I = e(() => JSON.stringify(k.data.variables, null, 2));
21
+ d(() => k.open, (e) => {
22
+ e || (j.value = void 0, M.value = void 0, N.value = "", P.value = void 0);
23
+ });
24
+ async function L(e) {
25
+ let t = e === "values" ? F.value : I.value;
26
+ j.value = e, M.value = void 0, N.value = "", P.value = void 0;
27
+ try {
28
+ if (typeof navigator > "u" || !navigator.clipboard?.writeText) throw Error("当前浏览器未授权剪贴板操作");
29
+ await navigator.clipboard.writeText(t), M.value = e, g.success(e === "values" ? "控件值对象已复制" : "控件变量定义已复制");
30
+ } catch (t) {
31
+ let n = t instanceof Error ? t.message : "未知错误";
32
+ N.value = `复制失败:${n}`, P.value = e, g.error(`复制失败:${n}`);
33
+ } finally {
34
+ j.value = void 0;
35
+ }
36
+ }
37
+ return (e, c) => (s(), t(u(m), {
38
+ open: o.open,
39
+ title: o.fileName ? `控件变量 · ${o.fileName}` : "控件变量",
40
+ width: "min(1100px, calc(100vw - 48px))",
41
+ centered: "",
42
+ footer: null,
43
+ "wrap-class-name": "gd-contract-template-designer__variable-data-modal",
44
+ "onUpdate:open": c[2] ||= (e) => A("update:open", e),
45
+ onCancel: c[3] ||= (e) => A("cancel")
46
+ }, {
47
+ default: f(() => [i("div", y, [i("section", b, [
48
+ i("div", x, [c[4] ||= i("div", null, [i("strong", null, "接口请求值"), i("small", null, "按控件 key 生成,可直接作为请求 body")], -1), a(u(h), { title: "复制接口请求值" }, {
49
+ default: f(() => [a(u(p), {
50
+ size: "small",
51
+ class: "gd-contract-template-designer__icon-button",
52
+ loading: j.value === "values",
53
+ "aria-label": "复制接口请求值",
54
+ onClick: c[0] ||= (e) => L("values")
55
+ }, {
56
+ default: f(() => [M.value === "values" ? (s(), t(u(_), {
57
+ key: 1,
58
+ "aria-hidden": "true"
59
+ })) : (s(), t(u(v), {
60
+ key: 0,
61
+ "aria-hidden": "true"
62
+ }))]),
63
+ _: 1
64
+ }, 8, ["loading"])]),
65
+ _: 1
66
+ })]),
67
+ i("pre", S, l(F.value), 1),
68
+ N.value && P.value === "values" ? (s(), r("small", C, l(N.value), 1)) : n("", !0)
69
+ ]), i("section", w, [
70
+ i("div", T, [c[5] ||= i("div", null, [i("strong", null, "控件变量定义"), i("small", null, "当前文件完整 variables 数组")], -1), a(u(h), { title: "复制控件变量定义" }, {
71
+ default: f(() => [a(u(p), {
72
+ size: "small",
73
+ class: "gd-contract-template-designer__icon-button",
74
+ loading: j.value === "variables",
75
+ "aria-label": "复制控件变量定义",
76
+ onClick: c[1] ||= (e) => L("variables")
77
+ }, {
78
+ default: f(() => [M.value === "variables" ? (s(), t(u(_), {
79
+ key: 1,
80
+ "aria-hidden": "true"
81
+ })) : (s(), t(u(v), {
82
+ key: 0,
83
+ "aria-hidden": "true"
84
+ }))]),
85
+ _: 1
86
+ }, 8, ["loading"])]),
87
+ _: 1
88
+ })]),
89
+ i("pre", E, l(I.value), 1),
90
+ N.value && P.value === "variables" ? (s(), r("small", D, l(N.value), 1)) : n("", !0)
91
+ ])])]),
92
+ _: 1
93
+ }, 8, ["open", "title"]));
94
+ }
95
+ });
96
+ //#endregion
97
+ export { O as default };