centaline-data-driven 1.3.12 → 1.3.15
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/README.md +21 -0
- package/package.json +1 -1
- package/src/Form.vue +2 -6
- package/src/centaline/css/common.css +3 -1
- package/src/centaline/dynamicDetail/src/dynamicPropertyDetailRET.vue +49 -88
- package/src/centaline/dynamicForm/src/dynamicForm.vue +9 -7
- package/src/centaline/dynamicForm/src/dynamicFormListTable.vue +3 -1
- package/src/centaline/loader/src/ctl/Form.js +110 -0
- package/src/centaline/loader/src/ctl/FormList.js +21 -2
- package/src/centaline/quickInputSos/src/quickInput.vue +107 -82
- 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/README.md
CHANGED
|
@@ -73,6 +73,15 @@ Vue.use(centaline, {
|
|
|
73
73
|
*/
|
|
74
74
|
getValueByFieldName(id, attrKey)
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* @method 表单列表弹层编辑时,弹层formData添加获取父表单数据方法
|
|
78
|
+
* @param {string} id 指定Field的fieldName1
|
|
79
|
+
* @param {string} attrKey 指定Field的属性attrKey
|
|
80
|
+
* @desc 获取指定Field的指定Field的值
|
|
81
|
+
* @returns {string} 指定Field的指定Field的值
|
|
82
|
+
*/
|
|
83
|
+
getValueByFieldNameFromParent(id, attrKey)
|
|
84
|
+
|
|
76
85
|
/**
|
|
77
86
|
* @method
|
|
78
87
|
* @param {string} id 指定Field的fieldName1
|
|
@@ -103,6 +112,18 @@ getListCount(tableName)
|
|
|
103
112
|
*/
|
|
104
113
|
getListFieldValue(tableName, rowNum, fiedlId, attrName, defaultValue)
|
|
105
114
|
|
|
115
|
+
/**
|
|
116
|
+
* @method 表单列表弹层编辑时,弹层formData添加获取父表单数据方法
|
|
117
|
+
* @param {String} tableName 表fieldName1 默认当前表
|
|
118
|
+
* @param {Number} rowNum 行号 默认当前行号(注意 这里第0行是列头)
|
|
119
|
+
* @param {String} fiedlId 列fieldName1 默认当前列fieldName1
|
|
120
|
+
* @param {String} attrName 需要获取attr,如code1,code2 默认code1
|
|
121
|
+
* @param {String} defaultValue 默认值,若该行被删除时,则直接返回这个值,可空
|
|
122
|
+
* @desc 获取指定列表中的指定Field的指定属性值
|
|
123
|
+
* @returns {String} 指定列表中的指定Field的指定属性值
|
|
124
|
+
*/
|
|
125
|
+
getListFieldValueFromParent(tableName, rowNum, fiedlId, attrName, defaultValue)
|
|
126
|
+
|
|
106
127
|
/**
|
|
107
128
|
* @method
|
|
108
129
|
* @param {String} value 设置的值
|
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="'/salemanage/adjust/point/readDetail'" :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>
|
|
@@ -14,11 +14,7 @@
|
|
|
14
14
|
data() {
|
|
15
15
|
return {
|
|
16
16
|
apiParam:{
|
|
17
|
-
actionType:
|
|
18
|
-
originalTraId: "1530076554013306882",
|
|
19
|
-
pageOnly: true,
|
|
20
|
-
pageStyle: 2,
|
|
21
|
-
pageTitle: "成交报告",
|
|
17
|
+
actionType: 2,
|
|
22
18
|
}
|
|
23
19
|
}
|
|
24
20
|
},
|
|
@@ -66,56 +66,14 @@
|
|
|
66
66
|
</div>
|
|
67
67
|
<div class="head-but">
|
|
68
68
|
<div>
|
|
69
|
-
<component
|
|
70
|
-
v-if="model.otherTradeActionRouter !== null"
|
|
71
|
-
v-bind="model.otherTradeActionRouter"
|
|
69
|
+
<component v-if="model.otherTradeActionRouter !== null" v-bind="model.otherTradeActionRouter"
|
|
72
70
|
class="max-default w93"
|
|
73
|
-
:is="model.otherTradeActionRouter.is"
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
v-if="parentModel && parentModel.$refs && parentModel.$refs.table"
|
|
80
|
-
:class="{
|
|
81
|
-
domDisabled:
|
|
82
|
-
parentModel &&
|
|
83
|
-
parentModel.$refs.table &&
|
|
84
|
-
parentModel.$refs.table.model.selectIndex <= 0,
|
|
85
|
-
}"
|
|
86
|
-
@click="clickPrevHandler"
|
|
87
|
-
src="../../../assets/T.png"
|
|
88
|
-
alt=""
|
|
89
|
-
style="
|
|
90
|
-
width: 26px;
|
|
91
|
-
height: 26px;
|
|
92
|
-
vertical-align: bottom;
|
|
93
|
-
margin-left: 20px;
|
|
94
|
-
cursor: pointer;
|
|
95
|
-
"
|
|
96
|
-
/>
|
|
97
|
-
<img
|
|
98
|
-
v-if="parentModel && parentModel.$refs && parentModel.$refs.table"
|
|
99
|
-
:class="{
|
|
100
|
-
domDisabled:
|
|
101
|
-
parentModel &&
|
|
102
|
-
parentModel.$refs.table &&
|
|
103
|
-
parentModel.$refs.table.model.listData &&
|
|
104
|
-
parentModel.$refs.table.model.selectIndex ===
|
|
105
|
-
parentModel.$refs.table.model.listData.length - 1,
|
|
106
|
-
}"
|
|
107
|
-
@click="clickNextHandler"
|
|
108
|
-
src="../../../assets/B.png"
|
|
109
|
-
alt=""
|
|
110
|
-
style="
|
|
111
|
-
width: 26px;
|
|
112
|
-
height: 26px;
|
|
113
|
-
vertical-align: bottom;
|
|
114
|
-
margin-left: 15px;
|
|
115
|
-
margin-right: 13px;
|
|
116
|
-
cursor: pointer;
|
|
117
|
-
"
|
|
118
|
-
/>
|
|
71
|
+
:is="model.otherTradeActionRouter.is" :vmodel="model.otherTradeActionRouter" :api="model.optionApi"
|
|
72
|
+
@click="fieldClickHandler(model.otherTradeActionRouter, $event)"></component>
|
|
73
|
+
<img :class="{domDisabled:flagDisabledPrev,}" @click="clickPrevHandler"
|
|
74
|
+
src="../../../assets/T.png" alt="" style="width: 26px;height: 26px;vertical-align: bottom;margin-left: 20px;cursor: pointer;"/>
|
|
75
|
+
<img :class="{domDisabled:flagDisabledNext,}" @click="clickNextHandler"
|
|
76
|
+
src="../../../assets/B.png" alt="" style="width: 26px;height: 26px;vertical-align: bottom;margin-left: 15px;margin-right: 13px;cursor: pointer;"/>
|
|
119
77
|
</div>
|
|
120
78
|
<div class="mt5">
|
|
121
79
|
<component
|
|
@@ -140,19 +98,8 @@
|
|
|
140
98
|
></component>
|
|
141
99
|
</div>
|
|
142
100
|
<div class="mt5">
|
|
143
|
-
<button
|
|
144
|
-
|
|
145
|
-
class="
|
|
146
|
-
el-button el-button--info el-button--mini
|
|
147
|
-
max-report
|
|
148
|
-
rel
|
|
149
|
-
w93
|
|
150
|
-
"
|
|
151
|
-
v-if="
|
|
152
|
-
model.actionRoutersMoreList !== null &&
|
|
153
|
-
model.actionRoutersMoreList.length > 0
|
|
154
|
-
"
|
|
155
|
-
>
|
|
101
|
+
<button type="button" class="el-button el-button--info el-button--mini max-report rel w93"
|
|
102
|
+
v-if="model.actionRoutersMoreList !== null && model.actionRoutersMoreList.length > 0">
|
|
156
103
|
<img src="../../../assets/dian.png" alt="" class="report" />
|
|
157
104
|
<ul class="report-cont">
|
|
158
105
|
<li
|
|
@@ -336,23 +283,13 @@
|
|
|
336
283
|
<div class="tablist-info base-box">
|
|
337
284
|
<div class="details-tabs-box">
|
|
338
285
|
<el-tabs :value="model.activeIndex1" @tab-click="handleSelect">
|
|
339
|
-
<el-tab-pane
|
|
340
|
-
v-for="(col, index) in model.tags1"
|
|
341
|
-
:key="col.appID"
|
|
342
|
-
:index="index.toString()"
|
|
343
|
-
:name="index.toString()"
|
|
344
|
-
>
|
|
286
|
+
<el-tab-pane v-for="(col, index) in model.tags1" :key="col.appID" :index="index.toString()" :name="index.toString()">
|
|
345
287
|
<div slot="label" v-html="col.appName"></div>
|
|
346
288
|
</el-tab-pane>
|
|
347
289
|
</el-tabs>
|
|
348
|
-
<ct-searchlist
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
:apiParam="model.paramDataTags1"
|
|
352
|
-
:flagFocus="false"
|
|
353
|
-
:searchConditionApi="model.searchConditionApiTags1"
|
|
354
|
-
:searchDataApi="model.searchDataApiTags1"
|
|
355
|
-
></ct-searchlist>
|
|
290
|
+
<ct-searchlist v-if="model.searchConditionApiTags1" :key="'list' + listKey.toString() + refershKey" style="min-height: 420px;"
|
|
291
|
+
:apiParam="model.paramDataTags1" :flagFocus="false" :searchConditionApi="model.searchConditionApiTags1" :searchDataApi="model.searchDataApiTags1">
|
|
292
|
+
</ct-searchlist>
|
|
356
293
|
</div>
|
|
357
294
|
</div>
|
|
358
295
|
<div
|
|
@@ -657,16 +594,33 @@ export default {
|
|
|
657
594
|
allIn: false,
|
|
658
595
|
refershKey: 0,
|
|
659
596
|
listKey: 0,
|
|
597
|
+
flagDisabledPrev:false,
|
|
598
|
+
flagDisabledNext:false,
|
|
660
599
|
};
|
|
661
600
|
},
|
|
662
601
|
mounted() {
|
|
663
602
|
var self = this;
|
|
664
603
|
this.$nextTick(function () {
|
|
604
|
+
if(self.parentModel && self.parentModel.$refs && self.parentModel.$refs.table){
|
|
605
|
+
if(self.parentModel.$refs.table.model.selectIndex <= 0){
|
|
606
|
+
self.flagDisabledPrev=true;
|
|
607
|
+
}
|
|
608
|
+
if(self.parentModel.$refs.table.model.listData && self.parentModel.$refs.table.model.selectIndex ===self.parentModel.$refs.table.model.listData.length - 1){
|
|
609
|
+
self.flagDisabledNext=true;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
else{
|
|
613
|
+
self.flagDisabledPrev=true;
|
|
614
|
+
self.flagDisabledNext=true;
|
|
615
|
+
}
|
|
616
|
+
|
|
665
617
|
if (self.vmodel) {
|
|
666
618
|
self.load(self.vmodel);
|
|
667
|
-
}
|
|
619
|
+
}
|
|
620
|
+
else if (typeof self.source !== "undefined") {
|
|
668
621
|
self.loaderObj.Detail(self.source, null, self.load);
|
|
669
|
-
}
|
|
622
|
+
}
|
|
623
|
+
else if (typeof self.api !== "undefined") {
|
|
670
624
|
self.loaderObj.Detail(self.api, self.apiParam, self.load);
|
|
671
625
|
}
|
|
672
626
|
});
|
|
@@ -881,7 +835,8 @@ export default {
|
|
|
881
835
|
],
|
|
882
836
|
};
|
|
883
837
|
self.$common.openDialog(dialogOption);
|
|
884
|
-
}
|
|
838
|
+
}
|
|
839
|
+
else if (field.isOpenList) {
|
|
885
840
|
var dialogOption = {
|
|
886
841
|
title: field.pageTitle,
|
|
887
842
|
pane: self.$common.getParentPane(self),
|
|
@@ -909,7 +864,8 @@ export default {
|
|
|
909
864
|
],
|
|
910
865
|
};
|
|
911
866
|
self.$common.openDialog(dialogOption);
|
|
912
|
-
}
|
|
867
|
+
}
|
|
868
|
+
else if (field.isFormPageInTab) {
|
|
913
869
|
// 外部框架tab页打开
|
|
914
870
|
submitData = field.getActionPara(submitData).para;
|
|
915
871
|
self.$common
|
|
@@ -921,24 +877,29 @@ export default {
|
|
|
921
877
|
self.model,
|
|
922
878
|
field.dialogWidth
|
|
923
879
|
);
|
|
924
|
-
}
|
|
880
|
+
}
|
|
881
|
+
else if (field.isSearchPageInTab) {
|
|
925
882
|
// 外部框架tab页打开
|
|
926
883
|
submitData = field.getActionPara(submitData).para;
|
|
927
884
|
self.$common
|
|
928
885
|
.getDataDrivenOpts()
|
|
929
886
|
.handler.openTabSearch(field, submitData);
|
|
930
|
-
}
|
|
887
|
+
}
|
|
888
|
+
else if (field.isBrowserNewTab) {
|
|
931
889
|
// 浏览器打开
|
|
932
890
|
submitData = field.getActionPara(submitData).para;
|
|
933
891
|
let query = self.$common.objectToQueryStr(submitData);
|
|
934
892
|
window.open(field.action + query, "_blank");
|
|
935
|
-
}
|
|
893
|
+
}
|
|
894
|
+
else if (field.isOpenUrlInBrowse) {
|
|
936
895
|
// 浏览器打开
|
|
937
896
|
window.open(submitData[field.submitFormField], "_blank");
|
|
938
|
-
}
|
|
897
|
+
}
|
|
898
|
+
else if (field.isSeeVoice) {
|
|
939
899
|
//看视频
|
|
940
900
|
self.$common.browseVideo(field, submitData);
|
|
941
|
-
}
|
|
901
|
+
}
|
|
902
|
+
else {
|
|
942
903
|
field.doAction(submitData, (data) => {
|
|
943
904
|
self.model.doAction(data, field);
|
|
944
905
|
if (callBack) {
|
|
@@ -950,8 +911,7 @@ export default {
|
|
|
950
911
|
//执行客户端脚本
|
|
951
912
|
else {
|
|
952
913
|
submitData = field.getActionPara(submitData).para;
|
|
953
|
-
let title =
|
|
954
|
-
field.pageTitle == undefined ? field.label : field.pageTitle;
|
|
914
|
+
let title = field.pageTitle == undefined ? field.label : field.pageTitle;
|
|
955
915
|
submitData.actionType = field.actionType;
|
|
956
916
|
var fun = self.$common.getDataDrivenOpts().handler[field.action];
|
|
957
917
|
fun(submitData, title, null);
|
|
@@ -974,7 +934,8 @@ export default {
|
|
|
974
934
|
clickAcion(field, submitData);
|
|
975
935
|
})
|
|
976
936
|
.catch(() => {});
|
|
977
|
-
}
|
|
937
|
+
}
|
|
938
|
+
else {
|
|
978
939
|
clickAcion(field, submitData);
|
|
979
940
|
}
|
|
980
941
|
},
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
v-for="(item, index) in collapse" v-if="item.show !== false" :key="index">
|
|
25
25
|
<el-row>
|
|
26
26
|
<el-col v-for="(col, index) in collapseFieldsRow[index + 1]" :key="index" :span="col.colspan" v-if="col.show !== false" style="padding:5px">
|
|
27
|
-
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" v-bind="col.bindPara" :fileData="getFileData(col)"
|
|
27
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model" v-bind="col.bindPara" :fileData="getFileData(col)"
|
|
28
28
|
@click="fieldClickHandler(col,$event)" @change="changeHandler(col,$event)" @enter="enterHandler(col,$event)"
|
|
29
29
|
@input="inputHandler(col,$event)" @importComplete="importComplete"
|
|
30
30
|
@popupSearchList="popupSearchListHandler"
|
|
@@ -35,15 +35,15 @@
|
|
|
35
35
|
</el-tabs>
|
|
36
36
|
|
|
37
37
|
<!--分组-->
|
|
38
|
-
<el-collapse v-else v-model="collapseActiveNames" @change="collapseHandleChange">
|
|
38
|
+
<el-collapse v-else v-model="collapseActiveNames" @change="collapseHandleChange" :class="model.flagHideSaveLine?'el-collapse-saveLine':''">
|
|
39
39
|
<el-collapse-item v-for="(item, index) in collapse" v-if="item.show !== false" :key="index" :title="item.label" :name="index" :disabled="item.lock" :class="item.lock?'ct-collapse-item-title':''">
|
|
40
40
|
<template slot="title">
|
|
41
41
|
<i class="sign"></i>
|
|
42
|
-
{{item.label}}
|
|
42
|
+
<span :class="[item.labelClass]">{{item.label}}</span>
|
|
43
43
|
</template>
|
|
44
44
|
<el-row>
|
|
45
45
|
<el-col v-for="(col, index) in collapseFieldsRow[index + 1]" :key="index" :span="col.colspan" v-if="col.show !== false" style="padding:5px">
|
|
46
|
-
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" v-bind="col.bindPara" :fileData="getFileData(col)" :from="'form'"
|
|
46
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model" v-bind="col.bindPara" :fileData="getFileData(col)" :from="'form'"
|
|
47
47
|
@click="fieldClickHandler(col,$event)" @change="changeHandler(col,$event)" @enter="enterHandler(col,$event)"
|
|
48
48
|
@input="inputHandler(col,$event)" @importComplete="importComplete"
|
|
49
49
|
@popupSearchList="popupSearchListHandler"
|
|
@@ -681,7 +681,7 @@
|
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
683
|
return submitData;
|
|
684
|
-
},
|
|
684
|
+
},
|
|
685
685
|
}
|
|
686
686
|
}
|
|
687
687
|
</script>
|
|
@@ -689,8 +689,10 @@
|
|
|
689
689
|
.el-collapse{
|
|
690
690
|
border-top: none;
|
|
691
691
|
}
|
|
692
|
-
.ct-collapse-item-title .el-collapse-item__header
|
|
693
|
-
{
|
|
692
|
+
.ct-collapse-item-title .el-collapse-item__header{
|
|
694
693
|
color:#303133 !important;
|
|
695
694
|
}
|
|
695
|
+
.el-collapse-saveLine .ct-collapse-item-title:last-child .el-collapse-item__wrap{
|
|
696
|
+
border-bottom:none;
|
|
697
|
+
}
|
|
696
698
|
</style>
|
|
@@ -94,7 +94,8 @@
|
|
|
94
94
|
},
|
|
95
95
|
props: {
|
|
96
96
|
vmodel: Object,
|
|
97
|
-
api: String
|
|
97
|
+
api: String,
|
|
98
|
+
parentModel: Object,
|
|
98
99
|
},
|
|
99
100
|
data() {
|
|
100
101
|
return {
|
|
@@ -107,6 +108,7 @@
|
|
|
107
108
|
let self = this;
|
|
108
109
|
this.model = this.vmodel;
|
|
109
110
|
this.model.OptApi = this.api;
|
|
111
|
+
this.model.$self=self;
|
|
110
112
|
|
|
111
113
|
this.$nextTick(function () {
|
|
112
114
|
self.model.refField = this.$refs.Fields;
|
|
@@ -160,6 +160,12 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
|
|
|
160
160
|
get saveButtonAction() {
|
|
161
161
|
return source.saveButtonAction;
|
|
162
162
|
},
|
|
163
|
+
get flagShowSaveLine() {
|
|
164
|
+
return source.flagShowSaveLine;
|
|
165
|
+
},
|
|
166
|
+
get flagHideSaveLine() {
|
|
167
|
+
return source.flagHideSaveLine;
|
|
168
|
+
},
|
|
163
169
|
//获取新的初始化的方法
|
|
164
170
|
_scripts: null,
|
|
165
171
|
get scripts() {
|
|
@@ -207,6 +213,12 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
|
|
|
207
213
|
return rtn1.source[attrKey];
|
|
208
214
|
}
|
|
209
215
|
},
|
|
216
|
+
getValueByFieldNameFromParent(id, attrKey) {
|
|
217
|
+
if(this.form && this.form.self && this.form.self.$parent){
|
|
218
|
+
return this.form.self.$parent.vmodel.content[0].on.getValueByFieldName(id, attrKey);
|
|
219
|
+
}
|
|
220
|
+
return null;
|
|
221
|
+
},
|
|
210
222
|
//设置Field的属性attrKey的值
|
|
211
223
|
setValueByFieldName(id, attrKey, attrValue) {
|
|
212
224
|
attrKey = this.common.initialsToLowerCase(attrKey);
|
|
@@ -222,6 +234,12 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
|
|
|
222
234
|
}
|
|
223
235
|
}
|
|
224
236
|
},
|
|
237
|
+
setValueByFieldNameFromParent(id, attrKey, attrValue) {
|
|
238
|
+
if(this.form && this.form.self && this.form.self.$parent){
|
|
239
|
+
return this.form.self.$parent.vmodel.content[0].on.setValueByFieldName(id, attrKey, attrValue);
|
|
240
|
+
}
|
|
241
|
+
return null;
|
|
242
|
+
},
|
|
225
243
|
//设置Field的v1、v2的值
|
|
226
244
|
setV1AndV2ByField1(id, code1, code2) {
|
|
227
245
|
var rtn1 = this.fieldsDic[id];
|
|
@@ -342,6 +360,12 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
|
|
|
342
360
|
return data.field.source[attrName];
|
|
343
361
|
}
|
|
344
362
|
},
|
|
363
|
+
getListFieldValueFromParent(tableName, rowNum, fiedlId, attrName, defaultValue) {
|
|
364
|
+
if(this.form && this.form.self && this.form.self.$parent){
|
|
365
|
+
return this.form.self.$parent.vmodel.content[0].on.getListFieldValue(tableName, rowNum, fiedlId, attrName, defaultValue);
|
|
366
|
+
}
|
|
367
|
+
return null;
|
|
368
|
+
},
|
|
345
369
|
//设置表格某行某列的值
|
|
346
370
|
setListFieldValue(value, tableName, rowNum, fiedlId, attrName) {
|
|
347
371
|
value = value==undefined?"":value.toString();
|
|
@@ -475,6 +499,92 @@ const Form = function (source, callBack, apiParam, failCallBack, isFormList) {
|
|
|
475
499
|
});
|
|
476
500
|
},
|
|
477
501
|
},
|
|
502
|
+
getValueByFieldName(id, attrKey) {
|
|
503
|
+
attrKey = common.initialsToLowerCase(attrKey);
|
|
504
|
+
var rtn1 = this.fieldsDic[id];
|
|
505
|
+
if (rtn1) {
|
|
506
|
+
return rtn1.source[attrKey];
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
setValueByFieldName(id, attrKey, attrValue) {
|
|
510
|
+
attrKey = common.initialsToLowerCase(attrKey);
|
|
511
|
+
var rtn1 = this.fieldsDic[id];
|
|
512
|
+
if (rtn1) {
|
|
513
|
+
rtn1.source[attrKey] = attrValue;
|
|
514
|
+
this.self.hatchHandle(id, attrKey, attrValue, rtn1);
|
|
515
|
+
|
|
516
|
+
//用于处理源数据改动,强制更新视图数据 todo
|
|
517
|
+
if (rtn1.self.$forceUpdate) {
|
|
518
|
+
rtn1.self.$forceUpdate();
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
},
|
|
522
|
+
getListField(tableName, rowNum, fiedlId) {
|
|
523
|
+
let listData = this.fields.find((v) => {
|
|
524
|
+
return v.id === tableName;
|
|
525
|
+
});
|
|
526
|
+
if (listData) {
|
|
527
|
+
let field = null;
|
|
528
|
+
//正在编辑的Field
|
|
529
|
+
if (rowNum === null && (fiedlId === null || listData.currentEventField.id === fiedlId)) {
|
|
530
|
+
field = listData.currentEventField;
|
|
531
|
+
}
|
|
532
|
+
//正在编辑的行
|
|
533
|
+
else if (rowNum === null && listData.currentRowIndex === 0) {
|
|
534
|
+
let fields = listData.currentRow.data;
|
|
535
|
+
field = fields[fiedlId];
|
|
536
|
+
}
|
|
537
|
+
//源数据
|
|
538
|
+
else {
|
|
539
|
+
if (rowNum === null && listData.currentRowIndex) {
|
|
540
|
+
rowNum = listData.currentRowIndex;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
if (rowNum === 0 || (rowNum && fiedlId)) {
|
|
544
|
+
try {
|
|
545
|
+
let fields = listData.rows[rowNum].field;
|
|
546
|
+
field = fields.find((v) => {
|
|
547
|
+
return v.id === fiedlId;
|
|
548
|
+
});
|
|
549
|
+
} catch (e) {
|
|
550
|
+
if (listData.rows.length <= rowNum) {
|
|
551
|
+
var checkMsg = "获取列表行索引超出界限";
|
|
552
|
+
this.message(checkMsg);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
return { listData: listData, field: field };
|
|
559
|
+
}
|
|
560
|
+
},
|
|
561
|
+
getListFieldValue(tableName, rowNum, fiedlId, attrName, defaultValue) {
|
|
562
|
+
tableName = tableName ? tableName : this.scripts.$fd;
|
|
563
|
+
let data = this.getListField(tableName, rowNum, fiedlId);
|
|
564
|
+
|
|
565
|
+
attrName = common.initialsToLowerCase(attrName);
|
|
566
|
+
attrName = attrName ? attrName : 'code1';
|
|
567
|
+
|
|
568
|
+
if (!fiedlId) {
|
|
569
|
+
fiedlId = data.listData.currentEventField.id;
|
|
570
|
+
}
|
|
571
|
+
if (fiedlId && rowNum === null && fiedlId === data.listData.currentEventField.id) {
|
|
572
|
+
data.field = data.listData.currentEventField;
|
|
573
|
+
}
|
|
574
|
+
rowNum = rowNum !== null ? rowNum : data.listData.currentRowIndex;
|
|
575
|
+
|
|
576
|
+
//若该行正在编辑,则取编辑状态的。
|
|
577
|
+
if (data && data.listData && data.listData.currentRow.data && data.listData.currentRow.data[fiedlId]
|
|
578
|
+
&& data.listData.currentRow.data.$sourceIndex === rowNum && data.listData.currentRow.isSet) {
|
|
579
|
+
return data.listData.currentRow.data[fiedlId].source[attrName];
|
|
580
|
+
}
|
|
581
|
+
else if (data && data.field) {
|
|
582
|
+
if (typeof defaultValue !== 'undefined' && data.listData.rows[rowNum].deleted) {//若该行被删除时,则直接返回默认值
|
|
583
|
+
return defaultValue;
|
|
584
|
+
}
|
|
585
|
+
return data.field.source[attrName];
|
|
586
|
+
}
|
|
587
|
+
},
|
|
478
588
|
getFormObj() {
|
|
479
589
|
var rtnFormObj = {};
|
|
480
590
|
rtn.fields.forEach((f) => {
|
|
@@ -309,6 +309,7 @@ const FormList = function (source, master) {
|
|
|
309
309
|
},
|
|
310
310
|
editRow(index, callback) {
|
|
311
311
|
var self = this;
|
|
312
|
+
self.currentRowIndex=index;
|
|
312
313
|
var dialogOption = {
|
|
313
314
|
title: '修改',
|
|
314
315
|
pane: common.getParentPane(self),
|
|
@@ -353,7 +354,16 @@ const FormList = function (source, master) {
|
|
|
353
354
|
common.closeDialog(dialogOption.dialog);
|
|
354
355
|
callback();
|
|
355
356
|
}
|
|
356
|
-
}
|
|
357
|
+
},
|
|
358
|
+
getValueByFieldName:function(id, attrKey){
|
|
359
|
+
return self.$self.parentModel.getValueByFieldName(id, attrKey);
|
|
360
|
+
},
|
|
361
|
+
setValueByFieldName:function(id, attrKey, attrValue){
|
|
362
|
+
return self.$self.parentModel.setValueByFieldName(id, attrKey, attrValue);
|
|
363
|
+
},
|
|
364
|
+
getListFieldValue:function(tableName, rowNum, fiedlId, attrName, defaultValue){
|
|
365
|
+
return self.$self.parentModel.getListFieldValue(tableName, rowNum, fiedlId, attrName, defaultValue);
|
|
366
|
+
},
|
|
357
367
|
}
|
|
358
368
|
}]
|
|
359
369
|
};
|
|
@@ -425,7 +435,16 @@ const FormList = function (source, master) {
|
|
|
425
435
|
common.closeDialog(dialogOption.dialog);
|
|
426
436
|
callback();
|
|
427
437
|
}
|
|
428
|
-
}
|
|
438
|
+
},
|
|
439
|
+
getValueByFieldName:function(id, attrKey){
|
|
440
|
+
return self.$self.parentModel.getValueByFieldName(id, attrKey);
|
|
441
|
+
},
|
|
442
|
+
setValueByFieldName:function(id, attrKey, attrValue){
|
|
443
|
+
return self.$self.parentModel.setValueByFieldName(id, attrKey, attrValue);
|
|
444
|
+
},
|
|
445
|
+
getListFieldValue:function(tableName, rowNum, fiedlId, attrName, defaultValue){
|
|
446
|
+
return self.$self.parentModel.getListFieldValue(tableName, rowNum, fiedlId, attrName, defaultValue);
|
|
447
|
+
},
|
|
429
448
|
}
|
|
430
449
|
}]
|
|
431
450
|
};
|