gasReport.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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.class" style="width: 240px"
  9. placeholder="请选择巡检班次" @change="classChange">
  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 #bodyCell="{ column, record }">
  27. <a v-if="column.dataIndex === 'operation'" class="table-action-link" @click="handlerLocation(record)">定位</a>
  28. </template> -->
  29. <template #action="{ record }">
  30. <a class="table-action-link" @click="handlerLocation(record)">定位</a>
  31. </template>
  32. </a-table>
  33. </div>
  34. </div>
  35. </template>
  36. <script setup lang="ts">
  37. import { ref, reactive, onMounted, watch,defineExpose } from 'vue';
  38. import { ColumnsReport } from './comment.data';
  39. import {queryReportData,} from '../deviceMonitor/components/device/device.api';
  40. import { useGlobSetting } from '/@/hooks/setting';
  41. const glob = useGlobSetting();
  42. let searchData = reactive({
  43. class: 'gasDayNight',
  44. });
  45. let classList = reactive<any[]>([
  46. { label: '夜班', value: 'gasDayNight' },
  47. { label: '早班', value: 'gasDayEarly' },
  48. { label: '中班', value: 'gasDayNoon' },
  49. ]);
  50. let gaspatrolTableData = ref<any[]>([]);
  51. let $emit = defineEmits([ 'locate']);
  52. //巡检班次选项切换
  53. let classChange = (val) => {
  54. searchData.class = val;
  55. };
  56. //查询
  57. let getSearch = () => {
  58. getSearchReport()
  59. };
  60. //重置
  61. let getReset = () => {
  62. searchData.class = '';
  63. getSearchReport()
  64. };
  65. //定位
  66. function handlerLocation(record) {
  67. $emit('locate', record);
  68. }
  69. //查询瓦斯日报列表数据
  70. async function getSearchReport() {
  71. let res = await queryReportData({ type: searchData.class });
  72. console.log(res, '瓦斯日报列表');
  73. gaspatrolTableData.value = JSON.parse(res.content) || [];
  74. }
  75. defineExpose({ getSearchReport })
  76. onMounted(() => { });
  77. </script>
  78. <style lang="less" scoped>
  79. @ventSpace: zxm;
  80. .gasReport {
  81. .search-area {
  82. margin: 15px;
  83. .area-item {
  84. display: flex;
  85. align-items: center;
  86. .item-text {
  87. color: #fff;
  88. }
  89. }
  90. }
  91. .zxm-picker,
  92. .zxm-input {
  93. border: 1px solid #3ad8ff77;
  94. background-color: #ffffff00;
  95. color: #fff;
  96. }
  97. }
  98. :deep(.@{ventSpace}-table-body) {
  99. height: auto !important;
  100. tr>td {
  101. background: #ffffff00 !important;
  102. }
  103. tr.@{ventSpace}-table-row-selected {
  104. td {
  105. background: #007cc415 !important;
  106. }
  107. }
  108. }
  109. :deep(.jeecg-basic-table .@{ventSpace}-table-wrapper .@{ventSpace}-table-title) {
  110. min-height: 0;
  111. }
  112. :deep(.@{ventSpace}-pagination) {
  113. margin-right: 20px !important;
  114. }
  115. // :deep(.zxm-table-thead > tr > th:last-child) {
  116. // border-right: 1px solid #91e9fe55 !important;
  117. // }</style>