MyFile.vue 85 KB

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