vue2-client 1.6.45 → 1.6.46

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/CHANGELOG.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Change Log
2
2
  > 所有关于本项目的变化都在该文档里。
3
3
 
4
- **1.6.44 - 1.6.45 -2023-07-13 @江超**
4
+ **1.6.44 - 1.6.46 -2023-07-13 @江超**
5
5
  - 修复单选框的校验问题
6
6
 
7
7
  **1.6.43 -2023-07-13 @江超**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue2-client",
3
- "version": "1.6.45",
3
+ "version": "1.6.46",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
@@ -162,18 +162,18 @@
162
162
  :prop="attr.model">
163
163
  <a-radio-group v-model="form[attr.model]">
164
164
  <template v-if="attr.keys">
165
- <a-radio v-for="(item,index) in attr.keys" :key="index" :value="item.value" :default-checked="index === 0">
165
+ <a-radio v-for="(item,index) in attr.keys" :key="index" :value="item.value">
166
166
  {{ item.label }}
167
167
  </a-radio>
168
168
  </template>
169
169
  <template v-else>
170
170
  <template v-if="attr.keyName.indexOf('logic@') !== -1">
171
- <a-radio v-for="(item,index) in option" :key="index" :value="item.value" :default-checked="index === 0">
171
+ <a-radio v-for="(item,index) in option" :key="index" :value="item.value">
172
172
  {{ item.label }}
173
173
  </a-radio>
174
174
  </template>
175
175
  <template v-else>
176
- <a-radio v-for="(item,index) in $appdata.getDictionaryList(attr.keyName)" :key="index" :value="item.value" :default-checked="index === 0">
176
+ <a-radio v-for="(item,index) in $appdata.getDictionaryList(attr.keyName)" :key="index" :value="item.value">
177
177
  {{ item.text }}
178
178
  </a-radio>
179
179
  </template>
@@ -431,8 +431,27 @@ export default {
431
431
  mode: this.mode,
432
432
  disabled: this.disabled
433
433
  })
434
+ } else if (this.attr.type === 'radio') {
435
+ this.initRadioValue()
434
436
  }
435
437
  })
438
+ } else {
439
+ this.initRadioValue()
440
+ }
441
+ },
442
+ initRadioValue () {
443
+ const model = this.attr.model
444
+ if (this.mode === '新增/修改' && this.attr.type === 'radio' && !this.form[model]) {
445
+ if (this.attr.keys && this.attr.keys.length > 0) {
446
+ this.form[model] = this.attr.keys[0].value
447
+ } else if (this.option && this.option.length > 0) {
448
+ this.form[model] = this.option[0].value
449
+ } else if (this.attr.keyName) {
450
+ const list = this.$appdata.getDictionaryList(this.attr.keyName)
451
+ if (list.length > 0) {
452
+ this.form[model] = list[0].value
453
+ }
454
+ }
436
455
  }
437
456
  },
438
457
  openChangeOne (status) {