ÎļþÃû´Ó src/views/line_graph/DataRiskModel.vue ÐÞ¸Ä |
| | |
| | | <!-- æ¥åå¼ --> |
| | | <!-- é£é©æ¨¡åçé¡µé¢ |
| | | åºå«ï¼ |
| | | 1.æ¥åç¶ç»ä»¶ä¼ å |
| | | 2.æ åå§å è½½æ°æ®ï¼æ mountedï¼ |
| | | --> |
| | | |
| | | <script> |
| | | import InputSearch from '@/sfc/InputSearch.vue' |
| | | // import InputSearch from '@/sfc/InputSearch.vue' |
| | | import AreaAndmonitorType from '@/sfc/AreaAndmonitorType.vue' |
| | | import DustRadarChart from './components/DustRadarChart.vue' |
| | | import DustRadarChart from '@/views/risk_assessment/components/DustRadarChart.vue' |
| | | import exceptionApi from '@/api/exceptionApi.js' |
| | | import LineChart from './components/LineChart.vue' |
| | | import LineChart from '@/views/risk_assessment/components/LineChart.vue' |
| | | import index from '@/utils/risk_estimate_common_function/index.js' |
| | | import ButtonClick from '@/sfc/ButtonClick.vue' |
| | | import dayjs from 'dayjs' |
| | | import MonthSelect from '@/sfc/MonthSelect.vue' |
| | | export default { |
| | | props: { |
| | | sName: { |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | month_1: { |
| | | type: String, |
| | | default: '' |
| | | } |
| | | }, |
| | | components: { |
| | | LineChart, |
| | | InputSearch, |
| | | // DateSelectWithShortCuts, |
| | | // InputSearch, |
| | | AreaAndmonitorType, |
| | | DustRadarChart, |
| | | ButtonClick, |
| | |
| | | chartData2: {}, |
| | | chartData3: {}, |
| | | chartData4: {}, |
| | | //devId:'', //设å¤ç¼å· |
| | | begin: '', //å¼å§æ¶é´ |
| | | end: '', //ç»ææ¶é´ |
| | | |
| | |
| | | name: '', |
| | | // 设å¤ç¼å· |
| | | number: '', |
| | | |
| | | // month:'', |
| | | // å¼å§æ¶é´ |
| | | beginTime: '', |
| | | // ç»ææ¶é´ |
| | |
| | | // æ´æ°ç«ç¹åååæ¶é´ |
| | | this.form.name = this.sName |
| | | this.month = this.month_1 |
| | | // åæ¶æ´æ°æèµ·å§æ¶é´ |
| | | this.form.beginTime = dayjs(this.month).startOf().format('YYYY-MM-DD HH:mm:ss') |
| | | this.form.endTime = dayjs(this.month).endOf('month').format('YYYY-MM-DD HH:mm:ss') |
| | | |
| | | this.parentDataFlag = true |
| | | // æ´æ°ææ¸
å |
| | | this.getRiskRank() |
| | | |
| | | // æ´æ°ç»è®¡æ°æ® |
| | | this.getAnalysisData() |
| | | // 计ç®é£é©å¼ |
| | |
| | | } |
| | | }, |
| | | |
| | | mounted() { |
| | | // // å è½½é£é©å¼æé«çç«ç¹æ°æ® |
| | | this.ShowDefaultData() |
| | | }, |
| | | mounted() {}, |
| | | |
| | | methods: { |
| | | // æ¥è¯¢ç«ç¹ç»è®¡ä¿¡æ¯ |
| | |
| | | // åæ¶æ´æ°å¼å§åç»ææ¶é´ |
| | | this.form.beginTime = dayjs(this.month).startOf().format('YYYY-MM-DD HH:mm:ss') |
| | | this.form.endTime = dayjs(this.month).endOf('month').format('YYYY-MM-DD HH:mm:ss') |
| | | console.log(this.form.beginTime, this.form.endTime) |
| | | }, |
| | | |
| | | /** |
| | |
| | | |
| | | // å è½½é»è®¤å±ç¤ºçå
容 |
| | | async updateOriginPage() { |
| | | this.screenLoading = true |
| | | // æ´æ°æåæ¸
åï¼å¹¶å¾å°é£é©å¼æé«ç«ç¹ |
| | | this.form.name = await this.getRiskRank() |
| | | this.screenLoading = false |
| | | |
| | | // æ´æ°æ¥ç»è®¡æ°æ® |
| | | this.getAnalysisData() |
| | | // 计ç®é£é©å¼ |
| | |
| | | if (this.form.endTime) { |
| | | params['endTime'] = this.form.endTime |
| | | } |
| | | this.screenLoading = true |
| | | this.loading = true |
| | | this.queryButton = true |
| | | exceptionApi |
| | |
| | | |
| | | // ç§»é¤ç©ºæ°æ®ç¶æ |
| | | this.isNoData = false |
| | | this.screenLoading = false |
| | | this.setChart() |
| | | // æçº¿å¾æ°æ® |
| | | let temp = index.calBillData(this.chartData, this.begin, this.end) |
| | |
| | | y: dataExceed |
| | | } |
| | | } |
| | | }, |
| | | |
| | | // å¾å°å10é£é©æåæ¸
å |
| | | async getRiskRank() { |
| | | let staticsData = await exceptionApi.analysisdataByType(this.month, 'month') |
| | | |
| | | let exceptionData = await exceptionApi.exceptiondata1({ |
| | | siteName: '', |
| | | beginTime: this.form.beginTime, |
| | | endTime: this.form.endTime |
| | | }) |
| | | |
| | | const riskValueSites = index.merge( |
| | | staticsData.data.data, |
| | | exceptionData.data.data, |
| | | this.form.beginTime, |
| | | this.form.endTime |
| | | ) |
| | | this.top_10_sites_with_risk_values = this.getTopRiskData(riskValueSites, 10) |
| | | if (this.top_10_sites_with_risk_values.length != 0) { |
| | | // è¡¨æ ¼æé£é©å¼ååæå |
| | | this.$nextTick(() => { |
| | | this.$refs.table.sort('riskValue', 'descending') |
| | | }) |
| | | // Promise |
| | | return this.top_10_sites_with_risk_values[0].siteName |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * éåºæåï¼è¿åéåºånumçå
ç´ |
| | | * @paramï¼ å¯¹è±¡æ°ç»ï¼è¿åçæ°é |
| | | */ |
| | | getTopRiskData(arr, num) { |
| | | // æç
§riskValueéåºæå |
| | | arr.sort((a, b) => b.riskValue - a.riskValue) |
| | | // è·åånum个å
ç´ |
| | | return arr.slice(0, num) |
| | | } |
| | | } |
| | | } |
| | |
| | | <el-form-item class="form-item"> |
| | | <AreaAndmonitorType></AreaAndmonitorType> |
| | | </el-form-item> |
| | | <el-form-item class="form-item"> |
| | | <InputSearch |
| | | :site-name="form.name" |
| | | isNeedDefaultSite="0" |
| | | @submit-value="(n) => (form.name = n)" |
| | | ></InputSearch> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <MonthSelect :month="this.month_1" @submit-value="giveMonth"></MonthSelect> |
| | | </el-form-item> |
| | | <!-- <el-form-item class="form-item"> |
| | | <InputSearch |
| | | :site-name="form.name" |
| | | isNeedDefaultSite="0" |
| | | @submit-value="(n) => (form.name = n)" |
| | | ></InputSearch> |
| | | </el-form-item> --> |
| | | |
| | | <el-form-item> |
| | | <ButtonClick |
| | | content="é£é©è¯ä¼°" |
| | | type="primary" |
| | | :loading="queryButton" |
| | | @do-search="riskAssessment" |
| | | ></ButtonClick> |
| | | </el-form-item> |
| | | <!-- <el-form-item> |
| | | <MonthSelect :month="this.month_1" @submit-value="giveMonth"></MonthSelect> |
| | | </el-form-item> --> |
| | | |
| | | <!-- <el-form-item> |
| | | <ButtonClick |
| | | content="é£é©è¯ä¼°" |
| | | type="primary" |
| | | :loading="queryButton" |
| | | @do-search="riskAssessment" |
| | | ></ButtonClick> |
| | | </el-form-item> --> |
| | | </el-form> |
| | | |
| | | <div v-loading="screenLoading" class="wait-name"> |
| | |
| | | </div> |
| | | |
| | | <el-row :gutter="10"> |
| | | <el-col :span="5"> |
| | | <el-card shadow="never" class="table-class"> |
| | | <el-table |
| | | ref="table" |
| | | highlight-current-row="true" |
| | | :data="top_10_sites_with_risk_values" |
| | | :default-sort="{ prop: 'riskValue', order: 'descending' }" |
| | | height="540" |
| | | > |
| | | <el-table-column |
| | | type="index" |
| | | label="åºå·" |
| | | :index="indexMethod" |
| | | fixed |
| | | width="52" |
| | | show-overflow-tooltip |
| | | align="center" |
| | | /> |
| | | <el-table-column |
| | | prop="siteName" |
| | | label="ç«ç¹åç§°" |
| | | show-overflow-tooltip |
| | | align="center" |
| | | > |
| | | <template #default="{ row }"> |
| | | <el-button |
| | | type="primary" |
| | | text |
| | | class="table-button" |
| | | @click="querySiteStaticsInfo(row)" |
| | | >{{ row.siteName }}</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="riskValue" |
| | | label="é£é©å¼" |
| | | sortable |
| | | show-overflow-tooltip |
| | | align="center" |
| | | /> |
| | | <!-- <el-table-column label="æä½" align="center"> |
| | | <template #default="{ row }"> |
| | | <el-button |
| | | type="primary" |
| | | text |
| | | class="table-button" |
| | | @click="querySiteStaticsInfo(row)" |
| | | >详æ
</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> --> |
| | | </el-table> |
| | | </el-card> |
| | | </el-col> |
| | | |
| | | <el-col :span="12"> |
| | | <el-card shadow="never" class="table-class"> |
| | | <el-col :span="14"> |
| | | <el-card shadow="never"> |
| | | <DustRadarChart |
| | | :name="[ |
| | | 'æ°æ®ææé£é©', |
| | | 'å
¸åå¼å¸¸å¤ç°é£é©', |
| | | 'å¼å¸¸ç±»åèéé£é©', |
| | | 'è¶
æ å¼å¸¸é£é©', |
| | | 'æ°æ®è¶
æ é£é©', |
| | | 'æ°æ®å¨çº¿é£é©' |
| | | ]" |
| | | :yData="[ |
| | |
| | | </el-card> |
| | | </el-col> |
| | | |
| | | <el-col :span="3"> |
| | | <el-col :span="5"> |
| | | <el-card shadow="never" class="card-height"> |
| | | <template #header> |
| | | <h1 |
| | |
| | | </el-card> |
| | | </el-col> |
| | | |
| | | <el-col :span="4"> |
| | | <el-col :span="5"> |
| | | <el-card shadow="never" class="card-height"> |
| | | <template #header><span class="title-16">é£é©è¯¦æ
</span></template> |
| | | |
| | |
| | | /* padding:0px */ |
| | | } |
| | | .card-height { |
| | | height: 570px; |
| | | height: 540px; |
| | | } |
| | | .el-header { |
| | | background-color: #010408; |
| | |
| | | color: red; |
| | | } |
| | | /* .wait-name { |
| | | width: 500px; |
| | | height: 600px; |
| | | } */ |
| | | width: 500px; |
| | | height: 600px; |
| | | } */ |
| | | .table-class { |
| | | /* border: 1px solid blue; */ |
| | | /* margin: 20px 0px 20px 0px; */ |
| | | height: 570px; |
| | | height: 540px; |
| | | } |
| | | |
| | | .table-button { |