gasReport.vue 3.7 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.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">
  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 } from 'vue';
  38. import { ColumnsReport } from './comment.data';
  39. let props = defineProps({
  40. tableData: {
  41. type: Array,
  42. default: () => {
  43. return [];
  44. },
  45. },
  46. });
  47. let searchData = reactive({
  48. class: 'gasDayNight',
  49. });
  50. let classList = reactive<any[]>([
  51. { label: '夜班', value: 'gasDayNight' },
  52. { label: '早班', value: 'gasDayEarly' },
  53. { label: '中班', value: 'gasDayNoon' },
  54. ]);
  55. let gaspatrolTableData = ref<any[]>([]);
  56. let $emit = defineEmits([ 'getSearchReport', 'locate']);
  57. //巡检班次选项切换
  58. let classChange = (val) => {
  59. searchData.class = val;
  60. };
  61. //查询
  62. let getSearch = () => {
  63. $emit('getSearchReport',searchData.class);
  64. };
  65. //重置
  66. let getReset = () => {
  67. searchData.class = '';
  68. };
  69. //定位
  70. function handlerLocation(record) {
  71. $emit('locate', record);
  72. }
  73. watch(
  74. () => props.tableData,
  75. (newV, oldV) => {
  76. gaspatrolTableData.value = newV
  77. },
  78. { immediate: true }
  79. );
  80. onMounted(() => { });
  81. </script>
  82. <style lang="less" scoped>
  83. @ventSpace: zxm;
  84. .gasReport {
  85. .search-area {
  86. margin: 15px;
  87. .area-item {
  88. display: flex;
  89. align-items: center;
  90. .item-text {
  91. color: #fff;
  92. }
  93. }
  94. }
  95. .zxm-picker,
  96. .zxm-input {
  97. border: 1px solid #3ad8ff77;
  98. background-color: #ffffff00;
  99. color: #fff;
  100. }
  101. }
  102. :deep(.@{ventSpace}-table-body) {
  103. height: auto !important;
  104. tr>td {
  105. background: #ffffff00 !important;
  106. }
  107. tr.@{ventSpace}-table-row-selected {
  108. td {
  109. background: #007cc415 !important;
  110. }
  111. }
  112. }
  113. :deep(.jeecg-basic-table .@{ventSpace}-table-wrapper .@{ventSpace}-table-title) {
  114. min-height: 0;
  115. }
  116. :deep(.@{ventSpace}-pagination) {
  117. margin-right: 20px !important;
  118. }
  119. // :deep(.zxm-table-thead > tr > th:last-child) {
  120. // border-right: 1px solid #91e9fe55 !important;
  121. // }</style>