mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-06 09:26:44 +08:00
项目编号修改为下拉搜索框
This commit is contained in:
47
src/components/project/ProjectNumber.vue
Normal file
47
src/components/project/ProjectNumber.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<a-select
|
||||
:getPopupContainer="
|
||||
(triggerNode) => {
|
||||
return triggerNode.parentNode || document.body;
|
||||
}
|
||||
"
|
||||
v-model:value="numValue"
|
||||
style="width: 100%;"
|
||||
placeholder="请选择项目编号"
|
||||
:options="options"
|
||||
showSearch
|
||||
allowClear
|
||||
@select="handleSelect"
|
||||
>
|
||||
</a-select>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {computed, defineEmits, defineProps, onMounted, ref, watch} from 'vue';
|
||||
import { useStore } from "vuex";
|
||||
const props = defineProps({
|
||||
value: String,
|
||||
label: String,
|
||||
})
|
||||
const emit = defineEmits(['update:value','update:label'])
|
||||
const store = useStore();
|
||||
const numValue = ref(props.value)
|
||||
const handleSelect = (value,option) => {
|
||||
emit('update:value',value)
|
||||
emit('update:label',option.id)
|
||||
};
|
||||
onMounted(() => {
|
||||
// console.log(store.state.project_number,'xixixixii')
|
||||
});
|
||||
const options = ref([
|
||||
{id:4,value:1,label:1},
|
||||
{id:5,value:2,label:2},
|
||||
{id:6,value:3,label:3},
|
||||
])
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .ant-select-selector{
|
||||
border-radius: 8px !important;
|
||||
}
|
||||
</style>
|
||||
@@ -131,5 +131,6 @@ async function init() {
|
||||
initDict("course_pic"); //课程封面
|
||||
initDict("job_type"); //岗位
|
||||
initDict("band"); //band
|
||||
initDict("examine_cover")
|
||||
initDict("examine_cover") //讲师认证封面图
|
||||
initDict("project_number") //项目编号
|
||||
}
|
||||
@@ -150,7 +150,8 @@
|
||||
<div class="num" v-if="projectInfo.boeFlag === 1">
|
||||
<div class="num_text">项目编号:</div>
|
||||
<div class="num_input">
|
||||
<a-input style="border-radius: 8px;" show-count allowClear maxlength="30" v-model:value="projectInfo.numValue" placeholder="请输入项目编号" />
|
||||
<!-- <a-input style="border-radius: 8px;" show-count allowClear maxlength="30" v-model:value="projectInfo.numValue" placeholder="请输入项目编号" /> -->
|
||||
<ProjectNumber v-model:value="projectInfo.numValue" v-model:label="projectInfo.numLabel"></ProjectNumber>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -275,7 +276,7 @@ import * as api2 from "../../api/indexAudit";
|
||||
import {validateName} from "@/api/index1";
|
||||
import dayjs from "dayjs";
|
||||
import {scrollLoad} from "@/api/method";
|
||||
|
||||
import ProjectNumber from "@/components/project/ProjectNumber";
|
||||
export default {
|
||||
name: "projectAdd",
|
||||
components: {
|
||||
@@ -285,6 +286,7 @@ export default {
|
||||
TrainClass,
|
||||
NameInput,
|
||||
OrgClass,
|
||||
ProjectNumber
|
||||
},
|
||||
setup() {
|
||||
const store = useStore();
|
||||
@@ -342,7 +344,8 @@ export default {
|
||||
});
|
||||
watch(()=>state.projectInfo.boeFlag,(val)=>{
|
||||
if(!val){
|
||||
state.projectInfo.numValue = ''
|
||||
state.projectInfo.numValue = null
|
||||
state.projectInfo.numLabel = null
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user