|
|
|
@ -732,6 +732,10 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
if (e.target.files.length) { |
|
|
|
|
let maxSize = 30 * 1024 * 1024 //限制30MB
|
|
|
|
|
let file = e.target.files[0] |
|
|
|
|
if (isVideo && !file.name.toLowerCase().includes(".mp4") && !file.name.toLowerCase().includes(".ogg") && !file.name.toLowerCase().includes(".webm")) { //视频格式限制
|
|
|
|
|
this.message.info("上传视频限制为mp4/ogg/webm格式"); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if (file.size > maxSize) { //超出限制
|
|
|
|
|
this.message.info("上传资源需小于30MB"); |
|
|
|
|
return |
|
|
|
@ -739,7 +743,7 @@ export class PlanComponent implements OnInit {
|
|
|
|
|
this.isShowLoading = true //打开遮罩
|
|
|
|
|
let institutionKey = `${this.companyData.id}` || "ceshi"; //单位id
|
|
|
|
|
let resType = isVideo ? ResType.Video : ResType.Texture |
|
|
|
|
let key = `${(new Date()).getMonth() + 1}-${(new Date()).getDate()}-${(new Date()).getHours()}` |
|
|
|
|
let key = `${(new Date()).getFullYear()}-${(new Date()).getMonth() + 1}-${(new Date()).getDate()}-${(new Date()).getHours()}` |
|
|
|
|
let url = DataManager.getResPath_mark(institutionKey, resType, key) //url
|
|
|
|
|
ServeManager.instance.openFileSelect(file, url, (name: string, path: string) => { //上传
|
|
|
|
|
if (!isVideo) { //img
|
|
|
|
|