| | |
| | | import riskApi from '@/api/risk/riskApi.js' |
| | | import riskValue from '@/utils/risk_estimate_common_function/riskValue.js' |
| | | import lineChart from '@/utils/chartFunction/lineChart.js' |
| | | import siteInfo from '@/api/site/siteInfo.js' |
| | | export default { |
| | | components: { |
| | | LineChart, |
| | |
| | | // 风险值 |
| | | weight: '', |
| | | // 无数据配置时间段 |
| | | areaColor: [] |
| | | areaColor: [], |
| | | // 某站点的基本信息 |
| | | siteInfo:{} |
| | | } |
| | | }, |
| | | mounted() { |
| | |
| | | |
| | | methods: { |
| | | // 查询站点统计信息 |
| | | querySiteStaticsInfo(row) { |
| | | async querySiteStaticsInfo(row) { |
| | | this.form.name = row.siteName |
| | | // 更新统计数据 |
| | | this.getAnalysisData() |
| | | await this.getAnalysisData() |
| | | // 计算风险值 |
| | | this.calRiskValue() |
| | | }, |
| | |
| | | riskAssessment() { |
| | | // 更新排名清单 |
| | | this.getRiskRank() |
| | | // 更新该站点的所属场景和运维商 |
| | | this.getSiteInfo(this.form.number) |
| | | // 更新分析数据 |
| | | this.getAnalysisData() |
| | | // 计算风险值 |
| | |
| | | this.form.number = arr[1] |
| | | this.screenLoading = false |
| | | |
| | | // 更新该站点的所属场景和运维商 |
| | | this.getSiteInfo(this.form.number) |
| | | // 更新日统计数据 |
| | | this.getAnalysisData() |
| | | // 计算风险值 |
| | | this.calRiskValue() |
| | | |
| | | }, |
| | | |
| | | // 计算风险值 |
| | | calRiskValue() { |
| | | console.log('设备编码:',this.form.number) |
| | | riskApi.queryRiskValue(this.form.number, this.month, 'month').then((response) => { |
| | | this.weight = riskValue.calRiskValue(response.data.data[0]).toFixed(2) |
| | | }) |
| | |
| | | let noDataTimeInteval = lineChart.backNoDataInteval(begin, end) |
| | | // 无数据配置时间段 |
| | | this.areaColor = lineChart.getMarkArea(noDataTimeInteval) |
| | | console.log('区域', this.areaColor) |
| | | this.setChart() |
| | | // 折线图数据 |
| | | let temp = index.calBillData(this.chartData, begin, end) |
| | |
| | | arr.sort((a, b) => b.riskValue - a.riskValue) |
| | | // 获取前num个元素 |
| | | return arr.slice(0, num) |
| | | }, |
| | | /** |
| | | * 根据设备编号查询站点基本信息 |
| | | * @param: 设备编号 |
| | | */ |
| | | getSiteInfo(mnCode) { |
| | | siteInfo.querySiteInfoByMnCode(mnCode).then(response => { |
| | | this.siteInfo = response.data.data[0] |
| | | }) |
| | | }, |
| | | |
| | | openDetail() { |
| | | const encodedSiteName = encodeURIComponent(this.form.name) |
| | | this.$router.push(`/exceptionDetail/${encodedSiteName}/${this.month}`) |
| | | } |
| | | } |
| | | } |
| | |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <!-- <el-card class="site-info time-text" > |
| | | <span>{{form.name}}</span> |
| | | <br/> |
| | | <br/> |
| | | <span>数据统计时段:{{ form.beginTime }} ~ {{ form.endTime }}</span> |
| | | <el-tag class="mx-1" >场景</el-tag>{{siteInfo.typename}} |
| | | |
| | | <el-tag class="mx-1">运维商</el-tag>{{siteInfo.dutyCompany}} |
| | | <el-button type="primary" size="small" class="exception-button" @click="openDetail()"> |
| | | 异常详情 |
| | | </el-button> |
| | | </el-card> --> |
| | | |
| | | <div v-loading="screenLoading" class="wait-name"> |
| | | <div class="chart-container" v-show="!isNoData && !screenLoading"> |
| | | <div class="time-text"> |
| | | <!-- <div class="time-text"> |
| | | <span>数据统计时段:{{ form.beginTime }} ~ {{ form.endTime }}</span> |
| | | <span class="site-name">{{ form.name }}</span> |
| | | </div> |
| | | <span class="site-name"> |
| | | <el-button type="primary" text class="exception-button" @click="openDetail()"> |
| | | 异常详情 |
| | | </el-button> |
| | | |
| | | </span> |
| | | <el-tag class="mx-1" >场景</el-tag>{{siteInfo.typename}} |
| | | <el-tag class="mx-2">运维商</el-tag>{{siteInfo.dutyCompany}} |
| | | </div> --> |
| | | |
| | | <el-card class="time-text" > |
| | | <span>{{form.name}}</span> |
| | | <br/> |
| | | <br/> |
| | | <span>数据统计时段:{{ form.beginTime }} ~ {{ form.endTime }}</span> |
| | | <el-tag class="mx-1" >场景</el-tag>{{siteInfo.typename}} |
| | | |
| | | <el-tag class="mx-1">运维商</el-tag>{{siteInfo.dutyCompany}} |
| | | <el-button type="primary" size="small" class="exception-button" @click="openDetail"> |
| | | 异常详情 |
| | | </el-button> |
| | | </el-card> |
| | | |
| | | <el-row :gutter="10"> |
| | | <el-col :span="5"> |
| | |
| | | :default-sort="{ prop: 'riskValue', order: 'descending' }" |
| | | height="540" |
| | | > |
| | | <!-- :index="indexMethod" --> |
| | | |
| | | <el-table-column |
| | | type="index" |
| | |
| | | /> |
| | | <el-table-column |
| | | prop="siteName" |
| | | label="站点名称" |
| | | label="点位名称" |
| | | show-overflow-tooltip |
| | | width="97" |
| | | align="center" |
| | | > |
| | | <template #default="{ row }"> |
| | |
| | | text |
| | | class="table-button" |
| | | @click="querySiteStaticsInfo(row)" |
| | | >{{ row.siteName }}</el-button |
| | | > |
| | | <span class="risk-rank-site"> |
| | | {{ row.siteName }} |
| | | </span> |
| | | </el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <div>低风险(<0.2)</div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </el-card> |
| | | </el-col> |
| | | |
| | | |
| | | <el-col :span="4"> |
| | | <el-card shadow="never" class="card-height"> |
| | |
| | | font-size: 14px; |
| | | color: #333333; |
| | | letter-spacing: 1px; |
| | | |
| | | } |
| | | .el-card { |
| | | margin-top: 15px; |
| | |
| | | .table-button { |
| | | letter-spacing: 1px; |
| | | text-decoration: underline; |
| | | border-radius: 0px; |
| | | /* border-radius: 0px; */ |
| | | |
| | | } |
| | | .risk-rank-site { |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | width: 80px; |
| | | } |
| | | .site-name { |
| | | margin-left: 20px; |
| | |
| | | flex-direction: column; |
| | | justify-content: space-around; |
| | | } |
| | | |
| | | .el-tag{ |
| | | margin-left: 25px; |
| | | font-size: 14px; |
| | | vertical-align: baseline; |
| | | } |
| | | .exception-button { |
| | | vertical-align: baseline; |
| | | margin-left: 150px; |
| | | } |
| | | |
| | | .site-info-detail{ |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | .mx-1{ |
| | | margin-left: 100px; |
| | | } |
| | | </style> |