enterprise.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <div>
  3. <div style="margin-bottom: 10px; display: flex; align-items: center">
  4. <el-input
  5. class="input_content"
  6. placeholder="请输入内容"
  7. v-model="sourceList.pagination.keyword"
  8. style="width: 90%"
  9. clearable
  10. size="small"
  11. ></el-input>
  12. <div style="text-align: center; width: 10%">
  13. <el-icon style="cursor: pointer" @click="getList"><Search /></el-icon>
  14. </div>
  15. </div>
  16. <el-row>
  17. <el-col :span="6" style="border-right: 1px solid #d7d7d7">
  18. <div class="mulu">
  19. <el-tree
  20. :data="treeListData"
  21. :props="{ label: 'name', children: 'netdiskList' }"
  22. ref="tree"
  23. node-key="id"
  24. @node-click="treeChange"
  25. default-expand-all
  26. :expand-on-click-node="false"
  27. ></el-tree>
  28. </div>
  29. </el-col>
  30. <el-col :span="18" style="padding: 0 5px">
  31. <el-table
  32. :data="sourceList.data"
  33. style="width: 100%"
  34. v-loading="loading"
  35. :height="tableHeight"
  36. >
  37. <el-table-column prop="name" label="文件名" width="115" />
  38. <el-table-column prop="createTime" label="上传时间" width="140" />
  39. <!-- <el-table-column
  40. label="操作"
  41. width="60"
  42. fixed="right"
  43. align="center"
  44. v-if="isShowBtn"
  45. >
  46. <template #default="{ row }">
  47. <el-button type="primary" text @click="handleClickRow(row)"
  48. ><i class="iconfont icon-iconm_wofqd"></i
  49. ></el-button>
  50. </template>
  51. </el-table-column> -->
  52. </el-table>
  53. <el-pagination
  54. style="margin-top: 10px"
  55. v-model:current-page="sourceList.pagination.pageNum"
  56. :page-size="10"
  57. layout="total, prev, pager, next"
  58. :total="sourceList.pagination.total"
  59. prev-text="上一页"
  60. next-text="下一页"
  61. @current-change="handleCurrentChange"
  62. />
  63. </el-col>
  64. </el-row>
  65. </div>
  66. </template>
  67. <script setup>
  68. import useMailStore from "@/store/modules/mail";
  69. const mailStore = useMailStore();
  70. const isShowBtn = ref(false);
  71. mailStore.$subscribe((mutations, state) => {
  72. if (state.currentId.includes("write")) {
  73. isShowBtn.value = true;
  74. } else {
  75. isShowBtn.value = false;
  76. }
  77. });
  78. const loading = ref(false);
  79. const sourceList = ref({
  80. data: [],
  81. pagination: {
  82. total: 300,
  83. pageNum: 1,
  84. pageSize: 10,
  85. keyword: "",
  86. },
  87. });
  88. const treeListData = ref([]);
  89. const tableHeight = window.innerHeight - 250;
  90. const statusData = ref([
  91. {
  92. label: "草稿",
  93. value: 0,
  94. },
  95. {
  96. label: "审批中",
  97. value: 10,
  98. },
  99. {
  100. label: "驳回",
  101. value: 20,
  102. },
  103. {
  104. label: "通过",
  105. value: 30,
  106. },
  107. {
  108. label: "终止",
  109. value: 99,
  110. },
  111. ]);
  112. const { proxy } = getCurrentInstance();
  113. const getList = (req) => {
  114. loading.value = true;
  115. proxy.post("/netdisk/page", sourceList.value.pagination).then((res) => {
  116. sourceList.value.data = res.rows;
  117. sourceList.value.pagination.total = res.total;
  118. setTimeout(() => {
  119. loading.value = false;
  120. }, 200);
  121. });
  122. };
  123. const handleCurrentChange = (val) => {
  124. sourceList.value.pagination.pageNum = val;
  125. getList();
  126. };
  127. const treeChange = (e) => {
  128. sourceList.value.pagination.parentFolderId = e.id;
  129. sourceList.value.pagination.pageNum = 1;
  130. getList();
  131. };
  132. const getTreeList = () => {
  133. proxy.get("/netdisk/tree", {}).then((res) => {
  134. treeListData.value = res.data;
  135. console.log(treeListData.value, "ada");
  136. });
  137. };
  138. getTreeList();
  139. getList();
  140. const handleClickRow = (row) => {
  141. console.log(row, "ada");
  142. };
  143. </script>
  144. <style lang="scss" scoped>
  145. * {
  146. font-size: 12px;
  147. }
  148. .el-button {
  149. padding: 0px;
  150. }
  151. .btn {
  152. width: 100%;
  153. border-radius: 10px;
  154. padding: 6px 10px;
  155. height: 24px;
  156. }
  157. .el-pagination {
  158. padding-left: 30px;
  159. }
  160. :deep(.el-pagination button, .el-pager li) {
  161. font-size: 12px;
  162. }
  163. :deep(.el-table .el-table__cell) {
  164. padding: 2px 0px;
  165. }
  166. </style>
  167. <style lang="scss">
  168. .mulu {
  169. width: 100%;
  170. padding: 0 5px;
  171. height: calc(100vh - 50px - 50px - 10px - 30px - 28px - 46px - 35px - 24px);
  172. overflow-y: auto;
  173. overflow-x: auto;
  174. .el-tree {
  175. .el-tree-node.is-expanded > .el-tree-node__children {
  176. overflow: visible;
  177. }
  178. .el-tree-node > .el-tree-node__children {
  179. overflow: visible;
  180. }
  181. .el-tree-node__content {
  182. height: 26px !important;
  183. }
  184. }
  185. }
  186. </style>