|
|
|
@ -32,7 +32,7 @@
|
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="任务类型" prop="taskTopType"> |
|
|
|
|
<el-select v-model="formData.taskTopType" placeholder="请选择任务优先级" size="large" @change="selectChild"> |
|
|
|
|
<el-select v-model="formData.taskTopType" placeholder="请选择任务类型" size="large" @change="selectChild"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="dict in taskTagTopList" |
|
|
|
|
:key="dict.id" |
|
|
|
@ -52,7 +52,7 @@
|
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> --> |
|
|
|
|
<el-form-item label="类型选项" prop="taskType"> |
|
|
|
|
<el-select v-model="formData.taskType" placeholder="请选择任务选项" > |
|
|
|
|
<el-select v-model="formData.taskType" placeholder="请选择任务选项" :disabled="isReadonly" > |
|
|
|
|
<el-option |
|
|
|
|
v-for="dict in tagChildList" |
|
|
|
|
:key="dict.id" |
|
|
|
@ -116,12 +116,13 @@
|
|
|
|
|
<el-select |
|
|
|
|
v-model="enterprise.queryParams.st" |
|
|
|
|
placeholder="请选择生态" size="large" |
|
|
|
|
clearable |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="dict in stList" |
|
|
|
|
:key="dict.id" |
|
|
|
|
:label="dict.tagName" |
|
|
|
|
:value="dict.id" |
|
|
|
|
:value="dict.tagName" |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
<div class="btn"> |
|
|
|
@ -139,12 +140,13 @@
|
|
|
|
|
v-model="enterprise.queryParams.wr" |
|
|
|
|
placeholder="请选择污染程度" |
|
|
|
|
size="large" |
|
|
|
|
clearable |
|
|
|
|
> |
|
|
|
|
<el-option |
|
|
|
|
v-for="dict in wrList" |
|
|
|
|
:key="dict.id" |
|
|
|
|
:label="dict.tagName" |
|
|
|
|
:value="dict.id" |
|
|
|
|
:value="dict.tagName" |
|
|
|
|
/> |
|
|
|
|
</el-select> |
|
|
|
|
<div class="btn2"> |
|
|
|
@ -165,6 +167,7 @@
|
|
|
|
|
borderBottom: '1px solid #EBEEF5', |
|
|
|
|
backgroundColor: '#F5F7FA' |
|
|
|
|
}" |
|
|
|
|
size="large" |
|
|
|
|
> |
|
|
|
|
<template #empty> |
|
|
|
|
<el-empty description="暂无数据" /> |
|
|
|
@ -307,6 +310,7 @@ const formData = ref({
|
|
|
|
|
tags: [], |
|
|
|
|
enterprises: [] as any |
|
|
|
|
}) |
|
|
|
|
const isReadonly = ref(true) |
|
|
|
|
const router = useRouter() |
|
|
|
|
const route = useRoute() |
|
|
|
|
const tagView = useTagsViewStore() |
|
|
|
@ -334,7 +338,7 @@ const { query } = useRoute()
|
|
|
|
|
const formRef = ref() // 表单 Ref` |
|
|
|
|
const tagList = ref([]) |
|
|
|
|
const queryFormRef = ref() // 搜索的表单 |
|
|
|
|
const enterprise = ref({ |
|
|
|
|
const enterprise:any = ref({ |
|
|
|
|
list: [] as any, |
|
|
|
|
queryParams: reactive({ |
|
|
|
|
pageNo: 1, |
|
|
|
@ -393,9 +397,9 @@ const deleteHandle = (id: number) => {
|
|
|
|
|
if (targetIndex === -1) return; |
|
|
|
|
|
|
|
|
|
// 删除元素(触发响应式更新) |
|
|
|
|
enterprise.value.list.splice(targetIndex, 1); |
|
|
|
|
enterprise.value.list.splice(targetIndex, 1) |
|
|
|
|
|
|
|
|
|
enterprise_copy.value = cloneDeep(enterprise.value); |
|
|
|
|
enterprise_copy.value = cloneDeep(enterprise.value) |
|
|
|
|
|
|
|
|
|
enterprise.value.total = enterprise.value.list.length |
|
|
|
|
|
|
|
|
@ -404,7 +408,7 @@ const deleteHandle = (id: number) => {
|
|
|
|
|
const itemsOnCurrentPage = enterprise.value.list.slice( |
|
|
|
|
(pageNo - 1) * pageSize, |
|
|
|
|
pageNo * pageSize |
|
|
|
|
); |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
if (itemsOnCurrentPage.length === 0 && pageNo > 1) { |
|
|
|
|
enterprise.value.queryParams.pageNo = pageNo - 1; |
|
|
|
@ -456,36 +460,32 @@ const handleQuery = () => {
|
|
|
|
|
|
|
|
|
|
// 动态过滤函数 |
|
|
|
|
const filterList = (list: EnterprisesVO[]) => { |
|
|
|
|
console.log('isAllConditionsEmpty.value', isAllConditionsEmpty.value) |
|
|
|
|
if (isAllConditionsEmpty.value) return enterprise_copy.value.list; // 直接返回完整列表 |
|
|
|
|
|
|
|
|
|
if (list.length > 0) { |
|
|
|
|
const { enterprisesName, qy, hy, st, wr , userId } = enterprise.value.queryParams; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return list.filter(item => { |
|
|
|
|
// 名称匹配(模糊查询) |
|
|
|
|
const nameMatch = enterprisesName ? |
|
|
|
|
item.enterprisesName?.toLowerCase().includes(enterprisesName.toLowerCase()) : true; |
|
|
|
|
// 类型精确匹配 |
|
|
|
|
const typeMatch = qy ? item.region == qy : true; |
|
|
|
|
//地区精确匹配 |
|
|
|
|
const hyMatch = hy ? item.tagList.includes(hy) : true |
|
|
|
|
|
|
|
|
|
const stMatch = st ? item.tagList.includes(st) : true |
|
|
|
|
|
|
|
|
|
const wrMatch = wr ? item.tagList.includes(wr) : true |
|
|
|
|
|
|
|
|
|
const userIdMatch = userId ? item.userId == userId : true |
|
|
|
|
|
|
|
|
|
return list.filter(item => { |
|
|
|
|
if (item.tagList) { |
|
|
|
|
// 名称匹配(模糊查询) |
|
|
|
|
const nameMatch = enterprisesName ? |
|
|
|
|
item.enterprisesName?.toLowerCase().includes(enterprisesName.toLowerCase()) : true; |
|
|
|
|
// 类型精确匹配 |
|
|
|
|
const typeMatch = qy ? item.region == qy : true; |
|
|
|
|
//地区精确匹配 |
|
|
|
|
const hyMatch = hy ? item.tagList.includes(hy) : true |
|
|
|
|
|
|
|
|
|
// 注册号精确匹配 |
|
|
|
|
// const regNumMatch = registrationNumber ? |
|
|
|
|
// item.registrationNumber === registrationNumber : true; |
|
|
|
|
// // ID精确匹配 |
|
|
|
|
// const idMatch = id !== undefined ? item.id === id : true; |
|
|
|
|
const stMatch = st ? item.tagList.includes(st) : true |
|
|
|
|
|
|
|
|
|
return nameMatch && typeMatch && hyMatch && stMatch && wrMatch && userIdMatch; |
|
|
|
|
const wrMatch = wr ? item.tagList.includes(wr) : true |
|
|
|
|
|
|
|
|
|
const userIdMatch = userId ? item.userId == userId : true |
|
|
|
|
|
|
|
|
|
return nameMatch && typeMatch && hyMatch && stMatch && wrMatch && userIdMatch; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -496,7 +496,22 @@ const insertEnterprise = () => {
|
|
|
|
|
} |
|
|
|
|
/** 重置按钮操作 */ |
|
|
|
|
const resetQuery = () => { |
|
|
|
|
queryFormRef.value.resetFields() |
|
|
|
|
// queryFormRef.value.resetFields() |
|
|
|
|
|
|
|
|
|
enterprise.value.queryParams = { |
|
|
|
|
pageNo: 1, |
|
|
|
|
pageSize: 10, |
|
|
|
|
enterprisesName: undefined, |
|
|
|
|
qy: undefined, |
|
|
|
|
hy: undefined, |
|
|
|
|
st: undefined, |
|
|
|
|
wr: undefined, |
|
|
|
|
userId: undefined |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
enterprise.value = cloneDeep(enterprise_copy.value); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleQuery() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -617,16 +632,26 @@ async function init() {
|
|
|
|
|
formData.value.tags = res.taskTagIdes.map((t) => t.tagId) |
|
|
|
|
enterprise.value.list = res.enterpriseIdes |
|
|
|
|
enterprise.value.total = res.enterpriseIdes.length |
|
|
|
|
|
|
|
|
|
//深拷贝一份 |
|
|
|
|
enterprise_copy.value = cloneDeep(enterprise.value); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const selectChild = (value: any) => { |
|
|
|
|
const data = taskTagTopList.value.find(item=>item.id == value) |
|
|
|
|
isReadonly.value = false |
|
|
|
|
tagChildList.value = data.children |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getList(data) { |
|
|
|
|
enterprise.value.list.push(...data) |
|
|
|
|
|
|
|
|
|
const diff = data.filter(item => !enterprise.value.list.includes(item)); |
|
|
|
|
|
|
|
|
|
// 2. 插入到旧数组前面(合并) |
|
|
|
|
enterprise.value.list = [...diff, ...enterprise.value.list]; |
|
|
|
|
|
|
|
|
|
//去重 |
|
|
|
|
enterprise.value.list = uniqueFunc(enterprise.value.list, 'id') |
|
|
|
|
enterprise.value.total = enterprise.value.list.length |
|
|
|
|