zhaobao před 2 roky
rodič
revize
c35993ae4d

+ 2 - 3
README.md

@@ -1,8 +1,7 @@
 ## 采空区
 
 开发文档[曲总本地服务器搭建](http://192.168.3.5:1866)
-大屏设计图地址[作者:黄皖【微信同名】](https://www.figma.com/file/Mdx5rjDsOLZnpEXmZ1MfKA/%E5%9B%9B%E8%89%B2%E9%A3%8E%E9%99%A9%E5%9B%BE?node-id=0-1&t=s4DDH1rHaijXZzjF-0)
-
-### 启动吗命令
+大屏设计图地址[作者:黄皖【微信同名】](https://www.figma.com/file/W40Blmucb76UnCgs3WGOEI/%E5%9B%9B%E8%89%B2%E9%A3%8E%E9%99%A9%E5%9B%BE?type=design&node-id=0-1&t=2juVPU2GZJzr3Hgt-0)
+### 启动命令
 
 #### yarn dev

+ 15 - 6
src/views/goaf/info/components/GoafInfo.vue

@@ -193,11 +193,19 @@ export default {
       const tHeader = Object.values(this.getEnums())
       const filterVal = Object.keys(this.getEnums())
       const list = this.dataList
-      // list.sort((a, b) => {
-      //   if (a['goafOrebelt'] !== b['goafOrebelt']) {
-      //     return a['goafOrebelt'].localeCompare(b['goafOrebelt'])
-      //   }
-      // })
+      list.sort((a, b) => {
+        return a['goafOrebelt'] - b['goafOrebelt']
+      })
+      const merges = []
+      let temp = ''
+      for (let i = 0; i < list.length; i++) {
+        if (list[i].goafOrebelt !== temp) {
+          temp = list[i].goafOrebelt
+          const start = i + 2
+          const end = i + 1 + list.filter(item => item.goafOrebelt === list[i].goafOrebelt).length
+          merges.push(`A${start}:A${end}`)
+        }
+      }
       const data = this.formatJson(filterVal, list)
       if (list.length < 1) {
         this.$message.error('没有数据可供导出!')
@@ -210,7 +218,8 @@ export default {
           data,
           filename: `采空区信息_${parseTime(new Date())}`,
           autoWidth: true,
-          bookType: 'xlsx'
+          bookType: 'xlsx',
+          merges
         })
         this.downloadLoading = false
       })

+ 70 - 11
src/views/goaf/qrcode/components/GoafInfo.vue

@@ -1,15 +1,25 @@
 <template>
   <div class="content-container goaf">
     <el-row class="tool-bar">
-      <el-col :span="12" class="left">
+      <el-col :span="3" class="left">
         <div class="content-title">
           采空区
         </div>
       </el-col>
-      <el-col :span="12" class="right">
-        <el-input v-model="conditions.data.goafName" class="search-input m-right-15" placeholder="请输入采空区名称">
-          <el-button slot="append" icon="el-icon-search" @click="getData()" />
-        </el-input>
+      <el-col :span="21" class="right">
+        <el-select v-model="conditions.goafOrebelt" class="search-input m-right-15" filterable placeholder="矿带" clearable @change="changeArea(1)">
+          <el-option v-for="(item,index) in goafOrebelts" :key="index" :value="item" :label="item" />
+        </el-select>
+        <el-select v-model="conditions.goafOrebody" class="search-input m-right-15" filterable placeholder="矿体" clearable @change="changeArea(2)">
+          <el-option v-for="(item,index) in goafOrebodys" :key="index" :value="item.goafOrebody" :label="item.goafOrebody" />
+        </el-select>
+        <el-select v-model="conditions.goafOreheight" class="search-input m-right-15" filterable placeholder="中段" clearable @change="changeArea(3)">
+          <el-option v-for="(item,index) in goafOreheights" :key="index" :value="item.goafOreheight" :label="item.goafOreheight" />
+        </el-select>
+        <el-select v-model="conditions.goafId" class="search-input m-right-15" filterable placeholder="采空区编号" clearable @change="changeArea(4)">
+          <el-option v-for="item in goafNames" :key="item.goafId" :value="item.goafId" :label="item.goafName" />
+        </el-select>
+        <el-button type="primary" style="margin-right: 10px;" @click="getData">查询</el-button>
         <el-button type="primary" @click="batchDown">批量下载二维码</el-button>
       </el-col>
     </el-row>
@@ -59,7 +69,7 @@ import html2canvas from 'html2canvas'
 import JSZip from 'jszip'
 import saveAs from 'file-saver'
 import QRCode from 'qrcodejs2'
-import { getGoafBaseInfoByPage, delGoaf } from '@/api/goaf/info'
+import { getGoafBaseInfoByPage, delGoaf, getGoafBaseInfo } from '@/api/goaf/info'
 import { Pagination } from '@/components'
 import { NumConvertLM } from '@/utils'
 import { QrCode } from '@/components'
@@ -73,17 +83,28 @@ export default {
       dataList: [],
       total: 0,
       listLoading: false,
+      goafList: [],
+      goafOrebelts: [],
+      goafOrebodys: [],
+      goafOreheights: [],
+      goafNames: [],
       conditions: {
         page: 1,
         limit: 10,
-        data: {
-          goafName: ''
-        }
+        goafId: '',
+        goafOrebelt: '',
+        goafOrebody: '',
+        goafOreheight: ''
       }
     }
   },
   created() {
     this.getData()
+    getGoafBaseInfo().then((res) => {
+      const goafOrebelts = res.data.map(item => item.goafOrebelt)
+      this.goafOrebelts = [...new Set(goafOrebelts)]
+      this.goafList = res.data
+    })
   },
   methods: {
     convertNum(num) {
@@ -91,6 +112,10 @@ export default {
     },
     getData() {
       this.listLoading = true
+      if (this.conditions.goafOrebelt === '') delete this.conditions.goafOrebelt
+      if (this.conditions.goafOrebody === '') delete this.conditions.goafOrebody
+      if (this.conditions.goafOreheight === '') delete this.conditions.goafOreheight
+      if (this.conditions.goafName === '') delete this.conditions.goafName
       getGoafBaseInfoByPage(this.conditions).then((resp) => {
         this.listLoading = false
         const { code, msg, data, total } = resp
@@ -102,7 +127,38 @@ export default {
         }
       })
     },
-
+    changeArea(type) {
+      const goafs = this.deeepClone(this.goafList)
+      let goafOrebodys = this.deeepClone(this.goafOrebodys)
+      let goafOreheights = this.deeepClone(this.goafOreheights)
+      let goafNames = this.deeepClone(this.goafNames)
+      if (type === 1) {
+        goafOrebodys = goafs.filter(item => item.goafOrebelt === this.conditions.goafOrebelt)
+        this.goafOrebodys = goafOrebodys
+        this.goafOreheights = []
+        this.goafNames = []
+        this.conditions.goafOrebody = ''
+        this.conditions.goafOreheight = ''
+        this.conditions.goafName = ''
+      } else if (type === 2) {
+        goafOreheights = goafs.filter(item => (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+        this.goafOreheights = goafOreheights
+        this.goafNames = []
+        this.conditions.goafOreheight = ''
+        this.conditions.goafName = ''
+      } else if (type === 3) {
+        goafNames = goafs.filter(item => (item.goafOreheight === this.conditions.goafOreheight) && (item.goafOrebody === this.conditions.goafOrebody) && (item.goafOrebelt === this.conditions.goafOrebelt))
+        this.goafNames = goafNames
+        this.conditions.goafName = ''
+      } else {
+        for (let i = 0; i < goafNames.length; i++) {
+          if (this.conditions.goafId === goafNames[i].goafId) {
+            this.conditions.goafName = goafNames[i].goafName
+          }
+        }
+      }
+      this.$forceUpdate()
+    },
     showQrcode(row) {
       this.$refs.qrcode.draw(row.goafQrCode)
     },
@@ -202,6 +258,9 @@ export default {
       }).catch(() => {
         this.$message.info('已取消删除')
       })
+    },
+    deeepClone(params) {
+      return JSON.parse(JSON.stringify(params))
     }
   }
 }
@@ -243,7 +302,7 @@ export default {
             }
 
             .search-input {
-                width: 300px;
+                width: 200px !important;
             }
         }