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
: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>
</div>
</div>
@ -88,34 +108,22 @@ const columns: ColumnProps[] = [
{
prop: "pm25",
label: "PM2.5",
width: 150,
render: scoped => {
return scoped.row.pm25 + "μg/m³";
}
width: 150
},
{
prop: "noise",
label: "噪音",
width: 150,
render: scoped => {
return scoped.row.noise + "db";
}
width: 150
},
{
prop: "pm10",
label: "PM10",
width: 150,
render: scoped => {
return scoped.row.pm10 + "μg/m³";
}
width: 150
},
{
prop: "tsp",
label: "TSP",
width: 150,
render: scoped => {
return scoped.row.tsp + "μg/m³";
}
width: 150
},
{
prop: "humidity",

View File

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

View File

@ -4,6 +4,7 @@
v-model="active"
:tabs="['项目名称', '工程名称']"
:records="records"
:activeIndex="modelActive"
@change-page="onCurChange"
@search="onSearchInput"
:pageable="pages"
@ -68,6 +69,10 @@ import { getRelevanceList } from "@/api/modules/common";
import DialogForm from "@/components/DialogForm/index.vue";
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";
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({
pageNo: 1,
pageSize: 7,
@ -362,7 +367,18 @@ onMounted(async () => {
await getEngPage();
searchSn.value = records.value[0].engineeringSn;
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>
<style scoped lang="scss">