gasReportCount.vue 3.7 KB

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