askbot-dragon 0.7.94 → 0.7.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -13,7 +13,10 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</div> -->
|
|
15
15
|
|
|
16
|
-
<form-template
|
|
16
|
+
<form-template
|
|
17
|
+
:formList="formList2"
|
|
18
|
+
@submitClick="submitClick"
|
|
19
|
+
></form-template>
|
|
17
20
|
<!-- <voice-component @closeVoice="closeVoice">
|
|
18
21
|
<div slot="voiceTip">
|
|
19
22
|
松开发送
|
|
@@ -486,7 +489,7 @@ export default {
|
|
|
486
489
|
}
|
|
487
490
|
},
|
|
488
491
|
formList2: {
|
|
489
|
-
formActionId: '',
|
|
492
|
+
formActionId: '11',
|
|
490
493
|
form: {
|
|
491
494
|
id: 3,
|
|
492
495
|
name: '表单1',
|
|
@@ -1773,7 +1776,10 @@ export default {
|
|
|
1773
1776
|
"workOrderFieldId":"4b2bea06e70b4a63a02df141f685f310"
|
|
1774
1777
|
},
|
|
1775
1778
|
"value":[
|
|
1776
|
-
|
|
1779
|
+
["嗨嗨嗨", "哈哈哈", "嘿嘿嘿", "嘻嘻嘻"],
|
|
1780
|
+
["嗨嗨嗨"],
|
|
1781
|
+
["嗨嗨嗨", "哈哈哈"],
|
|
1782
|
+
["嗨嗨嗨", "哈哈哈", "嘿嘿嘿"],
|
|
1777
1783
|
],
|
|
1778
1784
|
"display":true,
|
|
1779
1785
|
"required":false,
|
|
@@ -2320,7 +2326,7 @@ export default {
|
|
|
2320
2326
|
},
|
|
2321
2327
|
closeVoice() {
|
|
2322
2328
|
console.debug('我是close事件')
|
|
2323
|
-
}
|
|
2329
|
+
},
|
|
2324
2330
|
},
|
|
2325
2331
|
mounted() {
|
|
2326
2332
|
this.timer = setInterval(() => {
|
|
@@ -112,43 +112,15 @@
|
|
|
112
112
|
</el-checkbox-group>
|
|
113
113
|
</div>
|
|
114
114
|
<div v-else-if="item.formField.type==='SELECT' || item.formField.type==='OPTION'" >
|
|
115
|
-
<!-- <el-select
|
|
116
|
-
v-model=item.value
|
|
117
|
-
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
118
|
-
style="width: 100%"
|
|
119
|
-
filterable
|
|
120
|
-
v-if="item.formField.extInfo && item.formField.extInfo.option"
|
|
121
|
-
>
|
|
122
|
-
<el-option
|
|
123
|
-
v-for="(items,index) in item.formField.extInfo.option"
|
|
124
|
-
:key="index"
|
|
125
|
-
:label="items.label"
|
|
126
|
-
:value="items.value">
|
|
127
|
-
</el-option>
|
|
128
|
-
</el-select>
|
|
129
|
-
<el-select
|
|
130
|
-
v-model=item.value
|
|
131
|
-
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
132
|
-
style="width: 100%"
|
|
133
|
-
filterable
|
|
134
|
-
v-else-if="item.formField.extInfo && item.formField.extInfo.options"
|
|
135
|
-
>
|
|
136
|
-
<el-option
|
|
137
|
-
v-for="(items,index) in item.formField.extInfo.options"
|
|
138
|
-
:key="index"
|
|
139
|
-
:label="items.label"
|
|
140
|
-
:value="items.value">
|
|
141
|
-
</el-option>
|
|
142
|
-
</el-select>-->
|
|
143
115
|
<el-select
|
|
144
116
|
v-model=item.value
|
|
145
117
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
146
118
|
style="width: 100%"
|
|
147
119
|
filterable
|
|
148
|
-
v-if="item.
|
|
120
|
+
v-if="item.fieldId==='workorder_clientId' || item.fieldId === 'workorder_statusId' || item.fieldId === 'workorder_priority'"
|
|
149
121
|
>
|
|
150
122
|
<el-option
|
|
151
|
-
v-for="(items,index) in item.formField.extInfo.option"
|
|
123
|
+
v-for="(items,index) in item.formField.extInfo.option?item.formField.extInfo.option:item.formField.extInfo.options"
|
|
152
124
|
:key="index"
|
|
153
125
|
:label="items.label"
|
|
154
126
|
:value="items.value">
|
|
@@ -168,8 +140,8 @@
|
|
|
168
140
|
</div>
|
|
169
141
|
<template v-else-if="item.formField.type==='CASCADER'">
|
|
170
142
|
<div class="cascader-input" @click="openDrawer(item,'pc_cascader')">
|
|
171
|
-
<template v-if="
|
|
172
|
-
<span v-for="(cas,casIndex) in
|
|
143
|
+
<template v-if="extInfoFieldValue[item.fieldId] && (Array.isArray(extInfoFieldValue[item.fieldId]) && extInfoFieldValue[item.fieldId].length > 0)">
|
|
144
|
+
<span v-for="(cas,casIndex) in extInfoFieldValue[item.fieldId]" :key="casIndex">
|
|
173
145
|
{{casIndex==0?cas.label:'/'+cas.label}}
|
|
174
146
|
</span>
|
|
175
147
|
</template>
|
|
@@ -207,7 +179,7 @@
|
|
|
207
179
|
name="file"
|
|
208
180
|
action="/open/media/file/upload"
|
|
209
181
|
:multiple="item.formField.extInfo&&item.formField.extInfo.limitNum&&item.formField.extInfo.limitNum>1?true:false"
|
|
210
|
-
:file-list="
|
|
182
|
+
:file-list="extInfoFieldValue[item.fieldId]"
|
|
211
183
|
:limit="item.formField.extInfo.limitNum?Number(item.formField.extInfo.limitNum):(item.formField.extInfo.limit ? Number(item.formField.extInfo.limit) : 1)"
|
|
212
184
|
:before-upload="(file=>{return beforeAvatarUpload(file,item.formField.type)})"
|
|
213
185
|
:on-exceed="exceedUpload"
|
|
@@ -325,7 +297,7 @@
|
|
|
325
297
|
clickable
|
|
326
298
|
name="datetimePicker"
|
|
327
299
|
:required="item.required || isRequiredFn(item.formField)"
|
|
328
|
-
:value=
|
|
300
|
+
:value=extInfoFieldValue[item.fieldId]
|
|
329
301
|
:label=item.formField.name
|
|
330
302
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
331
303
|
@click="timeClick(item.fieldId,item,'DATE_TIME')"
|
|
@@ -351,7 +323,7 @@
|
|
|
351
323
|
clickable
|
|
352
324
|
name="datetimePicker"
|
|
353
325
|
:required="item.required || isRequiredFn(item.formField)"
|
|
354
|
-
:value=
|
|
326
|
+
:value=extInfoFieldValue[item.fieldId]
|
|
355
327
|
:label=item.formField.name
|
|
356
328
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
357
329
|
@click="timeClick(item.fieldId,item,'TIME')"
|
|
@@ -377,7 +349,7 @@
|
|
|
377
349
|
clickable
|
|
378
350
|
name="datetimePicker"
|
|
379
351
|
:required="item.required || isRequiredFn(item.formField)"
|
|
380
|
-
:value=
|
|
352
|
+
:value=extInfoFieldValue[item.fieldId]
|
|
381
353
|
:label=item.formField.name
|
|
382
354
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
383
355
|
@click="timeClick(item.fieldId,item,'DATE')"
|
|
@@ -469,7 +441,7 @@
|
|
|
469
441
|
:required="item.required || isRequiredFn(item.formField)"
|
|
470
442
|
:disabled="disableds"
|
|
471
443
|
@click-right-icon.stop="SelectClear(item.fieldId)"
|
|
472
|
-
:right-icon="
|
|
444
|
+
:right-icon="item.value || (Array.isArray(item.value) && item.value.length > 0)? 'close' : 'van-icon van-icon-arrow van-cell__right-icon'"
|
|
473
445
|
/>
|
|
474
446
|
<van-popup v-model="selectPicker" position="bottom" :style="{ height: '300px' }">
|
|
475
447
|
<select-popup
|
|
@@ -491,7 +463,7 @@
|
|
|
491
463
|
<van-field
|
|
492
464
|
readonly
|
|
493
465
|
clickable
|
|
494
|
-
:value="Array.isArray(
|
|
466
|
+
:value="Array.isArray(extInfoFieldValue[item.fieldId])?extInfoFieldValue[item.fieldId].join(','):extInfoFieldValue[item.fieldId]"
|
|
495
467
|
:label="item.formField.name"
|
|
496
468
|
name="picker"
|
|
497
469
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
@@ -499,7 +471,7 @@
|
|
|
499
471
|
@click-right-icon.stop="SelectClear(item.fieldId)"
|
|
500
472
|
:required="item.required || isRequiredFn(item.formField)"
|
|
501
473
|
:disabled="disableds"
|
|
502
|
-
:right-icon="
|
|
474
|
+
:right-icon="extInfoFieldValue[item.fieldId]? 'close' : 'van-icon van-icon-arrow van-cell__right-icon'"
|
|
503
475
|
/>
|
|
504
476
|
<van-popup v-model="refShowPicker" position="bottom" :style="{ height: '300px' }">
|
|
505
477
|
<select-popup
|
|
@@ -522,7 +494,7 @@
|
|
|
522
494
|
readonly
|
|
523
495
|
clickable
|
|
524
496
|
name="area"
|
|
525
|
-
:value="
|
|
497
|
+
:value="extInfoFieldValue[item.fieldId] && Array.isArray(extInfoFieldValue[item.fieldId])?extInfoFieldValue[item.fieldId].map(e=>e.label).join(','):''"
|
|
526
498
|
:label=item.formField.name
|
|
527
499
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
528
500
|
@click="openDrawer(item,'cascader')"
|
|
@@ -543,7 +515,7 @@
|
|
|
543
515
|
<div @click="checkUpload(item.fieldId,item.formField.extInfo)" class="form-field-item-file">
|
|
544
516
|
<div class="fileName"><span style="color: red" v-if="item.required || isRequiredFn(item.formField)">*</span>{{item.formField.name}}</div>
|
|
545
517
|
<van-uploader
|
|
546
|
-
v-model="
|
|
518
|
+
v-model="extInfoFieldValue[item.fieldId]"
|
|
547
519
|
:before-read="(file=>{return beforeRead(file,item.formField.type)})"
|
|
548
520
|
:max-count='item.formField.extInfo&&item.formField.extInfo.limitNum ? item.formField.extInfo.limitNum : (item.formField.extInfo.limit ? item.formField.extInfo.limit : 1)'
|
|
549
521
|
:after-read="afterRead"
|
|
@@ -583,7 +555,7 @@
|
|
|
583
555
|
<el-drawer
|
|
584
556
|
:withHeader="false"
|
|
585
557
|
:visible.sync="drawer"
|
|
586
|
-
size="
|
|
558
|
+
size="400px"
|
|
587
559
|
direction="btt">
|
|
588
560
|
<div class="drawer-container">
|
|
589
561
|
<tree ref="drawerTree"
|
|
@@ -603,6 +575,7 @@
|
|
|
603
575
|
:options="options"
|
|
604
576
|
:defaultValue="defaultValue"
|
|
605
577
|
@onConfim="confirmSelect"
|
|
578
|
+
@onclose= "selectPopUp = false"
|
|
606
579
|
:multiple="detailField.formField.extInfo && detailField.formField.extInfo.selectType ==='多选'?true:false"
|
|
607
580
|
ref="selectPopup"
|
|
608
581
|
:props="{
|
|
@@ -728,7 +701,7 @@ export default {
|
|
|
728
701
|
detailField:{
|
|
729
702
|
formField:{}
|
|
730
703
|
},
|
|
731
|
-
|
|
704
|
+
extInfoFieldValue:[],
|
|
732
705
|
selectPopUp:false,
|
|
733
706
|
options:[],
|
|
734
707
|
defaultValue:[],
|
|
@@ -800,6 +773,15 @@ export default {
|
|
|
800
773
|
item.value = item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:''
|
|
801
774
|
}
|
|
802
775
|
}
|
|
776
|
+
if (!item.relationDisplay){
|
|
777
|
+
item.value = []
|
|
778
|
+
this.extInfoFieldValue[item.fieldId] = []
|
|
779
|
+
this.selectValues[item.fieldId] = []
|
|
780
|
+
this.extInfoFieldValue[item.fieldId] = []
|
|
781
|
+
if (item.formField.extInfo.extInfoFieldValue){
|
|
782
|
+
item.formField.extInfo.extInfoFieldValue = ''
|
|
783
|
+
}
|
|
784
|
+
}
|
|
803
785
|
})
|
|
804
786
|
let newArr = arr.filter(item=>item.relationDisplay)
|
|
805
787
|
console.debug('arr',arr,newArr)
|
|
@@ -937,8 +919,8 @@ export default {
|
|
|
937
919
|
}
|
|
938
920
|
else{
|
|
939
921
|
let length = 0
|
|
940
|
-
if (this.
|
|
941
|
-
length = this.
|
|
922
|
+
if (this.extInfoFieldValue[this.filedId]){
|
|
923
|
+
length = this.extInfoFieldValue[this.filedId].length
|
|
942
924
|
}
|
|
943
925
|
if (file.length<=this.limitNum-length){
|
|
944
926
|
for (let i=0;i<file.length;i++){
|
|
@@ -1042,12 +1024,12 @@ export default {
|
|
|
1042
1024
|
imageInfo.url = ossFileUrl(this.ossConfig, res.name)
|
|
1043
1025
|
imageInfo.status='success'
|
|
1044
1026
|
imageInfo.name=res.name
|
|
1045
|
-
for (let j=0;j<this.
|
|
1046
|
-
if (this.
|
|
1047
|
-
this.
|
|
1048
|
-
this.
|
|
1049
|
-
this.
|
|
1050
|
-
delete this.
|
|
1027
|
+
for (let j=0;j<this.extInfoFieldValue[this.filedId].length;j++){
|
|
1028
|
+
if (this.extInfoFieldValue[this.filedId][j].content&&this.extInfoFieldValue[this.filedId][j].content===content){
|
|
1029
|
+
this.extInfoFieldValue[this.filedId][j].name=res.name
|
|
1030
|
+
this.extInfoFieldValue[this.filedId][j].status='success'
|
|
1031
|
+
this.extInfoFieldValue[this.filedId][j].url=imageInfo.url
|
|
1032
|
+
delete this.extInfoFieldValue[this.filedId][j].content
|
|
1051
1033
|
}
|
|
1052
1034
|
}
|
|
1053
1035
|
this.fileUpload=false
|
|
@@ -1153,10 +1135,7 @@ export default {
|
|
|
1153
1135
|
|
|
1154
1136
|
}
|
|
1155
1137
|
if (type ==='FILE' || type == 'ATTACHMENT' || type == 'IMAGE' || type == 'VIDEO'){
|
|
1156
|
-
if (this.formList.form.formFieldRelation[i].
|
|
1157
|
-
this.fileListList[this.formList.form.formFieldRelation[i].fieldId] = this.formList.form.formFieldRelation[i].formField.extInfo.extInfoFieldValue
|
|
1158
|
-
}
|
|
1159
|
-
else if (this.formList.form.formFieldRelation[i].value){
|
|
1138
|
+
if (this.formList.form.formFieldRelation[i].value){
|
|
1160
1139
|
if (this.formList.form.formFieldRelation[i].value===null||this.formList.form.formFieldRelation[i].value===''){
|
|
1161
1140
|
this.formList.form.formFieldRelation[i].value=[]
|
|
1162
1141
|
}
|
|
@@ -1172,14 +1151,14 @@ export default {
|
|
|
1172
1151
|
valueList[file].url = this.formList.form.formFieldRelation[i].value[file]
|
|
1173
1152
|
}
|
|
1174
1153
|
if (type === 'object'&&JSON.stringify(this.formList.form.formFieldRelation[i].value[file])!=='{}') {
|
|
1175
|
-
this.
|
|
1154
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]=this.formList.form.formFieldRelation[i].value
|
|
1176
1155
|
}
|
|
1177
1156
|
else {
|
|
1178
|
-
this.
|
|
1157
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]=[]
|
|
1179
1158
|
}
|
|
1180
1159
|
}
|
|
1181
1160
|
if (bool){
|
|
1182
|
-
this.
|
|
1161
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]=valueList
|
|
1183
1162
|
}
|
|
1184
1163
|
}
|
|
1185
1164
|
}
|
|
@@ -1190,7 +1169,7 @@ export default {
|
|
|
1190
1169
|
let name = this.formList.form.formFieldRelation[i].formField.extInfo.extInfoFieldValue.map(item=>{
|
|
1191
1170
|
return item.name
|
|
1192
1171
|
})
|
|
1193
|
-
this.
|
|
1172
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = name
|
|
1194
1173
|
}
|
|
1195
1174
|
}
|
|
1196
1175
|
}
|
|
@@ -1202,8 +1181,9 @@ export default {
|
|
|
1202
1181
|
this.formList.form.formFieldRelation[i].formField.extInfo.extInfoFieldValue:
|
|
1203
1182
|
(this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue?
|
|
1204
1183
|
this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue:[])
|
|
1205
|
-
|
|
1206
|
-
|
|
1184
|
+
if (!this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]){
|
|
1185
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = fieldValue
|
|
1186
|
+
}
|
|
1207
1187
|
if (this.formList.form.formFieldRelation[i].value){
|
|
1208
1188
|
this.formList.form.formFieldRelation[i].value = this.formList.form.formFieldRelation[i].formField.defaultValue?
|
|
1209
1189
|
this.formList.form.formFieldRelation[i].formField.defaultValue:[];
|
|
@@ -1222,17 +1202,17 @@ export default {
|
|
|
1222
1202
|
if (!this.formList.form.formFieldRelation[i].formField.extInfo.mold ||
|
|
1223
1203
|
this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'TIME' ||
|
|
1224
1204
|
this.getMoldTime(this.formList.form.formFieldRelation[i].formField.formField) == 'TIME'){
|
|
1225
|
-
this.
|
|
1205
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]=dateTime.Format('hh:mm')
|
|
1226
1206
|
}
|
|
1227
1207
|
else if (this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATA_TIME' ||
|
|
1228
1208
|
this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATE_TIME' ||
|
|
1229
1209
|
this.getMoldTime(this.formList.form.formFieldRelation[i].formField.formField) == 'DATE_TIME'){
|
|
1230
|
-
this.
|
|
1210
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = dateTime.Format('yyyy-MM-dd hh:mm')
|
|
1231
1211
|
}
|
|
1232
1212
|
else if (this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATA' ||
|
|
1233
1213
|
this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATE' ||
|
|
1234
1214
|
this.getMoldTime(this.formList.form.formFieldRelation[i].formField.formField) == 'DATE'){
|
|
1235
|
-
this.
|
|
1215
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = dateTime.Format('yyyy-MM-dd')
|
|
1236
1216
|
}
|
|
1237
1217
|
}
|
|
1238
1218
|
}
|
|
@@ -1284,6 +1264,9 @@ export default {
|
|
|
1284
1264
|
}
|
|
1285
1265
|
}
|
|
1286
1266
|
}
|
|
1267
|
+
if (this.formList.extInfo && this.formList.extInfo.extInfoFieldValue){
|
|
1268
|
+
this.extInfoFieldValue = this.formList.extInfo.extInfoFieldValue
|
|
1269
|
+
}
|
|
1287
1270
|
this.formShow = this.formList
|
|
1288
1271
|
},
|
|
1289
1272
|
addZero(i) {
|
|
@@ -1329,18 +1312,18 @@ export default {
|
|
|
1329
1312
|
if (type == 'DATE'){
|
|
1330
1313
|
this.datePicker = false
|
|
1331
1314
|
this.timeDetailData.value = value;
|
|
1332
|
-
this.
|
|
1315
|
+
this.extInfoFieldValue[id] =this.formatDate(value);
|
|
1333
1316
|
}
|
|
1334
1317
|
else if (type == 'TIME'){
|
|
1335
1318
|
this.timePicker = false;
|
|
1336
|
-
this.
|
|
1319
|
+
this.extInfoFieldValue[id] = value;
|
|
1337
1320
|
console.debug('timeDetailData',this.timeDetailData)
|
|
1338
1321
|
this.timeDetailData.value = forMatTime(value)
|
|
1339
1322
|
}
|
|
1340
1323
|
else if (type == 'DATE_TIME'){
|
|
1341
1324
|
this.dateTimePicker = false;
|
|
1342
1325
|
this.timeDetailData.value = value
|
|
1343
|
-
this.
|
|
1326
|
+
this.extInfoFieldValue[id] =this.formatDate(value) +" "+ this.addZero(value.getHours()) + ':' + this.addZero(value.getMinutes())
|
|
1344
1327
|
}
|
|
1345
1328
|
/*for (let i = 0; i < this.formShow.form.formFieldRelation.length; i++) {
|
|
1346
1329
|
if (this.formShow.form.formFieldRelation[i].fieldId=== id) {
|
|
@@ -1380,6 +1363,9 @@ export default {
|
|
|
1380
1363
|
//下拉的选择器
|
|
1381
1364
|
onConfirmSelect(value, item) {
|
|
1382
1365
|
console.log('value',value,this.selectDetail)
|
|
1366
|
+
if (!value){
|
|
1367
|
+
return
|
|
1368
|
+
}
|
|
1383
1369
|
this.selectValues[this.selectDetail.fieldId] = value;
|
|
1384
1370
|
for (let i = 0; i < this.formShow.form.formFieldRelation.length; i++) {
|
|
1385
1371
|
if (this.formShow.form.formFieldRelation[i].fieldId === this.selectDetail.fieldId) {
|
|
@@ -1443,9 +1429,13 @@ export default {
|
|
|
1443
1429
|
}
|
|
1444
1430
|
})
|
|
1445
1431
|
}
|
|
1446
|
-
if (this.
|
|
1432
|
+
if (this.extInfoFieldValue[this.formShow.form.formFieldRelation[i].fieldId] &&
|
|
1433
|
+
(this.formShow.form.formFieldRelation[i].formField.type == 'FILE' ||
|
|
1434
|
+
this.formShow.form.formFieldRelation[i].formField.type == 'IMAGE' ||
|
|
1435
|
+
this.formShow.form.formFieldRelation[i].formField.type == 'VIDEO' ||
|
|
1436
|
+
this.formShow.form.formFieldRelation[i].formField.type == 'ATTACHMENT')) {
|
|
1447
1437
|
let value=[]
|
|
1448
|
-
this.
|
|
1438
|
+
this.extInfoFieldValue[this.formShow.form.formFieldRelation[i].fieldId].forEach(item=>{
|
|
1449
1439
|
let file = {}
|
|
1450
1440
|
file.name = item.name
|
|
1451
1441
|
file.url = item.url
|
|
@@ -1454,7 +1444,6 @@ export default {
|
|
|
1454
1444
|
this.formShow.form.formFieldRelation[i].value = value.map(item=>{
|
|
1455
1445
|
return item.name
|
|
1456
1446
|
})
|
|
1457
|
-
this.formShow.form.formFieldRelation[i].formField.extInfo.extInfoFieldValue = value
|
|
1458
1447
|
}
|
|
1459
1448
|
if(this.formShow.form.formFieldRelation[i].display &&
|
|
1460
1449
|
(this.formShow.form.formFieldRelation[i].required || this.isRequiredFn(this.formShow.form.formFieldRelation[i].formField)) &&
|
|
@@ -1466,11 +1455,14 @@ export default {
|
|
|
1466
1455
|
strVal = value.replace(/\n/g,'');
|
|
1467
1456
|
}
|
|
1468
1457
|
let bool = this.formShow.form.formFieldRelation[i].value && this.formShow.form.formFieldRelation[i].value.includes('\n') && !strVal
|
|
1469
|
-
if(!this.formShow.form.formFieldRelation[i].value || bool|| (this.formShow.form.formFieldRelation[i].value&&this.formShow.form.formFieldRelation[i].value.length===0)) {
|
|
1458
|
+
if(!this.formShow.form.formFieldRelation[i].value || bool || (this.formShow.form.formFieldRelation[i].value&&this.formShow.form.formFieldRelation[i].value.length===0)) {
|
|
1470
1459
|
this.$message.error('请完善'+ this.formShow.form.formFieldRelation[i].formField.name)
|
|
1471
1460
|
return
|
|
1472
1461
|
}
|
|
1473
1462
|
}
|
|
1463
|
+
}
|
|
1464
|
+
this.formShow.extInfo = {
|
|
1465
|
+
extInfoFieldValue : this.extInfoFieldValue
|
|
1474
1466
|
}
|
|
1475
1467
|
this.$emit('submitClick',this.formShow)
|
|
1476
1468
|
this.disableds = true
|
|
@@ -1771,27 +1763,27 @@ export default {
|
|
|
1771
1763
|
imgInfo.name = data.file.name
|
|
1772
1764
|
imgInfo.uid = data.file.uid
|
|
1773
1765
|
}
|
|
1774
|
-
if (!this.
|
|
1766
|
+
if (!this.extInfoFieldValue[this.filedId])
|
|
1775
1767
|
{
|
|
1776
|
-
this.
|
|
1768
|
+
this.extInfoFieldValue[this.filedId] = []
|
|
1777
1769
|
}
|
|
1778
|
-
this.
|
|
1770
|
+
this.extInfoFieldValue[this.filedId].push(imgInfo)
|
|
1779
1771
|
this.loading.close()
|
|
1780
1772
|
}).catch((err) => {
|
|
1781
1773
|
console.debug("upload err", err);
|
|
1782
1774
|
});
|
|
1783
1775
|
},
|
|
1784
1776
|
successUpload(response,file,fileList){
|
|
1785
|
-
if (!this.
|
|
1786
|
-
this.
|
|
1777
|
+
if (!this.extInfoFieldValue[this.filedId]){
|
|
1778
|
+
this.extInfoFieldValue[this.filedId] = []
|
|
1787
1779
|
}
|
|
1788
1780
|
for (let i=0;i<fileList.length;i++){
|
|
1789
|
-
if (!this.
|
|
1790
|
-
this.
|
|
1781
|
+
if (!this.extInfoFieldValue[this.filedId][i]){
|
|
1782
|
+
this.extInfoFieldValue[this.filedId][i]={}
|
|
1791
1783
|
}
|
|
1792
|
-
this.
|
|
1793
|
-
this.
|
|
1794
|
-
this.
|
|
1784
|
+
this.extInfoFieldValue[this.filedId][i].url=fileList[i].url
|
|
1785
|
+
this.extInfoFieldValue[this.filedId][i].name=fileList[i].name
|
|
1786
|
+
this.extInfoFieldValue[this.filedId][i].status=fileList[i].status
|
|
1795
1787
|
}
|
|
1796
1788
|
},
|
|
1797
1789
|
uploadProgress(){
|
|
@@ -1803,17 +1795,17 @@ export default {
|
|
|
1803
1795
|
});
|
|
1804
1796
|
},
|
|
1805
1797
|
handleRemove(file) {
|
|
1806
|
-
if (this.
|
|
1807
|
-
for (let i=0;i<this.
|
|
1798
|
+
if (this.extInfoFieldValue[this.filedId]){
|
|
1799
|
+
for (let i=0;i<this.extInfoFieldValue[this.filedId].length;i++)
|
|
1808
1800
|
{
|
|
1809
|
-
if (this.
|
|
1810
|
-
if (this.
|
|
1811
|
-
this.
|
|
1801
|
+
if (this.extInfoFieldValue[this.filedId][i].uid){
|
|
1802
|
+
if (this.extInfoFieldValue[this.filedId][i].uid===file.uid){
|
|
1803
|
+
this.extInfoFieldValue[this.filedId].splice(i,1)
|
|
1812
1804
|
return
|
|
1813
1805
|
}
|
|
1814
1806
|
}
|
|
1815
|
-
else if (this.
|
|
1816
|
-
this.
|
|
1807
|
+
else if (this.extInfoFieldValue[this.filedId][i].url===file.url){
|
|
1808
|
+
this.extInfoFieldValue[this.filedId].splice(i,1)
|
|
1817
1809
|
return
|
|
1818
1810
|
}
|
|
1819
1811
|
}
|
|
@@ -1907,7 +1899,13 @@ export default {
|
|
|
1907
1899
|
sortInfos: [],
|
|
1908
1900
|
templateId: ''
|
|
1909
1901
|
})
|
|
1910
|
-
|
|
1902
|
+
let param = {
|
|
1903
|
+
templateId:field.formField.extInfo.ref.source,
|
|
1904
|
+
fieldId:fields,
|
|
1905
|
+
field:field,
|
|
1906
|
+
dataQuery:this.dataQuery
|
|
1907
|
+
}
|
|
1908
|
+
this.$emit('getTemplateList',param)
|
|
1911
1909
|
}
|
|
1912
1910
|
}
|
|
1913
1911
|
},
|
|
@@ -1936,66 +1934,7 @@ export default {
|
|
|
1936
1934
|
}
|
|
1937
1935
|
})
|
|
1938
1936
|
}
|
|
1939
|
-
|
|
1940
|
-
this.$set(item.formField.extInfo,'extInfoFieldValue',[])
|
|
1941
|
-
}
|
|
1942
|
-
item.formField.extInfo.extInfoFieldValue = arr
|
|
1943
|
-
console.log(arr,item);
|
|
1944
|
-
},
|
|
1945
|
-
getTemplateList(templateId, fieldId, field) {
|
|
1946
|
-
let url = '/order-api/data-template/data/page'
|
|
1947
|
-
this.dataQuery[field.fieldId].templateId = templateId
|
|
1948
|
-
// let dataQuery = {
|
|
1949
|
-
// filterId: '',
|
|
1950
|
-
// keywords: '',
|
|
1951
|
-
// pageInfo: {
|
|
1952
|
-
// pageNo: 1,
|
|
1953
|
-
// pageSize: 20
|
|
1954
|
-
// },
|
|
1955
|
-
// sortInfos: [],
|
|
1956
|
-
// templateId: templateId
|
|
1957
|
-
// }
|
|
1958
|
-
this.$http.post(url, this.dataQuery[field.fieldId]).then(res => {
|
|
1959
|
-
if (res.data.code === '0') {
|
|
1960
|
-
let list = res.data.data.data
|
|
1961
|
-
this.dataQuery[field.fieldId].hasNextPage = res.data.data.hasNextPage
|
|
1962
|
-
// this.isHasNext[field.id] = res.data.data.hasNextPage
|
|
1963
|
-
let templateList = []
|
|
1964
|
-
templateList = list.map(res => {
|
|
1965
|
-
let info = {}
|
|
1966
|
-
for (let key in res.fieldValues) {
|
|
1967
|
-
if (Array.isArray(fieldId)) {
|
|
1968
|
-
let vals = ''
|
|
1969
|
-
let values = ''
|
|
1970
|
-
fieldId.forEach(val => {
|
|
1971
|
-
vals += val
|
|
1972
|
-
if (res.fieldValues[val]) {
|
|
1973
|
-
values += res.fieldValues[val]
|
|
1974
|
-
}
|
|
1975
|
-
})
|
|
1976
|
-
info[vals] = values
|
|
1977
|
-
info.id = res.id
|
|
1978
|
-
info.name = values
|
|
1979
|
-
} else {
|
|
1980
|
-
if (fieldId === key) {
|
|
1981
|
-
info[key] = res.fieldValues[key]
|
|
1982
|
-
info.id = res.id
|
|
1983
|
-
info.name = res.fieldValues[key]
|
|
1984
|
-
}
|
|
1985
|
-
}
|
|
1986
|
-
}
|
|
1987
|
-
return info
|
|
1988
|
-
})
|
|
1989
|
-
this.$nextTick(() =>{
|
|
1990
|
-
this.$set(this.refTemplateList,field.fieldId,[
|
|
1991
|
-
...this.refTemplateList[field.fieldId],
|
|
1992
|
-
...templateList
|
|
1993
|
-
])
|
|
1994
|
-
console.log('refTemplateList',this.refTemplateList[field.fieldId])
|
|
1995
|
-
})
|
|
1996
|
-
|
|
1997
|
-
}
|
|
1998
|
-
})
|
|
1937
|
+
this.extInfoFieldValue[item.fieldId] = arr
|
|
1999
1938
|
},
|
|
2000
1939
|
lodeMore(item) {
|
|
2001
1940
|
this.dataQuery[item.fieldId].pageInfo.pageNo += 1
|
|
@@ -2004,7 +1943,6 @@ export default {
|
|
|
2004
1943
|
//打开级联/下拉抽屉选择
|
|
2005
1944
|
openDrawer(field,type){
|
|
2006
1945
|
this.detailField = field;
|
|
2007
|
-
console.debug('type',type)
|
|
2008
1946
|
if (type == 'cascader' || type === 'pc_cascader'){
|
|
2009
1947
|
if (type == 'cascader'){
|
|
2010
1948
|
this.showArea = true;
|
|
@@ -2013,16 +1951,19 @@ export default {
|
|
|
2013
1951
|
this.drawer = true;
|
|
2014
1952
|
}
|
|
2015
1953
|
this.$nextTick(()=>{
|
|
2016
|
-
let arr = this.
|
|
2017
|
-
console.debug('drawerTree',this.$refs.drawerTree)
|
|
1954
|
+
let arr = this.extInfoFieldValue[field.fieldId]?this.extInfoFieldValue[field.fieldId]:[]
|
|
2018
1955
|
let drawerTree = this.$refs.drawerTree
|
|
2019
|
-
if (drawerTree){
|
|
2020
|
-
|
|
2021
|
-
item
|
|
2022
|
-
|
|
2023
|
-
|
|
1956
|
+
if (drawerTree) {
|
|
1957
|
+
if (Array.isArray(drawerTree)) {
|
|
1958
|
+
drawerTree.forEach(item => {
|
|
1959
|
+
item.$refs.dataTree.setCheckedNodes(arr);
|
|
1960
|
+
item.checked = this.extInfoFieldValue[field.fieldId] && this.extInfoFieldValue[field.fieldId][0] ? this.extInfoFieldValue[field.fieldId][0].value : '';
|
|
1961
|
+
})
|
|
1962
|
+
} else {
|
|
1963
|
+
drawerTree.$refs.dataTree.setCheckedNodes(arr);
|
|
1964
|
+
drawerTree.checked = this.extInfoFieldValue[field.fieldId] && this.extInfoFieldValue[field.fieldId][0] ? this.extInfoFieldValue[field.fieldId][0].value : '';
|
|
1965
|
+
}
|
|
2024
1966
|
}
|
|
2025
|
-
|
|
2026
1967
|
})
|
|
2027
1968
|
}
|
|
2028
1969
|
else if (type === 'select'){
|
|
@@ -2043,7 +1984,7 @@ export default {
|
|
|
2043
1984
|
//保存级联数据
|
|
2044
1985
|
saveData(checkList,checkDatas){
|
|
2045
1986
|
this.$set(this.detailField,'value',checkList);
|
|
2046
|
-
this.
|
|
1987
|
+
this.extInfoFieldValue[this.detailField.fieldId] = checkDatas;
|
|
2047
1988
|
this.$set(this.detailField.formField.extInfo,'extInfoFieldValue',checkDatas);
|
|
2048
1989
|
console.debug('checkDatas',this.detailField.formField.extInfo,checkList)
|
|
2049
1990
|
this.$forceUpdate();
|
|
@@ -2064,22 +2005,18 @@ export default {
|
|
|
2064
2005
|
this.refShowPicker = false;
|
|
2065
2006
|
return
|
|
2066
2007
|
}
|
|
2067
|
-
if (!this.detailField.formField.extInfo.extInfoFieldValue){
|
|
2068
|
-
this.$set(this.detailField.formField.extInfo,'extInfoFieldValue',[])
|
|
2069
|
-
}
|
|
2070
2008
|
this.detailField.value = list;
|
|
2071
2009
|
let val = ''
|
|
2072
2010
|
if (Array.isArray(option)){
|
|
2073
2011
|
val = option.map(item=>{
|
|
2074
|
-
return item.
|
|
2012
|
+
return item.id
|
|
2075
2013
|
})
|
|
2076
|
-
this.detailField.
|
|
2014
|
+
this.extInfoFieldValue[this.detailField.fieldId] = option
|
|
2077
2015
|
}
|
|
2078
2016
|
else {
|
|
2079
|
-
val = option.
|
|
2080
|
-
this.detailField.
|
|
2017
|
+
val = option.id
|
|
2018
|
+
this.extInfoFieldValue[this.detailField.fieldId] = [option]
|
|
2081
2019
|
}
|
|
2082
|
-
this.selectValues[this.detailField.fieldId] = val;
|
|
2083
2020
|
this.refShowPicker = false;
|
|
2084
2021
|
},
|
|
2085
2022
|
// 一个重复的方法 兼容 状态优先级 的关联控件,
|
package/src/components/popup.vue
CHANGED
|
@@ -182,6 +182,7 @@ export default {
|
|
|
182
182
|
align-items: center;
|
|
183
183
|
justify-content: center;
|
|
184
184
|
height: 48px;
|
|
185
|
+
cursor: pointer;
|
|
185
186
|
.setColor {
|
|
186
187
|
color: #366aff;
|
|
187
188
|
}
|
|
@@ -205,9 +206,11 @@ export default {
|
|
|
205
206
|
padding: 0 20px;
|
|
206
207
|
.cancel {
|
|
207
208
|
color: #606266;
|
|
209
|
+
cursor:pointer;
|
|
208
210
|
}
|
|
209
211
|
.sure {
|
|
210
212
|
color: #366aff;
|
|
213
|
+
cursor: pointer;
|
|
211
214
|
}
|
|
212
215
|
}
|
|
213
216
|
.popup-footer {
|