|
@ -27,14 +27,7 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="事件类型" prop="firstIdList"> |
|
|
<el-form-item label="事件类型" prop="firstIdList"> |
|
|
<el-cascader ref="cascaderEvent" v-model="eventTypeCheck" :options="cateOptions" collapse-tags |
|
|
<el-cascader ref="cascaderEvent" v-model="eventTypeCheck" :options="cateOptions" collapse-tags |
|
|
:show-all-levels="false" :props="{ |
|
|
:show-all-levels="false" :props="optionProps" clearable class="u-item-width-normal" @change="handleEventType" /> |
|
|
multiple: true, |
|
|
|
|
|
checkStrictly: false, |
|
|
|
|
|
emitPath: false, |
|
|
|
|
|
children: 'subCategory', |
|
|
|
|
|
label: 'name', |
|
|
|
|
|
value: 'id', |
|
|
|
|
|
}" clearable class="u-item-width-normal" @change="handleEventType" /> |
|
|
|
|
|
<!-- <template slot-scope="{ node, data }"> |
|
|
<!-- <template slot-scope="{ node, data }"> |
|
|
<div @click="cascaderClick(node, data)"> |
|
|
<div @click="cascaderClick(node, data)"> |
|
|
<span>{{ data.name }}</span> |
|
|
<span>{{ data.name }}</span> |
|
@ -341,6 +334,14 @@ export default { |
|
|
secondIdList: [], |
|
|
secondIdList: [], |
|
|
}, |
|
|
}, |
|
|
cateOptions: [], |
|
|
cateOptions: [], |
|
|
|
|
|
optionProps: { |
|
|
|
|
|
multiple: true, |
|
|
|
|
|
checkStrictly: false, |
|
|
|
|
|
emitPath: false, |
|
|
|
|
|
children: 'children', |
|
|
|
|
|
label: 'categoryName', |
|
|
|
|
|
value: 'id', |
|
|
|
|
|
}, |
|
|
eventTypeCheck: [], |
|
|
eventTypeCheck: [], |
|
|
pageNo: 1, |
|
|
pageNo: 1, |
|
|
pageSize: window.localStorage.getItem("pageSize") || 20, |
|
|
pageSize: window.localStorage.getItem("pageSize") || 20, |
|
@ -380,9 +381,7 @@ export default { |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
mounted() { |
|
|
mounted() { |
|
|
console.log(this.$store.state); |
|
|
|
|
|
this.user = this.$store.state.user; |
|
|
this.user = this.$store.state.user; |
|
|
|
|
|
|
|
|
this.agencyId = this.user.agencyId; |
|
|
this.agencyId = this.user.agencyId; |
|
|
this.loadGrid(); |
|
|
this.loadGrid(); |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
@ -390,16 +389,12 @@ export default { |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
handleEventType(val) { |
|
|
handleEventType(val) { |
|
|
// console.log('val-----eee', val) |
|
|
|
|
|
console.log("nodes---", this.$refs.cascaderEvent.getCheckedNodes()); |
|
|
|
|
|
const nodes = this.$refs.cascaderEvent.getCheckedNodes(); |
|
|
const nodes = this.$refs.cascaderEvent.getCheckedNodes(); |
|
|
this.formData.firstIdList = []; |
|
|
this.formData.firstIdList = []; |
|
|
this.formData.secondIdList = []; |
|
|
this.formData.secondIdList = []; |
|
|
let level1 = nodes.filter((item) => item.level === 1); |
|
|
let level1 = nodes.filter((item) => item.level === 1); |
|
|
let level2 = nodes.filter((item) => item.level === 2); |
|
|
let level2 = nodes.filter((item) => item.level === 2); |
|
|
console.log("level2----1", level2); |
|
|
|
|
|
level1.forEach((item) => { |
|
|
level1.forEach((item) => { |
|
|
console.log("level2----2", level2); |
|
|
|
|
|
if (item.hasChildren) { |
|
|
if (item.hasChildren) { |
|
|
for (let i = level2.length - 1; i >= 0; i--) { |
|
|
for (let i = level2.length - 1; i >= 0; i--) { |
|
|
if (level2[i].parent.value === item.value) level2.splice(i, 1); |
|
|
if (level2[i].parent.value === item.value) level2.splice(i, 1); |
|
@ -414,7 +409,6 @@ export default { |
|
|
val.forEach((element) => { |
|
|
val.forEach((element) => { |
|
|
this.multipleSelection.push(element.icEventId); |
|
|
this.multipleSelection.push(element.icEventId); |
|
|
}); |
|
|
}); |
|
|
console.log(this.multipleSelection); |
|
|
|
|
|
}, |
|
|
}, |
|
|
async handleMarkDiffcult(command) { |
|
|
async handleMarkDiffcult(command) { |
|
|
const url = "/governance/icEventOld/difficultpointevent"; |
|
|
const url = "/governance/icEventOld/difficultpointevent"; |
|
@ -426,11 +420,8 @@ export default { |
|
|
icEventIdList: this.multipleSelection, |
|
|
icEventIdList: this.multipleSelection, |
|
|
type: command, |
|
|
type: command, |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
|
|
|
|
|
|
this.$message.success("标记成功"); |
|
|
this.$message.success("标记成功"); |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
} else { |
|
|
} else { |
|
@ -447,9 +438,7 @@ export default { |
|
|
icEventIdList: this.multipleSelection, |
|
|
icEventIdList: this.multipleSelection, |
|
|
type: "0", |
|
|
type: "0", |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
this.$message.success("取消标记成功"); |
|
|
this.$message.success("取消标记成功"); |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
@ -459,14 +448,12 @@ export default { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleSearch(val) { |
|
|
handleSearch(val) { |
|
|
console.log(this.formData); |
|
|
|
|
|
this.pageNo = 1; |
|
|
this.pageNo = 1; |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async loadGrid() { |
|
|
async loadGrid() { |
|
|
const url = "/gov/org/customergrid/gridoption"; |
|
|
const url = "/gov/org/customergrid/gridoption"; |
|
|
|
|
|
|
|
|
let params = { |
|
|
let params = { |
|
|
agencyId: this.agencyId, |
|
|
agencyId: this.agencyId, |
|
|
purpose: "query", |
|
|
purpose: "query", |
|
@ -523,12 +510,9 @@ export default { |
|
|
async handleWatch(row) { |
|
|
async handleWatch(row) { |
|
|
this.eventId = row.icEventId; |
|
|
this.eventId = row.icEventId; |
|
|
const url = "/governance/icEventOld/detail"; |
|
|
const url = "/governance/icEventOld/detail"; |
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/icEvent/detail"; |
|
|
|
|
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, { |
|
|
const { data, code, msg } = await requestPost(url, { |
|
|
icEventId: this.eventId, |
|
|
icEventId: this.eventId, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
this.eventDetailData = { ...data }; |
|
|
this.eventDetailData = { ...data }; |
|
|
this.pageType = "info"; |
|
|
this.pageType = "info"; |
|
@ -541,12 +525,9 @@ export default { |
|
|
async handleDispose(row) { |
|
|
async handleDispose(row) { |
|
|
this.eventId = row.icEventId; |
|
|
this.eventId = row.icEventId; |
|
|
const url = "/governance/icEventOld/detail"; |
|
|
const url = "/governance/icEventOld/detail"; |
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/icEvent/detail"; |
|
|
|
|
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, { |
|
|
const { data, code, msg } = await requestPost(url, { |
|
|
icEventId: this.eventId, |
|
|
icEventId: this.eventId, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
this.eventDetailData = { ...data }; |
|
|
this.eventDetailData = { ...data }; |
|
|
this.pageType = "dispose"; |
|
|
this.pageType = "dispose"; |
|
@ -580,7 +561,6 @@ export default { |
|
|
|
|
|
|
|
|
async handleDel(rowData) { |
|
|
async handleDel(rowData) { |
|
|
let message = "确认删除?"; |
|
|
let message = "确认删除?"; |
|
|
|
|
|
|
|
|
this.$confirm(message, "提示", { |
|
|
this.$confirm(message, "提示", { |
|
|
confirmButtonText: "确定", |
|
|
confirmButtonText: "确定", |
|
|
cancelButtonText: "取消", |
|
|
cancelButtonText: "取消", |
|
@ -594,9 +574,7 @@ export default { |
|
|
async delEvent(eventId) { |
|
|
async delEvent(eventId) { |
|
|
const url = "/governance/icEventOld/delete"; |
|
|
const url = "/governance/icEventOld/delete"; |
|
|
let idsArr = [eventId]; |
|
|
let idsArr = [eventId]; |
|
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, idsArr); |
|
|
const { data, code, msg } = await requestPost(url, idsArr); |
|
|
|
|
|
|
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
this.$message.success("删除成功!"); |
|
|
this.$message.success("删除成功!"); |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
@ -607,7 +585,9 @@ export default { |
|
|
|
|
|
|
|
|
async getTableData() { |
|
|
async getTableData() { |
|
|
const url = "/governance/icEventOld/list"; |
|
|
const url = "/governance/icEventOld/list"; |
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/project/icEvent/list"; |
|
|
if (this.eventTypeCheck) { |
|
|
|
|
|
this.formData.secondIdList = this.eventTypeCheck |
|
|
|
|
|
} |
|
|
const { pageSize, pageNo, formData } = this; |
|
|
const { pageSize, pageNo, formData } = this; |
|
|
const { data, code, msg } = await requestPost(url, { |
|
|
const { data, code, msg } = await requestPost(url, { |
|
|
pageSize, |
|
|
pageSize, |
|
@ -639,23 +619,41 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
async getCateOptions() { |
|
|
async getCateOptions() { |
|
|
const url = "/governance/issueprojectcategorydict/list"; |
|
|
const url = '/governance/icEvent/getCategoryTree'; |
|
|
|
|
|
let params = {}; |
|
|
const { data, code, msg } = await requestPost(url, {}); |
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
|
if (code === 0) { |
|
|
if (code === 0) { |
|
|
// this.cateOptions = data.map((item) => { |
|
|
let treeDataNew = this.deepTree(data, "children"); |
|
|
// item.subCategory.forEach((subitem) => { |
|
|
//组织级联数据 |
|
|
// delete subitem.subCategory; |
|
|
++this.iscascaderShow; |
|
|
// }); |
|
|
this.cateOptions = []; |
|
|
// return item; |
|
|
this.cateOptions = treeDataNew; |
|
|
// }); |
|
|
|
|
|
this.cateOptions = this.deepTree(data, "subCategory"); |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(msg); |
|
|
this.$message.error(msg); |
|
|
} |
|
|
} |
|
|
|
|
|
if (this.eventDetailCopy.parentCategoryId) { |
|
|
|
|
|
const pids = this.eventDetailCopy.parentCategoryId.split(','); |
|
|
|
|
|
pids.push(this.eventDetailCopy.categoryId); |
|
|
|
|
|
let nodes = this.cateOptions; |
|
|
|
|
|
for (let i = 0; i < pids.length; i++) { |
|
|
|
|
|
nodes = this.buildNode(nodes, pids[i]) |
|
|
|
|
|
} |
|
|
|
|
|
if (nodes) { |
|
|
|
|
|
this.formData.categoryList.push(nodes) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
buildNode(nodes, treeId) { |
|
|
|
|
|
for (let i = 0; i < nodes.length; i++) { |
|
|
|
|
|
if (nodes[i].id === treeId) { |
|
|
|
|
|
if (nodes[i].children) { |
|
|
|
|
|
return nodes[i].children |
|
|
|
|
|
} else { |
|
|
|
|
|
return nodes[i] |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleSizeChange(val) { |
|
|
handleSizeChange(val) { |
|
|
this.pageSize = val; |
|
|
this.pageSize = val; |
|
|
window.localStorage.setItem("pageSize", val); |
|
|
window.localStorage.setItem("pageSize", val); |
|
@ -665,7 +663,6 @@ export default { |
|
|
this.pageNo = val; |
|
|
this.pageNo = val; |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
resetSearch() { |
|
|
resetSearch() { |
|
|
this.formData = { |
|
|
this.formData = { |
|
|
gridId: "", |
|
|
gridId: "", |
|
@ -685,16 +682,16 @@ export default { |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
// this.loadTable() |
|
|
// this.loadTable() |
|
|
}, |
|
|
}, |
|
|
deepTree(arr, child) { |
|
|
//重构树,去除网格 |
|
|
|
|
|
deepTree(arr, children) { |
|
|
if (Array.isArray(arr) && arr.length > 0) { |
|
|
if (Array.isArray(arr) && arr.length > 0) { |
|
|
return arr.map((item) => { |
|
|
return arr.map((item) => { |
|
|
// if (child === 'subAgencyList') item.value = item.orgType + '-' + item.orgId |
|
|
|
|
|
return { |
|
|
return { |
|
|
...item, |
|
|
...item, |
|
|
[child]: |
|
|
[children]: |
|
|
(item[child] && |
|
|
(item[children] && |
|
|
item[child].length > 0 && |
|
|
item[children].length > 0 && |
|
|
this.deepTree(item[child], child)) || |
|
|
this.deepTree(item[children], children)) || |
|
|
null, |
|
|
null, |
|
|
}; |
|
|
}; |
|
|
}); |
|
|
}); |
|
|