vue2-client 1.7.20 → 1.8.0-10
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/.env +1 -0
- package/.eslintrc.js +19 -14
- package/babel.config.js +5 -5
- package/jest-transform-stub.js +5 -6
- package/jest.setup.js +7 -7
- package/package.json +23 -38
- package/src/App.vue +1 -1
- package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +2 -2
- package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +2 -1
- package/src/base-client/components/common/PersonSetting/PersonSetting.vue +4 -6
- package/src/base-client/components/common/Upload/Upload.vue +1 -1
- package/src/base-client/components/common/XAddForm/XAddForm.vue +21 -5
- package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +88 -53
- package/src/base-client/components/common/XDescriptions/XDescriptions.vue +117 -0
- package/src/base-client/components/common/XDescriptions/index.js +3 -0
- package/src/base-client/components/common/XDescriptions/index.md +83 -0
- package/src/base-client/components/common/XForm/XForm.vue +2 -0
- package/src/base-client/components/common/XFormTable/XFormTable.vue +11 -22
- package/src/base-client/components/common/XFormTable/index.md +1 -0
- package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +4 -3
- package/src/base-client/plugins/AppData.js +1 -1
- package/src/base-client/plugins/Config.js +0 -1
- package/src/base-client/plugins/GetLoginInfoService.js +4 -2
- package/src/base-client/plugins/tabs-page-plugin.js +5 -4
- package/src/components/FilePreview/FilePreview.vue +2 -2
- package/src/components/NumberInfo/NumberInfo.vue +1 -1
- package/src/components/checkbox/ColorCheckbox.vue +1 -1
- package/src/components/checkbox/ImgCheckbox.vue +2 -2
- package/src/components/menu/menu.js +1 -1
- package/src/components/tool/AStepItem.vue +1 -1
- package/src/config/default/antd.config.js +11 -6
- package/src/config/default/setting.config.js +0 -2
- package/src/layouts/PageLayout.vue +1 -1
- package/src/layouts/SinglePageView.vue +3 -2
- package/src/layouts/header/AdminHeader.vue +2 -2
- package/src/layouts/header/HeaderNotice.vue +3 -2
- package/src/layouts/tabs/TabsHead.vue +1 -2
- package/src/layouts/tabs/TabsView.vue +10 -10
- package/src/mock/extend/index.js +2 -1
- package/src/mock/goods/index.js +6 -6
- package/src/pages/CreateQueryPage.vue +4 -3
- package/src/pages/login/Login.vue +2 -2
- package/src/pages/system/dictionary/index.vue +1 -0
- package/src/pages/system/monitor/loginInfor/index.vue +2 -1
- package/src/pages/system/monitor/operLog/index.vue +2 -1
- package/src/pages/system/settings/modifyPassword.vue +1 -1
- package/src/pages/system/ticket/index.vue +3 -2
- package/src/pages/system/ticket/submitTicketSuccess.vue +1 -1
- package/src/services/api/common.js +18 -19
- package/src/services/apiService.js +2 -2
- package/src/utils/authority-utils.js +12 -12
- package/src/utils/errorCode.js +4 -4
- package/src/utils/login.js +8 -5
- package/src/utils/map-utils.js +20 -12
- package/src/utils/request.js +4 -3
- package/src/utils/routerUtil.js +6 -3
- package/src/utils/util.js +3 -2
- package/vue.config.js +30 -14
- package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -0
- package/webpack.config.js +0 -12
package/.env
CHANGED
package/.eslintrc.js
CHANGED
|
@@ -3,7 +3,7 @@ module.exports = {
|
|
|
3
3
|
env: {
|
|
4
4
|
node: true
|
|
5
5
|
},
|
|
6
|
-
|
|
6
|
+
extends: [
|
|
7
7
|
'plugin:vue/essential',
|
|
8
8
|
'plugin:vue/strongly-recommended',
|
|
9
9
|
'@vue/standard'
|
|
@@ -17,10 +17,11 @@ module.exports = {
|
|
|
17
17
|
'vue/max-attributes-per-line': [
|
|
18
18
|
2,
|
|
19
19
|
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
singleline: {
|
|
21
|
+
max: 5
|
|
22
|
+
},
|
|
23
|
+
multiline: {
|
|
24
|
+
max: 1,
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
],
|
|
@@ -35,38 +36,42 @@ module.exports = {
|
|
|
35
36
|
'vue/html-closing-bracket-newline': 0,
|
|
36
37
|
'vue/no-parsing-error': 0,
|
|
37
38
|
'vue/name-property-casing': 0,
|
|
39
|
+
'vue/multi-word-component-names': 0,
|
|
40
|
+
'vue/no-mutating-props': 0,
|
|
38
41
|
'no-tabs': 0,
|
|
39
|
-
'
|
|
42
|
+
'multiline-ternary': 0,
|
|
43
|
+
'object-shorthand': 0,
|
|
44
|
+
quotes: [
|
|
40
45
|
2,
|
|
41
46
|
'single',
|
|
42
47
|
{
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
avoidEscape: true,
|
|
49
|
+
allowTemplateLiterals: true
|
|
45
50
|
}
|
|
46
51
|
],
|
|
47
|
-
|
|
52
|
+
semi: [
|
|
48
53
|
2,
|
|
49
54
|
'never',
|
|
50
55
|
{
|
|
51
|
-
|
|
56
|
+
beforeStatementContinuationChars: 'never'
|
|
52
57
|
}
|
|
53
58
|
],
|
|
54
59
|
'no-delete-var': 2,
|
|
55
60
|
'prefer-const': [
|
|
56
61
|
2,
|
|
57
62
|
{
|
|
58
|
-
|
|
63
|
+
ignoreReadBeforeAssign: false
|
|
59
64
|
}
|
|
60
65
|
],
|
|
61
66
|
'template-curly-spacing': 'off',
|
|
62
|
-
|
|
67
|
+
indent: 'off',
|
|
63
68
|
// 必须使用全等: false
|
|
64
|
-
|
|
69
|
+
eqeqeq: 0,
|
|
65
70
|
// 可以使用!! 双重否定
|
|
66
71
|
'no-extra-boolean-cast': 'off'
|
|
67
72
|
},
|
|
68
73
|
parserOptions: {
|
|
69
|
-
parser: 'babel-
|
|
74
|
+
parser: '@babel/eslint-parser'
|
|
70
75
|
},
|
|
71
76
|
overrides: [
|
|
72
77
|
{
|
package/babel.config.js
CHANGED
|
@@ -9,13 +9,13 @@ if (IS_PROD) {
|
|
|
9
9
|
module.exports = {
|
|
10
10
|
presets: [
|
|
11
11
|
'@vue/cli-plugin-babel/preset',
|
|
12
|
-
['@vue/babel-preset-jsx', {
|
|
12
|
+
['@vue/babel-preset-jsx', { injectH: false }]
|
|
13
13
|
],
|
|
14
14
|
plugins,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
env: {
|
|
16
|
+
test: {
|
|
17
|
+
presets: ['@babel/preset-env'],
|
|
18
|
+
plugins: ['istanbul']
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
package/jest-transform-stub.js
CHANGED
package/jest.setup.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
global.matchMedia = global.matchMedia || function () {
|
|
2
|
-
return {
|
|
3
|
-
matches: false,
|
|
4
|
-
addListener: function () {},
|
|
5
|
-
removeListener: function () {}
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
global.matchMedia = global.matchMedia || function () {
|
|
2
|
+
return {
|
|
3
|
+
matches: false,
|
|
4
|
+
addListener: function () {},
|
|
5
|
+
removeListener: function () {}
|
|
6
|
+
}
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue2-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0-10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"ant-design-vue": "^1.7.8",
|
|
22
22
|
"axios": "^0.27.2",
|
|
23
23
|
"clipboard": "^2.0.11",
|
|
24
|
-
"core-js": "^3.
|
|
24
|
+
"core-js": "^3.33.0",
|
|
25
25
|
"crypto-js": "^4.1.1",
|
|
26
26
|
"date-fns": "^2.29.3",
|
|
27
27
|
"default-passive-events": "^2.0.0",
|
|
@@ -32,12 +32,14 @@
|
|
|
32
32
|
"js-base64": "^3.7.5",
|
|
33
33
|
"js-cookie": "^2.2.1",
|
|
34
34
|
"jsencrypt": "^3.3.2",
|
|
35
|
+
"lodash.clonedeep": "^4.5.0",
|
|
35
36
|
"lodash.get": "^4.4.2",
|
|
36
37
|
"mockjs": "^1.1.0",
|
|
37
38
|
"nprogress": "^0.2.0",
|
|
39
|
+
"regenerator-runtime": "^0.14.0",
|
|
38
40
|
"videojs-contrib-hls": "^5.15.0",
|
|
39
41
|
"viser-vue": "^2.4.8",
|
|
40
|
-
"vue": "2.
|
|
42
|
+
"vue": "^2.7.14",
|
|
41
43
|
"vue-i18n": "^8.28.2",
|
|
42
44
|
"vue-json-viewer": "^2.2.22",
|
|
43
45
|
"vue-router": "^3.6.5",
|
|
@@ -48,56 +50,39 @@
|
|
|
48
50
|
},
|
|
49
51
|
"devDependencies": {
|
|
50
52
|
"@ant-design/colors": "^7.0.0",
|
|
51
|
-
"@babel/core": "^7.
|
|
53
|
+
"@babel/core": "^7.22.20",
|
|
54
|
+
"@babel/eslint-parser": "^7.22.15",
|
|
52
55
|
"@babel/preset-env": "^7.22.20",
|
|
53
|
-
"@vue/cli-plugin-babel": "^
|
|
54
|
-
"@vue/cli-plugin-eslint": "^
|
|
55
|
-
"@vue/cli-service": "^
|
|
56
|
-
"@vue/eslint-config-standard": "^
|
|
56
|
+
"@vue/cli-plugin-babel": "^5.0.8",
|
|
57
|
+
"@vue/cli-plugin-eslint": "^5.0.8",
|
|
58
|
+
"@vue/cli-service": "^5.0.8",
|
|
59
|
+
"@vue/eslint-config-standard": "^8.0.1",
|
|
57
60
|
"@vue/test-utils": "^1.3.6",
|
|
58
|
-
"
|
|
59
|
-
"babel-core": "^6.22.1",
|
|
60
|
-
"babel-eslint": "^10.1.0",
|
|
61
|
-
"babel-jest": "^25.5.1",
|
|
62
|
-
"babel-loader": "^6.0.0",
|
|
63
|
-
"babel-plugin-component": "^1.1.1",
|
|
64
|
-
"babel-plugin-istanbul": "^4.1.1",
|
|
65
|
-
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
|
|
61
|
+
"babel-jest": "^26.6.3",
|
|
66
62
|
"babel-plugin-transform-remove-console": "^6.9.4",
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"babel-preset-env": "^1.3.2",
|
|
70
|
-
"babel-preset-react": "^6.24.1",
|
|
71
|
-
"babel-register": "^6.22.0",
|
|
72
|
-
"compression-webpack-plugin": "^4.0.1",
|
|
63
|
+
"compression-webpack-plugin": "^10.0.0",
|
|
64
|
+
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
73
65
|
"deepmerge": "^4.3.1",
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"eslint": "^6.8.0",
|
|
77
|
-
"eslint-plugin-import": "^2.26.0",
|
|
78
|
-
"eslint-plugin-node": "^11.1.0",
|
|
79
|
-
"eslint-plugin-promise": "^4.3.1",
|
|
80
|
-
"eslint-plugin-standard": "^4.1.0",
|
|
81
|
-
"eslint-plugin-vue": "^6.2.2",
|
|
66
|
+
"eslint": "^8.51.0",
|
|
67
|
+
"eslint-plugin-vue": "^9.17.0",
|
|
82
68
|
"fast-deep-equal": "^3.1.3",
|
|
83
|
-
"jest": "^
|
|
84
|
-
"jest-environment-jsdom": "^
|
|
69
|
+
"jest": "^26.6.3",
|
|
70
|
+
"jest-environment-jsdom": "^26.6.2",
|
|
85
71
|
"jest-transform-stub": "^2.0.0",
|
|
86
72
|
"less-loader": "^6.2.0",
|
|
87
73
|
"script-loader": "^0.7.2",
|
|
88
74
|
"style-resources-loader": "^1.5.0",
|
|
89
75
|
"vue-cli-plugin-style-resources-loader": "^0.1.5",
|
|
90
|
-
"vue-custom-element": "^3.3.0",
|
|
91
76
|
"vue-jest": "^4.0.1",
|
|
92
|
-
"vue-template-compiler": "2.
|
|
93
|
-
"
|
|
94
|
-
"webpack": "^4.46.0",
|
|
77
|
+
"vue-template-compiler": "^2.7.14",
|
|
78
|
+
"webpack": "^5.88.2",
|
|
95
79
|
"webpack-theme-color-replacer": "^1.4.7",
|
|
96
|
-
"whatwg-fetch": "^3.6.
|
|
80
|
+
"whatwg-fetch": "^3.6.19"
|
|
97
81
|
},
|
|
98
82
|
"browserslist": [
|
|
99
83
|
"> 1%",
|
|
100
84
|
"last 2 versions",
|
|
101
|
-
"not
|
|
85
|
+
"not dead",
|
|
86
|
+
"not ie 11"
|
|
102
87
|
]
|
|
103
88
|
}
|
package/src/App.vue
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
<a-icon type="bank" /> {{ group.title }}
|
|
26
26
|
</span>
|
|
27
27
|
<a-select-option v-for="address in group.children" :key="address.label + ' <' + address.value + '>'">
|
|
28
|
-
<p class="addressName"><a-icon type="environment"
|
|
28
|
+
<p class="addressName"><a-icon type="environment" /><span v-html="highLight(address.label, address.word)"></span></p>
|
|
29
29
|
<p v-if="address.address !== '[]'" class="addressRemark">
|
|
30
30
|
{{ address.address }}
|
|
31
31
|
</p>
|
|
@@ -169,7 +169,7 @@ export default {
|
|
|
169
169
|
const addressMap = {}
|
|
170
170
|
result.tips.forEach((res) => {
|
|
171
171
|
if (res.location) {
|
|
172
|
-
if (!
|
|
172
|
+
if (!Object.prototype.hasOwnProperty.call(addressMap, res.district)) {
|
|
173
173
|
addressMap[res.district] = []
|
|
174
174
|
}
|
|
175
175
|
addressMap[res.district].push({
|
|
@@ -653,6 +653,7 @@ export default {
|
|
|
653
653
|
rule: {
|
|
654
654
|
required: 'false'
|
|
655
655
|
},
|
|
656
|
+
column: [],
|
|
656
657
|
selectKey: undefined,
|
|
657
658
|
queryType: '=',
|
|
658
659
|
formType: 'input',
|
|
@@ -680,7 +681,7 @@ export default {
|
|
|
680
681
|
// 编辑数据字段前准备数据
|
|
681
682
|
editColumnItemExecute (_item) {
|
|
682
683
|
this.type = '修改'
|
|
683
|
-
const defaultValue = { formType: 'input', type: 'string', addOrEdit: 'all', slot: { type: 'default' }, rule: {}, selectKey: {} }
|
|
684
|
+
const defaultValue = { formType: 'input', type: 'string', addOrEdit: 'all', slot: { type: 'default' }, rule: {}, selectKey: {}, column: [] }
|
|
684
685
|
if (!_item.queryType) {
|
|
685
686
|
defaultValue.queryType = '='
|
|
686
687
|
}
|
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
okText="提交"
|
|
10
10
|
@cancel="close"
|
|
11
11
|
@ok="$refs.nativeForm.onSubmit()">
|
|
12
|
-
<x-add-native-form
|
|
12
|
+
<x-add-native-form
|
|
13
|
+
ref="nativeForm"
|
|
14
|
+
@afterSubmit="afterSubmit"
|
|
15
|
+
@onSubmit="onSubmit"
|
|
16
|
+
@tempTableModify="tempTableModify"/>
|
|
13
17
|
</a-modal>
|
|
14
18
|
</template>
|
|
15
19
|
<script>
|
|
@@ -43,6 +47,7 @@ export default {
|
|
|
43
47
|
},
|
|
44
48
|
methods: {
|
|
45
49
|
init (params) {
|
|
50
|
+
params.showSubmitBtn = false
|
|
46
51
|
const {
|
|
47
52
|
businessType, title
|
|
48
53
|
} = params
|
|
@@ -50,7 +55,7 @@ export default {
|
|
|
50
55
|
this.title = title
|
|
51
56
|
this.visible = true
|
|
52
57
|
const that = this
|
|
53
|
-
that.$nextTick(
|
|
58
|
+
that.$nextTick(() => {
|
|
54
59
|
that.$refs.nativeForm.init(params)
|
|
55
60
|
})
|
|
56
61
|
},
|
|
@@ -60,9 +65,20 @@ export default {
|
|
|
60
65
|
},
|
|
61
66
|
onSubmit (params) {
|
|
62
67
|
this.loading = true
|
|
63
|
-
this.$
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
if (this.$listeners.onSubmit) {
|
|
69
|
+
// 交由父级处理
|
|
70
|
+
this.$emit('onSubmit', params, () => {
|
|
71
|
+
this.close()
|
|
72
|
+
})
|
|
73
|
+
} else {
|
|
74
|
+
// 触发默认提交事件
|
|
75
|
+
this.$refs.nativeForm.defaultSubmit(params.realForm, () => {
|
|
76
|
+
this.close()
|
|
77
|
+
})
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
afterSubmit (params) {
|
|
81
|
+
this.$emit('afterSubmit', params)
|
|
66
82
|
},
|
|
67
83
|
tempTableModify (params) {
|
|
68
84
|
this.$emit('tempTableModify', params)
|
|
@@ -1,63 +1,66 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
v-for="(item, index) in realJsonData"
|
|
11
|
-
:key="index"
|
|
12
|
-
:attr="item"
|
|
13
|
-
:disabled="itemDisabled(item)"
|
|
14
|
-
:files="files"
|
|
15
|
-
:form="form"
|
|
16
|
-
:images="images"
|
|
17
|
-
:service-name="serviceName"
|
|
18
|
-
mode="新增/修改"
|
|
19
|
-
:get-data-params="getDataParams"
|
|
20
|
-
/>
|
|
21
|
-
</a-row>
|
|
22
|
-
<a-row :gutter="16" v-for="(groupItem, groupIndex) in groupJsonData" :key="groupIndex">
|
|
23
|
-
<a-card :title="groupItem.name" :bordered="false" size="small">
|
|
2
|
+
<div>
|
|
3
|
+
<a-form-model
|
|
4
|
+
v-if="loaded"
|
|
5
|
+
ref="selectForm"
|
|
6
|
+
:zIndex="1001"
|
|
7
|
+
:model="form"
|
|
8
|
+
:rules="rules">
|
|
9
|
+
<a-row :gutter="16">
|
|
24
10
|
<x-form-item
|
|
25
|
-
v-for="(item, index) in
|
|
11
|
+
v-for="(item, index) in realJsonData"
|
|
26
12
|
:key="index"
|
|
27
13
|
:attr="item"
|
|
28
14
|
:disabled="itemDisabled(item)"
|
|
29
15
|
:files="files"
|
|
30
|
-
:form="form[groupItem.model]"
|
|
31
|
-
:images="images"
|
|
32
|
-
:service-name="serviceName"
|
|
33
|
-
mode="新增/修改"
|
|
34
|
-
:get-data-params="getDataParams"
|
|
35
|
-
/>
|
|
36
|
-
</a-card>
|
|
37
|
-
</a-row>
|
|
38
|
-
<a-row :gutter="16" v-for="(item, key) in simpleFormJsonData" :key="'row' + key">
|
|
39
|
-
<a-card :title="item.name" :bordered="false" size="small">
|
|
40
|
-
<x-form-item
|
|
41
|
-
v-for="(formItem, formItemIndex) in item.value"
|
|
42
|
-
:key="key + formItemIndex"
|
|
43
|
-
:attr="formItem"
|
|
44
|
-
:disabled="itemDisabled(formItem)"
|
|
45
|
-
:files="files"
|
|
46
16
|
:form="form"
|
|
47
17
|
:images="images"
|
|
48
18
|
:service-name="serviceName"
|
|
49
19
|
mode="新增/修改"
|
|
50
20
|
:get-data-params="getDataParams"
|
|
51
21
|
/>
|
|
52
|
-
</a-
|
|
53
|
-
|
|
54
|
-
|
|
22
|
+
</a-row>
|
|
23
|
+
<a-row :gutter="16" v-for="(groupItem, groupIndex) in groupJsonData" :key="groupIndex">
|
|
24
|
+
<a-card :title="groupItem.name" :bordered="false" size="small">
|
|
25
|
+
<x-form-item
|
|
26
|
+
v-for="(item, index) in groupItem.groupItems"
|
|
27
|
+
:key="index"
|
|
28
|
+
:attr="item"
|
|
29
|
+
:disabled="itemDisabled(item)"
|
|
30
|
+
:files="files"
|
|
31
|
+
:form="form[groupItem.model]"
|
|
32
|
+
:images="images"
|
|
33
|
+
:service-name="serviceName"
|
|
34
|
+
mode="新增/修改"
|
|
35
|
+
:get-data-params="getDataParams"
|
|
36
|
+
/>
|
|
37
|
+
</a-card>
|
|
38
|
+
</a-row>
|
|
39
|
+
<a-row :gutter="16" v-for="(item, key) in simpleFormJsonData" :key="'row' + key">
|
|
40
|
+
<a-card :title="item.name" :bordered="false" size="small">
|
|
41
|
+
<x-form-item
|
|
42
|
+
v-for="(formItem, formItemIndex) in item.value"
|
|
43
|
+
:key="key + formItemIndex"
|
|
44
|
+
:attr="formItem"
|
|
45
|
+
:disabled="itemDisabled(formItem)"
|
|
46
|
+
:files="files"
|
|
47
|
+
:form="form"
|
|
48
|
+
:images="images"
|
|
49
|
+
:service-name="serviceName"
|
|
50
|
+
mode="新增/修改"
|
|
51
|
+
:get-data-params="getDataParams"
|
|
52
|
+
/>
|
|
53
|
+
</a-card>
|
|
54
|
+
</a-row>
|
|
55
|
+
</a-form-model>
|
|
56
|
+
<a-button v-if="showSubmitBtn" :loading="loading" type="primary" @click="onSubmit()">提交</a-button>
|
|
57
|
+
</div>
|
|
55
58
|
</template>
|
|
56
59
|
<script>
|
|
57
60
|
import XFormItem from '@vue2-client/base-client/components/common/XForm/XFormItem'
|
|
58
61
|
import { formatDate } from '@vue2-client/utils/util'
|
|
59
62
|
import { mapState } from 'vuex'
|
|
60
|
-
import { runLogic } from '@vue2-client/services/api/common'
|
|
63
|
+
import { addOrModify, runLogic } from '@vue2-client/services/api/common'
|
|
61
64
|
|
|
62
65
|
export default {
|
|
63
66
|
name: 'XAddNativeForm',
|
|
@@ -82,10 +85,16 @@ export default {
|
|
|
82
85
|
loading: false,
|
|
83
86
|
// 表单Model
|
|
84
87
|
form: {},
|
|
88
|
+
// 配置名称
|
|
89
|
+
configName: undefined,
|
|
90
|
+
// 配置内容,用于查询配置生成器的预览
|
|
91
|
+
configContent: undefined,
|
|
85
92
|
// 表单项集合
|
|
86
93
|
formItems: [],
|
|
87
94
|
// 服务名称
|
|
88
95
|
serviceName: undefined,
|
|
96
|
+
// 是否显示提交按钮
|
|
97
|
+
showSubmitBtn: true,
|
|
89
98
|
// 修改有文件的表单时使用
|
|
90
99
|
files: [],
|
|
91
100
|
images: [],
|
|
@@ -142,9 +151,11 @@ export default {
|
|
|
142
151
|
methods: {
|
|
143
152
|
init (params) {
|
|
144
153
|
const {
|
|
145
|
-
formItems, viewMode, isHandleFormKey = true, serviceName, isTableTemp = false, modifyModelData = {}, businessType, title, fixedAddForm = {}, getDataParams = {}, simpleFormJsonData = {}
|
|
154
|
+
configName, configContent, formItems, viewMode, isHandleFormKey = true, showSubmitBtn = true, serviceName, isTableTemp = false, modifyModelData = {}, businessType, title, fixedAddForm = {}, getDataParams = {}, simpleFormJsonData = {}
|
|
146
155
|
} = params
|
|
147
156
|
this.loaded = false
|
|
157
|
+
this.configName = configName
|
|
158
|
+
this.configContent = configContent
|
|
148
159
|
if (typeof formItems === 'string') {
|
|
149
160
|
this.formItems = JSON.parse(formItems)
|
|
150
161
|
} else {
|
|
@@ -152,6 +163,7 @@ export default {
|
|
|
152
163
|
}
|
|
153
164
|
this.viewMode = viewMode
|
|
154
165
|
this.isHandleFormKey = isHandleFormKey
|
|
166
|
+
this.showSubmitBtn = showSubmitBtn
|
|
155
167
|
this.serviceName = serviceName
|
|
156
168
|
this.businessType = businessType
|
|
157
169
|
this.title = title
|
|
@@ -233,7 +245,9 @@ export default {
|
|
|
233
245
|
case 'number':
|
|
234
246
|
case 'integer':
|
|
235
247
|
case 'float':
|
|
248
|
+
// eslint-disable-next-line no-case-declarations
|
|
236
249
|
let defaultValue
|
|
250
|
+
// eslint-disable-next-line no-case-declarations
|
|
237
251
|
let message
|
|
238
252
|
switch (item.rule.type) {
|
|
239
253
|
case 'number':
|
|
@@ -332,21 +346,42 @@ export default {
|
|
|
332
346
|
}
|
|
333
347
|
if (this.viewMode) {
|
|
334
348
|
this.$message.info('预览模式禁止新增和修改')
|
|
335
|
-
|
|
349
|
+
return false
|
|
350
|
+
}
|
|
351
|
+
if (this.$listeners.onSubmit) {
|
|
352
|
+
// 交由父级处理
|
|
353
|
+
this.$emit('onSubmit', {
|
|
336
354
|
businessType: this.businessType,
|
|
337
355
|
serviceName: this.serviceName,
|
|
338
356
|
realForm: realForm,
|
|
339
357
|
currUserName: this.currUser.name
|
|
340
358
|
})
|
|
341
|
-
|
|
359
|
+
} else {
|
|
360
|
+
this.defaultSubmit(realForm)
|
|
361
|
+
}
|
|
362
|
+
})
|
|
363
|
+
},
|
|
364
|
+
// 默认提交事件
|
|
365
|
+
defaultSubmit (realForm, callback) {
|
|
366
|
+
// 组织请求
|
|
367
|
+
const requestParameters = {
|
|
368
|
+
queryParamsName: this.configName,
|
|
369
|
+
queryParams: this.configContent,
|
|
370
|
+
form: realForm,
|
|
371
|
+
businessType: this.businessType,
|
|
372
|
+
operator: this.currUser.name
|
|
373
|
+
}
|
|
374
|
+
addOrModify(requestParameters, this.serviceName).then(data => {
|
|
375
|
+
this.$message.success(this.businessType + '成功!')
|
|
376
|
+
// commit
|
|
377
|
+
this.$emit('afterSubmit', { type: this.businessType, id: data.id, form: requestParameters.form })
|
|
378
|
+
}).catch(e => {
|
|
379
|
+
this.$message.error(this.businessType + '失败:' + e)
|
|
380
|
+
}).finally(() => {
|
|
381
|
+
this.loading = false
|
|
382
|
+
if (callback) {
|
|
383
|
+
callback()
|
|
342
384
|
}
|
|
343
|
-
// 交由父级处理
|
|
344
|
-
this.$emit('onSubmit', {
|
|
345
|
-
businessType: this.businessType,
|
|
346
|
-
serviceName: this.serviceName,
|
|
347
|
-
realForm: realForm,
|
|
348
|
-
currUserName: this.currUser.name
|
|
349
|
-
})
|
|
350
385
|
})
|
|
351
386
|
},
|
|
352
387
|
// 获取表单字段实际值
|