centaline-data-driven 1.6.64 → 1.6.65
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/package.json +1 -1
- package/release-log.md +7 -0
- package/src/SearchList.vue +2 -2
- package/src/centaline/dialogList/src/dialog.vue +332 -322
- package/src/centaline/dynamicFile/src/dynamicFile.vue +62 -14
- package/src/centaline/dynamicForm/src/dynamicForm.vue +1714 -1450
- package/src/centaline/dynamicViewerFile/src/dynamicViewerFile.vue +374 -392
- package/src/centaline/dynamicViewerFile/src/dynamicViewerImage.vue +1 -1
- package/src/main.js +2 -2
- package/wwwroot/static/centaline/centaline-data-driven.js +5474 -5162
- package/wwwroot/static/centaline/centaline-data-driven.js.map +1 -1
|
@@ -1,1022 +1,1110 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div ref="formRef" v-loading="loading"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
</div>
|
|
14
|
-
|
|
15
|
-
<!--relationParentFormFields-->
|
|
16
|
-
<el-row v-if="relationParentFormFields.length > 0">
|
|
17
|
-
<template v-for="(col, index) in relationParentFormFields">
|
|
18
|
-
<el-col :key="index" v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
19
|
-
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model" v-bind="col.bindPara"
|
|
20
|
-
:fileData="getFileData(col)" :from="'form'" :documentHeight="documentHeight" :documentWidth="documentWidth"
|
|
21
|
-
@click="fieldClickHandler(col,$event)" @change="changeHandler(col,$event)" @enter="enterHandler(col,$event)"
|
|
22
|
-
@input="inputHandler(col,$event)" @importComplete="importComplete" @blur="blurHandler(col,$event)"
|
|
23
|
-
@popupSearchList="popupSearchListHandler" @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
24
|
-
@popupLocation="popupLocationHandler"
|
|
25
|
-
@tableButtonClick="clickHandler"></component>
|
|
26
|
-
</el-col>
|
|
27
|
-
</template>
|
|
28
|
-
</el-row>
|
|
2
|
+
<div ref="formRef" v-loading="loading"
|
|
3
|
+
:style="{ width: pageWidth ? pageWidth + 'px' : '100%', margin: 'auto', 'min-height': minHeight }">
|
|
4
|
+
<div style="display: flex; width: 100%;">
|
|
5
|
+
<div style="flex: 1; min-width: 0;padding: 10px;" ref="leftContainerRef">
|
|
6
|
+
<div ref="fieldsRef" v-if="model !== null && !loading" class="ct-form"
|
|
7
|
+
:class="{ 'domDisabled': model.pageDisabled }" :key="formKey">
|
|
8
|
+
<div ref="topTipRef" v-if="model.tip" class="tip-absolute">
|
|
9
|
+
<span v-html="model.tip"></span>
|
|
10
|
+
</div>
|
|
11
|
+
<div v-if="(!this.model.isHorizontalLayout || this.flagScroll) && model.tip"
|
|
12
|
+
:style="{ 'height': (model.tip ? 30 : 0) + 'px' }"></div>
|
|
29
13
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
<el-col :key="index" v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
36
|
-
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model" v-bind="col.bindPara"
|
|
37
|
-
:fileData="getFileData(col)" :from="'form'" :documentHeight="documentHeight" :documentWidth="documentWidth"
|
|
38
|
-
@click="fieldClickHandler(col,$event)" @change="changeHandler(col,$event)" @enter="enterHandler(col,$event)"
|
|
39
|
-
@input="inputHandler(col,$event)" @importComplete="importComplete" @blur="blurHandler(col,$event)"
|
|
40
|
-
@popupSearchList="popupSearchListHandler" @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
41
|
-
@popupLocation="popupLocationHandler"
|
|
42
|
-
@tableButtonClick="clickHandler"></component>
|
|
43
|
-
</el-col>
|
|
44
|
-
</template>
|
|
45
|
-
<template v-else>
|
|
46
|
-
<el-col :key="index" v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
47
|
-
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model" v-bind="col.bindPara"
|
|
48
|
-
:fileData="getFileData(col)" :from="'form'" :documentHeight="documentHeight" :documentWidth="documentWidth"
|
|
49
|
-
@click="fieldClickHandler(col,$event)" @change="changeHandler(col,$event)" @enter="enterHandler(col,$event)"
|
|
50
|
-
@input="inputHandler(col,$event)" @importComplete="importComplete" @blur="blurHandler(col,$event)"
|
|
51
|
-
@popupSearchList="popupSearchListHandler" @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
52
|
-
@popupLocation="popupLocationHandler"
|
|
53
|
-
@tableButtonClick="clickHandler"></component>
|
|
54
|
-
</el-col>
|
|
55
|
-
</template>
|
|
56
|
-
</template>
|
|
57
|
-
</el-row>
|
|
14
|
+
<!--可根据场景判断显示el-card还是el-main-->
|
|
15
|
+
<component :is="model.showTitle ? 'el-main' : 'el-card'">
|
|
16
|
+
<div slot="header" class="clearfix" v-if="typeof model.title !== 'undefined' && model.flagShowTitle">
|
|
17
|
+
<span style="font-weight:bold">{{ model.title }}</span>
|
|
18
|
+
</div>
|
|
58
19
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
:fileData="getFileData(col)" :from="'form'" :documentHeight="documentHeight" :documentWidth="documentWidth"
|
|
73
|
-
@click="fieldClickHandler(col,$event)" @change="changeHandler(col,$event)" @enter="enterHandler(col,$event)"
|
|
74
|
-
@input="inputHandler(col,$event)" @importComplete="importComplete" @blur="blurHandler(col,$event)"
|
|
75
|
-
@popupSearchList="popupSearchListHandler" @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
76
|
-
@popupLocation="popupLocationHandler"
|
|
77
|
-
@tableButtonClick="clickHandler"></component>
|
|
78
|
-
</el-col>
|
|
79
|
-
</template>
|
|
80
|
-
<template v-else>
|
|
81
|
-
<el-col :key="index" :span="col.colspan" v-if="col.show !== false" style="padding:5px">
|
|
82
|
-
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model" v-bind="col.bindPara"
|
|
83
|
-
:fileData="getFileData(col)" :from="'form'" :documentHeight="documentHeight" :documentWidth="documentWidth"
|
|
84
|
-
@click="fieldClickHandler(col,$event)" @change="changeHandler(col,$event)" @enter="enterHandler(col,$event)"
|
|
85
|
-
@input="inputHandler(col,$event)" @importComplete="importComplete" @blur="blurHandler(col,$event)"
|
|
86
|
-
@popupSearchList="popupSearchListHandler" @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
87
|
-
@popupLocation="popupLocationHandler"
|
|
88
|
-
@tableButtonClick="clickHandler"></component>
|
|
89
|
-
</el-col>
|
|
90
|
-
</template>
|
|
20
|
+
<!--relationParentFormFields-->
|
|
21
|
+
<el-row v-if="relationParentFormFields.length > 0">
|
|
22
|
+
<template v-for="(col, index) in relationParentFormFields">
|
|
23
|
+
<el-col :key="index" v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
24
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model"
|
|
25
|
+
v-bind="col.bindPara" :fileData="getFileData(col)" :from="'form'" :documentHeight="documentHeight"
|
|
26
|
+
:documentWidth="documentWidth" @click="fieldClickHandler(col, $event)"
|
|
27
|
+
@change="changeHandler(col, $event)" @enter="enterHandler(col, $event)"
|
|
28
|
+
@input="inputHandler(col, $event)" @importComplete="importComplete" @blur="blurHandler(col, $event)"
|
|
29
|
+
@popupSearchList="popupSearchListHandler"
|
|
30
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
31
|
+
@popupLocation="popupLocationHandler" @tableButtonClick="clickHandler"></component>
|
|
32
|
+
</el-col>
|
|
91
33
|
</template>
|
|
92
34
|
</el-row>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
<template v-for="(col, index) in independentItem">
|
|
35
|
+
|
|
36
|
+
<!--头部元素-->
|
|
37
|
+
<el-row v-if="collapseFieldsRow.length > 0">
|
|
38
|
+
<template v-for="(col, index) in collapseFieldsRow[0]">
|
|
98
39
|
<template v-if="col.show !== false && col.lineFeed">
|
|
99
|
-
<div style="
|
|
40
|
+
<div style="float: left;width: 100%;"></div>
|
|
100
41
|
<el-col :key="index" v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
42
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model"
|
|
43
|
+
v-bind="col.bindPara" :fileData="getFileData(col)" :from="'form'" :documentHeight="documentHeight"
|
|
44
|
+
:documentWidth="documentWidth" @click="fieldClickHandler(col, $event)"
|
|
45
|
+
@change="changeHandler(col, $event)" @enter="enterHandler(col, $event)"
|
|
46
|
+
@input="inputHandler(col, $event)" @importComplete="importComplete"
|
|
47
|
+
@blur="blurHandler(col, $event)" @popupSearchList="popupSearchListHandler"
|
|
48
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
49
|
+
@popupLocation="popupLocationHandler" @tableButtonClick="clickHandler"></component>
|
|
108
50
|
</el-col>
|
|
109
51
|
</template>
|
|
110
52
|
<template v-else>
|
|
111
53
|
<el-col :key="index" v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
112
|
-
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model"
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
54
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model"
|
|
55
|
+
v-bind="col.bindPara" :fileData="getFileData(col)" :from="'form'" :documentHeight="documentHeight"
|
|
56
|
+
:documentWidth="documentWidth" @click="fieldClickHandler(col, $event)"
|
|
57
|
+
@change="changeHandler(col, $event)" @enter="enterHandler(col, $event)"
|
|
58
|
+
@input="inputHandler(col, $event)" @importComplete="importComplete"
|
|
59
|
+
@blur="blurHandler(col, $event)" @popupSearchList="popupSearchListHandler"
|
|
60
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
61
|
+
@popupLocation="popupLocationHandler" @tableButtonClick="clickHandler"></component>
|
|
119
62
|
</el-col>
|
|
120
63
|
</template>
|
|
121
64
|
</template>
|
|
122
65
|
</el-row>
|
|
123
|
-
<el-row ref="linksRef" v-if="model.links.findIndex((v)=>{return v.show}) > -1" style="margin-top: 8px;">
|
|
124
|
-
<el-col :span="24" style="text-align:left">
|
|
125
|
-
<component v-for="(btn, index) in model.links" :key="index" :is="btn.is" :vmodel="btn" @click="clickHandler" v-if="btn.show"></component>
|
|
126
|
-
</el-col>
|
|
127
|
-
</el-row>
|
|
128
|
-
</template>
|
|
129
|
-
</el-tabs>
|
|
130
66
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
</template>
|
|
138
|
-
<el-row>
|
|
139
|
-
<template v-for="(col, index) in collapseFieldsRow[index + 1]">
|
|
140
|
-
<template v-if="col.show !== false && col.lineFeed">
|
|
141
|
-
<div style="display: flex; flex: 0 0 100%;"></div>
|
|
142
|
-
<el-col :key="index" :span="col.colspan" v-if="col.show !== false" style="padding:5px">
|
|
143
|
-
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model" v-bind="col.bindPara"
|
|
144
|
-
:fileData="getFileData(col)" :from="'form'" :documentHeight="documentHeight" :documentWidth="documentWidth"
|
|
145
|
-
@click="fieldClickHandler(col,$event)" @change="changeHandler(col,$event)" @enter="enterHandler(col,$event)"
|
|
146
|
-
@input="inputHandler(col,$event)" @importComplete="importComplete" @blur="blurHandler(col,$event)"
|
|
147
|
-
@popupSearchList="popupSearchListHandler" @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
148
|
-
@popupLocation="popupLocationHandler"
|
|
149
|
-
@tableButtonClick="clickHandler"></component>
|
|
150
|
-
</el-col>
|
|
67
|
+
<!--tabs-->
|
|
68
|
+
<el-tabs ref="tabsRef" v-if="model.isHorizontalLayout" v-model="activeName" @tab-click="tabClickHandler">
|
|
69
|
+
<el-tab-pane :name="index.toString()" :lazy="item.lazyLoad" v-for="(item, index) in collapse"
|
|
70
|
+
v-if="item.show !== false" :key="index">
|
|
71
|
+
<template slot="label">
|
|
72
|
+
<span v-html="item.label"></span>
|
|
151
73
|
</template>
|
|
152
|
-
<
|
|
153
|
-
<
|
|
154
|
-
<
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
74
|
+
<el-row>
|
|
75
|
+
<template v-for="(col, index) in collapseFieldsRow[index + 1]">
|
|
76
|
+
<template v-if="col.show !== false && col.lineFeed">
|
|
77
|
+
<div style="display: flex; flex: 0 0 100%;"></div>
|
|
78
|
+
<el-col :key="index" :span="col.colspan" v-if="col.show !== false" style="padding:5px">
|
|
79
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model"
|
|
80
|
+
v-bind="col.bindPara" :fileData="getFileData(col)" :from="'form'"
|
|
81
|
+
:documentHeight="documentHeight" :documentWidth="documentWidth"
|
|
82
|
+
@click="fieldClickHandler(col, $event)" @change="changeHandler(col, $event)"
|
|
83
|
+
@enter="enterHandler(col, $event)" @input="inputHandler(col, $event)"
|
|
84
|
+
@importComplete="importComplete" @blur="blurHandler(col, $event)"
|
|
85
|
+
@popupSearchList="popupSearchListHandler"
|
|
86
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
87
|
+
@popupLocation="popupLocationHandler" @tableButtonClick="clickHandler"></component>
|
|
88
|
+
</el-col>
|
|
89
|
+
</template>
|
|
90
|
+
<template v-else>
|
|
91
|
+
<el-col :key="index" :span="col.colspan" v-if="col.show !== false" style="padding:5px">
|
|
92
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model"
|
|
93
|
+
v-bind="col.bindPara" :fileData="getFileData(col)" :from="'form'"
|
|
94
|
+
:documentHeight="documentHeight" :documentWidth="documentWidth"
|
|
95
|
+
@click="fieldClickHandler(col, $event)" @change="changeHandler(col, $event)"
|
|
96
|
+
@enter="enterHandler(col, $event)" @input="inputHandler(col, $event)"
|
|
97
|
+
@importComplete="importComplete" @blur="blurHandler(col, $event)"
|
|
98
|
+
@popupSearchList="popupSearchListHandler"
|
|
99
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
100
|
+
@popupLocation="popupLocationHandler" @tableButtonClick="clickHandler"></component>
|
|
101
|
+
</el-col>
|
|
102
|
+
</template>
|
|
103
|
+
</template>
|
|
104
|
+
</el-row>
|
|
105
|
+
</el-tab-pane>
|
|
106
|
+
<template v-if="model.flagFixedTabOnHorizontalLayout">
|
|
107
|
+
<!--尾部元素-->
|
|
108
|
+
<el-row ref="independentRef" v-if="independentItem.length > 0" style="margin-top: 20px;">
|
|
109
|
+
<template v-for="(col, index) in independentItem">
|
|
110
|
+
<template v-if="col.show !== false && col.lineFeed">
|
|
111
|
+
<div style="display: flex; flex: 0 0 100%;"></div>
|
|
112
|
+
<el-col :key="index" v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
113
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model"
|
|
114
|
+
v-bind="col.bindPara" :fileData="getFileData(col)" :from="'form'"
|
|
115
|
+
:documentHeight="documentHeight" :documentWidth="documentWidth"
|
|
116
|
+
@click="fieldClickHandler(col, $event)" @change="changeHandler(col, $event)"
|
|
117
|
+
@enter="enterHandler(col, $event)" @input="inputHandler(col, $event)"
|
|
118
|
+
@importComplete="importComplete" @blur="blurHandler(col, $event)"
|
|
119
|
+
@popupSearchList="popupSearchListHandler"
|
|
120
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
121
|
+
@popupLocation="popupLocationHandler" @tableButtonClick="clickHandler"></component>
|
|
122
|
+
</el-col>
|
|
123
|
+
</template>
|
|
124
|
+
<template v-else>
|
|
125
|
+
<el-col :key="index" v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
126
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model"
|
|
127
|
+
v-bind="col.bindPara" :fileData="getFileData(col)" :from="'form'"
|
|
128
|
+
:documentHeight="documentHeight" :documentWidth="documentWidth"
|
|
129
|
+
@click="fieldClickHandler(col, $event)" @change="changeHandler(col, $event)"
|
|
130
|
+
@enter="enterHandler(col, $event)" @input="inputHandler(col, $event)"
|
|
131
|
+
@importComplete="importComplete" @blur="blurHandler(col, $event)"
|
|
132
|
+
@popupSearchList="popupSearchListHandler"
|
|
133
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
134
|
+
@popupLocation="popupLocationHandler" @tableButtonClick="clickHandler"></component>
|
|
135
|
+
</el-col>
|
|
136
|
+
</template>
|
|
137
|
+
</template>
|
|
138
|
+
</el-row>
|
|
139
|
+
<el-row ref="linksRef" v-if="model.links.findIndex((v) => { return v.show }) > -1"
|
|
140
|
+
style="margin-top: 8px;">
|
|
141
|
+
<el-col :span="24" style="text-align:left">
|
|
142
|
+
<component v-for="(btn, index) in model.links" :key="index" :is="btn.is" :vmodel="btn"
|
|
143
|
+
@click="clickHandler" v-if="btn.show"></component>
|
|
161
144
|
</el-col>
|
|
162
|
-
</
|
|
145
|
+
</el-row>
|
|
163
146
|
</template>
|
|
164
|
-
</el-
|
|
165
|
-
</el-collapse-item>
|
|
166
|
-
</el-collapse>
|
|
147
|
+
</el-tabs>
|
|
167
148
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
<
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
@
|
|
189
|
-
@
|
|
190
|
-
@
|
|
191
|
-
@popupLocation="popupLocationHandler"
|
|
192
|
-
|
|
149
|
+
<!--分组-->
|
|
150
|
+
<el-collapse v-else v-model="collapseActiveNames" @change="collapseHandleChange"
|
|
151
|
+
:class="model.flagHideSaveLine ? 'el-collapse-saveLine' : ''">
|
|
152
|
+
<el-collapse-item v-for="(item, index) in collapse" v-if="item.show !== false" :key="index"
|
|
153
|
+
:title="item.label" :name="index" :disabled="item.lock"
|
|
154
|
+
:class="item.lock ? 'ct-collapse-item-title' : ''">
|
|
155
|
+
<template slot="title">
|
|
156
|
+
<i class="sign"></i>
|
|
157
|
+
<span :class="[item.labelClass]">{{ item.label }}</span>
|
|
158
|
+
</template>
|
|
159
|
+
<el-row>
|
|
160
|
+
<template v-for="(col, index) in collapseFieldsRow[index + 1]">
|
|
161
|
+
<template v-if="col.show !== false && col.lineFeed">
|
|
162
|
+
<div style="display: flex; flex: 0 0 100%;"></div>
|
|
163
|
+
<el-col :key="index" :span="col.colspan" v-if="col.show !== false" style="padding:5px">
|
|
164
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model"
|
|
165
|
+
v-bind="col.bindPara" :fileData="getFileData(col)" :from="'form'"
|
|
166
|
+
:documentHeight="documentHeight" :documentWidth="documentWidth"
|
|
167
|
+
@click="fieldClickHandler(col, $event)" @change="changeHandler(col, $event)"
|
|
168
|
+
@enter="enterHandler(col, $event)" @input="inputHandler(col, $event)"
|
|
169
|
+
@importComplete="importComplete" @blur="blurHandler(col, $event)"
|
|
170
|
+
@popupSearchList="popupSearchListHandler"
|
|
171
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
172
|
+
@popupLocation="popupLocationHandler" @tableButtonClick="clickHandler"></component>
|
|
173
|
+
</el-col>
|
|
174
|
+
</template>
|
|
175
|
+
<template v-else>
|
|
176
|
+
<el-col :key="index" :span="col.colspan" v-if="col.show !== false" style="padding:5px">
|
|
177
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model"
|
|
178
|
+
v-bind="col.bindPara" :fileData="getFileData(col)" :from="'form'"
|
|
179
|
+
:documentHeight="documentHeight" :documentWidth="documentWidth"
|
|
180
|
+
@click="fieldClickHandler(col, $event)" @change="changeHandler(col, $event)"
|
|
181
|
+
@enter="enterHandler(col, $event)" @input="inputHandler(col, $event)"
|
|
182
|
+
@importComplete="importComplete" @blur="blurHandler(col, $event)"
|
|
183
|
+
@popupSearchList="popupSearchListHandler"
|
|
184
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
185
|
+
@popupLocation="popupLocationHandler" @tableButtonClick="clickHandler"></component>
|
|
186
|
+
</el-col>
|
|
187
|
+
</template>
|
|
188
|
+
</template>
|
|
189
|
+
</el-row>
|
|
190
|
+
</el-collapse-item>
|
|
191
|
+
</el-collapse>
|
|
192
|
+
|
|
193
|
+
<template v-if="!model.flagFixedTabOnHorizontalLayout">
|
|
194
|
+
<!--尾部元素-->
|
|
195
|
+
<el-row ref="independentRef" v-if="independentItem.length > 0" style="margin-top: 20px;">
|
|
196
|
+
<template v-for="(col, index) in independentItem">
|
|
197
|
+
<template v-if="col.show !== false && col.lineFeed">
|
|
198
|
+
<div style="display: flex; flex: 0 0 100%;"></div>
|
|
199
|
+
<el-col :key="index" v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
200
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model"
|
|
201
|
+
v-bind="col.bindPara" :fileData="getFileData(col)" :from="'form'"
|
|
202
|
+
:documentHeight="documentHeight" :documentWidth="documentWidth"
|
|
203
|
+
@click="fieldClickHandler(col, $event)" @change="changeHandler(col, $event)"
|
|
204
|
+
@enter="enterHandler(col, $event)" @input="inputHandler(col, $event)"
|
|
205
|
+
@importComplete="importComplete" @blur="blurHandler(col, $event)"
|
|
206
|
+
@popupSearchList="popupSearchListHandler"
|
|
207
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
208
|
+
@popupLocation="popupLocationHandler" @tableButtonClick="clickHandler"></component>
|
|
209
|
+
</el-col>
|
|
210
|
+
</template>
|
|
211
|
+
<template v-else>
|
|
212
|
+
<el-col :key="index" v-if="col.show !== false" :span="col.colspan" style="padding:5px">
|
|
213
|
+
<component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model"
|
|
214
|
+
v-bind="col.bindPara" :fileData="getFileData(col)" :from="'form'"
|
|
215
|
+
:documentHeight="documentHeight" :documentWidth="documentWidth"
|
|
216
|
+
@click="fieldClickHandler(col, $event)" @change="changeHandler(col, $event)"
|
|
217
|
+
@enter="enterHandler(col, $event)" @input="inputHandler(col, $event)"
|
|
218
|
+
@importComplete="importComplete" @blur="blurHandler(col, $event)"
|
|
219
|
+
@popupSearchList="popupSearchListHandler"
|
|
220
|
+
@flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
|
|
221
|
+
@popupLocation="popupLocationHandler" @tableButtonClick="clickHandler"></component>
|
|
222
|
+
</el-col>
|
|
223
|
+
</template>
|
|
224
|
+
</template>
|
|
225
|
+
</el-row>
|
|
226
|
+
<el-row ref="linksRef" v-if="model.links.findIndex((v) => { return v.show }) > -1"
|
|
227
|
+
style="margin-top: 8px;">
|
|
228
|
+
<el-col :span="24" style="text-align:left">
|
|
229
|
+
<component v-for="(btn, index) in model.links" :key="index" :is="btn.is" :vmodel="btn"
|
|
230
|
+
@click="clickHandler" v-if="btn.show"></component>
|
|
193
231
|
</el-col>
|
|
194
|
-
</
|
|
232
|
+
</el-row>
|
|
195
233
|
</template>
|
|
196
|
-
</
|
|
197
|
-
<el-row ref="linksRef" v-if="model.links.findIndex((v)=>{return v.show}) > -1" style="margin-top: 8px;">
|
|
198
|
-
<el-col :span="24" style="text-align:left">
|
|
199
|
-
<component v-for="(btn, index) in model.links" :key="index" :is="btn.is" :vmodel="btn" @click="clickHandler" v-if="btn.show"></component>
|
|
200
|
-
</el-col>
|
|
201
|
-
</el-row>
|
|
202
|
-
</template>
|
|
203
|
-
</component>
|
|
234
|
+
</component>
|
|
204
235
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
:
|
|
217
|
-
|
|
236
|
+
<div
|
|
237
|
+
v-if="model.bottomTip || (model.buttons.length > 0 && model.buttons.findIndex((v) => { return v.show }) > -1)"
|
|
238
|
+
:style="{ 'height': (model.bottomTip ? 34 : 0) + (model.buttons.length > 0 && model.buttons.findIndex((v) => { return v.show }) > -1 ? 34 : 0) + 'px' }">
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
<div ref="bottomTipRef" v-if="model && !loading && model.bottomTip"
|
|
242
|
+
:class="(model.buttons.length > 0 && model.buttons.findIndex((v) => { return v.show }) > -1 ? 'tip-bottom-absolute40' : 'tip-bottom-absolute')">
|
|
243
|
+
<span v-html="model.bottomTip"></span>
|
|
244
|
+
</div>
|
|
245
|
+
<div ref="buttonsRef"
|
|
246
|
+
v-if="model && !loading && model.buttons.length > 0 && model.buttons.findIndex((v) => { return v.show }) > -1"
|
|
247
|
+
:class="isScroll ? 'ccai button-absolute' : 'button-absolute'"
|
|
248
|
+
:style="{
|
|
249
|
+
'max-width': leftContainerWidth && showViewerFile ? (leftContainerWidth -4) + 'px' : pageWidth ? (pageWidth - 20) + 'px' : '100%',
|
|
250
|
+
'right': showViewerFile ? 'auto' : '0px'
|
|
251
|
+
}">
|
|
252
|
+
<el-col :span="24"
|
|
253
|
+
style="display: flex;align-items: center;justify-content: center;height: 40px ;padding-bottom: 1px;padding-left: 5px;padding-right: 5px;"
|
|
254
|
+
class="btnPadBom">
|
|
255
|
+
<component v-for="(btn, index) in model.buttons" :key="index" :is="btn.is" :vmodel="btn"
|
|
256
|
+
@click="clickHandler" v-if="btn.show" :style="{ 'float': btn.isCheckbox ? btn.alignCss : '' }">
|
|
257
|
+
</component>
|
|
258
|
+
</el-col>
|
|
259
|
+
</div>
|
|
260
|
+
</div>
|
|
261
|
+
<div
|
|
262
|
+
:style="{ flex: ' 0 0 ' + 650 + 'px', position: 'sticky', top: '0', 'box-shadow': '-10px 0 5px -9px rgba(0, 0, 0, 0.3)' }"
|
|
263
|
+
v-if="showViewerFile">
|
|
264
|
+
<div
|
|
265
|
+
:style="{ position: 'sticky', top: '0', height: dialogHeight + 'px', overflow: 'hidden', 'border-bottom-right-radius': '4px' }">
|
|
266
|
+
<viewer-file :MediaAlbum="media.MediaAlbum" :groupIndex="media.groupIndex" :index="media.index"
|
|
267
|
+
:key="media.random" :flagLeft="media.flagLeft" @closeViewerFile="ViewerFileToggle(false)"
|
|
268
|
+
@ViewerFilechangeIndex="ViewerFilechangeIndex">
|
|
269
|
+
</viewer-file>
|
|
270
|
+
|
|
271
|
+
</div>
|
|
272
|
+
</div>
|
|
218
273
|
</div>
|
|
274
|
+
|
|
219
275
|
<div style="min-height:200px" v-if="loading"></div>
|
|
220
276
|
<iframe :src="downloadUrl" style="height:0px;width:0px;border-width: 0px;display: none;"> </iframe>
|
|
221
277
|
</div>
|
|
222
278
|
</template>
|
|
223
279
|
<script>
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
280
|
+
import dynamicElement from '../../mixins/dynamicElement'
|
|
281
|
+
import dynamicFormListTalbe from './dynamicFormListTable'
|
|
282
|
+
import dynamicViewerFile from '../../dynamicViewerFile/src/dynamicViewerFile.vue'
|
|
283
|
+
|
|
284
|
+
import { setTimeout } from 'timers';
|
|
285
|
+
export default {
|
|
286
|
+
name: 'ct-form',
|
|
287
|
+
mixins: [dynamicElement],
|
|
288
|
+
components: {
|
|
289
|
+
'ct-form-list-table': dynamicFormListTalbe,
|
|
290
|
+
'viewer-file': dynamicViewerFile
|
|
291
|
+
},
|
|
292
|
+
provide() {
|
|
293
|
+
return {
|
|
294
|
+
// 传递一个方法
|
|
295
|
+
ViewerFileToggle: this.ViewerFileToggle,
|
|
296
|
+
ChangeFileList: this.ChangeFileList
|
|
297
|
+
}
|
|
298
|
+
},
|
|
299
|
+
props: {
|
|
300
|
+
api: String,
|
|
301
|
+
vmodel: Object,
|
|
302
|
+
source: Object,
|
|
303
|
+
apiParam: Object,
|
|
304
|
+
parentModel: Object,
|
|
305
|
+
parentModelForm: Object,
|
|
306
|
+
pageWidth: Number,
|
|
307
|
+
topHeight: {
|
|
308
|
+
type: Number,
|
|
309
|
+
default: -1
|
|
232
310
|
},
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
source: Object,
|
|
237
|
-
apiParam: Object,
|
|
238
|
-
parentModel: Object,
|
|
239
|
-
parentModelForm: Object,
|
|
240
|
-
pageWidth: Number,
|
|
241
|
-
topHeight: {
|
|
242
|
-
type: Number,
|
|
243
|
-
default: -1
|
|
244
|
-
},
|
|
245
|
-
showTitle: {
|
|
246
|
-
type: Boolean,
|
|
247
|
-
default: false
|
|
248
|
-
},
|
|
249
|
-
documentHeight: {
|
|
250
|
-
String,
|
|
251
|
-
default: 'auto',
|
|
252
|
-
},
|
|
253
|
-
documentWidth: {
|
|
254
|
-
String,
|
|
255
|
-
default: 'auto',
|
|
256
|
-
},
|
|
257
|
-
flagScroll: {
|
|
258
|
-
Boolean,
|
|
259
|
-
default: false,
|
|
260
|
-
},
|
|
261
|
-
drowerClose:{
|
|
262
|
-
String,
|
|
263
|
-
default: 'close',
|
|
264
|
-
},
|
|
265
|
-
openType:{
|
|
266
|
-
String,
|
|
267
|
-
default: '',
|
|
268
|
-
},
|
|
269
|
-
isIframe: {
|
|
270
|
-
Boolean,
|
|
271
|
-
default: false,
|
|
272
|
-
},
|
|
273
|
-
relationParentFormFields: {
|
|
274
|
-
Array,
|
|
275
|
-
default: function () {
|
|
276
|
-
return [];
|
|
277
|
-
},
|
|
278
|
-
},
|
|
311
|
+
showTitle: {
|
|
312
|
+
type: Boolean,
|
|
313
|
+
default: false
|
|
279
314
|
},
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
loading: true,
|
|
284
|
-
activeName: '-1',
|
|
285
|
-
formKey: 0,
|
|
286
|
-
collapse: [],//分组数组
|
|
287
|
-
collapseActiveNames: [],//默认展开的分组name
|
|
288
|
-
collapseFieldsRow: [],//分组数组对应的行列布局
|
|
289
|
-
independentItem: [],//最后一个独立分组的行列布局
|
|
290
|
-
minHeight: 'auto',
|
|
291
|
-
downloadUrl:"",
|
|
292
|
-
tipWidth:0,
|
|
293
|
-
};
|
|
315
|
+
documentHeight: {
|
|
316
|
+
String,
|
|
317
|
+
default: 'auto',
|
|
294
318
|
},
|
|
295
|
-
|
|
296
|
-
|
|
319
|
+
documentWidth: {
|
|
320
|
+
String,
|
|
321
|
+
default: 'auto',
|
|
297
322
|
},
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
this.$nextTick(() => {
|
|
302
|
-
this.tipWidth=this.$el.clientWidth;
|
|
303
|
-
})
|
|
323
|
+
flagScroll: {
|
|
324
|
+
Boolean,
|
|
325
|
+
default: false,
|
|
304
326
|
},
|
|
305
|
-
|
|
306
|
-
|
|
327
|
+
drowerClose: {
|
|
328
|
+
String,
|
|
329
|
+
default: 'close',
|
|
307
330
|
},
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
331
|
+
openType: {
|
|
332
|
+
String,
|
|
333
|
+
default: '',
|
|
334
|
+
},
|
|
335
|
+
isIframe: {
|
|
336
|
+
Boolean,
|
|
337
|
+
default: false,
|
|
338
|
+
},
|
|
339
|
+
relationParentFormFields: {
|
|
340
|
+
Array,
|
|
341
|
+
default: function () {
|
|
342
|
+
return [];
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
},
|
|
346
|
+
data() {
|
|
347
|
+
return {
|
|
348
|
+
isScroll: false,
|
|
349
|
+
loading: true,
|
|
350
|
+
activeName: '-1',
|
|
351
|
+
formKey: 0,
|
|
352
|
+
collapse: [],//分组数组
|
|
353
|
+
collapseActiveNames: [],//默认展开的分组name
|
|
354
|
+
collapseFieldsRow: [],//分组数组对应的行列布局
|
|
355
|
+
independentItem: [],//最后一个独立分组的行列布局
|
|
356
|
+
minHeight: 'auto',
|
|
357
|
+
downloadUrl: "",
|
|
358
|
+
tipWidth: 0,
|
|
359
|
+
dialogHeight: (window.innerHeight - 60),
|
|
360
|
+
showViewerFile: false,
|
|
361
|
+
leftContainerWidth: 0,
|
|
362
|
+
media: {
|
|
363
|
+
MediaAlbum: [],
|
|
364
|
+
groupIndex: 0,
|
|
365
|
+
index: 0,
|
|
366
|
+
flagLeft: false,
|
|
367
|
+
random: Math.random()
|
|
319
368
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
369
|
+
};
|
|
370
|
+
},
|
|
371
|
+
deactivated() {
|
|
372
|
+
this.downloadUrl = "";
|
|
373
|
+
},
|
|
374
|
+
mounted() {
|
|
375
|
+
this.init();
|
|
376
|
+
this.setCss();
|
|
377
|
+
this.$nextTick(() => {
|
|
378
|
+
this.tipWidth = this.$el.clientWidth;
|
|
379
|
+
})
|
|
380
|
+
},
|
|
381
|
+
updated() {
|
|
382
|
+
this.computeScroll();
|
|
383
|
+
},
|
|
384
|
+
destroyed() {
|
|
385
|
+
this.$off();
|
|
386
|
+
if (this.timeoutHandle) {
|
|
387
|
+
clearTimeout(this.timeoutHandle)
|
|
388
|
+
}
|
|
389
|
+
if (this.$el.parentNode) this.$el.parentNode.removeChild(this.$el);
|
|
390
|
+
if (this.model && typeof this.model.scripts !== 'undefined') {
|
|
391
|
+
this.model.scripts.formData.form = null;
|
|
392
|
+
this.model.scripts.formData.excuteData = null;
|
|
393
|
+
this.model.scripts.formData.fieldsDic = null;
|
|
394
|
+
this.model.scripts.formData = null;
|
|
395
|
+
}
|
|
396
|
+
this.collapse = [];
|
|
397
|
+
this.collapseActiveNames = [];
|
|
398
|
+
this.collapseFieldsRow = [];
|
|
399
|
+
this.independentItem = [];
|
|
400
|
+
this.isHorizontalLayout = false;
|
|
401
|
+
if (this.model) {
|
|
402
|
+
this.model.links = null;
|
|
403
|
+
this.model.buttons = null;
|
|
404
|
+
}
|
|
405
|
+
this.model = null;
|
|
406
|
+
this.$el = null;
|
|
407
|
+
},
|
|
408
|
+
watch: {
|
|
409
|
+
showViewerFile() {
|
|
410
|
+
this.$nextTick(() => {
|
|
411
|
+
this.updateLeftWidth();
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
methods: {
|
|
416
|
+
updateLeftWidth() {
|
|
417
|
+
if (this.$refs.leftContainerRef) {
|
|
418
|
+
this.leftContainerWidth = this.$refs.leftContainerRef.clientWidth;
|
|
328
419
|
}
|
|
329
|
-
this.model = null;
|
|
330
|
-
this.$el = null;
|
|
331
420
|
},
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
this.$
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
if (parentDom && parentDom.scrollHeight > parentDom.clientHeight
|
|
421
|
+
computeScroll() {
|
|
422
|
+
this.$nextTick(() => {
|
|
423
|
+
if (this.$el) {
|
|
424
|
+
let parentDom = this.$el.parentElement;
|
|
425
|
+
if (parentDom && parentDom.scrollHeight > parentDom.clientHeight
|
|
338
426
|
&& this.model && (!this.model.isHorizontalLayout || this.flagScroll)) {
|
|
339
|
-
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
|
-
},
|
|
344
|
-
init() {
|
|
345
|
-
var self = this;
|
|
346
|
-
//初始化
|
|
347
|
-
this.loading = true;
|
|
348
|
-
this.collapse.splice(0, this.collapse.length);
|
|
349
|
-
this.collapseActiveNames.splice(0, this.collapseActiveNames.length);
|
|
350
|
-
this.collapseFieldsRow.splice(0, this.collapseFieldsRow.length);
|
|
351
|
-
this.independentItem.splice(0, this.independentItem.length);
|
|
352
|
-
|
|
353
|
-
this.$nextTick(function () {
|
|
354
|
-
if(this.drowerClose && this.drowerClose=='open'){
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
if (typeof self.api !== 'undefined') {
|
|
358
|
-
self.loaderObj.Form(self.api, self.load, this.apiParam, self.failLoad);
|
|
427
|
+
this.isScroll = true;
|
|
359
428
|
}
|
|
360
|
-
else if (typeof self.source !== 'undefined') {
|
|
361
|
-
self.load(self.loaderObj.Form(self.source));
|
|
362
|
-
}
|
|
363
|
-
else if (self.vmodel) {
|
|
364
|
-
self.load(self.vmodel);
|
|
365
|
-
}
|
|
366
|
-
});
|
|
367
|
-
},
|
|
368
|
-
failLoad() {
|
|
369
|
-
this.$emit('failLoad', this.model);
|
|
370
|
-
},
|
|
371
|
-
load(data) {
|
|
372
|
-
var self = this;
|
|
373
|
-
this.$set(this, 'model', data);
|
|
374
|
-
this.model.self = this;
|
|
375
|
-
if (typeof this.model.scripts !== 'undefined') {
|
|
376
|
-
this.model.scripts.formData = this.model.formData;
|
|
377
|
-
this.model.scripts.formData.form = this.model;
|
|
378
|
-
this.model.scripts.formData.excuteData = this.model.fields;
|
|
379
|
-
this.model.scripts.formData.fieldsDic = this.model.fieldsDic;
|
|
380
429
|
}
|
|
381
|
-
|
|
382
|
-
|
|
430
|
+
});
|
|
431
|
+
},
|
|
432
|
+
init() {
|
|
433
|
+
var self = this;
|
|
434
|
+
//初始化
|
|
435
|
+
this.loading = true;
|
|
436
|
+
this.collapse.splice(0, this.collapse.length);
|
|
437
|
+
this.collapseActiveNames.splice(0, this.collapseActiveNames.length);
|
|
438
|
+
this.collapseFieldsRow.splice(0, this.collapseFieldsRow.length);
|
|
439
|
+
this.independentItem.splice(0, this.independentItem.length);
|
|
383
440
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
441
|
+
this.$nextTick(function () {
|
|
442
|
+
if (this.drowerClose && this.drowerClose == 'open') {
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
if (typeof self.api !== 'undefined') {
|
|
446
|
+
self.loaderObj.Form(self.api, self.load, this.apiParam, self.failLoad);
|
|
447
|
+
}
|
|
448
|
+
else if (typeof self.source !== 'undefined') {
|
|
449
|
+
self.load(self.loaderObj.Form(self.source));
|
|
450
|
+
}
|
|
451
|
+
else if (self.vmodel) {
|
|
452
|
+
self.load(self.vmodel);
|
|
389
453
|
}
|
|
454
|
+
});
|
|
455
|
+
},
|
|
456
|
+
failLoad() {
|
|
457
|
+
this.$emit('failLoad', this.model);
|
|
458
|
+
},
|
|
459
|
+
load(data) {
|
|
460
|
+
var self = this;
|
|
461
|
+
this.$set(this, 'model', data);
|
|
462
|
+
this.model.self = this;
|
|
463
|
+
if (typeof this.model.scripts !== 'undefined') {
|
|
464
|
+
this.model.scripts.formData = this.model.formData;
|
|
465
|
+
this.model.scripts.formData.form = this.model;
|
|
466
|
+
this.model.scripts.formData.excuteData = this.model.fields;
|
|
467
|
+
this.model.scripts.formData.fieldsDic = this.model.fieldsDic;
|
|
468
|
+
}
|
|
469
|
+
this.loadFields();
|
|
470
|
+
this.loadTabs();
|
|
390
471
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
472
|
+
if (this.model.onload) {
|
|
473
|
+
let onloads = this.model.onload.split(';');
|
|
474
|
+
onloads.forEach((v, index) => {
|
|
475
|
+
self.$common.excute.call(self.model.scripts, v);
|
|
476
|
+
});
|
|
477
|
+
}
|
|
397
478
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
if (v.is === 'ct-independentGroup') {
|
|
405
|
-
isIndependent = true;
|
|
406
|
-
return true; //continue
|
|
407
|
-
}
|
|
408
|
-
if (isIndependent) {
|
|
409
|
-
this.independentItem.push(v);
|
|
410
|
-
}
|
|
411
|
-
else if (v.is === 'ct-group' || v.is === 'ct-repeat') {
|
|
479
|
+
this.loading = false;
|
|
480
|
+
//通知父组件加载完成
|
|
481
|
+
this.$emit('loaded', this.model);
|
|
482
|
+
},
|
|
483
|
+
loadFields() {
|
|
484
|
+
var self = this;
|
|
412
485
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
486
|
+
var collapseItemArr = [];//分组对应元素二维数组
|
|
487
|
+
var collapseItem = [];//分组对应元素数组
|
|
488
|
+
let realCollapseActiveNames = [];//真实的默认展开的分组name
|
|
489
|
+
let isIndependent = false;
|
|
490
|
+
self.model.fields.forEach((v, index) => {
|
|
491
|
+
v.index = index;
|
|
492
|
+
if (v.is === 'ct-independentGroup') {
|
|
493
|
+
isIndependent = true;
|
|
494
|
+
return true; //continue
|
|
495
|
+
}
|
|
496
|
+
if (isIndependent) {
|
|
497
|
+
this.independentItem.push(v);
|
|
498
|
+
}
|
|
499
|
+
else if (v.is === 'ct-group' || v.is === 'ct-repeat') {
|
|
421
500
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
}
|
|
426
|
-
else {
|
|
427
|
-
v.collapseName = collapseItemArr.length - 1;
|
|
428
|
-
collapseItem.push(v);
|
|
501
|
+
self.collapse.push(v);
|
|
502
|
+
if (v.isExpand && self.activeName == '-1') {
|
|
503
|
+
self.activeName = (self.collapse.length - 1).toString();
|
|
429
504
|
}
|
|
430
|
-
if (v.
|
|
431
|
-
|
|
432
|
-
collapseItem.push(v);
|
|
505
|
+
if (v.lock || v.isExpand) {
|
|
506
|
+
realCollapseActiveNames.push(self.collapse.length - 1);
|
|
433
507
|
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
if (collapseItem.length > 0) {
|
|
508
|
+
self.collapseActiveNames.push(self.collapse.length - 1);
|
|
509
|
+
|
|
437
510
|
collapseItemArr.push(collapseItem);
|
|
511
|
+
v.collapseName = collapseItemArr.length - 1;
|
|
512
|
+
collapseItem = [];
|
|
513
|
+
}
|
|
514
|
+
else {
|
|
515
|
+
v.collapseName = collapseItemArr.length - 1;
|
|
516
|
+
collapseItem.push(v);
|
|
517
|
+
}
|
|
518
|
+
if (v.is === 'ct-repeat') {
|
|
519
|
+
v.collapseName = collapseItemArr.length - 1;
|
|
520
|
+
collapseItem.push(v);
|
|
438
521
|
}
|
|
522
|
+
});
|
|
523
|
+
if (self.activeName === '-1') self.activeName = '0';
|
|
524
|
+
if (collapseItem.length > 0) {
|
|
525
|
+
collapseItemArr.push(collapseItem);
|
|
526
|
+
}
|
|
439
527
|
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
528
|
+
//遍历分组里的组件,计算行列布局
|
|
529
|
+
for (var i = 0; i < collapseItemArr.length; i++) {
|
|
530
|
+
var myFilter = collapseItemArr[i];
|
|
443
531
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
532
|
+
self.collapseFieldsRow.push(myFilter);
|
|
533
|
+
}
|
|
534
|
+
//因有一些子组件需要计算宽度及高度,故要先全部展开在缩起来
|
|
535
|
+
//也可采用方案二:子组件中,找不到高度,产生一个定时器,找到为止
|
|
536
|
+
//方案三:在显示分组时,主动触发resize方法
|
|
537
|
+
self.$nextTick(() => {
|
|
538
|
+
self.$set(self, 'collapseActiveNames', realCollapseActiveNames);
|
|
539
|
+
});
|
|
452
540
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
541
|
+
//联动组件处理 todo:去掉,使用form方式
|
|
542
|
+
var hasParent = self.model.fields.filter((v) => {
|
|
543
|
+
return typeof v.parentName !== 'undefined';
|
|
544
|
+
});
|
|
545
|
+
hasParent.forEach((v, index) => {
|
|
546
|
+
var parent = self.model.fields.find((v1) => {
|
|
547
|
+
return v1.id === v.parentName;
|
|
456
548
|
});
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
let h6 = this.$refs.bottomTipRef ? this.$refs.bottomTipRef.offsetHeight : 0;
|
|
477
|
-
let h7 = this.$refs.topTipRef ? this.$refs.topTipRef.offsetHeight : 0;
|
|
478
|
-
if(h5===0 && h6===0){
|
|
479
|
-
h1=h1-5;
|
|
480
|
-
}
|
|
481
|
-
let tabHeight = h1 - h2 - h5 - h6 - h7;
|
|
482
|
-
this.$refs.tabsRef.$el.children[1].style.height = tabHeight + 'px';
|
|
483
|
-
this.$refs.tabsRef.$el.children[1].style.overflow = 'auto';
|
|
549
|
+
if (parent) {
|
|
550
|
+
parent.child = parent.child ? parent.child : [];
|
|
551
|
+
parent.child.push(v);
|
|
552
|
+
v.parent = parent;
|
|
553
|
+
}
|
|
554
|
+
});
|
|
555
|
+
},
|
|
556
|
+
loadTabs() {
|
|
557
|
+
this.$nextTick(function () {
|
|
558
|
+
if (this.model.flagFixedTabOnHorizontalLayout && this.model.isHorizontalLayout && this.collapse.length > 0) {
|
|
559
|
+
let h1 = this.$refs.formRef.parentElement.offsetHeight - 10 | 0;
|
|
560
|
+
let h2 = this.$refs.tabsRef.$el.children[1].offsetTop + 15 | 0;
|
|
561
|
+
let h3 = this.$refs.independentRef ? this.$refs.independentRef.$el.offsetHeight + 20 : 0;
|
|
562
|
+
let h4 = this.$refs.linksRef ? this.$refs.linksRef.$el.offsetHeight : 0;
|
|
563
|
+
let h5 = this.$refs.buttonsRef ? this.$refs.buttonsRef.children[0].offsetHeight : 0;
|
|
564
|
+
let h6 = this.$refs.bottomTipRef ? this.$refs.bottomTipRef.offsetHeight : 0;
|
|
565
|
+
let h7 = this.$refs.topTipRef ? this.$refs.topTipRef.offsetHeight : 0;
|
|
566
|
+
if (h5 === 0 && h6 === 0) {
|
|
567
|
+
h1 = h1 - 5;
|
|
484
568
|
}
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
569
|
+
let tabHeight = h1 - h2 - h5 - h6 - h7;
|
|
570
|
+
this.$refs.tabsRef.$el.children[1].style.height = tabHeight + 'px';
|
|
571
|
+
this.$refs.tabsRef.$el.children[1].style.overflow = 'auto';
|
|
572
|
+
}
|
|
573
|
+
else {
|
|
574
|
+
if (this.$refs.formRef && (!this.model.isHorizontalLayout || this.flagScroll)) {
|
|
575
|
+
let h1 = this.$refs.formRef.parentElement.offsetHeight;
|
|
576
|
+
// let h5 = this.$refs.buttonsRef ? this.$refs.buttonsRef.children[0].offsetHeight : 0;
|
|
577
|
+
// let h6 = this.$refs.bottomTipRef ? this.$refs.bottomTipRef.offsetHeight : 0;
|
|
578
|
+
// let h7 = this.$refs.topTipRef ? this.$refs.topTipRef.offsetHeight : 0;
|
|
579
|
+
// let fieldsHeight = h1 - h5 - h6 - h7;
|
|
580
|
+
// this.$refs.fieldsRef.style.height = fieldsHeight + 'px';
|
|
581
|
+
this.minHeight = h1 + 'px';
|
|
495
582
|
}
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
583
|
+
}
|
|
584
|
+
})
|
|
585
|
+
},
|
|
586
|
+
fieldClickHandler(field) {
|
|
587
|
+
let submitData = null;
|
|
588
|
+
var router = this.model.buttons.find((v) => {
|
|
589
|
+
return v.id === field.id;
|
|
590
|
+
});
|
|
591
|
+
if (router == undefined) {
|
|
592
|
+
router = this.model.links.find((v) => {
|
|
501
593
|
return v.id === field.id;
|
|
502
594
|
});
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
clickHandler(field, submitData) {
|
|
522
|
-
var self = this;
|
|
523
|
-
this.model.scripts.$fd = field.id;
|
|
524
|
-
this.model.scripts.$result = [];
|
|
595
|
+
}
|
|
596
|
+
if (router == undefined) {
|
|
597
|
+
router = this.model.actionRouters.find((v) => {
|
|
598
|
+
return v.id === field.id;
|
|
599
|
+
});
|
|
600
|
+
}
|
|
601
|
+
if (router && field.isSubmitDataFromSelf) {
|
|
602
|
+
submitData = {};
|
|
603
|
+
router.submitFormField.forEach((v) => {
|
|
604
|
+
submitData[v] = field.list[field.listIndex].code;
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
this.clickHandler(router, submitData);
|
|
608
|
+
},
|
|
609
|
+
clickHandler(field, submitData) {
|
|
610
|
+
var self = this;
|
|
611
|
+
this.model.scripts.$fd = field.id;
|
|
612
|
+
this.model.scripts.$result = [];
|
|
525
613
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
614
|
+
var clickAcion = function (field) {
|
|
615
|
+
//若不是客户端方法,则直接访问接口
|
|
616
|
+
if (!field.isClientFuntion) {
|
|
617
|
+
let verified = true;
|
|
618
|
+
if (field.isSubmit) {
|
|
619
|
+
if (field.flagVerifyData) {
|
|
620
|
+
verified = self.validExcute();
|
|
621
|
+
}
|
|
622
|
+
if (verified) {
|
|
534
623
|
if (verified) {
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
self.model.pageDisabled = true;
|
|
624
|
+
//action有值,提交到后台
|
|
625
|
+
if (field.action) {
|
|
626
|
+
field.disabled = true;//提交按钮禁用
|
|
627
|
+
self.model.pageDisabled = true;
|
|
540
628
|
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
}
|
|
565
|
-
else{
|
|
566
|
-
if (data.content.indexOf("?") > -1) {
|
|
567
|
-
self.downloadUrl = data.content + "&" + Math.random();
|
|
568
|
-
}
|
|
569
|
-
else {
|
|
570
|
-
self.downloadUrl = data.content + "?" + Math.random();
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
if (data.rtnMsg) {
|
|
575
|
-
self.$message({
|
|
576
|
-
message: data.rtnMsg,
|
|
577
|
-
type: 'success',
|
|
578
|
-
showClose:true,
|
|
579
|
-
});
|
|
629
|
+
if (field.flagAsync) {
|
|
630
|
+
field.doAction(self.getFormObj(), (res) => {
|
|
631
|
+
if (res.rtnCode === 200) {
|
|
632
|
+
if (res.content && res.content.action) {
|
|
633
|
+
var dialogOption = {
|
|
634
|
+
title: field.pageTitle || field.label,
|
|
635
|
+
content: [{
|
|
636
|
+
component: 'ct-progress',
|
|
637
|
+
attrs: {
|
|
638
|
+
progressAction: res.content.action,
|
|
639
|
+
progressKey: res.content.key,
|
|
640
|
+
progressType: field.isExport ? 'export' : 'import',
|
|
641
|
+
width: '350px',
|
|
642
|
+
height: '185px'
|
|
643
|
+
},
|
|
644
|
+
on: {
|
|
645
|
+
finished(data) {
|
|
646
|
+
field.disabled = false;
|
|
647
|
+
self.model.pageDisabled = false;
|
|
648
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
649
|
+
if (field.isExport) {
|
|
650
|
+
if (data.content.indexOf(".zip") > -1) {
|
|
651
|
+
window.location.href = encodeURI(data.content);
|
|
580
652
|
}
|
|
581
|
-
|
|
582
|
-
if(
|
|
583
|
-
|
|
653
|
+
else {
|
|
654
|
+
if (data.content.indexOf("?") > -1) {
|
|
655
|
+
self.downloadUrl = data.content + "&" + Math.random();
|
|
584
656
|
}
|
|
585
|
-
else{
|
|
586
|
-
self.
|
|
657
|
+
else {
|
|
658
|
+
self.downloadUrl = data.content + "?" + Math.random();
|
|
587
659
|
}
|
|
588
660
|
}
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
error(data) {
|
|
592
|
-
field.disabled = false;
|
|
593
|
-
self.model.pageDisabled = false;
|
|
594
|
-
self.$common.closeDialog(dialogOption.dialog);
|
|
661
|
+
}
|
|
662
|
+
if (data.rtnMsg) {
|
|
595
663
|
self.$message({
|
|
596
664
|
message: data.rtnMsg,
|
|
597
|
-
type: '
|
|
598
|
-
showClose:true,
|
|
665
|
+
type: 'success',
|
|
666
|
+
showClose: true,
|
|
599
667
|
});
|
|
600
668
|
}
|
|
669
|
+
if (data.notification === 17) {
|
|
670
|
+
if (self.$common.dialogList && self.$common.dialogList.List.length > 0
|
|
671
|
+
&& (data.content.pageStyle === 1 || data.content.pageStyle === 3)) {
|
|
672
|
+
}
|
|
673
|
+
else {
|
|
674
|
+
self.clickHandler(self.model.getRtnRouter(data.content), null)
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
self.$emit('submit', { formData: self.model, responseData: data });
|
|
678
|
+
},
|
|
679
|
+
error(data) {
|
|
680
|
+
field.disabled = false;
|
|
681
|
+
self.model.pageDisabled = false;
|
|
682
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
683
|
+
self.$message({
|
|
684
|
+
message: data.rtnMsg,
|
|
685
|
+
type: 'warning',
|
|
686
|
+
showClose: true,
|
|
687
|
+
});
|
|
601
688
|
}
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
|
|
689
|
+
}
|
|
690
|
+
}]
|
|
691
|
+
};
|
|
692
|
+
self.$common.openDialog(dialogOption);
|
|
606
693
|
}
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
else{
|
|
637
|
-
if (data.content.indexOf("?") > -1) {
|
|
638
|
-
self.downloadUrl = data.content + "&" + Math.random();
|
|
639
|
-
}
|
|
640
|
-
else {
|
|
641
|
-
self.downloadUrl = data.content + "?" + Math.random();
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
if (data.rtnMsg) {
|
|
646
|
-
self.$message({
|
|
647
|
-
message: data.rtnMsg,
|
|
648
|
-
type: 'success',
|
|
649
|
-
showClose:true,
|
|
650
|
-
});
|
|
694
|
+
}
|
|
695
|
+
else if (res.rtnCode === 202) {
|
|
696
|
+
self.$common.confirm(res.rtnMsg, '提示', {
|
|
697
|
+
confirmButtonText: '确定',
|
|
698
|
+
cancelButtonText: '取消',
|
|
699
|
+
type: 'warning'
|
|
700
|
+
}).then(() => {
|
|
701
|
+
field.doAction(self.getFormObj({ flagHaveAlert: '1' }), (res202) => {
|
|
702
|
+
if (res202.rtnCode === 200) {
|
|
703
|
+
if (res202.content && res202.content.action) {
|
|
704
|
+
var dialogOption = {
|
|
705
|
+
title: field.pageTitle || field.label,
|
|
706
|
+
content: [{
|
|
707
|
+
component: 'ct-progress',
|
|
708
|
+
attrs: {
|
|
709
|
+
progressAction: res202.content.action,
|
|
710
|
+
progressKey: res202.content.key,
|
|
711
|
+
progressType: field.isExport ? 'export' : 'import',
|
|
712
|
+
width: '350px',
|
|
713
|
+
height: '185px'
|
|
714
|
+
},
|
|
715
|
+
on: {
|
|
716
|
+
finished(data) {
|
|
717
|
+
field.disabled = false;
|
|
718
|
+
self.model.pageDisabled = false;
|
|
719
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
720
|
+
if (field.isExport) {
|
|
721
|
+
if (data.content.indexOf(".zip") > -1) {
|
|
722
|
+
window.location.href = encodeURI(data.content);
|
|
651
723
|
}
|
|
652
|
-
|
|
653
|
-
if(
|
|
654
|
-
|
|
724
|
+
else {
|
|
725
|
+
if (data.content.indexOf("?") > -1) {
|
|
726
|
+
self.downloadUrl = data.content + "&" + Math.random();
|
|
655
727
|
}
|
|
656
|
-
else{
|
|
657
|
-
self.
|
|
728
|
+
else {
|
|
729
|
+
self.downloadUrl = data.content + "?" + Math.random();
|
|
658
730
|
}
|
|
659
731
|
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
error(data) {
|
|
663
|
-
field.disabled = false;
|
|
664
|
-
self.model.pageDisabled = false;
|
|
665
|
-
self.$common.closeDialog(dialogOption.dialog);
|
|
732
|
+
}
|
|
733
|
+
if (data.rtnMsg) {
|
|
666
734
|
self.$message({
|
|
667
735
|
message: data.rtnMsg,
|
|
668
|
-
type: '
|
|
669
|
-
showClose:true,
|
|
736
|
+
type: 'success',
|
|
737
|
+
showClose: true,
|
|
670
738
|
});
|
|
671
739
|
}
|
|
740
|
+
if (data.notification === 17) {
|
|
741
|
+
if (self.$common.dialogList && self.$common.dialogList.List.length > 0
|
|
742
|
+
&& (data.content.pageStyle === 1 || data.content.pageStyle === 3)) {
|
|
743
|
+
}
|
|
744
|
+
else {
|
|
745
|
+
self.clickHandler(self.model.getRtnRouter(data.content), null)
|
|
746
|
+
}
|
|
747
|
+
}
|
|
748
|
+
self.$emit('submit', { formData: self.model, responseData: data });
|
|
749
|
+
},
|
|
750
|
+
error(data) {
|
|
751
|
+
field.disabled = false;
|
|
752
|
+
self.model.pageDisabled = false;
|
|
753
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
754
|
+
self.$message({
|
|
755
|
+
message: data.rtnMsg,
|
|
756
|
+
type: 'warning',
|
|
757
|
+
showClose: true,
|
|
758
|
+
});
|
|
672
759
|
}
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
|
|
760
|
+
}
|
|
761
|
+
}]
|
|
762
|
+
};
|
|
763
|
+
self.$common.openDialog(dialogOption);
|
|
677
764
|
}
|
|
678
|
-
});
|
|
679
|
-
}).catch(() => {
|
|
680
|
-
field.disabled = false;
|
|
681
|
-
self.model.pageDisabled = false;
|
|
682
|
-
});
|
|
683
|
-
}
|
|
684
|
-
});
|
|
685
|
-
}
|
|
686
|
-
else {
|
|
687
|
-
field.doAction(self.getFormObj(), (data) => {
|
|
688
|
-
field.disabled = false;
|
|
689
|
-
self.model.pageDisabled = false;
|
|
690
|
-
if (data.rtnCode === 200) {
|
|
691
|
-
if (data.notification === 17) {
|
|
692
|
-
if(self.$common.dialogList && self.$common.dialogList.List.length > 0
|
|
693
|
-
&& (data.content.pageStyle===1 || data.content.pageStyle===3)){
|
|
694
765
|
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
self.$emit('submit', { formData: self.model, responseData: data });
|
|
712
|
-
},()=>{
|
|
713
|
-
self.$emit('submitCancel', { formData: self.model, responseData: data });
|
|
714
|
-
self.init();
|
|
715
|
-
}).catch(() => {
|
|
716
|
-
self.init();
|
|
717
|
-
});
|
|
766
|
+
});
|
|
767
|
+
}).catch(() => {
|
|
768
|
+
field.disabled = false;
|
|
769
|
+
self.model.pageDisabled = false;
|
|
770
|
+
});
|
|
771
|
+
}
|
|
772
|
+
});
|
|
773
|
+
}
|
|
774
|
+
else {
|
|
775
|
+
field.doAction(self.getFormObj(), (data) => {
|
|
776
|
+
field.disabled = false;
|
|
777
|
+
self.model.pageDisabled = false;
|
|
778
|
+
if (data.rtnCode === 200) {
|
|
779
|
+
if (data.notification === 17) {
|
|
780
|
+
if (self.$common.dialogList && self.$common.dialogList.List.length > 0
|
|
781
|
+
&& (data.content.pageStyle === 1 || data.content.pageStyle === 3)) {
|
|
718
782
|
}
|
|
719
783
|
else {
|
|
720
|
-
|
|
721
|
-
&& field.actionType && field.actionType===2 && data.notification !== 17 && data.notification !== 13
|
|
722
|
-
&& data.notification !== 14 && data.notification !== 15 && data.notification !== 16) {
|
|
723
|
-
if (typeof self.$common.getDataDrivenOpts().handler.closeTab === 'function') {
|
|
724
|
-
self.$common.getDataDrivenOpts().handler.closeTab();
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
self.$emit('submit', { formData: self.model, responseData: data });
|
|
728
|
-
}
|
|
729
|
-
if (self.parentModel) {
|
|
730
|
-
self.parentModel.$vue.closeTabThen(data);
|
|
784
|
+
self.clickHandler(self.model.getRtnRouter(data.content), null)
|
|
731
785
|
}
|
|
732
786
|
}
|
|
733
|
-
|
|
734
|
-
self.$common.confirm(
|
|
787
|
+
if (self.model.flagAlertClose) {
|
|
788
|
+
self.$common.confirm('操作成功,是否关闭本页面?', '提示', {
|
|
735
789
|
confirmButtonText: '确定',
|
|
736
790
|
cancelButtonText: '取消',
|
|
737
791
|
type: 'warning'
|
|
738
792
|
}).then(() => {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
&& (res.content.pageStyle===1 || res.content.pageStyle===3)){
|
|
744
|
-
}
|
|
745
|
-
else{
|
|
746
|
-
self.clickHandler(self.model.getRtnRouter(res.content), null)
|
|
747
|
-
}
|
|
748
|
-
}
|
|
749
|
-
self.$emit('submit', { formData: self.model, responseData: res });
|
|
793
|
+
//如果没有弹框 则关闭tab页
|
|
794
|
+
if (self.$common.dialogList && self.$common.dialogList.List.length === 0) {
|
|
795
|
+
if (typeof self.$common.getDataDrivenOpts().handler.closeTab === 'function') {
|
|
796
|
+
self.$common.getDataDrivenOpts().handler.closeTab();
|
|
750
797
|
}
|
|
751
|
-
}
|
|
798
|
+
}
|
|
799
|
+
self.$emit('submit', { formData: self.model, responseData: data });
|
|
800
|
+
}, () => {
|
|
801
|
+
self.$emit('submitCancel', { formData: self.model, responseData: data });
|
|
802
|
+
self.init();
|
|
752
803
|
}).catch(() => {
|
|
804
|
+
self.init();
|
|
753
805
|
});
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
if (
|
|
757
|
-
|
|
806
|
+
}
|
|
807
|
+
else {
|
|
808
|
+
if (self.$common.dialogList && self.$common.dialogList.List.length === 0 && self.openType !== 'detail'
|
|
809
|
+
&& field.actionType && field.actionType === 2 && data.notification !== 17 && data.notification !== 13
|
|
810
|
+
&& data.notification !== 14 && data.notification !== 15 && data.notification !== 16) {
|
|
811
|
+
if (typeof self.$common.getDataDrivenOpts().handler.closeTab === 'function') {
|
|
812
|
+
self.$common.getDataDrivenOpts().handler.closeTab();
|
|
813
|
+
}
|
|
758
814
|
}
|
|
815
|
+
self.$emit('submit', { formData: self.model, responseData: data });
|
|
759
816
|
}
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
817
|
+
if (self.parentModel) {
|
|
818
|
+
self.parentModel.$vue.closeTabThen(data);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
else if (data.rtnCode === 202) {
|
|
822
|
+
self.$common.confirm(data.rtnMsg, '提示', {
|
|
823
|
+
confirmButtonText: '确定',
|
|
824
|
+
cancelButtonText: '取消',
|
|
825
|
+
type: 'warning'
|
|
826
|
+
}).then(() => {
|
|
827
|
+
field.doAction(self.getFormObj({ flagHaveAlert: '1' }), (res) => {
|
|
828
|
+
if (res.rtnCode === 200) {
|
|
829
|
+
if (res.notification === 17) {
|
|
830
|
+
if (self.$common.dialogList && self.$common.dialogList.List.length > 0
|
|
831
|
+
&& (res.content.pageStyle === 1 || res.content.pageStyle === 3)) {
|
|
832
|
+
}
|
|
833
|
+
else {
|
|
834
|
+
self.clickHandler(self.model.getRtnRouter(res.content), null)
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
self.$emit('submit', { formData: self.model, responseData: res });
|
|
838
|
+
}
|
|
839
|
+
});
|
|
840
|
+
}).catch(() => {
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
if (data.notification === 14 || data.notification === 15 || data.notification === 16) {
|
|
844
|
+
if (typeof self.$common.getDataDrivenOpts().handler.closeTab === 'function') {
|
|
845
|
+
self.$common.getDataDrivenOpts().handler.closeTab();
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
}, self.model.scripts);
|
|
767
849
|
}
|
|
850
|
+
|
|
851
|
+
}
|
|
852
|
+
//无值,触发submit事件
|
|
853
|
+
else {
|
|
854
|
+
self.$emit('submit', { formData: self.model, responseData: {} });
|
|
768
855
|
}
|
|
769
856
|
}
|
|
770
857
|
}
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
}
|
|
777
|
-
if (typeof field.onClick !== 'undefined') {
|
|
778
|
-
verified = self.$common.excute.call(self.model.scripts, field.onClick);
|
|
858
|
+
}
|
|
859
|
+
else {
|
|
860
|
+
if (field.flagAttachSearchCondition) {
|
|
861
|
+
if (!self.validExcute()) {
|
|
862
|
+
return;
|
|
779
863
|
}
|
|
864
|
+
}
|
|
865
|
+
if (typeof field.onClick !== 'undefined') {
|
|
866
|
+
verified = self.$common.excute.call(self.model.scripts, field.onClick);
|
|
867
|
+
}
|
|
780
868
|
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
869
|
+
if (!submitData) {
|
|
870
|
+
submitData = self.getFileData(field);
|
|
871
|
+
}
|
|
784
872
|
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
}
|
|
790
|
-
}
|
|
791
|
-
else if(field.isTabInBrowse){
|
|
792
|
-
|
|
793
|
-
}
|
|
794
|
-
else if(field.isLayerInSystem){
|
|
795
|
-
if(field.isOpenBaiduMap){
|
|
796
|
-
var dialogOption = {
|
|
797
|
-
title: field.pageTitle,
|
|
798
|
-
pane: self.$common.getParentPane(self),
|
|
799
|
-
content: [
|
|
800
|
-
{
|
|
801
|
-
component: "ct-mapBaidu",
|
|
802
|
-
attrs: {
|
|
803
|
-
field: field,
|
|
804
|
-
apiParam: field.getActionPara(submitData).para,
|
|
805
|
-
width: field.dialogWidth + "px",
|
|
806
|
-
height: field.dialogHeight + "px",
|
|
807
|
-
},
|
|
808
|
-
on: {
|
|
809
|
-
submit(ev) {
|
|
810
|
-
if (callBack) {
|
|
811
|
-
callBack(field);
|
|
812
|
-
}
|
|
813
|
-
self.$common.closeDialog(dialogOption.dialog);
|
|
814
|
-
},
|
|
815
|
-
closeDialog(ev) {
|
|
816
|
-
}
|
|
817
|
-
},
|
|
818
|
-
},
|
|
819
|
-
],
|
|
820
|
-
};
|
|
821
|
-
self.$common.openDialog(dialogOption);
|
|
822
|
-
}
|
|
873
|
+
if (field.isTabInSystem) {
|
|
874
|
+
if (field.isOpenBaiduMap) {
|
|
875
|
+
submitData = field.getActionPara(submitData).para;
|
|
876
|
+
self.$common.getDataDrivenOpts().handler.openTabBaiduMap(submitData, field.pageTitle || field.label);
|
|
823
877
|
}
|
|
824
|
-
|
|
878
|
+
}
|
|
879
|
+
else if (field.isTabInBrowse) {
|
|
880
|
+
|
|
881
|
+
}
|
|
882
|
+
else if (field.isLayerInSystem) {
|
|
883
|
+
if (field.isOpenBaiduMap) {
|
|
825
884
|
var dialogOption = {
|
|
826
885
|
title: field.pageTitle,
|
|
827
886
|
pane: self.$common.getParentPane(self),
|
|
828
|
-
content: [
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
// && ev.responseData.content){
|
|
846
|
-
// self.$common.excuteFunStr.call(self.model.scripts, ev.responseData.content);
|
|
847
|
-
// }
|
|
848
|
-
// else
|
|
849
|
-
if (ev.responseData && ev.responseData.notification === 10) {
|
|
850
|
-
self.init();
|
|
851
|
-
}
|
|
852
|
-
else {
|
|
853
|
-
self.model.updateFields(ev, () => {
|
|
854
|
-
self.$refs.Fields.forEach((fd) => {
|
|
855
|
-
fd.$forceUpdate();
|
|
856
|
-
});
|
|
857
|
-
});
|
|
887
|
+
content: [
|
|
888
|
+
{
|
|
889
|
+
component: "ct-mapBaidu",
|
|
890
|
+
attrs: {
|
|
891
|
+
field: field,
|
|
892
|
+
apiParam: field.getActionPara(submitData).para,
|
|
893
|
+
width: field.dialogWidth + "px",
|
|
894
|
+
height: field.dialogHeight + "px",
|
|
895
|
+
},
|
|
896
|
+
on: {
|
|
897
|
+
submit(ev) {
|
|
898
|
+
if (callBack) {
|
|
899
|
+
callBack(field);
|
|
900
|
+
}
|
|
901
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
902
|
+
},
|
|
903
|
+
closeDialog(ev) {
|
|
858
904
|
}
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
}]
|
|
905
|
+
},
|
|
906
|
+
},
|
|
907
|
+
],
|
|
863
908
|
};
|
|
864
909
|
self.$common.openDialog(dialogOption);
|
|
865
910
|
}
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
911
|
+
}
|
|
912
|
+
else if (field.isOpenForm) {
|
|
913
|
+
var dialogOption = {
|
|
914
|
+
title: field.pageTitle,
|
|
915
|
+
pane: self.$common.getParentPane(self),
|
|
916
|
+
content: [{
|
|
917
|
+
component: 'ct-form',
|
|
918
|
+
attrs: {
|
|
919
|
+
api: field.action,
|
|
920
|
+
apiParam: field.getActionPara(submitData).para,
|
|
921
|
+
showTitle: false,
|
|
922
|
+
width: field.dialogWidth + 'px',
|
|
923
|
+
height: field.dialogHeight + 'px',
|
|
924
|
+
documentHeight: self.documentHeight,
|
|
925
|
+
documentWidth: self.documentWidth,
|
|
926
|
+
isIframe: self.isIframe,
|
|
927
|
+
},
|
|
928
|
+
on: {
|
|
929
|
+
submit(ev) {
|
|
930
|
+
// if(ev.responseData
|
|
931
|
+
// && ev.responseData.clientActionType
|
|
932
|
+
// && ev.responseData.clientActionType === 2
|
|
933
|
+
// && ev.responseData.content){
|
|
934
|
+
// self.$common.excuteFunStr.call(self.model.scripts, ev.responseData.content);
|
|
935
|
+
// }
|
|
936
|
+
// else
|
|
937
|
+
if (ev.responseData && ev.responseData.notification === 10) {
|
|
938
|
+
self.init();
|
|
939
|
+
}
|
|
940
|
+
else {
|
|
882
941
|
self.model.updateFields(ev, () => {
|
|
883
942
|
self.$refs.Fields.forEach((fd) => {
|
|
884
943
|
fd.$forceUpdate();
|
|
885
944
|
});
|
|
886
945
|
});
|
|
887
|
-
self.$common.closeDialog(dialogOption.dialog);
|
|
888
946
|
}
|
|
947
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
889
948
|
}
|
|
890
|
-
}
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
949
|
+
}
|
|
950
|
+
}]
|
|
951
|
+
};
|
|
952
|
+
self.$common.openDialog(dialogOption);
|
|
953
|
+
}
|
|
954
|
+
else if (field.isOpenList) {
|
|
955
|
+
var dialogOption = {
|
|
956
|
+
title: field.pageTitle,
|
|
957
|
+
pane: self.$common.getParentPane(self),
|
|
958
|
+
content: [{
|
|
959
|
+
component: 'ct-searchlist',
|
|
960
|
+
attrs: {
|
|
961
|
+
searchConditionApi: field.actionForSearchLayout,
|
|
962
|
+
searchDataApi: field.actionForSearch,
|
|
963
|
+
apiParam: submitData,
|
|
964
|
+
width: field.dialogWidth + 'px',
|
|
965
|
+
height: field.dialogHeight + 'px',
|
|
966
|
+
isIframe: self.isIframe,
|
|
967
|
+
},
|
|
968
|
+
on: {
|
|
969
|
+
submit(ev) {
|
|
970
|
+
self.model.updateFields(ev, () => {
|
|
971
|
+
self.$refs.Fields.forEach((fd) => {
|
|
972
|
+
fd.$forceUpdate();
|
|
973
|
+
});
|
|
974
|
+
});
|
|
975
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
}]
|
|
979
|
+
};
|
|
980
|
+
self.$common.openDialog(dialogOption);
|
|
981
|
+
}
|
|
982
|
+
else if (field.isFormPageInTab) {// 外部框架tab页打开
|
|
983
|
+
submitData = field.getActionPara(submitData).para;
|
|
984
|
+
if (field.pageStyle) {
|
|
985
|
+
submitData.pageStyle = field.pageStyle;
|
|
912
986
|
}
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
987
|
+
self.$common.getDataDrivenOpts().handler.openTab(field.action, submitData, field.pageTitle, self.model, field.dialogWidth);
|
|
988
|
+
}
|
|
989
|
+
else if (field.isSearchPageInTab) {// 外部框架tab页打开
|
|
990
|
+
submitData = field.getActionPara(submitData).para;
|
|
991
|
+
self.$common.getDataDrivenOpts().handler.openTabSearch(field, submitData);
|
|
992
|
+
}
|
|
993
|
+
else if (field.isOpenUrlInBrowse) {// 浏览器打开
|
|
994
|
+
window.open(submitData[field.submitFormField], "_blank");
|
|
995
|
+
}
|
|
996
|
+
else if (field.isBrowserNewTab) {// 浏览器打开
|
|
997
|
+
submitData = field.getActionPara(submitData).para;
|
|
998
|
+
let query = self.$common.objectToQueryStr(submitData);
|
|
999
|
+
window.open(field.action + query, "_blank");
|
|
1000
|
+
}
|
|
1001
|
+
else if (field.isUrlInSystemTab) {//外部框架tab页打开URl
|
|
1002
|
+
submitData = field.getActionPara(submitData).para;
|
|
1003
|
+
let query = self.$common.objectToQueryStr(submitData);
|
|
1004
|
+
let urlTab = field.action + query;
|
|
1005
|
+
if (field.action.indexOf('?') > -1 && query.indexOf('?') > -1) {
|
|
1006
|
+
urlTab = field.action + '&' + query.substr(1, query.length);
|
|
924
1007
|
}
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
1008
|
+
self.$common.getDataDrivenOpts().handler.openTabUrl(urlTab, field.pageTitle || field.label);
|
|
1009
|
+
}
|
|
1010
|
+
else if (field.isSeeVoice) {//看视频
|
|
1011
|
+
self.$common.browseVideo(field, submitData)
|
|
1012
|
+
}
|
|
1013
|
+
else if (field.isBrowseAttachment) {//浏览附件
|
|
1014
|
+
var mediaviewpagetype = (field.isFormPageInTab || field.isSearchPageInTab) ? 2 : 0;
|
|
1015
|
+
var MediaAlbum = [
|
|
1016
|
+
{ albumName: field.pageTitle || "媒体", medias: [] },
|
|
1017
|
+
];
|
|
1018
|
+
if (field.action) {
|
|
1019
|
+
var callback = function (res) {
|
|
1020
|
+
let data = res.content
|
|
1021
|
+
if (typeof data == 'object' && data.mediaAlbums) {
|
|
1022
|
+
MediaAlbum = data.mediaAlbums;
|
|
940
1023
|
}
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
MediaAlbum[0].medias.push(v);
|
|
946
|
-
});
|
|
947
|
-
self.$common.viewerfile(field.pageTitle, MediaAlbum, 0, 0,mediaviewpagetype);
|
|
1024
|
+
else {
|
|
1025
|
+
MediaAlbum[0].medias = data;
|
|
1026
|
+
}
|
|
1027
|
+
self.$common.viewerfile(field.pageTitle, MediaAlbum, 0, 0, mediaviewpagetype);
|
|
948
1028
|
}
|
|
1029
|
+
field.doAction(submitData, callback);
|
|
949
1030
|
}
|
|
950
|
-
else
|
|
951
|
-
submitData
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
if (data.rtnMsg) {
|
|
984
|
-
self.$message({
|
|
985
|
-
message: data.rtnMsg,
|
|
986
|
-
type: 'success',
|
|
987
|
-
showClose:true,
|
|
988
|
-
});
|
|
989
|
-
}
|
|
990
|
-
if (field && field.changeCallBackFunName) {
|
|
991
|
-
self.changeCallBackHandler(field, field.changeCallBackFunName, data.content);
|
|
1031
|
+
else {
|
|
1032
|
+
submitData.mediaData.forEach((v) => {
|
|
1033
|
+
MediaAlbum[0].medias.push(v);
|
|
1034
|
+
});
|
|
1035
|
+
self.$common.viewerfile(field.pageTitle, MediaAlbum, 0, 0, mediaviewpagetype);
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
else if (field.isExport || field.flagAsync) {
|
|
1039
|
+
submitData = field.getActionPara(submitData).para;
|
|
1040
|
+
if (field.flagAsync) {
|
|
1041
|
+
field.doAction(submitData, (res) => {
|
|
1042
|
+
if (res.rtnCode === 200) {
|
|
1043
|
+
if (res.content && res.content.action) {
|
|
1044
|
+
var dialogOption = {
|
|
1045
|
+
title: field.pageTitle || field.label,
|
|
1046
|
+
content: [{
|
|
1047
|
+
component: 'ct-progress',
|
|
1048
|
+
attrs: {
|
|
1049
|
+
progressAction: res.content.action,
|
|
1050
|
+
progressKey: res.content.key,
|
|
1051
|
+
progressType: field.isExport ? 'export' : 'import',
|
|
1052
|
+
width: '350px',
|
|
1053
|
+
height: '185px'
|
|
1054
|
+
},
|
|
1055
|
+
on: {
|
|
1056
|
+
finished(data) {
|
|
1057
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
1058
|
+
if (field.isExport) {
|
|
1059
|
+
if (data.content.indexOf(".zip") > -1) {
|
|
1060
|
+
window.location.href = encodeURI(data.content);
|
|
992
1061
|
}
|
|
993
1062
|
else {
|
|
994
|
-
|
|
1063
|
+
if (data.content.indexOf("?") > -1) {
|
|
1064
|
+
self.downloadUrl = data.content + "&" + Math.random();
|
|
1065
|
+
}
|
|
1066
|
+
else {
|
|
1067
|
+
self.downloadUrl = data.content + "?" + Math.random();
|
|
1068
|
+
}
|
|
995
1069
|
}
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
self.$common.closeDialog(dialogOption.dialog);
|
|
1070
|
+
}
|
|
1071
|
+
if (data.rtnMsg) {
|
|
999
1072
|
self.$message({
|
|
1000
1073
|
message: data.rtnMsg,
|
|
1001
|
-
type: '
|
|
1002
|
-
showClose:true,
|
|
1074
|
+
type: 'success',
|
|
1075
|
+
showClose: true,
|
|
1003
1076
|
});
|
|
1004
1077
|
}
|
|
1078
|
+
if (field && field.changeCallBackFunName) {
|
|
1079
|
+
self.changeCallBackHandler(field, field.changeCallBackFunName, data.content);
|
|
1080
|
+
}
|
|
1081
|
+
else {
|
|
1082
|
+
self.model.doAction(data);
|
|
1083
|
+
}
|
|
1084
|
+
},
|
|
1085
|
+
error(data) {
|
|
1086
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
1087
|
+
self.$message({
|
|
1088
|
+
message: data.rtnMsg,
|
|
1089
|
+
type: 'warning',
|
|
1090
|
+
showClose: true,
|
|
1091
|
+
});
|
|
1005
1092
|
}
|
|
1006
|
-
}
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
|
|
1093
|
+
}
|
|
1094
|
+
}]
|
|
1095
|
+
};
|
|
1096
|
+
self.$common.openDialog(dialogOption);
|
|
1010
1097
|
}
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1098
|
+
}
|
|
1099
|
+
else if (res.rtnCode === 202) {
|
|
1100
|
+
submitData.flagHaveAlert = '1';
|
|
1101
|
+
if (submitData.jsonData) submitData.jsonData.flagHaveAlert = '1';
|
|
1102
|
+
self.$common.confirm(res.rtnMsg, '提示', {
|
|
1103
|
+
confirmButtonText: '确定',
|
|
1104
|
+
cancelButtonText: '取消',
|
|
1105
|
+
type: 'warning'
|
|
1106
|
+
}).then(() => {
|
|
1107
|
+
field.doAction(submitData, (res202) => {
|
|
1020
1108
|
if (res202.rtnCode === 200) {
|
|
1021
1109
|
if (res202.content && res202.content.action) {
|
|
1022
1110
|
var dialogOption = {
|
|
@@ -1032,12 +1120,12 @@
|
|
|
1032
1120
|
},
|
|
1033
1121
|
on: {
|
|
1034
1122
|
finished(data) {
|
|
1035
|
-
self.$common.closeDialog(dialogOption.dialog);
|
|
1036
|
-
if(field.isExport){
|
|
1037
|
-
if(data.content.indexOf(".zip") > -1){
|
|
1123
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
1124
|
+
if (field.isExport) {
|
|
1125
|
+
if (data.content.indexOf(".zip") > -1) {
|
|
1038
1126
|
window.location.href = encodeURI(data.content);
|
|
1039
1127
|
}
|
|
1040
|
-
else{
|
|
1128
|
+
else {
|
|
1041
1129
|
if (data.content.indexOf("?") > -1) {
|
|
1042
1130
|
self.downloadUrl = data.content + "&" + Math.random();
|
|
1043
1131
|
}
|
|
@@ -1050,7 +1138,7 @@
|
|
|
1050
1138
|
self.$message({
|
|
1051
1139
|
message: data.rtnMsg,
|
|
1052
1140
|
type: 'success',
|
|
1053
|
-
showClose:true,
|
|
1141
|
+
showClose: true,
|
|
1054
1142
|
});
|
|
1055
1143
|
}
|
|
1056
1144
|
if (field && field.changeCallBackFunName) {
|
|
@@ -1065,7 +1153,7 @@
|
|
|
1065
1153
|
self.$message({
|
|
1066
1154
|
message: data.rtnMsg,
|
|
1067
1155
|
type: 'warning',
|
|
1068
|
-
showClose:true,
|
|
1156
|
+
showClose: true,
|
|
1069
1157
|
});
|
|
1070
1158
|
}
|
|
1071
1159
|
}
|
|
@@ -1073,662 +1161,838 @@
|
|
|
1073
1161
|
};
|
|
1074
1162
|
self.$common.openDialog(dialogOption);
|
|
1075
1163
|
}
|
|
1076
|
-
}
|
|
1077
|
-
}).catch(() => {
|
|
1164
|
+
}
|
|
1078
1165
|
});
|
|
1166
|
+
}).catch(() => {
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
});
|
|
1170
|
+
}
|
|
1171
|
+
else {
|
|
1172
|
+
if (field.action.indexOf("http://") === 0 || field.action.indexOf("https://") === 0) {
|
|
1173
|
+
if (field.action.indexOf(".zip") > -1) {
|
|
1174
|
+
window.location.href = encodeURI(field.action);
|
|
1175
|
+
}
|
|
1176
|
+
else {
|
|
1177
|
+
if (field.action.indexOf("?") > -1) {
|
|
1178
|
+
self.downloadUrl = field.action + "&" + Math.random();
|
|
1079
1179
|
}
|
|
1080
|
-
|
|
1180
|
+
else {
|
|
1181
|
+
self.downloadUrl = field.action + "?" + Math.random();
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1081
1184
|
}
|
|
1082
1185
|
else {
|
|
1083
|
-
|
|
1084
|
-
if(
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1186
|
+
field.doAction(submitData, (data) => {
|
|
1187
|
+
if (data.content) {
|
|
1188
|
+
if (data.content.indexOf("http://") === 0 || data.content.indexOf("https://") === 0) {
|
|
1189
|
+
if (data.content.indexOf(".zip") > -1) {
|
|
1190
|
+
window.location.href = encodeURI(data.action);
|
|
1191
|
+
}
|
|
1192
|
+
else {
|
|
1193
|
+
if (data.content.indexOf("?") > -1) {
|
|
1194
|
+
self.downloadUrl = data.content + "&" + Math.random();
|
|
1195
|
+
}
|
|
1196
|
+
else {
|
|
1197
|
+
self.downloadUrl = data.content + "?" + Math.random();
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1090
1200
|
}
|
|
1091
1201
|
else {
|
|
1092
|
-
self.downloadUrl = field.action + "?" + Math.random();
|
|
1093
1202
|
}
|
|
1094
1203
|
}
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
}
|
|
1208
|
+
else {
|
|
1209
|
+
submitData = field.getActionPara(submitData).para;
|
|
1210
|
+
field.doAction(submitData, (data) => {
|
|
1211
|
+
if (data.rtnCode === 200 || data.isSuccess) {
|
|
1212
|
+
if (field && field.changeCallBackFunName) {
|
|
1213
|
+
self.changeCallBackHandler(field, field.changeCallBackFunName, data.content);
|
|
1214
|
+
}
|
|
1215
|
+
else if (field.isRefersh || data.notification === 10) {
|
|
1216
|
+
self.init();
|
|
1095
1217
|
}
|
|
1096
1218
|
else {
|
|
1097
|
-
|
|
1098
|
-
if (data.content) {
|
|
1099
|
-
if (data.content.indexOf("http://") === 0 || data.content.indexOf("https://") === 0) {
|
|
1100
|
-
if(data.content.indexOf(".zip") > -1){
|
|
1101
|
-
window.location.href = encodeURI(data.action);
|
|
1102
|
-
}
|
|
1103
|
-
else{
|
|
1104
|
-
if (data.content.indexOf("?") > -1) {
|
|
1105
|
-
self.downloadUrl = data.content + "&" + Math.random();
|
|
1106
|
-
}
|
|
1107
|
-
else {
|
|
1108
|
-
self.downloadUrl = data.content + "?" + Math.random();
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
else {
|
|
1113
|
-
}
|
|
1114
|
-
}
|
|
1115
|
-
});
|
|
1219
|
+
self.model.doAction(data);
|
|
1116
1220
|
}
|
|
1117
1221
|
}
|
|
1118
|
-
}
|
|
1119
|
-
else {
|
|
1120
|
-
submitData = field.getActionPara(submitData).para;
|
|
1121
|
-
field.doAction(submitData, (data) => {
|
|
1122
|
-
if (data.rtnCode === 200 || data.isSuccess) {
|
|
1123
|
-
if (field && field.changeCallBackFunName) {
|
|
1124
|
-
self.changeCallBackHandler(field, field.changeCallBackFunName, data.content);
|
|
1125
|
-
}
|
|
1126
|
-
else if (field.isRefersh || data.notification === 10) {
|
|
1127
|
-
self.init();
|
|
1128
|
-
}
|
|
1129
|
-
else {
|
|
1130
|
-
self.model.doAction(data);
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
}, self.model.scripts);
|
|
1134
|
-
}
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
//执行客户端脚本
|
|
1138
|
-
else {
|
|
1139
|
-
if (!submitData) {
|
|
1140
|
-
submitData = {};
|
|
1141
|
-
var tempFormData = self.model.getFormObj();
|
|
1142
|
-
field.submitFormField.forEach((v) => {
|
|
1143
|
-
submitData[v] = self.$common.getDataOfUpperLower(tempFormData, v);
|
|
1144
|
-
});
|
|
1145
|
-
}
|
|
1146
|
-
submitData = field.getActionPara(submitData).para;
|
|
1147
|
-
let title = field.pageTitle == undefined ? field.label : field.pageTitle;
|
|
1148
|
-
submitData.actionType = field.actionType;
|
|
1149
|
-
if (self.isIframe) {
|
|
1150
|
-
submitData.isIframe = self.isIframe;
|
|
1222
|
+
}, self.model.scripts);
|
|
1151
1223
|
}
|
|
1152
|
-
var fun = self.$common.getDataDrivenOpts().handler[field.action];
|
|
1153
|
-
fun(submitData, title, self.model);
|
|
1154
1224
|
}
|
|
1155
1225
|
}
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1226
|
+
//执行客户端脚本
|
|
1227
|
+
else {
|
|
1228
|
+
if (!submitData) {
|
|
1229
|
+
submitData = {};
|
|
1230
|
+
var tempFormData = self.model.getFormObj();
|
|
1231
|
+
field.submitFormField.forEach((v) => {
|
|
1232
|
+
submitData[v] = self.$common.getDataOfUpperLower(tempFormData, v);
|
|
1233
|
+
});
|
|
1234
|
+
}
|
|
1235
|
+
submitData = field.getActionPara(submitData).para;
|
|
1236
|
+
let title = field.pageTitle == undefined ? field.label : field.pageTitle;
|
|
1237
|
+
submitData.actionType = field.actionType;
|
|
1238
|
+
if (self.isIframe) {
|
|
1239
|
+
submitData.isIframe = self.isIframe;
|
|
1164
1240
|
}
|
|
1241
|
+
var fun = self.$common.getDataDrivenOpts().handler[field.action];
|
|
1242
|
+
fun(submitData, title, self.model);
|
|
1165
1243
|
}
|
|
1244
|
+
}
|
|
1166
1245
|
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
clickAcion(field, submitData);
|
|
1175
|
-
}).catch(() => {
|
|
1176
|
-
});
|
|
1246
|
+
if (typeof field.onClick !== 'undefined') {
|
|
1247
|
+
self.$common.excute.call(self.model.scripts, field.onClick)
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
if (field.isSubmit && field.flagVerifyData) {
|
|
1251
|
+
if (!self.validExcute()) {
|
|
1252
|
+
return;
|
|
1177
1253
|
}
|
|
1178
|
-
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
if (field.alert) {
|
|
1257
|
+
self.$common.confirm(field.alertMsg, field.alertCaption, {
|
|
1258
|
+
confirmButtonText: field.alertOKButtonText,
|
|
1259
|
+
cancelButtonText: field.alertCancelButtonText,
|
|
1260
|
+
//type: 'warning'
|
|
1261
|
+
center: field.alertCenter
|
|
1262
|
+
}).then(() => {
|
|
1179
1263
|
clickAcion(field, submitData);
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
else {
|
|
1209
|
-
self.downloadUrl = data.content + "?" + Math.random();
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
if (data.rtnMsg) {
|
|
1214
|
-
self.$message({
|
|
1215
|
-
message: data.rtnMsg,
|
|
1216
|
-
type: 'info',
|
|
1217
|
-
showClose:true,
|
|
1218
|
-
});
|
|
1219
|
-
}
|
|
1220
|
-
if (field && field.changeCallBackFunName) {
|
|
1221
|
-
self.changeCallBackHandler(field, field.changeCallBackFunName, data.content);
|
|
1264
|
+
}).catch(() => {
|
|
1265
|
+
});
|
|
1266
|
+
}
|
|
1267
|
+
else {
|
|
1268
|
+
clickAcion(field, submitData);
|
|
1269
|
+
}
|
|
1270
|
+
},
|
|
1271
|
+
importComplete(res, field) {
|
|
1272
|
+
var self = this;
|
|
1273
|
+
if (field.flagAsync) {
|
|
1274
|
+
if (res.content && res.content.action) {
|
|
1275
|
+
var dialogOption = {
|
|
1276
|
+
title: field.pageTitle || field.label,
|
|
1277
|
+
content: [{
|
|
1278
|
+
component: 'ct-progress',
|
|
1279
|
+
attrs: {
|
|
1280
|
+
progressAction: res.content.action,
|
|
1281
|
+
progressKey: res.content.key,
|
|
1282
|
+
progressType: 'import',
|
|
1283
|
+
width: '350px',
|
|
1284
|
+
height: '185px'
|
|
1285
|
+
},
|
|
1286
|
+
on: {
|
|
1287
|
+
finished(data) {
|
|
1288
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
1289
|
+
if (field.isExport) {
|
|
1290
|
+
if (data.content.indexOf(".zip") > -1) {
|
|
1291
|
+
window.location.href = encodeURI(data.content);
|
|
1222
1292
|
}
|
|
1223
1293
|
else {
|
|
1224
|
-
|
|
1294
|
+
if (data.content.indexOf("?") > -1) {
|
|
1295
|
+
self.downloadUrl = data.content + "&" + Math.random();
|
|
1296
|
+
}
|
|
1297
|
+
else {
|
|
1298
|
+
self.downloadUrl = data.content + "?" + Math.random();
|
|
1299
|
+
}
|
|
1225
1300
|
}
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1228
|
-
self.$common.closeDialog(dialogOption.dialog);
|
|
1301
|
+
}
|
|
1302
|
+
if (data.rtnMsg) {
|
|
1229
1303
|
self.$message({
|
|
1230
1304
|
message: data.rtnMsg,
|
|
1231
|
-
type: '
|
|
1232
|
-
showClose:true,
|
|
1305
|
+
type: 'info',
|
|
1306
|
+
showClose: true,
|
|
1233
1307
|
});
|
|
1234
1308
|
}
|
|
1309
|
+
if (field && field.changeCallBackFunName) {
|
|
1310
|
+
self.changeCallBackHandler(field, field.changeCallBackFunName, data.content);
|
|
1311
|
+
}
|
|
1312
|
+
else {
|
|
1313
|
+
self.model.doAction(data);
|
|
1314
|
+
}
|
|
1315
|
+
},
|
|
1316
|
+
error(data) {
|
|
1317
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
1318
|
+
self.$message({
|
|
1319
|
+
message: data.rtnMsg,
|
|
1320
|
+
type: 'warning',
|
|
1321
|
+
showClose: true,
|
|
1322
|
+
});
|
|
1235
1323
|
}
|
|
1236
|
-
}
|
|
1237
|
-
}
|
|
1238
|
-
|
|
1239
|
-
|
|
1324
|
+
}
|
|
1325
|
+
}]
|
|
1326
|
+
};
|
|
1327
|
+
self.$common.openDialog(dialogOption);
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
else {
|
|
1331
|
+
if (field && field.changeCallBackFunName) {
|
|
1332
|
+
this.changeCallBackHandler(field, field.changeCallBackFunName, res.content);
|
|
1240
1333
|
}
|
|
1241
1334
|
else {
|
|
1242
|
-
|
|
1243
|
-
this.changeCallBackHandler(field, field.changeCallBackFunName, res.content);
|
|
1244
|
-
}
|
|
1245
|
-
else {
|
|
1246
|
-
this.model.doAction(res);
|
|
1247
|
-
}
|
|
1335
|
+
this.model.doAction(res);
|
|
1248
1336
|
}
|
|
1249
|
-
}
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
this.model.scripts.$fd = field.id;
|
|
1256
|
-
this.$common.excute.call(this.model.scripts, field.input);
|
|
1337
|
+
}
|
|
1338
|
+
},
|
|
1339
|
+
inputHandler(field) {
|
|
1340
|
+
if (typeof field.input !== 'undefined') {
|
|
1341
|
+
if (typeof this.model.scripts !== 'undefined') {
|
|
1342
|
+
this.model.scripts.formData.setExcuteListData(this.model.fields);
|
|
1257
1343
|
}
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1344
|
+
this.model.scripts.$fd = field.id;
|
|
1345
|
+
this.$common.excute.call(this.model.scripts, field.input);
|
|
1346
|
+
}
|
|
1347
|
+
},
|
|
1348
|
+
changeHandler(field) {
|
|
1349
|
+
var self = this;
|
|
1261
1350
|
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
}
|
|
1269
|
-
this.model.scripts.$fd = field.id;
|
|
1270
|
-
this.$common.excute.call(this.model.scripts, field.change);
|
|
1351
|
+
self.model.hiddenHandle(field);
|
|
1352
|
+
self.model.requiredHandle(field);
|
|
1353
|
+
|
|
1354
|
+
if (typeof field.change !== 'undefined') {
|
|
1355
|
+
if (typeof this.model.scripts !== 'undefined') {
|
|
1356
|
+
this.model.scripts.formData.setExcuteListData(this.model.fields);
|
|
1271
1357
|
}
|
|
1358
|
+
this.model.scripts.$fd = field.id;
|
|
1359
|
+
this.$common.excute.call(this.model.scripts, field.change);
|
|
1360
|
+
}
|
|
1272
1361
|
|
|
1273
|
-
|
|
1274
|
-
|
|
1362
|
+
self.model.isChanged = true;
|
|
1363
|
+
//self.model.validMrf(field);
|
|
1275
1364
|
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
}
|
|
1287
|
-
this.model.scripts.$fd = field.id;
|
|
1288
|
-
this.$common.excute.call(this.model.scripts, field.onAfterChanged);
|
|
1365
|
+
if (field.onAfterChanged && field.type !== 4) {
|
|
1366
|
+
var router = self.model.actionRouters.find((v) => {
|
|
1367
|
+
return v.id === field.onAfterChanged;
|
|
1368
|
+
});
|
|
1369
|
+
if (router) {
|
|
1370
|
+
self.clickHandler(router);
|
|
1371
|
+
}
|
|
1372
|
+
else {
|
|
1373
|
+
if (typeof this.model.scripts !== 'undefined') {
|
|
1374
|
+
this.model.scripts.formData.setExcuteListData(this.model.fields);
|
|
1289
1375
|
}
|
|
1376
|
+
this.model.scripts.$fd = field.id;
|
|
1377
|
+
this.$common.excute.call(this.model.scripts, field.onAfterChanged);
|
|
1290
1378
|
}
|
|
1379
|
+
}
|
|
1291
1380
|
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
}
|
|
1303
|
-
else{
|
|
1304
|
-
if (typeof this.model.scripts !== 'undefined') {
|
|
1305
|
-
this.model.scripts.formData.setExcuteListData(this.model.fields);
|
|
1306
|
-
}
|
|
1307
|
-
this.model.scripts.$fd = field.id;
|
|
1308
|
-
this.$common.excute.call(this.model.scripts, field.onAfterChanged);
|
|
1309
|
-
}
|
|
1381
|
+
self.$forceUpdate();
|
|
1382
|
+
},
|
|
1383
|
+
blurHandler(field) {
|
|
1384
|
+
var self = this;
|
|
1385
|
+
if (field.onAfterChanged) {
|
|
1386
|
+
var router = self.model.actionRouters.find((v) => {
|
|
1387
|
+
return v.id === field.onAfterChanged;
|
|
1388
|
+
});
|
|
1389
|
+
if (router) {
|
|
1390
|
+
self.clickHandler(router);
|
|
1310
1391
|
}
|
|
1311
|
-
|
|
1312
|
-
},
|
|
1313
|
-
enterHandler(field) {
|
|
1314
|
-
var self = this;
|
|
1315
|
-
if (typeof field.change !== 'undefined') {
|
|
1392
|
+
else {
|
|
1316
1393
|
if (typeof this.model.scripts !== 'undefined') {
|
|
1317
1394
|
this.model.scripts.formData.setExcuteListData(this.model.fields);
|
|
1318
1395
|
}
|
|
1319
1396
|
this.model.scripts.$fd = field.id;
|
|
1320
|
-
this.$common.excute.call(this.model.scripts, field.
|
|
1397
|
+
this.$common.excute.call(this.model.scripts, field.onAfterChanged);
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
self.$forceUpdate();
|
|
1401
|
+
},
|
|
1402
|
+
enterHandler(field) {
|
|
1403
|
+
var self = this;
|
|
1404
|
+
if (typeof field.change !== 'undefined') {
|
|
1405
|
+
if (typeof this.model.scripts !== 'undefined') {
|
|
1406
|
+
this.model.scripts.formData.setExcuteListData(this.model.fields);
|
|
1321
1407
|
}
|
|
1408
|
+
this.model.scripts.$fd = field.id;
|
|
1409
|
+
this.$common.excute.call(this.model.scripts, field.change);
|
|
1410
|
+
}
|
|
1322
1411
|
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1412
|
+
self.model.isChanged = true;
|
|
1413
|
+
self.model.hiddenHandle(field);
|
|
1414
|
+
self.model.requiredHandle(field);
|
|
1415
|
+
//self.model.validMrf(field);
|
|
1327
1416
|
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1417
|
+
if (field.routerKeyForEnterKey) {
|
|
1418
|
+
var router = self.model.actionRouters.find((v) => {
|
|
1419
|
+
return v.id === field.routerKeyForEnterKey;
|
|
1420
|
+
});
|
|
1421
|
+
self.clickHandler(router);
|
|
1422
|
+
}
|
|
1334
1423
|
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1424
|
+
self.$forceUpdate();
|
|
1425
|
+
},
|
|
1426
|
+
changeCallBackHandler(field, callBackFunName, callBackPara) {
|
|
1427
|
+
var self = this;
|
|
1428
|
+
if (callBackFunName) {
|
|
1429
|
+
this.model.scripts.$fd = field.id;
|
|
1430
|
+
this.$common.excuteFunStr.call(this.model.scripts, callBackFunName, callBackPara);
|
|
1431
|
+
}
|
|
1432
|
+
self.$forceUpdate();
|
|
1433
|
+
},
|
|
1434
|
+
popupSearchListHandler(singleSelectio, field, router, callBack) {
|
|
1435
|
+
var self = this;
|
|
1436
|
+
var submitData = {};
|
|
1437
|
+
var verified = true;
|
|
1438
|
+
var flagSearchlist = false;
|
|
1439
|
+
var tempFormData = self.model.getFormObj();
|
|
1351
1440
|
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
}
|
|
1367
|
-
else {
|
|
1368
|
-
self.$message({
|
|
1369
|
-
message: f.validMessage,
|
|
1370
|
-
type: 'error',
|
|
1371
|
-
showClose:true,
|
|
1372
|
-
});
|
|
1373
|
-
}
|
|
1441
|
+
var check = true;
|
|
1442
|
+
var checkMsg;
|
|
1443
|
+
router.submitFormField.forEach((v) => {
|
|
1444
|
+
self.$refs.Fields.forEach((f) => {
|
|
1445
|
+
if (f.model && f.model.id === v) {
|
|
1446
|
+
if (typeof f.validExcute !== 'undefined') {
|
|
1447
|
+
if (!f.validExcute()) {
|
|
1448
|
+
if (f.validMessage) {
|
|
1449
|
+
if (f.validMessage == '必填') {
|
|
1450
|
+
self.$message({
|
|
1451
|
+
message: '【' + f.model.label + '】' + f.validMessage,
|
|
1452
|
+
type: 'error',
|
|
1453
|
+
showClose: true,
|
|
1454
|
+
});
|
|
1374
1455
|
}
|
|
1375
1456
|
else {
|
|
1376
1457
|
self.$message({
|
|
1377
|
-
message:
|
|
1458
|
+
message: f.validMessage,
|
|
1378
1459
|
type: 'error',
|
|
1379
|
-
showClose:true,
|
|
1460
|
+
showClose: true,
|
|
1380
1461
|
});
|
|
1381
1462
|
}
|
|
1382
|
-
verified = false;
|
|
1383
|
-
return;
|
|
1384
1463
|
}
|
|
1464
|
+
else {
|
|
1465
|
+
self.$message({
|
|
1466
|
+
message: '【' + f.model.label + '】不能为空!',
|
|
1467
|
+
type: 'error',
|
|
1468
|
+
showClose: true,
|
|
1469
|
+
});
|
|
1470
|
+
}
|
|
1471
|
+
verified = false;
|
|
1472
|
+
return;
|
|
1385
1473
|
}
|
|
1386
1474
|
}
|
|
1387
|
-
});
|
|
1388
|
-
if (!verified) {
|
|
1389
|
-
return;
|
|
1390
|
-
}
|
|
1391
|
-
submitData[v] = self.$common.getDataOfUpperLower(tempFormData, v);
|
|
1392
|
-
if (!submitData[v]) {
|
|
1393
|
-
if (self.model.fieldsDic[v]) {
|
|
1394
|
-
if(self.model.fieldsDic[v].required){
|
|
1395
|
-
checkMsg = "请先录入" + self.model.fieldsDic[v].label;
|
|
1396
|
-
check = false;
|
|
1397
|
-
}
|
|
1398
|
-
}
|
|
1399
|
-
else {
|
|
1400
|
-
checkMsg = "未读取到表单项(" + v + ")的值";
|
|
1401
|
-
check = false;
|
|
1402
|
-
}
|
|
1403
1475
|
}
|
|
1404
1476
|
});
|
|
1405
|
-
|
|
1406
1477
|
if (!verified) {
|
|
1407
1478
|
return;
|
|
1408
1479
|
}
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1480
|
+
submitData[v] = self.$common.getDataOfUpperLower(tempFormData, v);
|
|
1481
|
+
if (!submitData[v]) {
|
|
1482
|
+
if (self.model.fieldsDic[v]) {
|
|
1483
|
+
if (self.model.fieldsDic[v].required) {
|
|
1484
|
+
checkMsg = "请先录入" + self.model.fieldsDic[v].label;
|
|
1485
|
+
check = false;
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
else {
|
|
1489
|
+
checkMsg = "未读取到表单项(" + v + ")的值";
|
|
1490
|
+
check = false;
|
|
1491
|
+
}
|
|
1419
1492
|
}
|
|
1493
|
+
});
|
|
1420
1494
|
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
documentHeight: self.documentHeight,
|
|
1436
|
-
documentWidth: self.documentWidth,
|
|
1437
|
-
flagPopupSearchlist: flagSearchlist,
|
|
1438
|
-
},
|
|
1439
|
-
on: {
|
|
1440
|
-
submit(option) {
|
|
1441
|
-
if (typeof callBack === "function" && !router.changeCallBackFunName) {
|
|
1442
|
-
callBack(option);
|
|
1443
|
-
}
|
|
1495
|
+
if (!verified) {
|
|
1496
|
+
return;
|
|
1497
|
+
}
|
|
1498
|
+
if (!check) {
|
|
1499
|
+
self.$message({
|
|
1500
|
+
message: checkMsg,
|
|
1501
|
+
type: 'warning',
|
|
1502
|
+
showClose: true,
|
|
1503
|
+
});
|
|
1504
|
+
return;
|
|
1505
|
+
}
|
|
1506
|
+
if (router.id.indexOf('_') === 0) {
|
|
1507
|
+
flagSearchlist = true;
|
|
1508
|
+
}
|
|
1444
1509
|
|
|
1445
|
-
|
|
1510
|
+
submitData = router.getActionPara(submitData).para;
|
|
1511
|
+
var dialogOption = {
|
|
1512
|
+
title: router.pageTitle,
|
|
1513
|
+
pane: self.$common.getParentPane(self),
|
|
1514
|
+
content: [{
|
|
1515
|
+
component: flagSearchlist ? 'ct-searchlist' : 'ct-popupSearchList',
|
|
1516
|
+
attrs: {
|
|
1517
|
+
searchConditionApi: router.actionForSearchLayout,
|
|
1518
|
+
searchFormApi: router.actionForSearchLayout,
|
|
1519
|
+
searchDataApi: router.actionForSearch,
|
|
1520
|
+
apiParam: submitData,
|
|
1521
|
+
singleSelectio: singleSelectio,
|
|
1522
|
+
width: router.dialogWidth + 'px',
|
|
1523
|
+
height: (router.dialogHeight || 500) + 'px',
|
|
1524
|
+
documentHeight: self.documentHeight,
|
|
1525
|
+
documentWidth: self.documentWidth,
|
|
1526
|
+
flagPopupSearchlist: flagSearchlist,
|
|
1527
|
+
},
|
|
1528
|
+
on: {
|
|
1529
|
+
submit(option) {
|
|
1530
|
+
if (typeof callBack === "function" && !router.changeCallBackFunName) {
|
|
1531
|
+
callBack(option);
|
|
1446
1532
|
}
|
|
1533
|
+
|
|
1534
|
+
self.changeCallBackHandler(field, router.changeCallBackFunName, option);
|
|
1447
1535
|
}
|
|
1448
|
-
}
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1536
|
+
}
|
|
1537
|
+
}]
|
|
1538
|
+
};
|
|
1539
|
+
this.$common.openDialog(dialogOption);
|
|
1540
|
+
},
|
|
1541
|
+
popupLocationHandler(field, router, callBack) {
|
|
1542
|
+
var self = this;
|
|
1543
|
+
var submitData = self.getFileData(router);
|
|
1544
|
+
var tempFormData = self.model.getFormObj();
|
|
1545
|
+
submitData.lng = field.code1;
|
|
1546
|
+
submitData.lat = field.code2;
|
|
1547
|
+
submitData = router.getActionPara(submitData).para;
|
|
1459
1548
|
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
}
|
|
1479
|
-
self.$common.closeDialog(dialogOption.dialog);
|
|
1480
|
-
},
|
|
1481
|
-
closeDialog(ev) {
|
|
1482
|
-
// self.$common.closeDialog(dialogOption.dialog);
|
|
1549
|
+
let dialogOption = {
|
|
1550
|
+
title: router.pageTitle || router.label,
|
|
1551
|
+
pane: self.$common.getParentPane(self),
|
|
1552
|
+
content: [{
|
|
1553
|
+
component: "ct-mapBaidu",
|
|
1554
|
+
attrs: {
|
|
1555
|
+
field: router,
|
|
1556
|
+
apiParam: submitData,
|
|
1557
|
+
width: router.dialogWidth + "px",
|
|
1558
|
+
height: router.dialogHeight + "px",
|
|
1559
|
+
documentHeight: self.documentHeight,
|
|
1560
|
+
documentWidth: self.documentWidth,
|
|
1561
|
+
openType: 'Location'
|
|
1562
|
+
},
|
|
1563
|
+
on: {
|
|
1564
|
+
submit(ev) {
|
|
1565
|
+
if (callBack) {
|
|
1566
|
+
callBack(ev);
|
|
1483
1567
|
}
|
|
1568
|
+
self.$common.closeDialog(dialogOption.dialog);
|
|
1569
|
+
},
|
|
1570
|
+
closeDialog(ev) {
|
|
1571
|
+
// self.$common.closeDialog(dialogOption.dialog);
|
|
1484
1572
|
}
|
|
1485
|
-
}
|
|
1486
|
-
}
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1573
|
+
}
|
|
1574
|
+
}]
|
|
1575
|
+
};
|
|
1576
|
+
this.$common.openDialog(dialogOption);
|
|
1577
|
+
},
|
|
1578
|
+
validExcute() {
|
|
1579
|
+
var self = this;
|
|
1580
|
+
var rtnBool = true;
|
|
1581
|
+
var jump = false;
|
|
1582
|
+
var i = 0;
|
|
1494
1583
|
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
}
|
|
1513
|
-
self.$message({
|
|
1514
|
-
message: '【' + m + '】' + f.validMessage,
|
|
1515
|
-
type: 'error',
|
|
1516
|
-
showClose:true,
|
|
1517
|
-
});
|
|
1518
|
-
}
|
|
1519
|
-
else {
|
|
1520
|
-
self.$message({
|
|
1521
|
-
message: f.validMessage,
|
|
1522
|
-
type: 'error',
|
|
1523
|
-
showClose:true,
|
|
1524
|
-
});
|
|
1584
|
+
self.$refs.Fields.forEach((f) => {
|
|
1585
|
+
if (f.model && typeof f.validExcute !== 'undefined') {
|
|
1586
|
+
if (!f.validExcute()) {
|
|
1587
|
+
if (i === 0) {
|
|
1588
|
+
if (f.model.is == "ct-file" || f.model.is == "ct-repeat" || f.model.is == "ct-form-list-table") {
|
|
1589
|
+
self.$message({
|
|
1590
|
+
message: f.validMessage,
|
|
1591
|
+
type: 'error',
|
|
1592
|
+
showClose: true,
|
|
1593
|
+
});
|
|
1594
|
+
}
|
|
1595
|
+
else {
|
|
1596
|
+
if (f.validMessage) {
|
|
1597
|
+
if (f.validMessage == '必填' && (f.model.label || (f.model.attrs && f.model.attrs.placeholder))) {
|
|
1598
|
+
let m = f.model.label;
|
|
1599
|
+
if (!m && f.model.attrs && f.model.attrs.placeholder) {
|
|
1600
|
+
m = f.model.attrs.placeholder;
|
|
1525
1601
|
}
|
|
1602
|
+
self.$message({
|
|
1603
|
+
message: '【' + m + '】' + f.validMessage,
|
|
1604
|
+
type: 'error',
|
|
1605
|
+
showClose: true,
|
|
1606
|
+
});
|
|
1526
1607
|
}
|
|
1527
1608
|
else {
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1609
|
+
self.$message({
|
|
1610
|
+
message: f.validMessage,
|
|
1611
|
+
type: 'error',
|
|
1612
|
+
showClose: true,
|
|
1613
|
+
});
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
else {
|
|
1617
|
+
if (f.model.label) {
|
|
1618
|
+
self.$message({
|
|
1619
|
+
message: '【' + f.model.label + '】不能为空!',
|
|
1620
|
+
type: 'error',
|
|
1621
|
+
showClose: true,
|
|
1622
|
+
});
|
|
1535
1623
|
}
|
|
1536
1624
|
}
|
|
1537
1625
|
}
|
|
1538
|
-
|
|
1626
|
+
}
|
|
1627
|
+
i++;
|
|
1539
1628
|
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1629
|
+
if (!jump) {
|
|
1630
|
+
if (self.model.isHorizontalLayout) {//水平布局
|
|
1631
|
+
self.activeName = f.model.collapseName.toString() === '-1' ? self.activeName : f.model.collapseName.toString();
|
|
1632
|
+
jump = true;
|
|
1633
|
+
}
|
|
1634
|
+
else {//垂直布局
|
|
1635
|
+
let timeOut = 0;
|
|
1636
|
+
//展开折叠
|
|
1637
|
+
if (f.collapseName != -1 && self.collapseActiveNames.indexOf(f.model.collapseName) == -1) {
|
|
1638
|
+
self.collapseActiveNames.push(f.model.collapseName);
|
|
1639
|
+
timeOut = 300;//展开折叠有个时间并影响滚动条位置,故需要延迟
|
|
1544
1640
|
}
|
|
1545
|
-
else {//垂直布局
|
|
1546
|
-
let timeOut = 0;
|
|
1547
|
-
//展开折叠
|
|
1548
|
-
if (f.collapseName != -1 && self.collapseActiveNames.indexOf(f.model.collapseName) == -1) {
|
|
1549
|
-
self.collapseActiveNames.push(f.model.collapseName);
|
|
1550
|
-
timeOut = 300;//展开折叠有个时间并影响滚动条位置,故需要延迟
|
|
1551
|
-
}
|
|
1552
1641
|
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
}
|
|
1565
|
-
this.$common.setScrollTop(total);
|
|
1566
|
-
}
|
|
1567
|
-
else if (f.$el.offsetParent.offsetParent.offsetParent.classList[0] === 'ct-dialog_wrapper') {
|
|
1568
|
-
total = f.$el.offsetParent.offsetTop - 45;
|
|
1569
|
-
document.querySelector(".ct-dialog_body").children[0].scrollTop = total;
|
|
1570
|
-
}
|
|
1571
|
-
else if (f.$el.offsetParent.offsetParent.offsetParent.localName === "body") {
|
|
1572
|
-
this.$common.setScrollTop(total);
|
|
1573
|
-
}
|
|
1574
|
-
else {
|
|
1575
|
-
f.$el.offsetParent.offsetParent.offsetParent.scrollTop = total;
|
|
1642
|
+
self.timeoutHandle = setTimeout(function () {
|
|
1643
|
+
if (f.$el.offsetParent && f.$el.offsetParent.offsetParent) {
|
|
1644
|
+
let total = f.$el.offsetParent.offsetParent.offsetTop;
|
|
1645
|
+
if (f.$el.offsetParent.offsetParent.offsetParent === null
|
|
1646
|
+
|| f.$el.offsetParent.offsetParent.offsetParent.classList[0] === 'app-main'
|
|
1647
|
+
|| f.$el.offsetParent.offsetParent.classList[0] === 'app-main') {
|
|
1648
|
+
total = f.$el.offsetParent.offsetTop;
|
|
1649
|
+
if (f.$el.offsetParent.offsetParent.classList[0] === 'app-main'
|
|
1650
|
+
&& f.$el.offsetTop > f.$el.offsetParent.offsetTop
|
|
1651
|
+
&& f.$el.offsetParent.classList[0] === 'el-row') {
|
|
1652
|
+
total = f.$el.offsetTop;
|
|
1576
1653
|
}
|
|
1654
|
+
this.$common.setScrollTop(total);
|
|
1577
1655
|
}
|
|
1578
|
-
|
|
1656
|
+
else if (f.$el.offsetParent.offsetParent.offsetParent.classList[0] === 'ct-dialog_wrapper') {
|
|
1657
|
+
total = f.$el.offsetParent.offsetTop - 45;
|
|
1658
|
+
document.querySelector(".ct-dialog_body").children[0].scrollTop = total;
|
|
1659
|
+
}
|
|
1660
|
+
else if (f.$el.offsetParent.offsetParent.offsetParent.localName === "body") {
|
|
1661
|
+
this.$common.setScrollTop(total);
|
|
1662
|
+
}
|
|
1663
|
+
else {
|
|
1664
|
+
f.$el.offsetParent.offsetParent.offsetParent.scrollTop = total;
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
}, timeOut);
|
|
1579
1668
|
|
|
1580
|
-
|
|
1581
|
-
}
|
|
1669
|
+
jump = true;
|
|
1582
1670
|
}
|
|
1583
|
-
rtnBool = false;
|
|
1584
1671
|
}
|
|
1672
|
+
rtnBool = false;
|
|
1585
1673
|
}
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1674
|
+
}
|
|
1675
|
+
});
|
|
1676
|
+
return rtnBool;
|
|
1677
|
+
},
|
|
1678
|
+
collapseHandleChange(itemArr) {
|
|
1679
|
+
let fieldTarget = this.model.fields.filter((v) => {
|
|
1680
|
+
return itemArr.indexOf(v.collapseName) > 0;
|
|
1681
|
+
});
|
|
1682
|
+
fieldTarget.forEach((f) => {
|
|
1683
|
+
if (f.self && f.self.resize) {
|
|
1684
|
+
f.self.resize();
|
|
1685
|
+
}
|
|
1686
|
+
});
|
|
1687
|
+
},
|
|
1688
|
+
getFormObj(moreFormObj) {
|
|
1689
|
+
let formData = this.model.getFormObj();
|
|
1690
|
+
if (this.$route && this.$route.query && this.$route.query.pageStyle) {
|
|
1691
|
+
Object.assign(formData, { 'pageStyle': this.$route.query.pageStyle });
|
|
1692
|
+
}
|
|
1693
|
+
if (moreFormObj) {
|
|
1694
|
+
Object.assign(formData, moreFormObj);
|
|
1695
|
+
}
|
|
1696
|
+
return formData;
|
|
1697
|
+
},
|
|
1698
|
+
getFileData(field) {
|
|
1699
|
+
var self = this;
|
|
1700
|
+
var submitData = {};
|
|
1701
|
+
var tempFormData = this.model.getFormObj();
|
|
1702
|
+
if (field.flagAttachSearchCondition) {
|
|
1703
|
+
submitData.jsonData = tempFormData;
|
|
1704
|
+
}
|
|
1705
|
+
else {
|
|
1706
|
+
if (field.submitFormField) {
|
|
1707
|
+
field.submitFormField.forEach((v) => {
|
|
1708
|
+
submitData[v] = self.$common.getDataOfUpperLower(tempFormData, v);
|
|
1709
|
+
if (submitData[v] == undefined || submitData[v] == null || submitData[v] == '') {
|
|
1710
|
+
if (self.parentModelForm) {
|
|
1711
|
+
submitData[v] = self.parentModelForm.getFormObj()[v];
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
});
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
return submitData;
|
|
1718
|
+
},
|
|
1719
|
+
setCss() {
|
|
1720
|
+
if (this.topHeight > -1) {
|
|
1721
|
+
this.minHeight = (document.documentElement.clientHeight - this.topHeight - 20) + 'px';
|
|
1722
|
+
}
|
|
1723
|
+
},
|
|
1724
|
+
tabClickHandler() {
|
|
1725
|
+
this.$nextTick(() => {
|
|
1726
|
+
});
|
|
1727
|
+
},
|
|
1728
|
+
refreshPage() {
|
|
1729
|
+
this.$nextTick(() => {
|
|
1730
|
+
});
|
|
1731
|
+
},
|
|
1732
|
+
flagNotificationParentAfterContentChanged() {
|
|
1733
|
+
this.init();
|
|
1734
|
+
},
|
|
1735
|
+
ViewerFileToggle(isOpen, mediaAlbum, groupIndex, index) {
|
|
1736
|
+
if (isOpen) {
|
|
1737
|
+
this.media = { MediaAlbum: mediaAlbum, groupIndex, index, flagLeft: false, random: Math.random() };
|
|
1738
|
+
}
|
|
1739
|
+
if (this.showViewerFile != isOpen) {
|
|
1740
|
+
this.showViewerFile = isOpen;
|
|
1741
|
+
let width = 650;
|
|
1742
|
+
this.dialogHeight = parseInt(this.minHeight || this.$refs.formRef.clientHeight);
|
|
1743
|
+
this.$emit('ToggleWidth', (this.showViewerFile ? width : -width));
|
|
1744
|
+
}
|
|
1745
|
+
},
|
|
1746
|
+
ViewerFilechangeIndex({ groupIndex, index }) {
|
|
1747
|
+
if (this.media) {
|
|
1748
|
+
this.media.groupIndex = groupIndex;
|
|
1749
|
+
this.media.index = index;
|
|
1750
|
+
}
|
|
1751
|
+
},
|
|
1752
|
+
ChangeFileList(mediaAlbum, groupIndex, index) {
|
|
1753
|
+
if (!this.showViewerFile) {
|
|
1754
|
+
return;
|
|
1755
|
+
} else {
|
|
1756
|
+
if (mediaAlbum[0].medias.length <= 0) {
|
|
1757
|
+
ViewerFileToggle(false);
|
|
1758
|
+
return;
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
const oldMedia = this.media;
|
|
1762
|
+
let newGroupIndex, newIndex, shouldShow;
|
|
1763
|
+
|
|
1764
|
+
// 情况1:没有旧记录,直接用传入索引,无效则找第一张
|
|
1765
|
+
if (!oldMedia || !oldMedia.MediaAlbum) {
|
|
1766
|
+
if (this.validatePosition(mediaAlbum, groupIndex, index)) {
|
|
1767
|
+
newGroupIndex = groupIndex;
|
|
1768
|
+
newIndex = index;
|
|
1769
|
+
shouldShow = true;
|
|
1770
|
+
} else {
|
|
1771
|
+
const first = this.findFirstValidPosition(mediaAlbum);
|
|
1772
|
+
if (first) {
|
|
1773
|
+
newGroupIndex = first.groupIndex;
|
|
1774
|
+
newIndex = first.index;
|
|
1775
|
+
shouldShow = true;
|
|
1776
|
+
} else {
|
|
1777
|
+
// 整个相册无图,直接关闭查看器,但依然要更新 MediaAlbum
|
|
1778
|
+
newGroupIndex = 0;
|
|
1779
|
+
newIndex = 0;
|
|
1780
|
+
shouldShow = false;
|
|
1596
1781
|
}
|
|
1597
|
-
});
|
|
1598
|
-
},
|
|
1599
|
-
getFormObj(moreFormObj) {
|
|
1600
|
-
let formData = this.model.getFormObj();
|
|
1601
|
-
if (this.$route && this.$route.query && this.$route.query.pageStyle) {
|
|
1602
|
-
Object.assign(formData, { 'pageStyle': this.$route.query.pageStyle });
|
|
1603
1782
|
}
|
|
1604
|
-
|
|
1605
|
-
|
|
1783
|
+
} else {
|
|
1784
|
+
// 取出旧图片
|
|
1785
|
+
const oldAlbumList = oldMedia.MediaAlbum;
|
|
1786
|
+
const oldGroup = oldAlbumList && oldAlbumList[oldMedia.groupIndex];
|
|
1787
|
+
const oldFile = oldGroup && oldGroup.medias && oldGroup.medias[oldMedia.index];
|
|
1788
|
+
|
|
1789
|
+
if (oldFile) {
|
|
1790
|
+
// 尝试在新相册中定位旧图
|
|
1791
|
+
const found = this.findFileInAlbum(mediaAlbum, oldFile);
|
|
1792
|
+
if (found) {
|
|
1793
|
+
// 找到了,移动到新位置
|
|
1794
|
+
newGroupIndex = found.groupIndex;
|
|
1795
|
+
newIndex = found.index;
|
|
1796
|
+
shouldShow = true;
|
|
1797
|
+
} else {
|
|
1798
|
+
// 旧图被删,回退
|
|
1799
|
+
const fallback = this.fallbackPosition(mediaAlbum, oldMedia.groupIndex, oldMedia.index);
|
|
1800
|
+
newGroupIndex = fallback.groupIndex;
|
|
1801
|
+
newIndex = fallback.index;
|
|
1802
|
+
shouldShow = fallback.show;
|
|
1803
|
+
}
|
|
1804
|
+
} else {
|
|
1805
|
+
// 旧记录无效,同样回退
|
|
1806
|
+
const fallback = this.fallbackPosition(mediaAlbum, oldMedia.groupIndex, oldMedia.index);
|
|
1807
|
+
newGroupIndex = fallback.groupIndex;
|
|
1808
|
+
newIndex = fallback.index;
|
|
1809
|
+
shouldShow = fallback.show;
|
|
1606
1810
|
}
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1811
|
+
}
|
|
1812
|
+
this.ViewerFileToggle(this.showViewerFile, mediaAlbum, newGroupIndex, newIndex);
|
|
1813
|
+
},
|
|
1814
|
+
validatePosition(albumList, gIdx, idx) {
|
|
1815
|
+
if (!albumList || gIdx < 0 || gIdx >= albumList.length) {
|
|
1816
|
+
return false;
|
|
1817
|
+
}
|
|
1818
|
+
var group = albumList[gIdx];
|
|
1819
|
+
var medias = group && group.medias;
|
|
1820
|
+
return medias && idx >= 0 && idx < medias.length;
|
|
1821
|
+
},
|
|
1822
|
+
findFirstValidPosition(albumList) {
|
|
1823
|
+
if (!albumList) {
|
|
1824
|
+
return null;
|
|
1825
|
+
}
|
|
1826
|
+
for (var g = 0; g < albumList.length; g++) {
|
|
1827
|
+
var group = albumList[g];
|
|
1828
|
+
var medias = group && group.medias;
|
|
1829
|
+
if (medias && medias.length > 0) {
|
|
1830
|
+
return { groupIndex: g, index: 0 };
|
|
1615
1831
|
}
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1832
|
+
}
|
|
1833
|
+
return null;
|
|
1834
|
+
},
|
|
1835
|
+
findFileInAlbum(albumList, targetFile) {
|
|
1836
|
+
if (!albumList) {
|
|
1837
|
+
return null;
|
|
1838
|
+
}
|
|
1839
|
+
// 先按引用查找
|
|
1840
|
+
for (var g = 0; g < albumList.length; g++) {
|
|
1841
|
+
var medias = albumList[g].medias;
|
|
1842
|
+
if (!medias) continue;
|
|
1843
|
+
for (var i = 0; i < medias.length; i++) {
|
|
1844
|
+
if (medias[i] === targetFile) {
|
|
1845
|
+
return { groupIndex: g, index: i };
|
|
1626
1846
|
}
|
|
1627
1847
|
}
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1848
|
+
}
|
|
1849
|
+
// 如果引用匹配不到,尝试用 id(如果存在)
|
|
1850
|
+
if (targetFile && targetFile.id != null) {
|
|
1851
|
+
for (var g2 = 0; g2 < albumList.length; g2++) {
|
|
1852
|
+
var medias2 = albumList[g2].medias;
|
|
1853
|
+
if (!medias2) continue;
|
|
1854
|
+
for (var i2 = 0; i2 < medias2.length; i2++) {
|
|
1855
|
+
if (medias2[i2].id === targetFile.id) {
|
|
1856
|
+
return { groupIndex: g2, index: i2 };
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1633
1859
|
}
|
|
1634
|
-
}
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1860
|
+
}
|
|
1861
|
+
return null;
|
|
1862
|
+
},
|
|
1863
|
+
fallbackPosition(albumList, prefGroup, prefIndex) {
|
|
1864
|
+
if (!albumList || albumList.length === 0) {
|
|
1865
|
+
return { groupIndex: 0, index: 0, show: false };
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
// 确保参考相册索引在有效范围内
|
|
1869
|
+
var gIdx = Math.min(prefGroup, albumList.length - 1);
|
|
1870
|
+
var group = albumList[gIdx];
|
|
1871
|
+
var medias = group && group.medias ? group.medias : [];
|
|
1872
|
+
|
|
1873
|
+
// 1. 同相册内回退
|
|
1874
|
+
if (medias.length > 0) {
|
|
1875
|
+
var newIdx;
|
|
1876
|
+
if (prefIndex > 0 && prefIndex <= medias.length) {
|
|
1877
|
+
// 优先上一张
|
|
1878
|
+
newIdx = prefIndex - 1;
|
|
1879
|
+
} else if (prefIndex === 0 && medias.length > 1) {
|
|
1880
|
+
// 第一张被删了,取下一张(索引 1)
|
|
1881
|
+
newIdx = 1;
|
|
1882
|
+
} else {
|
|
1883
|
+
// 只剩这一张,还是它
|
|
1884
|
+
newIdx = 0;
|
|
1885
|
+
}
|
|
1886
|
+
return { groupIndex: gIdx, index: newIdx, show: true };
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
// 2. 向前找非空相册,取最后一张
|
|
1890
|
+
for (var g = gIdx - 1; g >= 0; g--) {
|
|
1891
|
+
var m = albumList[g].medias || [];
|
|
1892
|
+
if (m.length > 0) {
|
|
1893
|
+
return { groupIndex: g, index: m.length - 1, show: true };
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
// 3. 向后找非空相册,取第一张
|
|
1898
|
+
for (var g2 = gIdx + 1; g2 < albumList.length; g2++) {
|
|
1899
|
+
var m2 = albumList[g2].medias || [];
|
|
1900
|
+
if (m2.length > 0) {
|
|
1901
|
+
return { groupIndex: g2, index: 0, show: true };
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1905
|
+
// 整个相册没有任何图片了
|
|
1906
|
+
return { groupIndex: 0, index: 0, show: false };
|
|
1646
1907
|
}
|
|
1647
1908
|
}
|
|
1909
|
+
}
|
|
1648
1910
|
</script>
|
|
1649
1911
|
<style>
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1912
|
+
.el-collapse {
|
|
1913
|
+
border-top: none;
|
|
1914
|
+
}
|
|
1653
1915
|
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1916
|
+
.ct-collapse-item-title .el-collapse-item__header {
|
|
1917
|
+
color: #303133 !important;
|
|
1918
|
+
line-height: normal;
|
|
1919
|
+
}
|
|
1658
1920
|
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
.button-initial {
|
|
1664
|
-
line-height: 34px;
|
|
1665
|
-
}
|
|
1921
|
+
.el-collapse-saveLine .ct-collapse-item-title:last-child .el-collapse-item__wrap {
|
|
1922
|
+
border-bottom: none;
|
|
1923
|
+
}
|
|
1666
1924
|
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1925
|
+
.button-initial {
|
|
1926
|
+
line-height: 34px;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
.button-absolute {
|
|
1930
|
+
z-index: 100;
|
|
1931
|
+
/* bottom: 6px; */
|
|
1932
|
+
bottom: 0;
|
|
1933
|
+
left: 0;
|
|
1934
|
+
right: 0;
|
|
1935
|
+
border-radius: 0 0 4px 4px;
|
|
1936
|
+
position: absolute;
|
|
1937
|
+
line-height: 34px;
|
|
1938
|
+
background-color: #fff;
|
|
1939
|
+
width: 100%;
|
|
1940
|
+
margin: auto;
|
|
1941
|
+
box-shadow: 0 2px 20px 0 rgb(0 0 0 / 10%);
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
.tip-absolute {
|
|
1945
|
+
width: '100%';
|
|
1946
|
+
z-index: 100;
|
|
1947
|
+
margin-top: -10px;
|
|
1948
|
+
/* top : 44px; */
|
|
1949
|
+
left: 0;
|
|
1950
|
+
right: 0;
|
|
1951
|
+
position: absolute;
|
|
1952
|
+
line-height: 24px;
|
|
1953
|
+
background-color: #ffe7cc;
|
|
1954
|
+
color: #EC3D3D;
|
|
1955
|
+
border-radius: 5px;
|
|
1956
|
+
padding: 8px;
|
|
1957
|
+
font-size: 12px;
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
.tip-bottom {
|
|
1961
|
+
line-height: 24px;
|
|
1962
|
+
background-color: #ffe7cc;
|
|
1963
|
+
color: #EC3D3D;
|
|
1964
|
+
border-radius: 5px;
|
|
1965
|
+
padding: 8px;
|
|
1966
|
+
font-size: 12px;
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
.tip-bottom-absolute {
|
|
1970
|
+
width: '100%';
|
|
1971
|
+
z-index: 100;
|
|
1972
|
+
bottom: 0;
|
|
1973
|
+
left: 0;
|
|
1974
|
+
right: 0;
|
|
1975
|
+
position: absolute;
|
|
1976
|
+
line-height: 24px;
|
|
1977
|
+
background-color: #ffe7cc;
|
|
1978
|
+
color: #EC3D3D;
|
|
1979
|
+
border-radius: 5px;
|
|
1980
|
+
padding: 8px;
|
|
1981
|
+
font-size: 12px;
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
.tip-bottom-absolute40 {
|
|
1985
|
+
width: '100%';
|
|
1986
|
+
z-index: 100;
|
|
1987
|
+
bottom: 40px;
|
|
1988
|
+
left: 0;
|
|
1989
|
+
right: 0;
|
|
1990
|
+
position: absolute;
|
|
1991
|
+
line-height: 24px;
|
|
1992
|
+
background-color: #ffe7cc;
|
|
1993
|
+
color: #EC3D3D;
|
|
1994
|
+
border-radius: 5px;
|
|
1995
|
+
padding: 8px;
|
|
1996
|
+
font-size: 12px;
|
|
1997
|
+
}
|
|
1734
1998
|
</style>
|