index.vue 11.4 KB
Newer Older
王晓倩's avatar
王晓倩 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
<template>
  <div class="app-container">
    <div style="width: 100%;height: 10em;">
      <div class="second-div">
        <div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
          <img src="../../../assets/hidden.png" width="40%" style="margin-top: 2rem;">
          <p>隐患数量</p>
        </div>
        <div style="width: 50%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{hiddenObj.hiddenTotal}}</div>
      </div>
      <div class="second-div">
        <div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
          <img src="../../../assets/hidden.png" width="40%" style="margin-top: 2rem;">
          <p>已完成数量</p>
        </div>
        <div style="width: 50%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{hiddenObj.completedTotal}}</div>
      </div>
      <div class="second-div">
        <div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
          <img src="../../../assets/hidden.png" width="40%" style="margin-top: 2rem;">
          <p>未完成数量</p>
        </div>
        <div style="width: 50%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{hiddenObj.incompleteTotal}}</div>
      </div>
      <div class="second-div">
        <div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
          <img src="../../../assets/yh1.png" width="40%" style="margin-top: 2rem;">
          <p>一级隐患</p>
        </div>
        <div style="width: 50%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{hiddenObj.oneLevelTotal}}</div>
      </div>
      <div class="second-div">
        <div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
          <img src="../../../assets/yh2.png" width="40%" style="margin-top: 2rem;">
          <p>二级隐患</p>
        </div>
        <div style="width: 50%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{hiddenObj.twoLevelTotal}}</div>
      </div>
      <div class="second-div">
        <div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
          <img src="../../../assets/yh3.png" width="40%" style="margin-top: 2rem;">
          <p>三级隐患</p>
        </div>
        <div style="width: 50%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{hiddenObj.threeLevelTotal}}</div>
      </div>
    </div>

    <div style="width: 100%; padding: 30px 10px 0px 15px;">
      <el-table v-loading="loading" :data="hiddenList" >
        <el-table-column label="隐患名称" align="center" prop="hiddenTitle" width="200px"/>
        <el-table-column label="隐患等级" align="center" prop="hiddenType">
          <template slot-scope="scope">
            <span v-if="scope.row.hiddenType == '1'">一级隐患</span>
            <span v-if="scope.row.hiddenType == '2'">二级隐患</span>
            <span v-if="scope.row.hiddenType == '3'">三级隐患</span>
          </template>
        </el-table-column>
        <el-table-column label="隐患位置" align="center" prop="hiddenLocation" width="300px"/>
        <el-table-column label="隐患发现人员" align="center" prop="hiddenFindPeople"/>
        <el-table-column label="发现时间" align="center" prop="hiddenFindDate" width="150px"/>
        <el-table-column label="处理方案" align="center" prop="dealPlanUrl" width="150px">
          <template slot-scope="scope">
          <span
            class="dbtn"
            @click="checkFile(scope.row.dealPlanUrl)"
            v-if="scope.row.dealPlan != ''"
          >
            <i class="el-icon el-icon-view"></i>查看/下载
          </span>
            <span v-else>-</span>
          </template>
        </el-table-column>
        <el-table-column label="整治情况" align="center" prop="remediation" width="120px">
          <template slot-scope="scope">
            <span v-if="scope.row.remediation == '1'">已完成</span>
            <span v-if="scope.row.remediation == '2'">未完成</span>
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" width="120px">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="showDetail(scope.row)"
            >详情</el-button>
          </template>
        </el-table-column>
      </el-table>

      <pagination
        v-show="total>0"
        :total="total"
        :page.sync="queryParams.pageNum"
        :limit.sync="queryParams.pageSize"
        @pagination="getList"
      />
      <el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body @cancel="cancel" @close="cancel">
        <el-row>
          <el-col :span="14">
            <el-form ref="detailForm" :model="detailForm" label-width="120px">
              <el-row>
                <el-col :span="10">
                  <el-form-item label="隐患名称:">
王晓倩's avatar
王晓倩 committed
105
                    <el-input v-model="detailForm.hiddenTitle" disabled/>
王晓倩's avatar
王晓倩 committed
106 107
                  </el-form-item>
                  <el-form-item label="隐患发现人员:">
王晓倩's avatar
王晓倩 committed
108
                    <el-input v-model="detailForm.hiddenFindPeople" disabled/>
王晓倩's avatar
王晓倩 committed
109 110
                  </el-form-item>
                  <el-form-item label="发现时间:">
王晓倩's avatar
王晓倩 committed
111
                    <el-input v-model="detailForm.hiddenFindDate" disabled/>
王晓倩's avatar
王晓倩 committed
112 113 114 115
                  </el-form-item>
                </el-col>
                <el-col :span="13">
                  <el-form-item label="隐患等级:">
王晓倩's avatar
王晓倩 committed
116 117 118
                    <el-input v-if="detailForm.hiddenType == '1'" value="一级隐患" disabled/>
                    <el-input v-if="detailForm.hiddenType == '2'" value="二级隐患" disabled/>
                    <el-input v-if="detailForm.hiddenType == '3'" value="三级隐患" disabled/>
王晓倩's avatar
王晓倩 committed
119 120
                  </el-form-item>
                  <el-form-item label="隐患位置:">
王晓倩's avatar
王晓倩 committed
121
                    <el-input v-model="detailForm.hiddenLocation" disabled/>
王晓倩's avatar
王晓倩 committed
122
                  </el-form-item>
王晓倩's avatar
王晓倩 committed
123 124 125 126 127 128 129 130
                  <el-form-item label="整治情况:">
                    <el-input v-if="detailForm.remediation == '1'" value="已完成" disabled/>
                    <el-input v-if="detailForm.remediation == '2'" value="未完成" disabled/>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
                <el-col :span="23">
王晓倩's avatar
王晓倩 committed
131 132 133 134
                  <el-form-item label="处理方案:">
                    <span class="dbtn" @click="checkFile(detailForm.dealPlanUrl)" v-if="detailForm.dealPlan != ''">
                      <i class="el-icon el-icon-view"></i>查看/下载
                    </span>
王晓倩's avatar
王晓倩 committed
135
                    <span v-else><el-input disabled/></span>
王晓倩's avatar
王晓倩 committed
136 137 138 139
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row>
王晓倩's avatar
王晓倩 committed
140 141 142 143 144
                <el-col :span="23">
                  <el-form-item label="隐患内容:">
                    <el-input type="textarea" v-model="detailForm.hiddenContent" disabled/>
                  </el-form-item>
                </el-col>
王晓倩's avatar
王晓倩 committed
145 146
              </el-row>
              <el-row>
王晓倩's avatar
王晓倩 committed
147 148 149 150 151
                <el-col :span="23">
                  <el-form-item label="备注信息:">
                    <el-input type="textarea" v-model="detailForm.remarks" disabled/>
                  </el-form-item>
                </el-col>
王晓倩's avatar
王晓倩 committed
152 153 154 155 156
              </el-row>
            </el-form>
          </el-col>

          <el-col :span="9">
王晓倩's avatar
王晓倩 committed
157
            <div style="width: 100%;height: 390px; border: 1px solid rgb(218, 213, 213);margin-bottom: 10px;">
王晓倩's avatar
王晓倩 committed
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303
              <div style="width: 100%;height: 100%" id="hiddenContainer"></div>
            </div>
          </el-col>
        </el-row>
      </el-dialog>
    </div>
  </div>
</template>

<script>
  import { hiddenStatistic } from "@/api/statistic/statisticAnalysis";
  import { listHidden, getHidden } from "@/api/standingBook/hidden";
  import { EditorMap } from "@/utils/mapClass/getPath.js";

  export default {
    name: "HiddenStatisticAnalysis",
    components: {
    },
    data() {
      return {
        // 统计数据
        hiddenObj: {},
        // 遮罩层
        loading: true,
        // 隐患台账表格数据
        hiddenList: [],
        // 总条数
        total: 0,
        // 地图
        map: null,
        devicePos: [],
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
        },
        // 表单参数
        detailForm: {},
      };
    },
    created() {
    },
    mounted() {
      this.getStatiData();
      this.getList();
    },
    methods: {
      getStatiData() {
        hiddenStatistic().then(response => {
          this.hiddenObj = response.data;
          console.log("this.hiddenObj",this.hiddenObj)
        });
      },
      getList() {
        this.loading = true;
        listHidden(this.queryParams).then(response => {
          this.hiddenList = response.rows;
          this.total = response.total;
          this.loading = false;
        });
      },
      checkFile(url) {
        window.open(url,'_blank');
      },
      reset() {
        this.detailForm = {
          hiddenId: null,
          hiddenTitle: null,
          hiddenContent: null,
          hiddenLocation: null,
          longitude:null,
          latitude: null,
          hiddenType: null,
          hiddenFindPeople: null,
          hiddenFindDate: null,
          dealPlan: null,
          remediation: null,
          createBy: null,
          createTime: null,
          updateBy: null,
          updateTime: null,
          isDel: null,
          remarks: null
        };
        this.resetForm("detailForm");
        this.devicePos = [];
      },
      /** 详细信息跳转 */
      showDetail(row) {
        this.reset();
        getHidden(row.hiddenId).then(response => {
          this.detailForm = response.data;
          this.devicePos = [this.detailForm.longitude, this.detailForm.latitude];
          console.log("this.devicePos",this.devicePos);
          this.open = true;
          this.title = "隐患整治台账详情";

          this.$nextTick(() => {
            this.map = new EditorMap("hiddenContainer", {}, this);
            this.map.addDevice({ path: this.devicePos });
            this.map.nowMouseTarget = null;
            this.map.mousetoolClose(false);
          });
        });
      },
      cancel() {
        this.open = false;
        this.reset();
        this.map.destroy();
      },
    }
  };
</script>
<style>
  .second-div{
    margin-top: 20px;
    width: 15%;
    float: left;
    margin-left: 1.5%;
    height: 9rem;
    color: #515a6e;
    background-color: #FFF;
    border-radius: 5px;
    border: 2px solid rgb(22, 151, 207, 0.3);
    box-shadow:  0 0 8px 8px rgba(131, 229, 255, 0.1)inset, 0 0 7px 7px rgba(22, 151, 207, 0.2);
  }
  .dbtn {
    display: inline-block;
    line-height: normal;
    padding-left: 2px;
    padding-right: 2px;
    cursor: pointer;
    border-radius: 3px;
    border-style: solid;
    border-width: 0;
    color: rgb(48, 180, 107);
  }
  .dbtn:hover {
    border-width: 1px;
    border-color: rgb(48, 180, 107);
  }
</style>