zmc
2023-11-02 a61623f7887a78170e5ab91d1fbf7929ce0e82fd
“去掉点击站点时页面上的搜索框和排名清单”
已修改5个文件
136 ■■■■ 文件已修改
src/api/index.js 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/line_graph/SiteComprehensiveRskRanking.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/line_graph/components/subRiskModel.vue 118 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js
@@ -1,12 +1,9 @@
import axios from 'axios';
import { setInterceptors } from './config';
const url = 'http://localhost:8081/';
// const url = 'http://localhost:8081/';
// 部署
// const url = 'http://114.215.109.124:8803/';
const url = 'http://114.215.109.124:8803/';
//飞羽监管
const $http = axios.create({
src/main.js
@@ -34,9 +34,9 @@
// 本地
axios.defaults.baseURL = 'http://localhost:8081'
// axios.defaults.baseURL = 'http://localhost:8081'
// 部署
// axios.defaults.baseURL = 'http://114.215.109.124:8803'
axios.defaults.baseURL = 'http://114.215.109.124:8803'
app.config.globalProperties.$http = axios
app.use(ElMessage)
src/router/index.js
@@ -116,7 +116,7 @@
            {
              path: "/detail/:siteName/:month",
              name: 'detail',
              meta: { title: '站点具体信息' },
              meta: { title: '站点具体信息',transition: 'slide-left' },
              component: () => import('@/views/line_graph/components/SiteDetail.vue')
            },
src/views/line_graph/SiteComprehensiveRskRanking.vue
@@ -195,7 +195,10 @@
      }
    },
    openDetail(row){
      this.$router.push(`/detail/${row.siteName}/${this.form.month}`)
      const encodedSiteName = encodeURIComponent(row.siteName);
      this.$router.push(`/detail/${encodedSiteName}/${this.form.month}`)
      // this.$router.push(`/detail/${row.siteName}/${this.form.month}`)
    }
  }
}
src/views/line_graph/components/subRiskModel.vue
@@ -5,7 +5,7 @@
-->
<script>
  import InputSearch from '@/sfc/InputSearch.vue'
  // import InputSearch from '@/sfc/InputSearch.vue'
  import AreaAndmonitorType from '@/sfc/AreaAndmonitorType.vue'
  import DustRadarChart from '@/views/line_graph/components/DustRadarChart.vue'
  import exceptionApi from '@/api/exceptionApi.js'
@@ -28,7 +28,7 @@
    components: {
      LineChart,
      // DateSelectWithShortCuts,
      InputSearch,
      // InputSearch,
      AreaAndmonitorType,
      DustRadarChart,
      ButtonClick,
@@ -105,8 +105,7 @@
          this.form.endTime = dayjs(this.month).endOf('month').format('YYYY-MM-DD HH:mm:ss')
          this.parentDataFlag = true
          // 更新排清单
          this.getRiskRank()
          // 更新统计数据
          this.getAnalysisData()
          // 计算风险值
@@ -225,6 +224,7 @@
        if (this.form.endTime) {
          params['endTime'] = this.form.endTime
        }
        this.screenLoading= true
        this.loading = true
        this.queryButton = true
        exceptionApi
@@ -242,6 +242,7 @@
  
            // 移除空数据状态
            this.isNoData = false
            this.screenLoading= false
            this.setChart()
            //  折线图数据
            let temp = index.calBillData(this.chartData, this.begin, this.end)
@@ -308,47 +309,6 @@
        }
      },
  
      // 得到前10风险排名清单
      async getRiskRank() {
        this.screenLoading = true
        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')
          })
          this.screenLoading = false
          // Promise
          return this.top_10_sites_with_risk_values[0].siteName
        }
        this.screenLoading = false
      },
      /**
       * 降序排列,返回降序前num的元素
       * @param: 对象数组,返回的数量
       */
      getTopRiskData(arr, num) {
        // 按照riskValue降序排列
        arr.sort((a, b) => b.riskValue - a.riskValue)
        // 获取前num个元素
        return arr.slice(0, num)
      }
    }
  }
  </script>
@@ -358,31 +318,27 @@
      <el-form-item class="form-item">
        <AreaAndmonitorType></AreaAndmonitorType>
      </el-form-item>
      <el-form-item class="form-item">
        <!-- <InputSearch isNeedDefaultSite="1" @submit-value="(n) => (form.name = n)" :siteName="form.name"></InputSearch> -->
      <!-- <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>
          <DateSelectWithShortCuts @submit-time="giveTime"></DateSelectWithShortCuts>
        </el-form-item> -->
  
      <el-form-item>
      <!-- <el-form-item>
        <MonthSelect :month="this.month_1" @submit-value="giveMonth"></MonthSelect>
      </el-form-item>
      </el-form-item> -->
  
      <el-form-item>
      <!-- <el-form-item>
        <ButtonClick
          content="风险评估"
          type="primary"
          :loading="queryButton"
          @do-search="riskAssessment"
        ></ButtonClick>
      </el-form-item>
      </el-form-item> -->
    </el-form>
  
    <div v-loading="screenLoading" class="wait-name">
@@ -393,47 +349,9 @@
        </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="25"
                  show-overflow-tooltip
                />
                <el-table-column prop="siteName" label="站点名称" show-overflow-tooltip />
                <el-table-column
                  prop="riskValue"
                  label="风险值"
                  sortable
                  width="67"
                  show-overflow-tooltip
                />
                <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-col :span="14">
            <el-card shadow="never">
              <DustRadarChart
                :name="[
@@ -454,7 +372,7 @@
            </el-card>
          </el-col>
  
          <el-col :span="3">
          <el-col :span="5">
            <el-card shadow="never" class="card-height">
              <template #header>
                <h1
@@ -497,7 +415,7 @@
            </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>
  
@@ -564,7 +482,9 @@
    margin-left: 10px;
  }
  .time-text {
    letter-spacing: 2px;
    font-size: 14px;
    color: #333333;
    letter-spacing: 1px;
  }
  .el-card {
    margin-top: 15px;
@@ -657,7 +577,7 @@
    border-radius: 0px;
  }
  .site-name {
    margin-left: 120px;
    margin-left: 20px;
  }
  </style>