fix: BUG修改

This commit is contained in:
kun 2023-06-21 11:44:30 +08:00
parent 2e7dd244fc
commit 28f198f199
2 changed files with 40 additions and 7 deletions

View File

@ -241,11 +241,11 @@ export const getAIengAlarmPage = (params: User.ReqUserParams) => {
};
// 扬尘管理!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// 分页列表查询扬尘工程信息
// 分页列表查询扬尘项目信息
export const getDustprojectPage = (params: User.ReqUserParams) => {
return http.post<ResPage<User.ResUserList>>(BASEURL + `/gov/environmentDev/projectPage`, params);
};
// 分页列表查询AI预警工程信息
// 分页列表查询扬尘工程信息
export const getDustengineeringPage = (params: User.ReqUserParams) => {
return http.post<ResPage<User.ResUserList>>(BASEURL + `/gov/environmentDev/engineeringPage`, params);
};

View File

@ -2,7 +2,7 @@
<div class="warning-page">
<LeftMenu
v-model="active"
:tabs="[]"
:tabs="['项目名称', '工程名称']"
:records="records"
@change-page="onCurChange"
@search="onSearchInput"
@ -147,9 +147,7 @@ import { useHandleData } from "@/hooks/useHandleData";
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";
import type { ResAiProjectPage, ResAiEngineerPage } from "@/api/types/government/AIwaring";
import changeTheme from "@/components/changeTheme/index.vue";
function parse(val) {
return val.trim() ? JSON.parse(val) : {};
}
import { getDustprojectPage, getDustengineeringPage } from "@/api/modules/goverment";
const pages = ref({
pageNo: 1,
pageSize: 7,
@ -368,12 +366,47 @@ const onDatePicker = () => {
form.value.startTime = form.value.createTime[0];
form.value.endTime = form.value.createTime[1];
};
//
const getAIproPage = async () => {
const { result } = await getDustprojectPage(pages.value);
records.value = result.records;
records.value.map(item => {
let showGif = false;
item.showGif = showGif;
});
pages.value.total = Number(result.total);
};
//
const getAIengPage = async () => {
const { result } = await getengineeringPage(pages.value);
const { result } = await getDustengineeringPage(pages.value);
records.value = result.records;
records.value.map(item => {
let showGif = false;
item.showGif = showGif;
});
pages.value.total = +result.total;
};
watch(
() => active.value,
async (value: number) => {
pages.value.pageNo = 1;
pages.value.total = 0;
// console.log(value);
if (value === 0) {
await getAIproPage();
await getproList();
onSearch(records.value[0]);
} else {
await getAIengPage();
await getengList();
onSearch(records.value[0]);
}
},
{
deep: true
}
);
onMounted(async () => {
getVideoData();
await getAIengPage();