folderFileBox.vue 63 KB

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