Browse Source

筛选弹窗下拉多选bug

master
zhang_li 1 year ago
parent
commit
b039a987b1
  1. 8
      src/components/ImportForm/src/ImportForm.vue
  2. 38
      src/components/SearchHigh/src/SearchHigh.vue

8
src/components/ImportForm/src/ImportForm.vue

@ -1,7 +1,7 @@
<!-- 导入组件 -->
<template>
<Dialog v-model="dialogVisible" title="导入" width="600">
<el-upload ref="uploadRef" v-model:file-list="fileList" :action="importUrl + '?mode=' + mode + '&file=' + file + '&updatePart=' + updatePart"
<el-upload ref="uploadRef" v-model:file-list="fileList" :action="importUrl + '?mode=' + mode + '&file=' + file + '&updatePart=' + updatePart + '&outFile=' + outFile"
:auto-upload="false" :disabled="formLoading" :headers="uploadHeaders" :limit="1" :on-error="submitFormError"
:on-exceed="handleExceed" :on-success="submitFormSuccess" :accept="accept" drag
style="width:300px;margin:0 auto">
@ -132,6 +132,11 @@ const file = ref('')
required: false,
default: false
},
outFile: {
type: Boolean,
required: false,
default: false
},
})
const importTemplateData= ref(props.importTemplateData)
const accept= ref(props.accept)
@ -140,6 +145,7 @@ const updateIsDisable = ref(props.updateIsDisable)//更新是否禁用,默认值
const appendIsDisable = ref(props.appendIsDisable)//,
const coverIsDisable = ref(props.coverIsDisable)//,
const updatePart = ref(props.updatePart)//
const outFile = ref(props.outFile)//
const importUrl =
import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + props.url

38
src/components/SearchHigh/src/SearchHigh.vue

@ -23,19 +23,19 @@
<!-- 数字输入框 -->
<el-input-number v-else-if="getInputType(item.column) == 'inputNumber'" v-model="item.value" :precision="6" :disabled="item.disabled"/>
<!-- 下拉框 -->
<el-select v-else-if="getInputType(item.column) == 'select'" v-model="item.value" placeholder="请选择内容" :filterable="true" clearable :disabled="item.disabled">
<el-select v-else-if="getInputType(item.column) == 'select'" v-model="item.value1" placeholder="请选择内容" :filterable="true" 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 initSelectOptions(item.column)" :key="dict.value" :label="dict.label"
:value="dict.value" />
<!-- <el-option v-for="(op, index) in initSelectOptions(item.column)" :label="op[item.optionsLabel] || op.label"
:value="op[item.optionsValue] || op.value" :key="index" /> -->
</el-select>
<!-- 时间 -->
<el-time-picker v-else-if="getInputType(item.column) == 'time'" range-separator="-" start-placeholder="开始时间" end-placeholder="结束时间" v-model="item.time" style="width: calc(100% - 20px);margin-right: 10px;" :disabled="item.disabled"/>
<el-time-picker v-else-if="getInputType(item.column) == 'time'" range-separator="-" start-placeholder="开始时间" end-placeholder="结束时间" v-model="item.value1" style="width: calc(100% - 20px);margin-right: 10px;" :disabled="item.disabled"/>
<!-- 日期 -->
<el-date-picker v-else-if="getInputType(item.column) == 'date'" v-model="item.time" type="daterange"
<el-date-picker v-else-if="getInputType(item.column) == 'date'" v-model="item.value1" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" style="width: calc(100% - 20px);margin-right: 10px;" @change="changeDateTimePicker($event, item,'daterange')" value-format="YYYY-MM-DD" format="YYYY/MM/DD" :disabled="item.disabled"/>
<!-- 日期时间 -->
<el-date-picker v-else-if="getInputType(item.column) == 'datePicker'" v-model="item.time" type="datetimerange"
<el-date-picker v-else-if="getInputType(item.column) == 'datePicker'" v-model="item.value1" type="datetimerange"
range-separator="-" start-placeholder="开始时间" end-placeholder="结束时间" style="width: calc(100% - 20px);margin-right: 10px;" @change="changeDateTimePicker($event, item, 'datetimerange')" value-format="x" format="YYYY/MM/DD HH:mm:ss" :disabled="item.disabled"/>
</div>
<!-- 删除条件按钮 -->
@ -178,7 +178,7 @@ const moreListPush = () => {
column: '',
action: "==",
value: "",
time:''
value1 :""
}
moreListData.value.filters.push(data)
}
@ -187,13 +187,13 @@ const moreListPush = () => {
const resetSelect = (val) => {
if (getInputType(val.column) == 'datePicker' || getInputType(val.column) == 'date') {
val.action = 'betweeen'
val.value = ""
val.disabled = false
}else{
val.action = '=='
val.value = ""
val.disabled = false
}
val.value1 = ""
val.value = ""
}
//
const actionSelect = (val)=>{
@ -202,6 +202,12 @@ const actionSelect = (val)=>{
}else{
val.disabled = false
}
val.value1 = undefined
nextTick(()=>{
val.value1 =[]
val.value = ''
})
}
//
@ -209,11 +215,21 @@ const buttonBaseClick = (val) => {
if (val == 'search') { //
let data = []
moreListData.value.filters.forEach(item => {
let obj = {
column: item.column,
action: item.action,
value: item.value,
let obj = {}
if(item.value1&&item.value1.length>0){
obj = {
column: item.column,
action: item.action,
value:Array.isArray(item.value1)?item.value1.join(','):item.value1,
}
}else{
obj = {
column: item.column,
action: item.action,
value:item.value,
}
}
data.push(obj)
})
if (props.masterId){

Loading…
Cancel
Save