Browse Source

智能查询逻辑

dev-新版ui
jiangyy 3 years ago
parent
commit
e5fee9c02f
  1. 58
      src/views/components/resiSearch.vue
  2. 109
      src/views/components/smartSearchRule.vue

58
src/views/components/resiSearch.vue

@ -182,11 +182,11 @@
class="resi-row-more"> class="resi-row-more">
<el-col :span="24"> <el-col :span="24">
<el-button v-for="btnItem in btnList" <el-button v-for="(btnItem,index) in btnList"
:key="btnItem.index" :key="index"
size="small" size="small"
:class="selBtnIndex===btnItem.index?'diy-button--blue':'diy-button--gray'" :class="selBtnIndex===index?'diy-button--blue':'diy-button--gray'"
@click="handelSelSmartBtn(btnItem.index)">{{btnItem.name}}</el-button> @click="handelSelSmartBtn(index)">{{btnItem.name}}</el-button>
</el-col> </el-col>
<el-col> <el-col>
@ -364,16 +364,56 @@ export default {
showSmartSearchForm: true, showSmartSearchForm: true,
formType: 'add', formType: 'add',
selBtnIndex: 1, selBtnIndex: 0,
btnList: [ btnList: [
{ {
name: '智能查询', name: '智能查询',
index: 1,
ruleList: [
{
selSmartType: 'house',
nextLogicalRel: "",
nextLogicalRelName: "",
personRule: {
ruleDesc: '',//
itemGroupId: '',
itemId: '',
queryType: '',
colTable: '',
colKey: '',
colVal: '',
itemList: [],
colType: '',//
colOption: [],
itemGroupName: '',
itemLabel: '',
queryTypeName: '',
colValLabel: '',
},
houseRule: {
ruleDesc: '',
queryType: '',
colTable: '',
colKey: '',
colVal: '',
titleName: '房屋信息',
colType: '',//
colOption: [],
itemGroupName: '房屋信息',
itemLabel: '',
queryTypeName: '',
colValLabel: '',
},
}
]
}, },
{ {
name: '租户', name: '租户',
index: 2,
ruleList: [ ruleList: [
{ {
selSmartType: 'house', selSmartType: 'house',
@ -412,12 +452,13 @@ export default {
ruleDesc: "房屋信息房屋状态等于出租", ruleDesc: "房屋信息房屋状态等于出租",
}, },
}, },
] ]
}, },
{ {
name: '第一党支部党员', name: '第一党支部党员',
index: 3,
ruleList: [ ruleList: [
{ {
selSmartType: 'person', selSmartType: 'person',
@ -517,6 +558,7 @@ export default {
handelSelSmartBtn (index) { handelSelSmartBtn (index) {
this.selBtnIndex = index this.selBtnIndex = index
this.$refs['ref_rule'].setRule(this.btnList[index].ruleList)
}, },
initForm () { initForm () {

109
src/views/components/smartSearchRule.vue

@ -300,7 +300,6 @@ export default {
handleSelSmartType (ruleIndex, item) { handleSelSmartType (ruleIndex, item) {
let oneData = this.smartRuleList[ruleIndex] let oneData = this.smartRuleList[ruleIndex]
// if (item.value === 'house') {
oneData.houseRule = { oneData.houseRule = {
ruleDesc: '', ruleDesc: '',
queryType: '', queryType: '',
@ -336,65 +335,61 @@ export default {
} }
// } else {
// }
this.$set(this.smartRuleList, ruleIndex, oneData) this.$set(this.smartRuleList, ruleIndex, oneData)
console.log(this.smartRuleList) console.log(this.smartRuleList)
}, },
// async setRule (smartRuleList, smartRuleList) { async setRule (ruleList) {
// // this.startLoading() // this.startLoading()
// if (this.groupList.length == 0 || this.houseItemList.length === 0) { if (this.groupList.length == 0 || this.houseItemList.length === 0) {
// setTimeout(() => { setTimeout(() => {
// this.setRule(smartRuleList, smartRuleList); this.setRule(ruleList);
// }, 500); }, 500);
// return false return false
// } }
this.smartRuleList = ruleList
// this.smartRuleList = smartRuleList if (this.smartRuleList && this.smartRuleList.length > 0) {
// if (this.smartRuleList && this.smartRuleList.length > 0) {
// this.personChecked = true for (let i = 0; i < this.smartRuleList.length; i++) {
// for (let i = 0; i < this.smartRuleList.length; i++) {
// let element = this.smartRuleList[i] let element = this.smartRuleList[i]
if (element.selSmartType === 'house') {
// let selGroup = this.groupList.filter((item) =>
// element.itemGroupId === item.id let selHouseItem = this.houseItemList.filter((item) =>
// ); element.houseRule.colKey === item.colKey
// console.log(selGroup) );
// if (selGroup.length > 0) { if (selHouseItem.length > 0) {
// await this.handleSelGroup(i, selGroup[0], true) await this.handleSelHouseItem(i, selHouseItem[0], true)
}
}
// let selItem = element.itemList.filter((item) =>
// element.itemId === item.itemId); if (element.selSmartType === 'person') {
// if (selItem.length > 0) {
// await this.handleSelGroupItem(i, selItem[0], true) let selGroup = this.groupList.filter((item) =>
// } element.personRule.itemGroupId === item.id
);
// } console.log(selGroup)
// }
// } if (selGroup.length > 0) {
await this.handleSelGroup(i, selGroup[0], true)
// this.smartRuleList = smartRuleList
// if (this.smartRuleList && this.smartRuleList.length > 0) {
// this.houseChecked = true let selItem = element.personRule.itemList.filter((item) =>
// this.smartRuleList.forEach((element, index) => { element.personRule.itemId === item.itemId);
if (selItem.length > 0) {
// let selHouseItem = this.houseItemList.filter((item) => await this.handleSelGroupItem(i, selItem[0], true)
// element.colKey === item.colKey }
// );
}
// if (selHouseItem.length > 0) { }
// this.handleSelHouseItem(index, selHouseItem[0], true)
// } }
}
// });
// }
// }, },
getRule () { getRule () {
this.okflag = false this.okflag = false

Loading…
Cancel
Save