jiangyy 3 years ago
parent
commit
df7a7b8f3a
  1. 134
      src/views/components/smartSearchRule.vue

134
src/views/components/smartSearchRule.vue

@ -17,55 +17,53 @@
</el-option> </el-option>
</el-select> </el-select>
<div v-if="ruleItem.selSmartType==='house'"> <div v-if="ruleItem.selSmartType==='house'"
<div v-for="(houseItem,houseIndex) in ruleItem.houseRuleList"
:key="houseIndex"
class="row-item-one"> class="row-item-one">
<el-select class="item_width_1" <el-select class="item_width_1"
v-model="houseItem.colKey" v-model="ruleItem.houseRule.colKey"
size="small" size="small"
placeholder="请选择"> placeholder="请选择">
<el-option v-for="item in houseItemList" <el-option v-for="item in houseItemList"
@click.native="handleSelHouseItem(houseIndex,item)" @click.native="handleSelHouseItem(ruleIndex,item)"
:key="item.colKey" :key="item.colKey"
:label="item.label" :label="item.label"
:value="item.colKey"> :value="item.colKey">
</el-option> </el-option>
</el-select> </el-select>
<el-select class="item_width_1" <el-select class="item_width_1"
v-model="houseItem.queryType" v-model="ruleItem.houseRule.queryType"
size="small" size="small"
placeholder="请选择"> placeholder="请选择">
<el-option v-for="item in queryList" <el-option v-for="item in queryList"
@click.native="handleSelHouseQuery(houseIndex,item)" @click.native="handleSelHouseQuery(ruleIndex,item)"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<div v-if="houseItem.queryType!=='is_null'&&houseItem.queryType!=='is_not_null'"> <div v-if="ruleItem.houseRule.queryType!=='is_null'&&ruleItem.houseRule.queryType!=='is_not_null'">
<el-select v-if="houseItem.colType==='select'||houseItem.colType==='radio'||houseItem.colType==='checkbox'" <el-select v-if="ruleItem.houseRule.colType==='select'||ruleItem.houseRule.colType==='radio'||ruleItem.houseRule.colType==='checkbox'"
class="item_width_2" class="item_width_2"
v-model="houseItem.colVal" v-model="ruleItem.houseRule.colVal"
size="small" size="small"
placeholder="请选择"> placeholder="请选择">
<el-option v-for="item in houseItem.colOption" <el-option v-for="item in ruleItem.houseRule.colOption"
@click.native="handleSelHouseValue(houseIndex,item)" @click.native="handleSelHouseValue(ruleIndex,item)"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
<el-input-number v-else-if="houseItem.colType==='inputNum'" <el-input-number v-else-if="ruleItem.houseRule.colType==='inputNum'"
class="item_width_2" class="item_width_2"
v-model="houseItem.colVal" v-model="ruleItem.houseRule.colVal"
:min="0" :min="0"
size="small" size="small"
label="请输入"></el-input-number> label="请输入"></el-input-number>
<el-date-picker v-else-if="houseItem.colType==='datepicker'||houseItem.colType==='date'" <el-date-picker v-else-if="ruleItem.houseRule.colType==='datepicker'||ruleItem.houseRule.colType==='date'"
v-model="houseItem.colVal" v-model="ruleItem.houseRule.colVal"
class="item_width_2" class="item_width_2"
type="datetime" type="datetime"
size="small" size="small"
@ -77,25 +75,10 @@
class="item_width_2" class="item_width_2"
size="small" size="small"
placeholder="请输入" placeholder="请输入"
v-model="houseItem.colVal"> v-model="ruleItem.houseRule.colVal">
</el-input> </el-input>
</div> </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>
</div>
</div> </div>
<div v-if="ruleItem.selSmartType==='person'"> <div v-if="ruleItem.selSmartType==='person'">
@ -174,23 +157,23 @@
</div> </div>
<el-select v-if="personIndex<(resiRuleList.length-1)" </div>
</div>
<el-select v-if="ruleIndex<(smartRuleList.length-1)"
class="item_width_1" class="item_width_1"
v-model="personItem.nextLogicalRel" v-model="ruleItem.houseRule.nextLogicalRel"
size="small" size="small"
placeholder="请选择"> placeholder="请选择">
<el-option v-for="item in logicalList" <el-option v-for="item in logicalList"
@click.native="handleSelPersonLogical(personIndex,item)" @click.native="handleSelPersonLogical(ruleIndex,item)"
:key="item.value" :key="item.value"
:label="item.label" :label="item.label"
:value="item.value"> :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</div>
</div>
<img v-if=" ruleIndex<smartRuleList.length-1" <img v-if=" ruleIndex<smartRuleList.length-1"
class="img_del" class="img_del"
src="@/assets/img/icon-del.png" src="@/assets/img/icon-del.png"
@ -299,6 +282,23 @@ export default {
smartRuleList: [ smartRuleList: [
{ {
selSmartType: 'house', selSmartType: 'house',
houseRule: {
ruleDesc: '',
nextLogicalRel: '',//andor
queryType: '',
colTable: '',
colKey: '',
colVal: '',
titleName: '房屋信息',
colType: '',//
colOption: [],
itemGroupName: '房屋信息',
itemLabel: '',
queryTypeName: '',
colValLabel: '',
nextLogicalRelName: '',
}
}, },
@ -325,12 +325,9 @@ export default {
methods: { methods: {
handleSelSmartType (ruleIndex, item) { handleSelSmartType (ruleIndex, item) {
let oneData = this.smartRuleList[ruleIndex] let oneData = this.smartRuleList[ruleIndex]
// oneData.
if (value === 'house') { if (item.value === 'house') {
let obj = { oneData.houseRule = {
ruleDesc: '', ruleDesc: '',
nextLogicalRel: '',//andor nextLogicalRel: '',//andor
queryType: '', queryType: '',
@ -347,11 +344,30 @@ export default {
colValLabel: '', colValLabel: '',
nextLogicalRelName: '', nextLogicalRelName: '',
} }
} else { } else {
oneData.personRule = {
ruleDesc: '',//
nextLogicalRel: '',//andor
itemGroupId: '',
itemId: '',
queryType: '',
colTable: '',
colKey: '',
colVal: '',
itemList: [],
colType: '',//
colOption: [],
itemGroupName: '',
itemLabel: '',
queryTypeName: '',
colValLabel: '',
nextLogicalRelName: '',
}
} }
this.$set(this.houseRuleList, houseIndex, oneData) this.$set(this.smartRuleList, ruleIndex, oneData)
}, },
async setRule (resiRuleList, houseRuleList) { async setRule (resiRuleList, houseRuleList) {
// this.startLoading() // this.startLoading()
@ -695,34 +711,6 @@ export default {
this.$set(this.houseRuleList, houseIndex, oneData) this.$set(this.houseRuleList, houseIndex, oneData)
}, },
addHouse () {
let obj = {
ruleDesc: '',
nextLogicalRel: '',//andor
queryType: '',
colTable: '',
colKey: '',
colVal: '',
titleName: '房屋信息',
colType: '',//
colOption: [],
itemGroupName: '房屋信息',
itemLabel: '',
queryTypeName: '',
colValLabel: '',
nextLogicalRelName: '',
}
this.houseRuleList.push(obj)
},
delHouse (index) {
this.houseRuleList.splice(index, 1);
},
// --- // ---

Loading…
Cancel
Save