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.
@@ -1,1022 +1,1110 @@
1
1
  <template>
2
- <div ref="formRef" v-loading="loading" :style="{width:pageWidth?pageWidth+'px':'100%',margin:'auto','min-height': minHeight,padding:'10px'}">
3
- <div ref="fieldsRef" v-if="model !== null && !loading" class="ct-form" :class="{'domDisabled':model.pageDisabled}" :key="formKey">
4
- <div ref="topTipRef" v-if="model.tip" class="tip-absolute">
5
- <span v-html="model.tip"></span>
6
- </div>
7
- <div v-if="(!this.model.isHorizontalLayout || this.flagScroll) && model.tip" :style="{'height': (model.tip ? 30:0) + 'px'}"></div>
8
-
9
- <!--可根据场景判断显示el-card还是el-main-->
10
- <component :is="model.showTitle?'el-main':'el-card'">
11
- <div slot="header" class="clearfix" v-if="typeof model.title !== 'undefined' && model.flagShowTitle">
12
- <span style="font-weight:bold">{{model.title}}</span>
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
- <el-row v-if="collapseFieldsRow.length > 0">
32
- <template v-for="(col, index) in collapseFieldsRow[0]">
33
- <template v-if="col.show !== false && col.lineFeed">
34
- <div style="float: left;width: 100%;"></div>
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
- <!--tabs-->
60
- <el-tabs ref="tabsRef" v-if="model.isHorizontalLayout" v-model="activeName" @tab-click="tabClickHandler">
61
- <el-tab-pane :name="index.toString()" :lazy="item.lazyLoad"
62
- v-for="(item, index) in collapse" v-if="item.show !== false" :key="index">
63
- <template slot="label">
64
- <span v-html="item.label"></span>
65
- </template>
66
- <el-row>
67
- <template v-for="(col, index) in collapseFieldsRow[index + 1]">
68
- <template v-if="col.show !== false && col.lineFeed">
69
- <div style="display: flex; flex: 0 0 100%;"></div>
70
- <el-col :key="index" :span="col.colspan" v-if="col.show !== false" style="padding:5px">
71
- <component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model" v-bind="col.bindPara"
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
- </el-tab-pane>
94
- <template v-if="model.flagFixedTabOnHorizontalLayout">
95
- <!--尾部元素-->
96
- <el-row ref="independentRef" v-if="independentItem.length > 0" style="margin-top: 20px;">
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="display: flex; flex: 0 0 100%;"></div>
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
- <component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model" v-bind="col.bindPara"
102
- :fileData="getFileData(col)" :from="'form'" :documentHeight="documentHeight" :documentWidth="documentWidth"
103
- @click="fieldClickHandler(col,$event)" @change="changeHandler(col,$event)" @enter="enterHandler(col,$event)"
104
- @input="inputHandler(col,$event)" @importComplete="importComplete" @blur="blurHandler(col,$event)"
105
- @popupSearchList="popupSearchListHandler" @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
106
- @popupLocation="popupLocationHandler"
107
- @tableButtonClick="clickHandler"></component>
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" v-bind="col.bindPara"
113
- :fileData="getFileData(col)" :from="'form'" :documentHeight="documentHeight" :documentWidth="documentWidth"
114
- @click="fieldClickHandler(col,$event)" @change="changeHandler(col,$event)" @enter="enterHandler(col,$event)"
115
- @input="inputHandler(col,$event)" @importComplete="importComplete" @blur="blurHandler(col,$event)"
116
- @popupSearchList="popupSearchListHandler" @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
117
- @popupLocation="popupLocationHandler"
118
- @tableButtonClick="clickHandler"></component>
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
- <el-collapse v-else v-model="collapseActiveNames" @change="collapseHandleChange" :class="model.flagHideSaveLine?'el-collapse-saveLine':''">
133
- <el-collapse-item v-for="(item, index) in collapse" v-if="item.show !== false" :key="index" :title="item.label" :name="index" :disabled="item.lock" :class="item.lock?'ct-collapse-item-title':''">
134
- <template slot="title">
135
- <i class="sign"></i>
136
- <span :class="[item.labelClass]">{{item.label}}</span>
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
- <template v-else>
153
- <el-col :key="index" :span="col.colspan" v-if="col.show !== false" style="padding:5px">
154
- <component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model" v-bind="col.bindPara"
155
- :fileData="getFileData(col)" :from="'form'" :documentHeight="documentHeight" :documentWidth="documentWidth"
156
- @click="fieldClickHandler(col,$event)" @change="changeHandler(col,$event)" @enter="enterHandler(col,$event)"
157
- @input="inputHandler(col,$event)" @importComplete="importComplete" @blur="blurHandler(col,$event)"
158
- @popupSearchList="popupSearchListHandler" @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
159
- @popupLocation="popupLocationHandler"
160
- @tableButtonClick="clickHandler"></component>
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
- </template>
145
+ </el-row>
163
146
  </template>
164
- </el-row>
165
- </el-collapse-item>
166
- </el-collapse>
147
+ </el-tabs>
167
148
 
168
- <template v-if="!model.flagFixedTabOnHorizontalLayout">
169
- <!--尾部元素-->
170
- <el-row ref="independentRef" v-if="independentItem.length > 0" style="margin-top: 20px;">
171
- <template v-for="(col, index) in independentItem">
172
- <template v-if="col.show !== false && col.lineFeed">
173
- <div style="display: flex; flex: 0 0 100%;"></div>
174
- <el-col :key="index" v-if="col.show !== false" :span="col.colspan" style="padding:5px">
175
- <component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model" v-bind="col.bindPara"
176
- :fileData="getFileData(col)" :from="'form'" :documentHeight="documentHeight" :documentWidth="documentWidth"
177
- @click="fieldClickHandler(col,$event)" @change="changeHandler(col,$event)" @enter="enterHandler(col,$event)"
178
- @input="inputHandler(col,$event)" @importComplete="importComplete" @blur="blurHandler(col,$event)"
179
- @popupSearchList="popupSearchListHandler" @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
180
- @popupLocation="popupLocationHandler"
181
- @tableButtonClick="clickHandler"></component>
182
- </el-col>
183
- </template>
184
- <template v-else>
185
- <el-col :key="index" v-if="col.show !== false" :span="col.colspan" style="padding:5px">
186
- <component ref="Fields" :is="col.is" :vmodel="col" :api="model.optionApi" :parentModel="model" v-bind="col.bindPara"
187
- :fileData="getFileData(col)" :from="'form'" :documentHeight="documentHeight" :documentWidth="documentWidth"
188
- @click="fieldClickHandler(col,$event)" @change="changeHandler(col,$event)" @enter="enterHandler(col,$event)"
189
- @input="inputHandler(col,$event)" @importComplete="importComplete" @blur="blurHandler(col,$event)"
190
- @popupSearchList="popupSearchListHandler" @flagNotificationParentAfterContentChanged="flagNotificationParentAfterContentChanged"
191
- @popupLocation="popupLocationHandler"
192
- @tableButtonClick="clickHandler"></component>
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
- </template>
232
+ </el-row>
195
233
  </template>
196
- </el-row>
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
- <div v-if="model.bottomTip || (model.buttons.length>0 && model.buttons.findIndex((v)=>{return v.show}) > -1)"
206
- :style="{'height': (model.bottomTip ? 34:0) + (model.buttons.length>0 && model.buttons.findIndex((v)=>{return v.show}) > -1?34:0) + 'px'}"></div>
207
- </div>
208
- <div ref="bottomTipRef" v-if="model && !loading && model.bottomTip"
209
- :class="(model.buttons.length>0 && model.buttons.findIndex((v)=>{return v.show}) > -1?'tip-bottom-absolute40':'tip-bottom-absolute')">
210
- <span v-html="model.bottomTip"></span>
211
- </div>
212
- <div ref="buttonsRef" v-if="model && !loading && model.buttons.length>0 && model.buttons.findIndex((v)=>{return v.show}) > -1"
213
- :class="isScroll?'ccai button-absolute':'button-absolute'" :style="{'max-width':pageWidth?(pageWidth-20)+'px':'100%'}">
214
- <el-col :span="24" style="display: flex;align-items: center;justify-content: center;height: 40px ;padding-bottom: 1px;padding-left: 5px;padding-right: 5px;" class="btnPadBom">
215
- <component v-for="(btn, index) in model.buttons" :key="index" :is="btn.is" :vmodel="btn" @click="clickHandler" v-if="btn.show"
216
- :style="{'float':btn.isCheckbox ? btn.alignCss:''}"></component>
217
- </el-col>
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
- import dynamicElement from '../../mixins/dynamicElement'
225
- import dynamicFormListTalbe from './dynamicFormListTable'
226
- import { setTimeout } from 'timers';
227
- export default {
228
- name: 'ct-form',
229
- mixins: [dynamicElement],
230
- components: {
231
- 'ct-form-list-table': dynamicFormListTalbe
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
- props: {
234
- api: String,
235
- vmodel: Object,
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
- data() {
281
- return {
282
- isScroll: false,
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
- deactivated(){
296
- this.downloadUrl="";
319
+ documentWidth: {
320
+ String,
321
+ default: 'auto',
297
322
  },
298
- mounted() {
299
- this.init();
300
- this.setCss();
301
- this.$nextTick(() => {
302
- this.tipWidth=this.$el.clientWidth;
303
- })
323
+ flagScroll: {
324
+ Boolean,
325
+ default: false,
304
326
  },
305
- updated() {
306
- this.computeScroll();
327
+ drowerClose: {
328
+ String,
329
+ default: 'close',
307
330
  },
308
- destroyed (){
309
- this.$off();
310
- if(this.timeoutHandle){
311
- clearTimeout(this.timeoutHandle)
312
- }
313
- if(this.$el.parentNode)this.$el.parentNode.removeChild(this.$el);
314
- if(this.model && typeof this.model.scripts !== 'undefined') {
315
- this.model.scripts.formData.form = null;
316
- this.model.scripts.formData.excuteData = null;
317
- this.model.scripts.formData.fieldsDic = null;
318
- this.model.scripts.formData = null;
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
- this.collapse=[];
321
- this.collapseActiveNames=[];
322
- this.collapseFieldsRow=[];
323
- this.independentItem=[];
324
- this.isHorizontalLayout=false;
325
- if(this.model){
326
- this.model.links = null;
327
- this.model.buttons = null;
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
- methods: {
333
- computeScroll(){
334
- this.$nextTick(() => {
335
- if(this.$el){
336
- let parentDom=this.$el.parentElement;
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
- this.isScroll = true;
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
- this.loadFields();
382
- this.loadTabs();
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
- if (this.model.onload) {
385
- let onloads = this.model.onload.split(';');
386
- onloads.forEach((v, index) => {
387
- self.$common.excute.call(self.model.scripts, v);
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
- this.loading = false;
392
- //通知父组件加载完成
393
- this.$emit('loaded', this.model);
394
- },
395
- loadFields() {
396
- var self = this;
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
- var collapseItemArr = [];//分组对应元素二维数组
399
- var collapseItem = [];//分组对应元素数组
400
- let realCollapseActiveNames = [];//真实的默认展开的分组name
401
- let isIndependent = false;
402
- self.model.fields.forEach((v, index) => {
403
- v.index = index;
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
- self.collapse.push(v);
414
- if (v.isExpand && self.activeName == '-1') {
415
- self.activeName = (self.collapse.length - 1).toString();
416
- }
417
- if (v.lock || v.isExpand) {
418
- realCollapseActiveNames.push(self.collapse.length - 1);
419
- }
420
- self.collapseActiveNames.push(self.collapse.length - 1);
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
- collapseItemArr.push(collapseItem);
423
- v.collapseName = collapseItemArr.length - 1;
424
- collapseItem = [];
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.is === 'ct-repeat') {
431
- v.collapseName = collapseItemArr.length - 1;
432
- collapseItem.push(v);
505
+ if (v.lock || v.isExpand) {
506
+ realCollapseActiveNames.push(self.collapse.length - 1);
433
507
  }
434
- });
435
- if (self.activeName === '-1') self.activeName = '0';
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
- for (var i = 0; i < collapseItemArr.length; i++) {
442
- var myFilter = collapseItemArr[i];
528
+ //遍历分组里的组件,计算行列布局
529
+ for (var i = 0; i < collapseItemArr.length; i++) {
530
+ var myFilter = collapseItemArr[i];
443
531
 
444
- self.collapseFieldsRow.push(myFilter);
445
- }
446
- //因有一些子组件需要计算宽度及高度,故要先全部展开在缩起来
447
- //也可采用方案二:子组件中,找不到高度,产生一个定时器,找到为止
448
- //方案三:在显示分组时,主动触发resize方法
449
- self.$nextTick(() => {
450
- self.$set(self, 'collapseActiveNames', realCollapseActiveNames);
451
- });
532
+ self.collapseFieldsRow.push(myFilter);
533
+ }
534
+ //因有一些子组件需要计算宽度及高度,故要先全部展开在缩起来
535
+ //也可采用方案二:子组件中,找不到高度,产生一个定时器,找到为止
536
+ //方案三:在显示分组时,主动触发resize方法
537
+ self.$nextTick(() => {
538
+ self.$set(self, 'collapseActiveNames', realCollapseActiveNames);
539
+ });
452
540
 
453
- //联动组件处理 todo:去掉,使用form方式
454
- var hasParent = self.model.fields.filter((v) => {
455
- return typeof v.parentName !== 'undefined';
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
- hasParent.forEach((v, index) => {
458
- var parent = self.model.fields.find((v1) => {
459
- return v1.id === v.parentName;
460
- });
461
- if (parent) {
462
- parent.child = parent.child ? parent.child : [];
463
- parent.child.push(v);
464
- v.parent = parent;
465
- }
466
- });
467
- },
468
- loadTabs(){
469
- this.$nextTick(function () {
470
- if(this.model.flagFixedTabOnHorizontalLayout && this.model.isHorizontalLayout && this.collapse.length > 0){
471
- let h1 = this.$refs.formRef.parentElement.offsetHeight - 10 | 0;
472
- let h2 = this.$refs.tabsRef.$el.children[1].offsetTop + 15 | 0;
473
- let h3 = this.$refs.independentRef ? this.$refs.independentRef.$el.offsetHeight + 20 : 0;
474
- let h4 = this.$refs.linksRef ? this.$refs.linksRef.$el.offsetHeight : 0;
475
- let h5 = this.$refs.buttonsRef ? this.$refs.buttonsRef.children[0].offsetHeight : 0;
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
- else{
486
- if(this.$refs.formRef && (!this.model.isHorizontalLayout || this.flagScroll)){
487
- let h1 = this.$refs.formRef.parentElement.offsetHeight;
488
- // let h5 = this.$refs.buttonsRef ? this.$refs.buttonsRef.children[0].offsetHeight : 0;
489
- // let h6 = this.$refs.bottomTipRef ? this.$refs.bottomTipRef.offsetHeight : 0;
490
- // let h7 = this.$refs.topTipRef ? this.$refs.topTipRef.offsetHeight : 0;
491
- // let fieldsHeight = h1 - h5 - h6 - h7;
492
- // this.$refs.fieldsRef.style.height = fieldsHeight + 'px';
493
- this.minHeight = h1 + 'px';
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
- fieldClickHandler(field) {
499
- let submitData = null;
500
- var router = this.model.buttons.find((v) => {
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
- if (router == undefined) {
504
- router = this.model.links.find((v) => {
505
- return v.id === field.id;
506
- });
507
- }
508
- if (router == undefined) {
509
- router = this.model.actionRouters.find((v) => {
510
- return v.id === field.id;
511
- });
512
- }
513
- if (router && field.isSubmitDataFromSelf) {
514
- submitData = {};
515
- router.submitFormField.forEach((v) => {
516
- submitData[v] = field.list[field.listIndex].code;
517
- });
518
- }
519
- this.clickHandler(router, submitData);
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
- var clickAcion = function (field) {
527
- //若不是客户端方法,则直接访问接口
528
- if (!field.isClientFuntion) {
529
- let verified = true;
530
- if (field.isSubmit) {
531
- if (field.flagVerifyData) {
532
- verified = self.validExcute();
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
- if (verified) {
536
- //action有值,提交到后台
537
- if (field.action) {
538
- field.disabled = true;//提交按钮禁用
539
- self.model.pageDisabled = true;
624
+ //action有值,提交到后台
625
+ if (field.action) {
626
+ field.disabled = true;//提交按钮禁用
627
+ self.model.pageDisabled = true;
540
628
 
541
- if (field.flagAsync) {
542
- field.doAction(self.getFormObj(), (res) => {
543
- if (res.rtnCode === 200) {
544
- if (res.content && res.content.action) {
545
- var dialogOption = {
546
- title: field.pageTitle || field.label,
547
- content: [{
548
- component: 'ct-progress',
549
- attrs: {
550
- progressAction: res.content.action,
551
- progressKey: res.content.key,
552
- progressType: field.isExport ? 'export' : 'import',
553
- width: '350px',
554
- height: '185px'
555
- },
556
- on: {
557
- finished(data) {
558
- field.disabled = false;
559
- self.model.pageDisabled = false;
560
- self.$common.closeDialog(dialogOption.dialog);
561
- if(field.isExport){
562
- if(data.content.indexOf(".zip") > -1){
563
- window.location.href = encodeURI(data.content);
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
- if (data.notification === 17) {
582
- if(self.$common.dialogList && self.$common.dialogList.List.length > 0
583
- && (data.content.pageStyle===1 || data.content.pageStyle===3)){
653
+ else {
654
+ if (data.content.indexOf("?") > -1) {
655
+ self.downloadUrl = data.content + "&" + Math.random();
584
656
  }
585
- else{
586
- self.clickHandler(self.model.getRtnRouter(data.content), null)
657
+ else {
658
+ self.downloadUrl = data.content + "?" + Math.random();
587
659
  }
588
660
  }
589
- self.$emit('submit', { formData: self.model, responseData: data });
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: 'warning',
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
- self.$common.openDialog(dialogOption);
605
- }
689
+ }
690
+ }]
691
+ };
692
+ self.$common.openDialog(dialogOption);
606
693
  }
607
- else if (res.rtnCode === 202) {
608
- self.$common.confirm(res.rtnMsg, '提示', {
609
- confirmButtonText: '确定',
610
- cancelButtonText: '取消',
611
- type: 'warning'
612
- }).then(() => {
613
- field.doAction(self.getFormObj({ flagHaveAlert: '1' }), (res202) => {
614
- if (res202.rtnCode === 200) {
615
- if (res202.content && res202.content.action) {
616
- var dialogOption = {
617
- title: field.pageTitle || field.label,
618
- content: [{
619
- component: 'ct-progress',
620
- attrs: {
621
- progressAction: res202.content.action,
622
- progressKey: res202.content.key,
623
- progressType: field.isExport ? 'export' : 'import',
624
- width: '350px',
625
- height: '185px'
626
- },
627
- on: {
628
- finished(data) {
629
- field.disabled = false;
630
- self.model.pageDisabled = false;
631
- self.$common.closeDialog(dialogOption.dialog);
632
- if(field.isExport){
633
- if(data.content.indexOf(".zip") > -1){
634
- window.location.href = encodeURI(data.content);
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
- if (data.notification === 17) {
653
- if(self.$common.dialogList && self.$common.dialogList.List.length > 0
654
- && (data.content.pageStyle===1 || data.content.pageStyle===3)){
724
+ else {
725
+ if (data.content.indexOf("?") > -1) {
726
+ self.downloadUrl = data.content + "&" + Math.random();
655
727
  }
656
- else{
657
- self.clickHandler(self.model.getRtnRouter(data.content), null)
728
+ else {
729
+ self.downloadUrl = data.content + "?" + Math.random();
658
730
  }
659
731
  }
660
- self.$emit('submit', { formData: self.model, responseData: data });
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: 'warning',
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
- self.$common.openDialog(dialogOption);
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
- else{
696
- self.clickHandler(self.model.getRtnRouter(data.content), null)
697
- }
698
- }
699
- if (self.model.flagAlertClose) {
700
- self.$common.confirm('操作成功,是否关闭本页面?', '提示', {
701
- confirmButtonText: '确定',
702
- cancelButtonText: '取消',
703
- type: 'warning'
704
- }).then(() => {
705
- //如果没有弹框 则关闭tab页
706
- if (self.$common.dialogList && self.$common.dialogList.List.length === 0) {
707
- if (typeof self.$common.getDataDrivenOpts().handler.closeTab === 'function') {
708
- self.$common.getDataDrivenOpts().handler.closeTab();
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
- if (self.$common.dialogList && self.$common.dialogList.List.length === 0 && self.openType !=='detail'
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
- else if (data.rtnCode === 202) {
734
- self.$common.confirm(data.rtnMsg, '提示', {
787
+ if (self.model.flagAlertClose) {
788
+ self.$common.confirm('操作成功,是否关闭本页面?', '提示', {
735
789
  confirmButtonText: '确定',
736
790
  cancelButtonText: '取消',
737
791
  type: 'warning'
738
792
  }).then(() => {
739
- field.doAction(self.getFormObj({ flagHaveAlert: '1' }), (res) => {
740
- if (res.rtnCode === 200) {
741
- if (res.notification === 17) {
742
- if(self.$common.dialogList && self.$common.dialogList.List.length > 0
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
- if (data.notification === 14 || data.notification === 15|| data.notification === 16) {
756
- if (typeof self.$common.getDataDrivenOpts().handler.closeTab === 'function') {
757
- self.$common.getDataDrivenOpts().handler.closeTab();
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
- }, self.model.scripts);
761
- }
762
-
763
- }
764
- //无值,触发submit事件
765
- else {
766
- self.$emit('submit', { formData: self.model, responseData: {} });
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
- else {
772
- if (field.flagAttachSearchCondition) {
773
- if (!self.validExcute()) {
774
- return;
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
- if (!submitData) {
782
- submitData = self.getFileData(field);
783
- }
869
+ if (!submitData) {
870
+ submitData = self.getFileData(field);
871
+ }
784
872
 
785
- if(field.isTabInSystem){
786
- if(field.isOpenBaiduMap){
787
- submitData = field.getActionPara(submitData).para;
788
- self.$common.getDataDrivenOpts().handler.openTabBaiduMap(submitData,field.pageTitle || field.label);
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
- else if (field.isOpenForm) {
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
- component: 'ct-form',
830
- attrs: {
831
- api: field.action,
832
- apiParam: field.getActionPara(submitData).para,
833
- showTitle: false,
834
- width: field.dialogWidth + 'px',
835
- height: field.dialogHeight + 'px',
836
- documentHeight: self.documentHeight,
837
- documentWidth: self.documentWidth,
838
- isIframe: self.isIframe,
839
- },
840
- on: {
841
- submit(ev) {
842
- // if(ev.responseData
843
- // && ev.responseData.clientActionType
844
- // && ev.responseData.clientActionType === 2
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
- self.$common.closeDialog(dialogOption.dialog);
860
- }
861
- }
862
- }]
905
+ },
906
+ },
907
+ ],
863
908
  };
864
909
  self.$common.openDialog(dialogOption);
865
910
  }
866
- else if (field.isOpenList) {
867
- var dialogOption = {
868
- title: field.pageTitle,
869
- pane: self.$common.getParentPane(self),
870
- content: [{
871
- component: 'ct-searchlist',
872
- attrs: {
873
- searchConditionApi: field.actionForSearchLayout,
874
- searchDataApi: field.actionForSearch,
875
- apiParam: submitData,
876
- width: field.dialogWidth + 'px',
877
- height: field.dialogHeight + 'px',
878
- isIframe: self.isIframe,
879
- },
880
- on: {
881
- submit(ev) {
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
- self.$common.openDialog(dialogOption);
893
- }
894
- else if (field.isFormPageInTab) {// 外部框架tab页打开
895
- submitData = field.getActionPara(submitData).para;
896
- if (field.pageStyle) {
897
- submitData.pageStyle = field.pageStyle;
898
- }
899
- self.$common.getDataDrivenOpts().handler.openTab(field.action, submitData, field.pageTitle, self.model, field.dialogWidth);
900
- }
901
- else if (field.isSearchPageInTab) {// 外部框架tab页打开
902
- submitData = field.getActionPara(submitData).para;
903
- self.$common.getDataDrivenOpts().handler.openTabSearch(field, submitData);
904
- }
905
- else if (field.isOpenUrlInBrowse) {// 浏览器打开
906
- window.open(submitData[field.submitFormField], "_blank");
907
- }
908
- else if (field.isBrowserNewTab) {// 浏览器打开
909
- submitData = field.getActionPara(submitData).para;
910
- let query = self.$common.objectToQueryStr(submitData);
911
- window.open(field.action + query, "_blank");
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
- else if (field.isUrlInSystemTab) {//外部框架tab页打开URl
914
- submitData = field.getActionPara(submitData).para;
915
- let query = self.$common.objectToQueryStr(submitData);
916
- let urlTab = field.action + query;
917
- if(field.action.indexOf('?')>-1 && query.indexOf('?')>-1){
918
- urlTab = field.action + '&' +query.substr(1, query.length);
919
- }
920
- self.$common.getDataDrivenOpts().handler.openTabUrl(urlTab,field.pageTitle||field.label);
921
- }
922
- else if (field.isSeeVoice) {//看视频
923
- self.$common.browseVideo(field, submitData)
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
- else if (field.isBrowseAttachment) {//浏览附件
926
- var mediaviewpagetype=(field.isFormPageInTab||field.isSearchPageInTab)?2:0;
927
- var MediaAlbum = [
928
- { albumName: field.pageTitle || "媒体", medias: [] },
929
- ];
930
- if (field.action) {
931
- var callback = function (res) {
932
- let data=res.content
933
- if(typeof data =='object'&&data.mediaAlbums){
934
- MediaAlbum = data.mediaAlbums;
935
- }
936
- else{
937
- MediaAlbum[0].medias = data;
938
- }
939
- self.$common.viewerfile(field.pageTitle, MediaAlbum, 0, 0,mediaviewpagetype);
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
- field.doAction(submitData, callback);
942
- }
943
- else {
944
- submitData.mediaData.forEach((v) => {
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 if (field.isExport || field.flagAsync) {
951
- submitData = field.getActionPara(submitData).para;
952
- if (field.flagAsync) {
953
- field.doAction(submitData, (res) => {
954
- if (res.rtnCode === 200) {
955
- if (res.content && res.content.action) {
956
- var dialogOption = {
957
- title: field.pageTitle || field.label,
958
- content: [{
959
- component: 'ct-progress',
960
- attrs: {
961
- progressAction: res.content.action,
962
- progressKey: res.content.key,
963
- progressType: field.isExport ? 'export' : 'import',
964
- width: '350px',
965
- height: '185px'
966
- },
967
- on: {
968
- finished(data) {
969
- self.$common.closeDialog(dialogOption.dialog);
970
- if(field.isExport){
971
- if(data.content.indexOf(".zip") > -1){
972
- window.location.href = encodeURI(data.content);
973
- }
974
- else{
975
- if (data.content.indexOf("?") > -1) {
976
- self.downloadUrl = data.content + "&" + Math.random();
977
- }
978
- else {
979
- self.downloadUrl = data.content + "?" + Math.random();
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
- self.model.doAction(data);
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
- error(data) {
998
- self.$common.closeDialog(dialogOption.dialog);
1070
+ }
1071
+ if (data.rtnMsg) {
999
1072
  self.$message({
1000
1073
  message: data.rtnMsg,
1001
- type: 'warning',
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
- self.$common.openDialog(dialogOption);
1009
- }
1093
+ }
1094
+ }]
1095
+ };
1096
+ self.$common.openDialog(dialogOption);
1010
1097
  }
1011
- else if (res.rtnCode === 202) {
1012
- submitData.flagHaveAlert='1';
1013
- if(submitData.jsonData)submitData.jsonData.flagHaveAlert='1';
1014
- self.$common.confirm(res.rtnMsg, '提示', {
1015
- confirmButtonText: '确定',
1016
- cancelButtonText: '取消',
1017
- type: 'warning'
1018
- }).then(() => {
1019
- field.doAction(submitData, (res202) => {
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
- if (field.action.indexOf("http://") === 0 || field.action.indexOf("https://") === 0) {
1084
- if(field.action.indexOf(".zip") > -1){
1085
- window.location.href = encodeURI(field.action);
1086
- }
1087
- else{
1088
- if (field.action.indexOf("?") > -1) {
1089
- self.downloadUrl = field.action + "&" + Math.random();
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
- field.doAction(submitData, (data) => {
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
- if(typeof field.onClick !== 'undefined'){
1158
- self.$common.excute.call(self.model.scripts, field.onClick)
1159
- }
1160
-
1161
- if (field.isSubmit && field.flagVerifyData) {
1162
- if(!self.validExcute()){
1163
- return;
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
- if (field.alert) {
1168
- self.$common.confirm(field.alertMsg, field.alertCaption, {
1169
- confirmButtonText: field.alertOKButtonText,
1170
- cancelButtonText: field.alertCancelButtonText,
1171
- //type: 'warning'
1172
- center: field.alertCenter
1173
- }).then(() => {
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
- else {
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
- importComplete(res, field) {
1183
- var self = this;
1184
- if (field.flagAsync) {
1185
- if (res.content && res.content.action) {
1186
- var dialogOption = {
1187
- title: field.pageTitle || field.label,
1188
- content: [{
1189
- component: 'ct-progress',
1190
- attrs: {
1191
- progressAction: res.content.action,
1192
- progressKey: res.content.key,
1193
- progressType: 'import',
1194
- width: '350px',
1195
- height: '185px'
1196
- },
1197
- on: {
1198
- finished(data) {
1199
- self.$common.closeDialog(dialogOption.dialog);
1200
- if(field.isExport){
1201
- if(data.content.indexOf(".zip") > -1){
1202
- window.location.href = encodeURI(data.content);
1203
- }
1204
- else{
1205
- if (data.content.indexOf("?") > -1) {
1206
- self.downloadUrl = data.content + "&" + Math.random();
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
- self.model.doAction(data);
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
- error(data) {
1228
- self.$common.closeDialog(dialogOption.dialog);
1301
+ }
1302
+ if (data.rtnMsg) {
1229
1303
  self.$message({
1230
1304
  message: data.rtnMsg,
1231
- type: 'warning',
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
- self.$common.openDialog(dialogOption);
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
- if (field && field.changeCallBackFunName) {
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
- inputHandler(field) {
1251
- if (typeof field.input !== 'undefined') {
1252
- if (typeof this.model.scripts !== 'undefined') {
1253
- this.model.scripts.formData.setExcuteListData(this.model.fields);
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
- changeHandler(field) {
1260
- var self = this;
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
- self.model.hiddenHandle(field);
1263
- self.model.requiredHandle(field);
1264
-
1265
- if (typeof field.change !== 'undefined') {
1266
- if (typeof this.model.scripts !== 'undefined') {
1267
- this.model.scripts.formData.setExcuteListData(this.model.fields);
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
- self.model.isChanged = true;
1274
- //self.model.validMrf(field);
1362
+ self.model.isChanged = true;
1363
+ //self.model.validMrf(field);
1275
1364
 
1276
- if (field.onAfterChanged && field.type !== 4) {
1277
- var router = self.model.actionRouters.find((v) => {
1278
- return v.id === field.onAfterChanged;
1279
- });
1280
- if(router){
1281
- self.clickHandler(router);
1282
- }
1283
- else{
1284
- if (typeof this.model.scripts !== 'undefined') {
1285
- this.model.scripts.formData.setExcuteListData(this.model.fields);
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
- self.$forceUpdate();
1293
- },
1294
- blurHandler(field) {
1295
- var self = this;
1296
- if (field.onAfterChanged) {
1297
- var router = self.model.actionRouters.find((v) => {
1298
- return v.id === field.onAfterChanged;
1299
- });
1300
- if(router){
1301
- self.clickHandler(router);
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
- self.$forceUpdate();
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.change);
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
- self.model.isChanged = true;
1324
- self.model.hiddenHandle(field);
1325
- self.model.requiredHandle(field);
1326
- //self.model.validMrf(field);
1412
+ self.model.isChanged = true;
1413
+ self.model.hiddenHandle(field);
1414
+ self.model.requiredHandle(field);
1415
+ //self.model.validMrf(field);
1327
1416
 
1328
- if (field.routerKeyForEnterKey) {
1329
- var router = self.model.actionRouters.find((v) => {
1330
- return v.id === field.routerKeyForEnterKey;
1331
- });
1332
- self.clickHandler(router);
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
- self.$forceUpdate();
1336
- },
1337
- changeCallBackHandler(field, callBackFunName, callBackPara) {
1338
- var self = this;
1339
- if (callBackFunName) {
1340
- this.model.scripts.$fd = field.id;
1341
- this.$common.excuteFunStr.call(this.model.scripts, callBackFunName, callBackPara);
1342
- }
1343
- self.$forceUpdate();
1344
- },
1345
- popupSearchListHandler(singleSelectio, field, router, callBack) {
1346
- var self = this;
1347
- var submitData = {};
1348
- var verified = true;
1349
- var flagSearchlist = false;
1350
- var tempFormData = self.model.getFormObj();
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
- var check = true;
1353
- var checkMsg;
1354
- router.submitFormField.forEach((v) => {
1355
- self.$refs.Fields.forEach((f) => {
1356
- if (f.model && f.model.id === v) {
1357
- if (typeof f.validExcute !== 'undefined') {
1358
- if (!f.validExcute()) {
1359
- if (f.validMessage) {
1360
- if (f.validMessage == '必填') {
1361
- self.$message({
1362
- message: '【' + f.model.label + '】' + f.validMessage,
1363
- type: 'error',
1364
- showClose:true,
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: '【' + f.model.label + '】不能为空!',
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
- if (!check) {
1410
- self.$message({
1411
- message: checkMsg,
1412
- type: 'warning',
1413
- showClose:true,
1414
- });
1415
- return;
1416
- }
1417
- if (router.id.indexOf('_') === 0) {
1418
- flagSearchlist = true;
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
- submitData = router.getActionPara(submitData).para;
1422
- var dialogOption = {
1423
- title: router.pageTitle,
1424
- pane: self.$common.getParentPane(self),
1425
- content: [{
1426
- component: flagSearchlist ? 'ct-searchlist' : 'ct-popupSearchList',
1427
- attrs: {
1428
- searchConditionApi: router.actionForSearchLayout,
1429
- searchFormApi: router.actionForSearchLayout,
1430
- searchDataApi: router.actionForSearch,
1431
- apiParam: submitData,
1432
- singleSelectio: singleSelectio,
1433
- width: router.dialogWidth + 'px',
1434
- height: (router.dialogHeight || 500) + 'px',
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
- self.changeCallBackHandler(field, router.changeCallBackFunName, option);
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
- this.$common.openDialog(dialogOption);
1451
- },
1452
- popupLocationHandler(field, router, callBack) {
1453
- var self = this;
1454
- var submitData = self.getFileData(router);
1455
- var tempFormData = self.model.getFormObj();
1456
- submitData.lng=field.code1;
1457
- submitData.lat=field.code2;
1458
- submitData = router.getActionPara(submitData).para;
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
- let dialogOption = {
1461
- title: router.pageTitle || router.label,
1462
- pane: self.$common.getParentPane(self),
1463
- content: [{
1464
- component: "ct-mapBaidu",
1465
- attrs: {
1466
- field: router,
1467
- apiParam: submitData,
1468
- width: router.dialogWidth + "px",
1469
- height: router.dialogHeight + "px",
1470
- documentHeight: self.documentHeight,
1471
- documentWidth: self.documentWidth,
1472
- openType : 'Location'
1473
- },
1474
- on: {
1475
- submit(ev) {
1476
- if (callBack) {
1477
- callBack(ev);
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
- this.$common.openDialog(dialogOption);
1488
- },
1489
- validExcute() {
1490
- var self = this;
1491
- var rtnBool = true;
1492
- var jump = false;
1493
- var i = 0;
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
- self.$refs.Fields.forEach((f) => {
1496
- if (f.model && typeof f.validExcute !== 'undefined') {
1497
- if (!f.validExcute()) {
1498
- if (i === 0) {
1499
- if (f.model.is == "ct-file"||f.model.is == "ct-repeat"||f.model.is == "ct-form-list-table") {
1500
- self.$message({
1501
- message: f.validMessage,
1502
- type: 'error',
1503
- showClose:true,
1504
- });
1505
- }
1506
- else {
1507
- if (f.validMessage) {
1508
- if (f.validMessage == '必填' && (f.model.label || (f.model.attrs && f.model.attrs.placeholder))) {
1509
- let m=f.model.label;
1510
- if(!m && f.model.attrs && f.model.attrs.placeholder){
1511
- m=f.model.attrs.placeholder;
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
- if (f.model.label) {
1529
- self.$message({
1530
- message: '' + f.model.label + '】不能为空!',
1531
- type: 'error',
1532
- showClose:true,
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
- i++;
1626
+ }
1627
+ i++;
1539
1628
 
1540
- if (!jump) {
1541
- if (self.model.isHorizontalLayout) {//水平布局
1542
- self.activeName = f.model.collapseName.toString() === '-1' ? self.activeName : f.model.collapseName.toString();
1543
- jump = true;
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
- self.timeoutHandle=setTimeout(function () {
1554
- if (f.$el.offsetParent && f.$el.offsetParent.offsetParent) {
1555
- let total = f.$el.offsetParent.offsetParent.offsetTop;
1556
- if (f.$el.offsetParent.offsetParent.offsetParent === null
1557
- || f.$el.offsetParent.offsetParent.offsetParent.classList[0] === 'app-main'
1558
- || f.$el.offsetParent.offsetParent.classList[0] === 'app-main') {
1559
- total = f.$el.offsetParent.offsetTop;
1560
- if (f.$el.offsetParent.offsetParent.classList[0] === 'app-main'
1561
- && f.$el.offsetTop > f.$el.offsetParent.offsetTop
1562
- && f.$el.offsetParent.classList[0] === 'el-row') {
1563
- total = f.$el.offsetTop;
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
- }, timeOut);
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
- jump = true;
1581
- }
1669
+ jump = true;
1582
1670
  }
1583
- rtnBool = false;
1584
1671
  }
1672
+ rtnBool = false;
1585
1673
  }
1586
- });
1587
- return rtnBool;
1588
- },
1589
- collapseHandleChange(itemArr) {
1590
- let fieldTarget = this.model.fields.filter((v) => {
1591
- return itemArr.indexOf(v.collapseName) > 0;
1592
- });
1593
- fieldTarget.forEach((f) => {
1594
- if (f.self && f.self.resize) {
1595
- f.self.resize();
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
- if (moreFormObj) {
1605
- Object.assign(formData, moreFormObj);
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
- return formData;
1608
- },
1609
- getFileData(field) {
1610
- var self = this;
1611
- var submitData = {};
1612
- var tempFormData = this.model.getFormObj();
1613
- if (field.flagAttachSearchCondition) {
1614
- submitData.jsonData = tempFormData;
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
- else {
1617
- if (field.submitFormField) {
1618
- field.submitFormField.forEach((v) => {
1619
- submitData[v] = self.$common.getDataOfUpperLower(tempFormData, v);
1620
- if(submitData[v]==undefined || submitData[v]==null || submitData[v]==''){
1621
- if(self.parentModelForm){
1622
- submitData[v] = self.parentModelForm.getFormObj()[v];
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
- return submitData;
1629
- },
1630
- setCss() {
1631
- if (this.topHeight > -1) {
1632
- this.minHeight = (document.documentElement.clientHeight - this.topHeight - 20) + 'px';
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
- tabClickHandler(){
1636
- this.$nextTick(() => {
1637
- });
1638
- },
1639
- refreshPage() {
1640
- this.$nextTick(() => {
1641
- });
1642
- },
1643
- flagNotificationParentAfterContentChanged() {
1644
- this.init();
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
- .el-collapse {
1651
- border-top: none;
1652
- }
1912
+ .el-collapse {
1913
+ border-top: none;
1914
+ }
1653
1915
 
1654
- .ct-collapse-item-title .el-collapse-item__header {
1655
- color: #303133 !important;
1656
- line-height: normal;
1657
- }
1916
+ .ct-collapse-item-title .el-collapse-item__header {
1917
+ color: #303133 !important;
1918
+ line-height: normal;
1919
+ }
1658
1920
 
1659
- .el-collapse-saveLine .ct-collapse-item-title:last-child .el-collapse-item__wrap {
1660
- border-bottom: none;
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
- .button-absolute {
1668
- z-index: 100;
1669
- /* bottom: 6px; */
1670
- bottom: 0;
1671
- left: 0;
1672
- right: 0;
1673
- border-radius: 0 0 4px 4px;
1674
- position: absolute;
1675
- line-height: 34px;
1676
- background-color: #fff;
1677
- width: 100%;
1678
- margin: auto;
1679
- box-shadow: 0 2px 20px 0 rgb(0 0 0 / 10%);
1680
- }
1681
-
1682
- .tip-absolute {
1683
- width:'100%';
1684
- z-index: 100;
1685
- margin-top: -10px;
1686
- /* top : 44px; */
1687
- left: 0;
1688
- right: 0;
1689
- position: absolute;
1690
- line-height: 24px;
1691
- background-color:#ffe7cc;
1692
- color:#EC3D3D;
1693
- border-radius: 5px;
1694
- padding: 8px;
1695
- font-size: 12px;
1696
- }
1697
-
1698
- .tip-bottom {
1699
- line-height: 24px;
1700
- background-color:#ffe7cc;
1701
- color:#EC3D3D;
1702
- border-radius: 5px;
1703
- padding: 8px;
1704
- font-size: 12px;
1705
- }
1706
- .tip-bottom-absolute {
1707
- width:'100%';
1708
- z-index: 100;
1709
- bottom: 0;
1710
- left: 0;
1711
- right: 0;
1712
- position: absolute;
1713
- line-height: 24px;
1714
- background-color:#ffe7cc;
1715
- color:#EC3D3D;
1716
- border-radius: 5px;
1717
- padding: 8px;
1718
- font-size: 12px;
1719
- }
1720
- .tip-bottom-absolute40 {
1721
- width:'100%';
1722
- z-index: 100;
1723
- bottom: 40px;
1724
- left: 0;
1725
- right: 0;
1726
- position: absolute;
1727
- line-height: 24px;
1728
- background-color:#ffe7cc;
1729
- color:#EC3D3D;
1730
- border-radius: 5px;
1731
- padding: 8px;
1732
- font-size: 12px;
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>