index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <div class="gasReportInspect">
  3. <customHeader>报表管理中心</customHeader>
  4. <div class="content">
  5. <div class="left-box">
  6. <!-- 左侧树菜单 -->
  7. <div class="card-toggle">
  8. <div :class="gasType == 'gasDayNight' ? 'card-item1' : 'card-item'"
  9. @click="handlerToggle('gasDayNight')">夜班</div>
  10. <div :class="gasType == 'gasDayEarly' ? 'card-item1' : 'card-item'"
  11. @click="handlerToggle('gasDayEarly')">早班</div>
  12. <div :class="gasType == 'gasDayNoon' ? 'card-item1' : 'card-item'"
  13. @click="handlerToggle('gasDayNoon')">中班</div>
  14. </div>
  15. <div v-if="listArr.length != 0" class="card-file">
  16. <fileSystem :selected="selected" :list="listArr" :draggable="true" @on-click="onClick">
  17. <template #icon="{ item }">
  18. <template v-if="item.isFolder">
  19. <SvgIcon v-if="item.isexpanded" size="18" name="file-open" />
  20. <SvgIcon v-else size="18" name="file-close" />
  21. </template>
  22. <treeIcon class="iconfont" :title="item.title" v-else />
  23. </template>
  24. </fileSystem>
  25. </div>
  26. </div>
  27. <div class="right-box">
  28. <a-table :columns="columnsType" size="small" :data-source="tableData" :scroll="{ y: 700 }"
  29. class="tableW" :pagination="pagination"></a-table>
  30. </div>
  31. </div>
  32. </div>
  33. </template>
  34. <script setup lang="ts">
  35. import { ref, nextTick, reactive, onMounted } from 'vue';
  36. import customHeader from '/@/components/vent/customHeader.vue';
  37. import fileSystem from './comment/common/cameraTree.vue';
  38. import { SvgIcon } from '/@/components/Icon';
  39. import treeIcon from './comment/common/Icon/treeIcon.vue';
  40. import { columnsType, pagination } from './gasReportInspect.data';
  41. import { queryReportData } from './gasReportInspect.api';
  42. let gasType = ref('gasDayNight')
  43. //左侧菜单列表
  44. let listArr = reactive<any[]>([]);
  45. //lxh 当前选中树节点
  46. let selected = reactive<any>({
  47. id: null,
  48. pid: null,
  49. title: '',
  50. isFolder: false,
  51. });
  52. let tableData = ref<any[]>([])
  53. let handlerToggle = (param) => {
  54. gasType.value = param
  55. pagination.current = 1
  56. getTreeList(gasType.value)
  57. }
  58. //获取左侧菜单树
  59. async function getTreeList(param) {
  60. listArr.length = 0
  61. const res = await queryReportData({ type: param })
  62. console.log(res, '早中晚----------------')
  63. if (res) {
  64. listArr.push({
  65. id: res.id,
  66. pid: null,
  67. title: res.fileName,
  68. isFolder: true,
  69. })
  70. tableData.value = JSON.parse(res.content)
  71. // pagination.total = Math.ceil(tableData.value.length / pagination.pageSize)
  72. }
  73. }
  74. //点击目录
  75. function onClick(node) {
  76. selected.id = node.id;
  77. selected.pid = node.pid;
  78. selected.title = node.title;
  79. selected.isFolder = node.isFolder;
  80. selected.ppid = node.ppid
  81. };
  82. onMounted(() => {
  83. getTreeList(gasType.value)
  84. })
  85. </script>
  86. <style lang="less" scoped>
  87. .gasReportInspect {
  88. width: 100%;
  89. height: 100%;
  90. padding: 80px 10px 15px 10px;
  91. box-sizing: border-box;
  92. position: relative;
  93. .content {
  94. width: 100%;
  95. height: calc(100% - 30px);
  96. display: flex;
  97. flex-direction: row;
  98. justify-content: space-between;
  99. align-items: flex-start;
  100. position: relative;
  101. // z-index: 999;
  102. .left-box {
  103. width: 15%;
  104. height: 100%;
  105. padding: 20px;
  106. border: 1px solid #99e8ff66;
  107. background: #27546e1a;
  108. box-shadow: 0px 0px 20px 7px rgba(145, 233, 254, 0.7) inset;
  109. -moz-box-shadow: 0px 0px 20px 7px rgba(145, 233, 254, 0.7) inset;
  110. -webkit-box-shadow: 0px 0px 50px 1px rgb(149 235 255 / 5%) inset;
  111. overflow-y: auto;
  112. .card-toggle {
  113. height: 30px;
  114. display: flex;
  115. justify-content: space-between;
  116. align-items: center;
  117. margin-bottom: 10px;
  118. color: #fff;
  119. .card-item {
  120. width: calc(33.3% - 5px);
  121. height: 100%;
  122. display: flex;
  123. justify-content: center;
  124. align-items: center;
  125. background: #1a5b7f;
  126. border-radius: 5px;
  127. cursor: pointer;
  128. }
  129. .card-item1 {
  130. width: calc(33.3% - 5px);
  131. height: 100%;
  132. display: flex;
  133. justify-content: center;
  134. align-items: center;
  135. background: #5dd8f7;
  136. border-radius: 5px;
  137. cursor: pointer;
  138. }
  139. }
  140. .card-file {
  141. height: calc(100% - 40px);
  142. overflow-y: auto;
  143. }
  144. // lxh
  145. .iconfont {
  146. color: #fff;
  147. font-size: 12px;
  148. margin-left: 5px;
  149. }
  150. }
  151. .right-box {
  152. width: 85%;
  153. height: 100%;
  154. padding: 0px 0px 0px 15px;
  155. box-sizing: border-box;
  156. }
  157. }
  158. }
  159. </style>