vue2-client 1.12.90 → 1.12.93

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.12.90",
3
+ "version": "1.12.93",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
@@ -62,6 +62,7 @@
62
62
  import { Calendar, Button } from 'ant-design-vue'
63
63
  import moment from 'moment'
64
64
  import 'moment/locale/zh-cn'
65
+ import { getConfigByName } from '@vue2-client/services/api/common'
65
66
 
66
67
  // 设置中文
67
68
  moment.locale('zh-cn')
@@ -114,7 +115,8 @@ const defaultConfig = {
114
115
  backToToday: 'back-to-today',
115
116
  action: 'action',
116
117
  add: 'add',
117
- monthChange: 'month-change'
118
+ monthChange: 'month-change',
119
+ init: 'init'
118
120
  }
119
121
  }
120
122
 
@@ -142,8 +144,7 @@ export default {
142
144
  }
143
145
  },
144
146
  created () {
145
- // 深度合并配置
146
- this.mergedConfig = this.mergeConfig(defaultConfig, this.config)
147
+ this.getData(this.config)
147
148
  },
148
149
  computed: {
149
150
  // 使用计算属性访问合并后的配置
@@ -161,6 +162,14 @@ export default {
161
162
  }
162
163
  },
163
164
  methods: {
165
+ // 获取配置
166
+ getData (config) {
167
+ getConfigByName(config, 'af-his', res => {
168
+ // 深度合并配置
169
+ this.mergedConfig = this.mergeConfig(defaultConfig, res)
170
+ this.$emit(this.mergedConfig.events.init, this.currentDate)
171
+ })
172
+ },
164
173
  // 深度合并配置
165
174
  mergeConfig (defaultConfig, userConfig) {
166
175
  const result = { ...defaultConfig }
@@ -222,6 +231,15 @@ export default {
222
231
  handleAdd (action) {
223
232
  this.$emit(this.config.events.add, this.currentDate)
224
233
  }
234
+ },
235
+ watch: {
236
+ // 监听配置参数名称变化
237
+ queryParamsName: {
238
+ handler (newValue) {
239
+ this.getData(newValue)
240
+ },
241
+ deep: true,
242
+ }
225
243
  }
226
244
  }
227
245
  </script>