提交 8d6eb0c6 authored 作者: pengxiaohui's avatar pengxiaohui

视频上传增加loading

上级 a229ebb6
import { fileUpload } from '@/api/system'
export default function(blobInfo, succFun, failFun) {
const file = blobInfo.blob()
const formData = new window.FormData()
formData.append('file', file)
formData.append('type', 'image')
fileUpload(formData)
.then(response => {
const [first] = response.data
response.code === 0 ? succFun(first.full_path) : failFun(response.message)
})
.catch(response => {
failFun(response.message)
})
}
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
<script> <script>
import plugins from './plugins' import plugins from './plugins'
import toolbar from './toolbar' import toolbar from './toolbar'
// import ImageUpload from './imageUpload'
import imageUpload from './plugins/image' import imageUpload from './plugins/image'
import { mediaUpload, mediaResolver } from './plugins/media' import { mediaUpload, mediaResolver } from './plugins/media'
export default { export default {
......
import { fileUpload } from '@/api/system' import { fileUpload } from '@/api/system'
import { Message } from 'element-ui' import { Message, Loading } from 'element-ui'
/** /**
* 以分隔符截取字符串,并返回最后一个截取段 * 以分隔符截取字符串,并返回最后一个截取段
*/ */
...@@ -24,10 +24,18 @@ export function mediaUpload(callback, value, meta) { ...@@ -24,10 +24,18 @@ export function mediaUpload(callback, value, meta) {
if (file && file.name) { if (file && file.name) {
const suffix = splitStrLast(file.name, '.') const suffix = splitStrLast(file.name, '.')
if (['mp4'].includes(suffix)) { if (['mp4'].includes(suffix)) {
const loading = Loading.service({
lock: true,
text: '视频上传中',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)',
customClass: 'tinymce-el-loading'
})
const formData = new window.FormData() const formData = new window.FormData()
formData.append('file', file) formData.append('file', file)
formData.append('type', 'file') formData.append('type', 'file')
fileUpload(formData).then(res => { fileUpload(formData).then(res => {
loading.close()
if (res.code === 0 && res.data && res.data[0]) { if (res.code === 0 && res.data && res.data[0]) {
const [first] = res.data const [first] = res.data
callback(first.full_path, { title: first.title }) callback(first.full_path, { title: first.title })
......
...@@ -140,7 +140,10 @@ body { ...@@ -140,7 +140,10 @@ body {
} }
/* tinymce picker/popover z-index reset */ /* tinymce picker/popover z-index reset */
.tox-tinymce-aux{ .tox-tinymce-aux{
z-index:999999 !important; z-index:9999 !important;
}
.tinymce-el-message, .tinymce-el-loading{
z-index:10000 !important;
} }
/* page_container background */ /* page_container background */
.page_container{ .page_container{
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论