|
|
@ -68,7 +68,7 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="条件关系" align="center" width="100"> |
|
|
|
<template slot-scope="scope" v-if="scope.$index != tableData.length - 1"> |
|
|
|
<el-select v-model="scope.row.nextLogicalRel" placeholder="请选择" clearable> |
|
|
|
<el-select v-model="scope.row.nextLogicalRel" placeholder="请选择" clearable disabled> |
|
|
|
<el-option v-for="item in nextLogicalRelOpction" :label="item.label" :value="item.value" |
|
|
|
:key="item.value"> |
|
|
|
</el-option> |
|
|
@ -98,11 +98,6 @@ import { requestPost, requestGet } from "@/js/dai/request"; |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
|
|
|
|
|
|
|
|
timeout: null, |
|
|
|
tagObj: {}, |
|
|
|
searchList: [], |
|
|
|
tableData: [ |
|
|
|
{ |
|
|
|
dataSource: "", //数据源 |
|
|
@ -110,7 +105,7 @@ export default { |
|
|
|
itemId: "", //字段名称 |
|
|
|
queryType: "", //比较符 |
|
|
|
colVal: "", //对应值 |
|
|
|
nextLogicalRel: "", //条件关系, |
|
|
|
nextLogicalRel: "and", //条件关系, |
|
|
|
tableName: "", //数据库表名 |
|
|
|
colKey: "", |
|
|
|
itemIdOpction: [], |
|
|
@ -122,7 +117,7 @@ export default { |
|
|
|
{ label: "人员信息", value: "resi" }, |
|
|
|
{ label: "房屋信息", value: "house" }, |
|
|
|
], |
|
|
|
queryTypeOpction: [{}], |
|
|
|
queryTypeOpction: [], |
|
|
|
nextLogicalRelOpction: [ |
|
|
|
{ label: "并且", value: "and" }, |
|
|
|
{ label: "或者", value: "or" }, |
|
|
@ -131,38 +126,23 @@ export default { |
|
|
|
}, |
|
|
|
created() { }, |
|
|
|
async mounted() { |
|
|
|
await this.getLabelList(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
async initForm(type, row) { |
|
|
|
await this.getFormEdit(); |
|
|
|
async initForm(data) { |
|
|
|
// await this.getFormEdit(); |
|
|
|
this.tableData = data |
|
|
|
console.log(data); |
|
|
|
for (let i in this.tableData) { |
|
|
|
this.handleChangeSource(this.tableData[i], [i], type); |
|
|
|
this.handleChangeFieldsType(this.tableData[i], [i], type); |
|
|
|
this.handleChangeSource(this.tableData[i], [i]); |
|
|
|
this.handleChangeFieldsType(this.tableData[i], [i]); |
|
|
|
setTimeout(() => { |
|
|
|
this.handleChangeFieldsName(this.tableData[i], [i], type); |
|
|
|
this.handleChangeFieldsName(this.tableData[i], [i]); |
|
|
|
}, 300); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async handleSelect(item) { |
|
|
|
console.log(item); |
|
|
|
await this.initForm("info", item); |
|
|
|
}, |
|
|
|
async getLabelList() { |
|
|
|
const url = "/governance/resiSearchTag/listResiSearchTags"; |
|
|
|
let params = { |
|
|
|
pageSize: 99, |
|
|
|
}; |
|
|
|
let { data, msg, code } = await requestPost(url, params); |
|
|
|
if (code == 0) { |
|
|
|
this.searchList = data.list; |
|
|
|
} else { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 选择数据源 |
|
|
|
async handleChangeSource(row, index, type) { |
|
|
|
async handleChangeSource(row, index) { |
|
|
|
console.log(row); |
|
|
|
if (row.dataSource == "resi") { |
|
|
|
let url = "/oper/customize/icformitemgroup/list"; |
|
|
@ -178,15 +158,15 @@ export default { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
this.hadeleClearForm(this.tableData[index], index); |
|
|
|
if (!type) { |
|
|
|
this.tableData[index].itemGroupId = ""; |
|
|
|
this.tableData[index].itemId = ""; |
|
|
|
this.tableData[index].colKey = ""; |
|
|
|
this.tableData[index].colVal = ""; |
|
|
|
this.tableData[index].nextLogicalRel = ""; |
|
|
|
this.tableData[index].queryType = ""; |
|
|
|
this.tableData[index].itemIdOpction = []; |
|
|
|
} |
|
|
|
// if (!type) { |
|
|
|
// this.tableData[index].itemGroupId = ""; |
|
|
|
// this.tableData[index].itemId = ""; |
|
|
|
// this.tableData[index].colKey = ""; |
|
|
|
// this.tableData[index].colVal = ""; |
|
|
|
// this.tableData[index].nextLogicalRel = ""; |
|
|
|
// this.tableData[index].queryType = ""; |
|
|
|
// this.tableData[index].itemIdOpction = []; |
|
|
|
// } |
|
|
|
} else if (row.dataSource == "house") { |
|
|
|
let url = "/governance/policy/item-list/house"; |
|
|
|
let params = {}; |
|
|
@ -197,14 +177,14 @@ export default { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
this.hadeleClearForm(this.tableData[index], index); |
|
|
|
if (!type) { |
|
|
|
this.tableData[index].itemGroupId = ""; |
|
|
|
this.tableData[index].itemId = ""; |
|
|
|
this.tableData[index].colKey = ""; |
|
|
|
this.tableData[index].colVal = ""; |
|
|
|
this.tableData[index].nextLogicalRel = ""; |
|
|
|
this.tableData[index].queryType = ""; |
|
|
|
} |
|
|
|
// if (!type) { |
|
|
|
// this.tableData[index].itemGroupId = ""; |
|
|
|
// this.tableData[index].itemId = ""; |
|
|
|
// this.tableData[index].colKey = ""; |
|
|
|
// this.tableData[index].colVal = ""; |
|
|
|
// this.tableData[index].nextLogicalRel = ""; |
|
|
|
// this.tableData[index].queryType = ""; |
|
|
|
// } |
|
|
|
} else if (row.dataSource == "stat") { |
|
|
|
let url = "/governance/policy/item-list/stat"; |
|
|
|
let params = {}; |
|
|
@ -215,14 +195,14 @@ export default { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
this.hadeleClearForm(this.tableData[index], index); |
|
|
|
if (!type) { |
|
|
|
this.tableData[index].itemGroupId = ""; |
|
|
|
this.tableData[index].itemId = ""; |
|
|
|
this.tableData[index].colKey = ""; |
|
|
|
this.tableData[index].colVal = ""; |
|
|
|
this.tableData[index].nextLogicalRel = ""; |
|
|
|
this.tableData[index].queryType = ""; |
|
|
|
} |
|
|
|
// if (!type) { |
|
|
|
// this.tableData[index].itemGroupId = ""; |
|
|
|
// this.tableData[index].itemId = ""; |
|
|
|
// this.tableData[index].colKey = ""; |
|
|
|
// this.tableData[index].colVal = ""; |
|
|
|
// this.tableData[index].nextLogicalRel = ""; |
|
|
|
// this.tableData[index].queryType = ""; |
|
|
|
// } |
|
|
|
} else { |
|
|
|
this.hadeleClearForm(this.tableData[index], index); |
|
|
|
this.tableData[index].itemGroupId = ""; |
|
|
@ -238,7 +218,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 字段类别修改 |
|
|
|
async handleChangeFieldsType(row, index, type) { |
|
|
|
async handleChangeFieldsType(row, index) { |
|
|
|
console.log(row, index, "字段类别row"); |
|
|
|
if (row.dataSource != "resi") return; |
|
|
|
const url = "/oper/customize/icformitem/getItemListV2"; |
|
|
@ -247,14 +227,14 @@ export default { |
|
|
|
policyFlag: "1", |
|
|
|
}; |
|
|
|
this.hadeleClearForm(this.tableData[index], index); |
|
|
|
if (!type) { |
|
|
|
this.tableData[index].itemId = ""; |
|
|
|
this.tableData[index].colKey = ""; |
|
|
|
this.tableData[index].colVal = ""; |
|
|
|
this.tableData[index].nextLogicalRel = ""; |
|
|
|
this.tableData[index].queryType = ""; |
|
|
|
this.tableData[index].itemIdOpction = []; |
|
|
|
} |
|
|
|
// if (!type) { |
|
|
|
// this.tableData[index].itemId = ""; |
|
|
|
// this.tableData[index].colKey = ""; |
|
|
|
// this.tableData[index].colVal = ""; |
|
|
|
// this.tableData[index].nextLogicalRel = ""; |
|
|
|
// this.tableData[index].queryType = ""; |
|
|
|
// this.tableData[index].itemIdOpction = []; |
|
|
|
// } |
|
|
|
let { data, code, msg } = await requestPost(url, params); |
|
|
|
if (code == 0) { |
|
|
|
this.$set(this.tableData[index], "itemIdOpction", data); |
|
|
@ -264,7 +244,7 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
// 字段名称修改 |
|
|
|
async handleChangeFieldsName(row, index, type) { |
|
|
|
async handleChangeFieldsName(row, index) { |
|
|
|
console.log(row, "字段名称row"); |
|
|
|
var arr = []; |
|
|
|
// 人的信息中colKey的字段是columnName要做一下判断 |
|
|
@ -272,22 +252,22 @@ export default { |
|
|
|
arr = row.itemIdOpction.filter((item) => item.colKey == row.itemId); |
|
|
|
this.tableData[index].tableName = arr[0].tableName; |
|
|
|
this.tableData[index].colKey = arr[0].colKey; |
|
|
|
if (!type) { |
|
|
|
this.tableData[index].colVal = ""; |
|
|
|
this.tableData[index].nextLogicalRel = ""; |
|
|
|
this.tableData[index].queryType = ""; |
|
|
|
} |
|
|
|
// if (!type) { |
|
|
|
// this.tableData[index].colVal = ""; |
|
|
|
// this.tableData[index].nextLogicalRel = ""; |
|
|
|
// this.tableData[index].queryType = ""; |
|
|
|
// } |
|
|
|
// this.tableData[index].colVal = '' |
|
|
|
// this.tableData[index].queryType = '' |
|
|
|
} else if (row.dataSource == "resi" && row.itemId != "") { |
|
|
|
arr = row.itemIdOpction.filter((item) => item.itemId == row.itemId); |
|
|
|
this.tableData[index].tableName = arr[0].tableName; |
|
|
|
this.tableData[index].colKey = arr[0].columnName; |
|
|
|
if (!type) { |
|
|
|
this.tableData[index].colVal = ""; |
|
|
|
this.tableData[index].nextLogicalRel = ""; |
|
|
|
this.tableData[index].queryType = ""; |
|
|
|
} |
|
|
|
// if (!type) { |
|
|
|
// this.tableData[index].colVal = ""; |
|
|
|
// this.tableData[index].nextLogicalRel = ""; |
|
|
|
// this.tableData[index].queryType = ""; |
|
|
|
// } |
|
|
|
// this.tableData[index].colVal = '' |
|
|
|
// this.tableData[index].queryType = '' |
|
|
|
} |
|
|
@ -348,36 +328,26 @@ export default { |
|
|
|
}; |
|
|
|
this.$set(this.tableData, index, obj); |
|
|
|
}, |
|
|
|
async getFormEdit(id) { |
|
|
|
const url = `/governance/resiSearchTag/listResiSearchRulesByTagId?tagId=${id}`; |
|
|
|
let { code, msg, data } = await requestGet(url); |
|
|
|
if (code == 0) { |
|
|
|
console.log(data, "获取到的详情信息"); |
|
|
|
this.tableData = data; |
|
|
|
} else if (code >= 8000) { |
|
|
|
this.$message.error(msg); |
|
|
|
} |
|
|
|
}, |
|
|
|
async handleComfirm() { |
|
|
|
let messageObj = {}; |
|
|
|
messageObj = this.validateRule(this.tableData); |
|
|
|
if (messageObj) { |
|
|
|
this.$message.error(messageObj); |
|
|
|
return; |
|
|
|
} |
|
|
|
for (let i in this.tableData) { |
|
|
|
for (let j in this.tableData[i]) { |
|
|
|
if ( |
|
|
|
typeof this.tableData[i][j] != "string" && |
|
|
|
typeof this.tableData[i][j] != "number" |
|
|
|
) { |
|
|
|
this.$delete(this.tableData[i], j); |
|
|
|
} |
|
|
|
let messageObj = {}; |
|
|
|
messageObj = this.validateRule(this.tableData); |
|
|
|
if (messageObj) { |
|
|
|
this.$message.error(messageObj); |
|
|
|
return; |
|
|
|
} |
|
|
|
for (let i in this.tableData) { |
|
|
|
for (let j in this.tableData[i]) { |
|
|
|
if ( |
|
|
|
typeof this.tableData[i][j] != "string" && |
|
|
|
typeof this.tableData[i][j] != "number" |
|
|
|
) { |
|
|
|
this.$delete(this.tableData[i], j); |
|
|
|
} |
|
|
|
} |
|
|
|
this.$emit("dialogOk", this.tableData); |
|
|
|
} |
|
|
|
this.$emit("dialogOk", this.tableData); |
|
|
|
|
|
|
|
// this.addSubmit(); |
|
|
|
// this.addSubmit(); |
|
|
|
}, |
|
|
|
handleCancle() { |
|
|
|
this.$emit("dialogCancle"); |
|
|
@ -441,7 +411,7 @@ export default { |
|
|
|
obj.itemId = ""; |
|
|
|
obj.queryType = ""; |
|
|
|
obj.colVal = ""; |
|
|
|
obj.nextLogicalRel = ""; |
|
|
|
obj.nextLogicalRel = "and"; |
|
|
|
obj.itemIdOpction = []; |
|
|
|
this.tableData.push(obj); |
|
|
|
}, |
|
|
@ -454,7 +424,12 @@ export default { |
|
|
|
this.tableData[index].queryType = ""; |
|
|
|
}, |
|
|
|
}, |
|
|
|
props: {}, |
|
|
|
props: { |
|
|
|
rulesData: { |
|
|
|
type: Array, |
|
|
|
default: () => [] |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: {}, |
|
|
|
watch: {}, |
|
|
|
}; |
|
|
|