folderFileBox.vue 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304
  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. let _fileArray = res.data.result;
  821. _fileArray.forEach(i => {
  822. if (i.folderName && i.folderName.includes('默认文件夹')) {
  823. i.folderName = (i.folderName || "").replace(/默认文件夹/g, this.lang.defaultFolder);
  824. }
  825. if (i.folderName && i.folderName.includes('Default Folder')) {
  826. i.folderName = (i.folderName || "").replace(/Default Folder/g, this.lang.defaultFolder);
  827. }
  828. if (i.folderName && i.folderName.includes('默認文件夾')) {
  829. i.folderName = (i.folderName || "").replace(/默認文件夾/g, this.lang.defaultFolder);
  830. }
  831. });
  832. this.fileArray = _fileArray;
  833. })
  834. .catch((err) => {
  835. this.isLoading = false;
  836. console.error(err);
  837. });
  838. },
  839. handleSelectionChange(selectedRows) {
  840. this.checkArray = selectedRows.map((row) => row.id);
  841. this.checkArray2 = selectedRows.map((row) => ({
  842. id: row.id,
  843. documentid: row.documentid,
  844. }));
  845. },
  846. addImg(e) {
  847. var el = e.currentTarget;
  848. el.getElementsByTagName("input")[0].click();
  849. e.target.value = "";
  850. },
  851. handleDrop(event) {
  852. event.preventDefault(); // 阻止默认的浏览器下载行为
  853. const files = event.dataTransfer.files;
  854. if (files.length) {
  855. this.beforeUpload({ target: { files } });
  856. }
  857. },
  858. debouncedSearch() {
  859. clearTimeout(this.debounceTimeout);
  860. this.debounceTimeout = setTimeout(() => {
  861. this.serchFile();
  862. }, 300);
  863. },
  864. serchFile() {
  865. this.page = 1;
  866. this.getData();
  867. },
  868. async beforeUpload(event) {
  869. let file = "";
  870. let cfindex2 = 0;
  871. this.proVisible = true;
  872. const allowedExtensions = [
  873. "csv",
  874. "xls",
  875. "xlsx",
  876. "md",
  877. "pdf",
  878. "txt",
  879. "ppt",
  880. "pptx",
  881. "docx",
  882. "doc",
  883. "jpg",
  884. "jpeg",
  885. "png",
  886. "gif",
  887. "bmp",
  888. "mp3",
  889. ];
  890. // let uuid = uuidv4();
  891. // let res = window.uploadFile({ file: event.target.files[0], uuid, userid:this.userid, folderid:this.folderid, moFolderid: this.moFolderid })
  892. // console.log(res);
  893. const audioExtensions = ["wav", "m4a", "aac", "ogg", "flac", "wma"];
  894. // return
  895. const uploadFiles = async (files) => {
  896. this.pcount = 0;
  897. this.ptotal = files.length;
  898. for (let cfindex = 0; cfindex < files.length; cfindex++) {
  899. file = files[cfindex];
  900. let fileExtension = file.name.split(".").pop().toLowerCase();
  901. if (audioExtensions.includes(fileExtension)) {
  902. try {
  903. console.log(this.lang.converting_audio);
  904. const convertingMsg = this.lang.converting_audio.replace('{format}', fileExtension.toUpperCase());
  905. this.$message.info(convertingMsg);
  906. // 使用原生 File 对象进行转换
  907. file = await convertAudioToMp3(file);
  908. fileExtension = file.name.split(".").pop().toLowerCase();
  909. const successMsg = this.lang.convert_success.replace('{filename}', file.name);
  910. this.$message.success(successMsg);
  911. } catch (error) {
  912. console.error('音频转换失败:', error);
  913. const errorMsg = error.message || error.toString();
  914. const failMsg = this.lang.convert_fail.replace('{error}', errorMsg);
  915. this.$message.error({
  916. message: failMsg,
  917. duration: 5000,
  918. showClose: true
  919. });
  920. // 转换失败时移除文件并跳过
  921. await new Promise((resolve) => setTimeout(resolve, 1000));
  922. continue;
  923. }
  924. }
  925. if (!allowedExtensions.includes(fileExtension)) {
  926. this.$message.error(`${this.lang.unsupFileformats}: ${file.name}`);
  927. await new Promise((resolve) => setTimeout(resolve, 1000)); // 延迟1秒再跳过
  928. continue; // 跳过不支持的文件
  929. }
  930. let uuid = uuidv4();
  931. let formData = new FormData();
  932. const timestamp = Date.now();
  933. const baseName = file.name.slice(0, -(fileExtension.length + 1));
  934. let string = [this.folderid, this.moFolderid].filter((id) => id);
  935. formData.append(
  936. "file",
  937. new File([file], `${baseName}${timestamp}.${fileExtension}`)
  938. );
  939. formData.append("collection_ids", JSON.stringify(string));
  940. formData.append("id", uuid);
  941. formData.append(
  942. "metadata",
  943. JSON.stringify({ title: file.name, collection_ids: string })
  944. );
  945. formData.append("ingestion_mode", "fast");
  946. formData.append("run_with_orchestration", "false");
  947. // 使用同步方式上传文件
  948. await this.uploadFile(formData, file.name, uuid);
  949. this.pcount = cfindex + 1;
  950. // 每5秒上传一次
  951. if (cfindex < files.length - 1) {
  952. await new Promise((resolve) => setTimeout(resolve, 5000));
  953. }
  954. }
  955. setTimeout(() => {
  956. this.proVisible = false;
  957. this.$message.success(this.lang.operComplete);
  958. this.getData(); // 在上传完所有文件后再调用getData
  959. }, 1000);
  960. };
  961. await uploadFiles(event.target.files);
  962. },
  963. async importFromWebpage(event) {
  964. console.log('importFromWebpage');
  965. this.webUrlDialogVisible = true;
  966. },
  967. handleWebUrlConfirm(dataFromForm) {
  968. if (!dataFromForm) return;
  969. this.proVisible = true;
  970. let uuid = uuidv4();
  971. let formData = new FormData();
  972. let string = [this.folderid, this.moFolderid].filter((id) => id);
  973. formData.append("url", dataFromForm.url)
  974. formData.append("collection_ids", JSON.stringify(string));
  975. formData.append("id", uuid);
  976. formData.append(
  977. "metadata",
  978. JSON.stringify({url: dataFromForm.url, collection_ids: string})
  979. );
  980. formData.append("ingestion_mode", "fast");
  981. formData.append("run_with_orchestration", "false");
  982. debugger
  983. const html2mdApi = process.env.VUE_APP_HTML2MD_API || 'http://localhost:7004';
  984. const url = html2mdApi + '/file/knowledge-base/html-to-markdown';
  985. const headers = {'Content-Type': 'multipart/form-data'};
  986. this.ajax.post(url, formData, {headers})
  987. .then(async (response) => {
  988. if (response && response.data && response.data.results) {
  989. this.$message.success('文件上传成功');
  990. const fileName = response.data.title;
  991. const documentId = response.data.results && response.data.results.document_id;
  992. const status = response && response.status === 200 ? "success" : "failed";
  993. const msg = response && response.status === 200 ? "切片成功" : "切片失败";
  994. this.$message({ message: msg, type: status == "success" ? status : "error" });
  995. this.getData();
  996. setTimeout(() => {
  997. this.fileArray.forEach((e) => {
  998. if (e.documentid === uuid) {
  999. e.ingestionStatus = status;
  1000. }
  1001. });
  1002. }, 1000);
  1003. if (documentId) {
  1004. await this.bindFileAndFolder(
  1005. fileName,
  1006. documentId,
  1007. this.userid,
  1008. this.folderid,
  1009. this.moFolderid
  1010. );
  1011. }
  1012. // 受控组件写法,直接清空 input
  1013. this.webInputUrl = '';
  1014. // 关闭弹窗
  1015. this.webUrlDialogVisible = false;
  1016. this.getData();
  1017. } else {
  1018. this.$message.error(response && response.data && response.data.msg ? response.data.msg : '文件上传失败');
  1019. }
  1020. this.proVisible = false;
  1021. })
  1022. .catch((error) => {
  1023. this.$message.error('服务器繁忙');
  1024. if (this.fileNames) this.fileNames.pop && this.fileNames.pop();
  1025. if (this.fileUrls) this.fileUrls.pop && this.fileUrls.pop();
  1026. console.log(error);
  1027. if (this.loadingInstance) {
  1028. this.$nextTick(() => {
  1029. this.loadingInstance.close();
  1030. });
  1031. }
  1032. this.proVisible = false;
  1033. });
  1034. },
  1035. async bindFileAndFolder(name, docid, uid, folder_id, mofid = '') {
  1036. try {
  1037. let params = {
  1038. n: name,
  1039. did: docid,
  1040. uid: this.userid,
  1041. fid: this.folderid,
  1042. mofid: this.moFolderid != this.folderid ? this.moFolderid : "",
  1043. };
  1044. const res2 = await this.ajax.post(this.$store.state.api + "addFile", [
  1045. params,
  1046. ]);
  1047. // 如果成功,关闭对话框
  1048. if (res2 && res2.status === 200) {
  1049. // this.handleClose && this.handleClose();
  1050. this.webUrlDialogVisible = false;
  1051. this.getData();
  1052. }
  1053. console.log(res2);
  1054. } catch (err) {
  1055. console.error(err);
  1056. this.$message.error(this.lang.uploadFail);
  1057. }
  1058. this.proVisible = false;
  1059. },
  1060. async uploadFile(formData, name, uuid) {
  1061. try {
  1062. this.ajax
  1063. .post("https://r2rserver.cocorobo.cn/v3/documents", formData, {
  1064. headers: {
  1065. "Content-Type": "multipart/form-data",
  1066. },
  1067. })
  1068. .then((res) => {
  1069. console.log(res, formData);
  1070. const message = res.data.results && res.data.results.message;
  1071. const status =
  1072. message === "Document created and ingested successfully."
  1073. ? "success"
  1074. : "failed";
  1075. const msg =
  1076. message === "Document created and ingested successfully."
  1077. ? "切片成功"
  1078. : "切片失败";
  1079. this.$message({
  1080. message: msg,
  1081. type: status == "success" ? status : "error",
  1082. });
  1083. // setTimeout(() => {
  1084. this.getData();
  1085. // }, 1000)
  1086. setTimeout(() => {
  1087. this.fileArray.forEach((e) => {
  1088. if (e.documentid === uuid) {
  1089. e.ingestionStatus = status;
  1090. }
  1091. });
  1092. }, 1000);
  1093. })
  1094. .catch((err) => {
  1095. this.$message.error(this.lang.uploadFail);
  1096. this.fileArray.forEach((e) => {
  1097. if (e.documentid === uuid) {
  1098. e.ingestionStatus = "failed";
  1099. }
  1100. });
  1101. console.error(err);
  1102. });
  1103. let docid = uuid;
  1104. let params = {
  1105. n: name,
  1106. did: docid,
  1107. uid: this.userid,
  1108. fid: this.folderid,
  1109. mofid: this.moFolderid != this.folderid ? this.moFolderid : "",
  1110. };
  1111. const res2 = await this.ajax.post(this.$store.state.api + "addFile", [
  1112. params,
  1113. ]);
  1114. console.log(res2);
  1115. } catch (err) {
  1116. console.error(err);
  1117. this.$message.error(this.lang.uploadFail);
  1118. }
  1119. },
  1120. formatFileSize(bytes) {
  1121. if (bytes < 1024) {
  1122. return bytes + "B";
  1123. } else if (bytes < 1048576) {
  1124. return (bytes / 1024).toFixed(2) + "KB";
  1125. } else if (bytes < 1073741824) {
  1126. return (bytes / 1048576).toFixed(2) + "MB";
  1127. } else {
  1128. return (bytes / 1073741824).toFixed(2) + "GB";
  1129. }
  1130. },
  1131. deleteFile(fileid, documentid) {
  1132. this.$confirm(this.lang.deleteFile, this.lang.prompt, {
  1133. confirmButtonText: this.lang.confirm,
  1134. cancelButtonText: this.lang.cancel,
  1135. type: "warning",
  1136. })
  1137. .then(() => {
  1138. let params = [
  1139. {
  1140. ids: fileid,
  1141. documentids: documentid,
  1142. },
  1143. ];
  1144. this.ajax //deleteFileByFilter
  1145. .post(this.$store.state.fileApi + "deleteFile", params)
  1146. .then((res) => {
  1147. this.$message({
  1148. message: this.lang.deleteSuccess,
  1149. type: "success",
  1150. });
  1151. this.checkArray = [];
  1152. this.checkArray2 = [];
  1153. this.$refs.myTable.clearSelection();
  1154. this.getData();
  1155. })
  1156. .catch((err) => {
  1157. this.$message.error(this.lang.deleteFail);
  1158. console.error(err);
  1159. });
  1160. })
  1161. .catch(() => {});
  1162. },
  1163. batchDelete() {
  1164. if (!this.checkArray.length) {
  1165. this.$message.warning(this.lang.selectDeFile);
  1166. return;
  1167. }
  1168. let array = this.checkArray2.map((item) => item.id);
  1169. let array2 = this.checkArray2.map((item) => item.documentid);
  1170. this.deleteFile(array.join(","), array2.join(","));
  1171. },
  1172. removeFile(fileid, documentid) {
  1173. this.$confirm(this.lang.sureRemove, this.lang.prompt, {
  1174. confirmButtonText: this.lang.confirm,
  1175. cancelButtonText: this.lang.cancel,
  1176. type: "warning",
  1177. })
  1178. .then(() => {
  1179. let params = [
  1180. {
  1181. ids: fileid,
  1182. documentids: documentid,
  1183. folderid: this.folderid,
  1184. },
  1185. ];
  1186. this.ajax
  1187. .post(this.$store.state.fileApi + "removeFile", params)
  1188. .then((res) => {
  1189. this.$message({
  1190. message: this.lang.removeSuccess,
  1191. type: "success",
  1192. });
  1193. this.checkArray = [];
  1194. this.checkArray2 = [];
  1195. this.$refs.myTable.clearSelection();
  1196. this.getData();
  1197. })
  1198. .catch((err) => {
  1199. this.$message.error(this.lang.removeFail);
  1200. console.error(err);
  1201. });
  1202. })
  1203. .catch(() => {});
  1204. },
  1205. batchRemove() {
  1206. if (!this.checkArray.length) {
  1207. this.$message.warning(this.lang.seReFile);
  1208. return;
  1209. }
  1210. let array = this.checkArray2.map((item) => item.id);
  1211. let array2 = this.checkArray2.map((item) => item.documentid);
  1212. this.removeFile(array.join(","), array2.join(","));
  1213. },
  1214. isSelectable(row) {
  1215. return row.isMo !== "2";
  1216. },
  1217. openG() {
  1218. this.$refs.relateFiles.openG(this.userid, this.folderid, this.moFolderid);
  1219. },
  1220. checkFile(row) {
  1221. if (row.ingestionStatus != "success")
  1222. return this.$message.info(this.lang.fileUploadFail);
  1223. this.$refs.checkDialog.openG(row.documentid);
  1224. },
  1225. handleClose(done) {
  1226. done();
  1227. },
  1228. downloadFile(row) {
  1229. let params = {
  1230. documentid: row.documentid,
  1231. filename: row.name,
  1232. };
  1233. // 使用axios发送GET请求下载文件
  1234. this.ajax
  1235. .post(`${this.$store.state.fileApi}downloadFile2`, [params], {
  1236. responseType: "blob",
  1237. })
  1238. .then((response) => {
  1239. const url = window.URL.createObjectURL(new Blob([response.data]));
  1240. const link = document.createElement("a");
  1241. link.href = url;
  1242. link.setAttribute("download", row.name); // 设置下载文件名
  1243. document.body.appendChild(link);
  1244. link.click();
  1245. link.remove();
  1246. this.$message({
  1247. message: this.lang.downloadSuccess,
  1248. type: "success",
  1249. });
  1250. })
  1251. .catch((err) => {
  1252. this.$message.error(this.lang.downloadFail);
  1253. console.error(err);
  1254. });
  1255. },
  1256. // extractFile(row) {
  1257. // if (row.ingestionStatus != "success")
  1258. // return this.$message.info(this.lang.fileUploadFail);
  1259. // let params = {
  1260. // documentid: row.documentid,
  1261. // };
  1262. // // 获取切片
  1263. // try {
  1264. // const res = this.ajax
  1265. // .post(this.$store.state.fileApi + "extractFile2", [params])
  1266. // .then((res) => {
  1267. // console.log(res, row);
  1268. // const message = res.data.result && res.data.result.message;
  1269. // // const status = message === 'Document entities and relationships extracted successfully.' ? 'success' : 'failed';
  1270. // // const msg = message === 'Document entities and relationships extracted successfully.' ? '提取成功' : '提取失败';
  1271. // // this.$message({
  1272. // // message: msg,
  1273. // // type: status == 'success' ? status : 'error'
  1274. // // })
  1275. // // this.fileArray.forEach(e => {
  1276. // // if (e.documentid === row.documentid) {
  1277. // // e.extractionStatus = status;
  1278. // // }
  1279. // // });
  1280. // setTimeout(() => {
  1281. // this.getData();
  1282. // }, 1000);
  1283. // })
  1284. // .catch((err) => {
  1285. // this.$message.error(this.lang.extrFailed);
  1286. // this.fileArray.forEach((e) => {
  1287. // if (e.documentid === row.documentid) {
  1288. // e.extractionStatus = "failed";
  1289. // }
  1290. // });
  1291. // console.error(err);
  1292. // });
  1293. // console.log(res.data);
  1294. // this.$message.success(this.lang.extractingFile);
  1295. // } catch (err) {
  1296. // console.error(err);
  1297. // }
  1298. // },
  1299. checkType(type) {
  1300. this.fileType = type;
  1301. },
  1302. extractFile(row) {
  1303. if (row.ingestionStatus != "success") return this.$message.info(this.lang.fileUploadFail)
  1304. this.row = row
  1305. this.promptDialog = true;
  1306. },
  1307. handleExtract() {
  1308. this.promptLoading = true
  1309. let params = {
  1310. documentid: this.row.documentid,
  1311. prompt: this.prompt
  1312. };
  1313. // 获取切片
  1314. try {
  1315. const res = this.ajax.post(this.$store.state.fileApi + "extractFile2", [
  1316. params
  1317. ]).then(res => {
  1318. console.log(res, this.row);
  1319. const message = res.data.result && res.data.result.message;
  1320. // const status = message === 'Document entities and relationships extracted successfully.' ? 'success' : 'failed';
  1321. // const msg = message === 'Document entities and relationships extracted successfully.' ? '提取成功' : '提取失败';
  1322. // this.$message({
  1323. // message: msg,
  1324. // type: status == 'success' ? status : 'error'
  1325. // })
  1326. // this.fileArray.forEach(e => {
  1327. // if (e.documentid === row.documentid) {
  1328. // e.extractionStatus = status;
  1329. // }
  1330. // });
  1331. setTimeout(() => {
  1332. this.promptLoading = false
  1333. this.promptDialog = false
  1334. this.getData();
  1335. }, 1000)
  1336. }).catch(err => {
  1337. this.promptLoading = false
  1338. this.$message.error(this.lang.extrFailed)
  1339. this.fileArray.forEach(e => {
  1340. if (e.documentid === this.row.documentid) {
  1341. e.extractionStatus = 'failed';
  1342. }
  1343. });
  1344. console.error(err);
  1345. });
  1346. console.log(res.data);
  1347. this.$message.success(this.lang.extractingFile);
  1348. this.getData();
  1349. } catch (err) {
  1350. this.promptLoading = false
  1351. console.error(err);
  1352. }
  1353. },
  1354. },
  1355. mounted() {
  1356. // this.getData();
  1357. // const script = document.createElement('script');
  1358. // script.src = 'https://beta.cloud.cocorobo.cn/js/Common/uploadR2R.js';
  1359. // script.type = 'text/javascript';
  1360. // script.defer = true; // 或者 async,根据需要
  1361. // script.onload = () => {
  1362. // console.log('上传脚本加载成功');
  1363. // // 你可以在这里使用上传文件的功能了
  1364. // };
  1365. // script.onerror = () => {
  1366. // console.error('上传脚本加载失败');
  1367. // };
  1368. // document.head.appendChild(script);
  1369. },
  1370. };
  1371. </script>
  1372. <style scoped>
  1373. .f_box {
  1374. width: 100%;
  1375. /* height: 100%; */
  1376. position: relative;
  1377. min-height: 400px;
  1378. display: flex;
  1379. flex-direction: column;
  1380. }
  1381. .f_box_top {
  1382. display: flex;
  1383. align-items: center;
  1384. padding: 10px 0 0;
  1385. padding-top: 0px;
  1386. width: 100%;
  1387. box-sizing: border-box;
  1388. position: relative;
  1389. height: 50px;
  1390. min-height: 50px;
  1391. border-bottom: 1px solid #e8ebf0;
  1392. padding: 0 24px;
  1393. }
  1394. .f_box_top_left {
  1395. display: flex;
  1396. align-items: center;
  1397. }
  1398. .f_box_top_title {
  1399. font-size: 16px;
  1400. color: rgba(8, 13, 30, 0.9);
  1401. /* font-weight: bold; */
  1402. }
  1403. .btn {
  1404. display: flex;
  1405. cursor: pointer;
  1406. align-items: center;
  1407. height: 30px;
  1408. padding: 0 8px;
  1409. background: rgb(0, 97, 255);
  1410. color: #fff;
  1411. box-sizing: border-box;
  1412. border-radius: 4px;
  1413. font-size: 14px;
  1414. align-items: center;
  1415. }
  1416. .btn2 {
  1417. display: flex;
  1418. cursor: pointer;
  1419. align-items: center;
  1420. height: 30px;
  1421. padding: 0 8px;
  1422. background: #fff;
  1423. color: rgb(0, 97, 255);
  1424. border: 1px solid rgb(0, 97, 255);
  1425. box-sizing: border-box;
  1426. border-radius: 4px;
  1427. font-size: 14px;
  1428. align-items: center;
  1429. }
  1430. .f_box_top .delBtn {
  1431. background: rgb(255, 0, 13);
  1432. }
  1433. .btn + .btn2,
  1434. .btn + .btn,
  1435. .btn2 + .btn2,
  1436. .btn2 + .delBtn {
  1437. margin-left: 15px;
  1438. }
  1439. .f_box_container {
  1440. display: flex;
  1441. flex-direction: column;
  1442. gap: 16px;
  1443. height: 100%;
  1444. overflow: auto;
  1445. }
  1446. .f_box_container {
  1447. display: flex;
  1448. flex-direction: column;
  1449. gap: 16px;
  1450. height: 100%;
  1451. overflow: auto;
  1452. }
  1453. .f_box_top_right {
  1454. margin-left: auto;
  1455. /* max-width: calc(100% - 280px); */
  1456. overflow: hidden;
  1457. display: flex;
  1458. /* align-items: center; */
  1459. padding: 0 24px;
  1460. /* min-height: fit-content; */
  1461. height: 36px;
  1462. min-height: 36px;
  1463. }
  1464. .f_box_top_right > .input {
  1465. position: relative;
  1466. /* height: 40px; */
  1467. }
  1468. .f_box_top_right >>> .el-button {
  1469. height: 35px !important;
  1470. font-size: 12.8px;
  1471. background-color: #3370ff;
  1472. border-radius: 6px;
  1473. margin-left: 12px;
  1474. }
  1475. .f_box_top_right >>> .el-button--primary:focus,
  1476. .f_box_top_right >>> .el-button--primary:hover {
  1477. filter: brightness(120%);
  1478. }
  1479. .f_box_top_right >>> .el-icon-plus:before {
  1480. font-size: 14px;
  1481. font-weight: 600;
  1482. /* vertical-align: middle; */
  1483. }
  1484. .f_box_top_right > .input > input {
  1485. width: 100%;
  1486. height: 100%;
  1487. border: 1px solid #dcdfe6;
  1488. border-radius: 5px;
  1489. padding: 0 15px 0 45px;
  1490. box-sizing: border-box;
  1491. font-size: 14px;
  1492. width: 250px;
  1493. height: 36px;
  1494. font-size: 12.8px;
  1495. border-radius: 6px;
  1496. outline: none;
  1497. }
  1498. .f_box_top_right > .input > .serch {
  1499. content: "";
  1500. display: block;
  1501. width: 20px;
  1502. height: 20px;
  1503. background-image: url("../../../assets/icon/sourceFile/search.png");
  1504. background-size: 100% 100%;
  1505. position: absolute;
  1506. left: 13px;
  1507. top: 50%;
  1508. transform: translateY(-50%);
  1509. cursor: pointer;
  1510. }
  1511. .f_box_top_right > .tab {
  1512. height: 30px;
  1513. width: 80px;
  1514. margin-left: 15px;
  1515. background: #e7e7e7;
  1516. border: 2px solid #d9d9d9;
  1517. border-radius: 5px;
  1518. box-sizing: border-box;
  1519. overflow: hidden;
  1520. display: flex;
  1521. align-items: center;
  1522. }
  1523. .f_box_top_right > .tab > .table,
  1524. .f_box_top_right > .tab > .list {
  1525. width: 50%;
  1526. height: 100%;
  1527. display: flex;
  1528. align-items: center;
  1529. justify-content: center;
  1530. cursor: pointer;
  1531. }
  1532. .f_box_top_right > .tab > .list::before {
  1533. content: "";
  1534. display: block;
  1535. width: 20px;
  1536. height: 20px;
  1537. background-image: url("../../../assets/icon/sourceFile/list.png");
  1538. background-size: 100% 100%;
  1539. }
  1540. .f_box_top_right > .tab > .list.active,
  1541. .f_box_top_right > .tab > .table.active {
  1542. background: #fff;
  1543. }
  1544. .f_box_top_right > .tab > .table::before {
  1545. content: "";
  1546. display: block;
  1547. width: 20px;
  1548. height: 20px;
  1549. background-image: url("../../../assets/icon/sourceFile/table.png");
  1550. background-size: 100% 100%;
  1551. }
  1552. .mask {
  1553. /* background-color: rgb(0 0 0 / 30%); */
  1554. /* position: fixed; */
  1555. position: absolute;
  1556. top: 0;
  1557. left: 0;
  1558. width: 100%;
  1559. height: 100%;
  1560. z-index: 4000;
  1561. display: flex;
  1562. align-items: center;
  1563. justify-content: center;
  1564. }
  1565. .progressBox {
  1566. width: 300px;
  1567. height: 100px;
  1568. background: #fff;
  1569. border-radius: 5px;
  1570. box-shadow: 0 0 6px 1px #bfbfbf;
  1571. display: flex;
  1572. align-items: center;
  1573. justify-content: center;
  1574. flex-direction: column;
  1575. position: relative;
  1576. color: #6c6c6c;
  1577. }
  1578. .progressBox >>> .el-progress-bar__outer {
  1579. background-color: #d1dfff !important;
  1580. }
  1581. .progressBox .lbox {
  1582. height: 50px;
  1583. font-size: 16px;
  1584. display: flex;
  1585. align-items: center;
  1586. color: #747474;
  1587. }
  1588. .progressBox .lbox img {
  1589. width: 50px;
  1590. margin-right: 0px;
  1591. }
  1592. .closeCss {
  1593. position: absolute;
  1594. top: 8px;
  1595. right: 8px;
  1596. cursor: pointer;
  1597. width: 20px;
  1598. height: 20px;
  1599. }
  1600. .closeCss > img {
  1601. width: 100%;
  1602. height: 100%;
  1603. }
  1604. .f_box_file_square {
  1605. height: calc(100% - 55px);
  1606. overflow: auto;
  1607. width: 100%;
  1608. padding: 55px;
  1609. box-sizing: border-box;
  1610. display: flex;
  1611. flex-wrap: wrap;
  1612. align-content: flex-start;
  1613. position: relative;
  1614. }
  1615. .f_box_file_square > .f_box_file {
  1616. display: flex;
  1617. flex-direction: column;
  1618. align-items: center;
  1619. justify-content: center;
  1620. width: 160px;
  1621. height: 160px;
  1622. cursor: pointer;
  1623. margin: 0 36px 36px 0;
  1624. border-radius: 20px;
  1625. position: relative;
  1626. }
  1627. .f_box_file_square > .f_box_file:hover {
  1628. background: #f0f2f5;
  1629. }
  1630. .f_box_file_square > .f_box_file:hover > .check {
  1631. display: block;
  1632. }
  1633. .f_box_file_square > .f_box_file.check {
  1634. background: #e0eafb;
  1635. }
  1636. .f_box_file_square > .f_box_file.check > .check {
  1637. display: block;
  1638. }
  1639. .f_box_file_square > .f_box_file > .check {
  1640. position: absolute;
  1641. left: 15px;
  1642. top: 15px;
  1643. width: 16px;
  1644. height: 16px;
  1645. background-size: 100%;
  1646. display: none;
  1647. }
  1648. .f_box_file_square > .f_box_file > .check > img {
  1649. width: 100%;
  1650. height: 100%;
  1651. object-fit: cover;
  1652. }
  1653. .f_box_file_square > .f_box_file > img {
  1654. width: 90px;
  1655. height: 90px;
  1656. object-fit: cover;
  1657. }
  1658. .f_box_file_square > .f_box_file > .name {
  1659. white-space: nowrap;
  1660. font-size: 14px;
  1661. max-width: 80%;
  1662. overflow: hidden;
  1663. margin: 4px auto 0;
  1664. text-overflow: ellipsis;
  1665. text-align: center;
  1666. }
  1667. .f_box_file_list {
  1668. /* height: calc(100% - 55px); */
  1669. /* overflow: auto; */
  1670. width: 100%;
  1671. /* padding: 10px 0; */
  1672. padding-top: 0;
  1673. box-sizing: border-box;
  1674. position: relative;
  1675. padding: 0 24px;
  1676. }
  1677. .f_box_file_list > .f_box_file {
  1678. }
  1679. .f_box_file_list >>> .el-table-column--selection .cell {
  1680. display: flex !important;
  1681. align-items: center !important;
  1682. }
  1683. .f_box_file_allCheck {
  1684. display: flex;
  1685. align-items: center;
  1686. position: absolute;
  1687. font-size: 14px;
  1688. top: 20px;
  1689. left: 10px;
  1690. cursor: pointer;
  1691. }
  1692. .f_box_file_allCheck > img {
  1693. width: 16px;
  1694. height: 16px;
  1695. object-fit: cover;
  1696. margin-right: 5px;
  1697. }
  1698. .el-dialogClass >>> .el-dialog {
  1699. border-radius: 8px;
  1700. }
  1701. .dialog >>> .el-dialog__body {
  1702. padding: 10px 20px;
  1703. }
  1704. .type_nav_box {
  1705. }
  1706. .type_nav_box > .nav {
  1707. height: 40px;
  1708. border-radius: 5px;
  1709. cursor: pointer;
  1710. display: flex;
  1711. align-items: center;
  1712. width: 100%;
  1713. padding: 0 10px;
  1714. box-sizing: border-box;
  1715. margin-bottom: 10px;
  1716. font-size: 16px;
  1717. color: #000;
  1718. }
  1719. .type_nav_box > .nav > .down {
  1720. min-width: 14px;
  1721. height: 14px;
  1722. background-image: url("../../../assets/icon/sourceFile/icon_arrow.png");
  1723. background-size: 100% 100%;
  1724. margin-right: 10px;
  1725. transition: all 0.3s;
  1726. transform: rotate(-90deg);
  1727. }
  1728. .type_nav_box > .nav.active > .down {
  1729. transform: rotate(0deg);
  1730. }
  1731. .type_nav_box > .nav > .file {
  1732. min-width: 18px;
  1733. height: 18px;
  1734. background-image: url("../../../assets/icon/sourceFile/file.png");
  1735. background-size: 100% 100%;
  1736. margin-right: 10px;
  1737. }
  1738. .type_nav_box > .nav > .name {
  1739. max-width: 100%;
  1740. overflow: hidden;
  1741. text-overflow: ellipsis;
  1742. white-space: nowrap;
  1743. }
  1744. .type_nav_box > .child {
  1745. }
  1746. .type_nav_box > .child > .nav {
  1747. height: 40px;
  1748. border-radius: 5px;
  1749. cursor: pointer;
  1750. display: flex;
  1751. align-items: center;
  1752. width: 100%;
  1753. padding: 0 10px 0 50px;
  1754. box-sizing: border-box;
  1755. margin-bottom: 10px;
  1756. font-size: 16px;
  1757. color: #000;
  1758. }
  1759. .type_nav_box > .child > .nav.active {
  1760. background: #e0eafb;
  1761. }
  1762. .type_nav_box > .child > .nav > .file {
  1763. min-width: 18px;
  1764. height: 18px;
  1765. background-image: url("../../../assets/icon/sourceFile/file.png");
  1766. background-size: 100% 100%;
  1767. margin-right: 10px;
  1768. }
  1769. .type_nav_box > .child > .nav > .name {
  1770. max-width: 100%;
  1771. overflow: hidden;
  1772. text-overflow: ellipsis;
  1773. white-space: nowrap;
  1774. }
  1775. .none_box {
  1776. height: calc(100% - 55px);
  1777. overflow: auto;
  1778. width: 100%;
  1779. padding: 10px;
  1780. box-sizing: border-box;
  1781. display: flex;
  1782. align-items: center;
  1783. justify-content: center;
  1784. }
  1785. .list_file_box {
  1786. width: 100%;
  1787. }
  1788. .list_file_box >>> .el-table__empty-block {
  1789. height: 300px !important;
  1790. display: flex;
  1791. align-items: center;
  1792. }
  1793. .list_file_box >>> .el-table__empty-block div {
  1794. display: flex;
  1795. flex-direction: column;
  1796. align-items: center;
  1797. /* justify-content: center; */
  1798. }
  1799. .customC {
  1800. /* height: 300px; */
  1801. /* width: 100px; */
  1802. /* height: 400px;
  1803. display: flex;
  1804. flex-direction: column;
  1805. align-items: center;
  1806. justify-content: center;
  1807. flex-wrap: wrap;
  1808. font-size: 14px;
  1809. margin-top: .5rem;
  1810. color: #667085; */
  1811. }
  1812. .list_file_box >>> table th {
  1813. border: none !important;
  1814. background-color: #f0f2f5 !important;
  1815. /* 浅灰色背景 */
  1816. color: #00000099 !important;
  1817. }
  1818. .list_file_box >>> table tr td {
  1819. border: none !important;
  1820. border-bottom: 1px solid #ebeef5 !important;
  1821. }
  1822. .list_file_box >>> table tr {
  1823. border: 1px #000 solid !important;
  1824. }
  1825. .list_file_box >>> .el-table__header-wrapper {
  1826. /* margin-bottom: 10px !important; */
  1827. }
  1828. .list_file_box >>> .el-table__row {
  1829. border: 1px #ccc solid;
  1830. }
  1831. .list_file_box >>> table tr td:nth-child(1) {
  1832. border-radius: 10px 0 0 10px !important;
  1833. }
  1834. .list_file_box >>> table tr td:nth-last-child(1) {
  1835. border-radius: 0 10px 10px 0 !important;
  1836. }
  1837. .list_file_box >>> table tr th:nth-child(1) {
  1838. border-radius: 10px 0 0 10px;
  1839. }
  1840. .list_file_box >>> table tr th:nth-last-child(2) {
  1841. border-radius: 0 10px 10px 0 !important;
  1842. }
  1843. .list_file_box >>> .el-table::before {
  1844. background-color: #fff;
  1845. }
  1846. .list_file_box >>> .el-table--border::after {
  1847. background-color: #fff;
  1848. }
  1849. .list_file_box >>> .el-table--border {
  1850. border: none;
  1851. border-bottom: 1px solid #ebeef5;
  1852. }
  1853. .BtnH >>> .el-button {
  1854. padding: 5px !important;
  1855. width: 30px !important;
  1856. color: #4c5567;
  1857. }
  1858. .BtnH >>> .el-button:focus,
  1859. .BtnH >>> .el-button:hover {
  1860. background: #e8ebf0 !important;
  1861. color: #487fff !important;
  1862. }
  1863. .BtnH >>> .el-button--small,
  1864. .el-button--small.is-round {
  1865. border: none;
  1866. padding: 0;
  1867. }
  1868. .BtnHP {
  1869. display: flex;
  1870. flex-direction: column;
  1871. justify-content: center;
  1872. }
  1873. .BtnHP >>> .el-popper .popper__arrow,
  1874. .el-popper .popper__arrow::after {
  1875. display: none;
  1876. }
  1877. .BtnHP >>> .el-button--text {
  1878. color: #667095;
  1879. }
  1880. .BtnHP img {
  1881. width: 16px;
  1882. }
  1883. .BtnHPDel {
  1884. display: flex;
  1885. flex-direction: column;
  1886. flex-wrap: wrap;
  1887. justify-content: center;
  1888. }
  1889. .BtnHPDel >>> .el-button + .el-button {
  1890. padding: 0;
  1891. }
  1892. .BtnHPDel >>> .el-button:focus,
  1893. .BtnHPDel >>> .el-button:hover {
  1894. background: #e8ebf0 !important;
  1895. }
  1896. /* .BtnHPDel >>> .el-button:hover .lookHp{
  1897. } */
  1898. .lookHp2 {
  1899. color: #6c6c6c;
  1900. }
  1901. .lookHp2 {
  1902. color: #487fff;
  1903. }
  1904. /* .btnBh{
  1905. display: flex;
  1906. align-items: center;
  1907. justify-content: center;
  1908. cursor: pointer;
  1909. height: 28px;
  1910. border-radius: 5px;
  1911. }
  1912. .btnBh:hover{
  1913. background: #F0F4FF;
  1914. }
  1915. .btnBh img{
  1916. margin-right: 5px;
  1917. } */
  1918. .btnBh2 img {
  1919. width: 17px;
  1920. margin-right: 5px;
  1921. padding: 1.5px;
  1922. box-sizing: border-box;
  1923. }
  1924. .btnBh2:hover {
  1925. background: #fbeae8;
  1926. }
  1927. .list_file_name {
  1928. display: flex;
  1929. align-items: center;
  1930. }
  1931. .list_file_name > img {
  1932. width: 24px;
  1933. height: 24px;
  1934. object-fit: cover;
  1935. margin-right: 5px;
  1936. }
  1937. .list_file_name > div {
  1938. max-width: 100%;
  1939. overflow: hidden;
  1940. white-space: nowrap;
  1941. text-overflow: ellipsis;
  1942. }
  1943. .pageBox {
  1944. display: flex;
  1945. }
  1946. /* .pageBox>>>.el-pagination__total {
  1947. margin-right: auto;
  1948. } */
  1949. .btnBh2 {
  1950. display: flex;
  1951. align-items: center;
  1952. cursor: pointer;
  1953. padding: 5px 8px;
  1954. border-radius: 6px;
  1955. box-sizing: border-box;
  1956. }
  1957. .btnBh {
  1958. display: flex;
  1959. cursor: pointer;
  1960. border-radius: 6px;
  1961. padding: 5px 8px;
  1962. }
  1963. </style>
  1964. <style>
  1965. .custom-popover {
  1966. min-width: 70px !important;
  1967. width: auto !important;
  1968. padding: 8px 10px;
  1969. border-radius: 8px;
  1970. }
  1971. /* .custom-popover2 {
  1972. min-width: 88px !important;
  1973. width: auto !important;
  1974. padding: 8px;
  1975. top: 414px !important;
  1976. text-align: center;
  1977. } */
  1978. .BtnH >>> .el-button {
  1979. padding: 5px !important;
  1980. width: 30px !important;
  1981. color: #4c5567;
  1982. }
  1983. .BtnH >>> .el-button:focus,
  1984. .BtnH >>> .el-button:hover {
  1985. background: #e8ebf0 !important;
  1986. color: #487fff !important;
  1987. }
  1988. .BtnHPDel1 >>> .el-button:focus,
  1989. .BtnHPDel1 >>> .el-button:hover {
  1990. background: #f0f4ff;
  1991. color: #082e86 !important;
  1992. }
  1993. .BtnHPDel >>> .el-button:focus,
  1994. .BtnHPDel >>> .el-button:hover {
  1995. background: #fbeae8 !important;
  1996. color: #de4c41 !important;
  1997. }
  1998. .BtnH >>> .el-button--small,
  1999. .el-button--small.is-round {
  2000. border: none;
  2001. padding: 0;
  2002. }
  2003. .BtnHP {
  2004. display: flex;
  2005. flex-direction: column;
  2006. justify-content: center;
  2007. }
  2008. .BtnHPDel {
  2009. display: flex;
  2010. flex-direction: column;
  2011. justify-content: center;
  2012. }
  2013. .BtnHPDel1 {
  2014. display: flex;
  2015. flex-direction: column;
  2016. justify-content: center;
  2017. }
  2018. .BtnHP >>> .el-button {
  2019. color: #4c5567;
  2020. margin-left: 0 !important;
  2021. }
  2022. .BtnHP >>> .el-popper .popper__arrow,
  2023. .el-popper .popper__arrow::after {
  2024. display: none;
  2025. }
  2026. .btnBh {
  2027. display: flex;
  2028. /* align-items: center; */
  2029. justify-content: center;
  2030. cursor: pointer;
  2031. /* height: 28px; */
  2032. border-radius: 6px;
  2033. padding: 6px 9px;
  2034. }
  2035. .btnBh:hover {
  2036. background: #f0f4ff;
  2037. }
  2038. .btnBh img {
  2039. margin-right: 5px;
  2040. width: 17px;
  2041. }
  2042. .btnBh2 {
  2043. display: flex;
  2044. align-items: center;
  2045. justify-content: center;
  2046. cursor: pointer;
  2047. height: 28px;
  2048. padding: 0 10px;
  2049. border-radius: 5px;
  2050. }
  2051. .btnBh2 img {
  2052. width: 14px;
  2053. margin-right: 5px;
  2054. }
  2055. .btnBh2:hover {
  2056. background: #fbeae8;
  2057. }
  2058. .lookHp2 {
  2059. color: #6c6c6c;
  2060. }
  2061. .lookHp2 {
  2062. color: #487fff;
  2063. }
  2064. .list_file_box >>> .el-table__empty-text {
  2065. display: flex;
  2066. justify-content: center;
  2067. line-height: 22px !important;
  2068. }
  2069. .list_file_box >>> .el-table-column--selection .cell {
  2070. display: flex !important;
  2071. align-items: center !important;
  2072. }
  2073. .f_box_top_center {
  2074. margin: auto;
  2075. display: flex;
  2076. align-items: center;
  2077. position: absolute;
  2078. top: 50%;
  2079. left: 50%;
  2080. transform: translate(-50%, -50%);
  2081. }
  2082. .f_box_top_center > span {
  2083. font-size: 16px;
  2084. cursor: pointer;
  2085. padding: 6px 8px;
  2086. color: #1a202c;
  2087. }
  2088. .f_box_top_center > span:hover {
  2089. background: rgb(242, 243, 243);
  2090. border-radius: 5px;
  2091. }
  2092. .f_box_top_center > span.active {
  2093. color: #2b5fd9;
  2094. }
  2095. .paginationArea {
  2096. width: 100%;
  2097. height: auto;
  2098. display: flex;
  2099. align-items: center;
  2100. justify-content: space-between;
  2101. }
  2102. .paginationArea > span {
  2103. font-size: 13px;
  2104. color: #606266;
  2105. }
  2106. .promptBox{
  2107. display: block;
  2108. }
  2109. .btnbox{
  2110. margin-top: 10px;
  2111. display: flex;
  2112. justify-content: flex-end;
  2113. }
  2114. </style>