From 24e8d9a83681cefdc5988b0ee0097e2c6b079402 Mon Sep 17 00:00:00 2001
From: cjl <909710561@qq.com>
Date: Tue, 19 May 2026 16:47:40 +0800
Subject: [PATCH] 路由
---
src/views/toCarryOutLegislativeReforms/delay/componets/queryForm.vue | 114 ++++++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 88 insertions(+), 26 deletions(-)
diff --git a/src/views/toCarryOutLegislativeReforms/delay/componets/queryForm.vue b/src/views/toCarryOutLegislativeReforms/delay/componets/queryForm.vue
index 7f99c37..1a88c49 100644
--- a/src/views/toCarryOutLegislativeReforms/delay/componets/queryForm.vue
+++ b/src/views/toCarryOutLegislativeReforms/delay/componets/queryForm.vue
@@ -1,9 +1,18 @@
<template>
<div>
<div class="search-form">
- <el-form :inline="true" :model="formData" class="demo-form-inline">
+ <el-form
+ :inline="true"
+ :model="formData"
+ class="demo-form-inline"
+ >
<el-form-item label="���������������">
- <el-input v-model="formData.allocationNum" placeholder="���������������" size="small" clearable />
+ <el-input
+ v-model="formData.allocationNum"
+ placeholder="���������������"
+ size="small"
+ clearable
+ />
</el-form-item>
<el-form-item label="���������������">
@@ -15,7 +24,6 @@
type="date"
placeholder="������������"
/>
-
</el-form-item>
<el-form-item label="���������������">
<el-date-picker
@@ -28,18 +36,25 @@
/>
</el-form-item>
- <el-form-item label="���������������">
- <el-select v-model="formData.unitId" size="small" clearable placeholder="���������">
- <el-option
- v-for="item in unitList"
- :key="item.unitId"
- :label="item.unitName"
- :value="item.unitId"
- />
- </el-select>
+ <el-form-item
+ label="���������������"
+ >
+ <el-cascader
+ size="small"
+ collapse-tags
+ :show-all-levels="false"
+ :options="unitList"
+ :props="{ multiple: true, value:'unitId',label:'unitName',children:'children'}"
+ @change="changeUid"
+ />
</el-form-item>
<el-form-item label="���������������">
- <el-select v-model="formData.polluteType" size="small" clearable placeholder="���������">
+ <el-select
+ v-model="formData.polluteType"
+ size="small"
+ clearable
+ placeholder="���������"
+ >
<el-option
v-for="item in polluteList"
:key="item.dataKey"
@@ -49,7 +64,12 @@
</el-select>
</el-form-item>
<el-form-item label="���������������">
- <el-select v-model="formData.changeType" placeholder="���������" clearable size="small">
+ <el-select
+ v-model="formData.changeType"
+ placeholder="���������"
+ clearable
+ size="small"
+ >
<el-option
v-for="item in Dic.changeEnum"
:key="item.value"
@@ -59,7 +79,12 @@
</el-select>
</el-form-item>
<el-form-item label="���������������">
- <el-select v-model="formData.state" placeholder="���������" clearable size="small">
+ <el-select
+ v-model="formData.state"
+ placeholder="���������"
+ clearable
+ size="small"
+ >
<el-option
v-for="item in Dic.allocationExtensionApproveEnum"
:key="item.value"
@@ -69,8 +94,21 @@
</el-select>
</el-form-item>
<el-form-item>
- <el-button type="primary" size="small" @click="onSubmit">������</el-button>
- <el-button v-if="searchType==='reform'" type="primary" size="small" @click="handleAdd">������</el-button>
+ <el-button
+ type="primary"
+ size="small"
+ @click="onSubmit"
+ >
+ ������
+ </el-button>
+ <el-button
+ v-if="searchType==='reform'"
+ type="primary"
+ size="small"
+ @click="handleAdd"
+ >
+ ������
+ </el-button>
</el-form-item>
</el-form>
</div>
@@ -82,7 +120,7 @@
props: {
searchType: { type: String, default: '' }
},
- data() {
+ data () {
return {
formData: {},
unitList: [],
@@ -93,22 +131,46 @@
}
},
- created() {
+ created () {
this.getUnitList()
this.getContaminateList()
console.log('searchType', this.searchType)
},
methods: {
// ������������������list
- getUnitList() {
+ changeUid (val) {
+ this.formData.unitId = this.uniqueArrayReduce(val)
+ },
+ uniqueArrayReduce (arrays) {
+ return arrays.reduce((acc, curr) => {
+ return acc.concat(curr.filter(item => !acc.includes(item)))
+ }, [])
+ },
+ removeEmptyArrays (obj) {
+ if (Array.isArray(obj)) {
+ return obj
+ .map(item => this.removeEmptyArrays(item)) // ������������������������
+ .filter(item => !Array.isArray(item) || item.length > 0) // ���������������
+ } else if (typeof obj === 'object' && obj !== null) {
+ Object.keys(obj).forEach(key => {
+ obj[key] = this.removeEmptyArrays(obj[key]) // ������������������������
+ if (Array.isArray(obj[key]) && obj[key].length === 0) {
+ delete obj[key] // ���������������������
+ }
+ })
+ }
+ return obj
+ },
+ // ������������������list
+ getUnitList () {
this.$request({
- url: '/allocation/unit',
+ url: '/allocation/unitQuery',
method: 'get'
- }).then((res) => {
- this.unitList = res.data
+ }).then(res => {
+ this.unitList = this.removeEmptyArrays(res.data)
})
},
- getContaminateList() {
+ getContaminateList () {
this.$request({
url: '/allocation/contaminate',
method: 'get'
@@ -116,10 +178,10 @@
this.polluteList = res.data
})
},
- onSubmit() {
+ onSubmit () {
this.$emit('handleSearch', this.formData)
},
- handleAdd() {
+ handleAdd () {
this.$emit('handleAdd', '12122')
}
}
--
Gitblit v1.8.0