enterprise.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  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="11" 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="13" 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="文件名" />
  38. <el-table-column
  39. prop="createTime"
  40. label="上传时间"
  41. width="80"
  42. align="center"
  43. >
  44. <template #default="{ row }">
  45. <el-tooltip
  46. class="box-item"
  47. effect="dark"
  48. :content="row.createTime"
  49. placement="top"
  50. >
  51. <!-- <span
  52. class="iconfont icon-iconx_kehd"
  53. style="cursor: pointer; font-size: 18px"
  54. ></span> -->
  55. <el-icon :size="20" style="cursor: pointer"><Timer /></el-icon>
  56. </el-tooltip>
  57. </template>
  58. </el-table-column>
  59. <!-- <el-table-column
  60. label="操作"
  61. width="60"
  62. fixed="right"
  63. align="center"
  64. v-if="isShowBtn"
  65. >
  66. <template #default="{ row }">
  67. <el-button type="primary" text @click="handleClickRow(row)"
  68. ><i class="iconfont icon-iconm_wofqd"></i
  69. ></el-button>
  70. </template>
  71. </el-table-column> -->
  72. </el-table>
  73. <el-pagination
  74. style="margin-top: 10px"
  75. v-model:current-page="sourceList.pagination.pageNum"
  76. :page-size="10"
  77. layout="total, prev, pager, next"
  78. :total="sourceList.pagination.total"
  79. prev-text="上一页"
  80. next-text="下一页"
  81. @current-change="handleCurrentChange"
  82. />
  83. </el-col>
  84. </el-row>
  85. </div>
  86. </template>
  87. <script setup>
  88. import useMailStore from "@/store/modules/mail";
  89. const mailStore = useMailStore();
  90. const isShowBtn = ref(false);
  91. mailStore.$subscribe((mutations, state) => {
  92. if (state.currentId.includes("write")) {
  93. isShowBtn.value = true;
  94. } else {
  95. isShowBtn.value = false;
  96. }
  97. });
  98. const loading = ref(false);
  99. const sourceList = ref({
  100. data: [],
  101. pagination: {
  102. total: 300,
  103. pageNum: 1,
  104. pageSize: 10,
  105. keyword: "",
  106. },
  107. });
  108. const treeListData = ref([]);
  109. const tableHeight = ref(0);
  110. const getTableHeight = () => {
  111. tableHeight.value = window.innerHeight - 250;
  112. };
  113. getTableHeight();
  114. window.addEventListener("resize", () => {
  115. getTableHeight();
  116. });
  117. const statusData = ref([
  118. {
  119. label: "草稿",
  120. value: 0,
  121. },
  122. {
  123. label: "审批中",
  124. value: 10,
  125. },
  126. {
  127. label: "驳回",
  128. value: 20,
  129. },
  130. {
  131. label: "通过",
  132. value: 30,
  133. },
  134. {
  135. label: "终止",
  136. value: 99,
  137. },
  138. ]);
  139. const { proxy } = getCurrentInstance();
  140. const getList = (req) => {
  141. loading.value = true;
  142. proxy.post("/netdisk/page", sourceList.value.pagination).then((res) => {
  143. sourceList.value.data = res.rows;
  144. sourceList.value.pagination.total = res.total;
  145. setTimeout(() => {
  146. loading.value = false;
  147. }, 200);
  148. });
  149. };
  150. const handleCurrentChange = (val) => {
  151. sourceList.value.pagination.pageNum = val;
  152. getList();
  153. };
  154. const treeChange = (e) => {
  155. sourceList.value.pagination.parentFolderId = e.id;
  156. sourceList.value.pagination.pageNum = 1;
  157. getList();
  158. };
  159. const getTreeList = () => {
  160. proxy.get("/netdisk/tree", {}).then((res) => {
  161. treeListData.value = res.data;
  162. console.log(treeListData.value, "ada");
  163. });
  164. };
  165. getTreeList();
  166. getList();
  167. const handleClickRow = (row) => {
  168. console.log(row, "ada");
  169. };
  170. </script>
  171. <style lang="scss" scoped>
  172. * {
  173. font-size: 12px;
  174. }
  175. .el-button {
  176. padding: 0px;
  177. }
  178. .btn {
  179. width: 100%;
  180. border-radius: 10px;
  181. padding: 6px 10px;
  182. height: 24px;
  183. }
  184. .el-pagination {
  185. padding-left: 30px;
  186. }
  187. :deep(.el-pagination button, .el-pager li) {
  188. font-size: 12px;
  189. }
  190. :deep(.el-table .el-table__cell) {
  191. padding: 2px 0px;
  192. }
  193. </style>
  194. <style lang="scss">
  195. .mulu {
  196. width: 100%;
  197. // padding: 0 5px;
  198. height: calc(100vh - 50px - 50px - 10px - 30px - 28px - 46px - 35px - 24px);
  199. overflow-y: auto;
  200. overflow-x: auto;
  201. .el-tree {
  202. .el-tree-node.is-expanded > .el-tree-node__children {
  203. overflow: visible;
  204. }
  205. .el-tree-node > .el-tree-node__children {
  206. overflow: visible;
  207. }
  208. .el-tree-node__content {
  209. height: 26px !important;
  210. }
  211. }
  212. }
  213. </style>