index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="68px"
  9. >
  10. <el-form-item label="文件名称" prop="fileName">
  11. <el-input
  12. v-model="queryParams.fileName"
  13. placeholder="请输入文件名称"
  14. clearable
  15. size="small"
  16. @input="handleQuery"
  17. @keyup.enter.native="handleQuery"
  18. />
  19. </el-form-item>
  20. <!-- <el-form-item label="阅读量" prop="readVolume">
  21. <el-input
  22. v-model="queryParams.readVolume"
  23. placeholder="请输入阅读量"
  24. clearable
  25. size="small"
  26. @keyup.enter.native="handleQuery"
  27. />
  28. </el-form-item> -->
  29. <!-- <el-form-item label="页数" prop="theNumberPages">
  30. <el-input
  31. v-model="queryParams.theNumberPages"
  32. placeholder="请输入页数"
  33. clearable
  34. size="small"
  35. @keyup.enter.native="handleQuery"
  36. />
  37. </el-form-item> -->
  38. <el-form-item label="上传人" prop="createUser">
  39. <el-input
  40. v-model="queryParams.createUser"
  41. placeholder="请输入上传人"
  42. clearable
  43. size="small"
  44. @input="handleQuery"
  45. @keyup.enter.native="handleQuery"
  46. />
  47. </el-form-item>
  48. <!-- <el-form-item label="上传人ID" prop="createUserid">
  49. <el-input
  50. v-model="queryParams.createUserid"
  51. placeholder="请输入上传人ID"
  52. clearable
  53. size="small"
  54. @keyup.enter.native="handleQuery"
  55. />
  56. </el-form-item>
  57. <el-form-item label="目录id" prop="directoryId">
  58. <el-input
  59. v-model="queryParams.directoryId"
  60. placeholder="请输入目录id"
  61. clearable
  62. size="small"
  63. @keyup.enter.native="handleQuery"
  64. />
  65. </el-form-item>
  66. <el-form-item label="目录名称" prop="directoryName">
  67. <el-input
  68. v-model="queryParams.directoryName"
  69. placeholder="请输入目录名称"
  70. clearable
  71. size="small"
  72. @keyup.enter.native="handleQuery"
  73. />
  74. </el-form-item>
  75. <el-form-item label="文件后缀" prop="parentDirId">
  76. <el-input
  77. v-model="queryParams.parentDirId"
  78. placeholder="请输入文件后缀"
  79. clearable
  80. size="small"
  81. @keyup.enter.native="handleQuery"
  82. />
  83. </el-form-item>
  84. <el-form-item label="文件位置" prop="parentDirName">
  85. <el-input
  86. v-model="queryParams.parentDirName"
  87. placeholder="请输入文件位置"
  88. clearable
  89. size="small"
  90. @keyup.enter.native="handleQuery"
  91. />
  92. </el-form-item>
  93. <el-form-item label="文件大小" prop="fileSize">
  94. <el-input
  95. v-model="queryParams.fileSize"
  96. placeholder="请输入文件大小"
  97. clearable
  98. size="small"
  99. @keyup.enter.native="handleQuery"
  100. />
  101. </el-form-item> -->
  102. <el-form-item>
  103. <!-- <el-button type="primary" icon="el-icon-search" size="btn" @click="handleQuery">搜索</el-button> -->
  104. <el-button icon="el-icon-refresh" size="btr" @click="resetQuery">重置</el-button>
  105. </el-form-item>
  106. </el-form>
  107. <el-row :gutter="10" class="mb8">
  108. <!-- <el-col :span="1.5">
  109. <el-button
  110. type="primary"
  111. plain
  112. icon="el-icon-plus"
  113. size="mini"
  114. @click="handleAdd"
  115. v-hasPermi="['zbqk:info:add']"
  116. >新增</el-button>
  117. </el-col>
  118. <el-col :span="1.5">
  119. <el-button
  120. type="success"
  121. plain
  122. icon="el-icon-edit"
  123. size="mini"
  124. :disabled="single"
  125. @click="handleUpdate"
  126. v-hasPermi="['zbqk:info:edit']"
  127. >修改</el-button>
  128. </el-col> -->
  129. <el-col :span="1.5">
  130. <el-button
  131. type="danger"
  132. plain
  133. icon="el-icon-delete"
  134. size="mini"
  135. :disabled="multiple"
  136. @click="handleDelete"
  137. v-hasPermi="['zbqk:info:remove']"
  138. >删除</el-button>
  139. </el-col>
  140. <el-col :span="1.5">
  141. <el-button
  142. style="width:88px;height:36px"
  143. icon="el-icon-upload2"
  144. size="read"
  145. type="text"
  146. @click="upload"
  147. >上传</el-button>
  148. </el-col>
  149. <!-- <el-col :span="1.5">
  150. <el-button
  151. type="warning"
  152. plain
  153. icon="el-icon-download"
  154. size="mini"
  155. :loading="exportLoading"
  156. @click="handleExport"
  157. v-hasPermi="['system:info:export']"
  158. >导出</el-button> -->
  159. </el-col>
  160. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  161. </el-row>
  162. <el-table
  163. v-loading="loading"
  164. :data="infoList"
  165. @selection-change="handleSelectionChange"
  166. :header-cell-style="{ background: '#003C69', color: 'white' }"
  167. >
  168. <el-table-column type="selection" width="55" align="center" />
  169. <el-table-column label="序号" type="index" width="80"/>
  170. <el-table-column label="" align="center" width="90" >
  171. <template slot-scope="scope">
  172. <div style="display: flex; flex-warp: warp; margin-top: 10px">
  173. <div style="padding-right: 12vh; width: 40px; height: 52px" class="uploadPeople">
  174. <!-- 根据后缀名控制图片显示doc还是pdf形式 -->
  175. <img v-if="scope.row.parentDirId == '.pdf'" src="../../../images/PDF.png" alt />
  176. <img
  177. v-else-if="
  178. scope.row.parentDirId == '.doc' ||
  179. scope.row.parentDirId == '.docx'
  180. "
  181. src="../../../images/doc.png"
  182. alt
  183. />
  184. <img
  185. v-else-if="
  186. scope.row.parentDirId == '.ppt' ||
  187. scope.row.parentDirId == '.pptx'
  188. "
  189. src="../../../images/ppt.png"
  190. alt
  191. />
  192. </div>
  193. </div>
  194. </template>
  195. </el-table-column>
  196. <!-- <el-table-column label="主键ID" align="center" prop="id" /> -->
  197. <el-table-column label="文件名称" align="center" prop="fileName" />
  198. <el-table-column label="阅读量" align="center" prop="readVolume" />
  199. <!-- <el-table-column label="页数" align="center" prop="theNumberPages" /> -->
  200. <el-table-column label="上传人" align="center" prop="createUser" />
  201. <!-- <el-table-column label="上传人ID" align="center" prop="createUserid" />
  202. <el-table-column label="目录id" align="center" prop="directoryId" /> -->
  203. <!-- <el-table-column label="目录名称" align="center" prop="directoryName" />
  204. <el-table-column label="文件后缀" align="center" prop="parentDirId" /> -->
  205. <!-- <el-table-column label="文件位置" align="center" prop="parentDirName" />
  206. <el-table-column label="文件大小" align="center" prop="fileSize" /> -->
  207. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  208. <template slot-scope="scope">
  209. <el-button
  210. size="read"
  211. type="text"
  212. @click.native="ViewRead(scope.row)"
  213. >
  214. <span>
  215. <!-- <iframe :src="'http://192.168.5.177:8080'+scope.row.parentDirName" target="_blank">阅读</iframe> -->
  216. <!-- :href="'http://192.168.2.250:8089' + scope.row.parentDirName" -->
  217. <a target="_blank">阅读</a>
  218. </span>
  219. </el-button>
  220. <el-button size="btu"
  221. type="text">
  222. <span class="chakan1">
  223. <a
  224. :href="downurl + scope.row.parentDirName"
  225. :download="scope.row.fileName"
  226. >下载</a
  227. >
  228. </span>
  229. </el-button>
  230. <!-- <el-button
  231. size="mini"
  232. type="text"
  233. icon="el-icon-edit"
  234. @click="handleUpdate(scope.row)"
  235. v-hasPermi="['zbqk:info:edit']"
  236. >修改</el-button> -->
  237. <el-button
  238. size="dels" type="text"
  239. @click="handleDelete(scope.row)"
  240. v-hasPermi="['zbqk:info:remove']"
  241. >删除</el-button>
  242. </template>
  243. </el-table-column>
  244. </el-table>
  245. <pagination
  246. v-show="total>0"
  247. :total="total"
  248. :page.sync="queryParams.pageNum"
  249. :limit.sync="queryParams.pageSize"
  250. @pagination="getList"
  251. />
  252. <!-- 添加或修改战备情况对话框 -->
  253. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  254. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  255. <el-form-item label="文件名称" prop="fileName">
  256. <el-input v-model="form.fileName" placeholder="请输入文件名称" />
  257. </el-form-item>
  258. <el-form-item label="阅读量" prop="readVolume">
  259. <el-input v-model="form.readVolume" placeholder="请输入阅读量" />
  260. </el-form-item>
  261. <el-form-item label="页数" prop="theNumberPages">
  262. <el-input v-model="form.theNumberPages" placeholder="请输入页数" />
  263. </el-form-item>
  264. <el-form-item label="上传人" prop="createUser">
  265. <el-input v-model="form.createUser" placeholder="请输入上传人" />
  266. </el-form-item>
  267. <el-form-item label="上传人ID" prop="createUserid">
  268. <el-input v-model="form.createUserid" placeholder="请输入上传人ID" />
  269. </el-form-item>
  270. <el-form-item label="目录id" prop="directoryId">
  271. <el-input v-model="form.directoryId" placeholder="请输入目录id" />
  272. </el-form-item>
  273. <el-form-item label="目录名称" prop="directoryName">
  274. <el-input v-model="form.directoryName" placeholder="请输入目录名称" />
  275. </el-form-item>
  276. <el-form-item label="文件后缀" prop="parentDirId">
  277. <el-input v-model="form.parentDirId" placeholder="请输入文件后缀" />
  278. </el-form-item>
  279. <el-form-item label="文件位置" prop="parentDirName">
  280. <el-input v-model="form.parentDirName" placeholder="请输入文件位置" />
  281. </el-form-item>
  282. <el-form-item label="文件大小" prop="fileSize">
  283. <el-input v-model="form.fileSize" placeholder="请输入文件大小" />
  284. </el-form-item>
  285. </el-form>
  286. <div slot="footer" class="dialog-footer">
  287. <el-button type="primary" @click="submitForm">确 定</el-button>
  288. <el-button @click="cancel">取 消</el-button>
  289. </div>
  290. </el-dialog>
  291. <!-- 添加预览doc文件弹框 -->
  292. <el-dialog
  293. style="color: pink"
  294. :title="title3"
  295. :visible.sync="open33"
  296. width="850px"
  297. append-to-body
  298. id="fileinfodocx"
  299. class="el-dialog__header"
  300. :close-on-click-modal="false"
  301. >
  302. <div ref="file"></div>
  303. <div slot="footer" class="dialog-footer">
  304. <el-button type="primary" @click="open33 = false">关 闭</el-button>
  305. <!-- <el-button type="primary" @click="open33 = false">
  306. 关 闭</el-button
  307. > -->
  308. </div>
  309. </el-dialog>
  310. <!-- 预览PDF文件弹框 -->
  311. <el-dialog
  312. :title="title3"
  313. :visible.sync="previewDialog"
  314. width="850px"
  315. append-to-body
  316. id="fileinfopdf"
  317. class="el-dialog__header"
  318. :close-on-click-modal="false"
  319. >
  320. <template>
  321. <!-- <div style="margin-bottom:20px"> -->
  322. <div style="display: flex">
  323. <el-button
  324. :class="gopage == true ? 'bg' : ''"
  325. class="gopage"
  326. :theme="'default'"
  327. type="submit"
  328. :title="'上一页'"
  329. @click.native="prePage"
  330. >
  331. 上一页</el-button
  332. >
  333. <div
  334. style="
  335. width: 50px;
  336. height: 28px;
  337. background: #f4f4f4;
  338. text-align: center;
  339. line-height: 28px;
  340. "
  341. >
  342. {{ pageNum }}/{{ pageTotalNum }}
  343. </div>
  344. <el-button
  345. :class="gopage == false ? 'bg' : ''"
  346. :theme="'default'"
  347. class="downpage"
  348. type="submit"
  349. :title="'下一页'"
  350. @click.native="nextPage"
  351. >
  352. 下一页</el-button
  353. >
  354. <!-- <el-button :theme="'default'" type="submit" :title="'顺时针旋转'" @click.native="clock" > 顺时针旋转</el-button>
  355. <el-button :theme="'default'" type="submit" :title="'逆时针旋转'" @click.native="counterClock" > 逆时针旋转</el-button>
  356. <el-button :theme="'default'" type="submit" :title="'打印'" @click.native="pdfPrintAll"> 打印</el-button> -->
  357. </div>
  358. <PDF
  359. ref="pdf"
  360. :src="pdfurl"
  361. :page="pageNum"
  362. :rotate="pageRotate"
  363. @progress="loadedRatio = $event"
  364. @page-loaded="pageLoaded($event)"
  365. @num-pages="pageTotalNum = $event"
  366. @error="pdfError($event)"
  367. @link-clicked="page = $event"
  368. ></PDF>
  369. <!-- </div> -->
  370. <!-- <div class="el-dialog__footer"> -->
  371. <div slot="footer" class="dialog-footer">
  372. <el-button type="primary" @click="previewDialog = false"
  373. >关 闭</el-button
  374. >
  375. <!-- <el-button @click="previewDialog = false" size="" class="aa1"
  376. >取 消</el-button
  377. > -->
  378. </div>
  379. <!-- </div> -->
  380. </template>
  381. </el-dialog>
  382. <!-- 上传文件弹框 -->
  383. <div class="big">
  384. <el-dialog
  385. style="color: pink"
  386. :title="title"
  387. :visible.sync="uploadopen"
  388. width="520px"
  389. append-to-body
  390. class="el-dialog__header"
  391. :close-on-click-modal="false"
  392. >
  393. <el-form
  394. ref="form"
  395. :model="form"
  396. :rules="rules"
  397. label-width="130px"
  398. :inline="true"
  399. >
  400. <!-- <el-form-item
  401. label-width="100px"
  402. prop="directory"
  403. class="change_plan_type"
  404. >
  405. <el-select
  406. v-model="form.directory"
  407. placeholder="请选择目录"
  408. clearable
  409. size="small"
  410. class="choose"
  411. >
  412. <el-option
  413. v-for="item in directory"
  414. :key="item.id"
  415. :label="item.directory"
  416. :value="item.directory"
  417. @click.native="chooseDirect(item.id)"
  418. ></el-option>
  419. </el-select>
  420. </el-form-item>
  421. <el-form-item
  422. prop="subclassification"
  423. class="change_plan_type"
  424. id="son"
  425. >
  426. <el-select
  427. v-model="form.subclassification"
  428. placeholder="请选择子分类"
  429. ref="dict"
  430. clearable
  431. size="small"
  432. >
  433. <el-option
  434. v-for="item in subclassification"
  435. :key="item.id"
  436. :label="item.directory"
  437. :value="item.directory"
  438. @click.native="soncategory(item.id)"
  439. ></el-option>
  440. </el-select>
  441. </el-form-item> -->
  442. <el-form-item style=" margin-top: 10px">
  443. <FileUpload v-model="moreFile" />
  444. </el-form-item>
  445. </el-form>
  446. <div slot="footer" class="dialog-footer">
  447. <el-button type="primary" @click="UploadsubmitForm">确 定</el-button>
  448. <el-button @click="uploadopen = false" size="btn">取 消</el-button>
  449. </div>
  450. </el-dialog>
  451. </div>
  452. </div>
  453. </template>
  454. <script>
  455. import axios from "axios";
  456. import PDF from "vue-pdf";
  457. const docx = require("docx-preview");
  458. window.JSZip = require("jszip");
  459. import {
  460. listInfo,
  461. getInfo,
  462. delInfo,
  463. addInfo,
  464. updateInfo,
  465. exportInfo,
  466. addFileinfo,
  467. updateFileinfo,
  468. } from "@/api/combatduty/info";
  469. export default {
  470. name: "Info",
  471. data() {
  472. return {
  473. // 遮罩层
  474. loading: true,
  475. // 导出遮罩层
  476. exportLoading: false,
  477. // 选中数组
  478. ids: [],
  479. // 非单个禁用
  480. single: true,
  481. // 非多个禁用
  482. multiple: true,
  483. // 显示搜索条件
  484. showSearch: true,
  485. // 总条数
  486. total: 0,
  487. // 战备情况表格数据
  488. infoList: [],
  489. // 弹出层标题
  490. title: "",
  491. // 是否显示弹出层
  492. open: false,
  493. // 查询参数
  494. queryParams: {
  495. pageNum: 1,
  496. pageSize: 10,
  497. fileName: null,
  498. readVolume: null,
  499. theNumberPages: null,
  500. createUser: null,
  501. createUserid: null,
  502. directoryId: null,
  503. directoryName: null,
  504. parentDirId: null,
  505. parentDirName: null,
  506. fileSize: null
  507. },
  508. // 表单参数
  509. form: {},
  510. // 表单校验
  511. rules: {},
  512. previewDialog: false,
  513. open33: false,
  514. title3: "预览文件",
  515. // 下载文件路径
  516. downurl: process.env.VUE_APP_BASE_API,
  517. pageRotate: 0,
  518. gopage: true,
  519. previewDialog: false,
  520. pdfurl: "",
  521. pageNum: 1,
  522. pageTotalNum: 1,
  523. pageRotate: 0,
  524. // 加载进度
  525. loadedRatio: 0,
  526. curPageNum: 0,
  527. gopage: true,
  528. // 多文件上传列表
  529. moreFile: [],
  530. nunms: 0,
  531. // 点击右侧一级分类进去
  532. Ids: null,
  533. last: null,
  534. uploadopen:false,
  535. // 多文件上传列表
  536. moreFile: [],
  537. };
  538. },
  539. components: {
  540. PDF
  541. },
  542. created() {
  543. this.getList();
  544. },
  545. methods: {
  546. /** 查询战备情况列表 */
  547. getList() {
  548. this.loading = true;
  549. listInfo(this.queryParams).then(response => {
  550. this.infoList = response.rows;
  551. this.total = response.total;
  552. this.loading = false;
  553. });
  554. },
  555. // 取消按钮
  556. cancel() {
  557. this.open = false;
  558. this.reset();
  559. },
  560. // 表单重置
  561. reset() {
  562. this.form = {
  563. id: null,
  564. fileName: null,
  565. readVolume: null,
  566. theNumberPages: null,
  567. createUser: null,
  568. createUserid: null,
  569. createTime: null,
  570. directoryId: null,
  571. directoryName: null,
  572. parentDirId: null,
  573. parentDirName: null,
  574. fileSize: null
  575. };
  576. this.resetForm("form");
  577. },
  578. /** 搜索按钮操作 */
  579. handleQuery() {
  580. this.queryParams.pageNum = 1;
  581. this.getList();
  582. },
  583. /** 重置按钮操作 */
  584. resetQuery() {
  585. this.resetForm("queryForm");
  586. this.handleQuery();
  587. },
  588. // 多选框选中数据
  589. handleSelectionChange(selection) {
  590. this.ids = selection.map(item => item.id);
  591. this.single = selection.length !== 1;
  592. this.multiple = !selection.length;
  593. },
  594. /** 新增按钮操作 */
  595. handleAdd() {
  596. this.reset();
  597. this.open = true;
  598. this.title = "添加战备情况";
  599. },
  600. /** 修改按钮操作 */
  601. handleUpdate(row) {
  602. this.reset();
  603. const id = row.id || this.ids;
  604. getInfo(id).then(response => {
  605. this.form = response.data;
  606. this.open = true;
  607. this.title = "修改战备情况";
  608. });
  609. },
  610. /** 提交按钮 */
  611. submitForm() {
  612. this.$refs["form"].validate(valid => {
  613. if (valid) {
  614. if (this.form.id != null) {
  615. updateInfo(this.form).then(response => {
  616. this.$modal.msgSuccess("修改成功");
  617. this.open = false;
  618. this.getList();
  619. });
  620. } else {
  621. addInfo(this.form).then(response => {
  622. this.$modal.msgSuccess("新增成功");
  623. this.open = false;
  624. this.getList();
  625. });
  626. }
  627. }
  628. });
  629. },
  630. /** 删除按钮操作 */
  631. handleDelete(row) {
  632. const ids = row.id || this.ids;
  633. this.$modal
  634. .confirm('是否确认删除战备情况编号为"' + ids + '"的数据项?')
  635. .then(function() {
  636. return delInfo(ids);
  637. })
  638. .then(() => {
  639. this.getList();
  640. this.$modal.msgSuccess("删除成功");
  641. })
  642. .catch(() => {});
  643. },
  644. /** 导出按钮操作 */
  645. handleExport() {
  646. const queryParams = this.queryParams;
  647. this.$modal
  648. .confirm("是否确认导出所有战备情况数据项?")
  649. .then(() => {
  650. this.exportLoading = true;
  651. return exportInfo(queryParams);
  652. })
  653. .then(response => {
  654. this.$download.name(response.msg);
  655. this.exportLoading = false;
  656. })
  657. .catch(() => {});
  658. },
  659. // 阅读按钮操作
  660. ViewRead(row) {
  661. if (row.parentDirId == ".docx" || row.parentDirId == ".doc") {
  662. this.open33 = true;
  663. axios({
  664. method: "get",
  665. responseType: "blob", // 设置响应文件格式
  666. url: process.env.VUE_APP_BASE_API + row.parentDirName,
  667. }).then(({ data }) => {
  668. $(".docx").attr("id", "printArea");
  669. docx.renderAsync(data, this.$refs.file); // 渲染到页面预览
  670. });
  671. } else if (row.parentDirId == ".pdf") {
  672. this.previewDialog = true;
  673. this.pdfurl = process.env.VUE_APP_BASE_API + row.parentDirName;
  674. console.log(this.pdfurl,row.parentDirName,123)
  675. this.pageNum = 1;
  676. } else {
  677. this.$message.error("只能阅读Word跟pdf文件");
  678. }
  679. row.common = "1";
  680. updateFileinfo(row).then((res) => {
  681. this.getList();
  682. });
  683. // window.open("www.baidu.com","_self");
  684. },
  685. UploadsubmitForm(){
  686. // this.form.bdglFileInfos = this.moreFile;
  687. let bdglFileInfos={};
  688. this.moreFile.forEach(item=>{
  689. bdglFileInfos={
  690. fileSize:item.fileLength,
  691. parentDirName:item.url,
  692. parentDirId: item.houZUI,
  693. theNumberPages: item.pageCount,
  694. fileName: item.name
  695. }
  696. })
  697. console.log(bdglFileInfos)
  698. if(bdglFileInfos.fileSize=='0.0KB'){
  699. this.$modal.msgSuccess("您好!上传文件不能为空文件。");
  700. }else{
  701. // 上传文件接口
  702. addFileinfo(bdglFileInfos).then((response) => {
  703. this.$modal.msgSuccess("上传成功");
  704. this.uploadopen = false;
  705. this.getList();
  706. });
  707. }
  708. },
  709. // 上传
  710. upload() {
  711. // this.getList()
  712. this.reset();
  713. this.uploadopen = true;
  714. this.title = "上传文件";
  715. this.moreFile = "";
  716. },
  717. /**
  718. * 预览PDF
  719. */
  720. previewPDF(row, index) {
  721. this.previewDialog = true;
  722. },
  723. // 上一页函数,
  724. prePage() {
  725. this.gopage = true;
  726. var page = this.pageNum;
  727. page = page > 1 ? page - 1 : this.pageTotalNum;
  728. this.pageNum = page;
  729. },
  730. // 下一页函数
  731. nextPage() {
  732. this.gopage = false;
  733. var page = this.pageNum;
  734. page = page < this.pageTotalNum ? page + 1 : 1;
  735. this.pageNum = page;
  736. },
  737. }
  738. };
  739. </script>
  740. <style scoped>
  741. /* 上一页样式 */
  742. .gopage {
  743. width: 60px;
  744. height: 28px;
  745. background: #f4f4f4;
  746. color: #60627d;
  747. border-radius: 14px 0px 0px 14px;
  748. }
  749. /* 下一页样式 */
  750. .downpage {
  751. width: 60px;
  752. height: 28px;
  753. background: #f4f4f4;
  754. border-radius: 0px 14px 14px 0px;
  755. }
  756. /* 阅读 */
  757. .el-button--read {
  758. color: #ffffff;
  759. width: 50px;
  760. height: 30px;
  761. background-color: #1d96ff;
  762. border-radius: 4px;
  763. font-size: 14px;
  764. line-height: 5px;
  765. margin-right: 10px;
  766. }
  767. /* 阅读按钮1样式 */
  768. .el-button--reads {
  769. color: #ffffff;
  770. width: 50px;
  771. height: 30px;
  772. background-color: #13ce66;
  773. border-radius: 4px;
  774. font-size: 14px;
  775. /* background-image: url("../../../images/uploads.png"); */
  776. background-repeat: no-repeat;
  777. background-position: 8px 6px;
  778. /* text-align: center; */
  779. line-height: 30px;
  780. margin-right: 10px;
  781. }
  782. /* 删除按钮样式 */
  783. .el-button--dels {
  784. color: #ffffff;
  785. width: 50px;
  786. height: 30px;
  787. background-color: #ff4949;
  788. border-radius: 4px;
  789. font-size: 14px;
  790. background-repeat: no-repeat;
  791. background-position: 8px 6px;
  792. /* text-align: center; */
  793. line-height: 5px;
  794. margin-right: 10px;
  795. }
  796. /* 查看按钮样式 */
  797. .el-button--reads .chakan {
  798. margin-left: 7px;
  799. }
  800. /* 阅读按钮样式 */
  801. .el-button--reads .chakan1 {
  802. padding-top: 2px;
  803. /* margin-left: 7px; */
  804. }
  805. /* 上传文件 */
  806. .uploadfilesbtn {
  807. width: 80px;
  808. height: 33px;
  809. line-height: 33px;
  810. background-color: #1d96ff;
  811. color: white;
  812. border-radius: 4px;
  813. font-size: 14px;
  814. text-align: center;
  815. }
  816. .bg {
  817. background: #1d96ff;
  818. color: white;
  819. }
  820. /* 计划附件 */
  821. ::v-deep .el-upload__tip {
  822. margin-left: 2px;
  823. }
  824. /*定义滚动条宽高及背景,宽高分别对应横竖滚动条的尺寸*/
  825. .el-dialog__body::-webkit-scrollbar {
  826. width: 14px;
  827. /* height: 2px !important; */
  828. background: #3d83b8;
  829. }
  830. /*定义滑块,内阴影及圆角*/
  831. .el-dialog__body::-webkit-scrollbar-thumb {
  832. /* border-radius: 20px; */
  833. /* height: 1px;
  834. width: 3px; */
  835. background: rgba(144, 206, 252, 1);
  836. }
  837. ::v-deep .docx {
  838. padding: 0 !important;
  839. }
  840. ::v-deep .docx-wrapper > section.docx {
  841. /* padding: 0 !important; */
  842. margin-bottom: 0px !important;
  843. box-shadow: none;
  844. }
  845. /* 预览弹框背景去除 */
  846. ::v-deep .docx-wrapper {
  847. padding: 0 !important;
  848. background: none !important;
  849. }
  850. ::v-deep .docx {
  851. width: 100% !important;
  852. }
  853. ::v-deep .vue-treeselect__placeholder {
  854. color: #bdbdbd4f !important;
  855. }
  856. ::v-deep .el-table__row .el-table__cell {
  857. text-align: center !important;
  858. }
  859. ::v-deep .el-input--small .el-input__inner{
  860. color: #ffffff;
  861. }
  862. </style>