Browse Source

删除文件

master
yunuo970428 2 years ago
parent
commit
afa4b933c8
  1. 178
      anrui-riskcenter-ui/src/components/uploadFile/FaImages.vue
  2. 155
      anrui-riskcenter-ui/src/components/uploadFile/FileUpload.vue
  3. 132
      anrui-riskcenter-ui/src/components/uploadFile/ImageUpload.vue
  4. 159
      anrui-riskcenter-ui/src/components/uploadFile/ImageUploadChe.vue
  5. 229
      anrui-riskcenter-ui/src/components/uploadFile/ManyImageUpload.vue
  6. 116
      anrui-riskcenter-ui/src/components/uploadFile/index.vue
  7. 194
      anrui-riskcenter-ui/src/components/uploadFile/upload.vue

178
anrui-riskcenter-ui/src/components/uploadFile/FaImages.vue

@ -1,178 +0,0 @@
<template>
<div>
<div>
<el-upload v-loading="loadding" ref="imgUpload" class="avatar-uploader" :headers="accessToken" :action="uploadFile" accept=".jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP" list-type="picture-card" :file-list="files" :on-remove="removeImage" :on-preview="handlePictureCardPreview" :on-progress="uploadProgrees" :on-error="uploadError" :on-success="uploadImgSuccess_FuJian">
<i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
<el-dialog :visible.sync="showpicture" :append-to-body="true" title="查看图片">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</template>
<script>
import { imageUpload } from '@/api/portal/Upload.js'
import { mapGetters } from 'vuex'
export default {
model: {
prop: 'imageFileList',
event: 'fileListChange',
},
props: {
placeholder: {
type: String,
default: '',
},
//
width: {
type: String,
default: '270px',
},
//
imageFileList: {
type: Array,
required: [],
},
num: {
type: String,
default: '',
},
},
data() {
return {
dialogImageUrl: '',
accessToken: {},
fileUrl: fileUrl,
uploadFile: imageUpload,
files: [],
showpicture: false,
loadding: false,
}
},
computed: {
...mapGetters([
'id',
'departmentCode',
'departmentLevel',
'departmentType',
'token',
]),
},
watch: {
imageFileList: {
deep: true,
handler(newVal, oldVal) {
this.files = []
for (var i = 0; i < newVal.length; i++) {
this.files.push({
name: newVal[i].name,
url: fileUrl + newVal[i].url,
})
}
},
},
},
mounted() {
this.$nextTick(() => {
this.Init()
})
},
created() {
if (this.imageFileList !== undefined) {
this.files = []
for (var i = 0; i < this.imageFileList.length; i++) {
this.files.push({
name: this.imageFileList[i].name,
url: fileUrl + this.imageFileList[i].url,
})
}
}
},
methods: {
//
Init() {
//
// 1. token
this.accessToken = {
accessToken: this.token,
}
}, // --
uploadImgSuccess_FuJian(response, file, ImageFileList) {
this.loadding = false
if (file.response.code === 20000) {
//
var imageUrl = this.fileUrl + file.response.data
var uid = file.response.data
this.files.push({ name: file.name, url: imageUrl })
var fileList = []
for (var i = 0; i < this.files.length; i++) {
console.log(this.files[i].url, 'this.files[i].url')
fileList.push({
name: this.files[i].name,
url: this.files[i].url.substr(this.fileUrl.length),
num: this.num,
})
}
this.$emit('fileListChange', fileList)
}
},
removeImage(file, ImageFileList) {
this.files.splice(this.files.indexOf(file), 1)
var fileList = []
for (var i = 0; i < this.files.length; i++) {
fileList.push({
name: this.files[i].name,
url: this.files[i].url.substr(this.fileUrl.length),
})
}
this.$emit('fileListChange', fileList)
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.showpicture = true
},
//
uploadError() {
this.loadding = false
},
uploadProgrees(event, file, fileList) {
if (Number(event.percent) > 0) {
this.loadding = true
}
// console.log('event:', event)
},
},
}
</script>
<style lang="scss" scoped>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 100px;
height: 250px;
line-height: 100px;
text-align: center;
}
.avatar {
width: 200px;
height: 200px;
display: block;
// float: left;
}
</style>

155
anrui-riskcenter-ui/src/components/uploadFile/FileUpload.vue

@ -1,155 +0,0 @@
<template>
<div>
<el-upload class="upload-demo" :data="datas" :accept="accept" :on-success="uploadImgSuccess"
:on-change="handleChange" :on-remove="handleRemove" :file-list="fileList_FuJian"
:http-request="uploadSectionFile">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">单个文件大小不允许超过100M,支持上传文件类型{{ accept }}</div>
</el-upload>
</div>
</template>
<script>
import {
uploadFile
} from '@/api/business/beiAn'
import {
mapGetters
} from 'vuex'
export default {
props: {
placeholder: {
type: String,
default: '',
},
//
width: {
type: String,
default: '270px',
},
accept: {
type: String,
default: '.jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP,.PDF,.xls,.docx,.xlsx,.ppt,.pptx',
},
//
files: {
type: String,
required: true,
},
//
name: {
type: String,
required: true,
},
},
data() {
return {
datas: null,
name:null,
accessToken: {},
fileList_FuJian: [],
enclosure: '',
file_add: '',
idsz: '',
file_catch: '',
files_list: [],
}
},
computed: {
...mapGetters([
'id',
'departmentCode',
'departmentLevel',
'departmentType',
'token',
]),
},
watch: {
// files: {
// deep: true,
// handler(val) {
// this.pageLoad(val, '')
// },
// },
},
creatd() {
},
mounted() {
this.$nextTick(() => {})
},
methods: {
handleChange(file, fileList) {},
//
pageLoad(files) {
// console.log('' + files)
if (files !== null && files !== '') {
this.files_list = JSON.parse(files)
var ids = ''
this.fileList_FuJian = []
// 1.
for (var i = 0; i < this.files_list.length; i++) {
var body = {
name: this.files_list[i].name,
url: '',
status: 'finished',
}
this.fileList_FuJian.push(body)
ids = ids + this.files_list[i].id + ','
}
// 2. id
if (ids !== '') {
ids = ids.substring(0, ids.length - 1)
}
this.enclosure = ids
this.file_catch = ids
} else {
this.file_add = ''
this.file_catch = ''
this.enclosure = ''
this.files_list = []
this.fileList_FuJian = []
}
},
// --
uploadImgSuccess(response, file, fileList) {
this.$emit('change', this.enclosure)
},
handleRemove(file, fileList) {
if (this.idsz != '') {
this.$emit('handleRemove', this.idsz)
}
},
// FrontPhoto
uploadSectionFile(params) {
const file = params.file
//
const form = new FormData()
// console.log('77777777777777',form)
//
form.append('file', file)
//
uploadFile(form).then((res) => {
//
if (res.code === '200') {
let a = ''
a = res.data.filePath
this.idsz = a
this.$emit('handleSuccess', res)
}
if (res.msg == '操作成功') {
this.$message({
message: '上传成功!',
type: 'success',
})
}
})
.catch((err) => {
console.log(err)
// ,
})
},
},
}
</script>
<style lang="scss" scoped></style>

132
anrui-riskcenter-ui/src/components/uploadFile/ImageUpload.vue

@ -1,132 +0,0 @@
<template>
<el-upload ref="upload" class="avatar-uploader" action="imageUrl" :show-file-list="true" list-type="picture-card"
:data="datas" :on-change="uploadchangeFile" :http-request="uploadSectionFile" :on-remove="onRemove">
<i class="el-icon-plus" />
<img v-if="FrontPhoto" :src="FrontPhoto" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon" />
<div slot="tip" class="el-upload__tip">{{ tip }}</div>
</el-upload>
</template>
<script>
// import { imageUpload } from '@/api/portal/Upload.js'
import {
imgUploadz
} from '@/api/jichuxinxi/baseaffiliatcompany' //
export default {
props: {
tip: {
type: String,
default: '',
},
types: {
type: String,
default: '',
},
},
data() {
return {
FrontPhoto: '',
imageUrl: imgUploadz,
datas: null,
imgId: '',
}
},
created() {
console.log('5522555',types)
this.datas = {
type: this.types
}
},
methods: {
// FrontPhoto
uploadSectionFile(params) {
// console.log(params, 111111111111)
const file = params.file
const fileType = file.type
const isImage = fileType.indexOf('image') != -1
const isLt2M = file.size / 1024 / 1024 < 2
// console.log(params)
//
if (!isImage) {
this.$message.error('只能上传图片格式png、jpg、gif、jpeg!')
return
}
if (!isLt2M) {
this.$message.error('只能上传图片大小小于2M')
return
}
//
const form = new FormData()
// console.log(form)
//
form.append('file', file)
// '',
imgUploadz(form).then((res) => {
//
if (res.code === '200') {
this.imgId = ''
res.data.attachType = this.types
this.imgId = res.data.filePath
this.$emit('imgdata', res)
}
// this.FrontPhoto = res.fullUrl
if (res.msg == '操作成功') {
this.$message({
message: '上传成功!',
type: 'success',
})
}
})
.catch((err) => {
console.log(err)
})
},
onRemove() {
if (this.imgId != '') {
this.$emit('removeIds', this.imgId)
}
},
uploadchangeFile(file) {
this.FrontPhoto = URL.createObjectURL(file.raw)
},
},
}
</script>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 200px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
.el-upload__tip {
line-height: 25px;
margin-top: 0;
}
</style>

159
anrui-riskcenter-ui/src/components/uploadFile/ImageUploadChe.vue

@ -1,159 +0,0 @@
<template>
<el-upload ref="upload" class="avatar-uploader" action="imageUrl" :show-file-list="true" list-type="picture-card" :data="datas" :on-change="uploadchangeFile" :http-request="uploadSectionFile" :on-remove="onRemove">
<i class="el-icon-plus" />
<img v-if="FrontPhoto" :src="FrontPhoto" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon" />
<div slot="tip" class="el-upload__tip">{{ tip }}</div>
</el-upload>
</template>
<script>
import { imageUpload } from '@/api/portal/Upload.js'
import { imgUploadz } from '@/api/jichuxinxi/baseaffiliatcompany' //
export default {
props: {
tip: {
type: String,
default: ''
},
types: {
type: String,
default: ''
},
linkChange: {
type: String,
default: ''
}
},
data() {
return {
FrontPhoto: '',
imageUrl: imgUploadz,
datas: null,
imgId: ''
}
},
created() {
this.datas = { type: this.types }
console.log(this.linkChange, 111111111111)
// console.log(this.datas, 11)
},
methods: {
// FrontPhoto
uploadSectionFile(params) {
// console.log(params, 111111111111)
const file = params.file
const fileType = file.type
const isImage = fileType.indexOf('image') != -1
const isLt2M = file.size / 1024 / 1024 < 2
// console.log(params)
//
if (!isImage) {
this.$message.error('只能上传图片格式png、jpg、gif、jpeg!')
return
}
if (!isLt2M) {
this.$message.error('只能上传图片大小小于2M')
return
}
//
const form = new FormData()
// console.log(form)
//
form.append('file', file)
// '',
//
if (this.linkChange == '') {
imageUpload(form)
.then((res) => {
//
if (res.code === '200') {
this.imgId = ''
res.data.attachType = this.types
this.imgId = res.data.filePath
this.$emit('imgdata', res)
}
// this.FrontPhoto = res.fullUrl
if (res.msg == '操作成功') {
this.$message({
message: '上传成功!',
type: 'success'
})
}
})
.catch((err) => {
console.log(err)
})
// ,
}
// else if (this.linkChange == 'keepOnRecord') {
// imageUpload(form)
// .then((res) => {
// //
// if (res.code === '200') {
// this.imgId = ''
// res.data.attachType = this.types
// this.imgId = res.data.filePath
// this.$emit('imgdata', res)
// }
// // this.FrontPhoto = res.fullUrl
// if (res.msg == '') {
// this.$message({
// message: '',
// type: 'success',
// })
// }
// })
// .catch((err) => {
// console.log(err)
// })
// }
},
onRemove() {
if (this.imgId != '') {
this.$emit('removeIds', this.imgId)
}
},
uploadchangeFile(file) {
this.FrontPhoto = URL.createObjectURL(file.raw)
}
}
}
</script>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 200px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
.el-upload__tip {
line-height: 25px;
margin-top: 0;
}
</style>

229
anrui-riskcenter-ui/src/components/uploadFile/ManyImageUpload.vue

@ -1,229 +0,0 @@
<template>
<div>
<div>
<el-upload ref="imgUpload" v-loading="loadding" class="avatar-uploader" :headers="accessToken"
:action="uploadFile" accept=".jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP" list-type="picture-card"
:file-list="files" :on-remove="removeImage" :on-preview="handlePictureCardPreview" :on-progress="uploadProgrees"
:on-error="uploadError" :on-success="uploadImgSuccess_FuJian">
<i class="el-icon-plus avatar-uploader-icon" />
</el-upload>
<!-- <button @click="test()">test</button> -->
</div>
<el-dialog :visible.sync="showpicture" :append-to-body="true" title="查看图片">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
</div>
</template>
<script>
import {
uploadFile,
deleteFilesOss
} from '@/api/portal/Upload.js'
import {
getStorage
} from '@/utils/auth.js'
import {
mapGetters
} from 'vuex'
export default {
model: {
prop: 'imageFileList',
event: 'fileListChange'
},
props: {
placeholder: {
type: String,
default: ''
},
//
width: {
type: String,
default: '270px'
},
// --
imageFileList: {
type: Array,
required: []
},
num: {
type: String,
default: ''
}
},
data() {
return {
dialogImageUrl: '',
accessToken: null,
uploadFile: uploadFile,
files: [],
showpicture: false,
loadding: false
}
},
computed: {
...mapGetters([
'id',
'departmentCode',
'departmentLevel',
'departmentType',
'token'
])
},
watch: {
imageFileList: {
deep: true,
immediate: true,
handler(newVal, oldVal) {
// debugger
console.log('aaaa1', newVal)
this.files = []
this.$nextTick(() => {
for (var i = 0; i < newVal.length; i++) {
// debugger
this.files.push({
name: newVal[i],
url: newVal[i],
// fullUrl: newVal[i]
})
}
})
}
}
},
mounted() {
this.$nextTick(() => {
this.Init()
})
},
created() {
this.uploadFile = uploadFile //
this.accessToken = {
'token': getStorage()
}
console.log('token', this.accessToken)
// console.log('imageFileList', this.imageFileList)
},
methods: {
//
Init() {
// 1. token
// this.accessToken = {
// token: this.token
// }
//
console.log('aaaa2', this.imageFileList)
if (this.imageFileList !== undefined) {
this.files = []
for (var i = 0; i < this.imageFileList.length; i++) {
// console.log('aaaa', i)
this.files.push({
name: this.imageFileList[i],
url: this.imageFileList[i]
})
}
}
}, // --
uploadImgSuccess_FuJian(response, file, ImageFileList) {
console.log('上传成功!',this.imageFileList)
// debugger
this.loadding = false
if (file.response.code === '200') {
// debugger
//
this.dialogImageUrl = file.response.data.fullUrl
var uid = file.response.data
this.files.push({
name: file.response.data.sourceFileName,
url: file.response.data.fullUrl,
// url: file.response.data.fullUrl,
// fullUrl: file.response.data.filePath,
// size: file.response.data.size,
// sourceFileName: file.response.data.sourceFileName
})
const imgFiles = []
this.files.forEach(o => {
imgFiles.push(o.url)
})
this.$emit('fileListChange', imgFiles)
console.log('上传成功:' + JSON.stringify(this.files))
// this.$emit('fileChange', this.files)
}
},
removeImage(file, ImageFileList) {
const fullPath = {
fullPath:file.url
}
deleteFilesOss(fullPath).then((res)=>{
console.log('移除',res)
if(res.code === '200'){
this.files = res.data
this.$notify({
title: '提示',
message: '移除成功',
type: 'success',
duration: 2000,
})
}
})
console.log('000000',this.files)
this.$emit('fileChange', this.files)
console.log(file,ImageFileList,'移除前')
this.imageFileList.forEach((e,index)=>{
if(e==file.name){
this.imageFileList.splice(index,1)
}
})
console.log('移除成功',this.imageFileList)
},
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url
this.showpicture = true
},
//
uploadError() {
this.loadding = false
},
uploadProgrees(event, file, fileList) {
if (Number(event.percent) > 0) {
this.loadding = true
}
// console.log('event:', event)
},
test() {
console.log('aaa', this.files)
this.$set(this.files, this.files)
}
}
}
</script>
<style lang="scss" scoped>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 100px;
height: 250px;
line-height: 100px;
text-align: center;
}
.avatar {
width: 200px;
height: 200px;
display: block;
// float: left;
}
</style>

116
anrui-riskcenter-ui/src/components/uploadFile/index.vue

@ -1,116 +0,0 @@
<template>
<el-upload class="avatar-uploader" ref="upload" :action="fakeaction" :show-file-list="false" :on-change="uploadchangeFile" :http-request="uploadSectionFile">
<!-- <el-button size="small" type="primary">点击上传</el-button> -->
<img v-if="Photo" :src="Photo" class="avatar">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
<div slot="tip" class="el-upload__tip">{{tip}}</div>
</el-upload>
</template>
<script>
import { imageUpload } from '@/api/Common/Upload.js'
export default {
props: {
tip: {
type: String,
default: '',
},
FrontPhoto: {
type: String,
default: '',
},
},
data() {
return {
Photo: this.FrontPhoto,
loading: null,
}
},
methods: {
openFullScreen2() {
this.loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)',
})
},
// FrontPhoto
uploadSectionFile(params) {
const file = params.file,
fileType = file.type,
isImage = fileType.indexOf('image') != -1,
isLt2M = file.size / 1024 / 1024 < 10
this.openFullScreen2()
console.log(params)
//
if (!isImage) {
this.$message.error('只能上传图片格式png、jpg、gif!')
this.loading.close()
return
}
if (!isLt2M) {
this.$message.error('只能上传图片大小小于10M')
this.loading.close()
return
}
//
const form = new FormData()
console.log(form)
//
form.append('file', file)
//
imageUpload(form)
.then((res) => {
//
console.log(res)
this.$emit('imgUrl', res.data)
this.Photo = res.data.fullUrl
if (res.code == 200) {
this.loading.close()
this.$message({
message: '上传成功!',
type: 'success',
})
}
})
.catch((err) => {
console.log(err)
})
},
uploadchangeFile(file) {
// this.Photo = URL.createObjectURL(file.raw)
},
},
}
</script>
<style>
.avatar-uploader .el-upload {
border: 1px dashed #d9d9d9;
border-radius: 6px;
cursor: pointer;
position: relative;
overflow: hidden;
}
.avatar-uploader .el-upload:hover {
border-color: #409eff;
}
.avatar-uploader-icon {
font-size: 28px;
color: #8c939d;
width: 200px;
height: 178px;
line-height: 178px;
text-align: center;
}
.avatar {
width: 178px;
height: 178px;
display: block;
}
</style>

194
anrui-riskcenter-ui/src/components/uploadFile/upload.vue

@ -1,194 +0,0 @@
<template>
<div>
<el-upload class="upload-demo" :data="datas" :accept="accept" :on-success="uploadImgSuccess" :on-change="handleChange" :on-remove="handleRemove" :file-list="fileList_FuJian" :http-request="uploadSectionFile">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">单个文件大小不允许超过100M,支持上传文件类型{{ accept }}</div>
</el-upload>
</div>
</template>
<script>
import { imgUploadz } from '@/api/jichuxinxi/baseaffiliatcompany'
import { mapGetters } from 'vuex'
export default {
props: {
placeholder: {
type: String,
default: '',
},
//
width: {
type: String,
default: '270px',
},
accept: {
type: String,
default:
'.jpg,.jpeg,.png,.bmp,.pdf,.JPG,.JPEG,.BMP,.PDF,.xls,.docx,.xlsx,.ppt,.pptx',
},
//
files: {
type: String,
required: true,
},
//
name: {
type: String,
required: true,
},
types:{
type:String,
required: true,
},
linkChange: {
type: String,
default: '',
},
},
data() {
return {
datas: null,
types:types,
accessToken: {},
fileList_FuJian: [],
enclosure: '',
file_add: '',
idsz: '',
file_catch: '',
files_list: [],
}
},
computed: {
...mapGetters([
'id',
'departmentCode',
'departmentLevel',
'departmentType',
'token',
]),
},
watch: {
files: {
deep: true,
handler(val) {
this.pageLoad(val, '')
},
},
},
creatd() {
this.datas = { type: this.types }
// console.log(this.datas,7777777)
console.log(this.type, '船只被')
},
mounted() {
this.$nextTick(() => {
// this.Init()
})
},
methods: {
//
Init() {
// 1. token
// this.accessToken = {
// token: this.token,
// }
this.pageLoad(this.files)
},
handleChange(file, fileList) {
},
//
pageLoad(files) {
// console.log('' + files)
if (files !== null && files !== '') {
this.files_list = JSON.parse(files)
var ids = ''
this.fileList_FuJian = []
// 1.
for (var i = 0; i < this.files_list.length; i++) {
var body = {
name: this.files_list[i].name,
url: '',
status: 'finished',
}
this.fileList_FuJian.push(body)
ids = ids + this.files_list[i].id + ','
}
// 2. id
if (ids !== '') {
ids = ids.substring(0, ids.length - 1)
}
this.enclosure = ids
this.file_catch = ids
} else {
this.file_add = ''
this.file_catch = ''
this.enclosure = ''
this.files_list = []
this.fileList_FuJian = []
}
},
// --
uploadImgSuccess(response, file, fileList) {
// console.log('fileList:' + JSON.stringify(fileList))
// this.enclosure = ''
// 1. id(this.file_add)
// this.getNewFileId(fileList)
// 2. id
// this.getFileId()
// console.log('4. ' + this.enclosure)
// 3. id
this.$emit('change', this.enclosure)
},
handleRemove(file, fileList) {
// console.log('file:' + JSON.stringify(file))
// console.log('fileList:' + JSON.stringify(fileList))
// this.enclosure = ''
// 1. id(this.file_add)
// this.getNewFileId(fileList)
// 2. id(this.file_catch)
// this.getCatchFileId(file)
// 3. id
// this.getFileId()
// 4. id
if (this.idsz != '') {
this.$emit('handleRemove', this.idsz)
}
},
// FrontPhoto
uploadSectionFile(params) {
const file = params.file
//
const form = new FormData()
console.log('77777777777777',form)
//
form.append('file', file)
//
console.log('988888',form.append)
imgUploadz(form).then((res) => {
//
if (res.code === '200') {
res.data.attachType = this.types
let a = ''
a = res.data.filePath
this.idsz = a
this.$emit('handleSuccess', res)
}
// this.FrontPhoto = res.fullUrl
if (res.msg == '操作成功') {
this.$message({
message: '上传成功!',
type: 'success',
})
}
})
.catch((err) => {
console.log(err)
// ,
})
},
},
}
</script>
<style lang="scss" scoped></style>
Loading…
Cancel
Save