centaline-data-driven 1.2.91 → 1.2.94
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/build/centaline/centaline.path.js +1 -0
- package/package.json +1 -1
- package/src/Form.vue +6 -17
- package/src/SearchList.vue +0 -2
- package/src/centaline/browseVideo/index.js +11 -0
- package/src/centaline/browseVideo/src/browseVideo.vue +30 -0
- package/src/centaline/common/index.js +28 -1
- package/src/centaline/dynamicCompound/src/dynamicCompound.vue +64 -13
- package/src/centaline/dynamicContact/src/dynamicContact.vue +3 -0
- package/src/centaline/dynamicDetail/src/dynamicContactList.vue +3 -0
- package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +15 -1
- package/src/centaline/dynamicDetail/src/dynamicPropertySimpleDetailRET.vue +3 -0
- package/src/centaline/dynamicForm/src/dynamicForm.vue +3 -0
- package/src/centaline/dynamicPopupSearchList/src/dynamicPopupSearchList.vue +1 -1
- package/src/centaline/dynamicPopupSearchList/src/dynamicPopupSearchListTable.vue +5 -2
- package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +12 -2
- package/src/centaline/loader/src/ctl/Compound.js +156 -5
- package/src/centaline/loader/src/ctl/Form.js +27 -14
- package/src/centaline/loader/src/ctl/Router.js +3 -0
- package/src/centaline/loader/src/ctl/SearchTable.js +6 -1
- package/src/centaline/loader/src/ctl/lib/LibFunction.js +1 -1
- package/src/main.js +4 -4
- package/wwwroot/static/centaline/centaline-data-driven.js +3 -3
- package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
|
@@ -44,6 +44,7 @@ const paths = {
|
|
|
44
44
|
"dynamicCompound": "./src/centaline/dynamicCompound/index.js",//复合控件
|
|
45
45
|
"dynamicContact": "./src/centaline/dynamicContact/index.js",//联系人电话
|
|
46
46
|
"dynamicLayout": "./src/centaline/dynamicLayout/index.js",//Layout组件
|
|
47
|
+
"browseVideo": "./src/centaline/browseVideo/index.js",//确认框组件
|
|
47
48
|
},
|
|
48
49
|
"plugs": {
|
|
49
50
|
"api": "./src/centaline/api/index.js",//调用API插件
|
package/package.json
CHANGED
package/src/Form.vue
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div id="app-form" class="data-driven" style="width:100%;height:100%;overflow:auto">
|
|
3
3
|
<!-- <ct-form :api="'/PropertyRET/getLayoutOfNew'" :apiParam="apiParam"></ct-form> -->
|
|
4
4
|
<!-- <ct-form :source="formdata.content" :apiParam="apiParam"></ct-form> -->
|
|
5
|
-
<ct-form :api="'/
|
|
5
|
+
<ct-form :api="'/api/third-dept-tran/transaction/detail'" :apiParam="apiParam"></ct-form>
|
|
6
6
|
<!--<ct-form :api="'api/Form/formdata'"></ct-form>-->
|
|
7
7
|
<ct-dialog-list></ct-dialog-list>
|
|
8
8
|
</div>
|
|
@@ -13,23 +13,12 @@
|
|
|
13
13
|
name: 'App',
|
|
14
14
|
data() {
|
|
15
15
|
return {
|
|
16
|
-
// apiParam: {profitReturnId: "1504359257134055426", actionType: 1, pageStyle: 2, pageTitle: "查看返利", pageOnly: true} ,
|
|
17
|
-
// apiParam: {headerParam: {}, urlParam: {contractID: "06cad32e-4d0d-4b6f-bd24-16a28629a550", actionType: "0"}}
|
|
18
|
-
// apiParam: {originalTraId: "1475658732246241281", actionType: 2, chanceID: "1"} ,
|
|
19
|
-
// apiParam: {originalTraId: "1516290587463507969", actionType: "3", pageStyle: "2", pageTitle: "成交报告",pageOnly: "true"}
|
|
20
16
|
apiParam:{
|
|
21
|
-
actionType:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
groupName: "estateId",
|
|
27
|
-
operation: 2,
|
|
28
|
-
searchDataType: 3,
|
|
29
|
-
searchValue1: "201703020943128D8A8FCF463E4016D6"
|
|
30
|
-
}]
|
|
31
|
-
}
|
|
32
|
-
}
|
|
17
|
+
actionType: 3,
|
|
18
|
+
originalTraId: "1530076554013306882",
|
|
19
|
+
pageOnly: true,
|
|
20
|
+
pageStyle: 2,
|
|
21
|
+
pageTitle: "成交报告",
|
|
33
22
|
}
|
|
34
23
|
}
|
|
35
24
|
},
|
package/src/SearchList.vue
CHANGED
|
@@ -13,8 +13,6 @@
|
|
|
13
13
|
:searchStatsApi="'/exampleList/getListStats'"
|
|
14
14
|
></ct-searchlist>
|
|
15
15
|
|
|
16
|
-
<!--<ct-searchlist :searchConditionApi="'/api/invoice-info/search-condition'" :searchDataApi="'/api/invoice-info/list'" :searchDataStatisticsApi="'api/ContractList/GetLayoutOfStatisticsTool'" :apiParam="para"></ct-searchlist>-->
|
|
17
|
-
<!-- <ct-searchlist :searchConditionApi="'/PropertyStatusList/getLayoutOfSearch'" :searchDataApi="'/PropertyStatusList/getListOfSearchModel'" :apiParam="para"></ct-searchlist> -->
|
|
18
16
|
<ct-dialog-list></ct-dialog-list>
|
|
19
17
|
</div>
|
|
20
18
|
</template>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import browseVideo from './src/browseVideo'
|
|
2
|
+
|
|
3
|
+
browseVideo.install = function (Vue) {
|
|
4
|
+
Vue.component(browseVideo.name, browseVideo);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
8
|
+
window.Vue.use(browseVideo);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default browseVideo;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div class="alert fade in" role="alert" style="padding:0px;border-bottom:none;display: table-caption;margin-left: 5px;">
|
|
4
|
+
<video :src="submitData[router.submitFormField]" controls="true" autoplay controlslist="nodownload"
|
|
5
|
+
:height="router.dialogHeight?router.dialogHeight-10:'40'" :width="router.dialogWidth?router.dialogWidth-10:'100%'">您的浏览器不支持 video 标签。
|
|
6
|
+
</video>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
<script>
|
|
11
|
+
export default {
|
|
12
|
+
name: 'ct-video',
|
|
13
|
+
props: {
|
|
14
|
+
router: Object,
|
|
15
|
+
submitData: Object,
|
|
16
|
+
},
|
|
17
|
+
data() {
|
|
18
|
+
return {
|
|
19
|
+
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
methods: {
|
|
23
|
+
clickHandler(ev, v) {
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
<style scoped>
|
|
29
|
+
|
|
30
|
+
</style>
|
|
@@ -215,7 +215,10 @@ const common = {
|
|
|
215
215
|
*/
|
|
216
216
|
closeDialog(vmodel) {
|
|
217
217
|
if (vmodel) {
|
|
218
|
-
if (vmodel.name === 'ct-comfirm'
|
|
218
|
+
if (vmodel.name === 'ct-comfirm'
|
|
219
|
+
|| vmodel.$options.name === 'ctDialog'
|
|
220
|
+
|| vmodel.$options.name === 'ct-dialog'
|
|
221
|
+
|| vmodel.$options.name === 'ct-video') {
|
|
219
222
|
this.dialogList.deleteDialog(vmodel);
|
|
220
223
|
return;
|
|
221
224
|
}
|
|
@@ -269,6 +272,30 @@ const common = {
|
|
|
269
272
|
|
|
270
273
|
},
|
|
271
274
|
|
|
275
|
+
browseVideo(router, submitData) {
|
|
276
|
+
let self = this;
|
|
277
|
+
|
|
278
|
+
return new Promise((resolve, reject) => {
|
|
279
|
+
var dialogOption = {
|
|
280
|
+
title: router.pageTitle,
|
|
281
|
+
name: 'ct-video',
|
|
282
|
+
vmodel: {},
|
|
283
|
+
content: [{
|
|
284
|
+
component: 'ct-video',
|
|
285
|
+
attrs: {
|
|
286
|
+
router: router,
|
|
287
|
+
submitData: submitData,
|
|
288
|
+
width: router.dialogWidth + 'px',
|
|
289
|
+
height: router.dialogHeight + 'px'
|
|
290
|
+
},
|
|
291
|
+
on: {
|
|
292
|
+
}
|
|
293
|
+
}]
|
|
294
|
+
};
|
|
295
|
+
this.openDialog(dialogOption);
|
|
296
|
+
})
|
|
297
|
+
},
|
|
298
|
+
|
|
272
299
|
/**
|
|
273
300
|
* @method
|
|
274
301
|
* @param {Object} evControl 指定Vue对象
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<el-
|
|
3
|
-
<
|
|
2
|
+
<el-container v-if="model.fields.length > 0">
|
|
3
|
+
<div v-for="(col, index) in model.fields" :key="index" v-if="col.show !== false" :class="index>0&&col.label==''?'complex-left-10':''" :style="{'width':(col.width!='0'?col.width+'px':'100%'),'flex':(col.width!='0'?'0 0 '+col.width+'px':'100%')}">
|
|
4
4
|
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.OptApi" v-bind="col.bindPara"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
</
|
|
8
|
-
</el-
|
|
5
|
+
@click="fieldClickHandler(col,$event)" @change="changeHandler(col,$event)" @enter="enterHandler(col,$event)"
|
|
6
|
+
@input="inputHandler(col,$event)"></component>
|
|
7
|
+
</div>
|
|
8
|
+
</el-container>
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script>
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
},
|
|
16
16
|
data: function () {
|
|
17
17
|
return {
|
|
18
|
-
|
|
19
18
|
}
|
|
20
19
|
},
|
|
21
20
|
methods: {
|
|
@@ -30,7 +29,8 @@
|
|
|
30
29
|
},
|
|
31
30
|
props: {
|
|
32
31
|
vmodel: Object,
|
|
33
|
-
api: String
|
|
32
|
+
api: String,
|
|
33
|
+
parentModel: Object,
|
|
34
34
|
},
|
|
35
35
|
data() {
|
|
36
36
|
return {
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
created() {
|
|
43
|
-
let self = this;
|
|
44
43
|
this.model = this.vmodel;
|
|
45
44
|
this.model.OptApi = this.api;
|
|
46
45
|
},
|
|
@@ -67,17 +66,69 @@
|
|
|
67
66
|
}
|
|
68
67
|
return rtnBool;
|
|
69
68
|
},
|
|
70
|
-
changeHandler(field
|
|
69
|
+
changeHandler(field) {
|
|
71
70
|
var self = this;
|
|
72
|
-
|
|
73
|
-
self
|
|
71
|
+
|
|
72
|
+
self.model.isChanged = true;
|
|
73
|
+
self.model.hiddenHandle(field);
|
|
74
|
+
self.model.requiredHandle(field);
|
|
75
|
+
//self.model.validMrf(field);
|
|
76
|
+
|
|
77
|
+
if (field.onAfterChanged) {
|
|
78
|
+
var router = self.model.actionRouters.find((v) => {
|
|
79
|
+
return v.id === field.onAfterChanged;
|
|
80
|
+
});
|
|
81
|
+
self.$parent.$parent.$parent.$parent.clickHandler(router);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
self.$forceUpdate();
|
|
85
|
+
},
|
|
86
|
+
enterHandler(field) {
|
|
87
|
+
var self = this;
|
|
88
|
+
|
|
89
|
+
self.model.isChanged = true;
|
|
90
|
+
self.model.hiddenHandle(field);
|
|
91
|
+
self.model.requiredHandle(field);
|
|
92
|
+
//self.model.validMrf(field);
|
|
93
|
+
|
|
94
|
+
if (field.routerKeyForEnterKey) {
|
|
95
|
+
var router = self.model.actionRouters.find((v) => {
|
|
96
|
+
return v.id === field.routerKeyForEnterKey;
|
|
97
|
+
});
|
|
98
|
+
self.$parent.$parent.$parent.$parent.clickHandler(router);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
self.$forceUpdate();
|
|
74
102
|
},
|
|
75
|
-
inputHandler(field
|
|
103
|
+
inputHandler(field) {
|
|
76
104
|
var self = this;
|
|
77
105
|
this.model.input = field.input;//当前小组件事件作为大组件事件
|
|
78
106
|
self.$emit('input');
|
|
79
107
|
|
|
80
108
|
},
|
|
109
|
+
fieldClickHandler(field) {
|
|
110
|
+
let submitData = null;
|
|
111
|
+
var router = this.model.buttons.find((v) => {
|
|
112
|
+
return v.id === field.id;
|
|
113
|
+
});
|
|
114
|
+
if (router == undefined) {
|
|
115
|
+
router = this.model.links.find((v) => {
|
|
116
|
+
return v.id === field.id;
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
if (router == undefined) {
|
|
120
|
+
router = this.model.actionRouters.find((v) => {
|
|
121
|
+
return v.id === field.id;
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
if (router && field.isSubmitDataFromSelf) {
|
|
125
|
+
submitData = {};
|
|
126
|
+
router.submitFormField.forEach((v) => {
|
|
127
|
+
submitData[v] = field.list[field.listIndex].code;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
this.$parent.$parent.$parent.$parent.clickHandler(router, submitData);
|
|
131
|
+
},
|
|
81
132
|
}
|
|
82
133
|
}
|
|
83
134
|
</script>
|
|
@@ -261,6 +261,9 @@
|
|
|
261
261
|
else if (field.isOpenUrlInBrowse) {// 浏览器打开
|
|
262
262
|
window.open(submitData[field.submitFormField], "_blank");
|
|
263
263
|
}
|
|
264
|
+
else if (field.isSeeVoice) {//看视频
|
|
265
|
+
self.$common.browseVideo(field,submitData)
|
|
266
|
+
}
|
|
264
267
|
else{
|
|
265
268
|
field.doAction(submitData, (data) => {
|
|
266
269
|
self.model.doAction(data,field);
|
|
@@ -402,6 +402,9 @@
|
|
|
402
402
|
else if (field.isOpenUrlInBrowse) {// 浏览器打开
|
|
403
403
|
window.open(submitData[field.submitFormField], "_blank");
|
|
404
404
|
}
|
|
405
|
+
else if (field.isSeeVoice) {//看视频
|
|
406
|
+
self.$common.browseVideo(field,submitData)
|
|
407
|
+
}
|
|
405
408
|
else{
|
|
406
409
|
field.doAction(submitData, (data) => {
|
|
407
410
|
self.model.doAction(data,field);
|
|
@@ -217,7 +217,18 @@
|
|
|
217
217
|
</div>
|
|
218
218
|
</div>
|
|
219
219
|
<div v-else class="el-tabs__content" :key="model.tags2Key">
|
|
220
|
-
<div v-
|
|
220
|
+
<div v-if="col.list" role="tabpanel" aria-labelledby="tab-first" class="el-tab-pane">
|
|
221
|
+
<div v-for="(info, i) in col.list" :key="i" class="tab-conten">
|
|
222
|
+
<img :src="info.dutyEmpUrl">
|
|
223
|
+
<div class="user-name" style="display: block;padding-top: 5px;">
|
|
224
|
+
<div style="display: flex;">
|
|
225
|
+
<div class="text">{{info.dutyEmpName}}</div>
|
|
226
|
+
<span class="user-but">{{info.dutyDeptName}}</span>
|
|
227
|
+
</div>
|
|
228
|
+
<div class="text">{{info.mobileNo}}</div>
|
|
229
|
+
</div>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
221
232
|
</div>
|
|
222
233
|
</el-tab-pane>
|
|
223
234
|
</el-tabs>
|
|
@@ -587,6 +598,9 @@
|
|
|
587
598
|
else if (field.isOpenUrlInBrowse) {// 浏览器打开
|
|
588
599
|
window.open(submitData[field.submitFormField], "_blank");
|
|
589
600
|
}
|
|
601
|
+
else if (field.isSeeVoice) {//看视频
|
|
602
|
+
self.$common.browseVideo(field,submitData)
|
|
603
|
+
}
|
|
590
604
|
else{
|
|
591
605
|
field.doAction(submitData, (data) => {
|
|
592
606
|
self.model.doAction(data,field);
|
|
@@ -401,6 +401,9 @@
|
|
|
401
401
|
else if (field.isOpenUrlInBrowse) {// 浏览器打开
|
|
402
402
|
window.open(submitData[field.submitFormField], "_blank");
|
|
403
403
|
}
|
|
404
|
+
else if (field.isSeeVoice) {//看视频
|
|
405
|
+
self.$common.browseVideo(field,submitData)
|
|
406
|
+
}
|
|
404
407
|
else{
|
|
405
408
|
field.doAction(submitData, (data) => {
|
|
406
409
|
self.model.doAction(data,field);
|
|
@@ -402,6 +402,9 @@
|
|
|
402
402
|
else if (field.isOpenUrlInBrowse) {// 浏览器打开
|
|
403
403
|
window.open(submitData[field.submitFormField], "_blank");
|
|
404
404
|
}
|
|
405
|
+
else if (field.isSeeVoice) {//看视频
|
|
406
|
+
self.$common.browseVideo(field,submitData)
|
|
407
|
+
}
|
|
405
408
|
else if (field.isExport) {
|
|
406
409
|
submitData = field.getActionPara(submitData).para;
|
|
407
410
|
self.model.export(field, submitData);
|
|
@@ -182,9 +182,10 @@
|
|
|
182
182
|
c.width = (c.maxLen + 2) * 6;
|
|
183
183
|
});
|
|
184
184
|
},
|
|
185
|
-
searchComplate(searchModel) {
|
|
185
|
+
searchComplate(searchModel,flagSearch) {
|
|
186
186
|
var self = this;
|
|
187
187
|
this.loading = true;
|
|
188
|
+
if(flagSearch==undefined)flagSearch=true;
|
|
188
189
|
this.$nextTick(function () {
|
|
189
190
|
if (typeof self.api !== 'undefined' && typeof searchModel !== 'undefined') {
|
|
190
191
|
var postData;
|
|
@@ -205,7 +206,9 @@
|
|
|
205
206
|
}
|
|
206
207
|
postData.fields.push(retains);
|
|
207
208
|
}
|
|
208
|
-
self.loaderObj.SearchTable(self.api, self.load, searchModel,
|
|
209
|
+
self.loaderObj.SearchTable(self.api, self.load, searchModel, flagSearch, postData,function(){
|
|
210
|
+
self.loading = false;
|
|
211
|
+
});
|
|
209
212
|
}
|
|
210
213
|
if (typeof self.source !== 'undefined') {
|
|
211
214
|
self.load(self.loaderObj.SearchTable(self.source));
|
|
@@ -554,10 +554,14 @@
|
|
|
554
554
|
h2 = this.$parent.$parent.$refs.contact.offsetHeight | 0;
|
|
555
555
|
}
|
|
556
556
|
var h3 = 0;
|
|
557
|
-
if (this.$parent.$parent.$refs.
|
|
557
|
+
if (this.$parent.$parent.$refs.title) {
|
|
558
558
|
h3 = this.$parent.$parent.$refs.title.offsetHeight | 0;
|
|
559
559
|
}
|
|
560
|
-
|
|
560
|
+
var h4 = 0;
|
|
561
|
+
if (this.$parent.$parent.$refs.shortcutFollow) {
|
|
562
|
+
h4 = this.$parent.$parent.$refs.shortcutFollow.offsetHeight | 0;
|
|
563
|
+
}
|
|
564
|
+
let tableHeight = h1 - h2 - h3-h4 - 290;
|
|
561
565
|
if (h2 == 0) {
|
|
562
566
|
tableHeight = tableHeight + 15;
|
|
563
567
|
}
|
|
@@ -753,6 +757,9 @@
|
|
|
753
757
|
else if (field.isOpenUrlInBrowse) {// 浏览器打开
|
|
754
758
|
window.open(submitData[field.submitFormField], "_blank");
|
|
755
759
|
}
|
|
760
|
+
else if (field.isSeeVoice) {//看视频
|
|
761
|
+
self.$common.browseVideo(field,submitData)
|
|
762
|
+
}
|
|
756
763
|
else {
|
|
757
764
|
//self.operationLoading = true;
|
|
758
765
|
|
|
@@ -934,6 +941,9 @@
|
|
|
934
941
|
else if (field.isOpenUrlInBrowse) {// 浏览器打开
|
|
935
942
|
window.open(submitData[field.submitFormField], "_blank");
|
|
936
943
|
}
|
|
944
|
+
else if (field.isSeeVoice) {//看视频
|
|
945
|
+
self.$common.browseVideo(field,submitData)
|
|
946
|
+
}
|
|
937
947
|
else {
|
|
938
948
|
//self.operationLoading = true;
|
|
939
949
|
|
|
@@ -6,7 +6,7 @@ import Router from './Router';
|
|
|
6
6
|
import Enum from './lib/Enum';
|
|
7
7
|
import Vue from 'vue';
|
|
8
8
|
|
|
9
|
-
const Compound = function (source,
|
|
9
|
+
const Compound = function (source, sourceParent) {
|
|
10
10
|
var rtn = {
|
|
11
11
|
get label() {
|
|
12
12
|
let l = '';
|
|
@@ -18,9 +18,63 @@ const Compound = function (source, dateType) {
|
|
|
18
18
|
}
|
|
19
19
|
return l;
|
|
20
20
|
},
|
|
21
|
+
isChanged: false,
|
|
21
22
|
set label(v) {
|
|
22
23
|
source.controlLabel = v;
|
|
23
24
|
},
|
|
25
|
+
_buttons: null,
|
|
26
|
+
get buttons() {
|
|
27
|
+
if (rtn._buttons !== null) {
|
|
28
|
+
return rtn._buttons;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
rtn._buttons = [];
|
|
32
|
+
if (sourceParent.buttons) {
|
|
33
|
+
sourceParent.buttons.forEach((v) => {
|
|
34
|
+
var button = Router(v);
|
|
35
|
+
button.is = "ct-btn";
|
|
36
|
+
rtn._buttons.push(button);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
return rtn._buttons;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
_links: null,
|
|
43
|
+
get links() {
|
|
44
|
+
if (rtn._links !== null) {
|
|
45
|
+
return rtn._links;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
rtn._links = [];
|
|
49
|
+
if (sourceParent.links) {
|
|
50
|
+
sourceParent.links.forEach((v) => {
|
|
51
|
+
var button = Router(v);
|
|
52
|
+
button.is = "ct-btn";
|
|
53
|
+
if (button.show) {
|
|
54
|
+
rtn._links.push(button);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return rtn._links;
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
_actionRouters: null,
|
|
62
|
+
get actionRouters() {
|
|
63
|
+
if (rtn._actionRouters !== null) {
|
|
64
|
+
return rtn._actionRouters;
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
rtn._actionRouters = [];
|
|
68
|
+
if (sourceParent.actionRouters) {
|
|
69
|
+
sourceParent.actionRouters.forEach((v) => {
|
|
70
|
+
var button = Router(v);
|
|
71
|
+
button.is = "ct-btn";
|
|
72
|
+
rtn._actionRouters.push(button);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return rtn._actionRouters;
|
|
76
|
+
}
|
|
77
|
+
},
|
|
24
78
|
getFormObj() {
|
|
25
79
|
var rtnFormObj = {};
|
|
26
80
|
rtn.fields.forEach((f) => {
|
|
@@ -30,6 +84,20 @@ const Compound = function (source, dateType) {
|
|
|
30
84
|
});
|
|
31
85
|
return rtnFormObj;
|
|
32
86
|
},
|
|
87
|
+
_compoundfieldsDic: null,//字典,方便取值
|
|
88
|
+
get compoundfieldsDic() {
|
|
89
|
+
if (rtn._compoundfieldsDic !== null) {
|
|
90
|
+
return rtn._compoundfieldsDic;
|
|
91
|
+
}
|
|
92
|
+
rtn._compoundfieldsDic = {};
|
|
93
|
+
if (source.compoundFields) {
|
|
94
|
+
source.compoundFields.forEach((f) => {
|
|
95
|
+
let item = LibFunction.GetControl(f, sourceParent, false, false);
|
|
96
|
+
rtn._compoundfieldsDic[item.id] = item;
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return rtn._compoundfieldsDic;
|
|
100
|
+
},
|
|
33
101
|
_fields: null,//数组,方便遍历
|
|
34
102
|
get fields() {
|
|
35
103
|
if (rtn._fields !== null) {
|
|
@@ -37,21 +105,104 @@ const Compound = function (source, dateType) {
|
|
|
37
105
|
}
|
|
38
106
|
let Index = 0;
|
|
39
107
|
rtn._fields = [];
|
|
40
|
-
|
|
41
|
-
let value = source.compoundFields[key];
|
|
108
|
+
source.compoundFields.forEach((v) => {
|
|
42
109
|
Index++;
|
|
43
110
|
let showLabel = true;
|
|
44
|
-
let item = LibFunction.GetControl(
|
|
111
|
+
let item = LibFunction.GetControl(v, sourceParent, showLabel, false);
|
|
45
112
|
if (item instanceof Object) {
|
|
113
|
+
item.width = v.width;
|
|
46
114
|
item.form = rtn;
|
|
47
115
|
if (Index == 1 && item.label == "") {
|
|
48
116
|
item.label = rtn.label;
|
|
49
117
|
}
|
|
118
|
+
rtn.hiddenHandle(item);//是否隐藏关联组件
|
|
50
119
|
rtn._fields.push(item);
|
|
51
120
|
}
|
|
52
|
-
}
|
|
121
|
+
});
|
|
122
|
+
rtn.allRequiredHandle();//必填关联组件
|
|
53
123
|
return rtn._fields;
|
|
54
124
|
},
|
|
125
|
+
//隐藏关联组件
|
|
126
|
+
hiddenHandle(item, update) {
|
|
127
|
+
if (item.id) {
|
|
128
|
+
let sign = false;
|
|
129
|
+
let field = null;
|
|
130
|
+
|
|
131
|
+
for (var i in source.compoundFields) {
|
|
132
|
+
if (source.compoundFields[i].hiddenRelationField === item.id) {
|
|
133
|
+
field = source.compoundFields[i];
|
|
134
|
+
if (field) {
|
|
135
|
+
let hiddenValueArr = field.hiddenRelationFieldValue.split(',');
|
|
136
|
+
if (hiddenValueArr.indexOf(item.code1) > -1) {
|
|
137
|
+
field.show = false;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
field.show = true;
|
|
141
|
+
}
|
|
142
|
+
sign = true;
|
|
143
|
+
|
|
144
|
+
if (update && rtn.self && sign) {
|
|
145
|
+
rtn.self.$forceUpdate();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
//验证必填关联组件
|
|
154
|
+
validMrf(item) {
|
|
155
|
+
let field = rtn.fields[item.mrf];
|
|
156
|
+
|
|
157
|
+
if (field && field.self) {
|
|
158
|
+
if (field.type === Enum.ControlType.List) {
|
|
159
|
+
//f.required = '0';
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
field.self.validExcute();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
allRequiredHandle() {
|
|
167
|
+
rtn.fields.forEach(v => {
|
|
168
|
+
rtn.requiredHandle(v, null, false);
|
|
169
|
+
});
|
|
170
|
+
},
|
|
171
|
+
//处理必填关联组件
|
|
172
|
+
requiredHandle(item, update, doMrf) {
|
|
173
|
+
if (item.id) {
|
|
174
|
+
let field = null;
|
|
175
|
+
for (var i in source.compoundFields) {
|
|
176
|
+
if (source.compoundFields[i].requiredRelationField === item.id) {
|
|
177
|
+
field = source.compoundFields[i];
|
|
178
|
+
let f = rtn.compoundfieldsDic[field.fieldName1];
|
|
179
|
+
|
|
180
|
+
if (field) {
|
|
181
|
+
let hiddenValueArr = field.requiredRelationFieldValue.split(',');
|
|
182
|
+
if (hiddenValueArr.indexOf(item.value) > -1) {
|
|
183
|
+
field.required = true;
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
field.required = false;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if (f && f.self && f.self.$forceUpdate) {
|
|
190
|
+
f.self.$forceUpdate();
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (update && rtn.self) {
|
|
194
|
+
rtn.self.$forceUpdate();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (doMrf !== false) {
|
|
201
|
+
rtn.validMrf(item);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
|
|
55
206
|
};
|
|
56
207
|
rtn = base.copy(Base(source), rtn);
|
|
57
208
|
return rtn;
|