ソースを参照

地图标记 新增/编辑 坐标保留6位, 设备管理分页接口调整

chenxr3 4 年 前
コミット
c09e97af3d

+ 33 - 24
ebc-middle-platform/src/modules/system-management/equipment-management.vue

@ -5,10 +5,11 @@
5 5
        <div>
6 6
          <div class="label">设备类型:</div>
7 7
          <div class="input-rule">
8
            <t-select v-model="queryCondition.equipmentType" style="width: 200px" clearable placeholder="请输入...">
9
              <t-option value="001">风机</t-option>
10
              <t-option value="002">升压站</t-option>
11
              <t-option value="003">船舶</t-option>
8
            <t-select v-model="queryCondition.equipmentType" style="width: 200px" clearable placeholder="请选择...">
9
              <t-option value="001">船舶</t-option>
10
              <t-option value="002">风机</t-option>
11
              <t-option value="003">升压站</t-option>
12
              <t-option value="004">测风塔</t-option>
12 13
            </t-select>
13 14
          </div>
14 15
        </div>
@ -47,13 +48,16 @@
47 48
        <t-table-column prop="FACILITY_TYPE" label="设备类型">
48 49
          <template slot-scope="scope">
49 50
            <div v-if="scope.row.FACILITY_TYPE==1">
50
              <span >风机</span>
51
              <span >船舶</span>
51 52
            </div>
52 53
            <div v-if="scope.row.FACILITY_TYPE==2">
53
              <span>升压站</span>
54
              <span>风机</span>
54 55
            </div>
55 56
            <div v-if="scope.row.FACILITY_TYPE==3">
56
              <span>船舶</span>
57
              <span>升压站</span>
58
            </div>
59
            <div v-if="scope.row.FACILITY_TYPE==4">
60
              <span>测风塔</span>
57 61
            </div>
58 62
          </template>
59 63
        </t-table-column>
@ -147,15 +151,19 @@ export default {
147 151
      typeList: [
148 152
        {
149 153
          value: '001',
150
          label: '风机'
154
          label: '船舶'
151 155
        },
152 156
        {
153 157
          value: '002',
154
          label: '升压站'
158
          label: '风机'
155 159
        },
156 160
        {
157 161
          value: '003',
158
          label: '船舶'
162
          label: '升压站'
163
        },
164
        {
165
          value: '004',
166
          label: '测风塔'
159 167
        }
160 168
      ],
161 169
      table: {
@ -346,24 +354,23 @@ export default {
346 354
    }
347 355
  },
348 356
  mounted() {
349
    this.getList(1, 10, '', '', '')
357
    this.getList()
350 358
  },
351 359
  methods: {
352
    getList(pageNum, pageSize, type, name, number) {
360
    getList() {
353 361
      var params = new FormData()
354 362
      params.append('data', JSON.stringify({
355
        pageNum: pageNum,
356
        pageSize: pageSize,
357
        FACILITY_CODE: number,
358
        FACILITY_TYPE: type,
359
        FACILITY_NAME: name
363
        pageNum: this.table.pager.currentPage,
364
        pageSize: this.table.pager.size,
365
        FACILITY_CODE: this.queryCondition.equipmentNumber,
366
        FACILITY_TYPE: this.queryCondition.equipmentType,
367
        FACILITY_NAME: this.queryCondition.equipmentName
360 368
      }))
361 369
      this.$test.post(services.equipment.GET_EQUIPMENT, params
362 370
      ).then(res => {
363 371
        // 请求成功处理...
364 372
        this.table.data = res.data.result.list
365 373
        this.table.pager.total = res.data.result.total
366
        this.table.pager.currentPage = res.data.result.pageNum
367 374
      }).catch(res => {
368 375
        // 请求失败处理...
369 376
      })
@ -398,7 +405,7 @@ export default {
398 405
      this.onSearch()
399 406
    },
400 407
    onSearch() {
401
      this.getList(1, this.table.pager.size, this.queryCondition.equipmentType, this.queryCondition.equipmentName, this.queryCondition.equipmentNumber)
408
      this.getList()
402 409
    },
403 410
    toExport() {
404 411
@ -429,10 +436,12 @@ export default {
429 436
      })
430 437
    },
431 438
    onPagerChange(page) {
432
      this.getList(page, this.table.pager.size, '', '', '')
439
      this.table.pager.currentPage = page
440
      this.getList()
433 441
    },
434 442
    onSizeChange(number) {
435
      this.getList(1, number, '', '', '')
443
      this.table.pager.size = number
444
      this.getList()
436 445
    },
437 446
    cancel() {
438 447
      this.$refs['formValidate'].resetFields()
@ -444,7 +453,8 @@ export default {
444 453
      this.formValidate.number = ''
445 454
      this.formValidate.lng = ''
446 455
      this.formValidate.lat = ''
447
      this.getList(this.table.pager.currentPage, this.table.pager.size, this.queryCondition.equipmentType, this.queryCondition.equipmentName, this.queryCondition.equipmentNumber)
456
      this.table.pager.currentPage = 1
457
      this.getList()
448 458
    },
449 459
    submit() {
450 460
      this.$refs.formValidate.validate(valid => {
@ -465,7 +475,6 @@ export default {
465 475
            // 请求成功处理...
466 476
            this.$Message.success('提交成功!')
467 477
            this.cancel()
468
            // this.getList(this.table.pager.currentPage, this.table.pager.size, this.queryCondition.equipmentType, this.queryCondition.equipmentName, this.queryCondition.equipmentNumber)
469 478
          }).catch(res => {
470 479
            // 请求失败处理...
471 480
          })
@ -524,7 +533,7 @@ export default {
524 533
          ).then(res => {
525 534
            // 请求成功处理...
526 535
            that.$Message.success('操作成功')
527
            that.getList(that.table.pager.currentPage, that.table.pager.size, that.queryCondition.equipmentType, that.queryCondition.equipmentName, that.queryCondition.equipmentNumber)
536
            that.getList()
528 537
          }).catch(res => {
529 538
            // 请求失败处理...
530 539
          })

+ 11 - 2
ebc-middle-platform/src/modules/system-management/map-mark.vue

@ -75,7 +75,7 @@
75 75
        :total="table.pager.total"
76 76
        :current.sync="table.pager.currentPage"
77 77
        :page-size.sync="table.pager.size"
78
        :sizer-range="[20, 50, 100]"
78
        :sizer-range="[10, 20, 50]"
79 79
        class="px-24 pt-16 float-right"
80 80
        show-elevator
81 81
        show-sizer
@ -158,11 +158,13 @@
158 158
                label="坐标名称"
159 159
              ></t-table-column>
160 160
              <t-table-column
161
                :formatter="lngOrLatFormatter"
161 162
                align="center"
162 163
                prop="lng"
163 164
                label="经度"
164 165
              ></t-table-column>
165 166
              <t-table-column
167
                :formatter="lngOrLatFormatter"
166 168
                align="center"
167 169
                prop="lat"
168 170
                label="纬度"
@ -195,7 +197,7 @@ export default {
195 197
        data: [],
196 198
        pager: {
197 199
          currentPage: 1,
198
          size: 5,
200
          size: 10,
199 201
          total: 0
200 202
        }
201 203
      },
@ -353,6 +355,13 @@ export default {
353 355
      this.modalData = []
354 356
      this.polygonDrawer.enable()
355 357
    },
358
    lngOrLatFormatter(row, column, cellValue, index) {
359
      if (cellValue.toString().split('.')[1].length > 6) {
360
        return cellValue.toFixed(6)
361
      } else {
362
        return cellValue
363
      }
364
    },
356 365
    timestampToTime(cjsj) {
357 366
      var date = new Date(cjsj.CREATE_DATE) // 时间戳为10位需*1000,时间戳为13位的话不需乘1000
358 367
      var Y = date.getFullYear() + '-'