@zscreate/zhxy-app-component 1.0.73 → 1.0.76
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,1475 +1,1504 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<view v-if="widget.type ==='custom'" class="evan-form-item-container"
|
|
2
|
+
<view class="form-item"
|
|
3
|
+
:class="{showFalse: showFalse, isScroll: isScroll, isCorrected: widget.options.isCorrected ? true : false}"
|
|
4
|
+
@click="resetShowFalse">
|
|
5
|
+
<view v-if="widget.options.isCorrected" class="correctedWrap">
|
|
6
|
+
原值是: {{ widget.options.oldValue }}
|
|
7
|
+
</view>
|
|
8
|
+
<view class="editCorrent"
|
|
9
|
+
v-if="isCorrect && correntArray.includes(widget.type) && (widget.options.canCorrect !== false || widget.options.canCorrect === undefined)"
|
|
10
|
+
@click="CorrentItem">
|
|
11
|
+
<!-- ===undefined兼容老版本表单 -->
|
|
12
|
+
<img src="./modules/edit.png" alt="">
|
|
13
|
+
</view>
|
|
14
|
+
<slot></slot>
|
|
15
|
+
|
|
16
|
+
<view v-if="widget.type ==='custom'" class="evan-form-item-container"
|
|
17
|
+
:class="'evan-form-item-container--' + labelPosition"
|
|
17
18
|
:style="{borderWidth:border?'1upx':0}">
|
|
18
19
|
<view class="evan-form-item-container__label"
|
|
19
20
|
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
20
|
-
{{widget.name}}
|
|
21
|
+
{{ widget.name }}
|
|
21
22
|
</view>
|
|
22
23
|
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
23
24
|
<slot name="custom"></slot>
|
|
24
25
|
</view>
|
|
25
26
|
</view>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
27
|
+
<!-- input -->
|
|
28
|
+
<view v-if="widget.type ==='input'" class="evan-form-item-container"
|
|
29
|
+
:class="'evan-form-item-container--' + labelPosition"
|
|
30
|
+
:style="{borderWidth:border?'1upx':0}">
|
|
31
|
+
<view class="evan-form-item-container__label"
|
|
32
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
33
|
+
{{ widget.name }}
|
|
34
|
+
</view>
|
|
35
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
36
|
+
<input class="form-input" placeholder-class="form-input-placeholder" v-model="dataModel"
|
|
37
|
+
:placeholder="widget.options.placeholder" :disabled="widget.options.disabled"/>
|
|
38
|
+
</view>
|
|
39
|
+
</view>
|
|
40
|
+
|
|
41
|
+
<!-- uploadModel -->
|
|
42
|
+
<view v-else-if="widget.type ==='uploadModel'" class="evan-form-item-container"
|
|
43
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
44
|
+
<view class="evan-form-item-container__label"
|
|
45
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
46
|
+
{{ widget.name }}
|
|
47
|
+
</view>
|
|
48
|
+
<view class="evan-form-item-container__main evan-form-item-container__textarea" :style="mContentStyle">
|
|
49
|
+
<view @click.prevent="downLoadFile(item)" style="margin-right: 20px;color: #007AFF;"
|
|
50
|
+
v-for="(item, index) in widget.options.defaultValue" :key="index"
|
|
51
|
+
:class="{disabledClick: widget.options.disabled}">
|
|
52
|
+
{{ item.name }}
|
|
53
|
+
</view>
|
|
54
|
+
<view v-if="widget.options.defaultValue.length === 0">暂无模板</view>
|
|
55
|
+
</view>
|
|
56
|
+
</view>
|
|
57
|
+
|
|
58
|
+
<!-- textarea -->
|
|
59
|
+
<view v-else-if="widget.type ==='textarea'" class="evan-form-item-container"
|
|
60
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
61
|
+
<view class="evan-form-item-container__label"
|
|
62
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
63
|
+
{{ widget.name }}
|
|
64
|
+
</view>
|
|
65
|
+
<view class="evan-form-item-container__main evan-form-item-container__textarea" :style="mContentStyle">
|
|
64
66
|
<textarea maxlength="300" class="form-input cover-text" v-model="dataModel"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
placeholder-style="line-height:60rpx" placeholder-class="form-input-placeholder"
|
|
68
|
+
:placeholder="widget.options.placeholder" :disabled="widget.options.disabled">
|
|
67
69
|
</textarea>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
70
|
+
</view>
|
|
71
|
+
</view>
|
|
72
|
+
|
|
73
|
+
<!-- rate -->
|
|
74
|
+
<view v-else-if="widget.type ==='rate'" class="evan-form-item-container"
|
|
75
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
76
|
+
<view class="evan-form-item-container__label"
|
|
77
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
78
|
+
{{ widget.name }}
|
|
79
|
+
</view>
|
|
80
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
81
|
+
<uni-rate allow-half :min="widget.options.min ? widget.options.min : 0" size="18"
|
|
82
|
+
:max="widget.options.max ? widget.options.max : 1000000" :value="dataModel" @change="changeRate"
|
|
83
|
+
:disabled="widget.options.disabled">
|
|
84
|
+
</uni-rate>
|
|
85
|
+
<view class="u_close" v-if="!widget.options.disabled" @click="dataModel = 0">
|
|
86
|
+
<u-icon name="close-circle" color="#999999" size="38"></u-icon>
|
|
87
|
+
</view>
|
|
88
|
+
</view>
|
|
89
|
+
</view>
|
|
90
|
+
|
|
91
|
+
<!-- radio -->
|
|
92
|
+
<view v-else-if="widget.type ==='radio'" :class="'evan-form-item-container--' + labelPosition"
|
|
93
|
+
:style="{borderWidth:border?'1upx':0}">
|
|
94
|
+
<view class="radio-height evan-form-item-container__label"
|
|
95
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}"
|
|
96
|
+
style="padding-left: 30rpx;" :style="mLabelStyle">{{ widget.name }}
|
|
97
|
+
</view>
|
|
98
|
+
<view class="evan-form-item-container__main" :style="mContentStyle" style="padding: 0;">
|
|
99
|
+
<view class="uni-list">
|
|
100
|
+
<radio-group @change="radioChange" :disabled="widget.options.disabled">
|
|
101
|
+
<!-- @change="radioChange" -->
|
|
102
|
+
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in checkboxAndRadioOptions"
|
|
103
|
+
:key="item.value">
|
|
104
|
+
<view>
|
|
105
|
+
<radio :value="item.value" :disabled="widget.options.disabled" :checked="item.checked"
|
|
106
|
+
color="#007AFF"/>
|
|
107
|
+
</view>
|
|
108
|
+
<view>{{ item.label }}</view>
|
|
109
|
+
</label>
|
|
110
|
+
</radio-group>
|
|
111
|
+
</view>
|
|
112
|
+
</view>
|
|
113
|
+
</view>
|
|
114
|
+
|
|
115
|
+
<!-- switch -->
|
|
116
|
+
<view v-else-if="widget.type ==='switch'" class="evan-form-item-container"
|
|
117
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
118
|
+
<view class="evan-form-item-container__label"
|
|
119
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
120
|
+
{{ widget.name }}
|
|
121
|
+
</view>
|
|
122
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
120
123
|
<switch :checked="Boolean(dataModel)" @change="switch1Change" color="#007AFF" style="transform: scale(0.8,0.8)"
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
124
|
+
:disabled="widget.options.disabled"/>
|
|
125
|
+
</view>
|
|
126
|
+
</view>
|
|
127
|
+
|
|
128
|
+
<!-- slider -->
|
|
129
|
+
<view v-else-if="widget.type ==='slider'" class="evan-form-item-container"
|
|
130
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
131
|
+
<view class="evan-form-item-container__label"
|
|
132
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
133
|
+
{{ widget.name }}
|
|
134
|
+
</view>
|
|
135
|
+
<view class="evan-form-item-container__main" :style="mContentStyle" style="padding: 0;">
|
|
136
|
+
<slider style="width: 100%;" :value="dataModel" :show-value="true" @change="sliderChange"
|
|
137
|
+
activeColor="#007AFF" backgroundColor="#E4E7ED" block-size="20"
|
|
138
|
+
:disabled="widget.options.disabled"/>
|
|
139
|
+
</view>
|
|
140
|
+
</view>
|
|
141
|
+
|
|
142
|
+
<!-- checkbox -->
|
|
143
|
+
<view v-else-if="widget.type ==='checkbox'" @click.native="isClickByUser = true"
|
|
144
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
145
|
+
<view class="radio-height evan-form-item-container__label"
|
|
146
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}"
|
|
147
|
+
style="padding-left: 30rpx;" :style="mLabelStyle">{{ widget.name }}
|
|
148
|
+
</view>
|
|
149
|
+
<view class="evan-form-item-container__main" :style="mContentStyle" style="padding: 0;">
|
|
150
|
+
<view class="uni-list">
|
|
151
|
+
<checkbox-group @change="checkboxChange" :disabled="widget.options.disabled">
|
|
152
|
+
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in checkboxAndRadioOptions"
|
|
153
|
+
:key="item.value">
|
|
154
|
+
<view>
|
|
155
|
+
<label>
|
|
156
|
+
<checkbox :value="item.value" :disabled="widget.options.disabled"
|
|
157
|
+
:checked="item.checked" color="#007AFF" style="transform: scale(0.8,0.8);"/>
|
|
158
|
+
<text></text>
|
|
159
|
+
</label>
|
|
160
|
+
</view>
|
|
161
|
+
<view>{{ item.label ? item.label : item.value }}</view>
|
|
162
|
+
</label>
|
|
163
|
+
</checkbox-group>
|
|
164
|
+
</view>
|
|
165
|
+
</view>
|
|
166
|
+
</view>
|
|
167
|
+
|
|
168
|
+
<!-- date -->
|
|
169
|
+
<view v-else-if="widget.type ==='date'" class="evan-form-item-container"
|
|
170
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
171
|
+
<view class="evan-form-item-container__label"
|
|
172
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
173
|
+
{{ widget.name }}
|
|
174
|
+
</view>
|
|
175
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
176
|
+
<view style="width: 100%;">
|
|
177
|
+
<!-- <xp-picker
|
|
178
|
+
:year-range="[1996, 2040]"
|
|
179
|
+
style="width: 100%;"
|
|
180
|
+
:ref="widget.model"
|
|
181
|
+
:mode="getMode(widget.options.format)"
|
|
182
|
+
@confirm="changeTime"
|
|
183
|
+
@cancel="cancel"
|
|
184
|
+
/> -->
|
|
185
|
+
|
|
186
|
+
<view class="evan-form-item-container__main--body">
|
|
187
|
+
<uni-datetime-picker @change="dateChange" @click.native="isClickByUser = true"
|
|
188
|
+
:type="widget.options.type" :format="widget.options.format"
|
|
189
|
+
:clearIcon="widget.options.clearable" v-model="dataModel" @maskClick="maskClick"
|
|
190
|
+
:border="false" :disabled="widget.options.disabled">
|
|
191
|
+
<view class="option-font-size">
|
|
192
|
+
{{ dataModel | filterDataModel(widget) }}
|
|
193
|
+
</view>
|
|
194
|
+
</uni-datetime-picker>
|
|
195
|
+
</view>
|
|
196
|
+
</view>
|
|
197
|
+
<!-- <view class="option-font-size" @tap="showTime(widget.model)">
|
|
198
|
+
{{dataModel ? dataModel : widget.options.placeholder?widget.options.placeholder: '请选择'}}
|
|
199
|
+
</view>
|
|
200
|
+
<view class="u_close" v-if="widget.options.clearable && dataModel && !widget.options.disabled"
|
|
201
|
+
@click="handleClose">
|
|
202
|
+
<u-icon name="close-circle" color="#999999" size="38"></u-icon>
|
|
203
|
+
</view> -->
|
|
204
|
+
</view>
|
|
205
|
+
</view>
|
|
206
|
+
|
|
207
|
+
<!-- time -->
|
|
208
|
+
<view v-else-if="widget.type ==='time'" class="evan-form-item-container"
|
|
209
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
210
|
+
<view class="evan-form-item-container__label"
|
|
211
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
212
|
+
{{ widget.name }}
|
|
213
|
+
</view>
|
|
214
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
215
|
+
<!-- <picker class="" mode="time" style="width: 100%;" :value="dataModel" @change="changedate" @cancel="cancel"
|
|
216
|
+
:disabled="widget.options.disabled">
|
|
217
|
+
<view class="option-font-size">{{dataModel ? dataModel : widget.options.placeholder?widget.options.placeholder: '请选择'}}</view>
|
|
218
|
+
</picker> -->
|
|
219
|
+
<view>
|
|
220
|
+
<xp-picker :ref="widget.model" :mode="getMode(widget.options.format)" @confirm="changeTime"
|
|
221
|
+
@cancel="cancel"/>
|
|
222
|
+
</view>
|
|
223
|
+
<view class="option-font-size" @tap="showTime(widget.model,0)">
|
|
224
|
+
{{
|
|
225
|
+
showTimeStr(dataModel, 0) ? showTimeStr(dataModel, 0) : widget.options.placeholder ? widget.options.placeholder : '请选择'
|
|
226
|
+
}}
|
|
227
|
+
</view>
|
|
228
|
+
<view class="option-time-icon" v-if="widget.options.isRange">
|
|
229
|
+
~
|
|
230
|
+
</view>
|
|
231
|
+
<view v-if="widget.options.isRange" class="option-font-size" @tap="showTime(widget.model,1)">
|
|
232
|
+
{{
|
|
233
|
+
showTimeStr(dataModel, 1) ? showTimeStr(dataModel, 1) : widget.options.placeholder ? widget.options.placeholder : '请选择'
|
|
234
|
+
}}
|
|
235
|
+
</view>
|
|
236
|
+
<view class="u_close" v-if="widget.options.clearable && getTime(dataModel) && !widget.options.disabled"
|
|
237
|
+
@click="handleClose">
|
|
238
|
+
<u-icon name="close-circle" color="#999999" size="38"></u-icon>
|
|
239
|
+
</view>
|
|
240
|
+
</view>
|
|
241
|
+
</view>
|
|
242
|
+
|
|
243
|
+
<!-- color -->
|
|
244
|
+
<view v-else-if="widget.type ==='color'" class="evan-form-item-container"
|
|
245
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
246
|
+
<view class="evan-form-item-container__label"
|
|
247
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
248
|
+
{{ widget.name }}
|
|
249
|
+
</view>
|
|
250
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
251
|
+
<tColorPicker ref="colorPicker" @confirm="confirm" :disabled="widget.options.disabled"></tColorPicker>
|
|
252
|
+
<view class="opencolor" @click="open" :style="{background: dataModel}"></view>
|
|
253
|
+
</view>
|
|
254
|
+
</view>
|
|
255
|
+
|
|
256
|
+
<!-- imgupload -->
|
|
257
|
+
<view v-else-if="widget.type ==='imgupload'" class="evan-form-item-container"
|
|
258
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
259
|
+
<view class="evan-form-item-container__label"
|
|
260
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
261
|
+
{{ widget.name }}
|
|
262
|
+
</view>
|
|
263
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
264
|
+
<unploadFile :widget="widget" @imgUrlPost="imgUrlPost" :defaultImg="dataModel"></unploadFile>
|
|
265
|
+
</view>
|
|
266
|
+
</view>
|
|
267
|
+
|
|
268
|
+
<!-- fileupload -->
|
|
269
|
+
<view v-else-if="widget.type ==='fileupload'" class="evan-form-item-container"
|
|
270
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
271
|
+
<view class="evan-form-item-container__label"
|
|
272
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
273
|
+
{{ widget.name }}
|
|
274
|
+
</view>
|
|
275
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
276
|
+
<l-file :url="actionUrl + widget.options.action" :disabled="widget.options.disabled"
|
|
277
|
+
@filePost="filePost" @fileDelete="fileDelete" :defaultFile="dataModel" :widget="widget.options">
|
|
278
|
+
</l-file>
|
|
279
|
+
</view>
|
|
280
|
+
</view>
|
|
281
|
+
|
|
282
|
+
<!-- editor -->
|
|
283
|
+
<!-- <view v-else-if="widget.type ==='editor'" class="evan-form-item-container"
|
|
284
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
285
|
+
<view class="evan-form-item-container__label"
|
|
286
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
287
|
+
{{widget.name}}
|
|
288
|
+
</view>
|
|
289
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
290
|
+
<jinEdit @editOk="editOk" :disabled="widget.options.disabled" :html="dataModel"></jinEdit>
|
|
291
|
+
</view>
|
|
292
|
+
</view> -->
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
<!-- cascader -->
|
|
296
|
+
<view v-else-if="widget.type ==='cascader'" class="evan-form-item-container"
|
|
297
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
298
|
+
<view class="evan-form-item-container__label"
|
|
299
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
300
|
+
{{ widget.name }}
|
|
301
|
+
</view>
|
|
302
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
303
|
+
<lb-picker ref="picker" v-model="dataModel" @change="cityChecked" :value="widget.options.defaultValue"
|
|
304
|
+
:disabled="widget.options.disabled">
|
|
305
|
+
</lb-picker>
|
|
306
|
+
</view>
|
|
307
|
+
</view>
|
|
308
|
+
|
|
309
|
+
<!-- number -->
|
|
310
|
+
<view v-else-if="widget.type ==='number'" class="evan-form-item-container"
|
|
311
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
312
|
+
<view class="evan-form-item-container__label"
|
|
313
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
314
|
+
{{ widget.name }}
|
|
315
|
+
</view>
|
|
316
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
317
|
+
<u-number-box v-model="dataModel" @numberBoxClick="numberBoxClick"
|
|
318
|
+
:step="widget.options.step ? widget.options.step:1"
|
|
319
|
+
:min="widget.options.min ? widget.options.min : 0"
|
|
320
|
+
:max="widget.options.max ? widget.options.max : 100000000" :disabled="widget.options.disabled">
|
|
321
|
+
</u-number-box>
|
|
322
|
+
</view>
|
|
323
|
+
</view>
|
|
324
|
+
|
|
325
|
+
<!-- codeControl -->
|
|
326
|
+
<view v-else-if="widget.type ==='codeControl'" class="evan-form-item-container"
|
|
327
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
328
|
+
<view class="evan-form-item-container__label"
|
|
329
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
330
|
+
{{ widget.name }}
|
|
331
|
+
</view>
|
|
332
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
333
|
+
<view>{{ widget.key }}</view>
|
|
334
|
+
</view>
|
|
335
|
+
</view>
|
|
336
|
+
|
|
337
|
+
<!-- superLink -->
|
|
338
|
+
<view v-else-if="widget.type ==='superLink'" class="evan-form-item-container"
|
|
339
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
340
|
+
<view class="evan-form-item-container__label"
|
|
341
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
342
|
+
{{ widget.name }}
|
|
343
|
+
</view>
|
|
344
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
345
|
+
<uni-link :href="widget.options.defaultValue" :text="widget.options.title"
|
|
346
|
+
:disabled="widget.options.disabled">
|
|
347
|
+
</uni-link>
|
|
348
|
+
</view>
|
|
349
|
+
</view>
|
|
350
|
+
|
|
351
|
+
<!-- placeholder -->
|
|
352
|
+
<view v-else-if="widget.type ==='placeholder'" class="evan-form-item-container"
|
|
353
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
354
|
+
<view class="evan-form-item-container__label"
|
|
355
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
356
|
+
{{ widget.name }}
|
|
357
|
+
</view>
|
|
358
|
+
<!-- <view class="evan-form-item-container__main" :style="mContentStyle">
|
|
359
|
+
<view>{{widget.options.placeholder}}</view>
|
|
360
|
+
</view> -->
|
|
361
|
+
</view>
|
|
362
|
+
|
|
363
|
+
<!-- hidden -->
|
|
364
|
+
<view v-else-if="widget.type ==='hidden'"></view>
|
|
365
|
+
|
|
366
|
+
<!-- signature-write -->
|
|
367
|
+
<view v-else-if="widget.type ==='signature-write'" class="evan-form-item-container"
|
|
368
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
369
|
+
<view class="evan-form-item-container__label"
|
|
370
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
371
|
+
{{ widget.name }}
|
|
372
|
+
</view>
|
|
373
|
+
<view class="evan-form-item-container__main" :style="mContentStyle">
|
|
374
|
+
<view style="float: left;">
|
|
375
|
+
<button v-show="!widget.options.disabled" size="mini" type="primary" @click="signatrueFlag = true"
|
|
376
|
+
style="white-space: nowrap;">签名
|
|
377
|
+
</button>
|
|
378
|
+
</view>
|
|
379
|
+
<image v-if="dataModel || signatrueImage" :src="dataModel ? dataModel : signatrueImage"
|
|
380
|
+
style="width:640rpx;height:174rpx;"></image>
|
|
381
|
+
<!-- 签名弹框 -->
|
|
382
|
+
<view v-if="signatrueFlag" class="signatrue-view" @click="signatrueFlag = false">
|
|
383
|
+
<view class="signatrue-box">
|
|
384
|
+
<signatrue-write @getBase64="getBase64" style="width: 100%;height: 100%;"></signatrue-write>
|
|
385
|
+
</view>
|
|
386
|
+
</view>
|
|
387
|
+
</view>
|
|
388
|
+
</view>
|
|
389
|
+
|
|
390
|
+
<!-- select -->
|
|
391
|
+
<view v-else-if="widget.type ==='select'" class="evan-form-item-container"
|
|
392
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
393
|
+
<view class="evan-form-item-container__label"
|
|
394
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
395
|
+
{{ widget.name }}
|
|
396
|
+
</view>
|
|
397
|
+
<view class="evan-form-item-container__main" :style="mContentStyle"
|
|
398
|
+
@click="handleSeclet(widget.options.multiple)">
|
|
399
|
+
<div class="option-font-size">{{ dataModelShow ? dataModelShow : widget.options.placeholder }}</div>
|
|
400
|
+
</view>
|
|
401
|
+
<!-- <icon type="clear" size="14" v-if="widget.options.canView" />-->
|
|
402
|
+
</view>
|
|
403
|
+
|
|
404
|
+
<!-- userSelector -->
|
|
405
|
+
<view v-else-if="widget.type ==='userSelector'" @click.native="isClickByUser = true"
|
|
406
|
+
class="evan-form-item-container" :class="'evan-form-item-container--' + labelPosition"
|
|
407
|
+
:style="{borderWidth:border?'1upx':0}">
|
|
408
|
+
<view class="evan-form-item-container__label"
|
|
409
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
410
|
+
{{ widget.name }}
|
|
411
|
+
</view>
|
|
412
|
+
<view class="evan-form-item-container__main" :style="mContentStyle"
|
|
413
|
+
@click.stop="selectUser(widget.options.multiple)">
|
|
414
|
+
<!-- <input class="form-input" placeholder-class="form-input-placeholder" v-model="dataModelShow"
|
|
415
|
+
:placeholder="widget.options.placeholder" :disabled="widget.options.disabled" /> -->
|
|
416
|
+
<view class="form-input">{{ dataModelShow ? dataModelShow : widget.options.placeholder }}</view>
|
|
417
|
+
</view>
|
|
418
|
+
</view>
|
|
419
|
+
|
|
420
|
+
<!-- deptSelector -->
|
|
421
|
+
<view v-else-if="widget.type ==='deptSelector'" class="evan-form-item-container"
|
|
422
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
423
|
+
<view class="evan-form-item-container__label"
|
|
424
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
425
|
+
{{ widget.name }}
|
|
426
|
+
</view>
|
|
427
|
+
<view class="evan-form-item-container__main" :style="mContentStyle"
|
|
428
|
+
@click.stop="selectdept(widget.options.multiple)">
|
|
429
|
+
<!-- <input class="form-input" placeholder-class="form-input-placeholder" v-model="dataModelShow"
|
|
430
|
+
:placeholder="widget.options.placeholder" :disabled="widget.options.disabled"
|
|
431
|
+
:departvalue="widget.options.defaultValue" /> -->
|
|
432
|
+
<view class="form-input">{{ dataModelShow ? dataModelShow : widget.options.placeholder }}</view>
|
|
433
|
+
</view>
|
|
434
|
+
</view>
|
|
435
|
+
|
|
436
|
+
<!-- relateSub -->
|
|
437
|
+
<view v-else-if="widget.type ==='relateSub'" class="evan-form-item-container"
|
|
438
|
+
:class="'evan-form-item-container--' + labelPosition" :style="{borderWidth:border?'1upx':0}">
|
|
439
|
+
<view class="evan-form-item-container__label"
|
|
440
|
+
:class="{showAsteriskRect:hasRequiredAsterisk,isRequired:showRequiredAsterisk}" :style="mLabelStyle">
|
|
441
|
+
{{ widget.name }}
|
|
442
|
+
</view>
|
|
443
|
+
<view class="evan-form-item-container__main" :style="mContentStyle" @click="relateSub(widget.options)">
|
|
444
|
+
<view class="form-input" placeholder-class="form-input-placeholder">
|
|
445
|
+
{{ dataModelShow ? dataModelShow : widget.options.placeholder }}
|
|
446
|
+
</view>
|
|
447
|
+
</view>
|
|
448
|
+
</view>
|
|
449
|
+
<view class="error-message" v-if="showFalse">{{ showFalseMsg }}</view>
|
|
450
|
+
</view>
|
|
443
451
|
</template>
|
|
444
452
|
|
|
445
453
|
<script>
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
454
|
+
import moment from "../../utils/moment.js";
|
|
455
|
+
import uniDatetimePicker
|
|
456
|
+
from '../../components/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue'
|
|
457
|
+
// import utils from './utils.js'
|
|
458
|
+
import tColorPicker from '../../components/t-color-picker/t-color-picker.vue'
|
|
459
|
+
import unploadFile from '../../components/uploadFile/uploadFile.vue'
|
|
460
|
+
import lFile from '../../components/l-file/l-file.vue'
|
|
461
|
+
import jinEdit from '../../components/jin-edit/jin-edit.vue';
|
|
462
|
+
import LbPicker from '../../components/lb-picker/index.vue';
|
|
463
|
+
import MyPicker from '../../components/dying318-picker/Pickers.vue';
|
|
464
|
+
import UniRate from '../../components/uni-rate/uni-rate.vue';
|
|
465
|
+
import Pubsub from 'pubsub-js'
|
|
466
|
+
import {
|
|
467
|
+
computedMixin
|
|
468
|
+
} from './mixins/computedMixin'
|
|
469
|
+
import {
|
|
470
|
+
validateFormMixin
|
|
471
|
+
} from './mixins/validateFormMixin'
|
|
472
|
+
import {
|
|
473
|
+
pubSubMixin
|
|
474
|
+
} from './mixins/pubSubMixin'
|
|
475
|
+
import {
|
|
476
|
+
valueChangeMixin
|
|
477
|
+
} from './mixins/valueChangeMixin'
|
|
478
|
+
import {
|
|
479
|
+
getMode
|
|
480
|
+
} from './utilForForm'
|
|
481
|
+
|
|
482
|
+
export default {
|
|
483
|
+
mixins: [computedMixin, validateFormMixin, pubSubMixin, valueChangeMixin],
|
|
484
|
+
components: {
|
|
485
|
+
UniRate,
|
|
486
|
+
tColorPicker,
|
|
487
|
+
unploadFile,
|
|
488
|
+
lFile,
|
|
489
|
+
LbPicker,
|
|
490
|
+
MyPicker,
|
|
491
|
+
jinEdit,
|
|
492
|
+
uniDatetimePicker
|
|
493
|
+
},
|
|
494
|
+
name: 'EvanFormItem',
|
|
495
|
+
props: {
|
|
496
|
+
linkage: Object,
|
|
497
|
+
formId: String,
|
|
498
|
+
itemkey: [Number, String],
|
|
499
|
+
models: [Object],
|
|
500
|
+
isCorrect: [Number, String, null],
|
|
501
|
+
widget: Object,
|
|
502
|
+
labelStyle: Object,
|
|
503
|
+
rules: [Object, Array],
|
|
504
|
+
label: String,
|
|
505
|
+
contentStyle: {
|
|
506
|
+
type: Object,
|
|
507
|
+
default: () => {
|
|
508
|
+
return {}
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
isApply: {
|
|
512
|
+
type: [Boolean, undefined],
|
|
513
|
+
default: false,
|
|
514
|
+
},
|
|
515
|
+
isDraft: {
|
|
516
|
+
type: [Boolean, undefined],
|
|
517
|
+
default: false
|
|
518
|
+
},
|
|
519
|
+
prop: String,
|
|
520
|
+
tableKey: String,
|
|
521
|
+
tableIndex: Number,
|
|
522
|
+
model: Object,
|
|
523
|
+
border: {
|
|
524
|
+
type: Boolean,
|
|
525
|
+
default: true
|
|
526
|
+
},
|
|
527
|
+
labelPosition: {
|
|
528
|
+
validator: function (value) {
|
|
529
|
+
if (!value) {
|
|
530
|
+
return true
|
|
531
|
+
}
|
|
532
|
+
return ['top', 'left'].indexOf(value) !== -1
|
|
533
|
+
},
|
|
534
|
+
default: 'top'
|
|
535
|
+
}
|
|
536
|
+
},
|
|
537
|
+
filters: {
|
|
538
|
+
filterDataModel(dataModel, widget) {
|
|
539
|
+
if (dataModel) {
|
|
540
|
+
if (Array.isArray(dataModel)) {
|
|
541
|
+
if (dataModel.length > 0) {
|
|
542
|
+
return dataModel.join(' ~ ')
|
|
543
|
+
}
|
|
544
|
+
return '请选择'
|
|
545
|
+
}
|
|
546
|
+
if (widget.type === 'date' && widget.options.format) {
|
|
547
|
+
return moment(dataModel).format(widget.options.format)
|
|
548
|
+
}
|
|
549
|
+
return dataModel
|
|
550
|
+
}
|
|
551
|
+
if (widget.options.placeholder) {
|
|
552
|
+
return widget.options.placeholder
|
|
553
|
+
}
|
|
554
|
+
if (widget.options.endPlaceholder) {
|
|
555
|
+
return widget.options.endPlaceholder[0]
|
|
556
|
+
}
|
|
557
|
+
return '请选择'
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
data() {
|
|
561
|
+
return {
|
|
562
|
+
isClickByUser: false, //是否用户点击
|
|
563
|
+
single: null,
|
|
564
|
+
showFalse: false,
|
|
565
|
+
showFalseMsg: '',
|
|
566
|
+
signatrueFlag: false,
|
|
567
|
+
signatrueImage: '',
|
|
568
|
+
dataModel: '',
|
|
569
|
+
// firstValidateField: true,//第一次校验
|
|
570
|
+
isScroll: false,
|
|
571
|
+
dataModelShow: '',
|
|
572
|
+
actionUrl: this.uniEnv.uploadUrl,
|
|
573
|
+
correntArray: ['input', 'textarea'],
|
|
574
|
+
checkboxAndRadioOptions: [],
|
|
575
|
+
selectedData: []
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
mounted() {
|
|
579
|
+
},
|
|
580
|
+
created() {
|
|
581
|
+
this.updateDataModel();
|
|
582
|
+
this.pubsubScribe();
|
|
583
|
+
this.showFormData(); //非 v-model值回显
|
|
584
|
+
//下拉框联动的时候重新选择清空联动的数据
|
|
585
|
+
if (this.widget.type == 'select') {
|
|
586
|
+
uni.$on(this.widget.model, item => {
|
|
587
|
+
this.dataModel = ''
|
|
588
|
+
this.dataModelShow = ''
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
// 时间检验
|
|
593
|
+
beforeMount() {
|
|
594
|
+
let widget = this.widget;
|
|
595
|
+
let model = widget.model;
|
|
596
|
+
if (!widget.options) return
|
|
597
|
+
// 时间比较增加校验规则
|
|
598
|
+
if (widget.options.condition && widget.options.conditionValue) {
|
|
599
|
+
let model = widget.model;
|
|
600
|
+
let rule = {
|
|
601
|
+
validator: this.validateTime,
|
|
602
|
+
trigger: ['date', 'time'].includes(this.widget.type) ? 'change' : "blur",
|
|
603
|
+
}
|
|
604
|
+
let rules = this.tableKey ? this.rules[this.tableKey] : this.rules;
|
|
605
|
+
rules[model].isvalidator ? '' : rules[model].push(rule) && (rules[model].isvalidator = true)
|
|
606
|
+
}
|
|
607
|
+
if (widget.options.onlyvalue && widget.options.onlyvalue === true) {
|
|
608
|
+
let rule = {
|
|
609
|
+
validator: this.validateonly,
|
|
610
|
+
trigger: ['date', 'time'].includes(widget.type) ? 'change' : "blur",
|
|
611
|
+
}
|
|
612
|
+
let tableKey = this.tableKey
|
|
613
|
+
if (tableKey) {
|
|
614
|
+
//防止重复添加 (可优化)
|
|
615
|
+
if (this.rules[tableKey][model].isonlyvalue)
|
|
616
|
+
return false;
|
|
617
|
+
this.rules[tableKey][model].push(rule);
|
|
618
|
+
this.rules[tableKey][model].isonlyvalue = true;
|
|
619
|
+
} else {
|
|
620
|
+
if (this.rules[model].isonlyvalue)
|
|
621
|
+
return false;
|
|
622
|
+
this.rules[model].push(rule);
|
|
623
|
+
this.rules[model].isonlyvalue = true;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
},
|
|
627
|
+
destroyed() {
|
|
628
|
+
if (this.pubsubSign) {
|
|
629
|
+
console.log("销毁")
|
|
630
|
+
Pubsub.unsubscribe(this.pubsubSign);
|
|
631
|
+
}
|
|
632
|
+
uni.$off(this.widget.model);
|
|
633
|
+
},
|
|
634
|
+
methods: {
|
|
635
|
+
//文件删除
|
|
636
|
+
fileDelete(idx) {
|
|
637
|
+
this.dataModel.splice(idx, 1)
|
|
638
|
+
},
|
|
639
|
+
//切换时间
|
|
640
|
+
dateChange(val) {
|
|
641
|
+
if (this.tableKey) {
|
|
642
|
+
this.models[this.tableKey][this.tableIndex][this.widget.model] = val;
|
|
643
|
+
} else {
|
|
644
|
+
this.models[this.widget.model] = val;
|
|
645
|
+
}
|
|
646
|
+
let rule = this.rules[this.widget.model]
|
|
647
|
+
if (rule.length > 0) {
|
|
648
|
+
this.validateInit()
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
//时间比较
|
|
652
|
+
validateTime(rule, value, callback) {
|
|
653
|
+
let options = this.widget.options
|
|
654
|
+
let time = this.tableKey ?
|
|
655
|
+
this.models[this.tableKey][this.tableIndex][options.conditionValue] : this.models[options
|
|
656
|
+
.conditionValue]
|
|
657
|
+
if (!value || !time) {
|
|
658
|
+
callback()
|
|
659
|
+
}
|
|
660
|
+
if (options.condition == '小于') {
|
|
661
|
+
if (moment(value).unix() < moment(time).unix()) {
|
|
662
|
+
callback()
|
|
663
|
+
} else {
|
|
664
|
+
callback("开始时间必须小于结束时间");
|
|
665
|
+
}
|
|
666
|
+
} else {
|
|
667
|
+
if (moment(value).unix() > moment(time).unix()) {
|
|
668
|
+
callback()
|
|
669
|
+
} else {
|
|
670
|
+
callback("开始时间必须小于结束时间");
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
},
|
|
674
|
+
//唯一值校验
|
|
675
|
+
validateonly(rule, value, callback) {
|
|
676
|
+
if (value) {
|
|
677
|
+
let params = {
|
|
678
|
+
formId: this.formId,
|
|
679
|
+
model: this.widget.model,
|
|
680
|
+
value: this.models,
|
|
681
|
+
};
|
|
682
|
+
// if (typeof(this.formDataId) == 'object' && this.formDataId.id) {
|
|
683
|
+
// params.formDataId = this.formDataId.id
|
|
684
|
+
// } else if (typeof(this.formDataId) == 'string') {
|
|
685
|
+
// params.formDataId = this.formDataId
|
|
686
|
+
// } else {
|
|
687
|
+
// params.formDataId = ''
|
|
688
|
+
// }
|
|
689
|
+
this.$u.get(this.widget.options.onlyurl, params).then((res) => {
|
|
690
|
+
if (res.result) {
|
|
691
|
+
callback(res.message);
|
|
692
|
+
} else {
|
|
693
|
+
callback();
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
} else {
|
|
697
|
+
callback();
|
|
698
|
+
}
|
|
699
|
+
},
|
|
700
|
+
maskClick(e) {
|
|
701
|
+
this.isClickByUser = true;
|
|
702
|
+
},
|
|
703
|
+
getMode,
|
|
704
|
+
showTimeStr(dataModel, index) {
|
|
705
|
+
if (this.widget.options.isRange) { // 时间段
|
|
706
|
+
return dataModel && dataModel[index] ? dataModel[index] : false
|
|
707
|
+
} else {
|
|
708
|
+
return dataModel && JSON.stringify(dataModel) != "[]" ? dataModel : false
|
|
709
|
+
}
|
|
710
|
+
},
|
|
711
|
+
//处理时间类型是数组还是字符串
|
|
712
|
+
getTime(datamodal) {
|
|
713
|
+
if (typeof (datamodal) == 'object') {
|
|
714
|
+
if (datamodal.length > 0) {
|
|
715
|
+
return true
|
|
716
|
+
} else {
|
|
717
|
+
return false
|
|
718
|
+
}
|
|
719
|
+
} else {
|
|
720
|
+
return datamodal
|
|
721
|
+
}
|
|
722
|
+
},
|
|
723
|
+
showTime(picker, index) {
|
|
724
|
+
if (!picker || this.widget.options.disabled) return;
|
|
725
|
+
this.$refs[picker].show(index);
|
|
726
|
+
},
|
|
727
|
+
//时间 日期清除
|
|
728
|
+
handleClose() {
|
|
729
|
+
if (this.widget.options.isRange) {
|
|
730
|
+
this.dataModel = []
|
|
731
|
+
} else {
|
|
732
|
+
this.dataModel = ''
|
|
733
|
+
}
|
|
734
|
+
},
|
|
735
|
+
//关联表单根据展示字段展示
|
|
736
|
+
showLabels(values) {
|
|
737
|
+
if (values.length == 0 || !this.widget.options.labels) return false;
|
|
738
|
+
let labels = this.widget.options.labels.split(",");
|
|
739
|
+
let labelsStr = "";
|
|
740
|
+
let splitSign = labels.length > 0 ? "/" : "";
|
|
741
|
+
values.forEach((item) => {
|
|
742
|
+
let _labelStr = "";
|
|
743
|
+
labels.forEach((i) => {
|
|
744
|
+
_labelStr += splitSign + item[i];
|
|
745
|
+
});
|
|
746
|
+
if (splitSign) {
|
|
747
|
+
_labelStr = _labelStr.substring(1);
|
|
748
|
+
}
|
|
749
|
+
labelsStr += "," + _labelStr;
|
|
750
|
+
});
|
|
751
|
+
this.dataModelShow = labelsStr.substring(1);
|
|
752
|
+
},
|
|
753
|
+
// 关联表单
|
|
754
|
+
relateSub(widget) {
|
|
755
|
+
if (this.widget.options.disabled) return;
|
|
756
|
+
let params = {
|
|
757
|
+
SQL: widget.SQL,
|
|
758
|
+
columnName: widget.columnName,
|
|
759
|
+
columnCode: widget.columnCode,
|
|
760
|
+
apiUrl: widget.apiUrl
|
|
761
|
+
}
|
|
762
|
+
var PubsubSign = String(Math.random()).split('.')[1];
|
|
763
|
+
Pubsub.subscribe(PubsubSign, (msg, data) => {
|
|
764
|
+
this.isClickByUser = true;
|
|
765
|
+
this.showLabels(data)
|
|
766
|
+
this.dataModel = data;
|
|
767
|
+
// console.log('发布')
|
|
768
|
+
// this.pulishMsg(data,true);//true代表用户点击
|
|
769
|
+
})
|
|
770
|
+
uni.navigateTo({
|
|
771
|
+
url: '/pages/picker/relateSub?params=' + JSON.stringify(params) + '&sign=' + PubsubSign +
|
|
772
|
+
'&selectedData=' + JSON.stringify(this.dataModel ? this.dataModel : [])
|
|
773
|
+
});
|
|
774
|
+
|
|
775
|
+
},
|
|
776
|
+
//rate value chage
|
|
777
|
+
showFormData() {
|
|
778
|
+
if (this.widget.type === 'userSelector' || this.widget.type == 'relateSub') {
|
|
779
|
+
this.updateUserSelectorModal()
|
|
780
|
+
}
|
|
781
|
+
if (this.widget.type === 'deptSelector') {
|
|
782
|
+
this.updatedeptSelectorModal()
|
|
783
|
+
}
|
|
784
|
+
if (this.widget.type === 'select' || this.widget.type == 'radio' || this.widget.type == 'checkbox') {
|
|
785
|
+
this.updatedSelectModal()
|
|
786
|
+
}
|
|
787
|
+
if (this.widget.type === 'relateSub') {
|
|
788
|
+
this.showLabels(this.dataModel)
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
|
|
792
|
+
updateRadioOrCheckboxModel(arr) {
|
|
793
|
+
if (!arr) return;
|
|
794
|
+
this.checkboxAndRadioOptions = JSON.parse(JSON.stringify(arr));
|
|
795
|
+
if (!this.dataModel) return false;
|
|
796
|
+
this.checkboxAndRadioOptions.forEach(item => {
|
|
797
|
+
if (this.dataModel.includes(item.value)) {
|
|
798
|
+
this.$set(item, 'checked', true)
|
|
799
|
+
} else {
|
|
800
|
+
this.$set(item, 'checked', false)
|
|
801
|
+
}
|
|
802
|
+
})
|
|
803
|
+
// console.log('this.checkboxAndRadioOptions', this.checkboxAndRadioOptions)
|
|
804
|
+
},
|
|
805
|
+
|
|
806
|
+
downLoadFile(path) {
|
|
807
|
+
// console.log(process.uniEnv.uploadUrl)
|
|
808
|
+
// console.log(path)
|
|
809
|
+
// #ifdef H5
|
|
810
|
+
window.open(this.uniEnv.imgUrl + path.url)
|
|
811
|
+
return
|
|
812
|
+
// #endif
|
|
813
|
+
uni.downloadFile({
|
|
814
|
+
// url: this.downLoadUrl + path, //下载地址接口返回
|
|
815
|
+
url: this.uniEnv.imgUrl + path.url,
|
|
816
|
+
filePath: wx.env.USER_DATA_PATH + "/" + path.name,
|
|
817
|
+
success: (data) => {
|
|
818
|
+
if (data.statusCode === 200) {
|
|
819
|
+
//文件保存到本地
|
|
820
|
+
uni.openDocument({
|
|
821
|
+
filePath: data.filePath,
|
|
822
|
+
showMenu: true,
|
|
823
|
+
success: function (res) {
|
|
824
|
+
// console.log('打开文档成功');
|
|
825
|
+
},
|
|
826
|
+
fail(res) {
|
|
827
|
+
console.log(res)
|
|
828
|
+
uni.showToast({
|
|
829
|
+
icon: 'none',
|
|
830
|
+
mask: true,
|
|
831
|
+
title: '下载失败',
|
|
832
|
+
duration: 3000,
|
|
833
|
+
});
|
|
834
|
+
},
|
|
835
|
+
});
|
|
836
|
+
// uni.saveFile({
|
|
837
|
+
// tempFilePath: data.tempFilePath, //临时路径
|
|
838
|
+
// success: function(res) {
|
|
839
|
+
// uni.showToast({
|
|
840
|
+
// icon: 'none',
|
|
841
|
+
// mask: true,
|
|
842
|
+
// title: '文件已保存:' + res.savedFilePath, //保存路径
|
|
843
|
+
// duration: 3000,
|
|
844
|
+
// });
|
|
845
|
+
// setTimeout(() => {
|
|
846
|
+
// //打开文档查看
|
|
847
|
+
// uni.openDocument({
|
|
848
|
+
// filePath: res.savedFilePath,
|
|
849
|
+
// success: function(res) {
|
|
850
|
+
// // console.log('打开文档成功');
|
|
851
|
+
// },
|
|
852
|
+
// complete: function(res) {}
|
|
853
|
+
// });
|
|
854
|
+
// }, 3000)
|
|
855
|
+
// }
|
|
856
|
+
// });
|
|
857
|
+
}
|
|
858
|
+
},
|
|
859
|
+
complete: function (res) {
|
|
860
|
+
// console.log(res)
|
|
861
|
+
}
|
|
862
|
+
})
|
|
863
|
+
},
|
|
864
|
+
|
|
865
|
+
/**纠错**/
|
|
866
|
+
CorrentItem() {
|
|
867
|
+
getApp().globalData.correntFormData
|
|
868
|
+
getApp().globalData.correntWidget = {
|
|
869
|
+
...this.widget,
|
|
870
|
+
dataModel: this.dataModel
|
|
871
|
+
}
|
|
872
|
+
uni.navigateTo({
|
|
873
|
+
url: '/pagesA/Correction/Correction'
|
|
874
|
+
});
|
|
875
|
+
|
|
876
|
+
},
|
|
877
|
+
/****更新*userSelector**/
|
|
878
|
+
updateUserSelectorModal() {
|
|
879
|
+
if (!this.dataModel || !Array.isArray(this.dataModel) || this.dataModel.length == 0) return;
|
|
880
|
+
var str = '';
|
|
881
|
+
//是否展示详情信息
|
|
882
|
+
if (this.widget.options.showfield) {
|
|
883
|
+
this.dataModel.forEach(item => {
|
|
884
|
+
// str += ',' + item.realname + (item.departname,item.phone);
|
|
885
|
+
str +=
|
|
886
|
+
`,${item.realname || item.username || ""} (${item.departname ? item.departname : ""}${item.departName ? item.departName : ""}${item.phone ? "," + item.phone : ""})`
|
|
887
|
+
})
|
|
888
|
+
} else {
|
|
889
|
+
this.dataModel.forEach(item => {
|
|
890
|
+
str += ',' + (item.realname || item.username);
|
|
891
|
+
})
|
|
892
|
+
}
|
|
893
|
+
this.dataModelShow = str.substr(1);
|
|
894
|
+
},
|
|
895
|
+
updatedeptSelectorModal() {
|
|
896
|
+
if (!this.dataModel || !(Object.prototype.toString.call(this.dataModel) === '[object Array]') || this
|
|
897
|
+
.dataModel.length ==
|
|
898
|
+
0) return;
|
|
899
|
+
var str = '';
|
|
900
|
+
this.dataModel.forEach(item => {
|
|
901
|
+
str += ',' + item.departName;
|
|
902
|
+
})
|
|
903
|
+
this.dataModelShow = str.substr(1);
|
|
904
|
+
},
|
|
905
|
+
updatedSelectModal() {
|
|
906
|
+
let options = this.widget.options
|
|
907
|
+
if (this.widget.options.dictCode || this.widget.options.dictName) {
|
|
908
|
+
//根据字典Code, 初始化字典数组
|
|
909
|
+
this.$u.get(
|
|
910
|
+
`/sys/dict/getDictItems/${this.widget.options.dictCode ? this.widget.options.dictCode : this.widget.options.dictName}`,
|
|
911
|
+
).then(res => {
|
|
912
|
+
if (res.success) {
|
|
913
|
+
if (this.widget.type == 'select') {
|
|
914
|
+
this.arrFindOptionLabel(res.result)
|
|
915
|
+
} else if (this.widget.type == 'radio' || this.widget.type == 'checkbox') {
|
|
916
|
+
this.updateRadioOrCheckboxModel(this.arrFindDictOrTable(res.result, 'dictCode'))
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
})
|
|
920
|
+
} else if (this.widget.options.dictTable) {
|
|
921
|
+
let params = {
|
|
922
|
+
tableName: this.widget.options.dictTable
|
|
923
|
+
};
|
|
924
|
+
this.$u.get(`/form/formdesiger/getDataCenterDict`, params).then(res => {
|
|
925
|
+
if (res.success) {
|
|
926
|
+
if (this.widget.type == 'select') {
|
|
927
|
+
this.arrFindOptionLabel(res.result)
|
|
928
|
+
} else if (this.widget.type == 'radio' || this.widget.type == 'checkbox') {
|
|
929
|
+
this.updateRadioOrCheckboxModel(this.arrFindDictOrTable(res.result, 'dictTable'))
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
})
|
|
933
|
+
} else if (this.widget.options.dictUrl) {
|
|
934
|
+
console.log(this.linkage)
|
|
935
|
+
//判断下拉框是否是被联动 linkage是整个表单下拉框联动的合集
|
|
936
|
+
if (this.linkage != null && this.linkage.hasOwnProperty(this.widget.model)) {
|
|
937
|
+
let params = {
|
|
938
|
+
id: this.linkage[this.widget.model]
|
|
939
|
+
}
|
|
940
|
+
this.getSelectUrl(options.dictUrl, params)
|
|
941
|
+
} else if (options.dictUrl.indexOf("?") != -1) {
|
|
942
|
+
let list = options.dictUrl.split("?");
|
|
943
|
+
let url = list[0];
|
|
944
|
+
let params = this.getparams(list[1])
|
|
945
|
+
this.getSelectUrl(url, params)
|
|
946
|
+
} else {
|
|
947
|
+
this.getSelectUrl(options.dictUrl)
|
|
948
|
+
}
|
|
949
|
+
} else {
|
|
950
|
+
if (this.widget.type == 'select') {
|
|
951
|
+
this.arrFindOptionLabel(this.widget.options.options)
|
|
952
|
+
} else if (this.widget.type == 'radio' || this.widget.type == 'checkbox') {
|
|
953
|
+
this.updateRadioOrCheckboxModel(this.widget.options.options)
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
}
|
|
957
|
+
},
|
|
958
|
+
//处理下拉框接口地址数据
|
|
959
|
+
getSelectUrl(url, params) {
|
|
960
|
+
this.$u.get(url, params).then(res => {
|
|
961
|
+
if (res.success) {
|
|
962
|
+
if (this.widget.type == 'select') {
|
|
963
|
+
let arr = res.result
|
|
964
|
+
if (!Array.isArray(arr)) return;
|
|
965
|
+
for (let i = 0; i < arr.length; i++) {
|
|
966
|
+
if (arr[i].dataKey == this.dataModel) {
|
|
967
|
+
this.dataModelShow = arr[i].dataValue
|
|
968
|
+
return
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
} else if (this.widget.type == 'radio' || this.widget.type == 'checkbox') {
|
|
972
|
+
this.updateRadioOrCheckboxModel(this.arrFindDictOrTable(res.result, 'dictTable'))
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
})
|
|
976
|
+
},
|
|
977
|
+
//截取参数
|
|
978
|
+
getparams(url) {
|
|
979
|
+
let obj = {};
|
|
980
|
+
let strs = url.split("&");
|
|
981
|
+
for (var i = 0; i < strs.length; i++) {
|
|
982
|
+
obj[strs[i].split("=")[0]] = strs[i].split("=")[1];
|
|
983
|
+
}
|
|
984
|
+
return obj;
|
|
985
|
+
},
|
|
986
|
+
//checkbox radio dictTable And dictCode ====> options
|
|
987
|
+
arrFindDictOrTable(arr, type) {
|
|
988
|
+
var newArr = []
|
|
989
|
+
if (type == 'dictTable') {
|
|
990
|
+
newArr = arr.map(item => {
|
|
991
|
+
return {
|
|
992
|
+
value: item.dictValue,
|
|
993
|
+
label: item.dictLabel
|
|
538
994
|
}
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
this.updatedSelectModal()
|
|
775
|
-
}
|
|
776
|
-
if (this.widget.type === 'relateSub') {
|
|
777
|
-
this.showLabels(this.dataModel)
|
|
778
|
-
}
|
|
779
|
-
},
|
|
780
|
-
|
|
781
|
-
updateRadioOrCheckboxModel(arr) {
|
|
782
|
-
if (!arr) return;
|
|
783
|
-
this.checkboxAndRadioOptions = JSON.parse(JSON.stringify(arr));
|
|
784
|
-
if (!this.dataModel) return false;
|
|
785
|
-
this.checkboxAndRadioOptions.forEach(item => {
|
|
786
|
-
if (this.dataModel.includes(item.value)) {
|
|
787
|
-
this.$set(item, 'checked', true)
|
|
788
|
-
} else {
|
|
789
|
-
this.$set(item, 'checked', false)
|
|
790
|
-
}
|
|
791
|
-
})
|
|
792
|
-
// console.log('this.checkboxAndRadioOptions', this.checkboxAndRadioOptions)
|
|
793
|
-
},
|
|
794
|
-
|
|
795
|
-
downLoadFile(path) {
|
|
796
|
-
// console.log(process.uniEnv.uploadUrl)
|
|
797
|
-
// console.log(path)
|
|
798
|
-
// #ifdef H5
|
|
799
|
-
window.open(this.uniEnv.imgUrl + path.url)
|
|
800
|
-
return
|
|
801
|
-
// #endif
|
|
802
|
-
uni.downloadFile({
|
|
803
|
-
// url: this.downLoadUrl + path, //下载地址接口返回
|
|
804
|
-
url: this.uniEnv.imgUrl + path.url,
|
|
805
|
-
filePath: wx.env.USER_DATA_PATH + "/" + path.name,
|
|
806
|
-
success: (data) => {
|
|
807
|
-
if (data.statusCode === 200) {
|
|
808
|
-
//文件保存到本地
|
|
809
|
-
uni.openDocument({
|
|
810
|
-
filePath: data.filePath,
|
|
811
|
-
showMenu: true,
|
|
812
|
-
success: function(res) {
|
|
813
|
-
// console.log('打开文档成功');
|
|
814
|
-
},
|
|
815
|
-
fail(res) {
|
|
816
|
-
console.log(res)
|
|
817
|
-
uni.showToast({
|
|
818
|
-
icon: 'none',
|
|
819
|
-
mask: true,
|
|
820
|
-
title: '下载失败',
|
|
821
|
-
duration: 3000,
|
|
822
|
-
});
|
|
823
|
-
},
|
|
824
|
-
});
|
|
825
|
-
// uni.saveFile({
|
|
826
|
-
// tempFilePath: data.tempFilePath, //临时路径
|
|
827
|
-
// success: function(res) {
|
|
828
|
-
// uni.showToast({
|
|
829
|
-
// icon: 'none',
|
|
830
|
-
// mask: true,
|
|
831
|
-
// title: '文件已保存:' + res.savedFilePath, //保存路径
|
|
832
|
-
// duration: 3000,
|
|
833
|
-
// });
|
|
834
|
-
// setTimeout(() => {
|
|
835
|
-
// //打开文档查看
|
|
836
|
-
// uni.openDocument({
|
|
837
|
-
// filePath: res.savedFilePath,
|
|
838
|
-
// success: function(res) {
|
|
839
|
-
// // console.log('打开文档成功');
|
|
840
|
-
// },
|
|
841
|
-
// complete: function(res) {}
|
|
842
|
-
// });
|
|
843
|
-
// }, 3000)
|
|
844
|
-
// }
|
|
845
|
-
// });
|
|
846
|
-
}
|
|
847
|
-
},
|
|
848
|
-
complete: function(res) {
|
|
849
|
-
// console.log(res)
|
|
850
|
-
}
|
|
851
|
-
})
|
|
852
|
-
},
|
|
853
|
-
|
|
854
|
-
/**纠错**/
|
|
855
|
-
CorrentItem() {
|
|
856
|
-
getApp().globalData.correntFormData
|
|
857
|
-
getApp().globalData.correntWidget = {
|
|
858
|
-
...this.widget,
|
|
859
|
-
dataModel: this.dataModel
|
|
860
|
-
}
|
|
861
|
-
uni.navigateTo({
|
|
862
|
-
url: '/pagesA/Correction/Correction'
|
|
863
|
-
});
|
|
864
|
-
|
|
865
|
-
},
|
|
866
|
-
/****更新*userSelector**/
|
|
867
|
-
updateUserSelectorModal() {
|
|
868
|
-
if (!this.dataModel || !Array.isArray(this.dataModel) || this.dataModel.length == 0) return;
|
|
869
|
-
var str = '';
|
|
870
|
-
//是否展示详情信息
|
|
871
|
-
if (this.widget.options.showfield) {
|
|
872
|
-
this.dataModel.forEach(item => {
|
|
873
|
-
// str += ',' + item.realname + (item.departname,item.phone);
|
|
874
|
-
str +=
|
|
875
|
-
`,${item.realname || item.username || ""} (${item.departname ? item.departname : ""}${item.departName ? item.departName : ""}${item.phone ? ","+item.phone : ""})`
|
|
876
|
-
})
|
|
877
|
-
} else {
|
|
878
|
-
this.dataModel.forEach(item => {
|
|
879
|
-
str += ',' + (item.realname || item.username);
|
|
880
|
-
})
|
|
881
|
-
}
|
|
882
|
-
this.dataModelShow = str.substr(1);
|
|
883
|
-
},
|
|
884
|
-
updatedeptSelectorModal() {
|
|
885
|
-
if (!this.dataModel || !(Object.prototype.toString.call(this.dataModel) === '[object Array]') || this
|
|
886
|
-
.dataModel.length ==
|
|
887
|
-
0) return;
|
|
888
|
-
var str = '';
|
|
889
|
-
this.dataModel.forEach(item => {
|
|
890
|
-
str += ',' + item.departName;
|
|
891
|
-
})
|
|
892
|
-
this.dataModelShow = str.substr(1);
|
|
893
|
-
},
|
|
894
|
-
updatedSelectModal() {
|
|
895
|
-
let options = this.widget.options
|
|
896
|
-
if (this.widget.options.dictCode || this.widget.options.dictName) {
|
|
897
|
-
//根据字典Code, 初始化字典数组
|
|
898
|
-
this.$u.get(
|
|
899
|
-
`/sys/dict/getDictItems/${this.widget.options.dictCode ? this.widget.options.dictCode : this.widget.options.dictName}`,
|
|
900
|
-
).then(res => {
|
|
901
|
-
if (res.success) {
|
|
902
|
-
if (this.widget.type == 'select') {
|
|
903
|
-
this.arrFindOptionLabel(res.result)
|
|
904
|
-
} else if (this.widget.type == 'radio' || this.widget.type == 'checkbox') {
|
|
905
|
-
this.updateRadioOrCheckboxModel(this.arrFindDictOrTable(res.result, 'dictCode'))
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
})
|
|
909
|
-
} else if (this.widget.options.dictTable) {
|
|
910
|
-
let params = {
|
|
911
|
-
tableName: this.widget.options.dictTable
|
|
912
|
-
};
|
|
913
|
-
this.$u.get(`/form/formdesiger/getDataCenterDict`, params).then(res => {
|
|
914
|
-
if (res.success) {
|
|
915
|
-
if (this.widget.type == 'select') {
|
|
916
|
-
this.arrFindOptionLabel(res.result)
|
|
917
|
-
} else if (this.widget.type == 'radio' || this.widget.type == 'checkbox') {
|
|
918
|
-
this.updateRadioOrCheckboxModel(this.arrFindDictOrTable(res.result, 'dictTable'))
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
})
|
|
922
|
-
} else if (this.widget.options.dictUrl) {
|
|
923
|
-
console.log(this.linkage)
|
|
924
|
-
//判断下拉框是否是被联动 linkage是整个表单下拉框联动的合集
|
|
925
|
-
if (this.linkage != null && this.linkage.hasOwnProperty(this.widget.model)) {
|
|
926
|
-
let params = {
|
|
927
|
-
id: this.linkage[this.widget.model]
|
|
928
|
-
}
|
|
929
|
-
this.getSelectUrl(options.dictUrl, params)
|
|
930
|
-
} else if (options.dictUrl.indexOf("?") != -1) {
|
|
931
|
-
let list = options.dictUrl.split("?");
|
|
932
|
-
let url = list[0];
|
|
933
|
-
let params = this.getparams(list[1])
|
|
934
|
-
this.getSelectUrl(url, params)
|
|
935
|
-
} else {
|
|
936
|
-
this.getSelectUrl(options.dictUrl)
|
|
937
|
-
}
|
|
938
|
-
} else {
|
|
939
|
-
if (this.widget.type == 'select') {
|
|
940
|
-
this.arrFindOptionLabel(this.widget.options.options)
|
|
941
|
-
} else if (this.widget.type == 'radio' || this.widget.type == 'checkbox') {
|
|
942
|
-
this.updateRadioOrCheckboxModel(this.widget.options.options)
|
|
943
|
-
}
|
|
944
|
-
|
|
945
|
-
}
|
|
946
|
-
},
|
|
947
|
-
//处理下拉框接口地址数据
|
|
948
|
-
getSelectUrl(url, params) {
|
|
949
|
-
this.$u.get(url, params).then(res => {
|
|
950
|
-
if (res.success) {
|
|
951
|
-
if (this.widget.type == 'select') {
|
|
952
|
-
let arr = res.result
|
|
953
|
-
if (!Array.isArray(arr)) return;
|
|
954
|
-
for (let i = 0; i < arr.length; i++) {
|
|
955
|
-
if (arr[i].dataKey == this.dataModel) {
|
|
956
|
-
this.dataModelShow = arr[i].dataValue
|
|
957
|
-
return
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
} else if (this.widget.type == 'radio' || this.widget.type == 'checkbox') {
|
|
961
|
-
this.updateRadioOrCheckboxModel(this.arrFindDictOrTable(res.result, 'dictTable'))
|
|
962
|
-
}
|
|
963
|
-
}
|
|
964
|
-
})
|
|
965
|
-
},
|
|
966
|
-
//截取参数
|
|
967
|
-
getparams(url) {
|
|
968
|
-
let obj = {};
|
|
969
|
-
let strs = url.split("&");
|
|
970
|
-
for (var i = 0; i < strs.length; i++) {
|
|
971
|
-
obj[strs[i].split("=")[0]] = strs[i].split("=")[1];
|
|
972
|
-
}
|
|
973
|
-
return obj;
|
|
974
|
-
},
|
|
975
|
-
//checkbox radio dictTable And dictCode ====> options
|
|
976
|
-
arrFindDictOrTable(arr, type) {
|
|
977
|
-
var newArr = []
|
|
978
|
-
if (type == 'dictTable') {
|
|
979
|
-
newArr = arr.map(item => {
|
|
980
|
-
return {
|
|
981
|
-
value: item.dictValue,
|
|
982
|
-
label: item.dictLabel
|
|
983
|
-
}
|
|
984
|
-
})
|
|
985
|
-
} else {
|
|
986
|
-
newArr = arr.map(item => {
|
|
987
|
-
return {
|
|
988
|
-
value: item.value,
|
|
989
|
-
label: item.text
|
|
990
|
-
}
|
|
991
|
-
})
|
|
992
|
-
}
|
|
993
|
-
// console.log(newArr)
|
|
994
|
-
return newArr;
|
|
995
|
-
},
|
|
996
|
-
arrFindOptionLabel(arr) {
|
|
997
|
-
if (!Array.isArray(arr)) return false;
|
|
998
|
-
let that = this;
|
|
999
|
-
arr.forEach(item => {
|
|
1000
|
-
if (item.dictValue == this.dataModel) {
|
|
1001
|
-
this.dataModelShow = item.dictLabel
|
|
1002
|
-
} else if (item.value == this.dataModel) {
|
|
1003
|
-
if (item.text) {
|
|
1004
|
-
this.dataModelShow = item.text
|
|
1005
|
-
} else {
|
|
1006
|
-
this.dataModelShow = item.value
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
})
|
|
1010
|
-
},
|
|
1011
|
-
/**点击表单后 代表确认已知晓验证不通过**/
|
|
1012
|
-
resetShowFalse() {
|
|
1013
|
-
this.showFalse = false;
|
|
1014
|
-
this.$emit("update:models", {
|
|
1015
|
-
...this.models
|
|
1016
|
-
})
|
|
1017
|
-
},
|
|
1018
|
-
updateDataModel() {
|
|
1019
|
-
if (this.tableKey) {
|
|
1020
|
-
this.dataModel = this.models[this.tableKey][this.tableIndex][this.widget.model]
|
|
1021
|
-
} else {
|
|
1022
|
-
if (this.widget.type === 'number') {
|
|
1023
|
-
if (this.models[this.widget.model]) {
|
|
1024
|
-
this.dataModel = this.models[this.widget.model]
|
|
1025
|
-
} else {
|
|
1026
|
-
this.dataModel = this.widget.options.min
|
|
1027
|
-
}
|
|
1028
|
-
} else {
|
|
1029
|
-
this.dataModel = this.models[this.widget.model]
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
},
|
|
1033
|
-
tableValueSet(val) {
|
|
1034
|
-
var cloneArr = this.models[this.tableKey];
|
|
1035
|
-
if (!(typeof cloneArr[this.tableIndex] == "object")) {
|
|
1036
|
-
cloneArr[this.tableIndex] = {};
|
|
1037
|
-
}
|
|
1038
|
-
cloneArr[this.tableIndex][this.widget.model] = val;
|
|
1039
|
-
this.$emit("update:models", {
|
|
1040
|
-
...this.models,
|
|
1041
|
-
[this.tableKey]: cloneArr
|
|
1042
|
-
});
|
|
1043
|
-
this.$emit("input-change", val, this.widget.model);
|
|
1044
|
-
},
|
|
1045
|
-
/****/
|
|
1046
|
-
// getParentModels(){
|
|
1047
|
-
// Pubsub.subscribe('randomObserve',(msg,data) => {
|
|
1048
|
-
// // console.log('fu传递model',msg, data)
|
|
1049
|
-
// // this.dataModel = data[this.widget.model];//dataModel
|
|
1050
|
-
// })
|
|
1051
|
-
// },
|
|
1052
|
-
// 当前formItem是否显示*号
|
|
1053
|
-
showRequiredAsteriskFun() {
|
|
1054
|
-
// console.log(this.rules, '----')
|
|
1055
|
-
const rules = this.rules[this.widget.model];
|
|
1056
|
-
// console.log('rules', rules)
|
|
1057
|
-
if (rules && rules.length > 0) {
|
|
1058
|
-
if (rules.find((rule) => rule.required === true)) {
|
|
1059
|
-
return true
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
return false
|
|
1063
|
-
},
|
|
1064
|
-
/****选择人员****/
|
|
1065
|
-
selectUser(flag) {
|
|
1066
|
-
if (this.widget.options.disabled) return
|
|
1067
|
-
this.isClickByUser = true
|
|
1068
|
-
var PubsubSign = 'SelectUser' + String(Math.random()).split('.')[1];
|
|
1069
|
-
Pubsub.subscribe(PubsubSign, (msg, data) => {
|
|
1070
|
-
this.dataModel = data;
|
|
1071
|
-
this.updateUserSelectorModal()
|
|
1072
|
-
})
|
|
1073
|
-
let departId = -1
|
|
1074
|
-
let departName = ""
|
|
1075
|
-
if (this.widget.options.departRelation) {
|
|
1076
|
-
const userInfo = uni.getStorageSync('userinfo')
|
|
1077
|
-
console.log("userInfo: ", userInfo)
|
|
1078
|
-
departId = userInfo.departId || userInfo.depart_id
|
|
1079
|
-
departName = userInfo.departName || userInfo.depart_name
|
|
995
|
+
})
|
|
996
|
+
} else {
|
|
997
|
+
newArr = arr.map(item => {
|
|
998
|
+
return {
|
|
999
|
+
value: item.value,
|
|
1000
|
+
label: item.text
|
|
1001
|
+
}
|
|
1002
|
+
})
|
|
1003
|
+
}
|
|
1004
|
+
// console.log(newArr)
|
|
1005
|
+
return newArr;
|
|
1006
|
+
},
|
|
1007
|
+
arrFindOptionLabel(arr) {
|
|
1008
|
+
if (!Array.isArray(arr)) return false;
|
|
1009
|
+
let that = this;
|
|
1010
|
+
let str = ''
|
|
1011
|
+
arr.forEach(item => {
|
|
1012
|
+
if (item.dictValue == this.dataModel || this.dataModel.includes(item.dictValue)) {
|
|
1013
|
+
str += ',' + item.dictLabel
|
|
1014
|
+
} else if (item.value == this.dataModel || this.dataModel.includes(item.value)) {
|
|
1015
|
+
if (item.text) {
|
|
1016
|
+
str += ',' + item.text;
|
|
1017
|
+
|
|
1018
|
+
} else {
|
|
1019
|
+
str += ',' + item.value
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
})
|
|
1023
|
+
this.dataModelShow = str.substring(1)
|
|
1024
|
+
},
|
|
1025
|
+
/**点击表单后 代表确认已知晓验证不通过**/
|
|
1026
|
+
resetShowFalse() {
|
|
1027
|
+
this.showFalse = false;
|
|
1028
|
+
this.$emit("update:models", {
|
|
1029
|
+
...this.models
|
|
1030
|
+
})
|
|
1031
|
+
},
|
|
1032
|
+
updateDataModel() {
|
|
1033
|
+
if (this.tableKey) {
|
|
1034
|
+
this.dataModel = this.models[this.tableKey][this.tableIndex][this.widget.model]
|
|
1035
|
+
} else {
|
|
1036
|
+
if (this.widget.type === 'number') {
|
|
1037
|
+
if (this.models[this.widget.model]) {
|
|
1038
|
+
this.dataModel = this.models[this.widget.model]
|
|
1039
|
+
} else {
|
|
1040
|
+
this.dataModel = this.widget.options.min
|
|
1041
|
+
}
|
|
1042
|
+
if (!this.dataModel) this.dataModel = 0
|
|
1043
|
+
} else {
|
|
1044
|
+
this.dataModel = this.models[this.widget.model]
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
},
|
|
1048
|
+
tableValueSet(val) {
|
|
1049
|
+
var cloneArr = this.models[this.tableKey];
|
|
1050
|
+
if (!(typeof cloneArr[this.tableIndex] == "object")) {
|
|
1051
|
+
cloneArr[this.tableIndex] = {};
|
|
1052
|
+
}
|
|
1053
|
+
cloneArr[this.tableIndex][this.widget.model] = val;
|
|
1054
|
+
this.$emit("update:models", {
|
|
1055
|
+
...this.models,
|
|
1056
|
+
[this.tableKey]: cloneArr
|
|
1057
|
+
});
|
|
1058
|
+
this.$emit("input-change", val, this.widget.model);
|
|
1059
|
+
},
|
|
1060
|
+
/****/
|
|
1061
|
+
// getParentModels(){
|
|
1062
|
+
// Pubsub.subscribe('randomObserve',(msg,data) => {
|
|
1063
|
+
// // console.log('fu传递model',msg, data)
|
|
1064
|
+
// // this.dataModel = data[this.widget.model];//dataModel
|
|
1065
|
+
// })
|
|
1066
|
+
// },
|
|
1067
|
+
// 当前formItem是否显示*号
|
|
1068
|
+
showRequiredAsteriskFun() {
|
|
1069
|
+
// console.log(this.rules, '----')
|
|
1070
|
+
const rules = this.rules[this.widget.model];
|
|
1071
|
+
// console.log('rules', rules)
|
|
1072
|
+
if (rules && rules.length > 0) {
|
|
1073
|
+
if (rules.find((rule) => rule.required === true)) {
|
|
1074
|
+
return true
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
return false
|
|
1078
|
+
},
|
|
1079
|
+
/****选择人员****/
|
|
1080
|
+
selectUser(flag) {
|
|
1081
|
+
if (this.widget.options.disabled) return
|
|
1082
|
+
this.isClickByUser = true
|
|
1083
|
+
var PubsubSign = 'SelectUser' + String(Math.random()).split('.')[1];
|
|
1084
|
+
Pubsub.subscribe(PubsubSign, (msg, data) => {
|
|
1085
|
+
this.dataModel = data;
|
|
1086
|
+
this.updateUserSelectorModal()
|
|
1087
|
+
})
|
|
1088
|
+
let departId = -1
|
|
1089
|
+
let departName = ""
|
|
1090
|
+
if (this.widget.options.departRelation) {
|
|
1091
|
+
const userInfo = uni.getStorageSync('userinfo')
|
|
1092
|
+
console.log("userInfo: ", userInfo)
|
|
1093
|
+
departId = userInfo.departId || userInfo.depart_id
|
|
1094
|
+
departName = userInfo.departName || userInfo.depart_name
|
|
1095
|
+
}
|
|
1096
|
+
uni.navigateTo({
|
|
1097
|
+
url: '/pages/picker/picker?departRelation=' + (this.widget.options.departRelation ? 1 : 0) + '&departId=' + departId + '&departName=' + departName + '&sign=' + PubsubSign + '&multiple=' + flag + '&roleId=' + (this
|
|
1098
|
+
.widget.options.role ? this.widget.options.role : '') + '&selectedData=' + JSON
|
|
1099
|
+
.stringify(this.dataModel ? this.dataModel : [])
|
|
1100
|
+
});
|
|
1101
|
+
},
|
|
1102
|
+
// select报修人员
|
|
1103
|
+
handleSeclet(flag) {
|
|
1104
|
+
// uni.hideKeyboard()
|
|
1105
|
+
// console.log(this.widget)
|
|
1106
|
+
if (this.widget.options.disabled) {
|
|
1107
|
+
return false
|
|
1108
|
+
} else {
|
|
1109
|
+
var optionsData = JSON.stringify(this.widget.options)
|
|
1110
|
+
var PubsubSign = String(Math.random()).split('.')[1];
|
|
1111
|
+
Pubsub.subscribe(PubsubSign, (msg, data) => {
|
|
1112
|
+
console.log(data)
|
|
1113
|
+
this.dataModel = data.map(item => item.value)
|
|
1114
|
+
|
|
1115
|
+
if (!data || !Array.isArray(data) || data.length == 0) {
|
|
1116
|
+
this.dataModel = ''
|
|
1117
|
+
this.dataModelShow = ''
|
|
1118
|
+
return;
|
|
1119
|
+
}
|
|
1120
|
+
let str = '';
|
|
1121
|
+
data.forEach(item => {
|
|
1122
|
+
str += ',' + item.label;
|
|
1123
|
+
})
|
|
1124
|
+
this.dataModelShow = str.substr(1);
|
|
1125
|
+
|
|
1126
|
+
// this.dataModel = data[0].value;
|
|
1127
|
+
// this.dataModelShow = data[0].label;
|
|
1128
|
+
// console.log('this.dataModelShow', this.dataModelShow)
|
|
1129
|
+
})
|
|
1130
|
+
console.log(this.linkage)
|
|
1131
|
+
let model = this.widget.model
|
|
1132
|
+
let arr = Object.keys(this.linkage)
|
|
1133
|
+
let id = ''
|
|
1134
|
+
if (arr.length > 0 && this.linkage.hasOwnProperty(model)) {
|
|
1135
|
+
id = this.linkage[model]
|
|
1136
|
+
}
|
|
1137
|
+
uni.navigateTo({
|
|
1138
|
+
url: '/pages/picker/service?sign=' + PubsubSign + '&multiple=' + flag + '&optionsData=' +
|
|
1139
|
+
encodeURIComponent(optionsData) + '&dataModel=' + JSON.stringify(this.dataModel) + '&id=' + id
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
},
|
|
1143
|
+
/****选择部门****/
|
|
1144
|
+
selectdept(flag) {
|
|
1145
|
+
if (this.widget.options.disabled) return;
|
|
1146
|
+
// uni.hideKeyboard()
|
|
1147
|
+
let departRela = ''
|
|
1148
|
+
if (this.widget.options.departRelation) {
|
|
1149
|
+
departRela = this.widget.options.departRelation
|
|
1150
|
+
}
|
|
1151
|
+
var PubsubSign = String(Math.random()).split('.')[1];
|
|
1152
|
+
Pubsub.subscribe(PubsubSign, (msg, data) => {
|
|
1153
|
+
this.dataModel = data;
|
|
1154
|
+
})
|
|
1155
|
+
var departType = this.widget.options.departType ? this.widget.options.departType : ''
|
|
1156
|
+
uni.navigateTo({
|
|
1157
|
+
url: '/pages/picker/depart?sign=' + PubsubSign + '&multiple=' + flag + '&departRela=' +
|
|
1158
|
+
departRela + '&selectedDepart=' + JSON.stringify(this.dataModel ? this.dataModel : []) + '&departType=' +
|
|
1159
|
+
departType
|
|
1160
|
+
});
|
|
1161
|
+
},
|
|
1162
|
+
// 获取EvanForm组件
|
|
1163
|
+
getParent() {
|
|
1164
|
+
let parent = this.$parent
|
|
1165
|
+
let parentName = parent.$options.name
|
|
1166
|
+
while (parentName !== 'EvanForm') {
|
|
1167
|
+
parent = parent.$parent
|
|
1168
|
+
parentName = parent.$options.name
|
|
1169
|
+
}
|
|
1170
|
+
return parent
|
|
1171
|
+
},
|
|
1172
|
+
getRules() {
|
|
1173
|
+
let form = this.getParent()
|
|
1174
|
+
let formRules = form.mRules;
|
|
1175
|
+
formRules = formRules ? formRules[this.prop] : [];
|
|
1176
|
+
return [].concat(formRules || []);
|
|
1177
|
+
},
|
|
1178
|
+
validateField(props, callback) {
|
|
1179
|
+
// console.log('---p', props)
|
|
1180
|
+
utils.validateField(this.model, this.mRules, props, callback, {
|
|
1181
|
+
showMessage: this.showMessage
|
|
1182
|
+
})
|
|
1183
|
+
},
|
|
1184
|
+
//打开级联选择器
|
|
1185
|
+
openCascdar() {
|
|
1186
|
+
this.$refs.picker.show()
|
|
1187
|
+
},
|
|
1188
|
+
cancel(e) {
|
|
1189
|
+
console.log(e)
|
|
1190
|
+
},
|
|
1191
|
+
open(item) {
|
|
1192
|
+
// 打开颜色选择器
|
|
1193
|
+
this.$refs.colorPicker.open();
|
|
1194
|
+
},
|
|
1195
|
+
confirm(event) {
|
|
1196
|
+
this.dataModel = event.hex
|
|
1197
|
+
},
|
|
1198
|
+
editOk(res) {
|
|
1199
|
+
this.dataModel = res.html
|
|
1200
|
+
console.log(this.dataModel);
|
|
1201
|
+
},
|
|
1202
|
+
//开关
|
|
1203
|
+
switch1Change: function (e) {
|
|
1204
|
+
this.dataModel = e.target.value
|
|
1205
|
+
},
|
|
1206
|
+
getBase64(base64) {
|
|
1207
|
+
this.signatrueImage = this.dataModel = base64
|
|
1208
|
+
this.signatrueFlag = false
|
|
1209
|
+
}
|
|
1210
|
+
},
|
|
1211
|
+
watch: {
|
|
1212
|
+
models: {
|
|
1213
|
+
deep: true,
|
|
1214
|
+
handler(v) {
|
|
1215
|
+
// this.updateDataModel(); // 当脚本文件里面 改动 models值后 需要更新 对应的
|
|
1216
|
+
// this.showFormData();
|
|
1217
|
+
if (this.tableKey) { //处理子表单删除行的时候 值未更新
|
|
1218
|
+
this.updateDataModel();
|
|
1219
|
+
this.showFormData();
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
},
|
|
1223
|
+
dataModel(v) {
|
|
1224
|
+
if (this.tableKey) {
|
|
1225
|
+
this.tableValueSet(v);
|
|
1226
|
+
} else {
|
|
1227
|
+
this.models[this.widget.model] = v
|
|
1228
|
+
if (this.widget.type === 'userSelector') {
|
|
1229
|
+
this.updateUserSelectorModal()
|
|
1080
1230
|
}
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
this.dataModel = data[0].value;
|
|
1099
|
-
this.dataModelShow = data[0].label;
|
|
1100
|
-
// console.log('this.dataModelShow', this.dataModelShow)
|
|
1101
|
-
})
|
|
1102
|
-
console.log(this.linkage)
|
|
1103
|
-
let model = this.widget.model
|
|
1104
|
-
let arr = Object.keys(this.linkage)
|
|
1105
|
-
let id = ''
|
|
1106
|
-
if (arr.length > 0 && this.linkage.hasOwnProperty(model)) {
|
|
1107
|
-
id = this.linkage[model]
|
|
1108
|
-
}
|
|
1109
|
-
uni.navigateTo({
|
|
1110
|
-
url: '/pages/picker/service?sign=' + PubsubSign + '&multiple=' + flag + '&optionsData=' +
|
|
1111
|
-
encodeURIComponent(optionsData) + '&dataModel=' + this.dataModel + '&id=' + id
|
|
1112
|
-
});
|
|
1113
|
-
}
|
|
1114
|
-
},
|
|
1115
|
-
/****选择部门****/
|
|
1116
|
-
selectdept(flag) {
|
|
1117
|
-
if (this.widget.options.disabled) return;
|
|
1118
|
-
// uni.hideKeyboard()
|
|
1119
|
-
let departRela = ''
|
|
1120
|
-
if (this.widget.options.departRelation) {
|
|
1121
|
-
departRela = this.widget.options.departRelation
|
|
1122
|
-
}
|
|
1123
|
-
var PubsubSign = String(Math.random()).split('.')[1];
|
|
1124
|
-
Pubsub.subscribe(PubsubSign, (msg, data) => {
|
|
1125
|
-
this.dataModel = data;
|
|
1126
|
-
})
|
|
1127
|
-
var departType = this.widget.options.departType ? this.widget.options.departType : ''
|
|
1128
|
-
uni.navigateTo({
|
|
1129
|
-
url: '/pages/picker/depart?sign=' + PubsubSign + '&multiple=' + flag + '&departRela=' +
|
|
1130
|
-
departRela + '&selectedDepart=' + JSON.stringify(this.dataModel ? this.dataModel : []) + '&departType=' +
|
|
1131
|
-
departType
|
|
1132
|
-
});
|
|
1133
|
-
},
|
|
1134
|
-
// 获取EvanForm组件
|
|
1135
|
-
getParent() {
|
|
1136
|
-
let parent = this.$parent
|
|
1137
|
-
let parentName = parent.$options.name
|
|
1138
|
-
while (parentName !== 'EvanForm') {
|
|
1139
|
-
parent = parent.$parent
|
|
1140
|
-
parentName = parent.$options.name
|
|
1141
|
-
}
|
|
1142
|
-
return parent
|
|
1143
|
-
},
|
|
1144
|
-
getRules() {
|
|
1145
|
-
let form = this.getParent()
|
|
1146
|
-
let formRules = form.mRules;
|
|
1147
|
-
formRules = formRules ? formRules[this.prop] : [];
|
|
1148
|
-
return [].concat(formRules || []);
|
|
1149
|
-
},
|
|
1150
|
-
validateField(props, callback) {
|
|
1151
|
-
// console.log('---p', props)
|
|
1152
|
-
utils.validateField(this.model, this.mRules, props, callback, {
|
|
1153
|
-
showMessage: this.showMessage
|
|
1154
|
-
})
|
|
1155
|
-
},
|
|
1156
|
-
//打开级联选择器
|
|
1157
|
-
openCascdar() {
|
|
1158
|
-
this.$refs.picker.show()
|
|
1159
|
-
},
|
|
1160
|
-
cancel(e) {
|
|
1161
|
-
console.log(e)
|
|
1162
|
-
},
|
|
1163
|
-
open(item) {
|
|
1164
|
-
// 打开颜色选择器
|
|
1165
|
-
this.$refs.colorPicker.open();
|
|
1166
|
-
},
|
|
1167
|
-
confirm(event) {
|
|
1168
|
-
this.dataModel = event.hex
|
|
1169
|
-
},
|
|
1170
|
-
editOk(res) {
|
|
1171
|
-
this.dataModel = res.html
|
|
1172
|
-
console.log(this.dataModel);
|
|
1173
|
-
},
|
|
1174
|
-
//开关
|
|
1175
|
-
switch1Change: function(e) {
|
|
1176
|
-
this.dataModel = e.target.value
|
|
1177
|
-
},
|
|
1178
|
-
getBase64(base64) {
|
|
1179
|
-
this.signatrueImage = this.dataModel = base64
|
|
1180
|
-
this.signatrueFlag = false
|
|
1181
|
-
}
|
|
1182
|
-
},
|
|
1183
|
-
watch: {
|
|
1184
|
-
models: {
|
|
1185
|
-
deep: true,
|
|
1186
|
-
handler(v) {
|
|
1187
|
-
// this.updateDataModel(); // 当脚本文件里面 改动 models值后 需要更新 对应的
|
|
1188
|
-
// this.showFormData();
|
|
1189
|
-
if (this.tableKey) { //处理子表单删除行的时候 值未更新
|
|
1190
|
-
this.updateDataModel();
|
|
1191
|
-
this.showFormData();
|
|
1192
|
-
}
|
|
1193
|
-
}
|
|
1194
|
-
},
|
|
1195
|
-
dataModel(v) {
|
|
1196
|
-
if (this.tableKey) {
|
|
1197
|
-
this.tableValueSet(v);
|
|
1198
|
-
} else {
|
|
1199
|
-
this.models[this.widget.model] = v
|
|
1200
|
-
if (this.widget.type === 'userSelector') {
|
|
1201
|
-
this.updateUserSelectorModal()
|
|
1202
|
-
}
|
|
1203
|
-
if (this.widget.type === 'deptSelector') {
|
|
1204
|
-
this.updatedeptSelectorModal()
|
|
1205
|
-
}
|
|
1206
|
-
this.$emit("update:models", {
|
|
1207
|
-
...this.models,
|
|
1208
|
-
[this.widget.model]: v
|
|
1209
|
-
});
|
|
1210
|
-
}
|
|
1211
|
-
this.pulishMsg(v, this.isClickByUser);
|
|
1212
|
-
this.isClickByUser = false;
|
|
1213
|
-
/**表单未校验前 不允许 次次校验,校验后实时监听校验*/
|
|
1214
|
-
if (!this.firstValidateField) {
|
|
1215
|
-
// this.init()
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1219
|
-
}
|
|
1231
|
+
if (this.widget.type === 'deptSelector') {
|
|
1232
|
+
this.updatedeptSelectorModal()
|
|
1233
|
+
}
|
|
1234
|
+
this.$emit("update:models", {
|
|
1235
|
+
...this.models,
|
|
1236
|
+
[this.widget.model]: v
|
|
1237
|
+
});
|
|
1238
|
+
}
|
|
1239
|
+
this.pulishMsg(v, this.isClickByUser);
|
|
1240
|
+
this.isClickByUser = false;
|
|
1241
|
+
/**表单未校验前 不允许 次次校验,校验后实时监听校验*/
|
|
1242
|
+
if (!this.firstValidateField) {
|
|
1243
|
+
// this.init()
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1220
1248
|
</script>
|
|
1221
1249
|
|
|
1222
1250
|
|
|
1223
1251
|
<style lang="scss" scoped>
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
flex-direction: row;
|
|
1361
|
-
align-items: center;
|
|
1362
|
-
justify-content: flex-end;
|
|
1363
|
-
}
|
|
1364
|
-
|
|
1365
|
-
&--top {
|
|
1366
|
-
.evan-form-item-container__label {
|
|
1367
|
-
// padding-bottom: 10upx;
|
|
1368
|
-
color: #000000;
|
|
1369
|
-
}
|
|
1370
|
-
}
|
|
1371
|
-
}
|
|
1372
|
-
|
|
1373
|
-
/deep/ .form-input-placeholder {
|
|
1374
|
-
// line-height: 90upx;
|
|
1375
|
-
color: #555;
|
|
1376
|
-
}
|
|
1377
|
-
|
|
1378
|
-
.form-textarea-placeholder {
|
|
1379
|
-
padding-top: 28upx;
|
|
1380
|
-
font-size: 34upx;
|
|
1381
|
-
width: 100%;
|
|
1382
|
-
}
|
|
1383
|
-
|
|
1384
|
-
.evan-form-item-container--top .radio-height {
|
|
1385
|
-
font-size: $uni-form-title-font-size;
|
|
1386
|
-
// font-weight: bold;
|
|
1387
|
-
// line-height: 40upx;
|
|
1388
|
-
padding: 25upx 0 25upx 30rpx;
|
|
1389
|
-
display: inline-block;
|
|
1390
|
-
}
|
|
1391
|
-
|
|
1392
|
-
/deep/.wx-picker-container .wx-picker-action.wx-picker-action-confirm {
|
|
1393
|
-
color: #007AFF !important;
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
.opencolor {
|
|
1397
|
-
width: 50upx;
|
|
1398
|
-
height: 20upx;
|
|
1399
|
-
padding: 5upx;
|
|
1400
|
-
background: #000007;
|
|
1401
|
-
margin-right: 15upx;
|
|
1402
|
-
}
|
|
1403
|
-
|
|
1404
|
-
.with-fun {
|
|
1405
|
-
width: 100%;
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1408
|
-
.no-index {
|
|
1409
|
-
position: relative;
|
|
1410
|
-
z-index: 0;
|
|
1411
|
-
}
|
|
1412
|
-
|
|
1413
|
-
.option-font-size {
|
|
1414
|
-
font-size: $uni-form-content-font-size;
|
|
1415
|
-
color: #555555;
|
|
1416
|
-
width: 100%;
|
|
1417
|
-
min-width: 100rpx;
|
|
1418
|
-
height: 100%;
|
|
1252
|
+
@import "../../static/uni.css";
|
|
1253
|
+
|
|
1254
|
+
$form-item-bottom-padding: 20 rpx; // 每个组件底部间隔
|
|
1255
|
+
|
|
1256
|
+
icon {
|
|
1257
|
+
position: absolute;
|
|
1258
|
+
bottom: 10px;
|
|
1259
|
+
right: 10px;
|
|
1260
|
+
z-index: 999;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
.u_close {
|
|
1264
|
+
padding: 20 rpx 20 rpx;
|
|
1265
|
+
position: absolute;
|
|
1266
|
+
right: 0;
|
|
1267
|
+
top: 72%;
|
|
1268
|
+
transform: translateY(-50%);
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
.disabledClick {
|
|
1272
|
+
pointer-events: none;
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
.cover-text {
|
|
1276
|
+
position: relative;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
radio {
|
|
1280
|
+
padding-left: $uni-form-padding-left;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
radio-group label {
|
|
1284
|
+
margin-left: -30rpx;
|
|
1285
|
+
}
|
|
1286
|
+
|
|
1287
|
+
checkbox-group label {
|
|
1288
|
+
padding-left: 60 rpx;
|
|
1289
|
+
margin-left: -30rpx;
|
|
1290
|
+
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
.form-item {
|
|
1294
|
+
background-color: #fff;
|
|
1295
|
+
position: relative;
|
|
1296
|
+
margin-bottom: $form-item-bottom-padding;
|
|
1297
|
+
|
|
1298
|
+
.editCorrent {
|
|
1299
|
+
position: absolute;
|
|
1300
|
+
right: 20 upx;
|
|
1301
|
+
top: 10 upx;
|
|
1302
|
+
width: 50 upx;
|
|
1303
|
+
height: 50 upx;
|
|
1304
|
+
|
|
1305
|
+
img {
|
|
1306
|
+
width: 30 upx;
|
|
1307
|
+
height: 30 upx;
|
|
1308
|
+
}
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
.correctedWrap {
|
|
1312
|
+
position: absolute;
|
|
1313
|
+
top: 0;
|
|
1314
|
+
right: 0;
|
|
1315
|
+
padding: 0 10 upx;
|
|
1316
|
+
background-color: #539DFA;
|
|
1317
|
+
color: #FFFFFF;
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
.isCorrected {
|
|
1322
|
+
border-top: 2 upx solid #ff0000;
|
|
1323
|
+
border-bottom: 2 upx solid #ff0000;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
.showFalse {
|
|
1327
|
+
// border-left: 1px dashed rgba(255,0,0,0.4);
|
|
1328
|
+
// border-right: 1px dashed rgba(255,0,0,0.4);
|
|
1329
|
+
// background-color: rgba(255, 0, 0, 0.1);
|
|
1330
|
+
// border-bottom: 1upx dashed rgba(255, 0, 0, 0.4);
|
|
1331
|
+
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
.evan-form-item-container {
|
|
1335
|
+
// border-bottom: 1upx solid #eee;
|
|
1336
|
+
position: relative;
|
|
1337
|
+
padding: 0;
|
|
1338
|
+
|
|
1339
|
+
&__label {
|
|
1340
|
+
font-size: $uni-form-title-font-size;
|
|
1341
|
+
color: #666;
|
|
1342
|
+
height: 70 upx;
|
|
1343
|
+
line-height: 70 upx;
|
|
1344
|
+
// padding: 12upx 0 0 0;
|
|
1345
|
+
display: inline-block;
|
|
1346
|
+
padding-left: $uni-form-padding-left;
|
|
1347
|
+
|
|
1348
|
+
&.showAsteriskRect::after {
|
|
1349
|
+
content: '';
|
|
1350
|
+
color: #FF3333;
|
|
1351
|
+
width: 30 upx;
|
|
1352
|
+
display: inline-block;
|
|
1353
|
+
padding-left: 10 upx;
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
&.isRequired::before {
|
|
1357
|
+
padding-right: 10 upx;
|
|
1358
|
+
content: '*';
|
|
1359
|
+
color: red;
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
&__main {
|
|
1364
|
+
flex: 1;
|
|
1365
|
+
min-height: 84 upx;
|
|
1366
|
+
display: flex;
|
|
1367
|
+
align-items: center;
|
|
1368
|
+
overflow: hidden;
|
|
1369
|
+
justify-content: flex-start;
|
|
1370
|
+
padding-left: $uni-form-padding-left;
|
|
1371
|
+
|
|
1372
|
+
.form-input {
|
|
1373
|
+
font-size: $uni-form-content-font-size;
|
|
1374
|
+
width: 100%;
|
|
1375
|
+
color: #555555 // padding-left: 28upx;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
&--body {
|
|
1379
|
+
position: relative;
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
&__main textarea {
|
|
1384
|
+
padding-top: 12 upx;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
&--left {
|
|
1419
1388
|
display: flex;
|
|
1389
|
+
flex-direction: row;
|
|
1420
1390
|
align-items: center;
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1391
|
+
justify-content: flex-end;
|
|
1392
|
+
}
|
|
1393
|
+
|
|
1394
|
+
&--top {
|
|
1395
|
+
.evan-form-item-container__label {
|
|
1396
|
+
// padding-bottom: 10upx;
|
|
1397
|
+
color: #000000;
|
|
1398
|
+
}
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
/deep/ .form-input-placeholder {
|
|
1403
|
+
// line-height: 90upx;
|
|
1404
|
+
color: #555;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
.form-textarea-placeholder {
|
|
1408
|
+
padding-top: 28 upx;
|
|
1409
|
+
font-size: 34 upx;
|
|
1410
|
+
width: 100%;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
.evan-form-item-container--top .radio-height {
|
|
1414
|
+
font-size: $uni-form-title-font-size;
|
|
1415
|
+
// font-weight: bold;
|
|
1416
|
+
// line-height: 40upx;
|
|
1417
|
+
padding: 25 upx 0 25 upx 30 rpx;
|
|
1418
|
+
display: inline-block;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
/deep/ .wx-picker-container .wx-picker-action.wx-picker-action-confirm {
|
|
1422
|
+
color: #007AFF !important;
|
|
1423
|
+
}
|
|
1424
|
+
|
|
1425
|
+
.opencolor {
|
|
1426
|
+
width: 50 upx;
|
|
1427
|
+
height: 20 upx;
|
|
1428
|
+
padding: 5 upx;
|
|
1429
|
+
background: #000007;
|
|
1430
|
+
margin-right: 15 upx;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
.with-fun {
|
|
1434
|
+
width: 100%;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
.no-index {
|
|
1438
|
+
position: relative;
|
|
1439
|
+
z-index: 0;
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1442
|
+
.option-font-size {
|
|
1443
|
+
font-size: $uni-form-content-font-size;
|
|
1444
|
+
color: #555555;
|
|
1445
|
+
width: 100%;
|
|
1446
|
+
min-width: 100 rpx;
|
|
1447
|
+
height: 100%;
|
|
1448
|
+
display: flex;
|
|
1449
|
+
align-items: center;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
/**checkbox radio*/
|
|
1453
|
+
.uni-list::before {
|
|
1454
|
+
height: 0px;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
.uni-list::after {
|
|
1458
|
+
height: 0px;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
.uni-list .uni-list-cell:last-child::after {
|
|
1462
|
+
height: 0 rpx;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
.uni-list-cell-last.uni-list-cell::after {
|
|
1466
|
+
height: 0 rpx;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
/**checkbox radio*/
|
|
1470
|
+
|
|
1471
|
+
/***error-message 错误信息展示 **/
|
|
1472
|
+
.error-message {
|
|
1473
|
+
color: red;
|
|
1474
|
+
padding-left: $uni-form-padding-left;
|
|
1475
|
+
font-size: 24 upx;
|
|
1476
|
+
background-color: #efefef;
|
|
1477
|
+
padding-top: $form-item-bottom-padding;
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
.signatrue-view {
|
|
1481
|
+
position: fixed;
|
|
1482
|
+
top: 0;
|
|
1483
|
+
left: 0;
|
|
1484
|
+
bottom: 0;
|
|
1485
|
+
right: 0;
|
|
1486
|
+
background: rgba(0, 0, 0, .6);
|
|
1487
|
+
z-index: 999;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
.signatrue-box {
|
|
1491
|
+
position: fixed;
|
|
1492
|
+
top: 50%;
|
|
1493
|
+
left: 0;
|
|
1494
|
+
// height: 50vh;
|
|
1495
|
+
height: 400 rpx;
|
|
1496
|
+
transform: translateY(-50%);
|
|
1497
|
+
background: #fff;
|
|
1498
|
+
z-index: 999;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
.option-time-icon {
|
|
1502
|
+
width: 150 rpx;
|
|
1503
|
+
}
|
|
1475
1504
|
</style>
|