@jeecg/online 3.5.3-beta2 → 3.5.3-vite4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AuthButtonConfig-2f71787c.mjs +125 -0
- package/AuthButtonTree-d73bccf5.mjs +156 -0
- package/AuthDataConfig-32cf23d2.mjs +212 -0
- package/AuthDataTree-03d62d3f.mjs +139 -0
- package/AuthFieldConfig-b1217a0c.mjs +139 -0
- package/AuthFieldTree-888e04a9.mjs +232 -0
- package/AuthManagerDrawer-f127b8a2.mjs +114 -0
- package/AuthSetterModal-37da78ed.mjs +261 -0
- package/CgformCopyList-3adab58f.mjs +245 -0
- package/CgformModal-6938d8c2.mjs +613 -0
- package/CgreportModal-77ec8c17.mjs +12 -0
- package/CgreportModal.vue_vue_type_script_setup_true_lang-52dcec5e.mjs +567 -0
- package/CheckDictTable-414313f2.mjs +211 -0
- package/CodeFileListModal-4831ce3d.mjs +158 -0
- package/CodeFileViewModal-5990dac4.mjs +244 -0
- package/CodeGeneratorModal-7df9e25d.mjs +234 -0
- package/CustomButtonList-1c9bd859.mjs +363 -0
- package/DBAttributeTable-cd1c41e5.mjs +473 -0
- package/DbToOnlineModal-dc5d2030.mjs +160 -0
- package/DetailForm-e4538e7a.mjs +446 -0
- package/EnhanceJavaModal-7f53d2ca.mjs +260 -0
- package/EnhanceJsHistory-c30805ce.mjs +184 -0
- package/EnhanceJsModal-0b133341.mjs +233 -0
- package/EnhanceSqlModal-33a94c83.mjs +259 -0
- package/ExtendConfigModal-60f2cf86.mjs +111 -0
- package/FieldExtendJsonModal-48f7d67f.mjs +220 -0
- package/FileSelectModal-64aaf623.mjs +91 -0
- package/ForeignKeyTable-cb1abd1d.mjs +69 -0
- package/IndexTable-4e94cd1f.mjs +89 -0
- package/JModalTip-abe1515a.mjs +46 -0
- package/JOnlineSearchSelect-5608a5cf.mjs +94 -0
- package/LeftDepart-ca7a7375.mjs +82 -0
- package/LeftRole-d0fa8398.mjs +86 -0
- package/LeftUser-0c88c240.mjs +105 -0
- package/LinkTableConfigModal-77d7c0b9.mjs +230 -0
- package/LinkTableFieldConfigModal-c5689ab0.mjs +178 -0
- package/LinkTableListPiece-34266919.mjs +34 -0
- package/ModalFormDemo-0eeea994.mjs +78 -0
- package/OnlCgformErpList-7a0388d8.mjs +425 -0
- package/OnlCgformErpSubTable-fc6ade76.mjs +388 -0
- package/OnlineAutoList-85e6a30d.mjs +472 -0
- package/OnlineAutoModal-2a146238.mjs +206 -0
- package/OnlineAutoTreeList-f8d0e100.mjs +495 -0
- package/OnlineCustomModal-456a85a6.mjs +227 -0
- package/OnlineDetailModal-f967f080.mjs +177 -0
- package/OnlineForm-630a22c2.mjs +778 -0
- package/OnlineFormDetail-1b216792.mjs +296 -0
- package/OnlineQueryForm-1c5949a7.mjs +378 -0
- package/OnlineSearchFormItem-7c2ea9ed.mjs +352 -0
- package/OnlineSelectCascade-c7baf52b.mjs +160 -0
- package/OnlineSubFormDetail-0aa4966c.mjs +140 -0
- package/PageAttributeTable-811185fd.mjs +404 -0
- package/ProcessOnlineForm-27be6f6f.mjs +177 -0
- package/QueryTable-4ba771ef.mjs +115 -0
- package/SuperQuery-3821f984.mjs +845 -0
- package/SuperQueryValComponent-471110b5.mjs +8 -0
- package/SuperQueryValComponent.vue_vue_type_script_lang-e3ad7ee8.mjs +101 -0
- package/auth.api-d3a6c4b3.mjs +39 -0
- package/auth.data-8be5c9e3.mjs +141 -0
- package/{cgform.data.js → cgform.data-cbdd88c3.mjs} +93 -62
- package/constant-fe20103a.mjs +6 -0
- package/enhance.api-138e6826.mjs +104 -0
- package/enhance.data-efc7e155.mjs +175 -0
- package/index-074b92e5.mjs +236 -0
- package/index-6a09a912.mjs +58 -0
- package/index-9d32ae88.mjs +313 -0
- package/main.index.js +7 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/useCgformList-2d6a5955.mjs +388 -0
- package/useExtendComponent-48d37d9b.mjs +3919 -0
- package/useListButton-cef1371a.mjs +656 -0
- package/useOnlinePopEvent-e9a042f8.mjs +19 -0
- package/useOnlineTest-0df0ae86.mjs +43 -0
- package/useSchemas-fc8d97ce.mjs +669 -0
- package/useTableSync-dc333087.mjs +83 -0
- package/AuthButtonConfig.js +0 -147
- package/AuthButtonTree.js +0 -183
- package/AuthDataConfig.js +0 -246
- package/AuthDataTree.js +0 -160
- package/AuthFieldConfig.js +0 -170
- package/AuthFieldTree.js +0 -281
- package/AuthManagerDrawer.js +0 -125
- package/AuthSetterModal.js +0 -316
- package/CgformCopyList.js +0 -266
- package/CgformModal.js +0 -780
- package/CgreportModal.js +0 -667
- package/CheckDictTable.js +0 -242
- package/CodeFileListModal.js +0 -175
- package/CodeFileViewModal.js +0 -325
- package/CodeGeneratorModal.js +0 -297
- package/CustomButtonList.js +0 -410
- package/DBAttributeTable.js +0 -526
- package/DbToOnlineModal.js +0 -192
- package/DetailForm.js +0 -608
- package/EnhanceJavaModal.js +0 -298
- package/EnhanceJsHistory.js +0 -229
- package/EnhanceJsModal.js +0 -293
- package/EnhanceSqlModal.js +0 -299
- package/ExtendConfigModal.js +0 -151
- package/FieldExtendJsonModal.js +0 -283
- package/FileSelectModal.js +0 -102
- package/ForeignKeyTable.js +0 -79
- package/IndexTable.js +0 -97
- package/JModalTip.js +0 -54
- package/JOnlineSearchSelect.js +0 -115
- package/LICENSE +0 -9
- package/LeftDepart.js +0 -96
- package/LeftRole.js +0 -98
- package/LeftUser.js +0 -117
- package/LinkTableConfigModal.js +0 -289
- package/LinkTableFieldConfigModal.js +0 -218
- package/LinkTableListPiece.js +0 -36
- package/ModalFormDemo.js +0 -85
- package/OnlineAutoList.js +0 -524
- package/OnlineAutoModal.js +0 -226
- package/OnlineAutoTreeList.js +0 -553
- package/OnlineCustomModal.js +0 -286
- package/OnlineDetailModal.js +0 -190
- package/OnlineForm.js +0 -1018
- package/OnlineFormDetail.js +0 -347
- package/OnlineQueryForm.js +0 -484
- package/OnlineSearchFormItem.js +0 -436
- package/OnlineSelectCascade.js +0 -228
- package/OnlineSubFormDetail.js +0 -166
- package/PageAttributeTable.js +0 -486
- package/ProcessOnlineForm.js +0 -208
- package/QueryTable.js +0 -129
- package/SuperQuery.js +0 -1021
- package/SuperQueryValComponent.js +0 -9
- package/SuperQueryValComponent.vue_vue_type_script_lang.js +0 -162
- package/_arrayPush.js +0 -278
- package/_baseClone.js +0 -471
- package/_baseSlice.js +0 -18
- package/_commonjsHelpers.js +0 -5
- package/_flatRest.js +0 -174
- package/auth.api.js +0 -43
- package/auth.data.js +0 -142
- package/clipboard.js +0 -565
- package/enhance.api.js +0 -129
- package/enhance.data.js +0 -196
- package/index.js +0 -87
- package/index2.js +0 -340
- package/index3.js +0 -264
- package/isArray.js +0 -47
- package/omit.js +0 -60
- package/pick.js +0 -68
- package/toString.js +0 -31
- package/useCgformList.js +0 -470
- package/useExtendComponent.js +0 -5205
- package/useListButton.js +0 -923
- package/useOnlineTest.js +0 -44
- package/useSchemas.js +0 -653
- package/useTableSync.js +0 -117
|
@@ -0,0 +1,3919 @@
|
|
|
1
|
+
var je = Object.defineProperty, We = Object.defineProperties;
|
|
2
|
+
var Je = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var ve = Object.getOwnPropertySymbols;
|
|
4
|
+
var He = Object.prototype.hasOwnProperty, Ue = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var Te = (n, e, t) => e in n ? je(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, ne = (n, e) => {
|
|
6
|
+
for (var t in e || (e = {}))
|
|
7
|
+
He.call(e, t) && Te(n, t, e[t]);
|
|
8
|
+
if (ve)
|
|
9
|
+
for (var t of ve(e))
|
|
10
|
+
Ue.call(e, t) && Te(n, t, e[t]);
|
|
11
|
+
return n;
|
|
12
|
+
}, pe = (n, e) => We(n, Je(e));
|
|
13
|
+
var J = (n, e, t) => new Promise((o, b) => {
|
|
14
|
+
var i = (g) => {
|
|
15
|
+
try {
|
|
16
|
+
v(t.next(g));
|
|
17
|
+
} catch (P) {
|
|
18
|
+
b(P);
|
|
19
|
+
}
|
|
20
|
+
}, a = (g) => {
|
|
21
|
+
try {
|
|
22
|
+
v(t.throw(g));
|
|
23
|
+
} catch (P) {
|
|
24
|
+
b(P);
|
|
25
|
+
}
|
|
26
|
+
}, v = (g) => g.done ? o(g.value) : Promise.resolve(g.value).then(i, a);
|
|
27
|
+
v((t = t.apply(n, e)).next());
|
|
28
|
+
});
|
|
29
|
+
import { add } from "/@/components/Form/src/componentMap";
|
|
30
|
+
import { propTypes } from "/@/utils/propTypes";
|
|
31
|
+
import { ref, reactive, watch, toRaw, computed, nextTick, resolveComponent, openBlock, createBlock, unref, createElementBlock, createVNode, defineComponent, h, mergeProps, withCtx, createTextVNode, toDisplayString, createCommentVNode, watchEffect, createElementVNode, Fragment, renderList, markRaw, defineAsyncComponent, normalizeClass } from "vue";
|
|
32
|
+
import { PrinterOutlined, DiffOutlined, FormOutlined, PlusOutlined, EditOutlined, MinusCircleFilled } from "@ant-design/icons-vue";
|
|
33
|
+
import { useModal, useModalInner, BasicModal } from "/@/components/Modal";
|
|
34
|
+
import { useMessage } from "/@/hooks/web/useMessage";
|
|
35
|
+
import { BasicForm, useForm } from "/@/components/Form/index";
|
|
36
|
+
import { defHttp } from "/@/utils/http/axios";
|
|
37
|
+
import { pick } from "lodash-es";
|
|
38
|
+
import { UploadTypeEnum } from "/@/components/Form/src/jeecg/components/JUpload";
|
|
39
|
+
import { duplicateCheck } from "/@/views/system/user/user.api";
|
|
40
|
+
import { useUserStore } from "/@/store/modules/user";
|
|
41
|
+
import { replaceAll, goJmReportViewPage, importViewsFile } from "/@/utils";
|
|
42
|
+
import * as CustomExpression from "/@/utils/desform/customExpression";
|
|
43
|
+
import { usePermissionStore } from "/@/store/modules/permission";
|
|
44
|
+
import { filterMultiDictText } from "/@/utils/dict/JDictSelectUtil";
|
|
45
|
+
import { getFileAccessHttpUrl } from "/@/utils/common/compUtils";
|
|
46
|
+
import { BasicTable, TableAction } from "/@/components/Table";
|
|
47
|
+
import { useListPage } from "/@/hooks/system/useListPage";
|
|
48
|
+
import { useRouter } from "vue-router";
|
|
49
|
+
import { getAreaTextByCode } from "/@/components/Form/src/utils/Area";
|
|
50
|
+
import { createImgPreview } from "/@/components/Preview/index";
|
|
51
|
+
import LinkTableListPiece from "./LinkTableListPiece-34266919.mjs";
|
|
52
|
+
import { _ as _export_sfc } from "./index-6a09a912.mjs";
|
|
53
|
+
import OnlineSelectCascade from "./OnlineSelectCascade-c7baf52b.mjs";
|
|
54
|
+
import { Loading } from "/@/components/Loading";
|
|
55
|
+
import { getToken } from "/@/utils/auth";
|
|
56
|
+
import JModalTip from "./JModalTip-abe1515a.mjs";
|
|
57
|
+
import { Button } from "ant-design-vue";
|
|
58
|
+
import { useDebounceFn } from "@vueuse/core";
|
|
59
|
+
const SUBMIT_FLOW_KEY = "jeecg_submit_form_and_flow", SUBMIT_FLOW_ID = "flow_submit_id", ONL_FORM_TABLE_NAME = "online_form_table_name", VALIDATE_FAILED = "validate-failed", SETUP = "setup", ENHANCEJS = "EnhanceJS", FORM_VIEW_TO_QUERY_VIEW = {
|
|
60
|
+
password: "text",
|
|
61
|
+
file: "text",
|
|
62
|
+
image: "text",
|
|
63
|
+
textarea: "text",
|
|
64
|
+
umeditor: "text",
|
|
65
|
+
markdown: "text",
|
|
66
|
+
checkbox: "list_multi",
|
|
67
|
+
radio: "list"
|
|
68
|
+
}, POP_CONTAINER = ".jeecg-online-modal .ant-modal-content", ONL_AUTH_PRE = "online_";
|
|
69
|
+
class IFormSchema {
|
|
70
|
+
constructor(e, t) {
|
|
71
|
+
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 = 4, this.initLabelLength();
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 获取最终的表单配置项,外面获取调用此方法
|
|
75
|
+
*/
|
|
76
|
+
getFormItemSchema() {
|
|
77
|
+
let e = this.getItem();
|
|
78
|
+
return this.addDefaultChangeEvent(e), e;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 获取表单配置,子类重写此方法
|
|
82
|
+
*/
|
|
83
|
+
getItem() {
|
|
84
|
+
let e = {
|
|
85
|
+
field: this.field,
|
|
86
|
+
label: this.label,
|
|
87
|
+
labelLength: this.labelLength,
|
|
88
|
+
component: "Input",
|
|
89
|
+
itemProps: {
|
|
90
|
+
labelCol: {
|
|
91
|
+
class: "online-form-label"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}, t = this.getRule();
|
|
95
|
+
return t.length > 0 && this.onlyValidator && (e.rules = t), this.hidden === !0 && (e.show = !1), e;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* 设置表单ref
|
|
99
|
+
* popup、分类树需要关联设置其他表单值的时候用到
|
|
100
|
+
* @param ref
|
|
101
|
+
*/
|
|
102
|
+
setFormRef(e) {
|
|
103
|
+
this.formRef = e;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* 设置表单元素隐藏
|
|
107
|
+
*/
|
|
108
|
+
isHidden() {
|
|
109
|
+
return this.hidden = !0, this;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* 设置是否必填项
|
|
113
|
+
* @param array
|
|
114
|
+
*/
|
|
115
|
+
isRequired(e) {
|
|
116
|
+
return e && e.length > 0 && e.indexOf(this.field) >= 0 && (this.required = !0), this;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* 初始化 label长度
|
|
120
|
+
*/
|
|
121
|
+
initLabelLength() {
|
|
122
|
+
let e = this.getExtendData();
|
|
123
|
+
e && e.labelLength && (this.labelLength = e.labelLength);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* 获取扩展参数
|
|
127
|
+
*/
|
|
128
|
+
getExtendData() {
|
|
129
|
+
let e = {}, { fieldExtendJson: t } = this._data;
|
|
130
|
+
if (t && typeof t == "string")
|
|
131
|
+
try {
|
|
132
|
+
let o = JSON.parse(t);
|
|
133
|
+
e = ne({}, o);
|
|
134
|
+
} catch (o) {
|
|
135
|
+
console.error(o);
|
|
136
|
+
}
|
|
137
|
+
return e;
|
|
138
|
+
}
|
|
139
|
+
/***
|
|
140
|
+
* 获取和此字段相关的其他字段 需要设置其为隐藏
|
|
141
|
+
*/
|
|
142
|
+
getRelatedHideFields() {
|
|
143
|
+
return [];
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* placeholder
|
|
147
|
+
*/
|
|
148
|
+
getPlaceholder() {
|
|
149
|
+
return "请输入" + this.label;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* 唯一校验
|
|
153
|
+
*/
|
|
154
|
+
setOnlyValidateFun(e) {
|
|
155
|
+
e && (this.onlyValidator = (t, o) => J(this, null, function* () {
|
|
156
|
+
let b = yield e(t, o);
|
|
157
|
+
return b ? Promise.reject(b) : Promise.resolve();
|
|
158
|
+
}));
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* 获取校验规则
|
|
162
|
+
*/
|
|
163
|
+
getRule() {
|
|
164
|
+
let e = [];
|
|
165
|
+
const { view: t, errorInfo: o, pattern: b, type: i } = this._data;
|
|
166
|
+
if (this.required === !0) {
|
|
167
|
+
let a = this.getPlaceholder();
|
|
168
|
+
o && (a = o), t == "sel_depart" || t == "sel_user" ? this.schemaProp.required = !0 : e.push({ required: !0, message: a });
|
|
169
|
+
}
|
|
170
|
+
if (t == "sel_user" && b === "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)
|
|
171
|
+
return e;
|
|
172
|
+
if (b)
|
|
173
|
+
if (b === "only")
|
|
174
|
+
this.onlyValidator && e.push({ validator: this.onlyValidator });
|
|
175
|
+
else if (b === "z")
|
|
176
|
+
i == "number" || i == "integer" || e.push({ pattern: /^-?\d+$/, message: "请输入整数" });
|
|
177
|
+
else {
|
|
178
|
+
let a = o || "正则表达式不正确";
|
|
179
|
+
e.push({ pattern: b, message: a });
|
|
180
|
+
}
|
|
181
|
+
return e;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* 添加默认的change事件
|
|
185
|
+
* @param schema
|
|
186
|
+
*/
|
|
187
|
+
addDefaultChangeEvent(e) {
|
|
188
|
+
this.hasChange && (e.componentProps || (e.componentProps = {}), this.disabled == !0 && (e.componentProps.disabled = !0), e.componentProps.hasOwnProperty("onChange") || (e.componentProps.onChange = (t, o) => {
|
|
189
|
+
t instanceof Event && (t = t.target.value), t instanceof Array && (t = t.join(",")), !this.formRef || !this.formRef.value || !this.formRef.value.$formValueChange ? console.log("当前表单无法触发change事件,field:" + this.field) : this.formRef.value.$formValueChange(this.field, t, o);
|
|
190
|
+
})), Object.keys(this.schemaProp).map((t) => {
|
|
191
|
+
e[t] = this.schemaProp[t];
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
noChange() {
|
|
195
|
+
this.hasChange = !1;
|
|
196
|
+
}
|
|
197
|
+
updateField(e) {
|
|
198
|
+
this.field = e;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* 高级查询 没有表单ref对象 手动设置setFieldValue方法用于 popup设置表单值
|
|
202
|
+
*/
|
|
203
|
+
setFunctionForFieldValue(e) {
|
|
204
|
+
e && (this.setFieldsValue = e);
|
|
205
|
+
}
|
|
206
|
+
asSearchForm() {
|
|
207
|
+
this.searchForm = !0;
|
|
208
|
+
}
|
|
209
|
+
/**获取modal作为类下拉组件pop的父容器*/
|
|
210
|
+
getModalAsContainer() {
|
|
211
|
+
let e = this.getPopContainer();
|
|
212
|
+
return document.querySelector(e);
|
|
213
|
+
}
|
|
214
|
+
/**区分modal表单和查询表单*/
|
|
215
|
+
getPopContainer() {
|
|
216
|
+
return this.searchForm === !0 ? "body" : this.inPopover === !0 ? `.${this.popContainer}` : this.popContainer ? `.${this.popContainer} .ant-modal-content` : POP_CONTAINER;
|
|
217
|
+
}
|
|
218
|
+
handleWidgetAttr(e) {
|
|
219
|
+
e.ui && e.ui.widgetattrs && e.ui.widgetattrs.disabled == !0 && (this.disabled = !0);
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* 设置 popContainer
|
|
223
|
+
*/
|
|
224
|
+
setCustomPopContainer(e) {
|
|
225
|
+
this.popContainer = e;
|
|
226
|
+
}
|
|
227
|
+
//update-begin-author:taoyan date:2022-8-5 for: 他表字段/关联记录用
|
|
228
|
+
// 获取他表字段的 配置信息
|
|
229
|
+
getLinkFieldInfo() {
|
|
230
|
+
return "";
|
|
231
|
+
}
|
|
232
|
+
// 1.将他表字段的配置信息设置到关联记录字段上
|
|
233
|
+
setOtherInfo(e) {
|
|
234
|
+
}
|
|
235
|
+
//update-end-author:taoyan date:2022-8-5 for: 他表字段/关联记录用
|
|
236
|
+
// 表单设计器高级查询用
|
|
237
|
+
isInPopover() {
|
|
238
|
+
this.inPopover = !0;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
class InputWidget extends IFormSchema {
|
|
242
|
+
getItem() {
|
|
243
|
+
let e = super.getItem();
|
|
244
|
+
return this.hidden === !0 && (e.show = !1), e;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
var DateFormat = /* @__PURE__ */ ((n) => (n.datetime = "YYYY-MM-DD HH:mm:ss", n.date = "YYYY-MM-DD", n))(DateFormat || {});
|
|
248
|
+
class DateWidget extends IFormSchema {
|
|
249
|
+
constructor(e, t) {
|
|
250
|
+
super(e, t), this.format = DateFormat[t.view], this.showTime = t.view != "date";
|
|
251
|
+
}
|
|
252
|
+
getItem() {
|
|
253
|
+
let e = super.getItem();
|
|
254
|
+
return Object.assign({}, e, {
|
|
255
|
+
component: "DatePicker",
|
|
256
|
+
componentProps: {
|
|
257
|
+
placeholder: `请选择${this.label}`,
|
|
258
|
+
showTime: this.showTime,
|
|
259
|
+
valueFormat: this.format,
|
|
260
|
+
style: {
|
|
261
|
+
width: "100%"
|
|
262
|
+
},
|
|
263
|
+
getPopupContainer: (t) => this.getModalAsContainer()
|
|
264
|
+
}
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
class SelectWidget extends IFormSchema {
|
|
269
|
+
constructor(e, t) {
|
|
270
|
+
super(e, 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;
|
|
271
|
+
}
|
|
272
|
+
getItem() {
|
|
273
|
+
let e = super.getItem(), t = this.getFormComponent(), o = this.getComponentProps();
|
|
274
|
+
return Object.assign({}, e, {
|
|
275
|
+
component: t,
|
|
276
|
+
componentProps: o
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
getFormComponent() {
|
|
280
|
+
return this.options.length > 0 ? "Select" : "JDictSelectTag";
|
|
281
|
+
}
|
|
282
|
+
getComponentProps() {
|
|
283
|
+
let t = {
|
|
284
|
+
allowClear: !0,
|
|
285
|
+
mode: this.multi === !0 ? "multiple" : "combobox",
|
|
286
|
+
style: {
|
|
287
|
+
width: "100%"
|
|
288
|
+
},
|
|
289
|
+
getPopupContainer: (o) => this.getModalAsContainer()
|
|
290
|
+
};
|
|
291
|
+
if (this.options.length > 0)
|
|
292
|
+
t.options = this.options;
|
|
293
|
+
else if (!this.dictTable)
|
|
294
|
+
t.dictCode = this.dictCode;
|
|
295
|
+
else {
|
|
296
|
+
let o = `${this.dictTable},${this.dictText},${this.dictCode}`;
|
|
297
|
+
t.dictCode = encodeURI(o);
|
|
298
|
+
}
|
|
299
|
+
return t;
|
|
300
|
+
}
|
|
301
|
+
getOptions(e, t) {
|
|
302
|
+
if (!e || e.length == 0)
|
|
303
|
+
return [];
|
|
304
|
+
let o = t == "number", b = [];
|
|
305
|
+
for (let i of e) {
|
|
306
|
+
let a = i.value;
|
|
307
|
+
o && (a = parseInt(a)), b.push({
|
|
308
|
+
value: a,
|
|
309
|
+
label: i.title
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
return b;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
class PasswordWidget extends IFormSchema {
|
|
316
|
+
getItem() {
|
|
317
|
+
let e = super.getItem();
|
|
318
|
+
return Object.assign({}, e, {
|
|
319
|
+
component: "InputPassword"
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
class FileWidget extends IFormSchema {
|
|
324
|
+
getItem() {
|
|
325
|
+
let e = super.getItem(), t = this.getComponentProps();
|
|
326
|
+
return Object.assign({}, e, {
|
|
327
|
+
component: "JUpload",
|
|
328
|
+
componentProps: t
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
getComponentProps() {
|
|
332
|
+
let e = this.getExtendData();
|
|
333
|
+
return e && e.uploadnum ? {
|
|
334
|
+
maxCount: Number(e.uploadnum)
|
|
335
|
+
} : {};
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
class ImageWidget extends IFormSchema {
|
|
339
|
+
getItem() {
|
|
340
|
+
let e = super.getItem(), t = this.getComponentProps();
|
|
341
|
+
return Object.assign({}, e, {
|
|
342
|
+
component: "JUpload",
|
|
343
|
+
componentProps: t
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
getComponentProps() {
|
|
347
|
+
let e = {
|
|
348
|
+
fileType: UploadTypeEnum.image
|
|
349
|
+
}, t = this.getExtendData();
|
|
350
|
+
return t && t.uploadnum && (e.maxCount = Number(t.uploadnum)), e;
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
class TextAreaWidget extends IFormSchema {
|
|
354
|
+
getItem() {
|
|
355
|
+
let e = super.getItem();
|
|
356
|
+
return Object.assign({}, e, {
|
|
357
|
+
component: "InputTextArea",
|
|
358
|
+
componentProps: {
|
|
359
|
+
autoSize: {
|
|
360
|
+
minRows: 4,
|
|
361
|
+
maxRows: 10
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
class SelectMultiWidget extends IFormSchema {
|
|
368
|
+
constructor(e, t) {
|
|
369
|
+
super(e, t), this.dictTable = t.dictTable, this.dictText = t.dictText, this.dictCode = t.dictCode;
|
|
370
|
+
}
|
|
371
|
+
getItem() {
|
|
372
|
+
let e = super.getItem(), t = this.getComponentProps();
|
|
373
|
+
return Object.assign({}, e, {
|
|
374
|
+
component: "JSelectMultiple",
|
|
375
|
+
componentProps: t
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
getComponentProps() {
|
|
379
|
+
if (!this.dictTable && !this.dictCode)
|
|
380
|
+
return {};
|
|
381
|
+
{
|
|
382
|
+
let e = {};
|
|
383
|
+
if (!this.dictTable)
|
|
384
|
+
e.dictCode = this.dictCode;
|
|
385
|
+
else {
|
|
386
|
+
let t = `${this.dictTable},${this.dictText},${this.dictCode}`;
|
|
387
|
+
e.dictCode = encodeURI(t);
|
|
388
|
+
}
|
|
389
|
+
return e.triggerChange = !0, e.popContainer = this.getPopContainer(), e;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
class SelectSearchWidget extends IFormSchema {
|
|
394
|
+
constructor(e, t) {
|
|
395
|
+
super(e, t), this.dict = encodeURI(`${t.dictTable},${t.dictText},${t.dictCode}`);
|
|
396
|
+
}
|
|
397
|
+
getItem() {
|
|
398
|
+
let e = super.getItem(), t = this.getPopContainer();
|
|
399
|
+
return Object.assign({}, e, {
|
|
400
|
+
component: "JSearchSelect",
|
|
401
|
+
componentProps: {
|
|
402
|
+
dict: this.dict,
|
|
403
|
+
pageSize: 6,
|
|
404
|
+
async: !0,
|
|
405
|
+
popContainer: t
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
class PopupWidget extends IFormSchema {
|
|
411
|
+
constructor(e, t) {
|
|
412
|
+
super(e, t), this.code = t.code, this.multi = t.popupMulti, this.fieldConfig = this.getFieldConfig(t);
|
|
413
|
+
}
|
|
414
|
+
getItem() {
|
|
415
|
+
let e = super.getItem(), t = this.getComponentProps();
|
|
416
|
+
return Object.assign({}, e, {
|
|
417
|
+
component: "JPopup",
|
|
418
|
+
componentProps: t
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
getComponentProps() {
|
|
422
|
+
let e = {
|
|
423
|
+
code: this.code,
|
|
424
|
+
multi: this.multi,
|
|
425
|
+
fieldConfig: this.fieldConfig
|
|
426
|
+
};
|
|
427
|
+
return this.formRef ? e.formElRef = this.formRef : e.setFieldsValue = this.setFieldsValue, this.inPopover === !0 && (e.getContainer = () => this.getModalAsContainer()), e;
|
|
428
|
+
}
|
|
429
|
+
getFieldConfig(e) {
|
|
430
|
+
let { destFields: t, orgFields: o } = e;
|
|
431
|
+
if (!t || t.length == 0)
|
|
432
|
+
return [];
|
|
433
|
+
let b = t.split(","), i = o.split(","), a = [];
|
|
434
|
+
const v = this.pre;
|
|
435
|
+
for (let g = 0; g < b.length; g++)
|
|
436
|
+
a.push({
|
|
437
|
+
target: v + b[g],
|
|
438
|
+
source: i[g]
|
|
439
|
+
});
|
|
440
|
+
return a;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
class TreeCategoryWidget extends IFormSchema {
|
|
444
|
+
constructor(e, t) {
|
|
445
|
+
super(e, t), this.multi = !1, this.pid = t.pidValue, this.pcode = t.pcode, this.textField = t.textField;
|
|
446
|
+
}
|
|
447
|
+
getItem() {
|
|
448
|
+
let e = super.getItem(), t = this.getComponentProps();
|
|
449
|
+
return Object.assign({}, e, {
|
|
450
|
+
componentProps: t,
|
|
451
|
+
component: "JCategorySelect"
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* 1. 不带返回值的
|
|
456
|
+
* 2. 带文本返回的
|
|
457
|
+
*/
|
|
458
|
+
getComponentProps() {
|
|
459
|
+
let e = {
|
|
460
|
+
placeholder: "请选择" + this.label
|
|
461
|
+
};
|
|
462
|
+
if (this.pcode)
|
|
463
|
+
e.pcode = this.pcode;
|
|
464
|
+
else {
|
|
465
|
+
let t = this.pid || "EMPTY_PID";
|
|
466
|
+
e.pid = t;
|
|
467
|
+
}
|
|
468
|
+
return this.textField ? pe(ne({
|
|
469
|
+
loadTriggleChange: !0,
|
|
470
|
+
multiple: this.multi
|
|
471
|
+
}, e), {
|
|
472
|
+
back: this.textField,
|
|
473
|
+
onChange: (t, o) => {
|
|
474
|
+
this.formRef && (this.formRef.value.setFieldsValue(o), this.formRef.value.$formValueChange(this.field, t));
|
|
475
|
+
}
|
|
476
|
+
}) : ne({
|
|
477
|
+
multiple: this.multi
|
|
478
|
+
}, e);
|
|
479
|
+
}
|
|
480
|
+
getRelatedHideFields() {
|
|
481
|
+
let e = [];
|
|
482
|
+
return this.textField && e.push(this.textField), e;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
class SelectDepartWidget extends IFormSchema {
|
|
486
|
+
getItem() {
|
|
487
|
+
let e = super.getItem(), t = this.getComponentProps();
|
|
488
|
+
return Object.assign({}, e, {
|
|
489
|
+
component: "JSelectDept",
|
|
490
|
+
componentProps: t
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
getComponentProps() {
|
|
494
|
+
let e = this.getExtendData(), t = {
|
|
495
|
+
checkStrictly: !0,
|
|
496
|
+
showButton: !1
|
|
497
|
+
};
|
|
498
|
+
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), this.inPopover === !0 && (t.getContainer = () => this.getModalAsContainer()), t;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
class SelectUserWidget extends IFormSchema {
|
|
502
|
+
constructor(e, t) {
|
|
503
|
+
super(e, t), this.showButton = t.showButton !== !1;
|
|
504
|
+
}
|
|
505
|
+
getItem() {
|
|
506
|
+
let e = super.getItem(), t = this.getComponentProps();
|
|
507
|
+
return Object.assign({}, e, {
|
|
508
|
+
component: "JSelectUser",
|
|
509
|
+
componentProps: t
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
getComponentProps() {
|
|
513
|
+
let e = this.getExtendData(), t = {
|
|
514
|
+
showSelected: !1,
|
|
515
|
+
allowClear: !0,
|
|
516
|
+
isRadioSelection: !1,
|
|
517
|
+
showButton: this.showButton
|
|
518
|
+
};
|
|
519
|
+
return e.text && (t.labelKey = e.text), e.store && (t.rowKey = e.store), e.multiSelect === !1 && (t.isRadioSelection = !0), this.inPopover === !0 && (t.getContainer = () => this.getModalAsContainer()), t;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
class EditorWidget extends IFormSchema {
|
|
523
|
+
getItem() {
|
|
524
|
+
let e = super.getItem();
|
|
525
|
+
return Object.assign({}, e, {
|
|
526
|
+
component: "JEditor",
|
|
527
|
+
componentProps: {
|
|
528
|
+
//update-begin-author:taoyan date:2022-6-1 for: VUEN-1159 第一次加载时,点击第一个输入框,光标会跑到富文本输入框
|
|
529
|
+
options: {
|
|
530
|
+
auto_focus: !1
|
|
531
|
+
}
|
|
532
|
+
//update-end-author:taoyan date:2022-6-1 for: VUEN-1159 第一次加载时,点击第一个输入框,光标会跑到富文本输入框
|
|
533
|
+
// fileMax:1,
|
|
534
|
+
// showImageUpload:false,
|
|
535
|
+
// width:"966px",
|
|
536
|
+
// height:"200px"
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
class MarkdownWidget extends IFormSchema {
|
|
542
|
+
getItem() {
|
|
543
|
+
let e = super.getItem();
|
|
544
|
+
return Object.assign({}, e, {
|
|
545
|
+
component: "JMarkdownEditor",
|
|
546
|
+
componentProps: {
|
|
547
|
+
// height: 300,
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
class PcaWidget extends IFormSchema {
|
|
553
|
+
getItem() {
|
|
554
|
+
let e = super.getItem();
|
|
555
|
+
return Object.assign({}, e, {
|
|
556
|
+
component: "JAreaSelect"
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
class TreeSelectWidget extends IFormSchema {
|
|
561
|
+
constructor(e, t) {
|
|
562
|
+
super(e, t), this.dict = t.dict, this.pidField = t.pidField, this.pidValue = t.pidValue;
|
|
563
|
+
}
|
|
564
|
+
getItem() {
|
|
565
|
+
let e = super.getItem();
|
|
566
|
+
return Object.assign({}, e, {
|
|
567
|
+
component: "JTreeSelect",
|
|
568
|
+
componentProps: {
|
|
569
|
+
dict: this.dict,
|
|
570
|
+
pidField: this.pidField,
|
|
571
|
+
pidValue: this.pidValue
|
|
572
|
+
}
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
class RadioWidget extends IFormSchema {
|
|
577
|
+
constructor(e, t) {
|
|
578
|
+
super(e, t), this.dictTable = t.dictTable, this.dictText = t.dictText, this.dictCode = t.dictCode;
|
|
579
|
+
}
|
|
580
|
+
getItem() {
|
|
581
|
+
let e = super.getItem(), t = this.getComponentProps();
|
|
582
|
+
return Object.assign({}, e, {
|
|
583
|
+
component: "JDictSelectTag",
|
|
584
|
+
componentProps: t
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
getComponentProps() {
|
|
588
|
+
if (!this.dictTable && !this.dictCode)
|
|
589
|
+
return {};
|
|
590
|
+
if (this.dictTable) {
|
|
591
|
+
let e = `${this.dictTable},${this.dictText},${this.dictCode}`;
|
|
592
|
+
return {
|
|
593
|
+
dictCode: encodeURI(e),
|
|
594
|
+
type: "radio"
|
|
595
|
+
};
|
|
596
|
+
} else
|
|
597
|
+
return {
|
|
598
|
+
dictCode: this.dictCode,
|
|
599
|
+
type: "radio"
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
class CheckboxWidget extends IFormSchema {
|
|
604
|
+
constructor(e, t) {
|
|
605
|
+
super(e, t), this.options = this.getOptions(t.enum);
|
|
606
|
+
}
|
|
607
|
+
getItem() {
|
|
608
|
+
let e = super.getItem();
|
|
609
|
+
return Object.assign({}, e, {
|
|
610
|
+
component: "JCheckbox",
|
|
611
|
+
componentProps: {
|
|
612
|
+
options: this.options,
|
|
613
|
+
triggerChange: !0
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
getOptions(e) {
|
|
618
|
+
if (!e || e.length == 0)
|
|
619
|
+
return [];
|
|
620
|
+
let t = [];
|
|
621
|
+
for (let o of e)
|
|
622
|
+
t.push({
|
|
623
|
+
value: o.value,
|
|
624
|
+
label: o.title
|
|
625
|
+
});
|
|
626
|
+
return t;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
class SwitchWidget extends IFormSchema {
|
|
630
|
+
constructor(e, t) {
|
|
631
|
+
super(e, t), this.hasChange = !1;
|
|
632
|
+
}
|
|
633
|
+
getItem() {
|
|
634
|
+
let e = super.getItem(), t = this.getComponentProps();
|
|
635
|
+
return Object.assign({}, e, {
|
|
636
|
+
component: "JSwitch",
|
|
637
|
+
componentProps: t
|
|
638
|
+
});
|
|
639
|
+
}
|
|
640
|
+
getComponentProps() {
|
|
641
|
+
let { fieldExtendJson: e } = this._data, t = ["Y", "N"];
|
|
642
|
+
if (e && typeof e == "string") {
|
|
643
|
+
let o = JSON.parse(e);
|
|
644
|
+
o.length == 2 && (t = o);
|
|
645
|
+
}
|
|
646
|
+
return {
|
|
647
|
+
options: t
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
class TimeWidget extends IFormSchema {
|
|
652
|
+
getItem() {
|
|
653
|
+
let e = super.getItem();
|
|
654
|
+
return Object.assign({}, e, {
|
|
655
|
+
component: "TimePicker",
|
|
656
|
+
componentProps: {
|
|
657
|
+
placeholder: `请选择${this.label}`,
|
|
658
|
+
valueFormat: "HH:mm:ss",
|
|
659
|
+
getPopupContainer: (t) => this.getModalAsContainer(),
|
|
660
|
+
style: {
|
|
661
|
+
width: "100%"
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
class LinkDownWidget extends IFormSchema {
|
|
668
|
+
constructor(e, t) {
|
|
669
|
+
super(e, t);
|
|
670
|
+
const { dictTable: o, dictText: b, dictCode: i, pidField: a, idField: v, origin: g, condition: P } = t;
|
|
671
|
+
this.table = o, this.txt = b, this.store = i, this.idField = v, this.pidField = a, this.origin = g, this.condition = P, this.options = [], this.next = t.next || "", this.type = t.type;
|
|
672
|
+
}
|
|
673
|
+
getItem() {
|
|
674
|
+
let e = super.getItem(), t = this.getComponentProps();
|
|
675
|
+
return Object.assign({}, e, {
|
|
676
|
+
component: "OnlineSelectCascade",
|
|
677
|
+
componentProps: t
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
getComponentProps() {
|
|
681
|
+
let e = {
|
|
682
|
+
table: this.table,
|
|
683
|
+
txt: this.txt,
|
|
684
|
+
store: this.store,
|
|
685
|
+
pidField: this.pidField,
|
|
686
|
+
idField: this.idField,
|
|
687
|
+
origin: this.origin,
|
|
688
|
+
pidValue: "-1",
|
|
689
|
+
style: {
|
|
690
|
+
width: "100%"
|
|
691
|
+
},
|
|
692
|
+
onChange: (t) => {
|
|
693
|
+
console.log("级联组件-onChange", t), this.valueChange(t);
|
|
694
|
+
},
|
|
695
|
+
onNext: (t) => {
|
|
696
|
+
console.log("级联组件-onNext", t), this.nextOptionsChange(t);
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
return this._data.origin === !0 && (e.condition = this.condition), e;
|
|
700
|
+
}
|
|
701
|
+
nextOptionsChange(e) {
|
|
702
|
+
return J(this, null, function* () {
|
|
703
|
+
if (!this.formRef) {
|
|
704
|
+
console.error("表单引用找不到");
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
if (!this.next)
|
|
708
|
+
return;
|
|
709
|
+
yield this.formRef.value.updateSchema({
|
|
710
|
+
field: this.next,
|
|
711
|
+
componentProps: {
|
|
712
|
+
pidValue: e
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
valueChange(e) {
|
|
718
|
+
return J(this, null, function* () {
|
|
719
|
+
if (!this.formRef) {
|
|
720
|
+
console.error("表单引用找不到");
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
if (!this.next)
|
|
724
|
+
return;
|
|
725
|
+
let t = this.formRef.value;
|
|
726
|
+
t.$formValueChange(this.field, e), yield t.setFieldsValue({ [this.next]: "" });
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
class SlotWidget extends IFormSchema {
|
|
731
|
+
constructor(e, t) {
|
|
732
|
+
super(e, t), this.slot = "";
|
|
733
|
+
}
|
|
734
|
+
getItem() {
|
|
735
|
+
let e = super.getItem(), t = this.slot;
|
|
736
|
+
return Object.assign({}, e, { slot: t });
|
|
737
|
+
}
|
|
738
|
+
groupDate() {
|
|
739
|
+
return this.slot = "groupDate", this;
|
|
740
|
+
}
|
|
741
|
+
groupDatetime() {
|
|
742
|
+
return this.slot = "groupDatetime", this;
|
|
743
|
+
}
|
|
744
|
+
groupNumber() {
|
|
745
|
+
return this.slot = "groupNumber", this;
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
class NumberWidget extends IFormSchema {
|
|
749
|
+
constructor(e, t) {
|
|
750
|
+
super(e, t), this.dbPointLength = t.dbPointLength;
|
|
751
|
+
}
|
|
752
|
+
getItem() {
|
|
753
|
+
let e = super.getItem(), t = this.getComponentProps();
|
|
754
|
+
return Object.assign({}, e, {
|
|
755
|
+
component: "InputNumber",
|
|
756
|
+
componentProps: t
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
getComponentProps() {
|
|
760
|
+
const e = {
|
|
761
|
+
style: {
|
|
762
|
+
width: "100%"
|
|
763
|
+
}
|
|
764
|
+
};
|
|
765
|
+
return this.dbPointLength >= 0 && (e.precision = this.dbPointLength), e;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
class LinkTableWidget extends IFormSchema {
|
|
769
|
+
constructor(e, t) {
|
|
770
|
+
super(e, t), this.dictTable = t.dictTable, this.dictText = t.dictText, this.dictCode = t.dictCode, this.view = t.view, this.componentString = "", this.linkFields = [];
|
|
771
|
+
}
|
|
772
|
+
getItem() {
|
|
773
|
+
let e = super.getItem();
|
|
774
|
+
const t = this.getComponentProps();
|
|
775
|
+
return Object.assign({}, e, {
|
|
776
|
+
component: this.componentString,
|
|
777
|
+
componentProps: t
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
getComponentProps() {
|
|
781
|
+
let e = {
|
|
782
|
+
textField: this.dictText,
|
|
783
|
+
tableName: this.dictTable,
|
|
784
|
+
valueField: this.dictCode
|
|
785
|
+
}, t = this.getExtendData();
|
|
786
|
+
if (t.multiSelect ? e.multi = !0 : e.multi = !1, t.imageField ? e.imageField = t.imageField : e.imageField = "", t.showType == "select") {
|
|
787
|
+
this.componentString = "LinkTableSelect";
|
|
788
|
+
let o = this.getPopContainer();
|
|
789
|
+
e.popContainer = o;
|
|
790
|
+
} else
|
|
791
|
+
this.componentString = "LinkTableCard";
|
|
792
|
+
return this.linkFields.length > 0 && (e.linkFields = this.linkFields), e;
|
|
793
|
+
}
|
|
794
|
+
// 他表字段用于翻译
|
|
795
|
+
setOtherInfo(e) {
|
|
796
|
+
this.linkFields = e;
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
class LinkTableFieldWidget extends IFormSchema {
|
|
800
|
+
constructor(e, t) {
|
|
801
|
+
super(e, t), this.dictTable = t.dictTable, this.dictText = t.dictText;
|
|
802
|
+
}
|
|
803
|
+
getItem() {
|
|
804
|
+
let e = super.getItem();
|
|
805
|
+
return Object.assign({}, e, {
|
|
806
|
+
componentProps: {
|
|
807
|
+
readOnly: !0,
|
|
808
|
+
allowClear: !1,
|
|
809
|
+
disabled: !0,
|
|
810
|
+
style: {
|
|
811
|
+
background: "none",
|
|
812
|
+
color: "rgba(0, 0, 0, 0.85)",
|
|
813
|
+
border: "none"
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
});
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* 获取他表字段的关联信息
|
|
820
|
+
*/
|
|
821
|
+
getLinkFieldInfo() {
|
|
822
|
+
return [this.dictTable, `${this.field},${this.dictText}`];
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
class LinkTableForQueryWidget extends IFormSchema {
|
|
826
|
+
constructor(e, t) {
|
|
827
|
+
super(e, t), this.code = t.code, this.titleField = t.titleField, this.multi = t.multi || !1;
|
|
828
|
+
}
|
|
829
|
+
getItem() {
|
|
830
|
+
let e = super.getItem();
|
|
831
|
+
return Object.assign({}, e, {
|
|
832
|
+
component: "LinkTableForQuery",
|
|
833
|
+
componentProps: {
|
|
834
|
+
code: this.code,
|
|
835
|
+
multi: this.multi,
|
|
836
|
+
field: this.titleField,
|
|
837
|
+
style: {
|
|
838
|
+
width: "100%"
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
class CascaderPcaForQueryWidget extends IFormSchema {
|
|
845
|
+
getItem() {
|
|
846
|
+
let e = super.getItem();
|
|
847
|
+
return Object.assign({}, e, {
|
|
848
|
+
component: "CascaderPcaForQuery",
|
|
849
|
+
componentProps: {
|
|
850
|
+
style: {
|
|
851
|
+
width: "100%"
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
});
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
class SelectUser2Widget extends IFormSchema {
|
|
858
|
+
constructor(e, t) {
|
|
859
|
+
super(e, t), this.multi = t.multi === !0, this.store = t.store || "", this.query = t.query || !1;
|
|
860
|
+
}
|
|
861
|
+
getItem() {
|
|
862
|
+
let e = super.getItem(), t = this.getComponentProps();
|
|
863
|
+
return Object.assign({}, e, {
|
|
864
|
+
component: "UserSelect",
|
|
865
|
+
componentProps: t
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
getComponentProps() {
|
|
869
|
+
let e = {
|
|
870
|
+
multi: this.multi,
|
|
871
|
+
store: this.store,
|
|
872
|
+
query: this.query
|
|
873
|
+
};
|
|
874
|
+
return this.inPopover === !0 && (e.getContainer = () => this.getModalAsContainer()), e;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
class RangeWidget extends IFormSchema {
|
|
878
|
+
constructor(e, t) {
|
|
879
|
+
super(e, t);
|
|
880
|
+
let o = t.view;
|
|
881
|
+
this.format = t.format, this.datetime = !1, o === "rangeNumber" ? this.componentType = "JRangeNumber" : o === "rangeTime" ? this.componentType = "RangeTime" : (this.componentType = "RangeDate", t.datetime === !0 && (this.datetime = !0));
|
|
882
|
+
}
|
|
883
|
+
getItem() {
|
|
884
|
+
let e = super.getItem();
|
|
885
|
+
return Object.assign({}, e, {
|
|
886
|
+
component: this.componentType,
|
|
887
|
+
componentProps: {
|
|
888
|
+
datetime: this.datetime,
|
|
889
|
+
format: this.format,
|
|
890
|
+
getPopupContainer: (t) => this.getModalAsContainer()
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
class FormSchemaFactory {
|
|
896
|
+
static createFormSchema(e, t) {
|
|
897
|
+
switch (t.view) {
|
|
898
|
+
case "password":
|
|
899
|
+
return new PasswordWidget(e, t);
|
|
900
|
+
case "list":
|
|
901
|
+
return new SelectWidget(e, t);
|
|
902
|
+
case "radio":
|
|
903
|
+
return new RadioWidget(e, t);
|
|
904
|
+
case "checkbox":
|
|
905
|
+
return new CheckboxWidget(e, t);
|
|
906
|
+
case "date":
|
|
907
|
+
case "datetime":
|
|
908
|
+
return new DateWidget(e, t);
|
|
909
|
+
case "time":
|
|
910
|
+
return new TimeWidget(e, t);
|
|
911
|
+
case "file":
|
|
912
|
+
return new FileWidget(e, t);
|
|
913
|
+
case "image":
|
|
914
|
+
return new ImageWidget(e, t);
|
|
915
|
+
case "textarea":
|
|
916
|
+
return new TextAreaWidget(e, t);
|
|
917
|
+
case "list_multi":
|
|
918
|
+
return new SelectMultiWidget(e, t);
|
|
919
|
+
case "sel_search":
|
|
920
|
+
return new SelectSearchWidget(e, t);
|
|
921
|
+
case "popup":
|
|
922
|
+
return new PopupWidget(e, t);
|
|
923
|
+
case "cat_tree":
|
|
924
|
+
return new TreeCategoryWidget(e, t);
|
|
925
|
+
case "sel_depart":
|
|
926
|
+
return new SelectDepartWidget(e, t);
|
|
927
|
+
case "sel_user":
|
|
928
|
+
return new SelectUserWidget(e, t);
|
|
929
|
+
case "umeditor":
|
|
930
|
+
return new EditorWidget(e, t);
|
|
931
|
+
case "markdown":
|
|
932
|
+
return new MarkdownWidget(e, t);
|
|
933
|
+
case "pca":
|
|
934
|
+
return new PcaWidget(e, t);
|
|
935
|
+
case "link_down":
|
|
936
|
+
return new LinkDownWidget(e, t);
|
|
937
|
+
case "sel_tree":
|
|
938
|
+
return new TreeSelectWidget(e, t);
|
|
939
|
+
case "switch":
|
|
940
|
+
return new SwitchWidget(e, t);
|
|
941
|
+
case "link_table":
|
|
942
|
+
return new LinkTableWidget(e, t);
|
|
943
|
+
case "link_table_field":
|
|
944
|
+
return new LinkTableFieldWidget(e, t);
|
|
945
|
+
case "slot":
|
|
946
|
+
return new SlotWidget(e, t);
|
|
947
|
+
case "LinkTableForQuery":
|
|
948
|
+
return new LinkTableForQueryWidget(e, t);
|
|
949
|
+
case "CascaderPcaForQuery":
|
|
950
|
+
return new CascaderPcaForQueryWidget(e, t);
|
|
951
|
+
case "select_user2":
|
|
952
|
+
return new SelectUser2Widget(e, t);
|
|
953
|
+
case "rangeDate":
|
|
954
|
+
case "rangeTime":
|
|
955
|
+
case "rangeNumber":
|
|
956
|
+
return new RangeWidget(e, t);
|
|
957
|
+
case "hidden":
|
|
958
|
+
return new InputWidget(e, t).isHidden();
|
|
959
|
+
default:
|
|
960
|
+
return t.type == "number" ? new NumberWidget(e, t) : new InputWidget(e, t);
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
static createSlotFormSchema(e, t) {
|
|
964
|
+
let o = new SlotWidget(e, t), b = t.view;
|
|
965
|
+
if (b == "date")
|
|
966
|
+
o.groupDate();
|
|
967
|
+
else if (b == "datetime")
|
|
968
|
+
o.groupDatetime();
|
|
969
|
+
else {
|
|
970
|
+
let i = t.type;
|
|
971
|
+
(i == "number" || i == "integer") && o.groupNumber();
|
|
972
|
+
}
|
|
973
|
+
return o;
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* 表单ID 默认是隐藏的
|
|
977
|
+
*/
|
|
978
|
+
static createIdField() {
|
|
979
|
+
return {
|
|
980
|
+
label: "",
|
|
981
|
+
field: "id",
|
|
982
|
+
component: "Input",
|
|
983
|
+
show: !1
|
|
984
|
+
};
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
var commonjsGlobal = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
|
|
988
|
+
function getDefaultExportFromCjs(n) {
|
|
989
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
990
|
+
}
|
|
991
|
+
var dayjs_min = { exports: {} };
|
|
992
|
+
(function(n, e) {
|
|
993
|
+
(function(t, o) {
|
|
994
|
+
n.exports = o();
|
|
995
|
+
})(commonjsGlobal, function() {
|
|
996
|
+
var t = 1e3, o = 6e4, b = 36e5, i = "millisecond", a = "second", v = "minute", g = "hour", P = "day", O = "week", _ = "month", M = "quarter", F = "year", E = "date", $ = "Invalid Date", A = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, I = /\[([^\]]+)]|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, N = { 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(u) {
|
|
997
|
+
var c = ["th", "st", "nd", "rd"], s = u % 100;
|
|
998
|
+
return "[" + u + (c[(s - 20) % 10] || c[s] || c[0]) + "]";
|
|
999
|
+
} }, S = function(u, c, s) {
|
|
1000
|
+
var l = String(u);
|
|
1001
|
+
return !l || l.length >= c ? u : "" + Array(c + 1 - l.length).join(s) + u;
|
|
1002
|
+
}, V = { s: S, z: function(u) {
|
|
1003
|
+
var c = -u.utcOffset(), s = Math.abs(c), l = Math.floor(s / 60), f = s % 60;
|
|
1004
|
+
return (c <= 0 ? "+" : "-") + S(l, 2, "0") + ":" + S(f, 2, "0");
|
|
1005
|
+
}, m: function u(c, s) {
|
|
1006
|
+
if (c.date() < s.date())
|
|
1007
|
+
return -u(s, c);
|
|
1008
|
+
var l = 12 * (s.year() - c.year()) + (s.month() - c.month()), f = c.clone().add(l, _), T = s - f < 0, D = c.clone().add(l + (T ? -1 : 1), _);
|
|
1009
|
+
return +(-(l + (s - f) / (T ? f - D : D - f)) || 0);
|
|
1010
|
+
}, a: function(u) {
|
|
1011
|
+
return u < 0 ? Math.ceil(u) || 0 : Math.floor(u);
|
|
1012
|
+
}, p: function(u) {
|
|
1013
|
+
return { M: _, y: F, w: O, d: P, D: E, h: g, m: v, s: a, ms: i, Q: M }[u] || String(u || "").toLowerCase().replace(/s$/, "");
|
|
1014
|
+
}, u: function(u) {
|
|
1015
|
+
return u === void 0;
|
|
1016
|
+
} }, W = "en", j = {};
|
|
1017
|
+
j[W] = N;
|
|
1018
|
+
var B = function(u) {
|
|
1019
|
+
return u instanceof x;
|
|
1020
|
+
}, p = function u(c, s, l) {
|
|
1021
|
+
var f;
|
|
1022
|
+
if (!c)
|
|
1023
|
+
return W;
|
|
1024
|
+
if (typeof c == "string") {
|
|
1025
|
+
var T = c.toLowerCase();
|
|
1026
|
+
j[T] && (f = T), s && (j[T] = s, f = T);
|
|
1027
|
+
var D = c.split("-");
|
|
1028
|
+
if (!f && D.length > 1)
|
|
1029
|
+
return u(D[0]);
|
|
1030
|
+
} else {
|
|
1031
|
+
var H = c.name;
|
|
1032
|
+
j[H] = c, f = H;
|
|
1033
|
+
}
|
|
1034
|
+
return !l && f && (W = f), f || !l && W;
|
|
1035
|
+
}, y = function(u, c) {
|
|
1036
|
+
if (B(u))
|
|
1037
|
+
return u.clone();
|
|
1038
|
+
var s = typeof c == "object" ? c : {};
|
|
1039
|
+
return s.date = u, s.args = arguments, new x(s);
|
|
1040
|
+
}, C = V;
|
|
1041
|
+
C.l = p, C.i = B, C.w = function(u, c) {
|
|
1042
|
+
return y(u, { locale: c.$L, utc: c.$u, x: c.$x, $offset: c.$offset });
|
|
1043
|
+
};
|
|
1044
|
+
var x = function() {
|
|
1045
|
+
function u(s) {
|
|
1046
|
+
this.$L = p(s.locale, null, !0), this.parse(s);
|
|
1047
|
+
}
|
|
1048
|
+
var c = u.prototype;
|
|
1049
|
+
return c.parse = function(s) {
|
|
1050
|
+
this.$d = function(l) {
|
|
1051
|
+
var f = l.date, T = l.utc;
|
|
1052
|
+
if (f === null)
|
|
1053
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
1054
|
+
if (C.u(f))
|
|
1055
|
+
return /* @__PURE__ */ new Date();
|
|
1056
|
+
if (f instanceof Date)
|
|
1057
|
+
return new Date(f);
|
|
1058
|
+
if (typeof f == "string" && !/Z$/i.test(f)) {
|
|
1059
|
+
var D = f.match(A);
|
|
1060
|
+
if (D) {
|
|
1061
|
+
var H = D[2] - 1 || 0, Y = (D[7] || "0").substring(0, 3);
|
|
1062
|
+
return T ? new Date(Date.UTC(D[1], H, D[3] || 1, D[4] || 0, D[5] || 0, D[6] || 0, Y)) : new Date(D[1], H, D[3] || 1, D[4] || 0, D[5] || 0, D[6] || 0, Y);
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
return new Date(f);
|
|
1066
|
+
}(s), this.$x = s.x || {}, this.init();
|
|
1067
|
+
}, c.init = function() {
|
|
1068
|
+
var s = this.$d;
|
|
1069
|
+
this.$y = s.getFullYear(), this.$M = s.getMonth(), this.$D = s.getDate(), this.$W = s.getDay(), this.$H = s.getHours(), this.$m = s.getMinutes(), this.$s = s.getSeconds(), this.$ms = s.getMilliseconds();
|
|
1070
|
+
}, c.$utils = function() {
|
|
1071
|
+
return C;
|
|
1072
|
+
}, c.isValid = function() {
|
|
1073
|
+
return this.$d.toString() !== $;
|
|
1074
|
+
}, c.isSame = function(s, l) {
|
|
1075
|
+
var f = y(s);
|
|
1076
|
+
return this.startOf(l) <= f && f <= this.endOf(l);
|
|
1077
|
+
}, c.isAfter = function(s, l) {
|
|
1078
|
+
return y(s) < this.startOf(l);
|
|
1079
|
+
}, c.isBefore = function(s, l) {
|
|
1080
|
+
return this.endOf(l) < y(s);
|
|
1081
|
+
}, c.$g = function(s, l, f) {
|
|
1082
|
+
return C.u(s) ? this[l] : this.set(f, s);
|
|
1083
|
+
}, c.unix = function() {
|
|
1084
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
1085
|
+
}, c.valueOf = function() {
|
|
1086
|
+
return this.$d.getTime();
|
|
1087
|
+
}, c.startOf = function(s, l) {
|
|
1088
|
+
var f = this, T = !!C.u(l) || l, D = C.p(s), H = function(L, U) {
|
|
1089
|
+
var X = C.w(f.$u ? Date.UTC(f.$y, U, L) : new Date(f.$y, U, L), f);
|
|
1090
|
+
return T ? X : X.endOf(P);
|
|
1091
|
+
}, Y = function(L, U) {
|
|
1092
|
+
return C.w(f.toDate()[L].apply(f.toDate("s"), (T ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(U)), f);
|
|
1093
|
+
}, q = this.$W, z = this.$M, te = this.$D, ie = "set" + (this.$u ? "UTC" : "");
|
|
1094
|
+
switch (D) {
|
|
1095
|
+
case F:
|
|
1096
|
+
return T ? H(1, 0) : H(31, 11);
|
|
1097
|
+
case _:
|
|
1098
|
+
return T ? H(1, z) : H(0, z + 1);
|
|
1099
|
+
case O:
|
|
1100
|
+
var oe = this.$locale().weekStart || 0, le = (q < oe ? q + 7 : q) - oe;
|
|
1101
|
+
return H(T ? te - le : te + (6 - le), z);
|
|
1102
|
+
case P:
|
|
1103
|
+
case E:
|
|
1104
|
+
return Y(ie + "Hours", 0);
|
|
1105
|
+
case g:
|
|
1106
|
+
return Y(ie + "Minutes", 1);
|
|
1107
|
+
case v:
|
|
1108
|
+
return Y(ie + "Seconds", 2);
|
|
1109
|
+
case a:
|
|
1110
|
+
return Y(ie + "Milliseconds", 3);
|
|
1111
|
+
default:
|
|
1112
|
+
return this.clone();
|
|
1113
|
+
}
|
|
1114
|
+
}, c.endOf = function(s) {
|
|
1115
|
+
return this.startOf(s, !1);
|
|
1116
|
+
}, c.$set = function(s, l) {
|
|
1117
|
+
var f, T = C.p(s), D = "set" + (this.$u ? "UTC" : ""), H = (f = {}, f[P] = D + "Date", f[E] = D + "Date", f[_] = D + "Month", f[F] = D + "FullYear", f[g] = D + "Hours", f[v] = D + "Minutes", f[a] = D + "Seconds", f[i] = D + "Milliseconds", f)[T], Y = T === P ? this.$D + (l - this.$W) : l;
|
|
1118
|
+
if (T === _ || T === F) {
|
|
1119
|
+
var q = this.clone().set(E, 1);
|
|
1120
|
+
q.$d[H](Y), q.init(), this.$d = q.set(E, Math.min(this.$D, q.daysInMonth())).$d;
|
|
1121
|
+
} else
|
|
1122
|
+
H && this.$d[H](Y);
|
|
1123
|
+
return this.init(), this;
|
|
1124
|
+
}, c.set = function(s, l) {
|
|
1125
|
+
return this.clone().$set(s, l);
|
|
1126
|
+
}, c.get = function(s) {
|
|
1127
|
+
return this[C.p(s)]();
|
|
1128
|
+
}, c.add = function(s, l) {
|
|
1129
|
+
var f, T = this;
|
|
1130
|
+
s = Number(s);
|
|
1131
|
+
var D = C.p(l), H = function(z) {
|
|
1132
|
+
var te = y(T);
|
|
1133
|
+
return C.w(te.date(te.date() + Math.round(z * s)), T);
|
|
1134
|
+
};
|
|
1135
|
+
if (D === _)
|
|
1136
|
+
return this.set(_, this.$M + s);
|
|
1137
|
+
if (D === F)
|
|
1138
|
+
return this.set(F, this.$y + s);
|
|
1139
|
+
if (D === P)
|
|
1140
|
+
return H(1);
|
|
1141
|
+
if (D === O)
|
|
1142
|
+
return H(7);
|
|
1143
|
+
var Y = (f = {}, f[v] = o, f[g] = b, f[a] = t, f)[D] || 1, q = this.$d.getTime() + s * Y;
|
|
1144
|
+
return C.w(q, this);
|
|
1145
|
+
}, c.subtract = function(s, l) {
|
|
1146
|
+
return this.add(-1 * s, l);
|
|
1147
|
+
}, c.format = function(s) {
|
|
1148
|
+
var l = this, f = this.$locale();
|
|
1149
|
+
if (!this.isValid())
|
|
1150
|
+
return f.invalidDate || $;
|
|
1151
|
+
var T = s || "YYYY-MM-DDTHH:mm:ssZ", D = C.z(this), H = this.$H, Y = this.$m, q = this.$M, z = f.weekdays, te = f.months, ie = f.meridiem, oe = function(U, X, G, Q) {
|
|
1152
|
+
return U && (U[X] || U(l, T)) || G[X].slice(0, Q);
|
|
1153
|
+
}, le = function(U) {
|
|
1154
|
+
return C.s(H % 12 || 12, U, "0");
|
|
1155
|
+
}, L = ie || function(U, X, G) {
|
|
1156
|
+
var Q = U < 12 ? "AM" : "PM";
|
|
1157
|
+
return G ? Q.toLowerCase() : Q;
|
|
1158
|
+
};
|
|
1159
|
+
return T.replace(I, function(U, X) {
|
|
1160
|
+
return X || function(G) {
|
|
1161
|
+
switch (G) {
|
|
1162
|
+
case "YY":
|
|
1163
|
+
return String(l.$y).slice(-2);
|
|
1164
|
+
case "YYYY":
|
|
1165
|
+
return C.s(l.$y, 4, "0");
|
|
1166
|
+
case "M":
|
|
1167
|
+
return q + 1;
|
|
1168
|
+
case "MM":
|
|
1169
|
+
return C.s(q + 1, 2, "0");
|
|
1170
|
+
case "MMM":
|
|
1171
|
+
return oe(f.monthsShort, q, te, 3);
|
|
1172
|
+
case "MMMM":
|
|
1173
|
+
return oe(te, q);
|
|
1174
|
+
case "D":
|
|
1175
|
+
return l.$D;
|
|
1176
|
+
case "DD":
|
|
1177
|
+
return C.s(l.$D, 2, "0");
|
|
1178
|
+
case "d":
|
|
1179
|
+
return String(l.$W);
|
|
1180
|
+
case "dd":
|
|
1181
|
+
return oe(f.weekdaysMin, l.$W, z, 2);
|
|
1182
|
+
case "ddd":
|
|
1183
|
+
return oe(f.weekdaysShort, l.$W, z, 3);
|
|
1184
|
+
case "dddd":
|
|
1185
|
+
return z[l.$W];
|
|
1186
|
+
case "H":
|
|
1187
|
+
return String(H);
|
|
1188
|
+
case "HH":
|
|
1189
|
+
return C.s(H, 2, "0");
|
|
1190
|
+
case "h":
|
|
1191
|
+
return le(1);
|
|
1192
|
+
case "hh":
|
|
1193
|
+
return le(2);
|
|
1194
|
+
case "a":
|
|
1195
|
+
return L(H, Y, !0);
|
|
1196
|
+
case "A":
|
|
1197
|
+
return L(H, Y, !1);
|
|
1198
|
+
case "m":
|
|
1199
|
+
return String(Y);
|
|
1200
|
+
case "mm":
|
|
1201
|
+
return C.s(Y, 2, "0");
|
|
1202
|
+
case "s":
|
|
1203
|
+
return String(l.$s);
|
|
1204
|
+
case "ss":
|
|
1205
|
+
return C.s(l.$s, 2, "0");
|
|
1206
|
+
case "SSS":
|
|
1207
|
+
return C.s(l.$ms, 3, "0");
|
|
1208
|
+
case "Z":
|
|
1209
|
+
return D;
|
|
1210
|
+
}
|
|
1211
|
+
return null;
|
|
1212
|
+
}(U) || D.replace(":", "");
|
|
1213
|
+
});
|
|
1214
|
+
}, c.utcOffset = function() {
|
|
1215
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
1216
|
+
}, c.diff = function(s, l, f) {
|
|
1217
|
+
var T, D = this, H = C.p(l), Y = y(s), q = (Y.utcOffset() - this.utcOffset()) * o, z = this - Y, te = function() {
|
|
1218
|
+
return C.m(D, Y);
|
|
1219
|
+
};
|
|
1220
|
+
switch (H) {
|
|
1221
|
+
case F:
|
|
1222
|
+
T = te() / 12;
|
|
1223
|
+
break;
|
|
1224
|
+
case _:
|
|
1225
|
+
T = te();
|
|
1226
|
+
break;
|
|
1227
|
+
case M:
|
|
1228
|
+
T = te() / 3;
|
|
1229
|
+
break;
|
|
1230
|
+
case O:
|
|
1231
|
+
T = (z - q) / 6048e5;
|
|
1232
|
+
break;
|
|
1233
|
+
case P:
|
|
1234
|
+
T = (z - q) / 864e5;
|
|
1235
|
+
break;
|
|
1236
|
+
case g:
|
|
1237
|
+
T = z / b;
|
|
1238
|
+
break;
|
|
1239
|
+
case v:
|
|
1240
|
+
T = z / o;
|
|
1241
|
+
break;
|
|
1242
|
+
case a:
|
|
1243
|
+
T = z / t;
|
|
1244
|
+
break;
|
|
1245
|
+
default:
|
|
1246
|
+
T = z;
|
|
1247
|
+
}
|
|
1248
|
+
return f ? T : C.a(T);
|
|
1249
|
+
}, c.daysInMonth = function() {
|
|
1250
|
+
return this.endOf(_).$D;
|
|
1251
|
+
}, c.$locale = function() {
|
|
1252
|
+
return j[this.$L];
|
|
1253
|
+
}, c.locale = function(s, l) {
|
|
1254
|
+
if (!s)
|
|
1255
|
+
return this.$L;
|
|
1256
|
+
var f = this.clone(), T = p(s, l, !0);
|
|
1257
|
+
return T && (f.$L = T), f;
|
|
1258
|
+
}, c.clone = function() {
|
|
1259
|
+
return C.w(this.$d, this);
|
|
1260
|
+
}, c.toDate = function() {
|
|
1261
|
+
return new Date(this.valueOf());
|
|
1262
|
+
}, c.toJSON = function() {
|
|
1263
|
+
return this.isValid() ? this.toISOString() : null;
|
|
1264
|
+
}, c.toISOString = function() {
|
|
1265
|
+
return this.$d.toISOString();
|
|
1266
|
+
}, c.toString = function() {
|
|
1267
|
+
return this.$d.toUTCString();
|
|
1268
|
+
}, u;
|
|
1269
|
+
}(), d = x.prototype;
|
|
1270
|
+
return y.prototype = d, [["$ms", i], ["$s", a], ["$m", v], ["$H", g], ["$W", P], ["$M", _], ["$y", F], ["$D", E]].forEach(function(u) {
|
|
1271
|
+
d[u[1]] = function(c) {
|
|
1272
|
+
return this.$g(c, u[0], u[1]);
|
|
1273
|
+
};
|
|
1274
|
+
}), y.extend = function(u, c) {
|
|
1275
|
+
return u.$i || (u(c, x, y), u.$i = !0), y;
|
|
1276
|
+
}, y.locale = p, y.isDayjs = B, y.unix = function(u) {
|
|
1277
|
+
return y(1e3 * u);
|
|
1278
|
+
}, y.en = j[W], y.Ls = j, y.p = {}, y;
|
|
1279
|
+
});
|
|
1280
|
+
})(dayjs_min);
|
|
1281
|
+
var dayjs_minExports = dayjs_min.exports;
|
|
1282
|
+
const dayjs = /* @__PURE__ */ getDefaultExportFromCjs(dayjs_minExports), ceKeys = Object.keys(CustomExpression), ceJoin = ceKeys.join(","), $CE$ = ceKeys.map((n) => CustomExpression[n]), normalRegExp = /#{([^}]+)?}/g, customRegExp = /{{([^}]+)?}}/g, fillRuleRegExp = /\${([^}]+)?}/g, ACTION_TYPES = { ADD: "add", EDIT: "edit", DETAIL: "detail", RELOAD: "reload" };
|
|
1283
|
+
function initDefValueConfig(n, e, t) {
|
|
1284
|
+
hasEffectiveValue(e.defVal) && t.push({ field: n, type: e.type, value: e.defVal });
|
|
1285
|
+
}
|
|
1286
|
+
function initSubTableDefValueConfig(n, e) {
|
|
1287
|
+
hasEffectiveValue(n.fieldDefaultValue) && e.push({ field: n.key, type: n.type, value: n.fieldDefaultValue });
|
|
1288
|
+
}
|
|
1289
|
+
function loadFormFieldsDefVal(n, e, t) {
|
|
1290
|
+
return J(this, null, function* () {
|
|
1291
|
+
if (Array.isArray(n) && n.length > 0) {
|
|
1292
|
+
let o = {};
|
|
1293
|
+
for (let b of n) {
|
|
1294
|
+
let { value: i, type: a, field: v } = b;
|
|
1295
|
+
i = yield handleDefaultValue(i, ACTION_TYPES.ADD, t || {}), a === "number" && i && (i = Number.parseFloat(i)), o[v] = i;
|
|
1296
|
+
}
|
|
1297
|
+
e(o);
|
|
1298
|
+
}
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
function loadOneFieldDefVal(n, e, t) {
|
|
1302
|
+
return J(this, null, function* () {
|
|
1303
|
+
let { defVal: o, type: b } = e;
|
|
1304
|
+
if (hasEffectiveValue(o)) {
|
|
1305
|
+
let i = yield handleDefaultValue(o, ACTION_TYPES.ADD, {});
|
|
1306
|
+
b === "number" && i && (i = Number.parseFloat(i)), t[n] = i;
|
|
1307
|
+
}
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
function hasEffectiveValue(n) {
|
|
1311
|
+
return !!(n || n === 0);
|
|
1312
|
+
}
|
|
1313
|
+
function handleDefaultValue(n, e, t) {
|
|
1314
|
+
return J(this, null, function* () {
|
|
1315
|
+
if (n != null && checkExpressionType(n)) {
|
|
1316
|
+
let o = yield getDefaultValue(n, e, t);
|
|
1317
|
+
if (o != null)
|
|
1318
|
+
return o;
|
|
1319
|
+
}
|
|
1320
|
+
return n;
|
|
1321
|
+
});
|
|
1322
|
+
}
|
|
1323
|
+
function checkExpressionType(n) {
|
|
1324
|
+
let e = 0, t = 0, o = 0;
|
|
1325
|
+
if (n.replace(fillRuleRegExp, () => o++), o > 1)
|
|
1326
|
+
return logWarn(`表达式[${n}]不合法:只能同时填写一个填值规则表达式!`), !1;
|
|
1327
|
+
n.replace(normalRegExp, () => e++), n.replace(customRegExp, () => t++);
|
|
1328
|
+
let b = e + t;
|
|
1329
|
+
return o > 0 && b > 0 ? (logWarn(`表达式[${n}]不合法:填值规则表达式不能和其他表达式混用!`), !1) : !0;
|
|
1330
|
+
}
|
|
1331
|
+
function getRegExpMap(n, e) {
|
|
1332
|
+
let t = /* @__PURE__ */ new Map();
|
|
1333
|
+
return n.replace(e, function(o, b) {
|
|
1334
|
+
return t.set(o, b.trim()), o;
|
|
1335
|
+
}), t;
|
|
1336
|
+
}
|
|
1337
|
+
function getDefaultValue(n, e, t) {
|
|
1338
|
+
return J(this, null, function* () {
|
|
1339
|
+
return (e === ACTION_TYPES.ADD || e === ACTION_TYPES.RELOAD) && fillRuleRegExp.test(n) ? yield executeRegExp(n, fillRuleRegExp, executeFillRuleExpression, [t]) : e === ACTION_TYPES.ADD ? (n = yield executeRegExp(n, normalRegExp, executeNormalExpression), n = yield executeRegExp(n, customRegExp, executeCustomExpression), n) : null;
|
|
1340
|
+
});
|
|
1341
|
+
}
|
|
1342
|
+
function executeRegExp(b, i, a) {
|
|
1343
|
+
return J(this, arguments, function* (n, e, t, o = []) {
|
|
1344
|
+
let v = getRegExpMap(n, e);
|
|
1345
|
+
for (let g of v.keys()) {
|
|
1346
|
+
let P = v.get(g), O = yield t.apply(null, [P, g, ...o]);
|
|
1347
|
+
if (g === n)
|
|
1348
|
+
return O;
|
|
1349
|
+
n = replaceAll(n, g, O);
|
|
1350
|
+
}
|
|
1351
|
+
return n;
|
|
1352
|
+
});
|
|
1353
|
+
}
|
|
1354
|
+
function executeNormalExpression(n, e) {
|
|
1355
|
+
return J(this, null, function* () {
|
|
1356
|
+
switch (n) {
|
|
1357
|
+
case "date":
|
|
1358
|
+
return dayjs().format("YYYY-MM-DD");
|
|
1359
|
+
case "time":
|
|
1360
|
+
return dayjs().format("HH:mm:ss");
|
|
1361
|
+
case "datetime":
|
|
1362
|
+
return dayjs().format("YYYY-MM-DD HH:mm:ss");
|
|
1363
|
+
default:
|
|
1364
|
+
let t = getUserInfoByExpression(n);
|
|
1365
|
+
return t != null ? t : e;
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1368
|
+
}
|
|
1369
|
+
function getUserInfoByExpression(n) {
|
|
1370
|
+
let t = useUserStore().getUserInfo;
|
|
1371
|
+
if (t)
|
|
1372
|
+
switch (n) {
|
|
1373
|
+
case "sysUserId":
|
|
1374
|
+
return t.id;
|
|
1375
|
+
case "sysUserCode":
|
|
1376
|
+
case "sys_user_code":
|
|
1377
|
+
return t.username;
|
|
1378
|
+
case "sysUserName":
|
|
1379
|
+
return t.realname;
|
|
1380
|
+
case "sysOrgCode":
|
|
1381
|
+
case "sys_org_code":
|
|
1382
|
+
return t.orgCode;
|
|
1383
|
+
}
|
|
1384
|
+
return null;
|
|
1385
|
+
}
|
|
1386
|
+
function executeCustomExpression(expression, origin) {
|
|
1387
|
+
return J(this, null, function* () {
|
|
1388
|
+
let fn = eval(`(function (${ceJoin}){ return ${expression} })`);
|
|
1389
|
+
try {
|
|
1390
|
+
return fn.apply(null, $CE$);
|
|
1391
|
+
} catch (n) {
|
|
1392
|
+
return logError(n), origin;
|
|
1393
|
+
}
|
|
1394
|
+
});
|
|
1395
|
+
}
|
|
1396
|
+
function executeFillRuleExpression(n, e, t) {
|
|
1397
|
+
return J(this, null, function* () {
|
|
1398
|
+
let o = `/sys/fillRule/executeRuleByCode/${n}`, b = {};
|
|
1399
|
+
typeof t == "function" ? b = t() : t && (b = ne({}, t));
|
|
1400
|
+
let { success: i, message: a, result: v } = yield defHttp.put({ url: o, params: b }, { isTransformResponse: !1 });
|
|
1401
|
+
return i ? v : (logError(`填值规则(${n})执行失败:${a}`), e);
|
|
1402
|
+
});
|
|
1403
|
+
}
|
|
1404
|
+
function logWarn(n) {
|
|
1405
|
+
console.warn("[loadFieldDefVal]:", n);
|
|
1406
|
+
}
|
|
1407
|
+
function logError(n) {
|
|
1408
|
+
console.error("[loadFieldDefVal]:", n);
|
|
1409
|
+
}
|
|
1410
|
+
const LINK_DOWN = "link_down", LINK_TABLE_FIELD = "link_table_field", LINK_TABLE = "link_table";
|
|
1411
|
+
function useFormItems(n, e) {
|
|
1412
|
+
useExtendComponent();
|
|
1413
|
+
const t = n.modalClass, o = ref([]), b = ref(""), i = ref({}), a = reactive({}), v = ref(!1), g = ref([]), P = ref({}), O = {}, _ = ref([]), M = reactive({}), F = ref("");
|
|
1414
|
+
F.value = { sm: 24, xs: 24, md: 12, lg: 12, xl: 12, xxl: 12 };
|
|
1415
|
+
function E(S, V, W) {
|
|
1416
|
+
clearObj(M), M[b.value] = [];
|
|
1417
|
+
let j = [], B = [], p = [], y = {}, C = {};
|
|
1418
|
+
Object.keys(S).map((d) => {
|
|
1419
|
+
const u = S[d];
|
|
1420
|
+
if (u.view == "tab") {
|
|
1421
|
+
v.value = !0, M[d] = [];
|
|
1422
|
+
let c = {
|
|
1423
|
+
key: d,
|
|
1424
|
+
// 这个foreignKey是主表的字段
|
|
1425
|
+
foreignKey: u.foreignKey,
|
|
1426
|
+
describe: u.describe,
|
|
1427
|
+
relationType: u.relationType,
|
|
1428
|
+
requiredFields: u.required || [],
|
|
1429
|
+
order: u.order,
|
|
1430
|
+
id: u.id
|
|
1431
|
+
};
|
|
1432
|
+
u.relationType == 1 ? (O[d] = ref(null), c.properties = u.properties) : ($(u), O[d] = ref(), c.columns = u.columns, y[d] = []), j.push(c), handleSubTableButtonAuth(d, u);
|
|
1433
|
+
} else if (initDefValueConfig(d, u, M[b.value]), u.view === LINK_DOWN) {
|
|
1434
|
+
let c = handleLinkDown(u, d);
|
|
1435
|
+
for (let s of c) {
|
|
1436
|
+
a[s.key] = !0, a[s.key + "_load"] = !0;
|
|
1437
|
+
let l = FormSchemaFactory.createFormSchema(s.key, s);
|
|
1438
|
+
W && l.setOnlyValidateFun(W), l.isRequired(V), l.setFormRef(e), l.handleWidgetAttr(u);
|
|
1439
|
+
let f = getFieldIndex(B, s.key);
|
|
1440
|
+
f == -1 ? B.push(l) : B[f] = l;
|
|
1441
|
+
}
|
|
1442
|
+
} else if (a[d] = !0, a[d + "_load"] = !0, getFieldIndex(B, d) == -1) {
|
|
1443
|
+
let s = FormSchemaFactory.createFormSchema(d, u);
|
|
1444
|
+
if (W && s.setOnlyValidateFun(W), s.isRequired(V), s.setFormRef(e), B.push(s), p.push(...s.getRelatedHideFields()), u.view === LINK_TABLE_FIELD) {
|
|
1445
|
+
let l = s.getLinkFieldInfo();
|
|
1446
|
+
l && (C[l[0]] ? C[l[0]].push(l[1]) : C[l[0]] = [l[1]]);
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
}), B.sort(function(d, u) {
|
|
1450
|
+
return d.order - u.order;
|
|
1451
|
+
});
|
|
1452
|
+
let x = [];
|
|
1453
|
+
x.push(FormSchemaFactory.createIdField());
|
|
1454
|
+
for (let d of B)
|
|
1455
|
+
d.view && d.view == LINK_TABLE && C[d.field] && d.setOtherInfo(C[d.field]), p.indexOf(d.field) >= 0 && d.isHidden(), t && d.setCustomPopContainer(t), x.push(d.getFormItemSchema());
|
|
1456
|
+
o.value = x, j.sort(function(d, u) {
|
|
1457
|
+
return d.order - u.order;
|
|
1458
|
+
}), g.value = j, P.value = y;
|
|
1459
|
+
}
|
|
1460
|
+
watch(
|
|
1461
|
+
a,
|
|
1462
|
+
(S) => {
|
|
1463
|
+
let V = e.value, W = [], j = toRaw(S);
|
|
1464
|
+
Object.keys(j).map((B) => {
|
|
1465
|
+
if (!B.endsWith("_load")) {
|
|
1466
|
+
let p = {
|
|
1467
|
+
field: B,
|
|
1468
|
+
show: j[B]
|
|
1469
|
+
}, y = B + "_load";
|
|
1470
|
+
j.hasOwnProperty(y) && (p.ifShow = j[y]), W.push(p);
|
|
1471
|
+
}
|
|
1472
|
+
}), V && V.updateSchema(W);
|
|
1473
|
+
},
|
|
1474
|
+
{ immediate: !1 }
|
|
1475
|
+
);
|
|
1476
|
+
function $(S) {
|
|
1477
|
+
useOnlineVxeTableColumns(S, (V) => {
|
|
1478
|
+
initSubTableDefValueConfig(V, M[S.key]);
|
|
1479
|
+
});
|
|
1480
|
+
}
|
|
1481
|
+
watch(
|
|
1482
|
+
() => n.formTemplate,
|
|
1483
|
+
() => {
|
|
1484
|
+
F.value = A();
|
|
1485
|
+
},
|
|
1486
|
+
{ immediate: !0 }
|
|
1487
|
+
);
|
|
1488
|
+
function A() {
|
|
1489
|
+
let S = n.formTemplate;
|
|
1490
|
+
return S == 2 ? { sm: 24, xs: 24, md: 12, lg: 12, xl: 12, xxl: 12 } : S == 3 ? { sm: 24, xs: 24, md: 8, lg: 8, xl: 8, xxl: 8 } : S == 4 ? { sm: 24, xs: 24, md: 6, lg: 6, xl: 6, xxl: 6 } : { sm: 24, xs: 24, md: 24, lg: 24, xl: 24, xxl: 24 };
|
|
1491
|
+
}
|
|
1492
|
+
function I(S, V) {
|
|
1493
|
+
return new Promise((W) => {
|
|
1494
|
+
V || W("");
|
|
1495
|
+
let B = {
|
|
1496
|
+
tableName: b.value.replace(/\$\d+/, ""),
|
|
1497
|
+
fieldName: S.field,
|
|
1498
|
+
fieldVal: V
|
|
1499
|
+
}, p = i.value;
|
|
1500
|
+
p.id && (B.dataId = p.id), duplicateCheck(B).then((y) => {
|
|
1501
|
+
y.success ? W("") : W(y.message);
|
|
1502
|
+
}).catch((y) => {
|
|
1503
|
+
W(y);
|
|
1504
|
+
});
|
|
1505
|
+
});
|
|
1506
|
+
}
|
|
1507
|
+
function N(S) {
|
|
1508
|
+
return Object.keys(S).map((V) => {
|
|
1509
|
+
S[V] && S[V] instanceof Array && (S[V] = S[V].join(","));
|
|
1510
|
+
}), S;
|
|
1511
|
+
}
|
|
1512
|
+
return {
|
|
1513
|
+
formSchemas: o,
|
|
1514
|
+
defaultValueFields: M,
|
|
1515
|
+
tableName: b,
|
|
1516
|
+
dbData: i,
|
|
1517
|
+
checkOnlyFieldValue: I,
|
|
1518
|
+
createFormSchemas: E,
|
|
1519
|
+
fieldDisplayStatus: a,
|
|
1520
|
+
subTabInfo: g,
|
|
1521
|
+
hasSubTable: v,
|
|
1522
|
+
subDataSource: P,
|
|
1523
|
+
baseColProps: F,
|
|
1524
|
+
changeDataIfArray2String: N,
|
|
1525
|
+
linkDownList: _,
|
|
1526
|
+
refMap: O
|
|
1527
|
+
};
|
|
1528
|
+
}
|
|
1529
|
+
function useOnlineVxeTableColumns(n, e) {
|
|
1530
|
+
const t = {
|
|
1531
|
+
inputNumber: "input-number",
|
|
1532
|
+
sel_depart: "depart-select",
|
|
1533
|
+
sel_user: "user-select",
|
|
1534
|
+
list_multi: "select-multiple",
|
|
1535
|
+
input_pop: "textarea",
|
|
1536
|
+
sel_search: "select-search",
|
|
1537
|
+
"select-dict-search": "selectDictSearch"
|
|
1538
|
+
};
|
|
1539
|
+
n.columns.forEach((i) => {
|
|
1540
|
+
i.type === "radio" ? i.type = "select" : t[i.type] ? i.type = t[i.type] : i.type === "popup" && o(i), i.type === "depart-select" && (i.checkStrictly = !0), i.type === "user-select" && b(i), i.type === "pca" && (i.width = "230px"), (i.width == 120 || i.width == "120px") && (i.type == "image" || i.type == "file") && (i.width = "130px"), i.width || (i.width = "200px"), e && e(i);
|
|
1541
|
+
});
|
|
1542
|
+
function o(i) {
|
|
1543
|
+
let { destFields: a, orgFields: v } = i, g = [];
|
|
1544
|
+
if (!(!a || a.length == 0)) {
|
|
1545
|
+
let P = a.split(","), O = v.split(",");
|
|
1546
|
+
for (let _ = 0; _ < P.length; _++)
|
|
1547
|
+
g.push({
|
|
1548
|
+
target: P[_],
|
|
1549
|
+
source: O[_]
|
|
1550
|
+
});
|
|
1551
|
+
}
|
|
1552
|
+
i.fieldConfig = g;
|
|
1553
|
+
}
|
|
1554
|
+
function b(i) {
|
|
1555
|
+
let a = i.fieldExtendJson, v = !1;
|
|
1556
|
+
if (a)
|
|
1557
|
+
try {
|
|
1558
|
+
JSON.parse(a).multiSelect === !1 && (v = !0);
|
|
1559
|
+
} catch (g) {
|
|
1560
|
+
console.log("子表获取用户组件的扩展配置出现错误", g);
|
|
1561
|
+
}
|
|
1562
|
+
i.isRadioSelection = v;
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
function useOnlineFormContext() {
|
|
1566
|
+
let n = {};
|
|
1567
|
+
const e = {
|
|
1568
|
+
addSubRows: "<m> 一对多子表,新增自定义行",
|
|
1569
|
+
changeOptions: "<m> 改变下拉框选项",
|
|
1570
|
+
clearSubRows: "<m> 清空一对多子表行",
|
|
1571
|
+
clearThenAddRows: "<m> 清空一对多子表行,然后新增自定义行",
|
|
1572
|
+
executeMainFillRule: "<m> 刷新主表的增值规制值",
|
|
1573
|
+
executeSubFillRule: "<m> 刷新子表的增值规制值",
|
|
1574
|
+
getFieldsValue: "<m> 获取表单控件的值",
|
|
1575
|
+
getSubTableInstance: "<m> 获取子表实例",
|
|
1576
|
+
isUpdate: "<p> 判断是否为编辑模式",
|
|
1577
|
+
loading: "<p> 页面加载状态",
|
|
1578
|
+
onlineFormRef: "<p> 当前表单ref对象",
|
|
1579
|
+
refMap: "<p> 子表ref对象map",
|
|
1580
|
+
setFieldsValue: "<m> 设置表单控件的值",
|
|
1581
|
+
sh: "<p> 表单控件的显示隐藏状态",
|
|
1582
|
+
subActiveKey: "<p> 子表激活tab,对应子表表名",
|
|
1583
|
+
subFormHeight: "<p> 一对一子表表单高度",
|
|
1584
|
+
submitFlowFlag: "<p> 是否提交流程状态",
|
|
1585
|
+
subTableHeight: "<p> 一对多子表表格高度",
|
|
1586
|
+
tableName: "<p> 当前表名",
|
|
1587
|
+
triggleChangeValues: "<m> 修改多个表单值",
|
|
1588
|
+
triggleChangeValue: "<m> 修改表单值",
|
|
1589
|
+
updateSchema: "<m> 修改表单控件配置"
|
|
1590
|
+
}, t = new Proxy(e, {
|
|
1591
|
+
get(i, a) {
|
|
1592
|
+
return Reflect.get(n, a);
|
|
1593
|
+
}
|
|
1594
|
+
});
|
|
1595
|
+
function o(i, a) {
|
|
1596
|
+
n[i] = a;
|
|
1597
|
+
}
|
|
1598
|
+
function b(i) {
|
|
1599
|
+
Object.keys(i).map((a) => {
|
|
1600
|
+
n[a] = i[a];
|
|
1601
|
+
});
|
|
1602
|
+
}
|
|
1603
|
+
return o("$nextTick", nextTick), o("addObject2Context", o), { onlineFormContext: t, addObject2Context: o, resetContext: b };
|
|
1604
|
+
}
|
|
1605
|
+
function handleLinkDown(n, e) {
|
|
1606
|
+
const {
|
|
1607
|
+
config: { table: t, key: o, txt: b, linkField: i, idField: a, pidField: v, condition: g },
|
|
1608
|
+
others: P,
|
|
1609
|
+
order: O,
|
|
1610
|
+
title: _
|
|
1611
|
+
} = n;
|
|
1612
|
+
let M = {
|
|
1613
|
+
dictTable: t,
|
|
1614
|
+
dictText: b,
|
|
1615
|
+
dictCode: o,
|
|
1616
|
+
pidField: v,
|
|
1617
|
+
idField: a,
|
|
1618
|
+
view: LINK_DOWN,
|
|
1619
|
+
type: n.type
|
|
1620
|
+
}, F = [], E = ne({
|
|
1621
|
+
key: e,
|
|
1622
|
+
title: _,
|
|
1623
|
+
order: O,
|
|
1624
|
+
condition: g,
|
|
1625
|
+
origin: !0
|
|
1626
|
+
}, M);
|
|
1627
|
+
if (i && i.length > 0) {
|
|
1628
|
+
let $ = i.split(",");
|
|
1629
|
+
E.next = $[0];
|
|
1630
|
+
for (let A = 0; A < $.length; A++)
|
|
1631
|
+
for (let I of P)
|
|
1632
|
+
if (I.field == $[A]) {
|
|
1633
|
+
let N = ne({
|
|
1634
|
+
key: I.field,
|
|
1635
|
+
title: I.title,
|
|
1636
|
+
order: I.order,
|
|
1637
|
+
origin: !1
|
|
1638
|
+
}, M);
|
|
1639
|
+
A + 1 < $.length && (N.next = $[A + 1]), F.push(N);
|
|
1640
|
+
}
|
|
1641
|
+
}
|
|
1642
|
+
return F.push(E), F;
|
|
1643
|
+
}
|
|
1644
|
+
function getFieldIndex(n, e) {
|
|
1645
|
+
let t = -1;
|
|
1646
|
+
for (let o = 0; o < n.length; o++)
|
|
1647
|
+
if (n[o].field === e) {
|
|
1648
|
+
t = o;
|
|
1649
|
+
break;
|
|
1650
|
+
}
|
|
1651
|
+
return t;
|
|
1652
|
+
}
|
|
1653
|
+
function getRefPromise(n) {
|
|
1654
|
+
return new Promise((e) => {
|
|
1655
|
+
(function t() {
|
|
1656
|
+
let o = n.value;
|
|
1657
|
+
o ? e(o) : setTimeout(() => {
|
|
1658
|
+
t();
|
|
1659
|
+
}, 100);
|
|
1660
|
+
})();
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
function clearObj(n) {
|
|
1664
|
+
Object.keys(n).map((e) => {
|
|
1665
|
+
delete n[e];
|
|
1666
|
+
});
|
|
1667
|
+
}
|
|
1668
|
+
const permissionStore = usePermissionStore();
|
|
1669
|
+
function handleSubTableButtonAuth(n, e) {
|
|
1670
|
+
let t = e.hideButtons, o = ONL_AUTH_PRE + n + ":";
|
|
1671
|
+
t || (t = []), permissionStore.setOnlineSubTableAuth(o, t);
|
|
1672
|
+
}
|
|
1673
|
+
function getDetailFormSchemas(n) {
|
|
1674
|
+
const e = ref([]), t = {}, o = reactive({}), b = ref(!1), i = ref([]), a = ref({}), v = computed(() => {
|
|
1675
|
+
let M = n.formTemplate;
|
|
1676
|
+
return M == "2" ? 12 : M == "3" ? 8 : M == "4" ? 6 : 24;
|
|
1677
|
+
});
|
|
1678
|
+
function g(M) {
|
|
1679
|
+
let F = [];
|
|
1680
|
+
console.log("111", M);
|
|
1681
|
+
let E = [], $ = {};
|
|
1682
|
+
Object.keys(M).map((A) => {
|
|
1683
|
+
const I = M[A];
|
|
1684
|
+
if (I.view == "tab") {
|
|
1685
|
+
b.value = !0;
|
|
1686
|
+
let N = {
|
|
1687
|
+
key: A,
|
|
1688
|
+
// 这个foreignKey是主表的字段
|
|
1689
|
+
foreignKey: I.foreignKey,
|
|
1690
|
+
describe: I.describe,
|
|
1691
|
+
relationType: I.relationType,
|
|
1692
|
+
requiredFields: I.required || [],
|
|
1693
|
+
order: I.order
|
|
1694
|
+
};
|
|
1695
|
+
I.relationType == 1 ? (t[A] = ref(null), N.properties = I.properties) : (P(I), t[A] = ref(), N.columns = I.columns, $[A] = [], o[A] = !1), F.push(N);
|
|
1696
|
+
} else if (I.view === LINK_DOWN) {
|
|
1697
|
+
let N = _(I, A);
|
|
1698
|
+
for (let S of N) {
|
|
1699
|
+
let V = O(E, S.key), W = {
|
|
1700
|
+
field: S.key,
|
|
1701
|
+
label: S.title,
|
|
1702
|
+
view: S.view,
|
|
1703
|
+
order: S.order,
|
|
1704
|
+
dictTable: S.dictTable,
|
|
1705
|
+
linkField: S.linkField || ""
|
|
1706
|
+
};
|
|
1707
|
+
V == -1 ? E.push(W) : E[V] = W;
|
|
1708
|
+
}
|
|
1709
|
+
} else if (I.view != "hidden") {
|
|
1710
|
+
if (O(E, A) == -1) {
|
|
1711
|
+
let S = Object.assign(
|
|
1712
|
+
{
|
|
1713
|
+
field: A,
|
|
1714
|
+
label: I.title
|
|
1715
|
+
},
|
|
1716
|
+
pick(I, ["view", "order", "fieldExtendJson", "dictTable", "dictText", "dictCode", "dict"])
|
|
1717
|
+
);
|
|
1718
|
+
if (I.view == "file" && (S.span = 24, S.isFile = !0), I.view == "image" && (S.span = 24, S.isImage = !0), I.view == "link_table" && I.fieldExtendJson)
|
|
1719
|
+
try {
|
|
1720
|
+
let V = JSON.parse(I.fieldExtendJson);
|
|
1721
|
+
V.showType != "select" && (S.isCard = !0), V.multiSelect == !0 && (S.multi = !0);
|
|
1722
|
+
} catch (V) {
|
|
1723
|
+
console.error("解析json字符串出错", I.fieldExtendJson);
|
|
1724
|
+
}
|
|
1725
|
+
(I.view == "umeditor" || I.view == "markdown") && (S.isHtml = !0, S.span = 24), E.push(S);
|
|
1726
|
+
}
|
|
1727
|
+
}
|
|
1728
|
+
}), E.sort(function(A, I) {
|
|
1729
|
+
return A.order - I.order;
|
|
1730
|
+
}), F.sort(function(A, I) {
|
|
1731
|
+
return A.order - I.order;
|
|
1732
|
+
}), i.value = F;
|
|
1733
|
+
for (let A = 0; A < E.length; A++) {
|
|
1734
|
+
let I = E[A];
|
|
1735
|
+
if ((I.isFile === !0 || I.isImage === !0 || I.isHtml === !0) && A > 0) {
|
|
1736
|
+
let N = E[A - 1], S = N.span || v.value;
|
|
1737
|
+
N.span = S;
|
|
1738
|
+
}
|
|
1739
|
+
}
|
|
1740
|
+
e.value = E, a.value = $, console.log("adadad", E);
|
|
1741
|
+
}
|
|
1742
|
+
function P(M) {
|
|
1743
|
+
useOnlineVxeTableColumns(M);
|
|
1744
|
+
}
|
|
1745
|
+
function O(M, F) {
|
|
1746
|
+
let E = -1;
|
|
1747
|
+
for (let $ = 0; $ < M.length; $++)
|
|
1748
|
+
if (M[$].field === F) {
|
|
1749
|
+
E = $;
|
|
1750
|
+
break;
|
|
1751
|
+
}
|
|
1752
|
+
return E;
|
|
1753
|
+
}
|
|
1754
|
+
function _(M, F) {
|
|
1755
|
+
let E = [];
|
|
1756
|
+
const {
|
|
1757
|
+
config: { table: $, key: A, txt: I, linkField: N },
|
|
1758
|
+
order: S,
|
|
1759
|
+
title: V,
|
|
1760
|
+
others: W
|
|
1761
|
+
} = M;
|
|
1762
|
+
let B = {
|
|
1763
|
+
view: "link_down",
|
|
1764
|
+
order: S,
|
|
1765
|
+
title: V,
|
|
1766
|
+
dictTable: JSON.stringify({
|
|
1767
|
+
table: $,
|
|
1768
|
+
key: A,
|
|
1769
|
+
txt: I
|
|
1770
|
+
})
|
|
1771
|
+
};
|
|
1772
|
+
if (E.push(Object.assign({}, { linkField: N, key: F }, B)), N) {
|
|
1773
|
+
let p = N.split(",");
|
|
1774
|
+
for (let y of p) {
|
|
1775
|
+
let C = "";
|
|
1776
|
+
for (let x of W)
|
|
1777
|
+
x.field == y && (C = x.title);
|
|
1778
|
+
E.push(Object.assign({}, { key: y }, B, { title: C }));
|
|
1779
|
+
}
|
|
1780
|
+
}
|
|
1781
|
+
return E;
|
|
1782
|
+
}
|
|
1783
|
+
return {
|
|
1784
|
+
detailFormSchemas: e,
|
|
1785
|
+
hasSubTable: b,
|
|
1786
|
+
subTabInfo: i,
|
|
1787
|
+
refMap: t,
|
|
1788
|
+
showStatus: o,
|
|
1789
|
+
createFormSchemas: g,
|
|
1790
|
+
formSpan: v,
|
|
1791
|
+
subDataSource: a
|
|
1792
|
+
};
|
|
1793
|
+
}
|
|
1794
|
+
function useEnhance(onlineTableContext, isList = !0) {
|
|
1795
|
+
let EnhanceJS = reactive({});
|
|
1796
|
+
const getAction = (n, e) => defHttp.get({ url: n, params: e }, { isTransformResponse: !1 }), postAction = (n, e) => defHttp.post({ url: n, params: e }, { isTransformResponse: !1 }), putAction = (n, e) => defHttp.put({ url: n, params: e }, { isTransformResponse: !1 }), deleteAction = (n, e) => defHttp.delete({ url: n, params: e }, { isTransformResponse: !1 });
|
|
1797
|
+
isList === !0 ? (onlineTableContext._getAction = getAction, onlineTableContext._postAction = postAction, onlineTableContext._putAction = putAction, onlineTableContext._deleteAction = deleteAction) : (onlineTableContext.addObject2Context("_getAction", getAction), onlineTableContext.addObject2Context("_postAction", postAction), onlineTableContext.addObject2Context("_putAction", putAction), onlineTableContext.addObject2Context("_deleteAction", deleteAction));
|
|
1798
|
+
function initCgEnhanceJs(str) {
|
|
1799
|
+
if (str) {
|
|
1800
|
+
let Obj = eval("(" + str + ")");
|
|
1801
|
+
return new Obj(getAction, postAction, deleteAction);
|
|
1802
|
+
} else
|
|
1803
|
+
return {};
|
|
1804
|
+
}
|
|
1805
|
+
function triggerJsFun(n, e) {
|
|
1806
|
+
EnhanceJS && EnhanceJS[e] && EnhanceJS[e](n);
|
|
1807
|
+
}
|
|
1808
|
+
function customBeforeSubmit(n, e) {
|
|
1809
|
+
return EnhanceJS && EnhanceJS.beforeSubmit ? EnhanceJS.beforeSubmit(n, e) : Promise.resolve();
|
|
1810
|
+
}
|
|
1811
|
+
function beforeDelete(n, e) {
|
|
1812
|
+
return EnhanceJS && EnhanceJS.beforeDelete ? EnhanceJS.beforeDelete(n, e) : Promise.resolve();
|
|
1813
|
+
}
|
|
1814
|
+
return isList === !0 && onlineTableContext && (onlineTableContext.beforeDelete = (n) => {
|
|
1815
|
+
const e = onlineTableContext.EnhanceJS;
|
|
1816
|
+
return e && e.beforeDelete ? e.beforeDelete(onlineTableContext, n) : Promise.resolve();
|
|
1817
|
+
}, onlineTableContext.beforeEdit = (n) => {
|
|
1818
|
+
const e = onlineTableContext.EnhanceJS;
|
|
1819
|
+
return e && e.beforeEdit ? e.beforeEdit(onlineTableContext, n) : Promise.resolve();
|
|
1820
|
+
}), {
|
|
1821
|
+
EnhanceJS,
|
|
1822
|
+
initCgEnhanceJs,
|
|
1823
|
+
customBeforeSubmit,
|
|
1824
|
+
beforeDelete,
|
|
1825
|
+
triggerJsFun
|
|
1826
|
+
};
|
|
1827
|
+
}
|
|
1828
|
+
const baseUrl = "/online/cgform/api/subform", _sfc_main$5 = {
|
|
1829
|
+
name: "OnlineSubForm",
|
|
1830
|
+
components: {
|
|
1831
|
+
BasicForm,
|
|
1832
|
+
Loading
|
|
1833
|
+
},
|
|
1834
|
+
props: {
|
|
1835
|
+
properties: {
|
|
1836
|
+
type: Object,
|
|
1837
|
+
required: !0
|
|
1838
|
+
},
|
|
1839
|
+
mainId: {
|
|
1840
|
+
type: String,
|
|
1841
|
+
default: ""
|
|
1842
|
+
},
|
|
1843
|
+
table: {
|
|
1844
|
+
type: String,
|
|
1845
|
+
default: ""
|
|
1846
|
+
},
|
|
1847
|
+
formTemplate: {
|
|
1848
|
+
type: Number,
|
|
1849
|
+
default: 1
|
|
1850
|
+
},
|
|
1851
|
+
requiredFields: {
|
|
1852
|
+
type: Array,
|
|
1853
|
+
default: []
|
|
1854
|
+
},
|
|
1855
|
+
isUpdate: {
|
|
1856
|
+
type: Boolean,
|
|
1857
|
+
default: !1
|
|
1858
|
+
},
|
|
1859
|
+
disabled: {
|
|
1860
|
+
type: Boolean,
|
|
1861
|
+
default: !1
|
|
1862
|
+
}
|
|
1863
|
+
},
|
|
1864
|
+
emits: ["formChange"],
|
|
1865
|
+
setup(n, { emit: e }) {
|
|
1866
|
+
console.log("进入online子表表单页面》》》》" + n.table);
|
|
1867
|
+
const t = ref(null), o = ref(!1);
|
|
1868
|
+
useMessage();
|
|
1869
|
+
const {
|
|
1870
|
+
formSchemas: b,
|
|
1871
|
+
defaultValueFields: i,
|
|
1872
|
+
changeDataIfArray2String: a,
|
|
1873
|
+
tableName: v,
|
|
1874
|
+
dbData: g,
|
|
1875
|
+
checkOnlyFieldValue: P,
|
|
1876
|
+
fieldDisplayStatus: O,
|
|
1877
|
+
createFormSchemas: _,
|
|
1878
|
+
baseColProps: M
|
|
1879
|
+
} = useFormItems(n, t), [F, { setProps: E, validate: $, resetFields: A, setFieldsValue: I, getFieldsValue: N }] = useForm({
|
|
1880
|
+
schemas: b,
|
|
1881
|
+
showActionButtonGroup: !1,
|
|
1882
|
+
baseColProps: M
|
|
1883
|
+
});
|
|
1884
|
+
watch(
|
|
1885
|
+
() => n.table,
|
|
1886
|
+
() => {
|
|
1887
|
+
v.value = n.table;
|
|
1888
|
+
},
|
|
1889
|
+
{ immediate: !0 }
|
|
1890
|
+
), watch(
|
|
1891
|
+
() => n.properties,
|
|
1892
|
+
(d) => {
|
|
1893
|
+
console.log("主表properties改变", n.properties), o.value = !1, S(), _(n.properties, n.requiredFields, P), o.value = !0;
|
|
1894
|
+
},
|
|
1895
|
+
{ deep: !0, immediate: !0 }
|
|
1896
|
+
), watch(
|
|
1897
|
+
() => n.mainId,
|
|
1898
|
+
(d) => {
|
|
1899
|
+
console.log("主表ID改变", n.mainId), setTimeout(() => {
|
|
1900
|
+
W();
|
|
1901
|
+
}, 100);
|
|
1902
|
+
},
|
|
1903
|
+
{ immediate: !0 }
|
|
1904
|
+
), watch(
|
|
1905
|
+
() => n.disabled,
|
|
1906
|
+
(d) => {
|
|
1907
|
+
E({ disabled: d });
|
|
1908
|
+
}
|
|
1909
|
+
);
|
|
1910
|
+
function S() {
|
|
1911
|
+
return J(this, null, function* () {
|
|
1912
|
+
let d = yield getRefPromise(t);
|
|
1913
|
+
d.$formValueChange = (u, c) => {
|
|
1914
|
+
let s = { [u]: c };
|
|
1915
|
+
e("formChange", s);
|
|
1916
|
+
};
|
|
1917
|
+
});
|
|
1918
|
+
}
|
|
1919
|
+
function V() {
|
|
1920
|
+
if (unref(n.isUpdate) === !1) {
|
|
1921
|
+
let d = toRaw(i[v.value]);
|
|
1922
|
+
loadFormFieldsDefVal(d, (u) => {
|
|
1923
|
+
I(u);
|
|
1924
|
+
});
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
function W() {
|
|
1928
|
+
return J(this, null, function* () {
|
|
1929
|
+
yield getRefPromise(o), yield A(), V();
|
|
1930
|
+
const { table: d, mainId: u } = n;
|
|
1931
|
+
if (!d || !u)
|
|
1932
|
+
return;
|
|
1933
|
+
let c = yield j(d, u);
|
|
1934
|
+
g.value = c, yield I(c);
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1937
|
+
function j(d, u) {
|
|
1938
|
+
let c = `${baseUrl}/${d}/${u}`;
|
|
1939
|
+
return new Promise((s, l) => {
|
|
1940
|
+
defHttp.get({ url: c }, { isTransformResponse: !1 }).then((f) => {
|
|
1941
|
+
console.log(f), f.success ? s(f.result) : (console.log(f.message), l());
|
|
1942
|
+
});
|
|
1943
|
+
}).finally(() => {
|
|
1944
|
+
g.value = "";
|
|
1945
|
+
});
|
|
1946
|
+
}
|
|
1947
|
+
function B() {
|
|
1948
|
+
return new Promise((d, u) => {
|
|
1949
|
+
$().then(() => {
|
|
1950
|
+
let c = N();
|
|
1951
|
+
c = a(c), d(c);
|
|
1952
|
+
}).catch((c) => {
|
|
1953
|
+
u(c);
|
|
1954
|
+
});
|
|
1955
|
+
});
|
|
1956
|
+
}
|
|
1957
|
+
function p() {
|
|
1958
|
+
let d = N();
|
|
1959
|
+
return d.id || (d.id = "sub-change-temp-id"), {
|
|
1960
|
+
row: d,
|
|
1961
|
+
target: x
|
|
1962
|
+
};
|
|
1963
|
+
}
|
|
1964
|
+
function y(d) {
|
|
1965
|
+
I(d);
|
|
1966
|
+
}
|
|
1967
|
+
function C() {
|
|
1968
|
+
let d = N(), u = toRaw(i[v.value]);
|
|
1969
|
+
loadFormFieldsDefVal(u, (c) => {
|
|
1970
|
+
I(c);
|
|
1971
|
+
}, d);
|
|
1972
|
+
}
|
|
1973
|
+
const x = {
|
|
1974
|
+
onlineFormRef: t,
|
|
1975
|
+
baseColProps: M,
|
|
1976
|
+
formSchemas: b,
|
|
1977
|
+
registerForm: F,
|
|
1978
|
+
setFieldsValue: I,
|
|
1979
|
+
getFieldsValue: N,
|
|
1980
|
+
getFormEvent: p,
|
|
1981
|
+
setValues: y,
|
|
1982
|
+
getAll: B,
|
|
1983
|
+
executeFillRule: C,
|
|
1984
|
+
sh: O
|
|
1985
|
+
};
|
|
1986
|
+
return x;
|
|
1987
|
+
}
|
|
1988
|
+
};
|
|
1989
|
+
function _sfc_render$5(n, e, t, o, b, i) {
|
|
1990
|
+
const a = resolveComponent("BasicForm");
|
|
1991
|
+
return openBlock(), createBlock(a, {
|
|
1992
|
+
ref: "onlineFormRef",
|
|
1993
|
+
onRegister: n.registerForm
|
|
1994
|
+
}, null, 8, ["onRegister"]);
|
|
1995
|
+
}
|
|
1996
|
+
const OnlineSubForm = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]), OnlineSubForm$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1997
|
+
__proto__: null,
|
|
1998
|
+
default: OnlineSubForm
|
|
1999
|
+
}, Symbol.toStringTag, { value: "Module" })), urlObject = {
|
|
2000
|
+
optPre: "/online/cgform/api/form/",
|
|
2001
|
+
urlButtonAction: "/online/cgform/api/doButton"
|
|
2002
|
+
}, _sfc_main$4 = {
|
|
2003
|
+
name: "OnlinePopForm",
|
|
2004
|
+
components: {
|
|
2005
|
+
BasicForm,
|
|
2006
|
+
Loading,
|
|
2007
|
+
OnlineSubForm,
|
|
2008
|
+
PrinterOutlined,
|
|
2009
|
+
DiffOutlined,
|
|
2010
|
+
FormOutlined
|
|
2011
|
+
},
|
|
2012
|
+
props: {
|
|
2013
|
+
id: {
|
|
2014
|
+
type: String,
|
|
2015
|
+
default: ""
|
|
2016
|
+
},
|
|
2017
|
+
formTemplate: {
|
|
2018
|
+
type: Number,
|
|
2019
|
+
default: 1
|
|
2020
|
+
},
|
|
2021
|
+
disabled: {
|
|
2022
|
+
type: Boolean,
|
|
2023
|
+
default: !1
|
|
2024
|
+
},
|
|
2025
|
+
isTree: {
|
|
2026
|
+
type: Boolean,
|
|
2027
|
+
default: !1
|
|
2028
|
+
},
|
|
2029
|
+
pidField: {
|
|
2030
|
+
type: String,
|
|
2031
|
+
default: ""
|
|
2032
|
+
},
|
|
2033
|
+
submitTip: {
|
|
2034
|
+
type: Boolean,
|
|
2035
|
+
default: !0
|
|
2036
|
+
},
|
|
2037
|
+
modalClass: {
|
|
2038
|
+
type: String,
|
|
2039
|
+
default: ""
|
|
2040
|
+
},
|
|
2041
|
+
//是否发送请求-即表单的保存/编辑请求,false则只将表单数据抛出去
|
|
2042
|
+
request: {
|
|
2043
|
+
type: Boolean,
|
|
2044
|
+
default: !0
|
|
2045
|
+
},
|
|
2046
|
+
// 是否是vxeTable上方按钮点击打开的表单数据
|
|
2047
|
+
isVxeTableData: {
|
|
2048
|
+
type: Boolean,
|
|
2049
|
+
default: !1
|
|
2050
|
+
}
|
|
2051
|
+
},
|
|
2052
|
+
emits: ["success", "rendered", "dataChange"],
|
|
2053
|
+
setup(n, { emit: e }) {
|
|
2054
|
+
console.log("onlineForm-setup》》");
|
|
2055
|
+
const { createMessage: t } = useMessage(), [o, { openModal: b }] = useModal(), i = ref(""), a = ref(null), v = ref(!0), g = ref(!1), P = ref(1), O = ref(!1), _ = ref(!1), M = reactive({
|
|
2056
|
+
reportPrintShow: 0,
|
|
2057
|
+
reportPrintUrl: "",
|
|
2058
|
+
joinQuery: 0,
|
|
2059
|
+
modelFullscreen: 0,
|
|
2060
|
+
modalMinWidth: ""
|
|
2061
|
+
}), { onlineFormContext: F, resetContext: E } = useOnlineFormContext(), {
|
|
2062
|
+
formSchemas: $,
|
|
2063
|
+
defaultValueFields: A,
|
|
2064
|
+
changeDataIfArray2String: I,
|
|
2065
|
+
tableName: N,
|
|
2066
|
+
dbData: S,
|
|
2067
|
+
checkOnlyFieldValue: V,
|
|
2068
|
+
hasSubTable: W,
|
|
2069
|
+
subTabInfo: j,
|
|
2070
|
+
refMap: B,
|
|
2071
|
+
subDataSource: p,
|
|
2072
|
+
baseColProps: y,
|
|
2073
|
+
createFormSchemas: C,
|
|
2074
|
+
fieldDisplayStatus: x
|
|
2075
|
+
} = useFormItems(n, a);
|
|
2076
|
+
let { EnhanceJS: d, initCgEnhanceJs: u } = useEnhance(F, !1);
|
|
2077
|
+
const [c, { setProps: s, validate: l, resetFields: f, setFieldsValue: T, updateSchema: D, getFieldsValue: H, scrollToField: Y }] = useForm({
|
|
2078
|
+
schemas: $,
|
|
2079
|
+
showActionButtonGroup: !1,
|
|
2080
|
+
baseColProps: y
|
|
2081
|
+
}), q = ref(!1);
|
|
2082
|
+
function z() {
|
|
2083
|
+
let r = n.disabled;
|
|
2084
|
+
q.value = r, s({ disabled: r });
|
|
2085
|
+
}
|
|
2086
|
+
function te(r, m, w) {
|
|
2087
|
+
return J(this, null, function* () {
|
|
2088
|
+
console.log("onlinepopform新增编辑进入表单》》form", m), yield f(), S.value = "";
|
|
2089
|
+
let k = unref(r);
|
|
2090
|
+
_.value = k, k && (yield oe(m)), yield nextTick(() => {
|
|
2091
|
+
!k && w && T(w), ie(), fe("js", "loaded"), z();
|
|
2092
|
+
});
|
|
2093
|
+
});
|
|
2094
|
+
}
|
|
2095
|
+
function ie() {
|
|
2096
|
+
if (unref(_) === !1) {
|
|
2097
|
+
let r = toRaw(A[N.value]);
|
|
2098
|
+
loadFormFieldsDefVal(r, (m) => {
|
|
2099
|
+
T(m);
|
|
2100
|
+
});
|
|
2101
|
+
}
|
|
2102
|
+
}
|
|
2103
|
+
function oe(r) {
|
|
2104
|
+
return J(this, null, function* () {
|
|
2105
|
+
let m = yield L(r.id);
|
|
2106
|
+
(!m || Object.keys(m).length == 0) && (m = ne({}, toRaw(r))), S.value = Object.assign({}, m);
|
|
2107
|
+
let w = le.value, k = pick(m, ...w);
|
|
2108
|
+
n.isVxeTableData === !0 && (k = Object.assign({}, k, r)), yield T(k);
|
|
2109
|
+
});
|
|
2110
|
+
}
|
|
2111
|
+
let le = computed(() => {
|
|
2112
|
+
let r = $.value, m = [];
|
|
2113
|
+
for (let w of r)
|
|
2114
|
+
m.push(w.field);
|
|
2115
|
+
return m;
|
|
2116
|
+
});
|
|
2117
|
+
function L(r) {
|
|
2118
|
+
let m = `${urlObject.optPre}${n.id}/${r}`;
|
|
2119
|
+
return new Promise((w, k) => {
|
|
2120
|
+
defHttp.get({ url: m }, { isTransformResponse: !1 }).then((K) => {
|
|
2121
|
+
K.success ? w(K.result) : (k(), t.warning(K.message));
|
|
2122
|
+
}).catch(() => {
|
|
2123
|
+
k();
|
|
2124
|
+
});
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2127
|
+
function U(r) {
|
|
2128
|
+
return J(this, null, function* () {
|
|
2129
|
+
P.value = r.head.tableType, N.value = r.head.tableName, v.value = r.head.tableType == 1, X(r.head.extConfigJson), C(r.schema.properties, r.schema.required, V), d = u(r.enhanceJs), e("rendered", M);
|
|
2130
|
+
let m = yield getRefPromise(a);
|
|
2131
|
+
m.$formValueChange = (w, k, K) => {
|
|
2132
|
+
Pe(w, k), K && T(K);
|
|
2133
|
+
};
|
|
2134
|
+
});
|
|
2135
|
+
}
|
|
2136
|
+
function X(r) {
|
|
2137
|
+
let m = { reportPrintShow: 0, reportPrintUrl: "", joinQuery: 0, modelFullscreen: 1, modalMinWidth: "" };
|
|
2138
|
+
r && (m = JSON.parse(r)), Object.keys(m).map((w) => {
|
|
2139
|
+
M[w] = m[w];
|
|
2140
|
+
});
|
|
2141
|
+
}
|
|
2142
|
+
function G() {
|
|
2143
|
+
v.value === !0 ? ae() : Q();
|
|
2144
|
+
}
|
|
2145
|
+
function Q() {
|
|
2146
|
+
R().then((r) => {
|
|
2147
|
+
ue(r);
|
|
2148
|
+
});
|
|
2149
|
+
}
|
|
2150
|
+
function R() {
|
|
2151
|
+
let r = {};
|
|
2152
|
+
return new Promise((m, w) => {
|
|
2153
|
+
l().then(
|
|
2154
|
+
(k) => m(k),
|
|
2155
|
+
({ errorFields: k }) => {
|
|
2156
|
+
k && k.length > 0 && Y(k[0][0]), w(VALIDATE_FAILED);
|
|
2157
|
+
}
|
|
2158
|
+
);
|
|
2159
|
+
}).then((m) => (Object.assign(r, I(m)), ee())).then((m) => (Object.assign(r, m), Promise.resolve(r))).catch((m) => (m === VALIDATE_FAILED || (m == null ? void 0 : m.code) === VALIDATE_FAILED ? (t.warning("校验未通过"), m.key && Z(m.key)) : console.error(m), Promise.reject(null)));
|
|
2160
|
+
}
|
|
2161
|
+
function Z(r) {
|
|
2162
|
+
let m = j.value;
|
|
2163
|
+
for (let w = 0; w < m.length; w++)
|
|
2164
|
+
if (r == m[w].key) {
|
|
2165
|
+
de.value = w + "";
|
|
2166
|
+
break;
|
|
2167
|
+
}
|
|
2168
|
+
}
|
|
2169
|
+
function ee() {
|
|
2170
|
+
return new Promise((r, m) => J(this, null, function* () {
|
|
2171
|
+
let w = {};
|
|
2172
|
+
try {
|
|
2173
|
+
let k = j.value;
|
|
2174
|
+
for (let K = 0; K < k.length; K++) {
|
|
2175
|
+
let re = k[K].key, se = B[re].value;
|
|
2176
|
+
if (se instanceof Array && (se = se[0]), k[K].relationType == 1)
|
|
2177
|
+
try {
|
|
2178
|
+
let me = yield se.getAll();
|
|
2179
|
+
w[re] = [], w[re].push(me);
|
|
2180
|
+
} catch (me) {
|
|
2181
|
+
throw { code: VALIDATE_FAILED, key: re };
|
|
2182
|
+
}
|
|
2183
|
+
else {
|
|
2184
|
+
if (yield se.fullValidateTable())
|
|
2185
|
+
throw { code: VALIDATE_FAILED, key: re };
|
|
2186
|
+
w[re] = se.getTableData();
|
|
2187
|
+
}
|
|
2188
|
+
}
|
|
2189
|
+
} catch (k) {
|
|
2190
|
+
m(k);
|
|
2191
|
+
}
|
|
2192
|
+
r(w);
|
|
2193
|
+
}));
|
|
2194
|
+
}
|
|
2195
|
+
function ae() {
|
|
2196
|
+
return J(this, null, function* () {
|
|
2197
|
+
try {
|
|
2198
|
+
let r = yield l();
|
|
2199
|
+
r = Object.assign({}, S.value, r), r = I(r), g.value = !0, ue(r);
|
|
2200
|
+
} finally {
|
|
2201
|
+
g.value = !1;
|
|
2202
|
+
}
|
|
2203
|
+
});
|
|
2204
|
+
}
|
|
2205
|
+
function ue(r) {
|
|
2206
|
+
Ee(ye, r).then(() => {
|
|
2207
|
+
Ve(r);
|
|
2208
|
+
}).catch((m) => {
|
|
2209
|
+
t.warning(m);
|
|
2210
|
+
});
|
|
2211
|
+
}
|
|
2212
|
+
function ce(r, m, w) {
|
|
2213
|
+
m && w ? w.setValues ? w.setValues(r) : w.setValues([
|
|
2214
|
+
{
|
|
2215
|
+
rowKey: m,
|
|
2216
|
+
values: r
|
|
2217
|
+
}
|
|
2218
|
+
]) : T(r);
|
|
2219
|
+
}
|
|
2220
|
+
function Fe(r, m) {
|
|
2221
|
+
let w = {};
|
|
2222
|
+
w[r] = m, T(w);
|
|
2223
|
+
}
|
|
2224
|
+
const de = ref("0"), he = ref(300), ge = ref(340);
|
|
2225
|
+
function Se(r) {
|
|
2226
|
+
if (_.value === !0) {
|
|
2227
|
+
let m = S.value;
|
|
2228
|
+
return _e(m, r);
|
|
2229
|
+
}
|
|
2230
|
+
return "";
|
|
2231
|
+
}
|
|
2232
|
+
function _e(r, m) {
|
|
2233
|
+
if (r) {
|
|
2234
|
+
let w = r[m];
|
|
2235
|
+
return !w && w !== 0 && (w = r[m.toLowerCase()], !w && w !== 0 && (w = r[m.toUpperCase()])), w;
|
|
2236
|
+
}
|
|
2237
|
+
return "";
|
|
2238
|
+
}
|
|
2239
|
+
function we(r, m) {
|
|
2240
|
+
if (d && d[m + "_onlChange"]) {
|
|
2241
|
+
let w = d[m + "_onlChange"](), k = Object.keys(r)[0];
|
|
2242
|
+
if (w[k]) {
|
|
2243
|
+
let K = B[m].value;
|
|
2244
|
+
K instanceof Array && (K = K[0]);
|
|
2245
|
+
let re = K.getFormEvent(), se = ne({
|
|
2246
|
+
column: { key: k },
|
|
2247
|
+
value: r[k]
|
|
2248
|
+
}, re);
|
|
2249
|
+
w[k].call(F, F, se);
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
}
|
|
2253
|
+
function xe(r, m) {
|
|
2254
|
+
if (d && d[m + "_onlChange"]) {
|
|
2255
|
+
let w = d[m + "_onlChange"](F);
|
|
2256
|
+
w[r.column.key] && w[r.column.key].call(F, F, r);
|
|
2257
|
+
}
|
|
2258
|
+
}
|
|
2259
|
+
function Oe(r, m) {
|
|
2260
|
+
console.log("handleAdded", r, m);
|
|
2261
|
+
}
|
|
2262
|
+
function Ie(r) {
|
|
2263
|
+
return "online_" + r + ":";
|
|
2264
|
+
}
|
|
2265
|
+
function Pe(r, m) {
|
|
2266
|
+
return J(this, null, function* () {
|
|
2267
|
+
if (S.value[r] != m && e("dataChange", r), !d || !d.onlChange || !r)
|
|
2268
|
+
return !1;
|
|
2269
|
+
let k = d.onlChange();
|
|
2270
|
+
if (k[r]) {
|
|
2271
|
+
let re = {
|
|
2272
|
+
row: yield H(),
|
|
2273
|
+
column: { key: r },
|
|
2274
|
+
value: m
|
|
2275
|
+
};
|
|
2276
|
+
k[r].call(F, F, re);
|
|
2277
|
+
}
|
|
2278
|
+
});
|
|
2279
|
+
}
|
|
2280
|
+
function fe(r, m) {
|
|
2281
|
+
if (r == "js")
|
|
2282
|
+
d && d[m] && d[m].call(F, F);
|
|
2283
|
+
else if (r == "action") {
|
|
2284
|
+
let w = S.value, k = {
|
|
2285
|
+
formId: n.id,
|
|
2286
|
+
buttonCode: m,
|
|
2287
|
+
dataId: w.id,
|
|
2288
|
+
uiFormData: Object.assign({}, w)
|
|
2289
|
+
};
|
|
2290
|
+
defHttp.post(
|
|
2291
|
+
{
|
|
2292
|
+
url: `${urlObject.urlButtonAction}`,
|
|
2293
|
+
params: k
|
|
2294
|
+
},
|
|
2295
|
+
{ isTransformResponse: !1 }
|
|
2296
|
+
).then((K) => {
|
|
2297
|
+
K.success ? t.success("处理完成!") : t.warning("处理失败!");
|
|
2298
|
+
});
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
function be(r) {
|
|
2302
|
+
let m = B[r].value, w = [...m.getNewDataWithId(), ...p.value[r]];
|
|
2303
|
+
if (!w || w.length == 0)
|
|
2304
|
+
return !1;
|
|
2305
|
+
let k = [];
|
|
2306
|
+
for (let K of w)
|
|
2307
|
+
k.push(K.id);
|
|
2308
|
+
m.removeRowsById(k);
|
|
2309
|
+
}
|
|
2310
|
+
function Ce(r, m) {
|
|
2311
|
+
if (!m)
|
|
2312
|
+
return !1;
|
|
2313
|
+
let w = B[r].value;
|
|
2314
|
+
typeof m == "object" ? w.addRows(m, !0) : t.error("添加子表数据,参数不识别!");
|
|
2315
|
+
}
|
|
2316
|
+
function De(r, m) {
|
|
2317
|
+
be(r), Ce(r, m);
|
|
2318
|
+
}
|
|
2319
|
+
function Me(r, m) {
|
|
2320
|
+
!m && m.length <= 0 && (m = []), m.map((w) => {
|
|
2321
|
+
w.hasOwnProperty("label") || (w.label = w.text);
|
|
2322
|
+
}), D({
|
|
2323
|
+
field: r,
|
|
2324
|
+
componentProps: {
|
|
2325
|
+
options: m
|
|
2326
|
+
}
|
|
2327
|
+
});
|
|
2328
|
+
}
|
|
2329
|
+
function Ee(r, m) {
|
|
2330
|
+
return d && d.beforeSubmit ? d.beforeSubmit(r, m) : Promise.resolve();
|
|
2331
|
+
}
|
|
2332
|
+
function ke(r, m) {
|
|
2333
|
+
let w = toRaw(x);
|
|
2334
|
+
r && r.length > 0 ? Object.keys(w).map((k) => {
|
|
2335
|
+
!k.endsWith("_load") && r.indexOf(k) < 0 && (x[k] = !1);
|
|
2336
|
+
}) : m && m.length > 0 && Object.keys(w).map((k) => {
|
|
2337
|
+
m.indexOf(k) >= 0 && (x[k] = !1);
|
|
2338
|
+
});
|
|
2339
|
+
}
|
|
2340
|
+
function Re(r) {
|
|
2341
|
+
return J(this, null, function* () {
|
|
2342
|
+
console.log("自定义弹窗打开online表单》》form", r), yield f(), S.value = "", _.value = !0, yield oe(r), yield nextTick(() => {
|
|
2343
|
+
fe("js", "loaded");
|
|
2344
|
+
});
|
|
2345
|
+
});
|
|
2346
|
+
}
|
|
2347
|
+
function Ae(r) {
|
|
2348
|
+
let m = B[r].value;
|
|
2349
|
+
return m instanceof Array && (m = m[0]), m;
|
|
2350
|
+
}
|
|
2351
|
+
function $e() {
|
|
2352
|
+
let r = M.reportPrintUrl, m = S.value.id, w = getToken();
|
|
2353
|
+
goJmReportViewPage(r, m, w);
|
|
2354
|
+
}
|
|
2355
|
+
function Ne(r) {
|
|
2356
|
+
console.log(r), i.value = r.id, b(!0);
|
|
2357
|
+
}
|
|
2358
|
+
function Le(r) {
|
|
2359
|
+
console.log(r);
|
|
2360
|
+
}
|
|
2361
|
+
function Ve(r) {
|
|
2362
|
+
if (Object.keys(r).map((m) => {
|
|
2363
|
+
Array.isArray(r[m]) && r[m].length == 0 && (r[m] = "");
|
|
2364
|
+
}), console.log("提交pop表单数据》》》form:", r), n.request == !1)
|
|
2365
|
+
e("success", r);
|
|
2366
|
+
else {
|
|
2367
|
+
let m = `${urlObject.optPre}${n.id}?tabletype=${P.value}`;
|
|
2368
|
+
console.log("提交pop表单url》》》url:", m), O.value === !0 && (r[SUBMIT_FLOW_KEY] = 1);
|
|
2369
|
+
let w = _.value === !0 ? "put" : "post";
|
|
2370
|
+
defHttp.request({ url: m, method: w, params: r }, { isTransformResponse: !1 }).then((k) => {
|
|
2371
|
+
k.success ? (k.result && (r.id || (r.id = k.result)), e("success", r), S.value = r, _.value = !0, t.success("操作成功!")) : t.warning(k.message);
|
|
2372
|
+
}).finally(() => {
|
|
2373
|
+
g.value = !1;
|
|
2374
|
+
});
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
function Be() {
|
|
2378
|
+
return J(this, null, function* () {
|
|
2379
|
+
let r = S.value, m = le.value, w = pick(r, ...m);
|
|
2380
|
+
if (r)
|
|
2381
|
+
yield T(w);
|
|
2382
|
+
else {
|
|
2383
|
+
let k = {};
|
|
2384
|
+
for (let K of m)
|
|
2385
|
+
k[K] = "";
|
|
2386
|
+
yield T(k);
|
|
2387
|
+
}
|
|
2388
|
+
});
|
|
2389
|
+
}
|
|
2390
|
+
let ye = {
|
|
2391
|
+
tableName: N,
|
|
2392
|
+
loading: g,
|
|
2393
|
+
subActiveKey: de,
|
|
2394
|
+
onlineFormRef: a,
|
|
2395
|
+
getFieldsValue: H,
|
|
2396
|
+
setFieldsValue: T,
|
|
2397
|
+
submitFlowFlag: O,
|
|
2398
|
+
subFormHeight: he,
|
|
2399
|
+
subTableHeight: ge,
|
|
2400
|
+
refMap: B,
|
|
2401
|
+
triggleChangeValues: ce,
|
|
2402
|
+
triggleChangeValue: Fe,
|
|
2403
|
+
sh: x,
|
|
2404
|
+
clearSubRows: be,
|
|
2405
|
+
addSubRows: Ce,
|
|
2406
|
+
clearThenAddRows: De,
|
|
2407
|
+
changeOptions: Me,
|
|
2408
|
+
isUpdate: _,
|
|
2409
|
+
getSubTableInstance: Ae
|
|
2410
|
+
};
|
|
2411
|
+
return E(ye), {
|
|
2412
|
+
//主表
|
|
2413
|
+
tableName: N,
|
|
2414
|
+
onlineFormRef: a,
|
|
2415
|
+
registerForm: c,
|
|
2416
|
+
loading: g,
|
|
2417
|
+
//子表
|
|
2418
|
+
subActiveKey: de,
|
|
2419
|
+
hasSubTable: W,
|
|
2420
|
+
subTabInfo: j,
|
|
2421
|
+
refMap: B,
|
|
2422
|
+
//一对一子表
|
|
2423
|
+
subFormHeight: he,
|
|
2424
|
+
getSubTableForeignKeyValue: Se,
|
|
2425
|
+
isUpdate: _,
|
|
2426
|
+
handleSubFormChange: we,
|
|
2427
|
+
//一对多子表
|
|
2428
|
+
subTableHeight: ge,
|
|
2429
|
+
onlineFormDisabled: q,
|
|
2430
|
+
subDataSource: p,
|
|
2431
|
+
getSubTableAuthPre: Ie,
|
|
2432
|
+
handleAdded: Oe,
|
|
2433
|
+
handleValueChange: xe,
|
|
2434
|
+
openSubFormModalForAdd: Ne,
|
|
2435
|
+
openSubFormModalForEdit: Le,
|
|
2436
|
+
registerVxeFormModal: o,
|
|
2437
|
+
vxeTableId: i,
|
|
2438
|
+
//父组件调用
|
|
2439
|
+
show: te,
|
|
2440
|
+
createRootProperties: U,
|
|
2441
|
+
handleSubmit: G,
|
|
2442
|
+
sh: x,
|
|
2443
|
+
handleCgButtonClick: fe,
|
|
2444
|
+
handleCustomFormSh: ke,
|
|
2445
|
+
handleCustomFormEdit: Re,
|
|
2446
|
+
//跳转
|
|
2447
|
+
dbData: S,
|
|
2448
|
+
onOpenReportPrint: $e,
|
|
2449
|
+
onlineExtConfigJson: M,
|
|
2450
|
+
recoverFormData: Be
|
|
2451
|
+
};
|
|
2452
|
+
}
|
|
2453
|
+
}, _hoisted_1$3 = ["id"];
|
|
2454
|
+
function _sfc_render$4(n, e, t, o, b, i) {
|
|
2455
|
+
const a = resolveComponent("BasicForm");
|
|
2456
|
+
return openBlock(), createElementBlock("div", {
|
|
2457
|
+
id: o.tableName + "_form"
|
|
2458
|
+
}, [
|
|
2459
|
+
createVNode(a, {
|
|
2460
|
+
ref: "onlineFormRef",
|
|
2461
|
+
onRegister: o.registerForm
|
|
2462
|
+
}, null, 8, ["onRegister"])
|
|
2463
|
+
], 8, _hoisted_1$3);
|
|
2464
|
+
}
|
|
2465
|
+
const OnlinePopForm = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]), OnlinePopForm$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2466
|
+
__proto__: null,
|
|
2467
|
+
default: OnlinePopForm
|
|
2468
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2469
|
+
function useAutoModal(n, { emit: e } = {}, t) {
|
|
2470
|
+
const o = ref(null), b = ref(!1), i = ref(1), a = ref([]), v = ref(!1), g = ref(0), P = ref(!1), O = ref(""), _ = ref(!1), M = ref(!1), F = ref(!0), E = reactive({}), $ = ref(!0), A = ref(""), I = ref(!0), N = ref(!1), { popModalFixedWidth: S, resetBodyStyle: V, popBodyStyle: W } = useFixedHeightModal(), j = ref(!1), B = ref(""), p = {
|
|
2471
|
+
handleOpenModal: (R) => {
|
|
2472
|
+
}
|
|
2473
|
+
}, y = ref(""), C = ref(""), x = ref(!1);
|
|
2474
|
+
let d = {};
|
|
2475
|
+
const u = computed(() => {
|
|
2476
|
+
let R = A.value;
|
|
2477
|
+
return R || (unref(b) === !0 ? "详情" : unref(M) === !0 ? "编辑" : "新增");
|
|
2478
|
+
}), [c, { setModalProps: s, closeModal: l }] = useModalInner((R) => J(this, null, function* () {
|
|
2479
|
+
A.value = "", N.value = !1, n === !0 ? yield p.handleOpenModal(R) : yield D(R), V(), t && t();
|
|
2480
|
+
})), f = ref(!1);
|
|
2481
|
+
function T() {
|
|
2482
|
+
return J(this, null, function* () {
|
|
2483
|
+
return yield getRefPromise(f), j.value;
|
|
2484
|
+
});
|
|
2485
|
+
}
|
|
2486
|
+
function D(R) {
|
|
2487
|
+
return J(this, null, function* () {
|
|
2488
|
+
s({ confirmLoading: !1 }), M.value = R.isUpdate, b.value = R.disableSubmit || !1, (R == null ? void 0 : R.hideSub) === !0 && ($.value = !1), R != null && R.title && (A.value = R.title), R != null && R.record ? C.value = R.record.id : C.value = "", yield nextTick(() => J(this, null, function* () {
|
|
2489
|
+
yield getRefPromise(v), Y(), yield o.value.show(R == null ? void 0 : R.isUpdate, R == null ? void 0 : R.record, R == null ? void 0 : R.param);
|
|
2490
|
+
}));
|
|
2491
|
+
});
|
|
2492
|
+
}
|
|
2493
|
+
function H(R) {
|
|
2494
|
+
v.value = !0, g.value = R.modalMinWidth, R.modelFullscreen == 1 ? s({ defaultFullscreen: !0 }) : s({ defaultFullscreen: !1 }), d = R;
|
|
2495
|
+
}
|
|
2496
|
+
function Y() {
|
|
2497
|
+
let R = C.value;
|
|
2498
|
+
d.commentStatus == 1 && R ? (x.value = !0, s({ defaultFullscreen: !0 })) : x.value = !1;
|
|
2499
|
+
}
|
|
2500
|
+
const q = 800, z = 1100, te = computed(() => {
|
|
2501
|
+
let R = 200 * (i.value - 1), Z = (unref(F) ? q : z) + R;
|
|
2502
|
+
Z = ie(Z);
|
|
2503
|
+
let ee = g.value;
|
|
2504
|
+
return console.log({ minWidth: ee }), ee && Z < ee && (Z = ee), console.log({ width: Z }), Z;
|
|
2505
|
+
});
|
|
2506
|
+
function ie(R) {
|
|
2507
|
+
let Z = E.modalMinWidth;
|
|
2508
|
+
if (Z != null && Z !== "")
|
|
2509
|
+
try {
|
|
2510
|
+
if (Z = Number.parseInt(Z), R < Z)
|
|
2511
|
+
return Z;
|
|
2512
|
+
} catch (ee) {
|
|
2513
|
+
console.warn("error modalMinWidth value: ", Z);
|
|
2514
|
+
}
|
|
2515
|
+
return R;
|
|
2516
|
+
}
|
|
2517
|
+
function oe(R, Z) {
|
|
2518
|
+
o.value.handleCgButtonClick(R, Z);
|
|
2519
|
+
}
|
|
2520
|
+
function le() {
|
|
2521
|
+
_.value = !0, setTimeout(() => {
|
|
2522
|
+
_.value = !1;
|
|
2523
|
+
}, 1500), o.value.handleSubmit();
|
|
2524
|
+
}
|
|
2525
|
+
function L() {
|
|
2526
|
+
l();
|
|
2527
|
+
}
|
|
2528
|
+
function U(R, Z = {}) {
|
|
2529
|
+
let ee = `/online/cgform/api/getFormItem/${R}`;
|
|
2530
|
+
return new Promise((ae, ue) => {
|
|
2531
|
+
defHttp.get({ url: ee, params: Z }, { isTransformResponse: !1 }).then((ce) => {
|
|
2532
|
+
console.log("表单结果》》modal:", ce), ce.success ? ae(ce.result) : ue(ce.message);
|
|
2533
|
+
}).catch(() => {
|
|
2534
|
+
ue();
|
|
2535
|
+
});
|
|
2536
|
+
});
|
|
2537
|
+
}
|
|
2538
|
+
function X(R, Z) {
|
|
2539
|
+
return J(this, null, function* () {
|
|
2540
|
+
let ee = yield U(R, Z), ae = ee.head.formTemplate;
|
|
2541
|
+
i.value = ae ? Number(ae) : 1, a.value = ee.cgButtonList, P.value = ee.head.isTree === "Y", O.value = ee.head.treeParentIdField || "", y.value = ee.head.tableName, B.value = ee.head.themeTemplate, ee.form_disable_update === !0 ? j.value = !0 : j.value = !1, f.value = !0, e && e("formConfig", ee), yield nextTick(() => J(this, null, function* () {
|
|
2542
|
+
yield (yield getRefPromise(o)).createRootProperties(ee);
|
|
2543
|
+
}));
|
|
2544
|
+
});
|
|
2545
|
+
}
|
|
2546
|
+
function G(R) {
|
|
2547
|
+
R[ONL_FORM_TABLE_NAME] = y.value, e("success", R), I.value == !0 && l(), N.value = !1, I.value = !0;
|
|
2548
|
+
}
|
|
2549
|
+
function Q() {
|
|
2550
|
+
o.value && o.value.onCloseModal();
|
|
2551
|
+
}
|
|
2552
|
+
return {
|
|
2553
|
+
// modal
|
|
2554
|
+
title: u,
|
|
2555
|
+
modalWidth: te,
|
|
2556
|
+
registerModal: c,
|
|
2557
|
+
closeModal: l,
|
|
2558
|
+
modalObject: p,
|
|
2559
|
+
onCloseEvent: Q,
|
|
2560
|
+
// 自定义按钮
|
|
2561
|
+
cgButtonList: a,
|
|
2562
|
+
handleCgButtonClick: oe,
|
|
2563
|
+
// 提交/关闭按钮
|
|
2564
|
+
disableSubmit: b,
|
|
2565
|
+
handleSubmit: le,
|
|
2566
|
+
submitLoading: _,
|
|
2567
|
+
handleCancel: L,
|
|
2568
|
+
successThenClose: I,
|
|
2569
|
+
handleSuccess: G,
|
|
2570
|
+
topTipVisible: N,
|
|
2571
|
+
//表单
|
|
2572
|
+
handleFormConfig: X,
|
|
2573
|
+
onlineFormCompRef: o,
|
|
2574
|
+
formTemplate: i,
|
|
2575
|
+
isTreeForm: P,
|
|
2576
|
+
pidFieldName: O,
|
|
2577
|
+
renderSuccess: H,
|
|
2578
|
+
formRendered: v,
|
|
2579
|
+
isUpdate: M,
|
|
2580
|
+
showSub: $,
|
|
2581
|
+
themeTemplate: B,
|
|
2582
|
+
// 评论区域参数
|
|
2583
|
+
tableName: y,
|
|
2584
|
+
formDataId: C,
|
|
2585
|
+
enableComment: x,
|
|
2586
|
+
popBodyStyle: W,
|
|
2587
|
+
popModalFixedWidth: S,
|
|
2588
|
+
getFormStatus: T
|
|
2589
|
+
};
|
|
2590
|
+
}
|
|
2591
|
+
function useFixedHeightModal() {
|
|
2592
|
+
const e = ref(800);
|
|
2593
|
+
let t = window.innerWidth - 300;
|
|
2594
|
+
t < 800 && (t = 800), e.value = t;
|
|
2595
|
+
const o = ref({});
|
|
2596
|
+
function b() {
|
|
2597
|
+
let i = window.innerHeight - 210;
|
|
2598
|
+
o.value = {
|
|
2599
|
+
height: i + "px",
|
|
2600
|
+
overflowY: "auto"
|
|
2601
|
+
};
|
|
2602
|
+
}
|
|
2603
|
+
return {
|
|
2604
|
+
popModalFixedWidth: e,
|
|
2605
|
+
popBodyStyle: o,
|
|
2606
|
+
resetBodyStyle: b
|
|
2607
|
+
};
|
|
2608
|
+
}
|
|
2609
|
+
const _sfc_main$3 = defineComponent({
|
|
2610
|
+
name: "OnlinePopModal",
|
|
2611
|
+
props: {
|
|
2612
|
+
/**可以是表名 可以是ID*/
|
|
2613
|
+
id: {
|
|
2614
|
+
type: String,
|
|
2615
|
+
default: ""
|
|
2616
|
+
},
|
|
2617
|
+
/*展示字段名*/
|
|
2618
|
+
showFields: {
|
|
2619
|
+
type: Array,
|
|
2620
|
+
default: () => []
|
|
2621
|
+
},
|
|
2622
|
+
/*隐藏字段名*/
|
|
2623
|
+
hideFields: {
|
|
2624
|
+
type: Array,
|
|
2625
|
+
default: () => []
|
|
2626
|
+
},
|
|
2627
|
+
topTip: {
|
|
2628
|
+
type: Boolean,
|
|
2629
|
+
default: !1
|
|
2630
|
+
},
|
|
2631
|
+
request: {
|
|
2632
|
+
type: Boolean,
|
|
2633
|
+
default: !0
|
|
2634
|
+
},
|
|
2635
|
+
saveClose: {
|
|
2636
|
+
type: Boolean,
|
|
2637
|
+
default: !1
|
|
2638
|
+
},
|
|
2639
|
+
// 是否是vxeTable上方按钮点击打开的表单数据
|
|
2640
|
+
isVxeTableData: {
|
|
2641
|
+
type: Boolean,
|
|
2642
|
+
default: !1
|
|
2643
|
+
},
|
|
2644
|
+
formTableType: {
|
|
2645
|
+
type: String,
|
|
2646
|
+
default: ""
|
|
2647
|
+
}
|
|
2648
|
+
},
|
|
2649
|
+
components: {
|
|
2650
|
+
BasicModal,
|
|
2651
|
+
OnlinePopForm,
|
|
2652
|
+
JModalTip,
|
|
2653
|
+
Button
|
|
2654
|
+
},
|
|
2655
|
+
emits: ["success", "register", "formConfig"],
|
|
2656
|
+
setup(n, { emit: e }) {
|
|
2657
|
+
console.log("进入表单弹框》》》》modal");
|
|
2658
|
+
const {
|
|
2659
|
+
title: t,
|
|
2660
|
+
registerModal: o,
|
|
2661
|
+
cgButtonList: b,
|
|
2662
|
+
handleCgButtonClick: i,
|
|
2663
|
+
disableSubmit: a,
|
|
2664
|
+
handleSubmit: v,
|
|
2665
|
+
submitLoading: g,
|
|
2666
|
+
handleCancel: P,
|
|
2667
|
+
handleFormConfig: O,
|
|
2668
|
+
onlineFormCompRef: _,
|
|
2669
|
+
formTemplate: M,
|
|
2670
|
+
isTreeForm: F,
|
|
2671
|
+
pidFieldName: E,
|
|
2672
|
+
renderSuccess: $,
|
|
2673
|
+
formRendered: A,
|
|
2674
|
+
handleSuccess: I,
|
|
2675
|
+
topTipVisible: N,
|
|
2676
|
+
successThenClose: S,
|
|
2677
|
+
isUpdate: V,
|
|
2678
|
+
popBodyStyle: W,
|
|
2679
|
+
popModalFixedWidth: j,
|
|
2680
|
+
getFormStatus: B
|
|
2681
|
+
} = useAutoModal(!1, { emit: e });
|
|
2682
|
+
watch(() => n.id, p, { immediate: !0 });
|
|
2683
|
+
function p() {
|
|
2684
|
+
return J(this, null, function* () {
|
|
2685
|
+
if (A.value = !1, !n.id)
|
|
2686
|
+
return;
|
|
2687
|
+
console.log("重新渲染表单》》》》modal");
|
|
2688
|
+
let s = {};
|
|
2689
|
+
n.formTableType && (s.tabletype = n.formTableType), yield O(n.id, s);
|
|
2690
|
+
});
|
|
2691
|
+
}
|
|
2692
|
+
function y() {
|
|
2693
|
+
n.saveClose === !1 && (S.value = !1), v();
|
|
2694
|
+
}
|
|
2695
|
+
function C() {
|
|
2696
|
+
N.value = !1, _.value.recoverFormData();
|
|
2697
|
+
}
|
|
2698
|
+
function x() {
|
|
2699
|
+
N.value = !0;
|
|
2700
|
+
}
|
|
2701
|
+
const d = computed(() => V.value ? n.topTip : !1), u = computed(() => {
|
|
2702
|
+
if (V.value == !0)
|
|
2703
|
+
return null;
|
|
2704
|
+
{
|
|
2705
|
+
let s = g.value;
|
|
2706
|
+
return [
|
|
2707
|
+
h(Button, { type: "primary", loading: s, onClick: v }, () => "确定"),
|
|
2708
|
+
h(Button, { onClick: P }, () => "关闭")
|
|
2709
|
+
];
|
|
2710
|
+
}
|
|
2711
|
+
});
|
|
2712
|
+
return {
|
|
2713
|
+
title: t,
|
|
2714
|
+
topTipVisible: N,
|
|
2715
|
+
handleSaveData: y,
|
|
2716
|
+
handleRecover: C,
|
|
2717
|
+
onlineFormCompRef: _,
|
|
2718
|
+
renderSuccess: $,
|
|
2719
|
+
registerModal: o,
|
|
2720
|
+
handleSubmit: v,
|
|
2721
|
+
handleSuccess: I,
|
|
2722
|
+
handleCancel: P,
|
|
2723
|
+
formTemplate: M,
|
|
2724
|
+
disableSubmit: a,
|
|
2725
|
+
cgButtonList: b,
|
|
2726
|
+
handleCgButtonClick: i,
|
|
2727
|
+
isTreeForm: F,
|
|
2728
|
+
pidFieldName: E,
|
|
2729
|
+
submitLoading: g,
|
|
2730
|
+
handleDataChange: x,
|
|
2731
|
+
isUpdate: V,
|
|
2732
|
+
showTopTip: d,
|
|
2733
|
+
modalFooter: u,
|
|
2734
|
+
popBodyStyle: W,
|
|
2735
|
+
popModalFixedWidth: j,
|
|
2736
|
+
getFormStatus: B
|
|
2737
|
+
};
|
|
2738
|
+
}
|
|
2739
|
+
});
|
|
2740
|
+
function _sfc_render$3(n, e, t, o, b, i) {
|
|
2741
|
+
const a = resolveComponent("j-modal-tip"), v = resolveComponent("online-pop-form"), g = resolveComponent("BasicModal");
|
|
2742
|
+
return openBlock(), createBlock(g, mergeProps({
|
|
2743
|
+
width: n.popModalFixedWidth,
|
|
2744
|
+
dialogStyle: { top: "70px" },
|
|
2745
|
+
bodyStyle: n.popBodyStyle
|
|
2746
|
+
}, n.$attrs, {
|
|
2747
|
+
footer: n.modalFooter,
|
|
2748
|
+
cancelText: "关闭",
|
|
2749
|
+
onRegister: n.registerModal,
|
|
2750
|
+
wrapClassName: "jeecg-online-pop-modal",
|
|
2751
|
+
onOk: n.handleSubmit
|
|
2752
|
+
}), {
|
|
2753
|
+
title: withCtx(() => [
|
|
2754
|
+
createTextVNode(toDisplayString(n.title) + " ", 1),
|
|
2755
|
+
n.showTopTip ? (openBlock(), createBlock(a, {
|
|
2756
|
+
key: 0,
|
|
2757
|
+
visible: n.topTipVisible,
|
|
2758
|
+
onSave: n.handleSaveData,
|
|
2759
|
+
onCancel: n.handleRecover
|
|
2760
|
+
}, null, 8, ["visible", "onSave", "onCancel"])) : createCommentVNode("", !0)
|
|
2761
|
+
]),
|
|
2762
|
+
default: withCtx(() => [
|
|
2763
|
+
createVNode(v, {
|
|
2764
|
+
ref: "onlineFormCompRef",
|
|
2765
|
+
id: n.id,
|
|
2766
|
+
disabled: n.disableSubmit,
|
|
2767
|
+
"form-template": n.formTemplate,
|
|
2768
|
+
isTree: n.isTreeForm,
|
|
2769
|
+
pidField: n.pidFieldName,
|
|
2770
|
+
request: n.request,
|
|
2771
|
+
isVxeTableData: n.isVxeTableData,
|
|
2772
|
+
onRendered: n.renderSuccess,
|
|
2773
|
+
onSuccess: n.handleSuccess,
|
|
2774
|
+
onDataChange: n.handleDataChange,
|
|
2775
|
+
"modal-class": "jeecg-online-pop-modal"
|
|
2776
|
+
}, null, 8, ["id", "disabled", "form-template", "isTree", "pidField", "request", "isVxeTableData", "onRendered", "onSuccess", "onDataChange"])
|
|
2777
|
+
]),
|
|
2778
|
+
_: 1
|
|
2779
|
+
}, 16, ["width", "bodyStyle", "footer", "onRegister", "onOk"]);
|
|
2780
|
+
}
|
|
2781
|
+
const OnlinePopModal = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]), OnlinePopModal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2782
|
+
__proto__: null,
|
|
2783
|
+
default: OnlinePopModal
|
|
2784
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2785
|
+
function queryTableData(n, e) {
|
|
2786
|
+
const t = "/online/cgform/api/getData/" + n;
|
|
2787
|
+
return defHttp.get({ url: t, params: e });
|
|
2788
|
+
}
|
|
2789
|
+
function queryTableColumns(n, e) {
|
|
2790
|
+
const t = "/online/cgform/api/getColumns/" + n;
|
|
2791
|
+
return defHttp.get({ url: t, params: e });
|
|
2792
|
+
}
|
|
2793
|
+
function useLinkTable(n) {
|
|
2794
|
+
const e = ref("1"), t = ref({}), o = ref({}), b = ref(""), i = reactive({
|
|
2795
|
+
add: !0,
|
|
2796
|
+
update: !0
|
|
2797
|
+
}), a = computed(() => n.textField ? n.textField.split(",") : []), v = ref([]), g = computed(() => {
|
|
2798
|
+
let p = v.value;
|
|
2799
|
+
return n.multi == !0 ? p.slice(0, 3) : p.slice(0, 6);
|
|
2800
|
+
});
|
|
2801
|
+
watchEffect(() => J(this, null, function* () {
|
|
2802
|
+
if (n.tableName) {
|
|
2803
|
+
let y = n.valueField || "", C = n.textField || "", x = [];
|
|
2804
|
+
if (y && x.push(y), C) {
|
|
2805
|
+
let u = C.split(",");
|
|
2806
|
+
b.value = u[0];
|
|
2807
|
+
for (let c of u)
|
|
2808
|
+
x.push(c);
|
|
2809
|
+
}
|
|
2810
|
+
let d = n.imageField || "";
|
|
2811
|
+
d && x.push(d), t.value = {
|
|
2812
|
+
linkTableSelectFields: x.join(",")
|
|
2813
|
+
}, yield F(), yield E();
|
|
2814
|
+
}
|
|
2815
|
+
}));
|
|
2816
|
+
const P = computed(() => {
|
|
2817
|
+
let p = n.textField || "", y = [], C = "";
|
|
2818
|
+
if (p) {
|
|
2819
|
+
let x = p.split(",");
|
|
2820
|
+
C = x[0];
|
|
2821
|
+
for (let d = 0; d < x.length; d++)
|
|
2822
|
+
d > 0 && y.push(x[d]);
|
|
2823
|
+
}
|
|
2824
|
+
return {
|
|
2825
|
+
others: y,
|
|
2826
|
+
labelField: C
|
|
2827
|
+
};
|
|
2828
|
+
}), O = ref([]), _ = ref([]), M = ref({});
|
|
2829
|
+
function F() {
|
|
2830
|
+
return J(this, null, function* () {
|
|
2831
|
+
let p = t.value;
|
|
2832
|
+
const y = yield queryTableColumns(n.tableName, p);
|
|
2833
|
+
if (_.value = y.columns, y.columns) {
|
|
2834
|
+
let C = n.imageField, x = y.columns.filter((d) => d.dataIndex != b.value && d.dataIndex != C);
|
|
2835
|
+
v.value = x;
|
|
2836
|
+
}
|
|
2837
|
+
if (M.value = y.dictOptions, console.log("隐藏的按钮", y.hideColumns), y.hideColumns) {
|
|
2838
|
+
let C = y.hideColumns;
|
|
2839
|
+
C.indexOf("add") >= 0 ? i.add = !1 : i.add = !0, C.indexOf("update") >= 0 ? i.update = !1 : i.update = !0;
|
|
2840
|
+
}
|
|
2841
|
+
});
|
|
2842
|
+
}
|
|
2843
|
+
function E() {
|
|
2844
|
+
return J(this, null, function* () {
|
|
2845
|
+
let p = A(), C = (yield queryTableData(n.tableName, p)).records, x = [], { others: d, labelField: u } = P.value, c = n.imageField;
|
|
2846
|
+
if (C && C.length > 0)
|
|
2847
|
+
for (let s of C) {
|
|
2848
|
+
let l = ne({}, s);
|
|
2849
|
+
$(l);
|
|
2850
|
+
let f = Object.assign({}, pick(l, d), { id: l.id, label: l[u], value: l[n.valueField] });
|
|
2851
|
+
c && (f[c] = l[c]), x.push(f);
|
|
2852
|
+
}
|
|
2853
|
+
x.push({}), O.value = x;
|
|
2854
|
+
});
|
|
2855
|
+
}
|
|
2856
|
+
function $(p) {
|
|
2857
|
+
let y = _.value, C = M.value;
|
|
2858
|
+
for (let x of y) {
|
|
2859
|
+
const { dataIndex: d, customRender: u } = x;
|
|
2860
|
+
(p[d] || p[d] === 0) && u && u == d && C[u] && (p[d] = filterMultiDictText(C[u], p[d]));
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
function A() {
|
|
2864
|
+
return Object.assign({ pageSize: 10, pageNo: e.value }, t.value, o.value);
|
|
2865
|
+
}
|
|
2866
|
+
function I(p) {
|
|
2867
|
+
if (!p)
|
|
2868
|
+
o.value = {};
|
|
2869
|
+
else {
|
|
2870
|
+
let y = a.value, C = [], x = [];
|
|
2871
|
+
for (let d = 0; d < y.length; d++)
|
|
2872
|
+
d <= 1 && (x.push(y[d]), C.push({ field: y[d], rule: "like", val: p }));
|
|
2873
|
+
C.superQueryMatchType = "or", C.superQueryParams = encodeURI(JSON.stringify(C)), o.value = C;
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
function N(p) {
|
|
2877
|
+
return J(this, null, function* () {
|
|
2878
|
+
if (!p)
|
|
2879
|
+
return [];
|
|
2880
|
+
let y = n.valueField, C = pe(ne({}, t.value), {
|
|
2881
|
+
pageSize: 10,
|
|
2882
|
+
pageNo: e.value
|
|
2883
|
+
});
|
|
2884
|
+
C.superQueryMatchType = "and";
|
|
2885
|
+
let x = [{ field: y, rule: "in", val: p }];
|
|
2886
|
+
C.superQueryParams = encodeURI(JSON.stringify(x));
|
|
2887
|
+
let u = (yield queryTableData(n.tableName, C)).records, c = [];
|
|
2888
|
+
if (u && u.length > 0)
|
|
2889
|
+
for (let s of u) {
|
|
2890
|
+
let l = ne({}, s);
|
|
2891
|
+
$(l), c.push(l);
|
|
2892
|
+
}
|
|
2893
|
+
return c;
|
|
2894
|
+
});
|
|
2895
|
+
}
|
|
2896
|
+
function S(p, y) {
|
|
2897
|
+
if (!p || p.length == 0)
|
|
2898
|
+
return !1;
|
|
2899
|
+
let C = y.split(",");
|
|
2900
|
+
if (C.length != p.length)
|
|
2901
|
+
return !1;
|
|
2902
|
+
let x = !0;
|
|
2903
|
+
for (let d of p) {
|
|
2904
|
+
let u = d[n.valueField];
|
|
2905
|
+
C.indexOf(u) < 0 && (x = !1);
|
|
2906
|
+
}
|
|
2907
|
+
return x;
|
|
2908
|
+
}
|
|
2909
|
+
function V(p) {
|
|
2910
|
+
Object.keys(p).map((y) => {
|
|
2911
|
+
p[y] instanceof Array && (p[y] = p[y].join(","));
|
|
2912
|
+
});
|
|
2913
|
+
}
|
|
2914
|
+
function W(p, y, C) {
|
|
2915
|
+
if (C || (C = {}), y && y.length > 0)
|
|
2916
|
+
for (let x of y) {
|
|
2917
|
+
let d = x.split(","), u = d[0], c = d[1];
|
|
2918
|
+
if (p[u])
|
|
2919
|
+
p[u].push(C[c]);
|
|
2920
|
+
else {
|
|
2921
|
+
let s = C[c] || "";
|
|
2922
|
+
p[u] = [s];
|
|
2923
|
+
}
|
|
2924
|
+
}
|
|
2925
|
+
}
|
|
2926
|
+
function j(p) {
|
|
2927
|
+
if (n.imageField) {
|
|
2928
|
+
let y = p[n.imageField];
|
|
2929
|
+
return getFileAccessHttpUrl(y);
|
|
2930
|
+
}
|
|
2931
|
+
return "";
|
|
2932
|
+
}
|
|
2933
|
+
const B = computed(() => !!n.imageField);
|
|
2934
|
+
return {
|
|
2935
|
+
pageNo: e,
|
|
2936
|
+
otherColumns: v,
|
|
2937
|
+
realShowColumns: g,
|
|
2938
|
+
selectOptions: O,
|
|
2939
|
+
reloadTableLinkOptions: E,
|
|
2940
|
+
textFieldArray: a,
|
|
2941
|
+
addQueryParams: I,
|
|
2942
|
+
tableColumns: _,
|
|
2943
|
+
transData: $,
|
|
2944
|
+
mainContentField: b,
|
|
2945
|
+
loadOne: N,
|
|
2946
|
+
compareData: S,
|
|
2947
|
+
formatData: V,
|
|
2948
|
+
initFormData: W,
|
|
2949
|
+
getImageSrc: j,
|
|
2950
|
+
showImage: B,
|
|
2951
|
+
auths: i
|
|
2952
|
+
};
|
|
2953
|
+
}
|
|
2954
|
+
const LinkTableSelect_vue_vue_type_style_index_0_scoped_e9a2adfa_lang = "", _sfc_main$2 = {
|
|
2955
|
+
name: "LinkTableSelect",
|
|
2956
|
+
components: {
|
|
2957
|
+
PlusOutlined,
|
|
2958
|
+
EditOutlined,
|
|
2959
|
+
OnlinePopModal
|
|
2960
|
+
},
|
|
2961
|
+
props: {
|
|
2962
|
+
valueField: propTypes.string.def(""),
|
|
2963
|
+
textField: propTypes.string.def(""),
|
|
2964
|
+
tableName: propTypes.string.def(""),
|
|
2965
|
+
multi: propTypes.bool.def(!1),
|
|
2966
|
+
value: propTypes.oneOfType([propTypes.string, propTypes.number, propTypes.array]),
|
|
2967
|
+
linkFields: propTypes.array.def([]),
|
|
2968
|
+
imageField: propTypes.string.def("")
|
|
2969
|
+
},
|
|
2970
|
+
emits: ["change", "update:value"],
|
|
2971
|
+
setup(n, { emit: e }) {
|
|
2972
|
+
const t = ref([]), { auths: o, mainContentField: b, textFieldArray: i, selectOptions: a, reloadTableLinkOptions: v, addQueryParams: g, formatData: P, initFormData: O, getImageSrc: _, showImage: M } = useLinkTable(n), [F, { openModal: E }] = useModal(), $ = computed(() => n.tableName), A = computed(() => n.multi === !0 ? {
|
|
2973
|
+
mode: "multiple"
|
|
2974
|
+
} : {});
|
|
2975
|
+
function I(p) {
|
|
2976
|
+
p == null || p.stopPropagation(), p == null || p.preventDefault(), E(!0, {});
|
|
2977
|
+
}
|
|
2978
|
+
function N(p, y) {
|
|
2979
|
+
if (p == null || p.stopPropagation(), p == null || p.preventDefault(), o.update == !1) {
|
|
2980
|
+
console.error("当前用户无编辑权限!");
|
|
2981
|
+
return;
|
|
2982
|
+
}
|
|
2983
|
+
E(!0, {
|
|
2984
|
+
isUpdate: !0,
|
|
2985
|
+
record: y
|
|
2986
|
+
});
|
|
2987
|
+
}
|
|
2988
|
+
function S(p) {
|
|
2989
|
+
return J(this, null, function* () {
|
|
2990
|
+
yield v();
|
|
2991
|
+
let y = p[n.valueField];
|
|
2992
|
+
t.value = y;
|
|
2993
|
+
});
|
|
2994
|
+
}
|
|
2995
|
+
function V(p) {
|
|
2996
|
+
g(p), v();
|
|
2997
|
+
}
|
|
2998
|
+
function W(p) {
|
|
2999
|
+
j(p), p || (g(), v());
|
|
3000
|
+
}
|
|
3001
|
+
function j(p) {
|
|
3002
|
+
let y = {}, C = n.linkFields, x = [];
|
|
3003
|
+
if (!p)
|
|
3004
|
+
O(y, C);
|
|
3005
|
+
else {
|
|
3006
|
+
let d = toRaw(a.value);
|
|
3007
|
+
console.log("options>>", d);
|
|
3008
|
+
let u = toRaw(p);
|
|
3009
|
+
u instanceof Array ? x = [...u] : n.multi == !0 ? x = u.split(",") : x = [u];
|
|
3010
|
+
let c = d.filter((s) => x.indexOf(s[n.valueField]) >= 0);
|
|
3011
|
+
if (c && c.length > 0) {
|
|
3012
|
+
let s = ne({}, c[0]);
|
|
3013
|
+
if (c.length > 1)
|
|
3014
|
+
for (let f = 1; f < c.length; f++)
|
|
3015
|
+
s = B(s, c[f]);
|
|
3016
|
+
let l = b.value;
|
|
3017
|
+
s[l] = s.label, O(y, C, s);
|
|
3018
|
+
}
|
|
3019
|
+
}
|
|
3020
|
+
P(y), e("change", x.join(",") || "", y), e("update:value", x.join(",") || "");
|
|
3021
|
+
}
|
|
3022
|
+
function B(p, y) {
|
|
3023
|
+
let C = {};
|
|
3024
|
+
return Object.keys(p).map((x) => {
|
|
3025
|
+
C[x] = (p[x] || "") + "," + (y[x] || "");
|
|
3026
|
+
}), C;
|
|
3027
|
+
}
|
|
3028
|
+
return watch(() => n.value, (p) => J(this, null, function* () {
|
|
3029
|
+
p ? (n.multi == !0 ? t.value = p.split(",") : t.value = p, n.linkFields && n.linkFields.length > 0 && j(p)) : t.value = [];
|
|
3030
|
+
}), { immediate: !0 }), watch(() => a.value, (p) => {
|
|
3031
|
+
p && p.length > 0 && n.linkFields && n.linkFields.length > 0 && t.value && t.value.length > 0 && j(t.value);
|
|
3032
|
+
}), {
|
|
3033
|
+
selectValue: t,
|
|
3034
|
+
selectOptions: a,
|
|
3035
|
+
registerPopModal: F,
|
|
3036
|
+
popTableName: $,
|
|
3037
|
+
textFieldArray: i,
|
|
3038
|
+
handleClickAdd: I,
|
|
3039
|
+
handleClickEdit: N,
|
|
3040
|
+
getFormData: S,
|
|
3041
|
+
handleSearch: useDebounceFn(V, 800),
|
|
3042
|
+
handleChange: W,
|
|
3043
|
+
bindValue: A,
|
|
3044
|
+
showImage: M,
|
|
3045
|
+
getImageSrc: _,
|
|
3046
|
+
auths: o
|
|
3047
|
+
};
|
|
3048
|
+
}
|
|
3049
|
+
}, _hoisted_1$2 = {
|
|
3050
|
+
key: 1,
|
|
3051
|
+
class: "online-select-item"
|
|
3052
|
+
}, _hoisted_2$2 = {
|
|
3053
|
+
key: 0,
|
|
3054
|
+
class: "left-avatar"
|
|
3055
|
+
}, _hoisted_3$2 = ["src"], _hoisted_4$2 = { class: "right-content" }, _hoisted_5$2 = { class: "label" }, _hoisted_6$2 = { class: "others" }, _hoisted_7$1 = { class: "other-item ellipsis" };
|
|
3056
|
+
function _sfc_render$2(n, e, t, o, b, i) {
|
|
3057
|
+
const a = resolveComponent("PlusOutlined"), v = resolveComponent("EditOutlined"), g = resolveComponent("a-select"), P = resolveComponent("online-pop-modal");
|
|
3058
|
+
return openBlock(), createElementBlock("div", null, [
|
|
3059
|
+
createVNode(g, mergeProps({
|
|
3060
|
+
value: o.selectValue,
|
|
3061
|
+
"onUpdate:value": e[1] || (e[1] = (O) => o.selectValue = O),
|
|
3062
|
+
style: { width: "100%" },
|
|
3063
|
+
placeholder: "请选择",
|
|
3064
|
+
"option-label-prop": "label",
|
|
3065
|
+
dropdownClassName: "table-link-select",
|
|
3066
|
+
allowClear: "",
|
|
3067
|
+
"show-search": ""
|
|
3068
|
+
}, o.bindValue, {
|
|
3069
|
+
options: o.selectOptions,
|
|
3070
|
+
"filter-option": !1,
|
|
3071
|
+
"not-found-content": null,
|
|
3072
|
+
onSearch: o.handleSearch,
|
|
3073
|
+
onChange: o.handleChange
|
|
3074
|
+
}), {
|
|
3075
|
+
option: withCtx((O) => [
|
|
3076
|
+
!O.value && o.auths.add ? (openBlock(), createElementBlock("div", {
|
|
3077
|
+
key: 0,
|
|
3078
|
+
class: "opt-add",
|
|
3079
|
+
onClick: e[0] || (e[0] = (..._) => o.handleClickAdd && o.handleClickAdd(..._))
|
|
3080
|
+
}, [
|
|
3081
|
+
createVNode(a),
|
|
3082
|
+
createTextVNode(" 记录 ")
|
|
3083
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
3084
|
+
o.showImage ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
|
|
3085
|
+
o.getImageSrc(O) ? (openBlock(), createElementBlock("img", {
|
|
3086
|
+
key: 0,
|
|
3087
|
+
src: o.getImageSrc(O),
|
|
3088
|
+
alt: ""
|
|
3089
|
+
}, null, 8, _hoisted_3$2)) : createCommentVNode("", !0)
|
|
3090
|
+
])) : createCommentVNode("", !0),
|
|
3091
|
+
createElementVNode("div", _hoisted_4$2, [
|
|
3092
|
+
createElementVNode("div", _hoisted_5$2, [
|
|
3093
|
+
o.auths.update ? (openBlock(), createBlock(v, {
|
|
3094
|
+
key: 0,
|
|
3095
|
+
onClick: (_) => o.handleClickEdit(_, O)
|
|
3096
|
+
}, null, 8, ["onClick"])) : createCommentVNode("", !0),
|
|
3097
|
+
createTextVNode(" " + toDisplayString(O.label), 1)
|
|
3098
|
+
]),
|
|
3099
|
+
createElementVNode("div", _hoisted_6$2, [
|
|
3100
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.textFieldArray, (_) => (openBlock(), createElementBlock("div", _hoisted_7$1, toDisplayString(O[_]), 1))), 256))
|
|
3101
|
+
])
|
|
3102
|
+
])
|
|
3103
|
+
]))
|
|
3104
|
+
]),
|
|
3105
|
+
_: 1
|
|
3106
|
+
}, 16, ["value", "options", "onSearch", "onChange"]),
|
|
3107
|
+
createVNode(P, {
|
|
3108
|
+
id: o.popTableName,
|
|
3109
|
+
onRegister: o.registerPopModal,
|
|
3110
|
+
onSuccess: o.getFormData,
|
|
3111
|
+
topTip: ""
|
|
3112
|
+
}, null, 8, ["id", "onRegister", "onSuccess"])
|
|
3113
|
+
]);
|
|
3114
|
+
}
|
|
3115
|
+
const LinkTableSelect = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-e9a2adfa"]]), LinkTableSelect$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3116
|
+
__proto__: null,
|
|
3117
|
+
default: LinkTableSelect
|
|
3118
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
3119
|
+
function useTableColumns(onlineTableContext, extConfigJson) {
|
|
3120
|
+
let router = useRouter();
|
|
3121
|
+
const columns = ref([]), dictOptionInfo = ref({}), selectedKeys = ref([]), rowSelection = ref(null);
|
|
3122
|
+
let enableScrollBar = ref(!0), tableScroll = computed(() => {
|
|
3123
|
+
if (enableScrollBar.value != !0)
|
|
3124
|
+
return { x: !1 };
|
|
3125
|
+
});
|
|
3126
|
+
const [registerOnlineHrefModal, { openModal: openOnlineHrefModal }] = useModal(), hrefMainTableId = ref(""), [registerPopModal, { openModal: openPopModal }] = useModal(), popTableId = ref("");
|
|
3127
|
+
function handleColumnResult(n, e = "checkbox") {
|
|
3128
|
+
dictOptionInfo.value = n.dictOptions, n.checkboxFlag == "Y" ? rowSelection.value = {
|
|
3129
|
+
selectedRowKeys: selectedKeys,
|
|
3130
|
+
onChange: onSelectChange,
|
|
3131
|
+
type: e
|
|
3132
|
+
} : rowSelection.value = null, enableScrollBar.value = n.scrollFlag == 1;
|
|
3133
|
+
let t = n.columns;
|
|
3134
|
+
t.forEach((a) => {
|
|
3135
|
+
a.fieldExtendJson && JSON.parse(a.fieldExtendJson).isFixed && (a.fixed = "left"), Object.keys(a).map((v) => {
|
|
3136
|
+
a[v] == null && delete a[v];
|
|
3137
|
+
});
|
|
3138
|
+
});
|
|
3139
|
+
let o = n.fieldHrefSlots;
|
|
3140
|
+
const b = {};
|
|
3141
|
+
o.forEach((a) => b[a.slotName] = a);
|
|
3142
|
+
let i = [];
|
|
3143
|
+
if (i = handleColumnHrefAndDict(t, b), bpmStatusFilter(i), console.log("-----列表列配置----", i), onlineTableContext.isTree() === !0) {
|
|
3144
|
+
let a = n.textField, v = -1;
|
|
3145
|
+
for (let g = 0; g < i.length; g++)
|
|
3146
|
+
if (i[g].dataIndex == a) {
|
|
3147
|
+
v = g;
|
|
3148
|
+
break;
|
|
3149
|
+
}
|
|
3150
|
+
if (v > 0) {
|
|
3151
|
+
let g = i.splice(v, 1);
|
|
3152
|
+
i.unshift(g[0]);
|
|
3153
|
+
}
|
|
3154
|
+
i.length > 0 && (i[0].align = "left");
|
|
3155
|
+
}
|
|
3156
|
+
columns.value = i, onlineTableContext.reloadTable();
|
|
3157
|
+
}
|
|
3158
|
+
function onSelectChange(n, e) {
|
|
3159
|
+
selectedKeys.value = n, onlineTableContext.selectedRows = toRaw(e), onlineTableContext.selectedRowKeys = toRaw(n);
|
|
3160
|
+
}
|
|
3161
|
+
function handleColumnHrefAndDict(n, e) {
|
|
3162
|
+
for (let t of n) {
|
|
3163
|
+
let { customRender: o, hrefSlotName: b, fieldType: i } = t;
|
|
3164
|
+
if (i == "date" || i == "Date")
|
|
3165
|
+
t.customRender = ({ text: a }) => a ? a.length > 10 ? a.substring(0, 10) : a : "";
|
|
3166
|
+
else if (i == "link_table")
|
|
3167
|
+
t.customRender = ({ text: a, record: v }) => {
|
|
3168
|
+
if (!a)
|
|
3169
|
+
return "";
|
|
3170
|
+
if (onlineTableContext.isPopList === !0)
|
|
3171
|
+
return v[t.dataIndex + "_dictText"];
|
|
3172
|
+
{
|
|
3173
|
+
let g = (a + "").split(","), P = [];
|
|
3174
|
+
v[t.dataIndex + "_dictText"] && (P = v[t.dataIndex + "_dictText"].split(","));
|
|
3175
|
+
let O = [];
|
|
3176
|
+
for (let _ = 0; _ < g.length; _++) {
|
|
3177
|
+
let M = h(
|
|
3178
|
+
LinkTableListPiece,
|
|
3179
|
+
{
|
|
3180
|
+
id: g[_],
|
|
3181
|
+
text: P[_],
|
|
3182
|
+
onTab: (F) => handleClickLinkTable(F, b)
|
|
3183
|
+
}
|
|
3184
|
+
);
|
|
3185
|
+
O.push(M);
|
|
3186
|
+
}
|
|
3187
|
+
return O.length == 0 ? "" : h("div", { style: { overflow: "hidden" } }, O);
|
|
3188
|
+
}
|
|
3189
|
+
};
|
|
3190
|
+
else {
|
|
3191
|
+
if (!b && t.scopedSlots && t.scopedSlots.customRender && e.hasOwnProperty(t.scopedSlots.customRender) && (b = t.scopedSlots.customRender), o || b) {
|
|
3192
|
+
let a = o, v = "_replace_text_";
|
|
3193
|
+
t.ellipsis = !0, t.customRender = ({ text: g, record: P }) => {
|
|
3194
|
+
let O = g;
|
|
3195
|
+
if (a)
|
|
3196
|
+
if (a.startsWith(v)) {
|
|
3197
|
+
let _ = a.replace(v, "");
|
|
3198
|
+
O = P[_];
|
|
3199
|
+
} else
|
|
3200
|
+
O = filterMultiDictText(unref(dictOptionInfo)[a], g + "");
|
|
3201
|
+
if (t.showLength && O && O.length > t.showLength && (O = O.substr(0, t.showLength) + "..."), b) {
|
|
3202
|
+
let _ = e[b];
|
|
3203
|
+
if (_)
|
|
3204
|
+
return h(
|
|
3205
|
+
"a",
|
|
3206
|
+
{
|
|
3207
|
+
onClick: () => handleClickFieldHref(_, P)
|
|
3208
|
+
},
|
|
3209
|
+
O
|
|
3210
|
+
);
|
|
3211
|
+
}
|
|
3212
|
+
return O;
|
|
3213
|
+
};
|
|
3214
|
+
}
|
|
3215
|
+
if (t.scopedSlots) {
|
|
3216
|
+
t.ellipsis = !0;
|
|
3217
|
+
let a = t.scopedSlots;
|
|
3218
|
+
t.slots = a, delete t.scopedSlots;
|
|
3219
|
+
}
|
|
3220
|
+
}
|
|
3221
|
+
}
|
|
3222
|
+
return n;
|
|
3223
|
+
}
|
|
3224
|
+
function handleClickFieldHref(field, record) {
|
|
3225
|
+
let href = field.href, urlPattern = /(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?/, compPattern = /\.vue(\?.*)?$/, jsPattern = /{{([^}]+)}}/g;
|
|
3226
|
+
if (typeof href == "string")
|
|
3227
|
+
if (href.startsWith("ONLINE:")) {
|
|
3228
|
+
let n = href.split(":");
|
|
3229
|
+
hrefMainTableId.value = n[1];
|
|
3230
|
+
let e = n[2];
|
|
3231
|
+
openOnlineHrefModal(!0, {
|
|
3232
|
+
isUpdate: !0,
|
|
3233
|
+
disableSubmit: !0,
|
|
3234
|
+
hideSub: !0,
|
|
3235
|
+
record: { id: record[e] }
|
|
3236
|
+
});
|
|
3237
|
+
} else
|
|
3238
|
+
href = href.trim().replace(/\${([^}]+)?}/g, (n, e) => record[e]), jsPattern.test(href) && (href = href.replace(jsPattern, function(text, s0) {
|
|
3239
|
+
try {
|
|
3240
|
+
return eval(s0);
|
|
3241
|
+
} catch (n) {
|
|
3242
|
+
return console.error(n), text;
|
|
3243
|
+
}
|
|
3244
|
+
})), urlPattern.test(href) ? window.open(href, "_blank") : compPattern.test(href) ? openHrefCompModal(href) : router.push(href);
|
|
3245
|
+
}
|
|
3246
|
+
const dialogStyle = {
|
|
3247
|
+
top: 0,
|
|
3248
|
+
left: 0,
|
|
3249
|
+
height: "100%",
|
|
3250
|
+
margin: 0,
|
|
3251
|
+
padding: 0
|
|
3252
|
+
}, hrefComponent = reactive({
|
|
3253
|
+
model: {
|
|
3254
|
+
title: "",
|
|
3255
|
+
okText: "关闭",
|
|
3256
|
+
width: "100%",
|
|
3257
|
+
visible: !1,
|
|
3258
|
+
destroyOnClose: !0,
|
|
3259
|
+
style: dialogStyle,
|
|
3260
|
+
// dialogStyle: dialogStyle,
|
|
3261
|
+
bodyStyle: { padding: "8px", height: "calc(100vh - 108px)", overflow: "auto", overflowX: "hidden" },
|
|
3262
|
+
// 隐藏掉取消按钮
|
|
3263
|
+
cancelButtonProps: { style: { display: "none" } }
|
|
3264
|
+
},
|
|
3265
|
+
on: {
|
|
3266
|
+
ok: () => hrefComponent.model.visible = !1,
|
|
3267
|
+
cancel: () => hrefComponent.model.visible = !1
|
|
3268
|
+
},
|
|
3269
|
+
is: null,
|
|
3270
|
+
params: {}
|
|
3271
|
+
});
|
|
3272
|
+
function openHrefCompModal(n) {
|
|
3273
|
+
let e = n.indexOf("?"), t = n;
|
|
3274
|
+
if (e !== -1) {
|
|
3275
|
+
t = n.substring(0, e);
|
|
3276
|
+
let b = n.substring(e + 1, n.length).split("&"), i = {};
|
|
3277
|
+
b.forEach((a) => {
|
|
3278
|
+
let v = a.split("=");
|
|
3279
|
+
i[v[0]] = v[1];
|
|
3280
|
+
}), hrefComponent.params = i;
|
|
3281
|
+
} else
|
|
3282
|
+
hrefComponent.params = {};
|
|
3283
|
+
hrefComponent.model.visible = !0, hrefComponent.model.title = "操作", hrefComponent.is = markRaw(defineAsyncComponent(() => importViewsFile(t)));
|
|
3284
|
+
}
|
|
3285
|
+
let fixedAction = "left";
|
|
3286
|
+
onlineTableContext.isTree() && (fixedAction = "right");
|
|
3287
|
+
const actionColumn = reactive({
|
|
3288
|
+
title: "操作",
|
|
3289
|
+
dataIndex: "action",
|
|
3290
|
+
slots: { customRender: "action" },
|
|
3291
|
+
fixed: fixedAction,
|
|
3292
|
+
align: "center",
|
|
3293
|
+
width: 150
|
|
3294
|
+
});
|
|
3295
|
+
watch(() => extConfigJson == null ? void 0 : extConfigJson.value, () => {
|
|
3296
|
+
var n, e;
|
|
3297
|
+
((n = extConfigJson == null ? void 0 : extConfigJson.value) == null ? void 0 : n.tableFixedAction) === 1 && (actionColumn.fixed = ((e = extConfigJson == null ? void 0 : extConfigJson.value) == null ? void 0 : e.tableFixedActionType) || "right", onlineTableContext.isTree() && (actionColumn.fixed = "right"));
|
|
3298
|
+
});
|
|
3299
|
+
function bpmStatusFilter(n) {
|
|
3300
|
+
let e = !1;
|
|
3301
|
+
for (let t = 0; t < n.length; t++)
|
|
3302
|
+
if (n[t].dataIndex.toLowerCase() == "bpm_status") {
|
|
3303
|
+
e = !0;
|
|
3304
|
+
break;
|
|
3305
|
+
}
|
|
3306
|
+
return onlineTableContext.hasBpmStatus = e, e;
|
|
3307
|
+
}
|
|
3308
|
+
function downloadRowFile(n) {
|
|
3309
|
+
if (!n)
|
|
3310
|
+
return;
|
|
3311
|
+
n.indexOf(",") > 0 && (n = n.substring(0, n.indexOf(",")));
|
|
3312
|
+
let e = getFileAccessHttpUrl(n);
|
|
3313
|
+
window.open(e);
|
|
3314
|
+
}
|
|
3315
|
+
function getImgView(n) {
|
|
3316
|
+
return n && n.indexOf(",") > 0 && (n = n.substring(0, n.indexOf(","))), getFileAccessHttpUrl(n);
|
|
3317
|
+
}
|
|
3318
|
+
function getPcaText(n) {
|
|
3319
|
+
return n ? getAreaTextByCode(n) : "";
|
|
3320
|
+
}
|
|
3321
|
+
function getFormatDate(n) {
|
|
3322
|
+
if (!n)
|
|
3323
|
+
return "";
|
|
3324
|
+
let e = n;
|
|
3325
|
+
return e.length > 10 && (e = e.substring(0, 10)), e;
|
|
3326
|
+
}
|
|
3327
|
+
watch(selectedKeys, () => {
|
|
3328
|
+
onlineTableContext.selectedRowKeys = toRaw(selectedKeys.value);
|
|
3329
|
+
}), onlineTableContext.clearSelectedRow = () => {
|
|
3330
|
+
selectedKeys.value = [], onlineTableContext.selectedRows = [], onlineTableContext.selectedRowKeys = [];
|
|
3331
|
+
};
|
|
3332
|
+
function viewOnlineCellImage(n) {
|
|
3333
|
+
if (n) {
|
|
3334
|
+
let e = [], t = n.split(",");
|
|
3335
|
+
for (let o of t)
|
|
3336
|
+
o && e.push(getFileAccessHttpUrl(o));
|
|
3337
|
+
createImgPreview({ imageList: e });
|
|
3338
|
+
}
|
|
3339
|
+
}
|
|
3340
|
+
const onlinePopModalRef = ref();
|
|
3341
|
+
function handleClickLinkTable(n, e) {
|
|
3342
|
+
return J(this, null, function* () {
|
|
3343
|
+
popTableId.value = e, (yield onlinePopModalRef.value.getFormStatus()) == !0 ? (hrefMainTableId.value = e, openOnlineHrefModal(!0, {
|
|
3344
|
+
isUpdate: !0,
|
|
3345
|
+
disableSubmit: !0,
|
|
3346
|
+
hideSub: !0,
|
|
3347
|
+
record: { id: n }
|
|
3348
|
+
})) : openPopModal(!0, {
|
|
3349
|
+
isUpdate: !0,
|
|
3350
|
+
record: {
|
|
3351
|
+
id: n
|
|
3352
|
+
}
|
|
3353
|
+
});
|
|
3354
|
+
});
|
|
3355
|
+
}
|
|
3356
|
+
return {
|
|
3357
|
+
columns,
|
|
3358
|
+
actionColumn,
|
|
3359
|
+
selectedKeys,
|
|
3360
|
+
rowSelection,
|
|
3361
|
+
enableScrollBar,
|
|
3362
|
+
tableScroll,
|
|
3363
|
+
downloadRowFile,
|
|
3364
|
+
getImgView,
|
|
3365
|
+
getPcaText,
|
|
3366
|
+
getFormatDate,
|
|
3367
|
+
handleColumnResult,
|
|
3368
|
+
onSelectChange,
|
|
3369
|
+
hrefComponent,
|
|
3370
|
+
viewOnlineCellImage,
|
|
3371
|
+
hrefMainTableId,
|
|
3372
|
+
registerOnlineHrefModal,
|
|
3373
|
+
registerPopModal,
|
|
3374
|
+
openPopModal,
|
|
3375
|
+
openOnlineHrefModal,
|
|
3376
|
+
onlinePopModalRef,
|
|
3377
|
+
popTableId
|
|
3378
|
+
};
|
|
3379
|
+
}
|
|
3380
|
+
const _sfc_main$1 = defineComponent({
|
|
3381
|
+
name: "OnlinePopListModal",
|
|
3382
|
+
props: {
|
|
3383
|
+
/**可以是表名 可以是ID*/
|
|
3384
|
+
id: {
|
|
3385
|
+
type: String,
|
|
3386
|
+
default: ""
|
|
3387
|
+
},
|
|
3388
|
+
multi: {
|
|
3389
|
+
type: Boolean,
|
|
3390
|
+
default: !1
|
|
3391
|
+
},
|
|
3392
|
+
addAuth: {
|
|
3393
|
+
type: Boolean,
|
|
3394
|
+
default: !0
|
|
3395
|
+
}
|
|
3396
|
+
},
|
|
3397
|
+
components: {
|
|
3398
|
+
BasicModal,
|
|
3399
|
+
BasicTable,
|
|
3400
|
+
TableAction,
|
|
3401
|
+
PlusOutlined,
|
|
3402
|
+
OnlinePopModal
|
|
3403
|
+
},
|
|
3404
|
+
emits: ["success", "register"],
|
|
3405
|
+
setup(n, { emit: e }) {
|
|
3406
|
+
const { createMessage: t } = useMessage(), { popModalFixedWidth: o, resetBodyStyle: b, popBodyStyle: i } = useFixedHeightModal(), a = ref(""), v = ref(800), [g, { closeModal: P }] = useModalInner(() => {
|
|
3407
|
+
a.value = "", D.value = [], H.value = [], f({ current: 1 }), l(), b();
|
|
3408
|
+
}), [O, { openModal: _ }] = useModal();
|
|
3409
|
+
function M() {
|
|
3410
|
+
P();
|
|
3411
|
+
}
|
|
3412
|
+
const F = computed(() => {
|
|
3413
|
+
const L = D.value;
|
|
3414
|
+
return !(L && L.length > 0);
|
|
3415
|
+
}), E = ref(!1);
|
|
3416
|
+
function $() {
|
|
3417
|
+
E.value = !0;
|
|
3418
|
+
let L = toRaw(H.value);
|
|
3419
|
+
L && L.length > 0 && (e("success", L), P()), setTimeout(() => {
|
|
3420
|
+
E.value = !1;
|
|
3421
|
+
}, 200);
|
|
3422
|
+
}
|
|
3423
|
+
function A(L) {
|
|
3424
|
+
const U = "/online/cgform/api/getData/" + n.id;
|
|
3425
|
+
return defHttp.get({ url: U, params: L });
|
|
3426
|
+
}
|
|
3427
|
+
function I(L) {
|
|
3428
|
+
return L.column = "id", new Promise((U, X) => J(this, null, function* () {
|
|
3429
|
+
const G = yield A(L);
|
|
3430
|
+
U(G);
|
|
3431
|
+
}));
|
|
3432
|
+
}
|
|
3433
|
+
const N = {
|
|
3434
|
+
isPopList: !0,
|
|
3435
|
+
reloadTable() {
|
|
3436
|
+
console.log("reloadTable");
|
|
3437
|
+
},
|
|
3438
|
+
isTree() {
|
|
3439
|
+
return !1;
|
|
3440
|
+
}
|
|
3441
|
+
}, S = ref({}), {
|
|
3442
|
+
columns: V,
|
|
3443
|
+
downloadRowFile: W,
|
|
3444
|
+
getImgView: j,
|
|
3445
|
+
getPcaText: B,
|
|
3446
|
+
getFormatDate: p,
|
|
3447
|
+
handleColumnResult: y,
|
|
3448
|
+
hrefComponent: C,
|
|
3449
|
+
viewOnlineCellImage: x
|
|
3450
|
+
} = useTableColumns(N, S);
|
|
3451
|
+
function d() {
|
|
3452
|
+
const L = "/online/cgform/api/getColumns/" + n.id;
|
|
3453
|
+
return new Promise((U, X) => {
|
|
3454
|
+
defHttp.get({ url: L }, { isTransformResponse: !1 }).then((G) => {
|
|
3455
|
+
G.success ? U(G.result) : (t.warning(G.message), X());
|
|
3456
|
+
});
|
|
3457
|
+
});
|
|
3458
|
+
}
|
|
3459
|
+
const u = ref("");
|
|
3460
|
+
watch(() => n.id, () => J(this, null, function* () {
|
|
3461
|
+
let L = yield d();
|
|
3462
|
+
y(L), u.value = L.description;
|
|
3463
|
+
}), { immediate: !0 });
|
|
3464
|
+
const { tableContext: c } = useListPage({
|
|
3465
|
+
designScope: "process-design",
|
|
3466
|
+
pagination: !0,
|
|
3467
|
+
tableProps: {
|
|
3468
|
+
title: "",
|
|
3469
|
+
api: I,
|
|
3470
|
+
clickToRowSelect: !0,
|
|
3471
|
+
columns: V,
|
|
3472
|
+
showTableSetting: !1,
|
|
3473
|
+
immediate: !1,
|
|
3474
|
+
//showIndexColumn: true,
|
|
3475
|
+
canResize: !1,
|
|
3476
|
+
showActionColumn: !1,
|
|
3477
|
+
actionColumn: {
|
|
3478
|
+
dataIndex: "action",
|
|
3479
|
+
slots: { customRender: "action" }
|
|
3480
|
+
},
|
|
3481
|
+
useSearchForm: !1,
|
|
3482
|
+
beforeFetch: (L) => ie(L)
|
|
3483
|
+
}
|
|
3484
|
+
}), [s, { reload: l, setPagination: f }, { rowSelection: T, selectedRowKeys: D, selectedRows: H }] = c;
|
|
3485
|
+
watch(() => n.multi, (L) => {
|
|
3486
|
+
L == !0 ? T.type = "checkbox" : T.type = "radio";
|
|
3487
|
+
}, { immediate: !0 });
|
|
3488
|
+
function Y(L) {
|
|
3489
|
+
return [
|
|
3490
|
+
{
|
|
3491
|
+
label: "编辑",
|
|
3492
|
+
onClick: q.bind(null, L)
|
|
3493
|
+
}
|
|
3494
|
+
];
|
|
3495
|
+
}
|
|
3496
|
+
function q(L) {
|
|
3497
|
+
console.log("handleUpdate", L);
|
|
3498
|
+
}
|
|
3499
|
+
function z() {
|
|
3500
|
+
l();
|
|
3501
|
+
}
|
|
3502
|
+
const te = ["int", "double", "Date", "Datetime", "BigDecimal"];
|
|
3503
|
+
function ie(L) {
|
|
3504
|
+
let U = a.value;
|
|
3505
|
+
if (!U)
|
|
3506
|
+
return L.superQueryMatchType = "or", L.superQueryParams = "", L;
|
|
3507
|
+
let X = V.value, G = [];
|
|
3508
|
+
if (X && X.length > 0)
|
|
3509
|
+
for (let Q of X)
|
|
3510
|
+
Q.dbType && (Q.dbType == "string" ? G.push({ field: Q.dataIndex, type: Q.dbType.toLowerCase(), rule: "like", val: U }) : Q.dbType == "Date" ? U.length == 10 && G.push({ field: Q.dataIndex, type: Q.dbType.toLowerCase(), rule: "eq", val: U }) : Q.dbType == "Datetime" ? U.length == 19 && G.push({ field: Q.dataIndex, type: Q.dbType.toLowerCase(), rule: "eq", val: U }) : te.indexOf(Q.dbType) && G.push({ field: Q.dataIndex, type: Q.dbType.toLowerCase(), rule: "eq", val: U }));
|
|
3511
|
+
return L.superQueryMatchType = "or", L.superQueryParams = encodeURI(JSON.stringify(G)), L;
|
|
3512
|
+
}
|
|
3513
|
+
function oe() {
|
|
3514
|
+
_(!0, {});
|
|
3515
|
+
}
|
|
3516
|
+
function le(L) {
|
|
3517
|
+
console.log("handleDateSave", L), e("success", [L]), P();
|
|
3518
|
+
}
|
|
3519
|
+
return {
|
|
3520
|
+
registerModal: g,
|
|
3521
|
+
modalWidth: v,
|
|
3522
|
+
handleCancel: M,
|
|
3523
|
+
submitDisabled: F,
|
|
3524
|
+
submitLoading: E,
|
|
3525
|
+
handleSubmit: $,
|
|
3526
|
+
registerTable: s,
|
|
3527
|
+
getTableAction: Y,
|
|
3528
|
+
searchText: a,
|
|
3529
|
+
onSearch: z,
|
|
3530
|
+
downloadRowFile: W,
|
|
3531
|
+
getImgView: j,
|
|
3532
|
+
getPcaText: B,
|
|
3533
|
+
getFormatDate: p,
|
|
3534
|
+
hrefComponent: C,
|
|
3535
|
+
viewOnlineCellImage: x,
|
|
3536
|
+
rowSelection: T,
|
|
3537
|
+
modalTitle: u,
|
|
3538
|
+
registerPopModal: O,
|
|
3539
|
+
handleAdd: oe,
|
|
3540
|
+
reload: l,
|
|
3541
|
+
popModalFixedWidth: o,
|
|
3542
|
+
popBodyStyle: i,
|
|
3543
|
+
handleDataSave: le
|
|
3544
|
+
};
|
|
3545
|
+
}
|
|
3546
|
+
}), _hoisted_1$1 = { style: { display: "inline-block", width: "calc(100% - 140px)", "text-align": "left" } }, _hoisted_2$1 = {
|
|
3547
|
+
key: 0,
|
|
3548
|
+
style: { "font-size": "12px", "font-style": "italic" }
|
|
3549
|
+
}, _hoisted_3$1 = {
|
|
3550
|
+
key: 0,
|
|
3551
|
+
style: { "font-size": "12px", "font-style": "italic" }
|
|
3552
|
+
}, _hoisted_4$1 = ["src", "onClick"], _hoisted_5$1 = ["innerHTML"], _hoisted_6$1 = ["title"];
|
|
3553
|
+
function _sfc_render$1(n, e, t, o, b, i) {
|
|
3554
|
+
const a = resolveComponent("PlusOutlined"), v = resolveComponent("a-button"), g = resolveComponent("a-input-search"), P = resolveComponent("TableAction"), O = resolveComponent("BasicTable"), _ = resolveComponent("BasicModal"), M = resolveComponent("online-pop-modal");
|
|
3555
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
3556
|
+
createVNode(_, {
|
|
3557
|
+
onRegister: n.registerModal,
|
|
3558
|
+
width: n.popModalFixedWidth,
|
|
3559
|
+
dialogStyle: { top: "70px" },
|
|
3560
|
+
bodyStyle: n.popBodyStyle,
|
|
3561
|
+
title: n.modalTitle,
|
|
3562
|
+
wrapClassName: "jeecg-online-pop-list-modal"
|
|
3563
|
+
}, {
|
|
3564
|
+
footer: withCtx(() => [
|
|
3565
|
+
createElementVNode("div", _hoisted_1$1, [
|
|
3566
|
+
n.addAuth ? (openBlock(), createBlock(v, {
|
|
3567
|
+
key: 0,
|
|
3568
|
+
style: { "border-radius": "50px" },
|
|
3569
|
+
type: "primary",
|
|
3570
|
+
onClick: n.handleAdd
|
|
3571
|
+
}, {
|
|
3572
|
+
default: withCtx(() => [
|
|
3573
|
+
createVNode(a),
|
|
3574
|
+
createTextVNode("新增记录")
|
|
3575
|
+
]),
|
|
3576
|
+
_: 1
|
|
3577
|
+
}, 8, ["onClick"])) : createCommentVNode("", !0)
|
|
3578
|
+
]),
|
|
3579
|
+
createVNode(v, {
|
|
3580
|
+
key: "back",
|
|
3581
|
+
onClick: n.handleCancel
|
|
3582
|
+
}, {
|
|
3583
|
+
default: withCtx(() => [
|
|
3584
|
+
createTextVNode("关闭")
|
|
3585
|
+
]),
|
|
3586
|
+
_: 1
|
|
3587
|
+
}, 8, ["onClick"]),
|
|
3588
|
+
createVNode(v, {
|
|
3589
|
+
disabled: n.submitDisabled,
|
|
3590
|
+
key: "submit",
|
|
3591
|
+
type: "primary",
|
|
3592
|
+
onClick: n.handleSubmit,
|
|
3593
|
+
loading: n.submitLoading
|
|
3594
|
+
}, {
|
|
3595
|
+
default: withCtx(() => [
|
|
3596
|
+
createTextVNode("确定")
|
|
3597
|
+
]),
|
|
3598
|
+
_: 1
|
|
3599
|
+
}, 8, ["disabled", "onClick", "loading"])
|
|
3600
|
+
]),
|
|
3601
|
+
default: withCtx(() => [
|
|
3602
|
+
createVNode(O, {
|
|
3603
|
+
onRegister: n.registerTable,
|
|
3604
|
+
rowSelection: n.rowSelection
|
|
3605
|
+
}, {
|
|
3606
|
+
tableTitle: withCtx(() => [
|
|
3607
|
+
createVNode(g, {
|
|
3608
|
+
value: n.searchText,
|
|
3609
|
+
"onUpdate:value": e[0] || (e[0] = (F) => n.searchText = F),
|
|
3610
|
+
onSearch: n.onSearch,
|
|
3611
|
+
placeholder: "请输入关键词,按回车搜索",
|
|
3612
|
+
style: { width: "240px" }
|
|
3613
|
+
}, null, 8, ["value", "onSearch"])
|
|
3614
|
+
]),
|
|
3615
|
+
action: withCtx(({ record: F }) => [
|
|
3616
|
+
createVNode(P, {
|
|
3617
|
+
actions: n.getTableAction(F)
|
|
3618
|
+
}, null, 8, ["actions"])
|
|
3619
|
+
]),
|
|
3620
|
+
fileSlot: withCtx(({ text: F }) => [
|
|
3621
|
+
F ? (openBlock(), createBlock(v, {
|
|
3622
|
+
key: 1,
|
|
3623
|
+
ghost: !0,
|
|
3624
|
+
type: "primary",
|
|
3625
|
+
preIcon: "ant-design:download",
|
|
3626
|
+
size: "small",
|
|
3627
|
+
onClick: (E) => n.downloadRowFile(F)
|
|
3628
|
+
}, {
|
|
3629
|
+
default: withCtx(() => [
|
|
3630
|
+
createTextVNode(" 下载 ")
|
|
3631
|
+
]),
|
|
3632
|
+
_: 2
|
|
3633
|
+
}, 1032, ["onClick"])) : (openBlock(), createElementBlock("span", _hoisted_2$1, "无文件"))
|
|
3634
|
+
]),
|
|
3635
|
+
imgSlot: withCtx(({ text: F }) => [
|
|
3636
|
+
F ? (openBlock(), createElementBlock("img", {
|
|
3637
|
+
key: 1,
|
|
3638
|
+
src: n.getImgView(F),
|
|
3639
|
+
alt: "图片不存在",
|
|
3640
|
+
class: "online-cell-image",
|
|
3641
|
+
onClick: (E) => n.viewOnlineCellImage(F)
|
|
3642
|
+
}, null, 8, _hoisted_4$1)) : (openBlock(), createElementBlock("span", _hoisted_3$1, "无图片"))
|
|
3643
|
+
]),
|
|
3644
|
+
htmlSlot: withCtx(({ text: F }) => [
|
|
3645
|
+
createElementVNode("div", { innerHTML: F }, null, 8, _hoisted_5$1)
|
|
3646
|
+
]),
|
|
3647
|
+
pcaSlot: withCtx(({ text: F }) => [
|
|
3648
|
+
createElementVNode("div", {
|
|
3649
|
+
title: n.getPcaText(F)
|
|
3650
|
+
}, toDisplayString(n.getPcaText(F)), 9, _hoisted_6$1)
|
|
3651
|
+
]),
|
|
3652
|
+
dateSlot: withCtx(({ text: F }) => [
|
|
3653
|
+
createElementVNode("span", null, toDisplayString(n.getFormatDate(F)), 1)
|
|
3654
|
+
]),
|
|
3655
|
+
_: 1
|
|
3656
|
+
}, 8, ["onRegister", "rowSelection"])
|
|
3657
|
+
]),
|
|
3658
|
+
_: 1
|
|
3659
|
+
}, 8, ["onRegister", "width", "bodyStyle", "title"]),
|
|
3660
|
+
createVNode(M, {
|
|
3661
|
+
id: n.id,
|
|
3662
|
+
onRegister: n.registerPopModal,
|
|
3663
|
+
onSuccess: n.handleDataSave,
|
|
3664
|
+
topTip: ""
|
|
3665
|
+
}, null, 8, ["id", "onRegister", "onSuccess"])
|
|
3666
|
+
], 64);
|
|
3667
|
+
}
|
|
3668
|
+
const OnlinePopListModal = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]), OnlinePopListModal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3669
|
+
__proto__: null,
|
|
3670
|
+
default: OnlinePopListModal
|
|
3671
|
+
}, Symbol.toStringTag, { value: "Module" })), LinkTableCard_vue_vue_type_style_index_0_scoped_447ec75a_lang = "", _sfc_main = {
|
|
3672
|
+
name: "LinkTableCard",
|
|
3673
|
+
props: {
|
|
3674
|
+
valueField: propTypes.string.def(""),
|
|
3675
|
+
textField: propTypes.string.def(""),
|
|
3676
|
+
tableName: propTypes.string.def(""),
|
|
3677
|
+
multi: propTypes.bool.def(!1),
|
|
3678
|
+
value: propTypes.oneOfType([propTypes.string, propTypes.number]),
|
|
3679
|
+
// ["表单字段,表字典字段","表单字段,表字典字段"]
|
|
3680
|
+
linkFields: propTypes.array.def([]),
|
|
3681
|
+
//是否是禁用页面
|
|
3682
|
+
disabled: propTypes.bool.def(!1),
|
|
3683
|
+
// 是否是detail页面
|
|
3684
|
+
detail: propTypes.bool.def(!1),
|
|
3685
|
+
imageField: propTypes.string.def("")
|
|
3686
|
+
},
|
|
3687
|
+
components: {
|
|
3688
|
+
PlusOutlined,
|
|
3689
|
+
MinusCircleFilled,
|
|
3690
|
+
OnlinePopListModal,
|
|
3691
|
+
OnlinePopModal
|
|
3692
|
+
},
|
|
3693
|
+
emits: ["change", "update:value"],
|
|
3694
|
+
setup(n, { emit: e }) {
|
|
3695
|
+
const t = computed(() => n.tableName), [o, { openModal: b }] = useModal(), [i, { openModal: a }] = useModal(), v = ref([]), g = ref([]), P = computed(() => !(n.disabled == !0 || n.multi === !1 && g.value.length > 0)), { auths: O, otherColumns: _, realShowColumns: M, tableColumns: F, textFieldArray: E, transData: $, loadOne: A, compareData: I, formatData: N, initFormData: S, getImageSrc: V, showImage: W } = useLinkTable(n), j = computed(() => n.multi === !0 ? 12 : 24), B = computed(() => n.multi === !0 ? 24 : 12);
|
|
3696
|
+
function p(l) {
|
|
3697
|
+
if (l && E.value.length > 0) {
|
|
3698
|
+
let f = E.value[0];
|
|
3699
|
+
return l[f];
|
|
3700
|
+
}
|
|
3701
|
+
}
|
|
3702
|
+
function y(l) {
|
|
3703
|
+
l == null || l.stopPropagation(), l == null || l.preventDefault();
|
|
3704
|
+
}
|
|
3705
|
+
function C(l, f) {
|
|
3706
|
+
if (y(l), O.update == !1) {
|
|
3707
|
+
console.error("当前用户无编辑权限!");
|
|
3708
|
+
return;
|
|
3709
|
+
}
|
|
3710
|
+
n.disabled == !1 && a(!0, {
|
|
3711
|
+
isUpdate: !0,
|
|
3712
|
+
record: f
|
|
3713
|
+
});
|
|
3714
|
+
}
|
|
3715
|
+
function x(l) {
|
|
3716
|
+
b(!0, {});
|
|
3717
|
+
}
|
|
3718
|
+
function d(l) {
|
|
3719
|
+
let f = g.value;
|
|
3720
|
+
for (let T of l) {
|
|
3721
|
+
let D = ne({}, T);
|
|
3722
|
+
$(D), f.push(D);
|
|
3723
|
+
}
|
|
3724
|
+
g.value = f, s();
|
|
3725
|
+
}
|
|
3726
|
+
function u(l) {
|
|
3727
|
+
let f = g.value;
|
|
3728
|
+
for (let T = 0; T < f.length; T++)
|
|
3729
|
+
if (f[T].id === l.id) {
|
|
3730
|
+
let D = ne({}, l);
|
|
3731
|
+
$(D), f.splice(T, 1, D);
|
|
3732
|
+
}
|
|
3733
|
+
g.value = f, s();
|
|
3734
|
+
}
|
|
3735
|
+
function c(l, f) {
|
|
3736
|
+
y(l);
|
|
3737
|
+
let T = g.value;
|
|
3738
|
+
T && T.length > f && (T.splice(f, 1), g.value = T), s();
|
|
3739
|
+
}
|
|
3740
|
+
function s() {
|
|
3741
|
+
let l = g.value, f = [], T = {}, D = n.linkFields;
|
|
3742
|
+
if (l.length > 0)
|
|
3743
|
+
for (let Y = 0; Y < l.length; Y++)
|
|
3744
|
+
f.push(l[Y][n.valueField]), S(T, D, l[Y]);
|
|
3745
|
+
else
|
|
3746
|
+
S(T, D);
|
|
3747
|
+
let H = f.join(",");
|
|
3748
|
+
N(T), e("change", H, T), e("update:value", H);
|
|
3749
|
+
}
|
|
3750
|
+
return watch(() => n.value, (l) => J(this, null, function* () {
|
|
3751
|
+
if (l) {
|
|
3752
|
+
if (I(g.value, l) === !1) {
|
|
3753
|
+
let T = yield A(l);
|
|
3754
|
+
g.value = T;
|
|
3755
|
+
}
|
|
3756
|
+
n.linkFields && n.linkFields.length > 0 && s();
|
|
3757
|
+
} else
|
|
3758
|
+
g.value = [];
|
|
3759
|
+
}), { immediate: !0 }), {
|
|
3760
|
+
popTableName: t,
|
|
3761
|
+
selectRecords: g,
|
|
3762
|
+
otherColumns: _,
|
|
3763
|
+
realShowColumns: M,
|
|
3764
|
+
showButton: P,
|
|
3765
|
+
selectValue: v,
|
|
3766
|
+
handleAddRecord: x,
|
|
3767
|
+
handleDeleteRecord: c,
|
|
3768
|
+
getMainContent: p,
|
|
3769
|
+
itemSpan: j,
|
|
3770
|
+
columnSpan: B,
|
|
3771
|
+
tableColumns: F,
|
|
3772
|
+
addCard: d,
|
|
3773
|
+
registerListModal: o,
|
|
3774
|
+
registerFormModal: i,
|
|
3775
|
+
handleClickEdit: C,
|
|
3776
|
+
updateCardData: u,
|
|
3777
|
+
getImageSrc: V,
|
|
3778
|
+
showImage: W,
|
|
3779
|
+
auths: O
|
|
3780
|
+
};
|
|
3781
|
+
}
|
|
3782
|
+
}, _hoisted_1 = { class: "table-link-card" }, _hoisted_2 = { style: { width: "100%", height: "100%" } }, _hoisted_3 = {
|
|
3783
|
+
key: 0,
|
|
3784
|
+
class: "card-button"
|
|
3785
|
+
}, _hoisted_4 = ["onClick"], _hoisted_5 = {
|
|
3786
|
+
key: 0,
|
|
3787
|
+
class: "card-delete"
|
|
3788
|
+
}, _hoisted_6 = { class: "card-inner" }, _hoisted_7 = { class: "card-main-content" }, _hoisted_8 = { class: "other-content" }, _hoisted_9 = { class: "label ellipsis" }, _hoisted_10 = { class: "text ellipsis" }, _hoisted_11 = {
|
|
3789
|
+
key: 0,
|
|
3790
|
+
class: "card-item-image"
|
|
3791
|
+
}, _hoisted_12 = ["src"];
|
|
3792
|
+
function _sfc_render(n, e, t, o, b, i) {
|
|
3793
|
+
const a = resolveComponent("PlusOutlined"), v = resolveComponent("a-button"), g = resolveComponent("minus-circle-filled"), P = resolveComponent("a-col"), O = resolveComponent("a-row"), _ = resolveComponent("online-pop-list-modal"), M = resolveComponent("online-pop-modal");
|
|
3794
|
+
return openBlock(), createElementBlock("div", null, [
|
|
3795
|
+
createElementVNode("div", _hoisted_1, [
|
|
3796
|
+
createElementVNode("div", _hoisted_2, [
|
|
3797
|
+
o.showButton ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
3798
|
+
createVNode(v, { onClick: o.handleAddRecord }, {
|
|
3799
|
+
default: withCtx(() => [
|
|
3800
|
+
createVNode(a),
|
|
3801
|
+
createTextVNode("记 录")
|
|
3802
|
+
]),
|
|
3803
|
+
_: 1
|
|
3804
|
+
}, 8, ["onClick"])
|
|
3805
|
+
])) : createCommentVNode("", !0),
|
|
3806
|
+
createVNode(O, null, {
|
|
3807
|
+
default: withCtx(() => [
|
|
3808
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.selectRecords, (F, E) => (openBlock(), createBlock(P, { span: o.itemSpan }, {
|
|
3809
|
+
default: withCtx(() => [
|
|
3810
|
+
createElementVNode("div", {
|
|
3811
|
+
class: normalizeClass(["card-item", { "disabled-chunk": t.detail == !0 }]),
|
|
3812
|
+
onClick: ($) => o.handleClickEdit($, F)
|
|
3813
|
+
}, [
|
|
3814
|
+
createElementVNode("div", {
|
|
3815
|
+
class: normalizeClass(["card-item-left", { "show-right-image": o.showImage }])
|
|
3816
|
+
}, [
|
|
3817
|
+
t.disabled == !1 ? (openBlock(), createElementBlock("span", _hoisted_5, [
|
|
3818
|
+
createVNode(g, {
|
|
3819
|
+
onClick: ($) => o.handleDeleteRecord($, E)
|
|
3820
|
+
}, null, 8, ["onClick"])
|
|
3821
|
+
])) : createCommentVNode("", !0),
|
|
3822
|
+
createElementVNode("div", _hoisted_6, [
|
|
3823
|
+
createElementVNode("div", _hoisted_7, toDisplayString(o.getMainContent(F)), 1),
|
|
3824
|
+
createElementVNode("div", _hoisted_8, [
|
|
3825
|
+
createVNode(O, null, {
|
|
3826
|
+
default: withCtx(() => [
|
|
3827
|
+
(openBlock(!0), createElementBlock(Fragment, null, renderList(o.realShowColumns, ($) => (openBlock(), createBlock(P, { span: o.columnSpan }, {
|
|
3828
|
+
default: withCtx(() => [
|
|
3829
|
+
createElementVNode("span", _hoisted_9, toDisplayString($.title), 1),
|
|
3830
|
+
createElementVNode("span", _hoisted_10, toDisplayString(F[$.dataIndex]), 1)
|
|
3831
|
+
]),
|
|
3832
|
+
_: 2
|
|
3833
|
+
}, 1032, ["span"]))), 256))
|
|
3834
|
+
]),
|
|
3835
|
+
_: 2
|
|
3836
|
+
}, 1024)
|
|
3837
|
+
])
|
|
3838
|
+
])
|
|
3839
|
+
], 2),
|
|
3840
|
+
o.showImage ? (openBlock(), createElementBlock("div", _hoisted_11, [
|
|
3841
|
+
o.getImageSrc(F) ? (openBlock(), createElementBlock("img", {
|
|
3842
|
+
key: 0,
|
|
3843
|
+
src: o.getImageSrc(F),
|
|
3844
|
+
alt: ""
|
|
3845
|
+
}, null, 8, _hoisted_12)) : createCommentVNode("", !0)
|
|
3846
|
+
])) : createCommentVNode("", !0)
|
|
3847
|
+
], 10, _hoisted_4)
|
|
3848
|
+
]),
|
|
3849
|
+
_: 2
|
|
3850
|
+
}, 1032, ["span"]))), 256))
|
|
3851
|
+
]),
|
|
3852
|
+
_: 1
|
|
3853
|
+
})
|
|
3854
|
+
])
|
|
3855
|
+
]),
|
|
3856
|
+
createVNode(_, {
|
|
3857
|
+
onRegister: o.registerListModal,
|
|
3858
|
+
multi: t.multi,
|
|
3859
|
+
id: o.popTableName,
|
|
3860
|
+
addAuth: o.auths.add,
|
|
3861
|
+
onSuccess: o.addCard
|
|
3862
|
+
}, null, 8, ["onRegister", "multi", "id", "addAuth", "onSuccess"]),
|
|
3863
|
+
createVNode(M, {
|
|
3864
|
+
id: o.popTableName,
|
|
3865
|
+
onRegister: o.registerFormModal,
|
|
3866
|
+
onSuccess: o.updateCardData,
|
|
3867
|
+
topTip: ""
|
|
3868
|
+
}, null, 8, ["id", "onRegister", "onSuccess"])
|
|
3869
|
+
]);
|
|
3870
|
+
}
|
|
3871
|
+
const LinkTableCard = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-447ec75a"]]), LinkTableCard$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3872
|
+
__proto__: null,
|
|
3873
|
+
default: LinkTableCard
|
|
3874
|
+
}, Symbol.toStringTag, { value: "Module" })), componentKeyMap = {};
|
|
3875
|
+
function useExtendComponent() {
|
|
3876
|
+
n("OnlineSelectCascade", OnlineSelectCascade), n("LinkTableSelect", LinkTableSelect), n("LinkTableCard", LinkTableCard);
|
|
3877
|
+
function n(t, o) {
|
|
3878
|
+
componentKeyMap[t] || (add(t, o), componentKeyMap[t] = 1);
|
|
3879
|
+
}
|
|
3880
|
+
function e(t) {
|
|
3881
|
+
t.component == "LinkTableCard" && (t.component = "LinkTableSelect", t.componentProps.popContainer = "body");
|
|
3882
|
+
}
|
|
3883
|
+
return {
|
|
3884
|
+
addComponent: n,
|
|
3885
|
+
linkTableCard2Select: e
|
|
3886
|
+
};
|
|
3887
|
+
}
|
|
3888
|
+
export {
|
|
3889
|
+
ENHANCEJS as E,
|
|
3890
|
+
FormSchemaFactory as F,
|
|
3891
|
+
LINK_DOWN as L,
|
|
3892
|
+
OnlinePopModal as O,
|
|
3893
|
+
SETUP as S,
|
|
3894
|
+
VALIDATE_FAILED as V,
|
|
3895
|
+
useTableColumns as a,
|
|
3896
|
+
useExtendComponent as b,
|
|
3897
|
+
FORM_VIEW_TO_QUERY_VIEW as c,
|
|
3898
|
+
getFieldIndex as d,
|
|
3899
|
+
useAutoModal as e,
|
|
3900
|
+
OnlineSubForm as f,
|
|
3901
|
+
getRefPromise as g,
|
|
3902
|
+
handleLinkDown as h,
|
|
3903
|
+
useOnlineFormContext as i,
|
|
3904
|
+
useFormItems as j,
|
|
3905
|
+
loadFormFieldsDefVal as k,
|
|
3906
|
+
loadOneFieldDefVal as l,
|
|
3907
|
+
SUBMIT_FLOW_KEY as m,
|
|
3908
|
+
SUBMIT_FLOW_ID as n,
|
|
3909
|
+
ONL_FORM_TABLE_NAME as o,
|
|
3910
|
+
getDetailFormSchemas as p,
|
|
3911
|
+
LinkTableCard as q,
|
|
3912
|
+
OnlineSubForm$1 as r,
|
|
3913
|
+
OnlinePopForm$1 as s,
|
|
3914
|
+
OnlinePopModal$1 as t,
|
|
3915
|
+
useEnhance as u,
|
|
3916
|
+
LinkTableSelect$1 as v,
|
|
3917
|
+
OnlinePopListModal$1 as w,
|
|
3918
|
+
LinkTableCard$1 as x
|
|
3919
|
+
};
|