plm前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

48 lines
1.0 KiB

<template>
<div>
<el-select v-bind="$attrs" v-on="$listeners" :value="value" style="width: 100%" @change="changeDictData">
<el-option v-for="(item, index) in options" :key="index" :label="item.dictLabel" :value="item.dictValue" :disabled="item.status === 'N'"></el-option>
</el-select>
</div>
</template>
<script>
import {selectDictDataList} from "../../../api/dict";
export default {
name:'dict-data-select',
model:{
prop:'value',
event:'change'
},
props:{
dictType: {
type: String,
required: true
},
value:{
required: true,
}
},
data () {
return {
options: []
}
},
created () {
this.initOption()
},
methods: {
//初始化options
async initOption () {
let params = {
site:this.$store.state.user.site,
dictType:this.dictType
}
let {data} = await selectDictDataList(params);
this.options = data.rows;
},
changeDictData(val){
this.$emit('change',val)
}
}
}
</script>