index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <div class="file-details">
  3. <!-- <div class="title">文件共享中心</div> -->
  4. <div class="content">
  5. <div class="left-box">
  6. <a-button type="primary" preIcon="ant-design:form-outlined" style="margin-bottom: 15px" @click="editMenu">编辑目录</a-button>
  7. <BasicTree :expandedKeys="expandedKeys" :treeData="treeData" :showLine="showLine" />
  8. </div>
  9. <div class="right-box">
  10. <div class="search">
  11. <a-input v-model:value="fileName" placeholder="请输入文件名称" />
  12. <a-button type="primary" preIcon="ant-design:search-outlined">查询</a-button>
  13. <a-button type="primary" style="float: right; right: 15px" preIcon="ant-design:cloud-upload-outlined">文件上传</a-button>
  14. </div>
  15. <div class="list">
  16. <div class="bd-t"></div>
  17. <NormalTable
  18. :columns="columns"
  19. :list="getTree"
  20. :formSchema="formSchema"
  21. :deleteById="deleteById"
  22. :saveOrUpdate="saveOrUpdate"
  23. designScope="file-detail"
  24. title="文件详情"
  25. :showTab="false"
  26. />
  27. <div class="bd-b"></div>
  28. </div>
  29. </div>
  30. </div>
  31. <!-- 编辑目录 -->
  32. <fileMenuDialog @register="registerModal" @saveOrUpdate="saveOrUpdateHandler" />
  33. </div>
  34. </template>
  35. <script lang="ts" setup name="system-user">
  36. import { useModal } from '/@/components/Modal';
  37. import fileMenuDialog from '../comment/fileMenuModal.vue';
  38. import { ref, onMounted, reactive, provide } from 'vue';
  39. import { BasicTree } from '/@/components/Tree/index';
  40. import { CollapseContainer } from '/@/components/Container/index';
  41. import NormalTable from '../comment/NormalTable.vue';
  42. import { columns, formSchema } from './fileDetail.data';
  43. import { getTree, deleteById, saveOrUpdate } from './fileDetail.api';
  44. import { TreeItem } from '/@/components/Tree/index';
  45. components: {
  46. CollapseContainer;
  47. }
  48. let showLine = ref(true);
  49. const expandedKeys = ref<string[]>(['0-0']); //默认展开树节点
  50. let fileName = ref('');
  51. //tree
  52. let treeData = reactive<TreeItem[]>([
  53. {
  54. title: '全部',
  55. key: '0-0',
  56. icon: 'file1|svg',
  57. children: [],
  58. },
  59. ]);
  60. provide('treeData', treeData);
  61. let getTreeList = async () => {
  62. let data = await getTree({ parentId: '' });
  63. console.log(data, '树节点数据');
  64. let child = data.records.map((el, index) => {
  65. return {
  66. id: el.id,
  67. title: el.fileName,
  68. key: index,
  69. icon: 'file2|svg',
  70. };
  71. });
  72. treeData[0].children?.push(...child);
  73. };
  74. //注册弹窗
  75. const [registerModal, { openModal, closeModal }] = useModal();
  76. //编辑目录
  77. let editMenu = () => {
  78. openModal(true);
  79. };
  80. //关闭目录弹窗
  81. let saveOrUpdateHandler = () => {
  82. closeModal();
  83. };
  84. onMounted(() => {
  85. getTreeList();
  86. });
  87. </script>
  88. <style lang="less" scoped>
  89. .file-details {
  90. width: 100%;
  91. height: 100%;
  92. padding: 15px;
  93. position: relative;
  94. background: url(../../../../assets/images/files/homes/bd.png) no-repeat center;
  95. .content {
  96. width: 100%;
  97. height: calc(100% - 30px);
  98. display: flex;
  99. flex-direction: row;
  100. justify-content: space-between;
  101. align-items: flex-start;
  102. .left-box {
  103. width: 15%;
  104. height: calc(100% - 20px);
  105. margin-bottom: 20px;
  106. padding: 20px;
  107. border: 2px solid #268bc1;
  108. box-shadow: 0px 0px 20px 7px rgba(30, 119, 186, 0.7) inset;
  109. -moz-box-shadow: 0px 0px 20px 7px rgba(30, 119, 186, 0.7) inset;
  110. -webkit-box-shadow: 0px 0px 20px 7px rgba(30, 119, 186, 0.7) inset;
  111. }
  112. .right-box {
  113. width: 85%;
  114. height: calc(100% - 20px);
  115. padding: 0px 0px 0px 15px;
  116. box-sizing: border-box;
  117. .search {
  118. height: 34px;
  119. line-height: 34px;
  120. margin-bottom: 15px;
  121. background: url(../../../../assets/images/files/details/cz-b.png) no-repeat;
  122. background-size: 100% 100%;
  123. }
  124. }
  125. .list {
  126. height: calc(100% - 49px);
  127. position: relative;
  128. .bd-t {
  129. height: 4px;
  130. width: 100%;
  131. position: absolute;
  132. top: 0px;
  133. background: url(../../../../assets/images/files/details/lb-b.png) no-repeat;
  134. background-size: 100% 100%;
  135. }
  136. .bd-b {
  137. height: 4px;
  138. width: 100%;
  139. position: absolute;
  140. bottom: 0px;
  141. background: url(../../../../assets/images/files/details/lb-b.png) no-repeat;
  142. background-size: 100% 100%;
  143. }
  144. }
  145. }
  146. }
  147. ::v-deep .jeecg-svg-icon {
  148. margin-right: 5px;
  149. }
  150. ::v-deep .jeecg-basic-table-form-container {
  151. padding: 0px 0px;
  152. }
  153. ::v-deep .zxm-btn-primary {
  154. background-color: transparent;
  155. border: none;
  156. background: url(../../../../assets/images/files/details/btn.png) no-repeat !important;
  157. background-size: 100% 100% !important;
  158. }
  159. ::v-deep .zxm-tree-switcher {
  160. background: transparent;
  161. }
  162. ::v-deep .zxm-input {
  163. width: 220px;
  164. height: 28px;
  165. background: transparent;
  166. border: 1px solid #31bccc;
  167. margin: 0px 20px;
  168. border-radius: 5px;
  169. }
  170. </style>