index.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <div class="dustMonitor">
  3. <customHeader>束管日报分析</customHeader>
  4. <div class="content-container">
  5. <div class="file-list">
  6. <ul>
  7. <li v-for="item in selectList" :key="item.fileId" :class="{ selected: item.fileId === selectedFileId }" @click="handleFileClick(item)">
  8. {{ item.fileName }}
  9. </li>
  10. </ul>
  11. </div>
  12. <div class="table-container">
  13. <a-table :columns="columns" :data-source="tableData" size="small" :scroll="{ y: 500 }" class="tableW">
  14. <template #bodyCell="{ column, record }">
  15. <template v-if="column.dataIndex === 'action'">
  16. <a class="action-link" @click="toDetail(record)">数据分析</a>
  17. </template>
  18. </template>
  19. </a-table>
  20. </div>
  21. </div>
  22. <a-modal style="width: 24%; height: 600px" title="爆炸三角形" v-model:visible="modalVisible" :draggable="true" :footer="null">
  23. <blastDelta :posMonitor="posMonitor" />
  24. </a-modal>
  25. </div>
  26. </template>
  27. <script setup lang="ts">
  28. import { ref, onMounted, shallowRef, reactive } from 'vue';
  29. import { columns } from './bundle-table.data';
  30. import { getBundleInfoList, getAllFileList } from './bundle-table.api';
  31. import customHeader from '/@/components/vent/customHeader.vue';
  32. // import { blastDelta } from './modal/blastDelta.vue';
  33. import blastDelta from './modal/blastDelta.vue';
  34. let selectList = ref<any[]>([]);
  35. let formSearch = reactive({
  36. pageNum: 1,
  37. pageSize: 1000,
  38. fileId: '',
  39. fileName: '',
  40. });
  41. let tableData = ref<any[]>([]);
  42. let modalVisible = ref(false);
  43. let selectedFileId = ref<string | null>(null);
  44. const posMonitor = shallowRef({});
  45. function toDetail(record: any) {
  46. posMonitor.value = record;
  47. console.log(posMonitor.value, '爆炸三角形');
  48. modalVisible.value = true;
  49. }
  50. //获取色谱仪报表
  51. async function getTableList(params: any) {
  52. let res = await getBundleInfoList({ type: 'bundle', ...params });
  53. const content = res.content;
  54. let contentArr = JSON.parse(content);
  55. tableData.value = contentArr;
  56. }
  57. //获取所有文件列表
  58. async function getAllFile() {
  59. let res = await getAllFileList({ type: 'bundle' });
  60. selectList.value = res.records.map((item: any) => ({
  61. fileId: item.fileId,
  62. fileName: item.fileName,
  63. }));
  64. if (selectList.value.length > 0) {
  65. formSearch.fileId = selectList.value[0].fileId;
  66. getSearch();
  67. }
  68. }
  69. // 处理文件点击事件
  70. function handleFileClick(item: any) {
  71. formSearch.fileId = item.fileId;
  72. formSearch.fileName = item.fileName;
  73. selectedFileId.value = item.fileId;
  74. getSearch();
  75. }
  76. //查询
  77. function getSearch() {
  78. const selectedFile = selectList.value.find((item) => item.fileId === formSearch.fileId);
  79. const params = {
  80. fileId: formSearch.fileId,
  81. fileName: selectedFile ? selectedFile.fileName : '',
  82. };
  83. getTableList(params);
  84. }
  85. onMounted(() => {
  86. getTableList({ type: 'bundle' });
  87. getAllFile().then(() => {
  88. if (selectList.value.length > 0) {
  89. formSearch.fileId = selectList.value[0].fileId;
  90. selectedFileId.value = selectList.value[0].fileId;
  91. getSearch();
  92. }
  93. });
  94. });
  95. </script>
  96. <style lang="less" scoped>
  97. @import '/@/design/theme.less';
  98. .content-container {
  99. display: flex;
  100. width: 100%;
  101. height: 100%;
  102. }
  103. .file-list {
  104. width: 20%;
  105. padding: 10px;
  106. margin-right: 10px;
  107. margin-bottom: 50px;
  108. border: 1px solid #99e8ff66;
  109. background: #27546e1a;
  110. box-shadow: 0px 0px 20px 7px rgba(145, 233, 254, 0.7) inset;
  111. -moz-box-shadow: 0px 0px 20px 7px rgba(145, 233, 254, 0.7) inset;
  112. -webkit-box-shadow: 0px 0px 50px 1px rgb(149 235 255 / 5%) inset;
  113. }
  114. .file-list ul {
  115. list-style: none;
  116. padding: 0;
  117. }
  118. .file-list li {
  119. color: #fff;
  120. padding: 5px;
  121. cursor: pointer;
  122. }
  123. .file-list li:hover,
  124. .file-list li.selected {
  125. background: #26adfc1a;
  126. }
  127. .table-container {
  128. margin-top: 10px;
  129. width: 80%;
  130. box-sizing: border-box;
  131. }
  132. .dustMonitor {
  133. width: 100%;
  134. height: 100%;
  135. padding: 10px 10px 15px 10px;
  136. box-sizing: border-box;
  137. position: relative;
  138. }
  139. :deep(.zxm-table-thead > tr > th:last-child) {
  140. border-right: 1px solid #91e9fe !important;
  141. }
  142. :deep(.zxm-picker-input > input) {
  143. color: #fff;
  144. }
  145. :deep(.zxm-select:not(.zxm-select-customize-input) .zxm-select-selector) {
  146. border: 1px solid var(--vent-form-item-border) !important;
  147. background-color: #ffffff00 !important;
  148. }
  149. :deep(.zxm-select-selection-item) {
  150. color: #fff !important;
  151. }
  152. </style>