mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 20:36:45 +08:00
-- 项目创建修改
This commit is contained in:
48
src/components/project/ProjectClass.vue
Normal file
48
src/components/project/ProjectClass.vue
Normal file
@@ -0,0 +1,48 @@
|
||||
<!-- 评估管理-创建评估页面 -->
|
||||
<template>
|
||||
<a-select
|
||||
v-model:value="id"
|
||||
placeholder="请选择分类"
|
||||
style="width: 100%"
|
||||
:options="options"
|
||||
allowClear
|
||||
:disabled="disabled"
|
||||
>
|
||||
</a-select>
|
||||
</template>
|
||||
<script>
|
||||
import {onMounted, reactive, toRefs, watch} from "vue";
|
||||
import {useStore} from "vuex";
|
||||
|
||||
export default {
|
||||
name: "ProjectClass",
|
||||
|
||||
props: {
|
||||
modelValue: {
|
||||
type: Number,
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
setup(props, ctx) {
|
||||
const store = useStore();
|
||||
|
||||
const state = reactive({
|
||||
options: [],
|
||||
id: props.modelValue
|
||||
});
|
||||
watch(state.id,()=>{
|
||||
ctx.emit('update:modelValue',state.id)
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
state.options = store.state.projectClass.map(e => ({value: parseInt(e.dictCode), label: e.dictName}))
|
||||
})
|
||||
return {
|
||||
...toRefs(state),
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user