imeik-bizui 2.4.6 → 2.4.8

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.
@@ -37,7 +37,7 @@
37
37
  ></CommonRegionCascader>
38
38
  -->
39
39
  <template>
40
- <el-cascader v-if="!isView" v-model="myValue" :props="props" :options="options" :placeholder="placeholder" clearable filterable v-bind="$attrs" popper-class="common-region-cascader-popper" @change="handleChange"></el-cascader>
40
+ <el-cascader v-if="!isView" ref="cascaderRef" v-model="myValue" :props="props" :options="options" :placeholder="placeholder" clearable filterable v-bind="$attrs" popper-class="common-region-cascader-popper" @change="handleChange"></el-cascader>
41
41
  <div v-else>{{ myLabel || '-' }}</div>
42
42
  </template>
43
43
 
@@ -250,8 +250,13 @@ export default {
250
250
  return null
251
251
  },
252
252
  handleChange() {
253
- this.$emit('input', this.myValue)
254
- this.$emit('change', this.myValue)
253
+ let pathNodes = []
254
+ const checkedNodes = this.$refs.cascaderRef?.getCheckedNodes()
255
+ if (checkedNodes && checkedNodes.length > 0) {
256
+ pathNodes = checkedNodes[0].pathNodes || []
257
+ }
258
+ this.$emit('input', this.myValue, pathNodes)
259
+ this.$emit('change', this.myValue, pathNodes)
255
260
  }
256
261
  }
257
262
  }
@@ -17,6 +17,8 @@
17
17
  :format="format"
18
18
  :value-format="valueFormat"
19
19
  :disabled="attrs.disabled || false"
20
+ :editable="attrs.editable === undefined ? false : attrs.editable"
21
+ :popper-class="popperClass"
20
22
  v-on="listeners"
21
23
  @change="onUpdate"
22
24
  />
@@ -140,6 +142,12 @@ export default {
140
142
  return 'yyyy-MM-dd'
141
143
  }
142
144
  },
145
+
146
+ popperClass() {
147
+ const customClass = this.attrs.popperClass || ''
148
+ return customClass ? `field-date-select-popper ${customClass}` : 'field-date-select-popper'
149
+ },
150
+
143
151
  showDiff() {
144
152
  return this.attrs.showDiff || false
145
153
  },
@@ -245,3 +253,11 @@ export default {
245
253
  }
246
254
  }
247
255
  </script>
256
+
257
+ <!-- 下拉挂 body,scoped 无效;限制宽度避免移动端超出视口 -->
258
+ <style lang="scss">
259
+ .field-date-select-popper {
260
+ max-width: 100%;
261
+ overflow-x: auto;
262
+ }
263
+ </style>