From c205de44f60c42dc1fc75b1dab32bbdd971534d9 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 28 十月 2024 16:33:57 +0800
Subject: [PATCH] l
---
admin/src/components/operation/HiddenDangerParam.vue | 47 ++++++++++++++++++++++++++++++++++++++---------
1 files changed, 38 insertions(+), 9 deletions(-)
diff --git a/admin/src/components/operation/HiddenDangerParam.vue b/admin/src/components/operation/HiddenDangerParam.vue
index c8bfb1a..18cc589 100644
--- a/admin/src/components/operation/HiddenDangerParam.vue
+++ b/admin/src/components/operation/HiddenDangerParam.vue
@@ -61,6 +61,7 @@
:action="uploadImgUrl"
:show-file-list="false"
:on-success="uploadAvatarSuccess"
+ :on-error="uploadError"
:before-upload="beforeUpload"
>
<div class="upload_wrap">
@@ -101,10 +102,11 @@
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import UploadFaceImg from '@/components/common/UploadFaceImg'
+import dayjs from 'dayjs'
import { allList, memberList } from '@/api/business/hiddenDangerParam'
import { create } from '@/api/business/hiddenDanger'
+import { Loading } from 'element-ui'
export default {
- name: 'OperaVisitsHkWindow',
extends: BaseOpera,
components: {
GlobalWindow
@@ -112,6 +114,7 @@
data () {
return {
isShowModal: false,
+ loadingInstance: false,
param: {},
userInfo: this.$store.state.userInfo,
uploadImgUrl: process.env.VUE_APP_API_PREFIX + '/visitsAdmin/cloudService/public/uploadBatch',
@@ -135,6 +138,7 @@
}
},
created () {
+ this.$set(this.param, 'submitTime', dayjs().format('YYYY-MM-DD HH:mm:ss'))
this.initData()
},
methods: {
@@ -156,6 +160,8 @@
const memberNames = item.memberNames.split(',')
if (memberIds && memberIds.length === 1) {
this.$set(this.param, 'checkUserId', memberIds[0])
+ } else {
+ this.$set(this.param, 'checkUserId', '')
}
memberIds.forEach((mem, i) => {
arr.push({
@@ -166,23 +172,41 @@
this.memberList = arr
},
beforeUpload (file) {
- if (['video/mp4', 'video/ogg', 'video/flv', 'video/avi', 'video/wmv', 'video/rmvb', 'image/jpeg', 'image/png', 'image/gif'].indexOf(file.type) == -1) {
+ if (['video/mp4', 'video/ogg', 'video/flv', 'video/avi', 'video/wmv', 'video/rmvb', 'image/jpeg','image/jpg', 'image/png', 'image/gif'].indexOf(file.type) == -1) {
this.$message.error('璇蜂笂浼犳纭殑瑙嗛/鍥剧墖鏍煎紡')
return false
}
+ this.loadingInstance = Loading.service({
+ lock: true,
+ text: 'Loading',
+ spinner: 'el-icon-loading',
+ background: 'rgba(0, 0, 0, 0.7)'
+ })
+ },
+ uploadError() {
+ this.$nextTick(() => { // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂�
+ if(this.loadingInstance){
+ this.loadingInstance.close()
+ }
+ })
},
uploadAvatarSuccess (file) {
+ this.$nextTick(() => { // 浠ユ湇鍔$殑鏂瑰紡璋冪敤鐨� Loading 闇�瑕佸紓姝ュ叧闂�
+ if(this.loadingInstance){
+ this.loadingInstance.close()
+ }
+ })
console.log('file', file)
const item = file.data[0]
- if (['.mp4', '.avi', '.flv', '.wmv'].indexOf(item.imgaddr) === -1) {
+ if (['.mp4', '.avi', '.flv', '.wmv'].some(char => item.imgaddr.includes(char))) {
this.fileList.push({
- type: 0,
+ type: 1,
fileurl: item.imgaddr,
fileurlFull: item.url
})
} else {
this.fileList.push({
- type: 1,
+ type: 0,
fileurl: item.imgaddr,
fileurlFull: item.url
})
@@ -253,10 +277,15 @@
display: flex;
flex-wrap: wrap;
.item {
- width: 90px;
- max-height: 90px;
+ width: 92px;
+ max-height: 92px;
margin-left: 10px;
position: relative;
+ border: 1px dashed #d9d9d9;
+ border-radius: 4px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
.close{
font-size: 20px;
position: absolute;
@@ -267,8 +296,8 @@
cursor: pointer;
}
.img {
- width: 90px;
- max-height: 90px;
+ width: 92px;
+ max-height: 92px;
}
}
}
--
Gitblit v1.9.3