|
|
|
@ -45,8 +45,8 @@ |
|
|
|
<el-dialog title="查询" append-to-body v-drag @close="closeSiftDialog" @open="openSiftDialog" :visible.sync="flag" width="65%"> |
|
|
|
<el-container> |
|
|
|
<el-aside width="90%"> |
|
|
|
<el-autocomplete :hide-loading="false" v-if="!settingFlag" style="width: 100%;" @select="handleSelect" :fetch-suggestions="querySaveRecord" v-model="itemDesc"> |
|
|
|
<el-button @click="$store.state.sift.searchFunction([...siftList])" style="width: 80px" slot="append" icon="el-icon-search"></el-button> |
|
|
|
<el-autocomplete :hide-loading="false" v-if="!settingFlag" style="width: 100%;" @select="handleSelect" :fetch-suggestions="querySaveRecord" v-model="querySavedVo.itemDesc"> |
|
|
|
<el-button @click="searchQuerySavedVo" style="width: 80px" slot="append" icon="el-icon-search"></el-button> |
|
|
|
</el-autocomplete> |
|
|
|
<el-table ref="siftTable" :row-key="getRowKeys" @selection-change="handleSelectionChange" :data="siftList" height="40vh" border> |
|
|
|
<el-table-column |
|
|
|
@ -63,20 +63,17 @@ |
|
|
|
<el-table-column label="属性名称" align="center" show-overflow-tooltip width="120" prop="fieldCaption"></el-table-column> |
|
|
|
<el-table-column label="条件" align="center"> |
|
|
|
<template slot-scope="{row,$index}"> |
|
|
|
<el-input v-model="row.formula" clearable :disabled="row.symbol === 'is_null' || row.symbol === 'is_not_null'"> |
|
|
|
<el-select @change="(value)=>changeSymbol(value,row)" slot="prepend" clearable v-model="row.symbol" style="width: 100px;cursor:pointer;"> |
|
|
|
<el-option value="eq" label="="></el-option> |
|
|
|
<el-option value="ne" label="!="></el-option> |
|
|
|
<el-option value="lt" label="<"></el-option> |
|
|
|
<el-option value="le" label="<="></el-option> |
|
|
|
<el-option value="gt" label=">"></el-option> |
|
|
|
<el-option value="ge" label=">="></el-option> |
|
|
|
<el-option value="like" label="包含"></el-option> |
|
|
|
<el-option value="in" label="在列表"></el-option> |
|
|
|
<el-option value="between" label="范围"></el-option> |
|
|
|
<el-option value="not_between" label="不在范围"></el-option> |
|
|
|
<el-option value="is_null" label="是空"></el-option> |
|
|
|
<el-option value="is_not_null" label="不是空"></el-option> |
|
|
|
<el-input v-model="row.formula" clearable> |
|
|
|
<el-select slot="prepend" clearable v-model="row.symbol" style="width: 100px;cursor:pointer;"> |
|
|
|
<el-option value="eq" label="等于"></el-option> |
|
|
|
<el-option value="gt" label="大于"></el-option> |
|
|
|
<el-option value="ge" label="大于等于"></el-option> |
|
|
|
<el-option value="lt" label="小于"></el-option> |
|
|
|
<el-option value="le" label="小于等于"></el-option> |
|
|
|
<el-option value="between" label="之间"></el-option> |
|
|
|
<el-option value="in" label="或者"></el-option> |
|
|
|
<el-option value="ne" label="不等于"></el-option> |
|
|
|
<el-option value="like" label="LIKE"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-input> |
|
|
|
</template> |
|
|
|
@ -89,6 +86,11 @@ |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="次序" align="center" prop="orderSeq" width="120"> |
|
|
|
<template slot-scope="{row,$index}"> |
|
|
|
<el-input-number v-model="row.orderSeq" clearable style="width: 100%;" :controls="false"></el-input-number> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="数据库字段" align="center" prop="originalField" show-overflow-tooltip width="120"></el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-aside> |
|
|
|
@ -111,6 +113,9 @@ |
|
|
|
<div class="box-div" v-if="settingFlag"> |
|
|
|
<button @click="settingFlag = false">取消</button> |
|
|
|
</div> |
|
|
|
<div class="box-div" v-if="!settingFlag"> |
|
|
|
<el-checkbox v-model="querySavedVo.caseSensitiveFlag" true-label="Y" false-label="N">区分大小写</el-checkbox> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-main> |
|
|
|
@ -147,10 +152,16 @@ |
|
|
|
settingFlag:false, |
|
|
|
selectionSiftList:[], |
|
|
|
recordList:[], |
|
|
|
itemDesc:'', |
|
|
|
selectData:{ |
|
|
|
itemDesc:undefined, |
|
|
|
}, |
|
|
|
querySavedVo:{ |
|
|
|
menuId:this.$route.meta.menuId, |
|
|
|
userId:this.$store.state.user.id, |
|
|
|
itemNo:undefined, |
|
|
|
itemDesc:undefined, |
|
|
|
caseSensitiveFlag:'N' |
|
|
|
}, |
|
|
|
saveQueryHeader:false, |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -248,7 +259,13 @@ |
|
|
|
}); |
|
|
|
} |
|
|
|
this.$store.commit("sift/commitSiftList",this.cloneSiftList); |
|
|
|
this.itemDesc = ''; |
|
|
|
this.querySavedVo={ |
|
|
|
menuId:this.$route.meta.menuId, |
|
|
|
userId:this.$store.state.user.id, |
|
|
|
itemNo:undefined, |
|
|
|
itemDesc:undefined, |
|
|
|
caseSensitiveFlag:'N' |
|
|
|
}; |
|
|
|
}, |
|
|
|
searchSiftList(){ |
|
|
|
let params = { |
|
|
|
@ -284,7 +301,13 @@ |
|
|
|
saveOrUpdateBatch(this.showSetting()).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.searchSiftList() |
|
|
|
this.itemDesc = ''; |
|
|
|
this.querySavedVo={ |
|
|
|
menuId:this.$route.meta.menuId, |
|
|
|
userId:this.$store.state.user.id, |
|
|
|
itemNo:undefined, |
|
|
|
itemDesc:undefined, |
|
|
|
caseSensitiveFlag:'N' |
|
|
|
} |
|
|
|
this.settingFlag = false |
|
|
|
this.$message.success(data.msg) |
|
|
|
}else { |
|
|
|
@ -336,7 +359,13 @@ |
|
|
|
arr[i].formula = null; |
|
|
|
arr[i].sortBy = null; |
|
|
|
} |
|
|
|
this.itemDesc = ''; |
|
|
|
this.querySavedVo = { |
|
|
|
menuId:this.$route.meta.menuId, |
|
|
|
userId:this.$store.state.user.id, |
|
|
|
itemNo:undefined, |
|
|
|
itemDesc:undefined, |
|
|
|
caseSensitiveFlag:'N' |
|
|
|
}; |
|
|
|
this.$store.commit("sift/commitSiftList",arr) |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.siftList.forEach(row =>{ |
|
|
|
@ -349,7 +378,13 @@ |
|
|
|
menuId:this.$route.meta.menuId, |
|
|
|
userId:this.$store.state.user.id |
|
|
|
} |
|
|
|
this.itemDesc = '' |
|
|
|
this.querySavedVo={ |
|
|
|
menuId:this.$route.meta.menuId, |
|
|
|
userId:this.$store.state.user.id, |
|
|
|
itemNo:undefined, |
|
|
|
itemDesc:undefined, |
|
|
|
caseSensitiveFlag:'N' |
|
|
|
} |
|
|
|
searchUserSettingList(params).then(({data})=>{ |
|
|
|
if (data && data.code === 0){ |
|
|
|
this.$store.commit("sift/commitSiftList",data.rows) |
|
|
|
@ -424,7 +459,7 @@ |
|
|
|
}) |
|
|
|
}, |
|
|
|
openSaveQueryHeaderDialog(){ |
|
|
|
if (!this.itemDesc){ |
|
|
|
if (!this.querySavedVo.itemDesc){ |
|
|
|
this.saveQueryHeader = true |
|
|
|
return |
|
|
|
} |
|
|
|
@ -451,10 +486,10 @@ |
|
|
|
this.$message.error(error) |
|
|
|
}) |
|
|
|
}, |
|
|
|
changeSymbol(value,row){ |
|
|
|
if (value === 'is_null' || value === 'is_not_null'){ |
|
|
|
row.formula = ''; |
|
|
|
} |
|
|
|
searchQuerySavedVo(){ |
|
|
|
let params = {...this.querySavedVo} |
|
|
|
params.querySavedDetailList = this.siftList |
|
|
|
this.$store.state.sift.searchFunction(params) |
|
|
|
} |
|
|
|
}, |
|
|
|
watch:{ |
|
|
|
@ -499,5 +534,14 @@ |
|
|
|
color: #fff; |
|
|
|
border: 1px solid rgb(22,179,163); |
|
|
|
} |
|
|
|
|
|
|
|
.el-input-number /deep/ .el-input__inner{ |
|
|
|
text-align: right; |
|
|
|
padding-right: 5px !important; |
|
|
|
} |
|
|
|
|
|
|
|
/deep/ .el-input-number--medium{ |
|
|
|
line-height: 20px; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|