vue2-client 1.2.25 → 1.2.28-test

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 (53) hide show
  1. package/.eslintrc.js +82 -81
  2. package/CHANGELOG.md +8 -0
  3. package/package.json +1 -1
  4. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +2 -3
  5. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +1 -2
  6. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +1 -2
  7. package/src/base-client/components/common/XAddForm/XAddForm.vue +1 -1
  8. package/src/base-client/components/common/XAddNativeForm/XAddNativeForm.vue +315 -0
  9. package/src/base-client/components/common/XAddNativeForm/index.js +3 -0
  10. package/src/base-client/components/common/XAddNativeForm/index.md +56 -0
  11. package/src/base-client/components/common/XForm/XForm.vue +1 -1
  12. package/src/base-client/components/common/XForm/XFormItem.vue +1 -1
  13. package/src/base-client/components/common/XFormTable/XFormTable.vue +1 -2
  14. package/src/base-client/components/iot/CustomerDetailsView/CustomerDetailsView.vue +1 -2
  15. package/src/base-client/components/iot/DeviceBrandDetailsView/DeviceBrandDetailsView.vue +1 -2
  16. package/src/base-client/components/iot/DeviceDetailsView/DeviceDetailsView.vue +1 -2
  17. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsCount.vue +1 -1
  18. package/src/base-client/components/iot/DeviceDetailsView/part/DeviceDetailsInstructOperate.vue +1 -2
  19. package/src/base-client/components/iot/DeviceTypeDetailsView/DeviceTypeDetailsView.vue +1 -2
  20. package/src/base-client/components/iot/InstructDetailsView/InstructDetailsView.vue +1 -3
  21. package/src/base-client/components/iot/LogDetailsView/LogDetailsView.vue +1 -2
  22. package/src/base-client/components/iot/MeterDetailsView/MeterDetailsView.vue +1 -2
  23. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsCount.vue +1 -1
  24. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsException.vue +1 -2
  25. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsHandPlan.vue +1 -2
  26. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsInstruct.vue +1 -2
  27. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsMain.vue +1 -2
  28. package/src/base-client/components/iot/MeterDetailsView/part/MeterDetailsSellGas.vue +1 -2
  29. package/src/base-client/components/iot/WebmeterAnalysisView/WebmeterAnalysisView.vue +1 -2
  30. package/src/base-client/components/system/DictionaryDetailsView/DictionaryDetailsView.vue +1 -2
  31. package/src/base-client/components/system/QueryParamsDetailsView/QueryParamsDetailsView.vue +1 -2
  32. package/src/base-client/components/ticket/EmployeeDetailsView/EmployeeDetailsView.vue +1 -2
  33. package/src/base-client/components/ticket/TicketDetailsView/TicketDetailsView.vue +844 -846
  34. package/src/base-client/components/ticket/TicketDetailsView/part/TicketDetailsFlow.vue +1 -2
  35. package/src/base-client/components/ticket/TicketSubmitSuccessView/TicketSubmitSuccessView.vue +528 -529
  36. package/src/base-client/plugins/AppData.js +1 -2
  37. package/src/base-client/plugins/GetLoginInfoService.js +45 -14
  38. package/src/components/exception/ExceptionPage.vue +1 -1
  39. package/src/config/CreateQueryConfig.js +72 -40
  40. package/src/layouts/ComponentLayoutOne.vue +0 -1
  41. package/src/layouts/SinglePageView.vue +1 -1
  42. package/src/layouts/header/HeaderNotice.vue +1 -1
  43. package/src/pages/report/ReportTableHome.vue +1 -1
  44. package/src/pages/system/ticket/index.vue +437 -438
  45. package/src/pages/system/ticket/submitTicketSuccess.vue +1 -2
  46. package/src/services/api/EmployeeDetailsViewApi.js +16 -16
  47. package/src/services/api/index.js +39 -0
  48. package/src/services/{api.js → apiService.js} +0 -0
  49. package/src/services/user.js +1 -1
  50. package/src/store/modules/account.js +2 -2
  51. package/src/utils/indexedDB.js +1 -1
  52. package/src/utils/routerUtil.js +7 -13
  53. package/src/utils/util.js +12 -0
package/.eslintrc.js CHANGED
@@ -1,81 +1,82 @@
1
- module.exports = {
2
- root: true,
3
- env: {
4
- node: true
5
- },
6
- 'extends': [
7
- 'plugin:vue/essential',
8
- 'plugin:vue/strongly-recommended',
9
- '@vue/standard'
10
- ],
11
- rules: {
12
- 'no-console': 'off',
13
- 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
14
- 'generator-star-spacing': 'off',
15
- 'no-mixed-operators': 0,
16
- 'vue/max-attributes-per-line': [
17
- 2,
18
- {
19
- 'singleline': 5,
20
- 'multiline': {
21
- 'max': 1,
22
- 'allowFirstLine': false
23
- }
24
- }
25
- ],
26
- 'vue/attribute-hyphenation': 0,
27
- 'vue/html-self-closing': 0,
28
- 'vue/component-name-in-template-casing': 0,
29
- 'vue/html-closing-bracket-spacing': 0,
30
- 'vue/singleline-html-element-content-newline': 0,
31
- 'vue/no-unused-components': 0,
32
- 'vue/multiline-html-element-content-newline': 0,
33
- 'vue/no-use-v-if-with-v-for': 0,
34
- 'vue/html-closing-bracket-newline': 0,
35
- 'vue/no-parsing-error': 0,
36
- 'vue/name-property-casing': 0,
37
- 'no-tabs': 0,
38
- 'quotes': [
39
- 2,
40
- 'single',
41
- {
42
- 'avoidEscape': true,
43
- 'allowTemplateLiterals': true
44
- }
45
- ],
46
- 'semi': [
47
- 2,
48
- 'never',
49
- {
50
- 'beforeStatementContinuationChars': 'never'
51
- }
52
- ],
53
- 'no-delete-var': 2,
54
- 'prefer-const': [
55
- 2,
56
- {
57
- 'ignoreReadBeforeAssign': false
58
- }
59
- ],
60
- 'template-curly-spacing': 'off',
61
- 'indent': 'off',
62
- // 必须使用全等: false
63
- 'eqeqeq': 0,
64
- // 可以使用!! 双重否定
65
- 'no-extra-boolean-cast': 'off'
66
- },
67
- parserOptions: {
68
- parser: 'babel-eslint'
69
- },
70
- overrides: [
71
- {
72
- files: [
73
- '**/__tests__/*.{j,t}s?(x)',
74
- '**/tests/unit/**/*.spec.{j,t}s?(x)'
75
- ],
76
- env: {
77
- jest: true
78
- }
79
- }
80
- ]
81
- }
1
+ module.exports = {
2
+ root: true,
3
+ env: {
4
+ node: true
5
+ },
6
+ 'extends': [
7
+ 'plugin:vue/essential',
8
+ 'plugin:vue/strongly-recommended',
9
+ '@vue/standard'
10
+ ],
11
+ rules: {
12
+ 'comma-dangle': 'off',
13
+ 'no-console': 'off',
14
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
15
+ 'generator-star-spacing': 'off',
16
+ 'no-mixed-operators': 0,
17
+ 'vue/max-attributes-per-line': [
18
+ 2,
19
+ {
20
+ 'singleline': 5,
21
+ 'multiline': {
22
+ 'max': 1,
23
+ 'allowFirstLine': false
24
+ }
25
+ }
26
+ ],
27
+ 'vue/attribute-hyphenation': 0,
28
+ 'vue/html-self-closing': 0,
29
+ 'vue/component-name-in-template-casing': 0,
30
+ 'vue/html-closing-bracket-spacing': 0,
31
+ 'vue/singleline-html-element-content-newline': 0,
32
+ 'vue/no-unused-components': 0,
33
+ 'vue/multiline-html-element-content-newline': 0,
34
+ 'vue/no-use-v-if-with-v-for': 0,
35
+ 'vue/html-closing-bracket-newline': 0,
36
+ 'vue/no-parsing-error': 0,
37
+ 'vue/name-property-casing': 0,
38
+ 'no-tabs': 0,
39
+ 'quotes': [
40
+ 2,
41
+ 'single',
42
+ {
43
+ 'avoidEscape': true,
44
+ 'allowTemplateLiterals': true
45
+ }
46
+ ],
47
+ 'semi': [
48
+ 2,
49
+ 'never',
50
+ {
51
+ 'beforeStatementContinuationChars': 'never'
52
+ }
53
+ ],
54
+ 'no-delete-var': 2,
55
+ 'prefer-const': [
56
+ 2,
57
+ {
58
+ 'ignoreReadBeforeAssign': false
59
+ }
60
+ ],
61
+ 'template-curly-spacing': 'off',
62
+ 'indent': 'off',
63
+ // 必须使用全等: false
64
+ 'eqeqeq': 0,
65
+ // 可以使用!! 双重否定
66
+ 'no-extra-boolean-cast': 'off'
67
+ },
68
+ parserOptions: {
69
+ parser: 'babel-eslint'
70
+ },
71
+ overrides: [
72
+ {
73
+ files: [
74
+ '**/__tests__/*.{j,t}s?(x)',
75
+ '**/tests/unit/**/*.spec.{j,t}s?(x)'
76
+ ],
77
+ env: {
78
+ jest: true
79
+ }
80
+ }
81
+ ]
82
+ }
package/CHANGELOG.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
+ **##1.2.28 -2022-03-29 @朱子峰**
5
+ - 功能修改:
6
+ - [Cookie]:去除自定义Cookie
7
+
8
+ **##1.2.27 -2022-03-29 @朱子峰**
9
+ - 功能新增:
10
+ - [XAddNativeForm]:将XAddForm从模态框中抽取,用于页面直接展示Form
11
+
4
12
  **##1.2.25 -2022-03-26 @江超**
5
13
  - 功能修改:
6
14
  - [查询配置生成]:表单[新增/修改场景]增加[version(版本号)]类型
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.2.25",
3
+ "version": "1.2.28-test",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -307,7 +307,7 @@
307
307
  <a-col :span="8" v-if="item.groupIndex !== 1">
308
308
  <a-form-model-item label="数据所属节点" prop="groupIndex">
309
309
  <a-select v-model="item.parent_title" placeholder="请选择父节点" ref="groupIndex" @change="parent_title_change">
310
- <a-select-option v-for="item in parent_node" :key="item.key">{{ item.title }}</a-select-option>
310
+ <a-select-option v-for="parent_item in parent_node" :key="parent_item.key">{{ parent_item.title }}</a-select-option>
311
311
  <a-popover slot="suffixIcon" title="关于父节点" placement="bottom">
312
312
  <template slot="content">
313
313
  <p>多个下拉框为一组时,需要首先选择的为父节点</p>
@@ -596,8 +596,7 @@ import JsonViewer from 'vue-json-viewer'
596
596
  import FileSaver from 'file-saver'
597
597
  import { queryType } from '@/config/CreateQueryConfig'
598
598
  import { mapState } from 'vuex'
599
- import { post } from '@vue2-client/services/api/restTools'
600
- import { commonApi } from '@vue2-client/services/api/common'
599
+ import { commonApi, post } from '@vue2-client/services/api'
601
600
  const DemoJson = [{ value: 'zhejiang', label: 'Zhejiang', children: [{ value: 'hangzhou', label: 'Hangzhou', children: [{ value: 'xihu', label: 'West Lake' }] }] }]
602
601
  export default {
603
602
  name: 'CreateQuery',
@@ -400,8 +400,7 @@ import JsonViewer from 'vue-json-viewer'
400
400
  import FileSaver from 'file-saver'
401
401
  import { queryType } from '@/config/CreateQueryConfig'
402
402
  import { mapState } from 'vuex'
403
- import { post } from '@vue2-client/services/api/restTools'
404
- import { commonApi } from '@vue2-client/services/api/common'
403
+ import { commonApi, post } from '@vue2-client/services/api'
405
404
  const DemoJson = [{ value: 'zhejiang', label: 'Zhejiang', children: [{ value: 'hangzhou', label: 'Hangzhou', children: [{ value: 'xihu', label: 'West Lake' }] }] }]
406
405
  export default {
407
406
  name: 'CreateSimpleFormQuery',
@@ -34,8 +34,7 @@
34
34
  <script>
35
35
  import { mapState } from 'vuex'
36
36
  import XAddForm from '@vue2-client/base-client/components/common/XAddForm/XAddForm'
37
- import { commonApi } from '@vue2-client/services/api/common'
38
- import { post } from '@vue2-client/services/api/restTools'
37
+ import { commonApi, post } from '@vue2-client/services/api'
39
38
 
40
39
  export default {
41
40
  name: 'FormGroupEdit',
@@ -47,7 +47,7 @@
47
47
  import XFormItem from '@vue2-client/base-client/components/common/XForm/XFormItem'
48
48
  import { formatDate } from '@vue2-client/utils/util'
49
49
  import { mapState } from 'vuex'
50
- import { post } from '@vue2-client/services/api/restTools'
50
+ import { post } from '@vue2-client/services/api'
51
51
 
52
52
  export default {
53
53
  name: 'XAddForm',
@@ -0,0 +1,315 @@
1
+ <template>
2
+ <div class="table-page-search-wrapper">
3
+ <a-form-model
4
+ v-if="loaded"
5
+ ref="selectForm"
6
+ :model="form"
7
+ :rules="rules">
8
+ <a-row :gutter="16">
9
+ <x-form-item
10
+ v-for="(item, index) in realJsonData"
11
+ mode="新增/修改"
12
+ :attr="item"
13
+ :form="form"
14
+ :key="index"
15
+ :disabled="itemDisabled(item)"
16
+ :xl="12"
17
+ :xxl="8"
18
+ />
19
+ <div v-for="group in realJsonSelectsData" :key="group[0].group">
20
+ <x-form-col v-for="groupItem in group" :key="groupItem.group + groupItem.groupIndex" :xl="12" :xxl="8">
21
+ <a-form-model-item :label="groupItem.name" :disabled="itemDisabled(groupItem)">
22
+ <a-select v-model="form[groupItem.model]" :disabled="itemDisabledPlus(groupItem.group,groupItem.groupIndex)" :allowClear="true" @change="selectsItemCheck(groupItem.group,groupItem.groupIndex,form[groupItem.model],group)" placeholder="请选择">
23
+ <template v-for="option in SelectsArray[groupItem.group][groupItem.groupIndex]">
24
+ <a-select-option :key="option.label" :value="option.value">
25
+ {{ option.label }}
26
+ </a-select-option>
27
+ </template>
28
+ </a-select>
29
+ </a-form-model-item>
30
+ </x-form-col>
31
+ </div>
32
+ </a-row>
33
+ </a-form-model>
34
+ </div>
35
+ </template>
36
+ <script>
37
+ import XFormItem from '@vue2-client/base-client/components/common/XForm/XFormItem'
38
+ import { formatDate } from '@vue2-client/utils/util'
39
+ import { mapState } from 'vuex'
40
+ import { post } from '@vue2-client/services/api'
41
+
42
+ export default {
43
+ name: 'XAddNativeForm',
44
+ components: {
45
+ XFormItem
46
+ },
47
+ data () {
48
+ return {
49
+ // 内容加载是否完成
50
+ loaded: false,
51
+ // 表单Model
52
+ form: undefined,
53
+ // 多层下拉框组 数据储存
54
+ SelectsArray: {},
55
+ // 多层下拉框组 各组数量
56
+ SelectsNumber: {},
57
+ // 校验
58
+ rules: {},
59
+ // 图标样式
60
+ iconStyle: {
61
+ position: 'relative',
62
+ top: '1px'
63
+ }
64
+ }
65
+ },
66
+ computed: {
67
+ // 过滤出用于新增/修改场景的表单项
68
+ realJsonData: function () {
69
+ return this.jsonData.filter(function (item) {
70
+ return item.addOrEdit && item.addOrEdit !== 'no' && item.addOrEdit !== 'silenceAdd' && !item.group
71
+ })
72
+ },
73
+ // 过滤出多个下拉框分组级联得数据
74
+ realJsonSelectsData: function () {
75
+ const Selectsata = this.jsonData.filter(item => !item.isOnlyAddOrEdit && item.group)
76
+ const groupName = [...new Set(Selectsata.map(item => item.group))]
77
+ // 初始化数据组
78
+ groupName.forEach(item => {
79
+ this.SelectsArray[item] = []
80
+ })
81
+ return groupName.map(groupName => {
82
+ const SelectsItem = Selectsata.filter(item => {
83
+ if (item.groupIndex === 1) {
84
+ if (item.keyName.substring(0, 6) === 'logic@') {
85
+ // 请求logic
86
+ post('/webmeterapi/' + item.keyName.substring(6), {}).then(res => {
87
+ this.SelectsArray[item.group][item.groupIndex] = res
88
+ })
89
+ } else {
90
+ this.SelectsArray[item.group][item.groupIndex] = JSON.parse(item.keyName)
91
+ }
92
+ }
93
+ return item.group === groupName
94
+ }
95
+ )
96
+ this.SelectsNumber[groupName] = SelectsItem.length ? SelectsItem.length : 0
97
+ return SelectsItem
98
+ })
99
+ },
100
+ // 过滤出用于静默新增场景的表单项
101
+ silenceAddJsonData: function () {
102
+ return this.jsonData.filter(function (item) {
103
+ return item.addOrEdit === 'silenceAdd'
104
+ })
105
+ },
106
+ // 过滤出版本号表单项
107
+ versionJsonData: function () {
108
+ return this.jsonData.filter(function (item) {
109
+ return item.addOrEdit === 'version'
110
+ })
111
+ },
112
+ ...mapState('account', { currUser: 'user' })
113
+ },
114
+ props: {
115
+ jsonData: {
116
+ type: Array,
117
+ default: () => {
118
+ return []
119
+ }
120
+ },
121
+ // 业务类型
122
+ businessType: {
123
+ type: String,
124
+ default: ''
125
+ },
126
+ // 修改操作前查询出的业务数据
127
+ modifyModelData: {
128
+ type: Object,
129
+ default: () => {
130
+ return {}
131
+ }
132
+ },
133
+ // 新增或修改业务是否执行中
134
+ loading: {
135
+ type: Boolean,
136
+ default: () => {
137
+ return false
138
+ }
139
+ },
140
+ // 固定新增表单
141
+ fixedAddForm: {
142
+ type: Object,
143
+ default: () => {
144
+ return {}
145
+ }
146
+ }
147
+ },
148
+ watch: {
149
+ visible (rel) {
150
+ if (rel) {
151
+ this.formItemLoad()
152
+ }
153
+ }
154
+ },
155
+ mounted () {
156
+ this.formItemLoad()
157
+ },
158
+ methods: {
159
+ selectsItemCheck (groupName, index, value, group) {
160
+ const tem = { }
161
+ // 获取当前下拉框子下拉框的数据
162
+ this.SelectsArray[groupName][index + 1] = this.SelectsArray[groupName][index].filter(item => item.value === value)[0].children
163
+ // 清空子下拉框的子们的数据
164
+ for (let i = index; i < this.SelectsNumber[groupName]; i++) {
165
+ tem[group[i].model] = undefined
166
+ }
167
+ this.form = Object.assign({}, this.form, tem)
168
+ // 清空子下拉框的子们的数据源
169
+ for (let i = index + 2; i <= this.SelectsNumber[groupName]; i++) {
170
+ this.SelectsArray[groupName][i] = []
171
+ }
172
+ },
173
+ formItemLoad () {
174
+ const formData = Object.assign({}, this.fixedAddForm)
175
+ for (let i = 0; i < this.realJsonData.length; i++) {
176
+ const item = this.realJsonData[i]
177
+ formData[item.model] = undefined
178
+ // 处理表单校验情况
179
+ if (item.rule) {
180
+ this.rules[item.model] = []
181
+ const required = item.rule.required ? item.rule.required === true || item.rule.required === 'true' : false
182
+ let trigger
183
+ let message
184
+ if (required) {
185
+ switch (item.type) {
186
+ case 'select':
187
+ message = '请选择' + item.name
188
+ trigger = 'change'
189
+ break
190
+ default:
191
+ message = '请输入' + item.name
192
+ trigger = 'blur'
193
+ }
194
+ this.rules[item.model].push({
195
+ required: true,
196
+ message: message,
197
+ trigger: trigger
198
+ })
199
+ }
200
+
201
+ switch (item.rule.type) {
202
+ case 'number':
203
+ case 'integer':
204
+ case 'float':
205
+ let defaultValue
206
+ let message
207
+ switch (item.rule.type) {
208
+ case 'number':
209
+ message = '数字'
210
+ defaultValue = 0
211
+ break
212
+ case 'integer':
213
+ message = '整数'
214
+ defaultValue = 0
215
+ break
216
+ case 'float':
217
+ message = '小数'
218
+ defaultValue = 0.0
219
+ break
220
+ }
221
+ this.rules[item.model].push({
222
+ type: item.rule.type,
223
+ message: item.name + '必须为' + message,
224
+ transform: (value) => {
225
+ if (value && value.length !== 0) {
226
+ return Number(value)
227
+ } else {
228
+ return defaultValue
229
+ }
230
+ },
231
+ trigger: 'blur'
232
+ })
233
+ break
234
+ }
235
+ }
236
+ }
237
+ this.form = formData
238
+ if (Object.keys(this.modifyModelData).length > 0) {
239
+ this.getModifyModelData()
240
+ }
241
+ this.loaded = true
242
+ },
243
+ itemDisabled (value) {
244
+ return (this.businessType === '新增' && value.addOrEdit === 'edit') ||
245
+ (this.businessType === '修改' && value.addOrEdit === 'add')
246
+ },
247
+ itemDisabledPlus (group, index) {
248
+ return (!this.SelectsArray[group][index]) || (this.SelectsArray[group][index] && this.SelectsArray[group][index].length === 0)
249
+ },
250
+ resetForm () {
251
+ this.$refs.selectForm.resetFields()
252
+ },
253
+ async onSubmit () {
254
+ this.$refs.selectForm.validate(async valid => {
255
+ for (const key of Object.keys(this.form)) {
256
+ if (this.form[key] === null || this.form[key] === '') {
257
+ this.form[key] = undefined
258
+ }
259
+ }
260
+ const requestParameters = Object.assign({}, this.form)
261
+ // 追加静默新增字段
262
+ if (this.businessType === '新增') {
263
+ for (const item of this.silenceAddJsonData) {
264
+ switch (item.silencePurpose) {
265
+ case 'createTime':
266
+ requestParameters[item.model] = formatDate('now')
267
+ break
268
+ case 'operator':
269
+ requestParameters[item.model] = this.currUser.name
270
+ break
271
+ case 'orgId':
272
+ requestParameters[item.model] = this.currUser.orgid
273
+ break
274
+ }
275
+ }
276
+ // 通过请求追加静默新增:自定义字段
277
+ for (const item of this.silenceAddJsonData.filter((item) => item.silencePurpose === 'customize')) {
278
+ requestParameters[item.model] = await this.getSilenceSource(item.silenceSource, requestParameters)
279
+ }
280
+ }
281
+ const data = {
282
+ valid: valid,
283
+ form: requestParameters
284
+ }
285
+ this.$emit('onSubmit', data)
286
+ })
287
+ },
288
+ async getSilenceSource (silenceSource, requestParameters) {
289
+ const result = await post('/webmeterapi/' + silenceSource, requestParameters)
290
+ return result
291
+ },
292
+ getModifyModelData () {
293
+ for (let i = 0; i < this.realJsonData.length; i++) {
294
+ const item = this.realJsonData[i]
295
+ if (this.modifyModelData[item.model] || this.modifyModelData[item.model] === 0) {
296
+ this.form[item.model] = this.modifyModelData[item.model] + ''
297
+ } else {
298
+ this.form[item.model] = undefined
299
+ }
300
+ }
301
+ // 追加版本号信息
302
+ for (const item of this.versionJsonData) {
303
+ if (!this.modifyModelData[item.model]) {
304
+ this.form[item.model] = 0
305
+ } else {
306
+ this.form[item.model] = this.modifyModelData[item.model] + ''
307
+ }
308
+ }
309
+ },
310
+ onClose () {
311
+ this.$emit('update:visible', false)
312
+ }
313
+ }
314
+ }
315
+ </script>
@@ -0,0 +1,3 @@
1
+ import XAddNativeForm from './XAddNativeForm'
2
+
3
+ export default XAddNativeForm
@@ -0,0 +1,56 @@
1
+ # XAddNativeForm
2
+
3
+ 动态新增/修改表单控件,根据JSON配置生成一个完整的可供新增/修改数据的动态表单
4
+
5
+
6
+ ## 何时使用
7
+
8
+ 当需要一个可供新增/修改数据的动态生成的表单时
9
+
10
+
11
+ 引用方式:
12
+
13
+ ```javascript
14
+ import XAddNativeForm from '@vue2-client/base-client/components/XAddNativeForm/XAddNativeForm'
15
+
16
+ export default {
17
+ components: {
18
+ XAddNativeForm
19
+ }
20
+ }
21
+ ```
22
+
23
+
24
+
25
+ ## 代码演示
26
+
27
+ ```html
28
+ <x-add-form
29
+ :business-type="businessType"
30
+ :json-data="formItems"
31
+ :modify-model-data="modifyModelData"
32
+ :loading="loading"
33
+ @onSubmit="onSubmit">
34
+ </x-add-form>
35
+ ```
36
+
37
+ ## API
38
+
39
+ | 参数 | 说明 | 类型 | 默认值 |
40
+ |-----------------|--------------------------|---------|-------|
41
+ | businessType | 业务类型 | String | '' |
42
+ | jsonData | JSON配置,根据[工具>查询配置生成]功能生成 | Object | {} |
43
+ | modifyModelData | 修改操作前查询出的业务数据 | Object | {} |
44
+ | loading | 新增或修改业务是否执行中 | Boolean | false |
45
+ | fixedAddForm | 固定新增表单,会和新增表单合并 | Object | {} |
46
+ | @onSubmit | 表单的提交事件 | event | - |
47
+
48
+ ## 例子1
49
+ ----
50
+ 参考XFormTable组件
51
+ ```
52
+
53
+ 注意事项
54
+ ----
55
+
56
+ > 本组件已经实现了自适应布局,在不同分辨率下的设备均可得到基本理想的展示效果
@@ -70,7 +70,7 @@
70
70
  </template>
71
71
  <script>
72
72
  import XFormItem from '@vue2-client/base-client/components/common/XForm/XFormItem'
73
- import { post } from '@vue2-client/services/api/restTools'
73
+ import { post } from '@vue2-client/services/api'
74
74
 
75
75
  export default {
76
76
  name: 'XForm',
@@ -165,7 +165,7 @@
165
165
  </template>
166
166
  <script>
167
167
 
168
- import { post } from '@vue2-client/services/api/restTools'
168
+ import { post } from '@vue2-client/services/api'
169
169
  import { debounce } from 'ant-design-vue/lib/vc-table/src/utils'
170
170
 
171
171
  export default {
@@ -57,11 +57,10 @@
57
57
  import XForm from '@vue2-client/base-client/components/common/XForm/XForm'
58
58
  import XAddForm from '@vue2-client/base-client/components/common/XAddForm/XAddForm'
59
59
  import XTable from '@vue2-client/base-client/components/common/XTable/XTable'
60
- import { query, commonApi, addOrModify, remove } from '@vue2-client/services/api/common'
60
+ import { commonApi, query, addOrModify, remove, post } from '@vue2-client/services/api'
61
61
  import { indexedDB } from '@vue2-client/utils/indexedDB'
62
62
  import { mapState } from 'vuex'
63
63
  import { Modal } from 'ant-design-vue'
64
- import { post } from '@vue2-client/services/api/restTools'
65
64
 
66
65
  export default {
67
66
  name: 'XFormTable',
@@ -74,8 +74,7 @@
74
74
 
75
75
  <script>
76
76
  import { formatDate } from '@vue2-client/utils/util'
77
- import { CustomerDetailsViewApi } from '@vue2-client/services/api/CustomerDetailsViewApi'
78
- import { post } from '@vue2-client/services/api/restTools'
77
+ import { CustomerDetailsViewApi, post } from '@vue2-client/services/api'
79
78
  import { mapState } from 'vuex'
80
79
 
81
80
  export default {