| | |
| | | 3、用户输入的值会以conditionMap[field]的格式拼接好进行回传,然后就需要使用的地方自行进行查询的调用; |
| | | --> |
| | | <template> |
| | | <el-dialog |
| | | <el-dialog |
| | | title="高级查询" |
| | | append-to-body |
| | | width="55vw" |
| | |
| | | @close="recoverPage"> |
| | | <div class="search-total"> |
| | | <!-- 头部按钮区域 --> |
| | | <div slot="title" class="dialog-search-button"> |
| | | <el-button |
| | | type="primary" |
| | | <div slot="title" class="dialog-search-button"> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | icon="el-icon-search" |
| | | @click="searchSubmit"> |
| | | 查询 |
| | | </el-button> |
| | | <el-button |
| | | <el-button |
| | | type="warning" |
| | | size="small" |
| | | icon="el-icon-refresh" |
| | |
| | | </div> |
| | | <!-- 页面主体内容区域 --> |
| | | <div class="search-content"> |
| | | <el-row |
| | | <el-row |
| | | v-for="(item,index) in initOptions" |
| | | :key="item.queryField" |
| | | :span="24"> |
| | |
| | | <el-select v-else-if="item.fieldType==='combox'" v-model="searchFormArrays[index].fieldValue" placeholder="请选择"> |
| | | <el-option |
| | | v-for="option in item.data" |
| | | :key="option.itemValue" |
| | | :label="option.itemName" |
| | | :value="option.itemValue"> |
| | | :key="option.itemValue || option.value" |
| | | :label="option.itemName || option.label" |
| | | :value="option.itemValue || option.value"> |
| | | </el-option> |
| | | </el-select> |
| | | <el-switch v-else-if="item.fieldType==='truefalse'" v-model="searchFormArrays[index].fieldValue"></el-switch> |
| | |
| | | label: "不等于", |
| | | },{ |
| | | value: "_ge", //大于,默认为大于等于 |
| | | label: "大于", |
| | | label: "大于", |
| | | },{ |
| | | value: "_le", //小于,默认为小于等于 |
| | | label: "小于", |
| | |
| | | let array = []; |
| | | this.initOptions.forEach((item,index) => { |
| | | if(item.fieldType==='combox') { |
| | | let enumCach = JSON.parse(localStorage.getItem(item.comboxKey)); |
| | | let enumCach = item.data || JSON.parse(localStorage.getItem(item.comboxKey)); |
| | | if(enumCach != null) { |
| | | item.data = enumCach; |
| | | }else { |
| | |
| | | options: Object.assign(item.referConfig,{width:"80%"}), |
| | | }) |
| | | //console.log(item.referConfigData.options); |
| | | //console.log(item); |
| | | //console.log(item); |
| | | } |
| | | // TODO: 这儿修改一下参照的查询条件 |
| | | let conditions = []; |
| | | if(item.fieldType==='text'){ |
| | | conditions = this.searchConditions; |
| | | }else if (item.fieldType==='combox'){ |
| | | conditions = this.dateConditions; |
| | | }else if (item.fieldType==='combox'|| item.fieldType==='truefalse'){ |
| | | conditions = this.switchSearchConditions; |
| | | }else if (item.fieldType==='datetime') { |
| | | conditions = this.switchSearchConditions; |
| | | conditions = this.dateConditions; |
| | | }else { |
| | | conditions = this.referSearchConditions; |
| | | } |
| | | // console.log(conditions); |
| | | this.$set(item,"conditions",conditions) |
| | | |
| | | |
| | | let add = { |
| | | queryField: String(item.queryField), |
| | | condition: item.fieldType==='text' ? String("_like"):String("_equal"), |
| | |
| | | |
| | | /** 为参照类型时值选择之后的处理 */ |
| | | setReferValue(data,index){ |
| | | // console.log(index); |
| | | if(data.field) { |
| | | this.searchFormArrays[index][data.fieldValue] = data.value || ''; |
| | | this.initOptions[index][data.showField] = data.text || ''; |
| | | } |
| | | // console.log(this.initOptions[index][data.showField]); |
| | | // console.log(data); |
| | | }, |
| | | |
| | | // 属性切换时查询条件和查询值也需要对输入框进行切换 |
| | |
| | | // }, |
| | | |
| | | // 移除搜索框 |
| | | |
| | | |
| | | removeInput(index){ |
| | | //console.log(this.initOptions); |
| | | this.$delete(this.initOptions,index); |
| | |
| | | console.log(condtionParam); |
| | | this.$emit('echoContion',condtionParam) |
| | | this.isShowDialog = false; |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | |
| | | min-height: 70vh; |
| | | // margin-left: 35px; |
| | | margin-top: -8px; |
| | | overflow-y: auto; |
| | | overflow-y: auto; |
| | | height: 70vh; |
| | | } |
| | | .dialog-search-button { |
| | |
| | | width: 100%; |
| | | } |
| | | |
| | | </style> |
| | | </style> |