MyFile.vue 89 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296
  1. <template>
  2. <div>
  3. <div class="bigBox">
  4. <div class="settingBox" @click="mouseClick">
  5. <!-- 设置盒子顶部搜索 -->
  6. <div class="topSearch">
  7. <div class="spaceName">{{spaceName}}</div>
  8. <div>
  9. <el-icon v-hasRole="['dept']" @click="createNewMenu(1, true)" color="#505870" size="24">
  10. <Plus />
  11. </el-icon>
  12. <!-- @click="createNewFile" -->
  13. </div>
  14. </div>
  15. <!-- 方块点击盒子 -->
  16. <div
  17. style="height: 75vh;overflow-y: auto;">
  18. <div class="searchBox">
  19. <el-input v-model="searchFire" class="searchFire" size="large" placeholder="搜索文件" />
  20. <el-icon class="SearchIcon">
  21. <Search />
  22. </el-icon>
  23. </div>
  24. <!-- v-for盒子 -->
  25. <div style="display: flex;justify-content: flex-start;align-items: flex-start;flex-wrap: wrap;align-content: flex-start;overflow-y: auto;">
  26. <template v-for="(item, index) in fileMenu" :key="index">
  27. <div class="setBox" >
  28. <el-dropdown trigger="click" class="selectChe">
  29. <span class="el-dropdown-link">
  30. ...
  31. </span>
  32. <template #dropdown>
  33. <el-dropdown-menu>
  34. <el-dropdown-item @click="restName(item, index)">重命名</el-dropdown-item>
  35. <el-dropdown-item v-if="item.dirType == '2' && isDept" @click="upFirstFoler(item)">编辑</el-dropdown-item>
  36. <el-dropdown-item v-if="item.dirType == '1'" @click="delName(item, index)">删除</el-dropdown-item>
  37. </el-dropdown-menu>
  38. </template>
  39. </el-dropdown>
  40. <div class="left_fileBox" @click="changeFile(item, index)">
  41. <el-tooltip
  42. class="box-item tool-tip"
  43. effect="dark"
  44. placement="top-start"
  45. v-if="item.encryptLevel"
  46. >
  47. <template #content> 安全级别: {{ item.encryptLevel == 'L1'?'敏感':(item.encryptLevel == 'L2'?'涉密':(item.encryptLevel == 'L3'?'机密':'绝密')) }} </template>
  48. <img :src="item.dirType=='1'?ordinaryList:fileStyle" style="width: 72px;height: 72px;" class="shouzhi">
  49. </el-tooltip>
  50. <img :src="item.dirType=='1'?ordinaryList:fileStyle" class="shouzhi" style="width: 72px;height: 72px;" v-else>
  51. <el-tooltip
  52. class="box-item tool-tip"
  53. effect="dark"
  54. placement="top-start"
  55. > <template #content> <span>{{ item.dirName }}</span></template>
  56. <p class="ellipsis-text shouzhi">{{ item.dirName }}</p>
  57. </el-tooltip>
  58. <img class="levelImg shouzhi" v-if="item.isEncrypt === 'Y'" :src="getLevelImg(item.encryptLevel)" alt="">
  59. </div>
  60. </div>
  61. </template>
  62. </div>
  63. </div>
  64. <div class="expansion">
  65. <div class="top_box">
  66. <span style="margin-left: 5px;font-size: 14px;font-weight: 500;">{{ formatStorage(useSpace) }}/{{ allSpace + "G" }}</span>
  67. <span style="margin-left: 5px;font-size: 14px;color: #2E6BC8;cursor: pointer;"
  68. @click="askApply">申请扩容</span>
  69. </div>
  70. <el-progress style="margin-left: 8px;" :stroke-width="12" color='#2E6BC8' :percentage="percent()" />
  71. </div>
  72. </div>
  73. <!-- 右侧大盒子 -->
  74. <div class="mesBox">
  75. <!-- 展示文件夹盒子 -->
  76. <!-- 文件夹 -->
  77. <div v-if="editOnline">
  78. <!-- 众多功能 -->
  79. <div class="manyUse">
  80. <div v-if="thisRole.some(item=>item == 'upload') || isDept"
  81. style="display: flex;width: 92px;height: 32px;justify-content: flex-start;align-items: center;line-height: 18px;">
  82. <div style="margin-left: 5px;">
  83. <img src="../../assets/images/upload.png" style="width: 24px;height: 24px;" alt="">
  84. </div>
  85. <div style="margin-left: 5px;">
  86. <span style="color: black;cursor: pointer;" @click="uploadModal = true" class="shouzhi">上传
  87. </span>
  88. </div>
  89. </div>
  90. <div v-else
  91. style="display: flex;width: 92px;opacity:0.5;height: 32px;justify-content: flex-start;align-items: center;line-height: 18px;">
  92. <div style="margin-left: 5px;">
  93. <img src="../../assets/images/upload.png" style="width: 24px;height: 24px;" alt="">
  94. </div>
  95. <div style="margin-left: 5px;">
  96. <span style="color: black;cursor: pointer;" class="shouzhi">上传
  97. </span>
  98. </div>
  99. </div>
  100. <div v-if="(!thisFolder.dirType) || !isDept"
  101. style="display: flex;width: 102px;opacity:0.5;height: 32px;justify-content: flex-start;align-items: center;">
  102. <div style="margin-left: 5px;">
  103. <el-icon
  104. style="background-color: #7084B4;width: 24px;height: 24px;border-radius: 50%;color: white;"
  105. >
  106. <Plus />
  107. </el-icon>
  108. </div>
  109. <div style="margin-left: 5px;">
  110. <span style="font-size: 14px;" class="shouzhi">新建目录</span>
  111. </div>
  112. </div>
  113. <div v-else
  114. style="display: flex;width: 102px;height: 32px;justify-content: flex-start;align-items: center;">
  115. <div style="margin-left: 5px;">
  116. <el-icon
  117. style="background-color: #7084B4;width: 24px;height: 24px;border-radius: 50%;color: white;"
  118. @click="createNewMenu(0)">
  119. <Plus />
  120. </el-icon>
  121. </div>
  122. <div style="margin-left: 5px;" @click="createNewMenu(0)">
  123. <span style="font-size: 14px;" class="shouzhi">新建目录</span>
  124. </div>
  125. </div>
  126. <template v-for="(item, index) in useMenu" :key="index">
  127. <div :class="{ 'isCheck': (haveCheck && thisRole.some(item=>item == 'delete')||haveCheck && isDept) }"
  128. style="display: flex;width: 82px;opacity:0.5;height: 32px;justify-content: flex-start;align-items: center;line-height: 18px;cursor: pointer;"
  129. @click="getMenu(item, index)">
  130. <div style="margin-left: 5px;">
  131. <img :src="item.img" style="width: 24px;height: 24px;" alt="">
  132. </div>
  133. <div style="margin-left: 5px;">
  134. <span style="font-size: 14px;" class="shouzhi">{{ item.name }}</span>
  135. </div>
  136. </div>
  137. </template>
  138. </div>
  139. <!-- 面包屑功能栏 -->
  140. <div class="breadBox">
  141. <!-- 左侧 -->
  142. <div style="display: flex;justify-content: space-around;align-items: center;margin-left: 10px;">
  143. <!-- 前进后退 -->
  144. <div style="display: flex;justify-content: space-around;align-items: center;margin-right: 5px;" >
  145. <img style="display:block;width: 11px;height: 11px;" :src="blueLeft" alt=""
  146. @click="arrowLift">
  147. <img style="display:block;width: 16px;height: 16px;" :src="grayRight" alt="">
  148. </div>
  149. <!-- 面包屑 -->
  150. <div class="topPath">
  151. {{ topPath }}
  152. <!-- <BreadMenu></BreadMenu> -->
  153. </div>
  154. </div>
  155. <!-- 右侧 -->
  156. <div>
  157. <img :src="sort" alt="">
  158. <!-- //控制宫格展示 -->
  159. <img
  160. v-if="fileGrid"
  161. src="@/assets/images/squre.png"
  162. class="shouzhi palace-grid"
  163. alt=""
  164. @click="changeShow(true)"
  165. />
  166. <img
  167. v-else
  168. src="@/assets/images/Frame_187.png"
  169. class="shouzhi palace-grid"
  170. alt=""
  171. @click="changeShow(false)"
  172. />
  173. <!-- <img :src="squre" alt="" @click="gridChange" class="shouzhi"> -->
  174. </div>
  175. </div>
  176. <!-- </div> -->
  177. <!-- 展示文件夹盒子 -->
  178. <!-- 文件夹 -->
  179. <div class="showBox">
  180. <div class="detailBox file-jia" @click="mouseClick">
  181. <el-collapse v-model="folder">
  182. <el-collapse-item name="1" class="custom-collapse-item">
  183. <template #title>
  184. <span class="file-title">文件夹</span>
  185. </template>
  186. <el-table v-if="fileGrid == 1" :data="folderList" height="37vh" style="width: 100%" :scrollbar-always-on="true"
  187. @selection-change="handleSelectionChange1" :single-select="true" @row-click="folderClick"
  188. @row-contextmenu="folderRClick" ref="taskTableRef">
  189. <el-table-column type="selection" width="55" />
  190. <el-table-column label="名称" width="180">
  191. <template #default="scope">
  192. <span class="juzhong">
  193. <el-icon v-if="scope.row.isFavorite == 'N'" @click.stop="collectByStar(scope.row,true)" class="juli">
  194. <Star />
  195. </el-icon>
  196. <img v-else @click.stop="delCollect(scope.row,true)" src="../../assets/images/yellowstar.png" alt="" class="juli">
  197. <img :src="scope.row.dirType=='1'?ordinary:fileBox" style="width: 20px;height: 24px;"
  198. alt="" class="juli">
  199. <span class="shouzhi"> {{ scope.row.dirName }}</span>
  200. </span>
  201. </template>
  202. </el-table-column>
  203. <el-table-column prop="createTime" label="时间" width="180" />
  204. <el-table-column prop="dirType" label="类型">
  205. <template #default="scope">
  206. <span v-if="scope.row.dirType == '1'">普通目录</span>
  207. <span v-else>组织目录</span>
  208. </template>
  209. </el-table-column>
  210. <el-table-column label="加密等级">
  211. <template #default="scope">
  212. <span>
  213. {{setTablelevel(scope.row.encryptLevel)}}
  214. </span>
  215. </template>
  216. </el-table-column>
  217. </el-table>
  218. <PlaceGridFolder v-else @folderClick="folderClick" :restName="restName"
  219. :collectFolder="collectFolder" :getAllTop="getAllTop" @folderBack="folderBack" :thisFolder="thisFolder" :impDirId="impDirId">
  220. </PlaceGridFolder>
  221. </el-collapse-item>
  222. </el-collapse>
  223. <!-- 右键唤出的菜单 -->
  224. <div class="right_menu" v-if="folderVisible"
  225. :style="{ left: folderleft + 'px', top: foldertop + 'px' }">
  226. <!-- <div class="menu_item" @click="folderClick(null, null)">
  227. <img src="@/assets/images/trash.png" alt="" />
  228. <span>打开</span>
  229. </div> -->
  230. <div class="menu_item" @click="restName(null, null)">
  231. <img src="@/assets/images/textbox.png" alt="" />
  232. <span class="shouzhi">重命名</span>
  233. </div>
  234. <div class="menu_item" @click="collectFolder">
  235. <img src="@/assets/images/collect.png" alt="" />
  236. <span class="shouzhi">收藏</span>
  237. </div>
  238. </div>
  239. </div>
  240. <!-- 文件 -->
  241. <div class="fileTable">
  242. <el-collapse v-model="files" >
  243. <el-collapse-item name="2" class="">
  244. <template #title>
  245. <span class="file-title">文件</span>
  246. </template>
  247. <el-table v-el-table-infinite-scroll="setScroll" :infinite-scroll-distance="30" :infinite-scroll-disabled="tableBeEnd" v-if="fileGrid == 1" height="38vh" :data="fileList" :scrollbar-always-on="true" style="width: 100%"
  248. @row-contextmenu="handleRowClick" @selection-change="handleSelectionChange"
  249. @row-click="mouseClick" :default-sort="{ prop: 'createTime', order: 'descending' }">
  250. <el-table-column type="selection" width="55" />
  251. <el-table-column label="名称" width="200">
  252. <template #default="scope">
  253. <span style="white-space: nowrap;overflow: hidden;text-overflow: ellipsis;" class="juzhong">
  254. <el-icon v-if="scope.row.isFavorite == 'N'" @click.stop="collectByStar(scope.row,false)">
  255. <Star />
  256. </el-icon>
  257. <img v-else @click.stop="delCollect(scope.row,false)" src="../../assets/images/yellowstar.png" alt="" class="juli">
  258. <img :src="getImage(scope.row.fileType)" alt="" class="juli">
  259. <el-tooltip
  260. class="box-item"
  261. effect="dark"
  262. placement="top"
  263. :show-after="1000"
  264. :content="scope.row.fileName"
  265. >
  266. <!-- <template #content> {{ scope.row.encryptLevel == 'L1'?'敏感':(scope.row.encryptLevel == 'L2'?'涉密':(scope.row.encryptLevel == 'L3'?'机密':'绝密')) }} </template> -->
  267. <span class="shouzhi">{{ scope.row.fileName }}</span>
  268. </el-tooltip>
  269. </span>
  270. </template>
  271. </el-table-column>
  272. <el-table-column prop="createTime" label="时间" sortable width="180" />
  273. <el-table-column prop="fileType" label="类型" />
  274. <el-table-column label="大小">
  275. <template #default="scope">
  276. <span>
  277. {{ formatFileSize(scope.row.fileSize) }}
  278. </span>
  279. </template>
  280. </el-table-column>
  281. </el-table>
  282. <PalaceGridFile v-else @showFile="showFile" :getAllTop="getAllTop" @navBack="navBack"
  283. @lastBB="lastBB" @onlineCase="onlineCase" @shareBack="shareBack" :thisFolder="thisFolder" :fileList="fileList"></PalaceGridFile>
  284. </el-collapse-item>
  285. </el-collapse>
  286. <div :class="{'setCli':!noMenuItem}" v-if="cliCC" :style="{ left: xz + 'px', top: yz -100 + 'px' }">
  287. <template v-for="(item, index) in filterMouseCli()" :key="index">
  288. <p @click="chooseSet(item, index, 1)" v-if="!noMenuItem" class="chooseSet shouzhi">
  289. <img :src="item.img" alt="">
  290. <span class="shouzhi"></span>{{ item.name }}
  291. <span v-if="item.name == '在线编辑' || item.name == '协作' ? true : false"
  292. style="color: #7084B4;float: right;position: relative;" class="arrow">></span>
  293. </p>
  294. </template>
  295. </div>
  296. <div class="setCli1" v-if="anyP" :style="{ left: xz + 155 + 'px', top: yz + 'px' }">
  297. <p @click="chooseSet1(0)" class="chooseSet">
  298. <img src="../../assets/images/user.png" alt="">
  299. 选择人员
  300. </p>
  301. <p class="chooseSet" @click="goLock">
  302. <img src="../../assets/images/archiveTray.png" alt="">
  303. 归档
  304. </p>
  305. </div>
  306. </div>
  307. </div>
  308. </div>
  309. <div v-else>
  310. <div>
  311. <el-button @click="editOnline = true; historyPrew = false">返回</el-button>
  312. </div>
  313. <FileEdit :docId="clickRowId" :copyRow="copyRow" :historyPrew="historyPrew"
  314. :historycopyRow="historycopyRow" :onlyView="onlyView" @cancleHistoryPrew="cancleHistoryPrew">
  315. </FileEdit>
  316. </div>
  317. </div>
  318. <!-- 扩容弹窗 -->
  319. <div>
  320. <SpaceBig v-if="spaces" :spaces="spaces" :impSpaceId="impSpaceId" @getSpaceC="getSpaceC"></SpaceBig>
  321. </div>
  322. <!-- 新增文件夹弹窗 -->
  323. <div>
  324. <CreateFloder v-if="folderCase" :thisType="thisFolder" :thisRole="thisRole" :folderCase="folderCase" @getChildrenC="getChildrenC" :oneOrTwo="oneOrTwo"
  325. :impDirId="impDirId" :impSpaceId="impSpaceId" :newDirId="newDirId" :newSpaceId="newSpaceId" :upFolderData="upFolderData" :thisFolderRole="thisFolderRole"
  326. :refreshFile="refreshFile">
  327. </CreateFloder>
  328. </div>
  329. <!-- 文件上传 -->
  330. <div>
  331. <el-dialog v-model="uploadModal" title="文件上传" width="30%" @close="closeUpload">
  332. <el-upload class="upload-demo" :file-list="fileArr" drag :http-request="onSuccess" multiple
  333. :on-remove="handleRemove"
  334. element-loading-text="上传中..."
  335. element-loading-background="rgba(255, 255, 255, 0.8)"
  336. v-loading="loadingUpload"
  337. >
  338. <el-icon class="el-icon--upload"><upload-filled /></el-icon>
  339. <div class="el-upload__text">拖入或<em>点击上传</em></div>
  340. <template #tip>
  341. <div class="el-upload__tip">请选择或拖入文件</div>
  342. </template>
  343. </el-upload>
  344. <template #footer>
  345. <span class="dialog-footer">
  346. <el-button @click="closeUpload">取消</el-button>
  347. <el-button type="primary" @click="sureUpload">确认</el-button>
  348. </span>
  349. </template>
  350. </el-dialog>
  351. </div>
  352. <!-- 文件重命名 -->
  353. <div>
  354. <el-dialog v-model="fileNameChange" title="重命名" width="30%">
  355. <el-form :model="nameForm" label-width="120px">
  356. <el-form-item label="新名字">
  357. <el-input v-model="nameForm.name"></el-input>
  358. </el-form-item>
  359. </el-form>
  360. <template #footer>
  361. <span class="dialog-footer">
  362. <el-button @click="fileNameChange = false">取消</el-button>
  363. <el-button type="primary" @click="sureChangeName">
  364. 确认
  365. </el-button>
  366. </span>
  367. </template>
  368. </el-dialog>
  369. </div>
  370. <!-- 文件收藏 -->
  371. <div>
  372. <FileCollect v-if="collects" :collects="collects" @getCollects="getCollects" :copyFileName="copyFileName"
  373. :copyFileId="copyFileId" @refreshFile="refreshFile" :isFolder="isFolder" :clickRow="clickRow"></FileCollect>
  374. </div>
  375. <!-- 中栏重命名 -->
  376. <div>
  377. <FolderReName v-if="rename" :rename="rename" :selectedBox="selectedBox" :getAllTop="getAllTop"
  378. :copyFolderName="copyFolderName" @getRename="getRename">
  379. </FolderReName>
  380. </div>
  381. <ImgPreview :previewData="previewData" :copyFileType="copyFileType" :showPreview="showPreview"
  382. @closeImgPreview="closeImgPreview"></ImgPreview>
  383. <div>
  384. <FileTree v-if="fileTrees" :fileTrees="fileTrees" :newSpaceId="newSpaceId" :fileId="clickRowId"
  385. @getChildren="getChildren" :copyOrMove="copyOrMove"></FileTree>
  386. </div>
  387. <!-- 穿梭框 -->
  388. <div>
  389. <TransferModal v-if="thanks" :thanks="thanks" :clickRowId="clickRowId" :workOrEdit="workOrEdit"
  390. @getCback="getCback"></TransferModal>
  391. </div>
  392. </div>
  393. </div>
  394. <!-- 图片预览 -->
  395. <!-- 历史版本 -->
  396. <historyList v-if="openForwardFile" :openFile="openForwardFile" :docId="clickRowId" :name="nameForm.name" :copyRow="copyRow"
  397. @close="openForwardFile = false" :fileUserTreeData="fileUserTreeData.data" @changeMsgClose="changeMsgClose"
  398. :historyTotal="historyTotal">
  399. </historyList>
  400. <!-- 历史版本 -->
  401. <!-- 二次密码验证 -->
  402. <inputPassword v-if="showInputPassword" @surePass="surePass" @closeIptPass="closeIptPass" :showInputPassword="showInputPassword"></inputPassword>
  403. <div v-loading.fullscreen="loadingPreview" v-if="loadingPreview" class="lodingBox"></div>
  404. </template>
  405. <script>
  406. import { ref, toRaw, onMounted,onActivated ,inject} from 'vue'
  407. import myfile from '../../api/myfile/myfile'
  408. import { delFavorite } from '@/api/biz/favorite.js'
  409. import documents from '../../api/document/document'
  410. import fileCount from '../../api/fileCount/fileCount'
  411. import FileTree from './components/FileTree.vue'
  412. import BreadMenu from './components/BreadMenu.vue'
  413. import FileEdit from '@/views/myfile/components/FileEdit.vue'
  414. import TransferModal from './modalComponebts/Transfer.vue'
  415. import CreateFloder from './modalComponebts/CreateFloder.vue'
  416. import FileCollect from './modalComponebts/FileCollect.vue'
  417. import FolderReName from './modalComponebts/FolderReName.vue'
  418. import SpaceBig from './modalComponebts/SpaceBig.vue'
  419. import PlaceGridFolder from './components/PlaceGridFolder.vue'
  420. import PalaceGridFile from './components/PalaceGridFile.vue'
  421. import ImgFile from "./jsComponents/ImgFile"
  422. import { Search } from '@element-plus/icons-vue'
  423. import blueLeft from '../../assets/images/blueLeft.png'
  424. import grayRight from "../../assets/images/grayRight.png"
  425. import sort from '../../assets/images/sort.png'
  426. import squre from '../../assets/images/squre.png'
  427. import level1 from "@/assets/images/level1.png";
  428. import level2 from "@/assets/images/level2.png";
  429. import level3 from "@/assets/images/level3.png";
  430. import level4 from "@/assets/images/level4.png";
  431. import { ElMessage ,ElLoading } from 'element-plus'
  432. import ImgPreview from '@/components/ImgPreview/ImgPreview.vue'
  433. import { preview } from "@/api/common/common.js";
  434. import historyList from "@/components/historyList/index.vue"; //选择文件发送的列表,历史版本
  435. import inputPassword from "./components/inputPassword.vue"; //选择文件发送的列表,历史版本
  436. import { listVersion } from "@/api/biz/version";
  437. import useUserStore from "@/store/modules/user";
  438. import { useRouter, useRoute,onBeforeRouteUpdate } from "vue-router";
  439. import { canPreviewFile,rightMenuRole,publicRightMenuRole } from "@/utils/index.js"
  440. import fileSpace from '../../api/filespace/fileSpace';
  441. import { getLeveldetail } from '../../api/level/level';
  442. import { encrypt, decrypt } from "@/utils/jsencrypt";
  443. import ordinaryList from "@/assets/images/ordinaryList.png";
  444. import ordinary from "@/assets/images/ordinary.png";
  445. import fileStyle from "@/assets/images/fileStyle.png";fileBox
  446. import fileBox from "@/assets/images/fileBox.png";
  447. import { getLevel } from '@/api/level/level.js';
  448. import Cookies from "js-cookie";
  449. import elTableInfiniteScroll from 'el-table-infinite-scroll'
  450. export default {
  451. directives: {
  452. 'el-table-infinite-scroll': elTableInfiniteScroll
  453. },
  454. setup() {
  455. const { proxy } = getCurrentInstance();
  456. const levelList = ref()
  457. let fileTrees = ref(false)//filetree父传子
  458. let thanks = ref(false)//transfer父传子
  459. let collects = ref(false)//文件收藏父传子
  460. let rename = ref(false)//文件夹重命名
  461. let spaces = ref(false)//空间扩容父传子
  462. let folderCase = ref(false)
  463. let fileGrid = ref(sessionStorage.getItem('fileGrid') || 0)
  464. let folderGrid = ref(true)
  465. let editOnline = ref(true)
  466. let searchFire = ref('')
  467. let selectedIndex = ref(0)
  468. let folder = ref(['1'])
  469. let files = ref(['2'])
  470. let folderList = ref([])
  471. let cliCC = ref(false)
  472. let anyP = ref(false)
  473. let uploadModal = ref(false)
  474. let collectImg = ref(true)
  475. let selectedBox = ref(-1)
  476. let clickRowId = ref(0)
  477. let trandata = ref()
  478. let folderId = ref('')
  479. let fileId = ref('')
  480. let tranvalue = ref([])
  481. let useSpace = ref(0)
  482. let allSpace = ref(0)
  483. let fileArr = ref([])
  484. let copyDirId = ref(0)//需要操作的dirid
  485. let copySpaceId = ref(0)//需要操作的spaceid
  486. let copyDocId = ref(0)//需要操作的docid
  487. let copyFileId = ref(0)//需要操作的fileid
  488. let copyFileSize = ref(0)//需要操作的filesize
  489. let copyFileType = ref('')//需要操作的文件类型
  490. let copyFileName = ref("")//需要操作的文件名
  491. let copyFolderName = ref("")
  492. let copySpaceCup = ref(0)
  493. let directoryId = ref('')
  494. let impSpaceId = ref("")
  495. let impDirId = ref("")
  496. let impNum = ref(0)
  497. let copyParentId = ref("")//文件夹
  498. let needBag = ref("")
  499. let copyOrMove = ref(0)//0代表复制,1代表移动
  500. let oneOrTwo = ref(0)//0代表二级,1代表一级
  501. let sortNum = ref(0)
  502. let folderTotal = ref(0)//文件夹total
  503. let fileTotal = ref(0)//文件total
  504. const openForwardFile = ref(false) //历史版本展示
  505. const delMoreFile = ref([]) //删除多个文件夹
  506. const historyTotal = ref(0)
  507. const historyPrew = ref(false)
  508. const leftNewFile = ref(false) //解决左侧点击后不能显示的问题
  509. let xz = ref(0)
  510. let yz = ref(0)
  511. const fileUserTreeData = reactive({ data: {} });
  512. let fileList = ref()
  513. let menuList = ref([
  514. {
  515. name: "我的空间",
  516. choose: "我的空间"
  517. }
  518. ])
  519. let useMenu = ref([
  520. // {
  521. // img: ImgFile.copy,
  522. // name: "复制"
  523. // },
  524. // {
  525. // img: ImgFile.clipboard,
  526. // name: "粘贴"
  527. // },
  528. // {
  529. // img: ImgFile.share,
  530. // name: "分享给"
  531. // },
  532. {
  533. img: ImgFile.trash,
  534. name: "删除"
  535. },
  536. ])
  537. let arrorMenu = ref([
  538. {
  539. img: ImgFile.file,
  540. name: "文件"
  541. },
  542. {
  543. img: ImgFile.folder,
  544. name: '文件夹'
  545. },
  546. {
  547. img: ImgFile.image,
  548. name: "图片"
  549. },
  550. {
  551. img: ImgFile.filmSlate,
  552. name: "视频"
  553. },
  554. {
  555. img: ImgFile.musicNotes,
  556. name: "音频"
  557. }
  558. ])
  559. let mouseCli = ref([
  560. {
  561. img: ImgFile.previewIcon,
  562. name: "预览"
  563. },
  564. {
  565. img: ImgFile.collect,
  566. name: "收藏"
  567. },
  568. {
  569. img: ImgFile.downLoad,
  570. name: "下载"
  571. },
  572. {
  573. img: ImgFile.textbox,
  574. name: "重命名"
  575. },
  576. {
  577. img: ImgFile.goon,
  578. name: "发送"
  579. },
  580. {
  581. img: ImgFile.share,
  582. name: "分享"
  583. },
  584. {
  585. img: ImgFile.notePencil,
  586. name: "在线编辑"
  587. },
  588. {
  589. img: ImgFile.icc,
  590. name: "文字识别"
  591. },
  592. {
  593. img: ImgFile.history,
  594. name: "历史版本"
  595. },
  596. {
  597. img: ImgFile.trash,
  598. name: "删除"
  599. }
  600. ])
  601. let nameForm = ref({
  602. name: ""
  603. })
  604. let ordinaryFolder = ref([ {
  605. img: ImgFile.previewIcon,
  606. name: "预览"
  607. },
  608. {
  609. img: ImgFile.collect,
  610. name: "收藏"
  611. },
  612. {
  613. img: ImgFile.downLoad,
  614. name: "下载"
  615. }
  616. ])
  617. let fileNameChange = ref(false)
  618. let fileMenu = ref([])
  619. let copyRow = ref({})
  620. let newDirId = ref('')
  621. let newSpaceId = ref('')
  622. let workOrEdit = ref(0)
  623. const showPreview = ref(false)//控制图片预览组件显示
  624. const previewData = ref()//需要预览的文件的数据
  625. const router = useRouter(); //注册路由
  626. const route = useRoute(); //注册路由
  627. const folderVisible = ref(false); //显示文件夹右键菜单
  628. const foldertop = ref(0);
  629. const folderleft = ref(0);
  630. const thisFolder = ref({}); //当前右键的文件夹
  631. const folderCheckout = ref(false)//是否有勾选
  632. const fileCheckout = ref(false)//是否有勾选
  633. const haveCheck = ref(false)//是否有勾选
  634. const onlyView = ref(false) //预览
  635. const topPath = ref()//顶部路径
  636. const isFolder = ref('N') //是否为文件夹
  637. const clickRow = ref()//当前右键的行数据
  638. const backFolder = ref()//上一级的文件夹
  639. const thisFolderRole = ref({})//文件夹安全等级
  640. const thisRole = ref([])//文件夹权限
  641. const showInputPassword = ref(false)
  642. const chooseRow = ref()
  643. const chooseNum = ref()
  644. const loadingPreview = ref(false)
  645. const noMenuItem = ref(false)
  646. const addTab = inject("addTab");
  647. const addFileTab = inject("addFileTab");
  648. const addFolderAdd = inject("addFolderAdd");
  649. const filePageNum = ref(1) //获取文件分页
  650. const tableBeEnd = ref(true)//控制下拉是否到底
  651. const tableTotal = ref(0)//表格数据总数
  652. const spaceName = ref()
  653. const isDept = ref(false)// 是否管理员
  654. const loadingUpload = ref(false);//文件上传加载
  655. //控制宫格展示
  656. const isList = ref(false); //控制显示方式
  657. const changeShow = (fileGrids) => {
  658. // isList.value = !isList.value;
  659. // fileGrid.value = fileGrids
  660. // folderGrid.value = fileGrids;
  661. if(fileGrid.value == 1){
  662. fileGrid.value = 0
  663. }else{
  664. fileGrid.value = 1
  665. }
  666. sessionStorage.setItem('fileGrid',fileGrid.value)
  667. };
  668. const upFolderData = ref()// 修改的文件夹的数据
  669. // const isUpFolder = ref(false)
  670. // 获取文件夹,中栏,文件
  671. function getAllTop() {
  672. documents.getTop(2).then(res => {
  673. let userMe = [res]
  674. impDirId.value = userMe[0].dirId//固定
  675. impSpaceId.value = userMe[0].spaceId//固定
  676. newSpaceId.value = userMe[0].spaceId//变化
  677. newDirId.value = userMe[0].dirId//变化
  678. topPath.value = userMe[0].dirPath
  679. spaceName.value = userMe[0].dirPath
  680. let obj = {
  681. pageNum: 1,
  682. pageSize: 10
  683. }
  684. documents.getALLdocumentByType({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId, pageNum: obj.pageNum, pageSize: obj.pageSize },2).then(res => {
  685. fileMenu.value = res.data
  686. folderList.value = res.data
  687. })
  688. myfile.getById(userMe[0].dirId - 0, obj).then(res => {
  689. if (res.code === 200) {
  690. fileList.value = res.rows
  691. fileTotal.value = res.total
  692. if (fileTotal.value / 10 != 1) {
  693. let x = Math.trunc(fileTotal.value / 10) + 1
  694. for (var i = 1; i <= x; i++) {
  695. obj.pageNum = i
  696. myfile.getById(userMe[0].dirId - 0, obj).then(res => {
  697. fileList.value = fileList.value.concat(res.rows)
  698. const uniqueFileList = Array.from(new Set(fileList.value.map(item => item.docId)))
  699. .map(docId => fileList.value.find(item => item.docId === docId));
  700. // 合并数组并更新 fileList.value
  701. fileList.value = uniqueFileList
  702. })
  703. }
  704. }
  705. // console.log('fileList.value',fileList.value);
  706. }
  707. // console.log('not200');
  708. })
  709. })
  710. }
  711. function getSpaceList() {
  712. myfile.fileType(3).then(res => {
  713. useSpace.value = res.data.usedCap
  714. allSpace.value = res.data.spaceCap
  715. })
  716. }
  717. function changeFile(row, num) {
  718. const addData = {
  719. path:'/department'+row.dirId,
  720. name:row.dirName,
  721. clickRowId:toRaw(row)
  722. }
  723. addFolderAdd(addData) //加了这句代码界面会渲染两次
  724. thisFolder.value = row
  725. console.log('row2',row);
  726. topPath.value = row.dirPath
  727. if(row.isEncrypt === "Y"){
  728. getLeveldetailFn(row.encryptLevel)
  729. }else{
  730. thisFolderRole.value = {}
  731. }
  732. thisRole.value = row.dirRole?row.dirRole.split(','):[]
  733. copyParentId.value = row.parentId
  734. newDirId.value = row.dirId
  735. newSpaceId.value = row.spaceId
  736. documents.getALLdocumentByType({ parentId: row.dirId - 0, spaceId: row.spaceId - 0 },2).then(res => {
  737. folderList.value = res.data
  738. // if (res.code === 200) {
  739. if (res.data.length === 0) {
  740. myfile.getById(newDirId.value)
  741. .then(res => {
  742. if (res.code === 200) {
  743. fileList.value = res.rows;
  744. }
  745. })
  746. .catch(error => {
  747. console.error("myfile.getAllFileMenu 调用失败:", error);
  748. });
  749. } else {
  750. myfile.getById(row.dirId - 0)
  751. .then(res => {
  752. if (res.code === 200) {
  753. fileList.value = res.rows;
  754. }
  755. })
  756. .catch(error => {
  757. console.error("myfile.getAllFileMenu 调用失败:", error);
  758. });
  759. }
  760. // }
  761. })
  762. selectedIndex.value = num
  763. const newItem = {
  764. name: row.dirName,
  765. choose: row.dirName,
  766. dirIds: row.dirId,
  767. spaceIds: row.spaceId
  768. };
  769. // 检查 newItem 是否已存在于 menuList 中
  770. const isItemExist = menuList.value.some(item => item.choose === newItem.choose);
  771. // 如果不存在,则添加它
  772. if (!isItemExist) {
  773. menuList.value.push(newItem);
  774. }
  775. }
  776. // x图标事件
  777. function shotdown(row) {
  778. menuList.value = menuList.value.filter(item => item.name !== row.name)
  779. selectedIndex.value = -1
  780. if (!editOnline.value) {
  781. editOnline.value = true
  782. }
  783. }
  784. // 文件名表格每一行点击事件
  785. function handleRowClick(row, col, e) {
  786. console.log('row',row);
  787. // console.log('thisFolder',thisFolder.value);
  788. isFolder.value = "N"
  789. clickRow.value = row
  790. e.preventDefault();
  791. e.stopPropagation();
  792. xz.value = e.pageX
  793. yz.value = e.pageY
  794. copyRow.value = row
  795. clickRowId.value = row.docId
  796. copyDirId.value = row.dirId
  797. copySpaceId.value = row.spaceId
  798. copyFileId.value = row.fileId
  799. copyFileSize.value = row.fileSize
  800. copyFileType.value = row.fileType
  801. nameForm.value.name = row.fileName
  802. copyFileName.value = row.fileName
  803. if (cliCC.value === true) {
  804. cliCC.value = false
  805. } else {
  806. cliCC.value = true
  807. }
  808. }
  809. // 申请扩容
  810. async function askApply() {
  811. const res = await fileSpace.querySpace(impSpaceId.value)
  812. console.log('res',res);
  813. if(res.data){
  814. ElMessage({ message: '已存在扩容申请', type: 'error' })
  815. return
  816. }
  817. spaces.value = true
  818. }
  819. //mouse弹框
  820. async function chooseSet(row, index, num) {
  821. // 权限控制
  822. if(thisFolderRole.value && thisFolderRole.value.roles){
  823. if(thisFolderRole.value.roles.l0600){
  824. const passArr = localStorage.getItem('passArr');
  825. const passArrObj = JSON.parse(passArr)
  826. if((!passArrObj) || !passArrObj.some(item=>item === clickRow.value.docId)){
  827. chooseRow.value = row
  828. chooseNum.value = num
  829. showInputPassword.value = true
  830. return
  831. }
  832. // console.log('needc');
  833. }
  834. }
  835. console.log('chooseSetrow',row);
  836. console.log('chooseSetnum',num);
  837. if (row.name == '在线编辑' || row.name == '协作') {
  838. cliCC.value = true
  839. }
  840. if (row.name == '分享') {
  841. workOrEdit.value = num
  842. thanks.value = true
  843. } else {
  844. thanks.value = false
  845. }
  846. if (row.name == '协作') {
  847. workOrEdit.value = num
  848. if (anyP.value) {
  849. anyP.value = false
  850. } else {
  851. anyP.value = true
  852. }
  853. } else {
  854. anyP.value = false
  855. }
  856. if (row.name == '删除') {
  857. myfile.delMenu(clickRowId.value).then(res => {
  858. if (res.code === 200) {
  859. ElMessage({
  860. type: "success",
  861. message: "删除成功"
  862. })
  863. refreshFile()
  864. }
  865. })
  866. }
  867. if (row.name === '复制到...') {
  868. copyOrMove.value = 0
  869. fileTrees.value = true
  870. }
  871. if (row.name === '移动到...') {
  872. copyOrMove.value = 1
  873. fileTrees.value = true
  874. }
  875. if (row.name === '重命名') {
  876. fileNameChange.value = true
  877. }
  878. if (row.name === "下载") {
  879. // location.href = `${import.meta.env.VITE_APP_BASE_API}/api/download/${copyFileId.value}`;
  880. downLoadfile()
  881. }
  882. if (row.name === '收藏') {
  883. collects.value = true
  884. }
  885. if (row.name === '在线编辑') {
  886. loadingPreview.value = true
  887. // const filePreview = canPreviewFile(copyFileType.value)
  888. // if (filePreview) {
  889. loadingPreview.value = false
  890. if(thisFolderRole.value.roles && thisFolderRole.value.roles.l0800){
  891. addFileTab(clickRow.value, 1,1);
  892. }else{
  893. addFileTab(clickRow.value, 1,0);
  894. }
  895. onlyView.value = false
  896. // editOnline.value = false
  897. cliCC.value = false
  898. // } else {
  899. // const res = await preview(copyRow.value.docId)
  900. // showPreview.value = true
  901. // previewData.value = URL.createObjectURL(res)
  902. // }
  903. loadingPreview.value = false
  904. }
  905. if (row.name === '文字识别') {
  906. router.push({
  907. path: '/identifyFont',
  908. query: {
  909. docId: copyRow.value.docId,
  910. fileId: copyRow.value.fileId,
  911. fileType: copyFileType.value
  912. }
  913. })
  914. }
  915. if (row.name === '预览') {
  916. loadingPreview.value = true
  917. const filePreview = canPreviewFile(copyFileType.value)
  918. if (filePreview) {
  919. loadingPreview.value = false
  920. // addTab(clickRow.value);
  921. if(thisFolderRole.value.roles && thisFolderRole.value.roles.l0800){
  922. addFileTab(clickRow.value, 0,1);
  923. }else{
  924. addFileTab(clickRow.value, 0,0);
  925. }
  926. onlyView.value = true
  927. // editOnline.value = false
  928. cliCC.value = false
  929. } else {
  930. const res = await preview(copyRow.value.docId)
  931. showPreview.value = true
  932. previewData.value = URL.createObjectURL(res)
  933. }
  934. loadingPreview.value = false
  935. console.log('filePreview', filePreview);
  936. // // console.log('res',res);
  937. // const res = await preview(copyFileId.value)
  938. // showPreview.value = true
  939. // previewData.value = URL.createObjectURL(res)
  940. } else if (row.name === "历史版本") {
  941. const resHistory = await listVersion({ docId: clickRowId.value })
  942. console.log('resHistory',resHistory);
  943. historyTotal.value = resHistory.total
  944. fileUserTreeData.data = resHistory.rows;
  945. openForwardFile.value = true
  946. }
  947. }
  948. function chooseSet1(num) {
  949. workOrEdit.value = num
  950. thanks.value = true
  951. anyP.value = false
  952. }
  953. function createNewMenu(num,leftNewFiles) {
  954. if (leftNewFiles) {
  955. leftNewFile.value = true //解决左侧点击文件后不显示的问题
  956. }
  957. upFolderData.value = null
  958. oneOrTwo.value = num
  959. folderCase.value = true
  960. }
  961. function cancleHistoryPrew(val) {
  962. historyPrew.value = false
  963. }
  964. function createNewFile() {
  965. addFile.value = true
  966. }
  967. function arrowClick(row, num) {
  968. if (row.name === '文件') {
  969. uploadModal.value = true
  970. } else {
  971. uploadModal.value = false
  972. }
  973. }
  974. // 确认上传
  975. function sureUpload() {
  976. loadingUpload.value = true;
  977. if (fileArr.value.length > 0) {
  978. for (var i = 1; i <= fileArr.value.length; i++) {
  979. myfile.uploadFile({
  980. spaceId: newSpaceId.value - 0,
  981. dirId: newDirId.value - 0,
  982. file: fileArr.value[i - 1]
  983. }).then(res => {
  984. if (res.code === 200) {
  985. ElMessage({
  986. message: "上传文件成功",
  987. type: "success"
  988. })
  989. refreshFile()
  990. uploadModal.value = false
  991. loadingUpload.value = false;
  992. fileArr.value = []
  993. }
  994. }).catch(err => {
  995. loadingUpload.value = false;
  996. fileArr.value = []
  997. })
  998. }
  999. } else {
  1000. loadingUpload.value = false;
  1001. return ElMessage({ message: "请选择文件", type: "error" })
  1002. }
  1003. }
  1004. function onSuccess(files, val) {
  1005. fileArr.value.push(files.file)
  1006. }
  1007. //关闭文件上传
  1008. const closeUpload =() =>{
  1009. uploadModal.value = false;
  1010. fileArr.value = [];
  1011. loadingUpload.value = false
  1012. }
  1013. // 移除上传的某些文件
  1014. const handleRemove = (file,rawFile) => {
  1015. fileArr.value = [...rawFile]
  1016. }
  1017. // 筛选后缀图片
  1018. function getImage(file) {
  1019. if (file === '.txt') {
  1020. return ImgFile.txt
  1021. } else if (file === '.xlxs' || file === '.docx') {
  1022. return ImgFile.xlxs
  1023. } else if (file === '.pptx') {
  1024. return ImgFile.pptx
  1025. } else if (file === '.word') {
  1026. return ImgFile.word
  1027. } else if (file === '.pdf') {
  1028. return ImgFile.pdf
  1029. }
  1030. }
  1031. // 表格多选框
  1032. function handleSelectionChange(val) {
  1033. delMoreFile.value = val //删除多项的数据
  1034. // if (val.length > 1) {
  1035. // // 如果选择了多项,只保留最后一项
  1036. // val.shift();
  1037. // }
  1038. if (val.length === 1) {
  1039. fileId.value = val[0].docId
  1040. }
  1041. if (val.length) {
  1042. folderCheckout.value = true
  1043. haveCheck.value = true
  1044. } else {
  1045. folderCheckout.value = false
  1046. if (!fileCheckout.value) {
  1047. haveCheck.value = false
  1048. }
  1049. }
  1050. }
  1051. // 文件夹
  1052. function handleSelectionChange1(val) {
  1053. delMoreFile.value = val //删除多项的数据
  1054. if (val.length > 1) {
  1055. // 如果选择了多项,只保留最后一项
  1056. val.shift();
  1057. proxy.$refs.taskTableRef.toggleRowSelection(val.shift(), false);//单选操作
  1058. }
  1059. if (val.length === 1) {
  1060. folderId.value = val[0]
  1061. }
  1062. if (val.length) {
  1063. fileCheckout.value = true
  1064. haveCheck.value = true
  1065. } else {
  1066. fileCheckout.value = false
  1067. if (!folderCheckout.value) {
  1068. haveCheck.value = false
  1069. }
  1070. }
  1071. // console.log('delMoreFile',delMoreFile.value);
  1072. // console.log('folderId',folderId.value);
  1073. }
  1074. // 重命名
  1075. function restName(row, index) {
  1076. // 判断是点击打开还是右键菜单打开
  1077. row = row ? row : clickRow.value
  1078. copyFolderName.value = row.dirName
  1079. selectedBox.value = row.dirId
  1080. rename.value = true
  1081. }
  1082. function getMenu(row, num) {
  1083. if (row.name === '删除') {
  1084. const datas = []
  1085. const isFile = ref(false)
  1086. delMoreFile.value.map(i => {//多选删除
  1087. if (i.parentId) {//文件
  1088. isFile.value = true
  1089. } else {//文件夹
  1090. datas.push(i.docId)
  1091. }
  1092. })
  1093. if(folderId.value.dirType === '2'){
  1094. return ElMessage({
  1095. message: "删除失败,组织目录不可删除",
  1096. type: "error"
  1097. })
  1098. }
  1099. // 文件夹删除
  1100. if (isFile.value) {//文件
  1101. documents.delDocument(folderId.value.dirId).then(res => {
  1102. if (res.code === 200) {
  1103. ElMessage({
  1104. message: "删除成功",
  1105. type: "success"
  1106. })
  1107. refreshFile()
  1108. } else {
  1109. ElMessage({
  1110. message: "删除失败,目录应不为空",
  1111. type: "error"
  1112. })
  1113. }
  1114. isFile.value = false
  1115. })
  1116. } else {
  1117. myfile.delMenu(datas.toString()).then(res => {
  1118. if (res.code === 200) {
  1119. ElMessage({
  1120. message: "删除成功",
  1121. type: "success"
  1122. })
  1123. refreshFile()
  1124. }
  1125. })
  1126. }
  1127. }
  1128. }
  1129. function delName(row, num) {
  1130. documents.delDocument(row.dirId).then(res => {
  1131. if (res.code === 200) {
  1132. getAllTop()
  1133. ElMessage({
  1134. message: "删除成功",
  1135. type: "success"
  1136. })
  1137. }
  1138. })
  1139. }
  1140. // 计算百分比
  1141. function percent() {
  1142. let numP = 0;
  1143. if (useSpace.value && allSpace.value) {
  1144. numP = (useSpace.value / allSpace.value) * 100;
  1145. }
  1146. return numP.toFixed(2) - 0; // 将结果保留两位小数
  1147. }
  1148. // 文件夹每行点击事件
  1149. function folderClick(row, list) {
  1150. // 初始化分页数据
  1151. tableBeEnd.value = true
  1152. filePageNum.value = 1
  1153. tableTotal.value = 0
  1154. // 上一级dirId就是下一级的parentId
  1155. // 判断是点击打开还是右键菜单打开
  1156. if(row){
  1157. backFolder.value = thisFolder.value
  1158. thisFolder.value = row;
  1159. }else{
  1160. row =thisFolder.value
  1161. }
  1162. if(row.isEncrypt === "Y"){
  1163. getLeveldetailFn(row.encryptLevel)
  1164. }else{
  1165. thisFolderRole.value = {}
  1166. }
  1167. thisRole.value = row.dirRole?row.dirRole.split(','):[]
  1168. // console.log('row1', toRaw(row));
  1169. topPath.value = row.dirPath
  1170. // console.log('topPath',toRaw(topPath.value));
  1171. newDirId.value = row.dirId
  1172. newSpaceId.value = row.spaceId
  1173. const query = `${newDirId.value}?pageSize=10&pageNum=${filePageNum.value}`
  1174. documents.getALLdocumentByType({
  1175. parentId: newDirId.value - 0,
  1176. spaceId: newSpaceId.value - 0
  1177. },2).then(res => {
  1178. folderList.value = res.data
  1179. if (res.data.length === 0) {
  1180. myfile.getById(query).then(res => {
  1181. if (res.code === 200) {
  1182. tableTotal.value =res.total
  1183. if(res.rows.length<res.total){
  1184. //第一次拿到的数据少于总数开启下拉事件
  1185. tableBeEnd.value = false
  1186. }
  1187. fileList.value = res.rows
  1188. }
  1189. })
  1190. } else {
  1191. myfile.getById(query).then(res => {
  1192. console.log('folerFile',res);
  1193. if (res.code === 200) {
  1194. tableTotal.value =res.total
  1195. if(res.rows.length<res.total){
  1196. //第一次拿到的数据少于总数开启下拉事件
  1197. tableBeEnd.value = false
  1198. }
  1199. fileList.value = JSON.parse(JSON.stringify(res.rows))
  1200. // console.log('fileList',toRaw(fileList.value));
  1201. }
  1202. })
  1203. }
  1204. })
  1205. }
  1206. // 确认文件重命名
  1207. function sureChangeName() {
  1208. myfile.editNewMenu({
  1209. dirId: copyDirId.value - 0,
  1210. docId: clickRowId.value - 0,
  1211. fileId: copyFileId.value,
  1212. fileName: nameForm.value.name,
  1213. fileSize: copyFileSize.value - 0,
  1214. fileType: copyFileType.value,
  1215. remark: '',
  1216. spaceId: copySpaceId.value - 0,
  1217. }).then(res => {
  1218. if (res.code === 200) {
  1219. ElMessage({
  1220. message: "重命名成功",
  1221. type: "success"
  1222. })
  1223. fileNameChange.value = false
  1224. refreshFile()
  1225. }
  1226. })
  1227. }
  1228. // 判断id
  1229. function isId() {
  1230. if (directoryId.value === '') {
  1231. directoryId.value = 0
  1232. getAllTop()
  1233. }
  1234. if (folderId.value === '') {
  1235. folderId.value = 0
  1236. getAllTop()
  1237. }
  1238. }
  1239. //关闭图片预览事件
  1240. const closeImgPreview = () => {
  1241. // console.log('close');
  1242. showPreview.value = false
  1243. }
  1244. function getChildren(data) {
  1245. fileTrees.value = data
  1246. refreshFile()
  1247. }
  1248. function getCback(data) {
  1249. thanks.value = data
  1250. }
  1251. function getChildrenC(data) {
  1252. folderCase.value = data
  1253. }
  1254. function getCollects(data) {
  1255. collects.value = data
  1256. }
  1257. function getRename(data) {
  1258. rename.value = data
  1259. }
  1260. function getSpaceC(data) {
  1261. spaces.value = data
  1262. }
  1263. function navBack(data, name) {
  1264. nameForm.value.name = name
  1265. fileNameChange.value = data
  1266. }
  1267. function onlineCase(data, uid, row) {
  1268. editOnline.value = data
  1269. clickRowId.value = uid
  1270. copyRow = row
  1271. }
  1272. function shareBack(data, num) {
  1273. thanks.value = data
  1274. workOrEdit.value = num
  1275. }
  1276. function showFile(data, e, a) {
  1277. editOnline.value = data
  1278. clickRowId.value = e
  1279. copyRow = a
  1280. }
  1281. function folderBack(dir, spa, nam) {
  1282. selectedBox.value = dir
  1283. copyFolderName.value = nam
  1284. copyFileName.value = spa
  1285. }
  1286. //历史版本
  1287. const forwardTreeData = reactive({ data: {} });
  1288. const historycopyRow = ref({})
  1289. function changeMsgClose(val, item) {
  1290. if (val) {
  1291. historycopyRow.value = item
  1292. editOnline.value = false
  1293. cliCC.value = false
  1294. historyPrew.value = true
  1295. }
  1296. openForwardFile.value = val
  1297. }
  1298. function lastBB(data, row, num) {
  1299. openForwardFile.value = data
  1300. historyTotal.value = row
  1301. fileUserTreeData.data = num
  1302. }
  1303. //对mouseCli数组进行筛选,实现菜单的区分显示
  1304. const filterMouseCli = () => {
  1305. const canPreviewArray = ['.doc','.wps', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.epub', '.fodt', '.htm', '.html', '.mht', '.odt', '.ott', '.pdf', '.rtf', '.txt', '.djvu', '.xps', '.csv', '.fods', '.ods', '.ots', '.xls', '.xlsm', '.xlsx', '.xlt', '.xltm', '.xltx', '.fodp', '.odp', '.otp', '.pot', '.potm', '.potx', '.pps', '.ppsm', '.ppsx', '.ppt', '.pptm', '.pptx']
  1306. const typeArr = ['.png', '.jpg', '.jpeg', '.JPG', '.mp3', '.mp4']
  1307. const imgTypeArr = ['.png', '.jpg', '.jpeg', '.JPG']
  1308. const canEditArr = ['.doc', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.txt', '.djvu', '.xps', '.csv', '.fods', '.ods', '.ots', '.xls', '.xlsm', '.xlsx', '.xlt', '.xltm', '.xltx', '.fodp', '.odp', '.otp','.doc', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.epub', '.fodt', '.htm', '.html', '.mht', '.odt', '.ott', '.rtf', '.txt', '.djvu', '.xps', '.wps','.pptx']
  1309. let arr = []
  1310. if (!(typeArr.includes(copyFileType.value) || canPreviewArray.includes(copyFileType.value))) {
  1311. arr = mouseCli.value.filter(item => item.name !== "预览")
  1312. } else {
  1313. arr = toRaw(mouseCli.value)
  1314. }
  1315. if (!canEditArr.includes(copyFileType.value)) {
  1316. arr = arr.filter(item => item.name !== "在线编辑" && item.name !== "协作" && item.name !== "历史版本")
  1317. }
  1318. if (!imgTypeArr.includes(copyFileType.value)) {
  1319. arr = arr.filter(item => item.name !== "文字识别")
  1320. }
  1321. // console.log('thisFolderRole',thisFolderRole.value);
  1322. if(thisFolderRole.value.roles){
  1323. // 加密登记
  1324. // console.log('thisFolderRole',thisFolderRole.value);
  1325. arr = rightMenuRole(toRaw(thisFolderRole.value),arr)
  1326. }
  1327. // console.log('thisRole.value',thisRole.value);
  1328. if(thisRole.value.length){
  1329. //权限
  1330. arr = publicRightMenuRole(toRaw(thisRole.value),arr)
  1331. }
  1332. if(thisFolder.value.dirType == '1' && !isDept.value){
  1333. arr = ordinaryFolder.value
  1334. }
  1335. if(arr.length<1){
  1336. noMenuItem.value = true
  1337. }else{
  1338. noMenuItem.value = false
  1339. }
  1340. console.log('filterArr',arr);
  1341. return arr
  1342. }
  1343. function mouseClick() {
  1344. if (cliCC.value) {
  1345. cliCC.value = false
  1346. }
  1347. if (anyP) {
  1348. anyP.value = false
  1349. }
  1350. }
  1351. // 文件夹右键事件
  1352. const folderRClick = (row, col, e) => {
  1353. e.preventDefault();
  1354. e.stopPropagation();
  1355. // thisFolder.value = '' //先清空
  1356. let thisRow = toRaw(row)
  1357. // console.log('thisFolder',thisFolder.value);
  1358. clickRow.value = thisRow
  1359. copyFolderName.value = row.dirName
  1360. // 唤出右键菜单,思路:获取鼠标位置来定位菜单
  1361. folderVisible.value = true;
  1362. foldertop.value = e.pageY;
  1363. folderleft.value = e.pageX;
  1364. };
  1365. // 关闭文件夹右键菜单
  1366. const closeRMenu = () => {
  1367. // console.log("close");
  1368. folderVisible.value = false;
  1369. };
  1370. // 文件夹收藏事件
  1371. const collectFolder = () => {
  1372. isFolder.value = 'Y'
  1373. // clickRow.value = thisFolder.value
  1374. // thisFolder.value = ''
  1375. copyFileName.value = clickRow.value.dirName
  1376. collects.value = true
  1377. }
  1378. // 左箭头事件
  1379. const arrowLift =async () => {
  1380. // router.go(-1)
  1381. // console.log(1);
  1382. topPath.value = backFolder.value.dirPath
  1383. // console.log('topPath',toRaw(topPath.value));
  1384. newDirId.value = backFolder.value.parentId
  1385. newSpaceId.value = backFolder.value.spaceId
  1386. documents.getALLdocumentByType({
  1387. parentId: newDirId.value - 0,
  1388. spaceId: newSpaceId.value - 0
  1389. },2).then(res => {
  1390. folderList.value = res.data
  1391. if (res.data.length === 0) {
  1392. myfile.getById(newDirId.value).then(res => {
  1393. if (res.code === 200) {
  1394. fileList.value = res.rows
  1395. }
  1396. })
  1397. } else {
  1398. myfile.getById(newDirId.value).then(res => {
  1399. if (res.code === 200) {
  1400. fileList.value = JSON.parse(JSON.stringify(res.rows))
  1401. // console.log('fileList',toRaw(fileList.value));
  1402. }
  1403. })
  1404. }
  1405. })
  1406. }
  1407. // 归档
  1408. function goLock() {
  1409. fileCount.lockActor(clickRowId.value).then(res => {
  1410. if (res.code === 200) {
  1411. ElMessage({
  1412. type: "success",
  1413. message: "归档成功"
  1414. })
  1415. cliCC.value = false
  1416. anyP.value = false
  1417. }
  1418. })
  1419. }
  1420. function formatFileSize(fileSize) {
  1421. if (fileSize >= 1024 * 1024 * 1024) {
  1422. // 大于等于1GB,显示GB
  1423. return (fileSize / (1024 * 1024 * 1024)).toFixed(2) + 'GB';
  1424. } else if (fileSize >= 1024 * 1024) {
  1425. // 大于等于1MB,显示MB
  1426. return (fileSize / (1024 * 1024)).toFixed(2) + 'MB';
  1427. } else if (fileSize >= 1024) {
  1428. // 大于等于1KB,显示KB
  1429. return (fileSize / 1024).toFixed(2) + 'KB';
  1430. } else {
  1431. // 小于1KB,显示字节
  1432. return fileSize + 'B';
  1433. }
  1434. }
  1435. function formatStorage(sizeInGB) {
  1436. if (sizeInGB >= 1) {
  1437. return sizeInGB.toFixed(2) + 'GB';
  1438. } else {
  1439. const sizeInMB = sizeInGB * 1024;
  1440. if (sizeInMB >= 1) {
  1441. return sizeInMB.toFixed(2) + 'MB';
  1442. } else {
  1443. const sizeInKB = sizeInMB * 1024;
  1444. return sizeInKB.toFixed(2) + 'KB';
  1445. }
  1446. }
  1447. }
  1448. //点击收藏后刷新文件
  1449. const refreshFile = ()=>{
  1450. // console.log('ref',toRaw(thisFolder.value));
  1451. if(toRaw(thisFolder.value).dirIdd && !leftNewFile.value){//如果点开了文件夹
  1452. // console.log(111);
  1453. folderClick()
  1454. }else{
  1455. // console.log(222);
  1456. getAllTop()
  1457. }
  1458. }
  1459. //star收藏事件
  1460. const collectByStar = (row,isfolder)=>{
  1461. // console.log('row',row);
  1462. if(isfolder){
  1463. let thisRow = toRaw(row)
  1464. isFolder.value = 'Y'
  1465. clickRow.value = thisRow
  1466. copyFolderName.value = row.dirName
  1467. copyFileName.value = clickRow.value.dirName
  1468. }else{
  1469. isFolder.value = "N"
  1470. clickRow.value = row
  1471. copyRow.value = row
  1472. clickRowId.value = row.docId
  1473. copyDirId.value = row.dirId
  1474. copyFileName.value = row.fileName
  1475. }
  1476. collects.value = true
  1477. }
  1478. // 取消文件收藏
  1479. const delCollect = async (row,isfolder)=>{
  1480. const thisRow = toRaw(row)
  1481. console.log('thisRow',thisRow);
  1482. let query = {}
  1483. if(isfolder){
  1484. query = {
  1485. isFolder:"Y",
  1486. relaId:thisRow.dirId
  1487. }
  1488. }else{
  1489. query = {
  1490. isFolder:"N",
  1491. relaId:thisRow.docId
  1492. }
  1493. }
  1494. const res = await delFavorite(query)
  1495. //TODO 之后需要重新获取数据 并message提示
  1496. console.log('res',res);
  1497. refreshFile()
  1498. }
  1499. //获取安全图标
  1500. const getLevelImg = (level)=>{
  1501. switch (level) {
  1502. case "L1":
  1503. return level1;
  1504. break;
  1505. case "L2":
  1506. return level2;
  1507. break;
  1508. case "L3":
  1509. return level3;
  1510. break;
  1511. case "L4":
  1512. return level4;
  1513. break;
  1514. return level1;
  1515. break;
  1516. }
  1517. }
  1518. const getLevelList = async ()=>{
  1519. const res = await getLevel()
  1520. if(res.rows){
  1521. levelList.value = res.rows.map(item=>{
  1522. return {
  1523. levelCode:item.levelCode,
  1524. levelName:item.levelName
  1525. }
  1526. })
  1527. console.log('levelList',levelList.value);
  1528. }
  1529. }
  1530. const setTablelevel = (level)=>{
  1531. const thisItem = levelList.value.find(item=>item.levelCode == level)
  1532. if(thisItem){
  1533. return thisItem.levelName
  1534. }else{
  1535. return '未加密'
  1536. }
  1537. }
  1538. //获取权限详情
  1539. const getLeveldetailFn =async (data)=>{
  1540. const res = await getLeveldetail(data)
  1541. // console.log('getLeveldetailFn',res);
  1542. if(res.code === 200){
  1543. thisFolderRole.value = res.data
  1544. }
  1545. // console.log('thisFolderRole',thisFolderRole.value);
  1546. }
  1547. const closeIptPass = ()=>{
  1548. showInputPassword.value = false
  1549. }
  1550. //输入验证密码后
  1551. const surePass = (pass)=>{
  1552. const passwordCookies = Cookies.get("pass");
  1553. // const oldPass = decrypt(passwordCookies)
  1554. // console.log('pass',pass);
  1555. // console.log('oldPass',oldPass);
  1556. // console.log('clickRow',clickRow);
  1557. showInputPassword.value = false
  1558. if(pass === passwordCookies){
  1559. const passArr = localStorage.getItem('passArr');
  1560. // console.log('passArr',passArr);
  1561. if(!passArr){
  1562. const newArr = []
  1563. newArr.push(clickRow.value.docId)
  1564. localStorage.setItem('passArr',JSON.stringify(newArr))
  1565. }else{
  1566. const passArrObj = JSON.parse(passArr)
  1567. passArrObj.push(clickRow.value.docId)
  1568. localStorage.setItem('passArr',JSON.stringify(passArrObj))
  1569. }
  1570. // 设置销毁
  1571. setTimeout(()=>{
  1572. const passArr = localStorage.getItem('passArr');
  1573. const passArrObj = JSON.parse(passArr)
  1574. console.log('```passArrObj',passArrObj);
  1575. const newArr = passArrObj.filter(item=>item != clickRow.value.docId)
  1576. console.log('```newArr',newArr);
  1577. localStorage.setItem('passArr',JSON.stringify(newArr))
  1578. },1000*30)
  1579. chooseSet(chooseRow.value,null,chooseNum.value)
  1580. }else{
  1581. ElMessage({ message: "验证失败", type: "error" })
  1582. }
  1583. }
  1584. const downLoadfile = ()=>{
  1585. myfile.fileDown(clickRow.value.docId).then(res=>{
  1586. var reader = new FileReader();
  1587. reader.onloadend = function(event){
  1588. //event 就是你要的返回内容
  1589. //因为返回的报错格式是字符串,手动转换成对象,转换成功表示请求失败
  1590. //转换失败就意味着你拿到的result是文件流,那么直接手动下载就好
  1591. try{
  1592. let data = JSON.parse(event.target.result)
  1593. }catch(err){
  1594. const link = document.createElement('a'); // 创建a标签
  1595. let blob = new Blob([res]);
  1596. link.style.display = 'none';
  1597. link.href = URL.createObjectURL(blob); // 创建下载的链接
  1598. link.setAttribute('download',clickRow.value.fileName); // 给下载后的文件命名
  1599. document.body.appendChild(link);
  1600. link.click(); // 点击下载
  1601. document.body.removeChild(link); // 完成移除元素
  1602. window.URL.revokeObjectURL(link.href); // 释放blob对象
  1603. }
  1604. };
  1605. reader.readAsText(res);
  1606. })
  1607. }
  1608. // 触底加载事件
  1609. const setScroll =async ()=>{
  1610. console.log('setScroll','到底喽');
  1611. // console.log('tableBeEnd.value',tableBeEnd.value);
  1612. filePageNum.value = filePageNum.value+1
  1613. const query = `${thisFolder.value.dirId}?pageSize=10&pageNum=${filePageNum.value}`
  1614. // -------------先禁止掉事件 定时器1秒钟后才能再次触发
  1615. tableBeEnd.value = true
  1616. // --------------------
  1617. const res = await myfile.getById(query)
  1618. console.log('setScrollres',res);
  1619. if (res.code === 200) {
  1620. // const newarr = res.rows.concat(toRaw(fileList.value))
  1621. const newarr = toRaw(fileList.value).concat(res.rows)
  1622. console.log('newarr',newarr);
  1623. fileList.value = JSON.parse(JSON.stringify(newarr))
  1624. if(newarr.length < tableTotal.value){
  1625. //获取后的数量<total就可以再次获取
  1626. setTimeout(()=>{
  1627. tableBeEnd.value = false
  1628. },1000)
  1629. }
  1630. }
  1631. // console.log('query',query);
  1632. // console.log('fileList',fileList.value);
  1633. }
  1634. // 获取用户信息
  1635. const getUserInfo =async ()=>{
  1636. const userStore = useUserStore();
  1637. const userId = toRaw(userStore.roles)
  1638. if(userId.some(item=>item == 'dept')){
  1639. isDept.value = true
  1640. }else{
  1641. isDept.value = false
  1642. }
  1643. console.log('isDept',isDept.value);
  1644. }
  1645. //修改文件夹权限
  1646. const upFirstFoler =async (item)=>{
  1647. // console.log('upFirstFoler',item);
  1648. const res = await myfile.getDir(item.dirId)
  1649. console.log('upFirstFolerres = ',res);
  1650. upFolderData.value = toRaw(res.data)
  1651. oneOrTwo.value = 1
  1652. folderCase.value = true
  1653. }
  1654. onMounted(() => {
  1655. getAllTop()
  1656. getSpaceList()
  1657. getUserInfo()
  1658. getLevelList()
  1659. // 添加监听,点击其他地方关闭文件夹右键菜单
  1660. window.addEventListener("click", closeRMenu, true);
  1661. window.addEventListener("click", mouseClick, true);
  1662. })
  1663. onActivated(()=>{
  1664. // console.log('onActivated.query',route.query);
  1665. loadingPreview.value = true
  1666. setTimeout(()=>{
  1667. if(route.query.clickRowId){
  1668. const newRow = JSON.parse(route.query.clickRowId)
  1669. // console.log('newRow',newRow);
  1670. myfile.getDir(newRow).then(res=>{
  1671. // console.log('tores',res);
  1672. thisFolder.value = res.data
  1673. refreshFile()
  1674. })
  1675. }
  1676. loadingPreview.value = false
  1677. },500)
  1678. })
  1679. // 监听路由变化
  1680. onBeforeRouteUpdate((to,from)=>{
  1681. console.log('to',to);
  1682. console.log('from',from);
  1683. if(to.name == 'department'){
  1684. loadingPreview.value = true
  1685. const thisdirId = to.params.dirId
  1686. console.log('thisdirId',thisdirId);
  1687. setTimeout(()=>{
  1688. if(thisdirId){
  1689. myfile.getDir(thisdirId).then(res=>{
  1690. console.log('tores',res);
  1691. thisFolder.value = res.data
  1692. refreshFile()
  1693. })
  1694. }
  1695. loadingPreview.value = false
  1696. },500)
  1697. }
  1698. // docId = to.query.clickRowId
  1699. // console.log(docId, "doc");
  1700. // console.log(copyRow, "row");
  1701. // edit();
  1702. })
  1703. return {
  1704. getSpaceList,
  1705. folderList,//文件夹的数据
  1706. fileList,//文件夹的数据
  1707. searchFire,//搜索文件的model
  1708. changeFile,//切换右侧视图的file
  1709. menuList,//右侧切换
  1710. selectedIndex,//当前选中下标
  1711. shotdown,//筛选出当前数据
  1712. useMenu,
  1713. arrorMenu,
  1714. blueLeft,//返回
  1715. ordinaryList,
  1716. ordinary,
  1717. fileStyle,
  1718. fileBox,
  1719. grayRight,//前进
  1720. squre,//视图切换
  1721. sort,//排序
  1722. folder,
  1723. files,
  1724. handleRowClick,
  1725. askApply,//申请扩容
  1726. cliCC,
  1727. mouseCli,//文件点击弹框
  1728. chooseSet,
  1729. trandata,
  1730. tranvalue,
  1731. anyP,
  1732. chooseSet1,
  1733. fileMenu,
  1734. createNewMenu,
  1735. // delBoser,
  1736. clickRowId,
  1737. createNewFile,
  1738. // fileUpload,
  1739. getImage,//筛选文件类型
  1740. handleSelectionChange,
  1741. handleSelectionChange1,
  1742. selectedBox,//重命名相关
  1743. restName,//重命名相关
  1744. getMenu,
  1745. folderId,
  1746. fileId,
  1747. // getAllMiddle,//拿到所有空间信息
  1748. delName,//删除空间信息
  1749. useSpace,//使用空间
  1750. allSpace,//总空间
  1751. percent,
  1752. arrowClick,
  1753. uploadModal,
  1754. sureUpload,
  1755. onSuccess,
  1756. fileArr,
  1757. directoryId,
  1758. folderClick,
  1759. copyDirId,//复制移动需要的↓
  1760. copyDocId,
  1761. copySpaceId,
  1762. copyFileId,
  1763. copyFileName,
  1764. copyFileSize,
  1765. copyFileType,
  1766. sureChangeName,//文件重命名
  1767. fileNameChange,//文件重命名模态框
  1768. nameForm,
  1769. collectImg,//收藏小星星
  1770. sortNum,
  1771. needBag,
  1772. isId,
  1773. editOnline,//在线编辑
  1774. copyParentId,
  1775. copyRow,
  1776. getAllTop,
  1777. newDirId,
  1778. newSpaceId,
  1779. showPreview,//控制图片预览
  1780. closeImgPreview,//关闭预览事件
  1781. previewData,//预览文件数据
  1782. router,
  1783. fileTrees,
  1784. getChildren,//子传父
  1785. copyOrMove,
  1786. impDirId,
  1787. impNum,
  1788. leftNewFile,
  1789. impSpaceId,
  1790. //历史版本=========
  1791. openForwardFile,
  1792. forwardTreeData,
  1793. fileUserTreeData,
  1794. filterMouseCli,
  1795. changeMsgClose,
  1796. historyPrew,
  1797. historycopyRow,
  1798. thanks,
  1799. getCback,
  1800. mouseClick,
  1801. folderVisible,
  1802. foldertop,
  1803. folderleft,
  1804. thisFolder,
  1805. folderRClick,
  1806. closeRMenu,
  1807. cancleHistoryPrew,
  1808. historyTotal,
  1809. //历史版本=========
  1810. fileUserTreeData,
  1811. thanks,
  1812. getCback,
  1813. mouseClick,
  1814. workOrEdit,
  1815. folderCase,//新建文件夹传值
  1816. getChildrenC,
  1817. oneOrTwo,//父传子判断
  1818. folderCheckout,
  1819. fileCheckout,
  1820. haveCheck,
  1821. onlyView,
  1822. goLock,
  1823. collects,//收藏父传子
  1824. getCollects,//收藏子传父
  1825. folderTotal,
  1826. fileTotal,
  1827. delMoreFile,//删除多个文件夹
  1828. topPath,
  1829. xz,//文件右键菜单left
  1830. yz,//文件右键菜单top
  1831. formatFileSize,
  1832. isFolder,
  1833. clickRow,
  1834. rename,
  1835. getRename,//文件夹重命名子传父
  1836. copyFolderName,
  1837. spaces,//空间扩容父传子
  1838. getSpaceC,//空间扩容子传父
  1839. copySpaceCup,
  1840. fileGrid,
  1841. folderGrid,
  1842. collectFolder,
  1843. arrowLift,
  1844. formatStorage,
  1845. showFile,
  1846. navBack,
  1847. onlineCase,
  1848. lastBB,
  1849. shareBack,
  1850. folderBack,
  1851. refreshFile,
  1852. delCollect,
  1853. backFolder,
  1854. collectByStar,
  1855. getLevelImg,
  1856. level1,
  1857. level2,
  1858. level3,
  1859. level4,
  1860. getLeveldetailFn,
  1861. thisFolderRole,
  1862. showInputPassword,
  1863. closeIptPass,
  1864. surePass,
  1865. chooseRow,
  1866. chooseNum,
  1867. loadingPreview,
  1868. thisRole,
  1869. noMenuItem,
  1870. downLoadfile,
  1871. addTab,
  1872. addFileTab,
  1873. addFolderAdd,
  1874. ordinaryFolder,
  1875. filePageNum,
  1876. setScroll,
  1877. tableBeEnd,
  1878. tableTotal,
  1879. spaceName,
  1880. getUserInfo,
  1881. isDept,
  1882. upFirstFoler,
  1883. //控制宫格展示
  1884. changeShow,
  1885. isList,
  1886. upFolderData,
  1887. setTablelevel,
  1888. levelList,
  1889. getLevelList,
  1890. closeUpload,
  1891. handleRemove,
  1892. loadingUpload
  1893. }
  1894. },
  1895. watch: {
  1896. },
  1897. components: {
  1898. BreadMenu,
  1899. FileEdit,
  1900. ImgPreview,
  1901. FileTree,
  1902. historyList,
  1903. TransferModal,
  1904. CreateFloder,
  1905. FileCollect,
  1906. FolderReName,
  1907. SpaceBig,
  1908. PlaceGridFolder,
  1909. PalaceGridFile,
  1910. inputPassword
  1911. },
  1912. }
  1913. </script>
  1914. <style lang="scss" scoped>
  1915. @import "@/assets/styles/my-common.scss";
  1916. .lodingBox{
  1917. position:absolute;
  1918. top: 0;
  1919. left: 0;
  1920. width: 100vh;
  1921. height: 100vh;
  1922. z-index: 10000000;
  1923. }
  1924. p {
  1925. margin: 0;
  1926. padding: 0;
  1927. }
  1928. .bigBox {
  1929. width: 100%;
  1930. height: 88vh;
  1931. display: flex;
  1932. justify-content: flex-start;
  1933. overflow: hidden;
  1934. }
  1935. .settingBox {
  1936. width: 25vw;
  1937. height: 92vh;
  1938. // border: 1px solid black;
  1939. border-radius: 4px;
  1940. /* margin: 5px 5px; */
  1941. margin-right: 8px;
  1942. background-color: white;
  1943. }
  1944. .topSearch {
  1945. width: 100%;
  1946. height: 48px;
  1947. background-color: #EBEFF6;
  1948. display: flex;
  1949. justify-content: space-between;
  1950. align-items: center;
  1951. padding-left: 16px;
  1952. padding-right: 16px;
  1953. }
  1954. .searchFire {
  1955. // width: 248px;
  1956. width: 100%;
  1957. height: 32px;
  1958. }
  1959. .searchBox{
  1960. display: flex;
  1961. justify-content: space-between;
  1962. position: relative;
  1963. padding: 8px 16px;
  1964. .SearchIcon{
  1965. color: gray;
  1966. position: absolute;
  1967. right: 5%;
  1968. top: 35%;
  1969. }
  1970. }
  1971. .setBox {
  1972. width: 88px;
  1973. height: 112px;
  1974. text-align: center;
  1975. margin-left: 5px;
  1976. margin-top: 5px;
  1977. position: relative;
  1978. .left_fileBox{
  1979. position: relative;
  1980. margin-top: 10px;
  1981. .levelImg{
  1982. width: 32px;
  1983. height: 32px;
  1984. position: absolute;
  1985. right: 5%;
  1986. bottom: 20%;
  1987. }
  1988. }
  1989. }
  1990. .setBox:hover {
  1991. background-color: #EEF9FF;
  1992. }
  1993. .setBox:hover .selectChe {
  1994. background-color: #EEF9FF;
  1995. display: block;
  1996. z-index: 1000;
  1997. }
  1998. .selectChe {
  1999. display: none;
  2000. width: 20px;
  2001. height: 20px;
  2002. background: rgba(255, 255, 255, 0.7);
  2003. border-radius: 4px 4px 4px 4px;
  2004. position: absolute;
  2005. top: 2px;
  2006. right: 2px;
  2007. line-height: 10px;
  2008. }
  2009. .mesBox {
  2010. width: 75vw;
  2011. height: 88vh;
  2012. border-radius: 4px;
  2013. background-color: white;
  2014. }
  2015. .useBox {
  2016. width: 100%;
  2017. height: 24px;
  2018. }
  2019. .tables {
  2020. display: inline-block;
  2021. width: 112px;
  2022. height: 22px;
  2023. border-radius: 4px;
  2024. line-height: 21px;
  2025. text-align: center;
  2026. font-size: 12px;
  2027. margin-left: 5px;
  2028. position: relative;
  2029. white-space: nowrap;
  2030. overflow: hidden;
  2031. text-overflow: ellipsis;
  2032. }
  2033. .tableLis {
  2034. display: inline-block;
  2035. width: 112px;
  2036. height: 22px;
  2037. border-radius: 4px;
  2038. background-color: #EBEFF6;
  2039. line-height: 21px;
  2040. text-align: center;
  2041. font-size: 12px;
  2042. margin-left: 5px;
  2043. position: relative;
  2044. white-space: nowrap;
  2045. overflow: hidden;
  2046. text-overflow: ellipsis;
  2047. max-width: auto;
  2048. }
  2049. .manyUse {
  2050. width: 100%;
  2051. height: 48px;
  2052. /* background-color: gray; */
  2053. line-height: 48px;
  2054. display: flex;
  2055. justify-content: flex-start;
  2056. align-items: center;
  2057. }
  2058. .el-dropdown-link {
  2059. color: white;
  2060. cursor: pointer;
  2061. }
  2062. .breadBox {
  2063. width: 100%;
  2064. height: 24px;
  2065. display: flex;
  2066. justify-content: space-between;
  2067. align-items: center;
  2068. background-color: #F6F7F9;
  2069. .topPath {
  2070. margin-left: 4px;
  2071. cursor: pointer;
  2072. color: #6F85B5;
  2073. font-size: 12px;
  2074. }
  2075. }
  2076. :deep(.el-collapse-item__header) {
  2077. height: 24px !important;
  2078. background-color: #EBEFF6 !important;
  2079. }
  2080. .detailBox {
  2081. width: 100%;
  2082. height: 50%;
  2083. // overflow-y: auto;
  2084. }
  2085. .showBox{
  2086. height: calc(100% - 48px - 24px);
  2087. }
  2088. :deep(.el-dialog__header) {
  2089. background-color: #ECEFF7;
  2090. margin-right: 0px;
  2091. }
  2092. :deep(.el-collapse-item__content) {
  2093. // height: 235px;
  2094. overflow-y: auto;
  2095. padding-bottom: 0;
  2096. }
  2097. :deep(.el-scrollbar__wrap) {
  2098. height: 100% !important;
  2099. // overflow-y: auto;
  2100. }
  2101. .fileTable {
  2102. height: 50%;
  2103. // overflow-y: auto;
  2104. // margin-top: 55px;
  2105. }
  2106. .setCli {
  2107. width: 156px;
  2108. max-height: auto;
  2109. position: absolute;
  2110. top: -70px;
  2111. left: 300px;
  2112. flex-wrap: 400;
  2113. background-color: white;
  2114. border: 1px solid gray;
  2115. border-radius: 4px;
  2116. z-index: 3;
  2117. overflow-y: auto;
  2118. // font-size: 16px;
  2119. }
  2120. .setCli1 {
  2121. width: 156px;
  2122. height: auto;
  2123. position: absolute;
  2124. background-color: white;
  2125. border: 1px solid gray;
  2126. border-radius: 4px;
  2127. z-index: 100;
  2128. overflow-y: auto;
  2129. }
  2130. .chooseSet {
  2131. width: 140px;
  2132. height: 30px;
  2133. line-height: 30px;
  2134. margin: 5px auto;
  2135. font-size: 13px;
  2136. cursor: pointer;
  2137. // display: flex;
  2138. // align-items: center;
  2139. // position: relative;
  2140. img {
  2141. margin-right: 4px;
  2142. vertical-align: middle;
  2143. }
  2144. }
  2145. .chooseSet:hover {
  2146. width: 140px;
  2147. height: 30px;
  2148. line-height: 30px;
  2149. margin: 5px auto;
  2150. font-size: 13px;
  2151. background-color: #F5F7F9;
  2152. /* color: white; */
  2153. }
  2154. :deep([data-v-69cdaa40] .el-collapse-item__header) {
  2155. padding-left: 10px;
  2156. }
  2157. :deep(.el-collapse-item__content) {
  2158. // height: 235px;
  2159. overflow-y: auto;
  2160. }
  2161. .ellipsis-text {
  2162. white-space: nowrap;
  2163. overflow: hidden;
  2164. text-overflow: ellipsis;
  2165. max-width: auto;
  2166. }
  2167. .right_menu {
  2168. width: 156px;
  2169. position: absolute;
  2170. padding: 8px;
  2171. box-shadow: 0px 2px 10px 1px rgba(199, 203, 216);
  2172. border-radius: 4px 4px 4px 4px;
  2173. border: 1px solid gray;
  2174. background-color: #fff;
  2175. z-index: 10000;
  2176. .menu_item {
  2177. width: 100%;
  2178. height: 30px;
  2179. border-radius: 4px 4px 4px 4px;
  2180. line-height: 30px;
  2181. display: flex;
  2182. margin: 5px auto;
  2183. align-items: center;
  2184. font-size: 13px;
  2185. &:hover {
  2186. background-color: #f5f7f9;
  2187. }
  2188. span {
  2189. margin-left: 4px;
  2190. }
  2191. }
  2192. }
  2193. // 扩容盒子
  2194. .expansion{
  2195. margin: 0 16px;
  2196. border-top: 1px solid #C1CCE3 ;
  2197. .top_box{
  2198. margin-top: 16px;
  2199. width: 100%;
  2200. display: flex;
  2201. justify-content: space-between;
  2202. }
  2203. }
  2204. .isCheck {
  2205. opacity: 1 !important;
  2206. }
  2207. :deep(.el-tag__content) {
  2208. display: block;
  2209. }
  2210. :deep(.el-icon el-tag__close) {
  2211. display: block;
  2212. }
  2213. :deep(.el-collapse-item__content) {
  2214. height: 100%;
  2215. border-bottom: none;
  2216. }
  2217. // 隐藏全选按钮
  2218. .file-jia {
  2219. :deep(.el-table th.el-table__cell:nth-child(1) .cell) {
  2220. visibility: hidden;
  2221. }
  2222. }
  2223. .file-title{
  2224. color: #2E6BC8;
  2225. margin-left: 30px;
  2226. }
  2227. ::v-deep .el-collapse-item__arrow {
  2228. position: relative;
  2229. color: #2e6bc8;
  2230. right: 97%;
  2231. }
  2232. :deep(.el-collapse-item__header) {
  2233. padding-left: 10px;
  2234. box-sizing: border-box;
  2235. }
  2236. .palace-grid{
  2237. margin-left: 4px;
  2238. margin-right: 20px;
  2239. }
  2240. </style>