@jeecg/online 1.0.1 → 3.4.3-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AuthButtonConfig.js +14 -7
- package/AuthButtonTree.js +3 -5
- package/AuthDataConfig.js +9 -6
- package/AuthDataTree.js +3 -5
- package/AuthFieldConfig.js +15 -12
- package/AuthFieldTree.js +24 -18
- package/AuthManagerDrawer.js +1 -1
- package/AuthSetterModal.js +1 -0
- package/CgformCopyList.js +34 -22
- package/CgformModal.js +57 -50
- package/CgreportModal.js +32 -39
- package/CheckDictTable.js +144 -24
- package/CodeFileListModal.js +175 -0
- package/CodeFileViewModal.js +325 -0
- package/CodeGeneratorModal.js +41 -38
- package/CustomButtonList.js +19 -22
- package/DBAttributeTable.js +248 -12
- package/DbToOnlineModal.js +27 -25
- package/DetailForm.js +605 -0
- package/EnhanceJavaModal.js +11 -17
- package/EnhanceJsHistory.js +6 -8
- package/EnhanceJsModal.js +9 -16
- package/EnhanceSqlModal.js +11 -17
- package/ExtendConfigModal.js +24 -15
- package/ForeignKeyTable.js +4 -3
- package/FormSchemaFactory.js +163 -30
- package/IndexTable.js +6 -5
- package/JModalTip.js +54 -0
- package/JOnlineSearchSelect.js +18 -10
- package/LeftDepart.js +1 -1
- package/LeftRole.js +7 -4
- package/LeftUser.js +7 -4
- package/LinkTableConfigModal.js +289 -0
- package/LinkTableFieldConfigModal.js +218 -0
- package/LinkTableListPiece.js +36 -0
- package/ModalFormDemo.js +3 -2
- package/OnlineAutoList.js +154 -55
- package/OnlineAutoModal.js +88 -131
- package/OnlineAutoTreeList.js +93 -53
- package/OnlineCustomModal.js +30 -14
- package/OnlineDetailModal.js +184 -0
- package/OnlineForm.js +259 -141
- package/OnlineFormDetail.js +326 -0
- package/OnlineQueryForm.js +72 -40
- package/OnlineSearchFormItem.js +26 -18
- package/OnlineSelectCascade.js +67 -53
- package/OnlineSubFormDetail.js +167 -0
- package/OnlineSuperQuery.js +69 -74
- package/OnlineSuperQueryValComponent.js +1 -0
- package/OnlineSuperQueryValComponent.vue_vue_type_script_lang.js +1 -17
- package/PageAttributeTable.js +233 -30
- package/ProcessOnlineForm.js +41 -16
- package/QueryTable.js +4 -3
- package/README.md +3 -8
- package/_arrayPush.js +5 -3
- package/{cloneDeep.js → _baseClone.js} +5 -9
- package/_baseSlice.js +18 -0
- package/_commonjsHelpers.js +5 -0
- package/_flatRest.js +174 -0
- package/auth.data.js +1 -3
- package/cgform.data.js +18 -9
- package/enhance.api.js +27 -18
- package/index.js +16 -6
- package/index2.js +48 -45
- package/index3.js +29 -26
- package/isArray.js +1 -1
- package/omit.js +60 -0
- package/package.json +1 -1
- package/pick.js +3 -173
- package/style.css +1 -1
- package/toString.js +2 -2
- package/useAutoForm.js +3437 -3791
- package/useCgformList.js +44 -31
- package/{useTableColumns.js → useListButton.js} +212 -407
- package/useOnlineTest.js +5 -26827
- package/useSchemas.js +364 -230
- package/useTableSync.js +19 -7
- package/ChartAutoRender.js +0 -69
- package/ChartDoubleRender.js +0 -154
- package/ChartSingleRender.js +0 -132
- package/ChartTabsRender.js +0 -218
- package/ErrorTip.js +0 -21
- package/FieldTable.js +0 -185
- package/GraphreportAutoChart.js +0 -352
- package/GraphreportList.js +0 -239
- package/GraphreportModal.js +0 -559
- package/OnlineSubForm.js +0 -200
- package/ParamsTable.js +0 -71
- package/graphreport.api.js +0 -23
- package/useChartRender.js +0 -405
- package/useMessageOnline.js +0 -71
|
@@ -37,24 +37,24 @@ var __async = (__this, __arguments, generator) => {
|
|
|
37
37
|
step((generator = generator.apply(__this, __arguments)).next());
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
|
-
import { E as ENHANCEJS,
|
|
41
|
-
import { useRoute
|
|
40
|
+
import { E as ENHANCEJS, d as SETUP } from "./FormSchemaFactory.js";
|
|
41
|
+
import { useRoute } from "vue-router";
|
|
42
|
+
import { router } from "/@/router";
|
|
42
43
|
import * as vue from "vue";
|
|
43
|
-
import { ref, onBeforeUnmount, toRaw, nextTick, reactive
|
|
44
|
+
import { ref, onBeforeUnmount, toRaw, nextTick, reactive } from "vue";
|
|
44
45
|
import * as UTIL_AXIOS from "/@/utils/http/axios";
|
|
45
46
|
import { defHttp } from "/@/utils/http/axios";
|
|
46
47
|
import * as HOOK_MESSAGE from "/@/hooks/web/useMessage";
|
|
47
48
|
import { useMessage } from "/@/hooks/web/useMessage";
|
|
48
|
-
import { randomString, filterObj
|
|
49
|
+
import { randomString, filterObj } from "/@/utils/common/compUtils";
|
|
49
50
|
import * as UTIL_CACHE from "/@/utils/cache";
|
|
50
51
|
import { onMountedOrActivated } from "/@/hooks/core/onMountedOrActivated";
|
|
51
52
|
import { useModal } from "/@/components/Modal";
|
|
52
53
|
import { Modal } from "ant-design-vue";
|
|
53
54
|
import { useMethods } from "/@/hooks/system/useMethods";
|
|
55
|
+
import { getToken } from "/@/utils/auth";
|
|
56
|
+
import { goJmReportViewPage } from "/@/utils";
|
|
54
57
|
import { p as pick } from "./pick.js";
|
|
55
|
-
import { filterMultiDictText } from "/@/utils/dict/JDictSelectUtil";
|
|
56
|
-
import { getAreaTextByCode } from "/@/components/Form/src/utils/Area";
|
|
57
|
-
import { createImgPreview } from "/@/components/Preview/index";
|
|
58
58
|
const $exports = {
|
|
59
59
|
vue,
|
|
60
60
|
"@": {
|
|
@@ -119,7 +119,7 @@ const onlineUrl = {
|
|
|
119
119
|
getTreeData: "/online/cgform/api/getTreeData/",
|
|
120
120
|
optPre: "/online/cgform/api/form/",
|
|
121
121
|
buttonAction: "/online/cgform/api/doButton",
|
|
122
|
-
exportXls: "/online/cgform/api/
|
|
122
|
+
exportXls: "/online/cgform/api/exportXlsOld/",
|
|
123
123
|
importXls: "/online/cgform/api/importXls/",
|
|
124
124
|
startProcess: "/act/process/extActProcess/startMutilProcess"
|
|
125
125
|
};
|
|
@@ -151,7 +151,7 @@ const metaPagination = {
|
|
|
151
151
|
showSizeChanger: true,
|
|
152
152
|
total: 0
|
|
153
153
|
};
|
|
154
|
-
const { createMessage: $message } = useMessage();
|
|
154
|
+
const { createMessage: $message, createErrorModal } = useMessage();
|
|
155
155
|
const GET_FUN_BODY_REG = /(?:\/\*[\s\S]*?\*\/|\/\/.*?\r?\n|[^{])+\{([\s\S]*)\}$/;
|
|
156
156
|
function useOnlineTableContext() {
|
|
157
157
|
console.log("-------------------------useOnlineTableContext----------------------->");
|
|
@@ -161,17 +161,19 @@ function useOnlineTableContext() {
|
|
|
161
161
|
const superQueryButtonRef = ref();
|
|
162
162
|
const pagination = ref(false);
|
|
163
163
|
const dataSource = ref([]);
|
|
164
|
+
const tableReloading = ref(true);
|
|
165
|
+
const onlineExtConfigJson = ref();
|
|
164
166
|
let specialConfigMap = {};
|
|
165
167
|
const methods = {
|
|
166
|
-
execButtonEnhance: function(code,
|
|
167
|
-
if (
|
|
168
|
+
execButtonEnhance: function(code, record) {
|
|
169
|
+
if (onlineTableContext[ENHANCEJS][code]) {
|
|
168
170
|
if (SETUP === code) {
|
|
169
171
|
executeEnhanceJsHook(code);
|
|
170
172
|
} else {
|
|
171
|
-
let row = toRaw(
|
|
172
|
-
return
|
|
173
|
+
let row = toRaw(record);
|
|
174
|
+
return onlineTableContext[ENHANCEJS][code].call(onlineTableContext, onlineTableContext, row);
|
|
173
175
|
}
|
|
174
|
-
} else if (
|
|
176
|
+
} else if (onlineTableContext[ENHANCEJS][code + "_hook"]) {
|
|
175
177
|
executeEnhanceJsHook(code + "_hook");
|
|
176
178
|
} else {
|
|
177
179
|
console.log("\u589E\u5F3A\u6CA1\u627E\u5230!", code);
|
|
@@ -179,22 +181,22 @@ function useOnlineTableContext() {
|
|
|
179
181
|
},
|
|
180
182
|
isTree: function(status) {
|
|
181
183
|
if (typeof status === "boolean") {
|
|
182
|
-
|
|
184
|
+
onlineTableContext["isTreeTable"] = status;
|
|
183
185
|
return status;
|
|
184
186
|
} else {
|
|
185
|
-
return
|
|
187
|
+
return onlineTableContext["isTreeTable"];
|
|
186
188
|
}
|
|
187
189
|
}
|
|
188
190
|
};
|
|
189
191
|
function executeEnhanceJsHook(code) {
|
|
190
|
-
let str =
|
|
192
|
+
let str = onlineTableContext[ENHANCEJS][code].toLocaleString();
|
|
191
193
|
let arr = str.match(GET_FUN_BODY_REG);
|
|
192
194
|
if (arr.length > 1) {
|
|
193
195
|
let temp = arr[1];
|
|
194
196
|
executeJsEnhanced(temp);
|
|
195
197
|
}
|
|
196
198
|
}
|
|
197
|
-
const
|
|
199
|
+
const onlineTableContext = new Proxy(CONTEXT_PROP_DESCRIPTION, {
|
|
198
200
|
get(_target, prop) {
|
|
199
201
|
if (typeof methods[prop] === "function") {
|
|
200
202
|
return methods[prop];
|
|
@@ -220,7 +222,7 @@ function useOnlineTableContext() {
|
|
|
220
222
|
}
|
|
221
223
|
}
|
|
222
224
|
});
|
|
223
|
-
const { executeJsEnhanced } = useCustomHook({},
|
|
225
|
+
const { executeJsEnhanced } = useCustomHook({}, onlineTableContext);
|
|
224
226
|
function getTableId() {
|
|
225
227
|
let idValue = route.params.id;
|
|
226
228
|
if (!idValue) {
|
|
@@ -252,14 +254,17 @@ function useOnlineTableContext() {
|
|
|
252
254
|
Object.keys(hrefParam).map((key) => {
|
|
253
255
|
acceptHrefParams[key] = hrefParam[key];
|
|
254
256
|
});
|
|
255
|
-
|
|
257
|
+
onlineTableContext["acceptHrefParams"] = acceptHrefParams;
|
|
256
258
|
}
|
|
257
259
|
}
|
|
258
260
|
function getColumnList() {
|
|
259
261
|
return new Promise((resolve, reject) => {
|
|
260
|
-
defHttp.get(
|
|
261
|
-
|
|
262
|
-
|
|
262
|
+
defHttp.get(
|
|
263
|
+
{
|
|
264
|
+
url: `${onlineTableContext.onlineUrl.getColumns}${ID.value}`
|
|
265
|
+
},
|
|
266
|
+
{ isTransformResponse: false }
|
|
267
|
+
).then((res) => {
|
|
263
268
|
if (res.success) {
|
|
264
269
|
resolve(res.result);
|
|
265
270
|
} else {
|
|
@@ -273,9 +278,9 @@ function useOnlineTableContext() {
|
|
|
273
278
|
}
|
|
274
279
|
function loadData() {
|
|
275
280
|
return new Promise((resolve, reject) => {
|
|
276
|
-
let url = `${
|
|
277
|
-
if (
|
|
278
|
-
url = `${
|
|
281
|
+
let url = `${onlineTableContext.onlineUrl.getData}${ID.value}`;
|
|
282
|
+
if (onlineTableContext.isTree() === true) {
|
|
283
|
+
url = `${onlineTableContext.onlineUrl.getTreeData}${ID.value}`;
|
|
279
284
|
}
|
|
280
285
|
let params = getLoadDataParams();
|
|
281
286
|
console.log("------\u67E5\u8BE2\u53C2\u6570-----", params);
|
|
@@ -285,7 +290,15 @@ function useOnlineTableContext() {
|
|
|
285
290
|
handleDataResult(res.result);
|
|
286
291
|
resolve(true);
|
|
287
292
|
} else {
|
|
288
|
-
|
|
293
|
+
if (res.message === "NO_DB_SYNC") {
|
|
294
|
+
createErrorModal({
|
|
295
|
+
title: "\u6570\u636E\u5E93\u672A\u540C\u6B65",
|
|
296
|
+
content: "\u8BF7\u5148\u540C\u6B65\u6570\u636E\u5E93\u518D\u67E5\u770B\u6B64\u9875\u9762\uFF01",
|
|
297
|
+
onOk: () => router.back()
|
|
298
|
+
});
|
|
299
|
+
} else {
|
|
300
|
+
$message.warning(res.message);
|
|
301
|
+
}
|
|
289
302
|
reject(false);
|
|
290
303
|
}
|
|
291
304
|
}).catch(() => {
|
|
@@ -296,9 +309,9 @@ function useOnlineTableContext() {
|
|
|
296
309
|
});
|
|
297
310
|
}
|
|
298
311
|
function getLoadDataParams() {
|
|
299
|
-
const { sortField, sortType, acceptHrefParams, queryParam } =
|
|
312
|
+
const { sortField, sortType, acceptHrefParams, queryParam } = onlineTableContext;
|
|
300
313
|
let treeParam = {};
|
|
301
|
-
if (
|
|
314
|
+
if (onlineTableContext.isTree() === true) {
|
|
302
315
|
treeParam["hasQuery"] = "false";
|
|
303
316
|
} else {
|
|
304
317
|
treeParam["hasQuery"] = "true";
|
|
@@ -318,7 +331,7 @@ function useOnlineTableContext() {
|
|
|
318
331
|
function handleDataResult(result) {
|
|
319
332
|
let total = 0;
|
|
320
333
|
if (Number(result.total) > 0) {
|
|
321
|
-
if (
|
|
334
|
+
if (onlineTableContext.isTree() === true) {
|
|
322
335
|
dataSource.value = getTreeDataByResult(result.records);
|
|
323
336
|
nextTick(() => {
|
|
324
337
|
loadDataByExpandedRows(dataSource.value);
|
|
@@ -336,11 +349,11 @@ function useOnlineTableContext() {
|
|
|
336
349
|
}
|
|
337
350
|
function handleChangeInTable($pagination, _filters, sorter) {
|
|
338
351
|
if (sorter && sorter.order) {
|
|
339
|
-
|
|
340
|
-
|
|
352
|
+
onlineTableContext["sortField"] = sorter.field;
|
|
353
|
+
onlineTableContext["sortType"] = "ascend" == sorter.order ? "asc" : "desc";
|
|
341
354
|
} else {
|
|
342
|
-
|
|
343
|
-
|
|
355
|
+
onlineTableContext["sortField"] = "id";
|
|
356
|
+
onlineTableContext["sortType"] = "asc";
|
|
344
357
|
}
|
|
345
358
|
if (pagination.value) {
|
|
346
359
|
pagination.value = $pagination;
|
|
@@ -348,20 +361,20 @@ function useOnlineTableContext() {
|
|
|
348
361
|
loadData();
|
|
349
362
|
}
|
|
350
363
|
function handleSpecialConfig(result) {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
let { acceptHrefParams, queryParam, superQuery, currentPage, pageSize } =
|
|
364
|
+
onlineTableContext["description"] = result.description;
|
|
365
|
+
onlineTableContext["currentTableName"] = result.currentTableName;
|
|
366
|
+
onlineTableContext["isDesForm"] = result.isDesForm;
|
|
367
|
+
onlineTableContext["desFormCode"] = result.desFormCode;
|
|
368
|
+
onlineTableContext["ID"] = ID.value;
|
|
369
|
+
let { acceptHrefParams, queryParam, superQuery, currentPage, pageSize } = onlineTableContext;
|
|
357
370
|
handleAcceptHrefParams();
|
|
358
371
|
if (!queryParam) {
|
|
359
|
-
|
|
372
|
+
onlineTableContext["queryParam"] = {};
|
|
360
373
|
} else {
|
|
361
374
|
onlineQueryFormOuter.value.initDefaultValues(queryParam, acceptHrefParams);
|
|
362
375
|
}
|
|
363
376
|
if (!superQuery) {
|
|
364
|
-
|
|
377
|
+
onlineTableContext["superQuery"] = { params: "", matchType: "" };
|
|
365
378
|
} else {
|
|
366
379
|
superQueryButtonRef.value.initDefaultValues(superQuery);
|
|
367
380
|
}
|
|
@@ -371,12 +384,20 @@ function useOnlineTableContext() {
|
|
|
371
384
|
pagination.value = false;
|
|
372
385
|
}
|
|
373
386
|
}
|
|
387
|
+
function reloadTable() {
|
|
388
|
+
return __async(this, null, function* () {
|
|
389
|
+
tableReloading.value = true;
|
|
390
|
+
yield nextTick();
|
|
391
|
+
tableReloading.value = false;
|
|
392
|
+
});
|
|
393
|
+
}
|
|
374
394
|
const add2Context = {
|
|
375
395
|
loadData,
|
|
376
|
-
getLoadDataParams
|
|
396
|
+
getLoadDataParams,
|
|
397
|
+
reloadTable
|
|
377
398
|
};
|
|
378
399
|
Object.keys(add2Context).map((key) => {
|
|
379
|
-
|
|
400
|
+
onlineTableContext[key] = add2Context[key];
|
|
380
401
|
});
|
|
381
402
|
let loading = ref(false);
|
|
382
403
|
function reload() {
|
|
@@ -384,14 +405,14 @@ function useOnlineTableContext() {
|
|
|
384
405
|
if (pagination.value) {
|
|
385
406
|
pagination.value = __spreadProps(__spreadValues({}, pagination.value), { current: 1 });
|
|
386
407
|
}
|
|
387
|
-
|
|
408
|
+
onlineTableContext.clearSelectedRow();
|
|
388
409
|
yield loadData();
|
|
389
410
|
});
|
|
390
411
|
}
|
|
391
412
|
function getTreeDataByResult(result) {
|
|
392
413
|
if (result) {
|
|
393
414
|
return result.map((item) => {
|
|
394
|
-
let hasChildrenField =
|
|
415
|
+
let hasChildrenField = onlineTableContext["hasChildrenField"];
|
|
395
416
|
if (item[hasChildrenField] == "1") {
|
|
396
417
|
let loadChild = { id: item.id + "_loadChild", name: "loading...", isLoading: true };
|
|
397
418
|
loadChild["jeecg_row_key"] = loadChild.id;
|
|
@@ -408,7 +429,7 @@ function useOnlineTableContext() {
|
|
|
408
429
|
function loadDataByExpandedRows(dataList) {
|
|
409
430
|
let expandedRowKeysValue = expandedRowKeys.value;
|
|
410
431
|
if (expandedRowKeysValue.length > 0) {
|
|
411
|
-
const { sortField, sortType, pidField } =
|
|
432
|
+
const { sortField, sortType, pidField } = onlineTableContext;
|
|
412
433
|
let params = Object.assign({}, { column: sortField, order: sortType });
|
|
413
434
|
params["hasQuery"] = "in";
|
|
414
435
|
let superParams = Object.assign({});
|
|
@@ -420,7 +441,7 @@ function useOnlineTableContext() {
|
|
|
420
441
|
params["superQueryParams"] = encodeURI(JSON.stringify(superParams));
|
|
421
442
|
params["superQueryMatchType"] = "and";
|
|
422
443
|
params["batchFlag"] = "true";
|
|
423
|
-
let url = `${
|
|
444
|
+
let url = `${onlineTableContext.onlineUrl.getTreeData}${ID.value}`;
|
|
424
445
|
console.log("--onlineList-\u67E5\u8BE2\u5B50\u8282\u70B9\u53C2\u6570", superParams);
|
|
425
446
|
defHttp.get({ url, params }, { isTransformResponse: false }).then((res) => {
|
|
426
447
|
console.log("--onlineList-\u67E5\u8BE2\u5B50\u8282\u70B9\u5217\u8868\u6570\u636E", res);
|
|
@@ -460,18 +481,21 @@ function useOnlineTableContext() {
|
|
|
460
481
|
}
|
|
461
482
|
}
|
|
462
483
|
function getSuperQueryData() {
|
|
463
|
-
if (!
|
|
484
|
+
if (!onlineTableContext.superQuery) {
|
|
464
485
|
return {};
|
|
465
486
|
}
|
|
466
|
-
const {
|
|
487
|
+
const {
|
|
488
|
+
superQuery: { params, matchType },
|
|
489
|
+
currentTableName
|
|
490
|
+
} = onlineTableContext;
|
|
467
491
|
let pre = currentTableName + "@";
|
|
468
492
|
let arr = [];
|
|
469
493
|
if (params.length > 0) {
|
|
470
494
|
for (let data of params) {
|
|
471
495
|
let item = __spreadValues({}, data);
|
|
472
|
-
let
|
|
473
|
-
if (
|
|
474
|
-
item.field =
|
|
496
|
+
let field = item.field;
|
|
497
|
+
if (field.startsWith(pre)) {
|
|
498
|
+
item.field = field.replace(pre, "");
|
|
475
499
|
}
|
|
476
500
|
arr.push(item);
|
|
477
501
|
}
|
|
@@ -485,7 +509,7 @@ function useOnlineTableContext() {
|
|
|
485
509
|
}
|
|
486
510
|
const superQueryStatus = ref(false);
|
|
487
511
|
function handleSuperQuery(params, matchType) {
|
|
488
|
-
|
|
512
|
+
onlineTableContext["superQuery"] = {
|
|
489
513
|
params,
|
|
490
514
|
matchType
|
|
491
515
|
};
|
|
@@ -502,7 +526,7 @@ function useOnlineTableContext() {
|
|
|
502
526
|
param = {};
|
|
503
527
|
}
|
|
504
528
|
if (!param.row) {
|
|
505
|
-
let rows =
|
|
529
|
+
let rows = onlineTableContext["selectedRows"];
|
|
506
530
|
if (!rows || rows.length == 0 || rows.length > 1) {
|
|
507
531
|
$message.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u6570\u636E");
|
|
508
532
|
return;
|
|
@@ -512,12 +536,18 @@ function useOnlineTableContext() {
|
|
|
512
536
|
param["code"] = ID.value;
|
|
513
537
|
doOpenCustomModal(true, param);
|
|
514
538
|
}
|
|
515
|
-
|
|
539
|
+
onlineTableContext["openCustomModal"] = openCustomModal;
|
|
516
540
|
function handlePageChange() {
|
|
517
541
|
let idValue = getTableId();
|
|
518
542
|
ID.value = idValue;
|
|
519
543
|
}
|
|
520
544
|
handlePageChange();
|
|
545
|
+
function handleFormConfig(formConfig) {
|
|
546
|
+
let extConfigJson = formConfig.head.extConfigJson;
|
|
547
|
+
if (extConfigJson) {
|
|
548
|
+
onlineExtConfigJson.value = JSON.parse(extConfigJson);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
521
551
|
return __spreadValues({
|
|
522
552
|
ID,
|
|
523
553
|
onlineQueryFormOuter,
|
|
@@ -526,20 +556,23 @@ function useOnlineTableContext() {
|
|
|
526
556
|
reload,
|
|
527
557
|
dataSource,
|
|
528
558
|
pagination,
|
|
559
|
+
tableReloading,
|
|
529
560
|
handleSpecialConfig,
|
|
530
|
-
onlineTableContext
|
|
561
|
+
onlineTableContext,
|
|
531
562
|
handleChangeInTable,
|
|
532
563
|
getColumnList,
|
|
533
564
|
getTreeDataByResult,
|
|
534
565
|
expandedRowKeys,
|
|
535
566
|
handleExpandedRowsChange,
|
|
567
|
+
onlineExtConfigJson,
|
|
568
|
+
handleFormConfig,
|
|
536
569
|
superQueryStatus,
|
|
537
570
|
handleSuperQuery,
|
|
538
571
|
registerCustomModal
|
|
539
572
|
}, add2Context);
|
|
540
573
|
}
|
|
541
574
|
const FLOW_CODE_PRE = "onl_";
|
|
542
|
-
function useListButton(
|
|
575
|
+
function useListButton(onlineTableContext, extConfigJson) {
|
|
543
576
|
const buttonStatus = {
|
|
544
577
|
add: true,
|
|
545
578
|
addSub: true,
|
|
@@ -554,6 +587,8 @@ function useListButton(onlineTableContext2) {
|
|
|
554
587
|
};
|
|
555
588
|
const [registerModal, { openModal }] = useModal();
|
|
556
589
|
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
|
590
|
+
const [registerDetailModal, { openModal: openDetailModal }] = useModal();
|
|
591
|
+
const [registerBpmModal, { openModal: openBpmModal }] = useModal();
|
|
557
592
|
const { createMessage: $message2 } = useMessage();
|
|
558
593
|
const buttonSwitch = reactive(buttonStatus);
|
|
559
594
|
const cgLinkButtonList = reactive([]);
|
|
@@ -591,93 +626,138 @@ function useListButton(onlineTableContext2) {
|
|
|
591
626
|
}
|
|
592
627
|
openModal(true, data);
|
|
593
628
|
}
|
|
594
|
-
function handleEdit(
|
|
595
|
-
|
|
629
|
+
function handleEdit(record) {
|
|
630
|
+
onlineTableContext.beforeEdit(record).then(() => {
|
|
596
631
|
openModal(true, {
|
|
597
632
|
isUpdate: true,
|
|
598
|
-
record
|
|
633
|
+
record
|
|
599
634
|
});
|
|
600
635
|
}).catch((msg) => {
|
|
601
636
|
$message2.warning(msg);
|
|
602
637
|
});
|
|
603
638
|
}
|
|
604
|
-
const getDeleteButton = (
|
|
639
|
+
const getDeleteButton = (record) => {
|
|
605
640
|
return {
|
|
606
641
|
label: "\u5220\u9664",
|
|
607
642
|
popConfirm: {
|
|
608
643
|
title: "\u662F\u5426\u5220\u9664\uFF1F",
|
|
609
|
-
confirm: handleDeleteOne.bind(null,
|
|
644
|
+
confirm: handleDeleteOne.bind(null, record)
|
|
610
645
|
}
|
|
611
646
|
};
|
|
612
647
|
};
|
|
613
|
-
function handleDeleteOne(
|
|
614
|
-
|
|
615
|
-
handleDelete(
|
|
648
|
+
function handleDeleteOne(record) {
|
|
649
|
+
onlineTableContext.beforeDelete(record).then(() => {
|
|
650
|
+
handleDelete(record.id);
|
|
616
651
|
}).catch((msg) => {
|
|
617
652
|
$message2.warning(msg);
|
|
618
653
|
});
|
|
619
654
|
}
|
|
620
|
-
function getActions(
|
|
655
|
+
function getActions(record) {
|
|
621
656
|
if (toRaw(buttonSwitch.update) === true) {
|
|
622
657
|
return [
|
|
623
658
|
{
|
|
624
659
|
label: "\u7F16\u8F91",
|
|
625
|
-
onClick: handleEdit.bind(null,
|
|
660
|
+
onClick: handleEdit.bind(null, record)
|
|
626
661
|
}
|
|
627
662
|
];
|
|
628
663
|
}
|
|
629
664
|
return [];
|
|
630
665
|
}
|
|
631
|
-
function getSubmitFlowButton(
|
|
666
|
+
function getSubmitFlowButton(record) {
|
|
632
667
|
return {
|
|
633
668
|
label: "\u63D0\u4EA4\u6D41\u7A0B",
|
|
634
669
|
popConfirm: {
|
|
635
670
|
title: "\u786E\u8BA4\u63D0\u4EA4\u6D41\u7A0B\u5417\uFF1F",
|
|
636
|
-
confirm: handleSubmitFlow.bind(null,
|
|
671
|
+
confirm: handleSubmitFlow.bind(null, record)
|
|
637
672
|
}
|
|
638
673
|
};
|
|
639
674
|
}
|
|
640
|
-
function
|
|
675
|
+
function getViewBpmGraphicButton(record) {
|
|
676
|
+
return {
|
|
677
|
+
label: "\u5BA1\u6279\u8FDB\u5EA6",
|
|
678
|
+
onClick: handleViewGraphic.bind(null, record)
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
function handleViewGraphic(record) {
|
|
682
|
+
const { currentTableName } = onlineTableContext;
|
|
683
|
+
let flowCode = FLOW_CODE_PRE + currentTableName;
|
|
684
|
+
let dataId = record.id;
|
|
685
|
+
openBpmModal(true, {
|
|
686
|
+
flowCode,
|
|
687
|
+
dataId
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
function getDropDownActions(record) {
|
|
641
691
|
let arr = [];
|
|
642
|
-
if (toRaw(buttonSwitch.
|
|
692
|
+
if (toRaw(buttonSwitch.detail) === true) {
|
|
643
693
|
arr.push({
|
|
644
694
|
label: "\u8BE6\u60C5",
|
|
645
|
-
onClick: handleDetail.bind(null,
|
|
695
|
+
onClick: handleDetail.bind(null, record)
|
|
646
696
|
});
|
|
647
697
|
}
|
|
648
|
-
if (
|
|
649
|
-
|
|
698
|
+
if (onlineTableContext["hasBpmStatus"] === true && toRaw(buttonSwitch.bpm) === true) {
|
|
699
|
+
let bpmStatusValue = getBpmStatusValue(record);
|
|
700
|
+
if (!bpmStatusValue || bpmStatusValue == "1") {
|
|
701
|
+
arr.push(getSubmitFlowButton(record));
|
|
702
|
+
} else {
|
|
703
|
+
arr.push(getViewBpmGraphicButton(record));
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
if (extConfigJson.value) {
|
|
707
|
+
let { reportPrintShow, reportPrintUrl } = extConfigJson.value;
|
|
708
|
+
if (reportPrintShow && reportPrintUrl) {
|
|
709
|
+
arr.push({
|
|
710
|
+
label: "\u6253\u5370",
|
|
711
|
+
onClick() {
|
|
712
|
+
let url = reportPrintUrl;
|
|
713
|
+
let id = record.id;
|
|
714
|
+
let token = getToken();
|
|
715
|
+
goJmReportViewPage(url, id, token);
|
|
716
|
+
}
|
|
717
|
+
});
|
|
718
|
+
}
|
|
650
719
|
}
|
|
651
720
|
if (toRaw(buttonSwitch.delete) === true) {
|
|
652
|
-
arr.push(getDeleteButton(
|
|
721
|
+
arr.push(getDeleteButton(record));
|
|
653
722
|
}
|
|
654
723
|
let buttonList = cgLinkButtonList;
|
|
655
724
|
if (buttonList && buttonList.length > 0) {
|
|
656
725
|
for (let item of buttonList) {
|
|
657
|
-
if (showLinkButtonOfExpression(item.exp || "",
|
|
726
|
+
if (showLinkButtonOfExpression(item.exp || "", record) === true) {
|
|
658
727
|
arr.push({
|
|
659
728
|
label: item.buttonName,
|
|
660
|
-
onClick: cgButtonLinkHandler.bind(null,
|
|
729
|
+
onClick: cgButtonLinkHandler.bind(null, record, item.buttonCode, item.optType)
|
|
661
730
|
});
|
|
662
731
|
}
|
|
663
732
|
}
|
|
664
733
|
}
|
|
665
734
|
return arr;
|
|
666
735
|
}
|
|
667
|
-
function
|
|
668
|
-
|
|
736
|
+
function getBpmStatusValue(record) {
|
|
737
|
+
const key = "bpm_status";
|
|
738
|
+
let value = record[key];
|
|
739
|
+
if (!value) {
|
|
740
|
+
value = record[key.toUpperCase()];
|
|
741
|
+
}
|
|
742
|
+
return value;
|
|
743
|
+
}
|
|
744
|
+
function handleDetail(record) {
|
|
745
|
+
openDetailModal(true, {
|
|
669
746
|
isUpdate: true,
|
|
670
747
|
disableSubmit: true,
|
|
671
|
-
record
|
|
748
|
+
record
|
|
672
749
|
});
|
|
673
750
|
}
|
|
674
|
-
function startProcess(
|
|
675
|
-
const {
|
|
751
|
+
function startProcess(record) {
|
|
752
|
+
const {
|
|
753
|
+
currentTableName,
|
|
754
|
+
onlineUrl: { startProcess: startProcess2 }
|
|
755
|
+
} = onlineTableContext;
|
|
676
756
|
let postConfig = {
|
|
677
757
|
url: startProcess2,
|
|
678
758
|
params: {
|
|
679
759
|
flowCode: FLOW_CODE_PRE + currentTableName,
|
|
680
|
-
id:
|
|
760
|
+
id: record.id,
|
|
681
761
|
formUrl: "modules/bpm/task/form/OnlineFormDetail",
|
|
682
762
|
formUrlMobile: "check/onlineForm/detail"
|
|
683
763
|
}
|
|
@@ -695,22 +775,25 @@ function useListButton(onlineTableContext2) {
|
|
|
695
775
|
});
|
|
696
776
|
});
|
|
697
777
|
}
|
|
698
|
-
function handleSubmitFlow(
|
|
778
|
+
function handleSubmitFlow(record) {
|
|
699
779
|
return __async(this, null, function* () {
|
|
700
|
-
yield startProcess(
|
|
701
|
-
|
|
780
|
+
yield startProcess(record);
|
|
781
|
+
onlineTableContext.loadData();
|
|
702
782
|
});
|
|
703
783
|
}
|
|
704
784
|
function handleDelete(dataId) {
|
|
705
785
|
console.log("\u5220\u9664\u6570\u636Eid\u503C", dataId);
|
|
706
|
-
let url = `${
|
|
786
|
+
let url = `${onlineTableContext.onlineUrl.optPre}${onlineTableContext.ID}/${dataId}`;
|
|
707
787
|
return new Promise((resolve, reject) => {
|
|
708
|
-
defHttp.delete(
|
|
709
|
-
|
|
710
|
-
|
|
788
|
+
defHttp.delete(
|
|
789
|
+
{
|
|
790
|
+
url
|
|
791
|
+
},
|
|
792
|
+
{ isTransformResponse: false }
|
|
793
|
+
).then((res) => {
|
|
711
794
|
if (res.success) {
|
|
712
795
|
$message2.success(res.message);
|
|
713
|
-
|
|
796
|
+
onlineTableContext.loadData();
|
|
714
797
|
resolve(true);
|
|
715
798
|
} else {
|
|
716
799
|
$message2.warning(res.message);
|
|
@@ -720,7 +803,7 @@ function useListButton(onlineTableContext2) {
|
|
|
720
803
|
});
|
|
721
804
|
}
|
|
722
805
|
function handleBatchDelete() {
|
|
723
|
-
let arr =
|
|
806
|
+
let arr = onlineTableContext["selectedRowKeys"];
|
|
724
807
|
if (arr.length <= 0) {
|
|
725
808
|
$message2.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u8BB0\u5F55\uFF01");
|
|
726
809
|
return false;
|
|
@@ -743,27 +826,30 @@ function useListButton(onlineTableContext2) {
|
|
|
743
826
|
cancelText: "\u53D6\u6D88",
|
|
744
827
|
onOk: () => __async(this, null, function* () {
|
|
745
828
|
yield handleDelete(ids);
|
|
746
|
-
|
|
829
|
+
onlineTableContext.clearSelectedRow();
|
|
747
830
|
})
|
|
748
831
|
});
|
|
749
832
|
}
|
|
750
833
|
}
|
|
751
|
-
function cgButtonLinkHandler(
|
|
834
|
+
function cgButtonLinkHandler(record, buttonCode, optType) {
|
|
752
835
|
if (optType == "js") {
|
|
753
|
-
|
|
836
|
+
onlineTableContext["execButtonEnhance"](buttonCode, record);
|
|
754
837
|
} else if (optType == "action") {
|
|
755
838
|
let params = {
|
|
756
|
-
formId:
|
|
839
|
+
formId: onlineTableContext["ID"],
|
|
757
840
|
buttonCode,
|
|
758
|
-
dataId:
|
|
841
|
+
dataId: record.id
|
|
759
842
|
};
|
|
760
|
-
let url = `${
|
|
761
|
-
defHttp.post(
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
843
|
+
let url = `${onlineTableContext.onlineUrl.buttonAction}`;
|
|
844
|
+
defHttp.post(
|
|
845
|
+
{
|
|
846
|
+
url,
|
|
847
|
+
params
|
|
848
|
+
},
|
|
849
|
+
{ isTransformResponse: false }
|
|
850
|
+
).then((res) => {
|
|
765
851
|
if (res.success) {
|
|
766
|
-
|
|
852
|
+
onlineTableContext.loadData();
|
|
767
853
|
$message2.success("\u5904\u7406\u5B8C\u6210!");
|
|
768
854
|
} else {
|
|
769
855
|
$message2.warning(res.message);
|
|
@@ -772,28 +858,31 @@ function useListButton(onlineTableContext2) {
|
|
|
772
858
|
}
|
|
773
859
|
}
|
|
774
860
|
function cgButtonJsHandler(buttonCode) {
|
|
775
|
-
|
|
861
|
+
onlineTableContext["execButtonEnhance"](buttonCode);
|
|
776
862
|
}
|
|
777
863
|
function cgButtonActionHandler(buttonCode) {
|
|
778
|
-
let arr =
|
|
864
|
+
let arr = onlineTableContext["selectedRowKeys"];
|
|
779
865
|
if (!arr || arr.length == 0) {
|
|
780
866
|
$message2.warning("\u8BF7\u5148\u9009\u4E2D\u4E00\u6761\u8BB0\u5F55");
|
|
781
867
|
return false;
|
|
782
868
|
}
|
|
783
869
|
let dataId = arr.join(",");
|
|
784
870
|
let params = {
|
|
785
|
-
formId:
|
|
871
|
+
formId: onlineTableContext["ID"],
|
|
786
872
|
buttonCode,
|
|
787
873
|
dataId
|
|
788
874
|
};
|
|
789
|
-
let url = `${
|
|
790
|
-
defHttp.post(
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
875
|
+
let url = `${onlineTableContext.onlineUrl.buttonAction}`;
|
|
876
|
+
defHttp.post(
|
|
877
|
+
{
|
|
878
|
+
url,
|
|
879
|
+
params
|
|
880
|
+
},
|
|
881
|
+
{ isTransformResponse: false }
|
|
882
|
+
).then((res) => {
|
|
794
883
|
if (res.success) {
|
|
795
|
-
|
|
796
|
-
|
|
884
|
+
onlineTableContext.loadData();
|
|
885
|
+
onlineTableContext.clearSelectedRow();
|
|
797
886
|
$message2.success("\u5904\u7406\u5B8C\u6210!");
|
|
798
887
|
} else {
|
|
799
888
|
$message2.warning(res.message);
|
|
@@ -804,18 +893,18 @@ function useListButton(onlineTableContext2) {
|
|
|
804
893
|
openImportModal(true);
|
|
805
894
|
}
|
|
806
895
|
const importUrl = () => {
|
|
807
|
-
return `${
|
|
896
|
+
return `${onlineTableContext.onlineUrl.importXls}${onlineTableContext.ID}`;
|
|
808
897
|
};
|
|
809
898
|
const { handleExportXlsx } = useMethods();
|
|
810
899
|
function onExportExcel() {
|
|
811
|
-
let params =
|
|
812
|
-
let selections =
|
|
900
|
+
let params = onlineTableContext.getLoadDataParams();
|
|
901
|
+
let selections = onlineTableContext["selectedRowKeys"];
|
|
813
902
|
if (selections && selections.length > 0) {
|
|
814
903
|
params["selections"] = selections.join(",");
|
|
815
904
|
}
|
|
816
905
|
let paramsStr = JSON.stringify(filterObj(params));
|
|
817
|
-
let url = `${
|
|
818
|
-
const description =
|
|
906
|
+
let url = `${onlineTableContext.onlineUrl.exportXls}${onlineTableContext.ID}`;
|
|
907
|
+
const description = onlineTableContext.description;
|
|
819
908
|
handleExportXlsx(description, url, { paramsStr });
|
|
820
909
|
}
|
|
821
910
|
function showLinkButtonOfExpression(expression, row) {
|
|
@@ -862,293 +951,9 @@ function useListButton(onlineTableContext2) {
|
|
|
862
951
|
initButtonSwitch,
|
|
863
952
|
getDeleteButton,
|
|
864
953
|
handleSubmitFlow,
|
|
865
|
-
getSubmitFlowButton
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
function useTableColumns(onlineTableContext) {
|
|
869
|
-
let router = useRouter();
|
|
870
|
-
const columns = ref([]);
|
|
871
|
-
const dictOptionInfo = ref({});
|
|
872
|
-
const selectedKeys = ref([]);
|
|
873
|
-
const rowSelection = ref(null);
|
|
874
|
-
let enableScrollBar = ref(true);
|
|
875
|
-
let tableScroll = computed(() => {
|
|
876
|
-
if (enableScrollBar.value == true) {
|
|
877
|
-
return void 0;
|
|
878
|
-
} else {
|
|
879
|
-
return { x: false };
|
|
880
|
-
}
|
|
881
|
-
});
|
|
882
|
-
function handleColumnResult(result) {
|
|
883
|
-
dictOptionInfo.value = result.dictOptions;
|
|
884
|
-
if (result.checkboxFlag == "Y") {
|
|
885
|
-
rowSelection.value = {
|
|
886
|
-
selectedRowKeys: selectedKeys,
|
|
887
|
-
onChange: onSelectChange
|
|
888
|
-
};
|
|
889
|
-
} else {
|
|
890
|
-
rowSelection.value = null;
|
|
891
|
-
}
|
|
892
|
-
enableScrollBar.value = result.scrollFlag == 1;
|
|
893
|
-
let dataColumns = result.columns;
|
|
894
|
-
dataColumns.forEach((column) => {
|
|
895
|
-
Object.keys(column).map((key) => {
|
|
896
|
-
if (column[key] == null) {
|
|
897
|
-
delete column[key];
|
|
898
|
-
}
|
|
899
|
-
});
|
|
900
|
-
});
|
|
901
|
-
let fieldHrefSlots = result.fieldHrefSlots;
|
|
902
|
-
const fieldHrefSlotKeysMap = {};
|
|
903
|
-
fieldHrefSlots.forEach((item) => fieldHrefSlotKeysMap[item.slotName] = item);
|
|
904
|
-
let tableColumns = [];
|
|
905
|
-
tableColumns = handleColumnHrefAndDict(dataColumns, fieldHrefSlotKeysMap);
|
|
906
|
-
bpmStatusFilter(tableColumns);
|
|
907
|
-
console.log("-----\u5217\u8868\u5217\u914D\u7F6E----", tableColumns);
|
|
908
|
-
if (onlineTableContext.isTree() === true) {
|
|
909
|
-
let firstField = result.textField;
|
|
910
|
-
let index = -1;
|
|
911
|
-
for (let i = 0; i < tableColumns.length; i++) {
|
|
912
|
-
if (tableColumns[i].dataIndex == firstField) {
|
|
913
|
-
index = i;
|
|
914
|
-
break;
|
|
915
|
-
}
|
|
916
|
-
}
|
|
917
|
-
if (index > 0) {
|
|
918
|
-
let deleteColumns = tableColumns.splice(index, 1);
|
|
919
|
-
tableColumns.unshift(deleteColumns[0]);
|
|
920
|
-
}
|
|
921
|
-
if (tableColumns.length > 0) {
|
|
922
|
-
tableColumns[0].align = "left";
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
columns.value = tableColumns;
|
|
926
|
-
}
|
|
927
|
-
function onSelectChange(selectedRowKeys, selectedRows) {
|
|
928
|
-
selectedKeys.value = selectedRowKeys;
|
|
929
|
-
onlineTableContext["selectedRows"] = toRaw(selectedRows);
|
|
930
|
-
onlineTableContext["selectedRowKeys"] = toRaw(selectedRowKeys);
|
|
931
|
-
}
|
|
932
|
-
function handleColumnHrefAndDict(columns2, fieldHrefSlotKeysMap) {
|
|
933
|
-
for (let column of columns2) {
|
|
934
|
-
let { customRender, hrefSlotName, fieldType } = column;
|
|
935
|
-
if (fieldType == "Date") {
|
|
936
|
-
column.customRender = ({ text: text2 }) => {
|
|
937
|
-
if (!text2) {
|
|
938
|
-
return "";
|
|
939
|
-
}
|
|
940
|
-
if (text2.length > 10) {
|
|
941
|
-
return text2.substring(0, 10);
|
|
942
|
-
}
|
|
943
|
-
return text2;
|
|
944
|
-
};
|
|
945
|
-
} else {
|
|
946
|
-
if (!hrefSlotName && (column.scopedSlots && column.scopedSlots.customRender)) {
|
|
947
|
-
if (fieldHrefSlotKeysMap.hasOwnProperty(column.scopedSlots.customRender)) {
|
|
948
|
-
hrefSlotName = column.scopedSlots.customRender;
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
if (customRender || hrefSlotName) {
|
|
952
|
-
let dictCode = customRender;
|
|
953
|
-
let replaceFlag = "_replace_text_";
|
|
954
|
-
column.ellipsis = true;
|
|
955
|
-
column.customRender = ({ text: text2, record: record2 }) => {
|
|
956
|
-
let value = text2;
|
|
957
|
-
if (dictCode) {
|
|
958
|
-
if (dictCode.startsWith(replaceFlag)) {
|
|
959
|
-
let textFieldName = dictCode.replace(replaceFlag, "");
|
|
960
|
-
value = record2[textFieldName];
|
|
961
|
-
} else {
|
|
962
|
-
value = filterMultiDictText(unref(dictOptionInfo)[dictCode], text2 + "");
|
|
963
|
-
}
|
|
964
|
-
}
|
|
965
|
-
if (column.showLength) {
|
|
966
|
-
if (value && value.length > column.showLength) {
|
|
967
|
-
value = value.substr(0, column.showLength) + "...";
|
|
968
|
-
}
|
|
969
|
-
}
|
|
970
|
-
if (hrefSlotName) {
|
|
971
|
-
let field2 = fieldHrefSlotKeysMap[hrefSlotName];
|
|
972
|
-
if (field2) {
|
|
973
|
-
return h("a", {
|
|
974
|
-
onClick: () => handleClickFieldHref(field2, record2)
|
|
975
|
-
}, value);
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
return value;
|
|
979
|
-
};
|
|
980
|
-
}
|
|
981
|
-
if (column.scopedSlots) {
|
|
982
|
-
column.ellipsis = true;
|
|
983
|
-
let slots = column.scopedSlots;
|
|
984
|
-
column["slots"] = slots;
|
|
985
|
-
delete column.scopedSlots;
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
return columns2;
|
|
990
|
-
}
|
|
991
|
-
function handleClickFieldHref(field, record) {
|
|
992
|
-
let href = field.href;
|
|
993
|
-
let urlPattern = /(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-\.\?\,\'\/\\\+&%\$#_]*)?/;
|
|
994
|
-
let compPattern = /\.vue(\?.*)?$/;
|
|
995
|
-
let jsPattern = /{{([^}]+)}}/g;
|
|
996
|
-
if (typeof href === "string") {
|
|
997
|
-
href = href.trim().replace(/\${([^}]+)?}/g, (_s1, s2) => record[s2]);
|
|
998
|
-
if (jsPattern.test(href)) {
|
|
999
|
-
href = href.replace(jsPattern, function(text, s0) {
|
|
1000
|
-
try {
|
|
1001
|
-
return eval(s0);
|
|
1002
|
-
} catch (e) {
|
|
1003
|
-
console.error(e);
|
|
1004
|
-
return text;
|
|
1005
|
-
}
|
|
1006
|
-
});
|
|
1007
|
-
}
|
|
1008
|
-
if (urlPattern.test(href)) {
|
|
1009
|
-
window.open(href, "_blank");
|
|
1010
|
-
} else if (compPattern.test(href)) {
|
|
1011
|
-
openHrefCompModal(href);
|
|
1012
|
-
} else {
|
|
1013
|
-
router.push(href);
|
|
1014
|
-
}
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
const dialogStyle = {
|
|
1018
|
-
top: 0,
|
|
1019
|
-
left: 0,
|
|
1020
|
-
height: "100%",
|
|
1021
|
-
margin: 0,
|
|
1022
|
-
padding: 0
|
|
1023
|
-
};
|
|
1024
|
-
const hrefComponent = reactive({
|
|
1025
|
-
model: {
|
|
1026
|
-
title: "",
|
|
1027
|
-
okText: "\u5173\u95ED",
|
|
1028
|
-
width: "100%",
|
|
1029
|
-
visible: false,
|
|
1030
|
-
destroyOnClose: true,
|
|
1031
|
-
style: dialogStyle,
|
|
1032
|
-
bodyStyle: { padding: "8px", height: "calc(100vh - 108px)", overflow: "auto", overflowX: "hidden" },
|
|
1033
|
-
cancelButtonProps: { style: { display: "none" } }
|
|
1034
|
-
},
|
|
1035
|
-
on: {
|
|
1036
|
-
ok: () => hrefComponent.model.visible = false,
|
|
1037
|
-
cancel: () => hrefComponent.model.visible = false
|
|
1038
|
-
},
|
|
1039
|
-
is: null,
|
|
1040
|
-
params: {}
|
|
1041
|
-
});
|
|
1042
|
-
function openHrefCompModal(href2) {
|
|
1043
|
-
let index = href2.indexOf("?");
|
|
1044
|
-
let path = href2;
|
|
1045
|
-
if (index !== -1) {
|
|
1046
|
-
path = href2.substring(0, index);
|
|
1047
|
-
let paramString = href2.substring(index + 1, href2.length);
|
|
1048
|
-
let paramArray = paramString.split("&");
|
|
1049
|
-
let params = {};
|
|
1050
|
-
paramArray.forEach((paramObject) => {
|
|
1051
|
-
let paramItem = paramObject.split("=");
|
|
1052
|
-
params[paramItem[0]] = paramItem[1];
|
|
1053
|
-
});
|
|
1054
|
-
hrefComponent.params = params;
|
|
1055
|
-
} else {
|
|
1056
|
-
hrefComponent.params = {};
|
|
1057
|
-
}
|
|
1058
|
-
hrefComponent.model.visible = true;
|
|
1059
|
-
hrefComponent.model.title = "\u64CD\u4F5C";
|
|
1060
|
-
hrefComponent.is = defineAsyncComponent(() => import(
|
|
1061
|
-
/* @vite-ignore */
|
|
1062
|
-
"/@/views/" + (path.startsWith("/") ? path.slice(1) : path)
|
|
1063
|
-
));
|
|
1064
|
-
}
|
|
1065
|
-
const actionColumn = reactive({
|
|
1066
|
-
title: "\u64CD\u4F5C",
|
|
1067
|
-
dataIndex: "action",
|
|
1068
|
-
slots: { customRender: "action" },
|
|
1069
|
-
align: "center",
|
|
1070
|
-
width: 150
|
|
1071
|
-
});
|
|
1072
|
-
function bpmStatusFilter(tableColumns) {
|
|
1073
|
-
let flag = false;
|
|
1074
|
-
for (let i = 0; i < tableColumns.length; i++) {
|
|
1075
|
-
let item = tableColumns[i];
|
|
1076
|
-
let fieldName = item.dataIndex;
|
|
1077
|
-
if (fieldName.toLowerCase() == "bpm_status") {
|
|
1078
|
-
flag = true;
|
|
1079
|
-
break;
|
|
1080
|
-
}
|
|
1081
|
-
}
|
|
1082
|
-
onlineTableContext["hasBpmStatus"] = flag;
|
|
1083
|
-
return flag;
|
|
1084
|
-
}
|
|
1085
|
-
function downloadRowFile(text2) {
|
|
1086
|
-
if (!text2) {
|
|
1087
|
-
return;
|
|
1088
|
-
}
|
|
1089
|
-
if (text2.indexOf(",") > 0) {
|
|
1090
|
-
text2 = text2.substring(0, text2.indexOf(","));
|
|
1091
|
-
}
|
|
1092
|
-
let url = getFileAccessHttpUrl(text2);
|
|
1093
|
-
window.open(url);
|
|
1094
|
-
}
|
|
1095
|
-
function getImgView(text2) {
|
|
1096
|
-
if (text2 && text2.indexOf(",") > 0) {
|
|
1097
|
-
text2 = text2.substring(0, text2.indexOf(","));
|
|
1098
|
-
}
|
|
1099
|
-
return getFileAccessHttpUrl(text2);
|
|
1100
|
-
}
|
|
1101
|
-
function getPcaText(code) {
|
|
1102
|
-
if (!code) {
|
|
1103
|
-
return "";
|
|
1104
|
-
}
|
|
1105
|
-
return getAreaTextByCode(code);
|
|
1106
|
-
}
|
|
1107
|
-
function getFormatDate(text2) {
|
|
1108
|
-
if (!text2) {
|
|
1109
|
-
return "";
|
|
1110
|
-
}
|
|
1111
|
-
let a = text2;
|
|
1112
|
-
if (a.length > 10) {
|
|
1113
|
-
a = a.substring(0, 10);
|
|
1114
|
-
}
|
|
1115
|
-
return a;
|
|
1116
|
-
}
|
|
1117
|
-
watch(selectedKeys, () => {
|
|
1118
|
-
onlineTableContext["selectedRowKeys"] = toRaw(selectedKeys.value);
|
|
1119
|
-
});
|
|
1120
|
-
onlineTableContext["clearSelectedRow"] = () => {
|
|
1121
|
-
selectedKeys.value = [];
|
|
1122
|
-
onlineTableContext["selectedRows"] = [];
|
|
1123
|
-
onlineTableContext["selectedRowKeys"] = [];
|
|
1124
|
-
};
|
|
1125
|
-
function viewOnlineCellImage(text2) {
|
|
1126
|
-
if (text2) {
|
|
1127
|
-
let imgList = [];
|
|
1128
|
-
let arr = text2.split(",");
|
|
1129
|
-
for (let str of arr) {
|
|
1130
|
-
if (str) {
|
|
1131
|
-
imgList.push(getFileAccessHttpUrl(str));
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
createImgPreview({ imageList: imgList });
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
return {
|
|
1138
|
-
columns,
|
|
1139
|
-
actionColumn,
|
|
1140
|
-
selectedKeys,
|
|
1141
|
-
rowSelection,
|
|
1142
|
-
enableScrollBar,
|
|
1143
|
-
tableScroll,
|
|
1144
|
-
downloadRowFile,
|
|
1145
|
-
getImgView,
|
|
1146
|
-
getPcaText,
|
|
1147
|
-
getFormatDate,
|
|
1148
|
-
handleColumnResult,
|
|
1149
|
-
onSelectChange,
|
|
1150
|
-
hrefComponent,
|
|
1151
|
-
viewOnlineCellImage
|
|
954
|
+
getSubmitFlowButton,
|
|
955
|
+
registerDetailModal,
|
|
956
|
+
registerBpmModal
|
|
1152
957
|
};
|
|
1153
958
|
}
|
|
1154
|
-
export { useListButton as a,
|
|
959
|
+
export { useListButton as a, useOnlineTableContext as u };
|