|
@@ -11,12 +11,11 @@
|
|
|
<el-button slot="append" icon="el-icon-search" @click="getData()" />
|
|
|
</el-input>
|
|
|
<el-button type="primary" @click="handleAdd">新增</el-button>
|
|
|
- <el-button type="primary" @click="batchDown">批量下载二维码</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-row class="m-top-15">
|
|
|
- <el-table v-loading="listLoading" class="page-table" border fit :data="dataList" :span-method="arraySpanMethod">
|
|
|
+ <el-table v-loading="listLoading" class="page-table" border fit :data="dataList">
|
|
|
<!-- <el-table-column type="index" label="序号" header-align="center" align="center" width="60" /> -->
|
|
|
<el-table-column prop="goafOrebelt" label="矿带">
|
|
|
<template v-slot="{row}">
|
|
@@ -25,17 +24,23 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="goafOrebody" label="矿体" />
|
|
|
<el-table-column prop="goafOreheight" label="中段" />
|
|
|
- <el-table-column prop="goafName" label="采空区名称" />
|
|
|
- <el-table-column prop="positionName" label="二维码" header-align="center" align="center" width="70">
|
|
|
+ <el-table-column prop="goafName" label="采空区名称" show-overflow-tooltip />
|
|
|
+ <el-table-column prop="goafRoofpillarThickness" label="顶板矿柱厚度" width="" />
|
|
|
+ <el-table-column prop="goafIncoavThickness" label=" 保安间柱平均厚度" width="150" />
|
|
|
+ <el-table-column prop="goafRockLithology" label="围岩岩性" />
|
|
|
+ <el-table-column prop="goafRockStability" label="围岩稳定性" />
|
|
|
+ <el-table-column prop="goafCanfillVolume" label="可充填体积(m³)" width="150" />
|
|
|
+ <el-table-column prop="goafRemainVolume" label="剩余可充填体积(m³)" width="180" />
|
|
|
+ <el-table-column prop="goafIsFill" label="是否充填" width="80">
|
|
|
<template v-slot="{row}">
|
|
|
- <span class="icon iconfont icon-erweima" @click="showQrcode(row)" />
|
|
|
+ <span>{{ row.goafFillMethod==0?'是':'否' }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="goafAvexArea" label="水平断面均暴露面积" />
|
|
|
+ <!-- <el-table-column prop="goafAvexArea" label="水平断面均暴露面积" />
|
|
|
<el-table-column prop="goafAvinWidth" label="平均倾向宽度" />
|
|
|
<el-table-column prop="goafAvexHeight" label="平均暴露高度">
|
|
|
<template v-slot="{row}">
|
|
|
- <span>{{ row.goafAvexHeight==0?'已填充”':row.goafAvexHeight }}</span>
|
|
|
+ <span>{{ row.goafAvexHeight==0?'已填充':row.goafAvexHeight }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="goafVoidVolume" label="体积">
|
|
@@ -45,27 +50,16 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="goafKeyTrend" label="倾向" />
|
|
|
<el-table-column prop="goafKeyDipangle" label="倾角(度)" />
|
|
|
- <el-table-column prop="goafRoofpillarThickness" label="顶板矿柱厚度" />
|
|
|
- <el-table-column prop="goafIncoavThickness" label=" 保安间柱平均厚度" />
|
|
|
- <el-table-column prop="goafExpLocation" label="勘探位置" />
|
|
|
- <el-table-column prop="goafRockLithology" label="围岩岩性" />
|
|
|
- <el-table-column prop="goafRockStability" label="围岩稳定性" />
|
|
|
+ <el-table-column prop="goafExpLocation" label="勘探位置" />
|
|
|
<el-table-column prop="goafFormationTime" label="形成时间" width="150" />
|
|
|
- <!-- <el-table-column prop="goafCanfillVolume" label="可充填体积(m³)" />
|
|
|
- <el-table-column prop="goafRemainVolume" label="剩余可充填体积(m³)" /> -->
|
|
|
<el-table-column prop="goafFillMethod" label="充填方式">
|
|
|
<template v-slot="{row}">
|
|
|
<span>{{ row.goafFillMethod==0?'废石':'尾矿' }}</span>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="goafIsFill" label="是否充填">
|
|
|
- <template v-slot="{row}">
|
|
|
- <span>{{ row.goafFillMethod==0?'是':'否' }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <!-- <el-table-column prop="goafInfoRemak" label="备注" /> -->
|
|
|
- <el-table-column label="操作" header-align="center" align="center" width="170">
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column label="操作" header-align="center" align="center" width="240">
|
|
|
<template v-slot="{row}">
|
|
|
+ <el-button type="primary" @click="showDetail(row)">详情</el-button>
|
|
|
<el-button size="mini" type="primary" icon="el-icon-edit" @click="handleUpdate(row)">修改</el-button>
|
|
|
<el-button size="mini" type="danger" icon="el-icon-edit" @click="handleDelete(row)">删除</el-button>
|
|
|
</template>
|
|
@@ -76,24 +70,18 @@
|
|
|
</div>
|
|
|
</el-row>
|
|
|
<goaf ref="goaf" @formSuccess="getData" />
|
|
|
- <QrCode ref="qrcode" />
|
|
|
- <div id="qrcode" ref="qrcodeModal" style="position:fixed;top:-9999px;" />
|
|
|
+ <detail ref="detail" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-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 { Pagination } from '@/components'
|
|
|
import Goaf from './Goaf'
|
|
|
+import Detail from './detail'
|
|
|
import { NumConvertLM } from '@/utils'
|
|
|
-import { QrCode } from '@/components'
|
|
|
-var zip = new JSZip()
|
|
|
export default {
|
|
|
- components: { Pagination, Goaf, QrCode },
|
|
|
+ components: { Pagination, Goaf, Detail },
|
|
|
data() {
|
|
|
return {
|
|
|
dataList: [],
|
|
@@ -109,55 +97,12 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
- const items = []
|
|
|
- const item = { 'goafId': 170,
|
|
|
- 'ocId': 832,
|
|
|
- 'goafOrebelt': 3,
|
|
|
- 'goafOrebody': 289,
|
|
|
- 'goafOreheight': 957,
|
|
|
- 'goafName': 'rocky.bechtelar',
|
|
|
- 'goafAvexArea': 568,
|
|
|
- 'goafAvinWidth': 592,
|
|
|
- 'goafAvexHeight': 609,
|
|
|
- 'goafVoidVolume': 742,
|
|
|
- 'goafKeyTrend': 172,
|
|
|
- 'goafKeyDipangle': 14,
|
|
|
- 'goafRoofpillarThickness': 719,
|
|
|
- 'goafIncoavThickness': 694,
|
|
|
- 'goafExpLocation': 'zdt5j3',
|
|
|
- 'goafRockLithology': '56emgx',
|
|
|
- 'goafRockStability': 'j7n0vf',
|
|
|
- 'goafFormationTime': '2023-04-17 12:29:24',
|
|
|
- 'goafCanfillVolume': 348,
|
|
|
- 'goafRemainVolume': 732,
|
|
|
- 'goafFillMethod': 142,
|
|
|
- 'goafIsFill': 703,
|
|
|
- 'goafInfoRemak': 'opiuk0',
|
|
|
- 'goafQrCode': '二维码地址-goafQrCode'
|
|
|
- }
|
|
|
- for (let i = 0; i < 10; i++) {
|
|
|
- items.push(item)
|
|
|
- }
|
|
|
- this.dataList = items
|
|
|
- this.total = 20
|
|
|
+ this.getData()
|
|
|
},
|
|
|
methods: {
|
|
|
convertNum(num) {
|
|
|
return num ? NumConvertLM(num) : '--'
|
|
|
},
|
|
|
- arraySpanMethod({ rowIndex, columnIndex }) {
|
|
|
- // if (columnIndex < 2) {
|
|
|
- // if (rowIndex < 1) {
|
|
|
- // return [this.conditions.limit || 10, 1]
|
|
|
- // } else {
|
|
|
- // return [0, 0]
|
|
|
- // }
|
|
|
- // }
|
|
|
- },
|
|
|
- loadData() {
|
|
|
- this.getData()
|
|
|
- },
|
|
|
-
|
|
|
// fetch data
|
|
|
getData() {
|
|
|
this.listLoading = true
|
|
@@ -170,10 +115,11 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error(msg)
|
|
|
}
|
|
|
- }).catch((error) => {
|
|
|
- console.log(error)
|
|
|
})
|
|
|
},
|
|
|
+ showDetail(data) {
|
|
|
+ this.$refs['detail'].showDetailModel(JSON.parse(JSON.stringify(data)))
|
|
|
+ },
|
|
|
// "Add Risk" Model
|
|
|
handleAdd() {
|
|
|
this.$refs['goaf'].showAddModel()
|
|
@@ -186,13 +132,13 @@ export default {
|
|
|
|
|
|
// Delete Action
|
|
|
handleDelete(data) {
|
|
|
- const { hazardId, riskId, riskSource } = data
|
|
|
- this.$confirm(`此操作将删除该数据${riskSource}, 是否继续?`, '提示', {
|
|
|
+ const { goafId, goafName } = data
|
|
|
+ this.$confirm(`此操作将删除该数据${goafName}, 是否继续?`, '提示', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
}).then(() => {
|
|
|
- delGoaf(hazardId, riskId).then((resp) => {
|
|
|
+ delGoaf(goafId).then((resp) => {
|
|
|
const { code, msg } = resp
|
|
|
if (code === 0) {
|
|
|
this.getData()
|
|
@@ -200,84 +146,10 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error(msg)
|
|
|
}
|
|
|
- }).catch((error) => {
|
|
|
- console.log(error)
|
|
|
})
|
|
|
}).catch(() => {
|
|
|
this.$message.info('已取消删除')
|
|
|
})
|
|
|
- },
|
|
|
- showQrcode(row) {
|
|
|
- this.$refs.qrcode.draw(row.goafQrCode)
|
|
|
- },
|
|
|
- batchDown() { /* 点击按钮获取制作二维码素材*/
|
|
|
- const content = JSON.parse(JSON.stringify(this.exportItems || this.dataList))
|
|
|
- this.downloadMaterial(content)
|
|
|
- },
|
|
|
-
|
|
|
- downloadMaterial(content) { // 下载物料
|
|
|
- this.batch(content, '采空区')
|
|
|
- },
|
|
|
-
|
|
|
- async batch(arr, fileName) {
|
|
|
- const self = this
|
|
|
- window.loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '制作二维码中!',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(0, 0, 0, 0.7)'
|
|
|
- })
|
|
|
-
|
|
|
- zip = new JSZip()
|
|
|
- for (let i = 0; i < arr.length; i++) {
|
|
|
- const item = arr[i]
|
|
|
- await self.drawQrcode(item.type, item.goafQrCode).catch(() => {
|
|
|
- window.loading.close()
|
|
|
- this.$message.error('导出失败')
|
|
|
- })
|
|
|
- await self.packMaterial(`${item.goafOrebelt}-${item.goafOrebody}-${item.goafOreheight}-${new Date().getTime()}`).catch(() => {
|
|
|
- window.loading.close()
|
|
|
- this.$message.error('导出失败')
|
|
|
- })
|
|
|
- }
|
|
|
- zip.generateAsync({
|
|
|
- type: 'blob'
|
|
|
- }).then((blob) => {
|
|
|
- saveAs(blob, fileName + '二维码物料.zip')
|
|
|
- window.loading.close()
|
|
|
- })
|
|
|
- },
|
|
|
- drawQrcode(type, url, sleep) { // 绘制二维码
|
|
|
- this.$refs.qrcodeModal.innerHTML = ''
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- new QRCode('qrcode', {
|
|
|
- width: 400,
|
|
|
- height: 400,
|
|
|
- text: url.toString()
|
|
|
- })
|
|
|
- setTimeout(function() {
|
|
|
- resolve()
|
|
|
- }, sleep || 300)
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- packMaterial(name) { // 打包处理
|
|
|
- if (!name) name = 'xxx'
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
- html2canvas(document.getElementById('qrcode'), {
|
|
|
- backgroundColor: null,
|
|
|
- useCORS: true,
|
|
|
- dpi: 500,
|
|
|
- scale: 5
|
|
|
- }).then((canvas) => {
|
|
|
- let dataURL = canvas.toDataURL('photo/png')
|
|
|
- dataURL = dataURL.replace(/^data:image\/(png|jpg);base64,/, '')
|
|
|
- zip.file(name + '.jpg', dataURL, { base64: true })
|
|
|
- resolve()
|
|
|
- }).catch((e) => {
|
|
|
- reject(e)
|
|
|
- })
|
|
|
- })
|
|
|
}
|
|
|
}
|
|
|
}
|