<template>
    <div style="width: 100%">
        <Label>选项类型</Label>
        <Container>
            <Select v-model="val" style="width:96.5%;max-width: 254px;" >
                <Option style="max-width: 254px;" v-for="item in optionsData" :value="item.value||''" :key="item.value">{{ item.label }}</Option>
            </Select>

        </Container>
        <Label>请输入按钮名称</Label>
        <Container>
        <Input v-model="value" placeholder="请输入按钮名称" clearable style="width: 300px" />
        </Container>
    </div>
</template>

<script>
    import * as components from './style';
    import {PropertyMixin} from '../../service/main-tool-editor-type-mixin';
    export default {
        components: {
            ...components
        },
        mixins: [PropertyMixin],
        position: 'mainToolEditorTypeLooktype',
        name: 'main-tool-editor-type-looktype',
        data () {
            return {
                val:'',
                value:'',
                dataArr:[
                    {
                        "label":"环评批复文号",
                        "value":"1"
                    },
                    {
                        "label":"身份证号",
                        "value":"2"
                    },
                    {
                        "label":"车牌号",
                        "value":"3"
                    },
                    {
                        "label":"网签合同号",
                        "value":"4"
                    },
                    {
                        "label":"申请号",
                        "value":"5"
                    },
                    {
                        "label":"请求号查询",
                        "value":"6"
                    },
                    {
                        "label":"房屋权属证号",
                        "value":"7"
                    },
                    {
                        "label":"监管协议号",
                        "value":"8"
                    },
                    {
                        "label":"小餐饮查询页面信息",
                        "value":"9"
                    },{
                        "label":"二手房合约备案卖家房屋产权证号",
                        "value":"10"
                    },
                    {
                        "label":"网签合同号：先调合同变更申请方校验接口",
                        "value":"11"
                    },
                    {
                        "label":"买方请求号查询",
                        "value":"12"
                    },
                    {
                        "label":"请求号查询",
                        "value":"13"
                    },
                    {
                        "label":"异地就医网上查询",
                        "value":"14"
                    },
                    {
                        "label":"医保卡个人账户查询",
                        "value":"15"
                    },
                    {
                        "label":"出具医疗（大额）保险费、生育保险费缴费电子发票查询",
                        "value":"16"
                    },
                    {
                        "label":"卫生许可事项",
                        "value":"18"
                    }
                ]
            };
        },
        props: {
            instanceInfo: Object,
            editor: Object
        },
        computed: {
            applicationState () {
                return this.$store.state.application;
            },
            viewportState () {
                return this.$store.state.viewport;
            },
            optionsData () {
                debugger;
               /* if (localStorage.getItem("page") && localStorage.getItem("page") != null) {

                } else {
                    /!*this.$Modal.success({
                        title: "友情提示",
                        content: "请先全局设置！"
                    });*!/
                    return;
                }
                let pageObj = eval('(' + localStorage.getItem("page") + ')');//JSON.parse(localStorage.getItem("page"));
                console.log(pageObj);*/
                let optionData= this.dataArr||[];
              /*  optionData.forEach(function (el,index) {
                    el.selectName="templateCache."+el.label;
                });*/
                let _data =  optionData;
                return _data;
            }
        },
        methods: {
            initCurrtField () {
                debugger;
                let currentInstance = this.$store.state.viewport.instances.get(this.$store.state.viewport.currentEditInstanceKey);
                if (!currentInstance.excat) {
                    currentInstance.excat=[{
                        "type":"",
                        "data": {
                            "type": "",
                            "btnName":""
                        }
                    }];
                }else{
                    this.val= currentInstance.excat[0].data.type;
                    this.value= currentInstance.excat[0].data.btnName;
                }
                debugger
            },
            handleChange () {

            }
        },
        mounted() {
            debugger;
            this.initCurrtField();
        },
        watch: {
           /* field (n, o) {
                if (n === o) {
                    return;
                }
                deep:true//对象内部的属性监听，也叫深度监听
                //  this.setInstanceProps(n);
            },
            val (n, o) {
                debugger;
                if (n === o) {
                    return;
                }
                this.setInstanceProps(n);
            }*/
        }
    };
</script>

<style>

</style>
