MyFile.vue 109 KB

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