vue2-client 1.7.4 → 1.7.6

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 CHANGED
@@ -12,4 +12,5 @@ VUE_APP_DICTIONARY_KEY=admin.dictionary
12
12
  VUE_APP_BADGE_KEY=admin.badge
13
13
  VUE_APP_SINGLEVALUE_KEY=admin.singlevalue
14
14
  VUE_APP_DIVISIONSOHCHINA=admin.divisionsohchina
15
+ VUE_APP_WEB_CONFIG_KEY=admin.webconfig
15
16
  VUE_APP_API_BASE_URL=http://123.60.214.109:8405
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.7.4",
3
+ "version": "1.7.6",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
@@ -255,25 +255,25 @@
255
255
  </a-radio-button>
256
256
  </a-radio-group>
257
257
  </a-form-model-item>
258
+ <a-form-model-item label="关联外键字段" prop="selectKeyName">
259
+ <a-input v-model="item.selectKeyName" placeholder="该列关联的外键字段">
260
+ <a-popover slot="suffix" placement="bottom" title="关于关联外键字段">
261
+ <template slot="content">
262
+ <p><span style="font-weight: bold;"><span style="color: #FF0036">非必需的实验性功能:</span>设置该参数需开发岗指导</span></p>
263
+ <p>当字段与主子表外键有关系时,你可以指定<span style="font-weight: bold">该列所关联的外键字段名</span>
264
+ </p>
265
+ <p>设置该参数是为了该字段用作表单查询时,系统可以通过设置的关联外键字段,而非字面值作为查询条件</p>
266
+ <p>示例:</p>
267
+ <p>主表为t_userfiles(表档案)表,别名为u,与t_gasbrand(气表品牌表)有关联关系,别名为g,为了显示表档案对应的气表品牌数据,我们将数据字段名设置为g.f_gasbrand</p>
268
+ <p>这样我们就可以在table中看到气表品牌了,但是用户如果通过气表品牌下拉框进行筛选,我们指定的g.f_gasbrand只是气表品牌的值,而实际关联字段是u.f_gasbrand_id</p>
269
+ <p>所以如果我们指定了关联外键字段u.f_gasbrand_id,系统则会使用u.f_gasbrand_id筛选数据,而不是g.f_gasbrand,从而优化了查询效率
270
+ </p>
271
+ </template>
272
+ <a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
273
+ </a-popover>
274
+ </a-input>
275
+ </a-form-model-item>
258
276
  </template>
259
- <a-form-model-item v-if="selectDataShow || item.groupIndexView" label="关联外键字段" prop="selectKeyName">
260
- <a-input v-model="item.selectKeyName" placeholder="该列关联的外键字段">
261
- <a-popover slot="suffix" placement="bottom" title="关于关联外键字段">
262
- <template slot="content">
263
- <p><span style="font-weight: bold;"><span style="color: #FF0036">非必需的实验性功能:</span>设置该参数需开发岗指导</span></p>
264
- <p>当字段与主子表外键有关系时,你可以指定<span style="font-weight: bold">该列所关联的外键字段名</span>
265
- </p>
266
- <p>设置该参数是为了该字段用作表单查询时,系统可以通过设置的关联外键字段,而非字面值作为查询条件</p>
267
- <p>示例:</p>
268
- <p>主表为t_userfiles(表档案)表,别名为u,与t_gasbrand(气表品牌表)有关联关系,别名为g,为了显示表档案对应的气表品牌数据,我们将数据字段名设置为g.f_gasbrand</p>
269
- <p>这样我们就可以在table中看到气表品牌了,但是用户如果通过气表品牌下拉框进行筛选,我们指定的g.f_gasbrand只是气表品牌的值,而实际关联字段是u.f_gasbrand_id</p>
270
- <p>所以如果我们指定了关联外键字段u.f_gasbrand_id,系统则会使用u.f_gasbrand_id筛选数据,而不是g.f_gasbrand,从而优化了查询效率
271
- </p>
272
- </template>
273
- <a-icon style="color: rgba(0,0,0,.45)" type="info-circle"/>
274
- </a-popover>
275
- </a-input>
276
- </a-form-model-item>
277
277
  <template v-if="item.formType === 'file' || item.formType === 'image'">
278
278
  <a-divider style="font-size: 14px;margin-top: 0">文件上传相关</a-divider>
279
279
  <a-form-model-item label="允许上传文件数量" prop="accept" style="margin-bottom: 5px;">
@@ -456,7 +456,6 @@ export default {
456
456
  accept: undefined,
457
457
  acceptCount: 3,
458
458
  pathKey: undefined,
459
- groupIndexView: undefined,
460
459
  selectType: undefined,
461
460
  selectKey: undefined,
462
461
  addOrEdit: 'all',
@@ -511,8 +510,6 @@ export default {
511
510
  pathKey: undefined,
512
511
  accept: undefined,
513
512
  selectType: undefined,
514
- groupIndex: undefined,
515
- groupIndexView: undefined,
516
513
  addOrEdit: 'all',
517
514
  selectKeyName: undefined,
518
515
  resUploadStock: undefined,
@@ -71,6 +71,11 @@ const GetAppDataService = {
71
71
  getSingleValues () {
72
72
  const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
73
73
  return JSON.parse(str)
74
+ },
75
+ getWebConfigByKey (key) {
76
+ const str = localStorage.getItem(process.env.VUE_APP_WEB_CONFIG_KEY)
77
+ const object = JSON.parse(str)
78
+ return object[key]
74
79
  }
75
80
  }
76
81
  export default GetAppDataService
@@ -16,22 +16,50 @@
16
16
  >
17
17
  <a-textarea v-model="importEditJson" placeholder="输入现有的JSON配置"/>
18
18
  </a-modal>
19
- <a-button style="margin-top: 10px;margin-left: 10px;" type="primary" @click="showDrawer">创建查询配置
20
- </a-button>
21
- <a-button style="margin-top: 10px;margin-left: 10px;" type="primary" @click="openImportView(1)">导入已有查询配置
22
- </a-button>
23
- <br/>
24
- <a-button style="margin-top: 10px;margin-left: 10px;" type="primary" @click="showSimpleFormQueryParamsDrawer">
25
- 创建简易表单配置
26
- </a-button>
27
- <a-button style="margin-top: 10px;margin-left: 10px;" type="primary" @click="openImportView(2)">导入已有简易表单配置
28
- </a-button>
19
+ <a-modal
20
+ :visible="liuliModalVisible"
21
+ title="从琉璃中心获取配置"
22
+ @cancel="liuliModalVisible = false"
23
+ @ok="getLiuLiConfigHandleOk"
24
+ >
25
+ <a-form-model :model="form" :rules="rules" ref="liuliModel">
26
+ <a-form-model-item label="命名空间" prop="namespaceName">
27
+ <a-input v-model="form.namespaceName" :placeholder="'默认值:' + this.defaultServiceName"/>
28
+ </a-form-model-item>
29
+ <a-form-model-item label="配置名称" prop="configName">
30
+ <a-input v-model="form.configName"/>
31
+ </a-form-model-item>
32
+ </a-form-model>
33
+ </a-modal>
34
+ <a-card title="查询配置管理">
35
+ <a-space>
36
+ <a-button type="primary" @click="showDrawer">创建新的配置
37
+ </a-button>
38
+ <a-button type="primary" @click="openImportView(1)">从JSON文本导入
39
+ </a-button>
40
+ <a-button type="primary" @click="openLiuLiConfigModalView(1)">从琉璃中心导入
41
+ </a-button>
42
+ </a-space>
43
+ </a-card>
44
+ <a-card title="简易表单配置管理" style="margin-top: 20px">
45
+ <a-space>
46
+ <a-button type="primary" @click="showSimpleFormQueryParamsDrawer">
47
+ 创建新的配置
48
+ </a-button>
49
+ <a-button type="primary" @click="openImportView(2)">从JSON文本导入
50
+ </a-button>
51
+ <a-button type="primary" @click="openLiuLiConfigModalView(2)">从琉璃中心导入
52
+ </a-button>
53
+ </a-space>
54
+ </a-card>
29
55
  </div>
30
56
  </template>
31
57
 
32
58
  <script>
33
59
  import CreateQuery from '@vue2-client/base-client/components/common/CreateQuery'
34
60
  import CreateSimpleFormQuery from '@vue2-client/base-client/components/common/CreateSimpleFormQuery'
61
+ import { mapState } from 'vuex'
62
+ import { getNativeConfig } from '@vue2-client/services/api/common'
35
63
 
36
64
  export default {
37
65
  name: 'CreateQueryPage',
@@ -41,15 +69,27 @@ export default {
41
69
  },
42
70
  data () {
43
71
  return {
72
+ isLoaded: false,
44
73
  visible: false,
45
74
  createSimpleFormVisible: false,
46
75
  toEditJson: undefined,
47
76
  toEditSimpleFormJson: undefined,
48
77
  importJsonVisible: false,
78
+ liuliModalVisible: false,
49
79
  type: undefined,
50
- importEditJson: ''
80
+ importEditJson: '',
81
+ form: {
82
+ namespaceName: undefined,
83
+ configName: undefined
84
+ },
85
+ rules: {
86
+ configName: [{ required: true, message: '请输入配置名称', trigger: 'blur' }]
87
+ }
51
88
  }
52
89
  },
90
+ computed: {
91
+ ...mapState('setting', ['defaultServiceName'])
92
+ },
53
93
  methods: {
54
94
  showDrawer () {
55
95
  this.visible = true
@@ -57,6 +97,10 @@ export default {
57
97
  showSimpleFormQueryParamsDrawer () {
58
98
  this.createSimpleFormVisible = true
59
99
  },
100
+ openLiuLiConfigModalView (type) {
101
+ this.type = type
102
+ this.liuliModalVisible = true
103
+ },
60
104
  openImportView (type) {
61
105
  this.type = type
62
106
  this.importJsonVisible = true
@@ -72,8 +116,34 @@ export default {
72
116
  }
73
117
  } catch (e) {
74
118
  this.$message.warn('操作失败,输入配置不是JSON格式')
119
+ } finally {
120
+ this.importJsonVisible = false
121
+ }
122
+ },
123
+ getLiuLiConfigHandleOk () {
124
+ try {
125
+ this.$refs.liuliModel.validate(valid => {
126
+ if (valid) {
127
+ getNativeConfig(this.form.configName, this.form.namespaceName).then(res => {
128
+ console.warn(res)
129
+ if (this.type === 1) {
130
+ this.toEditJson = res
131
+ this.showDrawer()
132
+ } else {
133
+ this.toEditSimpleFormJson = res
134
+ this.showSimpleFormQueryParamsDrawer()
135
+ }
136
+ })
137
+ } else {
138
+ return false
139
+ }
140
+ })
141
+ } catch (e) {
142
+ this.$message.error('操作失败:' + e)
143
+ throw e
144
+ } finally {
145
+ this.liuliModalVisible = false
75
146
  }
76
- this.importJsonVisible = false
77
147
  },
78
148
  }
79
149
  }
@@ -64,6 +64,7 @@ import { positions } from '@vue2-client/mock/common'
64
64
  import { timeFix } from '@vue2-client/utils/util'
65
65
  import { loginStart } from '@vue2-client/base-client/plugins/compatible/LoginServiceOA'
66
66
  import { indexedDB } from '@vue2-client/utils/indexedDB'
67
+ import { getConfig } from '@vue2-client/services/api'
67
68
 
68
69
  export default {
69
70
  name: 'Login',
@@ -75,6 +76,14 @@ export default {
75
76
  form: this.$form.createForm(this)
76
77
  }
77
78
  },
79
+ async created () {
80
+ await getConfig('webConfig', undefined, res => {
81
+ localStorage.setItem(process.env.VUE_APP_WEB_CONFIG_KEY, JSON.stringify(res))
82
+ if (res.setting) {
83
+ this.$store.commit('setting/setSetting', res.setting)
84
+ }
85
+ })
86
+ },
78
87
  computed: {
79
88
  ...mapState('setting', ['systemName', 'systemDesc', 'homePage', 'ticketPage', 'compatible', 'routeName', 'defaultAvatarUrl'])
80
89
  },
@@ -8,8 +8,10 @@ import { post } from '@vue2-client/services/api/restTools'
8
8
  import setting from '@vue2-client/store/modules/setting'
9
9
 
10
10
  const commonApi = {
11
- // 获取表格列配置
11
+ // 获取配置
12
12
  getConfig: 'logic/getLiuliConfiguration',
13
+ // 获取原生配置
14
+ getNativeConfig: 'logic/getLiuliNativeConfiguration',
13
15
  // 配置解析
14
16
  parseConfig: 'logic/parseConfig',
15
17
  // 通用查询
@@ -34,11 +36,15 @@ const commonApi = {
34
36
  getEmpTree: '/api/af-system/logic/getEmpTree',
35
37
  }
36
38
 
37
- export function getConfigUrl (serviceName = setting.state.state.defaultServiceName) {
39
+ export function getConfigUrl (serviceName = setting.state.defaultServiceName) {
38
40
  return '/api/' + serviceName + '/' + commonApi.getConfig
39
41
  }
40
42
 
41
- export function parseConfigUrl (serviceName = setting.state.state.defaultServiceName) {
43
+ export function getNativeConfigUrl (serviceName = setting.state.defaultServiceName) {
44
+ return '/api/' + serviceName + '/' + commonApi.getNativeConfig
45
+ }
46
+
47
+ export function parseConfigUrl (serviceName = setting.state.defaultServiceName) {
42
48
  return '/api/' + serviceName + '/' + commonApi.parseConfig
43
49
  }
44
50
 
@@ -59,6 +65,10 @@ export function getConfig (configName, serviceName = setting.state.defaultServic
59
65
  indexedDB.getByWeb(configName, getConfigUrl(serviceName), { configName: configName }, callback)
60
66
  }
61
67
 
68
+ export function getNativeConfig (configName, serviceName = setting.state.defaultServiceName) {
69
+ return post(getNativeConfigUrl(serviceName), { configName: configName })
70
+ }
71
+
62
72
  /**
63
73
  * 调用Logic获取配置内容
64
74
  * @param logicName Logic名称
@@ -109,6 +109,11 @@ export default {
109
109
  }
110
110
  sessionStorage.setItem(process.env.VUE_APP_TBAS_TITLES_KEY, JSON.stringify(state.customTitles))
111
111
  }
112
+ },
113
+ setSetting (state, setting) {
114
+ for (const key in setting) {
115
+ state[key] = setting[key]
116
+ }
112
117
  }
113
118
  }
114
119
  }