riku
2025-09-19 58c0f11fe2f23a1be2dec768f9ac02107301a634
src/components/search-option/FYOptionLocation.vue
@@ -1,6 +1,7 @@
<template>
  <el-form-item :label="placeholder" :prop="prop">
    <el-cascader
      v-bind="$attrs"
      :model-value="formatedValue"
      @change="handleChange"
      :options="locations"
@@ -21,7 +22,7 @@
      type: Boolean,
      default: true
    },
    // 查询的行政级别,取值1,2,3,4
    // 查询的行政级别,取值1,2,3,4, 5, 6
    level: {
      type: Number,
      default: 4
@@ -38,9 +39,12 @@
      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),
@@ -65,6 +69,7 @@
  methods: {
    handleChange(value) {
      this.$emit('update:value', this.optionFormat(value));
      this.$emit('change', this.optionFormat(value));
    },
    /**
     * 地区选项结果格式化