fix: BUG修改
This commit is contained in:
parent
5556a373c4
commit
a9cc52bac8
@ -1,13 +1,13 @@
|
||||
<!-- 经典布局 -->
|
||||
<template>
|
||||
<el-container class="layout">
|
||||
<el-container class="classic-main">
|
||||
<!-- <el-container class="classic-main">
|
||||
<Main />
|
||||
</el-container>
|
||||
<!-- <el-header>
|
||||
</el-container> -->
|
||||
<el-header>
|
||||
<div class="header-lf">
|
||||
<div @click="goHome" class="logo flx-center">
|
||||
<img src="@/assets/images/login/china.png" style="margin: 0 15px" alt="logo" />
|
||||
<!-- <img src="@/assets/images/login/china.png" style="margin: 0 15px" alt="logo" /> -->
|
||||
<span>数字化政务监管平台</span>
|
||||
<span v-if="moduleTitle" style="margin: 0 20px">|</span>
|
||||
<span class="title">{{ moduleTitle }}</span>
|
||||
@ -15,10 +15,10 @@
|
||||
<ToolBarLeft />
|
||||
</div>
|
||||
<ToolBarRight />
|
||||
</el-header> -->
|
||||
<!-- <el-container class="classic-content">
|
||||
</el-header>
|
||||
<el-container class="classic-content">
|
||||
<el-aside>
|
||||
<div class="menu" :style="{ width: isCollapse ? '65px' : '210px' }"> 根据屏幕自动收缩
|
||||
<!-- <div class="menu" :style="{ width: isCollapse ? '65px' : '210px' }"> 根据屏幕自动收缩 -->
|
||||
<div class="menu">
|
||||
<el-scrollbar>
|
||||
<el-menu
|
||||
@ -39,7 +39,7 @@
|
||||
<el-container class="classic-main">
|
||||
<Main />
|
||||
</el-container>
|
||||
</el-container> -->
|
||||
</el-container>
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<template v-for="(val, key) in formData" :key="datas[key]">
|
||||
<el-form-item v-if="Object.keys(datas).includes(key)" class="form-item" :prop="key" :label="datas[key]">
|
||||
<el-select class="select" v-if="key === 'enterpriseSn'" @change="onChange" v-model="formData[key]">
|
||||
<el-option value="" @click="openAddDialog" v-show="formData.type == 1">
|
||||
<el-option value="" @click="openAddDialog" v-show="formData.type != 1">
|
||||
<div class="selectAdd">
|
||||
<el-icon><circle-plus /></el-icon>
|
||||
<span>新建</span>
|
||||
@ -91,7 +91,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, watch, onMounted } from "vue";
|
||||
import { ref, computed, watch, onMounted, reactive } from "vue";
|
||||
import { Search } from "@element-plus/icons-vue";
|
||||
import { queryMainType } from "@/api/modules/project";
|
||||
import { getDicList } from "@/api/modules/jxjview";
|
||||
@ -106,7 +106,7 @@ export interface formConfig {
|
||||
datas: EngineeringMainList[number];
|
||||
}
|
||||
const openAddCompany = ref(false);
|
||||
const companyType = ref({ dictLabel: 1 });
|
||||
const companyType = ref({});
|
||||
const props = defineProps<{
|
||||
formConfig: formConfig;
|
||||
}>();
|
||||
@ -127,6 +127,9 @@ const allConfirm = () => {
|
||||
getMainData();
|
||||
};
|
||||
const openAddDialog = () => {
|
||||
companyType.value = reactive({
|
||||
dictLabel: formData.value.type
|
||||
});
|
||||
openAddCompany.value = true;
|
||||
};
|
||||
const onChange = option => {
|
||||
|
||||
@ -0,0 +1,96 @@
|
||||
.warning-page {
|
||||
// background-color: blue;
|
||||
display: flex;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.leftMenu {
|
||||
// width: 290px;
|
||||
// 页面的项目工程
|
||||
:deep(.item) {
|
||||
height: 78px !important;
|
||||
}
|
||||
:deep(.content) {
|
||||
height: calc(100% - 160px) !important;
|
||||
}
|
||||
.leftProject {
|
||||
// padding: 5px 8px;
|
||||
color: #333333;
|
||||
.projectName {
|
||||
display: block;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
color: var(--el-menu-text-color);
|
||||
// font-weight: 700;
|
||||
font-family: "siyuan_Medium";
|
||||
font-size: 20px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.leftMenu_item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 10px;
|
||||
overflow: hidden;
|
||||
.video {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
img {
|
||||
margin: 0 4px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
}
|
||||
.middleSize {
|
||||
color: var(--el-menu-text-color);
|
||||
font-size: 20px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
.bottom_item {
|
||||
.bottomSize {
|
||||
font-size: 20px;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.table-box {
|
||||
width: calc(100% - 300px);
|
||||
height: 100% !important;
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
:deep(.el-scrollbar__view) {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
// display: flex;
|
||||
// flex-wrap: wrap;
|
||||
}
|
||||
:deep() {
|
||||
.el-form-item__content > :not(button) {
|
||||
width: 160px;
|
||||
}
|
||||
.el-input__wrapper {
|
||||
color: white;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
box-shadow: 0 0 0 1px #087ba4 inset;
|
||||
}
|
||||
.el-input__inner {
|
||||
color: var(--el-menu-text-color);
|
||||
font-size: 20px;
|
||||
}
|
||||
.el-textarea__inner {
|
||||
color: white;
|
||||
font-size: 20px;
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
box-shadow: 0 0 0 1px var(--el-color-primary, var(--el-color-primary)) inset;
|
||||
}
|
||||
}
|
||||
// :deep(.el-dialog__body) {
|
||||
// padding: 0 0 0 0 !important;
|
||||
// background-color: pink;
|
||||
// }
|
||||
@ -0,0 +1,290 @@
|
||||
<template>
|
||||
<div class="warning-page">
|
||||
<LeftMenu
|
||||
v-model="active"
|
||||
:tabs="['项目名称', '工程名称']"
|
||||
:records="records"
|
||||
@change-page="onCurChange"
|
||||
@search="onSearchInput"
|
||||
:pageable="pages"
|
||||
class="leftMenu"
|
||||
>
|
||||
<template #default="{ data }">
|
||||
<div class="leftProject" @click="onSearch(data)">
|
||||
<span class="projectName">{{
|
||||
(data as ResAiProjectPage).projectName || (data as ResAiEngineerPage).engineeringName
|
||||
}}</span>
|
||||
<div class="leftMenu_item flx-justify-between">
|
||||
<div style="margin-top: 5px" class="flx-justify-between">
|
||||
<img style="margin-right: 5px" src="@/assets/images/AIwaring/dustMap.png" alt="" />
|
||||
<span class="middleSize">{{ data.projectAddress || data.address }}</span>
|
||||
</div>
|
||||
<!-- <div>
|
||||
<img src="@/assets/images/AIwaring/报警.png" alt="" />
|
||||
<span class="middleSize">今日报警次数:{{ data.todayAlarm }}</span>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</LeftMenu>
|
||||
<div class="table-box"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, onMounted, watch } from "vue";
|
||||
import {
|
||||
getDustprojectPage,
|
||||
getDustengineeringPage,
|
||||
getAIQuestionPage,
|
||||
addAIrecords,
|
||||
getAiMonitorDev
|
||||
} from "@/api/modules/goverment";
|
||||
import { videoList, videoDataAdd, videoDataEdit, videoDataDelete } from "@/api/modules/enterpriseApi";
|
||||
import Pagination from "@/components/ProTable/components/Pagination.vue";
|
||||
import { ElMessage, UploadProps } from "element-plus";
|
||||
import type { FormRules, FormInstance, UploadInstance } from "element-plus";
|
||||
import { GlobalStore } from "@/stores";
|
||||
import { Delete } from "@element-plus/icons-vue";
|
||||
import { jxj_User } from "@/api/types";
|
||||
import { useHandleData } from "@/hooks/useHandleData";
|
||||
import LeftMenu from "@/components/LeftMenu/LeftMenu.vue";
|
||||
import type { ResAiProjectPage, ResAiEngineerPage } from "@/api/types/government/AIwaring";
|
||||
import ProTable from "@/components/ProTable/index.vue";
|
||||
import { ColumnProps } from "@/components/ProTable/interface";
|
||||
import { getRealTimePage } from "@/api/modules/project";
|
||||
import { sendIframeMessage } from "@/utils/util";
|
||||
const pages = ref({
|
||||
pageNo: 1,
|
||||
pageSize: 7,
|
||||
total: 0
|
||||
});
|
||||
const records = ref<ResAiProjectPage[] | ResAiEngineerPage[]>([]);
|
||||
const active = ref(0);
|
||||
const fileList = ref([]);
|
||||
const store = GlobalStore();
|
||||
// 表格配置项
|
||||
const columns: ColumnProps[] = [
|
||||
{ type: "index", label: "序号", width: 80 },
|
||||
// 多级 prop
|
||||
{ prop: "name", label: "设备名称", isShow: false, search: { el: "input" } },
|
||||
{ prop: "deviceName", label: "设备名称", width: 180 },
|
||||
{
|
||||
prop: "temperature",
|
||||
label: "温度",
|
||||
width: 150,
|
||||
render: scoped => {
|
||||
return scoped.row.temperature + "℃";
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: "windspeed",
|
||||
label: "风速",
|
||||
width: 150,
|
||||
render: scoped => {
|
||||
return scoped.row.windspeed + "m/s";
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: "pm25",
|
||||
label: "PM2.5",
|
||||
width: 150,
|
||||
render: scoped => {
|
||||
return scoped.row.pm25 + "μg/m³";
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: "noise",
|
||||
label: "噪音",
|
||||
width: 150,
|
||||
render: scoped => {
|
||||
return scoped.row.noise + "db";
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: "pm10",
|
||||
label: "PM10",
|
||||
width: 150,
|
||||
render: scoped => {
|
||||
return scoped.row.pm10 + "μg/m³";
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: "tsp",
|
||||
label: "TSP",
|
||||
width: 150,
|
||||
render: scoped => {
|
||||
return scoped.row.tsp + "μg/m³";
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: "humidity",
|
||||
label: "湿度",
|
||||
width: 150,
|
||||
render: scoped => {
|
||||
return scoped.row.humidity + "%";
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: "winddirection",
|
||||
label: "风向",
|
||||
width: 160,
|
||||
render: scoped => {
|
||||
return scoped.row.winddirection + "风";
|
||||
}
|
||||
},
|
||||
{ prop: "createTime", label: "上报时间", width: 220 }
|
||||
];
|
||||
interface formData {
|
||||
title: string;
|
||||
uploadTime: string;
|
||||
remark: string;
|
||||
videoUrl: string;
|
||||
}
|
||||
const formData = ref<formData>({
|
||||
title: "",
|
||||
uploadTime: "",
|
||||
remark: "",
|
||||
videoUrl: ""
|
||||
});
|
||||
const visible = ref(false);
|
||||
const title = ref("新增录像");
|
||||
|
||||
const pageable = ref({
|
||||
pageNo: 1,
|
||||
pageSize: 12,
|
||||
total: 0
|
||||
});
|
||||
|
||||
const videoData = ref({
|
||||
records: []
|
||||
});
|
||||
const form = ref({
|
||||
title: "",
|
||||
createTime: "",
|
||||
startTime: "",
|
||||
endTime: ""
|
||||
});
|
||||
// 搜索用的项目sn或者工程sn
|
||||
const searchSn = ref("");
|
||||
|
||||
// 项目或者工程名字
|
||||
const searchName = ref<string>("");
|
||||
// dataCallback 是对于返回的表格数据做处理,如果你后台返回的数据不是 list && total && pageNum && pageSize 这些字段,那么你可以在这里进行处理成这些字段
|
||||
// 或者直接去 hooks/useTable.ts 文件中把字段改为你后端对应的就行
|
||||
const dataCallback = (data: any) => {
|
||||
// console.log(data);
|
||||
return {
|
||||
list: data.records,
|
||||
total: Number(data.total),
|
||||
pageNo: Number(data.current),
|
||||
pageSize: Number(data.size)
|
||||
};
|
||||
};
|
||||
// 如果你想在请求之前对当前请求参数做一些操作,可以自定义如下函数:params 为当前所有的请求参数(包括分页),最后返回请求列表接口
|
||||
// 默认不做操作就直接在 ProTable 组件上绑定 :requestApi="getUserList"
|
||||
const getTableList = (params: any) => {
|
||||
let newParams = JSON.parse(JSON.stringify(params));
|
||||
return getRealTimePage(newParams);
|
||||
};
|
||||
// 页面的项目名称和工程名称的div点击事件
|
||||
const onSearch = async (params: ResAiProjectPage | ResAiEngineerPage) => {
|
||||
const { result } = await getAIQuestionPage(
|
||||
active.value === 0
|
||||
? { projectSn: (params as ResAiProjectPage).projectSn, pageNo: pageable.value.pageNo, pageSize: pageable.value.pageSize }
|
||||
: {
|
||||
engineeringSn: (params as ResAiEngineerPage).engineeringSn,
|
||||
pageNo: pageable.value.pageNo,
|
||||
pageSize: pageable.value.pageSize
|
||||
}
|
||||
);
|
||||
pageable.value.total = Number(result.total);
|
||||
active.value === 0
|
||||
? (searchSn.value = (params as ResAiProjectPage).projectSn)
|
||||
: (searchSn.value = (params as ResAiEngineerPage).engineeringSn);
|
||||
active.value === 0
|
||||
? (searchName.value = (params as ResAiProjectPage).projectName)
|
||||
: (searchName.value = (params as ResAiEngineerPage).engineeringName);
|
||||
getVideoData();
|
||||
};
|
||||
// leftMenu页面的搜索按钮
|
||||
const onSearchInput = async (params: string) => {
|
||||
console.log(params);
|
||||
if (active.value === 0) {
|
||||
const { result } = await getDustprojectPage({ projectName: params, ...pages.value });
|
||||
records.value = result.records;
|
||||
} else {
|
||||
const { result } = await getDustengineeringPage({ engineeringName: params, ...pages.value });
|
||||
records.value = result.records;
|
||||
}
|
||||
};
|
||||
// leftMenu页面的分页
|
||||
const onCurChange = async (params: number) => {
|
||||
if (active.value === 0) {
|
||||
const { result } = await getDustprojectPage({ ...pages.value, pageNo: params });
|
||||
records.value = result.records;
|
||||
} else {
|
||||
const { result } = await getDustengineeringPage({ ...pages.value, pageNo: params });
|
||||
records.value = result.records;
|
||||
pages.value.total = +result.total;
|
||||
}
|
||||
pages.value.total = +res.result.total;
|
||||
};
|
||||
const getVideoData = async () => {
|
||||
const res = await videoList({ ...pageable.value, ...form.value });
|
||||
videoData.value.records = res.result.records;
|
||||
console.log(videoData.value);
|
||||
console.log(res);
|
||||
};
|
||||
// 获取项目名称分页
|
||||
const getProPage = 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 getEngPage = async () => {
|
||||
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 getProPage();
|
||||
onSearch(records.value[0]);
|
||||
} else {
|
||||
await getEngPage();
|
||||
onSearch(records.value[0]);
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true
|
||||
}
|
||||
);
|
||||
onMounted(async () => {
|
||||
getVideoData();
|
||||
await getProPage();
|
||||
onSearch(records.value[0]);
|
||||
searchSn.value = (records.value as ResAiProjectPage[])[0].projectSn;
|
||||
searchName.value = (records.value as ResAiProjectPage[])[0].projectName;
|
||||
await sendIframeMessage({ obj: { path: store.path, moduleId: store.moduleId } }, 2, undefined);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "./index.scss";
|
||||
</style>
|
||||
Loading…
x
Reference in New Issue
Block a user