From 17388fa7ecd1f3ebadad470a463573a1cfe4468f Mon Sep 17 00:00:00 2001 From: zmc <zmc_li@foxmail.com> Date: 星期四, 31 八月 2023 11:29:31 +0800 Subject: [PATCH] 扬尘Vue --- src/sfc/DustExceptionText.vue | 7 src/views/exception/FlightInspection.vue | 273 ----------- src/views/line_graph/DataRiskModel.vue | 139 ++++- src/views/line_graph/components/LineChart.vue | 2 src/views/exception/SiteAuditAssistance.vue | 635 ---------------------------- src/sfc/ExceptionType.vue | 8 src/sfc/TimeSelect.vue | 14 src/main.ts | 3 src/views/login/LoginSystem.vue | 7 src/api/exportExcel/requetsApi.js | 6 src/api/index.js | 3 src/views/origin_data/HistoryData.vue | 67 ++ src/sfc/AreaAndmonitorType.vue | 3 src/views/line_graph/components/DustRadarChart.vue | 85 ++ src/components/layout/AppAside.vue | 30 src/router/index.ts | 6 src/sfc/TimeSelectWithShortCuts.vue | 27 src/sfc/InputSearch.vue | 1 18 files changed, 309 insertions(+), 1,007 deletions(-) diff --git a/src/api/exportExcel/requetsApi.js b/src/api/exportExcel/requetsApi.js index 5f2dae4..6757fc1 100644 --- a/src/api/exportExcel/requetsApi.js +++ b/src/api/exportExcel/requetsApi.js @@ -8,5 +8,11 @@ */ fetchAllData(argsObj){ return $http.get('dust/analysisall',{params:argsObj}); + }, + + fetchAlSiteData(argsObj){ + + return $http.get('dust/historyall',{params:argsObj}); } + } \ No newline at end of file diff --git a/src/api/index.js b/src/api/index.js index 81af872..aff2f7b 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -2,7 +2,8 @@ import { setInterceptors } from './config'; // const url = 'http://47.100.191.150:9031/'; -const url = 'http://192.168.1.4:8081/'; +// const url = 'http://192.168.1.4:8081/'; +const url = 'http://localhost:8081/'; //椋炵窘鐩戠 const $http = axios.create({ diff --git a/src/components/layout/AppAside.vue b/src/components/layout/AppAside.vue index d8237dd..80fabe8 100644 --- a/src/components/layout/AppAside.vue +++ b/src/components/layout/AppAside.vue @@ -12,6 +12,7 @@ ' 鏁版嵁椋庨櫓妯″瀷', '鏁版嵁椋庨櫓鎺掑悕', '椋炶宸℃', + '绔欑偣瀹℃牳杈呭姪', '鍘嗗彶鏁版嵁绠$悊', '鏁版嵁鎺ュ叆绠$悊', '涓氬姟鎶ヨ〃', @@ -50,9 +51,12 @@ <el-link href="/hdata" class="logo" > <!-- <img src="@/assets/companylogo.png" alt="" /> --> <h1>鍦ㄧ嚎鐩戞祴鏁版嵁璐ㄩ噺璇勪及涓庨闄╁垎鏋�</h1> - + </el-link> + </el-space> + <div class="line"> + </div> </el-row> <el-scrollbar :height="menuHeight"> @@ -84,9 +88,9 @@ 椋炶宸℃ </el-menu-item> - <el-menu-item index="testdata" @click="selected = optionClick[2]"> + <el-menu-item index="testdata" @click="selected = optionClick[3]"> <el-icon><i-ep-Bell /></el-icon> - 寮傚父娴嬭瘯 + 绔欑偣瀹℃牳杈呭姪 </el-menu-item> </el-sub-menu> @@ -98,32 +102,32 @@ </template> - <el-menu-item index="hdata" @click="selected = optionClick[3]"> + <el-menu-item index="hdata" @click="selected = optionClick[4]"> <el-icon><i-ep-Histogram /></el-icon> 鍘嗗彶鏁版嵁绠$悊 </el-menu-item> - <el-menu-item index="management" @click="selected = optionClick[4]"> + <!-- <el-menu-item index="management" @click="selected = optionClick[5]"> <el-icon><i-ep-Histogram /></el-icon> 鏁版嵁鎺ュ叆绠$悊 </el-menu-item> - <el-menu-item index="report" @click="selected = optionClick[5]"> + <el-menu-item index="report" @click="selected = optionClick[6]"> <el-icon><i-ep-Histogram /></el-icon> 涓氬姟鎶ヨ〃 - </el-menu-item> + </el-menu-item> --> </el-sub-menu> - <el-sub-menu index="4"> + <!-- <el-sub-menu index="4"> <template #title> <el-icon><i-ep-DataLine /></el-icon> <span class="parent-title">閰嶇疆绠$悊</span> </template> - <el-menu-item index="setting" @click="selected = optionClick[6]"> + <el-menu-item index="setting" @click="selected = optionClick[7]"> <el-icon><i-ep-Histogram /></el-icon> 鏁版嵁鎺ュ叆閰嶇疆 </el-menu-item> - </el-sub-menu> + </el-sub-menu> --> </el-scrollbar> </el-menu> @@ -184,4 +188,10 @@ font-weight: bold; font-size: 18px; } +// .line { +// width: 180px; +// border: 1px solid rgb(255,255,255,0.2); +// margin: 0px; +// padding: 0px; +// } </style> diff --git a/src/main.ts b/src/main.ts index 3cdc444..3d9bbbc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -14,7 +14,8 @@ const app = createApp(App) -axios.defaults.baseURL = 'http://192.168.1.4:8081' +// axios.defaults.baseURL = 'http://192.168.1.4:8081' +axios.defaults.baseURL = 'http://localhost:8081' app.config.globalProperties.$http = axios app.use(createPinia()) diff --git a/src/router/index.ts b/src/router/index.ts index 5d6046c..e80b211 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -28,7 +28,7 @@ { path:"/hdata", name:'hdata', - component: () => import('@/views/origin_data/TableData.vue') + component: () => import('@/views/origin_data/HistoryData.vue') }, // 椋炶宸℃ @@ -38,11 +38,11 @@ component: () => import('@/views/exception/FlightInspection.vue') }, - // 寮傚父娴嬭瘯 + // 绔欑偣瀹℃牳杈呭姪 { path:"/testdata", name:'testdata', - component: () => import('@/views/exception/ExceptionTest.vue') + component: () => import('@/views/exception/SiteAuditAssistance.vue') }, // 鏁版嵁鎺ュ叆閰嶇疆 diff --git a/src/sfc/AreaAndmonitorType.vue b/src/sfc/AreaAndmonitorType.vue index d5448db..d0fc43c 100644 --- a/src/sfc/AreaAndmonitorType.vue +++ b/src/sfc/AreaAndmonitorType.vue @@ -68,9 +68,10 @@ width: 100px; } .el-space { - margin-top: 5px; + /* margin-top: 5px; */ } .text { color: black; + font-size: 16px; } </style> \ No newline at end of file diff --git a/src/sfc/DustExceptionText.vue b/src/sfc/DustExceptionText.vue index 0ac11dc..b726e90 100644 --- a/src/sfc/DustExceptionText.vue +++ b/src/sfc/DustExceptionText.vue @@ -10,7 +10,8 @@ siteName: String, exceptionType: String, beginTime: String, - endTime: String + endTime: String, + }, emits: ['submitExceptionData'], data() { @@ -34,6 +35,7 @@ .then((result) => { //灏嗚繑鍥炵殑缁撴灉浼犻�掔粰鐖剁粍浠� this.$emit('submitExceptionData', result.data.data); + // this.$emit('subloading',false) }); } } @@ -48,4 +50,7 @@ .text { color: #000000; } +// .text:hover{ +// color: #2876aa; +// } </style> diff --git a/src/sfc/ExceptionType.vue b/src/sfc/ExceptionType.vue index c11f5d4..4a1170b 100644 --- a/src/sfc/ExceptionType.vue +++ b/src/sfc/ExceptionType.vue @@ -32,8 +32,14 @@ // this.exceptionType = response.data.data response.data.data.forEach(item => { this.exceptionType.push(item.exceptionType) + }); - console.log(this.exceptionType); + let a = ['0','1','2','3','4','5','6','7'] + a.forEach(item=>{ + if(this.exceptionType.indexOf(item) == -1){ + this.exceptionType.push(item) + } + }) }) }, handleCheckAllChange (val) { diff --git a/src/sfc/InputSearch.vue b/src/sfc/InputSearch.vue index 9c6cc8e..c0a5d13 100644 --- a/src/sfc/InputSearch.vue +++ b/src/sfc/InputSearch.vue @@ -105,6 +105,7 @@ .text { font-weight: bold; margin-top: 5px; + font-size: 16px; } .el-autocomplete { margin-top: 5px; diff --git a/src/sfc/TimeSelect.vue b/src/sfc/TimeSelect.vue index b19d348..b2a57a5 100644 --- a/src/sfc/TimeSelect.vue +++ b/src/sfc/TimeSelect.vue @@ -59,18 +59,20 @@ </template> <style> -.demonstration { - margin-left: 15px; - margin-top: 5px; - font-weight: bold; - white-space: nowrap; -} + .block { display: flex; justify-content: center; width: 90%; white-space: nowrap; } + +.demonstration { + margin-left: 15px; + margin-top: 5px; + font-weight: bold; + white-space: nowrap; +} .pick-date { width: 100%; margin-top: 5px; diff --git a/src/sfc/TimeSelectWithShortCuts.vue b/src/sfc/TimeSelectWithShortCuts.vue index 4f08f84..5cf713a 100644 --- a/src/sfc/TimeSelectWithShortCuts.vue +++ b/src/sfc/TimeSelectWithShortCuts.vue @@ -74,18 +74,18 @@ <template> <div class="block"> - <div class="demonstration">璧锋鏃堕棿锛�</div> - <el-date-picker - v-model="time" - type="datetimerange" - :shortcuts="shortcuts" - range-separator="~" - start-placeholder="寮�濮嬫椂闂�" - end-placeholder="缁撴潫鏃堕棿" - value-format="YYYY-MM-DD HH:mm:ss" - @change="$emit('submitTime', time)" - class="pick-date" - /> + <span class="demonstration">璧锋鏃堕棿锛�</span> + <el-date-picker + v-model="time" + type="datetimerange" + :shortcuts="shortcuts" + range-separator="~" + start-placeholder="寮�濮嬫椂闂�" + end-placeholder="缁撴潫鏃堕棿" + value-format="YYYY-MM-DD HH:mm:ss" + @change="$emit('submitTime', time)" + class="pick-date" + /> </div> </template> @@ -96,8 +96,9 @@ } .demonstration { margin-left: 15px; - margin-top: 5px; + /* margin-top: 5px; */ font-weight: bold; + font-size: 16px; } .pick-date { diff --git a/src/views/exception/FlightInspection.vue b/src/views/exception/FlightInspection.vue index a64ed4e..61e9267 100644 --- a/src/views/exception/FlightInspection.vue +++ b/src/views/exception/FlightInspection.vue @@ -15,11 +15,8 @@ import dayjs from 'dayjs'; export default { components: { - ExceptionType, - InputSearch, TimeSelectWithShortCuts, DustExceptionText, - DustLineChart, AreaAndmonitorType }, data() { @@ -103,6 +100,8 @@ afterButton: false, // 鎶樼嚎鍥� lineChart: false, + // 寮傚父绔欑偣鍚嶅瓙鏂囨湰 + text:false }, @@ -1358,26 +1357,11 @@ <el-form-item > <AreaAndmonitorType ></AreaAndmonitorType> </el-form-item> - <el-form-item> - <InputSearch - :isNeedDefaultSite="0" - @submit-value="(n) => (form.name = n)" - @submit-site-Nums="(n) => (siteTotal = n)" - > - </InputSearch> - </el-form-item> - - <el-form-item> <TimeSelectWithShortCuts @submit-time="giveTime"></TimeSelectWithShortCuts> </el-form-item> - <el-form-item> - <ExceptionType - @submit-value="(n) => form.exceptionName = n" - ></ExceptionType> - </el-form-item> </div> <div class="head-container-search"> @@ -1447,7 +1431,7 @@ </div> <hr /> <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> + <div class="card-exception-buttom" v-loading="loading.text" > <el-scrollbar max-height="90px"> <DustExceptionText :site-name="item.name" @@ -1455,7 +1439,7 @@ :begin-time="beginTime" :end-time="endTime" @submit-exception-data="getAbnormalDataByClick" - + @subloading="(n)=>loading.text=n" v-for="(item, index) in exception.exception4" :key="item" >{{ item.name }} @@ -1514,7 +1498,7 @@ </div> <hr /> <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> + <div class="card-exception-buttom" v-loading="loading.text"> <el-scrollbar max-height="90px"> <DustExceptionText :site-name="item.name" @@ -1581,7 +1565,7 @@ </div> <hr /> <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> + <div class="card-exception-buttom" v-loading="loading.text"> <el-scrollbar max-height="90px"> <DustExceptionText :site-name="item.name" @@ -1648,7 +1632,7 @@ </div> <hr /> <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> + <div class="card-exception-buttom" v-loading="loading.text"> <el-scrollbar max-height="90px"> <DustExceptionText :site-name="item.name" @@ -1719,7 +1703,7 @@ </div> <hr /> <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> + <div class="card-exception-buttom" v-loading="loading.text"> <el-scrollbar max-height="90px"> <DustExceptionText :site-name="item.name" @@ -1781,7 +1765,7 @@ </div> <hr /> <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> + <div class="card-exception-buttom" v-loading="loading.text"> <el-scrollbar max-height="90px"> <DustExceptionText :site-name="item.name" @@ -1843,7 +1827,7 @@ </div> <hr /> <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> + <div class="card-exception-buttom" v-loading="loading.text"> <el-scrollbar max-height="90px"> <DustExceptionText :site-name="item.name" @@ -1974,7 +1958,7 @@ </div> <hr /> <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> + <div class="card-exception-buttom" v-loading="loading.text"> <el-scrollbar max-height="90px"> <DustExceptionText :site-name="item.name" @@ -2005,241 +1989,6 @@ </el-col> </el-row> - <el-row> - <el-col v-show="!isNoData"> - <el-table - ref="table" - :data="displayData" - :height="tableHeight" - highlight-current-row="true" - size="default" - v-loading="loading.tableLoading" - border - > - <el-table-column - type="index" - label="搴忓彿" - width="60px" - align="center" - fixed - :index="indexMethod1" - /> - <el-table-column prop="name" label="绔欑偣鍚嶇О" show-overflow-tooltip /> - <el-table-column - prop="mnCode" - label="璁惧缂栧彿" - align="center" - show-overflow-tooltip - /> - <el-table-column - prop="exception" - label="寮傚父绫诲瀷" - align="center" - show-overflow-tooltip - /> - <el-table-column - prop="region" - label="鍖哄煙" - align="center" - show-overflow-tooltip - /> - <el-table-column - prop="beginTime" - label="寮�濮嬫椂闂�" - align="center" - show-overflow-tooltip - /> - <el-table-column - prop="endTime" - label="缁撴潫鏃堕棿" - align="center" - show-overflow-tooltip - /> - <el-table-column - prop="typename" - label="鍦烘櫙" - align="center" - show-overflow-tooltip - /> - <el-table-column - prop="address" - label="鍦板潃" - align="center" - show-overflow-tooltip - /> - <el-table-column - prop="dutyCompany" - label="杩愮淮鍟�" - align="center" - show-overflow-tooltip - /> - <el-table-column label="鎿嶄綔" align="center"> - <template #default="{ row }"> - <el-button - type="primary" - class="table-button" - @click="showDialog(row)" - >鏌ョ湅璇︽儏</el-button - > - </template> - </el-table-column> - </el-table> - - <el-pagination - ref="h4" - background - layout="total, sizes, prev, pager, next, jumper" - v-model:current-page="currentPage" - v-model:page-size="pageSize" - :total="total" - :page-sizes="[10, 20, 50, 100]" - @size-change="handleSizeChange" - @current-change="handleCurrentChange" - > - </el-pagination> - </el-col> - </el-row> - - <el-empty v-show="isNoData" :image-size="200" /> - - <el-dialog v-model="dialogTableVisible" draggable align-center height="300px"> - <!-- 澶� --> - <template #header> - <div class="diag-head"> - <div class="diag-head-text"> - <div> - <span class="diag-head-text1">绔欑偣鍚嶇О锛�</span - >{{ tableCurrentRowData.name }} - </div> - - <div> - <span class="diag-head-text1">寮傚父绫诲瀷锛�</span> - <span v-if="tableCurrentRowData.exceptionType == '0'" - >鏂數鎴栨柇缃�</span - > - <span v-else-if="tableCurrentRowData.exceptionType == '1'" - >鏁版嵁瓒呬綆</span - > - <span v-else-if="tableCurrentRowData.exceptionType == '2'">瓒呮爣</span> - <span v-else-if="tableCurrentRowData.exceptionType == '3'" - >鏁版嵁闀挎椂闂存棤娉㈠姩</span - > - <span v-else-if="tableCurrentRowData.exceptionType == '4'" - >閲忕骇绐佸彉寮傚父</span - > <span v-else-if="tableCurrentRowData.exceptionType == '5'" - >涓磋繎瓒呮爣寮傚父</span - > <span v-else-if="tableCurrentRowData.exceptionType == '6'" - >鍗曟棩瓒呮爣娆℃暟涓寸晫寮傚父</span - > <span v-else-if="tableCurrentRowData.exceptionType == '7'" - >婊戝姩骞冲潎鍊煎紓甯�</span - > - </div> - - <div> - <span class="diag-head-text1">寮傚父鏃堕棿娈碉細</span - >{{ tableCurrentRowData.beginTime }} ~ - {{ tableCurrentRowData.endTime }} - </div> - </div> - - <div class="chart-jump-button"> - <el-button - type="danger" - :loading="loading.preButton" - :disabled="dialog.isPreCantouch || flag.banTouch" - @click="getPreviousRowData" - >涓婃潯寮傚父</el-button - > - <el-button - type="danger" - :loading="loading.afterButton" - :disabled="dialog.isNextCantouch || flag.banTouch" - @click="getNextRowData" - >涓嬫潯寮傚父</el-button - > - </div> - </div> - </template> - - <!-- :option="dialog.option" --> - - <!-- 鍥惧舰 --> - <DustLineChart - :option="dialog.option" - :is-open-dialog="dialogTableVisible" - v-loading="loading.lineChart" - ></DustLineChart> - - <!-- 琛ㄦ牸 --> - <div> - <el-table :data="dialog.historyData" size="default" height="200" border> - <el-table-column - type="index" - label="搴忓彿" - width="60px" - align="center" - fixed - :index="indexMethod2" - ></el-table-column> - <el-table-column - fixed - prop="name" - label="绔欑偣鍚嶇О" - show-overflow-tooltip - /> - <el-table-column - prop="mnCode" - label="璁惧缂栧彿" - align="center" - show-overflow-tooltip - /> - <el-table-column - prop="dutyCompany" - label="杩愮淮鍟�" - align="center" - show-overflow-tooltip - /> - <el-table-column - prop="lst" - label="閲囬泦鏃堕棿" - align="center" - show-overflow-tooltip - /> - <el-table-column - prop="dustValue" - label="棰楃矑鐗╂祿搴�(mg/m鲁)" - align="center" - show-overflow-tooltip - /> - </el-table> - </div> - <template #footer> - <el-tag type="success" class="mx-1" effect="dark" round - ><span - class="table-line-lable" - v-show="tableCurrentRowData.exceptionType == '0'" - >缂哄け鏁版嵁锛� - </span> - <span - v-show=" - tableCurrentRowData.exceptionType == '1' || - tableCurrentRowData.exceptionType == '2' || - tableCurrentRowData.exceptionType == '3' || - tableCurrentRowData.exceptionType == '4' - " - >寮傚父鏁版嵁锛�</span - > - <span class="table-line-num">{{ dialog.exceptionTotal }}鏉�</span> - <span - v-show=" - tableCurrentRowData.exceptionType === '0' - " - > - (閫昏緫璁$畻)</span - > - </el-tag> - </template> - </el-dialog> </template> <style lang="scss" scoped> diff --git a/src/views/exception/ExceptionTest.vue b/src/views/exception/SiteAuditAssistance.vue similarity index 67% rename from src/views/exception/ExceptionTest.vue rename to src/views/exception/SiteAuditAssistance.vue index a64ed4e..303f548 100644 --- a/src/views/exception/ExceptionTest.vue +++ b/src/views/exception/SiteAuditAssistance.vue @@ -2,7 +2,6 @@ import InputSearch from '../../sfc/InputSearch.vue'; import ExceptionType from '../../sfc/ExceptionType.vue'; import TimeSelectWithShortCuts from '../../sfc/TimeSelectWithShortCuts.vue'; -import DustExceptionText from '../../sfc/DustExceptionText.vue'; import { useFetch } from '../../utils/fetch.js'; import { useCommonFunction } from '../../utils/common.js'; import AreaAndmonitorType from '../../sfc/AreaAndmonitorType.vue' @@ -18,7 +17,7 @@ ExceptionType, InputSearch, TimeSelectWithShortCuts, - DustExceptionText, + DustLineChart, AreaAndmonitorType }, @@ -181,31 +180,17 @@ } }, mounted() { - // 娴嬭瘯缁勫悎寮忓嚱鏁� - // let param = { - // siteName: '閲戝北鍖洪噾灞辨柊鍩嶫SC1-0401鍗曞厓1-11-01鍦板潡椤圭洰09', - // beginTime: '2023-07-01 00:00:00', - // endTime: '2023-07-10 00:00:00' - // }; - // this.backData = this.request('/dust/history1', param); - // console.log('鍘嗗彶鏁版嵁涓猴細', this.backData.value); + this.backExceptionDataAWeekAgo(); - // this.calTableHeight(); + this.calTableHeight(); // 鏌ヨ鏃堕棿娈电殑鍚勫紓甯哥殑绔欑偣锛屾煡璇㈣鏃堕棿鍖洪棿鐨勫悇寮傚父鏁伴噺 this.getShopNames(); - // this.exception.exception0 = this.getSiteNameByExceptionType('0',this.beginTime,this.endTime) - // console.log('寮傚父鏁版嵁涓猴細',this.exception.exception0); + }, methods: { - - // getExceptionSiteNum(){ - // this.$http.get('/dust/exceptionsitenum').then(result => { - // this.exceptionSiteNum = result.data.data.length - // }) - // }, /** * description锛氱偣鍑诲紓甯哥珯鐐瑰悕瀛楁椂 杩斿洖鐨勬暟鎹� * @param锛� @@ -1300,10 +1285,9 @@ calTableHeight() { const h1 = this.$refs.h1.$el.offsetHeight; const h2 = this.$refs.h2.$el.offsetHeight; - const h3 = this.$refs.h3.$el.offsetHeight; const h4 = this.$refs.h4.$el.offsetHeight; // 鍏朵腑涓�涓�40鏄洅瀛愮殑鎬诲杈硅窛 - this.tableHeight = `calc(100vh - ${h1}px - ${h2}px - ${h3}px - ${h4}px - 40px - var(--el-main-padding) * 2)`; + this.tableHeight = `calc(100vh - ${h1}px - ${h2}px - ${h4}px - 100px - var(--el-main-padding) * 2)`; }, // 椤靛ぇ灏忔敼鍙樻椂瑙﹀彂 @@ -1395,615 +1379,6 @@ </el-row> </el-row> - <el-row ref="h3"> - <el-col> - <el-card> - <template #header> - <div class="card-header">寮傚父鍒嗘瀽</div> - </template> - - - <el-row :gutter="20" class="card-row" > - <el-col :span="6"> - <div class="card-content-unnormal"> - <!-- 鏍囧ご --> - <div class="card-text1"> - <image class="card-header-image"></image> - <span class="card-header-text">閲忕骇绐佸彉寮傚父</span> - </div> - - <div class="card-content-text"> - <el-scrollbar> - - <span class="card-exceptionname-text1">寮傚父绔欑偣鍗犳瘮:</span> - <span>{{ exception.exception4.length }} /{{ siteTotal }}</span> - <span> - ({{ - ((exception.exception4.length / siteTotal) * 100).toFixed( - 1 - ) - }}%)</span - > - - <div class="card-exceptionname-text2" - >寮傚父鏁板崰姣�:{{ - ( - (exception.exception4Num / - (exception.exception0Num + - exception.exception1Num + - exception.exception2Num + - exception.exception3Num+ - exception.exception4Num+ - exception.exception5Num+ - exception.exception6Num+ - exception.exception7Num - )) * - 100 - ).toFixed(1) - }}%</div - > - - </el-scrollbar> - </div> - <hr /> - <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> - <el-scrollbar max-height="90px"> - <DustExceptionText - :site-name="item.name" - exception-type="4" - :begin-time="beginTime" - :end-time="endTime" - @submit-exception-data="getAbnormalDataByClick" - - v-for="(item, index) in exception.exception4" - :key="item" - >{{ item.name }} - <span - v-if="index < exception.exception4.length - 1" - class="text-blank" - >,</span - > - </DustExceptionText> - </el-scrollbar> - </div> - <!-- 缁撴潫 --> - </div> - </el-col> - - <el-col :span="6"> - <div class="card-content-unnormal"> - <!-- 鏍囧ご --> - <div class="card-text1"> - <image class="card-header-image"></image> - <span class="card-header-text">涓磋繎瓒呮爣寮傚父</span> - </div> - - <div class="card-content-text"> - <el-scrollbar> - - <span class="card-exceptionname-text1">寮傚父绔欑偣鍗犳瘮:</span> - <span>{{ exception.exception5.length }} /{{ siteTotal }}</span> - <span> - ({{ - ((exception.exception5.length / siteTotal) * 100).toFixed( - 1 - ) - }}%)</span - > - - <div class="card-exceptionname-text2" - >寮傚父鏁板崰姣�:{{ - ( - (exception.exception5Num / - (exception.exception0Num + - exception.exception1Num + - exception.exception2Num + - exception.exception3Num+ - exception.exception4Num+ - exception.exception5Num+ - exception.exception6Num+ - exception.exception7Num - )) * - 100 - ).toFixed(1) - }}%</div - > - - </el-scrollbar> - </div> - <hr /> - <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> - <el-scrollbar max-height="90px"> - <DustExceptionText - :site-name="item.name" - exception-type="5" - :begin-time="beginTime" - :end-time="endTime" - @submit-exception-data="getAbnormalDataByClick" - - v-for="(item, index) in exception.exception5" - :key="item" - >{{ item.name }} - <span - v-if="index < exception.exception5.length - 1" - class="text-blank" - >,</span - > - </DustExceptionText> - </el-scrollbar> - </div> - <!-- 缁撴潫 --> - </div> - </el-col> - - <el-col :span="6"> - <div class="card-content-unnormal"> - <!-- 鏍囧ご --> - <div class="card-text1"> - <image class="card-header-image"></image> - <span class="card-header-text">鍗曟棩瓒呮爣娆℃暟涓寸晫寮傚父</span> - </div> - - <div class="card-content-text"> - <el-scrollbar> - - <span class="card-exceptionname-text1">寮傚父绔欑偣鍗犳瘮:</span> - <span>{{ exception.exception6.length }} /{{ siteTotal }}</span> - <span> - ({{ - ((exception.exception6.length / siteTotal) * 100).toFixed( - 1 - ) - }}%)</span - > - - <div class="card-exceptionname-text2" - >寮傚父鏁板崰姣�:{{ - ( - (exception.exception6Num / - (exception.exception0Num + - exception.exception1Num + - exception.exception2Num + - exception.exception3Num+ - exception.exception4Num+ - exception.exception5Num+ - exception.exception6Num+ - exception.exception7Num - )) * - 100 - ).toFixed(1) - }}%</div - > - - </el-scrollbar> - </div> - <hr /> - <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> - <el-scrollbar max-height="90px"> - <DustExceptionText - :site-name="item.name" - exception-type="6" - :begin-time="beginTime" - :end-time="endTime" - @submit-exception-data="getAbnormalDataByClick" - - v-for="(item, index) in exception.exception6" - :key="item" - >{{ item.name }} - <span - v-if="index < exception.exception6.length - 1" - class="text-blank" - >,</span - > - </DustExceptionText> - </el-scrollbar> - </div> - <!-- 缁撴潫 --> - </div> - </el-col> - - <el-col :span="6"> - <div class="card-content-unnormal"> - <!-- 鏍囧ご --> - <div class="card-text1"> - <image class="card-header-image"></image> - <span class="card-header-text">鍙樺寲瓒嬪娍寮傚父</span> - </div> - - <div class="card-content-text"> - <el-scrollbar> - - <span class="card-exceptionname-text1">寮傚父绔欑偣鍗犳瘮:</span> - <span>{{ exception.exception7.length }} /{{ siteTotal }}</span> - <span> - ({{ - ((exception.exception7.length / siteTotal) * 100).toFixed( - 1 - ) - }}%)</span - > - - <div class="card-exceptionname-text2" - >寮傚父鏁板崰姣�:{{ - ( - (exception.exception7Num / - (exception.exception0Num + - exception.exception1Num + - exception.exception2Num + - exception.exception3Num+ - exception.exception4Num+ - exception.exception5Num+ - exception.exception6Num+ - exception.exception7Num - )) * - 100 - ).toFixed(1) - }}%</div - > - - </el-scrollbar> - </div> - <hr /> - <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> - <el-scrollbar max-height="90px"> - <DustExceptionText - :site-name="item.name" - exception-type="7" - :begin-time="beginTime" - :end-time="endTime" - @submit-exception-data="getAbnormalDataByClick" - - v-for="(item, index) in exception.exception7" - :key="item" - >{{ item.name }} - <span - v-if="index < exception.exception7.length - 1" - class="text-blank" - >,</span - > - </DustExceptionText> - </el-scrollbar> - </div> - <!-- 缁撴潫 --> - </div> - </el-col> - </el-row> - - - <el-row :gutter="20" > - <el-col :span="6"> - <div class="card-content-normal"> - <!-- 鏍囧ご --> - <div class="card-text1"> - <image class="card-header-image"></image> - <span class="card-header-text">娴撳害瓒呮爣</span> - </div> - - <div class="card-content-text"> - <el-scrollbar> - - <span class="card-exceptionname-text1">寮傚父绔欑偣鍗犳瘮:</span> - <span>{{ exception.exception2.length }} /{{ siteTotal }}</span> - <span> - ({{ - ((exception.exception2.length / siteTotal) * 100).toFixed( - 1 - ) - }}%)</span - > - - <div class="card-exceptionname-text2" - >寮傚父鏁板崰姣�:{{ - ( - (exception.exception2Num / - (exception.exception0Num + - exception.exception1Num + - exception.exception2Num + - exception.exception3Num+ - exception.exception4Num+ - exception.exception5Num+ - exception.exception6Num+ - exception.exception7Num - - )) * - 100 - ).toFixed(1) - }}%</div - > - - </el-scrollbar> - </div> - <hr /> - <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> - <el-scrollbar max-height="90px"> - <DustExceptionText - :site-name="item.name" - exception-type="2" - :begin-time="beginTime" - :end-time="endTime" - @submit-exception-data="getAbnormalDataByClick" - - v-for="(item, index) in exception.exception2" - :key="item" - >{{ item.name }} - <span - v-if="index < exception.exception2.length - 1" - class="text-blank" - >,</span - > - </DustExceptionText> - </el-scrollbar> - </div> - <!-- 缁撴潫 --> - </div> - </el-col> - <el-col :span="6" - ><div class="card-content-normal"> - <!-- 鏍囧ご --> - <div class="card-text1"> - <image class="card-header-image"></image> - <span class="card-header-text">鏁版嵁缂哄け寮傚父</span> - </div> - - <div class="card-content-text"> - <el-scrollbar> - <span class="card-exceptionname-text1">寮傚父绔欑偣鍗犳瘮:</span> - <span>{{ exception.exception0.length }} /{{ siteTotal }}</span> - <span> - ({{ - ((exception.exception0.length / siteTotal) * 100).toFixed( - 1 - ) - }}%)</span - > - <div class="card-exceptionname-text2" - >寮傚父鏁板崰姣�:{{ - ( - (exception.exception0Num / - (exception.exception0Num + - exception.exception1Num + - exception.exception2Num + - exception.exception3Num+ - exception.exception4Num+ - exception.exception5Num+ - exception.exception6Num+ - exception.exception7Num)) * - 100 - ).toFixed(1) - }}%</div - > - </el-scrollbar> - </div> - <hr /> - <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> - <el-scrollbar max-height="90px"> - <DustExceptionText - :site-name="item.name" - exception-type="0" - :begin-time="beginTime" - :end-time="endTime" - @submit-exception-data="getAbnormalDataByClick" - - v-for="(item, index) in exception.exception0" - :key="item" - >{{ item.name }} - <span - v-if="index < exception.exception0.length - 1" - class="text-blank" - >,</span - > - </DustExceptionText> - </el-scrollbar> - </div> - <!-- 缁撴潫 --> - </div> - </el-col> - <el-col :span="6"> - <div class="card-content-normal"> - <!-- 鏍囧ご --> - <div class="card-text1"> - <image class="card-header-image"></image> - <span class="card-header-text">鏁版嵁瓒呬綆</span> - </div> - - <div class="card-content-text"> - <el-scrollbar> - <span class="card-exceptionname-text1">寮傚父绔欑偣鍗犳瘮:</span> - <span>{{ exception.exception1.length }} /{{ siteTotal }}</span> - <span> - ({{ - ((exception.exception1.length / siteTotal) * 100).toFixed( - 1 - ) - }}%)</span - > - <div class="card-exceptionname-text2" - >寮傚父鏁板崰姣�:{{ - ( - (exception.exception1Num / - (exception.exception0Num + - exception.exception1Num + - exception.exception2Num + - exception.exception3Num+ - exception.exception4Num+ - exception.exception5Num+ - exception.exception6Num+ - exception.exception7Num)) * - 100 - ).toFixed(1) - }}%</div - > - </el-scrollbar> - </div> - <hr /> - <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> - <el-scrollbar max-height="90px"> - <DustExceptionText - :site-name="item.name" - exception-type="1" - :begin-time="beginTime" - :end-time="endTime" - @submit-exception-data="getAbnormalDataByClick" - - v-for="(item, index) in exception.exception1" - :key="item" - >{{ item.name }} - <span - v-if="index < exception.exception1.length - 1" - class="text-blank" - >,</span - > - </DustExceptionText> - </el-scrollbar> - </div> - <!-- 缁撴潫 --> - </div></el-col - > - <el-col :span="6" - ><div class="card-content-normal"> - <!-- 鏍囧ご --> - <div class="card-text1"> - <image class="card-header-image"></image> - <span class="card-header-text">鏁版嵁闀挎椂娈垫棤娉㈠姩</span> - </div> - - <div class="card-content-text"> - <el-scrollbar> - <span class="card-exceptionname-text1">寮傚父绔欑偣鍗犳瘮:</span> - <span>{{ exception.exception3.length }} /{{ siteTotal }}</span> - <span> - ({{ - ((exception.exception3.length / siteTotal) * 100).toFixed( - 1 - ) - }}%)</span - > - <div class="card-exceptionname-text2" - >寮傚父鏁板崰姣�:{{(100- - - ((exception.exception0Num / - (exception.exception0Num + - exception.exception1Num + - exception.exception2Num + - exception.exception3Num+ - exception.exception4Num+ - exception.exception5Num+ - exception.exception6Num+ - exception.exception7Num)) * - 100 - ) - - ((exception.exception1Num / - (exception.exception0Num + - exception.exception1Num + - exception.exception2Num + - exception.exception3Num+ - exception.exception4Num+ - exception.exception5Num+ - exception.exception6Num+ - exception.exception7Num)) * - 100 - ) - - ((exception.exception2Num / - (exception.exception0Num + - exception.exception1Num + - exception.exception2Num + - exception.exception3Num+ - exception.exception4Num+ - exception.exception5Num+ - exception.exception6Num+ - exception.exception7Num)) * - 100 - ) - - ((exception.exception4Num / - (exception.exception0Num + - exception.exception1Num + - exception.exception2Num + - exception.exception3Num+ - exception.exception4Num+ - exception.exception5Num+ - exception.exception6Num+ - exception.exception7Num)) * - 100 - )- - ((exception.exception5Num / - (exception.exception0Num + - exception.exception1Num + - exception.exception2Num + - exception.exception3Num+ - exception.exception4Num+ - exception.exception5Num+ - exception.exception6Num+ - exception.exception7Num)) * - 100 - )- - ((exception.exception6Num / - (exception.exception0Num + - exception.exception1Num + - exception.exception2Num + - exception.exception3Num+ - exception.exception4Num+ - exception.exception5Num+ - exception.exception6Num+ - exception.exception7Num)) * - 100 - )- - ((exception.exception7Num / - (exception.exception0Num + - exception.exception1Num + - exception.exception2Num + - exception.exception3Num+ - exception.exception4Num+ - exception.exception5Num+ - exception.exception6Num+ - exception.exception7Num)) * - 100 - ) - - - ).toFixed(1) - }}%</div - > - </el-scrollbar> - </div> - <hr /> - <!-- 寮傚父鐨勫簵閾哄悕瀛� --> - <div class="card-exception-buttom"> - <el-scrollbar max-height="90px"> - <DustExceptionText - :site-name="item.name" - exception-type="3" - :begin-time="beginTime" - :end-time="endTime" - @submit-exception-data="getAbnormalDataByClick" - - v-for="(item, index) in exception.exception3" - :key="item" - >{{ item.name }} - <span - v-if="index < exception.exception3.length - 1" - class="text-blank" - >,</span - > - </DustExceptionText> - </el-scrollbar> - </div> - <!-- 缁撴潫 --> - </div> - </el-col> - </el-row> - - - - </el-card> - </el-col> - </el-row> <el-row> <el-col v-show="!isNoData"> diff --git a/src/views/line_graph/DataRiskModel.vue b/src/views/line_graph/DataRiskModel.vue index 7a76161..ceb7659 100644 --- a/src/views/line_graph/DataRiskModel.vue +++ b/src/views/line_graph/DataRiskModel.vue @@ -4,11 +4,16 @@ import InputSearch from '../../sfc/InputSearch.vue'; import AreaAndmonitorType from '../../sfc/AreaAndmonitorType.vue'; -import DustRadarChart from './components/DustRadarChart.vue'; +// import DustRadarChart from './components/DustRadarChart.vue'; import exceptionApi from '@/api/exceptionApi.js'; import { useWindowSize } from '@vueuse/core'; import LineChart from './components/LineChart.vue' + + +const DustRadarChart = defineAsyncComponent(() => + import('./components/DustRadarChart.vue') +) import dayjs from 'dayjs'; export default { @@ -153,11 +158,13 @@ * @returns锛� */ getDaysDifference(startDate, endDate) { - var start = new Date(startDate); - var end = new Date(endDate); - var timeDiff = Math.abs(end.getTime() - start.getTime()); - var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24)); - return diffDays; + // var start = new Date(startDate); + // var end = new Date(endDate); + // var timeDiff = Math.abs(end.getTime() - start.getTime()); + // var diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24)); + + + return dayjs(endDate).diff(startDate,'day') + 1; }, /** * 浠庡垎鏋愭暟鎹暟缁勪腑鎵惧埌鏈�灏忓拰澶у�� @@ -181,6 +188,7 @@ let begin = dayjs(this.form.beginTime).format('YYYY-MM-DD'); let end = dayjs(this.form.endTime).format('YYYY-MM-DD'); let dayDiff = this.getDaysDifference(begin, end); + console.log('鏃ユ湡闂撮殧',dayDiff); let obj = {}; // 璁$畻鏈�灏忓拰澶у�� arr.forEach((item) => { @@ -202,13 +210,13 @@ online = sumOnline / dayDiff; valid = sumValid / dayDiff; exceeding = sumExceeding / dayDiff; - obj['min'] = min; - obj['max'] = max; + obj['min'] = min.toFixed(3); + obj['max'] = max.toFixed(3); - obj['avg'] = avg.toFixed(3); - obj['online'] = online.toFixed(3); - obj['valid'] = valid.toFixed(3); - obj['exceeding'] = exceeding.toFixed(3); + obj['avg'] = avg.toFixed(2); + obj['online'] = online.toFixed(2); + obj['valid'] = valid.toFixed(2); + obj['exceeding'] = exceeding.toFixed(2); return obj; }, @@ -345,7 +353,9 @@ <div class="search-container"> <el-container> <el-main> + <el-form :inline="true" :model="form"> + <el-form-item> <AreaAndmonitorType></AreaAndmonitorType> </el-form-item> @@ -355,79 +365,108 @@ @submit-value="(n) => (form.name = n)" ></InputSearch> </el-form-item> + <el-form-item> <TimeSelectWithShortCuts @submit-time="giveTime" ></TimeSelectWithShortCuts> </el-form-item> - + + <el-form-item> <el-button type="primary" @click="fetch">灞曠ず鎶樼嚎鍥�</el-button> </el-form-item> + </el-form> - <div>鏁版嵁缁熻鏃舵锛歿{ begin}} ~ {{ end }}</div> + <div class="time-text">鏁版嵁缁熻鏃舵锛歿{ begin}} ~ {{ end }}</div> - <el-row :gutter="20"> - <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12"> - <el-card + <el-card shadow="never" - :style="{ height: `calc(${height}px - 35vh - 250px)` }" > - <DustRadarChart :name="['鏁版嵁鏈夋晥鐜�','鍏稿瀷寮傚父澶嶇幇鐜�','寮傚父绫诲瀷鑱氶泦搴�','鏁版嵁瓒呮爣鐜�','鏁版嵁鍦ㄧ嚎鐜�']" :data="[bill.valid,bill.exceptionRecurrence,bill.exceptionTypeAggregation,bill.exceeding,bill.online]" ></DustRadarChart> - </el-card> + <el-row :gutter="20"> + + <el-col :xs="24" :sm="24" :md="12" :lg="16" :xl="16"> + + <DustRadarChart :name="['鏁版嵁鏈夋晥鐜�','鍏稿瀷寮傚父澶嶇幇鐜�','寮傚父绫诲瀷鑱氶泦搴�','鏁版嵁瓒呮爣鐜�','鏁版嵁鍦ㄧ嚎鐜�']" :yData="[bill.valid,bill.exceptionRecurrence,bill.exceptionTypeAggregation,bill.exceeding,bill.online]" ></DustRadarChart> + </el-col> - <el-col :xs="24" :sm="24" :md="12" :lg="6" :xl="6"> + <el-col :xs="24" :sm="24" :md="6" :lg="4" :xl="4"> <el-card shadow="never" - :style="{ height: `calc(${height}px - 35vh - 250px)` }" > - <template #header>椋庨櫓璇︽儏</template> - <el-space direction="vertical"> - <div>鏈�澶у��:{{ bill.max }} mg/m鲁</div> - <div>鏈�灏忓��:{{ bill.min }} mg/m鲁</div> + <template #header><span class="title-16">椋庨櫓璇︽儏</span></template> + <el-form > + <el-form-item label="鏈�澶у�硷細"> + {{ bill.max }} mg/m鲁 + </el-form-item> + <el-form-item label="鏈�灏忓�硷細"> + {{ bill.min }} mg/m鲁 + </el-form-item> + <el-form-item label="鏁版嵁鏈夋晥鐜囷細"> + {{ bill.online }}% + </el-form-item> + <el-form-item label="鏁版嵁鍦ㄧ嚎鐜囷細"> + {{ bill.valid }}% + </el-form-item> + <el-form-item label="鏁版嵁瓒呮爣鐜囷細"> + {{ bill.exceeding }}% + </el-form-item> + <el-form-item label="寮傚父绫诲瀷鑱氶泦搴︼細"> + {{ bill.exceptionTypeAggregation*100 }}% + </el-form-item> + <el-form-item label="鍏稿瀷寮傚父澶嶇幇鐜囷細" label-width="auto"> + {{ bill.exceptionRecurrence*100 }}% + </el-form-item> + </el-form> + <!-- <div class="date-text">鏈�澶у��:{{ bill.max }} mg/m鲁</div> --> + <!-- <div>鏈�灏忓��:{{ bill.min }} mg/m鲁</div> <div>鍧囧��:{{ bill.avg }} mg/m鲁</div> <div>鏁版嵁鏈夋晥鐜�:{{ bill.online }}%</div> <div>鏁版嵁鍦ㄧ嚎鐜�:{{ bill.valid }}%</div> <div>鏁版嵁瓒呮爣鐜�:{{ bill.exceeding }}%</div> <div>寮傚父绫诲瀷鑱氶泦搴�:{{ bill.exceptionTypeAggregation*100 }}%</div> - <div>鍏稿瀷寮傚父澶嶇幇鐜�:{{ bill.exceptionRecurrence*100 }}%</div> - </el-space> + <div>鍏稿瀷寮傚父澶嶇幇鐜�:{{ bill.exceptionRecurrence*100 }}%</div> --> + </el-card> </el-col> - <el-col :xs="24" :sm="24" :md="12" :lg="6" :xl="6"> + <el-col :xs="24" :sm="24" :md="6" :lg="4" :xl="4"> <el-card shadow="never" - :style="{ height: `calc(${height}px - 35vh - 250px)` }" + > - <template #header>椋庨櫓绛夌骇</template> + <template #header> + <span class="title-16">椋庨櫓绛夌骇</span> + </template> <template #default> - <el-space direction="vertical" :size="15"> + <!-- <el-space direction="vertical" :size="15" > --> <div class="container"> - <div class="block heigh"></div> <div>楂橀闄�(鈮�0.6)</div> + <div class="block-color heigh"></div> <div>楂橀闄�(鈮�0.6)</div> </div> <div class="container"> - <div class="block medium" ></div> <div>涓闄�(0.2~0.6)</div> + <div class="block-color medium" ></div> <div>涓闄�(0.2~0.6)</div> </div> <div class="container"> - <div class="block low"></div><div>浣庨闄�(锛�0.2)</div> + <div class="block-color low"></div><div>浣庨闄�(锛�0.2)</div> </div> - </el-space> + <!-- </el-space> --> </template> </el-card> </el-col> </el-row> + </el-card> + <el-row :gutter="24"> <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6"> <el-card shadow="never" - :style="{ height: `calc(${height}px - 35vh - 250px)` }" + > <template #default> <LineChart @@ -444,7 +483,7 @@ <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6"> <el-card shadow="never" - :style="{ height: `calc(${height}px - 35vh - 250px)` }" + > <template #default> <LineChart @@ -460,7 +499,7 @@ <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6"> <el-card shadow="never" - :style="{ height: `calc(${height}px - 35vh - 250px)` }"> + > <template #default> <LineChart title="鏃ユ湁鏁堢巼" @@ -474,7 +513,7 @@ </el-col> <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="6"> - <el-card shadow="never" :style="{ height: `calc(${height}px - 35vh - 250px)` }"> + <el-card shadow="never" > <template #default> <LineChart title="鏃ヨ秴鏍囩巼" @@ -496,6 +535,9 @@ </template> <style scoped> +.time-text { + letter-spacing: 2px; +} .el-card { margin-top: 15px; border-radius: 9px; @@ -511,12 +553,13 @@ } .container { display: flex; - justify-content: space-between; + margin-bottom: 10px; } -.block { +.block-color { width: 1em; height: 1em; margin-right: 10px; + margin-top: 3px; } .heigh { background-color: red; @@ -531,4 +574,16 @@ .el-text { align-self: left; } +.el-form-item { +margin-bottom: 20px; + +} +:deep().el-form-item__content { + justify-content: flex-end; + +} +.title-16 { + font-size: 16px; + font-weight: bold; +} </style> diff --git a/src/views/line_graph/components/DustRadarChart.vue b/src/views/line_graph/components/DustRadarChart.vue index 732b39d..3541676 100644 --- a/src/views/line_graph/components/DustRadarChart.vue +++ b/src/views/line_graph/components/DustRadarChart.vue @@ -4,17 +4,19 @@ <script> import * as echarts from 'echarts'; export default { - props:{ - name:{ - type:Array, - default:()=>{ - return [] - } - }, - data:{ - type:Array, - default:()=>{ - return [] + props: { + // 灞炴�� + name: { + type: Array, + default: () => { + return []; + } + }, + // 鏁版嵁 + yData: { + type: Array, + default: () => { + return []; } } }, @@ -23,9 +25,9 @@ chart: null }; }, - watch:{ - data(){ - this.set() + watch: { + yData() { + this.set(); } }, mounted() { @@ -35,13 +37,30 @@ initRadarChart() { this.chart = echarts.init(document.getElementById('main')); }, - set(){ + set() { + // this.data[0] = this.data[0]*0.01 let option = { title: { text: '缁煎悎椋庨櫓' }, tooltip: {}, radar: { + // 杞� + // axisLine: { + // show:true, + // lineStyle: { + // color: '#F53F3F' ,// 璁剧疆杈规绾跨殑棰滆壊涓洪粦鑹� + // type:'dashed', + // } + // }, + + // 杈规棰滆壊 + splitLine: { + lineStyle: { + // 浣跨敤娣辨祬鐨勯棿闅旇壊 + color: ['#ddd', '#aaa'] + } + }, // shape: 'circle', indicator: [ { name: this.name[0], max: 1 }, @@ -49,18 +68,42 @@ { name: this.name[2], max: 1 }, { name: this.name[3], max: 1 }, { name: this.name[4], max: 1 } - ] + ], + // splitArea: { + // areaStyle: { + // // color: ['#77EADF', '#26C3BE', '#64AFE9', '#428BD4'], + // shadowColor: 'rgba(0, 0, 0, 0.2)', + // shadowBlur: 10 + // } + // }, + axisName: { + color: '#428BD4' + }, + legend: { + borderColor: '#428BD4' + } }, series: [ { - name: 'Budget vs spending', type: 'radar', data: [ { - value: [this.data[0]*0.01,this.data[1]*0.01, this.data[2]*0.01,this.data[3]*0.01,this.data[4]*0.01], + value: [ + (this.yData[0] / 100).toFixed(4), + this.yData[1], + this.yData[2], + (this.yData[3] / 100).toFixed(4), + (this.yData[4] / 100).toFixed(4) + ], name: '寮傚父鍒嗘瀽' - }, - ] + } + ], + label: { + show: true, + formatter: function (params) { + return params.value; + } + } } ] }; @@ -77,6 +120,6 @@ <style scoped> .chart { width: 100%; - height: 35vh; + height: 500px; } </style> diff --git a/src/views/line_graph/components/LineChart.vue b/src/views/line_graph/components/LineChart.vue index 17021bd..71bf7f5 100644 --- a/src/views/line_graph/components/LineChart.vue +++ b/src/views/line_graph/components/LineChart.vue @@ -129,7 +129,7 @@ <style> .line-chart { width: 100%; - height: 35vh; + height: 300px; margin-top: 25px; } </style> diff --git a/src/views/login/LoginSystem.vue b/src/views/login/LoginSystem.vue index 5ea8052..8b89e3f 100644 --- a/src/views/login/LoginSystem.vue +++ b/src/views/login/LoginSystem.vue @@ -43,7 +43,7 @@ if (this.username === 'admin' && this.password === 'admin123') { ElMessage.success('鐧诲綍鎴愬姛'); // 鐧诲綍鎴愬姛锛岃烦杞埌瀵瑰簲椤甸潰 - this.$router.push('/ndata') // 鍋囪鐧诲綍鎴愬姛鍚庤烦杞埌 '/dashboard' 椤甸潰 + this.$router.push('/edata') // 鍋囪鐧诲綍鎴愬姛鍚庤烦杞埌 '/dashboard' 椤甸潰 } else { // console.log('Login Failed!') ElMessage.error('璐﹀彿鎴栧瘑鐮侀敊璇�'); @@ -79,7 +79,8 @@ position: absolute; right: 10%; width: 20%; - height: 50%; + + height: 500; } .el-form-item { @@ -112,7 +113,7 @@ letter-spacing: 0.3em; text-align: center; box-sizing: border-box; - bottom: 80px; + bottom: 10px; } diff --git a/src/views/origin_data/TableData.vue b/src/views/origin_data/HistoryData.vue similarity index 83% rename from src/views/origin_data/TableData.vue rename to src/views/origin_data/HistoryData.vue index 96aef65..c3205da 100644 --- a/src/views/origin_data/TableData.vue +++ b/src/views/origin_data/HistoryData.vue @@ -5,6 +5,7 @@ import AreaAndmonitorType from '../../sfc/AreaAndmonitorType.vue' import {useCommonFunction} from '../../utils/common.js'; +import requetsApi from '@/api/exportExcel/requetsApi.js' import dayjs from 'dayjs'; @@ -47,8 +48,8 @@ }; }, setup(){ - const {isExceedOneMonth} = useCommonFunction() - return {isExceedOneMonth} + const {isExceedOneMonth,exportToExcel} = useCommonFunction() + return {isExceedOneMonth,exportToExcel} }, mounted() { this.backMinuteDataAWeekAgo(); @@ -56,6 +57,45 @@ }, methods: { + exportDom(){ + + let params ={ + 'beginTime':this.form.beginTime, + 'endTime': this.form.endTime, + } + if (this.form.name) { + params['siteName'] = this.form.name; + } + if (this.form.number) { + params['mnCode'] = this.form.numbe; + } + if (this.scenarioType.length != 0) { + params['scenarioType'] = this.scenarioType; + } + requetsApi.fetchAlSiteData(params).then(res => { + const data = res.data.data + console.log('闀垮害锛�',data.length); + + const tableColumns = [ + 'name', + 'address', + 'dutyCompany', + 'mnCode', + 'typeName', + 'dustValue', + 'noiseValue', + 'lst', + 'quality', + 'groupName', + + ] + const excelColumns = [['A1','绔欑偣鍚嶇О'], + ['B1','鍦板潃'],['C1','渚涘簲鍟�'],['D1','璁惧缂栧彿'], + ['E1','绫诲瀷'],['F1','鎵皹娴撳害(mg/m鲁)'],['G1','鍣0(dB)'], + ['H1','閲囬泦鏃堕棿'],['I1','绛夌骇'],['J1','鎵�鍦ㄥ尯鍘�']] + this.exportToExcel(data,tableColumns,excelColumns,'鍘嗗彶鏁版嵁琛�.xlsx') + }) + }, // 鍔熻兘锛氳〃鏍奸珮搴︽牴鎹唴瀹硅嚜閫傚簲 calTableHeight() { const h1 = this.$refs.h1.$el.offsetHeight; @@ -92,10 +132,10 @@ // 鏌ヨ鏁版嵁 handleSubmit() { - if (this.isExceedOneMonth(this.form.beginTime, this.form.endTime)) { - alert('鏃堕棿璺ㄥ害涓嶈兘瓒呰繃涓�涓湀'); - return; - } + // if (this.isExceedOneMonth(this.form.beginTime, this.form.endTime)) { + // alert('鏃堕棿璺ㄥ害涓嶈兘瓒呰繃涓�涓湀'); + // return; + // } this.loading = true; let params = {}; params['page'] = this.currentPage; @@ -221,12 +261,12 @@ :data="displayData" :height="tableHeight" v-loading="loading" + table-layout="auto" > <!--缁戝畾涓�涓柟娉曪紝灏嗚繑鍥炲�艰祴缁檌ndex,鍗宠〃鏍兼瘡琛屾暟鎹殑涓嬫爣--> <el-table-column type="index" label="搴忓彿" - width="60px" align="center" fixed :index="indexMethod" @@ -244,7 +284,7 @@ show-overflow-tooltip ></el-table-column> <el-table-column - prop="sname" + prop="dutyCompany" label="渚涘簲鍟�" align="center" show-overflow-tooltip @@ -262,8 +302,14 @@ ></el-table-column> <el-table-column prop="dustValue" - label="鎵皹娴撳害" - width="80px" + label="鎵皹娴撳害(mg/m鲁)" + align="center" + sortable + show-overflow-tooltip + ></el-table-column> + <el-table-column + prop="noiseValue" + label="鍣0(dB)" align="center" sortable show-overflow-tooltip @@ -278,7 +324,6 @@ <el-table-column prop="quality" label="绛夌骇" - width="50px" align="center" show-overflow-tooltip ></el-table-column> -- Gitblit v1.9.3