quanyawei
2023-12-20 e27e8bcfe31730a9a35ddf09cf4386509b2608b1
src/views/toCarryOutLegislativeReforms/reform/index.vue
@@ -2,7 +2,7 @@
  <div v-loading="loading" class="main">
    <div>
      <searchBar v-if="searchType" :search-type="'reform'" @handleSearch="handleSearchBut" @handleAdd="handleOpenDialog(null, 'add')" />
      <newWorkOrder v-if="centerDialogVisible" ref="newWorkOrder" :parent-form-data="parentFormData" :title="title" :page-state="pageState" :visible.sync="centerDialogVisible" @handleSubmit="newHandleSubmit" />
      <newWorkOrder v-if="centerDialogVisible" ref="newWorkOrder" :isToMap.sync='isToMap' :parent-form-data="parentFormData" :title="title" :page-state="pageState" :visible.sync="centerDialogVisible" @handleSubmit="newHandleSubmit" />
      <!-- <el-divider></el-divider> -->
      <div class="tab">
        <div class="exportBox">
@@ -229,6 +229,7 @@
        <el-button type="primary" @click="handleEditChange">确 定</el-button>
      </span>
    </el-dialog>
    <mapContainer :visible.sync="isToMap" v-if="isToMap"></mapContainer>
  </div>
</template>
@@ -238,18 +239,21 @@
import _ from 'lodash'
import qs from 'qs'
import searchBar from '@/views/toCarryOutLegislativeReforms/components/queryForm'
import mapContainer from '@/views/toCarryOutLegislativeReforms/components/locationMap'
import newWorkOrder from '@/views/toCarryOutLegislativeReforms/components/newWorkOrder'
import workOrderInformation from '@/views/toCarryOutLegislativeReforms/components/workOrderInformation'
export default {
  components: {
    searchBar,
    newWorkOrder,
    mapContainer,
    workOrderInformation
  },
  // mixins: [mixins],
  data() {
    return {
      loading: false,
      isToMap: false,
      selectionRows: [],
      errorClass: 'errorClass',
      searchType: 'reform',
@@ -295,6 +299,11 @@
      sealList: []
    }
  },
  watch: {
    isToMap(newVal, oldVal) {
      this.isToMap = newVal
    }
  },
  computed: {
    updataEscalationUnitIdFormatter: function () {
      const data = this.unitList.find(
@@ -322,8 +331,23 @@
    this.handleSearch({ isInvalid: 0, state: [9, 20, 30] })
    this.getUnitList()
    this.getContaminateList()
    if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(
        this.successCallback,
        this.errorCallback
      )
    } else {
      alert('该浏览器不支持获取当前位置信息')
    }
  },
  methods: {
    successCallback(position) {
      const latitude = position.coords.latitude // 纬度
      const longitude = position.coords.longitude // 经度
      console.log('经度:' + longitude)
      console.log('纬度:' + latitude)
    },
    errorCallback() {},
    handleSelectionChange(rows) {
      console.log(rows)
      this.selectionRows = rows
@@ -376,6 +400,7 @@
          cancel = c
        }),
        onDownloadProgress(progress) {
          console.log('onDownloadProgress', progress)
          const loaded = progress.loaded
          // progress对象中的loaded表示已经下载的数量,total表示总数量,这里计算出百分比
          let downProgress = Math.round((loaded / totalSize) * 100)
@@ -432,7 +457,12 @@
        link.click()
        // 下载完成进行释放
        url.revokeObjectURL(link.href)
        this.$message.success('下载完成!')
        this.$message({
          showClose: true,
          duration: 0,
          message: '下载完成!',
          type: 'success'
        })
        this.loading = false
      }
    },