gasReportCount.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <div class="gasReport">
  3. <div class="search-area">
  4. <a-row>
  5. <a-col :span="4">
  6. <div class="area-item">
  7. <div class="item-text">巡检类型:</div>
  8. <a-select ref="select" v-model:value="searchData.insType" style="width: 240px"
  9. placeholder="请选择巡检类型" @change="typeChange">
  10. <a-select-option v-for="(item, index) in classList" :key="item.value" :value="item.value">{{
  11. item.label }}</a-select-option>
  12. </a-select>
  13. </div>
  14. </a-col>
  15. <a-col :span="4">
  16. <a-button type="primary" preIcon="ant-design:search-outlined" style="margin-left: 10px"
  17. @click="getSearch">查询</a-button>
  18. <a-button preIcon="ant-design:sync-outlined" style="margin: 0px 15px"
  19. @click="getReset">重置</a-button>
  20. </a-col>
  21. </a-row>
  22. </div>
  23. <div class="content-area">
  24. <a-table :columns="ColumnsReport" size="small" :data-source="gaspatrolTableData" class="tableW"
  25. :pagination="false" :scroll="{ y: 620 }">
  26. <template #action="{ record }">
  27. <a class="table-action-link" @click="handlerLocation(record)">定位</a>
  28. </template>
  29. </a-table>
  30. </div>
  31. </div>
  32. </template>
  33. <script setup lang="ts">
  34. import { ref, reactive, onMounted, watch,defineExpose } from 'vue';
  35. import { columnsGas1, columnsGas2 } from './comment.data';
  36. import {queryReportData,} from '../deviceMonitor/components/device/device.api';
  37. let searchData = reactive({
  38. insType: 'gasDay1',
  39. });
  40. let classList = reactive<any[]>([
  41. { label: '一次巡检', value: 'gasDay1' },
  42. { label: '二次巡检', value: 'gasDay2' },
  43. ]);
  44. let ColumnsReport = ref<any>(columnsGas1)
  45. let gaspatrolTableData = ref<any[]>([]);
  46. let $emit = defineEmits([ 'locate']);
  47. //巡检班次选项切换
  48. let typeChange = (val) => {
  49. searchData.insType = val;
  50. switch (searchData.insType) {
  51. case 'gasDay1':
  52. ColumnsReport.value = columnsGas1
  53. break;
  54. case 'gasDay2':
  55. ColumnsReport.value = columnsGas2
  56. break;
  57. }
  58. };
  59. //查询
  60. let getSearch = () => {
  61. getSearchReport()
  62. };
  63. //重置
  64. let getReset = () => {
  65. searchData.insType = '';
  66. getSearchReport()
  67. };
  68. //定位
  69. function handlerLocation(record) {
  70. $emit('locate', record);
  71. }
  72. //查询瓦斯日报列表数据
  73. async function getSearchReport() {
  74. let res = await queryReportData({ type: searchData.insType});
  75. console.log(res, '瓦斯日报列表');
  76. gaspatrolTableData.value = JSON.parse(res.content) || [];
  77. }
  78. defineExpose({ getSearchReport })
  79. onMounted(() => { });
  80. </script>
  81. <style lang="less" scoped>
  82. @ventSpace: zxm;
  83. .gasReport {
  84. .search-area {
  85. margin: 15px;
  86. .area-item {
  87. display: flex;
  88. align-items: center;
  89. .item-text {
  90. color: #fff;
  91. }
  92. }
  93. }
  94. .zxm-picker,
  95. .zxm-input {
  96. border: 1px solid #3ad8ff77;
  97. background-color: #ffffff00;
  98. color: #fff;
  99. }
  100. }
  101. :deep(.@{ventSpace}-table-body) {
  102. height: auto !important;
  103. tr>td {
  104. background: #ffffff00 !important;
  105. }
  106. tr.@{ventSpace}-table-row-selected {
  107. td {
  108. background: #007cc415 !important;
  109. }
  110. }
  111. }
  112. :deep(.jeecg-basic-table .@{ventSpace}-table-wrapper .@{ventSpace}-table-title) {
  113. min-height: 0;
  114. }
  115. :deep(.@{ventSpace}-pagination) {
  116. margin-right: 20px !important;
  117. }
  118. // :deep(.zxm-table-thead > tr > th:last-child) {
  119. // border-right: 1px solid #91e9fe55 !important;
  120. // }</style>