feat : 需求征集和项目管理的名称匹配搜索

This commit is contained in:
2024-11-02 20:00:29 +08:00
parent 960d294870
commit a175a6456a
7 changed files with 112 additions and 13 deletions

View File

@@ -3,8 +3,17 @@
<el-row>
<el-col :span="5">
<el-form-item prop="requirementName" label="征集名称">
<el-input v-model="selectForm.requirementName" placeholder="请输入征集名称" clearable @keyup.enter.native="getList"
style="width: 100%"/>
<!-- <el-input v-model="selectForm.requirementName" placeholder="请输入征集名称" clearable @keyup.enter.native="getList"-->
<!-- style="width: 100%"/>-->
<el-select v-model="selectForm.requirementName" placeholder="请输入征集名称" filterable clearable remote :remote-method="getRequirementName"
style="width: 100%" @change="changeName" >
<el-option
v-for="item in requirementNameOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="5" :offset="1">
@@ -53,11 +62,9 @@
<script setup lang="jsx">
import {useAuthStore} from '@/stores/userstore.js'
import Tag from '@/components/Tag.vue'
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import {ElNotification} from "element-plus";
import {deleteDemand} from "@/api/project-demand";
import {useCacheStore} from '@/stores/cache.js'
import {getRequirementStatePerm} from "@/api/project-demand";
import {getRequirementStatePerm,filterRequirementName,deleteDemand} from "@/api/project-demand";
import {Refresh, Search} from '@element-plus/icons-vue'
const cacheStore = useCacheStore()
@@ -66,6 +73,7 @@ const router = useRouter()
const selectForm = ref({})
const tableIns = ref()
const formRef = ref()
const requirementNameOptions = ref([])
const stateOption = ref([])
const userInfo = ref(authStore.userinfo)
const auths = {
@@ -187,6 +195,28 @@ const tableConfig = reactive({
params: {}
})
const changeName=(val)=>{
selectForm.value.requirementName=val
getList()
}
const getRequirementName=async (val)=>{
if(val){
const res=await filterRequirementName(val)
if(res.code==1000){
let optionObj={}
let options=[]
res.data.forEach(item=>{
optionObj={
value:item,
label:item
}
options.push(optionObj)
})
requirementNameOptions.value= options
}
}
}
const selectOptionVisibleChange = (value) => {
console.log('value', value)
}

View File

@@ -51,8 +51,6 @@ const searchConfig = ref([
options: [],
remote: true,
remoteMethod:async (val)=>{
// requirementNameValue.value=val
// search({requirementName:val})
if(val){
const res=await getRequirementName(val)
if(res.code==1000){