浏览代码

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

chenxr3 4 年之前
父节点
当前提交
c09e97af3d

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

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

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

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