vue2-client 1.7.10-test → 1.7.11
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 +3 -3
- package/src/base-client/components/common/CreateQuery/CreateQuery.vue +1 -1
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +59 -4
- package/src/base-client/components/common/XForm/XForm.vue +24 -0
- package/src/base-client/components/common/XFormTable/XFormTable.vue +9 -8
- package/src/base-client/components/common/XTable/XTable.vue +3 -1
- package/src/config/CreateQueryConfig.js +1 -1
- package/vue.config.js +3 -3
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue2-client",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
|
-
"serve": "vue-cli-service serve",
|
|
7
|
-
"build": "vue-cli-service build",
|
|
6
|
+
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
|
|
7
|
+
"build": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build",
|
|
8
8
|
"test:unit": "vue-cli-service test:unit",
|
|
9
9
|
"lint": "vue-cli-service lint",
|
|
10
10
|
"build:preview": "vue-cli-service build --mode preview",
|
|
@@ -19,6 +19,20 @@
|
|
|
19
19
|
:get-data-params="getDataParams"
|
|
20
20
|
/>
|
|
21
21
|
</a-row>
|
|
22
|
+
<a-row :gutter="16" v-for="(groupItem, groupIndex) in groupJsonData" :key="groupIndex">
|
|
23
|
+
<x-form-item
|
|
24
|
+
v-for="(item, index) in groupItem.groupItems"
|
|
25
|
+
:key="index"
|
|
26
|
+
:attr="item"
|
|
27
|
+
:disabled="itemDisabled(item)"
|
|
28
|
+
:files="files"
|
|
29
|
+
:form="form[groupItem.model]"
|
|
30
|
+
:images="images"
|
|
31
|
+
:service-name="serviceName"
|
|
32
|
+
mode="新增/修改"
|
|
33
|
+
:get-data-params="getDataParams"
|
|
34
|
+
/>
|
|
35
|
+
</a-row>
|
|
22
36
|
<a-row :gutter="16" v-for="(item, key) in simpleFormJsonData" :key="'row' + key">
|
|
23
37
|
<a-card :title="item.name" :bordered="false" size="small">
|
|
24
38
|
<x-form-item
|
|
@@ -93,6 +107,22 @@ export default {
|
|
|
93
107
|
return item.addOrEdit && item.addOrEdit !== 'no' && item.addOrEdit !== 'silenceAdd' && item.addOrEdit !== 'version' && !this.itemDisabled(item)
|
|
94
108
|
})
|
|
95
109
|
},
|
|
110
|
+
// 过滤出用于新增/修改场景的表单项
|
|
111
|
+
groupJsonData: function () {
|
|
112
|
+
return this.formItems.filter((item) => {
|
|
113
|
+
return item.type === 'group'
|
|
114
|
+
}).map((item) => {
|
|
115
|
+
item.groupItems = item.groupItems.filter((item) => {
|
|
116
|
+
return item.addOrEdit && item.addOrEdit !== 'no' && item.addOrEdit !== 'silenceAdd' && item.addOrEdit !== 'version' && !this.itemDisabled(item)
|
|
117
|
+
}).map((groupItem) => {
|
|
118
|
+
// 只保留第一个下划线后面的内容
|
|
119
|
+
groupItem.model = groupItem.model.substring(groupItem.model.indexOf('_') + 1)
|
|
120
|
+
return groupItem
|
|
121
|
+
})
|
|
122
|
+
return item
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
},
|
|
96
126
|
// 过滤出用于静默新增场景的表单项
|
|
97
127
|
silenceAddJsonData: function () {
|
|
98
128
|
return this.formItems.filter(function (item) {
|
|
@@ -132,6 +162,15 @@ export default {
|
|
|
132
162
|
const item = this.realJsonData[i]
|
|
133
163
|
this.setFormProps(formData, item)
|
|
134
164
|
}
|
|
165
|
+
// 设置表单分组项目相关参数
|
|
166
|
+
for (let i = 0; i < this.groupJsonData.length; i++) {
|
|
167
|
+
const groupItem = this.groupJsonData[i]
|
|
168
|
+
formData[groupItem.model] = {}
|
|
169
|
+
for (let j = 0; j < groupItem.groupItems.length; j++) {
|
|
170
|
+
const item = groupItem.groupItems[j]
|
|
171
|
+
this.setFormProps(formData[groupItem.model], item)
|
|
172
|
+
}
|
|
173
|
+
}
|
|
135
174
|
// 设置动态简易表单项的相关参数
|
|
136
175
|
for (const key in this.simpleFormJsonData) {
|
|
137
176
|
for (const item of this.simpleFormJsonData[key].value) {
|
|
@@ -234,10 +273,6 @@ export default {
|
|
|
234
273
|
if (!valid) {
|
|
235
274
|
return false
|
|
236
275
|
}
|
|
237
|
-
if (this.viewMode) {
|
|
238
|
-
this.$message.info('预览模式禁止新增和修改')
|
|
239
|
-
return false
|
|
240
|
-
}
|
|
241
276
|
this.loading = true
|
|
242
277
|
for (const key of Object.keys(this.form)) {
|
|
243
278
|
if (this.form[key] === null || this.form[key] === '') {
|
|
@@ -293,6 +328,16 @@ export default {
|
|
|
293
328
|
realForm[realKey] = value
|
|
294
329
|
}
|
|
295
330
|
}
|
|
331
|
+
if (this.viewMode) {
|
|
332
|
+
this.$message.info('预览模式禁止新增和修改')
|
|
333
|
+
console.log({
|
|
334
|
+
businessType: this.businessType,
|
|
335
|
+
serviceName: this.serviceName,
|
|
336
|
+
realForm: realForm,
|
|
337
|
+
currUserName: this.currUser.name
|
|
338
|
+
})
|
|
339
|
+
return false
|
|
340
|
+
}
|
|
296
341
|
// 交由父级处理
|
|
297
342
|
this.$emit('onSubmit', {
|
|
298
343
|
businessType: this.businessType,
|
|
@@ -347,6 +392,16 @@ export default {
|
|
|
347
392
|
this.form[item.model] = undefined
|
|
348
393
|
}
|
|
349
394
|
}
|
|
395
|
+
// 对分组表单进行处理
|
|
396
|
+
for (let i = 0; i < this.groupJsonData.length; i++) {
|
|
397
|
+
const item = this.groupJsonData[i]
|
|
398
|
+
try {
|
|
399
|
+
if (modifyModelData.data[item.model]) {
|
|
400
|
+
this.form[item.model] = JSON.parse(modifyModelData.data[item.model])
|
|
401
|
+
}
|
|
402
|
+
} catch (e) {
|
|
403
|
+
}
|
|
404
|
+
}
|
|
350
405
|
// 追加版本号信息
|
|
351
406
|
for (const item of this.versionJsonData) {
|
|
352
407
|
if (!modifyModelData.data[item.model]) {
|
|
@@ -15,6 +15,16 @@
|
|
|
15
15
|
:service-name="serviceName"
|
|
16
16
|
:get-data-params="getDataParams"
|
|
17
17
|
/>
|
|
18
|
+
<div v-for="(groupItem, groupIndex) in groupJsonData" :key="groupIndex">
|
|
19
|
+
<x-form-item
|
|
20
|
+
v-for="(item, index) in groupItem.groupItems"
|
|
21
|
+
:key="index"
|
|
22
|
+
:attr="item"
|
|
23
|
+
:form="form"
|
|
24
|
+
:service-name="serviceName"
|
|
25
|
+
:get-data-params="getDataParams"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
18
28
|
<div v-show="advanced">
|
|
19
29
|
<x-form-item
|
|
20
30
|
v-for="(item, index) in realJsonData.slice(6)"
|
|
@@ -87,6 +97,20 @@ export default {
|
|
|
87
97
|
realJsonData: function () {
|
|
88
98
|
return this.formItems.filter(item => !item.isOnlyAddOrEdit)
|
|
89
99
|
},
|
|
100
|
+
// 过滤出用于新增/修改场景的表单项
|
|
101
|
+
groupJsonData: function () {
|
|
102
|
+
return this.formItems.filter((item) => {
|
|
103
|
+
return item.type === 'group'
|
|
104
|
+
}).map((item) => {
|
|
105
|
+
item.groupItems = item.groupItems.filter(item => !item.isOnlyAddOrEdit).map((groupItem) => {
|
|
106
|
+
// 只保留第一个下划线后面的内容
|
|
107
|
+
groupItem.model = groupItem.model.substring(groupItem.model.indexOf('_') + 1)
|
|
108
|
+
return groupItem
|
|
109
|
+
})
|
|
110
|
+
return item
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
},
|
|
90
114
|
},
|
|
91
115
|
methods: {
|
|
92
116
|
init (params) {
|
|
@@ -147,14 +147,6 @@ export default {
|
|
|
147
147
|
},
|
|
148
148
|
deep: true
|
|
149
149
|
},
|
|
150
|
-
fixedQueryForm: {
|
|
151
|
-
handler () {
|
|
152
|
-
this.$nextTick(() => {
|
|
153
|
-
this.refreshTable(true)
|
|
154
|
-
})
|
|
155
|
-
},
|
|
156
|
-
deep: true
|
|
157
|
-
},
|
|
158
150
|
queryParamsJson: {
|
|
159
151
|
handler () {
|
|
160
152
|
this.getConfigBySource()
|
|
@@ -343,6 +335,15 @@ export default {
|
|
|
343
335
|
refreshTable (toFirstPage = true) {
|
|
344
336
|
this.$refs.xTable.refresh(toFirstPage)
|
|
345
337
|
},
|
|
338
|
+
/**
|
|
339
|
+
* 设置固定查询表单
|
|
340
|
+
*/
|
|
341
|
+
setFixedQueryForm (form, isRefreshTable) {
|
|
342
|
+
this.fixedQueryForm = form
|
|
343
|
+
if (isRefreshTable) {
|
|
344
|
+
this.refreshTable(true)
|
|
345
|
+
}
|
|
346
|
+
}
|
|
346
347
|
}
|
|
347
348
|
}
|
|
348
349
|
</script>
|
|
@@ -129,7 +129,9 @@ export default {
|
|
|
129
129
|
// 取到表格携带的表单参数
|
|
130
130
|
const requestParameters = Object.assign({}, parameter)
|
|
131
131
|
// 取到父组件传入的表单参数
|
|
132
|
-
const conditionParams =
|
|
132
|
+
const conditionParams = {}
|
|
133
|
+
Object.assign(conditionParams, this.fixedQueryForm)
|
|
134
|
+
Object.assign(conditionParams, this.form)
|
|
133
135
|
// 如果传了燃气公司字段,则进行数据处理
|
|
134
136
|
if (conditionParams.orgName) {
|
|
135
137
|
requestParameters.orgName = conditionParams.orgName
|
package/vue.config.js
CHANGED
|
@@ -8,9 +8,9 @@ const CompressionWebpackPlugin = require('compression-webpack-plugin')
|
|
|
8
8
|
const productionGzipExtensions = ['js', 'css']
|
|
9
9
|
const isProd = process.env.NODE_ENV === 'production'
|
|
10
10
|
|
|
11
|
-
const server = 'http://
|
|
11
|
+
const server = 'http://61.134.55.234:8405'
|
|
12
12
|
// const local = 'http://localhost:8445/webmeter'
|
|
13
|
-
const local = 'http://
|
|
13
|
+
const local = 'http://61.134.55.234:8456/webmeter'
|
|
14
14
|
// const local = 'http://localhost:8080'
|
|
15
15
|
|
|
16
16
|
module.exports = {
|
|
@@ -30,7 +30,7 @@ module.exports = {
|
|
|
30
30
|
changeOrigin: true
|
|
31
31
|
},
|
|
32
32
|
'/api': {
|
|
33
|
-
pathRewrite: { '^/api/af-system/': '/rs/' },
|
|
33
|
+
pathRewrite: { '^/api/af-system/': '/rs/', '^/api/af-iot/': '/rs/' },
|
|
34
34
|
// pathRewrite: { '^/api': '/' },
|
|
35
35
|
target: local,
|
|
36
36
|
changeOrigin: true
|