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.
Files changed (60) hide show
  1. package/.env +1 -0
  2. package/.eslintrc.js +19 -14
  3. package/babel.config.js +5 -5
  4. package/jest-transform-stub.js +5 -6
  5. package/jest.setup.js +7 -7
  6. package/package.json +23 -38
  7. package/src/App.vue +1 -1
  8. package/src/base-client/components/common/AddressSearchCombobox/AddressSearchCombobox.vue +2 -2
  9. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +2 -1
  10. package/src/base-client/components/common/PersonSetting/PersonSetting.vue +4 -6
  11. package/src/base-client/components/common/Upload/Upload.vue +1 -1
  12. package/src/base-client/components/common/XAddForm/XAddForm.vue +21 -5
  13. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +88 -53
  14. package/src/base-client/components/common/XDescriptions/XDescriptions.vue +117 -0
  15. package/src/base-client/components/common/XDescriptions/index.js +3 -0
  16. package/src/base-client/components/common/XDescriptions/index.md +83 -0
  17. package/src/base-client/components/common/XForm/XForm.vue +2 -0
  18. package/src/base-client/components/common/XFormTable/XFormTable.vue +11 -22
  19. package/src/base-client/components/common/XFormTable/index.md +1 -0
  20. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +4 -3
  21. package/src/base-client/plugins/AppData.js +1 -1
  22. package/src/base-client/plugins/Config.js +0 -1
  23. package/src/base-client/plugins/GetLoginInfoService.js +4 -2
  24. package/src/base-client/plugins/tabs-page-plugin.js +5 -4
  25. package/src/components/FilePreview/FilePreview.vue +2 -2
  26. package/src/components/NumberInfo/NumberInfo.vue +1 -1
  27. package/src/components/checkbox/ColorCheckbox.vue +1 -1
  28. package/src/components/checkbox/ImgCheckbox.vue +2 -2
  29. package/src/components/menu/menu.js +1 -1
  30. package/src/components/tool/AStepItem.vue +1 -1
  31. package/src/config/default/antd.config.js +11 -6
  32. package/src/config/default/setting.config.js +0 -2
  33. package/src/layouts/PageLayout.vue +1 -1
  34. package/src/layouts/SinglePageView.vue +3 -2
  35. package/src/layouts/header/AdminHeader.vue +2 -2
  36. package/src/layouts/header/HeaderNotice.vue +3 -2
  37. package/src/layouts/tabs/TabsHead.vue +1 -2
  38. package/src/layouts/tabs/TabsView.vue +10 -10
  39. package/src/mock/extend/index.js +2 -1
  40. package/src/mock/goods/index.js +6 -6
  41. package/src/pages/CreateQueryPage.vue +4 -3
  42. package/src/pages/login/Login.vue +2 -2
  43. package/src/pages/system/dictionary/index.vue +1 -0
  44. package/src/pages/system/monitor/loginInfor/index.vue +2 -1
  45. package/src/pages/system/monitor/operLog/index.vue +2 -1
  46. package/src/pages/system/settings/modifyPassword.vue +1 -1
  47. package/src/pages/system/ticket/index.vue +3 -2
  48. package/src/pages/system/ticket/submitTicketSuccess.vue +1 -1
  49. package/src/services/api/common.js +18 -19
  50. package/src/services/apiService.js +2 -2
  51. package/src/utils/authority-utils.js +12 -12
  52. package/src/utils/errorCode.js +4 -4
  53. package/src/utils/login.js +8 -5
  54. package/src/utils/map-utils.js +20 -12
  55. package/src/utils/request.js +4 -3
  56. package/src/utils/routerUtil.js +6 -3
  57. package/src/utils/util.js +3 -2
  58. package/vue.config.js +30 -14
  59. package//350/277/201/347/247/273/346/227/245/345/277/227.md +15 -0
  60. package/webpack.config.js +0 -12
package/.env CHANGED
@@ -14,3 +14,4 @@ VUE_APP_SINGLEVALUE_KEY=admin.singlevalue
14
14
  VUE_APP_DIVISIONSOHCHINA=admin.divisionsohchina
15
15
  VUE_APP_WEB_CONFIG_KEY=admin.webconfig
16
16
  VUE_APP_API_BASE_URL=http://123.60.214.109:8405
17
+ VUE_APP_SYSTEM_NAME=af-system
package/.eslintrc.js CHANGED
@@ -3,7 +3,7 @@ module.exports = {
3
3
  env: {
4
4
  node: true
5
5
  },
6
- 'extends': [
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
- 'singleline': 5,
21
- 'multiline': {
22
- 'max': 1,
23
- 'allowFirstLine': false
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
- 'quotes': [
42
+ 'multiline-ternary': 0,
43
+ 'object-shorthand': 0,
44
+ quotes: [
40
45
  2,
41
46
  'single',
42
47
  {
43
- 'avoidEscape': true,
44
- 'allowTemplateLiterals': true
48
+ avoidEscape: true,
49
+ allowTemplateLiterals: true
45
50
  }
46
51
  ],
47
- 'semi': [
52
+ semi: [
48
53
  2,
49
54
  'never',
50
55
  {
51
- 'beforeStatementContinuationChars': 'never'
56
+ beforeStatementContinuationChars: 'never'
52
57
  }
53
58
  ],
54
59
  'no-delete-var': 2,
55
60
  'prefer-const': [
56
61
  2,
57
62
  {
58
- 'ignoreReadBeforeAssign': false
63
+ ignoreReadBeforeAssign: false
59
64
  }
60
65
  ],
61
66
  'template-curly-spacing': 'off',
62
- 'indent': 'off',
67
+ indent: 'off',
63
68
  // 必须使用全等: false
64
- 'eqeqeq': 0,
69
+ eqeqeq: 0,
65
70
  // 可以使用!! 双重否定
66
71
  'no-extra-boolean-cast': 'off'
67
72
  },
68
73
  parserOptions: {
69
- parser: 'babel-eslint'
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', { 'injectH': false }]
12
+ ['@vue/babel-preset-jsx', { injectH: false }]
13
13
  ],
14
14
  plugins,
15
- 'env': {
16
- 'test': {
17
- 'presets': ['@babel/preset-env'],
18
- 'plugins': ['istanbul']
15
+ env: {
16
+ test: {
17
+ presets: ['@babel/preset-env'],
18
+ plugins: ['istanbul']
19
19
  }
20
20
  }
21
21
  }
@@ -1,9 +1,8 @@
1
1
  module.exports = {
2
- process() {
3
- return 'module.exports = {};';
2
+ process () {
3
+ return 'module.exports = {};'
4
4
  },
5
- getCacheKey() {
6
- return 'lessTransform';
5
+ getCacheKey () {
6
+ return 'lessTransform'
7
7
  },
8
- };
9
-
8
+ }
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.7.20",
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.30.1",
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.6.14",
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.21.4",
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": "^4.5.19",
54
- "@vue/cli-plugin-eslint": "^4.5.19",
55
- "@vue/cli-service": "^4.5.19",
56
- "@vue/eslint-config-standard": "^4.0.0",
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
- "@vuepress/plugin-back-to-top": "^1.9.9",
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
- "babel-plugin-transform-runtime": "^6.22.0",
68
- "babel-polyfill": "^6.26.0",
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
- "document-register-element": "^1.14.10",
75
- "escope": "^4.0.0",
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": "^24.0.0",
84
- "jest-environment-jsdom": "^23.4.0",
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.6.14",
93
- "vuepress": "^1.9.9",
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.2"
80
+ "whatwg-fetch": "^3.6.19"
97
81
  },
98
82
  "browserslist": [
99
83
  "> 1%",
100
84
  "last 2 versions",
101
- "not ie <= 10"
85
+ "not dead",
86
+ "not ie 11"
102
87
  ]
103
88
  }
package/src/App.vue CHANGED
@@ -53,7 +53,7 @@ export default {
53
53
  themeUtil.changeThemeColor(val, this.theme.mode).then(closeMessage)
54
54
  }
55
55
  },
56
- 'layout': function () {
56
+ layout: function () {
57
57
  window.dispatchEvent(new Event('resize'))
58
58
  }
59
59
  },
@@ -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" /> <span v-html="highLight(address.label, address.word)">{{ address.label }}</span></p>
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 (!addressMap.hasOwnProperty(res.district)) {
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
  }
@@ -191,13 +191,11 @@ export default {
191
191
  }
192
192
 
193
193
  .ant-card-body {
194
- :global {
195
- .ant-tree {
196
- line-height: 3;
194
+ .ant-tree {
195
+ line-height: 3;
197
196
 
198
- li {
199
- position: relative;
200
- }
197
+ li {
198
+ position: relative;
201
199
  }
202
200
  }
203
201
  }
@@ -39,7 +39,7 @@ import { mapState } from 'vuex'
39
39
  import { fileDelete, upload } from '@vue2-client/services/api/common'
40
40
 
41
41
  export default {
42
- name: 'uploads',
42
+ name: 'Uploads',
43
43
  data () {
44
44
  return {
45
45
  uploadedFileList: [],
@@ -9,7 +9,11 @@
9
9
  okText="提交"
10
10
  @cancel="close"
11
11
  @ok="$refs.nativeForm.onSubmit()">
12
- <x-add-native-form ref="nativeForm" @onSubmit="onSubmit" @tempTableModify="tempTableModify"/>
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(function () {
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.$emit('onSubmit', params, () => {
64
- this.close()
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
- <a-form-model
3
- v-if="loaded"
4
- ref="selectForm"
5
- :zIndex="1001"
6
- :model="form"
7
- :rules="rules">
8
- <a-row :gutter="16">
9
- <x-form-item
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 groupItem.groupItems"
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-card>
53
- </a-row>
54
- </a-form-model>
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
- console.log({
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
- return false
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
  // 获取表单字段实际值