Browse Source

智能查询

dev-新版ui
jiangyy 3 years ago
parent
commit
0fc089ae64
  1. 2
      src/views/components/resiSearch.vue
  2. 461
      src/views/components/smartSearchRule.vue

2
src/views/components/resiSearch.vue

@ -363,7 +363,7 @@ export default {
'AGENCY_ID': 'like'
},
showSmartSearchForm: false,
showSmartSearchForm: true,
formType: 'add',
selBtnIndex: 1,
btnList: [

461
src/views/components/smartSearchRule.vue

@ -1,227 +1,205 @@
<template>
<div>
<!-- <div>
<el-checkbox v-model="personChecked"></el-checkbox>
<span @click="clickTab('person')"
:class="['tab-title',{'tab-title-sel':personSel}]">人员信息</span>
<el-checkbox v-model="houseChecked"></el-checkbox>
<span @click="clickTab('house')"
:class="['tab-title',{'tab-title-sel':houseSel}]">房屋信息</span>
</div> -->
<div class="m-main">
<div v-for="(ruleItem,ruleIndex) in smartRuleList"
:key="ruleIndex"
class="row-item">
<el-select class="item_width_1"
v-model="selSmartType"
size="mini"
v-model="ruleItem.selSmartType"
size="small"
placeholder="请选择">
<el-option v-for="item in smartList1"
@click.native="handleSelSmartType(item.value)"
@click.native="handleSelSmartType(ruleIndex,item)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
<div v-if="houseSel"
style="margin-top:10px">
<div v-for="(houseItem,houseIndex) in houseRuleList"
:key="houseIndex"
class="row-item">
<el-input class="item_width_1"
size="mini"
placeholder="请输入"
:disabled="true"
v-model="houseTitleName">
</el-input>
<el-select class="item_width_1"
v-model="houseItem.colKey"
size="mini"
placeholder="请选择">
<el-option v-for="item in houseItemList"
@click.native="handleSelHouseItem(houseIndex,item)"
:key="item.colKey"
:label="item.label"
:value="item.colKey">
</el-option>
</el-select>
<el-select class="item_width_1"
v-model="houseItem.queryType"
size="mini"
placeholder="请选择">
<el-option v-for="item in queryList"
@click.native="handleSelHouseQuery(houseIndex,item)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<div v-if="houseItem.queryType!=='is_null'&&houseItem.queryType!=='is_not_null'">
<el-select v-if="houseItem.colType==='select'||houseItem.colType==='radio'||houseItem.colType==='checkbox'"
class="item_width_2"
v-model="houseItem.colVal"
size="mini"
<div v-if="ruleItem.selSmartType==='house'">
<div v-for="(houseItem,houseIndex) in ruleItem.houseRuleList"
:key="houseIndex"
class="row-item-one">
<el-select class="item_width_1"
v-model="houseItem.colKey"
size="small"
placeholder="请选择">
<el-option v-for="item in houseItemList"
@click.native="handleSelHouseItem(houseIndex,item)"
:key="item.colKey"
:label="item.label"
:value="item.colKey">
</el-option>
</el-select>
<el-select class="item_width_1"
v-model="houseItem.queryType"
size="small"
placeholder="请选择">
<el-option v-for="item in houseItem.colOption"
@click.native="handleSelHouseValue(houseIndex,item)"
<el-option v-for="item in queryList"
@click.native="handleSelHouseQuery(houseIndex,item)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<div v-if="houseItem.queryType!=='is_null'&&houseItem.queryType!=='is_not_null'">
<el-select v-if="houseItem.colType==='select'||houseItem.colType==='radio'||houseItem.colType==='checkbox'"
class="item_width_2"
v-model="houseItem.colVal"
size="small"
placeholder="请选择">
<el-option v-for="item in houseItem.colOption"
@click.native="handleSelHouseValue(houseIndex,item)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input-number v-else-if="houseItem.colType==='inputNum'"
class="item_width_2"
v-model="houseItem.colVal"
:min="0"
size="small"
label="请输入"></el-input-number>
<el-date-picker v-else-if="houseItem.colType==='datepicker'||houseItem.colType==='date'"
v-model="houseItem.colVal"
class="item_width_2"
type="datetime"
size="small"
value-format="yyyy-MM-dd HH:mm:ss"
value="yyyy-MM-dd HH:mm:ss"
placeholder="开始时间">
</el-date-picker>
<el-input v-else
class="item_width_2"
size="small"
placeholder="请输入"
v-model="houseItem.colVal">
</el-input>
</div>
<el-select v-if="houseIndex<(houseRuleList.length-1)"
class="item_width_1"
v-model="houseItem.nextLogicalRel"
size="small"
placeholder="请选择">
<el-option v-for="item in logicalList"
@click.native="handleSelHouseLogical(houseIndex,item)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input-number v-else-if="houseItem.colType==='inputNum'"
class="item_width_2"
v-model="houseItem.colVal"
:min="0"
size="mini"
label="请输入"></el-input-number>
<el-date-picker v-else-if="houseItem.colType==='datepicker'||houseItem.colType==='date'"
v-model="houseItem.colVal"
class="item_width_2"
type="datetime"
size="mini"
value-format="yyyy-MM-dd HH:mm:ss"
value="yyyy-MM-dd HH:mm:ss"
placeholder="开始时间">
</el-date-picker>
<el-input v-else
class="item_width_2"
size="mini"
placeholder="请输入"
v-model="houseItem.colVal">
</el-input>
</div>
<el-select v-if="houseIndex<(houseRuleList.length-1)"
class="item_width_1"
v-model="houseItem.nextLogicalRel"
size="mini"
placeholder="请选择">
<el-option v-for="item in logicalList"
@click.native="handleSelHouseLogical(houseIndex,item)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<img v-if=" houseIndex<houseRuleList.length-1"
class="img_del"
src="@/assets/img/icon-del.png"
@click="delHouse(houseIndex)">
<img v-if=" houseIndex==houseRuleList.length-1"
class="img_del"
src="@/assets/img/icon-add.png"
@click="addHouse(houseIndex)">
</div>
</div>
</div>
<div v-if="ruleItem.selSmartType==='person'">
<div v-for="(personItem,personIndex) in resiRuleList"
:key="personIndex"
class="row-item-one">
<div v-if="personSel">
<div v-for="(personItem,personIndex) in resiRuleList"
:key="personIndex"
class="row-item">
<el-select class="item_width_1"
v-model="personItem.itemGroupId"
size="mini"
placeholder="请选择">
<el-option v-for="item in groupList"
@click.native="handleSelGroup(personIndex,item)"
:key="item.id"
:label="item.label"
:value="item.id">
</el-option>
</el-select>
<el-select class="item_width_1"
v-model="personItem.itemId"
size="mini"
placeholder="请选择">
<el-option v-for="item in personItem.itemList"
@click.native="handleSelGroupItem(personIndex,item)"
:key="item.itemId"
:label="item.label"
:value="item.itemId">
</el-option>
</el-select>
<el-select class="item_width_1"
v-model="personItem.queryType"
size="mini"
placeholder="请选择">
<el-option v-for="item in queryList"
@click.native="handleSelPersonQuery(personIndex,item)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<div v-if="personItem.queryType!=='is_null'&&personItem.queryType!=='is_not_null'">
<el-select v-if="personItem.colType==='select'||personItem.colType==='radio'||personItem.colType==='checkbox'"
class="item_width_2"
v-model="personItem.colVal"
size="mini"
<el-select class="item_width_1"
v-model="personItem.itemGroupId"
size="small"
placeholder="请选择">
<el-option v-for="item in groupList"
@click.native="handleSelGroup(personIndex,item)"
:key="item.id"
:label="item.label"
:value="item.id">
</el-option>
</el-select>
<el-select class="item_width_1"
v-model="personItem.itemId"
size="small"
placeholder="请选择">
<el-option v-for="item in personItem.itemList"
@click.native="handleSelGroupItem(personIndex,item)"
:key="item.itemId"
:label="item.label"
:value="item.itemId">
</el-option>
</el-select>
<el-select class="item_width_1"
v-model="personItem.queryType"
size="small"
placeholder="请选择">
<el-option v-for="item in queryList"
@click.native="handleSelPersonQuery(personIndex,item)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<div v-if="personItem.queryType!=='is_null'&&personItem.queryType!=='is_not_null'">
<el-select v-if="personItem.colType==='select'||personItem.colType==='radio'||personItem.colType==='checkbox'"
class="item_width_2"
v-model="personItem.colVal"
size="small"
placeholder="请选择">
<el-option v-for="item in personItem.colOption"
@click.native="handleSelPersonValue(personIndex,item)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input-number v-else-if="personItem.colType==='inputNum'"
class="item_width_2"
v-model="personItem.colVal"
:min="0"
size="small"
label="请输入"></el-input-number>
<el-date-picker v-else-if="personItem.colType==='datepicker'||personItem.colType==='date'"
v-model="personItem.colVal"
class="item_width_2"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
value="yyyy-MM-dd HH:mm:ss"
placeholder="开始时间">
</el-date-picker>
<el-input v-else
class="item_width_2"
size="small"
placeholder="请输入"
v-model="personItem.colVal">
</el-input>
</div>
<el-select v-if="personIndex<(resiRuleList.length-1)"
class="item_width_1"
v-model="personItem.nextLogicalRel"
size="small"
placeholder="请选择">
<el-option v-for="item in personItem.colOption"
@click.native="handleSelPersonValue(personIndex,item)"
<el-option v-for="item in logicalList"
@click.native="handleSelPersonLogical(personIndex,item)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<el-input-number v-else-if="personItem.colType==='inputNum'"
class="item_width_2"
v-model="personItem.colVal"
:min="0"
size="mini"
label="请输入"></el-input-number>
<el-date-picker v-else-if="personItem.colType==='datepicker'||personItem.colType==='date'"
v-model="personItem.colVal"
class="item_width_2"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
value="yyyy-MM-dd HH:mm:ss"
placeholder="开始时间">
</el-date-picker>
<el-input v-else
class="item_width_2"
size="mini"
placeholder="请输入"
v-model="personItem.colVal">
</el-input>
</div>
<el-select v-if="personIndex<(resiRuleList.length-1)"
class="item_width_1"
v-model="personItem.nextLogicalRel"
size="mini"
placeholder="请选择">
<el-option v-for="item in logicalList"
@click.native="handleSelPersonLogical(personIndex,item)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<img v-if="personIndex<resiRuleList.length-1"
class="img_del"
src="@/assets/img/icon-del.png"
@click="delPerson(personIndex)">
<img v-if="personIndex==resiRuleList.length-1"
class="img_del"
src="@/assets/img/icon-add.png"
@click="addPerson(personIndex)">
</div>
<img v-if=" ruleIndex<smartRuleList.length-1"
class="img_del"
src="@/assets/img/icon-del.png"
@click="delHouse(ruleIndex)">
<img v-if=" ruleIndex==smartRuleList.length-1"
class="img_del"
src="@/assets/img/icon-add.png"
@click="addHouse(ruleIndex)">
</div>
</div>
@ -246,14 +224,14 @@ export default {
houseSel: true,
personSel: false,
selSmartType: 'fangwu',
smartList1: [
{
value: 'fangwu',
value: 'house',
label: '房屋信息'
},
{
value: 'jumin',
value: 'person',
label: '居民信息'
}
],
@ -312,14 +290,19 @@ export default {
nextLogicalRelName: '',
}
],
houseTitleName: '房屋信息',
okflag: false,
showPersonList: false,
ruleList: {},
smartRuleList: [],
smartRuleList: [
{
selSmartType: 'house',
},
],
}
},
@ -340,14 +323,35 @@ export default {
methods: {
handleSelSmartType (value) {
if (value === '房屋') {
this.houseSel = true
this.personSel = false
handleSelSmartType (ruleIndex, item) {
let oneData = this.smartRuleList[ruleIndex]
// oneData.
if (value === 'house') {
let obj = {
ruleDesc: '',
nextLogicalRel: '',//andor
queryType: '',
colTable: '',
colKey: '',
colVal: '',
titleName: '房屋信息',
colType: '',//
colOption: [],
itemGroupName: '房屋信息',
itemLabel: '',
queryTypeName: '',
colValLabel: '',
nextLogicalRelName: '',
}
} else {
this.houseSel = false
this.personSel = true
}
this.$set(this.houseRuleList, houseIndex, oneData)
},
async setRule (resiRuleList, houseRuleList) {
// this.startLoading()
@ -691,63 +695,6 @@ export default {
this.$set(this.houseRuleList, houseIndex, oneData)
},
clickTab (type) {
if (type === 'person') {
this.personSel = true
this.houseSel = false
}
if (type === 'house') {
this.personSel = false
this.houseSel = true
}
},
addRule () {
if (this.personSel) {
this.addPerson()
}
if (this.houseSel) {
this.addHouse()
}
},
addPerson () {
let obj = {
ruleDesc: '',//
nextLogicalRel: '',//andor
itemGroupId: '',
itemId: '',
queryType: '',
colTable: '',
colKey: '',
colVal: '',
itemList: [],
colType: '',//
colOption: [],
itemGroupName: '',
itemLabel: '',
queryTypeName: '',
colValLabel: '',
nextLogicalRelName: '',
}
this.resiRuleList.push(obj)
},
delPerson (index) {
this.resiRuleList.splice(index, 1);
},
addHouse () {
let obj = {
@ -778,7 +725,6 @@ export default {
// ---
async loadPersonGroup () {
const url = '/oper/customize/icformitemgroup/list'
@ -926,6 +872,9 @@ export default {
display: flex;
margin-bottom: 10px;
}
.row-item-one {
display: flex;
}
.item_width_1 {
width: 120px;
margin-right: 10px;

Loading…
Cancel
Save