vue2-client 1.8.71 → 1.8.73
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/CHANGELOG.md +1 -1
- package/package.json +1 -1
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +14 -5
- package/src/base-client/components/common/XForm/XForm.vue +8 -2
- package/src/base-client/components/common/XForm/XFormItem.vue +14 -4
- package/src/base-client/components/common/XFormTable/XFormTable.vue +6 -3
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -18,10 +18,11 @@
|
|
|
18
18
|
:service-name="serviceName"
|
|
19
19
|
mode="新增/修改"
|
|
20
20
|
:get-data-params="getDataParams"
|
|
21
|
+
:env="env"
|
|
21
22
|
/>
|
|
22
23
|
</a-row>
|
|
23
24
|
<a-row :gutter="16" v-for="(groupItem, groupIndex) in groupJsonData" :key="groupIndex">
|
|
24
|
-
<a-card :title="groupItem.name" :bordered="false" size="small">
|
|
25
|
+
<a-card v-if="groupItem.groupItems.length > 0" :title="groupItem.name" :bordered="false" size="small">
|
|
25
26
|
<x-form-item
|
|
26
27
|
v-for="(item, index) in groupItem.groupItems"
|
|
27
28
|
:key="index"
|
|
@@ -33,11 +34,12 @@
|
|
|
33
34
|
:service-name="serviceName"
|
|
34
35
|
mode="新增/修改"
|
|
35
36
|
:get-data-params="getDataParams"
|
|
37
|
+
:env="env"
|
|
36
38
|
/>
|
|
37
39
|
</a-card>
|
|
38
40
|
</a-row>
|
|
39
41
|
<a-row :gutter="16" v-for="(item, key) in simpleFormJsonData" :key="'row' + key">
|
|
40
|
-
<a-card :title="item.name" :bordered="false" size="small">
|
|
42
|
+
<a-card v-if="item.value.length > 0" :title="item.name" :bordered="false" size="small">
|
|
41
43
|
<x-form-item
|
|
42
44
|
v-for="(formItem, formItemIndex) in item.value"
|
|
43
45
|
:key="key + formItemIndex"
|
|
@@ -49,6 +51,7 @@
|
|
|
49
51
|
:service-name="serviceName"
|
|
50
52
|
mode="新增/修改"
|
|
51
53
|
:get-data-params="getDataParams"
|
|
54
|
+
:env="env"
|
|
52
55
|
/>
|
|
53
56
|
</a-card>
|
|
54
57
|
</a-row>
|
|
@@ -107,7 +110,9 @@ export default {
|
|
|
107
110
|
// 是否处理表单key
|
|
108
111
|
isKeyHandle: true,
|
|
109
112
|
// 动态简易表单集合
|
|
110
|
-
simpleFormJsonData: {}
|
|
113
|
+
simpleFormJsonData: {},
|
|
114
|
+
// 当前环境
|
|
115
|
+
env: 'prod'
|
|
111
116
|
}
|
|
112
117
|
},
|
|
113
118
|
computed: {
|
|
@@ -150,7 +155,10 @@ export default {
|
|
|
150
155
|
methods: {
|
|
151
156
|
init (params) {
|
|
152
157
|
const {
|
|
153
|
-
configName, configContent, formItems, viewMode, isHandleFormKey = true,
|
|
158
|
+
configName, configContent, formItems, viewMode, isHandleFormKey = true,
|
|
159
|
+
showSubmitBtn = true, serviceName, isTableTemp = false, isKeyHandle = true,
|
|
160
|
+
modifyModelData = {}, businessType, title, fixedAddForm = {}, getDataParams = {},
|
|
161
|
+
simpleFormJsonData = {}, env = 'prod'
|
|
154
162
|
} = params
|
|
155
163
|
this.loaded = false
|
|
156
164
|
this.configName = configName
|
|
@@ -168,6 +176,7 @@ export default {
|
|
|
168
176
|
this.title = title
|
|
169
177
|
this.getDataParams = getDataParams
|
|
170
178
|
this.simpleFormJsonData = simpleFormJsonData
|
|
179
|
+
this.env = env
|
|
171
180
|
this.isTableTemp = isTableTemp
|
|
172
181
|
this.isKeyHandle = isKeyHandle
|
|
173
182
|
// 设置普通表单项的相关参数
|
|
@@ -371,7 +380,7 @@ export default {
|
|
|
371
380
|
businessType: this.businessType,
|
|
372
381
|
operator: this.currUser.name
|
|
373
382
|
}
|
|
374
|
-
addOrModify(requestParameters, this.serviceName).then(data => {
|
|
383
|
+
addOrModify(requestParameters, this.serviceName, this.env === 'dev').then(data => {
|
|
375
384
|
this.$message.success(this.businessType + '成功!')
|
|
376
385
|
// commit
|
|
377
386
|
this.$emit('afterSubmit', { type: this.businessType, id: data.id, form: requestParameters.form })
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
:form="form"
|
|
15
15
|
:service-name="serviceName"
|
|
16
16
|
:get-data-params="getDataParams"
|
|
17
|
+
:env="env"
|
|
17
18
|
/>
|
|
18
19
|
<div v-for="(groupItem, groupIndex) in groupJsonData" :key="'group-' + groupIndex">
|
|
19
20
|
<x-form-item
|
|
@@ -23,6 +24,7 @@
|
|
|
23
24
|
:form="form"
|
|
24
25
|
:service-name="serviceName"
|
|
25
26
|
:get-data-params="getDataParams"
|
|
27
|
+
:env="env"
|
|
26
28
|
/>
|
|
27
29
|
</div>
|
|
28
30
|
<div v-show="advanced">
|
|
@@ -33,6 +35,7 @@
|
|
|
33
35
|
:form="form"
|
|
34
36
|
:service-name="serviceName"
|
|
35
37
|
:get-data-params="getDataParams"
|
|
38
|
+
:env="env"
|
|
36
39
|
/>
|
|
37
40
|
</div>
|
|
38
41
|
<a-col>
|
|
@@ -90,7 +93,9 @@ export default {
|
|
|
90
93
|
// 是否显示
|
|
91
94
|
visible: true,
|
|
92
95
|
// 调用logic获取数据源的追加参数
|
|
93
|
-
getDataParams: {}
|
|
96
|
+
getDataParams: {},
|
|
97
|
+
// 当前环境
|
|
98
|
+
env: 'prod',
|
|
94
99
|
}
|
|
95
100
|
},
|
|
96
101
|
computed: {
|
|
@@ -116,11 +121,12 @@ export default {
|
|
|
116
121
|
methods: {
|
|
117
122
|
init (params) {
|
|
118
123
|
const {
|
|
119
|
-
formItems, serviceName, getDataParams = {}
|
|
124
|
+
formItems, serviceName, getDataParams = {}, env = 'prod'
|
|
120
125
|
} = params
|
|
121
126
|
this.loaded = false
|
|
122
127
|
this.formItems = JSON.parse(JSON.stringify(formItems))
|
|
123
128
|
this.serviceName = serviceName
|
|
129
|
+
this.env = env
|
|
124
130
|
const formData = {}
|
|
125
131
|
for (let i = 0; i < this.realJsonData.length; i++) {
|
|
126
132
|
const item = this.realJsonData[i]
|
|
@@ -384,7 +384,14 @@ export default {
|
|
|
384
384
|
getDataParams: {
|
|
385
385
|
type: Object,
|
|
386
386
|
default: undefined
|
|
387
|
-
}
|
|
387
|
+
},
|
|
388
|
+
// 环境
|
|
389
|
+
env: {
|
|
390
|
+
type: String,
|
|
391
|
+
default: () => {
|
|
392
|
+
return 'prod'
|
|
393
|
+
}
|
|
394
|
+
},
|
|
388
395
|
},
|
|
389
396
|
created () {
|
|
390
397
|
this.init()
|
|
@@ -490,7 +497,7 @@ export default {
|
|
|
490
497
|
})
|
|
491
498
|
},
|
|
492
499
|
// 获取数据
|
|
493
|
-
getData (value,
|
|
500
|
+
getData (value, callbackFun) {
|
|
494
501
|
if (value !== '') {
|
|
495
502
|
const logicName = this.attr.keyName
|
|
496
503
|
const logic = logicName.substring(6)
|
|
@@ -498,8 +505,11 @@ export default {
|
|
|
498
505
|
if (this.getDataParams && this.getDataParams[this.attr.model]) {
|
|
499
506
|
Object.assign(value, this.getDataParams[this.attr.model])
|
|
500
507
|
}
|
|
501
|
-
runLogic(logic, value, this.serviceName).then(res => {
|
|
502
|
-
|
|
508
|
+
runLogic(logic, value, this.serviceName, this.env === 'dev').then(res => {
|
|
509
|
+
callbackFun(res)
|
|
510
|
+
}).catch(e => {
|
|
511
|
+
callbackFun([])
|
|
512
|
+
console.error('获取数据失败:' + e)
|
|
503
513
|
})
|
|
504
514
|
}
|
|
505
515
|
},
|
|
@@ -233,7 +233,8 @@ export default {
|
|
|
233
233
|
this.$refs.xForm.init({
|
|
234
234
|
formItems: res.formJson,
|
|
235
235
|
serviceName: this.serviceName,
|
|
236
|
-
getDataParams: this.getDataParams
|
|
236
|
+
getDataParams: this.getDataParams,
|
|
237
|
+
env: this.env
|
|
237
238
|
})
|
|
238
239
|
}
|
|
239
240
|
this.loading = false
|
|
@@ -313,7 +314,8 @@ export default {
|
|
|
313
314
|
isTableTemp: this.isTableTemp,
|
|
314
315
|
serviceName: this.serviceName,
|
|
315
316
|
fixedAddForm: this.fixedAddForm,
|
|
316
|
-
getDataParams: this.getDataParams
|
|
317
|
+
getDataParams: this.getDataParams,
|
|
318
|
+
env: this.env
|
|
317
319
|
})
|
|
318
320
|
},
|
|
319
321
|
/**
|
|
@@ -334,7 +336,8 @@ export default {
|
|
|
334
336
|
serviceName: this.serviceName,
|
|
335
337
|
fixedAddForm: this.fixedAddForm,
|
|
336
338
|
getDataParams: this.getDataParams,
|
|
337
|
-
modifyModelData: modifyModelData
|
|
339
|
+
modifyModelData: modifyModelData,
|
|
340
|
+
env: this.env
|
|
338
341
|
})
|
|
339
342
|
},
|
|
340
343
|
/**
|