import Vue from "vue";

export default Vue.extend({
    template: `
        <div>
            <Select
                ref="select"
                v-model="value"
                style="width:200px;"
                transfer
                clearable
                :placeholder="placeholder"
                @on-change="params.api.stopEditing;"
            >
                <Option v-for="key in Object.keys(dict)" :value="key" :key="key">{{ dict[key] }}</Option>
            </Select>
        </div>
    `,
    data() {
        return {
            value: false,
            dict:{}
        }
    },
    computed:{
        placeholder(){
            return `请选择${this.params.column.colDef.headerName}`
        }
    },
    methods: {
        getValue() {
            return this.value;
        },

        isPopup() {
            return true;
        }
    },
    created() {
        this.value = this.params.value;
        let column = this.params.column;
        let gridDicts = this.params.context.gridDicts;
        this.dict = gridDicts[column.colId];
    },
    mounted() {
        
    }
})