GoafInfo.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <div class="content-container goaf">
  3. <el-row class="tool-bar">
  4. <el-col :span="12" class="left">
  5. <div class="content-title">
  6. 采空区
  7. </div>
  8. </el-col>
  9. <el-col :span="12" class="right">
  10. <el-input v-model="conditions.data.goafName" class="search-input m-right-15" placeholder="请输入采空区名称">
  11. <el-button slot="append" icon="el-icon-search" @click="getData()" />
  12. </el-input>
  13. <el-button type="primary" @click="handleAdd">新增</el-button>
  14. </el-col>
  15. </el-row>
  16. <el-row class="m-top-15">
  17. <el-table v-loading="listLoading" class="page-table" border fit :data="dataList">
  18. <el-table-column prop="goafOrebelt" label="矿带">
  19. <template v-slot="{row}">
  20. <span>{{ convertNum(row.goafOrebelt) }}</span>
  21. </template>
  22. </el-table-column>
  23. <el-table-column prop="goafOrebody" label="矿体" />
  24. <el-table-column prop="goafOreheight" label="中段" />
  25. <el-table-column prop="goafName" label="采空区名称" show-overflow-tooltip />
  26. <el-table-column prop="goafRoofpillarThickness" label="顶板矿柱厚度" width="" />
  27. <el-table-column prop="goafIncoavThickness" label=" 保安间柱平均厚度" width="150" />
  28. <el-table-column prop="goafRockLithology" label="围岩岩性" />
  29. <el-table-column prop="goafRockStability" label="围岩稳定性" />
  30. <el-table-column prop="goafCanfillVolume" label="可充填体积(m³)" width="150" />
  31. <el-table-column prop="goafRemainVolume" label="剩余可充填体积(m³)" width="180" />
  32. <el-table-column prop="goafIsFill" label="是否充填" width="80">
  33. <template v-slot="{row}">
  34. <span v-if="row.goafIsFill==0" style="color:'#49E86C'">是</span>
  35. <span v-else style="color:'#E44E2D'">否</span>
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="操作" header-align="center" align="center" width="180">
  39. <template v-slot="{row}">
  40. <el-button size="mini" type="text" style="color:#1B81FF" @click="showDetail(row)">详情</el-button>
  41. <el-button size="mini" type="text" style="color:#1B81FF" @click="handleUpdate(row)">修改</el-button>
  42. <el-button size="mini" type="text" style="color:#E44E2D" @click="handleDelete(row)">删除</el-button>
  43. </template>
  44. </el-table-column>
  45. </el-table>
  46. <div class="pagination-container" style="float:right;margin-right:40px;">
  47. <pagination v-show="total>0" :total="total" :page.sync="conditions.page" :limit.sync="conditions.limit" @pagination="getData" />
  48. </div>
  49. </el-row>
  50. <goaf ref="goaf" @formSuccess="getData" />
  51. <detail ref="detail" />
  52. </div>
  53. </template>
  54. <script>
  55. import { getGoafBaseInfoByPage, delGoaf } from '@/api/goaf/info'
  56. import { Pagination } from '@/components'
  57. import Goaf from './Goaf'
  58. import Detail from './detail'
  59. import { NumConvertLM } from '@/utils'
  60. export default {
  61. components: { Pagination, Goaf, Detail },
  62. data() {
  63. return {
  64. dataList: [],
  65. total: 0,
  66. listLoading: false,
  67. conditions: {
  68. page: 1,
  69. limit: 10,
  70. data: {
  71. goafName: ''
  72. }
  73. }
  74. }
  75. },
  76. created() {
  77. this.getData()
  78. },
  79. methods: {
  80. convertNum(num) {
  81. return num ? NumConvertLM(num) : '--'
  82. },
  83. // fetch data
  84. getData() {
  85. this.listLoading = true
  86. getGoafBaseInfoByPage(this.conditions).then((resp) => {
  87. this.listLoading = false
  88. const { code, msg, data, total } = resp
  89. if (code === 0) {
  90. this.dataList = data
  91. this.total = total
  92. } else {
  93. this.$message.error(msg)
  94. }
  95. })
  96. },
  97. showDetail(data) {
  98. this.$refs['detail'].showDetailModel(JSON.parse(JSON.stringify(data)))
  99. },
  100. // "Add Risk" Model
  101. handleAdd() {
  102. this.$refs['goaf'].showAddModel()
  103. },
  104. // "Edit Risk" Model
  105. handleUpdate(data) {
  106. this.$refs['goaf'].showEditModel(JSON.parse(JSON.stringify(data)))
  107. },
  108. // Delete Action
  109. handleDelete(data) {
  110. const { goafId, goafName } = data
  111. this.$confirm(`此操作将删除该数据${goafName}, 是否继续?`, '提示', {
  112. confirmButtonText: '确定',
  113. cancelButtonText: '取消',
  114. type: 'warning'
  115. }).then(() => {
  116. delGoaf(goafId).then((resp) => {
  117. const { code, msg } = resp
  118. if (code === 0) {
  119. this.getData()
  120. this.$message.success(msg)
  121. } else {
  122. this.$message.error(msg)
  123. }
  124. })
  125. }).catch(() => {
  126. this.$message.info('已取消删除')
  127. })
  128. }
  129. }
  130. }
  131. </script>
  132. <style lang="scss" scoped>
  133. @import "icon/iconfont.css";
  134. .content-container {
  135. background: #193142FF;
  136. margin: 10px 10px 10px 0;
  137. padding: 15px;
  138. height: calc(100vh - 90px);
  139. box-sizing: border-box;
  140. .content-title {
  141. font-size: 18px;
  142. font-weight: bold;
  143. color: #FFFFFF;
  144. font-weight: bold;
  145. background: linear-gradient(0deg, #FFFFFF 0%, #98A8B7 100%);
  146. background-clip: text;
  147. -webkit-background-clip: text;
  148. -webkit-text-fill-color: transparent;
  149. }
  150. .tool-bar {
  151. .left {
  152. float: left;
  153. }
  154. .right {
  155. float: right;
  156. text-align: right;
  157. }
  158. .title {
  159. line-height: 36px;
  160. font-size: 26px;
  161. }
  162. .search-input {
  163. width: 300px;
  164. }
  165. }
  166. .el-dropdown {
  167. margin: 0 10px;
  168. }
  169. }
  170. </style>
  171. <style lang="scss">
  172. .goaf .el-table__body tr.hover-row>td {
  173. background-color: #306379;
  174. }
  175. .goaf{
  176. .page-table{
  177. height: calc(100vh - 260px);
  178. overflow-y: auto;
  179. }
  180. }
  181. </style>