vue2-client 1.8.81 → 1.8.83

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 (23) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/package.json +1 -1
  3. package/src/base-client/components/common/XForm/XFormItem.vue +37 -23
  4. package/src/base-client/components/common/XFormTable/XFormTable.vue +2 -2
  5. package/src/base-client/components/index.js +0 -6
  6. package/src/router/async/router.map.js +0 -2
  7. package/src/services/api/common.js +30 -33
  8. package/src/base-client/components/common/CreateQuery/CreateQuery.vue +0 -669
  9. package/src/base-client/components/common/CreateQuery/CreateQueryItem.vue +0 -1014
  10. package/src/base-client/components/common/CreateQuery/index.js +0 -3
  11. package/src/base-client/components/common/CreateQuery/index.md +0 -42
  12. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQuery.vue +0 -452
  13. package/src/base-client/components/common/CreateSimpleFormQuery/CreateSimpleFormQueryItem.vue +0 -511
  14. package/src/base-client/components/common/CreateSimpleFormQuery/index.js +0 -3
  15. package/src/base-client/components/common/CreateSimpleFormQuery/index.md +0 -42
  16. package/src/base-client/components/common/FormGroupEdit/FormGroupEdit.vue +0 -149
  17. package/src/base-client/components/common/FormGroupEdit/index.js +0 -3
  18. package/src/base-client/components/common/FormGroupEdit/index.md +0 -43
  19. package/src/base-client/components/common/FormGroupQuery/FormGroupQuery.vue +0 -166
  20. package/src/base-client/components/common/FormGroupQuery/index.js +0 -3
  21. package/src/base-client/components/common/FormGroupQuery/index.md +0 -43
  22. package/src/config/CreateQueryConfig.js +0 -322
  23. package/src/pages/CreateQueryPage.vue +0 -160
package/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
+ **1.8.82 - 1.8.83 -2024-3-7 @江超**
5
+ - 删除过时组件
6
+ - XFormItem的下拉框数据源现在支持从配置中心获取了
7
+ - 待解决:XTable显示来自配置中心的字典徽标
8
+
4
9
  **1.8.79 -2024-3-6 @江超**
5
10
  - 增加实体保存的方法
6
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.8.81",
3
+ "version": "1.8.83",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -35,17 +35,25 @@
35
35
  <template v-if="attr.keys">
36
36
  <a-select-option
37
37
  v-for="(item,index) in attr.keys"
38
- :key="index"
38
+ :key="index.value"
39
39
  :value="item.value">
40
40
  {{ item.label }}
41
41
  </a-select-option>
42
42
  </template>
43
43
  <template v-else>
44
- <template v-if="attr.keyName.indexOf('logic@') !== -1">
44
+ <template v-if="attr.keyName.indexOf('logic@') !== -1 || attr.keyName.indexOf('config@') !== -1">
45
45
  <a-select-option
46
46
  v-for="(item,index) in option"
47
- :key="index"
48
- :value="item.value">{{ item.label }}
47
+ :key="index.value"
48
+ :value="item.value">
49
+ <template v-if="attr.keyName.indexOf('config@') !== -1 && item.status">
50
+ <!-- 徽标(badge) -->
51
+ <a-badge v-if="item.status !== 'gary'" :color="item.status" :text="item.label"/>
52
+ <a-badge v-else color="#D9D9D9" :text="item.label"/>
53
+ </template>
54
+ <template v-else>
55
+ {{ item.label }}
56
+ </template>
49
57
  </a-select-option>
50
58
  </template>
51
59
  <template v-else>
@@ -111,7 +119,7 @@
111
119
  </a-select-option>
112
120
  </template>
113
121
  <template v-else>
114
- <template v-if="attr.keyName.indexOf('logic@') !== -1">
122
+ <template v-if="attr.keyName.indexOf('logic@') !== -1 || attr.keyName.indexOf('config@') !== -1">
115
123
  <a-select-option
116
124
  v-for="(item,index) in option"
117
125
  :key="index"
@@ -163,7 +171,7 @@
163
171
  </a-radio>
164
172
  </template>
165
173
  <template v-else>
166
- <template v-if="attr.keyName.indexOf('logic@') !== -1">
174
+ <template v-if="attr.keyName.indexOf('logic@') !== -1 || attr.keyName.indexOf('config@') !== -1">
167
175
  <a-radio v-for="(item,index) in option" :key="index" :value="item.value">
168
176
  {{ item.label }}
169
177
  </a-radio>
@@ -313,7 +321,7 @@ import AddressSearchCombobox from '@vue2-client/base-client/components/common/Ad
313
321
  import Upload from '@vue2-client/base-client/components/common/Upload'
314
322
  import moment from 'moment'
315
323
  import XTreeSelect from '@vue2-client/base-client/components/common/XForm/XTreeSelect'
316
- import { runLogic } from '@vue2-client/services/api/common'
324
+ import { getConfigByName, runLogic } from '@vue2-client/services/api/common'
317
325
 
318
326
  export default {
319
327
  name: 'XFormItem',
@@ -428,26 +436,32 @@ export default {
428
436
  }
429
437
  }
430
438
  if (this.attr.keyName && this.attr.keyName.indexOf('logic@') !== -1) {
431
- this.getData({}, res => {
432
- this.option = res
433
- if (this.attr.type === 'treeSelect') {
434
- this.$refs.xTreeSelect.init({
435
- option: this.option,
436
- form: this.form,
437
- queryType: this.attr.queryType,
438
- name: this.attr.name,
439
- model: this.attr.model,
440
- mode: this.mode,
441
- disabled: this.disabled
442
- })
443
- } else if (this.attr.type === 'radio') {
444
- this.initRadioValue()
445
- }
446
- })
439
+ this.getData({}, res => this.getDataCallback(res))
440
+ } else if (this.attr.keyName && this.attr.keyName.indexOf('config@') !== -1) {
441
+ const configName = this.attr.keyName.substring(7)
442
+ getConfigByName(configName, this.serviceName, res => {
443
+ this.getDataCallback(res.value)
444
+ }, this.env === 'dev')
447
445
  } else {
448
446
  this.initRadioValue()
449
447
  }
450
448
  },
449
+ getDataCallback (res) {
450
+ this.option = res
451
+ if (this.attr.type === 'treeSelect') {
452
+ this.$refs.xTreeSelect.init({
453
+ option: this.option,
454
+ form: this.form,
455
+ queryType: this.attr.queryType,
456
+ name: this.attr.name,
457
+ model: this.attr.model,
458
+ mode: this.mode,
459
+ disabled: this.disabled
460
+ })
461
+ } else if (this.attr.type === 'radio') {
462
+ this.initRadioValue()
463
+ }
464
+ },
451
465
  initRadioValue () {
452
466
  const model = this.attr.model
453
467
  if (this.mode === '新增/修改' && this.attr.type === 'radio' && !this.form[model]) {
@@ -205,7 +205,7 @@ export default {
205
205
  getConfig () {
206
206
  getConfigByName(this.queryParamsName, this.serviceName, (res) => {
207
207
  this.updateComponents(res)
208
- })
208
+ }, this.env === 'dev')
209
209
  },
210
210
  getConfigBySource () {
211
211
  parseConfig(this.queryParamsJson, 'CRUD_FORM', this.serviceName, this.env === 'dev').then(res => {
@@ -215,7 +215,7 @@ export default {
215
215
  getColumnJsonByLogic () {
216
216
  getConfigByLogic(this.logicName, this.logicParam, this.serviceName, (res) => {
217
217
  this.updateComponents(res, true)
218
- })
218
+ }, this.env === 'dev')
219
219
  },
220
220
  /**
221
221
  * 更新子组件
@@ -10,12 +10,8 @@ import XCard from './common/XCard'
10
10
  import XBadge from './common/XBadge'
11
11
  import Upload from './common/Upload'
12
12
  import JSONToTree from './common/JSONToTree'
13
- import FormGroupEdit from './common/FormGroupEdit'
14
- import FormGroupQuery from './common/FormGroupQuery'
15
13
  import AddressSearchCombobox from './common/AddressSearchCombobox'
16
14
  import AmapMarker from './common/AmapMarker'
17
- // import CreateQuery from './common/CreateQuery'
18
- // import CreateSimpleFormQuery from './common/CreateSimpleFormQuery'
19
15
  import PersonSetting from './common/PersonSetting'
20
16
  import XFormTable from './common/XFormTable'
21
17
  import XStepView from './common/XStepView'
@@ -34,8 +30,6 @@ export default {
34
30
  XBadge,
35
31
  Upload,
36
32
  JSONToTree,
37
- FormGroupEdit,
38
- FormGroupQuery,
39
33
  AddressSearchCombobox,
40
34
  AmapMarker,
41
35
  // CreateQuery,
@@ -33,8 +33,6 @@ routerResource.submitTicket = () => import('@vue2-client/pages/system/ticket')
33
33
  routerResource.ServiceReview = () => import('@vue2-client/pages/ServiceReview')
34
34
  // 系统设置
35
35
  routerResource.settings = () => import('@vue2-client/pages/system/settings')
36
- // 查询配置生成工具
37
- routerResource.createQuery = () => import('@vue2-client/pages/CreateQueryPage')
38
36
  // AMIS示例页面
39
37
  routerResource.amisDemo = () => import('@vue2-client/pages/AMisDemo/AMisDemo')
40
38
  // 数据检索
@@ -39,49 +39,37 @@ const commonApi = {
39
39
  getColumnsJson: '/api/af-system/logic/getColumns',
40
40
  }
41
41
 
42
- export function getConfigUrl (serviceName = process.env.VUE_APP_SYSTEM_NAME) {
43
- return '/api/' + serviceName + '/' + commonApi.getConfig
44
- }
45
-
46
- export function getNativeConfigUrl (serviceName = process.env.VUE_APP_SYSTEM_NAME) {
47
- return '/api/' + serviceName + '/' + commonApi.getNativeConfig
48
- }
49
-
50
- export function parseConfigUrl (serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
51
- let apiPre = '/api/'
52
- if (isDev) {
53
- apiPre = '/devApi/'
54
- }
55
- return apiPre + serviceName + '/' + commonApi.parseConfig
56
- }
57
-
58
- /**
59
- * 获取字典键参数
60
- */
61
- export function getDictionaryParam () {
62
- return post('/api/af-system/logic/getDictionaryParam', {})
63
- }
64
-
65
42
  /**
66
43
  * 根据配置名获取配置内容
67
44
  * @param content 已有的配置内容
68
45
  * @param configName 配置名称
69
46
  * @param serviceName 命名空间名称
70
47
  * @param callback 回调函数
48
+ * @param isDev 是否为开发环境
71
49
  */
72
- export function getConfig (content, configName, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback) {
50
+ export function getConfig (content, configName, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback, isDev) {
73
51
  if (content) {
74
52
  return content
75
53
  }
76
- indexedDB.getByWeb(configName, getConfigUrl(serviceName), { configName: configName }, callback)
54
+ let apiPre = '/api/'
55
+ if (isDev) {
56
+ apiPre = '/devApi/'
57
+ }
58
+ const getConfigUrl = apiPre + commonApi.getConfig
59
+ indexedDB.getByWeb(configName, getConfigUrl, { configName: configName }, callback)
77
60
  }
78
61
 
79
- export function getConfigByName (configName, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback) {
80
- return getConfig(undefined, configName, serviceName, callback)
62
+ export function getConfigByName (configName, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback, isDev) {
63
+ return getConfig(undefined, configName, serviceName, callback, isDev)
81
64
  }
82
65
 
83
- export function getNativeConfig (configName, serviceName = process.env.VUE_APP_SYSTEM_NAME) {
84
- return post(getNativeConfigUrl(serviceName), { configName: configName })
66
+ export function getNativeConfig (configName, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
67
+ let apiPre = '/api/'
68
+ if (isDev) {
69
+ apiPre = '/devApi/'
70
+ }
71
+ const getConfigUrl = apiPre + commonApi.getNativeConfig
72
+ return post(getConfigUrl, { configName: configName })
85
73
  }
86
74
 
87
75
  /**
@@ -90,9 +78,14 @@ export function getNativeConfig (configName, serviceName = process.env.VUE_APP_S
90
78
  * @param parameter Logic调用参数
91
79
  * @param serviceName 命名空间名称
92
80
  * @param callback 回调函数
81
+ * @param isDev 是否是开发环境
93
82
  */
94
- export function getConfigByLogic (logicName, parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback) {
95
- indexedDB.getByWeb(`${logicName}_${JSON.stringify(parameter)}`, '/api/' + serviceName + '/logic/' + logicName,
83
+ export function getConfigByLogic (logicName, parameter, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback, isDev) {
84
+ let apiPre = '/api/'
85
+ if (isDev) {
86
+ apiPre = '/devApi/'
87
+ }
88
+ indexedDB.getByWeb(`${logicName}_${JSON.stringify(parameter)}`, apiPre + serviceName + '/logic/' + logicName,
96
89
  parameter, callback)
97
90
  }
98
91
 
@@ -101,10 +94,14 @@ export function getConfigByLogic (logicName, parameter, serviceName = process.en
101
94
  * @param configContent 原配置内容
102
95
  * @param configType 配置类型
103
96
  * @param serviceName 命名空间名称
104
- * @package isDev 是否是开发环境
97
+ * @param isDev 是否是开发环境
105
98
  */
106
99
  export function parseConfig (configContent, configType, serviceName = process.env.VUE_APP_SYSTEM_NAME, isDev) {
107
- const url = parseConfigUrl(serviceName, isDev)
100
+ let apiPre = '/api/'
101
+ if (isDev) {
102
+ apiPre = '/devApi/'
103
+ }
104
+ const url = apiPre + serviceName + '/' + commonApi.parseConfig
108
105
  return post(url, {
109
106
  configType: configType,
110
107
  configContent: configContent