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-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" class="row-item-one">
:key="houseIndex"
class="row-item-one"> <el-select class="item_width_1"
v-model="ruleItem.houseRule.colKey"
<el-select class="item_width_1" size="small"
v-model="houseItem.colKey" placeholder="请选择">
size="small" <el-option v-for="item in houseItemList"
placeholder="请选择"> @click.native="handleSelHouseItem(ruleIndex,item)"
<el-option v-for="item in houseItemList" :key="item.colKey"
@click.native="handleSelHouseItem(houseIndex,item)" :label="item.label"
:key="item.colKey" :value="item.colKey">
:label="item.label" </el-option>
:value="item.colKey"> </el-select>
</el-option> <el-select class="item_width_1"
</el-select> v-model="ruleItem.houseRule.queryType"
<el-select class="item_width_1" size="small"
v-model="houseItem.queryType" 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" size="small"
placeholder="请选择"> placeholder="请选择">
<el-option v-for="item in queryList" <el-option v-for="item in ruleItem.houseRule.colOption"
@click.native="handleSelHouseQuery(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>
<div v-if="houseItem.queryType!=='is_null'&&houseItem.queryType!=='is_not_null'"> <el-input-number v-else-if="ruleItem.houseRule.colType==='inputNum'"
class="item_width_2"
<el-select v-if="houseItem.colType==='select'||houseItem.colType==='radio'||houseItem.colType==='checkbox'" v-model="ruleItem.houseRule.colVal"
class="item_width_2" :min="0"
v-model="houseItem.colVal" size="small"
size="small" label="请输入"></el-input-number>
placeholder="请选择"> <el-date-picker v-else-if="ruleItem.houseRule.colType==='datepicker'||ruleItem.houseRule.colType==='date'"
<el-option v-for="item in houseItem.colOption" v-model="ruleItem.houseRule.colVal"
@click.native="handleSelHouseValue(houseIndex,item)" class="item_width_2"
:key="item.value" type="datetime"
:label="item.label" size="small"
:value="item.value"> value-format="yyyy-MM-dd HH:mm:ss"
</el-option> value="yyyy-MM-dd HH:mm:ss"
</el-select> placeholder="开始时间">
<el-input-number v-else-if="houseItem.colType==='inputNum'" </el-date-picker>
class="item_width_2" <el-input v-else
v-model="houseItem.colVal" class="item_width_2"
:min="0" size="small"
size="small" placeholder="请输入"
label="请输入"></el-input-number> v-model="ruleItem.houseRule.colVal">
<el-date-picker v-else-if="houseItem.colType==='datepicker'||houseItem.colType==='date'" </el-input>
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>
</div> </div>
</div> </div>
@ -174,23 +157,23 @@
</div> </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>
</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" <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 (item.value === 'house') {
if (value === 'house') { oneData.houseRule = {
let obj = {
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