folderFileBox.vue 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948
  1. <template>
  2. <div class="f_box" @dragover.prevent @drop="handleDrop">
  3. <div class="f_box_top">
  4. <div class="f_box_top_left">
  5. <el-breadcrumb separator="/">
  6. <el-breadcrumb-item style="color: #000; font-weight: 600"
  7. ><span @click="goBackPage">{{
  8. lang.rootDirectory
  9. }}</span></el-breadcrumb-item
  10. >
  11. <el-breadcrumb-item>{{ data.name }}</el-breadcrumb-item>
  12. </el-breadcrumb>
  13. <!-- <div class="f_box_top_title">文件</div> -->
  14. </div>
  15. <div class="f_box_top_center">
  16. <span :class="{ active: fileType == 1 }" @click="checkType(1)">{{
  17. lang.fileData
  18. }}</span>
  19. <span :class="{ active: fileType == 2 }" @click="checkType(2)">{{
  20. lang.backTest
  21. }}</span>
  22. </div>
  23. </div>
  24. <div class="f_box_container" v-if="fileType == 1">
  25. <div class="f_box_top_right">
  26. <div class="input">
  27. <input
  28. type="text"
  29. v-model="fileName"
  30. :placeholder="lang.selectFileName"
  31. @input="debouncedSearch"
  32. />
  33. <div class="serch"></div>
  34. </div>
  35. <el-button type="primary" size="small" @click="serchFile">
  36. <img
  37. style="
  38. vertical-align: middle;
  39. transform: scale(1.1);
  40. padding-bottom: 2px;
  41. box-sizing: border-box;
  42. " src="../../../assets/shuax.svg" alt=""/>
  43. {{ lang.flushed }}
  44. </el-button>
  45. <el-button v-if="userid == data.userid" type="primary" icon="el-icon-plus" size="small"
  46. @click="addImg($event)">{{ lang.uploadFile }}
  47. <input type="file" accept="*" style="display: none" multiple="multiple"
  48. @change="beforeUpload($event)"/></el-button>
  49. <el-button v-if="userid == data.userid" type="primary" icon="el-icon-plus" size="small"
  50. @click="importFromWebpage($event)">{{ lang.importFromWebpage }}
  51. <!-- <input-->
  52. <!-- type="file"-->
  53. <!-- accept="*"-->
  54. <!-- style="display: none"-->
  55. <!-- multiple="multiple"-->
  56. <!-- @change="importFromWebpage($event)"-->
  57. <!-- />-->
  58. </el-button>
  59. <el-button type="primary" size="small" @click="openG" v-if="userid == data.userid && data.isMo == '2'">
  60. <img style="vertical-align: middle" src="../../../assets/ETL.svg" alt=""/>
  61. {{ lang.associatedFiles }}
  62. </el-button>
  63. <el-button
  64. type="primary"
  65. v-if="checkArray.length && userid == data.userid"
  66. size="small"
  67. @click="batchRemove"
  68. >
  69. <img
  70. style="vertical-align: middle; padding-bottom: 3px"
  71. src="../../../assets/yichuBtn.svg"
  72. alt=""
  73. />
  74. {{ lang.remove }}</el-button
  75. >
  76. <el-button
  77. type="danger"
  78. style="background: #f56c6c"
  79. v-if="checkArray.length && userid == data.userid"
  80. size="small"
  81. @click="batchDelete"
  82. >
  83. <img
  84. style="vertical-align: middle; padding-bottom: 3px"
  85. src="../../../assets/delBtn.svg"
  86. alt=""
  87. />
  88. {{ lang.delete }}</el-button
  89. >
  90. <div
  91. v-if="checkArray.length"
  92. style="
  93. margin-left: 12px;
  94. color: #b0b0b0;
  95. font-size: 14px;
  96. flex-shrink: 0;
  97. line-height: 35px;
  98. "
  99. >
  100. {{ lang.x_items_selected.replace("${x}",checkArray.length) }}
  101. <!-- {{ lang.selectedFiles }}&nbsp;{{ checkArray.length }}&nbsp;{{
  102. lang.piece
  103. }} -->
  104. </div>
  105. <!-- <div class="btn" @click="serchFile">刷新</div>
  106. <div class="btn" @click="addImg($event)">
  107. 上传文件
  108. <input
  109. type="file"
  110. accept="*"
  111. style="display: none"
  112. multiple="multiple"
  113. @change="beforeUpload($event)"
  114. />
  115. </div> -->
  116. <!-- <div class="btn" @click="openG" v-if="userid == data.userid && data.isMo == '2'">关联文件</div>
  117. <div class="btn" @click="batchRemove">移除</div>
  118. <div class="btn delBtn" @click="batchDelete">删除</div> -->
  119. </div>
  120. <!-- <div class="f_box_top">
  121. <div class="f_box_top_left"></div>
  122. <div class="f_box_top_right">
  123. </div>
  124. </div> -->
  125. <!-- <div class="none_box" v-if="fileArray.length == 0">暂无上传文件</div> -->
  126. <!-- v-else-if="stype == '2' && fileArray.length" -->
  127. <div
  128. v-show="fileType == 1"
  129. class="f_box_file_list"
  130. v-loading.body="isLoading"
  131. >
  132. <div class="list_file_box">
  133. <el-table
  134. :data="fileArray"
  135. border
  136. style="width: 100%; cursor: pointer"
  137. max-height="800px"
  138. @selection-change="handleSelectionChange"
  139. ref="myTable"
  140. :row-key="(row) => row.id"
  141. @row-click="checkFile"
  142. >
  143. <template #empty>
  144. <div class="customC">
  145. <div style="height: 50px; line-height: 50px; width: 47.4px">
  146. <img
  147. style="width: 100%"
  148. src="../../../assets/flieKong.svg"
  149. alt=""
  150. />
  151. </div>
  152. <div style="height: 50px; line-height: 40px">
  153. {{ lang.noDataContent }}
  154. </div>
  155. </div>
  156. </template>
  157. <el-table-column
  158. type="selection"
  159. width="50px"
  160. :reserve-selection="true"
  161. fixed
  162. ></el-table-column>
  163. <el-table-column
  164. prop="name"
  165. :label="lang.fileName"
  166. show-overflow-tooltip
  167. min-width="150px"
  168. ></el-table-column>
  169. <el-table-column
  170. prop="folderName"
  171. :label="lang.folderBelongs"
  172. show-overflow-tooltip
  173. min-width="150px"
  174. ></el-table-column>
  175. <el-table-column
  176. prop="username"
  177. :label="lang.owner"
  178. show-overflow-tooltip
  179. width="100px"
  180. ></el-table-column>
  181. <el-table-column :label="lang.sliceClassification" width="100px">
  182. <template slot-scope="scope">
  183. {{ getState(scope.row.ingestionStatus) }}
  184. </template>
  185. </el-table-column>
  186. <el-table-column :label="lang.graphExtraction" width="100px">
  187. <template slot-scope="scope">
  188. {{ getState2(scope.row.extractionStatus) }}
  189. </template>
  190. </el-table-column>
  191. <el-table-column
  192. :label="lang.fileType"
  193. show-overflow-tooltip
  194. width="100px"
  195. >
  196. <template slot-scope="scope">
  197. {{ scope.row.documentType ? scope.row.documentType : "-" }}
  198. </template>
  199. </el-table-column>
  200. <!-- <el-table-column label="公开状态" show-overflow-tooltip width="80px"></el-table-column> -->
  201. <el-table-column
  202. prop="time"
  203. :label="lang.uploadTime"
  204. show-overflow-tooltip
  205. width="100px"
  206. >
  207. <template slot-scope="scope">
  208. {{ scope.row.time }}
  209. </template>
  210. </el-table-column>
  211. <el-table-column :label="lang.operate" width="100px" fixed="right">
  212. <template slot-scope="scope">
  213. <el-popover
  214. placement="bottom-end"
  215. trigger="hover"
  216. visible-arrow
  217. popper-class="custom-popover"
  218. width="100px"
  219. >
  220. <div class="BtnHP">
  221. <div class="BtnHPDel1">
  222. <!-- <el-button
  223. type="primary"
  224. size="small"
  225. @click="extractFile(scope.row)"
  226. v-if="userid == data.userid "
  227. :disabled="scope.row.ingestionStatus == 'failed'"
  228. >提取</el-button
  229. > -->
  230. <div
  231. class="btnBh"
  232. @click="extractFile(scope.row)"
  233. @mouseover="isHover = true"
  234. v-if="userid == data.userid"
  235. :disabled="scope.row.ingestionStatus == 'failed'"
  236. @mouseleave="isHover = false"
  237. >
  238. <img
  239. style="width: 14px"
  240. :src="isHover ? tqList2 : tqList"
  241. alt=""
  242. />
  243. <span :class="isHover ? 'lookHp2' : 'lookHp1'">{{
  244. lang.extract
  245. }}</span>
  246. </div>
  247. <!-- <el-button
  248. type="primary"
  249. size="small"
  250. @click="checkFile(scope.row)"
  251. :disabled="scope.row.ingestionStatus == 'failed'"
  252. >查看</el-button
  253. > -->
  254. <div
  255. class="btnBh"
  256. @click="checkFile(scope.row)"
  257. @mouseover="isHover2 = true"
  258. :disabled="scope.row.ingestionStatus == 'failed'"
  259. @mouseleave="isHover2 = false"
  260. >
  261. <img :src="isHover2 ? look2 : look1" alt="" />
  262. <span :class="isHover2 ? 'lookHp2' : 'lookHp1'">{{
  263. lang.view
  264. }}</span>
  265. </div>
  266. </div>
  267. <div
  268. class="btnBh"
  269. @click="removeFile(scope.row.id, scope.row.documentid)"
  270. @mouseover="isHover3 = true"
  271. v-if="userid == data.userid && data.isMo == '2'"
  272. @mouseleave="isHover3 = false"
  273. >
  274. <img
  275. style="width: 14px"
  276. :src="isHover3 ? yichu2 : yichu"
  277. alt=""
  278. />
  279. <span :class="isHover3 ? 'lookHp2' : 'lookHp1'">{{
  280. lang.remove
  281. }}</span>
  282. </div>
  283. <div
  284. class="btnBh"
  285. @click="downloadFile(scope.row)"
  286. @mouseover="isHover4 = true"
  287. :disabled="scope.row.ingestionStatus == 'failed'"
  288. @mouseleave="isHover4 = false"
  289. >
  290. <img :src="isHover4 ? download2 : download" alt="" />
  291. <span :class="isHover4 ? 'lookHp2' : 'lookHp1'">{{
  292. lang.download
  293. }}</span>
  294. </div>
  295. <!-- <el-button
  296. type="primary"
  297. size="small"
  298. v-if="userid == data.userid && data.isMo == '2'"
  299. @click="removeFile(scope.row.id, scope.row.documentid)"
  300. >移除</el-button
  301. > -->
  302. <!-- <el-button
  303. type="danger"
  304. size="small"
  305. v-if="userid == scope.row.userid"
  306. @click="deleteFile(scope.row.id, scope.row.documentid)"
  307. >删除</el-button
  308. > -->
  309. <div
  310. style="
  311. background-color: #e7e7e7;
  312. width: 100%;
  313. height: 0.5px;
  314. margin: 5px 0;
  315. "
  316. ></div>
  317. <div class="BtnHPDel">
  318. <div
  319. class="btnBh2"
  320. @click="deleteFile(scope.row.id, scope.row.documentid)"
  321. v-if="scope.row.userid == userid"
  322. >
  323. <img src="../../../assets/listdel.svg" alt="" />
  324. <span style="color: #de4c41">{{ lang.delete }}</span>
  325. </div>
  326. </div>
  327. </div>
  328. <el-button
  329. slot="reference"
  330. class="BtnH"
  331. style="border: none; padding: 5px"
  332. @click.stop=""
  333. >
  334. <i class="el-icon-more"></i>
  335. </el-button>
  336. </el-popover>
  337. </template>
  338. </el-table-column>
  339. </el-table>
  340. </div>
  341. <div class="paginationArea">
  342. <span>{{ lang.a_total_of_x_items.replace("${x}", total) }}</span>
  343. <el-pagination
  344. class="pageBox"
  345. style="margin-top: 10px"
  346. layout="prev, pager, next, slot"
  347. :page-size="limit"
  348. :total="total"
  349. @current-change="handleCurrentChange"
  350. :page-sizes="[10, 20, 50, 100]"
  351. ><el-select
  352. v-model="limit"
  353. @change="handleSizeChange"
  354. class="file_mySelect"
  355. >
  356. <el-option
  357. v-for="item in [10, 20, 50, 100]"
  358. :key="item"
  359. :label="item"
  360. :value="item"
  361. ></el-option>
  362. </el-select>
  363. </el-pagination>
  364. </div>
  365. <div v-if="proVisible" class="mask">
  366. <div class="progressBox">
  367. <div class="lbox">
  368. {{ lang.uploadWait }}<img src="../../../assets/KekeLoading.gif" />
  369. </div>
  370. <div class="lbox_count">{{ pcount }} / {{ ptotal }}</div>
  371. </div>
  372. </div>
  373. </div>
  374. </div>
  375. <testBox
  376. v-if="fileType == 2"
  377. :userid="userid"
  378. :folderid="folderid"
  379. ></testBox>
  380. <wpdf :dialogVisiblePdf.sync="dialogVisiblePdf" :url="wurl"></wpdf>
  381. <wVideo :dialogVisibleVideo.sync="dialogVisibleVideo" :url="wurl"></wVideo>
  382. <wOffice
  383. :dialogVisibleOffice.sync="dialogVisibleOffice"
  384. :url="wurl"
  385. ></wOffice>
  386. <relateFiles ref="relateFiles"></relateFiles>
  387. <checkDialog ref="checkDialog"></checkDialog>
  388. <WebCrawlDialog :visible.sync="webUrlDialogVisible" @confirm="handleWebUrlConfirm"/>
  389. </div>
  390. </template>
  391. <script>
  392. import officeImg from "../../../assets/icon/sourceFile/office.png";
  393. import pdfImg from "../../../assets/icon/sourceFile/pdf.png";
  394. import videoImg from "../../../assets/icon/sourceFile/video.png";
  395. import otherImg from "../../../assets/icon/sourceFile/other.png";
  396. import checkImg from "../../../assets/icon/sourceFile/check.png";
  397. import checkIsImg from "../../../assets/icon/sourceFile/check_is.png";
  398. // 导入SVG组件
  399. import look1 from "../../../assets/look1.svg";
  400. import look2 from "../../../assets/look2.svg";
  401. import tqList2 from "../../../assets/tqList2.svg";
  402. import tqList from "../../../assets/tqList.svg";
  403. import yichu from "../../../assets/yichu.svg";
  404. import yichu2 from "../../../assets/yichu2.svg";
  405. import download from "../../../assets/download.svg";
  406. import download2 from "../../../assets/download2.svg";
  407. import wVideo from "../test/file/wVideo.vue";
  408. import wpdf from "../test/file/wPdf2.vue";
  409. import wOffice from "../test/file/wOffice.vue";
  410. import { v4 as uuidv4 } from "uuid";
  411. import relateFiles from "./components/relateFiles";
  412. import checkDialog from "./components/checkDialog";
  413. import testBox from "./components/testBox";
  414. import WebCrawlDialog from "./WebCrawlDialog.vue";
  415. export default {
  416. components: {
  417. wVideo,
  418. wpdf,
  419. wOffice,
  420. relateFiles,
  421. checkDialog,
  422. testBox,
  423. WebCrawlDialog,
  424. },
  425. props: {
  426. userid: {
  427. type: String,
  428. },
  429. typeArray: {
  430. type: Array,
  431. },
  432. pid: {
  433. type: String,
  434. },
  435. folderid: {
  436. type: String,
  437. },
  438. moFolderid: {
  439. type: String,
  440. },
  441. data: {
  442. type: Object,
  443. },
  444. },
  445. watch: {
  446. pid: {
  447. immediate: true,
  448. deep: true,
  449. handler(newValue, oldValue) {
  450. this.fileArray = [];
  451. this.checkArray = [];
  452. this.fileName = "";
  453. this.proVisible = false;
  454. this.page = 1;
  455. this.getData();
  456. },
  457. },
  458. },
  459. data() {
  460. return {
  461. look1: look1,
  462. look2: look2,
  463. tqList2: tqList2,
  464. tqList: tqList,
  465. yichu: yichu,
  466. yichu2: yichu2,
  467. download: download,
  468. download2: download2,
  469. isHover: false,
  470. isHover2: false,
  471. isHover3: false,
  472. isHover4: false,
  473. isLoading: false,
  474. proVisible: false,
  475. stype: 2,
  476. fileArray: [],
  477. officeImg: officeImg,
  478. pdfImg: pdfImg,
  479. videoImg: videoImg,
  480. otherImg: otherImg,
  481. checkImg: checkImg,
  482. checkIsImg: checkIsImg,
  483. checkArray: [],
  484. checkArray2: [],
  485. dialogVisiblePdf: false,
  486. dialogVisibleVideo: false,
  487. dialogVisibleOffice: false,
  488. wurl: "",
  489. moveBox: false,
  490. checkTypeArray: [],
  491. moveChild: "",
  492. fileName: "",
  493. limit: 10,
  494. total: 0,
  495. page: 1,
  496. debounceTimeout: null,
  497. pcount: 0,
  498. ptotal: 0,
  499. fileType: 1,
  500. webUrlDialogVisible: false,
  501. };
  502. },
  503. computed: {
  504. getState() {
  505. return function (item) {
  506. if (item == "success") {
  507. return this.lang.success;
  508. } else if (item == "failed") {
  509. return this.lang.fail;
  510. } else if (item == "augmenting") {
  511. return this.lang.sliced;
  512. } else if (item == "pending") {
  513. return this.lang.pending;
  514. } else if (item == "enriched") {
  515. return "enriched";
  516. } else if (!item) {
  517. return this.lang.sliced;
  518. } else {
  519. return item;
  520. }
  521. };
  522. },
  523. getState2() {
  524. return function (item) {
  525. if (item == "success") {
  526. return this.lang.success;
  527. } else if (item == "failed") {
  528. return this.lang.fail;
  529. } else if (item == "pending") {
  530. return this.lang.pending;
  531. } else if (item == "processing") {
  532. return this.lang.processing;
  533. } else if (item == "enriched") {
  534. return "enriched";
  535. } else if (!item) {
  536. return this.lang.uploading;
  537. } else {
  538. return item;
  539. }
  540. };
  541. },
  542. },
  543. methods: {
  544. goBackPage() {
  545. this.$emit("goCheckType", this.pid.split("/")[0]);
  546. },
  547. handleCurrentChange(val) {
  548. this.page = val;
  549. this.getData();
  550. },
  551. handleSizeChange(val) {
  552. this.page = 1;
  553. this.limit = val;
  554. this.getData();
  555. },
  556. getData() {
  557. this.isLoading = true;
  558. let params = {
  559. uid: this.userid,
  560. folderid: this.folderid,
  561. n: this.fileName.trim(),
  562. page: this.page,
  563. num: this.limit,
  564. };
  565. this.ajax
  566. .post(this.$store.state.fileApi + "getFileD", [params])
  567. .then((res) => {
  568. this.isLoading = false;
  569. console.log(res.data);
  570. this.total = res.data.result.length ? res.data.result[0].num : 0;
  571. this.fileArray = res.data.result;
  572. })
  573. .catch((err) => {
  574. this.isLoading = false;
  575. console.error(err);
  576. });
  577. },
  578. handleSelectionChange(selectedRows) {
  579. this.checkArray = selectedRows.map((row) => row.id);
  580. this.checkArray2 = selectedRows.map((row) => ({
  581. id: row.id,
  582. documentid: row.documentid,
  583. }));
  584. },
  585. addImg(e) {
  586. var el = e.currentTarget;
  587. el.getElementsByTagName("input")[0].click();
  588. e.target.value = "";
  589. },
  590. handleDrop(event) {
  591. event.preventDefault(); // 阻止默认的浏览器下载行为
  592. const files = event.dataTransfer.files;
  593. if (files.length) {
  594. this.beforeUpload({ target: { files } });
  595. }
  596. },
  597. debouncedSearch() {
  598. clearTimeout(this.debounceTimeout);
  599. this.debounceTimeout = setTimeout(() => {
  600. this.serchFile();
  601. }, 300);
  602. },
  603. serchFile() {
  604. this.page = 1;
  605. this.getData();
  606. },
  607. async beforeUpload(event) {
  608. let file = "";
  609. let cfindex2 = 0;
  610. this.proVisible = true;
  611. const allowedExtensions = [
  612. "csv",
  613. "xls",
  614. "xlsx",
  615. "md",
  616. "pdf",
  617. "txt",
  618. "ppt",
  619. "pptx",
  620. "docx",
  621. "doc",
  622. "jpg",
  623. "jpeg",
  624. "png",
  625. "gif",
  626. "bmp",
  627. ];
  628. // let uuid = uuidv4();
  629. // let res = window.uploadFile({ file: event.target.files[0], uuid, userid:this.userid, folderid:this.folderid, moFolderid: this.moFolderid })
  630. // console.log(res);
  631. // return
  632. const uploadFiles = async (files) => {
  633. this.pcount = 0;
  634. this.ptotal = files.length;
  635. for (let cfindex = 0; cfindex < files.length; cfindex++) {
  636. file = files[cfindex];
  637. const fileExtension = file.name.split(".").pop().toLowerCase();
  638. if (!allowedExtensions.includes(fileExtension)) {
  639. this.$message.error(`${this.lang.unsupFileformats}: ${file.name}`);
  640. await new Promise((resolve) => setTimeout(resolve, 1000)); // 延迟1秒再跳过
  641. continue; // 跳过不支持的文件
  642. }
  643. let uuid = uuidv4();
  644. let formData = new FormData();
  645. const timestamp = Date.now();
  646. const baseName = file.name.slice(0, -(fileExtension.length + 1));
  647. let string = [this.folderid, this.moFolderid].filter((id) => id);
  648. formData.append(
  649. "file",
  650. new File([file], `${baseName}${timestamp}.${fileExtension}`)
  651. );
  652. formData.append("collection_ids", JSON.stringify(string));
  653. formData.append("id", uuid);
  654. formData.append(
  655. "metadata",
  656. JSON.stringify({ title: file.name, collection_ids: string })
  657. );
  658. formData.append("ingestion_mode", "fast");
  659. formData.append("run_with_orchestration", "false");
  660. // 使用同步方式上传文件
  661. await this.uploadFile(formData, file.name, uuid);
  662. this.pcount = cfindex + 1;
  663. // 每5秒上传一次
  664. if (cfindex < files.length - 1) {
  665. await new Promise((resolve) => setTimeout(resolve, 5000));
  666. }
  667. }
  668. setTimeout(() => {
  669. this.proVisible = false;
  670. this.$message.success(this.lang.operComplete);
  671. this.getData(); // 在上传完所有文件后再调用getData
  672. }, 1000);
  673. };
  674. await uploadFiles(event.target.files);
  675. },
  676. async importFromWebpage(event) {
  677. console.log('importFromWebpage');
  678. this.webUrlDialogVisible = true;
  679. },
  680. handleWebUrlConfirm(dataFromForm) {
  681. if (!dataFromForm) return;
  682. this.proVisible = true;
  683. // this.isLoading = true;
  684. // 直接 decode,不用判断前缀
  685. // let url = decodeURIComponent(dataFromForm.url);
  686. // const fileExtension = file.name.split(".").pop().toLowerCase();
  687. // if (!allowedExtensions.includes(fileExtension)) {
  688. // this.$message.error(`${this.lang.unsupFileformats}: ${file.name}`);
  689. // await new Promise((resolve) => setTimeout(resolve, 1000)); // 延迟1秒再跳过
  690. // continue; // 跳过不支持的文件
  691. // }
  692. let uuid = uuidv4();
  693. let formData = new FormData();
  694. // const timestamp = Date.now();
  695. // const baseName = file.name.slice(0, -(fileExtension.length + 1));
  696. let string = [this.folderid, this.moFolderid].filter((id) => id);
  697. formData.append("url", dataFromForm.url)
  698. // formData.append(
  699. // "file",
  700. // new File([file], `${baseName}${timestamp}.${fileExtension}`)
  701. // );
  702. formData.append("collection_ids", JSON.stringify(string));
  703. formData.append("id", uuid);
  704. formData.append(
  705. "metadata",
  706. JSON.stringify({url: dataFromForm.url, collection_ids: string})
  707. );
  708. formData.append("ingestion_mode", "fast");
  709. formData.append("run_with_orchestration", "false");
  710. // 获取html2md服务地址,优先从store取,没有则默认
  711. const html2mdApi = process.env.VUE_APP_HTML2MD_API || 'http://localhost:7004';
  712. const url = html2mdApi + '/file/knowledge-base/html-to-markdown';
  713. const headers = {'Content-Type': 'multipart/form-data'};
  714. this.ajax.post(url, formData, {headers})
  715. .then(async (response) => {
  716. // if (this.loadingInstance) {
  717. // this.$nextTick(() => {
  718. // this.loadingInstance.close();
  719. // });
  720. // }
  721. console.log(response);
  722. if (response && response.data && response.data.results) {
  723. this.$message.success('文件上传成功');
  724. // 获取文件名和id
  725. // const fileName = response.data.results && response.data.results.filename ? response.data.results.filename : url;
  726. const fileName = response.data.title;
  727. const documentId = response.data.results && response.data.results.document_id;
  728. const status =
  729. response && response.status === 200
  730. ? "success"
  731. : "failed";
  732. const msg =
  733. response && response.status === 200
  734. ? "切片成功"
  735. : "切片失败";
  736. this.$message({
  737. message: msg,
  738. type: status == "success" ? status : "error",
  739. });
  740. // setTimeout(() => {
  741. this.getData();
  742. // }, 1000)
  743. setTimeout(() => {
  744. this.fileArray.forEach((e) => {
  745. if (e.documentid === uuid) {
  746. e.ingestionStatus = status;
  747. }
  748. });
  749. }, 1000);
  750. // 调用 bindFileAndFolder
  751. if (documentId) {
  752. await this.bindFileAndFolder(
  753. fileName,
  754. documentId,
  755. this.userid,
  756. this.folderid,
  757. this.moFolderid
  758. );
  759. }
  760. } else {
  761. this.$message.error(response && response.data && response.data.msg ? response.data.msg : '文件上传失败');
  762. }
  763. })
  764. .catch((error) => {
  765. this.$message.error('服务器繁忙');
  766. if (this.fileNames) this.fileNames.pop && this.fileNames.pop();
  767. if (this.fileUrls) this.fileUrls.pop && this.fileUrls.pop();
  768. console.log(error);
  769. if (this.loadingInstance) {
  770. this.$nextTick(() => {
  771. this.loadingInstance.close();
  772. });
  773. }
  774. });
  775. },
  776. async bindFileAndFolder(name, docid, uid, folder_id, mofid = '') {
  777. try {
  778. let params = {
  779. n: name,
  780. did: docid,
  781. uid: this.userid,
  782. fid: this.folderid,
  783. mofid: this.moFolderid != this.folderid ? this.moFolderid : "",
  784. };
  785. const res2 = await this.ajax.post(this.$store.state.api + "addFile", [
  786. params,
  787. ]);
  788. // 如果成功,关闭对话框
  789. if (res2 && res2.status === 200) {
  790. // this.handleClose && this.handleClose();
  791. this.webUrlDialogVisible = false;
  792. }
  793. console.log(res2);
  794. } catch (err) {
  795. console.error(err);
  796. this.$message.error(this.lang.uploadFail);
  797. }
  798. this.proVisible = false;
  799. },
  800. async uploadFile(formData, name, uuid) {
  801. try {
  802. this.ajax
  803. .post("https://r2rserver.cocorobo.cn/v3/documents", formData, {
  804. headers: {
  805. "Content-Type": "multipart/form-data",
  806. },
  807. })
  808. .then((res) => {
  809. console.log(res, formData);
  810. const message = res.data.results && res.data.results.message;
  811. const status =
  812. message === "Document created and ingested successfully."
  813. ? "success"
  814. : "failed";
  815. const msg =
  816. message === "Document created and ingested successfully."
  817. ? "切片成功"
  818. : "切片失败";
  819. this.$message({
  820. message: msg,
  821. type: status == "success" ? status : "error",
  822. });
  823. // setTimeout(() => {
  824. this.getData();
  825. // }, 1000)
  826. setTimeout(() => {
  827. this.fileArray.forEach((e) => {
  828. if (e.documentid === uuid) {
  829. e.ingestionStatus = status;
  830. }
  831. });
  832. }, 1000);
  833. })
  834. .catch((err) => {
  835. this.$message.error(this.lang.uploadFail);
  836. this.fileArray.forEach((e) => {
  837. if (e.documentid === uuid) {
  838. e.ingestionStatus = "failed";
  839. }
  840. });
  841. console.error(err);
  842. });
  843. let docid = uuid;
  844. let params = {
  845. n: name,
  846. did: docid,
  847. uid: this.userid,
  848. fid: this.folderid,
  849. mofid: this.moFolderid != this.folderid ? this.moFolderid : "",
  850. };
  851. const res2 = await this.ajax.post(this.$store.state.api + "addFile", [
  852. params,
  853. ]);
  854. console.log(res2);
  855. } catch (err) {
  856. console.error(err);
  857. this.$message.error(this.lang.uploadFail);
  858. }
  859. },
  860. formatFileSize(bytes) {
  861. if (bytes < 1024) {
  862. return bytes + "B";
  863. } else if (bytes < 1048576) {
  864. return (bytes / 1024).toFixed(2) + "KB";
  865. } else if (bytes < 1073741824) {
  866. return (bytes / 1048576).toFixed(2) + "MB";
  867. } else {
  868. return (bytes / 1073741824).toFixed(2) + "GB";
  869. }
  870. },
  871. deleteFile(fileid, documentid) {
  872. this.$confirm(this.lang.deleteFile, this.lang.prompt, {
  873. confirmButtonText: this.lang.confirm,
  874. cancelButtonText: this.lang.cancel,
  875. type: "warning",
  876. })
  877. .then(() => {
  878. let params = [
  879. {
  880. ids: fileid,
  881. documentids: documentid,
  882. },
  883. ];
  884. this.ajax //deleteFileByFilter
  885. .post(this.$store.state.fileApi + "deleteFile", params)
  886. .then((res) => {
  887. this.$message({
  888. message: this.lang.deleteSuccess,
  889. type: "success",
  890. });
  891. this.checkArray = [];
  892. this.checkArray2 = [];
  893. this.$refs.myTable.clearSelection();
  894. this.getData();
  895. })
  896. .catch((err) => {
  897. this.$message.error(this.lang.deleteFail);
  898. console.error(err);
  899. });
  900. })
  901. .catch(() => {});
  902. },
  903. batchDelete() {
  904. if (!this.checkArray.length) {
  905. this.$message.warning(this.lang.selectDeFile);
  906. return;
  907. }
  908. let array = this.checkArray2.map((item) => item.id);
  909. let array2 = this.checkArray2.map((item) => item.documentid);
  910. this.deleteFile(array.join(","), array2.join(","));
  911. },
  912. removeFile(fileid, documentid) {
  913. this.$confirm(this.lang.sureRemove, this.lang.prompt, {
  914. confirmButtonText: this.lang.confirm,
  915. cancelButtonText: this.lang.cancel,
  916. type: "warning",
  917. })
  918. .then(() => {
  919. let params = [
  920. {
  921. ids: fileid,
  922. documentids: documentid,
  923. folderid: this.folderid,
  924. },
  925. ];
  926. this.ajax
  927. .post(this.$store.state.fileApi + "removeFile", params)
  928. .then((res) => {
  929. this.$message({
  930. message: this.lang.removeSuccess,
  931. type: "success",
  932. });
  933. this.checkArray = [];
  934. this.checkArray2 = [];
  935. this.$refs.myTable.clearSelection();
  936. this.getData();
  937. })
  938. .catch((err) => {
  939. this.$message.error(this.lang.removeFail);
  940. console.error(err);
  941. });
  942. })
  943. .catch(() => {});
  944. },
  945. batchRemove() {
  946. if (!this.checkArray.length) {
  947. this.$message.warning(this.lang.seReFile);
  948. return;
  949. }
  950. let array = this.checkArray2.map((item) => item.id);
  951. let array2 = this.checkArray2.map((item) => item.documentid);
  952. this.removeFile(array.join(","), array2.join(","));
  953. },
  954. isSelectable(row) {
  955. return row.isMo !== "2";
  956. },
  957. openG() {
  958. this.$refs.relateFiles.openG(this.userid, this.folderid, this.moFolderid);
  959. },
  960. checkFile(row) {
  961. if (row.ingestionStatus != "success")
  962. return this.$message.info(this.lang.fileUploadFail);
  963. this.$refs.checkDialog.openG(row.documentid);
  964. },
  965. downloadFile(row) {
  966. let params = {
  967. documentid: row.documentid,
  968. filename: row.name,
  969. };
  970. // 使用axios发送GET请求下载文件
  971. this.ajax
  972. .post(`${this.$store.state.fileApi}downloadFile2`, [params], {
  973. responseType: "blob",
  974. })
  975. .then((response) => {
  976. const url = window.URL.createObjectURL(new Blob([response.data]));
  977. const link = document.createElement("a");
  978. link.href = url;
  979. link.setAttribute("download", row.name); // 设置下载文件名
  980. document.body.appendChild(link);
  981. link.click();
  982. link.remove();
  983. this.$message({
  984. message: this.lang.downloadSuccess,
  985. type: "success",
  986. });
  987. })
  988. .catch((err) => {
  989. this.$message.error(this.lang.downloadFail);
  990. console.error(err);
  991. });
  992. },
  993. extractFile(row) {
  994. if (row.ingestionStatus != "success")
  995. return this.$message.info(this.lang.fileUploadFail);
  996. let params = {
  997. documentid: row.documentid,
  998. };
  999. // 获取切片
  1000. try {
  1001. const res = this.ajax
  1002. .post(this.$store.state.fileApi + "extractFile2", [params])
  1003. .then((res) => {
  1004. console.log(res, row);
  1005. const message = res.data.result && res.data.result.message;
  1006. // const status = message === 'Document entities and relationships extracted successfully.' ? 'success' : 'failed';
  1007. // const msg = message === 'Document entities and relationships extracted successfully.' ? '提取成功' : '提取失败';
  1008. // this.$message({
  1009. // message: msg,
  1010. // type: status == 'success' ? status : 'error'
  1011. // })
  1012. // this.fileArray.forEach(e => {
  1013. // if (e.documentid === row.documentid) {
  1014. // e.extractionStatus = status;
  1015. // }
  1016. // });
  1017. setTimeout(() => {
  1018. this.getData();
  1019. }, 1000);
  1020. })
  1021. .catch((err) => {
  1022. this.$message.error(this.lang.extrFailed);
  1023. this.fileArray.forEach((e) => {
  1024. if (e.documentid === row.documentid) {
  1025. e.extractionStatus = "failed";
  1026. }
  1027. });
  1028. console.error(err);
  1029. });
  1030. console.log(res.data);
  1031. this.$message.success(this.lang.extractingFile);
  1032. } catch (err) {
  1033. console.error(err);
  1034. }
  1035. },
  1036. checkType(type) {
  1037. this.fileType = type;
  1038. },
  1039. },
  1040. mounted() {
  1041. // this.getData();
  1042. // const script = document.createElement('script');
  1043. // script.src = 'https://beta.cloud.cocorobo.cn/js/Common/uploadR2R.js';
  1044. // script.type = 'text/javascript';
  1045. // script.defer = true; // 或者 async,根据需要
  1046. // script.onload = () => {
  1047. // console.log('上传脚本加载成功');
  1048. // // 你可以在这里使用上传文件的功能了
  1049. // };
  1050. // script.onerror = () => {
  1051. // console.error('上传脚本加载失败');
  1052. // };
  1053. // document.head.appendChild(script);
  1054. },
  1055. };
  1056. </script>
  1057. <style scoped>
  1058. .f_box {
  1059. width: 100%;
  1060. /* height: 100%; */
  1061. position: relative;
  1062. min-height: 400px;
  1063. display: flex;
  1064. flex-direction: column;
  1065. }
  1066. .f_box_top {
  1067. display: flex;
  1068. align-items: center;
  1069. padding: 10px 0 0;
  1070. padding-top: 0px;
  1071. width: 100%;
  1072. box-sizing: border-box;
  1073. position: relative;
  1074. height: 50px;
  1075. min-height: 50px;
  1076. border-bottom: 1px solid #e8ebf0;
  1077. padding: 0 24px;
  1078. }
  1079. .f_box_top_left {
  1080. display: flex;
  1081. align-items: center;
  1082. }
  1083. .f_box_top_title {
  1084. font-size: 16px;
  1085. color: rgba(8, 13, 30, 0.9);
  1086. /* font-weight: bold; */
  1087. }
  1088. .btn {
  1089. display: flex;
  1090. cursor: pointer;
  1091. align-items: center;
  1092. height: 30px;
  1093. padding: 0 8px;
  1094. background: rgb(0, 97, 255);
  1095. color: #fff;
  1096. box-sizing: border-box;
  1097. border-radius: 4px;
  1098. font-size: 14px;
  1099. align-items: center;
  1100. }
  1101. .btn2 {
  1102. display: flex;
  1103. cursor: pointer;
  1104. align-items: center;
  1105. height: 30px;
  1106. padding: 0 8px;
  1107. background: #fff;
  1108. color: rgb(0, 97, 255);
  1109. border: 1px solid rgb(0, 97, 255);
  1110. box-sizing: border-box;
  1111. border-radius: 4px;
  1112. font-size: 14px;
  1113. align-items: center;
  1114. }
  1115. .f_box_top .delBtn {
  1116. background: rgb(255, 0, 13);
  1117. }
  1118. .btn + .btn2,
  1119. .btn + .btn,
  1120. .btn2 + .btn2,
  1121. .btn2 + .delBtn {
  1122. margin-left: 15px;
  1123. }
  1124. .f_box_container {
  1125. display: flex;
  1126. flex-direction: column;
  1127. gap: 16px;
  1128. height: 100%;
  1129. overflow: auto;
  1130. }
  1131. .f_box_container {
  1132. display: flex;
  1133. flex-direction: column;
  1134. gap: 16px;
  1135. height: 100%;
  1136. overflow: auto;
  1137. }
  1138. .f_box_top_right {
  1139. margin-left: auto;
  1140. /* max-width: calc(100% - 280px); */
  1141. overflow: hidden;
  1142. display: flex;
  1143. /* align-items: center; */
  1144. padding: 0 24px;
  1145. min-height: fit-content;
  1146. }
  1147. .f_box_top_right > .input {
  1148. position: relative;
  1149. /* height: 40px; */
  1150. }
  1151. .f_box_top_right >>> .el-button {
  1152. height: 35px !important;
  1153. font-size: 12.8px;
  1154. background-color: #3370ff;
  1155. border-radius: 6px;
  1156. margin-left: 12px;
  1157. }
  1158. .f_box_top_right >>> .el-button--primary:focus,
  1159. .f_box_top_right >>> .el-button--primary:hover {
  1160. filter: brightness(120%);
  1161. }
  1162. .f_box_top_right >>> .el-icon-plus:before {
  1163. font-size: 14px;
  1164. font-weight: 600;
  1165. /* vertical-align: middle; */
  1166. }
  1167. .f_box_top_right > .input > input {
  1168. width: 100%;
  1169. height: 100%;
  1170. border: 1px solid #dcdfe6;
  1171. border-radius: 5px;
  1172. padding: 0 15px 0 45px;
  1173. box-sizing: border-box;
  1174. font-size: 14px;
  1175. width: 250px;
  1176. height: 36px;
  1177. font-size: 12.8px;
  1178. border-radius: 6px;
  1179. outline: none;
  1180. }
  1181. .f_box_top_right > .input > .serch {
  1182. content: "";
  1183. display: block;
  1184. width: 20px;
  1185. height: 20px;
  1186. background-image: url("../../../assets/icon/sourceFile/search.png");
  1187. background-size: 100% 100%;
  1188. position: absolute;
  1189. left: 13px;
  1190. top: 50%;
  1191. transform: translateY(-50%);
  1192. cursor: pointer;
  1193. }
  1194. .f_box_top_right > .tab {
  1195. height: 30px;
  1196. width: 80px;
  1197. margin-left: 15px;
  1198. background: #e7e7e7;
  1199. border: 2px solid #d9d9d9;
  1200. border-radius: 5px;
  1201. box-sizing: border-box;
  1202. overflow: hidden;
  1203. display: flex;
  1204. align-items: center;
  1205. }
  1206. .f_box_top_right > .tab > .table,
  1207. .f_box_top_right > .tab > .list {
  1208. width: 50%;
  1209. height: 100%;
  1210. display: flex;
  1211. align-items: center;
  1212. justify-content: center;
  1213. cursor: pointer;
  1214. }
  1215. .f_box_top_right > .tab > .list::before {
  1216. content: "";
  1217. display: block;
  1218. width: 20px;
  1219. height: 20px;
  1220. background-image: url("../../../assets/icon/sourceFile/list.png");
  1221. background-size: 100% 100%;
  1222. }
  1223. .f_box_top_right > .tab > .list.active,
  1224. .f_box_top_right > .tab > .table.active {
  1225. background: #fff;
  1226. }
  1227. .f_box_top_right > .tab > .table::before {
  1228. content: "";
  1229. display: block;
  1230. width: 20px;
  1231. height: 20px;
  1232. background-image: url("../../../assets/icon/sourceFile/table.png");
  1233. background-size: 100% 100%;
  1234. }
  1235. .mask {
  1236. /* background-color: rgb(0 0 0 / 30%); */
  1237. /* position: fixed; */
  1238. position: absolute;
  1239. top: 0;
  1240. left: 0;
  1241. width: 100%;
  1242. height: 100%;
  1243. z-index: 4000;
  1244. display: flex;
  1245. align-items: center;
  1246. justify-content: center;
  1247. }
  1248. .progressBox {
  1249. width: 300px;
  1250. height: 100px;
  1251. background: #fff;
  1252. border-radius: 5px;
  1253. box-shadow: 0 0 6px 1px #bfbfbf;
  1254. display: flex;
  1255. align-items: center;
  1256. justify-content: center;
  1257. flex-direction: column;
  1258. position: relative;
  1259. color: #6c6c6c;
  1260. }
  1261. .progressBox >>> .el-progress-bar__outer {
  1262. background-color: #d1dfff !important;
  1263. }
  1264. .progressBox .lbox {
  1265. height: 50px;
  1266. font-size: 16px;
  1267. display: flex;
  1268. align-items: center;
  1269. color: #747474;
  1270. }
  1271. .progressBox .lbox img {
  1272. width: 50px;
  1273. margin-right: 0px;
  1274. }
  1275. .closeCss {
  1276. position: absolute;
  1277. top: 8px;
  1278. right: 8px;
  1279. cursor: pointer;
  1280. width: 20px;
  1281. height: 20px;
  1282. }
  1283. .closeCss > img {
  1284. width: 100%;
  1285. height: 100%;
  1286. }
  1287. .f_box_file_square {
  1288. height: calc(100% - 55px);
  1289. overflow: auto;
  1290. width: 100%;
  1291. padding: 55px;
  1292. box-sizing: border-box;
  1293. display: flex;
  1294. flex-wrap: wrap;
  1295. align-content: flex-start;
  1296. position: relative;
  1297. }
  1298. .f_box_file_square > .f_box_file {
  1299. display: flex;
  1300. flex-direction: column;
  1301. align-items: center;
  1302. justify-content: center;
  1303. width: 160px;
  1304. height: 160px;
  1305. cursor: pointer;
  1306. margin: 0 36px 36px 0;
  1307. border-radius: 20px;
  1308. position: relative;
  1309. }
  1310. .f_box_file_square > .f_box_file:hover {
  1311. background: #f0f2f5;
  1312. }
  1313. .f_box_file_square > .f_box_file:hover > .check {
  1314. display: block;
  1315. }
  1316. .f_box_file_square > .f_box_file.check {
  1317. background: #e0eafb;
  1318. }
  1319. .f_box_file_square > .f_box_file.check > .check {
  1320. display: block;
  1321. }
  1322. .f_box_file_square > .f_box_file > .check {
  1323. position: absolute;
  1324. left: 15px;
  1325. top: 15px;
  1326. width: 16px;
  1327. height: 16px;
  1328. background-size: 100%;
  1329. display: none;
  1330. }
  1331. .f_box_file_square > .f_box_file > .check > img {
  1332. width: 100%;
  1333. height: 100%;
  1334. object-fit: cover;
  1335. }
  1336. .f_box_file_square > .f_box_file > img {
  1337. width: 90px;
  1338. height: 90px;
  1339. object-fit: cover;
  1340. }
  1341. .f_box_file_square > .f_box_file > .name {
  1342. white-space: nowrap;
  1343. font-size: 14px;
  1344. max-width: 80%;
  1345. overflow: hidden;
  1346. margin: 4px auto 0;
  1347. text-overflow: ellipsis;
  1348. text-align: center;
  1349. }
  1350. .f_box_file_list {
  1351. /* height: calc(100% - 55px); */
  1352. /* overflow: auto; */
  1353. width: 100%;
  1354. /* padding: 10px 0; */
  1355. padding-top: 0;
  1356. box-sizing: border-box;
  1357. position: relative;
  1358. padding: 0 24px;
  1359. }
  1360. .f_box_file_list > .f_box_file {
  1361. }
  1362. .f_box_file_list >>> .el-table-column--selection .cell {
  1363. display: flex !important;
  1364. align-items: center !important;
  1365. }
  1366. .f_box_file_allCheck {
  1367. display: flex;
  1368. align-items: center;
  1369. position: absolute;
  1370. font-size: 14px;
  1371. top: 20px;
  1372. left: 10px;
  1373. cursor: pointer;
  1374. }
  1375. .f_box_file_allCheck > img {
  1376. width: 16px;
  1377. height: 16px;
  1378. object-fit: cover;
  1379. margin-right: 5px;
  1380. }
  1381. .el-dialogClass >>> .el-dialog {
  1382. border-radius: 8px;
  1383. }
  1384. .dialog >>> .el-dialog__body {
  1385. padding: 10px 20px;
  1386. }
  1387. .type_nav_box {
  1388. }
  1389. .type_nav_box > .nav {
  1390. height: 40px;
  1391. border-radius: 5px;
  1392. cursor: pointer;
  1393. display: flex;
  1394. align-items: center;
  1395. width: 100%;
  1396. padding: 0 10px;
  1397. box-sizing: border-box;
  1398. margin-bottom: 10px;
  1399. font-size: 16px;
  1400. color: #000;
  1401. }
  1402. .type_nav_box > .nav > .down {
  1403. min-width: 14px;
  1404. height: 14px;
  1405. background-image: url("../../../assets/icon/sourceFile/icon_arrow.png");
  1406. background-size: 100% 100%;
  1407. margin-right: 10px;
  1408. transition: all 0.3s;
  1409. transform: rotate(-90deg);
  1410. }
  1411. .type_nav_box > .nav.active > .down {
  1412. transform: rotate(0deg);
  1413. }
  1414. .type_nav_box > .nav > .file {
  1415. min-width: 18px;
  1416. height: 18px;
  1417. background-image: url("../../../assets/icon/sourceFile/file.png");
  1418. background-size: 100% 100%;
  1419. margin-right: 10px;
  1420. }
  1421. .type_nav_box > .nav > .name {
  1422. max-width: 100%;
  1423. overflow: hidden;
  1424. text-overflow: ellipsis;
  1425. white-space: nowrap;
  1426. }
  1427. .type_nav_box > .child {
  1428. }
  1429. .type_nav_box > .child > .nav {
  1430. height: 40px;
  1431. border-radius: 5px;
  1432. cursor: pointer;
  1433. display: flex;
  1434. align-items: center;
  1435. width: 100%;
  1436. padding: 0 10px 0 50px;
  1437. box-sizing: border-box;
  1438. margin-bottom: 10px;
  1439. font-size: 16px;
  1440. color: #000;
  1441. }
  1442. .type_nav_box > .child > .nav.active {
  1443. background: #e0eafb;
  1444. }
  1445. .type_nav_box > .child > .nav > .file {
  1446. min-width: 18px;
  1447. height: 18px;
  1448. background-image: url("../../../assets/icon/sourceFile/file.png");
  1449. background-size: 100% 100%;
  1450. margin-right: 10px;
  1451. }
  1452. .type_nav_box > .child > .nav > .name {
  1453. max-width: 100%;
  1454. overflow: hidden;
  1455. text-overflow: ellipsis;
  1456. white-space: nowrap;
  1457. }
  1458. .none_box {
  1459. height: calc(100% - 55px);
  1460. overflow: auto;
  1461. width: 100%;
  1462. padding: 10px;
  1463. box-sizing: border-box;
  1464. display: flex;
  1465. align-items: center;
  1466. justify-content: center;
  1467. }
  1468. .list_file_box {
  1469. width: 100%;
  1470. }
  1471. .list_file_box >>> .el-table__empty-block {
  1472. height: 300px !important;
  1473. display: flex;
  1474. align-items: center;
  1475. }
  1476. .list_file_box >>> .el-table__empty-block div {
  1477. display: flex;
  1478. flex-direction: column;
  1479. align-items: center;
  1480. /* justify-content: center; */
  1481. }
  1482. .customC {
  1483. /* height: 300px; */
  1484. /* width: 100px; */
  1485. /* height: 400px;
  1486. display: flex;
  1487. flex-direction: column;
  1488. align-items: center;
  1489. justify-content: center;
  1490. flex-wrap: wrap;
  1491. font-size: 14px;
  1492. margin-top: .5rem;
  1493. color: #667085; */
  1494. }
  1495. .list_file_box >>> table th {
  1496. border: none !important;
  1497. background-color: #f0f2f5 !important;
  1498. /* 浅灰色背景 */
  1499. color: #00000099 !important;
  1500. }
  1501. .list_file_box >>> table tr td {
  1502. border: none !important;
  1503. border-bottom: 1px solid #ebeef5 !important;
  1504. }
  1505. .list_file_box >>> table tr {
  1506. border: 1px #000 solid !important;
  1507. }
  1508. .list_file_box >>> .el-table__header-wrapper {
  1509. /* margin-bottom: 10px !important; */
  1510. }
  1511. .list_file_box >>> .el-table__row {
  1512. border: 1px #ccc solid;
  1513. }
  1514. .list_file_box >>> table tr td:nth-child(1) {
  1515. border-radius: 10px 0 0 10px !important;
  1516. }
  1517. .list_file_box >>> table tr td:nth-last-child(1) {
  1518. border-radius: 0 10px 10px 0 !important;
  1519. }
  1520. .list_file_box >>> table tr th:nth-child(1) {
  1521. border-radius: 10px 0 0 10px;
  1522. }
  1523. .list_file_box >>> table tr th:nth-last-child(2) {
  1524. border-radius: 0 10px 10px 0 !important;
  1525. }
  1526. .list_file_box >>> .el-table::before {
  1527. background-color: #fff;
  1528. }
  1529. .list_file_box >>> .el-table--border::after {
  1530. background-color: #fff;
  1531. }
  1532. .list_file_box >>> .el-table--border {
  1533. border: none;
  1534. border-bottom: 1px solid #ebeef5;
  1535. }
  1536. .BtnH >>> .el-button {
  1537. padding: 5px !important;
  1538. width: 30px !important;
  1539. color: #4c5567;
  1540. }
  1541. .BtnH >>> .el-button:focus,
  1542. .BtnH >>> .el-button:hover {
  1543. background: #e8ebf0 !important;
  1544. color: #487fff !important;
  1545. }
  1546. .BtnH >>> .el-button--small,
  1547. .el-button--small.is-round {
  1548. border: none;
  1549. padding: 0;
  1550. }
  1551. .BtnHP {
  1552. display: flex;
  1553. flex-direction: column;
  1554. justify-content: center;
  1555. }
  1556. .BtnHP >>> .el-popper .popper__arrow,
  1557. .el-popper .popper__arrow::after {
  1558. display: none;
  1559. }
  1560. .BtnHP >>> .el-button--text {
  1561. color: #667095;
  1562. }
  1563. .BtnHP img {
  1564. width: 16px;
  1565. }
  1566. .BtnHPDel {
  1567. display: flex;
  1568. flex-direction: column;
  1569. flex-wrap: wrap;
  1570. justify-content: center;
  1571. }
  1572. .BtnHPDel >>> .el-button + .el-button {
  1573. padding: 0;
  1574. }
  1575. .BtnHPDel >>> .el-button:focus,
  1576. .BtnHPDel >>> .el-button:hover {
  1577. background: #e8ebf0 !important;
  1578. }
  1579. /* .BtnHPDel >>> .el-button:hover .lookHp{
  1580. } */
  1581. .lookHp2 {
  1582. color: #6c6c6c;
  1583. }
  1584. .lookHp2 {
  1585. color: #487fff;
  1586. }
  1587. /* .btnBh{
  1588. display: flex;
  1589. align-items: center;
  1590. justify-content: center;
  1591. cursor: pointer;
  1592. height: 28px;
  1593. border-radius: 5px;
  1594. }
  1595. .btnBh:hover{
  1596. background: #F0F4FF;
  1597. }
  1598. .btnBh img{
  1599. margin-right: 5px;
  1600. } */
  1601. .btnBh2 img {
  1602. width: 17px;
  1603. margin-right: 5px;
  1604. padding: 1.5px;
  1605. box-sizing: border-box;
  1606. }
  1607. .btnBh2:hover {
  1608. background: #fbeae8;
  1609. }
  1610. .list_file_name {
  1611. display: flex;
  1612. align-items: center;
  1613. }
  1614. .list_file_name > img {
  1615. width: 24px;
  1616. height: 24px;
  1617. object-fit: cover;
  1618. margin-right: 5px;
  1619. }
  1620. .list_file_name > div {
  1621. max-width: 100%;
  1622. overflow: hidden;
  1623. white-space: nowrap;
  1624. text-overflow: ellipsis;
  1625. }
  1626. .pageBox {
  1627. display: flex;
  1628. }
  1629. /* .pageBox>>>.el-pagination__total {
  1630. margin-right: auto;
  1631. } */
  1632. .btnBh2 {
  1633. display: flex;
  1634. align-items: center;
  1635. cursor: pointer;
  1636. padding: 5px 8px;
  1637. border-radius: 6px;
  1638. box-sizing: border-box;
  1639. }
  1640. .btnBh {
  1641. display: flex;
  1642. cursor: pointer;
  1643. border-radius: 6px;
  1644. padding: 5px 8px;
  1645. }
  1646. </style>
  1647. <style>
  1648. .custom-popover {
  1649. min-width: 70px !important;
  1650. width: auto !important;
  1651. padding: 8px 10px;
  1652. border-radius: 8px;
  1653. }
  1654. /* .custom-popover2 {
  1655. min-width: 88px !important;
  1656. width: auto !important;
  1657. padding: 8px;
  1658. top: 414px !important;
  1659. text-align: center;
  1660. } */
  1661. .BtnH >>> .el-button {
  1662. padding: 5px !important;
  1663. width: 30px !important;
  1664. color: #4c5567;
  1665. }
  1666. .BtnH >>> .el-button:focus,
  1667. .BtnH >>> .el-button:hover {
  1668. background: #e8ebf0 !important;
  1669. color: #487fff !important;
  1670. }
  1671. .BtnHPDel1 >>> .el-button:focus,
  1672. .BtnHPDel1 >>> .el-button:hover {
  1673. background: #f0f4ff;
  1674. color: #082e86 !important;
  1675. }
  1676. .BtnHPDel >>> .el-button:focus,
  1677. .BtnHPDel >>> .el-button:hover {
  1678. background: #fbeae8 !important;
  1679. color: #de4c41 !important;
  1680. }
  1681. .BtnH >>> .el-button--small,
  1682. .el-button--small.is-round {
  1683. border: none;
  1684. padding: 0;
  1685. }
  1686. .BtnHP {
  1687. display: flex;
  1688. flex-direction: column;
  1689. justify-content: center;
  1690. }
  1691. .BtnHPDel {
  1692. display: flex;
  1693. flex-direction: column;
  1694. justify-content: center;
  1695. }
  1696. .BtnHPDel1 {
  1697. display: flex;
  1698. flex-direction: column;
  1699. justify-content: center;
  1700. }
  1701. .BtnHP >>> .el-button {
  1702. color: #4c5567;
  1703. margin-left: 0 !important;
  1704. }
  1705. .BtnHP >>> .el-popper .popper__arrow,
  1706. .el-popper .popper__arrow::after {
  1707. display: none;
  1708. }
  1709. .btnBh {
  1710. display: flex;
  1711. /* align-items: center; */
  1712. justify-content: center;
  1713. cursor: pointer;
  1714. /* height: 28px; */
  1715. border-radius: 6px;
  1716. padding: 6px 9px;
  1717. }
  1718. .btnBh:hover {
  1719. background: #f0f4ff;
  1720. }
  1721. .btnBh img {
  1722. margin-right: 5px;
  1723. width: 17px;
  1724. }
  1725. .btnBh2 {
  1726. display: flex;
  1727. align-items: center;
  1728. justify-content: center;
  1729. cursor: pointer;
  1730. height: 28px;
  1731. padding: 0 10px;
  1732. border-radius: 5px;
  1733. }
  1734. .btnBh2 img {
  1735. width: 14px;
  1736. margin-right: 5px;
  1737. }
  1738. .btnBh2:hover {
  1739. background: #fbeae8;
  1740. }
  1741. .lookHp2 {
  1742. color: #6c6c6c;
  1743. }
  1744. .lookHp2 {
  1745. color: #487fff;
  1746. }
  1747. .list_file_box >>> .el-table__empty-text {
  1748. display: flex;
  1749. justify-content: center;
  1750. line-height: 22px !important;
  1751. }
  1752. .list_file_box >>> .el-table-column--selection .cell {
  1753. display: flex !important;
  1754. align-items: center !important;
  1755. }
  1756. .f_box_top_center {
  1757. margin: auto;
  1758. display: flex;
  1759. align-items: center;
  1760. position: absolute;
  1761. top: 50%;
  1762. left: 50%;
  1763. transform: translate(-50%, -50%);
  1764. }
  1765. .f_box_top_center > span {
  1766. font-size: 16px;
  1767. cursor: pointer;
  1768. padding: 6px 8px;
  1769. color: #1a202c;
  1770. }
  1771. .f_box_top_center > span:hover {
  1772. background: rgb(242, 243, 243);
  1773. border-radius: 5px;
  1774. }
  1775. .f_box_top_center > span.active {
  1776. color: #2b5fd9;
  1777. }
  1778. .paginationArea {
  1779. width: 100%;
  1780. height: auto;
  1781. display: flex;
  1782. align-items: center;
  1783. justify-content: space-between;
  1784. }
  1785. .paginationArea > span {
  1786. font-size: 13px;
  1787. color: #606266;
  1788. }
  1789. </style>