| | |
| | | <template> |
| | | <el-form-item :label="placeholder" :prop="prop"> |
| | | <el-cascader |
| | | v-bind="$attrs" |
| | | :model-value="formatedValue" |
| | | @change="handleChange" |
| | | :options="locations" |
| | |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | // 查询的行政级别,取值1,2,3,4 |
| | | // 查询的行政级别,取值1,2,3,4, 5, 6 |
| | | level: { |
| | | type: Number, |
| | | default: 4 |
| | |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | prop: String |
| | | prop: { |
| | | type: String, |
| | | default: '_locations' |
| | | } |
| | | }, |
| | | emits: ['update:value'], |
| | | emits: ['update:value', 'change'], |
| | | data() { |
| | | return { |
| | | locations: enumLocation(this.allOption, this.level), |
| | |
| | | methods: { |
| | | handleChange(value) { |
| | | this.$emit('update:value', this.optionFormat(value)); |
| | | this.$emit('change', this.optionFormat(value)); |
| | | }, |
| | | /** |
| | | * 地区选项结果格式化 |