askbot-dragon 0.7.94 → 0.7.97
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"
|
|
@@ -242,7 +214,7 @@
|
|
|
242
214
|
</template>
|
|
243
215
|
<div
|
|
244
216
|
@click="lodeMore(item)"
|
|
245
|
-
v-if="
|
|
217
|
+
v-if="refNextPage[item.fieldId] && refNextPage[item.fieldId].hasNextPage"
|
|
246
218
|
style="width:100%;height:30px;display:flex;align-items: center;justify-content: center;color:#606266">
|
|
247
219
|
加载更多
|
|
248
220
|
</div>
|
|
@@ -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
|
|
@@ -514,6 +486,9 @@
|
|
|
514
486
|
label:'name'
|
|
515
487
|
}"
|
|
516
488
|
>
|
|
489
|
+
<template slot="popup-footer" v-if="refNextPage[item.fieldId] && refNextPage[item.fieldId].hasNextPage">
|
|
490
|
+
<span @click="lodeMore(item)">加载更多</span>
|
|
491
|
+
</template>
|
|
517
492
|
</select-popup>
|
|
518
493
|
</van-popup>
|
|
519
494
|
</div>
|
|
@@ -522,7 +497,7 @@
|
|
|
522
497
|
readonly
|
|
523
498
|
clickable
|
|
524
499
|
name="area"
|
|
525
|
-
:value="
|
|
500
|
+
:value="extInfoFieldValue[item.fieldId] && Array.isArray(extInfoFieldValue[item.fieldId])?extInfoFieldValue[item.fieldId].map(e=>e.label).join('/'):''"
|
|
526
501
|
:label=item.formField.name
|
|
527
502
|
:placeholder="item.formField.extInfo&&item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:'请选择'"
|
|
528
503
|
@click="openDrawer(item,'cascader')"
|
|
@@ -543,7 +518,7 @@
|
|
|
543
518
|
<div @click="checkUpload(item.fieldId,item.formField.extInfo)" class="form-field-item-file">
|
|
544
519
|
<div class="fileName"><span style="color: red" v-if="item.required || isRequiredFn(item.formField)">*</span>{{item.formField.name}}</div>
|
|
545
520
|
<van-uploader
|
|
546
|
-
v-model="
|
|
521
|
+
v-model="extInfoFieldValue[item.fieldId]"
|
|
547
522
|
:before-read="(file=>{return beforeRead(file,item.formField.type)})"
|
|
548
523
|
:max-count='item.formField.extInfo&&item.formField.extInfo.limitNum ? item.formField.extInfo.limitNum : (item.formField.extInfo.limit ? item.formField.extInfo.limit : 1)'
|
|
549
524
|
:after-read="afterRead"
|
|
@@ -583,7 +558,7 @@
|
|
|
583
558
|
<el-drawer
|
|
584
559
|
:withHeader="false"
|
|
585
560
|
:visible.sync="drawer"
|
|
586
|
-
size="
|
|
561
|
+
size="400px"
|
|
587
562
|
direction="btt">
|
|
588
563
|
<div class="drawer-container">
|
|
589
564
|
<tree ref="drawerTree"
|
|
@@ -603,6 +578,7 @@
|
|
|
603
578
|
:options="options"
|
|
604
579
|
:defaultValue="defaultValue"
|
|
605
580
|
@onConfim="confirmSelect"
|
|
581
|
+
@onclose= "selectPopUp = false"
|
|
606
582
|
:multiple="detailField.formField.extInfo && detailField.formField.extInfo.selectType ==='多选'?true:false"
|
|
607
583
|
ref="selectPopup"
|
|
608
584
|
:props="{
|
|
@@ -724,11 +700,12 @@ export default {
|
|
|
724
700
|
refTemplateList:{},
|
|
725
701
|
refList:{},
|
|
726
702
|
dataQuery:{},
|
|
703
|
+
refNextPage:{},
|
|
727
704
|
drawer:false,
|
|
728
705
|
detailField:{
|
|
729
706
|
formField:{}
|
|
730
707
|
},
|
|
731
|
-
|
|
708
|
+
extInfoFieldValue:{},
|
|
732
709
|
selectPopUp:false,
|
|
733
710
|
options:[],
|
|
734
711
|
defaultValue:[],
|
|
@@ -800,6 +777,15 @@ export default {
|
|
|
800
777
|
item.value = item.formField.extInfo.placeholder?item.formField.extInfo.placeholder:''
|
|
801
778
|
}
|
|
802
779
|
}
|
|
780
|
+
if (!item.relationDisplay){
|
|
781
|
+
item.value = []
|
|
782
|
+
this.extInfoFieldValue[item.fieldId] = []
|
|
783
|
+
this.selectValues[item.fieldId] = []
|
|
784
|
+
this.extInfoFieldValue[item.fieldId] = []
|
|
785
|
+
if (item.formField.extInfo.extInfoFieldValue){
|
|
786
|
+
item.formField.extInfo.extInfoFieldValue = ''
|
|
787
|
+
}
|
|
788
|
+
}
|
|
803
789
|
})
|
|
804
790
|
let newArr = arr.filter(item=>item.relationDisplay)
|
|
805
791
|
console.debug('arr',arr,newArr)
|
|
@@ -937,8 +923,8 @@ export default {
|
|
|
937
923
|
}
|
|
938
924
|
else{
|
|
939
925
|
let length = 0
|
|
940
|
-
if (this.
|
|
941
|
-
length = this.
|
|
926
|
+
if (this.extInfoFieldValue[this.filedId]){
|
|
927
|
+
length = this.extInfoFieldValue[this.filedId].length
|
|
942
928
|
}
|
|
943
929
|
if (file.length<=this.limitNum-length){
|
|
944
930
|
for (let i=0;i<file.length;i++){
|
|
@@ -1042,12 +1028,12 @@ export default {
|
|
|
1042
1028
|
imageInfo.url = ossFileUrl(this.ossConfig, res.name)
|
|
1043
1029
|
imageInfo.status='success'
|
|
1044
1030
|
imageInfo.name=res.name
|
|
1045
|
-
for (let j=0;j<this.
|
|
1046
|
-
if (this.
|
|
1047
|
-
this.
|
|
1048
|
-
this.
|
|
1049
|
-
this.
|
|
1050
|
-
delete this.
|
|
1031
|
+
for (let j=0;j<this.extInfoFieldValue[this.filedId].length;j++){
|
|
1032
|
+
if (this.extInfoFieldValue[this.filedId][j].content&&this.extInfoFieldValue[this.filedId][j].content===content){
|
|
1033
|
+
this.extInfoFieldValue[this.filedId][j].name=res.name
|
|
1034
|
+
this.extInfoFieldValue[this.filedId][j].status='success'
|
|
1035
|
+
this.extInfoFieldValue[this.filedId][j].url=imageInfo.url
|
|
1036
|
+
delete this.extInfoFieldValue[this.filedId][j].content
|
|
1051
1037
|
}
|
|
1052
1038
|
}
|
|
1053
1039
|
this.fileUpload=false
|
|
@@ -1153,10 +1139,7 @@ export default {
|
|
|
1153
1139
|
|
|
1154
1140
|
}
|
|
1155
1141
|
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){
|
|
1142
|
+
if (this.formList.form.formFieldRelation[i].value){
|
|
1160
1143
|
if (this.formList.form.formFieldRelation[i].value===null||this.formList.form.formFieldRelation[i].value===''){
|
|
1161
1144
|
this.formList.form.formFieldRelation[i].value=[]
|
|
1162
1145
|
}
|
|
@@ -1172,14 +1155,14 @@ export default {
|
|
|
1172
1155
|
valueList[file].url = this.formList.form.formFieldRelation[i].value[file]
|
|
1173
1156
|
}
|
|
1174
1157
|
if (type === 'object'&&JSON.stringify(this.formList.form.formFieldRelation[i].value[file])!=='{}') {
|
|
1175
|
-
this.
|
|
1158
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]=this.formList.form.formFieldRelation[i].value
|
|
1176
1159
|
}
|
|
1177
1160
|
else {
|
|
1178
|
-
this.
|
|
1161
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]=[]
|
|
1179
1162
|
}
|
|
1180
1163
|
}
|
|
1181
1164
|
if (bool){
|
|
1182
|
-
this.
|
|
1165
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]=valueList
|
|
1183
1166
|
}
|
|
1184
1167
|
}
|
|
1185
1168
|
}
|
|
@@ -1190,7 +1173,7 @@ export default {
|
|
|
1190
1173
|
let name = this.formList.form.formFieldRelation[i].formField.extInfo.extInfoFieldValue.map(item=>{
|
|
1191
1174
|
return item.name
|
|
1192
1175
|
})
|
|
1193
|
-
this.
|
|
1176
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = name
|
|
1194
1177
|
}
|
|
1195
1178
|
}
|
|
1196
1179
|
}
|
|
@@ -1198,12 +1181,11 @@ export default {
|
|
|
1198
1181
|
let type = this.formList.form.formFieldRelation[i].formField.type
|
|
1199
1182
|
let extInfo = this.formList.form.formFieldRelation[i].formField.extInfo
|
|
1200
1183
|
if (type === 'CASCADER') {
|
|
1201
|
-
let fieldValue = this.formList.form.formFieldRelation[i].formField.extInfo.
|
|
1202
|
-
this.formList.form.formFieldRelation[i].formField.extInfo.
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
this.checkDatas[this.formList.form.formFieldRelation[i].fieldId] = fieldValue
|
|
1184
|
+
let fieldValue = this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue ?
|
|
1185
|
+
this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue :[]
|
|
1186
|
+
if (!this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]){
|
|
1187
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = fieldValue
|
|
1188
|
+
}
|
|
1207
1189
|
if (this.formList.form.formFieldRelation[i].value){
|
|
1208
1190
|
this.formList.form.formFieldRelation[i].value = this.formList.form.formFieldRelation[i].formField.defaultValue?
|
|
1209
1191
|
this.formList.form.formFieldRelation[i].formField.defaultValue:[];
|
|
@@ -1222,17 +1204,17 @@ export default {
|
|
|
1222
1204
|
if (!this.formList.form.formFieldRelation[i].formField.extInfo.mold ||
|
|
1223
1205
|
this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'TIME' ||
|
|
1224
1206
|
this.getMoldTime(this.formList.form.formFieldRelation[i].formField.formField) == 'TIME'){
|
|
1225
|
-
this.
|
|
1207
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId]=dateTime.Format('hh:mm')
|
|
1226
1208
|
}
|
|
1227
1209
|
else if (this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATA_TIME' ||
|
|
1228
1210
|
this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATE_TIME' ||
|
|
1229
1211
|
this.getMoldTime(this.formList.form.formFieldRelation[i].formField.formField) == 'DATE_TIME'){
|
|
1230
|
-
this.
|
|
1212
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = dateTime.Format('yyyy-MM-dd hh:mm')
|
|
1231
1213
|
}
|
|
1232
1214
|
else if (this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATA' ||
|
|
1233
1215
|
this.formList.form.formFieldRelation[i].formField.extInfo.mold == 'DATE' ||
|
|
1234
1216
|
this.getMoldTime(this.formList.form.formFieldRelation[i].formField.formField) == 'DATE'){
|
|
1235
|
-
this.
|
|
1217
|
+
this.extInfoFieldValue[this.formList.form.formFieldRelation[i].fieldId] = dateTime.Format('yyyy-MM-dd')
|
|
1236
1218
|
}
|
|
1237
1219
|
}
|
|
1238
1220
|
}
|
|
@@ -1284,6 +1266,9 @@ export default {
|
|
|
1284
1266
|
}
|
|
1285
1267
|
}
|
|
1286
1268
|
}
|
|
1269
|
+
if (this.formList.extInfo && this.formList.extInfo.extInfoFieldValue){
|
|
1270
|
+
this.extInfoFieldValue = this.formList.extInfo.extInfoFieldValue
|
|
1271
|
+
}
|
|
1287
1272
|
this.formShow = this.formList
|
|
1288
1273
|
},
|
|
1289
1274
|
addZero(i) {
|
|
@@ -1329,18 +1314,18 @@ export default {
|
|
|
1329
1314
|
if (type == 'DATE'){
|
|
1330
1315
|
this.datePicker = false
|
|
1331
1316
|
this.timeDetailData.value = value;
|
|
1332
|
-
this.
|
|
1317
|
+
this.extInfoFieldValue[id] =this.formatDate(value);
|
|
1333
1318
|
}
|
|
1334
1319
|
else if (type == 'TIME'){
|
|
1335
1320
|
this.timePicker = false;
|
|
1336
|
-
this.
|
|
1321
|
+
this.extInfoFieldValue[id] = value;
|
|
1337
1322
|
console.debug('timeDetailData',this.timeDetailData)
|
|
1338
1323
|
this.timeDetailData.value = forMatTime(value)
|
|
1339
1324
|
}
|
|
1340
1325
|
else if (type == 'DATE_TIME'){
|
|
1341
1326
|
this.dateTimePicker = false;
|
|
1342
1327
|
this.timeDetailData.value = value
|
|
1343
|
-
this.
|
|
1328
|
+
this.extInfoFieldValue[id] =this.formatDate(value) +" "+ this.addZero(value.getHours()) + ':' + this.addZero(value.getMinutes())
|
|
1344
1329
|
}
|
|
1345
1330
|
/*for (let i = 0; i < this.formShow.form.formFieldRelation.length; i++) {
|
|
1346
1331
|
if (this.formShow.form.formFieldRelation[i].fieldId=== id) {
|
|
@@ -1380,6 +1365,9 @@ export default {
|
|
|
1380
1365
|
//下拉的选择器
|
|
1381
1366
|
onConfirmSelect(value, item) {
|
|
1382
1367
|
console.log('value',value,this.selectDetail)
|
|
1368
|
+
if (!value){
|
|
1369
|
+
return
|
|
1370
|
+
}
|
|
1383
1371
|
this.selectValues[this.selectDetail.fieldId] = value;
|
|
1384
1372
|
for (let i = 0; i < this.formShow.form.formFieldRelation.length; i++) {
|
|
1385
1373
|
if (this.formShow.form.formFieldRelation[i].fieldId === this.selectDetail.fieldId) {
|
|
@@ -1443,9 +1431,13 @@ export default {
|
|
|
1443
1431
|
}
|
|
1444
1432
|
})
|
|
1445
1433
|
}
|
|
1446
|
-
if (this.
|
|
1434
|
+
if (this.extInfoFieldValue[this.formShow.form.formFieldRelation[i].fieldId] &&
|
|
1435
|
+
(this.formShow.form.formFieldRelation[i].formField.type == 'FILE' ||
|
|
1436
|
+
this.formShow.form.formFieldRelation[i].formField.type == 'IMAGE' ||
|
|
1437
|
+
this.formShow.form.formFieldRelation[i].formField.type == 'VIDEO' ||
|
|
1438
|
+
this.formShow.form.formFieldRelation[i].formField.type == 'ATTACHMENT')) {
|
|
1447
1439
|
let value=[]
|
|
1448
|
-
this.
|
|
1440
|
+
this.extInfoFieldValue[this.formShow.form.formFieldRelation[i].fieldId].forEach(item=>{
|
|
1449
1441
|
let file = {}
|
|
1450
1442
|
file.name = item.name
|
|
1451
1443
|
file.url = item.url
|
|
@@ -1454,7 +1446,6 @@ export default {
|
|
|
1454
1446
|
this.formShow.form.formFieldRelation[i].value = value.map(item=>{
|
|
1455
1447
|
return item.name
|
|
1456
1448
|
})
|
|
1457
|
-
this.formShow.form.formFieldRelation[i].formField.extInfo.extInfoFieldValue = value
|
|
1458
1449
|
}
|
|
1459
1450
|
if(this.formShow.form.formFieldRelation[i].display &&
|
|
1460
1451
|
(this.formShow.form.formFieldRelation[i].required || this.isRequiredFn(this.formShow.form.formFieldRelation[i].formField)) &&
|
|
@@ -1466,12 +1457,17 @@ export default {
|
|
|
1466
1457
|
strVal = value.replace(/\n/g,'');
|
|
1467
1458
|
}
|
|
1468
1459
|
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)) {
|
|
1460
|
+
if(!this.formShow.form.formFieldRelation[i].value || bool || (this.formShow.form.formFieldRelation[i].value&&this.formShow.form.formFieldRelation[i].value.length===0)) {
|
|
1470
1461
|
this.$message.error('请完善'+ this.formShow.form.formFieldRelation[i].formField.name)
|
|
1471
1462
|
return
|
|
1472
1463
|
}
|
|
1473
1464
|
}
|
|
1474
1465
|
}
|
|
1466
|
+
let extInfo = {
|
|
1467
|
+
extInfoFieldValue:this.extInfoFieldValue
|
|
1468
|
+
}
|
|
1469
|
+
this.$set(this.formShow,'extInfo',extInfo)
|
|
1470
|
+
console.debug('form',this.formShow)
|
|
1475
1471
|
this.$emit('submitClick',this.formShow)
|
|
1476
1472
|
this.disableds = true
|
|
1477
1473
|
this.submitValue = '已提交'
|
|
@@ -1545,7 +1541,9 @@ export default {
|
|
|
1545
1541
|
SelectClear(fieldId) {
|
|
1546
1542
|
if(this.disableds === false){
|
|
1547
1543
|
let i = this.formShow.form.formFieldRelation.findIndex(item => { console.log(item.fieldId); return item.fieldId == fieldId })
|
|
1548
|
-
this.selectValues[this.formShow.form.formFieldRelation[i].fieldId] = ''
|
|
1544
|
+
this.selectValues[this.formShow.form.formFieldRelation[i].fieldId] = '';
|
|
1545
|
+
this.formShow.form.formFieldRelation[i].value = "";
|
|
1546
|
+
this.extInfoFieldValue[this.formShow.form.formFieldRelation[i].fieldId] = ""
|
|
1549
1547
|
this.$forceUpdate()
|
|
1550
1548
|
}
|
|
1551
1549
|
},
|
|
@@ -1771,27 +1769,27 @@ export default {
|
|
|
1771
1769
|
imgInfo.name = data.file.name
|
|
1772
1770
|
imgInfo.uid = data.file.uid
|
|
1773
1771
|
}
|
|
1774
|
-
if (!this.
|
|
1772
|
+
if (!this.extInfoFieldValue[this.filedId])
|
|
1775
1773
|
{
|
|
1776
|
-
this.
|
|
1774
|
+
this.extInfoFieldValue[this.filedId] = []
|
|
1777
1775
|
}
|
|
1778
|
-
this.
|
|
1776
|
+
this.extInfoFieldValue[this.filedId].push(imgInfo)
|
|
1779
1777
|
this.loading.close()
|
|
1780
1778
|
}).catch((err) => {
|
|
1781
1779
|
console.debug("upload err", err);
|
|
1782
1780
|
});
|
|
1783
1781
|
},
|
|
1784
1782
|
successUpload(response,file,fileList){
|
|
1785
|
-
if (!this.
|
|
1786
|
-
this.
|
|
1783
|
+
if (!this.extInfoFieldValue[this.filedId]){
|
|
1784
|
+
this.extInfoFieldValue[this.filedId] = []
|
|
1787
1785
|
}
|
|
1788
1786
|
for (let i=0;i<fileList.length;i++){
|
|
1789
|
-
if (!this.
|
|
1790
|
-
this.
|
|
1787
|
+
if (!this.extInfoFieldValue[this.filedId][i]){
|
|
1788
|
+
this.extInfoFieldValue[this.filedId][i]={}
|
|
1791
1789
|
}
|
|
1792
|
-
this.
|
|
1793
|
-
this.
|
|
1794
|
-
this.
|
|
1790
|
+
this.extInfoFieldValue[this.filedId][i].url=fileList[i].url
|
|
1791
|
+
this.extInfoFieldValue[this.filedId][i].name=fileList[i].name
|
|
1792
|
+
this.extInfoFieldValue[this.filedId][i].status=fileList[i].status
|
|
1795
1793
|
}
|
|
1796
1794
|
},
|
|
1797
1795
|
uploadProgress(){
|
|
@@ -1803,17 +1801,17 @@ export default {
|
|
|
1803
1801
|
});
|
|
1804
1802
|
},
|
|
1805
1803
|
handleRemove(file) {
|
|
1806
|
-
if (this.
|
|
1807
|
-
for (let i=0;i<this.
|
|
1804
|
+
if (this.extInfoFieldValue[this.filedId]){
|
|
1805
|
+
for (let i=0;i<this.extInfoFieldValue[this.filedId].length;i++)
|
|
1808
1806
|
{
|
|
1809
|
-
if (this.
|
|
1810
|
-
if (this.
|
|
1811
|
-
this.
|
|
1807
|
+
if (this.extInfoFieldValue[this.filedId][i].uid){
|
|
1808
|
+
if (this.extInfoFieldValue[this.filedId][i].uid===file.uid){
|
|
1809
|
+
this.extInfoFieldValue[this.filedId].splice(i,1)
|
|
1812
1810
|
return
|
|
1813
1811
|
}
|
|
1814
1812
|
}
|
|
1815
|
-
else if (this.
|
|
1816
|
-
this.
|
|
1813
|
+
else if (this.extInfoFieldValue[this.filedId][i].url===file.url){
|
|
1814
|
+
this.extInfoFieldValue[this.filedId].splice(i,1)
|
|
1817
1815
|
return
|
|
1818
1816
|
}
|
|
1819
1817
|
}
|
|
@@ -1894,7 +1892,7 @@ export default {
|
|
|
1894
1892
|
let fields = field.formField.type === 'REF' ? field.formField.extInfo.ref.field : field.formField.extInfo.ref.vars
|
|
1895
1893
|
if (visible) {
|
|
1896
1894
|
if (
|
|
1897
|
-
!this.refTemplateList[field.fieldId] || this.
|
|
1895
|
+
!this.refTemplateList[field.fieldId] || this.refNextPage[field.fieldId].hasNextPage
|
|
1898
1896
|
) {
|
|
1899
1897
|
this.$set(this.refTemplateList, field.fieldId, [])
|
|
1900
1898
|
!this.dataQuery[field.fieldId] && this.$set(this.dataQuery,field.fieldId, {
|
|
@@ -1907,7 +1905,14 @@ export default {
|
|
|
1907
1905
|
sortInfos: [],
|
|
1908
1906
|
templateId: ''
|
|
1909
1907
|
})
|
|
1910
|
-
|
|
1908
|
+
let param = {
|
|
1909
|
+
templateId:field.formField.extInfo.ref.source,
|
|
1910
|
+
fieldId:fields,
|
|
1911
|
+
field:field,
|
|
1912
|
+
dataQuery:this.dataQuery,
|
|
1913
|
+
refNextPage:this.refNextPage
|
|
1914
|
+
}
|
|
1915
|
+
this.$emit('getTemplateList',param)
|
|
1911
1916
|
}
|
|
1912
1917
|
}
|
|
1913
1918
|
},
|
|
@@ -1936,66 +1941,7 @@ export default {
|
|
|
1936
1941
|
}
|
|
1937
1942
|
})
|
|
1938
1943
|
}
|
|
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
|
-
})
|
|
1944
|
+
this.extInfoFieldValue[item.fieldId] = arr
|
|
1999
1945
|
},
|
|
2000
1946
|
lodeMore(item) {
|
|
2001
1947
|
this.dataQuery[item.fieldId].pageInfo.pageNo += 1
|
|
@@ -2004,7 +1950,6 @@ export default {
|
|
|
2004
1950
|
//打开级联/下拉抽屉选择
|
|
2005
1951
|
openDrawer(field,type){
|
|
2006
1952
|
this.detailField = field;
|
|
2007
|
-
console.debug('type',type)
|
|
2008
1953
|
if (type == 'cascader' || type === 'pc_cascader'){
|
|
2009
1954
|
if (type == 'cascader'){
|
|
2010
1955
|
this.showArea = true;
|
|
@@ -2013,16 +1958,19 @@ export default {
|
|
|
2013
1958
|
this.drawer = true;
|
|
2014
1959
|
}
|
|
2015
1960
|
this.$nextTick(()=>{
|
|
2016
|
-
let arr = this.
|
|
2017
|
-
console.debug('drawerTree',this.$refs.drawerTree)
|
|
1961
|
+
let arr = this.extInfoFieldValue[field.fieldId]?this.extInfoFieldValue[field.fieldId]:[]
|
|
2018
1962
|
let drawerTree = this.$refs.drawerTree
|
|
2019
|
-
if (drawerTree){
|
|
2020
|
-
|
|
2021
|
-
item
|
|
2022
|
-
|
|
2023
|
-
|
|
1963
|
+
if (drawerTree) {
|
|
1964
|
+
if (Array.isArray(drawerTree)) {
|
|
1965
|
+
drawerTree.forEach(item => {
|
|
1966
|
+
item.$refs.dataTree.setCheckedNodes(arr);
|
|
1967
|
+
item.checked = this.extInfoFieldValue[field.fieldId] && this.extInfoFieldValue[field.fieldId][0] ? this.extInfoFieldValue[field.fieldId][0].value : '';
|
|
1968
|
+
})
|
|
1969
|
+
} else {
|
|
1970
|
+
drawerTree.$refs.dataTree.setCheckedNodes(arr);
|
|
1971
|
+
drawerTree.checked = this.extInfoFieldValue[field.fieldId] && this.extInfoFieldValue[field.fieldId][0] ? this.extInfoFieldValue[field.fieldId][0].value : '';
|
|
1972
|
+
}
|
|
2024
1973
|
}
|
|
2025
|
-
|
|
2026
1974
|
})
|
|
2027
1975
|
}
|
|
2028
1976
|
else if (type === 'select'){
|
|
@@ -2043,7 +1991,7 @@ export default {
|
|
|
2043
1991
|
//保存级联数据
|
|
2044
1992
|
saveData(checkList,checkDatas){
|
|
2045
1993
|
this.$set(this.detailField,'value',checkList);
|
|
2046
|
-
this.
|
|
1994
|
+
this.extInfoFieldValue[this.detailField.fieldId] = checkDatas;
|
|
2047
1995
|
this.$set(this.detailField.formField.extInfo,'extInfoFieldValue',checkDatas);
|
|
2048
1996
|
console.debug('checkDatas',this.detailField.formField.extInfo,checkList)
|
|
2049
1997
|
this.$forceUpdate();
|
|
@@ -2064,22 +2012,18 @@ export default {
|
|
|
2064
2012
|
this.refShowPicker = false;
|
|
2065
2013
|
return
|
|
2066
2014
|
}
|
|
2067
|
-
if (!this.detailField.formField.extInfo.extInfoFieldValue){
|
|
2068
|
-
this.$set(this.detailField.formField.extInfo,'extInfoFieldValue',[])
|
|
2069
|
-
}
|
|
2070
2015
|
this.detailField.value = list;
|
|
2071
2016
|
let val = ''
|
|
2072
2017
|
if (Array.isArray(option)){
|
|
2073
2018
|
val = option.map(item=>{
|
|
2074
|
-
return item.
|
|
2019
|
+
return item.id
|
|
2075
2020
|
})
|
|
2076
|
-
this.detailField.
|
|
2021
|
+
this.extInfoFieldValue[this.detailField.fieldId] = option
|
|
2077
2022
|
}
|
|
2078
2023
|
else {
|
|
2079
|
-
val = option.
|
|
2080
|
-
this.detailField.
|
|
2024
|
+
val = option.id
|
|
2025
|
+
this.extInfoFieldValue[this.detailField.fieldId] = [option]
|
|
2081
2026
|
}
|
|
2082
|
-
this.selectValues[this.detailField.fieldId] = val;
|
|
2083
2027
|
this.refShowPicker = false;
|
|
2084
2028
|
},
|
|
2085
2029
|
// 一个重复的方法 兼容 状态优先级 的关联控件,
|
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 {
|
package/src/components/tree.vue
CHANGED
|
@@ -31,7 +31,10 @@ export default {
|
|
|
31
31
|
name: "tree",
|
|
32
32
|
data(){
|
|
33
33
|
return{
|
|
34
|
-
defaultProps:{
|
|
34
|
+
defaultProps:{
|
|
35
|
+
label:"label",
|
|
36
|
+
value:"value"
|
|
37
|
+
},
|
|
35
38
|
checked:'',
|
|
36
39
|
dataTree:[],
|
|
37
40
|
checkList:[],
|
|
@@ -96,6 +99,7 @@ export default {
|
|
|
96
99
|
else if (this.dataOptions.extInfo.cascadeDown && this.dataOptions.extInfo.cascadeDown[0]){
|
|
97
100
|
this.dataTree = this.dataOptions.extInfo.cascadeDown[0].options
|
|
98
101
|
}
|
|
102
|
+
console.debug('dataTree',this.dataOptions,this.dataTree)
|
|
99
103
|
}
|
|
100
104
|
};
|
|
101
105
|
</script>
|
|
@@ -119,9 +123,11 @@ export default {
|
|
|
119
123
|
padding-bottom: 30px;
|
|
120
124
|
.primary{
|
|
121
125
|
color: #366aff;
|
|
126
|
+
cursor: pointer;
|
|
122
127
|
}
|
|
123
128
|
.cacel{
|
|
124
129
|
color: #969799;
|
|
130
|
+
cursor: pointer;
|
|
125
131
|
}
|
|
126
132
|
}
|
|
127
133
|
.tree-container{
|