<template>
    <div style="width: 100%">
        <Container>
        <Select v-model="value" style="width:96.5%;" >
            <Option v-for="item in optionsData" :value="item.key||''" :key="item.key">{{ item.label }}</Option>
        </Select>
    </Container>
    </div>
</template>

<script>
import * as components from './style';
import {PropertyMixin} from '../../service/main-tool-editor-type-mixin';
import Service from "../../service/tool-service";
export default {
    components: {
        ...components
    },
    mixins: [PropertyMixin],
    position: 'mainToolEditorTypeReqTableSelect',
    name: 'main-tool-editor-type-reqTableSelect',
    data () {
        return {
            propArr:[]
        };
    },
    props: {
        instanceInfo: Object,
        editor: Object
    },
    computed: {
        applicationState () {
            return this.$store.state.application;
        },
        viewportState () {
            return this.$store.state.viewport;
        },
        optionsData () {
            let _data = this.propArr || [];
            return _data;
        }
    },
    methods: {
        // change_status(val){  // 筛选状态
        //
        //     console.log(this.val);
        //     this.val=val;
        //     this.setInstanceProps(this.val);
        // },
        handleChange () {

        }
    },
    mounted(){

        let _this=this;
        let params = {
            itemNo:localStorage.itemNo
        };
        let propArr=[];
            // this.$http.get('/static/data/page-ide/202-1.json').then((response) => {
            if(localStorage.getItem("selectArr")&&localStorage.getItem("selectArr")!="undefined"){
                propArr= JSON.parse(localStorage.getItem("selectArr")||[]);
            }
            let mockData=[];
            propArr.map(function(item,key,ary) {
                mockData.push({
                    key: "templateCache."+item.selectName,
                    label: item.selectName
                });
            });
            _this.propArr=mockData;
            _this.initCurrtField();


    },
    watch: {
        value (n, o) {


            if (n === o) {
                return;
            }
            this.setInstanceProps(n);
        }
    }
};
</script>

<style>

</style>
