| | |
| | | <el-row |
| | | v-for="(item,index) in initOptions" |
| | | :key="item.queryField" |
| | | v-show="!item.hidden" |
| | | :span="24"> |
| | | <el-col :span="5"> |
| | | <div class="grid-content"> |
| | | <el-select placeholder="请选择" v-model="searchFormArrays[index].queryField"> |
| | | <el-select disabled placeholder="请选择" v-model="searchFormArrays[index].queryField"> |
| | | <el-option |
| | | v-for="feildName in initOptions" |
| | | v-for="feildName in options" |
| | | :key="feildName.queryField" |
| | | :label="feildName.title" |
| | | :value="feildName.queryField"> |
| | |
| | | <el-select v-else-if="item.fieldType==='combox'" v-model="searchFormArrays[index].fieldValue" placeholder="请选择"> |
| | | <el-option |
| | | v-for="option in item.data" |
| | | :key="option.value" |
| | | :label="option.key" |
| | | :value="option.value"> |
| | | :key="option.itemValue" |
| | | :label="option.itemName" |
| | | :value="option.itemValue"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-switch v-else-if="item.fieldType==='truefalse'" v-model="searchFormArrays[index].fieldValue"></el-switch> |
| | |
| | | //console.log(this.initOptions); |
| | | this.initOptions.forEach((item,index) => { |
| | | if(item.fieldType==='combox') { |
| | | |
| | | this.getEnum(item.comboxKey).then(res=>{ |
| | | console.log(res.data); |
| | | }) |
| | | //item.data = |
| | | let enumCach = JSON.parse(localStorage.getItem(item.comboxKey)); |
| | | if(enumCach != null) { |
| | | item.data = enumCach; |
| | | }else { |
| | | getDictionary({code: item.comboxKey}).then(res=>{ |
| | | item.data = res.data.data; |
| | | localStorage.setItem(item.comboxKey,JSON.stringify(res.data.data)); |
| | | }) |
| | | } |
| | | } |
| | | let add = { |
| | | queryField: String(item.queryField), |
| | |
| | | //console.log(this.searchFormArrays); |
| | | } |
| | | }, |
| | | created () { |
| | | |
| | | }, |
| | | methods: { |
| | | |
| | | async getEnum(enumText){ |
| | | let enumParam = ''; |
| | | await getDictionary({code: enumText}).then(res=>{ |
| | | enumParam = res.data.data; |
| | | // console.log(res.data); |
| | | }) |
| | | //console.log(enumParam); |
| | | return enumParam; |
| | | }, |
| | | // 属性切换时查询条件和查询值也需要对输入框进行切换 |
| | | // changeField(index) { |
| | | // //console.log(option,this.searchFormArrays[index],index); |
| | | // // 找到数组中对应的要切换为的那个对象 |
| | | // let changeItem = this.options.filter((item)=>{ |
| | | // return item.queryField == this.searchFormArrays[index].queryField; |
| | | // })[0] |
| | | // // 如果是combox类型的还需要对枚举类型进行请求 |
| | | // if(changeItem.fieldType==='combox' && changeItem.comboxKey != '') { |
| | | // changeItem.data = JSON.parse(localStorage.getItem(changeItem.comboxKey)); |
| | | // } |
| | | // //console.log(changeItem.fieldType); |
| | | // // 将当前切换的配置项赋值到option的对应的那个对象进行覆盖 |
| | | // this.initOptions[index] = changeItem; |
| | | // // 覆盖v-model的对象 |
| | | // this.searchFormArrays[index] = { |
| | | // queryField: String(changeItem.queryField), |
| | | // condition: changeItem.fieldType==='text' ? String("_like"):String("_equal"), |
| | | // fieldValue: changeItem.fieldType==='truefalse' ? Boolean(false):String(""), |
| | | // }; |
| | | // //console.log(this.initOptions); |
| | | // //console.log(this.searchFormArrays); |
| | | // }, |
| | | |
| | | // 移除搜索框 |
| | | |
| | | removeInput(index){ |
| | | //console.log(this.initOptions); |
| | | this.$delete(this.initOptions,index); |
| | |
| | | //console.log(condtionParam['conditionMap['+searchConditions[index].queryField+']']+'' == 'undefined'); |
| | | if(searchConditions[index].fieldValue.trim() != '' || searchConditions[index].fieldValue+''==='false') { |
| | | // 存在相同的查询条件 |
| | | if(condtionParam['conditionMap['+searchConditions[index].queryField+']']+''.trim() != 'undefined' ) { |
| | | if(condtionParam['conditionMap['+searchConditions[index].queryField+']']+'' != 'undefined' ) { |
| | | this.$message.warning("存在重复查询条件,请仔细核对!"); |
| | | console.log(condtionParam['conditionMap['+searchConditions[index].queryField+']']); |
| | | return false; |
| | | } |
| | | //拼接成map对象,将查询对象和condition拼接在一起,组成高级查询map的key |