index.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863
  1. <template>
  2. <div class="ws-upload">
  3. <div v-if="!remarkWord">
  4. <el-button
  5. class="upload-btn"
  6. size="small"
  7. :disabled="disabled"
  8. type="default"
  9. @click="_handleUploadClick"
  10. >{{ buttonName ? buttonName : $t('upload.uploadButton') }}</el-button
  11. >
  12. </div>
  13. <div class="trigger-group" v-if="editable && remarkWord">
  14. <el-button
  15. class="upload-btn"
  16. size="small"
  17. :disabled="disabled"
  18. type="default"
  19. @click="_handleUploadClick"
  20. >{{ buttonName ? buttonName : $t('upload.uploadButton') }}</el-button
  21. >
  22. <!-- <el-tooltip class="item" effect="dark" :content="$t('upload.uploadText01')+formatTxt+'格式的文件,单个文件大小不能超过10M'" placement="top">
  23. <i class="el-icon-question"></i>
  24. </el-tooltip> -->
  25. <div class="tip">
  26. {{ $t('upload.uploadText01') }}
  27. {{ formatTxt}}
  28. 格式的文件,单个文件大小不能超过10M
  29. </div>
  30. </div>
  31. <div>
  32. <el-button
  33. v-if="batchDown"
  34. class="batchdown-btn"
  35. size="small"
  36. type="default"
  37. @click="_handleDownClick"
  38. >批量下载</el-button>
  39. </div>
  40. <el-upload
  41. action="#"
  42. list-type="picture-card"
  43. :http-request="_handleRequest"
  44. :file-list="fileList"
  45. :before-upload="_handleBeforeUpload"
  46. :accept="accept"
  47. :multiple="!limit || parseInt(limit) > 1"
  48. ref="elUpload"
  49. >
  50. <template v-slot:trigger>
  51. <div ref="triggerDiv">-</div>
  52. </template>
  53. <template v-slot:file="{ file }">
  54. <div class="thumbnail-group">
  55. <el-image v-if='getFileClass(file)=="ext png"||getFileClass(file)=="ext jpg"||getFileClass(file)=="ext jpeg"||getFileClass(file)=="ext JPG"||getFileClass(file)=="ext PNG"'
  56. :src='file.url'
  57. class="el-upload-list__item-thumbnail"
  58. :class="getFileClass(file)"
  59. :preview-src-list="file.imgurl">
  60. </el-image>
  61. <!-- <img
  62. /> -->
  63. <div v-else class="el-upload-list__item-thumbnail"
  64. :class="getFileClass(file)"></div>
  65. </div>
  66. <div class="fileName" v-if="showName" :title="file.name">
  67. {{ file.name }}
  68. </div>
  69. <span
  70. class="el-upload-list__item-actions"
  71. :class="!(file.status == 'success') ? 'operate-bg' : ''"
  72. v-if="file.status == 'success' && (editable || download)"
  73. >
  74. <span class="el-upload-list__item-delete">
  75. <i
  76. class="el-icon-view"
  77. v-if="
  78. isOnlineFile(file) &&
  79. download &&
  80. !isPictureFile(file) &&
  81. !onlineEdit
  82. "
  83. @click="_handleDownload(file, 'view')"
  84. ></i>
  85. <i
  86. class="el-icon-edit"
  87. v-if="onlineEdit"
  88. @click="_handleOnline(file)"
  89. ></i>
  90. <i
  91. class="el-icon-download"
  92. @click.stop="_handleDownload(file, 'down')"
  93. ></i>
  94. <i
  95. v-if="editable"
  96. class="el-icon-delete"
  97. @click.stop="_handleRemove(file)"
  98. ></i>
  99. </span>
  100. </span>
  101. </template>
  102. </el-upload>
  103. <BaseDialog
  104. v-drag
  105. :modal="false"
  106. :visible.sync="dialogVisible"
  107. @closed="_handlePreviewClosed"
  108. :title="downloadName"
  109. append-to-body
  110. >
  111. <img v-lazy="dialogImageUrl" width="100%" />
  112. </BaseDialog>
  113. <BaseDialog
  114. width="70%"
  115. :title="pdfFileName"
  116. :visible.sync="isShowPdf"
  117. :appendToBody="true"
  118. >
  119. <pdf :loadUrl="pdfUrl" v-if="isShowPdf" />
  120. </BaseDialog>
  121. </div>
  122. </template>
  123. <script>
  124. import { getFileList, saveFiles } from '@/model/upload'
  125. import { getOssInterimCredentials } from '@/model/procurement/spare'
  126. import { uuid } from '@/utils/assist'
  127. import downloadNow from '../WsDownload/download'
  128. import { EventBus } from 'base-core-lib'
  129. import pdf from '@/components/pdf/pdf'
  130. import { mapActions } from 'vuex'
  131. import JSZip from 'jszip';
  132. import FileSaver from 'file-saver';
  133. export default {
  134. name: 'WsUpload',
  135. components: {
  136. pdf,
  137. },
  138. props: {
  139. appendixIds: String,
  140. editable: {
  141. // 是否为编辑模式
  142. type: Boolean,
  143. default: true,
  144. },
  145. remarkWord: {
  146. // 是否有备注要求
  147. type: Boolean,
  148. default: true,
  149. },
  150. preview: {
  151. // 是否允许预览
  152. type: Boolean,
  153. default: true,
  154. },
  155. download: {
  156. // 是否允许下载
  157. type: Boolean,
  158. default: true,
  159. },
  160. showName: {
  161. // 是否显示文件名
  162. type: Boolean,
  163. default: true,
  164. },
  165. limit: {
  166. // 文件总数量限制
  167. type: Number,
  168. default: 50,
  169. },
  170. sizeLimit: {
  171. // 文件大小限制
  172. type: Number,
  173. default: undefined,
  174. },
  175. accept: {
  176. // 限制文件类型
  177. type: String,
  178. default:
  179. '.jpg, .jpeg, .png, .gif, .pdf, .doc, .docx, .xls, .xlsx, .zip, .rar, .eml, .mpeg, .avi, .asf, .wmv, .mpv, .rmvb, .rm, .flv, .mp4, .3pg, .ppt, .pptx, .txt',
  180. },
  181. ossKey: {
  182. type: String,
  183. required: false,
  184. },
  185. compId: {
  186. // 公司ID
  187. type: String,
  188. required: true,
  189. },
  190. vesselId: {
  191. // 船舶ID
  192. type: String,
  193. default: '',
  194. required: false,
  195. },
  196. tableName: {
  197. // 要保存的表的名字
  198. type: String,
  199. required: false,
  200. },
  201. batchDown: {
  202. // 要保存的表的名字
  203. type: String,
  204. required: false,
  205. },
  206. onlineEdit: false,
  207. disabled: false,
  208. buttonName: {
  209. // 要保存的表的名字
  210. type: String,
  211. },
  212. },
  213. data() {
  214. return {
  215. pdfUrl: '',
  216. pdfFileName: '',
  217. isShowPdf: false,
  218. // vesselBankFlag: localStorage.getItem("ws-pf_serviceTypeFlag") == "true" ? "B" : "V",
  219. vesselBankFlag: 'V',
  220. curFileNum: 0,
  221. tempFileList: [],
  222. initFileList: [],
  223. loading: false, // 是否正在初始化filelsit
  224. fileList: [],
  225. removeList: [],
  226. dialogImageUrl: '',
  227. dialogVisible: false,
  228. downloadName: '',
  229. loadingView: '', // loading弹出层
  230. uploadParams: {
  231. companyId: this.compId,
  232. basePath: '', //config.getUploadPath(this.ossKey, this.compId)
  233. },
  234. clientFag: localStorage.getItem('ws-pf_clientFag'),
  235. }
  236. },
  237. computed: {
  238. formatTxt() {
  239. console.log(this.accept)
  240. return this.accept
  241. .replace(/\./g, '')
  242. .replace(/ /g, '')
  243. .replace(/,/g, '、')
  244. },
  245. thisAppendixIds() {
  246. return this.appendixIds
  247. },
  248. _getFileImgs() {
  249. let arr = []
  250. for (let i of this.fileList) {
  251. if (this.isPictureFile(i)) {
  252. arr.push(i.url)
  253. }
  254. }
  255. return arr
  256. },
  257. },
  258. watch: {
  259. // 监听props.appendixIds, 变化时向服务器请求
  260. async thisAppendixIds(newV, oldV) {
  261. this.getDefaultFiles(newV)
  262. },
  263. },
  264. mounted() {
  265. this.getDefaultFiles(this.appendixIds)
  266. const handleChange = this.$refs.elUpload.$refs['upload-inner'].handleChange
  267. this.$refs.elUpload.$refs['upload-inner'].handleChange = (ev) => {
  268. this.initFileList = []
  269. this.curFileNum = ev.target.files.length
  270. for (let i = 0; i < this.curFileNum; i++) {
  271. this.initFileList.push(ev.target.files[i])
  272. this.tempFileList[i] = i
  273. }
  274. handleChange(ev)
  275. }
  276. },
  277. methods: {
  278. ...mapActions('common', ['uploadShipFiles']),
  279. //pdf预览
  280. async toOpen(scope) {
  281. const data = await this.getFileList({
  282. appendixIds: scope.row.filePathId,
  283. }).toPromise()
  284. let path = data[0] ? data[0].appendixPath : ''
  285. let filePath = this.$store.getters.baseInfo.fileUrl + '/' + path
  286. this.pdfUrl = filePath
  287. this.pdfFileName = scope.row.templateName
  288. this.isShowPdf = true
  289. },
  290. // handleChangeImage(file, fileList) {
  291. // console.info(file, fileList)
  292. // this.initFileList = fileList
  293. // this.tempFileList = fileList
  294. // },
  295. // 获取图片文件
  296. _getFileImg(file) {
  297. if (!file) {
  298. return ''
  299. }
  300. if (this.isPictureFile(file)) {
  301. if (file.url.indexOf('blob') === 0 || this.vesselBankFlag === 'V') {
  302. return file.url
  303. }
  304. return file.url + '?x-oss-process=image/resize,w_120,h_120'
  305. }
  306. return ''
  307. },
  308. async getDefaultFiles(appendixIds) {
  309. this.fileList = []
  310. if (appendixIds) {
  311. this.loading = true
  312. const list = await this._getFileList(appendixIds)
  313. this.loading = false
  314. if (list) {
  315. this.fileList = list.map((item, idx) => {
  316. return {
  317. appendixId: item.appendixId,
  318. name: item.appendixName,
  319. url: this.getFilePath(item.appendixPath),
  320. imgurl:[this.getFilePath(item.appendixPath)],
  321. uid: uuid(),
  322. }
  323. })
  324. }
  325. }
  326. },
  327. _handleDownClick(){
  328. console.log(this.fileList,111)
  329. var arr=[]
  330. for (let i = 0; i < this.fileList.length; i++) {
  331. arr.push(this.fileList[i].url+'?s=' + Math.random().toString())
  332. }
  333. let urls = arr
  334. let promises = [];
  335. urls.map((item) => {
  336. promises.push(this.getBase64Image(item));
  337. });
  338. Promise.all(promises)
  339. .then((result) => {
  340. let zip = new JSZip();// 创建压缩包
  341. let img = zip.folder("image"); // 创建文件夹
  342. let number = 0;
  343. result.map((p) => {
  344. let i = number++;
  345. img.file(`${i}.png`, p, {
  346. base64: true,
  347. });
  348. });
  349. zip.generateAsync({ type: "blob" }).then(function (content) {
  350. // see FileSaver.js
  351. FileSaver.saveAs(content, "image.zip");
  352. });
  353. })
  354. .catch((err) => {});
  355. },
  356. getBase64Image(src) {
  357. return new Promise(function (resolve, reject) {
  358. var canvas = document.createElement("canvas"),
  359. ctx = canvas.getContext("2d"),
  360. img = new Image();
  361. img.crossOrigin = "Access-Control-Allow-Origin";
  362. img.onload = function () {
  363. canvas.height = img.height;
  364. canvas.width = img.width;
  365. ctx.drawImage(img, 0, 0);
  366. var dataURL = canvas.toDataURL("image/png");
  367. let deleDataHeader = dataURL.split(",")[1];
  368. resolve(deleDataHeader);
  369. canvas = null;
  370. };
  371. //这个很重要
  372. img.src =src;
  373. });
  374. },
  375. // 处理上传按钮点击
  376. _handleUploadClick() {
  377. this.$refs.triggerDiv.click()
  378. },
  379. // 处理预览
  380. _handlePreview(file) {
  381. this.dialogImageUrl = file.url
  382. this.downloadName = file.name
  383. this.dialogVisible = true
  384. },
  385. // 处理预览关闭
  386. _handlePreviewClosed() {
  387. this.dialogImageUrl = ''
  388. this.downloadName = ''
  389. },
  390. // 处理删除
  391. _handleRemove(file) {
  392. if (file.appendixId) {
  393. // 这是要删除已经存在的附件
  394. const index = this.fileList.findIndex(
  395. (itm) => itm.appendixId === file.appendixId
  396. )
  397. this.fileList.splice(index, 1)
  398. this.removeList.push(file.appendixId)
  399. } else {
  400. // 这是删除已上传但还未保存的附件
  401. const index = this.fileList.findIndex((itm) => itm.uid === file.uid)
  402. this.fileList.splice(index, 1)
  403. }
  404. this.$emit('onChange', this.fileList.length)
  405. },
  406. // 自定义上传过程
  407. _handleRequest(param) {
  408. if (this.vesselBankFlag === 'V') {
  409. //船端
  410. this._uploadFilesShip(param)
  411. }
  412. },
  413. async _uploadFilesShip(param) {
  414. return new Promise(async (resolve, reject) => {
  415. this.showLoading()
  416. const file = param.file
  417. try {
  418. const data = await this.uploadShipFiles({
  419. file: file,
  420. companyId: this.compId || '',
  421. modelId: this.isNull(this.tableName)
  422. ? ''
  423. : this.tableName.split('_')[0],
  424. vesselId: this.vesselId || '',
  425. })
  426. this.$emit(
  427. 'uploadSuccess',
  428. data,
  429. file,
  430. this.getFilePath(data.appendixPath)
  431. )
  432. const item = {
  433. appendixName: data.appendixName,
  434. appendixPath: data.appendixPath,
  435. appendixSize: this.toKB(file.size),
  436. // appendixType: "V",
  437. appendixType:
  438. localStorage.getItem('ws-pf_serviceTypeFlag') == 'true'
  439. ? 'B'
  440. : 'V',
  441. fromTableName: this.tableName,
  442. vesselId: this.vesselId || '',
  443. uid: file.uid,
  444. url: this.getFilePath(data.appendixPath),
  445. name: file.name,
  446. }
  447. let fileIndex = this.getFileIndex(item.uid)
  448. if (fileIndex >= 0) {
  449. this.tempFileList.splice(fileIndex, 1, item)
  450. this._handleSuccessOnce()
  451. }
  452. resolve()
  453. } catch (error) {
  454. this.handleError()
  455. reject()
  456. }
  457. })
  458. },
  459. // 处理单个文件上传成功
  460. _handleSuccessOnce() {
  461. this.curFileNum--
  462. if (this.curFileNum === 0) {
  463. this.fileList.push.apply(
  464. this.fileList,
  465. this.tempFileList.filter((item) => {
  466. return !this.isNull(item.uid)
  467. })
  468. )
  469. this.tempFileList = []
  470. this.$emit('onChange', this.fileList.length)
  471. this.hideLoading()
  472. }
  473. },
  474. // 处理在线编辑
  475. _handleOnline(file) {
  476. window.open(
  477. process.env.VUE_APP_BASE_API +
  478. '/office/file?fileId=' +
  479. file.appendixId +
  480. '&showSaveFlag=1'
  481. )
  482. },
  483. // 处理下载
  484. _handleDownload(file, type) {
  485. if (this.isOnlineFile(file) && type === 'view') {
  486. this.pdfUrl =
  487. file.url || this.$store.getters.baseInfo.fileUrl + file.appendixPath
  488. this.pdfFileName = file.appendixName || file.name
  489. this.isShowPdf = true
  490. return
  491. }
  492. downloadNow(file.url+'?s=' + Math.random().toString(), file.name, this.vesselBankFlag, type)
  493. },
  494. _handleBeforeUpload(file) {
  495. let size = this.sizeLimit ? this.sizeLimit : 50
  496. if (file.size > size * 1024 * 1024) {
  497. EventBus.$emit('error', this.$t('showMessage.filesCannot') + size + 'M')
  498. return false
  499. }
  500. if (this.limit) {
  501. let limitFileNum = parseInt(this.limit)
  502. let currentFileNum = this.fileList.length + this.curFileNum
  503. if (limitFileNum > 1 && currentFileNum > limitFileNum) {
  504. this._handleExceed()
  505. return false
  506. }
  507. if (limitFileNum === 1) {
  508. this.fileList = []
  509. }
  510. }
  511. return true
  512. },
  513. //处理文件上传失败
  514. _handleError() {
  515. this.curFileNum--
  516. this.hideLoading()
  517. },
  518. _handleExceed() {
  519. EventBus.$emit('warning', `最多只能上传${this.limit}个文件`)
  520. },
  521. // 传入appendixIds 从服务器获取文件列表信息
  522. _getFileList(appendixIds) {
  523. return new Promise(async (next) => {
  524. try {
  525. next((await getFileList({ appendixIds }).toPromise()) || [])
  526. } catch (error) {
  527. next()
  528. }
  529. })
  530. },
  531. handleSaveBill() {
  532. return new Promise((resolve, reject) => {
  533. if (!this.removeList && this.fileList.length == 0) {
  534. resolve('')
  535. return
  536. }
  537. const oldAppendixIds = this.removeList.join()
  538. const newAppendixs = this.fileList
  539. const params = { newAppendixs, oldAppendixIds }
  540. // if (newAppendixs)
  541. saveFiles(params)
  542. .toPromise()
  543. .then((res) => {
  544. resolve(res.join())
  545. })
  546. .catch((err) => {
  547. EventBus.$emit('error', this.$t('showMessage.saveFilesError'))
  548. reject()
  549. })
  550. })
  551. },
  552. // 获取文件样式
  553. getFileClass(file) {
  554. const ext = this.getExtName(file.name)
  555. return 'ext ' + ext
  556. },
  557. // 是否为图片
  558. isPictureFile(file) {
  559. if (file && file.name) {
  560. const name = this.getExtName(file.name)
  561. return (
  562. name === 'jpg' ||
  563. name === 'png' ||
  564. name === 'jpeg' ||
  565. name === 'gif' ||
  566. name === 'webp' ||
  567. name === 'bmp' ||
  568. name === 'JPG' ||
  569. name === 'PNG' ||
  570. name === 'JPEG' ||
  571. name === 'GIF' ||
  572. name === 'WEBP' ||
  573. name === 'BMP'
  574. )
  575. }
  576. return false
  577. },
  578. // 是否为在线打开文件
  579. isOnlineFile(file) {
  580. if (file && file.name) {
  581. const name = this.getExtName(file.name)
  582. return name === 'pdf' || name === 'tet'
  583. }
  584. return false
  585. },
  586. getOssInter() {
  587. return new Promise(async (next) => {
  588. try {
  589. next(await getOssInterimCredentials().toPromise())
  590. } catch (error) {
  591. next()
  592. }
  593. })
  594. },
  595. getFileIndex(uid) {
  596. for (let i = 0; i < this.initFileList.length; i++) {
  597. if (this.initFileList[i].uid === uid) {
  598. return i
  599. }
  600. }
  601. return -1
  602. },
  603. // 显示loading
  604. showLoading() {
  605. this.loadingView = this.$loading({
  606. lock: true,
  607. text: 'Loading',
  608. spinner: 'el-icon-loading',
  609. background: 'rgba(0, 0, 0, 0.7)',
  610. target: document.querySelector('.div1'),
  611. })
  612. },
  613. // 隐藏loading
  614. hideLoading() {
  615. this.loadingView.close()
  616. },
  617. // 获取后缀名
  618. getExtName(url) {
  619. if (!url) {
  620. return url
  621. }
  622. url = url.substr(url.lastIndexOf('.') + 1)
  623. if (url.indexOf('?') >= 0) {
  624. url = url.substr(url.indexOf('?'))
  625. }
  626. return url
  627. },
  628. checkUrl(path) {
  629. if (path.indexOf('http://') > -1 || path.indexOf('https://') > -1) {
  630. let pathSplit = path.split('.com/')
  631. if (pathSplit) {
  632. path = pathSplit[1]
  633. }
  634. }
  635. return path
  636. },
  637. getFilePath(path) {
  638. // let sysUrl = process.env.NODE_ENV === "production"?"http://" + window.location.host+"/":"http://product-dev.winsea.com/";
  639. // let sysUrl = this.$store.getters.baseInfo.fileUrl
  640. // path = this.checkUrl(path)
  641. // if (this.clientFag === "B") {
  642. // // sysUrl+="pb/"
  643. // }
  644. // return sysUrl + this.slash(path)
  645. return path
  646. },
  647. // 字节转KB
  648. toKB(bt) {
  649. return (bt / 1024).toFixed(2) + 'KB'
  650. },
  651. clearFiles() {
  652. this.fileList = []
  653. },
  654. // 反斜杠转斜杠
  655. slash(str) {
  656. return str.replace(/\\/g, '/')
  657. },
  658. },
  659. }
  660. </script>
  661. <style lang="scss" scoped>
  662. $picture-size: 110px;
  663. $ctrl-margin-left: 10px;
  664. .archived-history
  665. .upButton
  666. /deep/
  667. .el-upload-list__item-delete:nth-last-of-type(1) {
  668. display: inline-block !important;
  669. }
  670. .el-button--default {
  671. border: 1px solid #5473e8;
  672. color: #5473e8;
  673. }
  674. .ws-upload {
  675. /*.upload-noramark-btn{*/
  676. /* padding: 0px;*/
  677. /* border: none;*/
  678. /*}*/
  679. padding-bottom: 10px;
  680. .trigger-group {
  681. margin-bottom: 10px;
  682. margin-top: 10px;
  683. .upload-btn {
  684. display: inline-block;
  685. border-radius: 4px;
  686. }
  687. .tip {
  688. // display: inline-block;
  689. margin: 0;
  690. padding: 0;
  691. font-size: 12px;
  692. line-height: 17px;
  693. color: #999;
  694. margin-bottom: 4px;
  695. margin-top: 4px;
  696. vertical-align: middle;
  697. white-space: initial;
  698. text-align: left;
  699. width: calc(100% - 100px);
  700. }
  701. }
  702. /deep/ .thumbnail-group {
  703. width: $picture-size;
  704. height: $picture-size;
  705. .el-upload-list__item-thumbnail {
  706. display: block;
  707. border-radius: 6px;
  708. border: 1px solid #ccd6e3;
  709. background-color: #fff;
  710. }
  711. }
  712. /deep/.winsea-picture-view ul {
  713. padding: 0;
  714. }
  715. /deep/ .el-upload-list__item-actions {
  716. height: $picture-size;
  717. overflow: hidden;
  718. border-radius: 6px;
  719. align-items: center;
  720. display: flex;
  721. justify-content: center;
  722. z-index: 100;
  723. height: 30px;
  724. top: 80px;
  725. }
  726. .fileName {
  727. font-size: 12px;
  728. color: #666;
  729. margin: 0;
  730. text-align: center;
  731. margin-top: 4px;
  732. margin-bottom: 4px;
  733. white-space: nowrap;
  734. overflow: hidden;
  735. text-overflow: ellipsis;
  736. }
  737. /deep/
  738. .el-upload-list--picture-card
  739. .el-upload-list__item-actions
  740. span
  741. + span {
  742. margin-left: $ctrl-margin-left;
  743. }
  744. /deep/ .el-upload.el-upload--picture-card {
  745. display: none;
  746. }
  747. /deep/ .el-upload-list__item {
  748. width: $picture-size;
  749. height: auto;
  750. border: 0;
  751. background: none;
  752. }
  753. .ws-upload-progress {
  754. width: 84%;
  755. top: 88px;
  756. }
  757. .ext {
  758. background-size: $picture-size * 0.7;
  759. background-repeat: no-repeat;
  760. background-position: center;
  761. }
  762. .doc {
  763. background-image: url('~@/assets/images/common/upload/doc.png');
  764. }
  765. .docx {
  766. background-image: url('~@/assets/images/common/upload/docx.png');
  767. }
  768. .eml {
  769. background-image: url('~@/assets/images/common/upload/eml.png');
  770. }
  771. .ppt {
  772. background-image: url('~@/assets/images/common/upload/PPT.png');
  773. }
  774. .pptx {
  775. background-image: url('~@/assets/images/common/upload/PPT.png');
  776. }
  777. .pdf {
  778. background-image: url('~@/assets/images/common/upload/pdf.png');
  779. }
  780. .txt {
  781. background-image: url('~@/assets/images/common/upload/txt.png');
  782. }
  783. .mp4,
  784. .avi,
  785. .mov,
  786. .rmvb,
  787. .rm,
  788. .flv {
  789. background-image: url('~@/assets/images/common/upload/video.jpg');
  790. background-size: $picture-size;
  791. }
  792. .rar {
  793. background-image: url('~@/assets/images/common/upload/rar.png');
  794. }
  795. .xls {
  796. background-image: url('~@/assets/images/common/upload/xls.png');
  797. }
  798. .xlsx {
  799. background-image: url('~@/assets/images/common/upload/xlsx.png');
  800. }
  801. .zip {
  802. background-image: url('~@/assets/images/common/upload/zip.png');
  803. }
  804. }
  805. // 取消ele动画
  806. /deep/ .el-list-leave-active {
  807. transition: all 0s;
  808. }
  809. /deep/ .el-list-enter-active {
  810. transition: all 0s;
  811. }
  812. /*.el-button--text{*/
  813. /* color: #666666;*/
  814. /*}*/
  815. /*.el-button--text:hover{*/
  816. /* color: #4a89f1;*/
  817. /*}*/
  818. /*.el-button--text:focus{*/
  819. /* color: #ffffff;*/
  820. /*}*/
  821. .operate-bg:hover {
  822. opacity: 0;
  823. }
  824. .batchdown-btn{
  825. margin-bottom:10px;
  826. }
  827. </style>