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

222
src/views/components/smartSearchRule.vue

@ -17,83 +17,66 @@
</el-option>
</el-select>
<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"
<div v-if="ruleItem.selSmartType==='house'"
class="row-item-one">
<el-select class="item_width_1"
v-model="ruleItem.houseRule.colKey"
size="small"
placeholder="请选择">
<el-option v-for="item in houseItemList"
@click.native="handleSelHouseItem(ruleIndex,item)"
:key="item.colKey"
:label="item.label"
:value="item.colKey">
</el-option>
</el-select>
<el-select class="item_width_1"
v-model="ruleItem.houseRule.queryType"
size="small"
placeholder="请选择">
<el-option v-for="item in queryList"
@click.native="handleSelHouseQuery(ruleIndex,item)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<div v-if="ruleItem.houseRule.queryType!=='is_null'&&ruleItem.houseRule.queryType!=='is_not_null'">
<el-select v-if="ruleItem.houseRule.colType==='select'||ruleItem.houseRule.colType==='radio'||ruleItem.houseRule.colType==='checkbox'"
class="item_width_2"
v-model="ruleItem.houseRule.colVal"
size="small"
placeholder="请选择">
<el-option v-for="item in queryList"
@click.native="handleSelHouseQuery(houseIndex,item)"
<el-option v-for="item in ruleItem.houseRule.colOption"
@click.native="handleSelHouseValue(ruleIndex,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="ruleItem.houseRule.colType==='inputNum'"
class="item_width_2"
v-model="ruleItem.houseRule.colVal"
:min="0"
size="small"
label="请输入"></el-input-number>
<el-date-picker v-else-if="ruleItem.houseRule.colType==='datepicker'||ruleItem.houseRule.colType==='date'"
v-model="ruleItem.houseRule.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="ruleItem.houseRule.colVal">
</el-input>
</div>
</div>
@ -174,23 +157,23 @@
</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 logicalList"
@click.native="handleSelPersonLogical(personIndex,item)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</div>
</div>
<el-select v-if="ruleIndex<(smartRuleList.length-1)"
class="item_width_1"
v-model="ruleItem.houseRule.nextLogicalRel"
size="small"
placeholder="请选择">
<el-option v-for="item in logicalList"
@click.native="handleSelPersonLogical(ruleIndex,item)"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<img v-if=" ruleIndex<smartRuleList.length-1"
class="img_del"
src="@/assets/img/icon-del.png"
@ -299,6 +282,23 @@ export default {
smartRuleList: [
{
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: {
handleSelSmartType (ruleIndex, item) {
let oneData = this.smartRuleList[ruleIndex]
// oneData.
if (value === 'house') {
let obj = {
if (item.value === 'house') {
oneData.houseRule = {
ruleDesc: '',
nextLogicalRel: '',//andor
queryType: '',
@ -347,11 +344,30 @@ export default {
colValLabel: '',
nextLogicalRelName: '',
}
} 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) {
// this.startLoading()
@ -695,34 +711,6 @@ export default {
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