@jeecg/online 3.7.1-RC → 3.7.4-beta

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 (143) hide show
  1. package/AccountLoginForm-84cbd344.mjs +254 -0
  2. package/AiModal-26903538.mjs +84 -0
  3. package/AppForgetPassword-52443f23.mjs +310 -0
  4. package/AppLogin-ecf798fa.mjs +287 -0
  5. package/AppLoginHeader-4432c584.mjs +27 -0
  6. package/AppNameEmail-3303a037.mjs +180 -0
  7. package/AppRegister-79a62c59.mjs +303 -0
  8. package/AppTenant-f0bef7ca.mjs +373 -0
  9. package/AppThirdForm-fd8b4604.mjs +189 -0
  10. package/AuthButtonConfig-d5bffca0.mjs +156 -0
  11. package/AuthButtonTree-b0bd6c40.mjs +165 -0
  12. package/{AuthDataConfig-5c3a8e6b.mjs → AuthDataConfig-d3b7afa4.mjs} +23 -23
  13. package/{AuthDataTree-dd7a1240.mjs → AuthDataTree-f14a98d9.mjs} +43 -43
  14. package/{AuthFieldConfig-9f6fa06c.mjs → AuthFieldConfig-f1e224cc.mjs} +71 -71
  15. package/AuthFieldTree-5cc0da05.mjs +232 -0
  16. package/{AuthManagerDrawer-76f15e8d.mjs → AuthManagerDrawer-32556109.mjs} +6 -6
  17. package/{AuthSetterModal-f5d2e87f.mjs → AuthSetterModal-364f1f67.mjs} +9 -9
  18. package/BuiltInButtonList-bb6cf95c.mjs +10 -0
  19. package/BuiltInButtonList.vue_vue_type_script_setup_true_lang-07d0b7d0.mjs +338 -0
  20. package/CgformAddressModal-1131274c.mjs +260 -0
  21. package/CgformCopyList-5fba0810.mjs +252 -0
  22. package/{CgformModal-21c5c387.mjs → CgformModal-c4a4e0c2.mjs} +190 -194
  23. package/{CgreportModal-edefa8e3.mjs → CgreportModal-8a84aae5.mjs} +181 -168
  24. package/{CheckDictTable-1bc8322d.mjs → CheckDictTable-8a938e3a.mjs} +3 -3
  25. package/CodeFileListModal-a924902a.mjs +159 -0
  26. package/{CodeFileViewModal-2fe911f4.mjs → CodeFileViewModal-405e2b58.mjs} +66 -66
  27. package/CodeGeneratorModal-2e1dc13d.mjs +281 -0
  28. package/CustomButtonList-c453b654.mjs +274 -0
  29. package/{DBAttributeTable-285d40db.mjs → DBAttributeTable-1a45c7b7.mjs} +3 -3
  30. package/{DbToOnlineModal-5dcb67c3.mjs → DbToOnlineModal-f28ff0a3.mjs} +53 -54
  31. package/{DetailForm-deecbf3d.mjs → DetailForm-c592b8d8.mjs} +5 -5
  32. package/DropMenuItem-1e49abea.mjs +44 -0
  33. package/{EnhanceJavaModal-45c66cd5.mjs → EnhanceJavaModal-d5a93f2a.mjs} +62 -62
  34. package/{EnhanceJsHistory-fab3102e.mjs → EnhanceJsHistory-8ddb0657.mjs} +35 -35
  35. package/{EnhanceJsModal-175357a1.mjs → EnhanceJsModal-dc4f9ade.mjs} +104 -104
  36. package/{EnhanceSqlModal-7ea1b300.mjs → EnhanceSqlModal-984f045d.mjs} +67 -67
  37. package/ErrorTip-bb616e32.mjs +7 -0
  38. package/ErrorTip.vue_vue_type_script_setup_true_lang-49d35987.mjs +60 -0
  39. package/{ExtendConfigModal-a89ae052.mjs → ExtendConfigModal-7d70f362.mjs} +2 -2
  40. package/{FieldExtendJsonModal-32135634.mjs → FieldExtendJsonModal-bf04d70e.mjs} +2 -2
  41. package/{FileSelectModal-1643c8b9.mjs → FileSelectModal-ffc69d4a.mjs} +23 -23
  42. package/{ForeignKeyTable-7f7e28a7.mjs → ForeignKeyTable-92decaea.mjs} +3 -3
  43. package/{IndexTable-cdcc2b48.mjs → IndexTable-2ded2014.mjs} +3 -3
  44. package/JModalTip-a927f85d.mjs +49 -0
  45. package/{JOnlineSearchSelect-22aae934.mjs → JOnlineSearchSelect-04ec87d0.mjs} +1 -1
  46. package/{LeftDepart-d5615ed9.mjs → LeftDepart-52cb6743.mjs} +1 -1
  47. package/LeftRole-b0e0b496.mjs +86 -0
  48. package/{LeftUser-22baa378.mjs → LeftUser-dd4b10e2.mjs} +30 -30
  49. package/{LinkTableConfigModal-9242d750.mjs → LinkTableConfigModal-7eeb3e58.mjs} +43 -31
  50. package/{LinkTableFieldConfigModal-24adc50c.mjs → LinkTableFieldConfigModal-b078fcef.mjs} +1 -1
  51. package/{LinkTableListPiece-f3a8e0d7.mjs → LinkTableListPiece-e016b8e6.mjs} +1 -1
  52. package/{ModalFormDemo-711418db.mjs → ModalFormDemo-aaa719a7.mjs} +1 -1
  53. package/OnlCgformErpList-5c5acdaa.mjs +488 -0
  54. package/OnlCgformErpSubTable-e1b88312.mjs +441 -0
  55. package/{OnlCgformInnerSubTable-6c23781f.mjs → OnlCgformInnerSubTable-6b6fa15a.mjs} +38 -38
  56. package/OnlCgformInnerTableList-b283a525.mjs +474 -0
  57. package/OnlCgformTabList-91e3dd78.mjs +424 -0
  58. package/OnlineAutoList-84475f1b.mjs +513 -0
  59. package/OnlineAutoModal-95f46901.mjs +260 -0
  60. package/OnlineAutoTreeList-20b9ce04.mjs +523 -0
  61. package/OnlineCustomModal-c8b1e780.mjs +232 -0
  62. package/{OnlineDetailModal-d5895734.mjs → OnlineDetailModal-5b412bb9.mjs} +74 -65
  63. package/OnlineForm-58282699.mjs +1012 -0
  64. package/{OnlineFormDetail-022ca117.mjs → OnlineFormDetail-fc087725.mjs} +7 -7
  65. package/{OnlineFormUrlAdd-9715d70a.mjs → OnlineFormUrlAdd-bc9105bb.mjs} +9 -9
  66. package/{OnlineFormUrlDetail-8f864b1a.mjs → OnlineFormUrlDetail-ad912560.mjs} +11 -11
  67. package/{OnlineFormUrlEdit-ac985b36.mjs → OnlineFormUrlEdit-f2fa79ff.mjs} +9 -9
  68. package/OnlineFormUrlSuccess-76813d45.mjs +59 -0
  69. package/OnlineQueryForm-9248341f.mjs +484 -0
  70. package/{OnlineSearchFormItem-6c557343.mjs → OnlineSearchFormItem-1e437bd3.mjs} +82 -82
  71. package/{OnlineSelectCascade-05c40fef.mjs → OnlineSelectCascade-d631ed72.mjs} +1 -1
  72. package/{OnlineSubFormDetail-58e896ce.mjs → OnlineSubFormDetail-8be879b9.mjs} +52 -53
  73. package/{OnlineTabAutoModal-47b18ad6.mjs → OnlineTabAutoModal-c9ca3c24.mjs} +108 -95
  74. package/{OnlineTabDetailModal-82de1465.mjs → OnlineTabDetailModal-fd4c9a72.mjs} +36 -36
  75. package/OnlineTabForm-1940e88b.mjs +814 -0
  76. package/{OnlineTabFormDetail-8d0c40c0.mjs → OnlineTabFormDetail-2aa67564.mjs} +17 -17
  77. package/{PageAttributeTable-25e3b7da.mjs → PageAttributeTable-66e7b485.mjs} +108 -108
  78. package/PhoneLoginForm-86437a9d.mjs +214 -0
  79. package/{ProcessOnlineForm-148632fe.mjs → ProcessOnlineForm-98ede18d.mjs} +32 -32
  80. package/{QueryTable-f7bfca7f.mjs → QueryTable-65d3f54f.mjs} +3 -3
  81. package/SetSwitchOptions-f914bc17.mjs +62 -0
  82. package/ShareAddView-657f0f8b.mjs +86 -0
  83. package/ShareEditView-1b945fd3.mjs +92 -0
  84. package/ShareView-222ed3d8.mjs +80 -0
  85. package/ShareView.vue_vue_type_script_setup_true_lang-44fbeaff.mjs +162 -0
  86. package/SingleView-23b0cb4e.mjs +68 -0
  87. package/SingleView.vue_vue_type_style_index_0_lang-e0f2f6c0.mjs +131 -0
  88. package/SuperQuery-46032e66.mjs +974 -0
  89. package/{SuperQueryValComponent-7ad86d4b.mjs → SuperQueryValComponent-5a9ccfd4.mjs} +1 -1
  90. package/{SuperQueryValComponent.vue_vue_type_script_lang-e9196096.mjs → SuperQueryValComponent.vue_vue_type_script_lang-8fe34917.mjs} +11 -11
  91. package/{auth.api-ea1d33d4.mjs → auth.api-53df4c33.mjs} +17 -17
  92. package/{auth.data-511e5197.mjs → auth.data-626c5083.mjs} +16 -12
  93. package/button.data-fe45d43b.mjs +12 -0
  94. package/{cgform.data-475d4984.mjs → cgform.data-0ca62d09.mjs} +4 -1
  95. package/{enhance.data-a67572e1.mjs → enhance.data-6601ff44.mjs} +1 -1
  96. package/index-19eaef11.mjs +11 -0
  97. package/index-1a2e8832.mjs +135 -0
  98. package/{index-f30613d1.mjs → index-2fb8e07f.mjs} +59 -59
  99. package/index-5e89258d.mjs +8 -0
  100. package/index-9e1e1e53.mjs +57 -0
  101. package/{index-30e0e923.mjs → index-a039036e.mjs} +272 -262
  102. package/index-c5a79b0b.mjs +219 -0
  103. package/index-cce225be.mjs +110 -0
  104. package/index-f2c2d1cf.mjs +74 -0
  105. package/main.index.js +1 -1
  106. package/package.json +1 -1
  107. package/shareStore-7de6c7a6.mjs +67 -0
  108. package/style.css +1 -1
  109. package/useCgformList-f3cb9156.mjs +378 -0
  110. package/useExtendComponent-bb98e568.mjs +4460 -0
  111. package/useListButton-98908683.mjs +719 -0
  112. package/{useSchemas-a9c75b0f.mjs → useSchemas-b074f3a1.mjs} +33 -0
  113. package/{useTableSync-d7e9f18d.mjs → useTableSync-075826a1.mjs} +1 -1
  114. package/utils-9fce7606.mjs +16 -0
  115. package/AiModal-6de335e3.mjs +0 -84
  116. package/AuthButtonConfig-89763932.mjs +0 -154
  117. package/AuthButtonTree-2d87d0b3.mjs +0 -157
  118. package/AuthFieldTree-e326fc38.mjs +0 -232
  119. package/CgformCopyList-365b3e8f.mjs +0 -251
  120. package/CodeFileListModal-24601898.mjs +0 -159
  121. package/CodeGeneratorModal-f09fe903.mjs +0 -282
  122. package/CustomButtonList-f07bc695.mjs +0 -397
  123. package/JModalTip-b055ab60.mjs +0 -49
  124. package/LeftRole-2ed8a2bf.mjs +0 -86
  125. package/OnlCgformErpList-58acdfa0.mjs +0 -470
  126. package/OnlCgformErpSubTable-9b1e1938.mjs +0 -426
  127. package/OnlCgformInnerTableList-4b5e14ed.mjs +0 -458
  128. package/OnlCgformTabList-019ad753.mjs +0 -408
  129. package/OnlineAutoList-48589d09.mjs +0 -493
  130. package/OnlineAutoModal-c2928847.mjs +0 -239
  131. package/OnlineAutoTreeList-3baa1d00.mjs +0 -503
  132. package/OnlineCustomModal-9e17b6ce.mjs +0 -232
  133. package/OnlineForm-9f1153ba.mjs +0 -985
  134. package/OnlineFormUrlSuccess-3dfc54ab.mjs +0 -59
  135. package/OnlineQueryForm-eedb9a60.mjs +0 -466
  136. package/OnlineTabForm-27655c83.mjs +0 -817
  137. package/SetSwitchOptions-b2af757f.mjs +0 -62
  138. package/SuperQuery-a8592995.mjs +0 -967
  139. package/index-1d1a6e56.mjs +0 -57
  140. package/useCgformList-f41d4dc1.mjs +0 -426
  141. package/useExtendComponent-dcae5c78.mjs +0 -4399
  142. package/useListButton-bfac4ecf.mjs +0 -697
  143. /package/{OnlineForm.vue_vue_type_style_index_0_scoped_4657b304_lang-4ed993c7.mjs → OnlineForm.vue_vue_type_style_index_0_scoped_3f26e7bd_lang-4ed993c7.mjs} +0 -0
@@ -1,4399 +0,0 @@
1
- var Cn = Object.defineProperty, Sn = Object.defineProperties;
2
- var Fn = Object.getOwnPropertyDescriptors;
3
- var vt = Object.getOwnPropertySymbols;
4
- var _n = Object.prototype.hasOwnProperty, Tn = Object.prototype.propertyIsEnumerable;
5
- var yt = (n, e, t) => e in n ? Cn(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, ce = (n, e) => {
6
- for (var t in e || (e = {}))
7
- _n.call(e, t) && yt(n, t, e[t]);
8
- if (vt)
9
- for (var t of vt(e))
10
- Tn.call(e, t) && yt(n, t, e[t]);
11
- return n;
12
- }, Me = (n, e) => Sn(n, Fn(e));
13
- var z = (n, e, t) => new Promise((i, f) => {
14
- var s = (h) => {
15
- try {
16
- w(t.next(h));
17
- } catch (T) {
18
- f(T);
19
- }
20
- }, p = (h) => {
21
- try {
22
- w(t.throw(h));
23
- } catch (T) {
24
- f(T);
25
- }
26
- }, w = (h) => h.done ? i(h.value) : Promise.resolve(h.value).then(s, p);
27
- w((t = t.apply(n, e)).next());
28
- });
29
- import { add as xn } from "/@/components/Form/src/componentMap";
30
- import { propTypes as re } from "/@/utils/propTypes";
31
- import { computed as pe, watch as he, unref as Ce, ref as P, reactive as Se, toRaw as be, nextTick as Ne, resolveComponent as le, openBlock as ee, createBlock as Oe, createElementBlock as de, normalizeClass as Ye, createVNode as fe, defineComponent as xt, h as je, mergeProps as Ot, withCtx as oe, createTextVNode as _e, toDisplayString as xe, createCommentVNode as Te, watchEffect as On, inject as Pn, onMounted as Pt, onBeforeUnmount as Dn, createElementVNode as me, Fragment as Ue, renderList as it, markRaw as In, defineAsyncComponent as Mn } from "vue";
32
- import { PrinterOutlined as Rn, DiffOutlined as kn, FormOutlined as En, PlusOutlined as ot, EditOutlined as $n, MinusCircleFilled as Ln } from "@ant-design/icons-vue";
33
- import { useModal as De, useModalInner as Dt, BasicModal as It } from "/@/components/Modal";
34
- import { useMessage as Re } from "/@/hooks/web/useMessage";
35
- import { BasicForm as Mt, useForm as Rt } from "/@/components/Form/index";
36
- import { defHttp as ge } from "/@/utils/http/axios";
37
- import { pick as qe } from "lodash-es";
38
- import { L as lt } from "./constant-fa63bd66.mjs";
39
- import { replaceUserInfoByExpression as jn, getFileAccessHttpUrl as Je } from "/@/utils/common/compUtils";
40
- import { UploadTypeEnum as An } from "/@/components/Form/src/jeecg/components/JUpload";
41
- import { isArray as wt, isObject as kt } from "/@/utils/is";
42
- import { duplicateCheck as Nn } from "/@/views/system/user/user.api";
43
- import { useUserStore as Bn } from "/@/store/modules/user";
44
- import { replaceAll as Vn, _eval as at, goJmReportViewPage as Wn, importViewsFile as Jn, getWeekMonthQuarterYear as Yn } from "/@/utils";
45
- import * as Et from "/@/utils/desform/customExpression";
46
- import { usePermissionStore as Un } from "/@/store/modules/permission";
47
- import { filterMultiDictText as $t } from "/@/utils/dict/JDictSelectUtil";
48
- import { BasicTable as qn, TableAction as Hn } from "/@/components/Table";
49
- import { useListPage as Qn } from "/@/hooks/system/useListPage";
50
- import { useRouter as zn } from "vue-router";
51
- import { getAreaTextByCode as Kn } from "/@/components/Form/src/utils/Area";
52
- import { createImgPreview as Zn } from "/@/components/Preview/index";
53
- import Gn from "./LinkTableListPiece-f3a8e0d7.mjs";
54
- import { getToken as Lt } from "/@/utils/auth";
55
- import { downloadFile as Xn } from "/@/api/common/api";
56
- import { useAppInject as jt } from "/@/hooks/web/useAppInject";
57
- import { _ as Ee } from "./index-1d1a6e56.mjs";
58
- import He from "/@/assets/images/placeholderImage.png";
59
- import ei from "./OnlineSelectCascade-05c40fef.mjs";
60
- import { Loading as At } from "/@/components/Loading";
61
- import ti from "./JModalTip-b055ab60.mjs";
62
- import { Button as Ge } from "ant-design-vue";
63
- import { useDebounceFn as ni } from "@vueuse/core";
64
- const ii = "jeecg_submit_form_and_flow", Rs = "flow_submit_id", li = "online_form_table_name", Le = "validate-failed", ks = "setup", Es = "EnhanceJS", $s = {
65
- password: "text",
66
- file: "text",
67
- image: "text",
68
- textarea: "text",
69
- umeditor: "text",
70
- markdown: "text",
71
- checkbox: "list_multi",
72
- radio: "list"
73
- }, si = ".jeecg-online-modal .ant-modal-content", ri = "online_";
74
- class X {
75
- constructor(e, t) {
76
- this._data = t, this.field = e, this.label = t.title, this.hidden = !1, this.order = t.order || 999, this.required = !1, this.onlyValidator = "", this.setFieldsValue = "", this.hasChange = !0, e.indexOf("@") > 0 ? this.pre = e.substring(0, e.indexOf("@") + 1) : this.pre = "", this.schemaProp = {}, this.searchForm = !1, this.disabled = !1, this.popContainer = "", this.handleWidgetAttr(t), this.inPopover = !1, this.labelLength = lt, this.initLabelLength();
77
- }
78
- /**
79
- * 获取最终的表单配置项,外面获取调用此方法
80
- */
81
- getFormItemSchema() {
82
- let e = this.getItem();
83
- return this.addDefaultChangeEvent(e), e;
84
- }
85
- /**
86
- * 获取表单配置,子类重写此方法
87
- */
88
- getItem() {
89
- let e = {
90
- field: this.field,
91
- label: this.label,
92
- labelLength: this.labelLength,
93
- component: "Input",
94
- itemProps: {
95
- labelCol: {
96
- class: "online-form-label"
97
- }
98
- }
99
- }, t = this.getRule();
100
- return t.length > 0 && this.onlyValidator && (e.rules = t), this.hidden === !0 && (e.show = !1), e;
101
- }
102
- /**
103
- * 设置表单ref
104
- * popup、分类树需要关联设置其他表单值的时候用到
105
- * @param ref
106
- */
107
- setFormRef(e) {
108
- this.formRef = e;
109
- }
110
- /**
111
- * 设置表单元素隐藏
112
- */
113
- isHidden() {
114
- return this.hidden = !0, this;
115
- }
116
- /**
117
- * 设置是否必填项
118
- * @param array
119
- */
120
- isRequired(e) {
121
- return e && e.length > 0 && e.indexOf(this.field) >= 0 && (this.required = !0), this;
122
- }
123
- /**
124
- * 初始化 label长度
125
- */
126
- initLabelLength() {
127
- let e = this.getExtendData();
128
- e && e.labelLength && (this.labelLength = e.labelLength);
129
- }
130
- /**
131
- * 获取扩展参数
132
- */
133
- getExtendData() {
134
- let e = {}, { fieldExtendJson: t } = this._data;
135
- if (t && typeof t == "string")
136
- try {
137
- let i = JSON.parse(t);
138
- e = ce({}, i);
139
- } catch (i) {
140
- }
141
- return e;
142
- }
143
- /***
144
- * 获取和此字段相关的其他字段 需要设置其为隐藏
145
- */
146
- getRelatedHideFields() {
147
- return [];
148
- }
149
- /**
150
- * placeholder
151
- */
152
- getPlaceholder(e) {
153
- let t = "请输入";
154
- return [
155
- "list",
156
- "radio",
157
- "checkbox",
158
- "date",
159
- "datetime",
160
- "time",
161
- "list_multi",
162
- "sel_search",
163
- "popup",
164
- "cat_tree",
165
- "sel_depart",
166
- "sel_user",
167
- "pca",
168
- "link_down",
169
- "sel_tree",
170
- "switch",
171
- "link_table",
172
- "link_table_field",
173
- "popup_dict",
174
- "LinkTableForQuery",
175
- "CascaderPcaForQuery",
176
- "select_user2",
177
- "rangeDate",
178
- "rangeTime",
179
- "rangeNumber"
180
- ].includes(e) ? t = "请选择" : ["file", "image"].includes(e) && (t = "请上传"), t + this.label;
181
- }
182
- /**
183
- * 唯一校验
184
- */
185
- setOnlyValidateFun(e) {
186
- e && (this.onlyValidator = (t, i) => z(this, null, function* () {
187
- let f = yield e(t, i);
188
- return f ? Promise.reject(f) : Promise.resolve();
189
- }));
190
- }
191
- /**
192
- * 获取校验规则
193
- */
194
- getRule() {
195
- let e = [];
196
- const { view: t, errorInfo: i, pattern: f, type: s, fieldExtendJson: p } = this._data;
197
- if (this.required === !0) {
198
- let w = this.getPlaceholder(t);
199
- if (p) {
200
- const h = JSON.parse(p);
201
- h.validateError && (w = h.validateError);
202
- }
203
- i && (w = i), t == "sel_depart" || t == "sel_user" ? (this.schemaProp.required = !0, e.push({ required: !0, message: w })) : e.push({ required: !0, message: w });
204
- }
205
- if (t == "sel_user" && f === "only" && this.onlyValidator && e.push({ validator: this.onlyValidator }), t === "list" || t === "radio" || t === "markdown" || t === "pca" || t.indexOf("sel") >= 0 || t === "time" || t.indexOf("upload") >= 0 || t.indexOf("file") >= 0 || t.indexOf("image") >= 0)
206
- return e;
207
- if (f)
208
- if (f === "only")
209
- this.onlyValidator && e.push({ validator: this.onlyValidator });
210
- else if (f === "z")
211
- s == "number" || s == "integer" || e.push({ pattern: /^-?\d+$/, message: "请输入整数" });
212
- else {
213
- let w = i || "正则校验失败", h;
214
- try {
215
- h = new RegExp(f), h || (h = f);
216
- } catch (T) {
217
- h = f;
218
- }
219
- e.push({ pattern: h, message: w });
220
- }
221
- return e;
222
- }
223
- /**
224
- * 添加默认的change事件
225
- * @param schema
226
- */
227
- addDefaultChangeEvent(e) {
228
- this.hasChange && (e.componentProps || (e.componentProps = {}), this.disabled == !0 && (e.componentProps.disabled = !0), e.componentProps.hasOwnProperty("onChange") || (e.componentProps.onChange = (t, i) => {
229
- t instanceof Event && (t = t.target.value), t instanceof Array && (t = t.join(",")), !this.formRef || !this.formRef.value || !this.formRef.value.$formValueChange || this.formRef.value.$formValueChange(this.field, t, i);
230
- })), Object.keys(this.schemaProp).map((t) => {
231
- e[t] = this.schemaProp[t];
232
- });
233
- }
234
- noChange() {
235
- this.hasChange = !1;
236
- }
237
- updateField(e) {
238
- this.field = e;
239
- }
240
- /**
241
- * 高级查询 没有表单ref对象 手动设置setFieldValue方法用于 popup设置表单值
242
- */
243
- setFunctionForFieldValue(e) {
244
- e && (this.setFieldsValue = e);
245
- }
246
- asSearchForm() {
247
- this.searchForm = !0;
248
- }
249
- /**获取modal作为类下拉组件pop的父容器*/
250
- getModalAsContainer() {
251
- let e = this.getPopContainer();
252
- if (e != "body") {
253
- const t = document.querySelectorAll(e);
254
- if (t && t.length > 1) {
255
- const i = [];
256
- if (t.forEach((f) => {
257
- f.offsetWidth == 0 && f.offsetHeight == 0 || i.push(f);
258
- }), i.length === 1)
259
- return i[0];
260
- }
261
- }
262
- return document.querySelector(e);
263
- }
264
- /**区分modal表单和查询表单*/
265
- getPopContainer() {
266
- return this.searchForm === !0 ? "body" : this.inPopover === !0 ? `.${this.popContainer}` : this.popContainer ? `.${this.popContainer} .ant-modal-content` : si;
267
- }
268
- handleWidgetAttr(e) {
269
- e.ui && e.ui.widgetattrs && e.ui.widgetattrs.disabled == !0 && (this.disabled = !0);
270
- }
271
- /**
272
- * 设置 popContainer
273
- */
274
- setCustomPopContainer(e) {
275
- this.popContainer = e;
276
- }
277
- //update-begin-author:taoyan date:2022-8-5 for: 他表字段/关联记录用
278
- // 获取他表字段的 配置信息
279
- getLinkFieldInfo() {
280
- return "";
281
- }
282
- // 1.将他表字段的配置信息设置到关联记录字段上
283
- setOtherInfo(e) {
284
- }
285
- //update-end-author:taoyan date:2022-8-5 for: 他表字段/关联记录用
286
- // 表单设计器高级查询用
287
- isInPopover() {
288
- this.inPopover = !0;
289
- }
290
- handleDictTableParams() {
291
- if (!this.formRef.value)
292
- return;
293
- const e = this._data.dictTable;
294
- if (!e)
295
- return;
296
- const t = e.match(/\${([^}]+)}/g);
297
- if (!t || t.length == 0)
298
- return;
299
- const i = t.map((p) => p.replace("${", "").replace("}", "")), f = pe(() => {
300
- const p = this.formRef.value.formModel;
301
- return i.map((w) => p[w]).join("");
302
- });
303
- let s = null;
304
- he(f, () => {
305
- s && clearTimeout(s), s = setTimeout(() => {
306
- const p = this.formRef.value.formModel;
307
- let w = e.replace(/\${([^}]+)}/g, (h, T) => p[T] == null ? "" : p[T]);
308
- this.updateDictTable(w);
309
- }, 150);
310
- }, { immediate: !0 });
311
- }
312
- updateDictTable(e) {
313
- }
314
- /**
315
- * 获取表字典的编码,可替换系统变量
316
- * @param dictTable
317
- * @param dictText
318
- * @param dictCode
319
- */
320
- genDictTableCode(e, t, i) {
321
- return e = jn(e), encodeURI(`${e},${t},${i}`);
322
- }
323
- }
324
- class Ct extends X {
325
- getItem() {
326
- let e = super.getItem();
327
- return this.hidden === !0 && (e.show = !1), e;
328
- }
329
- }
330
- var Nt = /* @__PURE__ */ ((n) => (n.datetime = "YYYY-MM-DD HH:mm:ss", n.date = "YYYY-MM-DD", n))(Nt || {});
331
- class oi extends X {
332
- constructor(e, t, i) {
333
- super(e, t), this.format = Nt[t.view], this.showTime = t.view != "date";
334
- let f = t.fieldExtendJson;
335
- t.view == "date" && f && (f = JSON.parse(f), f.picker && f.picker != "default" ? this.picker = f.picker : this.picker = void 0), this.allowSelectRange = ["eq", "ne"].includes(i == null ? void 0 : i.rule);
336
- }
337
- getItem() {
338
- let e = super.getItem();
339
- return Object.assign({}, e, {
340
- component: "DatePickerInFilter",
341
- componentProps: {
342
- placeholder: `请选择${this.label}`,
343
- showTime: this.showTime,
344
- valueFormat: this.format,
345
- allowSelectRange: this.allowSelectRange,
346
- // update-begin--author:liaozhiyang---date:20240430---for:【issues/6094】online 日期(年月日)控件增加年、年月,年周,年季度等格式
347
- picker: this.picker,
348
- // update-end--author:liaozhiyang---date:20240430---for:【issues/6094】online 日期(年月日)控件增加年、年月,年周,年季度等格式
349
- style: {
350
- width: "100%"
351
- },
352
- getPopupContainer: (t) => this.getModalAsContainer()
353
- }
354
- });
355
- }
356
- }
357
- class ai extends X {
358
- constructor(e, t) {
359
- super(e, t), this.schema = t, this.options = this.getOptions(t.enum, t.type), this.dictTable = t.dictTable, this.dictText = t.dictText, this.dictCode = t.dictCode, this.multi = t.multi || !1;
360
- }
361
- getItem() {
362
- let e = super.getItem(), t = this.getFormComponent(), i = this.getComponentProps();
363
- return Object.assign({}, e, {
364
- component: t,
365
- componentProps: i
366
- });
367
- }
368
- getFormComponent() {
369
- return this.options.length > 0 ? "Select" : "JDictSelectTag";
370
- }
371
- setFormRef(e) {
372
- super.setFormRef(e), this.handleDictTableParams();
373
- }
374
- updateDictTable(e) {
375
- this.formRef.value.updateSchema({
376
- field: this.field,
377
- componentProps: {
378
- dictCode: this.genDictTableCode(e, this.dictText, this.dictCode)
379
- }
380
- });
381
- }
382
- getComponentProps() {
383
- let t = {
384
- allowClear: !0,
385
- mode: this.multi === !0 ? "multiple" : "combobox",
386
- style: {
387
- width: "100%"
388
- },
389
- getPopupContainer: (i) => this.getModalAsContainer(),
390
- // 下拉框展开/关闭的回调
391
- onDropdownVisibleChange: (i) => {
392
- i && typeof this.schema.updateOptions == "function" && this.schema.updateOptions();
393
- }
394
- };
395
- return this.options.length > 0 ? t.options = this.options : this.dictTable ? t.dictCode = this.genDictTableCode(this.dictTable, this.dictText, this.dictCode) : (t.dictCode = this.dictCode, t.useDicColor = !0), t;
396
- }
397
- getOptions(e, t) {
398
- if (!e || e.length == 0)
399
- return [];
400
- let i = t == "number", f = [];
401
- for (let s of e) {
402
- if (s == null)
403
- break;
404
- let p = s.value;
405
- i && (p = parseInt(p)), f.push(Me(ce({}, s), {
406
- value: p,
407
- label: s.title
408
- }));
409
- }
410
- return f;
411
- }
412
- }
413
- class ui extends X {
414
- getItem() {
415
- let e = super.getItem();
416
- return Object.assign({}, e, {
417
- component: "InputPassword"
418
- });
419
- }
420
- }
421
- class ci extends X {
422
- getItem() {
423
- let e = super.getItem(), t = this.getComponentProps();
424
- return Object.assign({}, e, {
425
- component: "JUpload",
426
- componentProps: t
427
- });
428
- }
429
- getComponentProps() {
430
- let e = this.getExtendData();
431
- return e && e.uploadnum ? {
432
- maxCount: Number(e.uploadnum)
433
- } : {};
434
- }
435
- }
436
- class di extends X {
437
- getItem() {
438
- let e = super.getItem(), t = this.getComponentProps();
439
- return Object.assign({}, e, {
440
- component: "JUpload",
441
- componentProps: t
442
- });
443
- }
444
- getComponentProps() {
445
- let e = {
446
- fileType: An.image
447
- }, t = this.getExtendData();
448
- return t && t.uploadnum && (e.maxCount = Number(t.uploadnum)), e;
449
- }
450
- }
451
- class fi extends X {
452
- getItem() {
453
- let e = super.getItem();
454
- return Object.assign({}, e, {
455
- component: "InputTextArea",
456
- componentProps: {
457
- autoSize: {
458
- minRows: 4,
459
- maxRows: 10
460
- }
461
- }
462
- });
463
- }
464
- }
465
- class pi extends X {
466
- constructor(e, t) {
467
- super(e, t), this.dictTable = t.dictTable, this.dictText = t.dictText, this.dictCode = t.dictCode;
468
- }
469
- setFormRef(e) {
470
- super.setFormRef(e), this.handleDictTableParams();
471
- }
472
- updateDictTable(e) {
473
- this.formRef.value.updateSchema({
474
- field: this.field,
475
- componentProps: {
476
- dictCode: this.genDictTableCode(e, this.dictText, this.dictCode)
477
- }
478
- });
479
- }
480
- getItem() {
481
- let e = super.getItem(), t = this.getComponentProps();
482
- return Object.assign({}, e, {
483
- component: "JSelectMultiple",
484
- componentProps: t
485
- });
486
- }
487
- getComponentProps() {
488
- if (!this.dictTable && !this.dictCode)
489
- return {};
490
- {
491
- let e = {};
492
- return this.dictTable ? e.dictCode = this.genDictTableCode(this.dictTable, this.dictText, this.dictCode) : (e.dictCode = this.dictCode, e.useDicColor = !0), e.triggerChange = !0, e.popContainer = this.getPopContainer(), e;
493
- }
494
- }
495
- }
496
- class mi extends X {
497
- constructor(e, t) {
498
- super(e, t), t.dictTable && t.dictText && t.dictCode ? (this.dict = this.genDictTableCode(t.dictTable, t.dictText, t.dictCode), this.type = 1) : (this.dict = encodeURI(`${t.dictCode}`), this.type = 0);
499
- }
500
- setFormRef(e) {
501
- super.setFormRef(e), this.handleDictTableParams();
502
- }
503
- updateDictTable(e) {
504
- this.formRef.value.updateSchema({
505
- field: this.field,
506
- componentProps: {
507
- dict: this.genDictTableCode(e, this._data.dictText, this._data.dictCode)
508
- }
509
- });
510
- }
511
- getItem() {
512
- let e = super.getItem(), t = this.getPopContainer();
513
- return Object.assign({}, e, {
514
- component: "JSearchSelect",
515
- componentProps: {
516
- dict: this.dict,
517
- pageSize: 10,
518
- // update-begin--author:liaozhiyang---date:20240628---for:【issues/6336】online下拉搜索框设置数据字典编辑弹窗报错
519
- async: !!this.type,
520
- // update-end--author:liaozhiyang---date:20240628---for:【issues/6336】online下拉搜索框设置数据字典编辑弹窗报错
521
- popContainer: t
522
- }
523
- });
524
- }
525
- }
526
- class hi extends X {
527
- constructor(e, t) {
528
- super(e, t), this.code = t.code, this.multi = t.popupMulti, this.fieldConfig = this.getFieldConfig(t);
529
- }
530
- getItem() {
531
- let e = super.getItem(), t = this.getComponentProps();
532
- return Object.assign({}, e, {
533
- component: "JPopup",
534
- componentProps: t
535
- });
536
- }
537
- getComponentProps() {
538
- let e = {
539
- code: this.code,
540
- multi: this.multi,
541
- fieldConfig: this.fieldConfig
542
- };
543
- return this.formRef ? e.formElRef = this.formRef : e.setFieldsValue = this.setFieldsValue, this.inPopover === !0 && (e.getContainer = () => this.getModalAsContainer()), e.getFormValues = () => Ce(this.formRef).getFieldsValue(), e;
544
- }
545
- getFieldConfig(e) {
546
- let { destFields: t, orgFields: i } = e;
547
- if (!t || t.length == 0)
548
- return [];
549
- let f = t.split(","), s = i.split(","), p = [];
550
- const w = this.pre;
551
- for (let h = 0; h < f.length; h++)
552
- p.push({
553
- target: w + f[h],
554
- source: s[h]
555
- });
556
- return p;
557
- }
558
- }
559
- class gi extends X {
560
- constructor(e, t) {
561
- super(e, t), this.dictCode = `${t.code},${t.destFields},${t.orgFields}`, this.multi = t.popupMulti;
562
- }
563
- getItem() {
564
- const e = super.getItem(), t = this.getComponentProps();
565
- return Object.assign({}, e, {
566
- component: "JPopupDict",
567
- componentProps: t
568
- });
569
- }
570
- getComponentProps() {
571
- const e = {
572
- dictCode: this.dictCode,
573
- multi: this.multi
574
- };
575
- return this.inPopover && (e.getContainer = () => this.getModalAsContainer()), e.getFormValues = () => Ce(this.formRef).getFieldsValue(), e;
576
- }
577
- }
578
- class bi extends X {
579
- constructor(e, t) {
580
- super(e, t), this.multi = !1, this.pid = t.pidValue, this.pcode = t.pcode, this.textField = t.textField;
581
- }
582
- getItem() {
583
- let e = super.getItem(), t = this.getComponentProps();
584
- return Object.assign({}, e, {
585
- componentProps: t,
586
- component: "JCategorySelect"
587
- });
588
- }
589
- /**
590
- * 1. 不带返回值的
591
- * 2. 带文本返回的
592
- */
593
- getComponentProps() {
594
- let e = {
595
- placeholder: "请选择" + this.label
596
- };
597
- if (this.pcode)
598
- e.pcode = this.pcode;
599
- else {
600
- let t = this.pid || "EMPTY_PID";
601
- e.pid = t;
602
- }
603
- return this.textField ? Me(ce({
604
- loadTriggleChange: !0,
605
- multiple: this.multi
606
- }, e), {
607
- back: this.textField,
608
- onChange: (t, i) => {
609
- this.formRef && (this.formRef.value.setFieldsValue(i), this.formRef.value.$formValueChange(this.field, t));
610
- }
611
- }) : ce({
612
- multiple: this.multi
613
- }, e);
614
- }
615
- getRelatedHideFields() {
616
- let e = [];
617
- return this.textField && e.push(this.textField), e;
618
- }
619
- }
620
- class vi extends X {
621
- getItem() {
622
- let e = super.getItem(), t = this.getComponentProps();
623
- return Object.assign({}, e, {
624
- component: "JSelectDept",
625
- componentProps: t
626
- });
627
- }
628
- getComponentProps() {
629
- let e = this.getExtendData(), t = {
630
- checkStrictly: !0,
631
- showButton: !1
632
- };
633
- return e.text && (t.labelKey = e.text), e.store && (t.rowKey = e.store), e.multiSelect === !1 && (t.multiple = !1), e.multiSelect === !0 && (t.multiple = !0), t.maxTagCount = 3, this.inPopover === !0 && (t.getContainer = () => this.getModalAsContainer()), t;
634
- }
635
- }
636
- class yi extends X {
637
- constructor(e, t) {
638
- super(e, t), this.showButton = t.showButton !== !1;
639
- }
640
- getItem() {
641
- let e = super.getItem(), t = this.getComponentProps();
642
- return Object.assign({}, e, {
643
- component: "JSelectUser",
644
- componentProps: t
645
- });
646
- }
647
- getComponentProps() {
648
- let e = this.getExtendData(), t = {
649
- showSelected: !1,
650
- allowClear: !0,
651
- isRadioSelection: !1,
652
- showButton: this.showButton
653
- };
654
- return e.text && (t.labelKey = e.text), e.store && (t.rowKey = e.store), e.multiSelect === !1 && (t.isRadioSelection = !0), t.maxTagCount = 3, this.inPopover === !0 && (t.getContainer = () => this.getModalAsContainer()), t;
655
- }
656
- }
657
- class wi extends X {
658
- getItem() {
659
- let e = super.getItem();
660
- return Object.assign({}, e, {
661
- component: "JEditor",
662
- componentProps: {
663
- //update-begin-author:taoyan date:2022-6-1 for: VUEN-1159 第一次加载时,点击第一个输入框,光标会跑到富文本输入框
664
- options: {
665
- auto_focus: !1
666
- }
667
- //update-end-author:taoyan date:2022-6-1 for: VUEN-1159 第一次加载时,点击第一个输入框,光标会跑到富文本输入框
668
- // fileMax:1,
669
- // showImageUpload:false,
670
- // width:"966px",
671
- // height:"200px"
672
- }
673
- });
674
- }
675
- }
676
- class Ci extends X {
677
- getItem() {
678
- let e = super.getItem();
679
- return Object.assign({}, e, {
680
- component: "JMarkdownEditor",
681
- componentProps: {
682
- // height: 300,
683
- }
684
- });
685
- }
686
- }
687
- class Si extends X {
688
- getItem() {
689
- let e = super.getItem();
690
- return Object.assign({}, e, {
691
- component: "JAreaLinkage",
692
- componentProps: {
693
- saveCode: "region",
694
- getPopupContainer: () => document.querySelector("body")
695
- }
696
- });
697
- }
698
- }
699
- class Fi extends X {
700
- constructor(e, t) {
701
- super(e, t), this.dict = t.dict, this.pidField = t.pidField, this.pidValue = t.pidValue, this.hasChildField = t.hasChildField;
702
- }
703
- getItem() {
704
- let e = super.getItem();
705
- return Object.assign({}, e, {
706
- component: "JTreeSelect",
707
- componentProps: {
708
- dict: this.dict,
709
- pidField: this.pidField,
710
- pidValue: this.pidValue,
711
- // update-begin--author:liaozhiyang---date:20240509---for:【issues/6197】解决自定义树组件是否含有子节点功能不生效
712
- hasChildField: this.hasChildField
713
- // update-end--author:liaozhiyang---date:20240509---for:【issues/6197】解决自定义树组件是否含有子节点功能不生效
714
- }
715
- });
716
- }
717
- }
718
- class _i extends X {
719
- constructor(e, t) {
720
- super(e, t), this.dictTable = t.dictTable, this.dictText = t.dictText, this.dictCode = t.dictCode;
721
- }
722
- setFormRef(e) {
723
- super.setFormRef(e), this.handleDictTableParams();
724
- }
725
- updateDictTable(e) {
726
- this.formRef.value.updateSchema({
727
- field: this.field,
728
- componentProps: {
729
- dictCode: this.genDictTableCode(e, this.dictText, this.dictCode)
730
- }
731
- });
732
- }
733
- getItem() {
734
- let e = super.getItem(), t = this.getComponentProps();
735
- return Object.assign({}, e, {
736
- component: "JDictSelectTag",
737
- componentProps: t
738
- });
739
- }
740
- getComponentProps() {
741
- return !this.dictTable && !this.dictCode ? {} : this.dictTable ? {
742
- dictCode: this.genDictTableCode(this.dictTable, this.dictText, this.dictCode),
743
- type: "radio"
744
- } : {
745
- // update-begin--author:liaozhiyang---date:20230110---for:【QQYUN-7799】字典组件(原生组件除外)加上颜色配置
746
- useDicColor: !0,
747
- // update-end--author:liaozhiyang---date:20230110---for:【QQYUN-7799】字典组件(原生组件除外)加上颜色配置
748
- dictCode: this.dictCode,
749
- type: "radio"
750
- };
751
- }
752
- }
753
- class Ti extends X {
754
- constructor(e, t) {
755
- super(e, t), this.options = this.getOptions(t.enum);
756
- }
757
- setFormRef(e) {
758
- super.setFormRef(e), this.handleDictTableParams();
759
- }
760
- updateDictTable(e) {
761
- this.formRef.value.updateSchema({
762
- field: this.field,
763
- componentProps: {
764
- options: [],
765
- dictCode: this.genDictTableCode(e, this._data.dictText, this._data.dictCode)
766
- }
767
- });
768
- }
769
- getItem() {
770
- let e = super.getItem();
771
- return Object.assign({}, e, {
772
- component: "JCheckbox",
773
- componentProps: {
774
- options: this.options,
775
- triggerChange: !0,
776
- // update-begin--author:liaozhiyang---date:20230110---for:【QQYUN-7799】字典组件(原生组件除外)加上颜色配置
777
- useDicColor: !0
778
- // update-end--author:liaozhiyang---date:20230110---for:【QQYUN-7799】字典组件(原生组件除外)加上颜色配置
779
- }
780
- });
781
- }
782
- getOptions(e) {
783
- if (!e || e.length == 0)
784
- return [];
785
- let t = [];
786
- for (let i of e)
787
- t.push({
788
- value: i.value,
789
- label: i.title,
790
- // update-begin--author:liaozhiyang---date:20230110---for:【QQYUN-7799】字典组件(原生组件除外)加上颜色配置
791
- color: i.color
792
- // update-end--author:liaozhiyang---date:20230110---for:【QQYUN-7799】字典组件(原生组件除外)加上颜色配置
793
- });
794
- return t;
795
- }
796
- }
797
- class xi extends X {
798
- constructor(e, t) {
799
- super(e, t);
800
- }
801
- getItem() {
802
- let e = super.getItem(), t = this.getComponentProps();
803
- return Object.assign({}, e, {
804
- component: "JSwitch",
805
- componentProps: t
806
- });
807
- }
808
- getComponentProps() {
809
- let { fieldExtendJson: e } = this._data, t = ["Y", "N"];
810
- if (e && typeof e == "string") {
811
- const i = JSON.parse(e);
812
- wt(i) && i.length == 2 ? t = i : kt(i) && wt(i.switchOptions) && (t = i.switchOptions);
813
- }
814
- return {
815
- options: t
816
- };
817
- }
818
- }
819
- class Oi extends X {
820
- getItem() {
821
- let e = super.getItem();
822
- return Object.assign({}, e, {
823
- component: "TimePicker",
824
- componentProps: {
825
- placeholder: `请选择${this.label}`,
826
- valueFormat: "HH:mm:ss",
827
- getPopupContainer: (t) => this.getModalAsContainer(),
828
- style: {
829
- width: "100%"
830
- }
831
- }
832
- });
833
- }
834
- }
835
- class Pi extends X {
836
- constructor(e, t) {
837
- super(e, t);
838
- const { dictTable: i, dictText: f, dictCode: s, pidField: p, idField: w, origin: h, condition: T } = t;
839
- this.table = i, this.txt = f, this.store = s, this.idField = w, this.pidField = p, this.origin = h, this.condition = T, this.options = [], this.next = t.next || "", this.type = t.type;
840
- }
841
- getItem() {
842
- let e = super.getItem(), t = this.getComponentProps();
843
- return Object.assign({}, e, {
844
- component: "OnlineSelectCascade",
845
- componentProps: t
846
- });
847
- }
848
- getComponentProps() {
849
- let e = {
850
- table: this.table,
851
- txt: this.txt,
852
- store: this.store,
853
- pidField: this.pidField,
854
- idField: this.idField,
855
- origin: this.origin,
856
- pidValue: "-1",
857
- style: {
858
- width: "100%"
859
- },
860
- onChange: (t) => {
861
- this.valueChange(t);
862
- },
863
- onNext: (t) => {
864
- this.nextOptionsChange(t);
865
- }
866
- };
867
- return this._data.origin === !0 && (e.condition = this.condition), e;
868
- }
869
- nextOptionsChange(e) {
870
- return z(this, null, function* () {
871
- if (!this.formRef || !this.next)
872
- return;
873
- yield this.formRef.value.updateSchema({
874
- field: this.next,
875
- componentProps: {
876
- pidValue: e
877
- }
878
- });
879
- });
880
- }
881
- valueChange(e) {
882
- return z(this, null, function* () {
883
- if (!this.formRef)
884
- return;
885
- let t = this.formRef.value;
886
- t.$formValueChange(this.field, e), this.next && (yield t.setFieldsValue({ [this.next]: "" }));
887
- });
888
- }
889
- }
890
- class St extends X {
891
- constructor(e, t) {
892
- super(e, t), this.slot = "";
893
- let i = t.fieldExtendJson;
894
- t.view == "date" && i && (i = JSON.parse(i), i.picker && i.picker != "default" ? this.picker = i.picker : this.picker = void 0), this.precision = t.dbPointLength;
895
- }
896
- getItem() {
897
- let e = super.getItem(), t = this.slot;
898
- const i = {};
899
- return this.picker && (i.picker = this.picker), this.precision && (i.precision = this.precision), Object.assign({}, e, {
900
- slot: t,
901
- componentProps: i
902
- });
903
- }
904
- groupDate() {
905
- return this.slot = "groupDate", this;
906
- }
907
- groupDatetime() {
908
- return this.slot = "groupDatetime", this;
909
- }
910
- groupTime() {
911
- return this.slot = "groupTime", this;
912
- }
913
- groupNumber() {
914
- return this.slot = "groupNumber", this;
915
- }
916
- }
917
- class Di extends X {
918
- constructor(e, t) {
919
- super(e, t), this.dbPointLength = t.dbPointLength;
920
- }
921
- getItem() {
922
- let e = super.getItem(), t = this.getComponentProps();
923
- return Object.assign({}, e, {
924
- component: "InputNumber",
925
- componentProps: t
926
- });
927
- }
928
- getComponentProps() {
929
- const e = {
930
- style: {
931
- width: "100%"
932
- }
933
- };
934
- return this.dbPointLength >= 0 && (e.precision = this.dbPointLength), e;
935
- }
936
- }
937
- class Ii extends X {
938
- constructor(e, t) {
939
- super(e, t), this.dictTable = t.dictTable, this.dictText = t.dictText, this.dictCode = t.dictCode, this.view = t.view, this.componentString = "", this.linkFields = [];
940
- }
941
- getItem() {
942
- let e = super.getItem();
943
- const t = this.getComponentProps();
944
- return Object.assign({}, e, {
945
- component: this.componentString,
946
- componentProps: t
947
- });
948
- }
949
- getComponentProps() {
950
- let e = {
951
- textField: this.dictText,
952
- tableName: this.dictTable,
953
- valueField: this.dictCode
954
- }, t = this.getExtendData();
955
- if (t.multiSelect ? e.multi = !0 : e.multi = !1, t.imageField ? e.imageField = t.imageField : e.imageField = "", t.showType == "select") {
956
- this.componentString = "LinkTableSelect";
957
- let i = this.getPopContainer();
958
- e.popContainer = i;
959
- } else
960
- this.componentString = "LinkTableCard";
961
- return this.linkFields.length > 0 && (e.linkFields = this.linkFields), e;
962
- }
963
- // 他表字段用于翻译
964
- setOtherInfo(e) {
965
- this.linkFields = e;
966
- }
967
- }
968
- class Mi extends X {
969
- constructor(e, t) {
970
- super(e, t), this.dictTable = t.dictTable, this.dictText = t.dictText;
971
- }
972
- getItem() {
973
- let e = super.getItem();
974
- return Object.assign({}, e, {
975
- componentProps: {
976
- readOnly: !0,
977
- allowClear: !1,
978
- disabled: !0,
979
- style: {
980
- background: "none",
981
- color: "rgba(0, 0, 0, 0.85)",
982
- border: "none"
983
- }
984
- }
985
- });
986
- }
987
- /**
988
- * 获取他表字段的关联信息
989
- */
990
- getLinkFieldInfo() {
991
- return [this.dictTable, `${this.field},${this.dictText}`];
992
- }
993
- }
994
- class Ri extends X {
995
- constructor(e, t) {
996
- super(e, t), this.code = t.code, this.titleField = t.titleField, this.multi = t.multi || !1;
997
- }
998
- getItem() {
999
- let e = super.getItem();
1000
- return Object.assign({}, e, {
1001
- component: "LinkTableForQuery",
1002
- componentProps: {
1003
- code: this.code,
1004
- multi: this.multi,
1005
- field: this.titleField,
1006
- style: {
1007
- width: "100%"
1008
- }
1009
- }
1010
- });
1011
- }
1012
- }
1013
- class ki extends X {
1014
- constructor(e, t, i) {
1015
- var f;
1016
- super(e, t), this.schema = t, this.areaLevel = (f = t.areaLevel) != null ? f : 3, this.allowChangeLevel = ["eq", "ne"].includes(i == null ? void 0 : i.rule);
1017
- }
1018
- getItem() {
1019
- let e = super.getItem();
1020
- return Object.assign({}, e, {
1021
- component: "CascaderPcaInFilter",
1022
- componentProps: {
1023
- areaLevel: this.areaLevel,
1024
- allowChangeLevel: this.allowChangeLevel,
1025
- placeholder: "请选择…",
1026
- style: {
1027
- width: "100%"
1028
- }
1029
- }
1030
- });
1031
- }
1032
- }
1033
- class Ei extends X {
1034
- constructor(e, t) {
1035
- super(e, t), this.multi = t.multi === !0, this.store = t.store || "", this.query = t.query || !1;
1036
- }
1037
- getItem() {
1038
- let e = super.getItem(), t = this.getComponentProps();
1039
- return Object.assign({}, e, {
1040
- component: "UserSelect",
1041
- componentProps: t
1042
- });
1043
- }
1044
- getComponentProps() {
1045
- let e = {
1046
- multi: this.multi,
1047
- store: this.store,
1048
- query: this.query
1049
- };
1050
- return this.inPopover === !0 && (e.getContainer = () => this.getModalAsContainer()), e;
1051
- }
1052
- }
1053
- class $i extends X {
1054
- constructor(e, t) {
1055
- super(e, t);
1056
- let i = t.view;
1057
- this.format = t.format, this.datetime = !1, i === "rangeNumber" ? this.componentType = "JRangeNumber" : i === "rangeTime" ? this.componentType = "RangeTime" : (this.componentType = "RangeDate", t.datetime === !0 && (this.datetime = !0));
1058
- }
1059
- getItem() {
1060
- let e = super.getItem();
1061
- return Object.assign({}, e, {
1062
- component: this.componentType,
1063
- componentProps: {
1064
- datetime: this.datetime,
1065
- format: this.format,
1066
- getPopupContainer: (t) => this.getModalAsContainer()
1067
- }
1068
- });
1069
- }
1070
- }
1071
- class Xe {
1072
- static createFormSchema(e, t, i) {
1073
- switch (t.view) {
1074
- case "password":
1075
- return new ui(e, t);
1076
- case "list":
1077
- return new ai(e, t);
1078
- case "radio":
1079
- return new _i(e, t);
1080
- case "checkbox":
1081
- return new Ti(e, t);
1082
- case "date":
1083
- case "datetime":
1084
- return new oi(e, t, i);
1085
- case "time":
1086
- return new Oi(e, t);
1087
- case "file":
1088
- return new ci(e, t);
1089
- case "image":
1090
- return new di(e, t);
1091
- case "textarea":
1092
- return new fi(e, t);
1093
- case "list_multi":
1094
- return new pi(e, t);
1095
- case "sel_search":
1096
- return new mi(e, t);
1097
- case "popup":
1098
- return new hi(e, t);
1099
- case "cat_tree":
1100
- return new bi(e, t);
1101
- case "sel_depart":
1102
- return new vi(e, t);
1103
- case "sel_user":
1104
- return new yi(e, t);
1105
- case "umeditor":
1106
- return new wi(e, t);
1107
- case "markdown":
1108
- return new Ci(e, t);
1109
- case "pca":
1110
- return new Si(e, t);
1111
- case "link_down":
1112
- return new Pi(e, t);
1113
- case "sel_tree":
1114
- return new Fi(e, t);
1115
- case "switch":
1116
- return new xi(e, t);
1117
- case "link_table":
1118
- return new Ii(e, t);
1119
- case "link_table_field":
1120
- return new Mi(e, t);
1121
- case "popup_dict":
1122
- return new gi(e, t);
1123
- case "slot":
1124
- return new St(e, t);
1125
- case "LinkTableForQuery":
1126
- return new Ri(e, t);
1127
- case "CascaderPcaForQuery":
1128
- return new ki(e, t, i);
1129
- case "select_user2":
1130
- return new Ei(e, t);
1131
- case "rangeDate":
1132
- case "rangeTime":
1133
- case "rangeNumber":
1134
- return new $i(e, t);
1135
- case "hidden":
1136
- return new Ct(e, t).isHidden();
1137
- default:
1138
- return t.type == "number" ? new Di(e, t) : new Ct(e, t);
1139
- }
1140
- }
1141
- static createSlotFormSchema(e, t) {
1142
- let i = new St(e, t), f = t.view;
1143
- if (f == "date")
1144
- i.groupDate();
1145
- else if (f == "datetime")
1146
- i.groupDatetime();
1147
- else if (f == "time")
1148
- i.groupTime();
1149
- else {
1150
- let s = t.type;
1151
- (s == "number" || s == "integer") && i.groupNumber();
1152
- }
1153
- return i;
1154
- }
1155
- /**
1156
- * 表单ID 默认是隐藏的
1157
- */
1158
- static createIdField() {
1159
- return {
1160
- label: "",
1161
- field: "id",
1162
- component: "Input",
1163
- show: !1
1164
- };
1165
- }
1166
- }
1167
- var ut = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
1168
- function ct(n) {
1169
- return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
1170
- }
1171
- var Bt = { exports: {} };
1172
- (function(n, e) {
1173
- (function(t, i) {
1174
- n.exports = i();
1175
- })(ut, function() {
1176
- var t = 1e3, i = 6e4, f = 36e5, s = "millisecond", p = "second", w = "minute", h = "hour", T = "day", D = "week", y = "month", I = "quarter", F = "year", J = "date", L = "Invalid Date", q = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, N = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, $ = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(b) {
1177
- var r = ["th", "st", "nd", "rd"], d = b % 100;
1178
- return "[" + b + (r[(d - 20) % 10] || r[d] || r[0]) + "]";
1179
- } }, Y = function(b, r, d) {
1180
- var o = String(b);
1181
- return !o || o.length >= r ? b : "" + Array(r + 1 - o.length).join(d) + b;
1182
- }, A = { s: Y, z: function(b) {
1183
- var r = -b.utcOffset(), d = Math.abs(r), o = Math.floor(d / 60), l = d % 60;
1184
- return (r <= 0 ? "+" : "-") + Y(o, 2, "0") + ":" + Y(l, 2, "0");
1185
- }, m: function b(r, d) {
1186
- if (r.date() < d.date())
1187
- return -b(d, r);
1188
- var o = 12 * (d.year() - r.year()) + (d.month() - r.month()), l = r.clone().add(o, y), c = d - l < 0, a = r.clone().add(o + (c ? -1 : 1), y);
1189
- return +(-(o + (d - l) / (c ? l - a : a - l)) || 0);
1190
- }, a: function(b) {
1191
- return b < 0 ? Math.ceil(b) || 0 : Math.floor(b);
1192
- }, p: function(b) {
1193
- return { M: y, y: F, w: D, d: T, D: J, h, m: w, s: p, ms: s, Q: I }[b] || String(b || "").toLowerCase().replace(/s$/, "");
1194
- }, u: function(b) {
1195
- return b === void 0;
1196
- } }, H = "en", Q = {};
1197
- Q[H] = $;
1198
- var Z = function(b) {
1199
- return b instanceof R;
1200
- }, S = function b(r, d, o) {
1201
- var l;
1202
- if (!r)
1203
- return H;
1204
- if (typeof r == "string") {
1205
- var c = r.toLowerCase();
1206
- Q[c] && (l = c), d && (Q[c] = d, l = c);
1207
- var a = r.split("-");
1208
- if (!l && a.length > 1)
1209
- return b(a[0]);
1210
- } else {
1211
- var O = r.name;
1212
- Q[O] = r, l = O;
1213
- }
1214
- return !o && l && (H = l), l || !o && H;
1215
- }, C = function(b, r) {
1216
- if (Z(b))
1217
- return b.clone();
1218
- var d = typeof r == "object" ? r : {};
1219
- return d.date = b, d.args = arguments, new R(d);
1220
- }, v = A;
1221
- v.l = S, v.i = Z, v.w = function(b, r) {
1222
- return C(b, { locale: r.$L, utc: r.$u, x: r.$x, $offset: r.$offset });
1223
- };
1224
- var R = function() {
1225
- function b(d) {
1226
- this.$L = S(d.locale, null, !0), this.parse(d);
1227
- }
1228
- var r = b.prototype;
1229
- return r.parse = function(d) {
1230
- this.$d = function(o) {
1231
- var l = o.date, c = o.utc;
1232
- if (l === null)
1233
- return /* @__PURE__ */ new Date(NaN);
1234
- if (v.u(l))
1235
- return /* @__PURE__ */ new Date();
1236
- if (l instanceof Date)
1237
- return new Date(l);
1238
- if (typeof l == "string" && !/Z$/i.test(l)) {
1239
- var a = l.match(q);
1240
- if (a) {
1241
- var O = a[2] - 1 || 0, x = (a[7] || "0").substring(0, 3);
1242
- return c ? new Date(Date.UTC(a[1], O, a[3] || 1, a[4] || 0, a[5] || 0, a[6] || 0, x)) : new Date(a[1], O, a[3] || 1, a[4] || 0, a[5] || 0, a[6] || 0, x);
1243
- }
1244
- }
1245
- return new Date(l);
1246
- }(d), this.$x = d.x || {}, this.init();
1247
- }, r.init = function() {
1248
- var d = this.$d;
1249
- this.$y = d.getFullYear(), this.$M = d.getMonth(), this.$D = d.getDate(), this.$W = d.getDay(), this.$H = d.getHours(), this.$m = d.getMinutes(), this.$s = d.getSeconds(), this.$ms = d.getMilliseconds();
1250
- }, r.$utils = function() {
1251
- return v;
1252
- }, r.isValid = function() {
1253
- return this.$d.toString() !== L;
1254
- }, r.isSame = function(d, o) {
1255
- var l = C(d);
1256
- return this.startOf(o) <= l && l <= this.endOf(o);
1257
- }, r.isAfter = function(d, o) {
1258
- return C(d) < this.startOf(o);
1259
- }, r.isBefore = function(d, o) {
1260
- return this.endOf(o) < C(d);
1261
- }, r.$g = function(d, o, l) {
1262
- return v.u(d) ? this[o] : this.set(l, d);
1263
- }, r.unix = function() {
1264
- return Math.floor(this.valueOf() / 1e3);
1265
- }, r.valueOf = function() {
1266
- return this.$d.getTime();
1267
- }, r.startOf = function(d, o) {
1268
- var l = this, c = !!v.u(o) || o, a = v.p(d), O = function(j, U) {
1269
- var te = v.w(l.$u ? Date.UTC(l.$y, U, j) : new Date(l.$y, U, j), l);
1270
- return c ? te : te.endOf(T);
1271
- }, x = function(j, U) {
1272
- return v.w(l.toDate()[j].apply(l.toDate("s"), (c ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(U)), l);
1273
- }, u = this.$W, _ = this.$M, k = this.$D, G = "set" + (this.$u ? "UTC" : "");
1274
- switch (a) {
1275
- case F:
1276
- return c ? O(1, 0) : O(31, 11);
1277
- case y:
1278
- return c ? O(1, _) : O(0, _ + 1);
1279
- case D:
1280
- var B = this.$locale().weekStart || 0, K = (u < B ? u + 7 : u) - B;
1281
- return O(c ? k - K : k + (6 - K), _);
1282
- case T:
1283
- case J:
1284
- return x(G + "Hours", 0);
1285
- case h:
1286
- return x(G + "Minutes", 1);
1287
- case w:
1288
- return x(G + "Seconds", 2);
1289
- case p:
1290
- return x(G + "Milliseconds", 3);
1291
- default:
1292
- return this.clone();
1293
- }
1294
- }, r.endOf = function(d) {
1295
- return this.startOf(d, !1);
1296
- }, r.$set = function(d, o) {
1297
- var l, c = v.p(d), a = "set" + (this.$u ? "UTC" : ""), O = (l = {}, l[T] = a + "Date", l[J] = a + "Date", l[y] = a + "Month", l[F] = a + "FullYear", l[h] = a + "Hours", l[w] = a + "Minutes", l[p] = a + "Seconds", l[s] = a + "Milliseconds", l)[c], x = c === T ? this.$D + (o - this.$W) : o;
1298
- if (c === y || c === F) {
1299
- var u = this.clone().set(J, 1);
1300
- u.$d[O](x), u.init(), this.$d = u.set(J, Math.min(this.$D, u.daysInMonth())).$d;
1301
- } else
1302
- O && this.$d[O](x);
1303
- return this.init(), this;
1304
- }, r.set = function(d, o) {
1305
- return this.clone().$set(d, o);
1306
- }, r.get = function(d) {
1307
- return this[v.p(d)]();
1308
- }, r.add = function(d, o) {
1309
- var l, c = this;
1310
- d = Number(d);
1311
- var a = v.p(o), O = function(_) {
1312
- var k = C(c);
1313
- return v.w(k.date(k.date() + Math.round(_ * d)), c);
1314
- };
1315
- if (a === y)
1316
- return this.set(y, this.$M + d);
1317
- if (a === F)
1318
- return this.set(F, this.$y + d);
1319
- if (a === T)
1320
- return O(1);
1321
- if (a === D)
1322
- return O(7);
1323
- var x = (l = {}, l[w] = i, l[h] = f, l[p] = t, l)[a] || 1, u = this.$d.getTime() + d * x;
1324
- return v.w(u, this);
1325
- }, r.subtract = function(d, o) {
1326
- return this.add(-1 * d, o);
1327
- }, r.format = function(d) {
1328
- var o = this, l = this.$locale();
1329
- if (!this.isValid())
1330
- return l.invalidDate || L;
1331
- var c = d || "YYYY-MM-DDTHH:mm:ssZ", a = v.z(this), O = this.$H, x = this.$m, u = this.$M, _ = l.weekdays, k = l.months, G = l.meridiem, B = function(U, te, ne, se) {
1332
- return U && (U[te] || U(o, c)) || ne[te].slice(0, se);
1333
- }, K = function(U) {
1334
- return v.s(O % 12 || 12, U, "0");
1335
- }, j = G || function(U, te, ne) {
1336
- var se = U < 12 ? "AM" : "PM";
1337
- return ne ? se.toLowerCase() : se;
1338
- };
1339
- return c.replace(N, function(U, te) {
1340
- return te || function(ne) {
1341
- switch (ne) {
1342
- case "YY":
1343
- return String(o.$y).slice(-2);
1344
- case "YYYY":
1345
- return v.s(o.$y, 4, "0");
1346
- case "M":
1347
- return u + 1;
1348
- case "MM":
1349
- return v.s(u + 1, 2, "0");
1350
- case "MMM":
1351
- return B(l.monthsShort, u, k, 3);
1352
- case "MMMM":
1353
- return B(k, u);
1354
- case "D":
1355
- return o.$D;
1356
- case "DD":
1357
- return v.s(o.$D, 2, "0");
1358
- case "d":
1359
- return String(o.$W);
1360
- case "dd":
1361
- return B(l.weekdaysMin, o.$W, _, 2);
1362
- case "ddd":
1363
- return B(l.weekdaysShort, o.$W, _, 3);
1364
- case "dddd":
1365
- return _[o.$W];
1366
- case "H":
1367
- return String(O);
1368
- case "HH":
1369
- return v.s(O, 2, "0");
1370
- case "h":
1371
- return K(1);
1372
- case "hh":
1373
- return K(2);
1374
- case "a":
1375
- return j(O, x, !0);
1376
- case "A":
1377
- return j(O, x, !1);
1378
- case "m":
1379
- return String(x);
1380
- case "mm":
1381
- return v.s(x, 2, "0");
1382
- case "s":
1383
- return String(o.$s);
1384
- case "ss":
1385
- return v.s(o.$s, 2, "0");
1386
- case "SSS":
1387
- return v.s(o.$ms, 3, "0");
1388
- case "Z":
1389
- return a;
1390
- }
1391
- return null;
1392
- }(U) || a.replace(":", "");
1393
- });
1394
- }, r.utcOffset = function() {
1395
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
1396
- }, r.diff = function(d, o, l) {
1397
- var c, a = this, O = v.p(o), x = C(d), u = (x.utcOffset() - this.utcOffset()) * i, _ = this - x, k = function() {
1398
- return v.m(a, x);
1399
- };
1400
- switch (O) {
1401
- case F:
1402
- c = k() / 12;
1403
- break;
1404
- case y:
1405
- c = k();
1406
- break;
1407
- case I:
1408
- c = k() / 3;
1409
- break;
1410
- case D:
1411
- c = (_ - u) / 6048e5;
1412
- break;
1413
- case T:
1414
- c = (_ - u) / 864e5;
1415
- break;
1416
- case h:
1417
- c = _ / f;
1418
- break;
1419
- case w:
1420
- c = _ / i;
1421
- break;
1422
- case p:
1423
- c = _ / t;
1424
- break;
1425
- default:
1426
- c = _;
1427
- }
1428
- return l ? c : v.a(c);
1429
- }, r.daysInMonth = function() {
1430
- return this.endOf(y).$D;
1431
- }, r.$locale = function() {
1432
- return Q[this.$L];
1433
- }, r.locale = function(d, o) {
1434
- if (!d)
1435
- return this.$L;
1436
- var l = this.clone(), c = S(d, o, !0);
1437
- return c && (l.$L = c), l;
1438
- }, r.clone = function() {
1439
- return v.w(this.$d, this);
1440
- }, r.toDate = function() {
1441
- return new Date(this.valueOf());
1442
- }, r.toJSON = function() {
1443
- return this.isValid() ? this.toISOString() : null;
1444
- }, r.toISOString = function() {
1445
- return this.$d.toISOString();
1446
- }, r.toString = function() {
1447
- return this.$d.toUTCString();
1448
- }, b;
1449
- }(), M = R.prototype;
1450
- return C.prototype = M, [["$ms", s], ["$s", p], ["$m", w], ["$H", h], ["$W", T], ["$M", y], ["$y", F], ["$D", J]].forEach(function(b) {
1451
- M[b[1]] = function(r) {
1452
- return this.$g(r, b[0], b[1]);
1453
- };
1454
- }), C.extend = function(b, r) {
1455
- return b.$i || (b(r, R, C), b.$i = !0), C;
1456
- }, C.locale = S, C.isDayjs = Z, C.unix = function(b) {
1457
- return C(1e3 * b);
1458
- }, C.en = Q[H], C.Ls = Q, C.p = {}, C;
1459
- });
1460
- })(Bt);
1461
- var Li = Bt.exports;
1462
- const we = /* @__PURE__ */ ct(Li);
1463
- var Vt = { exports: {} };
1464
- (function(n, e) {
1465
- (function(t, i) {
1466
- n.exports = i();
1467
- })(ut, function() {
1468
- var t = "week", i = "year";
1469
- return function(f, s, p) {
1470
- var w = s.prototype;
1471
- w.week = function(h) {
1472
- if (h === void 0 && (h = null), h !== null)
1473
- return this.add(7 * (h - this.week()), "day");
1474
- var T = this.$locale().yearStart || 1;
1475
- if (this.month() === 11 && this.date() > 25) {
1476
- var D = p(this).startOf(i).add(1, i).date(T), y = p(this).endOf(t);
1477
- if (D.isBefore(y))
1478
- return 1;
1479
- }
1480
- var I = p(this).startOf(i).date(T).startOf(t).subtract(1, "millisecond"), F = this.diff(I, t, !0);
1481
- return F < 0 ? p(this).startOf("week").week() : Math.ceil(F);
1482
- }, w.weeks = function(h) {
1483
- return h === void 0 && (h = null), this.week(h);
1484
- };
1485
- };
1486
- });
1487
- })(Vt);
1488
- var ji = Vt.exports;
1489
- const Ai = /* @__PURE__ */ ct(ji);
1490
- var Wt = { exports: {} };
1491
- (function(n, e) {
1492
- (function(t, i) {
1493
- n.exports = i();
1494
- })(ut, function() {
1495
- var t = "month", i = "quarter";
1496
- return function(f, s) {
1497
- var p = s.prototype;
1498
- p.quarter = function(T) {
1499
- return this.$utils().u(T) ? Math.ceil((this.month() + 1) / 3) : this.month(this.month() % 3 + 3 * (T - 1));
1500
- };
1501
- var w = p.add;
1502
- p.add = function(T, D) {
1503
- return T = Number(T), this.$utils().p(D) === i ? this.add(3 * T, t) : w.bind(this)(T, D);
1504
- };
1505
- var h = p.startOf;
1506
- p.startOf = function(T, D) {
1507
- var y = this.$utils(), I = !!y.u(D) || D;
1508
- if (y.p(T) === i) {
1509
- var F = this.quarter() - 1;
1510
- return I ? this.month(3 * F).startOf(t).startOf("day") : this.month(3 * F + 2).endOf(t).endOf("day");
1511
- }
1512
- return h.bind(this)(T, D);
1513
- };
1514
- };
1515
- });
1516
- })(Wt);
1517
- var Ni = Wt.exports;
1518
- const Bi = /* @__PURE__ */ ct(Ni);
1519
- we.extend(Ai);
1520
- we.extend(Bi);
1521
- const Jt = Object.keys(Et), Vi = Jt.join(","), Wi = Jt.map((n) => Et[n]), Yt = /#{([^}]+)?}/g, Ut = /{{([^}]+)?}}/g, st = /\${([^}]+)?}/g, Ae = { ADD: "add", EDIT: "edit", DETAIL: "detail", RELOAD: "reload" };
1522
- function et(n, e, t) {
1523
- if (dt(e.defVal)) {
1524
- const i = { field: n, type: e.type, value: e.defVal, view: e.view, fieldExtendJson: e.fieldExtendJson }, f = t.findIndex((s) => s.field === n);
1525
- f === -1 ? t.push(i) : t[f] = i;
1526
- }
1527
- }
1528
- function Ji(n, e) {
1529
- dt(n.fieldDefaultValue) && e.push({ field: n.key, type: n.type, value: n.fieldDefaultValue });
1530
- }
1531
- function rt(n, e, t) {
1532
- return z(this, null, function* () {
1533
- if (Array.isArray(n) && n.length > 0) {
1534
- let i = {};
1535
- for (let f of n) {
1536
- let { value: s, type: p, field: w } = f;
1537
- s = yield qt(s, Ae.ADD, t || {}), p === "number" && s && (s = Number.parseFloat(s)), s = Yi(f, s), i[w] = s;
1538
- }
1539
- e(i);
1540
- }
1541
- });
1542
- }
1543
- function Yi(n, e) {
1544
- const { type: t, field: i, view: f, fieldExtendJson: s } = n;
1545
- if (f == "date" && s) {
1546
- const p = JSON.parse(s), { picker: w } = p;
1547
- if (w && w != "default" && e) {
1548
- let h;
1549
- try {
1550
- if (w === "year") {
1551
- const D = e.split("-")[0];
1552
- h = we().year(D).format("YYYY-MM-DD");
1553
- }
1554
- if (w === "month") {
1555
- const T = e.split("-"), D = T[0], y = +T[1] + 1;
1556
- h = we().year(D).month(y).format("YYYY-MM-DD");
1557
- }
1558
- if (w === "week") {
1559
- const T = e.split("-"), D = T[0], y = T[1].match(/^(\d+)周$/)[1];
1560
- h = we().year(D).week(y).format("YYYY-MM-DD");
1561
- }
1562
- if (w === "quarter") {
1563
- const T = e.split("-"), D = T[0], y = T[1].match(/^[Qq](\d)$/)[1];
1564
- h = we().year(D).quarter(y).format("YYYY-MM-DD");
1565
- }
1566
- } catch (T) {
1567
- h = e;
1568
- }
1569
- return h;
1570
- }
1571
- return e;
1572
- }
1573
- return e;
1574
- }
1575
- function Ls(n, e, t) {
1576
- return z(this, null, function* () {
1577
- let { defVal: i, type: f } = e;
1578
- if (dt(i)) {
1579
- let s = yield qt(i, Ae.ADD, {});
1580
- if (f === "number" && s)
1581
- if (e.mode == "group" && typeof s == "string" && s.indexOf(",") != -1) {
1582
- const p = s.split(",");
1583
- s = [], p[0] && s.push(Number.parseFloat(p[0])), p[1] && s.push(Number.parseFloat(p[1]));
1584
- } else
1585
- s = Number.parseFloat(s);
1586
- t[n] = s;
1587
- }
1588
- });
1589
- }
1590
- function dt(n) {
1591
- return !!(n || n === 0);
1592
- }
1593
- function qt(n, e, t) {
1594
- return z(this, null, function* () {
1595
- if (n != null && Ui(n)) {
1596
- let i = yield Hi(n, e, t);
1597
- if (i != null)
1598
- return i;
1599
- }
1600
- return n;
1601
- });
1602
- }
1603
- function Ui(n) {
1604
- let e = 0, t = 0, i = 0;
1605
- if (n.replace(st, () => i++), i > 1)
1606
- return !1;
1607
- n.replace(Yt, () => e++), n.replace(Ut, () => t++);
1608
- let f = e + t;
1609
- return !(i > 0 && f > 0);
1610
- }
1611
- function qi(n, e) {
1612
- let t = /* @__PURE__ */ new Map();
1613
- return n.replace(e, function(i, f) {
1614
- return t.set(i, f.trim()), i;
1615
- }), t;
1616
- }
1617
- function Hi(n, e, t) {
1618
- return z(this, null, function* () {
1619
- return (e === Ae.ADD || e === Ae.RELOAD) && st.test(n) ? yield tt(n, st, Zi, [t]) : e === Ae.ADD ? (n = yield tt(n, Yt, Qi), n = yield tt(n, Ut, Ki), n) : null;
1620
- });
1621
- }
1622
- function tt(f, s, p) {
1623
- return z(this, arguments, function* (n, e, t, i = []) {
1624
- let w = qi(n, e);
1625
- for (let h of w.keys()) {
1626
- let T = w.get(h), D = yield t.apply(null, [T, h, ...i]);
1627
- if (h === n)
1628
- return D;
1629
- n = Vn(n, h, D);
1630
- }
1631
- return n;
1632
- });
1633
- }
1634
- function Qi(n, e) {
1635
- return z(this, null, function* () {
1636
- switch (n) {
1637
- case "date":
1638
- return we().format("YYYY-MM-DD");
1639
- case "time":
1640
- return we().format("HH:mm:ss");
1641
- case "datetime":
1642
- return we().format("YYYY-MM-DD HH:mm:ss");
1643
- default:
1644
- let t = zi(n);
1645
- return t != null ? t : e;
1646
- }
1647
- });
1648
- }
1649
- function zi(n) {
1650
- let t = Bn().getUserInfo;
1651
- if (t)
1652
- switch (n) {
1653
- case "sysUserId":
1654
- return t.id;
1655
- case "sysUserCode":
1656
- case "sys_user_code":
1657
- return t.username;
1658
- case "sysUserName":
1659
- return t.realname;
1660
- case "sysOrgCode":
1661
- case "sys_org_code":
1662
- return t.orgCode;
1663
- }
1664
- return null;
1665
- }
1666
- function Ki(n, e) {
1667
- return z(this, null, function* () {
1668
- let t = at(`(function (${Vi}){ return ${n} })`);
1669
- try {
1670
- return t.apply(null, Wi);
1671
- } catch (i) {
1672
- return e;
1673
- }
1674
- });
1675
- }
1676
- function Zi(n, e, t) {
1677
- return z(this, null, function* () {
1678
- let i = `/sys/fillRule/executeRuleByCode/${n}`, f = {};
1679
- typeof t == "function" ? f = t() : t && (f = ce({}, t));
1680
- let { success: s, message: p, result: w } = yield ge.put({ url: i, params: f }, { isTransformResponse: !1 });
1681
- return s ? w : e;
1682
- });
1683
- }
1684
- const ft = "link_down", Gi = "link_table_field", Xi = "link_table";
1685
- function Ht(n, e) {
1686
- Kl();
1687
- const t = n.modalClass, i = P([]), f = P(""), s = P({}), p = Se({}), w = P(!1), h = P([]), T = P({}), D = {}, y = P([]), I = Se({}), F = P("");
1688
- F.value = { sm: 24, xs: 24, md: 12, lg: 12, xl: 12, xxl: 12 };
1689
- const J = P({ xs: { span: 24 }, sm: { span: 4 }, md: { span: 4 }, lg: { span: 4 }, xl: { span: 4 }, xxl: { span: 4 } }), L = P(null), q = P(6 * 14 + 10);
1690
- function N(S, C, v, R = {}) {
1691
- var x;
1692
- nl(I), I[f.value] = [];
1693
- let M = [], b = [], r = [], d = {}, o = {};
1694
- Object.keys(S).map((u) => {
1695
- var k;
1696
- const _ = S[u];
1697
- if (_.view == "tab") {
1698
- w.value = !0, I[u] = [];
1699
- let G = {
1700
- key: u,
1701
- // 这个foreignKey是主表的字段
1702
- foreignKey: _.foreignKey,
1703
- describe: _.describe,
1704
- relationType: _.relationType,
1705
- requiredFields: _.required || [],
1706
- order: _.order,
1707
- id: _.id
1708
- };
1709
- _.relationType == 1 ? (D[u] = P(null), G.properties = _.properties) : ($(_), D[u] = P(), G.columns = _.columns, d[u] = []), M.push(G), ll(u, _);
1710
- } else if (et(u, _, I[f.value]), _.view === ft) {
1711
- let G = tl(_, u);
1712
- for (let B of G) {
1713
- const K = B.key == u ? _ : (k = _.others) == null ? void 0 : k.find((te) => te.field === B.key);
1714
- K && et(B.key, K, I[f.value]), p[B.key] = !0, p[B.key + "_load"] = !0, p[B.key + "_disabled"] = !1, Y(R, B);
1715
- let j = Xe.createFormSchema(B.key, B);
1716
- v && j.setOnlyValidateFun(v), j.isRequired(C), j.setFormRef(e), j.handleWidgetAttr(_);
1717
- let U = Ft(b, B.key);
1718
- U == -1 ? b.push(j) : b[U] = j;
1719
- }
1720
- } else if (et(u, _, I[f.value]), p[u] = !0, p[u + "_load"] = !0, p[u + "_disabled"] = !1, Ft(b, u) == -1) {
1721
- Y(R, _);
1722
- let B = Xe.createFormSchema(u, _);
1723
- if (v && B.setOnlyValidateFun(v), B.isRequired(C), B.setFormRef(e), b.push(B), r.push(...B.getRelatedHideFields()), _.view === Gi) {
1724
- let K = B.getLinkFieldInfo();
1725
- K && (o[K[0]] ? o[K[0]].push(K[1]) : o[K[0]] = [K[1]]);
1726
- }
1727
- }
1728
- }), b.sort(function(u, _) {
1729
- return u.order - _.order;
1730
- });
1731
- const l = [];
1732
- (() => {
1733
- for (let u = 0, _ = b.length; u < _; u++) {
1734
- const k = b[u];
1735
- A(k == null ? void 0 : k._data, "isOneRow") && (l.push(b.splice(u, 1)[0]), u--, _--);
1736
- }
1737
- })(), b = [...b, ...l];
1738
- let c = [];
1739
- c.push(Xe.createIdField());
1740
- let a = null, O = !1;
1741
- for (let u of b) {
1742
- const _ = u.label.length;
1743
- a ? (a.label.length < _ || a.label.length === _ && !a.required && u.required) && (a = u) : a = u, u.required && (O = !0), u.view && u.view == Xi && o[u.field] && u.setOtherInfo(o[u.field]), r.indexOf(u.field) >= 0 && u.isHidden(), t && u.setCustomPopContainer(t);
1744
- const k = u.getFormItemSchema();
1745
- if (k.component === "JDictSelectTag" && ((x = u == null ? void 0 : u._data) == null ? void 0 : x.type) === "number" && (k.componentProps.stringToNumber = !0), n.formTemplate > 1 && A(u == null ? void 0 : u._data, "isOneRow")) {
1746
- k.colProps = { span: 24 };
1747
- const G = H(), { labelCol: B = {} } = G, K = {}, j = {};
1748
- Object.keys(B).forEach((U) => {
1749
- if (["xs", "sm", "md", "lg", "xl", "xxl"].includes(U)) {
1750
- const te = B[U].span, ne = Math.round(te / n.formTemplate);
1751
- K[U] = { span: ne }, j[U] = { span: 24 - ne - 1 };
1752
- }
1753
- }), k.itemProps = { labelCol: K, wrapperCol: j };
1754
- }
1755
- c.push(k);
1756
- }
1757
- if (i.value = c, M.sort(function(u, _) {
1758
- return u.order - _.order;
1759
- }), M.forEach((u) => {
1760
- const _ = u.columns;
1761
- u.columns && _.forEach((k) => {
1762
- var G;
1763
- if (u.relationType == 0 && ["popup", "popup_dict"].includes(k.type)) {
1764
- let B = !0;
1765
- k.fieldExtendJson && (B = JSON.parse(k.fieldExtendJson).popupMulti);
1766
- const K = (G = k.props) != null ? G : {};
1767
- k.props = Me(ce({}, K), { multi: B });
1768
- }
1769
- if (k.type === "date" && k.fieldExtendJson) {
1770
- const B = JSON.parse(k.fieldExtendJson);
1771
- B.picker && B.picker != "default" && Object.assign(k, { picker: B.picker });
1772
- }
1773
- });
1774
- }), h.value = M, T.value = d, R.formLabelLengthShow && R.formLabelLength)
1775
- q.value = R.formLabelLength * 14 + 10 + +`${O ? 13 : 0}`, L.value = null;
1776
- else if (a) {
1777
- let u = a.label.length;
1778
- u = u > lt ? lt : u;
1779
- const _ = a.required, k = u * 14 + 10 + +`${_ ? 13 : 0}`;
1780
- q.value = k;
1781
- }
1782
- }
1783
- he(
1784
- p,
1785
- (S) => {
1786
- let C = e.value, v = [], R = be(S);
1787
- Object.keys(R).map((M) => {
1788
- if (!M.endsWith("_load")) {
1789
- let b = {
1790
- field: M,
1791
- show: R[M]
1792
- }, r = M + "_load";
1793
- R.hasOwnProperty(r) && (b.ifShow = R[r]);
1794
- let d = M + "_disabled";
1795
- R.hasOwnProperty(d) && (b.dynamicDisabled = () => R[d]), v.push(b);
1796
- }
1797
- }), C && C.updateSchema(v);
1798
- },
1799
- { immediate: !1 }
1800
- );
1801
- function $(S) {
1802
- Qt(S, (C) => {
1803
- Ji(C, I[S.key]);
1804
- });
1805
- }
1806
- function Y(S, C, v = "labelLength") {
1807
- const { formLabelLengthShow: R, formLabelLength: M } = S;
1808
- if (R && M) {
1809
- let b = C == null ? void 0 : C.fieldExtendJson;
1810
- b ? (b = JSON.parse(b), b[v] = M) : b = { [v]: M }, C.fieldExtendJson = JSON.stringify(b);
1811
- }
1812
- }
1813
- function A(S = {}, C) {
1814
- let v = S == null ? void 0 : S.fieldExtendJson;
1815
- if (v)
1816
- return v = JSON.parse(v), v[C];
1817
- }
1818
- he(
1819
- () => n.formTemplate,
1820
- () => {
1821
- const S = H();
1822
- F.value = S.baseColProps, J.value = S.labelCol, L.value = S.wrapperCol;
1823
- },
1824
- { immediate: !0 }
1825
- );
1826
- function H() {
1827
- let S = n.formTemplate;
1828
- return S == 2 ? {
1829
- baseColProps: { sm: 24, xs: 24, md: 12, lg: 12, xl: 12, xxl: 12 }
1830
- // update-begin--author:liaozhiyang---date:20230105---for:【QQYUN-7632】 label栅格改成labelwidth固宽
1831
- // labelCol: { xs: { span: 24 }, sm: { span: 4 }, md: { span: 4 }, lg: { span: 4 }, xl: { span: 4 }, xxl: { span: 4 } },
1832
- // wrapperCol: { xs: { span: 24 }, sm: { span: 19 }, md: { span: 19 }, lg: { span: 19 }, xl: { span: 19 }, xxl: { span: 19 } },
1833
- // update-end--author:liaozhiyang---date:20230105---for:【QQYUN-7632】 label栅格改成labelwidth固宽
1834
- } : S == 3 ? {
1835
- baseColProps: { sm: 24, xs: 24, md: 8, lg: 8, xl: 8, xxl: 8 }
1836
- // update-begin--author:liaozhiyang---date:20230105---for:【QQYUN-7632】 label栅格改成labelwidth固宽
1837
- // labelCol: { xs: { span: 24 }, sm: { span: 6 }, md: { span: 6 }, lg: { span: 6 }, xl: { span: 6 }, xxl: { span: 6 } },
1838
- // wrapperCol: { xs: { span: 24 }, sm: { span: 17 }, md: { span: 17 }, lg: { span: 17 }, xxl: { span: 17 } },
1839
- // update-end--author:liaozhiyang---date:20230105---for:【QQYUN-7632】 label栅格改成labelwidth固宽
1840
- } : S == 4 ? {
1841
- baseColProps: { sm: 24, xs: 24, md: 6, lg: 6, xl: 6, xxl: 6 }
1842
- // update-begin--author:liaozhiyang---date:20230105---for:【QQYUN-7632】 label栅格改成labelwidth固宽
1843
- // labelCol: { xs: { span: 24 }, sm: { span: 4 }, md: { span: 4 }, lg: { span: 4 }, xl: { span: 4 }, xxl: { span: 4 } },
1844
- // wrapperCol: { xs: { span: 24 }, sm: { span: 18 }, md: { span: 18 }, lg: { span: 18 }, xl: { span: 18 }, xxl: { span: 18 } },
1845
- // update-end--author:liaozhiyang---date:20230105---for:【QQYUN-7632】 label栅格改成labelwidth固宽
1846
- } : {
1847
- baseColProps: { sm: 24, xs: 24, md: 24, lg: 24, xl: 24, xxl: 24 }
1848
- // update-begin--author:liaozhiyang---date:20230105---for:【QQYUN-7632】 label栅格改成labelwidth固宽
1849
- // labelCol: { xs: { span: 24 }, sm: { span: 4 }, md: { span: 4 }, lg: { span: 4 }, xl: { span: 4 }, xxl: { span: 4 } },
1850
- // wrapperCol:{ xs: { span: 24 }, sm: { span: 18 }, md: { span: 18 }, lg: { span: 18 }, xl: { span: 18 }, xxl: { span: 18 } },
1851
- // update-end--author:liaozhiyang---date:20230105---for:【QQYUN-7632】 label栅格改成labelwidth固宽
1852
- };
1853
- }
1854
- function Q(S, C) {
1855
- return new Promise((v) => {
1856
- C || v("");
1857
- let M = {
1858
- tableName: f.value.replace(/\$\d+/, ""),
1859
- fieldName: S.field,
1860
- fieldVal: C
1861
- }, b = s.value;
1862
- b.id && (M.dataId = b.id), Nn(M).then((r) => {
1863
- r.success ? v("") : v(r.message);
1864
- }).catch((r) => {
1865
- v(r);
1866
- });
1867
- });
1868
- }
1869
- function Z(S) {
1870
- return Object.keys(S).map((C) => {
1871
- S[C] && S[C] instanceof Array && (S[C] = S[C].join(","));
1872
- }), S;
1873
- }
1874
- return {
1875
- formSchemas: i,
1876
- defaultValueFields: I,
1877
- tableName: f,
1878
- dbData: s,
1879
- checkOnlyFieldValue: Q,
1880
- createFormSchemas: N,
1881
- fieldDisplayStatus: p,
1882
- subTabInfo: h,
1883
- hasSubTable: w,
1884
- subDataSource: T,
1885
- baseColProps: F,
1886
- changeDataIfArray2String: Z,
1887
- linkDownList: y,
1888
- refMap: D,
1889
- labelCol: J,
1890
- wrapperCol: L,
1891
- labelWidth: q
1892
- };
1893
- }
1894
- function Qt(n, e) {
1895
- const t = {
1896
- inputNumber: "input-number",
1897
- sel_depart: "depart-select",
1898
- sel_user: "user-select",
1899
- list_multi: "select-multiple",
1900
- input_pop: "textarea",
1901
- sel_search: "select-search",
1902
- "select-dict-search": "selectDictSearch"
1903
- };
1904
- n.columns.forEach((s) => {
1905
- s.type === "radio" ? s.type = "select" : t[s.type] ? s.type = t[s.type] : s.type === "popup" && i(s), s.type === "depart-select" && (s.checkStrictly = !0), s.type === "user-select" && f(s), s.type === "pca" && (s.width = "230px"), (s.width == 120 || s.width == "120px") && (s.type == "image" || s.type == "file") && (s.width = "130px"), s.width || (s.width = "200px"), e && e(s);
1906
- });
1907
- function i(s) {
1908
- let { destFields: p, orgFields: w } = s, h = [];
1909
- if (!(!p || p.length == 0)) {
1910
- let T = p.split(","), D = w.split(",");
1911
- for (let y = 0; y < T.length; y++)
1912
- h.push({
1913
- target: T[y],
1914
- source: D[y]
1915
- });
1916
- }
1917
- s.fieldConfig = h;
1918
- }
1919
- function f(s) {
1920
- let p = s.fieldExtendJson, w = !1;
1921
- if (p)
1922
- try {
1923
- JSON.parse(p).multiSelect === !1 && (w = !0);
1924
- } catch (h) {
1925
- }
1926
- s.isRadioSelection = w;
1927
- }
1928
- }
1929
- function el() {
1930
- let n = {};
1931
- const e = {
1932
- addSubRows: "<m> 一对多子表,新增自定义行",
1933
- changeOptions: "<m> 改变下拉框选项",
1934
- clearSubRows: "<m> 清空一对多子表行",
1935
- clearThenAddRows: "<m> 清空一对多子表行,然后新增自定义行",
1936
- executeMainFillRule: "<m> 刷新主表的增值规制值",
1937
- executeSubFillRule: "<m> 刷新子表的增值规制值",
1938
- getFieldsValue: "<m> 获取表单控件的值",
1939
- getSubTableInstance: "<m> 获取子表实例",
1940
- isUpdate: "<p> 判断是否为编辑模式",
1941
- loading: "<p> 页面加载状态",
1942
- onlineFormRef: "<p> 当前表单ref对象",
1943
- refMap: "<p> 子表ref对象map",
1944
- setFieldsValue: "<m> 设置表单控件的值",
1945
- sh: "<p> 表单控件的显示隐藏状态",
1946
- subActiveKey: "<p> 子表激活tab,对应子表表名",
1947
- subFormHeight: "<p> 一对一子表表单高度",
1948
- submitFlowFlag: "<p> 是否提交流程状态",
1949
- subTableHeight: "<p> 一对多子表表格高度",
1950
- tableName: "<p> 当前表名",
1951
- triggleChangeValues: "<m> 修改多个表单值",
1952
- triggleChangeValue: "<m> 修改表单值",
1953
- updateSchema: "<m> 修改表单控件配置",
1954
- // update-begin--author:liaozhiyang---date:20240313---for:【QQYUN-8350】js增强根据主表限制子表options
1955
- changeSubTableOptions: "<m> 改变一对多子表下拉框选项",
1956
- changeSubFormbleOptions: "<m> 改变一对一子表下拉框选项",
1957
- // update-end--author:liaozhiyang---date:20240313---for:【QQYUN-8350】js增强根据主表限制子表options
1958
- // update-begin--author:liaozhiyang---date:20240321---for:【QQYUN-5806】js增强改变下拉搜索options
1959
- changeRemoteOptions: "<m> 改变远程下拉框选项",
1960
- // update-end--author:liaozhiyang---date:20240321---for:【QQYUN-5806】js增强改变下拉搜索options
1961
- // update-begin--author:liaozhiyang---date:20240705---for:【TV360X-1754】js增强-提交表单并且发起流程
1962
- submitFormAndFlow: "<m> 提交表单且发起流程"
1963
- // update-end--author:liaozhiyang---date:20240705---for:【TV360X-1754】js增强-提交表单并且发起流程
1964
- }, t = new Proxy(e, {
1965
- get(s, p) {
1966
- return Reflect.get(n, p);
1967
- }
1968
- });
1969
- function i(s, p) {
1970
- n[s] = p;
1971
- }
1972
- function f(s) {
1973
- Object.keys(s).map((p) => {
1974
- n[p] = s[p];
1975
- });
1976
- }
1977
- return i("$nextTick", Ne), i("addObject2Context", i), { onlineFormContext: t, addObject2Context: i, resetContext: f };
1978
- }
1979
- function tl(n, e) {
1980
- const {
1981
- config: { table: t, key: i, txt: f, linkField: s, idField: p, pidField: w, condition: h },
1982
- others: T,
1983
- order: D,
1984
- title: y
1985
- } = n;
1986
- let I = {
1987
- dictTable: t,
1988
- dictText: f,
1989
- dictCode: i,
1990
- pidField: w,
1991
- idField: p,
1992
- view: ft,
1993
- type: n.type
1994
- }, F = [], J = ce({
1995
- key: e,
1996
- title: y,
1997
- order: D,
1998
- condition: h,
1999
- origin: !0
2000
- }, I);
2001
- if (s && s.length > 0) {
2002
- let L = s.split(",");
2003
- J.next = L[0];
2004
- for (let q = 0; q < L.length; q++)
2005
- for (let N of T)
2006
- if (N.field == L[q]) {
2007
- let $ = ce({
2008
- key: N.field,
2009
- title: N.title,
2010
- order: N.order,
2011
- origin: !1
2012
- }, I);
2013
- q + 1 < L.length && ($.next = L[q + 1]), F.push($);
2014
- }
2015
- }
2016
- return F.push(J), F;
2017
- }
2018
- function Ft(n, e) {
2019
- let t = -1;
2020
- for (let i = 0; i < n.length; i++)
2021
- if (n[i].field === e) {
2022
- t = i;
2023
- break;
2024
- }
2025
- return t;
2026
- }
2027
- function ke(n) {
2028
- return new Promise((e) => {
2029
- (function t() {
2030
- let i = n.value;
2031
- i ? e(i) : setTimeout(() => {
2032
- t();
2033
- }, 100);
2034
- })();
2035
- });
2036
- }
2037
- function nl(n) {
2038
- Object.keys(n).map((e) => {
2039
- delete n[e];
2040
- });
2041
- }
2042
- const il = Un();
2043
- function ll(n, e) {
2044
- let t = e.hideButtons, i = ri + n + ":";
2045
- t || (t = []), il.setOnlineSubTableAuth(i, t);
2046
- }
2047
- function js(n) {
2048
- const e = P([]), t = {}, i = Se({}), f = P(!1), s = P([]), p = P({}), { getIsMobile: w } = jt(), h = pe(() => {
2049
- let F = n.formTemplate;
2050
- return w.value ? 24 : F == "2" ? 12 : F == "3" ? 8 : F == "4" ? 6 : 24;
2051
- });
2052
- function T(F) {
2053
- let J = [], L = [], q = {};
2054
- Object.keys(F).map((N) => {
2055
- const $ = F[N];
2056
- if ($.view == "tab") {
2057
- f.value = !0;
2058
- let Y = {
2059
- key: N,
2060
- // 这个foreignKey是主表的字段
2061
- foreignKey: $.foreignKey,
2062
- describe: $.describe,
2063
- relationType: $.relationType,
2064
- requiredFields: $.required || [],
2065
- order: $.order
2066
- };
2067
- $.relationType == 1 ? (t[N] = P(null), Y.properties = $.properties) : (D($), t[N] = P(), Y.columns = $.columns, q[N] = [], i[N] = !1), J.push(Y);
2068
- } else if ($.view === ft) {
2069
- let Y = I($, N);
2070
- for (let A of Y) {
2071
- let H = y(L, A.key), Q = {
2072
- field: A.key,
2073
- label: A.title,
2074
- view: A.view,
2075
- order: A.order,
2076
- dictTable: A.dictTable,
2077
- linkField: A.linkField || ""
2078
- };
2079
- H == -1 ? L.push(Q) : L[H] = Q;
2080
- }
2081
- } else if ($.view != "hidden") {
2082
- if (y(L, N) == -1) {
2083
- let A = Object.assign(
2084
- {
2085
- field: N,
2086
- label: $.title
2087
- },
2088
- qe($, ["view", "order", "fieldExtendJson", "dictTable", "dictText", "dictCode", "dict"])
2089
- );
2090
- if ($.view == "file" && (A.span = 24, A.isFile = !0), $.view == "image" && (A.span = 24, A.isImage = !0), $.view == "link_table" && $.fieldExtendJson)
2091
- try {
2092
- let H = JSON.parse($.fieldExtendJson);
2093
- H.showType != "select" && (A.isCard = !0), H.multiSelect == !0 && (A.multi = !0);
2094
- } catch (H) {
2095
- }
2096
- ($.view == "umeditor" || $.view == "markdown") && (A.isHtml = !0, A.span = 24), L.push(A);
2097
- }
2098
- }
2099
- }), L.sort(function(N, $) {
2100
- return N.order - $.order;
2101
- }), J.sort(function(N, $) {
2102
- return N.order - $.order;
2103
- }), s.value = J;
2104
- for (let N = 0; N < L.length; N++) {
2105
- let $ = L[N];
2106
- if (($.isFile === !0 || $.isImage === !0 || $.isHtml === !0) && N > 0) {
2107
- let Y = L[N - 1], A = Y.span || h.value;
2108
- Y.span = A;
2109
- }
2110
- }
2111
- e.value = L, p.value = q;
2112
- }
2113
- function D(F) {
2114
- Qt(F);
2115
- }
2116
- function y(F, J) {
2117
- let L = -1;
2118
- for (let q = 0; q < F.length; q++)
2119
- if (F[q].field === J) {
2120
- L = q;
2121
- break;
2122
- }
2123
- return L;
2124
- }
2125
- function I(F, J) {
2126
- let L = [];
2127
- const {
2128
- config: { table: q, key: N, txt: $, linkField: Y },
2129
- order: A,
2130
- title: H,
2131
- others: Q
2132
- } = F;
2133
- let S = {
2134
- view: "link_down",
2135
- order: A,
2136
- title: H,
2137
- dictTable: JSON.stringify({
2138
- table: q,
2139
- key: N,
2140
- txt: $
2141
- })
2142
- };
2143
- if (L.push(Object.assign({}, { linkField: Y, key: J }, S)), Y) {
2144
- let C = Y.split(",");
2145
- for (let v of C) {
2146
- let R = "";
2147
- for (let M of Q)
2148
- M.field == v && (R = M.title);
2149
- L.push(Object.assign({}, { key: v }, S, { title: R }));
2150
- }
2151
- }
2152
- return L;
2153
- }
2154
- return {
2155
- detailFormSchemas: e,
2156
- hasSubTable: f,
2157
- subTabInfo: s,
2158
- refMap: t,
2159
- showStatus: i,
2160
- createFormSchemas: T,
2161
- formSpan: h,
2162
- subDataSource: p
2163
- };
2164
- }
2165
- function sl(n, e = !0) {
2166
- let t = Se({});
2167
- const i = (y, I) => ge.get({ url: y, params: I }, { isTransformResponse: !1 }), f = (y, I) => ge.post({ url: y, params: I }, { isTransformResponse: !1 }), s = (y, I) => ge.put({ url: y, params: I }, { isTransformResponse: !1 }), p = (y, I) => ge.delete({ url: y, params: I }, { isTransformResponse: !1 });
2168
- e === !0 ? (n._getAction = i, n._postAction = f, n._putAction = s, n._deleteAction = p, n._useMessage = Re) : (n.addObject2Context("_getAction", i), n.addObject2Context("_postAction", f), n.addObject2Context("_putAction", s), n.addObject2Context("_deleteAction", p), n.addObject2Context("_useMessage", Re));
2169
- function w(y) {
2170
- if (y) {
2171
- let I, F;
2172
- try {
2173
- I = at(y), F = new I(i, f, p);
2174
- } catch (J) {
2175
- F = {};
2176
- const { createMessage: L } = Re();
2177
- L.warning(`js增强代码有语法错误,请检查代码~ ${J}`);
2178
- }
2179
- return F;
2180
- } else
2181
- return {};
2182
- }
2183
- function h(y, I) {
2184
- t && t[I] && t[I](y);
2185
- }
2186
- function T(y, I) {
2187
- return t && t.beforeSubmit ? t.beforeSubmit(y, I) : Promise.resolve();
2188
- }
2189
- function D(y, I) {
2190
- return t && t.beforeDelete ? t.beforeDelete(y, I) : Promise.resolve();
2191
- }
2192
- return e === !0 && n && (n.beforeDelete = (y) => {
2193
- const I = n.EnhanceJS;
2194
- return I && I.beforeDelete ? I.beforeDelete(n, y) : Promise.resolve();
2195
- }, n.beforeEdit = (y) => {
2196
- const I = n.EnhanceJS;
2197
- return I && I.beforeEdit ? I.beforeEdit(n, y) : Promise.resolve();
2198
- }), {
2199
- EnhanceJS: t,
2200
- initCgEnhanceJs: w,
2201
- customBeforeSubmit: T,
2202
- beforeDelete: D,
2203
- triggerJsFun: h
2204
- };
2205
- }
2206
- const rl = "/online/cgform/api/subform", ol = {
2207
- name: "OnlineSubForm",
2208
- components: {
2209
- BasicForm: Mt,
2210
- Loading: At
2211
- },
2212
- props: {
2213
- properties: {
2214
- type: Object,
2215
- required: !0
2216
- },
2217
- mainId: {
2218
- type: String,
2219
- default: ""
2220
- },
2221
- table: {
2222
- type: String,
2223
- default: ""
2224
- },
2225
- formTemplate: {
2226
- type: Number,
2227
- default: 1
2228
- },
2229
- requiredFields: {
2230
- type: Array,
2231
- default: []
2232
- },
2233
- isUpdate: {
2234
- type: Boolean,
2235
- default: !1
2236
- },
2237
- disabled: {
2238
- type: Boolean,
2239
- default: !1
2240
- }
2241
- },
2242
- emits: ["formChange"],
2243
- setup(n, { emit: e }) {
2244
- const t = P(null), i = P(!1);
2245
- Re();
2246
- const {
2247
- formSchemas: f,
2248
- defaultValueFields: s,
2249
- changeDataIfArray2String: p,
2250
- tableName: w,
2251
- dbData: h,
2252
- checkOnlyFieldValue: T,
2253
- fieldDisplayStatus: D,
2254
- createFormSchemas: y,
2255
- baseColProps: I,
2256
- labelCol: F,
2257
- wrapperCol: J,
2258
- labelWidth: L
2259
- } = Ht(n, t), [q, { setProps: N, validate: $, resetFields: Y, setFieldsValue: A, getFieldsValue: H, updateSchema: Q, scrollToField: Z }] = Rt({
2260
- schemas: f,
2261
- showActionButtonGroup: !1,
2262
- baseColProps: I,
2263
- // update-begin--author:liaozhiyang---date:20240429---for:【QQYUN-7632】 label栅格改成labelwidth固宽
2264
- labelWidth: L,
2265
- // update-end--author:liaozhiyang---date:20240429---for:【QQYUN-7632】 label栅格改成labelwidth固宽
2266
- // update-begin--author:liaozhiyang---date:20240105---for:【QQYUN-7499】多列风格富文本、markdown增加独占一行功能
2267
- labelCol: F,
2268
- wrapperCol: J
2269
- // update-end--author:liaozhiyang---date:20240105---for:【QQYUN-7499】多列风格富文本、markdown增加独占一行功能
2270
- });
2271
- he(
2272
- () => n.table,
2273
- () => {
2274
- w.value = n.table;
2275
- },
2276
- { immediate: !0 }
2277
- ), he(
2278
- () => n.properties,
2279
- (l) => {
2280
- i.value = !1, S(), y(n.properties, n.requiredFields, T), i.value = !0;
2281
- },
2282
- { deep: !0, immediate: !0 }
2283
- ), he(
2284
- () => n.mainId,
2285
- (l) => {
2286
- setTimeout(() => {
2287
- v();
2288
- }, 100);
2289
- },
2290
- { immediate: !0 }
2291
- ), he(
2292
- () => n.disabled,
2293
- (l) => {
2294
- N({ disabled: l });
2295
- }
2296
- );
2297
- function S() {
2298
- return z(this, null, function* () {
2299
- let l = yield ke(t);
2300
- l.$formValueChange = (c, a) => {
2301
- let O = { [c]: a };
2302
- e("formChange", O);
2303
- };
2304
- });
2305
- }
2306
- function C() {
2307
- if (Ce(n.isUpdate) === !1) {
2308
- let l = be(s[w.value]);
2309
- rt(l, (c) => {
2310
- A(c);
2311
- });
2312
- }
2313
- }
2314
- function v() {
2315
- return z(this, null, function* () {
2316
- yield ke(i), yield Y(), C();
2317
- const { table: l, mainId: c } = n;
2318
- if (!l || !c)
2319
- return;
2320
- let a = yield R(l, c);
2321
- h.value = a, yield A(a);
2322
- });
2323
- }
2324
- function R(l, c) {
2325
- let a = `${rl}/${l}/${c}`;
2326
- return new Promise((O, x) => {
2327
- ge.get({ url: a }, { isTransformResponse: !1 }).then((u) => {
2328
- u.success ? O(u.result) : x();
2329
- });
2330
- }).finally(() => {
2331
- h.value = "";
2332
- });
2333
- }
2334
- function M() {
2335
- return new Promise((l, c) => {
2336
- $().then(() => {
2337
- let a = H();
2338
- a = p(a), l(a);
2339
- }).catch((a) => {
2340
- a.errorFields && (a.scrollToField = () => a.errorFields[0] && Z(a.errorFields[0].name, { behavior: "smooth", block: "center" })), c(a);
2341
- });
2342
- });
2343
- }
2344
- function b() {
2345
- let l = H();
2346
- return l.id || (l.id = "sub-change-temp-id"), {
2347
- row: l,
2348
- target: o
2349
- };
2350
- }
2351
- function r(l) {
2352
- A(l);
2353
- }
2354
- function d() {
2355
- let l = H(), c = be(s[w.value]);
2356
- rt(c, (a) => {
2357
- A(a);
2358
- }, l);
2359
- }
2360
- const o = {
2361
- onlineFormRef: t,
2362
- baseColProps: I,
2363
- formSchemas: f,
2364
- registerForm: q,
2365
- setFieldsValue: A,
2366
- getFieldsValue: H,
2367
- getFormEvent: b,
2368
- setValues: r,
2369
- getAll: M,
2370
- executeFillRule: d,
2371
- sh: D,
2372
- resetFields: Y,
2373
- updateSchema: Q
2374
- };
2375
- return o;
2376
- }
2377
- };
2378
- function al(n, e, t, i, f, s) {
2379
- const p = le("BasicForm");
2380
- return ee(), Oe(p, {
2381
- ref: "onlineFormRef",
2382
- onRegister: n.registerForm
2383
- }, null, 8, ["onRegister"]);
2384
- }
2385
- const zt = /* @__PURE__ */ Ee(ol, [["render", al], ["__scopeId", "data-v-196bf574"]]), As = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2386
- __proto__: null,
2387
- default: zt
2388
- }, Symbol.toStringTag, { value: "Module" })), nt = {
2389
- optPre: "/online/cgform/api/form/",
2390
- urlButtonAction: "/online/cgform/api/doButton"
2391
- }, ul = {
2392
- name: "OnlinePopForm",
2393
- components: {
2394
- BasicForm: Mt,
2395
- Loading: At,
2396
- OnlineSubForm: zt,
2397
- PrinterOutlined: Rn,
2398
- DiffOutlined: kn,
2399
- FormOutlined: En
2400
- },
2401
- props: {
2402
- id: {
2403
- type: String,
2404
- default: ""
2405
- },
2406
- formTemplate: {
2407
- type: Number,
2408
- default: 1
2409
- },
2410
- disabled: {
2411
- type: Boolean,
2412
- default: !1
2413
- },
2414
- isTree: {
2415
- type: Boolean,
2416
- default: !1
2417
- },
2418
- pidField: {
2419
- type: String,
2420
- default: ""
2421
- },
2422
- submitTip: {
2423
- type: Boolean,
2424
- default: !0
2425
- },
2426
- modalClass: {
2427
- type: String,
2428
- default: ""
2429
- },
2430
- //是否发送请求-即表单的保存/编辑请求,false则只将表单数据抛出去
2431
- request: {
2432
- type: Boolean,
2433
- default: !0
2434
- },
2435
- // 是否是vxeTable上方按钮点击打开的表单数据
2436
- isVxeTableData: {
2437
- type: Boolean,
2438
- default: !1
2439
- }
2440
- },
2441
- emits: ["success", "rendered", "dataChange"],
2442
- setup(n, { emit: e }) {
2443
- const { createMessage: t } = Re(), [i, { openModal: f }] = De(), s = P(""), p = P(null), w = P(!0), h = P(!1), T = P(1), D = P(!1), y = P(!1), I = Se({
2444
- reportPrintShow: 0,
2445
- reportPrintUrl: "",
2446
- joinQuery: 0,
2447
- modelFullscreen: 0,
2448
- modalMinWidth: ""
2449
- }), { onlineFormContext: F, resetContext: J } = el(), {
2450
- formSchemas: L,
2451
- defaultValueFields: q,
2452
- changeDataIfArray2String: N,
2453
- tableName: $,
2454
- dbData: Y,
2455
- checkOnlyFieldValue: A,
2456
- hasSubTable: H,
2457
- subTabInfo: Q,
2458
- refMap: Z,
2459
- subDataSource: S,
2460
- baseColProps: C,
2461
- createFormSchemas: v,
2462
- fieldDisplayStatus: R,
2463
- labelCol: M,
2464
- wrapperCol: b,
2465
- labelWidth: r
2466
- } = Ht(n, p);
2467
- let { EnhanceJS: d, initCgEnhanceJs: o } = sl(F, !1);
2468
- const [l, { setProps: c, validate: a, resetFields: O, setFieldsValue: x, updateSchema: u, getFieldsValue: _, scrollToField: k }] = Rt({
2469
- schemas: L,
2470
- showActionButtonGroup: !1,
2471
- baseColProps: C,
2472
- // update-begin--author:liaozhiyang---date:20240329---for:【QQYUN-7872】online表单label较长优化
2473
- labelWidth: r,
2474
- // update-end--author:liaozhiyang---date:20240329---for:【QQYUN-7872】online表单label较长优化
2475
- // update-begin--author:liaozhiyang---date:20240105---for:【QQYUN-7499】多列风格富文本、markdown增加独占一行功能
2476
- labelCol: M,
2477
- wrapperCol: b
2478
- // update-end--author:liaozhiyang---date:20240105---for:【QQYUN-7499】多列风格富文本、markdown增加独占一行功能
2479
- }), G = P(!1);
2480
- function B() {
2481
- let m = n.disabled;
2482
- G.value = m, c({ disabled: m });
2483
- }
2484
- function K(m, g, E) {
2485
- return z(this, null, function* () {
2486
- yield O(), Y.value = "";
2487
- let W = Ce(m);
2488
- y.value = W, W && (yield U(g)), yield Ne(() => {
2489
- !W && E && x(E), j(), Ze("js", "loaded"), B();
2490
- });
2491
- });
2492
- }
2493
- function j() {
2494
- if (Ce(y) === !1) {
2495
- let m = be(q[$.value]);
2496
- rt(m, (g) => {
2497
- x(g);
2498
- });
2499
- }
2500
- }
2501
- function U(m) {
2502
- return z(this, null, function* () {
2503
- let g = yield ne(m.id);
2504
- (!g || Object.keys(g).length == 0) && (g = ce({}, be(m))), Y.value = Object.assign({}, g);
2505
- let E = te.value, W = qe(g, ...E);
2506
- n.isVxeTableData === !0 && (W = Object.assign({}, W, m)), yield x(W);
2507
- });
2508
- }
2509
- let te = pe(() => {
2510
- let m = L.value, g = [];
2511
- for (let E of m)
2512
- g.push(E.field);
2513
- return g;
2514
- });
2515
- function ne(m) {
2516
- let g = `${nt.optPre}${n.id}/${m}`;
2517
- return new Promise((E, W) => {
2518
- ge.get({ url: g }, { isTransformResponse: !1 }).then((ie) => {
2519
- ie.success ? E(ie.result) : (W(), t.warning(ie.message));
2520
- }).catch(() => {
2521
- W();
2522
- });
2523
- });
2524
- }
2525
- function se(m) {
2526
- return z(this, null, function* () {
2527
- T.value = m.head.tableType, $.value = m.head.tableName, w.value = m.head.tableType == 1, ze(m.head.extConfigJson), v(m.schema.properties, m.schema.required, A, I), d = o(m.enhanceJs), e("rendered", I);
2528
- let g = yield ke(p);
2529
- g.$formValueChange = (E, W, ie) => {
2530
- un(E, W), ie && x(ie);
2531
- };
2532
- });
2533
- }
2534
- function ze(m) {
2535
- let g = { reportPrintShow: 0, reportPrintUrl: "", joinQuery: 0, modelFullscreen: 1, modalMinWidth: "", formLabelLength: null };
2536
- m && (g = JSON.parse(m)), Object.keys(g).map((E) => {
2537
- I[E] = g[E];
2538
- });
2539
- }
2540
- function Ke() {
2541
- w.value === !0 ? Pe() : V();
2542
- }
2543
- function V() {
2544
- ae().then((m) => {
2545
- ue(m);
2546
- });
2547
- }
2548
- function ae() {
2549
- let m = {};
2550
- return new Promise((g, E) => {
2551
- a().then(
2552
- (W) => g(W),
2553
- ({ errorFields: W }) => {
2554
- E({
2555
- code: Le,
2556
- key: $.value,
2557
- // 滚动到未通过校验的字段上
2558
- scrollToField: () => W[0] && k(W[0].name, { behavior: "smooth", block: "center" })
2559
- });
2560
- }
2561
- );
2562
- }).then((g) => (Object.assign(m, N(g)), Ie())).then((g) => (Object.assign(m, g), Promise.resolve(m))).catch((g) => ((g === Le || (g == null ? void 0 : g.code) === Le) && (t.warning("校验未通过"), g.key && (ve(g.key), g.scrollToField && setTimeout(() => g.scrollToField(), 150))), Promise.reject(null)));
2563
- }
2564
- function ve(m) {
2565
- let g = Q.value;
2566
- for (let E = 0; E < g.length; E++)
2567
- if (m == g[E].key) {
2568
- $e.value = E + "";
2569
- break;
2570
- }
2571
- }
2572
- function Ie() {
2573
- return new Promise((m, g) => z(this, null, function* () {
2574
- let E = {};
2575
- try {
2576
- let W = Q.value;
2577
- for (let ie = 0; ie < W.length; ie++) {
2578
- let ye = W[ie].key, Fe = Z[ye].value;
2579
- if (Fe instanceof Array && (Fe = Fe[0]), W[ie].relationType == 1)
2580
- try {
2581
- let We = yield Fe.getAll();
2582
- E[ye] = [], E[ye].push(We);
2583
- } catch (We) {
2584
- return g(ce({ code: Le, key: ye }, We));
2585
- }
2586
- else {
2587
- if (yield Fe.fullValidateTable())
2588
- return g({ code: Le, key: ye });
2589
- E[ye] = Fe.getTableData();
2590
- }
2591
- }
2592
- } catch (W) {
2593
- g(W);
2594
- }
2595
- m(E);
2596
- }));
2597
- }
2598
- function Pe() {
2599
- return z(this, null, function* () {
2600
- try {
2601
- let m = yield a();
2602
- m = Object.assign({}, Y.value, m), m = N(m), h.value = !0, ue(m);
2603
- } catch (m) {
2604
- if (kt(m)) {
2605
- const g = m.errorFields;
2606
- g != null && g.length && g[0].errors && (t.warning(g[0].errors[0]), k(g[0].name, { behavior: "smooth", block: "center" }));
2607
- }
2608
- } finally {
2609
- h.value = !1;
2610
- }
2611
- });
2612
- }
2613
- function ue(m) {
2614
- fn(bt, m).then(() => {
2615
- yn(m);
2616
- }).catch((g) => {
2617
- t.warning(g);
2618
- });
2619
- }
2620
- function Be(m, g, E) {
2621
- g && E ? E.setValues ? E.setValues(m) : E.setValues([
2622
- {
2623
- rowKey: g,
2624
- values: m
2625
- }
2626
- ]) : x(m);
2627
- }
2628
- function Ve(m, g) {
2629
- let E = {};
2630
- E[m] = g, x(E);
2631
- }
2632
- const $e = P("0"), pt = P(300), mt = P(340);
2633
- function nn(m) {
2634
- if (y.value === !0) {
2635
- let g = Y.value;
2636
- return ln(g, m);
2637
- }
2638
- return "";
2639
- }
2640
- function ln(m, g) {
2641
- if (m) {
2642
- let E = m[g];
2643
- return !E && E !== 0 && (E = m[g.toLowerCase()], !E && E !== 0 && (E = m[g.toUpperCase()])), E;
2644
- }
2645
- return "";
2646
- }
2647
- function sn(m, g) {
2648
- if (d && d[g + "_onlChange"]) {
2649
- let E = d[g + "_onlChange"](), W = Object.keys(m)[0];
2650
- if (E[W]) {
2651
- let ie = Z[g].value;
2652
- ie instanceof Array && (ie = ie[0]);
2653
- let ye = ie.getFormEvent(), Fe = ce({
2654
- column: { key: W },
2655
- value: m[W]
2656
- }, ye);
2657
- E[W].call(F, F, Fe);
2658
- }
2659
- }
2660
- }
2661
- function rn(m, g) {
2662
- if (d && d[g + "_onlChange"]) {
2663
- let E = d[g + "_onlChange"](F);
2664
- E[m.column.key] && E[m.column.key].call(F, F, m);
2665
- }
2666
- }
2667
- function on(m, g) {
2668
- }
2669
- function an(m) {
2670
- return "online_" + m + ":";
2671
- }
2672
- function un(m, g) {
2673
- return z(this, null, function* () {
2674
- if (Y.value[m] != g && e("dataChange", m), !d || !d.onlChange || !m)
2675
- return !1;
2676
- let W = d.onlChange();
2677
- if (W[m]) {
2678
- let ye = {
2679
- row: yield _(),
2680
- column: { key: m },
2681
- value: g
2682
- };
2683
- W[m].call(F, F, ye);
2684
- }
2685
- });
2686
- }
2687
- function Ze(m, g) {
2688
- if (m == "js")
2689
- d && d[g] && d[g].call(F, F);
2690
- else if (m == "action") {
2691
- let E = Y.value, W = {
2692
- formId: n.id,
2693
- buttonCode: g,
2694
- dataId: E.id,
2695
- uiFormData: Object.assign({}, E)
2696
- };
2697
- ge.post(
2698
- {
2699
- url: `${nt.urlButtonAction}`,
2700
- params: W
2701
- },
2702
- { isTransformResponse: !1 }
2703
- ).then((ie) => {
2704
- ie.success ? t.success("处理完成!") : t.warning("处理失败!");
2705
- });
2706
- }
2707
- }
2708
- function ht(m) {
2709
- let g = Z[m].value, E = [...g.getNewDataWithId(), ...S.value[m]];
2710
- if (!E || E.length == 0)
2711
- return !1;
2712
- let W = [];
2713
- for (let ie of E)
2714
- W.push(ie.id);
2715
- g.removeRowsById(W);
2716
- }
2717
- function gt(m, g) {
2718
- if (!g)
2719
- return !1;
2720
- let E = Z[m].value;
2721
- typeof g == "object" ? E.addRows(g, !0) : t.error("添加子表数据,参数不识别!");
2722
- }
2723
- function cn(m, g) {
2724
- ht(m), gt(m, g);
2725
- }
2726
- function dn(m, g) {
2727
- !g && g.length <= 0 && (g = []), g.map((E) => {
2728
- E.hasOwnProperty("label") || (E.label = E.text);
2729
- }), u({
2730
- field: m,
2731
- componentProps: {
2732
- options: g
2733
- }
2734
- });
2735
- }
2736
- function fn(m, g) {
2737
- return d && d.beforeSubmit ? d.beforeSubmit(m, g) : Promise.resolve();
2738
- }
2739
- function pn(m, g) {
2740
- let E = be(R);
2741
- m && m.length > 0 ? Object.keys(E).map((W) => {
2742
- !W.endsWith("_load") && m.indexOf(W) < 0 && (R[W] = !1);
2743
- }) : g && g.length > 0 && Object.keys(E).map((W) => {
2744
- g.indexOf(W) >= 0 && (R[W] = !1);
2745
- });
2746
- }
2747
- function mn(m) {
2748
- return z(this, null, function* () {
2749
- yield O(), Y.value = "", y.value = !0, yield U(m), yield Ne(() => {
2750
- Ze("js", "loaded");
2751
- });
2752
- });
2753
- }
2754
- function hn(m) {
2755
- let g = Z[m].value;
2756
- return g instanceof Array && (g = g[0]), g;
2757
- }
2758
- function gn() {
2759
- let m = I.reportPrintUrl, g = Y.value.id, E = Lt();
2760
- Wn(m, g, E);
2761
- }
2762
- function bn(m) {
2763
- s.value = m.id, f(!0);
2764
- }
2765
- function vn(m) {
2766
- }
2767
- function yn(m) {
2768
- if (Object.keys(m).map((g) => {
2769
- Array.isArray(m[g]) && m[g].length == 0 && (m[g] = "");
2770
- }), n.request == !1)
2771
- e("success", m);
2772
- else {
2773
- let g = `${nt.optPre}${n.id}?tabletype=${T.value}`;
2774
- D.value === !0 && (m[ii] = 1);
2775
- let E = y.value === !0 ? "put" : "post";
2776
- ge.request({ url: g, method: E, params: m }, { isTransformResponse: !1 }).then((W) => {
2777
- W.success ? (W.result && (m.id || (m.id = W.result)), e("success", m), Y.value = m, y.value = !0, t.success("操作成功!")) : t.warning(W.message);
2778
- }).finally(() => {
2779
- h.value = !1;
2780
- });
2781
- }
2782
- }
2783
- function wn() {
2784
- return z(this, null, function* () {
2785
- let m = Y.value, g = te.value, E = qe(m, ...g);
2786
- if (m)
2787
- yield x(E);
2788
- else {
2789
- let W = {};
2790
- for (let ie of g)
2791
- W[ie] = "";
2792
- yield x(W);
2793
- }
2794
- });
2795
- }
2796
- let bt = {
2797
- tableName: $,
2798
- loading: h,
2799
- subActiveKey: $e,
2800
- onlineFormRef: p,
2801
- getFieldsValue: _,
2802
- setFieldsValue: x,
2803
- submitFlowFlag: D,
2804
- subFormHeight: pt,
2805
- subTableHeight: mt,
2806
- refMap: Z,
2807
- triggleChangeValues: Be,
2808
- triggleChangeValue: Ve,
2809
- sh: R,
2810
- clearSubRows: ht,
2811
- addSubRows: gt,
2812
- clearThenAddRows: cn,
2813
- changeOptions: dn,
2814
- isUpdate: y,
2815
- getSubTableInstance: hn
2816
- };
2817
- return J(bt), {
2818
- //主表
2819
- tableName: $,
2820
- onlineFormRef: p,
2821
- registerForm: l,
2822
- loading: h,
2823
- //子表
2824
- subActiveKey: $e,
2825
- hasSubTable: H,
2826
- subTabInfo: Q,
2827
- refMap: Z,
2828
- //一对一子表
2829
- subFormHeight: pt,
2830
- getSubTableForeignKeyValue: nn,
2831
- isUpdate: y,
2832
- handleSubFormChange: sn,
2833
- //一对多子表
2834
- subTableHeight: mt,
2835
- onlineFormDisabled: G,
2836
- subDataSource: S,
2837
- getSubTableAuthPre: an,
2838
- handleAdded: on,
2839
- handleValueChange: rn,
2840
- openSubFormModalForAdd: bn,
2841
- openSubFormModalForEdit: vn,
2842
- registerVxeFormModal: i,
2843
- vxeTableId: s,
2844
- //父组件调用
2845
- show: K,
2846
- createRootProperties: se,
2847
- handleSubmit: Ke,
2848
- sh: R,
2849
- handleCgButtonClick: Ze,
2850
- handleCustomFormSh: pn,
2851
- handleCustomFormEdit: mn,
2852
- //跳转
2853
- dbData: Y,
2854
- onOpenReportPrint: gn,
2855
- onlineExtConfigJson: I,
2856
- recoverFormData: wn
2857
- };
2858
- }
2859
- };
2860
- const cl = ["id"];
2861
- function dl(n, e, t, i, f, s) {
2862
- const p = le("BasicForm");
2863
- return ee(), de("div", {
2864
- id: i.tableName + "_form",
2865
- class: Ye(["onlinePopFormWrap", [`formTemplate_${t.formTemplate}`]])
2866
- }, [
2867
- fe(p, {
2868
- ref: "onlineFormRef",
2869
- onRegister: i.registerForm
2870
- }, null, 8, ["onRegister"])
2871
- ], 10, cl);
2872
- }
2873
- const Kt = /* @__PURE__ */ Ee(ul, [["render", dl], ["__scopeId", "data-v-2c2d5706"]]), Ns = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2874
- __proto__: null,
2875
- default: Kt
2876
- }, Symbol.toStringTag, { value: "Module" }));
2877
- function fl(n, { emit: e } = {}, t) {
2878
- const i = P(null), f = P(!1), s = P(1), p = P([]), w = P(!1), h = P(0), T = P(!1), D = P(""), y = P(!1), I = P(!1), F = P(!0), J = Se({}), L = P(!0), q = P(""), N = P(!0), $ = P(!1), { popModalFixedWidth: Y, resetBodyStyle: A, popBodyStyle: H } = Zt(), Q = P(!1), Z = P(""), { getIsMobile: S } = jt(), C = {
2879
- handleOpenModal: (V) => {
2880
- }
2881
- }, v = P(""), R = P(""), M = P(""), b = P(!1);
2882
- let r = {};
2883
- const d = pe(() => {
2884
- let V = q.value;
2885
- return V || (Ce(f) === !0 ? "详情" : Ce(I) === !0 ? "编辑" : "新增");
2886
- }), [o, { setModalProps: l, closeModal: c }] = Dt((V) => z(this, null, function* () {
2887
- q.value = "", $.value = !1, n === !0 ? yield C.handleOpenModal(V) : yield x(V), A(), t && t();
2888
- })), a = P(!1);
2889
- function O() {
2890
- return z(this, null, function* () {
2891
- return yield ke(a), Q.value;
2892
- });
2893
- }
2894
- function x(V) {
2895
- return z(this, null, function* () {
2896
- l({ confirmLoading: !1 }), I.value = V.isUpdate, f.value = V.disableSubmit || !1, (V == null ? void 0 : V.hideSub) === !0 && (L.value = !1), V != null && V.title && (q.value = V.title), V != null && V.record ? M.value = V.record.id : M.value = "", yield Ne(() => z(this, null, function* () {
2897
- yield ke(w), _(), yield i.value.show(V == null ? void 0 : V.isUpdate, V == null ? void 0 : V.record, V == null ? void 0 : V.param);
2898
- }));
2899
- });
2900
- }
2901
- function u(V) {
2902
- w.value = !0, h.value = V.modalMinWidth, V.modelFullscreen == 1 ? l({ defaultFullscreen: !0 }) : l({ defaultFullscreen: !1 }), r = V, S.value && (r.commentStatus = 0);
2903
- }
2904
- function _() {
2905
- let V = M.value;
2906
- r.commentStatus == 1 && V ? (b.value = !0, l({ defaultFullscreen: !0 })) : b.value = !1;
2907
- }
2908
- const k = 800, G = 1100, B = pe(() => {
2909
- let V = 200 * (s.value - 1), ae = (Ce(F) ? k : G) + V;
2910
- ae = K(ae);
2911
- let ve = h.value;
2912
- return ve && ae < ve && (ae = ve), ae;
2913
- });
2914
- function K(V) {
2915
- let ae = J.modalMinWidth;
2916
- if (ae != null && ae !== "")
2917
- try {
2918
- if (ae = Number.parseInt(ae), V < ae)
2919
- return ae;
2920
- } catch (ve) {
2921
- }
2922
- return V;
2923
- }
2924
- function j(V, ae) {
2925
- i.value.handleCgButtonClick(V, ae);
2926
- }
2927
- function U() {
2928
- y.value = !0, setTimeout(() => {
2929
- y.value = !1;
2930
- }, 1500), i.value.handleSubmit();
2931
- }
2932
- function te() {
2933
- c();
2934
- }
2935
- function ne(V, ae = {}) {
2936
- let ve = `/online/cgform/api/getFormItem/${V}`;
2937
- return new Promise((Ie, Pe) => {
2938
- ge.get({ url: ve, params: ae }, { isTransformResponse: !1 }).then((ue) => {
2939
- ue.success ? Ie(ue.result) : Pe(ue.message);
2940
- }).catch(() => {
2941
- Pe();
2942
- });
2943
- });
2944
- }
2945
- function se(V, ae, ve, Ie, Pe) {
2946
- return z(this, null, function* () {
2947
- let ue = null;
2948
- if (Ie && Pe) {
2949
- const Ve = `/online/cgform/api/getFormItemBytbname/${Pe}`, $e = { taskId: Ie };
2950
- ue = yield ge.get({ url: Ve, params: $e });
2951
- } else
2952
- ue = yield ne(V, ae);
2953
- let Be = ue.head.formTemplate;
2954
- s.value = Be ? Number(Be) : 1, p.value = ue.cgButtonList, T.value = ue.head.isTree === "Y", D.value = ue.head.treeParentIdField || "", v.value = ue.head.id, R.value = ue.head.tableName, Z.value = ue.head.themeTemplate, ue.form_disable_update === !0 ? Q.value = !0 : Q.value = !1, a.value = !0, e && e("formConfig", ue), ve && ve(ue), yield Ne(() => z(this, null, function* () {
2955
- yield (yield ke(i)).createRootProperties(ue);
2956
- }));
2957
- });
2958
- }
2959
- function ze(V) {
2960
- V[li] = R.value, e("success", V), N.value == !0 && c(), $.value = !1, N.value = !0;
2961
- }
2962
- function Ke() {
2963
- i.value && i.value.onCloseModal(), I.value && (r != null ? r : {}).commentStatus == 1 && l({ defaultFullscreen: !1 });
2964
- }
2965
- return {
2966
- // modal
2967
- title: d,
2968
- modalWidth: B,
2969
- registerModal: o,
2970
- closeModal: c,
2971
- modalObject: C,
2972
- onCloseEvent: Ke,
2973
- // 自定义按钮
2974
- cgButtonList: p,
2975
- handleCgButtonClick: j,
2976
- // 提交/关闭按钮
2977
- disableSubmit: f,
2978
- handleSubmit: U,
2979
- submitLoading: y,
2980
- handleCancel: te,
2981
- successThenClose: N,
2982
- handleSuccess: ze,
2983
- topTipVisible: $,
2984
- //表单
2985
- handleFormConfig: se,
2986
- onlineFormCompRef: i,
2987
- formTemplate: s,
2988
- isTreeForm: T,
2989
- pidFieldName: D,
2990
- renderSuccess: u,
2991
- formRendered: w,
2992
- isUpdate: I,
2993
- showSub: L,
2994
- themeTemplate: Z,
2995
- // 评论区域参数
2996
- tableId: v,
2997
- tableName: R,
2998
- formDataId: M,
2999
- enableComment: b,
3000
- popBodyStyle: H,
3001
- popModalFixedWidth: Y,
3002
- getFormStatus: O
3003
- };
3004
- }
3005
- function Zt() {
3006
- const e = P(800);
3007
- let t = window.innerWidth - 300;
3008
- t < 800 && (t = 800), e.value = t;
3009
- const i = P({});
3010
- function f() {
3011
- let s = window.innerHeight - 210;
3012
- i.value = {
3013
- height: s + "px",
3014
- overflowY: "auto"
3015
- };
3016
- }
3017
- return {
3018
- popModalFixedWidth: e,
3019
- popBodyStyle: i,
3020
- resetBodyStyle: f
3021
- };
3022
- }
3023
- const pl = xt({
3024
- name: "OnlinePopModal",
3025
- props: {
3026
- /**可以是表名 可以是ID*/
3027
- id: {
3028
- type: String,
3029
- default: ""
3030
- },
3031
- /*展示字段名*/
3032
- showFields: {
3033
- type: Array,
3034
- default: () => []
3035
- },
3036
- /*隐藏字段名*/
3037
- hideFields: {
3038
- type: Array,
3039
- default: () => []
3040
- },
3041
- topTip: {
3042
- type: Boolean,
3043
- default: !1
3044
- },
3045
- request: {
3046
- type: Boolean,
3047
- default: !0
3048
- },
3049
- saveClose: {
3050
- type: Boolean,
3051
- default: !1
3052
- },
3053
- // 是否是vxeTable上方按钮点击打开的表单数据
3054
- isVxeTableData: {
3055
- type: Boolean,
3056
- default: !1
3057
- },
3058
- formTableType: {
3059
- type: String,
3060
- default: ""
3061
- },
3062
- // -update-begin--author:liaozhiyang---date:20240613---for:【TV360X-1000】流程一对多走流程的接口
3063
- // 有taskId即是流程
3064
- taskId: {
3065
- type: String
3066
- },
3067
- tableName: {
3068
- type: String
3069
- }
3070
- // -update-end--author:liaozhiyang---date:20240613---for:【TV360X-1000】流程一对多走流程的接口
3071
- },
3072
- components: {
3073
- BasicModal: It,
3074
- OnlinePopForm: Kt,
3075
- JModalTip: ti,
3076
- Button: Ge
3077
- },
3078
- emits: ["success", "register", "formConfig"],
3079
- setup(n, { emit: e }) {
3080
- const {
3081
- title: t,
3082
- registerModal: i,
3083
- cgButtonList: f,
3084
- handleCgButtonClick: s,
3085
- disableSubmit: p,
3086
- handleSubmit: w,
3087
- submitLoading: h,
3088
- handleCancel: T,
3089
- handleFormConfig: D,
3090
- onlineFormCompRef: y,
3091
- formTemplate: I,
3092
- isTreeForm: F,
3093
- pidFieldName: J,
3094
- renderSuccess: L,
3095
- formRendered: q,
3096
- handleSuccess: N,
3097
- topTipVisible: $,
3098
- successThenClose: Y,
3099
- isUpdate: A,
3100
- popBodyStyle: H,
3101
- popModalFixedWidth: Q,
3102
- getFormStatus: Z
3103
- } = fl(!1, { emit: e });
3104
- he(() => n.id, S, { immediate: !0 });
3105
- function S() {
3106
- return z(this, null, function* () {
3107
- if (q.value = !1, !n.id)
3108
- return;
3109
- let d = {};
3110
- n.formTableType && (d.tabletype = n.formTableType), n.taskId ? yield D(n.id, d, null, n.taskId, n.tableName) : yield D(n.id, d);
3111
- });
3112
- }
3113
- function C() {
3114
- n.saveClose === !1 && (Y.value = !1), w();
3115
- }
3116
- function v() {
3117
- $.value = !1, y.value.recoverFormData();
3118
- }
3119
- function R() {
3120
- $.value = !0;
3121
- }
3122
- const M = pe(() => A.value ? n.topTip : !1), b = pe(() => {
3123
- if (A.value == !0)
3124
- return null;
3125
- {
3126
- let d = h.value;
3127
- return [
3128
- je(Ge, { type: "primary", loading: d, onClick: w }, () => "确定"),
3129
- je(Ge, { onClick: T }, () => "关闭")
3130
- ];
3131
- }
3132
- });
3133
- return {
3134
- title: t,
3135
- topTipVisible: $,
3136
- handleSaveData: C,
3137
- handleRecover: v,
3138
- onlineFormCompRef: y,
3139
- renderSuccess: L,
3140
- registerModal: i,
3141
- handleSubmit: w,
3142
- handleSuccess: N,
3143
- handleCancel: T,
3144
- formTemplate: I,
3145
- disableSubmit: p,
3146
- cgButtonList: f,
3147
- handleCgButtonClick: s,
3148
- isTreeForm: F,
3149
- pidFieldName: J,
3150
- submitLoading: h,
3151
- handleDataChange: R,
3152
- isUpdate: A,
3153
- showTopTip: M,
3154
- modalFooter: b,
3155
- popBodyStyle: H,
3156
- popModalFixedWidth: Q,
3157
- getFormStatus: Z
3158
- };
3159
- }
3160
- });
3161
- function ml(n, e, t, i, f, s) {
3162
- const p = le("j-modal-tip"), w = le("online-pop-form"), h = le("BasicModal");
3163
- return ee(), Oe(h, Ot({
3164
- width: n.popModalFixedWidth,
3165
- dialogStyle: { top: "70px" },
3166
- bodyStyle: n.popBodyStyle
3167
- }, n.$attrs, {
3168
- footer: n.modalFooter,
3169
- cancelText: "关闭",
3170
- onRegister: n.registerModal,
3171
- wrapClassName: "jeecg-online-pop-modal",
3172
- onOk: n.handleSubmit
3173
- }), {
3174
- title: oe(() => [
3175
- _e(xe(n.title) + " ", 1),
3176
- n.showTopTip ? (ee(), Oe(p, {
3177
- key: 0,
3178
- visible: n.topTipVisible,
3179
- onSave: n.handleSaveData,
3180
- onCancel: n.handleRecover
3181
- }, null, 8, ["visible", "onSave", "onCancel"])) : Te("", !0)
3182
- ]),
3183
- default: oe(() => [
3184
- fe(w, {
3185
- ref: "onlineFormCompRef",
3186
- id: n.id,
3187
- disabled: n.disableSubmit,
3188
- "form-template": n.formTemplate,
3189
- isTree: n.isTreeForm,
3190
- pidField: n.pidFieldName,
3191
- request: n.request,
3192
- isVxeTableData: n.isVxeTableData,
3193
- onRendered: n.renderSuccess,
3194
- onSuccess: n.handleSuccess,
3195
- onDataChange: n.handleDataChange,
3196
- "modal-class": "jeecg-online-pop-modal"
3197
- }, null, 8, ["id", "disabled", "form-template", "isTree", "pidField", "request", "isVxeTableData", "onRendered", "onSuccess", "onDataChange"])
3198
- ]),
3199
- _: 1
3200
- }, 16, ["width", "bodyStyle", "footer", "onRegister", "onOk"]);
3201
- }
3202
- const Qe = /* @__PURE__ */ Ee(pl, [["render", ml]]), Bs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3203
- __proto__: null,
3204
- default: Qe
3205
- }, Symbol.toStringTag, { value: "Module" }));
3206
- function _t(n, e) {
3207
- const t = "/online/cgform/api/getData/" + n;
3208
- return ge.get({ url: t, params: e });
3209
- }
3210
- function hl(n, e) {
3211
- const t = "/online/cgform/api/getColumns/" + n;
3212
- return ge.get({ url: t, params: e });
3213
- }
3214
- function Gt(n) {
3215
- const e = P("1"), t = P({}), i = P({}), f = P(""), s = Se({
3216
- add: !0,
3217
- update: !0
3218
- }), p = pe(() => n.textField ? n.textField.split(",") : []), w = P([]), h = pe(() => {
3219
- let S = w.value;
3220
- return n.multi == !0 ? S.slice(0, 3) : S.slice(0, 6);
3221
- });
3222
- On(() => z(this, null, function* () {
3223
- if (n.tableName) {
3224
- let C = n.valueField || "", v = n.textField || "", R = [];
3225
- if (C && R.push(C), v) {
3226
- let b = v.split(",");
3227
- f.value = b[0];
3228
- for (let r of b)
3229
- R.push(r);
3230
- }
3231
- let M = n.imageField || "";
3232
- M && R.push(M), t.value = {
3233
- linkTableSelectFields: R.join(",")
3234
- }, yield F(), yield J();
3235
- }
3236
- }));
3237
- const T = pe(() => {
3238
- let S = n.textField || "", C = [], v = "";
3239
- if (S) {
3240
- let R = S.split(",");
3241
- v = R[0];
3242
- for (let M = 0; M < R.length; M++)
3243
- M > 0 && C.push(R[M]);
3244
- }
3245
- return {
3246
- others: C,
3247
- labelField: v
3248
- };
3249
- }), D = P([]), y = P([]), I = P({});
3250
- function F() {
3251
- return z(this, null, function* () {
3252
- let S = t.value;
3253
- const C = yield hl(n.tableName, S);
3254
- if (y.value = C.columns, C.columns) {
3255
- let v = n.imageField, R = C.columns.filter((M) => M.dataIndex != f.value && M.dataIndex != v);
3256
- w.value = R;
3257
- }
3258
- if (I.value = C.dictOptions, C.hideColumns) {
3259
- let v = C.hideColumns;
3260
- v.indexOf("add") >= 0 ? s.add = !1 : s.add = !0, v.indexOf("update") >= 0 ? s.update = !1 : s.update = !0;
3261
- }
3262
- });
3263
- }
3264
- function J() {
3265
- return z(this, null, function* () {
3266
- let S = q(), v = (yield _t(n.tableName, S)).records, R = [], { others: M, labelField: b } = T.value, r = n.imageField;
3267
- if (v && v.length > 0)
3268
- for (let d of v) {
3269
- let o = ce({}, d);
3270
- L(o);
3271
- let l = Object.assign({}, qe(o, M), { id: o.id, label: o[b], value: o[n.valueField] });
3272
- r && (l[r] = o[r]), R.push(l);
3273
- }
3274
- n.editBtnShow && R.push({}), D.value = R;
3275
- });
3276
- }
3277
- function L(S) {
3278
- let C = y.value, v = I.value;
3279
- for (let R of C) {
3280
- const { dataIndex: M, customRender: b } = R;
3281
- if ((S[M] || S[M] === 0) && b && b == M && v[b]) {
3282
- S[M] = $t(v[b], S[M]);
3283
- continue;
3284
- }
3285
- let r = S[M + "_dictText"];
3286
- r && (S[M] = r);
3287
- }
3288
- }
3289
- function q() {
3290
- return Object.assign({ pageSize: 100, pageNo: e.value }, t.value, i.value);
3291
- }
3292
- function N(S) {
3293
- if (!S)
3294
- i.value = {};
3295
- else {
3296
- let C = p.value, v = [], R = [];
3297
- for (let M = 0; M < C.length; M++)
3298
- M <= 1 && (R.push(C[M]), v.push({ field: C[M], rule: "like", val: S }));
3299
- v.superQueryMatchType = "or", v.superQueryParams = encodeURI(JSON.stringify(v)), i.value = v;
3300
- }
3301
- }
3302
- function $(S) {
3303
- return z(this, null, function* () {
3304
- if (!S)
3305
- return [];
3306
- let C = n.valueField, v = Me(ce({}, t.value), {
3307
- pageSize: 100,
3308
- pageNo: e.value
3309
- });
3310
- v.superQueryMatchType = "and";
3311
- let R = [{ field: C, rule: "in", val: S }];
3312
- v.superQueryParams = encodeURI(JSON.stringify(R));
3313
- let b = (yield _t(n.tableName, v)).records, r = [];
3314
- if (b && b.length > 0)
3315
- for (let d of b) {
3316
- let o = ce({}, d);
3317
- L(o), r.push(o);
3318
- }
3319
- return r;
3320
- });
3321
- }
3322
- function Y(S, C) {
3323
- if (!S || S.length == 0)
3324
- return !1;
3325
- let v = C.split(",");
3326
- if (v.length != S.length)
3327
- return !1;
3328
- let R = !0;
3329
- for (let M of S) {
3330
- let b = M[n.valueField];
3331
- v.indexOf(b) < 0 && (R = !1);
3332
- }
3333
- return R;
3334
- }
3335
- function A(S) {
3336
- Object.keys(S).map((C) => {
3337
- S[C] instanceof Array && (S[C] = S[C].join(","));
3338
- });
3339
- }
3340
- function H(S, C, v) {
3341
- if (v || (v = {}), C && C.length > 0)
3342
- for (let R of C) {
3343
- let M = R.split(","), b = M[0], r = M[1];
3344
- if (S[b])
3345
- S[b].push(v[r]);
3346
- else {
3347
- let d = v[r] || "";
3348
- S[b] = [d];
3349
- }
3350
- }
3351
- }
3352
- function Q(S) {
3353
- if (n.imageField) {
3354
- let C = S[n.imageField];
3355
- return typeof C == "string" && (C = C.split(",")[0]), Je(C);
3356
- }
3357
- return "";
3358
- }
3359
- const Z = pe(() => !!n.imageField);
3360
- return {
3361
- pageNo: e,
3362
- otherColumns: w,
3363
- realShowColumns: h,
3364
- selectOptions: D,
3365
- reloadTableLinkOptions: J,
3366
- textFieldArray: p,
3367
- addQueryParams: N,
3368
- tableColumns: y,
3369
- transData: L,
3370
- mainContentField: f,
3371
- loadOne: $,
3372
- compareData: Y,
3373
- formatData: A,
3374
- initFormData: H,
3375
- getImageSrc: Q,
3376
- showImage: Z,
3377
- auths: s
3378
- };
3379
- }
3380
- const gl = {
3381
- name: "LinkTableSelect",
3382
- components: {
3383
- PlusOutlined: ot,
3384
- EditOutlined: $n,
3385
- OnlinePopModal: Qe
3386
- },
3387
- props: {
3388
- valueField: re.string.def(""),
3389
- textField: re.string.def(""),
3390
- tableName: re.string.def(""),
3391
- multi: re.bool.def(!1),
3392
- value: re.oneOfType([re.string, re.number, re.array]),
3393
- linkFields: re.array.def([]),
3394
- imageField: re.string.def(""),
3395
- // update-begin--author:liaozhiyang---date:20240530---for:【TV360X-389】普通查询关联记录去掉编辑按钮
3396
- editBtnShow: re.bool.def(!0)
3397
- // update-end--author:liaozhiyang---date:20240530---for:【TV360X-389】普通查询关联记录去掉编辑按钮
3398
- },
3399
- emits: ["change", "update:value"],
3400
- setup(n, { emit: e, attrs: t }) {
3401
- const i = Pn("tableId", P(null)), f = P(), s = P([]), { auths: p, mainContentField: w, textFieldArray: h, selectOptions: T, reloadTableLinkOptions: D, addQueryParams: y, formatData: I, initFormData: F, getImageSrc: J, showImage: L } = Gt(n), [q, { openModal: N }] = De(), $ = pe(() => n.tableName), Y = pe(() => n.multi === !0 ? Me(ce({}, t), {
3402
- // update-end--author:liaozhiyang---date:20240617---for:【TV360X-988】关联记录组件下拉风格禁用未生效
3403
- mode: "multiple"
3404
- }) : ce({}, t));
3405
- function A(r) {
3406
- r == null || r.stopPropagation(), r == null || r.preventDefault(), N(!0, {});
3407
- }
3408
- function H(r, d) {
3409
- r == null || r.stopPropagation(), r == null || r.preventDefault(), p.update != !1 && N(!0, {
3410
- isUpdate: !0,
3411
- record: d
3412
- });
3413
- }
3414
- const Q = "custom:online:reload";
3415
- Pt(() => {
3416
- f.value && f.value.addEventListener(Q, Z);
3417
- }), Dn(() => {
3418
- f.value && f.value.removeEventListener(Q, Z);
3419
- });
3420
- function Z() {
3421
- D();
3422
- }
3423
- function S(r) {
3424
- return z(this, null, function* () {
3425
- try {
3426
- const o = document.querySelectorAll(`.online-list-${i.value} .jeecg-basic-table-form-container.online-query-form .link-table-select-box`);
3427
- o && o.length > 0 && o.forEach((l) => l.dispatchEvent(new Event(Q)));
3428
- } catch (o) {
3429
- }
3430
- yield D();
3431
- let d = r[n.valueField];
3432
- n.multi === !0 ? s.value = [d] : s.value = d, v(s.value);
3433
- });
3434
- }
3435
- function C(r) {
3436
- y(r), D();
3437
- }
3438
- function v(r) {
3439
- R(r), r || (y(), D());
3440
- }
3441
- function R(r) {
3442
- let d = {}, o = n.linkFields, l = [];
3443
- if (!r)
3444
- F(d, o);
3445
- else {
3446
- let c = be(T.value), a = be(r);
3447
- a instanceof Array ? l = [...a] : n.multi == !0 ? l = a.split(",") : l = [a];
3448
- let O = c.filter((x) => l.indexOf(x[n.valueField]) >= 0);
3449
- if (O && O.length > 0) {
3450
- let x = ce({}, O[0]);
3451
- if (O.length > 1)
3452
- for (let _ = 1; _ < O.length; _++)
3453
- x = M(x, O[_]);
3454
- let u = w.value;
3455
- x[u] = x.label, F(d, o, x);
3456
- }
3457
- }
3458
- I(d), e("change", l.join(",") || "", d), e("update:value", l.join(",") || "");
3459
- }
3460
- function M(r, d) {
3461
- let o = {};
3462
- return Object.keys(r).map((l) => {
3463
- o[l] = (r[l] || "") + "," + (d[l] || "");
3464
- }), o;
3465
- }
3466
- he(() => n.value, (r) => z(this, null, function* () {
3467
- r ? (n.multi == !0 ? s.value = r.split(",") : s.value = r, n.linkFields && n.linkFields.length > 0 && R(r)) : s.value = [];
3468
- }), { immediate: !0 }), he(() => T.value, (r) => {
3469
- r && r.length > 0 && n.linkFields && n.linkFields.length > 0 && s.value && s.value.length > 0 && R(s.value);
3470
- });
3471
- const b = (r) => {
3472
- r.target.src = He;
3473
- };
3474
- return {
3475
- boxRef: f,
3476
- selectValue: s,
3477
- selectOptions: T,
3478
- registerPopModal: q,
3479
- popTableName: $,
3480
- textFieldArray: h,
3481
- handleClickAdd: A,
3482
- handleClickEdit: H,
3483
- getFormData: S,
3484
- handleSearch: ni(C, 800),
3485
- handleChange: v,
3486
- bindValue: Y,
3487
- showImage: L,
3488
- getImageSrc: J,
3489
- auths: p,
3490
- placeholderImage: He,
3491
- handleImageError: b
3492
- };
3493
- }
3494
- };
3495
- const bl = {
3496
- class: "link-table-select-box",
3497
- ref: "boxRef"
3498
- }, vl = {
3499
- key: 1,
3500
- class: "online-select-item"
3501
- }, yl = {
3502
- key: 0,
3503
- class: "left-avatar"
3504
- }, wl = ["src"], Cl = ["src"], Sl = { class: "right-content" }, Fl = { class: "others" }, _l = { class: "other-item ellipsis" };
3505
- function Tl(n, e, t, i, f, s) {
3506
- const p = le("PlusOutlined"), w = le("EditOutlined"), h = le("a-select"), T = le("online-pop-modal");
3507
- return ee(), de("div", bl, [
3508
- fe(h, Ot({
3509
- value: i.selectValue,
3510
- "onUpdate:value": e[2] || (e[2] = (D) => i.selectValue = D),
3511
- style: { width: "100%" },
3512
- placeholder: "请选择",
3513
- "option-label-prop": "label",
3514
- popupClassName: "table-link-select",
3515
- allowClear: "",
3516
- "show-search": ""
3517
- }, i.bindValue, {
3518
- options: i.selectOptions,
3519
- "filter-option": !1,
3520
- "not-found-content": null,
3521
- onSearch: i.handleSearch,
3522
- onChange: i.handleChange
3523
- }), {
3524
- option: oe((D) => [
3525
- !D.value && i.auths.add ? (ee(), de("div", {
3526
- key: 0,
3527
- class: "opt-add",
3528
- onClick: e[0] || (e[0] = (...y) => i.handleClickAdd && i.handleClickAdd(...y))
3529
- }, [
3530
- fe(p),
3531
- _e(" 记录 ")
3532
- ])) : (ee(), de("div", vl, [
3533
- i.showImage ? (ee(), de("div", yl, [
3534
- i.getImageSrc(D) ? (ee(), de("img", {
3535
- key: 0,
3536
- src: i.getImageSrc(D),
3537
- alt: "",
3538
- onError: e[1] || (e[1] = (...y) => i.handleImageError && i.handleImageError(...y))
3539
- }, null, 40, wl)) : (ee(), de("img", {
3540
- key: 1,
3541
- src: i.placeholderImage,
3542
- alt: ""
3543
- }, null, 8, Cl))
3544
- ])) : Te("", !0),
3545
- me("div", Sl, [
3546
- me("div", {
3547
- class: Ye(["label", { noEditBtn: !(t.editBtnShow && i.auths.update) }])
3548
- }, [
3549
- t.editBtnShow && i.auths.update ? (ee(), Oe(w, {
3550
- key: 0,
3551
- onClick: (y) => i.handleClickEdit(y, D)
3552
- }, null, 8, ["onClick"])) : Te("", !0),
3553
- _e(" " + xe(D.label), 1)
3554
- ], 2),
3555
- me("div", Fl, [
3556
- (ee(!0), de(Ue, null, it(i.textFieldArray, (y) => (ee(), de("div", _l, xe(D[y]), 1))), 256))
3557
- ])
3558
- ])
3559
- ]))
3560
- ]),
3561
- _: 1
3562
- }, 16, ["value", "options", "onSearch", "onChange"]),
3563
- fe(T, {
3564
- id: i.popTableName,
3565
- onRegister: i.registerPopModal,
3566
- onSuccess: i.getFormData,
3567
- topTip: ""
3568
- }, null, 8, ["id", "onRegister", "onSuccess"])
3569
- ], 512);
3570
- }
3571
- const Xt = /* @__PURE__ */ Ee(gl, [["render", Tl], ["__scopeId", "data-v-76bee333"]]), Vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3572
- __proto__: null,
3573
- default: Xt
3574
- }, Symbol.toStringTag, { value: "Module" }));
3575
- function xl(n, e) {
3576
- let t = zn();
3577
- const i = P([]), f = P({}), s = P([]), p = P(null);
3578
- let w = P(!0), h = pe(() => {
3579
- if (w.value != !0)
3580
- return { x: !1 };
3581
- });
3582
- const [T, { openModal: D }] = De(), y = P(""), [I, { openModal: F }] = De(), J = P("");
3583
- function L(o, l = "checkbox") {
3584
- f.value = o.dictOptions, o.checkboxFlag == "Y" ? p.value = {
3585
- selectedRowKeys: s,
3586
- onChange: q,
3587
- type: l
3588
- } : p.value = null, w.value = o.scrollFlag == 1;
3589
- let c = o.columns;
3590
- c.forEach((u) => {
3591
- var _;
3592
- if (u.fieldExtendJson && JSON.parse(u.fieldExtendJson).isFixed && (u.fixed = "left"), u.hrefSlotName && u.scopedSlots) {
3593
- const k = (_ = o.fieldHrefSlots) == null ? void 0 : _.find((G) => G.slotName === u.hrefSlotName);
3594
- k && (u.fieldHref = k);
3595
- }
3596
- Object.keys(u).map((k) => {
3597
- u[k] == null && delete u[k];
3598
- });
3599
- });
3600
- let a = o.fieldHrefSlots;
3601
- const O = {};
3602
- a.forEach((u) => O[u.slotName] = u);
3603
- let x = [];
3604
- if (x = N(c, O), S(x), n.isTree() === !0) {
3605
- let u = o.textField, _ = -1;
3606
- for (let k = 0; k < x.length; k++)
3607
- if (x[k].dataIndex == u) {
3608
- _ = k;
3609
- break;
3610
- }
3611
- if (_ > 0) {
3612
- let k = x.splice(_, 1);
3613
- x.unshift(k[0]);
3614
- }
3615
- x.length > 0 && (x[0].align = "left");
3616
- }
3617
- i.value = x, n.reloadTable();
3618
- }
3619
- function q(o, l) {
3620
- s.value = o, n.selectedRows = be(l), n.selectedRowKeys = be(o);
3621
- }
3622
- function N(o, l) {
3623
- for (let c of o) {
3624
- let { customRender: a, hrefSlotName: O, fieldType: x } = c;
3625
- if (x == "date" || x == "Date")
3626
- c.customRender = ({ text: u }) => u ? u.length > 10 ? u.substring(0, 10) : u : "";
3627
- else if (x == "link_table")
3628
- c.customRender = ({ text: u, record: _ }) => {
3629
- if (!u)
3630
- return "";
3631
- if (n.isPopList === !0)
3632
- return _[c.dataIndex + "_dictText"];
3633
- {
3634
- let k = (u + "").split(","), G = [];
3635
- _[c.dataIndex + "_dictText"] && (G = _[c.dataIndex + "_dictText"].split(","));
3636
- let B = [];
3637
- for (let K = 0; K < k.length; K++) {
3638
- let j = je(
3639
- Gn,
3640
- {
3641
- id: k[K],
3642
- text: G[K],
3643
- onTab: (U) => d(U, O)
3644
- }
3645
- );
3646
- B.push(j);
3647
- }
3648
- return B.length == 0 ? "" : je("div", { style: { overflow: "hidden" } }, B);
3649
- }
3650
- };
3651
- else if (x === "popup_dict")
3652
- c.customRender = ({ text: u, record: _ }) => _[c.dataIndex + "_dictText"] != null ? _[c.dataIndex + "_dictText"] : u;
3653
- else {
3654
- if (!O && c.scopedSlots && c.scopedSlots.customRender && l.hasOwnProperty(c.scopedSlots.customRender) && (O = c.scopedSlots.customRender), a || O) {
3655
- let u = a, _ = "_replace_text_";
3656
- c.ellipsis = !0, c.customRender = ({ text: k, record: G }) => {
3657
- let B = k;
3658
- if (u)
3659
- if (u.startsWith(_)) {
3660
- let K = u.replace(_, "");
3661
- B = G[K];
3662
- } else
3663
- B = $t(Ce(f)[u], k + "");
3664
- if (c.showLength && B && B.length > c.showLength && (B = B.substr(0, c.showLength) + "..."), O) {
3665
- let K = l[O];
3666
- if (K)
3667
- return je(
3668
- "a",
3669
- {
3670
- onClick: () => $(K, G)
3671
- },
3672
- B
3673
- );
3674
- }
3675
- return B;
3676
- };
3677
- }
3678
- if (c.scopedSlots) {
3679
- c.ellipsis = !0;
3680
- let u = c.scopedSlots;
3681
- c.slots = u, delete c.scopedSlots;
3682
- }
3683
- }
3684
- }
3685
- return o;
3686
- }
3687
- function $(o, l) {
3688
- let c = o.href, a = /(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&amp;%\$#_]*)?/, O = /\.vue(\?.*)?$/, x = /{{([^}]+)}}/g;
3689
- if (typeof c == "string")
3690
- if (c.startsWith("ONLINE:")) {
3691
- let u = c.split(":");
3692
- y.value = u[1];
3693
- let _ = u[2];
3694
- D(!0, {
3695
- isUpdate: !0,
3696
- disableSubmit: !0,
3697
- hideSub: !0,
3698
- record: { id: l[_] }
3699
- });
3700
- } else
3701
- c = c.trim().replace(/\${([^}]+)?}/g, (u, _) => l[_]), x.test(c) && (c = c.replace(x, function(u, _) {
3702
- try {
3703
- return _.trim() === "ACCESS_TOKEN" ? Lt() : at(_);
3704
- } catch (k) {
3705
- return u;
3706
- }
3707
- })), a.test(c) ? window.open(c, "_blank") : O.test(c) ? H(c) : t.push(c);
3708
- }
3709
- const A = Se({
3710
- model: {
3711
- title: "",
3712
- okText: "关闭",
3713
- width: "100%",
3714
- open: !1,
3715
- destroyOnClose: !0,
3716
- style: {
3717
- top: 0,
3718
- left: 0,
3719
- height: "100%",
3720
- margin: 0,
3721
- padding: 0
3722
- },
3723
- // dialogStyle: dialogStyle,
3724
- bodyStyle: { padding: "8px", height: "calc(100vh - 108px)", overflow: "auto", overflowX: "hidden" },
3725
- // 隐藏掉取消按钮
3726
- cancelButtonProps: { style: { display: "none" } }
3727
- },
3728
- on: {
3729
- ok: () => A.model.open = !1,
3730
- cancel: () => A.model.open = !1
3731
- },
3732
- is: null,
3733
- params: {}
3734
- });
3735
- function H(o) {
3736
- let l = o.indexOf("?"), c = o;
3737
- if (l !== -1) {
3738
- c = o.substring(0, l);
3739
- let O = o.substring(l + 1, o.length).split("&"), x = {};
3740
- O.forEach((u) => {
3741
- let _ = u.split("=");
3742
- x[_[0]] = _[1];
3743
- }), A.params = x;
3744
- } else
3745
- A.params = {};
3746
- A.model.open = !0, A.model.title = "操作", A.is = In(Mn(() => Jn(c)));
3747
- }
3748
- let Q = "left";
3749
- n.isTree() && (Q = "right");
3750
- const Z = Se({
3751
- title: "操作",
3752
- dataIndex: "action",
3753
- slots: { customRender: "action" },
3754
- fixed: Q,
3755
- align: "center",
3756
- width: 150
3757
- });
3758
- he(() => e == null ? void 0 : e.value, () => {
3759
- var o, l;
3760
- ((o = e == null ? void 0 : e.value) == null ? void 0 : o.tableFixedAction) === 1 && (Z.fixed = ((l = e == null ? void 0 : e.value) == null ? void 0 : l.tableFixedActionType) || "right", n.isTree() && (Z.fixed = "right"));
3761
- });
3762
- function S(o) {
3763
- let l = !1;
3764
- for (let c = 0; c < o.length; c++)
3765
- if (o[c].dataIndex.toLowerCase() == "bpm_status") {
3766
- l = !0;
3767
- break;
3768
- }
3769
- return n.hasBpmStatus = l, l;
3770
- }
3771
- function C(o, l, c, a) {
3772
- if (o)
3773
- if (o.indexOf(",") > 0)
3774
- Xn(`/online/cgform/field/download/${a}/${l.id}/${c.dataIndex}`, `文件_${l.id}.zip`);
3775
- else {
3776
- const O = Je(o);
3777
- window.open(O);
3778
- }
3779
- }
3780
- function v(o) {
3781
- return o && o.indexOf(",") > 0 && (o = o.substring(0, o.indexOf(","))), Je(o);
3782
- }
3783
- function R(o) {
3784
- return o ? Kn(o) : "";
3785
- }
3786
- function M(o, l) {
3787
- if (!o)
3788
- return "";
3789
- let c = o;
3790
- c.length > 10 && (c = c.substring(0, 10));
3791
- let a = l == null ? void 0 : l.fieldExtendJson;
3792
- return a && (a = JSON.parse(a), a.picker && a.picker != "default") ? Yn(c)[a.picker] : c;
3793
- }
3794
- he(s, () => {
3795
- n.selectedRowKeys = be(s.value);
3796
- }), n.clearSelectedRow = () => {
3797
- s.value = [], n.selectedRows = [], n.selectedRowKeys = [];
3798
- };
3799
- function b(o) {
3800
- if (o) {
3801
- let l = [], c = o.split(",");
3802
- for (let a of c)
3803
- a && l.push(Je(a));
3804
- Zn({ imageList: l });
3805
- }
3806
- }
3807
- const r = P();
3808
- function d(o, l) {
3809
- return z(this, null, function* () {
3810
- J.value = l, (yield r.value.getFormStatus()) == !0 ? (y.value = l, D(!0, {
3811
- isUpdate: !0,
3812
- disableSubmit: !0,
3813
- hideSub: !0,
3814
- record: { id: o }
3815
- })) : F(!0, {
3816
- isUpdate: !0,
3817
- record: {
3818
- id: o
3819
- }
3820
- });
3821
- });
3822
- }
3823
- return {
3824
- columns: i,
3825
- actionColumn: Z,
3826
- selectedKeys: s,
3827
- rowSelection: p,
3828
- enableScrollBar: w,
3829
- tableScroll: h,
3830
- downloadRowFile: C,
3831
- getImgView: v,
3832
- getPcaText: R,
3833
- getFormatDate: M,
3834
- handleColumnResult: L,
3835
- onSelectChange: q,
3836
- hrefComponent: A,
3837
- viewOnlineCellImage: b,
3838
- hrefMainTableId: y,
3839
- registerOnlineHrefModal: T,
3840
- registerPopModal: I,
3841
- openPopModal: F,
3842
- openOnlineHrefModal: D,
3843
- onlinePopModalRef: r,
3844
- popTableId: J,
3845
- handleClickFieldHref: $
3846
- };
3847
- }
3848
- const Ol = xt({
3849
- name: "OnlinePopListModal",
3850
- props: {
3851
- /**可以是表名 可以是ID*/
3852
- id: {
3853
- type: String,
3854
- default: ""
3855
- },
3856
- multi: {
3857
- type: Boolean,
3858
- default: !1
3859
- },
3860
- addAuth: {
3861
- type: Boolean,
3862
- default: !0
3863
- }
3864
- },
3865
- components: {
3866
- BasicModal: It,
3867
- BasicTable: qn,
3868
- TableAction: Hn,
3869
- PlusOutlined: ot,
3870
- OnlinePopModal: Qe
3871
- },
3872
- emits: ["success", "register"],
3873
- setup(n, { emit: e }) {
3874
- const { createMessage: t } = Re(), { popModalFixedWidth: i, resetBodyStyle: f, popBodyStyle: s } = Zt(), p = P(""), w = P(800), [h, { closeModal: T }] = Dt((j) => {
3875
- p.value = "", a.value = j.selectedRowKeys, O.value = j.selectedRows, l({ current: 1 }), o(), f();
3876
- }), [D, { openModal: y }] = De();
3877
- function I() {
3878
- T();
3879
- }
3880
- const F = pe(() => {
3881
- const j = a.value;
3882
- return !(j && j.length > 0);
3883
- }), J = P(!1);
3884
- function L() {
3885
- J.value = !0;
3886
- let j = be(O.value);
3887
- j && j.length > 0 && (e("success", j), T()), setTimeout(() => {
3888
- J.value = !1;
3889
- }, 200);
3890
- }
3891
- function q(j) {
3892
- const U = "/online/cgform/api/getData/" + n.id;
3893
- return ge.get({ url: U, params: j });
3894
- }
3895
- function N(j) {
3896
- return j.column = "id", new Promise((U, te) => z(this, null, function* () {
3897
- const ne = yield q(j);
3898
- U(ne);
3899
- }));
3900
- }
3901
- const $ = {
3902
- isPopList: !0,
3903
- reloadTable() {
3904
- },
3905
- isTree() {
3906
- return !1;
3907
- }
3908
- }, Y = P({}), {
3909
- columns: A,
3910
- downloadRowFile: H,
3911
- getImgView: Q,
3912
- getPcaText: Z,
3913
- getFormatDate: S,
3914
- handleColumnResult: C,
3915
- hrefComponent: v,
3916
- viewOnlineCellImage: R
3917
- } = xl($, Y);
3918
- function M() {
3919
- const j = "/online/cgform/api/getColumns/" + n.id;
3920
- return new Promise((U, te) => {
3921
- ge.get({ url: j }, { isTransformResponse: !1 }).then((ne) => {
3922
- ne.success ? U(ne.result) : (t.warning(ne.message), te());
3923
- });
3924
- });
3925
- }
3926
- const b = P("");
3927
- he(() => n.id, () => z(this, null, function* () {
3928
- let j = yield M();
3929
- C(j), b.value = j.description;
3930
- }), { immediate: !0 });
3931
- const { tableContext: r } = Qn({
3932
- designScope: "process-design",
3933
- pagination: !0,
3934
- tableProps: {
3935
- title: "",
3936
- api: N,
3937
- clickToRowSelect: !0,
3938
- columns: A,
3939
- showTableSetting: !1,
3940
- immediate: !1,
3941
- //showIndexColumn: true,
3942
- canResize: !1,
3943
- showActionColumn: !1,
3944
- actionColumn: {
3945
- dataIndex: "action",
3946
- slots: { customRender: "action" }
3947
- },
3948
- useSearchForm: !1,
3949
- beforeFetch: (j) => G(j)
3950
- }
3951
- }), [d, { reload: o, setPagination: l }, { rowSelection: c, selectedRowKeys: a, selectedRows: O }] = r;
3952
- he(() => n.multi, (j) => {
3953
- j == !0 ? c.type = "checkbox" : c.type = "radio";
3954
- }, { immediate: !0 });
3955
- function x(j) {
3956
- return [
3957
- {
3958
- label: "编辑",
3959
- onClick: u.bind(null, j)
3960
- }
3961
- ];
3962
- }
3963
- function u(j) {
3964
- }
3965
- function _() {
3966
- o();
3967
- }
3968
- const k = ["int", "double", "Date", "Datetime", "BigDecimal"];
3969
- function G(j) {
3970
- let U = p.value;
3971
- if (!U)
3972
- return j.superQueryMatchType = "or", j.superQueryParams = "", j;
3973
- let te = A.value, ne = [];
3974
- if (te && te.length > 0)
3975
- for (let se of te)
3976
- se.dbType && (se.dbType == "string" ? ne.push({ field: se.dataIndex, type: se.dbType.toLowerCase(), rule: "like", val: U }) : se.dbType == "Date" ? U.length == 10 && ne.push({ field: se.dataIndex, type: se.dbType.toLowerCase(), rule: "eq", val: U }) : se.dbType == "Datetime" ? U.length == 19 && ne.push({ field: se.dataIndex, type: se.dbType.toLowerCase(), rule: "eq", val: U }) : k.indexOf(se.dbType) && ne.push({ field: se.dataIndex, type: se.dbType.toLowerCase(), rule: "eq", val: U }));
3977
- return j.superQueryMatchType = "or", j.superQueryParams = encodeURI(JSON.stringify(ne)), j;
3978
- }
3979
- function B() {
3980
- y(!0, {});
3981
- }
3982
- function K(j) {
3983
- e("success", [j]), T();
3984
- }
3985
- return {
3986
- registerModal: h,
3987
- modalWidth: w,
3988
- handleCancel: I,
3989
- submitDisabled: F,
3990
- submitLoading: J,
3991
- handleSubmit: L,
3992
- registerTable: d,
3993
- getTableAction: x,
3994
- searchText: p,
3995
- onSearch: _,
3996
- downloadRowFile: H,
3997
- getImgView: Q,
3998
- getPcaText: Z,
3999
- getFormatDate: S,
4000
- hrefComponent: v,
4001
- viewOnlineCellImage: R,
4002
- rowSelection: c,
4003
- modalTitle: b,
4004
- registerPopModal: D,
4005
- handleAdd: B,
4006
- reload: o,
4007
- popModalFixedWidth: i,
4008
- popBodyStyle: s,
4009
- handleDataSave: K
4010
- };
4011
- }
4012
- }), Pl = { style: { display: "inline-block", width: "calc(100% - 140px)", "text-align": "left" } }, Dl = {
4013
- key: 0,
4014
- style: { "font-size": "12px", "font-style": "italic" }
4015
- }, Il = {
4016
- key: 0,
4017
- style: { "font-size": "12px", "font-style": "italic" }
4018
- }, Ml = ["src", "onClick"], Rl = ["innerHTML"], kl = ["title"];
4019
- function El(n, e, t, i, f, s) {
4020
- const p = le("PlusOutlined"), w = le("a-button"), h = le("a-input-search"), T = le("TableAction"), D = le("BasicTable"), y = le("BasicModal"), I = le("online-pop-modal");
4021
- return ee(), de(Ue, null, [
4022
- fe(y, {
4023
- onRegister: n.registerModal,
4024
- width: n.popModalFixedWidth,
4025
- dialogStyle: { top: "70px" },
4026
- bodyStyle: n.popBodyStyle,
4027
- title: n.modalTitle,
4028
- wrapClassName: "jeecg-online-pop-list-modal"
4029
- }, {
4030
- footer: oe(() => [
4031
- me("div", Pl, [
4032
- n.addAuth ? (ee(), Oe(w, {
4033
- key: 0,
4034
- style: { "border-radius": "50px" },
4035
- type: "primary",
4036
- onClick: n.handleAdd
4037
- }, {
4038
- default: oe(() => [
4039
- fe(p),
4040
- _e("新增记录")
4041
- ]),
4042
- _: 1
4043
- }, 8, ["onClick"])) : Te("", !0)
4044
- ]),
4045
- fe(w, {
4046
- key: "back",
4047
- onClick: n.handleCancel
4048
- }, {
4049
- default: oe(() => [
4050
- _e("关闭")
4051
- ]),
4052
- _: 1
4053
- }, 8, ["onClick"]),
4054
- fe(w, {
4055
- disabled: n.submitDisabled,
4056
- key: "submit",
4057
- type: "primary",
4058
- onClick: n.handleSubmit,
4059
- loading: n.submitLoading
4060
- }, {
4061
- default: oe(() => [
4062
- _e("确定")
4063
- ]),
4064
- _: 1
4065
- }, 8, ["disabled", "onClick", "loading"])
4066
- ]),
4067
- default: oe(() => [
4068
- fe(D, {
4069
- onRegister: n.registerTable,
4070
- rowSelection: n.rowSelection
4071
- }, {
4072
- tableTitle: oe(() => [
4073
- fe(h, {
4074
- value: n.searchText,
4075
- "onUpdate:value": e[0] || (e[0] = (F) => n.searchText = F),
4076
- onSearch: n.onSearch,
4077
- placeholder: "请输入关键词,按回车搜索",
4078
- style: { width: "240px" }
4079
- }, null, 8, ["value", "onSearch"])
4080
- ]),
4081
- action: oe(({ record: F }) => [
4082
- fe(T, {
4083
- actions: n.getTableAction(F)
4084
- }, null, 8, ["actions"])
4085
- ]),
4086
- fileSlot: oe(({ text: F }) => [
4087
- F ? (ee(), Oe(w, {
4088
- key: 1,
4089
- ghost: !0,
4090
- type: "primary",
4091
- preIcon: "ant-design:download",
4092
- size: "small",
4093
- onClick: (J) => n.downloadRowFile(F)
4094
- }, {
4095
- default: oe(() => [
4096
- _e(" 下载 ")
4097
- ]),
4098
- _: 2
4099
- }, 1032, ["onClick"])) : (ee(), de("span", Dl, "无文件"))
4100
- ]),
4101
- imgSlot: oe(({ text: F }) => [
4102
- F ? (ee(), de("img", {
4103
- key: 1,
4104
- src: n.getImgView(F),
4105
- alt: "图片不存在",
4106
- class: "online-cell-image",
4107
- onClick: (J) => n.viewOnlineCellImage(F)
4108
- }, null, 8, Ml)) : (ee(), de("span", Il, "无图片"))
4109
- ]),
4110
- htmlSlot: oe(({ text: F }) => [
4111
- me("div", { innerHTML: F }, null, 8, Rl)
4112
- ]),
4113
- pcaSlot: oe(({ text: F }) => [
4114
- me("div", {
4115
- title: n.getPcaText(F)
4116
- }, xe(n.getPcaText(F)), 9, kl)
4117
- ]),
4118
- dateSlot: oe(({ text: F, column: J }) => [
4119
- me("span", null, xe(n.getFormatDate(F, J)), 1)
4120
- ]),
4121
- _: 1
4122
- }, 8, ["onRegister", "rowSelection"])
4123
- ]),
4124
- _: 1
4125
- }, 8, ["onRegister", "width", "bodyStyle", "title"]),
4126
- fe(I, {
4127
- id: n.id,
4128
- onRegister: n.registerPopModal,
4129
- onSuccess: n.handleDataSave,
4130
- topTip: ""
4131
- }, null, 8, ["id", "onRegister", "onSuccess"])
4132
- ], 64);
4133
- }
4134
- const en = /* @__PURE__ */ Ee(Ol, [["render", El]]), Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4135
- __proto__: null,
4136
- default: en
4137
- }, Symbol.toStringTag, { value: "Module" }));
4138
- const $l = {
4139
- name: "LinkTableCard",
4140
- props: {
4141
- valueField: re.string.def(""),
4142
- textField: re.string.def(""),
4143
- tableName: re.string.def(""),
4144
- multi: re.bool.def(!1),
4145
- value: re.oneOfType([re.string, re.number]),
4146
- // ["表单字段,表字典字段","表单字段,表字典字段"]
4147
- linkFields: re.array.def([]),
4148
- //是否是禁用页面
4149
- disabled: re.bool.def(!1),
4150
- // 是否是detail页面
4151
- detail: re.bool.def(!1),
4152
- imageField: re.string.def("")
4153
- },
4154
- components: {
4155
- PlusOutlined: ot,
4156
- MinusCircleFilled: Ln,
4157
- OnlinePopListModal: en,
4158
- OnlinePopModal: Qe
4159
- },
4160
- emits: ["change", "update:value"],
4161
- setup(n, { emit: e }) {
4162
- const t = pe(() => n.tableName), [i, { openModal: f }] = De(), [s, { openModal: p }] = De(), w = P([]), h = P([]), T = P(null), D = P(0), y = pe(() => !(n.disabled == !0 || n.multi === !1 && h.value.length > 0)), { auths: I, otherColumns: F, realShowColumns: J, tableColumns: L, textFieldArray: q, transData: N, loadOne: $, compareData: Y, formatData: A, initFormData: H, getImageSrc: Q, showImage: Z } = Gt(n), S = pe(() => n.multi === !0 ? 12 : 24), C = pe(() => n.multi === !0 ? 24 : 12);
4163
- function v(a) {
4164
- if (a && q.value.length > 0) {
4165
- let O = q.value[0];
4166
- return a[O];
4167
- }
4168
- }
4169
- function R(a) {
4170
- a == null || a.stopPropagation(), a == null || a.preventDefault();
4171
- }
4172
- function M(a, O) {
4173
- R(a), I.update != !1 && n.disabled == !1 && p(!0, {
4174
- isUpdate: !0,
4175
- record: O
4176
- });
4177
- }
4178
- function b(a) {
4179
- f(!0, {
4180
- // update-begin--author:liaozhiyang---date:20240517---for:【TV360X-43】修复关联记录可以添加重复数据
4181
- selectedRowKeys: h.value.map((O) => O.id),
4182
- selectedRows: [...h.value]
4183
- // update-end--author:liaozhiyang---date:20240517---for:【TV360X-43】修复关联记录可以添加重复数据
4184
- });
4185
- }
4186
- function r(a) {
4187
- let O = [];
4188
- for (let x of a) {
4189
- let u = ce({}, x);
4190
- N(u), O.push(u);
4191
- }
4192
- h.value = O, l();
4193
- }
4194
- function d(a) {
4195
- let O = h.value;
4196
- for (let x = 0; x < O.length; x++)
4197
- if (O[x].id === a.id) {
4198
- let u = ce({}, a);
4199
- N(u), O.splice(x, 1, u);
4200
- }
4201
- h.value = O, l();
4202
- }
4203
- function o(a, O) {
4204
- R(a);
4205
- let x = h.value;
4206
- x && x.length > O && (x.splice(O, 1), h.value = x), l();
4207
- }
4208
- function l() {
4209
- let a = h.value, O = [], x = {}, u = n.linkFields;
4210
- if (a.length > 0)
4211
- for (let k = 0; k < a.length; k++)
4212
- O.push(a[k][n.valueField]), H(x, u, a[k]);
4213
- else
4214
- H(x, u);
4215
- let _ = O.join(",");
4216
- A(x), e("change", _, x), e("update:value", _);
4217
- }
4218
- return he(() => n.value, (a) => z(this, null, function* () {
4219
- if (a) {
4220
- if (Y(h.value, a) === !1) {
4221
- let x = yield $(a);
4222
- h.value = x;
4223
- }
4224
- n.linkFields && n.linkFields.length > 0 && l();
4225
- } else
4226
- h.value = [];
4227
- }), { immediate: !0 }), Pt(() => {
4228
- T.value.offsetWidth < 250 && (D.value = 24);
4229
- }), {
4230
- popTableName: t,
4231
- selectRecords: h,
4232
- otherColumns: F,
4233
- realShowColumns: J,
4234
- showButton: y,
4235
- selectValue: w,
4236
- handleAddRecord: b,
4237
- handleDeleteRecord: o,
4238
- getMainContent: v,
4239
- itemSpan: S,
4240
- columnSpan: C,
4241
- tableColumns: L,
4242
- addCard: r,
4243
- registerListModal: i,
4244
- registerFormModal: s,
4245
- handleClickEdit: M,
4246
- updateCardData: d,
4247
- getImageSrc: Q,
4248
- showImage: Z,
4249
- auths: I,
4250
- tableLinkCardRef: T,
4251
- fixedSpan: D,
4252
- placeholderImage: He,
4253
- handleImageError: (a) => {
4254
- a.target.src = He;
4255
- }
4256
- };
4257
- }
4258
- }, Ll = { ref: "tableLinkCardRef" }, jl = { class: "table-link-card" }, Al = { style: { width: "100%", height: "100%" } }, Nl = {
4259
- key: 0,
4260
- class: "card-button"
4261
- }, Bl = ["onClick"], Vl = {
4262
- key: 0,
4263
- class: "card-delete"
4264
- }, Wl = { class: "card-inner" }, Jl = { class: "card-main-content" }, Yl = { class: "other-content" }, Ul = { class: "label ellipsis" }, ql = { class: "text ellipsis" }, Hl = {
4265
- key: 0,
4266
- class: "card-item-image"
4267
- }, Ql = ["src"];
4268
- function zl(n, e, t, i, f, s) {
4269
- const p = le("PlusOutlined"), w = le("a-button"), h = le("minus-circle-filled"), T = le("a-col"), D = le("a-row"), y = le("online-pop-list-modal"), I = le("online-pop-modal");
4270
- return ee(), de("div", Ll, [
4271
- me("div", jl, [
4272
- me("div", Al, [
4273
- i.showButton ? (ee(), de("div", Nl, [
4274
- fe(w, { onClick: i.handleAddRecord }, {
4275
- default: oe(() => [
4276
- fe(p),
4277
- _e("记 录")
4278
- ]),
4279
- _: 1
4280
- }, 8, ["onClick"])
4281
- ])) : Te("", !0),
4282
- fe(D, null, {
4283
- default: oe(() => [
4284
- (ee(!0), de(Ue, null, it(i.selectRecords, (F, J) => (ee(), Oe(T, {
4285
- span: i.fixedSpan ? i.fixedSpan : i.itemSpan
4286
- }, {
4287
- default: oe(() => [
4288
- me("div", {
4289
- class: Ye(["card-item", { "disabled-chunk": t.detail == !0 }]),
4290
- onClick: (L) => i.handleClickEdit(L, F)
4291
- }, [
4292
- me("div", {
4293
- class: Ye(["card-item-left", { "show-right-image": i.getImageSrc(F) }])
4294
- }, [
4295
- t.disabled == !1 ? (ee(), de("span", Vl, [
4296
- fe(h, {
4297
- onClick: (L) => i.handleDeleteRecord(L, J)
4298
- }, null, 8, ["onClick"])
4299
- ])) : Te("", !0),
4300
- me("div", Wl, [
4301
- me("div", Jl, xe(i.getMainContent(F)), 1),
4302
- me("div", Yl, [
4303
- fe(D, null, {
4304
- default: oe(() => [
4305
- (ee(!0), de(Ue, null, it(i.realShowColumns, (L) => (ee(), Oe(T, { span: i.columnSpan }, {
4306
- default: oe(() => [
4307
- me("span", Ul, xe(L.title), 1),
4308
- me("span", ql, xe(F[L.dataIndex]), 1)
4309
- ]),
4310
- _: 2
4311
- }, 1032, ["span"]))), 256))
4312
- ]),
4313
- _: 2
4314
- }, 1024)
4315
- ])
4316
- ])
4317
- ], 2),
4318
- i.getImageSrc(F) ? (ee(), de("div", Hl, [
4319
- i.getImageSrc(F) ? (ee(), de("img", {
4320
- key: 0,
4321
- src: i.getImageSrc(F),
4322
- alt: "",
4323
- onError: e[0] || (e[0] = (...L) => i.handleImageError && i.handleImageError(...L))
4324
- }, null, 40, Ql)) : Te("", !0)
4325
- ])) : Te("", !0)
4326
- ], 10, Bl)
4327
- ]),
4328
- _: 2
4329
- }, 1032, ["span"]))), 256))
4330
- ]),
4331
- _: 1
4332
- })
4333
- ])
4334
- ]),
4335
- fe(y, {
4336
- onRegister: i.registerListModal,
4337
- multi: t.multi,
4338
- id: i.popTableName,
4339
- addAuth: i.auths.add,
4340
- onSuccess: i.addCard
4341
- }, null, 8, ["onRegister", "multi", "id", "addAuth", "onSuccess"]),
4342
- fe(I, {
4343
- id: i.popTableName,
4344
- onRegister: i.registerFormModal,
4345
- onSuccess: i.updateCardData,
4346
- topTip: ""
4347
- }, null, 8, ["id", "onRegister", "onSuccess"])
4348
- ], 512);
4349
- }
4350
- const tn = /* @__PURE__ */ Ee($l, [["render", zl], ["__scopeId", "data-v-6c31f866"]]), Js = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
4351
- __proto__: null,
4352
- default: tn
4353
- }, Symbol.toStringTag, { value: "Module" })), Tt = {};
4354
- function Kl() {
4355
- n("OnlineSelectCascade", ei), n("LinkTableSelect", Xt), n("LinkTableCard", tn);
4356
- function n(t, i) {
4357
- Tt[t] || (xn(t, i), Tt[t] = 1);
4358
- }
4359
- function e(t) {
4360
- t.component == "LinkTableCard" && (t.component = "LinkTableSelect", t.componentProps.popContainer = "body");
4361
- }
4362
- return {
4363
- addComponent: n,
4364
- linkTableCard2Select: e
4365
- };
4366
- }
4367
- export {
4368
- Es as E,
4369
- Xe as F,
4370
- tn as L,
4371
- Qe as O,
4372
- ii as S,
4373
- Le as V,
4374
- xl as a,
4375
- fl as b,
4376
- zt as c,
4377
- el as d,
4378
- Ht as e,
4379
- Rs as f,
4380
- ke as g,
4381
- li as h,
4382
- Kl as i,
4383
- we as j,
4384
- js as k,
4385
- rt as l,
4386
- $s as m,
4387
- Ls as n,
4388
- ft as o,
4389
- tl as p,
4390
- Ft as q,
4391
- ks as r,
4392
- As as s,
4393
- Ns as t,
4394
- sl as u,
4395
- Bs as v,
4396
- Vs as w,
4397
- Ws as x,
4398
- Js as y
4399
- };