vue2-client 1.2.55-test → 1.2.55-test3
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/base-client/components/common/Upload/Upload.vue +18 -2
- package/src/base-client/components/common/XAddForm/XAddForm.vue +12 -5
- package/src/base-client/components/common/XForm/XFormItem.vue +358 -346
- package/src/base-client/components/common/XFormTable/XFormTable.vue +483 -482
- package/src/services/api/common.js +56 -47
- package/vue.config.js +2 -2
package/package.json
CHANGED
|
@@ -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.model.type === 'file' ? [...this.files] : [...this.images]
|
|
72
|
+
},
|
|
58
73
|
methods: {
|
|
59
74
|
uploadFiles (info) {
|
|
60
75
|
// 初始化文件信息
|
|
@@ -77,7 +92,8 @@ export default {
|
|
|
77
92
|
if (this.model.pathKey) {
|
|
78
93
|
formData.append('pathKey', this.model.pathKey)
|
|
79
94
|
}
|
|
80
|
-
formData.append('stockAlias', this.model.stockAlias)
|
|
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))
|
|
@@ -87,7 +103,7 @@ export default {
|
|
|
87
103
|
// if (process.env.NODE_ENV === 'production') {
|
|
88
104
|
// url = `/${this.model.stockAlias}/webmeteruploadapi/resource`
|
|
89
105
|
// }
|
|
90
|
-
post('/webmeterresourceapi/
|
|
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,7 +257,9 @@ export default {
|
|
|
252
257
|
}
|
|
253
258
|
}
|
|
254
259
|
this.form = formData
|
|
255
|
-
|
|
260
|
+
this.files = this.modifyModelData.files
|
|
261
|
+
this.images = this.modifyModelData.images
|
|
262
|
+
if (Object.keys(this.modifyModelData.data).length > 0) {
|
|
256
263
|
this.getModifyModelData()
|
|
257
264
|
}
|
|
258
265
|
},
|
|
@@ -308,18 +315,18 @@ export default {
|
|
|
308
315
|
getModifyModelData () {
|
|
309
316
|
for (let i = 0; i < this.realJsonData.length; i++) {
|
|
310
317
|
const item = this.realJsonData[i]
|
|
311
|
-
if (this.modifyModelData[item.model] || this.modifyModelData[item.model] === 0) {
|
|
312
|
-
this.form[item.model] = this.modifyModelData[item.model] + ''
|
|
318
|
+
if (this.modifyModelData.data[item.model] || this.modifyModelData.data[item.model] === 0) {
|
|
319
|
+
this.form[item.model] = this.modifyModelData.data[item.model] + ''
|
|
313
320
|
} else {
|
|
314
321
|
this.form[item.model] = undefined
|
|
315
322
|
}
|
|
316
323
|
}
|
|
317
324
|
// 追加版本号信息
|
|
318
325
|
for (const item of this.versionJsonData) {
|
|
319
|
-
if (!this.modifyModelData[item.model]) {
|
|
326
|
+
if (!this.modifyModelData.data[item.model]) {
|
|
320
327
|
this.form[item.model] = 0
|
|
321
328
|
} else {
|
|
322
|
-
this.form[item.model] = this.modifyModelData[item.model] + ''
|
|
329
|
+
this.form[item.model] = this.modifyModelData.data[item.model] + ''
|
|
323
330
|
}
|
|
324
331
|
}
|
|
325
332
|
},
|