DefaultPage.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099
  1. <template>
  2. <div class="main">
  3. <div class="topBox">
  4. <div class="upload" v-if="isSearch">
  5. <el-upload
  6. class="upload-show"
  7. :file-list="fileArr"
  8. :limit="50"
  9. :on-change="upBefore"
  10. :show-file-list="false"
  11. drag
  12. :http-request="onSuccess"
  13. multiple
  14. :on-exceed="handleExceed"
  15. element-loading-text="上传中..."
  16. element-loading-background="rgba(255, 255, 255, 0.8)"
  17. v-loading="loadingUpload"
  18. >
  19. <img src="@/assets/images/newIndex/yunBlack.png" alt="" />
  20. <span class="text1">上传文件</span>
  21. <p class="text2">
  22. 将文件拖到此处或 <span class="blueT">选择文件</span>
  23. </p>
  24. </el-upload>
  25. <div class="right">
  26. <div class="line">|</div>
  27. <img
  28. src="@/assets/images/newIndex/scan.png"
  29. @click="scannerFile"
  30. class="scanImg"
  31. alt=""
  32. />
  33. </div>
  34. </div>
  35. <div class="search hoverColor" :class="{ showSearch: isSearch }">
  36. <input
  37. type="text"
  38. class="search_input"
  39. v-model="searchText"
  40. @keyup.enter="searchBtn"
  41. placeholder="输入关键词或文件名(≥2字)"
  42. />
  43. <div class="searchBtn" @click="searchBtn">
  44. <img src="@/assets/images/newIndex/search.png" alt="" />
  45. <span>全域瞬搜</span>
  46. </div>
  47. </div>
  48. </div>
  49. <div v-if="isSearch" class="searchBtm">
  50. <div class="highSearch">
  51. <div v-loading="highLoading" v-if="highLoading" class="lodingBox"></div>
  52. <div v-else class="mainBox">
  53. <div class="title">共查询到{{ props.hightDataTotal }}个相关结果</div>
  54. <div
  55. class="list"
  56. v-infinite-scroll="setScroll"
  57. infinite-scroll-distance="30"
  58. >
  59. <div class="oneBox" v-for="item in hightData" :key="item.id">
  60. <span
  61. class="fileName hand"
  62. @click="toFile(item.content.docInfo)"
  63. >{{ item.content.docInfo==null ? '' : item.content.docInfo.fileName }}</span
  64. >
  65. <div class="flieTime">
  66. <span>创建时间:</span>
  67. <span>{{ item.content.docInfo.createTime }}</span>
  68. <div class="position">
  69. <span>文件位置:</span>
  70. <span>{{ item.content.docInfo.dir.dirPath }}</span>
  71. </div>
  72. </div>
  73. <div
  74. class="flieContent"
  75. v-for="par in item.highlightFields.content"
  76. :key="par"
  77. v-html="par"
  78. ></div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. <div class="allSearch">
  84. <div v-loading="allLoading" v-if="allLoading" class="lodingBox"></div>
  85. <div v-else>
  86. <div class="title"><span>文件名匹配结果</span></div>
  87. <div class="num">共查询到{{ props.allDataTotal }}个相关结果</div>
  88. <el-table
  89. :data="allData"
  90. style="width: 100%"
  91. ref="container"
  92. height="584"
  93. class="hand"
  94. scrollbar-always-on
  95. v-el-table-infinite-scroll="allScroll"
  96. :infinite-scroll-distance="10"
  97. @row-click="toFile"
  98. >
  99. <el-table-column type="index" width="70" />
  100. <el-table-column label="名称" width="200" :show-overflow-tooltip="true">
  101. <template #default="scope">
  102. <div class="flie_name">
  103. <img
  104. class="table_icon"
  105. :src="setIcon(scope.row.fileType)"
  106. alt=""
  107. style=""
  108. />
  109. <span v-html="scope.row==null? '' :scope.row.fileName"></span>
  110. </div>
  111. </template>
  112. </el-table-column>
  113. <el-table-column prop="dir.dirPath" label="所属空间" width="210" :show-overflow-tooltip="true" />
  114. <el-table-column prop="fileType" label="类型" width="100" />
  115. <el-table-column prop="createTime" label="时间" width="200" />
  116. <el-table-column prop="fileSize" label="大小" width="100">
  117. <template #default="scope">
  118. <div>{{ formatFileSize(scope.row.fileSize) }}</div>
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. </div>
  123. </div>
  124. </div>
  125. <div v-else class="btmBox">
  126. <div class="upFile" @paste.native="copyFile">
  127. <el-upload
  128. class="upload-demo"
  129. :file-list="fileArr"
  130. :limit="50"
  131. :on-change="upBefore"
  132. :show-file-list="false"
  133. drag
  134. :http-request="onSuccess"
  135. multiple
  136. :on-exceed="handleExceed"
  137. element-loading-text="上传中..."
  138. element-loading-background="rgba(255, 255, 255, 0.8)"
  139. v-loading="loadingUpload"
  140. >
  141. <img
  142. src="@/assets/images/newIndex/upFolderLogo.png"
  143. class="upImg"
  144. alt=""
  145. />
  146. <span class="text1">上传你的文件</span>
  147. </el-upload>
  148. <p class="text2">将文件拖到此处或点击选择文件</p>
  149. <div class="line"></div>
  150. <img
  151. src="@/assets/images/newIndex/scan.png"
  152. @click="scannerFile"
  153. class="scanImg"
  154. alt=""
  155. />
  156. <div class="text3">扫描文件</div>
  157. </div>
  158. <div class="recent">
  159. <div class="top">
  160. <span>最近文件</span>
  161. </div>
  162. <div class="list">
  163. <div
  164. v-for="item in props.tableFileData"
  165. :key="item"
  166. @click="toFile(item)"
  167. class="oneBox"
  168. >
  169. <div class="imgBox">
  170. <img :src="setImg(item == null ? '' : item.fileType)" alt="" />
  171. </div>
  172. <div class="rightBox">
  173. <el-tooltip
  174. class="box-item"
  175. effect="dark"
  176. placement="top"
  177. :show-after="1000"
  178. :content="item.fileName"
  179. >
  180. <div class="text hand">{{ item.fileName }}</div>
  181. </el-tooltip>
  182. <div class="time">{{ item.createTime }}</div>
  183. </div>
  184. <img
  185. class="openArrow"
  186. src="@/assets/images/newIndex/CaretRight.png"
  187. alt=""
  188. />
  189. </div>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. <ImgPreview
  195. :previewData="previewData"
  196. :copyFileType="copyFileType"
  197. :showPreview="showPreview"
  198. @closeImgPreview="closeImgPreview"
  199. ></ImgPreview>
  200. <!-- 扫描文档 -->
  201. <ScanFile
  202. v-if="openScan"
  203. :openScan="openScan"
  204. :scannerFiles="scannerFiles"
  205. @saveScanFile="saveScanFile"
  206. @closeOpen="closeOpen"
  207. ></ScanFile>
  208. <!-- 可用扫描仪信息 -->
  209. <div>
  210. <el-dialog v-model="checkScanner" title="扫描仪" width="30%">
  211. <div
  212. v-for="item in scannerList"
  213. :key="item.scannerId"
  214. @click="checkScanFn(item)"
  215. id="Onescan"
  216. :class="{ checkScan: item.scannerId == checkScanId }"
  217. >
  218. <img src="@/assets/images/scanImg.png" alt="" />
  219. {{ item.scannerName }}
  220. </div>
  221. <template #footer>
  222. <span class="dialog-footer">
  223. <el-button @click="closeCheckScanner">取消</el-button>
  224. <el-button type="primary" @click="sureScaner">确认</el-button>
  225. </span>
  226. </template>
  227. </el-dialog>
  228. </div>
  229. <!-- 扫描文件移动到 -->
  230. <MoveTo
  231. v-if="openScanMove"
  232. :spaceType="3"
  233. :scanFileArr="scanFileArr"
  234. :thisFolder="thisFolder"
  235. :openScanMove="openScanMove"
  236. :spaceId="spaceId"
  237. @closeOpenScanMove="closeOpenScanMove"
  238. ></MoveTo>
  239. <div
  240. v-loading.fullscreen="loadingPreview"
  241. v-if="loadingPreview"
  242. class="lodingBox"
  243. ></div>
  244. </template>
  245. <script setup>
  246. import { onMounted, ref, toRaw, inject, watchEffect } from "vue";
  247. import { setIcon, canPreviewFile } from "@/utils/index.js";
  248. import { preview } from "@/api/common/common.js";
  249. import { ElMessage, ElLoading, ElMessageBox } from "element-plus";
  250. import ImgPreview from "@/components/ImgPreview/ImgPreview.vue";
  251. import { getConfigKey } from "@/api/system/config.js";
  252. import ScanFile from "@/components/ScanFile/ScanFile.vue";
  253. import MoveTo from "@/components/MoveTo/MoveTo.vue";
  254. import myfile from "@/api/myfile/myfile";
  255. import { listInfo, selectInfo, getFileByScanerId } from "@/api/scanner/info.js";
  256. import documents from "@/api/document/document";
  257. import uploadApi from "@/api/upload/upload";
  258. import bus from "@/utils/bus.js";
  259. import { default as vElTableInfiniteScroll } from "el-table-infinite-scroll";
  260. const copyFileType = ref();
  261. const previewData = ref();
  262. const loadingPreview = ref(false);
  263. const showPreview = ref(false);
  264. let fileArr = ref([]);
  265. const useSpace = ref();
  266. let fileBig = ref(0);
  267. const allSpace = ref();
  268. const maxFileSize = ref(); //能上传的最大size
  269. const loadingUpload = ref(false);
  270. const topDirId = ref(); //我的文件顶层的目录id
  271. const topSpaceId = ref(); //我的文件顶层的目录id
  272. const scannerList = ref(); // 扫描仪数据
  273. const checkScanId = ref(); // 选中的scan的id
  274. const checkScanner = ref(false); //显示扫描仪选择框
  275. const scannerFiles = ref([]); //选择的扫描仪的文件
  276. const openScanMove = ref(false);
  277. const openScan = ref(false); //控制扫描文档显示
  278. const scanFileArr = ref([]); //认领的扫描文件数组
  279. const isSearch = ref(props.showSearch);
  280. const searchText = ref(); // 搜索内容
  281. const hightData = ref([]); // 高级搜索数据
  282. const allData = ref([]); // 全域搜索数据
  283. const canSearch = ref(true);
  284. const allLoading = ref(false);
  285. const highLoading = ref(false);
  286. const highPage = ref(1);
  287. const allPage = ref(1);
  288. const highEnd = ref(false);
  289. const allEnd = ref(false);
  290. const emit = defineEmits([
  291. "openMaxmin",
  292. "changeSearch",
  293. "highSearch",
  294. "allSearch",
  295. ]);
  296. const props = defineProps({
  297. showSearch: {
  298. type: Boolean,
  299. default: false,
  300. },
  301. hightData: {
  302. type: Array,
  303. default: () => [],
  304. },
  305. allData: {
  306. type: Array,
  307. default: () => [],
  308. },
  309. hightDataTotal: {
  310. type: Number,
  311. default: 0,
  312. },
  313. allDataTotal: {
  314. type: Number,
  315. default: 0,
  316. },
  317. highSearching: {
  318. type: Boolean,
  319. default: false,
  320. },
  321. allSearching: {
  322. type: Boolean,
  323. default: false,
  324. },
  325. tableFileData: {
  326. type: Array,
  327. default: () => [],
  328. },
  329. highEnd: {
  330. type: Boolean,
  331. default: false,
  332. },
  333. allEnd: {
  334. type: Boolean,
  335. default: false,
  336. },
  337. });
  338. //搜索事件
  339. const searchBtn = () => {
  340. // console.log("searchText", searchText.value);
  341. if (!canSearch.value) {
  342. return;
  343. } else {
  344. canSearch.value = false;
  345. setTimeout(() => {
  346. canSearch.value = true;
  347. }, 3000);
  348. }
  349. if (!searchText.value) {
  350. ElMessage({
  351. message: "请输入关键字",
  352. type: "error",
  353. });
  354. return;
  355. }
  356. highPage.value = 1;
  357. allPage.value = 1;
  358. emit("changeSearch", true, searchText.value);
  359. };
  360. // 打开最近文件
  361. const toFile = async (row) => {
  362. copyFileType.value = row.fileType;
  363. // console.log("row", row);
  364. loadingPreview.value = true;
  365. const filePreview = canPreviewFile(row.fileType);
  366. if (filePreview) {
  367. loadingPreview.value = false;
  368. emit(
  369. "openMaxmin",
  370. row.fileName,
  371. `${window.location.origin}/fileEdit?clickRowId=${row.docId}&canEdit=0&canCopy=0&history=0&fileId=0`
  372. );
  373. } else {
  374. const res = await preview(row.docId);
  375. showPreview.value = true;
  376. previewData.value = URL.createObjectURL(res);
  377. loadingPreview.value = false;
  378. }
  379. };
  380. // 高级搜索触底加载
  381. const setScroll = async () => {
  382. if (highEnd.value) return;
  383. highPage.value++;
  384. emit("highSearch", highPage.value);
  385. };
  386. // all搜索触底加载
  387. const allScroll = async () => {
  388. if (allEnd.value) return;
  389. allPage.value++;
  390. emit("allSearch", allPage.value);
  391. };
  392. // 设置icon
  393. const setImg = (type) => {
  394. return setIcon(type);
  395. };
  396. //关闭图片预览事件
  397. const closeImgPreview = () => {
  398. // console.log('close');
  399. showPreview.value = false;
  400. };
  401. // 限制上传文件大小
  402. const upBefore = (file, files) => {
  403. const maxSize = (maxFileSize.value - 0) * 1024 * 1024;
  404. // console.log('maxSize',maxSize);
  405. if (file.size > maxSize) {
  406. files.pop();
  407. ElMessage({
  408. message:
  409. file.name + "上传失败,上传文件大小最大为" + maxFileSize.value + "M",
  410. type: "error",
  411. });
  412. } else {
  413. fileBig.value = file.size + fileBig.value;
  414. // fileArr.value.push(file.raw)
  415. }
  416. // console.log('filesend',files);
  417. };
  418. // 我的文件的空间信息
  419. function getSpaceList() {
  420. myfile.fileType(3).then((res) => {
  421. useSpace.value = res.data.usedCap;
  422. allSpace.value = res.data.spaceCap;
  423. });
  424. }
  425. //获取我的文件顶层的目录id
  426. const getDirId = () => {
  427. documents.getTop(3).then((res) => {
  428. topDirId.value = res.dirId;
  429. topSpaceId.value = res.spaceId;
  430. });
  431. };
  432. function onSuccess(files, val) {
  433. if(!loadingUpload.value){
  434. const maxSize = (maxFileSize.value - 0) * 1024 * 1024;
  435. if (files.file.size < maxSize) {
  436. fileArr.value.push(files.file);
  437. }
  438. sureUpload(); //没有文件在上传,立即上传
  439. }else{
  440. //当前有文件正在上传,排队等待上传
  441. setTimeout(() => {
  442. onSuccess(files,val)
  443. }, 1000);
  444. }
  445. }
  446. const handleExceed = (files, fileList)=> {
  447. ElMessage({
  448. message: "同时上传文件数超过文件最大数量50",
  449. type: "error",
  450. });
  451. }
  452. // 确认上传
  453. function sureUpload() {
  454. loadingUpload.value = true;
  455. if (
  456. useSpace.value * 1024 * 1024 + fileBig.value / 1024 >
  457. allSpace.value * 1024 * 1024
  458. ) {
  459. ElMessage({
  460. message: "当前文件空间占用已超过最大容量,请联系管理员扩容",
  461. type: "error",
  462. });
  463. loadingUpload.value = false;
  464. fileArr.value = []
  465. return;
  466. } else {
  467. if (fileArr.value.length > 0) {
  468. // console.log('fileArr',fileArr.value);
  469. let form = new FormData();
  470. let filename = ""
  471. for (var i = 0; i < fileArr.value.length; i++) {
  472. form.append("files", fileArr.value[i]);
  473. filename = fileArr.value[i].name
  474. }
  475. form.append("spaceId", topSpaceId.value);
  476. form.append("dirId", topDirId.value);
  477. // console.error(fileArr.value);
  478. uploadApi
  479. .uploadFileMany(form)
  480. .then((res) => {
  481. if (res.code === 200) {
  482. ElMessage({
  483. message: filename+"上传成功",
  484. type: "success",
  485. });
  486. loadingUpload.value = false;
  487. fileArr.value = [];
  488. fileBig.value = 0;
  489. const storage = sessionStorage.getItem("tagList");
  490. if (storage != null) {
  491. const oldStorage = JSON.parse(storage);
  492. // 判断是否存在myfile
  493. const myfileTag = oldStorage.find((item) =>
  494. item.path.includes("myfile")
  495. );
  496. if (myfileTag !=null && myfileTag.id) {
  497. const tagIfarme = document.querySelector(
  498. `#${myfileTag.id} iframe`
  499. );
  500. const iframeWindow = tagIfarme.contentWindow.window;
  501. iframeWindow.$refreshFile();
  502. } else {
  503. return;
  504. }
  505. }
  506. }else{
  507. loadingUpload.value = false;
  508. fileArr.value = [];
  509. ElMessage({
  510. message: filename+"上传失败:"+res.msg,
  511. type: "error",
  512. });
  513. }
  514. })
  515. .catch((err) => {
  516. loadingUpload.value = false;
  517. fileArr.value = [];
  518. ElMessage({
  519. message: filename+"上传失败:"+err.message,
  520. type: "error",
  521. });
  522. });
  523. } else {
  524. loadingUpload.value = false;
  525. //return ElMessage({ message: "请选择文件", type: "error" });
  526. }
  527. }
  528. }
  529. //获取扫描仪列表
  530. const scannerFile = async () => {
  531. const res = await selectInfo();
  532. scannerList.value = res.rows;
  533. checkScanner.value = true;
  534. checkScanId.value = null;
  535. // console.log('scanner',res);
  536. };
  537. // 选择扫描仪
  538. const checkScanFn = (item) => {
  539. checkScanId.value = item.scannerId;
  540. };
  541. // 确认选择扫描仪 获取扫描仪下文件列表
  542. const sureScaner = async () => {
  543. if (!checkScanId.value) return;
  544. const res = await getFileByScanerId(checkScanId.value);
  545. // console.log("sureScanerres", res);
  546. scannerFiles.value = res.data;
  547. checkScanner.value = false;
  548. openScan.value = true;
  549. };
  550. // 关闭窗口
  551. const closeCheckScanner = () => {
  552. checkScanner.value = false;
  553. };
  554. const closeOpen = () => {
  555. openScan.value = false;
  556. };
  557. // 移动到事件
  558. const saveScanFile = (arr) => {
  559. // console.log("arr", arr);
  560. openScan.value = false;
  561. scanFileArr.value = arr;
  562. openScanMove.value = true;
  563. };
  564. // 关闭窗口
  565. const closeOpenScanMove = () => {
  566. openScanMove.value = false;
  567. // refreshFile();
  568. };
  569. //粘贴文件上传
  570. const copyFile = (event) => {
  571. const items = (event.clipboardData || window.clipboardData).items;
  572. console.log("files:", event.clipboardData);
  573. let file = null;
  574. if (!items || items.length === 0) {
  575. ElMessage({
  576. message: "请选当前浏览器不支持本地或请打开图片再复制择文件",
  577. type: "error",
  578. });
  579. return;
  580. }
  581. // // 搜索剪切板items
  582. // for (let i = 0; i < items.length; i++) {
  583. // if (items[i].type.indexOf("image") !== -1) {
  584. // file = items[i].getAsFile();
  585. // break;
  586. // }
  587. // }
  588. };
  589. function formatFileSize(fileSize) {
  590. if (fileSize >= 1024 * 1024 * 1024) {
  591. // 大于等于1GB,显示GB
  592. return (fileSize / (1024 * 1024 * 1024)).toFixed(2) + "GB";
  593. } else if (fileSize >= 1024 * 1024) {
  594. // 大于等于1MB,显示MB
  595. return (fileSize / (1024 * 1024)).toFixed(2) + "MB";
  596. } else if (fileSize >= 1024) {
  597. // 大于等于1KB,显示KB
  598. return (fileSize / 1024).toFixed(2) + "KB";
  599. } else {
  600. // 小于1KB,显示字节
  601. return fileSize + "B";
  602. }
  603. }
  604. const clearSearchText = ()=>{
  605. searchText.value = '';
  606. }
  607. //暴露clearSearchText方法
  608. defineExpose({
  609. clearSearchText
  610. });
  611. watchEffect(() => {
  612. if (props.showSearch) {
  613. isSearch.value = true;
  614. } else {
  615. isSearch.value = false;
  616. }
  617. });
  618. watch(
  619. () => props.hightData,
  620. (newValue, oldValue) => {
  621. // console.log('iFrameData 发生改变了', newValue, oldValue);
  622. hightData.value = newValue;
  623. },
  624. {
  625. immediate: true,
  626. deep: true,
  627. }
  628. );
  629. watch(
  630. () => props.allData,
  631. (newValue, oldValue) => {
  632. // console.log('iFrameData 发生改变了', newValue, oldValue);
  633. allData.value = newValue;
  634. },
  635. {
  636. immediate: true,
  637. deep: true,
  638. }
  639. );
  640. watch(
  641. () => props.highSearching,
  642. (newValue, oldValue) => {
  643. highLoading.value = newValue;
  644. },
  645. {
  646. immediate: true,
  647. deep: true,
  648. }
  649. );
  650. watch(
  651. () => props.allSearching,
  652. (newValue, oldValue) => {
  653. allLoading.value = newValue;
  654. },
  655. {
  656. immediate: true,
  657. deep: true,
  658. }
  659. );
  660. watch(
  661. () => props.highEnd,
  662. (newValue, oldValue) => {
  663. highEnd.value = newValue;
  664. },
  665. {
  666. immediate: true,
  667. deep: true,
  668. }
  669. );
  670. watch(
  671. () => props.allEnd,
  672. (newValue, oldValue) => {
  673. allEnd.value = newValue;
  674. },
  675. {
  676. immediate: true,
  677. deep: true,
  678. }
  679. );
  680. onMounted(() => {
  681. getSpaceList();
  682. getDirId();
  683. getConfigKey("file.size.limit").then((response) => {
  684. // console.log('response',response);
  685. maxFileSize.value = response.msg;
  686. });
  687. });
  688. </script>
  689. <style lang="scss" scoped>
  690. .main {
  691. width: 100%;
  692. height: calc(100vh - 160px);
  693. display: flex;
  694. padding: 16px 16px 0 16px;
  695. flex-direction: column;
  696. justify-content: center;
  697. align-items: center;
  698. }
  699. .topBox {
  700. width: 100%;
  701. display: flex;
  702. justify-content: center;
  703. .upload {
  704. width: 448px;
  705. height: 64px;
  706. border-radius: 86px 86px 86px 86px;
  707. background-color: #fff;
  708. margin-right: 16px;
  709. padding: 0 24px;
  710. display: flex;
  711. align-items: center;
  712. justify-content: space-between;
  713. .right {
  714. margin-top: 12px;
  715. width: 50px;
  716. display: flex;
  717. justify-content: space-between;
  718. align-items: center;
  719. .line {
  720. height: 100%;
  721. width: 1px;
  722. color: #dbdbdb;
  723. line-height: 40px;
  724. }
  725. .scanImg {
  726. width: 32px;
  727. height: 32px;
  728. cursor: pointer;
  729. }
  730. }
  731. img {
  732. width: 40px;
  733. height: 40px;
  734. }
  735. .text1 {
  736. margin-left: 8px;
  737. font-family: Inter-Bold;
  738. font-size: 18px;
  739. color: #030102;
  740. }
  741. .text2 {
  742. margin-left: 24px;
  743. font-weight: 400;
  744. font-size: 16px;
  745. font-family: Inter-Regular;
  746. color: #7c808d;
  747. .blueT {
  748. font-size: 16px;
  749. font-family: Inter-Medium;
  750. color: #2e8bf6;
  751. text-decoration-line: underline;
  752. }
  753. }
  754. .upload-show {
  755. width: 100px;
  756. height: 40px;
  757. }
  758. :deep(.el-upload) {
  759. width: 350px !important;
  760. height: 48px !important;
  761. display: flex !important;
  762. align-items: center !important;
  763. // height: 40px !important;
  764. }
  765. :deep(.el-upload-dragger) {
  766. padding: 0;
  767. border: none;
  768. display: flex;
  769. justify-content: flex-start !important;
  770. align-items: center !important;
  771. flex-direction: row !important;
  772. }
  773. }
  774. }
  775. .search {
  776. width: 1232px;
  777. // width: 600px;
  778. height: 64px;
  779. background-color: #2e8bf6;
  780. border-radius: 86px 86px 86px 86px;
  781. display: flex;
  782. justify-content: space-between;
  783. padding-right: 24px;
  784. .search_input {
  785. width: 1080px;
  786. height: 100%;
  787. border: none;
  788. outline: none;
  789. background-color: #fff;
  790. padding-left: 20px;
  791. border-radius: 86px 86px 86px 86px;
  792. }
  793. .searchBtn {
  794. color: #fff;
  795. font-size: 18px;
  796. cursor: pointer;
  797. display: flex;
  798. justify-content: center;
  799. align-items: center;
  800. font-family: Inter-Bold;
  801. span {
  802. margin-left: 8px;
  803. }
  804. }
  805. }
  806. .showSearch {
  807. width: 1424px !important;
  808. .search_input {
  809. width: 1272px !important;
  810. }
  811. }
  812. // 主页
  813. .btmBox {
  814. margin-top: 16px;
  815. width: 1232px;
  816. height: 624px;
  817. display: flex;
  818. justify-content: space-between;
  819. .upFile {
  820. width: 494px;
  821. height: 100%;
  822. background-color: #fff;
  823. border-radius: 16px 16px 16px 16px;
  824. display: flex;
  825. flex-direction: column;
  826. align-items: center;
  827. justify-content: center;
  828. .upImg {
  829. width: 194px;
  830. height: 128px;
  831. }
  832. .text1 {
  833. font-style: 18px;
  834. color: #2e8bf6;
  835. font-family: Inter-Bold;
  836. margin-top: 16px;
  837. margin-bottom: 8px;
  838. }
  839. .text2 {
  840. font-weight: 400;
  841. font-size: 16px;
  842. font-family: Inter-Regular;
  843. color: #7c808d;
  844. span {
  845. font-weight: 500;
  846. font-size: 16px;
  847. color: #2e8bf6;
  848. text-decoration-line: underline;
  849. }
  850. }
  851. .text3 {
  852. font-family: Inter-Regular;
  853. font-size: 14px;
  854. color: #7c808d;
  855. margin-top: 8px;
  856. }
  857. .line {
  858. margin-top: 16px;
  859. width: 124px;
  860. height: 1px;
  861. border-top: 1px solid #dbdbdb;
  862. }
  863. .scanImg {
  864. width: 32px;
  865. height: 32px;
  866. margin-top: 16px;
  867. cursor: pointer;
  868. }
  869. }
  870. .recent {
  871. width: 722px;
  872. height: 100%;
  873. background-color: #fff;
  874. border-radius: 16px 16px 16px 16px;
  875. padding: 24px;
  876. .top {
  877. width: 100%;
  878. height: 42px;
  879. border-bottom: 1px solid #dbdbdb;
  880. span {
  881. font-weight: bold;
  882. font-size: 18px;
  883. color: #030102;
  884. }
  885. }
  886. .list {
  887. width: 100%;
  888. height: calc(624px - 42px - 1px - 24px);
  889. overflow-y: auto;
  890. // padding-top: 12px;
  891. box-sizing: border-box;
  892. .oneBox {
  893. width: 100%;
  894. height: 60px;
  895. padding: 8px 22px;
  896. box-sizing: border-box;
  897. border-radius: 12px 12px 12px 12px;
  898. display: flex;
  899. align-items: center;
  900. .imgBox {
  901. width: 44px;
  902. height: 44px;
  903. border-radius: 8px 8px 8px 8px;
  904. border: 1px solid #d0d6e6;
  905. display: flex;
  906. justify-content: center;
  907. align-items: center;
  908. img {
  909. width: 32px;
  910. height: 32px;
  911. }
  912. }
  913. .rightBox {
  914. margin-left: 12px;
  915. width: calc(100% - 44px - 12px);
  916. display: flex;
  917. flex-direction: column;
  918. justify-content: space-between;
  919. .text {
  920. font-family: Inter-Medium;
  921. font-size: 16px;
  922. color: #030102;
  923. /*第一步: 溢出隐藏 */
  924. overflow: hidden;
  925. /* 第二步:让文本不会换行, 在同一行继续 */
  926. white-space: nowrap;
  927. /* 第三步:用省略号来代表未显示完的文本 */
  928. text-overflow: ellipsis;
  929. }
  930. .time {
  931. font-weight: 500;
  932. font-size: 12px;
  933. color: #7c808d;
  934. }
  935. }
  936. .openArrow {
  937. width: 20px;
  938. height: 20px;
  939. }
  940. &:hover {
  941. background: #f6f6f6;
  942. .imgBox {
  943. border: 1px solid #2e8bf6;
  944. }
  945. }
  946. }
  947. }
  948. }
  949. }
  950. // 搜索结果页面
  951. .searchBtm {
  952. width: 100%;
  953. height: 699px;
  954. margin-top: 16px;
  955. display: flex;
  956. justify-content: space-between;
  957. .highSearch {
  958. width: 936px;
  959. height: 699px;
  960. border-radius: 16px 16px 16px 16px;
  961. background: #ffffff;
  962. padding: 24px;
  963. .mainBox {
  964. width: 100%;
  965. height: 100%;
  966. }
  967. .title {
  968. width: 100%;
  969. height: 22px;
  970. font-family: Inter-Regular;
  971. font-size: 14px;
  972. line-height: 22px;
  973. }
  974. .list {
  975. margin-top: 12px;
  976. height: calc(100% - 48px - 12px);
  977. overflow-y: auto;
  978. .oneBox {
  979. width: 100%;
  980. // height: 120px;
  981. border-bottom: 1px dashed #c1cce3;
  982. padding-bottom: 16px;
  983. padding-top: 16px;
  984. .fileName {
  985. font-size: 16px;
  986. color: #2e6bc8;
  987. font-family: Inter-Medium;
  988. text-decoration: underline;
  989. cursor: pointer;
  990. }
  991. .flieTime {
  992. font-size: 12px;
  993. font-family: Inter-Medium;
  994. color: #7c808d;
  995. // line-height: 20px;
  996. vertical-align: middle;
  997. display: flex;
  998. align-items: center;
  999. margin: 4px 0;
  1000. span {
  1001. margin-left: 4px;
  1002. }
  1003. }
  1004. .flieContent {
  1005. width: 100%;
  1006. font-size: 14px;
  1007. color: #000000;
  1008. font-family: Inter-Regular;
  1009. line-height: 22px;
  1010. display: -webkit-box;
  1011. -webkit-box-orient: vertical;
  1012. text-overflow: ellipsis;
  1013. -webkit-line-clamp: 3; //超过3行显示省略号
  1014. overflow: hidden;
  1015. }
  1016. }
  1017. }
  1018. }
  1019. .allSearch {
  1020. width: 936px;
  1021. height: 699px;
  1022. border-radius: 16px 16px 16px 16px;
  1023. background: #ffffff;
  1024. padding: 24px;
  1025. .title {
  1026. width: 100%;
  1027. height: 42px;
  1028. border-bottom: 1px solid #dbdbdb;
  1029. span {
  1030. font-family: Inter-Bold;
  1031. font-size: 18px;
  1032. color: #030102;
  1033. }
  1034. }
  1035. .num {
  1036. font-size: 14px;
  1037. font-family: Inter-Regular;
  1038. color: #555d72;
  1039. margin-top: 12px;
  1040. }
  1041. .table_icon {
  1042. height: 27px;
  1043. width: 27px;
  1044. vertical-align: middle;
  1045. }
  1046. //表格文本超出隐藏
  1047. :deep(.flie_name, .folder) {
  1048. font-family: Inter-Regular;
  1049. /*第一步: 溢出隐藏 */
  1050. overflow: hidden;
  1051. /* 第二步:让文本不会换行, 在同一行继续 */
  1052. white-space: nowrap;
  1053. /* 第三步:用省略号来代表未显示完的文本 */
  1054. text-overflow: ellipsis;
  1055. }
  1056. }
  1057. }
  1058. .lodingBox {
  1059. position: relative;
  1060. width: 100%;
  1061. height: 100%;
  1062. z-index: 10000000;
  1063. }
  1064. .checkScan {
  1065. background-color: #f5f7f9;
  1066. }
  1067. #Onescan {
  1068. height: 48px;
  1069. line-height: 48px;
  1070. font-size: 14px;
  1071. display: flex;
  1072. align-items: center;
  1073. }
  1074. ::v-deep .el-upload-dragger {
  1075. display: flex;
  1076. flex-direction: column;
  1077. justify-content: center;
  1078. }
  1079. //关键字背景色
  1080. :deep(em) {
  1081. background: #fff0ba !important;
  1082. }
  1083. .hoverColor {
  1084. &:hover {
  1085. background-color: #236ec3;
  1086. }
  1087. }
  1088. .hand {
  1089. cursor: pointer;
  1090. }
  1091. </style>