index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="20">
  4. <!--目录数据-->
  5. <el-col :span="5" :xs="24">
  6. <div class="head-container">
  7. <el-input
  8. v-model="menuName"
  9. :placeholder="$t('请输入') + $t('目录名称')"
  10. clearable
  11. size="small"
  12. prefix-icon="el-icon-search"
  13. style="margin-bottom: 20px"
  14. />
  15. </div>
  16. <div class="head-container">
  17. <el-table
  18. v-loading="loading"
  19. :data="menuOptions"
  20. style="margin-bottom: 20px"
  21. border
  22. class="menuTable"
  23. :show-header="status"
  24. @row-click="handleNodeClick"
  25. :height="menuHeight">
  26. <el-table-column align="center" prop="cataname" :show-overflow-tooltip="true"/>
  27. </el-table>
  28. </div>
  29. </el-col>
  30. <!--公共盘数据数据-->
  31. <el-col :span="19" :xs="24">
  32. <el-row :gutter="10" class="mb8">
  33. <el-col :span="1.5">
  34. <el-button
  35. type="success"
  36. icon="el-icon-edit"
  37. size="mini"
  38. @click="menuUpdate"
  39. v-hasPermi="['document:publicdoc:edit']"
  40. >{{ $t('左侧目录修改') }}</el-button>
  41. </el-col>
  42. <el-col :span="1.5">
  43. <el-button
  44. type="primary"
  45. icon="el-icon-plus"
  46. size="mini"
  47. @click="handleAdd"
  48. v-hasPermi="['document:publicdoc:add']"
  49. >{{ $t('新增') }}</el-button>
  50. </el-col>
  51. <el-col :span="1.5">
  52. <el-button
  53. type="danger"
  54. icon="el-icon-delete"
  55. size="mini"
  56. :disabled="multiple"
  57. @click="handleDelete"
  58. v-hasPermi="['document:publicdoc:remove']"
  59. >{{ $t('删除') }}</el-button>
  60. </el-col>
  61. <el-col :span="1.5">
  62. <el-button
  63. type="info"
  64. icon="el-icon-upload2"
  65. size="mini"
  66. @click="handleImport"
  67. v-hasPermi="['document:publicdoc:edit']"
  68. >{{ $t('导入') }}</el-button>
  69. </el-col>
  70. <el-col :span="1.5">
  71. <el-button
  72. type="warning"
  73. icon="el-icon-download"
  74. size="mini"
  75. @click="handleExport"
  76. v-hasPermi="['document:publicdoc:export']"
  77. >{{ $t('导出') }}</el-button>
  78. </el-col>
  79. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  80. </el-row>
  81. <el-table v-loading="loading" :data="publicdocList" @selection-change="handleSelectionChange" :height="clientHeight" border>
  82. <el-table-column type="selection" width="55" align="center" />
  83. <el-table-column :label="$t('文件名称')" align="center" prop="filename" :show-overflow-tooltip="true"/>
  84. <el-table-column :label="$t('目录')" align="center" prop="menuName" :show-overflow-tooltip="true"/>
  85. <el-table-column :label="$t('负责人')" align="center" prop="responsibility" :show-overflow-tooltip="true"/>
  86. <el-table-column :label="$t('具体行动')" align="center" prop="action" :show-overflow-tooltip="true"/>
  87. <el-table-column :label="$t('位置')" align="center" prop="location" :show-overflow-tooltip="true"/>
  88. <el-table-column :label="$t('文件放置频次')" align="center" prop="frequency" :show-overflow-tooltip="true"/>
  89. <el-table-column :label="$t('文件最新日期')" align="center" prop="filedate" :show-overflow-tooltip="true"/>
  90. <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
  91. <el-table-column :label="$t('操作')" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
  92. <template slot-scope="scope">
  93. <el-button
  94. size="mini"
  95. type="text"
  96. icon="el-icon-edit"
  97. @click="handleUpdate(scope.row)"
  98. v-hasPermi="['document:publicdoc:edit']"
  99. >{{ $t('修改') }}</el-button>
  100. <el-button
  101. size="mini"
  102. type="text"
  103. icon="el-icon-delete"
  104. @click="handleDelete(scope.row)"
  105. v-hasPermi="['document:publicdoc:remove']"
  106. >{{ $t('删除') }}</el-button>
  107. <el-button
  108. size="mini"
  109. type="text"
  110. icon="el-icon-document"
  111. @click="handleDoc(scope.row)"
  112. v-hasPermi="['document:publicdoc:edit']"
  113. >{{ $t('报告附件') }}</el-button>
  114. </template>
  115. </el-table-column>
  116. </el-table>
  117. <pagination
  118. v-show="total>0"
  119. :total="total"
  120. :page.sync="queryParams.pageNum"
  121. :limit.sync="queryParams.pageSize"
  122. @pagination="getList"
  123. />
  124. <!-- 添加或修改公共盘文档对话框 -->
  125. <el-dialog v-dialogDrag :title="title" :visible.sync="open" width="500px" append-to-body>
  126. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  127. <el-form-item :label="$t('文件名称')" prop="filename">
  128. <el-input v-model="form.filename" :placeholder="$t('请输入') + $t('文件名称')" />
  129. </el-form-item>
  130. <el-form-item :label="$t('目录')" prop="menuName">
  131. <el-select v-model="form.menuName" filterable :placeholder="$t('请选择') + $t('目录')">
  132. <el-option
  133. v-for="dict in menuOptions"
  134. :key="dict.cataname"
  135. :label="dict.cataname"
  136. :value="dict.cataname">
  137. </el-option>
  138. </el-select>
  139. </el-form-item>
  140. <el-form-item :label="$t('负责人')" prop="responsibility">
  141. <el-input v-model="form.responsibility" :placeholder="$t('请选择') + $t('负责人')" />
  142. </el-form-item>
  143. <el-form-item :label="$t('具体行动')" prop="action">
  144. <el-input v-model="form.action" :placeholder="$t('请输入') + $t('具体行动')" />
  145. </el-form-item>
  146. <el-form-item :label="$t('位置')" prop="location">
  147. <el-input v-model="form.location" :placeholder="$t('请输入') + $t('位置')" />
  148. </el-form-item>
  149. <el-form-item :label="$t('文件放置频次')" prop="frequency">
  150. <el-input v-model="form.frequency" :placeholder="$t('请输入') + $t('文件放置频次')" />
  151. </el-form-item>
  152. <el-form-item :label="$t('文件最新日期')" prop="filedate">
  153. <el-input v-model="form.filedate" :placeholder="$t('请输入') + $t('文件最新日期')" />
  154. </el-form-item>
  155. <el-form-item :label="$t('备注')" prop="remarks">
  156. <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')" />
  157. </el-form-item>
  158. <el-form-item :label="$t('归属部门')" prop="deptId">
  159. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" :placeholder="$t('请选择') + $t('归属部门')" />
  160. </el-form-item>
  161. </el-form>
  162. <div slot="footer" class="dialog-footer">
  163. <el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button>
  164. <el-button @click="cancel">{{ $t('取 消') }}</el-button>
  165. </div>
  166. </el-dialog>
  167. <!-- 用户导入对话框 -->
  168. <el-dialog v-dialogDrag :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  169. <el-upload
  170. ref="upload"
  171. :limit="1"
  172. accept=".xlsx, .xls"
  173. :headers="upload.headers"
  174. :action="upload.url"
  175. :disabled="upload.isUploading"
  176. :on-progress="handleFileUploadProgress"
  177. :on-success="handleFileSuccess"
  178. :auto-upload="false"
  179. drag
  180. >
  181. <i class="el-icon-upload"></i>
  182. <div class="el-upload__text">
  183. {{ $t('将文件拖到此处,或') }}
  184. <em>{{ $t('点击上传') }}</em>
  185. </div>
  186. <div class="el-upload__tip" slot="tip">
  187. <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
  188. <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
  189. </div>
  190. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  191. <input name="type" :value="upload.type" hidden />
  192. </form>
  193. <div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
  194. </el-upload>
  195. <div slot="footer" class="dialog-footer">
  196. <el-button type="primary" @click="submitFileForm(1)">{{ $t('确 定') }}</el-button>
  197. <el-button @click="upload.open = false">{{ $t('取 消') }}</el-button>
  198. </div>
  199. </el-dialog>
  200. <!-- 报告附件对话框 -->
  201. <el-dialog v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="700px" append-to-body>
  202. <el-upload
  203. ref="doc"
  204. :limit="50"
  205. :headers="doc.headers"
  206. :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
  207. :disabled="doc.isUploading"
  208. :on-progress="handleFileDocProgress"
  209. :on-success="handleFileDocSuccess"
  210. :auto-upload="true"
  211. drag
  212. >
  213. <i class="el-icon-upload"></i>
  214. <div class="el-upload__text">
  215. {{ $t('将文件拖到此处,或') }}
  216. <em>{{ $t('点击上传') }}</em>
  217. </div>
  218. </el-upload>
  219. <el-table :data="doc.commonfileList" border>
  220. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  221. <template slot-scope="scope">
  222. <a class="link-type" @click="handleDownload(scope.row)">
  223. <span>{{ scope.row.fileName }}</span>
  224. </a>
  225. </template>
  226. </el-table-column>
  227. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  228. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  229. <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
  230. <template slot-scope="scope">
  231. <el-button
  232. v-if="scope.row.fileName.endsWith('pdf')"
  233. size="mini"
  234. type="text"
  235. icon="el-icon-view"
  236. @click="handleSee(scope.row)"
  237. >{{ $t('预览') }}</el-button>
  238. <el-button
  239. size="mini"
  240. type="text"
  241. icon="el-icon-download"
  242. @click="handleDownload(scope.row)"
  243. >{{ $t('下载') }}</el-button>
  244. <el-button
  245. size="mini"
  246. type="text"
  247. icon="el-icon-delete"
  248. @click="handleDeleteDoc(scope.row)"
  249. >{{ $t('删除') }}</el-button>
  250. </template>
  251. </el-table-column>
  252. </el-table>
  253. <el-dialog v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1700px" append-to-body>
  254. <div style="margin-top: -60px;float: right;margin-right: 40px;">
  255. <el-button size="mini" type="text" @click="window.open(this.pdf.pdfUrl)">{{$t('新页面打开PDF')}}</el-button></div>
  256. <div style="margin-top: -30px">
  257. <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
  258. </div>
  259. </el-dialog>
  260. <div slot="footer" class="dialog-footer">
  261. <!-- <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>-->
  262. <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
  263. </div>
  264. </el-dialog>
  265. </el-col>
  266. </el-row>
  267. </div>
  268. </template>
  269. <script>
  270. import {
  271. addPublicdoc,
  272. delPublicdoc,
  273. exportPublicdoc,
  274. getPublicdoc,
  275. listPublicdoc,
  276. updatePublicdoc
  277. } from "@/api/document/publicdoc";
  278. import {listMenu} from "../../../api/document/publicdocmenu";
  279. import {treeselect} from "@/api/system/dept";
  280. import {getToken} from "@/utils/auth";
  281. import Treeselect from "@riophae/vue-treeselect";
  282. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  283. import {allFileList, delCommonfile} from "@/api/common/commonfile";
  284. import pdf from "vue-pdf";
  285. export default {
  286. name: "Publicdoc",
  287. components: { Treeselect,pdf },
  288. data() {
  289. return {
  290. // 遮罩层
  291. loading: true,
  292. // 选中数组
  293. ids: [],
  294. // 非单个禁用
  295. single: true,
  296. // 非多个禁用
  297. multiple: true,
  298. // 显示搜索条件
  299. showSearch: false,
  300. // 总条数
  301. total: 0,
  302. // 公共盘文档表格数据
  303. publicdocList: [],
  304. // 弹出层标题
  305. title: "",
  306. //表头是否显示
  307. status: false,
  308. // 目录名称
  309. menuName: undefined,
  310. // 部门树选项
  311. deptOptions: undefined,
  312. //目录菜单
  313. menuOptions: undefined,
  314. clientHeight: 300,
  315. menuHeight: 300,
  316. // 是否显示弹出层
  317. open: false,
  318. // 用户导入参数
  319. upload: {
  320. //下载模板请求地址
  321. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  322. //下载模板类型
  323. type: 'publicdoc',
  324. // 是否显示弹出层(用户导入)
  325. open: false,
  326. // 弹出层标题(用户导入)
  327. title: "",
  328. // 是否禁用上传
  329. isUploading: false,
  330. // 是否更新已经存在的用户数据
  331. updateSupport: 0,
  332. // 设置上传的请求头部
  333. headers: { Authorization: "Bearer " + getToken() },
  334. // 上传的地址
  335. url: process.env.VUE_APP_BASE_API + "/document/publicdoc/importData"
  336. },
  337. // 报告附件参数
  338. doc: {
  339. file: "123",
  340. // 是否显示弹出层(报告附件)
  341. open: false,
  342. // 弹出层标题(报告附件)
  343. title: "",
  344. // 是否禁用上传
  345. isUploading: false,
  346. // 是否更新已经存在的用户数据
  347. updateSupport: 0,
  348. // 报告附件上传位置编号
  349. ids: 0,
  350. // 设置上传的请求头部
  351. headers: { Authorization: "Bearer " + getToken() },
  352. // 上传的地址
  353. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  354. commonfileList: null,
  355. queryParams: {
  356. pId: null,
  357. pType: 'publicdoc'
  358. },
  359. pType: 'publicdoc',
  360. pId: null
  361. },
  362. pdf : {
  363. title: '',
  364. pdfUrl: '',
  365. numPages: null,
  366. open: false,
  367. pageNum: 1,
  368. pageTotalNum: 1,
  369. loadedRatio: 0,
  370. },
  371. // 查询参数
  372. queryParams: {
  373. pageNum: 1,
  374. pageSize: 20,
  375. menuid: null
  376. },
  377. //查询目录参数
  378. queryMenu: {
  379. cataname: ""
  380. },
  381. // 表单参数
  382. form: {},
  383. // 表单校验
  384. rules: {
  385. filename: [
  386. { required: true, message: this.$t('文件名称') + this.$t('不能为空'), trigger: "blur" }
  387. ],
  388. menuid: [
  389. { required: true, message: this.$t('目录') + "ID" + this.$t('不能为空'), trigger: "blur" }
  390. ],
  391. deptId: [
  392. { required: true, message: this.$t('部门编号') + this.$t('不能为空'), trigger: "blur" }
  393. ]
  394. }
  395. };
  396. },
  397. watch: {
  398. menuName(val) {
  399. this.queryMenu.cataname = val
  400. this.getMenuList();
  401. }
  402. },
  403. created() {
  404. //设置表格高度对应屏幕高度
  405. this.$nextTick(() => {
  406. this.clientHeight = (document.body.clientHeight - 80) * 0.8
  407. this.menuHeight = document.body.clientHeight -200
  408. })
  409. this.getList();
  410. this.getTreeselect();
  411. this.getMenuList();
  412. },
  413. methods: {
  414. /** 查询公共盘文档列表 */
  415. getList() {
  416. this.loading = true;
  417. listPublicdoc(this.queryParams).then(response => {
  418. this.publicdocList = response.rows;
  419. this.total = response.total;
  420. this.loading = false;
  421. });
  422. },
  423. /** 查询部门下拉树结构 */
  424. getTreeselect() {
  425. treeselect().then(response => {
  426. this.deptOptions = response.data;
  427. });
  428. },
  429. /** 查询目录菜单 */
  430. getMenuList() {
  431. listMenu(this.queryMenu).then(response => {
  432. this.menuOptions = response;
  433. });
  434. },
  435. // 取消按钮
  436. cancel() {
  437. this.open = false;
  438. this.reset();
  439. },
  440. // 表单重置
  441. reset() {
  442. this.form = {
  443. id: null,
  444. filename: null,
  445. menuid: null,
  446. responsibility: null,
  447. action: null,
  448. location: null,
  449. frequency: null,
  450. filedate: null,
  451. delFlag: null,
  452. createrCode: null,
  453. createdate: null,
  454. updaterCode: null,
  455. updatedate: null,
  456. remarks: null,
  457. deptId: null
  458. };
  459. this.resetForm("form");
  460. },
  461. /** 搜索按钮操作 */
  462. handleQuery() {
  463. this.queryParams.pageNum = 1;
  464. console.info("1111")
  465. this.getList();
  466. },
  467. // 节点单击事件
  468. handleNodeClick(data) {
  469. this.queryParams.menuid = data.id;
  470. this.getList();
  471. },
  472. /** 重置按钮操作 */
  473. resetQuery() {
  474. this.resetForm("queryForm");
  475. this.handleQuery();
  476. },
  477. // 多选框选中数据
  478. handleSelectionChange(selection) {
  479. this.ids = selection.map(item => item.id)
  480. this.single = selection.length!==1
  481. this.multiple = !selection.length
  482. },
  483. /** 新增按钮操作 */
  484. handleAdd() {
  485. this.reset();
  486. this.open = true;
  487. this.title = this.$t('新增') + " " + this.$t('公共盘文档');
  488. },
  489. /** 修改按钮操作 */
  490. handleUpdate(row) {
  491. this.reset();
  492. const id = row.id || this.ids
  493. getPublicdoc(id).then(response => {
  494. this.form = response.data;
  495. this.open = true;
  496. this.title = this.$t('修改') + this.$t('公共盘文档');
  497. });
  498. },
  499. /** 修改左侧目录操作 */
  500. menuUpdate() {
  501. this.$router.push("/document/publicdocmenu");
  502. },
  503. /** 提交按钮 */
  504. submitForm() {
  505. this.$refs["form"].validate(valid => {
  506. if (valid) {
  507. if (this.form.id != null) {
  508. updatePublicdoc(this.form).then(response => {
  509. this.msgSuccess(this.$t('修改成功'));
  510. this.open = false;
  511. this.getList();
  512. });
  513. } else {
  514. addPublicdoc(this.form).then(response => {
  515. this.msgSuccess(this.$t('新增成功'));
  516. this.open = false;
  517. this.getList();
  518. });
  519. }
  520. }
  521. });
  522. },
  523. /** 删除按钮操作 */
  524. handleDelete(row) {
  525. const ids = row.id || this.ids;
  526. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  527. confirmButtonText: this.$t('确定'),
  528. cancelButtonText: this.$t('取消'),
  529. type: "warning"
  530. }).then(function() {
  531. return delPublicdoc(ids);
  532. }).then(() => {
  533. this.getList();
  534. this.msgSuccess(this.$t('删除成功'));
  535. })
  536. },
  537. /** 导出按钮操作 */
  538. handleExport() {
  539. const queryParams = this.queryParams;
  540. this.$confirm(this.$t('是否确认导出所有公共盘文档数据项?'), this.$t('警告'), {
  541. confirmButtonText: this.$t('确定'),
  542. cancelButtonText: this.$t('取消'),
  543. type: "warning"
  544. }).then(function() {
  545. return exportPublicdoc(queryParams);
  546. }).then(response => {
  547. this.download(response.msg);
  548. })
  549. },
  550. /** 导入按钮操作 */
  551. handleImport() {
  552. this.upload.title = this.$t('用户导入');
  553. this.upload.open = true;
  554. },
  555. /** 下载模板操作 */
  556. importTemplate() {
  557. this.$refs['downloadFileForm'].submit()
  558. },
  559. // 文件上传中处理
  560. handleFileUploadProgress(event, file, fileList) {
  561. this.upload.isUploading = true;
  562. },
  563. // 文件上传成功处理
  564. handleFileSuccess(response, file, fileList) {
  565. this.upload.open = false;
  566. this.upload.isUploading = false;
  567. this.$refs.upload.clearFiles();
  568. if (response.data[0] != null) {
  569. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败')+"。", this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  570. }else {
  571. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  572. }
  573. this.getList();
  574. },
  575. // 提交上传文件
  576. submitFileForm(val) {
  577. if(val == 1) {
  578. this.$refs.upload.submit();
  579. }
  580. },
  581. /** 报告附件按钮操作 */
  582. handleDoc(row) {
  583. this.doc.id = row.id;
  584. this.doc.title = row.filename;
  585. this.doc.open = true;
  586. this.doc.queryParams.pId = row.id
  587. this.doc.pId = row.id
  588. this.getFileList()
  589. this.$nextTick(() => {
  590. this.$refs.doc.clearFiles()
  591. })
  592. },
  593. getFileList (){
  594. allFileList(this.doc.queryParams).then(response => {
  595. this.doc.commonfileList = response;
  596. });
  597. },
  598. //附件上传中处理
  599. handleFileDocProgress(event, file, fileList) {
  600. this.doc.file = file;
  601. this.doc.isUploading = true;
  602. },
  603. //附件上传成功处理
  604. handleFileDocSuccess(response, file, fileList) {
  605. this.doc.isUploading = false;
  606. this.$alert(response.msg, this.$t('导入结果') , { dangerouslyUseHTMLString: true });
  607. this.getFileList()
  608. },
  609. //pdf预览
  610. handleSee (row){
  611. this.pdf.open =true
  612. this.pdf.pageNum = 1
  613. this.pdf.loadedRatio = 0
  614. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + row.fileUrl
  615. this.pdf.title = row.fileName
  616. let loadingTask = null
  617. loadingTask = pdf.createLoadingTask(this.pdf.pdfUrl)
  618. loadingTask.promise.then(pdf => {
  619. this.pdf.numPages = pdf.numPages
  620. }).catch(err => {
  621. this.msgError(this.$t('pdf加载失败'))
  622. })
  623. },
  624. // pdf上一页
  625. prePage() {
  626. let page = this.pdf.pageNum
  627. page = page > 1 ? page - 1 : this.pdf.pageTotalNum
  628. this.pdf.pageNum = page
  629. },
  630. // pdf下一页
  631. nextPage() {
  632. let page = this.pdf.pageNum
  633. page = page < this.pdf.pageTotalNum ? page + 1 : 1
  634. this.pdf.pageNum = page
  635. },
  636. /** 删除按钮操作 */
  637. handleDeleteDoc(row) {
  638. const ids = row.id || this.ids;
  639. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  640. confirmButtonText: this.$t('确定'),
  641. cancelButtonText: this.$t('取消'),
  642. type: "warning"
  643. }).then(function() {
  644. return delCommonfile(ids);
  645. }).then(() => {
  646. this.getFileList()
  647. this.msgSuccess(this.$t('删除成功'));
  648. })
  649. },
  650. // 文件下载处理
  651. handleDownload(row) {
  652. var name = row.fileName;
  653. var url = row.fileUrl;
  654. var suffix = url.substring(url.lastIndexOf("."), url.length);
  655. const a = document.createElement('a')
  656. a.setAttribute('download', name)
  657. a.setAttribute('target', '_blank')
  658. a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
  659. a.click()
  660. }
  661. }
  662. };
  663. </script>
  664. <style>
  665. #tradeLeft{
  666. width: 23%;
  667. padding: 20px;
  668. }
  669. /*chrome滚动条颜色设置*/
  670. *::-webkit-scrollbar {width:7px; height:10px; background-color:transparent;} /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
  671. *::-webkit-scrollbar-track {background-color:#f0f6ff; } /*定义滚动条轨道 内阴影+圆角*/
  672. *::-webkit-scrollbar-thumb {background-color:#d6d6d6; border-radius:6px;} /*定义滑块 内阴影+圆角*/
  673. .scrollbarHide::-webkit-scrollbar{display: none}
  674. .scrollbarShow::-webkit-scrollbar{display: block}
  675. .menuTable {
  676. cursor: pointer; /*鼠标悬停变小手*/
  677. }
  678. </style>