index.vue 22.8 KB
Newer Older
王晓倩's avatar
王晓倩 committed
1 2
<template>
  <div class="app-container">
3
    <el-form :model="queryParams" ref="queryParams" :inline="true" v-show="showSearch" label-width="100px">
王晓倩's avatar
王晓倩 committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
      <!--<el-form-item label="事故名称" prop="troubleName">
        <el-input
          v-model="queryParams.troubleName"
          placeholder="请输入事故名称"
          clearable
          size="small"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>-->
      <el-form-item label="事故类型" prop="troubleType">
        <el-select v-model="queryParams.troubleType" placeholder="请选择事故类型" clearable size="small">
          <el-option
            v-for="dict in troubleTypeOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          ></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="是否处理" prop="isDeal">
24
        <el-select v-model="queryParams.isDeal" placeholder="请选择是否处理" clearable size="small">
王晓倩's avatar
王晓倩 committed
25 26 27 28 29 30 31 32
          <el-option
            v-for="dict in isDealOptions"
            :key="dict.dictValue"
            :label="dict.dictLabel"
            :value="dict.dictValue"
          ></el-option>
        </el-select>
      </el-form-item>
33
      <el-form-item label="事故发生时间" prop="happenDate">
王晓倩's avatar
王晓倩 committed
34
        <el-date-picker clearable size="small"
35
                        v-model="queryParams.happenDateStart"
王晓倩's avatar
王晓倩 committed
36 37 38 39 40
                        type="datetime"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        placeholder="请选择起始时间">
        </el-date-picker><span style="color: #bebfc3"> - </span>
        <el-date-picker clearable size="small"
41
                        v-model="queryParams.happenDateEnd"
王晓倩's avatar
王晓倩 committed
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
                        type="datetime"
                        value-format="yyyy-MM-dd HH:mm:ss"
                        placeholder="请选择截止时间">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
		  :loading="exportLoading"
          @click="handleExport"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="troubleList" >
77
      <el-table-column label="事故名称" align="center" prop="troubleName" width="200px"/>
78
      <el-table-column label="事故类型" align="center" prop="troubleType">
王晓倩's avatar
王晓倩 committed
79 80 81 82 83
        <template slot-scope="scope">
          <span v-if="scope.row.troubleType == 1">生产安全事故</span>
          <span v-if="scope.row.troubleType == 2">非生产安全事故</span>
        </template>
      </el-table-column>
84
      <el-table-column label="事故地点" align="center" prop="troubleLocation" width="300px"/>
85
      <el-table-column label="事故发生时间" align="center" prop="happenDate" width="150px"/>
86 87 88 89 90 91 92
      <el-table-column label="是否人员伤亡" align="center" prop="isCasualties" width="150px">
        <template slot-scope="scope">
          <span v-if="scope.row.isCasualties == 1"></span>
          <span v-if="scope.row.isCasualties == 2"></span>
        </template>
      </el-table-column>
      <el-table-column label="责任单位" align="center" prop="responsibleUnit" width="150px"/>
93 94
      <el-table-column label="责任人员" align="center" prop="responsiblePeople"/>
      <el-table-column label="是否处理" align="center" prop="isDeal">
王晓倩's avatar
王晓倩 committed
95 96 97 98 99
        <template slot-scope="scope">
          <span v-if="scope.row.isDeal == 1">已处理</span>
          <span v-if="scope.row.isDeal == 2">未处理</span>
        </template>
      </el-table-column>
100
<!--      <el-table-column label="处理完成时间" align="center" prop="dealDate" width="180px"/>-->
101
      <el-table-column label="操作" align="center" width="180px">
王晓倩's avatar
王晓倩 committed
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="showDetail(scope.row)"
          >详情</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(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"
    />

    <!-- 添加或修改事故台账对话框 -->
134
    <el-dialog :title="title1" :visible.sync="open1" width="800px" append-to-body @cancel="cancel1">
王晓倩's avatar
王晓倩 committed
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-row>
          <el-col :span="11">
            <el-form-item label="事故名称" prop="troubleName">
              <el-input v-model="form.troubleName" placeholder="请输入事故名称" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="事故类型" prop="troubleType">
              <el-select v-model="form.troubleType" placeholder="请选择事故类型" style="width: 100%">
                <el-option label="生产安全事故" value="1" />
                <el-option label="非生产安全事故" value="2" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="23">
            <el-form-item label="事故地点" prop="troubleLocation">
              <el-input v-model="form.troubleLocation" placeholder="请输入事故地点" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="23">
            <el-form-item label="经纬度坐标" prop="longitude">
161 162 163 164 165 166 167 168 169
              <el-col :span="9">
                <el-input v-model="form.longitude" placeholder="请输入经度" />
              </el-col>
              <el-col :span="9" style="margin-left: 10px">
                <el-input v-model="form.latitude" placeholder="请输入纬度"/>
              </el-col>
              <el-col :span="3" style="margin-left: 30px">
                <el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
              </el-col>
王晓倩's avatar
王晓倩 committed
170 171 172 173
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
174
          <el-col :span="11">
王晓倩's avatar
王晓倩 committed
175
            <el-form-item label="事故原因" prop="troubleReason">
176
              <el-input v-model="form.troubleReason" placeholder="请输入事故原因" />
王晓倩's avatar
王晓倩 committed
177 178
            </el-form-item>
          </el-col>
179 180 181 182 183 184
          <el-col :span="12">
            <el-form-item label="事故发生时间" prop="happenDate">
              <el-date-picker clearable size="small"
                              v-model="form.happenDate"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
185
                              placeholder="选择事故发生时间"
186 187 188 189
                              style="width: 100%">
              </el-date-picker>
            </el-form-item>
          </el-col>
王晓倩's avatar
王晓倩 committed
190 191 192 193 194 195 196 197
        </el-row>
        <el-row>
          <el-col :span="23">
            <el-form-item label="简要经过" prop="briefProcess">
              <el-input type="textarea" v-model="form.briefProcess" placeholder="请输入简要经过" />
            </el-form-item>
          </el-col>
        </el-row>
198
        <el-row>
199
          <el-col :span="11">
200
            <el-form-item label="是否人员伤亡" prop="isCasualties">
201
              <el-select v-model="form.isCasualties" placeholder="请选择是否人员伤亡" style="width: 100%">
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
                <el-option label="是" value="1" />
                <el-option label="否" value="2" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row v-if="form.isCasualties == '1'">
          <el-col :span="11">
            <el-form-item label="受伤人数" prop="injuryNum">
              <el-input v-model.number="form.injuryNum" placeholder="请输入受伤人数" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="死亡人数" prop="deathNum">
              <el-input v-model.number="form.deathNum" placeholder="请输入死亡人数" />
            </el-form-item>
          </el-col>
        </el-row>
王晓倩's avatar
王晓倩 committed
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
        <el-row>
          <el-col :span="11">
            <el-form-item label="责任单位" prop="responsibleUnit">
              <el-input v-model="form.responsibleUnit" placeholder="请输入责任单位" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="责任人员" prop="responsiblePeople">
              <el-input v-model="form.responsiblePeople" placeholder="请输入责任人员" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="11">
            <el-form-item label="是否处理" prop="isDeal">
235 236 237 238 239 240 241
              <el-select v-model="form.isDeal" placeholder="请选择处理结果" filterable style="width: 100%" >
                <el-option
                  v-for="dict in isDealOptions"
                  :key="dict.dictValue"
                  :label="dict.dictLabel"
                  :value="dict.dictValue"
                ></el-option>
王晓倩's avatar
王晓倩 committed
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="处理完成时间" prop="dealDate">
              <el-date-picker clearable size="small"
                              v-model="form.dealDate"
                              type="datetime"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="选择处理完成时间"
                              style="width: 100%">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="23">
            <el-form-item label="备注信息" prop="remarks">
              <el-input type="textarea" v-model="form.remarks" placeholder="请输入备注信息" />
            </el-form-item>
          </el-col>
        </el-row>
264 265 266 267 268 269 270
      </el-form>

      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel1">取 消</el-button>
      </div>
    </el-dialog>
271

272 273 274 275 276
    <el-dialog :title="title2" :visible.sync="open2" width="1200px" append-to-body @cancel="cancel2" @close="cancel2">
      <el-row>
        <el-col :span="14">
          <el-form ref="detailForm" :model="detailForm" label-width="120px">
            <el-row>
277
              <el-col :span="11">
278
                <el-form-item label="事故名称:">
279
                  <el-input v-model="detailForm.troubleName" disabled/>
280 281
                </el-form-item>
                <el-form-item label="事故原因:">
282
                  <el-input v-model="detailForm.troubleReason" disabled/>
283 284
                </el-form-item>
                <el-form-item label="责任单位:">
285
                  <el-input v-model="detailForm.responsibleUnit" disabled/>
286
                </el-form-item>
287
                <el-form-item label="是否人员伤亡:">
288 289
                  <el-input v-if="detailForm.isCasualties == '1'" value="是" disabled/>
                  <el-input v-if="detailForm.isCasualties == '2'" value="是" disabled/>
290
                </el-form-item>
291
              </el-col>
292
              <el-col :span="12">
293
                <el-form-item label="事故类型:">
294 295
                  <el-input v-if="detailForm.troubleType == '1'" value="安全生产事故" disabled/>
                  <el-input v-if="detailForm.troubleType == '2'" value="非生产安全事故" disabled/>
296 297
                </el-form-item>
                <el-form-item label="事故地点:">
298
                  <el-input v-model="detailForm.troubleLocation" disabled/>
299 300
                </el-form-item>
                <el-form-item label="责任人员:">
301
                  <el-input v-model="detailForm.responsiblePeople" disabled/>
302 303
                </el-form-item>
                <el-form-item label="是否处理:">
304 305
                  <el-input v-if="detailForm.isDeal == '1'" value="已处理" disabled/>
                  <el-input v-if="detailForm.isDeal == '2'" value="未处理" disabled/>
306 307
                </el-form-item>
              </el-col>
308 309 310 311
            </el-row>
            <el-row v-if="detailForm.isCasualties == '1'">
              <el-col :span="11">
                <el-form-item label="受伤人数:">
312
                  <el-input v-model="detailForm.injuryNum" disabled/>
313 314
                </el-form-item>
              </el-col>
315
              <el-col :span="12">
316
                <el-form-item label="死亡人数:">
317
                  <el-input v-model="detailForm.deathNum" disabled/>
318 319 320
                </el-form-item>
              </el-col>
            </el-row>
321
            <el-row>
322 323 324 325 326
              <el-col :span="23">
                <el-form-item label="处理完成时间:">
                  <el-input v-model="detailForm.dealDate" disabled/>
                </el-form-item>
              </el-col>
327 328
            </el-row>
            <el-row>
329 330 331 332 333
              <el-col :span="23">
                <el-form-item label="简要经过:">
                  <el-input type="textarea" v-model="detailForm.briefProcess" disabled/>
                </el-form-item>
              </el-col>
334
            </el-row>
335
            <el-row>
336 337 338 339 340
              <el-col :span="23">
                <el-form-item label="备注信息:">
                  <el-input type="textarea" v-model="detailForm.remarks" disabled/>
                </el-form-item>
              </el-col>
341 342 343 344 345
            </el-row>
          </el-form>
        </el-col>

        <el-col :span="9">
346
          <div style="width: 100%;height: 390px; border: 1px solid rgb(218, 213, 213);margin-bottom: 10px;">
347
            <div style="width: 100%;height: 100%" id="troubleContainer"></div>
348 349 350
          </div>
        </el-col>
      </el-row>
王晓倩's avatar
王晓倩 committed
351 352
    </el-dialog>

353 354 355 356 357 358 359
    <GetPos
      :dialogVisible.sync="dialogTableVisible"
      device=""
      :devicePos="devicePos"
      @close="dialogcancelFun"
      @getPath="getPath"
    />
王晓倩's avatar
王晓倩 committed
360 361 362 363 364 365

  </div>
</template>

<script>
import { listTrouble, getTrouble, delTrouble, addTrouble, updateTrouble, exportTrouble } from "@/api/standingBook/trouble";
366
import GetPos from '@/components/GetPos';
367
import { EditorMap } from "@/utils/mapClass/getPath.js";
王晓倩's avatar
王晓倩 committed
368 369 370 371

export default {
  name: "Trouble",
  components: {
372
    GetPos
王晓倩's avatar
王晓倩 committed
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396
  },
  data() {
    return {
      // 遮罩层
      loading: true,
      // 导出遮罩层
      exportLoading: false,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 事故台账表格数据
      troubleList: [],
      // 数据字典类型
      troubleTypeOptions: [],
      isDealOptions: [],
      // 地图
      dialogTableVisible: false,
397
      devicePos: [],
398
      map: null,
王晓倩's avatar
王晓倩 committed
399
      // 弹出层标题
400 401
      title1: "",
      title2: "",
王晓倩's avatar
王晓倩 committed
402
      // 是否显示弹出层
403 404
      open1: false,
      open2: false,
王晓倩's avatar
王晓倩 committed
405 406 407 408 409 410 411
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        troubleName: null,
        troubleType: null,
        isDeal: null,
412 413
        happenDateStart: null,
        happenDateEnd: null,
王晓倩's avatar
王晓倩 committed
414 415 416 417 418
        dealDateStart: null,
        dealDateEnd: null
      },
      // 表单参数
      form: {},
419
      detailForm: {},
王晓倩's avatar
王晓倩 committed
420 421 422 423 424 425 426 427 428 429 430 431
      // 表单校验
      rules: {
        troubleName: [
          { required: true, message: "请输入事故名称", trigger: "blur" },
        ],
        troubleType: [
          { required: true, message: "请输入事故类型", trigger: "blur" },
        ],
        troubleLocation: [
          { required: true, message: "请输入事故地点", trigger: "blur" },
        ],
        longitude: [
432
          { required: true, message: "请输入经纬度", trigger: "blur" },
王晓倩's avatar
王晓倩 committed
433
        ],
434
        happenDate: [
435
          { required: true, message: "请选择事故发生时间", trigger: "blur" },
436
        ],
437 438 439
        troubleReason: [
          { required: true, message: "请输入事故原因", trigger: "blur" },
        ],
440 441 442
        isCasualties: [
          { required: true, message: "请选择是否人员伤亡", trigger: "change" },
        ],
王晓倩's avatar
王晓倩 committed
443 444 445 446 447 448
        responsibleUnit: [
          { required: true, message: "请输入责任单位", trigger: "blur" },
        ],
        responsiblePeople: [
          { required: true, message: "请输入责任人员", trigger: "blur" },
        ],
449 450 451
        isDeal: [
          { required: true, message: "请选择是否已处理", trigger: "change" },
        ],
王晓倩's avatar
王晓倩 committed
452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474
      }
    };
  },
  created() {
    this.getList();
    this.getDicts("t_trouble_type").then(response => {
      this.troubleTypeOptions = response.data;
    });
    this.getDicts("t_is_deal").then(response => {
      this.isDealOptions = response.data;
    });
  },
  methods: {
    /** 查询事故台账列表 */
    getList() {
      this.loading = true;
      listTrouble(this.queryParams).then(response => {
        this.troubleList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
475 476 477
    cancel1() {
      this.open1 = false;
      this.reset1();
王晓倩's avatar
王晓倩 committed
478
    },
479 480 481
    cancel2() {
      this.open2 = false;
      this.reset2();
482
      this.map.destroy();
483
    },
王晓倩's avatar
王晓倩 committed
484
    // 表单重置
485
    reset1() {
王晓倩's avatar
王晓倩 committed
486 487 488 489
      this.form = {
        troubleId: null,
        troubleName: null,
        troubleLocation: null,
490
        longitude: null,
491
        latitude: null,
王晓倩's avatar
王晓倩 committed
492 493 494
        troubleType: null,
        briefProcess: null,
        troubleReason: null,
495 496 497
        isCasualties: null,
        injuryNum: null,
        deathNum: null,
王晓倩's avatar
王晓倩 committed
498 499 500
        responsibleUnit: null,
        responsiblePeople: null,
        isDeal: null,
501
        happenDate: null,
王晓倩's avatar
王晓倩 committed
502 503 504 505 506 507 508 509 510
        dealDate: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        isDel: null,
        remarks: null
      };
      this.resetForm("form");
王晓倩's avatar
王晓倩 committed
511
      this.devicePos = [];
王晓倩's avatar
王晓倩 committed
512
    },
513 514 515 516 517 518 519 520 521 522
    reset2() {
      this.detailForm = {
        troubleId: null,
        troubleName: null,
        troubleLocation: null,
        longitude: null,
        latitude: null,
        troubleType: null,
        briefProcess: null,
        troubleReason: null,
523 524 525
        isCasualties: null,
        injuryNum: null,
        deathNum: null,
526 527 528 529 530 531 532 533 534 535 536 537 538
        responsibleUnit: null,
        responsiblePeople: null,
        isDeal: null,
        happenDate: null,
        dealDate: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        isDel: null,
        remarks: null
      };
      this.resetForm("detailForm");
539
      this.devicePos = [];
540
    },
王晓倩's avatar
王晓倩 committed
541 542 543 544 545 546 547
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
548 549 550 551 552 553 554 555 556 557 558 559
      this.queryParams = {
        pageNum: 1,
        pageSize: 10,
        troubleName: null,
        troubleType: null,
        isDeal: null,
        happenDateStart: null,
        happenDateEnd: null,
        dealDateStart: null,
        dealDateEnd: null
      },
      this.resetForm("queryParams");
王晓倩's avatar
王晓倩 committed
560 561 562 563
      this.handleQuery();
    },
    /** 新增按钮操作 */
    handleAdd() {
564 565 566
      this.reset1();
      this.open1 = true;
      this.title1 = "添加燃气事故台账";
王晓倩's avatar
王晓倩 committed
567 568 569
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
570
      this.reset1();
571
      getTrouble(row.troubleId).then(response => {
王晓倩's avatar
王晓倩 committed
572
        this.form = response.data;
573
        this.devicePos = [this.form.longitude, this.form.latitude];
574 575
        this.open1 = true;
        this.title1 = "修改燃气事故台账";
王晓倩's avatar
王晓倩 committed
576 577 578 579 580 581 582 583 584
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.troubleId != null) {
            updateTrouble(this.form).then(response => {
              this.msgSuccess("修改成功");
585
              this.open1 = false;
王晓倩's avatar
王晓倩 committed
586 587 588 589 590
              this.getList();
            });
          } else {
            addTrouble(this.form).then(response => {
              this.msgSuccess("新增成功");
591
              this.open1 = false;
王晓倩's avatar
王晓倩 committed
592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      // const troubleIds = row.troubleId || this.ids;
      row.isDel = "1";
      this.$confirm('是否确认删除"' + row.troubleName + '"的台账?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function() {
          return updateTrouble(row);
        }).then(() => {
          this.getList();
          this.msgSuccess("删除成功");
        }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      const queryParams = this.queryParams;
      this.$confirm('是否确认导出所有事故台账数据项?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(() => {
          this.exportLoading = true;
          return exportTrouble(queryParams);
        }).then(response => {
          this.download(response.msg);
          this.exportLoading = false;
        }).catch(() => {});
    },
    /** 详细信息跳转 */
    showDetail(row) {
630
      this.reset2();
631
      getTrouble(row.troubleId).then(response => {
632
        this.detailForm = response.data;
633 634
        this.devicePos = [this.detailForm.longitude, this.detailForm.latitude];
        console.log("this.devicePos",this.devicePos);
635 636
        this.open2 = true;
        this.title2 = "燃气事故台账详情";
637 638

        this.$nextTick(() => {
639
          this.map = new EditorMap("troubleContainer", {}, this);
640 641 642 643
          this.map.addDevice({ path: this.devicePos });
          this.map.nowMouseTarget = null;
          this.map.mousetoolClose(false);
        });
644
      });
王晓倩's avatar
王晓倩 committed
645 646 647 648 649 650 651
    },
    MapdialogFun() {
      this.dialogTableVisible = true;
    },
    dialogcancelFun() {
      this.dialogTableVisible = false;
    },
652
    getPath(res){
王晓倩's avatar
王晓倩 committed
653 654
      console.log("res", res);
      console.log(this.form.longitude, this.form.latitude);
655 656 657 658
      //确认选择经纬度
      this.form.longitude = res[0];
      this.form.latitude = res[1];
    }
王晓倩's avatar
王晓倩 committed
659 660 661
  }
};
</script>