fix: BUG修改

This commit is contained in:
kun 2024-03-29 18:26:36 +08:00
parent 4af05c71c3
commit c0b83ed8c5
3 changed files with 44 additions and 17 deletions

View File

@ -36,6 +36,26 @@
background background
:isShowSearch="false" :isShowSearch="false"
> >
<template #pm25="scope">
<span :style="{ color: scope.row.pm25Alarm ? '#F80840' : 'var(--el-menu-text-color)' }">{{
scope.row.pm25 + "μg/m³"
}}</span>
</template>
<template #noise="scope">
<span :style="{ color: scope.row.noiseAlarm ? '#F80840' : 'var(--el-menu-text-color)' }">{{
scope.row.noise + "db"
}}</span>
</template>
<template #pm10="scope">
<span :style="{ color: scope.row.pm10Alarm ? '#F80840' : 'var(--el-menu-text-color)' }">{{
scope.row.pm10 + "μg/m³"
}}</span>
</template>
<template #tsp="scope">
<span :style="{ color: scope.row.tspAlarm ? '#F80840' : 'var(--el-menu-text-color)' }">{{
scope.row.tsp + "μg/m³"
}}</span>
</template>
</ProTable> </ProTable>
</div> </div>
</div> </div>
@ -88,34 +108,22 @@ const columns: ColumnProps[] = [
{ {
prop: "pm25", prop: "pm25",
label: "PM2.5", label: "PM2.5",
width: 150, width: 150
render: scoped => {
return scoped.row.pm25 + "μg/m³";
}
}, },
{ {
prop: "noise", prop: "noise",
label: "噪音", label: "噪音",
width: 150, width: 150
render: scoped => {
return scoped.row.noise + "db";
}
}, },
{ {
prop: "pm10", prop: "pm10",
label: "PM10", label: "PM10",
width: 150, width: 150
render: scoped => {
return scoped.row.pm10 + "μg/m³";
}
}, },
{ {
prop: "tsp", prop: "tsp",
label: "TSP", label: "TSP",
width: 150, width: 150
render: scoped => {
return scoped.row.tsp + "μg/m³";
}
}, },
{ {
prop: "humidity", prop: "humidity",

View File

@ -58,6 +58,9 @@ const handleDealItem = (obj: any) => {
case 3: // case 3: //
routeUrl = "/goverment/huizhou/progressManagement/divisionsAndISubItems/index"; routeUrl = "/goverment/huizhou/progressManagement/divisionsAndISubItems/index";
break; break;
case 4: //
routeUrl = "/hz-enterprise/smartSite/alarmLedger/index";
break;
} }
router.push({ path: routeUrl, query: { projectName } }); router.push({ path: routeUrl, query: { projectName } });
}; };

View File

@ -4,6 +4,7 @@
v-model="active" v-model="active"
:tabs="['项目名称', '工程名称']" :tabs="['项目名称', '工程名称']"
:records="records" :records="records"
:activeIndex="modelActive"
@change-page="onCurChange" @change-page="onCurChange"
@search="onSearchInput" @search="onSearchInput"
:pageable="pages" :pageable="pages"
@ -68,6 +69,10 @@ import { getRelevanceList } from "@/api/modules/common";
import DialogForm from "@/components/DialogForm/index.vue"; import DialogForm from "@/components/DialogForm/index.vue";
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue"; import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";
import { getDustprojectPage, getDustengineeringPage, getAIQuestionPage } from "@/api/modules/goverment"; import { getDustprojectPage, getDustengineeringPage, getAIQuestionPage } from "@/api/modules/goverment";
import { useRoute } from "vue-router";
import { sendIframeMessage } from "@/utils/util";
const route = useRoute();
const modelActive = ref(0);
const pages = ref({ const pages = ref({
pageNo: 1, pageNo: 1,
pageSize: 7, pageSize: 7,
@ -362,7 +367,18 @@ onMounted(async () => {
await getEngPage(); await getEngPage();
searchSn.value = records.value[0].engineeringSn; searchSn.value = records.value[0].engineeringSn;
searchName.value = records.value[0].engineeringName; searchName.value = records.value[0].engineeringName;
onSearch(records.value[0]); if (route.query.projectName) {
let defaultActive = records.value.findIndex((item: any) => {
return route.query.projectName == item.engineeringName;
});
if (defaultActive != -1) {
modelActive.value = defaultActive;
onSearch(records.value[defaultActive]);
}
} else {
onSearch(records.value[0]);
}
await sendIframeMessage({ obj: { path: route.path } }, 2, undefined);
}); });
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">