centaline-data-driven-v3 0.0.57 → 0.0.59
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/dist/centaline-data-driven-v3.umd.js +56 -56
- package/package.json +1 -1
- package/src/components/app/SearchList/SearchTable.vue +1 -1
- package/src/components/web/Button.vue +3 -3
- package/src/components/web/SearchList/SearchTable.vue +115 -29
- package/src/components/web/SearchList.vue +4 -1
- package/src/components/web/other/PopupSearchListTable.vue +8 -2
- package/src/loader/src/Field.js +7 -0
- package/src/loader/src/Form.js +15 -1
- package/src/loader/src/LibFunction.js +3 -0
- package/src/loader/src/PhotoSelect.js +11 -1
- package/src/loader/src/Router.js +15 -1
- package/src/main.js +4 -4
- package/src/utils/Enum.js +778 -766
- package/src/utils/mixins.js +57 -10
- package/src/views/Form.vue +2 -3
- package/src/views/SearchList.vue +3 -2
package/package.json
CHANGED
|
@@ -64,6 +64,7 @@ import { ElMessage } from 'element-plus'
|
|
|
64
64
|
const emit = defineEmits(['input', 'fieldClick', 'importComplete'])
|
|
65
65
|
const props = defineProps({
|
|
66
66
|
parameterAction: String,
|
|
67
|
+
fileData: Object,
|
|
67
68
|
vmodel: Object,
|
|
68
69
|
source: Object,
|
|
69
70
|
flagAppMode: Boolean,
|
|
@@ -94,10 +95,9 @@ const headers = computed(() => {
|
|
|
94
95
|
function clickHandle() {
|
|
95
96
|
emit('fieldClick', model.value);
|
|
96
97
|
}
|
|
98
|
+
|
|
97
99
|
function handleAvatarSuccess(res) {
|
|
98
|
-
|
|
99
|
-
emit('importComplete', res, model.value);
|
|
100
|
-
});
|
|
100
|
+
emit('importComplete', res, model.value);
|
|
101
101
|
}
|
|
102
102
|
function handleAvatarError(info) {
|
|
103
103
|
ElMessage({
|
|
@@ -359,6 +359,7 @@ function searchComplate(m, defaultSearch) {
|
|
|
359
359
|
searchEnd.value = Date.now();
|
|
360
360
|
isLoading.value = false;
|
|
361
361
|
tableLoading.value = false;
|
|
362
|
+
emit("loadedError");
|
|
362
363
|
});
|
|
363
364
|
}
|
|
364
365
|
if (typeof props.source !== "undefined") {
|
|
@@ -459,41 +460,126 @@ function toolbarClickHandler(field) {
|
|
|
459
460
|
}
|
|
460
461
|
//导入
|
|
461
462
|
function importComplete(res, field) {
|
|
463
|
+
if (res && res.rtnCode && res.rtnCode === 201) {
|
|
464
|
+
if (res.rtnMsg) {
|
|
465
|
+
ElMessage({
|
|
466
|
+
message: res.rtnMsg,
|
|
467
|
+
type: 'warning',
|
|
468
|
+
showClose: true,
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
else if (res && res.rtnCode && res.rtnCode === 202 && res.rtnMsg) {
|
|
474
|
+
common.confirm(res.rtnMsg, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
|
475
|
+
|
|
476
|
+
})
|
|
477
|
+
.catch(() => {
|
|
478
|
+
});
|
|
479
|
+
}
|
|
462
480
|
if (field.flagAsync) {
|
|
463
|
-
if (res.
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
481
|
+
if (res.rtnCode && res.rtnCode === 202 && res.rtnMsg) {
|
|
482
|
+
common.confirm(res.rtnMsg, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {
|
|
483
|
+
if (res.content && res.content.action) {
|
|
484
|
+
var dialogOption = {
|
|
485
|
+
title: field.pageTitle || field.label,
|
|
486
|
+
content: [{
|
|
487
|
+
component: 'ct-progress',
|
|
488
|
+
width: '350px',
|
|
489
|
+
height: '165px',
|
|
490
|
+
attrs: {
|
|
491
|
+
progressAction: res.content.action,
|
|
492
|
+
progressKey: res.content.key,
|
|
493
|
+
progressType: 'import',
|
|
494
|
+
onFinished(data) {
|
|
495
|
+
common.closeDialog(dialogOption);
|
|
496
|
+
if (field.isExport) {
|
|
497
|
+
if (data.content.indexOf(".zip") > -1) {
|
|
498
|
+
window.location.href = encodeURI(data.content);
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
if (data.content.indexOf("?") > -1) {
|
|
502
|
+
downloadUrl.value = data.content + "&" + Math.random();
|
|
503
|
+
}
|
|
504
|
+
else {
|
|
505
|
+
downloadUrl.value = data.content + "?" + Math.random();
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
if (data.rtnMsg) {
|
|
510
|
+
ElMessage({
|
|
511
|
+
message: data.rtnMsg,
|
|
512
|
+
type: 'success',
|
|
513
|
+
showClose: true,
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
getPage(1, false);
|
|
517
|
+
},
|
|
518
|
+
onError(data) {
|
|
519
|
+
common.closeDialog(dialogOption);
|
|
520
|
+
ElMessage({
|
|
521
|
+
message: data.rtnMsg,
|
|
522
|
+
type: 'warning',
|
|
523
|
+
showClose: true,
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
}]
|
|
528
|
+
};
|
|
529
|
+
common.openDialog(dialogOption);
|
|
530
|
+
}
|
|
531
|
+
})
|
|
532
|
+
.catch(() => { });
|
|
533
|
+
}
|
|
534
|
+
else {
|
|
535
|
+
if (res.content && res.content.action) {
|
|
536
|
+
var dialogOption = {
|
|
537
|
+
title: field.pageTitle || field.label,
|
|
538
|
+
content: [{
|
|
539
|
+
component: 'ct-progress',
|
|
540
|
+
width: '350px',
|
|
541
|
+
height: '165px',
|
|
542
|
+
attrs: {
|
|
543
|
+
progressAction: res.content.action,
|
|
544
|
+
progressKey: res.content.key,
|
|
545
|
+
progressType: 'import',
|
|
546
|
+
onFinished(data) {
|
|
547
|
+
common.closeDialog(dialogOption);
|
|
548
|
+
if (field.isExport) {
|
|
549
|
+
if (data.content.indexOf(".zip") > -1) {
|
|
550
|
+
window.location.href = encodeURI(data.content);
|
|
551
|
+
}
|
|
552
|
+
else {
|
|
553
|
+
if (data.content.indexOf("?") > -1) {
|
|
554
|
+
downloadUrl.value = data.content + "&" + Math.random();
|
|
555
|
+
}
|
|
556
|
+
else {
|
|
557
|
+
downloadUrl.value = data.content + "?" + Math.random();
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
if (data.rtnMsg) {
|
|
562
|
+
ElMessage({
|
|
563
|
+
message: data.rtnMsg,
|
|
564
|
+
type: 'success',
|
|
565
|
+
showClose: true,
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
getPage(1, false);
|
|
569
|
+
},
|
|
570
|
+
onError(data) {
|
|
571
|
+
common.closeDialog(dialogOption);
|
|
477
572
|
ElMessage({
|
|
478
573
|
message: data.rtnMsg,
|
|
479
|
-
type: '
|
|
574
|
+
type: 'warning',
|
|
480
575
|
showClose: true,
|
|
481
576
|
});
|
|
482
577
|
}
|
|
483
|
-
getPage(1, false);
|
|
484
578
|
},
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
type: 'warning',
|
|
490
|
-
showClose: true,
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
},
|
|
494
|
-
}]
|
|
495
|
-
};
|
|
496
|
-
common.openDialog(dialogOption);
|
|
579
|
+
}]
|
|
580
|
+
};
|
|
581
|
+
common.openDialog(dialogOption);
|
|
582
|
+
}
|
|
497
583
|
}
|
|
498
584
|
}
|
|
499
585
|
else {
|
|
@@ -1051,7 +1137,7 @@ function updateCurrentRow(router, data, flagSimple) {
|
|
|
1051
1137
|
SearchTable.getCurrentRowApiData(model.value,
|
|
1052
1138
|
function () {
|
|
1053
1139
|
itemKey.value = Math.random()
|
|
1054
|
-
model.value.selectAll=false
|
|
1140
|
+
model.value.selectAll = false
|
|
1055
1141
|
emit("searchComplate");
|
|
1056
1142
|
if (data && !flagSimple) {
|
|
1057
1143
|
emit("simpleRouterRefreshHandler");
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
@rowClickHandle="rowClickHandle" @refreshRowHandle="refreshRowHandle" @scrollHandle="scrollHandle"
|
|
20
20
|
@refreshParent="refreshParentHandler" @simpleRouterRefreshHandler="simpleRouterRefreshHandler"
|
|
21
21
|
@closeSideBar="closeSideBar" @popupClickHandler="popupClickHandler" :dragStartItem="dragStartItem"
|
|
22
|
-
:dragStartName="dragStartName"
|
|
22
|
+
:dragStartName="dragStartName" @loadedError="tableLoadedError"
|
|
23
23
|
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
24
24
|
@drag="drag"
|
|
25
25
|
>
|
|
@@ -285,6 +285,9 @@ function tableLoaded() {
|
|
|
285
285
|
emit('tableLoaded', refTable.value.model);
|
|
286
286
|
emit('loaded', refTable.value.model);
|
|
287
287
|
}
|
|
288
|
+
function tableLoadedError() {
|
|
289
|
+
pageDisabled.value = false;
|
|
290
|
+
}
|
|
288
291
|
function sideMenuClickHandler(v) {
|
|
289
292
|
drowerClose.value = v;
|
|
290
293
|
let popoverCallTels = document.getElementsByClassName('el-popoverCallTel');
|
|
@@ -28,9 +28,15 @@
|
|
|
28
28
|
</template>
|
|
29
29
|
</template>
|
|
30
30
|
</el-table-column>
|
|
31
|
-
<template v-else>
|
|
32
|
-
<el-table-column v-if="col.
|
|
31
|
+
<template v-else-if="col.show">
|
|
32
|
+
<el-table-column v-if="col.flagHtml" :prop="col.id" :label="col.name" :min-width="col.width">
|
|
33
|
+
<template #default="scope">
|
|
34
|
+
<span v-html="scope.row[col.id]"></span>
|
|
35
|
+
</template>
|
|
36
|
+
</el-table-column>
|
|
37
|
+
<el-table-column v-else :prop="col.id" :label="col.name" :min-width="col.width">
|
|
33
38
|
</el-table-column>
|
|
39
|
+
|
|
34
40
|
</template>
|
|
35
41
|
</template>
|
|
36
42
|
</el-table>
|
package/src/loader/src/Field.js
CHANGED
|
@@ -734,6 +734,13 @@ const Base = function (source, moreActionRouter) {
|
|
|
734
734
|
set lazyLoad(v) {
|
|
735
735
|
source.lazyLoad = v;
|
|
736
736
|
},
|
|
737
|
+
// 控件类型为 VueCustomizedComponent 时 对应的 前端vue的组件名称
|
|
738
|
+
get vueComponentName() {
|
|
739
|
+
return source.vueComponentName;
|
|
740
|
+
},
|
|
741
|
+
set vueComponentName(v) {
|
|
742
|
+
source.vueComponentName = v;
|
|
743
|
+
},
|
|
737
744
|
//Field结束
|
|
738
745
|
|
|
739
746
|
collapseName: -1,//所属分组
|
package/src/loader/src/Form.js
CHANGED
|
@@ -81,6 +81,11 @@ function loadFromModel(source, isFormList) {
|
|
|
81
81
|
attrValue = Number(attrValue).toFixed(rtn1.decimals1)
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
+
else if (attrKey == 'code1' && (rtn1.controlType === Enum.ControlType.File
|
|
85
|
+
|| rtn1.controlType === Enum.ControlType.SliceUpload|| rtn1.controlType === Enum.ControlType.PhotoSelect)
|
|
86
|
+
&& attrValue != undefined && attrValue != null && attrValue != '') {
|
|
87
|
+
rtn1.jsSetFile(attrValue,rtn1);
|
|
88
|
+
}
|
|
84
89
|
rtn1[attrKey] = attrValue;
|
|
85
90
|
if (rtn1.controlType === Enum.ControlType.Tags) {
|
|
86
91
|
rtn1["value"] = JSON.parse(attrValue);
|
|
@@ -1082,7 +1087,16 @@ function changeHandler(field, model) {
|
|
|
1082
1087
|
var router = model.actionRouters.find((v) => {
|
|
1083
1088
|
return v.id === field.onAfterChanged;
|
|
1084
1089
|
});
|
|
1085
|
-
|
|
1090
|
+
if(router){
|
|
1091
|
+
clickHandler(router);
|
|
1092
|
+
}
|
|
1093
|
+
else{
|
|
1094
|
+
if (model.scripts) {
|
|
1095
|
+
model.scripts.formData.setExcuteListData(model.fields);
|
|
1096
|
+
}
|
|
1097
|
+
model.scripts.$fd = field.id;
|
|
1098
|
+
common.excute.call(model.scripts, field.onAfterChanged);
|
|
1099
|
+
}
|
|
1086
1100
|
}
|
|
1087
1101
|
}
|
|
1088
1102
|
function getRouterAndSubmitData(field, model) {
|
|
@@ -247,6 +247,9 @@ const LibFunction = {
|
|
|
247
247
|
item = NumberWithPlusAndMinus(item)
|
|
248
248
|
item.is = 'ct-numberwithplusandminus'
|
|
249
249
|
break;
|
|
250
|
+
case Enum.ControlType.VueCustomizedComponent:
|
|
251
|
+
item.is = 'ct-'+item.vueComponentName.toLowerCase();
|
|
252
|
+
break;
|
|
250
253
|
default:
|
|
251
254
|
item = Label(item)
|
|
252
255
|
item.is = 'ct-label'
|
|
@@ -32,6 +32,16 @@ const loadModel = function (source, fileSourceList, router, optionApi, sourceLis
|
|
|
32
32
|
}
|
|
33
33
|
return rtn._fileList;
|
|
34
34
|
},
|
|
35
|
+
//外部调用赋值
|
|
36
|
+
jsSetFile(data, model) {
|
|
37
|
+
var photos = JSON.parse(data);
|
|
38
|
+
photos.forEach((v) => {
|
|
39
|
+
if (model.fileSourceList.length < parseInt(model.maxValue1 || 999)) {
|
|
40
|
+
model.fileList.push(v);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
PhotoSelect.setSelectfileSourceList(model.fileList, model);
|
|
44
|
+
},
|
|
35
45
|
getFormObj() {
|
|
36
46
|
var rtnFormObj = {};
|
|
37
47
|
var self = this;
|
|
@@ -95,7 +105,7 @@ function setSelectfileSourceList(newfileList, model) {
|
|
|
95
105
|
let item = newfileList.find(v => {
|
|
96
106
|
return v.mediaID === model.fileSourceList[i].mediaID;
|
|
97
107
|
});
|
|
98
|
-
if(!item){
|
|
108
|
+
if (!item) {
|
|
99
109
|
model.fileSourceList[i].flagDefault = false;
|
|
100
110
|
model.fileSourceList[i].flagDeleted = true;
|
|
101
111
|
pushArr.push(model.fileSourceList[i])
|
package/src/loader/src/Router.js
CHANGED
|
@@ -17,7 +17,7 @@ const Router = function (source) {
|
|
|
17
17
|
return source.action;
|
|
18
18
|
},
|
|
19
19
|
set action(v) {
|
|
20
|
-
return source.action=v;
|
|
20
|
+
return source.action = v;
|
|
21
21
|
},
|
|
22
22
|
// action的url对应的FieldName,如果此处有值,则忽略action
|
|
23
23
|
get actionField() {
|
|
@@ -92,10 +92,24 @@ const Router = function (source) {
|
|
|
92
92
|
source.hidden = !v;
|
|
93
93
|
},
|
|
94
94
|
|
|
95
|
+
//是否显示
|
|
96
|
+
get vueComponentName() {
|
|
97
|
+
return source.vueComponentName;
|
|
98
|
+
},
|
|
99
|
+
set vueComponentName(v) {
|
|
100
|
+
source.vueComponentName = vueComponentName;
|
|
101
|
+
},
|
|
102
|
+
|
|
95
103
|
//Action 对应的页面样式
|
|
96
104
|
get pageStyle() {
|
|
97
105
|
return source.pageStyle;
|
|
98
106
|
},
|
|
107
|
+
get isVueComponentInLayer() {
|
|
108
|
+
return source.pageStyle === Enum.PageStyle.OpenVueComponentInLayer;
|
|
109
|
+
},
|
|
110
|
+
get isVueComponentInTab() {
|
|
111
|
+
return source.pageStyle === Enum.PageStyle.OpenVueComponentInTab;
|
|
112
|
+
},
|
|
99
113
|
get isOpenForm() {
|
|
100
114
|
return source.pageStyle === Enum.PageStyle.FormPageInLayer;
|
|
101
115
|
},
|
package/src/main.js
CHANGED
|
@@ -21,8 +21,8 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
app.use(centaline, {
|
|
24
|
-
|
|
25
|
-
baseUrl: "http://10.88.22.66:6060/onecard-api/",
|
|
24
|
+
baseUrl:"http://10.88.22.66/IBS.Mvc/api/",
|
|
25
|
+
//baseUrl: "http://10.88.22.66:6060/onecard-api/",
|
|
26
26
|
//baseUrl: "http://10.1.245.50:38735/max-uplink-api/",
|
|
27
27
|
//baseUrl: "http://10.1.245.111:38028/",
|
|
28
28
|
flagRouterSelf: true,
|
|
@@ -63,8 +63,8 @@ app.use(centaline, {
|
|
|
63
63
|
return {
|
|
64
64
|
//authObject: '{token:"aplus eyJhbGciOiJIUzI1NiIsInppcCI6IkRFRiJ9.eNrEjjsOwjAQBe-ydVay1xvvOl3sJA2HiPIxElSIJBIIcXdAQEfPFK-YZt4Nlm2EChqtDafOYWqpRG6kxLoTxZhUTSRxHLUPH_DHfOmt5SDWt1gHScieHapNiol94q5pXYoNFJAvJ6isGHWmNMYVcBjWtyCr_iW2JZ93-fqPc8f18MwGIqFRCIO1GXmWGYd9npCZJ6N5JjYZ7g8AAAD__w.HgtNKtHWooj8c9Hy_vB8CfKq-qOeHMp0irnW0DfXtHo"}',
|
|
65
65
|
//oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
|
|
66
|
-
authObject: '{token:"1-
|
|
67
|
-
|
|
66
|
+
//authObject: '{token:"1-7acf3f06-c2ea-471c-a5fa-07e1c2a81728"}',
|
|
67
|
+
authObject: '{EmpID:"Token_0cb4ef4e-d86d-4090-9973-d3466ea6429f",MachineCode:"7a216b39-84af-43bb-842b-07604ac37a10",SSO_Token:"SSOToken_0cb4ef4e-d86d-4090-9973-d3466ea6429f",Platform:"WEB"}',
|
|
68
68
|
};
|
|
69
69
|
},
|
|
70
70
|
// 请求完成事件,可判断是否登录过期执行响应操作
|