imeik-bizui 2.2.2 → 2.2.4

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.
@@ -29,6 +29,11 @@
29
29
  import { queryBudgetDepartManage } from '../../api/applycenter.js'
30
30
  export default {
31
31
  name: 'FieldCostBearDepartmentSelect',
32
+ inject: {
33
+ isConfig: {
34
+ default: false
35
+ }
36
+ },
32
37
  props: {
33
38
  value: {
34
39
  type: String,
@@ -171,20 +176,16 @@ export default {
171
176
  * 检查默认选中模式
172
177
  */
173
178
  checkDefault() {
174
- // 如果是查看模式,则不设置默认值
175
- if(this.isView) {
176
- return
177
- }
178
- let defaultType = this.attrs.default
179
- let tempValue = undefined
179
+ const defaultType = this.attrs.default
180
+ let tempValue
180
181
  // 如果默认选中“我的部门”,且无初始值,则设为默认部门
181
182
  if (defaultType === '2') {
182
183
  tempValue = this.defaultDepartment
183
184
  } else if (defaultType === '3') {
184
185
  tempValue = this.attrs.defaultValue
185
186
  }
186
- // 设置默认值并触发change事件
187
- if (tempValue && !this.value) {
187
+ // 当tempValue有值且没有初始值时,或者是在配置模式下,则设置默认值并触发change事件
188
+ if ((tempValue && !this.value) || this.isConfig) {
188
189
  this.myValue = tempValue
189
190
  this.onChange()
190
191
  }