centaline-data-driven 1.2.79 → 1.2.82
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 +0 -2
- package/package.json +1 -1
- package/src/Form.vue +4 -4
- package/src/centaline/css/max.css +4 -1
- package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +16 -1
- package/src/centaline/dynamicDetail/src/dynamicPropertySimpleDetailRET.vue +15 -0
- package/src/centaline/dynamicFile/src/dynamicFile.vue +15 -37
- package/src/centaline/dynamicForm/index.js +0 -4
- package/src/centaline/dynamicForm/src/dynamicForm.vue +1 -1
- package/src/centaline/dynamicForm/src/dynamicFormListTable.vue +18 -0
- package/src/centaline/dynamicLayout/src/dynamicLayout.vue +111 -185
- package/src/centaline/dynamicLayout/src/dynamicLayoutChildren.vue +11 -9
- package/src/centaline/dynamicLayout/src/dynamicLayoutChildrenFor.vue +39 -0
- package/src/centaline/dynamicLayout/src/dynamicLayoutImage.vue +55 -6
- package/src/centaline/dynamicLayout/src/dynamicLayoutLabel.vue +11 -7
- package/src/centaline/dynamicLayout/src/dynamicLayoutLine.vue +3 -1
- package/src/centaline/dynamicSearchList/src/dynamicSearchTable.vue +292 -60
- package/src/centaline/loader/src/ctl/CellLayout.js +170 -113
- package/src/centaline/loader/src/ctl/File.js +0 -1
- package/src/centaline/loader/src/ctl/FormList.js +83 -18
- package/src/centaline/loader/src/ctl/SearchTable.js +49 -45
- 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
- package/src/centaline/dynamicLabel/index.js +0 -11
- package/src/centaline/dynamicLabel/src/dynamicLabel.vue +0 -73
- package/src/centaline/dynamicLs/index.js +0 -22
- package/src/centaline/dynamicLs/src/dynamicLs.vue +0 -233
|
@@ -3,7 +3,6 @@ const paths = {
|
|
|
3
3
|
"dynamicD": "./src/centaline/dynamicD/index.js",//日期组件
|
|
4
4
|
"dynamicGp": "./src/centaline/dynamicGp/index.js",//分组标签组件
|
|
5
5
|
"dynamicIti": "./src/centaline/dynamicIti/index.js",//数字区域组件
|
|
6
|
-
"dynamicLs": "./src/centaline/dynamicLs/index.js",//表单列表组件
|
|
7
6
|
"dynamicMt": "./src/centaline/dynamicMt/index.js",//多行文本组件
|
|
8
7
|
"dynamicSo": "./src/centaline/dynamicSo/index.js",//单选下拉菜单
|
|
9
8
|
"dynamicSos": "./src/centaline/dynamicSos/index.js",//单选搜索下拉菜单
|
|
@@ -11,7 +10,6 @@ const paths = {
|
|
|
11
10
|
"dynamicT": "./src/centaline/dynamicT/index.js",//文本input组件
|
|
12
11
|
"dynamicL": "./src/centaline/dynamicL/index.js",//文本label组件
|
|
13
12
|
"dynamicTags": "./src/centaline/dynamicTags/index.js",//多选搜索下拉菜单组件
|
|
14
|
-
"dynamicLabel": "./src/centaline/dynamicLabel/index.js",//标签组件
|
|
15
13
|
"dynamicForm": "./src/centaline/dynamicForm/index.js",//表单组件
|
|
16
14
|
"dynamicDrop": "./src/centaline/dynamicDrop/index.js",//快捷下拉输入组件
|
|
17
15
|
"dynamicSearchList": "./src/centaline/dynamicSearchList/index.js",//查询表单组件
|
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="'/api/
|
|
5
|
+
<ct-form :api="'/api/finance/collection-money/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>
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
// apiParam: {originalTraId: "1475658732246241281", actionType: 2, chanceID: "1"} ,
|
|
19
19
|
// apiParam: {originalTraId: "1516290587463507969", actionType: "3", pageStyle: "2", pageTitle: "成交报告",pageOnly: "true"}
|
|
20
20
|
apiParam:{
|
|
21
|
-
actionType:
|
|
22
|
-
originalTraId: "
|
|
21
|
+
actionType: 2,
|
|
22
|
+
originalTraId: "1527194056950345730",
|
|
23
23
|
pageOnly: true,
|
|
24
24
|
pageStyle: 2,
|
|
25
|
-
pageTitle: "
|
|
25
|
+
pageTitle: "新增代收款"
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
},
|
|
@@ -354,6 +354,20 @@
|
|
|
354
354
|
if(this.model.tags2 && this.model.tags2[0]){
|
|
355
355
|
this.model.getTags2List(0);
|
|
356
356
|
}
|
|
357
|
+
if (typeof window.localStorage !== 'undefined') {
|
|
358
|
+
var tagkey = window.localStorage.getItem('detailtagkey');
|
|
359
|
+
for (var i = 0; i < self.model.tags1.length; i++) {
|
|
360
|
+
if (tagkey == self.model.tags1[i].appID) {
|
|
361
|
+
self.model.activeIndex1 = i.toString();
|
|
362
|
+
if (self.model.tags1 && self.model.tags1[i]) {
|
|
363
|
+
self.listKey = self.listKey + 1;
|
|
364
|
+
self.model.searchConditionApiTags1 = self.model.tags1[i].searchConditionApiUrl || '';
|
|
365
|
+
self.model.searchDataApiTags1 = self.model.tags1[i].searchDataApiUrl || '';
|
|
366
|
+
self.model.paramDataTags1 = self.model.tags1[i].paramData || '';
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
}
|
|
357
371
|
this.loadOperation();
|
|
358
372
|
this.loadCommission();
|
|
359
373
|
this.setDetailHeight();
|
|
@@ -444,7 +458,8 @@
|
|
|
444
458
|
this.listKey=this.listKey+1;
|
|
445
459
|
this.model.searchConditionApiTags1=this.model.tags1[i].searchConditionApiUrl||'';
|
|
446
460
|
this.model.searchDataApiTags1=this.model.tags1[i].searchDataApiUrl||'';
|
|
447
|
-
this.model.paramDataTags1=this.model.tags1[i].paramData||'';
|
|
461
|
+
this.model.paramDataTags1 = this.model.tags1[i].paramData || '';
|
|
462
|
+
window.localStorage.setItem("detailtagkey", this.model.tags1[i].appID);//存储
|
|
448
463
|
}
|
|
449
464
|
},
|
|
450
465
|
fieldClickHandler(field) {
|
|
@@ -149,6 +149,20 @@
|
|
|
149
149
|
if(this.model.tags2 && this.model.tags2[0]){
|
|
150
150
|
this.model.getTags2List(0);
|
|
151
151
|
}
|
|
152
|
+
if (typeof window.localStorage !== 'undefined') {
|
|
153
|
+
var tagkey = window.localStorage.getItem('simpletagkey');
|
|
154
|
+
for (var i = 0; i < self.model.tags1.length;i++) {
|
|
155
|
+
if (tagkey == self.model.tags1[i].appID) {
|
|
156
|
+
self.model.activeIndex1 = i.toString();
|
|
157
|
+
if (self.model.tags1 && self.model.tags1[i]) {
|
|
158
|
+
self.listKey = self.listKey + 1;
|
|
159
|
+
self.model.searchConditionApiTags1 = self.model.tags1[i].searchConditionApiUrl || '';
|
|
160
|
+
self.model.searchDataApiTags1 = self.model.tags1[i].searchDataApiUrl || '';
|
|
161
|
+
self.model.paramDataTags1 = self.model.tags1[i].paramData || '';
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
152
166
|
this.loadOperation();
|
|
153
167
|
this.setDetailStyle();
|
|
154
168
|
this.$nextTick(() => {
|
|
@@ -249,6 +263,7 @@
|
|
|
249
263
|
this.model.searchConditionApiTags1 = this.model.tags1[i].searchConditionApiUrl || '';
|
|
250
264
|
this.model.searchDataApiTags1 = this.model.tags1[i].searchDataApiUrl || '';
|
|
251
265
|
this.model.paramDataTags1 = this.model.tags1[i].paramData || '';
|
|
266
|
+
window.localStorage.setItem("simpletagkey", this.model.tags1[i].appID);//存储
|
|
252
267
|
}
|
|
253
268
|
},
|
|
254
269
|
fieldClickHandler(field) {
|
|
@@ -207,7 +207,6 @@
|
|
|
207
207
|
},
|
|
208
208
|
//不能共用的数据校验
|
|
209
209
|
selfValidExcute: function (eventName) {
|
|
210
|
-
|
|
211
210
|
if (this.model.required) {
|
|
212
211
|
if (this.model.getfileListLength() === 0) {
|
|
213
212
|
this.validMessage = "必须上传附件";
|
|
@@ -217,48 +216,31 @@
|
|
|
217
216
|
}
|
|
218
217
|
|
|
219
218
|
if (this.model.max) {
|
|
220
|
-
|
|
221
|
-
if(this.model.getfileListLength() >= this.model.max)
|
|
222
|
-
{
|
|
219
|
+
if(this.model.getfileListLength() >= this.model.max){
|
|
223
220
|
this.disableUpload=true;
|
|
224
|
-
}
|
|
225
|
-
{
|
|
221
|
+
}
|
|
222
|
+
else{
|
|
226
223
|
this.disableUpload=false;
|
|
227
224
|
}
|
|
228
|
-
|
|
229
|
-
// if (this.model.getfileListLength() > this.model.max) {
|
|
230
|
-
// this.validMessage = "附件数量";
|
|
231
|
-
// if(this.model.min)
|
|
232
|
-
// {
|
|
233
|
-
// this.validMessage += "最少" + this.model.min + "个"+",";
|
|
234
|
-
// }
|
|
235
|
-
// // this.validMessage += "最多" + this.model.max+ "个";
|
|
236
|
-
// this.valid = false;
|
|
237
|
-
// return false;
|
|
238
|
-
// }
|
|
239
225
|
}
|
|
240
226
|
if (this.model.min) {
|
|
241
227
|
if (this.model.getfileListLength() < this.model.min) {
|
|
242
228
|
//change时需要判断有没有上传图片如果没有图片则不提示
|
|
243
|
-
|
|
244
|
-
if(eventName=='change' && this.model.getfileListLength()>0)
|
|
245
|
-
{
|
|
229
|
+
if(eventName=='change' && this.model.getfileListLength()>0){
|
|
246
230
|
this.validMessage = "附件数量还差" + (parseInt(this.model.min)-this.model.getfileListLength()) + "张";
|
|
247
231
|
this.valid = false;
|
|
248
|
-
}
|
|
249
|
-
{
|
|
232
|
+
}
|
|
233
|
+
else if(eventName=='valid'){
|
|
250
234
|
this.validMessage = "附件数量还差" + (parseInt(this.model.min)-this.model.getfileListLength()) + "张";
|
|
251
235
|
this.valid = false;
|
|
252
|
-
}else if(eventName=='remove')
|
|
253
|
-
{
|
|
254
|
-
this.valid = true;
|
|
255
236
|
}
|
|
256
|
-
|
|
237
|
+
else if(eventName=='remove'){
|
|
238
|
+
this.valid = true;
|
|
239
|
+
}
|
|
257
240
|
return false;
|
|
258
241
|
}
|
|
259
242
|
}
|
|
260
|
-
if(eventName=='valid'&&!this.validFileClass())
|
|
261
|
-
{
|
|
243
|
+
if(eventName=='valid'&&!this.validFileClass()){
|
|
262
244
|
this.validMessage="请选择附件分类";
|
|
263
245
|
this.valid = false;
|
|
264
246
|
return false;
|
|
@@ -267,17 +249,13 @@
|
|
|
267
249
|
return this.valid;
|
|
268
250
|
},
|
|
269
251
|
//验证附件分类是否必填
|
|
270
|
-
validFileClass()
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
{
|
|
274
|
-
if(this.model.sourceList&&this.model.sourceList.length>0)
|
|
275
|
-
{
|
|
252
|
+
validFileClass(){
|
|
253
|
+
if(this.model.paramName){
|
|
254
|
+
if(this.model.sourceList&&this.model.sourceList.length>0){
|
|
276
255
|
let notClass= this.model.sourceList.filter(item=>{
|
|
277
|
-
return item.mediaLabelID==undefined||item.mediaLabelID=="";
|
|
256
|
+
return (item.mediaLabelID==undefined||item.mediaLabelID=="") && item.flagDeleted !== true;
|
|
278
257
|
})
|
|
279
|
-
if(notClass.length>0)
|
|
280
|
-
{
|
|
258
|
+
if(notClass.length>0){
|
|
281
259
|
return false
|
|
282
260
|
}
|
|
283
261
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import dynamicForm from './src/dynamicForm'
|
|
2
2
|
import dynamicInput from '../dynamicInput/index'
|
|
3
|
-
import dynamicLabel from '../dynamicLabel/index'
|
|
4
|
-
import dynamicLs from '../dynamicLs/index'
|
|
5
3
|
import api from '../api/index'
|
|
6
4
|
import common from '../common/index'
|
|
7
5
|
import validate from '../validate/index'
|
|
@@ -9,8 +7,6 @@ import validate from '../validate/index'
|
|
|
9
7
|
dynamicForm.install = function (Vue) {
|
|
10
8
|
Vue.component(dynamicForm.name, dynamicForm);
|
|
11
9
|
Vue.component(dynamicInput.name, dynamicInput);
|
|
12
|
-
Vue.component(dynamicLabel.name, dynamicLabel);
|
|
13
|
-
Vue.component(dynamicLs.name, dynamicLs);
|
|
14
10
|
|
|
15
11
|
Vue.use(api);
|
|
16
12
|
Vue.use(common);
|
|
@@ -30,6 +30,12 @@
|
|
|
30
30
|
<span v-else-if="v.is=='ct-sensitiveeye'">
|
|
31
31
|
<component v-if ref="Fields" :is="v.is" :vmodel="scope.row[v.id]" :vrowmodel="scope.row" :api="model.OptApi"></component>
|
|
32
32
|
</span>
|
|
33
|
+
<!--可点击的列-->
|
|
34
|
+
<span v-else-if="v.router" :class="'cell'" style="display: flex;">
|
|
35
|
+
<ct-tablecurrency :router="v.router" :colValue="scope.row[v.id].label" :rowData="scope.row"
|
|
36
|
+
@click="rolRouterClickHandler">
|
|
37
|
+
</ct-tablecurrency>
|
|
38
|
+
</span>
|
|
33
39
|
<ct-span v-else :vmodel="scope.row[v.id]" :rowNum="scope.row.$sourceIndex" ref="FieldsLabel"></ct-span>
|
|
34
40
|
</template>
|
|
35
41
|
</el-table-column>
|
|
@@ -281,6 +287,18 @@
|
|
|
281
287
|
|
|
282
288
|
this.$emit('tableButtonClick', button, submitData);
|
|
283
289
|
},
|
|
290
|
+
rolRouterClickHandler(field, rowData,rowindex) {
|
|
291
|
+
if(this.$refs['popover'+rowindex]){
|
|
292
|
+
this.$refs['popover'+rowindex][0].doClose();
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
var submitData = {};
|
|
296
|
+
field.submitListField.forEach((k) => {
|
|
297
|
+
submitData[k] = rowData[k];
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
this.$emit('tableButtonClick', field, submitData);
|
|
301
|
+
},
|
|
284
302
|
//汇总行 计算
|
|
285
303
|
getSummaries(param) {
|
|
286
304
|
const self = this;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
<div v-loading="loading" class="ct-Layout" v-if="Layout !== null && !loading">
|
|
3
|
+
<ct-layoutchildren :rowindex="rowindex" :vmodel="Layout" @click="clickHandler"></ct-layoutchildren>
|
|
4
|
+
</div>
|
|
5
5
|
</template>
|
|
6
6
|
<script>
|
|
7
7
|
import dynamicElement from '../../mixins/dynamicElement'
|
|
8
8
|
import dynamicLayoutChildren from './dynamicLayoutChildren.vue';
|
|
9
|
-
import common from '../../common';
|
|
10
9
|
export default {
|
|
11
10
|
name: 'ct-layout',
|
|
12
11
|
mixins: [dynamicElement],
|
|
@@ -24,7 +23,7 @@
|
|
|
24
23
|
},
|
|
25
24
|
data() {
|
|
26
25
|
return {
|
|
27
|
-
Layout:[]
|
|
26
|
+
Layout: []
|
|
28
27
|
};
|
|
29
28
|
},
|
|
30
29
|
created() {
|
|
@@ -49,21 +48,69 @@
|
|
|
49
48
|
},
|
|
50
49
|
load(data, cellLayout) {
|
|
51
50
|
var str = '';
|
|
51
|
+
if (cellLayout.indexOf("for=") != -1) {
|
|
52
|
+
var cellxmlDOM = this.loadXML(cellLayout);
|
|
53
|
+
var listxml = this.getxmlForStr(cellxmlDOM);
|
|
54
|
+
|
|
55
|
+
if (typeof listxml !== 'undefined') {
|
|
56
|
+
for (var j = 0; j < listxml.attributes.length; j++) {
|
|
57
|
+
var attribute = listxml.attributes.item(j);
|
|
58
|
+
if (attribute.nodeName.toLowerCase() == "for".toLowerCase()) {
|
|
59
|
+
var liststr = "";
|
|
60
|
+
var celllist = this.xmlToString(listxml)
|
|
61
|
+
|
|
62
|
+
var celllistNew = this.loadXML(celllist);
|
|
63
|
+
var newAtt = celllistNew.createAttribute("forrowindex");
|
|
64
|
+
newAtt.nodeValue = "{{forrowindex}}";
|
|
65
|
+
var x = celllistNew.getElementsByTagName("Layout");
|
|
66
|
+
x[0].setAttributeNode(newAtt);
|
|
67
|
+
var cellstr = this.xmlToString(celllistNew)
|
|
68
|
+
var list = data[attribute.nodeValue];
|
|
69
|
+
if (typeof list !== 'undefined') {
|
|
70
|
+
for (var i = 0; i < list.length; i++) {
|
|
71
|
+
list[i].forrowindex = i;
|
|
72
|
+
liststr += cellstr.replace(/\{\{(.+?)\}\}/g, (...args) => {
|
|
73
|
+
return this.getValue(list[i], args[1])
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
cellLayout = cellLayout.replace(/\n/g, '').trim() //去除换行 和头尾空格
|
|
78
|
+
let replacer = function (match, p1, p2, p3, offset) {
|
|
79
|
+
return p1 + p3
|
|
80
|
+
}
|
|
81
|
+
cellLayout = cellLayout.replace(/(>)(\s*)(<)/g, replacer) //把 > 和 < 之间的空格去除
|
|
82
|
+
cellLayout = cellLayout.replace(/ +/g, ' ')
|
|
83
|
+
cellLayout = cellLayout.replace(celllist, liststr)
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
52
88
|
if (typeof data !== 'undefined') {
|
|
53
89
|
str = cellLayout.replace(/\{\{(.+?)\}\}/g, (...args) => {
|
|
54
90
|
return this.getValue(data, args[1])
|
|
55
91
|
});
|
|
56
92
|
}
|
|
57
93
|
var xmlDOM = this.loadXML(str);
|
|
58
|
-
this.Layout = this.xmlToJson(xmlDOM
|
|
94
|
+
this.Layout = this.xmlToJson(xmlDOM);
|
|
59
95
|
this.loading = false;
|
|
60
96
|
},
|
|
61
|
-
getValue(data,val) {
|
|
97
|
+
getValue(data, val) {
|
|
62
98
|
return val.split('.').reduce((data, currentVal) => {
|
|
63
|
-
|
|
99
|
+
var rtn = data[currentVal];
|
|
100
|
+
if (rtn.toString().indexOf('"') != -1) {
|
|
101
|
+
rtn = rtn.replace(/"/g, "'");
|
|
102
|
+
rtn = rtn.replace(/>/g, ">");
|
|
103
|
+
rtn = rtn.replace(/</g, "<");
|
|
104
|
+
}
|
|
105
|
+
return rtn
|
|
64
106
|
}, data)
|
|
65
107
|
},
|
|
66
108
|
loadXML(xmlString) {
|
|
109
|
+
xmlString = xmlString.replace(/\n/g, '').trim()
|
|
110
|
+
let replacer = function (match, p1, p2, p3, offset) {
|
|
111
|
+
return p1 + p3
|
|
112
|
+
}
|
|
113
|
+
xmlString = xmlString.replace(/(>)(\s*)(<)/g, replacer)
|
|
67
114
|
if (document.all) {
|
|
68
115
|
var xmlDom = new ActiveXObject("Microsoft.XMLDOM");
|
|
69
116
|
xmlDom.loadXML(xmlString)
|
|
@@ -73,19 +120,43 @@
|
|
|
73
120
|
return new DOMParser().parseFromString(xmlString, "text/xml");
|
|
74
121
|
}
|
|
75
122
|
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
123
|
+
xmlToString(xmlObj) {
|
|
124
|
+
if (document.all) //IE浏览器
|
|
125
|
+
{
|
|
126
|
+
return xmlObj.xml;
|
|
127
|
+
}
|
|
128
|
+
else //其他浏览器
|
|
129
|
+
{
|
|
130
|
+
return (new XMLSerializer()).serializeToString(xmlObj);
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
getxmlForStr(xml) {
|
|
80
134
|
if (xml.nodeType == 1) { // element
|
|
81
135
|
// do attributes
|
|
82
136
|
if (xml.attributes.length > 0) {
|
|
83
137
|
for (var j = 0; j < xml.attributes.length; j++) {
|
|
84
138
|
var attribute = xml.attributes.item(j);
|
|
85
|
-
|
|
139
|
+
if (attribute.nodeName.toLowerCase() == "for".toLowerCase()) {
|
|
140
|
+
return xml
|
|
141
|
+
}
|
|
86
142
|
}
|
|
87
143
|
}
|
|
88
144
|
}
|
|
145
|
+
if (xml.hasChildNodes()) {
|
|
146
|
+
for (var i = 0; i < xml.childNodes.length; i++) {
|
|
147
|
+
var item = xml.childNodes.item(i);
|
|
148
|
+
var result = this.getxmlForStr(item);
|
|
149
|
+
if (result) {
|
|
150
|
+
return result;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
xmlToJson(xml) {
|
|
157
|
+
var self = this;
|
|
158
|
+
// Create the return object
|
|
159
|
+
var obj = {};
|
|
89
160
|
if (xml.nodeName.toLowerCase() == "Layout".toLowerCase() || xml.nodeName.toLowerCase() == "StackLayout".toLowerCase()) {
|
|
90
161
|
obj["is"] = "ct-layoutchildren";
|
|
91
162
|
}
|
|
@@ -98,12 +169,35 @@
|
|
|
98
169
|
else if (xml.nodeName.toLowerCase() == "Image".toLowerCase()) {
|
|
99
170
|
obj["is"] = "ct-layoutimage";
|
|
100
171
|
}
|
|
101
|
-
|
|
172
|
+
if (xml.nodeType == 1) { // element
|
|
173
|
+
// do attributes
|
|
174
|
+
if (xml.attributes.length > 0) {
|
|
175
|
+
for (var j = 0; j < xml.attributes.length; j++) {
|
|
176
|
+
var attribute = xml.attributes.item(j);
|
|
177
|
+
obj[attribute.nodeName] = attribute.nodeValue;
|
|
178
|
+
if (attribute.nodeName.toLowerCase() == "for".toLowerCase()) {
|
|
179
|
+
obj["is"] = "ct-layoutchildrenfor";
|
|
180
|
+
}
|
|
181
|
+
if (attribute.nodeName.toLowerCase() == "routerKey".toLowerCase()) {
|
|
182
|
+
var actionRouter = self.actionRouter;
|
|
183
|
+
let field = actionRouter.find(b => {
|
|
184
|
+
return b.id === attribute.nodeValue;
|
|
185
|
+
});
|
|
186
|
+
if (typeof field !== "undefined") {
|
|
187
|
+
if (!field.rightField || self.vmodel[field.rightField] == 1) {
|
|
188
|
+
obj["rightRouter"] = true;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
102
197
|
// do children
|
|
103
198
|
if (xml.hasChildNodes()) {
|
|
104
199
|
for (var i = 0; i < xml.childNodes.length; i++) {
|
|
105
200
|
var item = xml.childNodes.item(i);
|
|
106
|
-
var nodeName = item.nodeName;
|
|
107
201
|
if (typeof (obj["fields"]) == "undefined") {
|
|
108
202
|
obj["fields"] = [];
|
|
109
203
|
obj["fields"].push(this.xmlToJson(item));
|
|
@@ -119,178 +213,10 @@
|
|
|
119
213
|
}
|
|
120
214
|
return obj;
|
|
121
215
|
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
var submitData = {};
|
|
125
|
-
var rowData = self.vmodel;
|
|
126
|
-
var actionRouter = self.actionRouter;
|
|
127
|
-
debugger
|
|
128
|
-
let field = actionRouter.find(b => {
|
|
129
|
-
return b.id === routerKey;
|
|
130
|
-
});
|
|
131
|
-
field.submitListField.forEach((k) => {
|
|
132
|
-
submitData[k] = rowData[k];
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
let action = field.action;
|
|
136
|
-
if (field.actionField) {
|
|
137
|
-
action = rowData[field.actionField];
|
|
138
|
-
}
|
|
139
|
-
this.routerClickHandler(field, submitData, action);
|
|
216
|
+
clickHandler(routerKey, rowindex, forname, forrowindex) {
|
|
217
|
+
this.$emit('click', routerKey, rowindex, forname, forrowindex);
|
|
140
218
|
},
|
|
141
|
-
routerClickHandler(field, submitData, action) {
|
|
142
|
-
let self = this;
|
|
143
|
-
action = action || field.action;
|
|
144
|
-
|
|
145
|
-
var clickAcion = function () {
|
|
146
|
-
//若不是客户端方法,则直接访问接口
|
|
147
|
-
if (!field.isClientFuntion) {
|
|
148
|
-
// 外部框架tab页打开
|
|
149
|
-
if (field.isFormPageInTab) {
|
|
150
|
-
submitData = field.getActionPara(submitData).para;
|
|
151
|
-
if (field.pageStyle) {
|
|
152
|
-
submitData.pageStyle = field.pageStyle;
|
|
153
|
-
}
|
|
154
|
-
self.$common.getDataDrivenOpts().handler.openTab(action, submitData, field.pageTitle, self.model, field.dialogWidth);
|
|
155
|
-
}
|
|
156
|
-
else if (field.isSearchPageInTab) {// 外部框架tab页打开
|
|
157
|
-
submitData = field.getActionPara(submitData).para;
|
|
158
|
-
self.$common.getDataDrivenOpts().handler.openTabSearch(field, submitData);
|
|
159
|
-
}
|
|
160
|
-
else if (field.isBrowserNewTab) {// 浏览器打开
|
|
161
|
-
submitData = field.getActionPara(submitData).para;
|
|
162
|
-
let query = self.$common.objectToQueryStr(submitData);
|
|
163
|
-
window.open(action + query, "_blank");
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
//self.operationLoading = true;
|
|
167
219
|
|
|
168
|
-
//Form
|
|
169
|
-
if (field.isOpenForm) {
|
|
170
|
-
var dialogOption = {
|
|
171
|
-
title: field.pageTitle,
|
|
172
|
-
pane: self.$common.getParentPane(self),
|
|
173
|
-
content: [{
|
|
174
|
-
component: field.navToNewPageName,
|
|
175
|
-
attrs: {
|
|
176
|
-
//source: data.content,
|
|
177
|
-
api: action,
|
|
178
|
-
apiParam: field.getActionPara(submitData).para,
|
|
179
|
-
showTitle: false,
|
|
180
|
-
width: field.dialogWidth + 'px',
|
|
181
|
-
height: field.dialogHeight + 'px'
|
|
182
|
-
},
|
|
183
|
-
on: {
|
|
184
|
-
submit(ev) {
|
|
185
|
-
if (!field.flagFreshCurrentRow && !field.flagAddRowAfterAction) {
|
|
186
|
-
self.model.doAction(ev);
|
|
187
|
-
}
|
|
188
|
-
self.$forceUpdate();
|
|
189
|
-
self.$refs.footer.$forceUpdate();
|
|
190
|
-
self.$common.closeDialog(dialogOption.dialog);
|
|
191
|
-
self.updateCurrentRow(field, ev);
|
|
192
|
-
},
|
|
193
|
-
refreshParent() {
|
|
194
|
-
self.getPage(1);
|
|
195
|
-
self.$common.closeDialog(dialogOption.dialog);
|
|
196
|
-
},
|
|
197
|
-
closeDialog() {
|
|
198
|
-
self.updateCurrentRow(field);
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}]
|
|
202
|
-
};
|
|
203
|
-
self.$common.openDialog(dialogOption);
|
|
204
|
-
}
|
|
205
|
-
//SearchList
|
|
206
|
-
else if (field.isOpenList) {
|
|
207
|
-
var dialogOption = {
|
|
208
|
-
title: field.pageTitle,
|
|
209
|
-
pane: self.$common.getParentPane(self),
|
|
210
|
-
content: [{
|
|
211
|
-
component: field.navToNewPageName,
|
|
212
|
-
attrs: {
|
|
213
|
-
searchConditionApi: field.actionForSearchLayout,
|
|
214
|
-
searchDataApi: field.actionForSearch,
|
|
215
|
-
apiParam: submitData,
|
|
216
|
-
width: field.dialogWidth + 'px',
|
|
217
|
-
height: field.dialogHeight + 'px'
|
|
218
|
-
},
|
|
219
|
-
on: {
|
|
220
|
-
refreshParent() {
|
|
221
|
-
self.getPage(1);
|
|
222
|
-
self.$common.closeDialog(dialogOption.dialog);
|
|
223
|
-
},
|
|
224
|
-
closeDialog() {
|
|
225
|
-
self.updateCurrentRow(field);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}]
|
|
229
|
-
};
|
|
230
|
-
self.$common.openDialog(dialogOption);
|
|
231
|
-
}
|
|
232
|
-
//Tabs
|
|
233
|
-
else if (field.isOpenTabs) {
|
|
234
|
-
var dialogOption = {
|
|
235
|
-
title: field.pageTitle,
|
|
236
|
-
pane: self.$common.getParentPane(self),
|
|
237
|
-
content: [{
|
|
238
|
-
component: field.navToNewPageName,
|
|
239
|
-
attrs: {
|
|
240
|
-
searchConditionApi: field.actionForSearchLayout,
|
|
241
|
-
searchDataApi: field.actionForSearch,
|
|
242
|
-
apiParam: submitData,
|
|
243
|
-
width: field.dialogWidth + 'px',
|
|
244
|
-
height: field.dialogHeight + 'px'
|
|
245
|
-
},
|
|
246
|
-
on: {
|
|
247
|
-
}
|
|
248
|
-
}]
|
|
249
|
-
};
|
|
250
|
-
self.$common.openDialog(dialogOption);
|
|
251
|
-
}
|
|
252
|
-
else {
|
|
253
|
-
self.operationLoading = true;
|
|
254
|
-
field.doAction(submitData, (data) => {
|
|
255
|
-
self.operationLoading = false;
|
|
256
|
-
if (!field.flagFreshCurrentRow && !field.flagAddRowAfterAction) {
|
|
257
|
-
self.model.doAction({ responseData: data });
|
|
258
|
-
}
|
|
259
|
-
self.$forceUpdate();
|
|
260
|
-
self.$refs.footer.$forceUpdate();
|
|
261
|
-
self.updateCurrentRow(field, data);
|
|
262
|
-
})
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
//执行客户端脚本
|
|
267
|
-
else {
|
|
268
|
-
// let parm={submitData:submitData,field:field}
|
|
269
|
-
// self.$common.excuteFunStr.call(self.model.scripts, field.action,parm);
|
|
270
|
-
let title = field.pageTitle == undefined ? field.label : field.pageTitle;
|
|
271
|
-
submitData.actionType = field.actionType;
|
|
272
|
-
var fun = self.$common.getDataDrivenOpts().handler[action];
|
|
273
|
-
fun(submitData, title, self.model);
|
|
274
|
-
// var fun = self.model.scripts.formData[action];
|
|
275
|
-
// fun(submitData,field);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
if (field.alert) {
|
|
280
|
-
self.$common.confirm(field.alertMsg, field.alertCaption, {
|
|
281
|
-
confirmButtonText: field.alertOKButtonText,
|
|
282
|
-
cancelButtonText: field.alertCancelButtonText,
|
|
283
|
-
//type: 'warning'
|
|
284
|
-
center: field.alertCenter
|
|
285
|
-
}).then(() => {
|
|
286
|
-
clickAcion();
|
|
287
|
-
}).catch(() => {
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
else {
|
|
291
|
-
clickAcion();
|
|
292
|
-
}
|
|
293
|
-
},
|
|
294
220
|
},
|
|
295
221
|
mounted() {
|
|
296
222
|
|