<template>
    <el-row>
        <el-form-item label="默认值类型" label-width="90px">
            <el-radio-group v-model="activeData.__config__.valueType" size="small"
                style="text-align:center" @change="valueTypeChange">
                <el-radio label="1">发起相关</el-radio>
                <el-radio label="2">正常</el-radio>
            </el-radio-group>
        </el-form-item>

        <template v-if="activeData.__config__.valueType == '1'">
            <el-form-item label="发起类型">
                <el-select v-model="activeData.__config__.defaultValue" placeholder="请选择发起类型"
                    clearable>
                    <el-option :label="item.fullName" :value="item.enCode"
                        v-for="item,index in startOptions" :key="index"></el-option>
                </el-select>
            </el-form-item>
        </template>
    </el-row>
</template>
<script>
import comMixin from './mixin';
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
export default {
    props: ['activeData'],
    mixins: [comMixin],
    components: {},
    data() {
        return {
            startOptions: []
        }
    },
    created() {
        if (this.activeData.__config__.valueType == '1') {
            console.log('inputCreated')
            this.getStartOptions();
        }
    },
    methods: {
        valueTypeChange(e) {
            this.activeData.__config__.defaultValue = '';
            if (e == '1') {
                this.getStartOptions();
            }
        },
        getStartOptions() {
            getDictionaryDataSelector('processFormDefaultValue').then(res => {
                this.startOptions = res.data.list
            })
        },
    }
}
</script>