vue2-client 1.2.54 → 1.2.55-test2

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.
@@ -220,7 +220,7 @@
220
220
  <a-divider style="font-size: 14px;margin-top: 0">数据源相关</a-divider>
221
221
  <a-form-model-item label="数据源类型" prop="selectType">
222
222
  <a-select v-model="item.selectType" placeholder="请选择数据源类型" @change="changeSelectKType">
223
- <a-select-option v-for="selectDataTypeItem in selectDataType" :key="selectDataTypeItem.key">{{ selectDataTypeItem.label }}</a-select-option>
223
+ <a-select-option v-for="selectDataTypeItem in selectDataType.filter(h=>!h.noMatch.includes(item.formType))" :key="selectDataTypeItem.key">{{ selectDataTypeItem.label }}</a-select-option>
224
224
  <a-popover
225
225
  slot="suffixIcon"
226
226
  placement="bottom"
@@ -358,7 +358,7 @@ import {
358
358
  addOrEditType,
359
359
  selectDataType
360
360
  } from '@vue2-client/config/CreateQueryConfig'
361
- import { commonApi, post } from '@/services/api'
361
+ import { commonApi, post } from '@vue2-client/services/api'
362
362
  import JsonViewer from 'vue-json-viewer'
363
363
 
364
364
  const DemoJson = [{
@@ -50,11 +50,26 @@ export default {
50
50
  default: () => {
51
51
  return {}
52
52
  }
53
+ },
54
+ files: {
55
+ type: Array,
56
+ default: () => {
57
+ return []
58
+ }
59
+ },
60
+ images: {
61
+ type: Array,
62
+ default: () => {
63
+ return []
64
+ }
53
65
  }
54
66
  },
55
67
  computed: {
56
68
  ...mapState('account', { currUser: 'user' })
57
69
  },
70
+ created () {
71
+ this.uploadedFileList = this.mode.type === 'file' ? [...this.files] : [...this.images]
72
+ },
58
73
  methods: {
59
74
  uploadFiles (info) {
60
75
  // 初始化文件信息
@@ -78,16 +93,17 @@ export default {
78
93
  formData.append('pathKey', this.model.pathKey)
79
94
  }
80
95
  formData.append('stockAlias', this.model.stockAlias)
96
+ formData.append('formType', this.model.type)
81
97
  formData.append('resUploadStock', this.model.resUploadStock)
82
98
  formData.append('filename', info.file.name)
83
99
  formData.append('filesize', (info.file.size / 1024 / 1024).toFixed(4))
84
100
  formData.append('f_operator', this.currUser.username)
85
101
 
86
- let url = '/webmeteruploadapi/upload'
87
- if (process.env.NODE_ENV === 'production') {
88
- url = `/${this.model.stockAlias}/webmeteruploadapi/upload`
89
- }
90
- post(url, formData, { headers }).then(res => {
102
+ // const url = '/webmeteruploadapi/resource'
103
+ // if (process.env.NODE_ENV === 'production') {
104
+ // url = `/${this.model.stockAlias}/webmeteruploadapi/resource`
105
+ // }
106
+ post('/webmeterresourceapi/upload', formData, { headers }).then(res => {
91
107
  // 根据服务端返回的结果判断成功与否,设置文件条目的状态
92
108
  if (res.success) {
93
109
  fileInfo.status = 'done'
@@ -20,6 +20,8 @@
20
20
  v-for="(item, index) in realJsonData"
21
21
  mode="新增/修改"
22
22
  :attr="item"
23
+ :files="files"
24
+ :images="images"
23
25
  :form="form"
24
26
  :key="index"
25
27
  :disabled="itemDisabled(item)"
@@ -54,6 +56,9 @@ export default {
54
56
  SelectsArray: { },
55
57
  // 多层下拉框组 各组数量
56
58
  SelectsNumber: {},
59
+ // 修改有文件得表单是使用
60
+ files: [],
61
+ images: [],
57
62
  // 校验
58
63
  rules: {},
59
64
  // 图标样式
@@ -252,6 +257,9 @@ export default {
252
257
  }
253
258
  }
254
259
  this.form = formData
260
+ this.files = this.modifyModelData.files
261
+ this.images = this.modifyModelData.images
262
+ this.modifyModelData = this.modifyModelData.data
255
263
  if (Object.keys(this.modifyModelData).length > 0) {
256
264
  this.getModifyModelData()
257
265
  }
@@ -204,7 +204,7 @@
204
204
  :xs="24"
205
205
  :xxl="24">
206
206
  <a-form-model-item :ref="attr.model" :label="attr.name" :prop="attr.model">
207
- <upload :model="attr" @setFiles="setFiles"></upload>
207
+ <upload :model="attr" @setFiles="setFiles" :files="files" :images="images"></upload>
208
208
  </a-form-model-item>
209
209
  </x-form-col>
210
210
  <!-- TODO 地点搜索框 -->
@@ -235,11 +235,9 @@
235
235
 
236
236
  import { post } from '@vue2-client/services/api'
237
237
  import { debounce } from 'ant-design-vue/lib/vc-table/src/utils'
238
- import AddressSearchCombobox from '@/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox'
239
238
 
240
239
  export default {
241
240
  name: 'XFormItem',
242
- components: { AddressSearchCombobox },
243
241
  data () {
244
242
  // 检索去抖
245
243
  this.fetchFunction = debounce(this.fetchFunction, 800)
@@ -288,7 +286,19 @@ export default {
288
286
  default: () => {
289
287
  return {}
290
288
  }
291
- }
289
+ },
290
+ files: {
291
+ type: Array,
292
+ default: () => {
293
+ return []
294
+ }
295
+ },
296
+ images: {
297
+ type: Array,
298
+ default: () => {
299
+ return []
300
+ }
301
+ },
292
302
  },
293
303
  created () {
294
304
  if (this.attr.keyName && this.attr.keyName.indexOf('logic@') !== -1) {