storelevelOption.vue 2.2 KB
<template>
<div class="condition-item">
    <li class="condition-item">
        <span class="condition-item-text">店铺层级: </span>
        <div class="condition-item-option">
            <el-select v-model="storeLevel" :placeholder="$t('pholder.gateLevel')" class="floor-sel-box">
                <el-option v-for="item in storeLevelList" :key="item.value" :label="$t('asisTab.' + item.label)" :value="item.value"></el-option>
            </el-select>
            <el-select v-if="storeLevel === 'floor'" v-model="storeFloorVal" filterable :placeholder="$t('pholder.floorSelect')" class="floor-sel-box">
                <el-option v-for="item in shopFloorData" :key="item.id" :label="item.name" :value="item.id"></el-option>
            </el-select>
        </div>
    </li>
    <format-option-content v-if="storeLevel === 'format'" :storeLevel="true" :objectVal="2" @formatValWatch="storeFormatValReceive"></format-option-content>
</div>
</template>

<script>
export default {
    props: {
        shopFloorData: {
            type: Array
        },
        shopFloorVal: {
        }
    },
    data() {
        return {
            storeLevelList: [
                {
                    label: 'floor',
                    value: 'floor',
                },
                {
                    label: 'format',
                    value: 'format',
                }
                
            ],
            storeFloorVal: '',
            storeLevel: '',
            storemutiFormatVal: [],
            storemutiFormatTwoVal: [],
            storeformatLevel: null,
        }
    },
    watch: {
        storeLevel(val) {
            let obj = {
                Level: val
            }
            this.$emit('storelevel',obj)
        },
        storeFloorVal(val) {
            let obj = {
                FloorVal: val
            }
            this.$emit('storelevel',obj)
        }
    },
    created() {
        this.storeLevel = 'floor';
        this.storeformatLevel = 1;
    },
    mounted() {
        this.storeFloorVal = JSON.parse(JSON.stringify(this.shopFloorVal));
    },
    methods: {
        storeFormatValReceive(valObj) {
            this.$emit('storelevel', valObj)
        },
    }
}
</script>

<style scoped>

</style>