askbot-dragon 0.7.93 → 0.7.94

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.
@@ -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-else-if="item.formField.type==='INPUT'&&item.fieldId!=='workorder_name'"
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="fieldValus[item.fieldId]"
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'"
@@ -229,18 +229,21 @@
229
229
  filterable
230
230
  :multiple="item.formField.extInfo && item.formField.extInfo.selectType == '多选'"
231
231
  @visible-change="(visible) =>{ return refTemplateVisibleChange(visible,item) }"
232
+ collapse-tags
233
+ @change="changeRefData($event,item)"
232
234
  >
233
235
  <template v-for="(items,index) in refTemplateList[item.fieldId]">
234
236
  <el-option
235
237
  v-if="refTemplateList[item.fieldId]"
236
238
  :key="index"
237
- :label="items.label"
238
- :value="items.value">
239
+ :label="items.name"
240
+ :value="items.id">
239
241
  </el-option>
240
242
  </template>
241
243
  <div
242
244
  @click="lodeMore(item)"
243
- style="widht:100%;height:30px;display:flex;align-items: center;justify-content: center;color:#606266">
245
+ v-if="dataQuery[item.fieldId] && dataQuery[item.fieldId].hasNextPage"
246
+ style="width:100%;height:30px;display:flex;align-items: center;justify-content: center;color:#606266">
244
247
  加载更多
245
248
  </div>
246
249
  </el-select>
@@ -500,11 +503,11 @@
500
503
  />
501
504
  <van-popup v-model="refShowPicker" position="bottom" :style="{ height: '300px' }">
502
505
  <select-popup
503
- :options="refTemplateList[item.fieldId]"
504
- :defaultValue="defaultValue"
506
+ :options="refTemplateList[selectDetail.fieldId]"
507
+ :defaultValue="refDefaultValue[selectDetail.fieldId]"
505
508
  @onConfim="confirmRefSelect"
506
509
  @onclose= "refShowPicker = false"
507
- :multiple="detailField.formField.extInfo && detailField.formField.extInfo.selectType ==='多选'?true:false"
510
+ :multiple="selectDetail.formField && selectDetail.formField.extInfo && selectDetail.formField.extInfo.selectType ==='多选'?true:false"
508
511
  ref="selectPopup"
509
512
  :props="{
510
513
  value:'id',
@@ -730,7 +733,8 @@ export default {
730
733
  options:[],
731
734
  defaultValue:[],
732
735
  timeDetailData:{},
733
- selectDetail:{}
736
+ selectDetail:{},
737
+ refDefaultValue:{}
734
738
  }
735
739
  },
736
740
  props: {
@@ -1148,8 +1152,11 @@ export default {
1148
1152
  }
1149
1153
 
1150
1154
  }
1151
- if (type ==='FILE'){
1152
- if (this.formList.form.formFieldRelation[i].value!==undefined){
1155
+ if (type ==='FILE' || type == 'ATTACHMENT' || type == 'IMAGE' || type == 'VIDEO'){
1156
+ if (this.formList.form.formFieldRelation[i].formField.extInfo.extInfoFieldValue){
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){
1153
1160
  if (this.formList.form.formFieldRelation[i].value===null||this.formList.form.formFieldRelation[i].value===''){
1154
1161
  this.formList.form.formFieldRelation[i].value=[]
1155
1162
  }
@@ -1177,16 +1184,25 @@ export default {
1177
1184
  }
1178
1185
  }
1179
1186
  }
1180
-
1181
-
1182
-
1187
+ }
1188
+ if (type === 'REF' || type === 'REF_TEMPLATE'){
1189
+ if (this.formList.form.formFieldRelation[i].formField.extInfo.extInfoFieldValue){
1190
+ let name = this.formList.form.formFieldRelation[i].formField.extInfo.extInfoFieldValue.map(item=>{
1191
+ return item.name
1192
+ })
1193
+ this.selectValues[this.formList.form.formFieldRelation[i].fieldId] = name
1194
+ }
1183
1195
  }
1184
1196
  }
1185
1197
  for (let i = 0; i < this.formList.form.formFieldRelation.length; i++) {
1186
1198
  let type = this.formList.form.formFieldRelation[i].formField.type
1187
1199
  let extInfo = this.formList.form.formFieldRelation[i].formField.extInfo
1188
1200
  if (type === 'CASCADER') {
1189
- let fieldValue = this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue?this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue:[]
1201
+ let fieldValue = this.formList.form.formFieldRelation[i].formField.extInfo.extInfoFieldValue?
1202
+ this.formList.form.formFieldRelation[i].formField.extInfo.extInfoFieldValue:
1203
+ (this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue?
1204
+ this.formList.form.formFieldRelation[i].formField.extInfo.fieldValue:[])
1205
+
1190
1206
  this.checkDatas[this.formList.form.formFieldRelation[i].fieldId] = fieldValue
1191
1207
  if (this.formList.form.formFieldRelation[i].value){
1192
1208
  this.formList.form.formFieldRelation[i].value = this.formList.form.formFieldRelation[i].formField.defaultValue?
@@ -1305,6 +1321,7 @@ export default {
1305
1321
  this.isPhone=this.propIsPhone;
1306
1322
  this.isCompany=this.propIsCompany;
1307
1323
  }
1324
+
1308
1325
  },
1309
1326
  //时间的选择器
1310
1327
  onConfirm(value, id,item,type) {
@@ -1426,7 +1443,7 @@ export default {
1426
1443
  }
1427
1444
  })
1428
1445
  }
1429
- if (this.fileListList[this.formShow.form.formFieldRelation[i].fieldId]!== undefined) {
1446
+ if (this.fileListList[this.formShow.form.formFieldRelation[i].fieldId]) {
1430
1447
  let value=[]
1431
1448
  this.fileListList[this.formShow.form.formFieldRelation[i].fieldId].forEach(item=>{
1432
1449
  let file = {}
@@ -1434,7 +1451,10 @@ export default {
1434
1451
  file.url = item.url
1435
1452
  value.push(file)
1436
1453
  })
1437
- this.formShow.form.formFieldRelation[i].value=value
1454
+ this.formShow.form.formFieldRelation[i].value = value.map(item=>{
1455
+ return item.name
1456
+ })
1457
+ this.formShow.form.formFieldRelation[i].formField.extInfo.extInfoFieldValue = value
1438
1458
  }
1439
1459
  if(this.formShow.form.formFieldRelation[i].display &&
1440
1460
  (this.formShow.form.formFieldRelation[i].required || this.isRequiredFn(this.formShow.form.formFieldRelation[i].formField)) &&
@@ -1488,11 +1508,12 @@ export default {
1488
1508
  },
1489
1509
  //下拉的点击事件
1490
1510
  selectClick(id,type,item) {
1491
- console.debug('111')
1511
+ console.debug('111',item)
1492
1512
  if (this.disableds){
1493
1513
  return
1494
1514
  }
1495
- this.selectDetail = item
1515
+ this.selectDetail = item;
1516
+ this.defaultValue = ''
1496
1517
  if(type == 'client') {
1497
1518
  let selectOption
1498
1519
  this.selectValue=[]
@@ -1511,7 +1532,9 @@ export default {
1511
1532
  this.selectId = id
1512
1533
  this.showPicker = true
1513
1534
  } else if (type == 'ref'){
1514
- this.refShowPicker = true
1535
+ this.refShowPicker = true;
1536
+ this.refTemplateVisibleChange(true,item);
1537
+ this.refDefaultValue[item.fieldId] = item.value?[item.value]:[]
1515
1538
  } else if (type == 'select'){
1516
1539
  this.selectPicker = true;
1517
1540
  }
@@ -1867,6 +1890,7 @@ export default {
1867
1890
  this.videoUploadPercent = file.percentage.toFixed(0);
1868
1891
  },
1869
1892
  refTemplateVisibleChange(visible,field) {
1893
+ console.debug('field1111',field)
1870
1894
  let fields = field.formField.type === 'REF' ? field.formField.extInfo.ref.field : field.formField.extInfo.ref.vars
1871
1895
  if (visible) {
1872
1896
  if (
@@ -1887,6 +1911,37 @@ export default {
1887
1911
  }
1888
1912
  }
1889
1913
  },
1914
+ changeRefData(value, item) {
1915
+ console.log(value);
1916
+ console.debug('value', value, item, this.refTemplateList[item.fieldId])
1917
+ let arr = []
1918
+ if (this.refTemplateList[item.fieldId]) {
1919
+ this.refTemplateList[item.fieldId].forEach(data => {
1920
+ if(typeof value == 'string' || typeof value == 'number') {
1921
+ if(value == data.id) {
1922
+ let obj = {
1923
+ name: data.name,
1924
+ id: data.id
1925
+ }
1926
+ arr.push(data)
1927
+ }
1928
+ } else {
1929
+ if (value.indexOf(data.id) !== -1) {
1930
+ let obj = {
1931
+ name: data.name,
1932
+ id: data.id
1933
+ }
1934
+ arr.push(data)
1935
+ }
1936
+ }
1937
+ })
1938
+ }
1939
+ if (!item.formField.extInfo.extInfoFieldValue){
1940
+ this.$set(item.formField.extInfo,'extInfoFieldValue',[])
1941
+ }
1942
+ item.formField.extInfo.extInfoFieldValue = arr
1943
+ console.log(arr,item);
1944
+ },
1890
1945
  getTemplateList(templateId, fieldId, field) {
1891
1946
  let url = '/order-api/data-template/data/page'
1892
1947
  this.dataQuery[field.fieldId].templateId = templateId
@@ -1936,7 +1991,9 @@ export default {
1936
1991
  ...this.refTemplateList[field.fieldId],
1937
1992
  ...templateList
1938
1993
  ])
1994
+ console.log('refTemplateList',this.refTemplateList[field.fieldId])
1939
1995
  })
1996
+
1940
1997
  }
1941
1998
  })
1942
1999
  },
@@ -1987,7 +2044,8 @@ export default {
1987
2044
  saveData(checkList,checkDatas){
1988
2045
  this.$set(this.detailField,'value',checkList);
1989
2046
  this.checkDatas[this.detailField.fieldId] = checkDatas;
1990
- this.$set(this.detailField.formField.extInfo,'fieldValue',this.checkDatas)
2047
+ this.$set(this.detailField.formField.extInfo,'extInfoFieldValue',checkDatas);
2048
+ console.debug('checkDatas',this.detailField.formField.extInfo,checkList)
1991
2049
  this.$forceUpdate();
1992
2050
  this.showArea = false;
1993
2051
  this.drawer = false;
@@ -2006,11 +2064,22 @@ export default {
2006
2064
  this.refShowPicker = false;
2007
2065
  return
2008
2066
  }
2067
+ if (!this.detailField.formField.extInfo.extInfoFieldValue){
2068
+ this.$set(this.detailField.formField.extInfo,'extInfoFieldValue',[])
2069
+ }
2009
2070
  this.detailField.value = list;
2010
- let val = option?option.map(item=>{
2011
- return item.name
2012
- }):[]
2013
- this.selectValue[this.detailField.fieldId] = val;
2071
+ let val = ''
2072
+ if (Array.isArray(option)){
2073
+ val = option.map(item=>{
2074
+ return item.name
2075
+ })
2076
+ this.detailField.formField.extInfo.extInfoFieldValue = option
2077
+ }
2078
+ else {
2079
+ val = option.name
2080
+ this.detailField.formField.extInfo.extInfoFieldValue = [option]
2081
+ }
2082
+ this.selectValues[this.detailField.fieldId] = val;
2014
2083
  this.refShowPicker = false;
2015
2084
  },
2016
2085
  // 一个重复的方法 兼容 状态优先级 的关联控件,
@@ -95,10 +95,45 @@ export default {
95
95
  watch: {
96
96
  defaultValue: {
97
97
  handler(value) {
98
- if (!value) {
99
- // 定位当前位置
100
- /* this.options.forEach(item => {})*/
98
+ console.log(value,'=====');
99
+ this.checkOptions = []
100
+ if(Array.isArray(this.defaultValue)) {
101
+ if (this.multiple){
102
+ let val = []
103
+ this.defaultValue.forEach(item=>{
104
+ item.forEach(items=>{
105
+ val.push(items)
106
+ })
107
+ })
108
+ this.checkIdList = [...val]
109
+ }
110
+ else {
111
+ this.checkIdList = [...this.defaultValue]
112
+ }
113
+
114
+ this.checkIdList.forEach(item =>{
115
+ if (Array.isArray(item)){
116
+ item.forEach(items=>{
117
+
118
+ this.options.forEach(res =>{
119
+ console.debug('items',items,res[this.props.value])
120
+ if(items == res[this.props.value]) {
121
+ this.checkOptions.push(res)
122
+ }
123
+ })
124
+ })
125
+ }
126
+ else {
127
+ this.options.forEach(res =>{
128
+ if(item == res[this.props.value]) {
129
+ this.checkOptions.push(res)
130
+ }
131
+ })
132
+ }
133
+
134
+ })
101
135
  }
136
+ console.debug('checkOptions',this.checkOptions)
102
137
  },
103
138
  deep: true,
104
139
  immediate: true
@@ -126,15 +161,21 @@ export default {
126
161
  this.checkOptions = []
127
162
  this.checkIdList = []
128
163
  }
129
- }
164
+ },
130
165
  },
131
-
166
+ mounted() {
167
+ console.debug('options',this.options)
168
+
169
+ }
132
170
  }
133
171
  </script>
134
172
 
135
173
  <style lang="less" scoped>
136
174
  .popup-content {
137
175
  /*padding-top: 8px;*/
176
+ height: 240px;
177
+ overflow-y: scroll;
178
+ overflow-x: hidden;
138
179
  .filter-item {
139
180
  width: 100%;
140
181
  display: flex;
@@ -51,19 +51,23 @@ export default {
51
51
  },
52
52
  ergodicData(list){
53
53
  list.forEach(item=>{
54
- if (item.checked){
55
- let data = this.$refs.dataTree.getNode(item)
56
- let checkList = []
57
- let arr = this.serchParent(data,checkList)
58
- this.checkList.push(arr)
59
- this.checkDatas.push(item)
54
+ if (this.dataOptions.extInfo.selectType === '多选'){
55
+ if (item.checked){
56
+ let data = this.$refs.dataTree.getNode(item)
57
+ let checkList = []
58
+ let arr = this.serchParent(data,checkList)
59
+ this.checkList.push(arr)
60
+ this.checkDatas.push(item)
61
+ }
60
62
  }
61
- if (item.value === this.checked){
62
- let data = this.$refs.dataTree.getNode(item)
63
- let checkList = []
64
- let arr = this.serchParent(data,checkList)
65
- this.checkList = arr
66
- this.checkDatas = [item]
63
+ else {
64
+ if (item.value === this.checked){
65
+ let data = this.$refs.dataTree.getNode(item)
66
+ let checkList = []
67
+ let arr = this.serchParent(data,checkList)
68
+ this.checkList = arr
69
+ this.checkDatas = [item]
70
+ }
67
71
  }
68
72
  if (item.children){
69
73
  this.ergodicData(item.children)