index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886
  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. perview(row){
  296. const typeArr = ['doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx']
  297. let arr=row.url.split('.')
  298. let fileType=arr[arr.length-1]
  299. let url = ''
  300. if (typeArr.indexOf(fileType) !== -1) {
  301. // 使用微软的office online
  302. url='http://view.xdocin.com/xdoc?_xdoc='+row.url
  303. } else {
  304. url = row.url
  305. }
  306. // window.open()居中打开
  307. const width = 1000; const height = 800
  308. const top = (window.screen.availHeight - height) / 2
  309. const left = (window.screen.availWidth - width) / 2
  310. window.open(url, '', 'width=' + width + ',height=' + height + ',top=' + top + ',left=' + left)
  311. },
  312. // 获取图片文件
  313. _getFileImg(file) {
  314. if (!file) {
  315. return ''
  316. }
  317. if (this.isPictureFile(file)) {
  318. if (file.url.indexOf('blob') === 0 || this.vesselBankFlag === 'V') {
  319. return file.url
  320. }
  321. return file.url + '?x-oss-process=image/resize,w_120,h_120'
  322. }
  323. return ''
  324. },
  325. async getDefaultFiles(appendixIds) {
  326. this.fileList = []
  327. if (appendixIds) {
  328. this.loading = true
  329. const list = await this._getFileList(appendixIds)
  330. this.loading = false
  331. if (list) {
  332. this.fileList = list.map((item, idx) => {
  333. return {
  334. appendixId: item.appendixId,
  335. name: item.appendixName,
  336. url: this.getFilePath(item.appendixPath),
  337. imgurl:[this.getFilePath(item.appendixPath)],
  338. uid: uuid(),
  339. }
  340. })
  341. }
  342. }
  343. },
  344. _handleDownClick(){
  345. console.log(this.fileList,111)
  346. var arr=[]
  347. for (let i = 0; i < this.fileList.length; i++) {
  348. arr.push(this.fileList[i].url+'?s=' + Math.random().toString())
  349. }
  350. let urls = arr
  351. let promises = [];
  352. urls.map((item) => {
  353. promises.push(this.getBase64Image(item));
  354. });
  355. Promise.all(promises)
  356. .then((result) => {
  357. let zip = new JSZip();// 创建压缩包
  358. let img = zip.folder("image"); // 创建文件夹
  359. let number = 0;
  360. result.map((p) => {
  361. let i = number++;
  362. img.file(`${i}.png`, p, {
  363. base64: true,
  364. });
  365. });
  366. zip.generateAsync({ type: "blob" }).then(function (content) {
  367. // see FileSaver.js
  368. FileSaver.saveAs(content, "image.zip");
  369. });
  370. })
  371. .catch((err) => {});
  372. },
  373. getBase64Image(src) {
  374. return new Promise(function (resolve, reject) {
  375. var canvas = document.createElement("canvas"),
  376. ctx = canvas.getContext("2d"),
  377. img = new Image();
  378. img.crossOrigin = "Access-Control-Allow-Origin";
  379. img.onload = function () {
  380. canvas.height = img.height;
  381. canvas.width = img.width;
  382. ctx.drawImage(img, 0, 0);
  383. var dataURL = canvas.toDataURL("image/png");
  384. let deleDataHeader = dataURL.split(",")[1];
  385. resolve(deleDataHeader);
  386. canvas = null;
  387. };
  388. //这个很重要
  389. img.src =src;
  390. });
  391. },
  392. // 处理上传按钮点击
  393. _handleUploadClick() {
  394. this.$refs.triggerDiv.click()
  395. },
  396. // 处理预览
  397. _handlePreview(file) {
  398. this.dialogImageUrl = file.url
  399. this.downloadName = file.name
  400. this.dialogVisible = true
  401. },
  402. // 处理预览关闭
  403. _handlePreviewClosed() {
  404. this.dialogImageUrl = ''
  405. this.downloadName = ''
  406. },
  407. // 处理删除
  408. _handleRemove(file) {
  409. if (file.appendixId) {
  410. // 这是要删除已经存在的附件
  411. const index = this.fileList.findIndex(
  412. (itm) => itm.appendixId === file.appendixId
  413. )
  414. this.fileList.splice(index, 1)
  415. this.removeList.push(file.appendixId)
  416. } else {
  417. // 这是删除已上传但还未保存的附件
  418. const index = this.fileList.findIndex((itm) => itm.uid === file.uid)
  419. this.fileList.splice(index, 1)
  420. }
  421. this.$emit('onChange', this.fileList.length,this.fileList)
  422. },
  423. // 自定义上传过程
  424. _handleRequest(param) {
  425. if (this.vesselBankFlag === 'V') {
  426. //船端
  427. this._uploadFilesShip(param)
  428. }
  429. },
  430. async _uploadFilesShip(param) {
  431. return new Promise(async (resolve, reject) => {
  432. this.showLoading()
  433. const file = param.file
  434. try {
  435. const data = await this.uploadShipFiles({
  436. file: file,
  437. companyId: this.compId || '',
  438. modelId: this.isNull(this.tableName)
  439. ? ''
  440. : this.tableName.split('_')[0],
  441. vesselId: this.vesselId || '',
  442. })
  443. this.$emit(
  444. 'uploadSuccess',
  445. data,
  446. file,
  447. this.getFilePath(data.appendixPath)
  448. )
  449. const item = {
  450. appendixName: data.appendixName,
  451. appendixPath: data.appendixPath,
  452. appendixSize: this.toKB(file.size),
  453. // appendixType: "V",
  454. appendixType:
  455. localStorage.getItem('ws-pf_serviceTypeFlag') == 'true'
  456. ? 'B'
  457. : 'V',
  458. fromTableName: this.tableName,
  459. vesselId: this.vesselId || '',
  460. uid: file.uid,
  461. url: this.getFilePath(data.appendixPath),
  462. name: file.name,
  463. }
  464. let fileIndex = this.getFileIndex(item.uid)
  465. if (fileIndex >= 0) {
  466. this.tempFileList.splice(fileIndex, 1, item)
  467. this._handleSuccessOnce()
  468. }
  469. resolve()
  470. } catch (error) {
  471. this.handleError()
  472. reject()
  473. }
  474. })
  475. },
  476. // 处理单个文件上传成功
  477. _handleSuccessOnce() {
  478. this.curFileNum--
  479. if (this.curFileNum === 0) {
  480. this.fileList.push.apply(
  481. this.fileList,
  482. this.tempFileList.filter((item) => {
  483. return !this.isNull(item.uid)
  484. })
  485. )
  486. this.tempFileList = []
  487. this.$emit('onChange', this.fileList.length,this.fileList)
  488. this.hideLoading()
  489. }
  490. },
  491. // 处理在线编辑
  492. _handleOnline(file) {
  493. window.open(
  494. process.env.VUE_APP_BASE_API +
  495. '/office/file?fileId=' +
  496. file.appendixId +
  497. '&showSaveFlag=1'
  498. )
  499. },
  500. // 处理下载
  501. _handleDownload(file, type) {
  502. if (this.isOnlineFile(file) && type === 'view') {
  503. console.log(file)
  504. if(file.name.indexOf('pdf')!=-1||file.name.indexOf('tet')!=-1){
  505. this.pdfUrl =
  506. file.url || this.$store.getters.baseInfo.fileUrl + file.appendixPath
  507. this.pdfFileName = file.appendixName || file.name
  508. this.isShowPdf = true
  509. return
  510. }else{
  511. this.perview(file)
  512. return
  513. }
  514. }
  515. downloadNow(file.url+'?s=' + Math.random().toString(), file.name, this.vesselBankFlag, type)
  516. },
  517. _handleBeforeUpload(file) {
  518. let size = this.sizeLimit ? this.sizeLimit : 50
  519. if (file.size > size * 1024 * 1024) {
  520. EventBus.$emit('error', this.$t('showMessage.filesCannot') + size + 'M')
  521. return false
  522. }
  523. if (this.limit) {
  524. let limitFileNum = parseInt(this.limit)
  525. let currentFileNum = this.fileList.length + this.curFileNum
  526. if (limitFileNum > 1 && currentFileNum > limitFileNum) {
  527. this._handleExceed()
  528. return false
  529. }
  530. if (limitFileNum === 1) {
  531. this.fileList = []
  532. }
  533. }
  534. return true
  535. },
  536. //处理文件上传失败
  537. _handleError() {
  538. this.curFileNum--
  539. this.hideLoading()
  540. },
  541. _handleExceed() {
  542. EventBus.$emit('warning', `最多只能上传${this.limit}个文件`)
  543. },
  544. // 传入appendixIds 从服务器获取文件列表信息
  545. _getFileList(appendixIds) {
  546. return new Promise(async (next) => {
  547. try {
  548. next((await getFileList({ appendixIds }).toPromise()) || [])
  549. } catch (error) {
  550. next()
  551. }
  552. })
  553. },
  554. handleSaveBill() {
  555. return new Promise((resolve, reject) => {
  556. if (!this.removeList && this.fileList.length == 0) {
  557. resolve('')
  558. return
  559. }
  560. const oldAppendixIds = this.removeList.join()
  561. const newAppendixs = this.fileList
  562. const params = { newAppendixs, oldAppendixIds }
  563. // if (newAppendixs)
  564. saveFiles(params)
  565. .toPromise()
  566. .then((res) => {
  567. resolve(res.join())
  568. })
  569. .catch((err) => {
  570. EventBus.$emit('error', this.$t('showMessage.saveFilesError'))
  571. reject()
  572. })
  573. })
  574. },
  575. // 获取文件样式
  576. getFileClass(file) {
  577. const ext = this.getExtName(file.name).toLowerCase()
  578. return 'ext ' + ext
  579. },
  580. // 是否为图片
  581. isPictureFile(file) {
  582. if (file && file.name) {
  583. const name = this.getExtName(file.name)
  584. return (
  585. name === 'jpg' ||
  586. name === 'png' ||
  587. name === 'jpeg' ||
  588. name === 'gif' ||
  589. name === 'webp' ||
  590. name === 'bmp' ||
  591. name === 'JPG' ||
  592. name === 'PNG' ||
  593. name === 'JPEG' ||
  594. name === 'GIF' ||
  595. name === 'WEBP' ||
  596. name === 'BMP'
  597. )
  598. }
  599. return false
  600. },
  601. // 是否为在线打开文件
  602. isOnlineFile(file) {
  603. if (file && file.name) {
  604. const name = this.getExtName(file.name)
  605. return name === 'pdf' || name === 'tet'|| name === 'docx'
  606. }
  607. return false
  608. },
  609. getOssInter() {
  610. return new Promise(async (next) => {
  611. try {
  612. next(await getOssInterimCredentials().toPromise())
  613. } catch (error) {
  614. next()
  615. }
  616. })
  617. },
  618. getFileIndex(uid) {
  619. for (let i = 0; i < this.initFileList.length; i++) {
  620. if (this.initFileList[i].uid === uid) {
  621. return i
  622. }
  623. }
  624. return -1
  625. },
  626. // 显示loading
  627. showLoading() {
  628. this.loadingView = this.$loading({
  629. lock: true,
  630. text: 'Loading',
  631. spinner: 'el-icon-loading',
  632. background: 'rgba(0, 0, 0, 0.7)',
  633. target: document.querySelector('.div1'),
  634. })
  635. },
  636. // 隐藏loading
  637. hideLoading() {
  638. this.loadingView.close()
  639. },
  640. // 获取后缀名
  641. getExtName(url) {
  642. if (!url) {
  643. return url
  644. }
  645. url = url.substr(url.lastIndexOf('.') + 1)
  646. if (url.indexOf('?') >= 0) {
  647. url = url.substr(url.indexOf('?'))
  648. }
  649. return url
  650. },
  651. checkUrl(path) {
  652. if (path.indexOf('http://') > -1 || path.indexOf('https://') > -1) {
  653. let pathSplit = path.split('.com/')
  654. if (pathSplit) {
  655. path = pathSplit[1]
  656. }
  657. }
  658. return path
  659. },
  660. getFilePath(path) {
  661. // let sysUrl = process.env.NODE_ENV === "production"?"http://" + window.location.host+"/":"http://product-dev.winsea.com/";
  662. // let sysUrl = this.$store.getters.baseInfo.fileUrl
  663. // path = this.checkUrl(path)
  664. // if (this.clientFag === "B") {
  665. // // sysUrl+="pb/"
  666. // }
  667. // return sysUrl + this.slash(path)
  668. return path
  669. },
  670. // 字节转KB
  671. toKB(bt) {
  672. return (bt / 1024).toFixed(2) + 'KB'
  673. },
  674. clearFiles() {
  675. this.fileList = []
  676. },
  677. // 反斜杠转斜杠
  678. slash(str) {
  679. return str.replace(/\\/g, '/')
  680. },
  681. },
  682. }
  683. </script>
  684. <style lang="scss" scoped>
  685. $picture-size: 110px;
  686. $ctrl-margin-left: 10px;
  687. .archived-history
  688. .upButton
  689. /deep/
  690. .el-upload-list__item-delete:nth-last-of-type(1) {
  691. display: inline-block !important;
  692. }
  693. .el-button--default {
  694. border: 1px solid #5473e8;
  695. color: #5473e8;
  696. }
  697. .ws-upload {
  698. /*.upload-noramark-btn{*/
  699. /* padding: 0px;*/
  700. /* border: none;*/
  701. /*}*/
  702. padding-bottom: 10px;
  703. .trigger-group {
  704. margin-bottom: 10px;
  705. margin-top: 10px;
  706. .upload-btn {
  707. display: inline-block;
  708. border-radius: 4px;
  709. }
  710. .tip {
  711. // display: inline-block;
  712. margin: 0;
  713. padding: 0;
  714. font-size: 12px;
  715. line-height: 17px;
  716. color: #999;
  717. margin-bottom: 4px;
  718. margin-top: 4px;
  719. vertical-align: middle;
  720. white-space: initial;
  721. text-align: left;
  722. width: calc(100% - 100px);
  723. }
  724. }
  725. /deep/ .thumbnail-group {
  726. width: $picture-size;
  727. height: $picture-size;
  728. .el-upload-list__item-thumbnail {
  729. display: block;
  730. border-radius: 6px;
  731. border: 1px solid #ccd6e3;
  732. background-color: #fff;
  733. }
  734. }
  735. /deep/.winsea-picture-view ul {
  736. padding: 0;
  737. }
  738. /deep/ .el-upload-list__item-actions {
  739. height: $picture-size;
  740. overflow: hidden;
  741. border-radius: 6px;
  742. align-items: center;
  743. display: flex;
  744. justify-content: center;
  745. z-index: 100;
  746. height: 30px;
  747. top: 80px;
  748. }
  749. .fileName {
  750. font-size: 12px;
  751. color: #666;
  752. margin: 0;
  753. text-align: center;
  754. margin-top: 4px;
  755. margin-bottom: 4px;
  756. white-space: nowrap;
  757. overflow: hidden;
  758. text-overflow: ellipsis;
  759. }
  760. /deep/
  761. .el-upload-list--picture-card
  762. .el-upload-list__item-actions
  763. span
  764. + span {
  765. margin-left: $ctrl-margin-left;
  766. }
  767. /deep/ .el-upload.el-upload--picture-card {
  768. display: none;
  769. }
  770. /deep/ .el-upload-list__item {
  771. width: $picture-size;
  772. height: auto;
  773. border: 0;
  774. background: none;
  775. }
  776. .ws-upload-progress {
  777. width: 84%;
  778. top: 88px;
  779. }
  780. .ext {
  781. background-size: $picture-size * 0.7;
  782. background-repeat: no-repeat;
  783. background-position: center;
  784. }
  785. .doc {
  786. background-image: url('~@/assets/images/common/upload/doc.png');
  787. }
  788. .docx,.DocX,.DOCX {
  789. background-image: url('~@/assets/images/common/upload/docx.png');
  790. }
  791. .eml {
  792. background-image: url('~@/assets/images/common/upload/eml.png');
  793. }
  794. .ppt {
  795. background-image: url('~@/assets/images/common/upload/PPT.png');
  796. }
  797. .pptx {
  798. background-image: url('~@/assets/images/common/upload/PPT.png');
  799. }
  800. .pdf {
  801. background-image: url('~@/assets/images/common/upload/pdf.png');
  802. }
  803. .txt {
  804. background-image: url('~@/assets/images/common/upload/txt.png');
  805. }
  806. .mp4,
  807. .avi,
  808. .mov,
  809. .rmvb,
  810. .rm,
  811. .flv {
  812. background-image: url('~@/assets/images/common/upload/video.jpg');
  813. background-size: $picture-size;
  814. }
  815. .rar {
  816. background-image: url('~@/assets/images/common/upload/rar.png');
  817. }
  818. .xls {
  819. background-image: url('~@/assets/images/common/upload/xls.png');
  820. }
  821. .xlsx {
  822. background-image: url('~@/assets/images/common/upload/xlsx.png');
  823. }
  824. .zip {
  825. background-image: url('~@/assets/images/common/upload/zip.png');
  826. }
  827. }
  828. // 取消ele动画
  829. /deep/ .el-list-leave-active {
  830. transition: all 0s;
  831. }
  832. /deep/ .el-list-enter-active {
  833. transition: all 0s;
  834. }
  835. /*.el-button--text{*/
  836. /* color: #666666;*/
  837. /*}*/
  838. /*.el-button--text:hover{*/
  839. /* color: #4a89f1;*/
  840. /*}*/
  841. /*.el-button--text:focus{*/
  842. /* color: #ffffff;*/
  843. /*}*/
  844. .operate-bg:hover {
  845. opacity: 0;
  846. }
  847. .batchdown-btn{
  848. margin-bottom:10px;
  849. }
  850. </style>