index.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226
  1. <template>
  2. <div class="flexlayout guizhangzhidu">
  3. <!-- 文件区域 左边-->
  4. <div class="tablesfile">
  5. <div class="jichu">文件</div>
  6. <el-table
  7. v-loading="loading1"
  8. :data="fileinfoList"
  9. @selection-change="handleSelectionChange"
  10. :header-cell-style="{ background: '#003C69', color: 'white' }"
  11. >
  12. <el-table-column label="序号" type="index" width="100">
  13. </el-table-column>
  14. <el-table-column
  15. label="文件"
  16. align="center"
  17. width="650"
  18. prop="directory"
  19. class="fileNAME"
  20. >
  21. <template slot-scope="scope">
  22. <div style="display: flex; flex-warp: warp; margin-top: 10px">
  23. <div style="padding-left: 20px" class="uploadPeople">
  24. <!-- 根据后缀名控制图片显示doc还是pdf形式 -->
  25. <img
  26. v-if="scope.row.parentDirId == '.pdf'"
  27. src="../../../images/PDF.png"
  28. alt=""
  29. />
  30. <img
  31. v-else-if="scope.row.parentDirId == '.doc'|| scope.row.parentDirId == '.docx'"
  32. src="../../../images/doc.png"
  33. alt=""
  34. />
  35. </div>
  36. <!-- 文件名称 fileName -->
  37. <div>
  38. <div style="text-align: start; width: 100%;margin-left:30px">
  39. {{ scope.row.fileName }}
  40. </div>
  41. <!-- 上传人 createUser -->
  42. <!-- 页数 theNumberPages-->
  43. <!-- 时间 createTime -->
  44. <!-- 阅读量 readVolume -->
  45. <div style="display:flex">
  46. <span
  47. style="
  48. font-size: 14px;
  49. color: rgba(204, 204, 204, 1);
  50. margin-right: 30px;
  51. width:100px;
  52. margin-left:30px;
  53. display:block;
  54. text-align:start
  55. "
  56. >上传人:{{ scope.row.createUser }}</span
  57. >
  58. <span
  59. style="
  60. font-size: 14px;
  61. color: rgba(204, 204, 204, 1);
  62. margin-right: 30px;
  63. width:50px;
  64. display:block;
  65. text-align:start
  66. "
  67. >页数:{{ scope.row.theNumberPages }}</span
  68. >
  69. <span
  70. style="
  71. font-size: 14px;
  72. color: rgba(204, 204, 204, 1);
  73. margin-right: 30px;
  74. width:200px;
  75. display:block;
  76. text-align:start
  77. "
  78. >时间:{{ scope.row.createTime }}</span
  79. >
  80. <span
  81. style="
  82. font-size: 14px;
  83. color: rgba(204, 204, 204, 1);
  84. width:100px;
  85. display:block;
  86. "
  87. >阅读量:{{ scope.row.readVolume }}</span
  88. >
  89. </div>
  90. </div>
  91. </div>
  92. </template>
  93. </el-table-column>
  94. <!-- <el-table-column
  95. label="文件"
  96. align="center"
  97. class-name="small-padding fixed-width"
  98. label-width="30px"
  99. >
  100. <template slot-scope="scope">
  101. {{scope.row.directoryName}}
  102. </template>
  103. </el-table-column> -->
  104. <el-table-column
  105. label="操作"
  106. align="center"
  107. class-name="small-padding fixed-width"
  108. label-width="150px"
  109. >
  110. <template slot-scope="scope">
  111. <el-button
  112. size="read"
  113. type="text"
  114. @click.native="ViewRead(scope.row)"
  115. >
  116. <span>
  117. <!-- <iframe :src="'http://192.168.5.177:8080'+scope.row.parentDirName" target="_blank">阅读</iframe> -->
  118. <a
  119. :href="'http://192.168.5.177:8080' + scope.row.parentDirName"
  120. target="_blank"
  121. >阅读</a
  122. >
  123. </span>
  124. </el-button>
  125. <el-button
  126. size="reads"
  127. type="text"
  128. @click="handleupLoad(scope.row)"
  129. >
  130. <span class="chakan1">
  131. <a :href="scope.row.parentDirName" download>下载</a>
  132. </span>
  133. </el-button>
  134. <el-button size="dels" type="text" @click="handledels(scope.row)">
  135. <span> 删除 </span>
  136. </el-button>
  137. </template>
  138. </el-table-column>
  139. </el-table>
  140. <!-- <el-pagination
  141. :background="background"
  142. :current-page.sync="currentPage"
  143. :page-size.sync="queryParams.pageSize"
  144. :layout="layout"
  145. :page-sizes="queryParams.pageNum"
  146. :pager-count="pagerCount"
  147. :total="total"
  148. v-bind="$attrs"
  149. @size-change="handleSizeChange"
  150. @current-change="handleCurrentChange"
  151. /> -->
  152. <pagination
  153. v-show="total > 0"
  154. :total="total"
  155. :page.sync="queryParams.pageNum"
  156. :limit.sync="queryParams.pageSize"
  157. @pagination="getList"
  158. />
  159. </div>
  160. <!-- 右边 -->
  161. <div class="rights">
  162. <!-- 目录 -->
  163. <div class="catalog">
  164. <div class="jichu">
  165. 目录
  166. <el-button class="turnback" @click="turnback" v-if="addbtn==0">返回上级</el-button>
  167. <el-button class="uploadfilesbtn" :class="addbtn?'margins':''" @click="upload" v-if="addbtn!=0">上传文件</el-button
  168. ><el-button class="manage" @click="mange" v-if="addbtn!=0">目录管理</el-button>
  169. </div>
  170. <el-table
  171. v-loading="loading"
  172. :data="directory"
  173. @selection-change="handleSelectionChange"
  174. :header-cell-style="{ background: '#003C69', color: 'white' }"
  175. >
  176. <el-table-column label="序号" type="index" width="50">
  177. </el-table-column>
  178. <el-table-column label="目录" align="center" prop="directory">
  179. <template slot-scope="scope">
  180. <div
  181. @click="mulus(scope.row)"
  182. :class="scope.row.subclassification == 0 ? '' : 'undeline'"
  183. style="position:relative;cursor:pointer"
  184. >
  185. <img src="../../../images/文件夹.png" alt="" style="margin-right:5px;position:absolute;left:5px;top:2px">
  186. <span style="margin-left:25px"> {{ scope.row.directory }}</span>
  187. </div>
  188. </template>
  189. </el-table-column>
  190. <el-table-column
  191. label="子分类"
  192. align="center"
  193. prop="subclassification"
  194. />
  195. <el-table-column label="文件" align="center" prop="documentsNumber" />
  196. <!-- <el-table-column
  197. label="更新时间"
  198. align="center"
  199. class-name="small-padding fixed-width"
  200. >
  201. <template slot-scope="scope">
  202. <el-button
  203. size="add"
  204. type="text"
  205. @click="ViewProgress(scope.row)"
  206. v-if="addbtn==true"
  207. >
  208. <span>添加</span>
  209. </el-button>
  210. <el-button
  211. size="dels"
  212. type="text"
  213. @click="handleDelete(scope.row)"
  214. >
  215. <span class="chakan">删除</span>
  216. </el-button>
  217. </template>
  218. </el-table-column> -->
  219. <el-table-column
  220. label="操作"
  221. align="center"
  222. class-name="small-padding fixed-width"
  223. >
  224. <template slot-scope="scope">
  225. <el-button
  226. size="add"
  227. type="text"
  228. @click="ViewProgress(scope.row)"
  229. v-if="addbtn==true"
  230. >
  231. <span>添加</span>
  232. </el-button>
  233. <el-button
  234. size="dels"
  235. type="text"
  236. @click="handleDelete(scope.row)"
  237. >
  238. <span class="chakan">删除</span>
  239. </el-button>
  240. </template>
  241. </el-table-column>
  242. </el-table>
  243. <pagination
  244. class="pagination"
  245. v-show="total1 > 0"
  246. :total="total1"
  247. :page.sync="queryParams1.pageNum"
  248. :limit.sync="queryParams1.pageSize"
  249. @pagination="ListDirectoryinfo"
  250. />
  251. </div>
  252. <!-- 排行 -->
  253. <div class="Ranking">
  254. <div class="jichu">排行</div>
  255. <table style="color: white">
  256. <tr class="borderBottom" v-for="(item,index) in Ranking" :key="item.directory_id">
  257. <!-- 作战类 documentCategory -->
  258. <!-- 上月阅读量 readnumber1 -->
  259. <!-- 本月阅读量 readnumber2 -->
  260. <!-- 排序 -->
  261. <td class="numbers">{{index+1}}</td>
  262. <!-- 作战类类别 -->
  263. <td class="find">{{item.documentCategory}}</td>
  264. <!-- 上周阅读量 -->
  265. <td class="readnumber">
  266. 上月阅读量 <span style="margin-left: 5px">{{item.readnumber2}}</span>
  267. </td>
  268. <!-- 本周阅读量 -->
  269. <td class="thisweek" style="position:relative">
  270. <!-- <img src="../../../images/upRow.png" alt="" style="position:absolute;top:18px;right:158px" > -->
  271. <!-- <img src="../../../images/downRow.png" alt="" style="position:absolute;top:17px;right:158px"> -->
  272. 本月阅读量 <span style="color: red; margin-left: 5px">{{item. readnumber1}}</span>
  273. </td>
  274. </tr>
  275. </table>
  276. <!-- <el-table
  277. v-loading="loading"
  278. :data="list"
  279. @selection-change="handleSelectionChange"
  280. :header-cell-style="{ background: '#003C69', color: 'white' }"
  281. class="RankingTables"
  282. >
  283. <el-table-column label="排名" type="index" width="50">
  284. </el-table-column>
  285. <el-table-column label="类别" align="center" prop="directory">
  286. <template slot-scope="scope">
  287. <div
  288. @click="mulus(scope.row)"
  289. :class="scope.row.subclassification == 0 ? '' : 'undeline'"
  290. >
  291. {{ scope.row.directory }}
  292. </div>
  293. </template>
  294. </el-table-column>
  295. <el-table-column
  296. label="上周阅读量"
  297. align="center"
  298. prop="subclassification"
  299. />
  300. <el-table-column
  301. label="本周阅读量"
  302. align="center"
  303. class-name="small-padding fixed-width"
  304. >
  305. <template slot-scope="scope">
  306. <div style="position:relative"> -->
  307. <!-- 阅读量增长箭头 -->
  308. <!-- <img src="../../../images/upRow.png" alt="" style="position:absolute;top:5px;right:130px" >
  309. 阅读量下降箭头
  310. <img src="../../../images/downRow.png" alt="" style="position:absolute;top:5px;right:130px"> -->
  311. <!-- 本周阅读量
  312. {{scope.row.read}}
  313. </div>
  314. </template>
  315. </el-table-column>
  316. </el-table> -->
  317. </div>
  318. <!-- 上传文件弹框 -->
  319. <div class="big">
  320. <el-dialog
  321. style="color: pink"
  322. :title="title"
  323. :visible.sync="open"
  324. width="520px"
  325. append-to-body
  326. class="el-dialog__header"
  327. >
  328. <el-form
  329. ref="form"
  330. :model="form"
  331. :rules="rules"
  332. label-width="130px"
  333. :inline="true"
  334. >
  335. <el-form-item
  336. label-width="100px"
  337. prop="directory"
  338. class="change_plan_type"
  339. >
  340. <el-select
  341. v-model="form.directory"
  342. placeholder="请选择目录"
  343. clearable
  344. size="small"
  345. class="choose"
  346. >
  347. <el-option
  348. v-for="item in directory"
  349. :key="item.id"
  350. :label="item.directory"
  351. :value="item.directory"
  352. @click.native="chooseDirect(item.id)"
  353. ></el-option>
  354. </el-select>
  355. </el-form-item>
  356. <el-form-item
  357. prop="subclassification"
  358. class="change_plan_type"
  359. id="son"
  360. >
  361. <el-select
  362. v-model="form.subclassification"
  363. placeholder="请选择子分类"
  364. ref="dict"
  365. clearable
  366. size="small"
  367. >
  368. <el-option
  369. v-for="item in subclassification"
  370. :key="item.id"
  371. :label="item.directory"
  372. :value="item.directory"
  373. @click.native="soncategory(item.id)"
  374. ></el-option>
  375. </el-select>
  376. </el-form-item>
  377. <el-form-item style="margin-left: 30px; margin-top: 30px">
  378. <FileUpload v-model="form.file" />
  379. </el-form-item>
  380. </el-form>
  381. <div slot="footer" class="dialog-footer">
  382. <el-button type="primary" @click="submitForm">确 定</el-button>
  383. <el-button @click="cancel">取 消</el-button>
  384. </div>
  385. </el-dialog>
  386. </div>
  387. <!-- 新建分类弹框 -->
  388. <el-dialog
  389. style="color: pink"
  390. :title="title1"
  391. :visible.sync="open1"
  392. width="316px"
  393. append-to-body
  394. class="el-dialog__header"
  395. >
  396. <el-form
  397. ref="form1"
  398. :model="form1"
  399. :rules="rules"
  400. label-width="130px"
  401. :inline="true"
  402. >
  403. <el-form-item prop="directory">
  404. <el-input
  405. v-model="form1.directory"
  406. placeholder="请输入目录名称"
  407. @click.native="planName"
  408. class="filename"
  409. />
  410. </el-form-item>
  411. </el-form>
  412. <div slot="footer" class="dialog-footer">
  413. <el-button type="primary" @click="submitForm1">确 定</el-button>
  414. <el-button @click="cancel">取 消</el-button>
  415. </div>
  416. </el-dialog>
  417. <!-- 添加子分类弹框 -->
  418. <el-dialog
  419. style="color: pink"
  420. :title="title2"
  421. :visible.sync="open2"
  422. width="316px"
  423. append-to-body
  424. class="el-dialog__header"
  425. >
  426. <el-form
  427. ref="form2"
  428. :model="form2"
  429. :rules="rules"
  430. label-width="130px"
  431. :inline="true"
  432. >
  433. <el-form-item prop="directory">
  434. <el-input
  435. v-model="form2.directory"
  436. placeholder="请输入子分类名称"
  437. @click.native="planName"
  438. class="filename"
  439. />
  440. </el-form-item>
  441. </el-form>
  442. <div slot="footer" class="dialog-footer">
  443. <el-button type="primary" @click="submitForm2">确 定</el-button>
  444. <el-button @click="cancel">取 消</el-button>
  445. </div>
  446. </el-dialog>
  447. </div>
  448. </div>
  449. </template>
  450. <script>
  451. import {
  452. // 获取文件列表接口
  453. listFileinfo,
  454. // 修改文件列表接口
  455. getFileinfo,
  456. // 删除文件列表接口
  457. delFileinfo,
  458. // 上传文件
  459. addFileinfo,
  460. // 修改文件列表接口
  461. updateFileinfo,
  462. // 导出文件列表接口
  463. exportFileinfo,
  464. // 获取排行接口
  465. rankList
  466. } from "@/api/regulations/fileinfo";
  467. import {
  468. // 查询目录列表接口
  469. listDirectoryinfo,
  470. // 添加目录列表接口
  471. addDirectoryinfo,
  472. // 删除目录列表接口
  473. delDirectoryinfo,
  474. } from "@/api/regulations/directoryinfo";
  475. export default {
  476. name: "Fileinfo",
  477. data() {
  478. return {
  479. list: [
  480. {
  481. id: 1,
  482. file: "文件",
  483. },
  484. {
  485. id: 2,
  486. file: "文件",
  487. },
  488. {
  489. id: 3,
  490. file: "文件",
  491. },
  492. ],
  493. // 分页器1
  494. total: 0,
  495. // 分页器2
  496. total1: 0,
  497. queryParams: {
  498. pageNum: 1,
  499. pageSize: 8,
  500. catalog: "",
  501. category: "",
  502. fileName: null,
  503. readVolume: null,
  504. theNumberPages: null,
  505. createUser: null,
  506. createUserid: null,
  507. directoryId: null,
  508. directoryName: null,
  509. parentDirId: null,
  510. parentDirName: null,
  511. fileSize: null,
  512. },
  513. queryParams1: {
  514. pageNum: 1,
  515. pageSize: 5,
  516. catalog: "",
  517. category: "",
  518. fileName: null,
  519. readVolume: null,
  520. theNumberPages: null,
  521. createUser: null,
  522. createUserid: null,
  523. directoryId: null,
  524. directoryName: null,
  525. parentDirId: null,
  526. parentDirName: null,
  527. fileSize: null,
  528. },
  529. // 上传文件
  530. open: false,
  531. // 新建分类
  532. open1: false,
  533. // 添加子分类
  534. open2: false,
  535. // 表单参数
  536. form: {},
  537. // 新建目录
  538. form1: {},
  539. // 新建子分类
  540. form2: {},
  541. // 规章制度文件记录表格数据
  542. fileinfoList: [],
  543. // 表单校验
  544. rules: {},
  545. // 目录
  546. directory: [],
  547. // 父节点id
  548. parentId: "",
  549. // 遮罩层
  550. loading: true,
  551. // 导出遮罩层
  552. exportLoading: false,
  553. // 子分类
  554. subclassification: [],
  555. // 刷新
  556. loading1: false,
  557. // 文件
  558. file: {},
  559. //文件类型判断
  560. fileType: 1,
  561. // 添加子分类名称
  562. title2: "",
  563. // 添加新建分类名称
  564. title1: "",
  565. // 添加上传文件名称
  566. title: "",
  567. // 排行数据
  568. Ranking:[],
  569. // 添加按钮
  570. addbtn:true
  571. };
  572. },
  573. created() {
  574. this.getList();
  575. // 获取目录接口
  576. this.ListDirectoryinfo();
  577. // 获取排行目录接口
  578. rankList().then(res=>{
  579. this.Ranking=res.data
  580. })
  581. $(".app-wrapper").removeClass("openSidebar")
  582. console.log($(".app-wrapper"))
  583. $(".app-wrapper").addClass("hideSidebar")
  584. $(".sidebar-logo-container").removeClass("collapse")
  585. },
  586. methods: {
  587. // 文件删除按钮操作
  588. handledels(row) {
  589. this.$modal
  590. .confirm('是否确认删除该文件')
  591. .then(function () {
  592. return delFileinfo(row.id);
  593. })
  594. .then(() => {
  595. this.getList();
  596. this.$modal.msgSuccess("删除成功");
  597. })
  598. .catch(() => {});
  599. },
  600. // 子分类id
  601. soncategory(id) {
  602. this.form.directoryId = id;
  603. },
  604. // 获取目录列表
  605. ListDirectoryinfo() {
  606. this.loading = true;
  607. this.queryParams.common = "1";
  608. listDirectoryinfo(this.queryParams).then((res) => {
  609. console.log(res.rows)
  610. this.directory = res.rows;
  611. this.total1 = res.rows.length;
  612. this.loading = false;
  613. // console.log(this.directory);
  614. });
  615. },
  616. // 点击目录根据子目录的数量控制他是否可以点进去进行渲染
  617. mulus(row) {
  618. this.parentId = row.id;
  619. this.form.directoryId=row.id
  620. listFileinfo({directoryId:this.form.directoryId}).then(res=>{
  621. this.fileinfoList = res.rows;
  622. this.total = res.total;
  623. })
  624. listDirectoryinfo({ parentId: this.parentId }).then((res) => {
  625. res.rows.forEach((item) => {
  626. if (item.subclassification == 0) {
  627. this.directory = res.rows;
  628. this.addbtn=false
  629. } else {
  630. return;
  631. }
  632. });
  633. });
  634. // 绑定的数据 directory
  635. },
  636. // 返回目录
  637. turnback() {
  638. this.addbtn=true
  639. this.getList()
  640. this.ListDirectoryinfo();
  641. },
  642. // 选中父目录之后
  643. chooseDirect(id) {
  644. this.subclassification = [];
  645. this.parentId = id;
  646. // 获取到父目录id了
  647. listDirectoryinfo({ parentId: this.parentId }).then((res) => {
  648. this.subclassification = res.rows;
  649. });
  650. },
  651. /** 查询规章制度文件记录列表 */
  652. getList() {
  653. this.loading = true;
  654. listFileinfo(this.queryParams).then((response) => {
  655. console.log(response.total)
  656. this.fileinfoList = response.rows;
  657. this.total = response.total;
  658. this.loading=false
  659. });
  660. },
  661. // 取消按钮
  662. cancel() {
  663. this.open = false;
  664. this.reset();
  665. },
  666. // 表单重置
  667. reset() {
  668. this.form = {
  669. id: null,
  670. fileName: null,
  671. readVolume: null,
  672. theNumberPages: null,
  673. createUser: null,
  674. createUserid: null,
  675. createTime: null,
  676. directoryId: null,
  677. directoryName: null,
  678. parentDirId: null,
  679. parentDirName: null,
  680. fileSize: null,
  681. };
  682. this.resetForm("form");
  683. },
  684. /** 搜索按钮操作 */
  685. handleQuery() {
  686. this.queryParams.pageNum = 1;
  687. this.getList();
  688. },
  689. /** 重置按钮操作 */
  690. resetQuery() {
  691. this.resetForm("queryForm");
  692. this.handleQuery();
  693. },
  694. // 多选框选中数据
  695. handleSelectionChange(selection) {
  696. this.ids = selection.map((item) => item.id);
  697. this.single = selection.length !== 1;
  698. this.multiple = !selection.length;
  699. },
  700. /** 新增按钮操作 */
  701. handleAdd() {
  702. this.reset();
  703. this.open = true;
  704. this.title = "添加规章制度文件记录";
  705. },
  706. /** 修改按钮操作 */
  707. handleUpdate(row) {
  708. this.reset();
  709. const id = row.id || this.ids;
  710. getFileinfo(id).then((response) => {
  711. this.form = response.data;
  712. this.open = true;
  713. this.title = "修改规章制度文件记录";
  714. });
  715. },
  716. /** 上传文件提交按钮 */
  717. submitForm() {
  718. console.log(this.form)
  719. this.$refs["form"].validate((valid) => {
  720. if (valid) {
  721. console.log(this.form.file[0]);
  722. // 文件名
  723. this.form.fileName = this.form.file[0].name;
  724. // 路径
  725. this.form.parentDirName = this.form.file[0].url;
  726. // 后缀
  727. this.form.parentDirId = this.form.file[0].houZUI;
  728. // 页数
  729. this.form.theNumberPages = this.form.file[0].pageCount;
  730. // 文件大小
  731. this.form.fileSize = this.form.file[0].fileLength;
  732. // 目录名称
  733. this.form.directoryName = this.form.subclassification;
  734. //输出结果
  735. console.log(this.form);
  736. // 上传文件接口
  737. addFileinfo(this.form).then((response) => {
  738. this.ListDirectoryinfo();
  739. this.$modal.msgSuccess("上传成功");
  740. this.open = false;
  741. this.getList();
  742. });
  743. }
  744. });
  745. },
  746. // 新建分类
  747. submitForm1() {
  748. // 新建分类接口
  749. // addDirectoryinfo
  750. this.$refs["form1"].validate((valid) => {
  751. if (valid) {
  752. addDirectoryinfo(this.form1).then((response) => {
  753. this.$modal.msgSuccess("新增成功");
  754. this.ListDirectoryinfo();
  755. this.open1 = false;
  756. this.form1 = {};
  757. // this.reset()
  758. });
  759. }
  760. });
  761. },
  762. // 添加子分类
  763. submitForm2() {
  764. this.$refs["form2"].validate((valid) => {
  765. console.log(this.form2);
  766. if (valid) {
  767. addDirectoryinfo(this.form2).then((response) => {
  768. this.$modal.msgSuccess("上传子分类成功");
  769. this.open2 = false;
  770. this.form2 = {};
  771. this.ListDirectoryinfo();
  772. });
  773. }
  774. });
  775. },
  776. /** 删除按钮操作 */
  777. handleDelete(row) {
  778. const ids = row.id;
  779. console.log(ids);
  780. this.$modal
  781. .confirm("是否确认删除?")
  782. .then(function () {
  783. this.ListDirectoryinfo();
  784. this.getList();
  785. return delDirectoryinfo(ids);
  786. })
  787. .then(() => {
  788. this.ListDirectoryinfo();
  789. this.loading=false
  790. this.loading1=false
  791. this.$modal.msgSuccess("删除成功");
  792. })
  793. .catch(() => {});
  794. },
  795. /** 导出按钮操作 */
  796. handleExport() {
  797. const queryParams = this.queryParams;
  798. this.$modal
  799. .confirm("是否确认导出所有规章制度文件记录数据项?")
  800. .then(() => {
  801. this.exportLoading = true;
  802. return exportFileinfo(queryParams);
  803. })
  804. .then((response) => {
  805. this.$download.name(response.msg);
  806. this.exportLoading = false;
  807. })
  808. .catch(() => {});
  809. },
  810. // 上传
  811. upload() {
  812. // this.getList()
  813. this.reset();
  814. this.open = true;
  815. this.title = "上传文件";
  816. this.ListDirectoryinfo();
  817. },
  818. // 目录管理
  819. mange() {
  820. this.open1 = true;
  821. this.title1 = "新建分类";
  822. },
  823. // 添加
  824. ViewProgress(row) {
  825. // 传入父亲目录id
  826. this.form2.parentId = row.id;
  827. // console.log(this.form2.parentId)
  828. this.open2 = true;
  829. this.title2 = "请输入子分类名称";
  830. },
  831. // 取消按钮
  832. cancel() {
  833. this.open = false;
  834. this.open1 = false;
  835. this.open2 = false;
  836. this.comstatus = 0;
  837. this.reset();
  838. },
  839. // 阅读按钮操作
  840. ViewRead(row) {
  841. // console.log(row.id)
  842. // console.log(row)
  843. row.common = "1";
  844. updateFileinfo(row).then((res) => {
  845. this.getList();
  846. });
  847. // console.log(this.fileinfoList);
  848. // window.open("www.baidu.com","_self");
  849. },
  850. // 下载按钮操作
  851. handleupLoad() {},
  852. },
  853. };
  854. </script>
  855. <style scoped>
  856. .jichu {
  857. color: white;
  858. width: 100%;
  859. height: 40px;
  860. line-height: 40px;
  861. border-left: 4px solid rgba(29, 150, 255, 1);
  862. text-indent: 1em;
  863. }
  864. /* 文件表格 */
  865. .tablesfile {
  866. /* height: 87vh; */
  867. background: #00365f;
  868. width: calc(100% - 695px);
  869. position: absolute;
  870. left: 20px;
  871. top: 20px;
  872. bottom: 20px;
  873. }
  874. /* 弹性布局 */
  875. .flexlayout {
  876. display: flex;
  877. justify-content: space-around;
  878. align-items: flex-start;
  879. height: 100%;
  880. display: flex;
  881. width: 100%;
  882. margin: 20px 20px 20px;
  883. }
  884. /* 目录 */
  885. .catalog {
  886. width: 100%;
  887. height: 50%;
  888. position: relative;
  889. background-color: #00365f;
  890. }
  891. /* 弹框按钮 */
  892. .dialog-footer .el-button {
  893. width: 60px;
  894. height: 30px;
  895. }
  896. /* 分页器样式 */
  897. .pagination {
  898. position: absolute;
  899. bottom: 20px;
  900. right: 10px;
  901. }
  902. /* 排行 */
  903. .Ranking {
  904. width: 100%;
  905. height: 48.6%;
  906. right: 12%;
  907. top: 45%;
  908. background-color: #00365f;
  909. margin-top: 10px;
  910. margin-bottom: 20px;
  911. }
  912. /* 右边栏样式 */
  913. .rights {
  914. /* height: 100vh; */
  915. /* height: 85vh; */
  916. width: 632px;
  917. float: right;
  918. position: absolute;
  919. top: 20px;
  920. right: 20px;
  921. bottom: 20px;
  922. }
  923. /* 阅读 */
  924. .el-button--read {
  925. color: #ffffff;
  926. width: 50px;
  927. height: 30px;
  928. background-color: #1d96ff;
  929. border-radius: 4px;
  930. font-size: 14px;
  931. line-height: 5px;
  932. margin-right: 10px;
  933. }
  934. /* 阅读按钮1样式 */
  935. .el-button--reads {
  936. color: #ffffff;
  937. width: 67px;
  938. height: 30px;
  939. background-color: #1d96ff;
  940. border-radius: 4px;
  941. font-size: 14px;
  942. background-image: url("../../../images/uploads.png");
  943. background-repeat: no-repeat;
  944. background-position: 8px 6px;
  945. /* text-align: center; */
  946. line-height: 30px;
  947. margin-right: 10px;
  948. }
  949. /* 删除按钮样式 */
  950. .el-button--dels {
  951. color: #ffffff;
  952. width: 60px;
  953. height: 30px;
  954. background-color: #ff4949;
  955. border-radius: 4px;
  956. font-size: 14px;
  957. background-repeat: no-repeat;
  958. background-position: 8px 6px;
  959. /* text-align: center; */
  960. line-height: 5px;
  961. margin-right: 10px;
  962. }
  963. /* 查看按钮样式 */
  964. .el-button--reads .chakan {
  965. margin-left: 7px;
  966. }
  967. /* 阅读按钮样式 */
  968. .el-button--reads .chakan1 {
  969. padding-top:2px;
  970. margin-left: 7px;
  971. }
  972. /* 表格 */
  973. .tdfirst {
  974. width: 60px;
  975. text-align: center;
  976. }
  977. .tdsecound {
  978. width: 880px;
  979. }
  980. .tdthird {
  981. width: 70px;
  982. }
  983. .tdfourth {
  984. width: 70px;
  985. }
  986. tr {
  987. width: 100%;
  988. height: 50px;
  989. }
  990. .lefttable tr:nth-child(even) {
  991. background-color: #00365f;
  992. }
  993. .lefttable tr:nth-child(odd) {
  994. background-color: rgb(0, 60, 105);
  995. }
  996. /* 表格 */
  997. .numbers {
  998. width: 50px;
  999. text-align: center;
  1000. /* background: pink; */
  1001. /* margin-left: 10px; */
  1002. }
  1003. .find {
  1004. /* background-color: skyblue; */
  1005. font-size: 14px;
  1006. width: 200px;
  1007. text-align: center;
  1008. }
  1009. .readnumber {
  1010. font-size: 14px;
  1011. width: 220px;
  1012. text-align: center;
  1013. }
  1014. .thisweek {
  1015. font-size: 14px;
  1016. width: 210px;
  1017. text-align: center;
  1018. }
  1019. .borderBottom {
  1020. width: 100%;
  1021. height: 50px;
  1022. border-bottom: 1px solid #718a9dff;
  1023. }
  1024. table {
  1025. border-collapse: collapse;
  1026. width: 100%;
  1027. }
  1028. /* 左边表格 */
  1029. .lefttable tr {
  1030. width: 100%;
  1031. height: 60px;
  1032. background-color: pink;
  1033. }
  1034. /* 上传文件 */
  1035. .uploadfilesbtn {
  1036. width: 80px;
  1037. height: 33px;
  1038. line-height: 33px;
  1039. background-color: #1d96ff;
  1040. color: white;
  1041. border-radius: 4px;
  1042. font-size: 14px;
  1043. text-align: center;
  1044. }
  1045. .margins{
  1046. margin-left: 370px;
  1047. }
  1048. /* 返回目录按钮 */
  1049. .turnback {
  1050. width: 86px;
  1051. height: 33px;
  1052. border: 1px solid #ccc;
  1053. border-radius: 4px;
  1054. font-size: 14px;
  1055. line-height: 33px;
  1056. margin-left: 30px;
  1057. text-align: center;
  1058. margin-left: 450px;
  1059. color: #ccc;
  1060. background: #00365f;
  1061. }
  1062. /* 目录管理 */
  1063. .manage {
  1064. /* display: inline-block; */
  1065. width: 80px;
  1066. height: 33px;
  1067. line-height: 33px;
  1068. background-color: #1d96ff;
  1069. color: white;
  1070. font-size: 14px;
  1071. border-radius: 4px;
  1072. margin-left: 10px;
  1073. }
  1074. .pagination-container {
  1075. background: #fff;
  1076. padding: 32px 16px;
  1077. }
  1078. .pagination-container.hidden {
  1079. display: none;
  1080. }
  1081. /* 弹框样式修改 */
  1082. ::v-deep .el-dialog {
  1083. background-color: #004d86 !important;
  1084. }
  1085. ::v-deep .el-dialog__title {
  1086. color: white;
  1087. }
  1088. ::v-deep .el-dialog__header {
  1089. border-bottom: 1px solid #718a9dff;
  1090. }
  1091. ::v-deep .select_file {
  1092. margin-left: -30px;
  1093. }
  1094. /* 计划附件 */
  1095. ::v-deep .el-upload__tip {
  1096. color: white;
  1097. position: absolute;
  1098. top: -5px;
  1099. width: 500px;
  1100. left: 80px;
  1101. color: white;
  1102. }
  1103. ::v-deep .el-form-item__content {
  1104. width: 230px;
  1105. }
  1106. /* 选取附件 */
  1107. ::v-deep .el-upload-list__item {
  1108. width: 400px;
  1109. }
  1110. ::v-deep .el-upload-list__item a {
  1111. color: white;
  1112. text-indent: 0.5em;
  1113. }
  1114. ::v-deep .el-select-dropdown__item {
  1115. color: white;
  1116. }
  1117. /* 输入框背景 */
  1118. ::v-deep .el-input__inner {
  1119. background-color: #004d86;
  1120. /* width: 270px; */
  1121. }
  1122. ::v-deep .filename .el-input__inner {
  1123. width: 270px;
  1124. color: white;
  1125. }
  1126. ::v-deep .el-select-dropdown__wrap {
  1127. background-color: white !important;
  1128. }
  1129. .el-select-dropdown__item {
  1130. text-indent: 1em;
  1131. color: white;
  1132. border: none !important;
  1133. }
  1134. ::v-deep .el-select-dropdown__wrap .el-scrollbar__view {
  1135. background-color: white !important;
  1136. }
  1137. ::v-deep .pagination-container {
  1138. display: block !important;
  1139. }
  1140. /* 添加按钮 */
  1141. .el-button--add {
  1142. width: 55px !important;
  1143. border: 1px solid transparent;
  1144. padding: 3px 8px;
  1145. font-size: 14px;
  1146. line-height: 1.5;
  1147. border-radius: 3px;
  1148. color: #fff;
  1149. background-color: #13ce66;
  1150. }
  1151. /* 删除按钮 */
  1152. .el-button--del {
  1153. width: 46px !important;
  1154. border: 1px solid transparent;
  1155. padding: 3px 8px;
  1156. font-size: 14px;
  1157. line-height: 1.5;
  1158. border-radius: 3px;
  1159. color: #fff;
  1160. background-color: #ff4949;
  1161. }
  1162. /* 下划线 */
  1163. .undeline {
  1164. /* text-decoration: underline; */
  1165. /* text-align: start; */
  1166. color: #1d96ff;
  1167. cursor: pointer;
  1168. }
  1169. /* 序号居中 */
  1170. ::v-deep .el-table_1_column_1,.el-table_3_column_9 {
  1171. text-align: center;
  1172. }
  1173. ::v-deep .el-table_2_column_4 {
  1174. text-align: center;
  1175. }
  1176. /* 导入按钮 */
  1177. .imports {
  1178. color: skyblue;
  1179. display: inline-block;
  1180. margin-top: 30px;
  1181. margin-right: 150px;
  1182. /* padding-top: 10px; */
  1183. }
  1184. .is-ready li {
  1185. width: 300px !important;
  1186. }
  1187. .cursor {
  1188. cursor: pointer;
  1189. color: #409eff;
  1190. font-size: 16px;
  1191. }
  1192. * {
  1193. padding: 0;
  1194. margin: 0;
  1195. }
  1196. html,
  1197. body,
  1198. #app {
  1199. height: 100%;
  1200. margin: 0;
  1201. padding: 0;
  1202. }
  1203. /* .el-table td.el-table__cell div {
  1204. margin: auto;
  1205. } */
  1206. /* 下拉框样式 */
  1207. ::v-deep .guizhangzhidu .el-select-dropdown .el-select-dropdown__wrap .el-scrollbar__view{
  1208. background-color: white !important;
  1209. text-indent: 1em !important;
  1210. }
  1211. ::v-deep .guizhangzhidu .el-select-dropdown__list{
  1212. background: white !important;
  1213. }
  1214. ::v-deep .el-table_2_column_13 .cell{
  1215. text-align: center !important;
  1216. }
  1217. </style>