Browse Source

检验任务创建者筛选功能不可用

hella_online_20240829
zhang_li 4 months ago
parent
commit
8267f93ef4
  1. 37
      src/components/SearchHigh/src/SearchHigh.vue

37
src/components/SearchHigh/src/SearchHigh.vue

@ -23,7 +23,7 @@
<!-- 数字输入框 -->
<el-input-number v-else-if="getInputType(item.column) == 'inputNumber'" v-model="item.value" :precision="getInputPrecision(item.column)" :disabled="item.disabled"/>
<!-- 下拉框 -->
<el-select v-else-if="getInputType(item.column) == 'select'" v-model="item.value1" :placeholder="t('ts.请选择内容')" :filterable="true" clearable :disabled="item.disabled" :multiple="item.action=='in' || item.action=='notIn' ? true : false" collapse-tags collapse-tags-tooltip :key="item.action">
<el-select v-else-if="getInputType(item.column) == 'select'" v-model="item.value1" :placeholder="t('ts.请选择内容')" :filterable="getFilterable(item.column)" clearable :disabled="item.disabled" :multiple="item.action=='in' || item.action=='notIn' ? true : false" collapse-tags collapse-tags-tooltip :key="item.action">
<el-option v-for="dict in allDictOptions[item.column]" :key="dict.value" :label="t(`ts.${dict.label}`).replace('ts.','')"
:value="dict.value" />
<!-- <el-option v-for="(op, index) in initSelectOptions(item.column)" :label="op[item.optionsLabel] || op.label"
@ -57,8 +57,19 @@
import { Minus } from '@element-plus/icons-vue'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import * as UserApi from '@/api/system/user'
const { t } = useI18n()
const userListAll = ref([])
UserApi.getUserListAll().then((res) => {
userListAll.value = res.map(item => {
return {
label: item.nickname,
value: item.id
}
})
})
const props = defineProps({
// name
routeName: {
@ -142,7 +153,7 @@ const moreListOptions = ref({
const type = searchOption_high.value.find(item => (item.field == val))
let data = 'input'
if (type?.dictType) {
if (type?.dictType || type?.field == 'creator') {
data = 'select'
} else if (type?.form?.component == 'InputNumber') {
data = 'inputNumber'
@ -155,6 +166,16 @@ const moreListOptions = ref({
}
return data
}
const getFilterable = (val) => {
const type = searchOption_high.value.find(item => (item.field == val))
//
if (type?.field == 'creator') {
return false
}else{
return true
}
}
//
const getInputPrecision = (val) => {
const type = searchOption_high.value.find(item => (item.field == val))
@ -231,7 +252,7 @@ const buttonBaseClick = (val) => {
let data = []
moreListData.value.filters.forEach(item => {
let obj = {}
if(item.value1&&item.value1.length>0){
if(item.value1&&item.value1.length>0 || (item.value1&&typeof item.value1 === 'number')){
obj = {
column: item.column,
action: item.action,
@ -274,8 +295,15 @@ const allDictOptions = ref({}) //所有下拉框选项
const getDictOptions = ()=>{
let selectList = searchOption_high.value.filter(item=>getInputType(item.field) == 'select')
selectList.forEach(item=>{
allDictOptions.value[item.field] = getStrDictOptions(item.dictType)
// allDictOptions.value[item.field] = getStrDictOptions(item.dictType)
if (item.dictType) {
allDictOptions.value[item.field] = getStrDictOptions(item.dictType)
} else if(item.field == 'creator'){
allDictOptions.value[item.field] = userListAll.value
}
})
console.log(888,userListAll.value)
console.log(999,allDictOptions.value)
}
// option
const initSelectOptions = (item) => {
@ -302,6 +330,7 @@ const changeDateTimePicker = (e, val,from) =>{
val.value = e.join(',')
}
}
defineExpose({
popoverVisible
})

Loading…
Cancel
Save