<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>-->
            <span>{{value}}</span>
            <Input v-model="value" />
        </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: 'mainToolEditorTypeReqSelect',
        name: 'main-tool-editor-type-reqSelect',
        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: {
            //note 设置随机属性值
            randomProp(len) {
                len = len || 10;
                var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';    /****默认去掉了容易混淆的字符oOLl,9gq,Vv,Uu,I1****/
                var maxPos = $chars.length;
                var pwd = '';
                for (let i = 0; i < len; i++) {
                    pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
                }
                return pwd;
            },
            // change_status(val){  // 筛选状态
            //
            //     console.log(this.val);
            //     this.val=val;
            //     this.setInstanceProps(this.val);
            // },
            handleChange () {

            }
        },
        mounted(){
            debugger;
            //note 判断是否存在
            if(!this.getInstanceData.property.prop){
                this.setInstanceProps(this.randomProp());
            }
            this.initCurrtField();
            /* let _this=this;
             let params = {
                 itemNo:localStorage.itemNo
             };
             if(localStorage.propInfo&&localStorage.propInfo!="undefined") {
                  let res=JSON.parse(localStorage.propInfo);
                  let propArr=[];
                  let targetArr=[];
                  for(let propObj in res.prop) {
                      propArr=[...propArr,...res.prop[propObj]];
                  }
                  let mockData=[];
                  propArr.map(function(item,key,ary) {
                      mockData.push({
                          key: item.busiName,
                          label: item.busiDesc
                      });
                  });
                  _this.propArr=mockData;
                  _this.initCurrtField();
              }*/
            //});
            /*this.$http.get('/static/data/page-ide/202-1.json').then((response) => {
                _this.propArr=response.propArr;
                _this.initCurrtField();
            });*/
        },
        watch: {
            value (n, o) {


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

<style>

</style>
