askbot-dragon 0.7.93 → 0.7.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/ConversationContainer.vue +788 -531
- package/src/components/formTemplate.vue +172 -166
- package/src/components/popup.vue +49 -5
- package/src/components/tree.vue +23 -13
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<el-input v-model="item.value"
|
|
22
22
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请输入'"
|
|
23
23
|
:maxlength="item.formField.extInfo&&item.formField.extInfo.maxNum?item.formField.extInfo.maxNum*1:1000"
|
|
24
|
-
v-
|
|
24
|
+
v-if="item.formField.type==='INPUT'&&item.fieldId!=='workorder_name'"
|
|
25
25
|
></el-input>
|
|
26
26
|
<template v-else-if="item.formField.type==='EXPLANATION'">
|
|
27
27
|
<div class="explanation">
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
</p>
|
|
41
41
|
</div>
|
|
42
42
|
</template>
|
|
43
|
-
<el-input type="textarea" :rows="2" v-model="
|
|
43
|
+
<el-input type="textarea" :rows="2" v-model="item.value"
|
|
44
44
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请输入'"
|
|
45
45
|
:maxlength="item.formField.extInfo&&item.formField.extInfo.maxNum?item.formField.extInfo.maxNum*1:1000"
|
|
46
46
|
v-if="item.formField.type==='TEXTAREA'&& item.fieldId!=='workorder_description'"
|
|
@@ -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"
|
|
@@ -229,18 +201,21 @@
|
|
|
229
201
|
filterable
|
|
230
202
|
:multiple="item.formField.extInfo && item.formField.extInfo.selectType == '多选'"
|
|
231
203
|
@visible-change="(visible) =>{ return refTemplateVisibleChange(visible,item) }"
|
|
204
|
+
collapse-tags
|
|
205
|
+
@change="changeRefData($event,item)"
|
|
232
206
|
>
|
|
233
207
|
<template v-for="(items,index) in refTemplateList[item.fieldId]">
|
|
234
208
|
<el-option
|
|
235
209
|
v-if="refTemplateList[item.fieldId]"
|
|
236
210
|
:key="index"
|
|
237
|
-
:label="items.
|
|
238
|
-
:value="items.
|
|
211
|
+
:label="items.name"
|
|
212
|
+
:value="items.id">
|
|
239
213
|
</el-option>
|
|
240
214
|
</template>
|
|
241
215
|
<div
|
|
242
216
|
@click="lodeMore(item)"
|
|
243
|
-
|
|
217
|
+
v-if="dataQuery[item.fieldId] && dataQuery[item.fieldId].hasNextPage"
|
|
218
|
+
style="width:100%;height:30px;display:flex;align-items: center;justify-content: center;color:#606266">
|
|
244
219
|
加载更多
|
|
245
220
|
</div>
|
|
246
221
|
</el-select>
|
|
@@ -322,7 +297,7 @@
|
|
|
322
297
|
clickable
|
|
323
298
|
name="datetimePicker"
|
|
324
299
|
:required="item.required || isRequiredFn(item.formField)"
|
|
325
|
-
:value=
|
|
300
|
+
:value=extInfoFieldValue[item.fieldId]
|
|
326
301
|
:label=item.formField.name
|
|
327
302
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
328
303
|
@click="timeClick(item.fieldId,item,'DATE_TIME')"
|
|
@@ -348,7 +323,7 @@
|
|
|
348
323
|
clickable
|
|
349
324
|
name="datetimePicker"
|
|
350
325
|
:required="item.required || isRequiredFn(item.formField)"
|
|
351
|
-
:value=
|
|
326
|
+
:value=extInfoFieldValue[item.fieldId]
|
|
352
327
|
:label=item.formField.name
|
|
353
328
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
354
329
|
@click="timeClick(item.fieldId,item,'TIME')"
|
|
@@ -374,7 +349,7 @@
|
|
|
374
349
|
clickable
|
|
375
350
|
name="datetimePicker"
|
|
376
351
|
:required="item.required || isRequiredFn(item.formField)"
|
|
377
|
-
:value=
|
|
352
|
+
:value=extInfoFieldValue[item.fieldId]
|
|
378
353
|
:label=item.formField.name
|
|
379
354
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
380
355
|
@click="timeClick(item.fieldId,item,'DATE')"
|
|
@@ -466,7 +441,7 @@
|
|
|
466
441
|
:required="item.required || isRequiredFn(item.formField)"
|
|
467
442
|
:disabled="disableds"
|
|
468
443
|
@click-right-icon.stop="SelectClear(item.fieldId)"
|
|
469
|
-
: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'"
|
|
470
445
|
/>
|
|
471
446
|
<van-popup v-model="selectPicker" position="bottom" :style="{ height: '300px' }">
|
|
472
447
|
<select-popup
|
|
@@ -488,7 +463,7 @@
|
|
|
488
463
|
<van-field
|
|
489
464
|
readonly
|
|
490
465
|
clickable
|
|
491
|
-
:value="Array.isArray(
|
|
466
|
+
:value="Array.isArray(extInfoFieldValue[item.fieldId])?extInfoFieldValue[item.fieldId].join(','):extInfoFieldValue[item.fieldId]"
|
|
492
467
|
:label="item.formField.name"
|
|
493
468
|
name="picker"
|
|
494
469
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
@@ -496,15 +471,15 @@
|
|
|
496
471
|
@click-right-icon.stop="SelectClear(item.fieldId)"
|
|
497
472
|
:required="item.required || isRequiredFn(item.formField)"
|
|
498
473
|
:disabled="disableds"
|
|
499
|
-
:right-icon="
|
|
474
|
+
:right-icon="extInfoFieldValue[item.fieldId]? 'close' : 'van-icon van-icon-arrow van-cell__right-icon'"
|
|
500
475
|
/>
|
|
501
476
|
<van-popup v-model="refShowPicker" position="bottom" :style="{ height: '300px' }">
|
|
502
477
|
<select-popup
|
|
503
|
-
:options="refTemplateList[
|
|
504
|
-
:defaultValue="
|
|
478
|
+
:options="refTemplateList[selectDetail.fieldId]"
|
|
479
|
+
:defaultValue="refDefaultValue[selectDetail.fieldId]"
|
|
505
480
|
@onConfim="confirmRefSelect"
|
|
506
481
|
@onclose= "refShowPicker = false"
|
|
507
|
-
:multiple="
|
|
482
|
+
:multiple="selectDetail.formField && selectDetail.formField.extInfo && selectDetail.formField.extInfo.selectType ==='多选'?true:false"
|
|
508
483
|
ref="selectPopup"
|
|
509
484
|
:props="{
|
|
510
485
|
value:'id',
|
|
@@ -519,7 +494,7 @@
|
|
|
519
494
|
readonly
|
|
520
495
|
clickable
|
|
521
496
|
name="area"
|
|
522
|
-
:value="
|
|
497
|
+
:value="extInfoFieldValue[item.fieldId] && Array.isArray(extInfoFieldValue[item.fieldId])?extInfoFieldValue[item.fieldId].map(e=>e.label).join('/'):''"
|
|
523
498
|
:label=item.formField.name
|
|
524
499
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
525
500
|
@click="openDrawer(item,'cascader')"
|
|
@@ -540,7 +515,7 @@
|
|
|
540
515
|
<div @click="checkUpload(item.fieldId,item.formField.extInfo)" class="form-field-item-file">
|
|
541
516
|
<div class="fileName"><span style="color: red" v-if="item.required || isRequiredFn(item.formField)">*</span>{{item.formField.name}}</div>
|
|
542
517
|
<van-uploader
|
|
543
|
-
v-model="
|
|
518
|
+
v-model="extInfoFieldValue[item.fieldId]"
|
|
544
519
|
:before-read="(file=>{return beforeRead(file,item.formField.type)})"
|
|
545
520
|
:max-count='item.formField.extInfo&&item.formField.extInfo.limitNum ? item.formField.extInfo.limitNum : (item.formField.extInfo.limit ? item.formField.extInfo.limit : 1)'
|
|
546
521
|
:after-read="afterRead"
|
|
@@ -580,7 +555,7 @@
|
|
|
580
555
|
<el-drawer
|
|
581
556
|
:withHeader="false"
|
|
582
557
|
:visible.sync="drawer"
|
|
583
|
-
size="
|
|
558
|
+
size="400px"
|
|
584
559
|
direction="btt">
|
|
585
560
|
<div class="drawer-container">
|
|
586
561
|
<tree ref="drawerTree"
|
|
@@ -600,6 +575,7 @@
|
|
|
600
575
|
:options="options"
|
|
601
576
|
:defaultValue="defaultValue"
|
|
602
577
|
@onConfim="confirmSelect"
|
|
578
|
+
@onclose= "selectPopUp = false"
|
|
603
579
|
:multiple="detailField.formField.extInfo && detailField.formField.extInfo.selectType ==='多选'?true:false"
|
|
604
580
|
ref="selectPopup"
|
|
605
581
|
:props="{
|
|
@@ -725,12 +701,13 @@ export default {
|
|
|
725
701
|
detailField:{
|
|
726
702
|
formField:{}
|
|
727
703
|
},
|
|
728
|
-
|
|
704
|
+
extInfoFieldValue:{},
|
|
729
705
|
selectPopUp:false,
|
|
730
706
|
options:[],
|
|
731
707
|
defaultValue:[],
|
|
732
708
|
timeDetailData:{},
|
|
733
|
-
selectDetail:{}
|
|
709
|
+
selectDetail:{},
|
|
710
|
+
refDefaultValue:{}
|
|
734
711
|
}
|
|
735
712
|
},
|
|
736
713
|
props: {
|
|
@@ -796,6 +773,15 @@ export default {
|
|
|
796
773
|
item.value = item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:''
|
|
797
774
|
}
|
|
798
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
|
+
}
|
|
799
785
|
})
|
|
800
786
|
let newArr = arr.filter(item=>item.relationDisplay)
|
|
801
787
|
console.debug('arr',arr,newArr)
|
|
@@ -933,8 +919,8 @@ export default {
|
|
|
933
919
|
}
|
|
934
920
|
else{
|
|
935
921
|
let length = 0
|
|
936
|
-
if (this.
|
|
937
|
-
length = this.
|
|
922
|
+
if (this.extInfoFieldValue[this.filedId]){
|
|
923
|
+
length = this.extInfoFieldValue[this.filedId].length
|
|
938
924
|
}
|
|
939
925
|
if (file.length<=this.limitNum-length){
|
|
940
926
|
for (let i=0;i<file.length;i++){
|
|
@@ -1038,12 +1024,12 @@ export default {
|
|
|
1038
1024
|
imageInfo.url = ossFileUrl(this.ossConfig, res.name)
|
|
1039
1025
|
imageInfo.status='success'
|
|
1040
1026
|
imageInfo.name=res.name
|
|
1041
|
-
for (let j=0;j<this.
|
|
1042
|
-
if (this.
|
|
1043
|
-
this.
|
|
1044
|
-
this.
|
|
1045
|
-
this.
|
|
1046
|
-
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
|
|
1047
1033
|
}
|
|
1048
1034
|
}
|
|
1049
1035
|
this.fileUpload=false
|
|
@@ -1148,8 +1134,8 @@ export default {
|
|
|
1148
1134
|
}
|
|
1149
1135
|
|
|
1150
1136
|
}
|
|
1151
|
-
if (type ==='FILE'){
|
|
1152
|
-
if (this.formList.form.formFieldRelation[i].value
|
|
1137
|
+
if (type ==='FILE' || type == 'ATTACHMENT' || type == 'IMAGE' || type == 'VIDEO'){
|
|
1138
|
+
if (this.formList.form.formFieldRelation[i].value){
|
|
1153
1139
|
if (this.formList.form.formFieldRelation[i].value===null||this.formList.form.formFieldRelation[i].value===''){
|
|
1154
1140
|
this.formList.form.formFieldRelation[i].value=[]
|
|
1155
1141
|
}
|
|
@@ -1165,29 +1151,37 @@ export default {
|
|
|
1165
1151
|
valueList[file].url = this.formList.form.formFieldRelation[i].value[file]
|
|
1166
1152
|
}
|
|
1167
1153
|
if (type === 'object'&&JSON.stringify(this.formList.form.formFieldRelation[i].value[file])!=='{}') {
|
|
1168
|
-
this.
|
|
1154
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]=this.formList.form.formFieldRelation[i].value
|
|
1169
1155
|
}
|
|
1170
1156
|
else {
|
|
1171
|
-
this.
|
|
1157
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]=[]
|
|
1172
1158
|
}
|
|
1173
1159
|
}
|
|
1174
1160
|
if (bool){
|
|
1175
|
-
this.
|
|
1161
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]=valueList
|
|
1176
1162
|
}
|
|
1177
1163
|
}
|
|
1178
1164
|
}
|
|
1179
1165
|
}
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1166
|
+
}
|
|
1167
|
+
if (type === 'REF' || type === 'REF_TEMPLATE'){
|
|
1168
|
+
if (this.formList.form.formFieldRelation[i].formField.extInfo.extInfoFieldValue){
|
|
1169
|
+
let name = this.formList.form.formFieldRelation[i].formField.extInfo.extInfoFieldValue.map(item=>{
|
|
1170
|
+
return item.name
|
|
1171
|
+
})
|
|
1172
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = name
|
|
1173
|
+
}
|
|
1183
1174
|
}
|
|
1184
1175
|
}
|
|
1185
1176
|
for (let i = 0; i < this.formList.form.formFieldRelation.length; i++) {
|
|
1186
1177
|
let type = this.formList.form.formFieldRelation[i].formField.type
|
|
1187
1178
|
let extInfo = this.formList.form.formFieldRelation[i].formField.extInfo
|
|
1188
1179
|
if (type === 'CASCADER') {
|
|
1189
|
-
let fieldValue = this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue?
|
|
1190
|
-
|
|
1180
|
+
let fieldValue = this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue ?
|
|
1181
|
+
this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue :[]
|
|
1182
|
+
if (!this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]){
|
|
1183
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = fieldValue
|
|
1184
|
+
}
|
|
1191
1185
|
if (this.formList.form.formFieldRelation[i].value){
|
|
1192
1186
|
this.formList.form.formFieldRelation[i].value = this.formList.form.formFieldRelation[i].formField.defaultValue?
|
|
1193
1187
|
this.formList.form.formFieldRelation[i].formField.defaultValue:[];
|
|
@@ -1206,17 +1200,17 @@ export default {
|
|
|
1206
1200
|
if (!this.formList.form.formFieldRelation[i].formField.extInfo.mold ||
|
|
1207
1201
|
this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'TIME' ||
|
|
1208
1202
|
this.getMoldTime(this.formList.form.formFieldRelation[i].formField.formField) == 'TIME'){
|
|
1209
|
-
this.
|
|
1203
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]=dateTime.Format('hh:mm')
|
|
1210
1204
|
}
|
|
1211
1205
|
else if (this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATA_TIME' ||
|
|
1212
1206
|
this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATE_TIME' ||
|
|
1213
1207
|
this.getMoldTime(this.formList.form.formFieldRelation[i].formField.formField) == 'DATE_TIME'){
|
|
1214
|
-
this.
|
|
1208
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = dateTime.Format('yyyy-MM-dd hh:mm')
|
|
1215
1209
|
}
|
|
1216
1210
|
else if (this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATA' ||
|
|
1217
1211
|
this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATE' ||
|
|
1218
1212
|
this.getMoldTime(this.formList.form.formFieldRelation[i].formField.formField) == 'DATE'){
|
|
1219
|
-
this.
|
|
1213
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = dateTime.Format('yyyy-MM-dd')
|
|
1220
1214
|
}
|
|
1221
1215
|
}
|
|
1222
1216
|
}
|
|
@@ -1268,6 +1262,9 @@ export default {
|
|
|
1268
1262
|
}
|
|
1269
1263
|
}
|
|
1270
1264
|
}
|
|
1265
|
+
if (this.formList.extInfo && this.formList.extInfo.extInfoFieldValue){
|
|
1266
|
+
this.extInfoFieldValue = this.formList.extInfo.extInfoFieldValue
|
|
1267
|
+
}
|
|
1271
1268
|
this.formShow = this.formList
|
|
1272
1269
|
},
|
|
1273
1270
|
addZero(i) {
|
|
@@ -1305,6 +1302,7 @@ export default {
|
|
|
1305
1302
|
this.isPhone=this.propIsPhone;
|
|
1306
1303
|
this.isCompany=this.propIsCompany;
|
|
1307
1304
|
}
|
|
1305
|
+
|
|
1308
1306
|
},
|
|
1309
1307
|
//时间的选择器
|
|
1310
1308
|
onConfirm(value, id,item,type) {
|
|
@@ -1312,18 +1310,18 @@ export default {
|
|
|
1312
1310
|
if (type == 'DATE'){
|
|
1313
1311
|
this.datePicker = false
|
|
1314
1312
|
this.timeDetailData.value = value;
|
|
1315
|
-
this.
|
|
1313
|
+
this.extInfoFieldValue[id] =this.formatDate(value);
|
|
1316
1314
|
}
|
|
1317
1315
|
else if (type == 'TIME'){
|
|
1318
1316
|
this.timePicker = false;
|
|
1319
|
-
this.
|
|
1317
|
+
this.extInfoFieldValue[id] = value;
|
|
1320
1318
|
console.debug('timeDetailData',this.timeDetailData)
|
|
1321
1319
|
this.timeDetailData.value = forMatTime(value)
|
|
1322
1320
|
}
|
|
1323
1321
|
else if (type == 'DATE_TIME'){
|
|
1324
1322
|
this.dateTimePicker = false;
|
|
1325
1323
|
this.timeDetailData.value = value
|
|
1326
|
-
this.
|
|
1324
|
+
this.extInfoFieldValue[id] =this.formatDate(value) +" "+ this.addZero(value.getHours()) + ':' + this.addZero(value.getMinutes())
|
|
1327
1325
|
}
|
|
1328
1326
|
/*for (let i = 0; i < this.formShow.form.formFieldRelation.length; i++) {
|
|
1329
1327
|
if (this.formShow.form.formFieldRelation[i].fieldId=== id) {
|
|
@@ -1363,6 +1361,9 @@ export default {
|
|
|
1363
1361
|
//下拉的选择器
|
|
1364
1362
|
onConfirmSelect(value, item) {
|
|
1365
1363
|
console.log('value',value,this.selectDetail)
|
|
1364
|
+
if (!value){
|
|
1365
|
+
return
|
|
1366
|
+
}
|
|
1366
1367
|
this.selectValues[this.selectDetail.fieldId] = value;
|
|
1367
1368
|
for (let i = 0; i < this.formShow.form.formFieldRelation.length; i++) {
|
|
1368
1369
|
if (this.formShow.form.formFieldRelation[i].fieldId === this.selectDetail.fieldId) {
|
|
@@ -1426,15 +1427,21 @@ export default {
|
|
|
1426
1427
|
}
|
|
1427
1428
|
})
|
|
1428
1429
|
}
|
|
1429
|
-
if (this.
|
|
1430
|
+
if (this.extInfoFieldValue[this.formShow.form.formFieldRelation[i].fieldId] &&
|
|
1431
|
+
(this.formShow.form.formFieldRelation[i].formField.type == 'FILE' ||
|
|
1432
|
+
this.formShow.form.formFieldRelation[i].formField.type == 'IMAGE' ||
|
|
1433
|
+
this.formShow.form.formFieldRelation[i].formField.type == 'VIDEO' ||
|
|
1434
|
+
this.formShow.form.formFieldRelation[i].formField.type == 'ATTACHMENT')) {
|
|
1430
1435
|
let value=[]
|
|
1431
|
-
this.
|
|
1436
|
+
this.extInfoFieldValue[this.formShow.form.formFieldRelation[i].fieldId].forEach(item=>{
|
|
1432
1437
|
let file = {}
|
|
1433
1438
|
file.name = item.name
|
|
1434
1439
|
file.url = item.url
|
|
1435
1440
|
value.push(file)
|
|
1436
1441
|
})
|
|
1437
|
-
this.formShow.form.formFieldRelation[i].value=value
|
|
1442
|
+
this.formShow.form.formFieldRelation[i].value = value.map(item=>{
|
|
1443
|
+
return item.name
|
|
1444
|
+
})
|
|
1438
1445
|
}
|
|
1439
1446
|
if(this.formShow.form.formFieldRelation[i].display &&
|
|
1440
1447
|
(this.formShow.form.formFieldRelation[i].required || this.isRequiredFn(this.formShow.form.formFieldRelation[i].formField)) &&
|
|
@@ -1446,12 +1453,17 @@ export default {
|
|
|
1446
1453
|
strVal = value.replace(/\n/g,'');
|
|
1447
1454
|
}
|
|
1448
1455
|
let bool = this.formShow.form.formFieldRelation[i].value && this.formShow.form.formFieldRelation[i].value.includes('\n') && !strVal
|
|
1449
|
-
if(!this.formShow.form.formFieldRelation[i].value || bool|| (this.formShow.form.formFieldRelation[i].value&&this.formShow.form.formFieldRelation[i].value.length===0)) {
|
|
1456
|
+
if(!this.formShow.form.formFieldRelation[i].value || bool || (this.formShow.form.formFieldRelation[i].value&&this.formShow.form.formFieldRelation[i].value.length===0)) {
|
|
1450
1457
|
this.$message.error('请完善'+ this.formShow.form.formFieldRelation[i].formField.name)
|
|
1451
1458
|
return
|
|
1452
1459
|
}
|
|
1453
1460
|
}
|
|
1454
1461
|
}
|
|
1462
|
+
let extInfo = {
|
|
1463
|
+
extInfoFieldValue:this.extInfoFieldValue
|
|
1464
|
+
}
|
|
1465
|
+
this.$set(this.formShow,'extInfo',extInfo)
|
|
1466
|
+
console.debug('form',this.formShow)
|
|
1455
1467
|
this.$emit('submitClick',this.formShow)
|
|
1456
1468
|
this.disableds = true
|
|
1457
1469
|
this.submitValue = '已提交'
|
|
@@ -1488,11 +1500,12 @@ export default {
|
|
|
1488
1500
|
},
|
|
1489
1501
|
//下拉的点击事件
|
|
1490
1502
|
selectClick(id,type,item) {
|
|
1491
|
-
console.debug('111')
|
|
1503
|
+
console.debug('111',item)
|
|
1492
1504
|
if (this.disableds){
|
|
1493
1505
|
return
|
|
1494
1506
|
}
|
|
1495
|
-
this.selectDetail = item
|
|
1507
|
+
this.selectDetail = item;
|
|
1508
|
+
this.defaultValue = ''
|
|
1496
1509
|
if(type == 'client') {
|
|
1497
1510
|
let selectOption
|
|
1498
1511
|
this.selectValue=[]
|
|
@@ -1511,7 +1524,9 @@ export default {
|
|
|
1511
1524
|
this.selectId = id
|
|
1512
1525
|
this.showPicker = true
|
|
1513
1526
|
} else if (type == 'ref'){
|
|
1514
|
-
this.refShowPicker = true
|
|
1527
|
+
this.refShowPicker = true;
|
|
1528
|
+
this.refTemplateVisibleChange(true,item);
|
|
1529
|
+
this.refDefaultValue[item.fieldId] = item.value?[item.value]:[]
|
|
1515
1530
|
} else if (type == 'select'){
|
|
1516
1531
|
this.selectPicker = true;
|
|
1517
1532
|
}
|
|
@@ -1748,27 +1763,27 @@ export default {
|
|
|
1748
1763
|
imgInfo.name = data.file.name
|
|
1749
1764
|
imgInfo.uid = data.file.uid
|
|
1750
1765
|
}
|
|
1751
|
-
if (!this.
|
|
1766
|
+
if (!this.extInfoFieldValue[this.filedId])
|
|
1752
1767
|
{
|
|
1753
|
-
this.
|
|
1768
|
+
this.extInfoFieldValue[this.filedId] = []
|
|
1754
1769
|
}
|
|
1755
|
-
this.
|
|
1770
|
+
this.extInfoFieldValue[this.filedId].push(imgInfo)
|
|
1756
1771
|
this.loading.close()
|
|
1757
1772
|
}).catch((err) => {
|
|
1758
1773
|
console.debug("upload err", err);
|
|
1759
1774
|
});
|
|
1760
1775
|
},
|
|
1761
1776
|
successUpload(response,file,fileList){
|
|
1762
|
-
if (!this.
|
|
1763
|
-
this.
|
|
1777
|
+
if (!this.extInfoFieldValue[this.filedId]){
|
|
1778
|
+
this.extInfoFieldValue[this.filedId] = []
|
|
1764
1779
|
}
|
|
1765
1780
|
for (let i=0;i<fileList.length;i++){
|
|
1766
|
-
if (!this.
|
|
1767
|
-
this.
|
|
1781
|
+
if (!this.extInfoFieldValue[this.filedId][i]){
|
|
1782
|
+
this.extInfoFieldValue[this.filedId][i]={}
|
|
1768
1783
|
}
|
|
1769
|
-
this.
|
|
1770
|
-
this.
|
|
1771
|
-
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
|
|
1772
1787
|
}
|
|
1773
1788
|
},
|
|
1774
1789
|
uploadProgress(){
|
|
@@ -1780,17 +1795,17 @@ export default {
|
|
|
1780
1795
|
});
|
|
1781
1796
|
},
|
|
1782
1797
|
handleRemove(file) {
|
|
1783
|
-
if (this.
|
|
1784
|
-
for (let i=0;i<this.
|
|
1798
|
+
if (this.extInfoFieldValue[this.filedId]){
|
|
1799
|
+
for (let i=0;i<this.extInfoFieldValue[this.filedId].length;i++)
|
|
1785
1800
|
{
|
|
1786
|
-
if (this.
|
|
1787
|
-
if (this.
|
|
1788
|
-
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)
|
|
1789
1804
|
return
|
|
1790
1805
|
}
|
|
1791
1806
|
}
|
|
1792
|
-
else if (this.
|
|
1793
|
-
this.
|
|
1807
|
+
else if (this.extInfoFieldValue[this.filedId][i].url===file.url){
|
|
1808
|
+
this.extInfoFieldValue[this.filedId].splice(i,1)
|
|
1794
1809
|
return
|
|
1795
1810
|
}
|
|
1796
1811
|
}
|
|
@@ -1867,6 +1882,7 @@ export default {
|
|
|
1867
1882
|
this.videoUploadPercent = file.percentage.toFixed(0);
|
|
1868
1883
|
},
|
|
1869
1884
|
refTemplateVisibleChange(visible,field) {
|
|
1885
|
+
console.debug('field1111',field)
|
|
1870
1886
|
let fields = field.formField.type === 'REF' ? field.formField.extInfo.ref.field : field.formField.extInfo.ref.vars
|
|
1871
1887
|
if (visible) {
|
|
1872
1888
|
if (
|
|
@@ -1883,62 +1899,42 @@ export default {
|
|
|
1883
1899
|
sortInfos: [],
|
|
1884
1900
|
templateId: ''
|
|
1885
1901
|
})
|
|
1886
|
-
|
|
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)
|
|
1887
1909
|
}
|
|
1888
1910
|
}
|
|
1889
1911
|
},
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
this.
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
// templateId: templateId
|
|
1902
|
-
// }
|
|
1903
|
-
this.$http.post(url, this.dataQuery[field.fieldId]).then(res => {
|
|
1904
|
-
if (res.data.code === '0') {
|
|
1905
|
-
let list = res.data.data.data
|
|
1906
|
-
this.dataQuery[field.fieldId].hasNextPage = res.data.data.hasNextPage
|
|
1907
|
-
// this.isHasNext[field.id] = res.data.data.hasNextPage
|
|
1908
|
-
let templateList = []
|
|
1909
|
-
templateList = list.map(res => {
|
|
1910
|
-
let info = {}
|
|
1911
|
-
for (let key in res.fieldValues) {
|
|
1912
|
-
if (Array.isArray(fieldId)) {
|
|
1913
|
-
let vals = ''
|
|
1914
|
-
let values = ''
|
|
1915
|
-
fieldId.forEach(val => {
|
|
1916
|
-
vals += val
|
|
1917
|
-
if (res.fieldValues[val]) {
|
|
1918
|
-
values += res.fieldValues[val]
|
|
1919
|
-
}
|
|
1920
|
-
})
|
|
1921
|
-
info[vals] = values
|
|
1922
|
-
info.id = res.id
|
|
1923
|
-
info.name = values
|
|
1924
|
-
} else {
|
|
1925
|
-
if (fieldId === key) {
|
|
1926
|
-
info[key] = res.fieldValues[key]
|
|
1927
|
-
info.id = res.id
|
|
1928
|
-
info.name = res.fieldValues[key]
|
|
1929
|
-
}
|
|
1912
|
+
changeRefData(value, item) {
|
|
1913
|
+
console.log(value);
|
|
1914
|
+
console.debug('value', value, item, this.refTemplateList[item.fieldId])
|
|
1915
|
+
let arr = []
|
|
1916
|
+
if (this.refTemplateList[item.fieldId]) {
|
|
1917
|
+
this.refTemplateList[item.fieldId].forEach(data => {
|
|
1918
|
+
if(typeof value == 'string' || typeof value == 'number') {
|
|
1919
|
+
if(value == data.id) {
|
|
1920
|
+
let obj = {
|
|
1921
|
+
name: data.name,
|
|
1922
|
+
id: data.id
|
|
1930
1923
|
}
|
|
1924
|
+
arr.push(data)
|
|
1931
1925
|
}
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1926
|
+
} else {
|
|
1927
|
+
if (value.indexOf(data.id) !== -1) {
|
|
1928
|
+
let obj = {
|
|
1929
|
+
name: data.name,
|
|
1930
|
+
id: data.id
|
|
1931
|
+
}
|
|
1932
|
+
arr.push(data)
|
|
1933
|
+
}
|
|
1934
|
+
}
|
|
1935
|
+
})
|
|
1936
|
+
}
|
|
1937
|
+
this.extInfoFieldValue[item.fieldId] = arr
|
|
1942
1938
|
},
|
|
1943
1939
|
lodeMore(item) {
|
|
1944
1940
|
this.dataQuery[item.fieldId].pageInfo.pageNo += 1
|
|
@@ -1947,7 +1943,6 @@ export default {
|
|
|
1947
1943
|
//打开级联/下拉抽屉选择
|
|
1948
1944
|
openDrawer(field,type){
|
|
1949
1945
|
this.detailField = field;
|
|
1950
|
-
console.debug('type',type)
|
|
1951
1946
|
if (type == 'cascader' || type === 'pc_cascader'){
|
|
1952
1947
|
if (type == 'cascader'){
|
|
1953
1948
|
this.showArea = true;
|
|
@@ -1956,16 +1951,19 @@ export default {
|
|
|
1956
1951
|
this.drawer = true;
|
|
1957
1952
|
}
|
|
1958
1953
|
this.$nextTick(()=>{
|
|
1959
|
-
let arr = this.
|
|
1960
|
-
console.debug('drawerTree',this.$refs.drawerTree)
|
|
1954
|
+
let arr = this.extInfoFieldValue[field.fieldId]?this.extInfoFieldValue[field.fieldId]:[]
|
|
1961
1955
|
let drawerTree = this.$refs.drawerTree
|
|
1962
|
-
if (drawerTree){
|
|
1963
|
-
|
|
1964
|
-
item
|
|
1965
|
-
|
|
1966
|
-
|
|
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
|
+
}
|
|
1967
1966
|
}
|
|
1968
|
-
|
|
1969
1967
|
})
|
|
1970
1968
|
}
|
|
1971
1969
|
else if (type === 'select'){
|
|
@@ -1986,8 +1984,9 @@ export default {
|
|
|
1986
1984
|
//保存级联数据
|
|
1987
1985
|
saveData(checkList,checkDatas){
|
|
1988
1986
|
this.$set(this.detailField,'value',checkList);
|
|
1989
|
-
this.
|
|
1990
|
-
this.$set(this.detailField.formField.extInfo,'
|
|
1987
|
+
this.extInfoFieldValue[this.detailField.fieldId] = checkDatas;
|
|
1988
|
+
this.$set(this.detailField.formField.extInfo,'extInfoFieldValue',checkDatas);
|
|
1989
|
+
console.debug('checkDatas',this.detailField.formField.extInfo,checkList)
|
|
1991
1990
|
this.$forceUpdate();
|
|
1992
1991
|
this.showArea = false;
|
|
1993
1992
|
this.drawer = false;
|
|
@@ -2007,10 +2006,17 @@ export default {
|
|
|
2007
2006
|
return
|
|
2008
2007
|
}
|
|
2009
2008
|
this.detailField.value = list;
|
|
2010
|
-
let val =
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2009
|
+
let val = ''
|
|
2010
|
+
if (Array.isArray(option)){
|
|
2011
|
+
val = option.map(item=>{
|
|
2012
|
+
return item.id
|
|
2013
|
+
})
|
|
2014
|
+
this.extInfoFieldValue[this.detailField.fieldId] = option
|
|
2015
|
+
}
|
|
2016
|
+
else {
|
|
2017
|
+
val = option.id
|
|
2018
|
+
this.extInfoFieldValue[this.detailField.fieldId] = [option]
|
|
2019
|
+
}
|
|
2014
2020
|
this.refShowPicker = false;
|
|
2015
2021
|
},
|
|
2016
2022
|
// 一个重复的方法 兼容 状态优先级 的关联控件,
|