diff --git a/src/views/modules/shequzhili/event/eventList.vue b/src/views/modules/shequzhili/event/eventList.vue index 1790d751b..1632a2d5c 100644 --- a/src/views/modules/shequzhili/event/eventList.vue +++ b/src/views/modules/shequzhili/event/eventList.vue @@ -46,7 +46,26 @@ placeholder="请输入"> - + + + + - + + item.level === 1) + let level2 = nodes.filter(item => item.level === 2) + console.log('level2----1', level2) + level1.forEach(item => { + console.log('level2----2', level2) + if (item.hasChildren) { + for (let i = level2.length - 1; i >= 0; i--) { + if (level2[i].parent.value === item.value) level2.splice(i, 1) + } + } + }) + this.formData.firstIdList = level1.map(item => item.value) + this.formData.secondIdList = level2.map(item => item.value) + }, handleSelectionChange (val) { this.multipleSelection = []; val.forEach(element => { @@ -692,6 +746,23 @@ export default { this.$message.error(msg); } }, + async getCateOptions() { + const url = "/gov/issue/issueprojectcategorydict/list"; + + const { data, code, msg } = await requestPost(url, {}); + + if (code === 0) { + // this.cateOptions = data.map((item) => { + // item.subCategory.forEach((subitem) => { + // delete subitem.subCategory; + // }); + // return item; + // }); + this.cateOptions = this.deepTree(data, 'subCategory') + } else { + this.$message.error(msg); + } + }, handleSizeChange (val) { @@ -715,12 +786,27 @@ export default { startTime: '', endTime: '', status: '', + firstIdList: [], + secondIdList: [], } + this.eventTypeCheck = [] + - - // this.pageNo = 1 + this.pageNo = 1 + this.getTableData(); // this.loadTable() }, + deepTree(arr, child) { + if (Array.isArray(arr) && arr.length > 0) { + return arr.map(item => { + // if (child === 'subAgencyList') item.value = item.orgType + '-' + item.orgId + return { + ...item, + [child]: item[child] && item[child].length > 0 && this.deepTree(item[child], child) || null + } + }) + } + } }, }; @@ -729,4 +815,10 @@ export default { @import "@/assets/scss/buttonstyle.scss"; @import "@/assets/scss/modules/management/list-main.scss"; @import "@/assets/scss/modules/shequzhili/event-info.scss"; +.div_search { + .item_width_2 { + width: 200px; + } +} +