修改
This commit is contained in:
parent
540fc66405
commit
c539c2a3e4
@ -1,19 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<div
|
||||
class="user-info-head"
|
||||
:class="video.VideoPath ? 'wihi' : ''"
|
||||
@click="editCropper()"
|
||||
>
|
||||
<div class="user-info-head" :class="video.VideoPath ? 'wihi' : ''" @click="editCropper()">
|
||||
<video
|
||||
style="width: 208px; height: 208px"
|
||||
v-if="video.VideoPath"
|
||||
v-bind:src="video.VideoPath"
|
||||
class="avatar video-avatar"
|
||||
controls="controls"
|
||||
>
|
||||
您的浏览器不支持视频播放
|
||||
</video>
|
||||
>您的浏览器不支持视频播放</video>
|
||||
<img
|
||||
v-if="options.img"
|
||||
v-bind:src="options.img"
|
||||
@ -62,14 +56,8 @@
|
||||
v-bind:src="videoForm.showVideoPath"
|
||||
class="avatar video-avatar"
|
||||
controls="controls"
|
||||
>
|
||||
您的浏览器不支持视频播放
|
||||
</video>
|
||||
<img
|
||||
style="width: 100%; height: 100%"
|
||||
v-if="previews.url"
|
||||
:src="previews.url"
|
||||
/>
|
||||
>您的浏览器不支持视频播放</video>
|
||||
<img style="width: 100%; height: 100%" v-if="previews.url" :src="previews.url" />
|
||||
<div v-else></div>
|
||||
</div>
|
||||
<div
|
||||
@ -79,9 +67,7 @@
|
||||
types != 'posterPictureUrl' &&
|
||||
types != 'itemDirectoryUrl'
|
||||
"
|
||||
>
|
||||
请上传图片为800x800px的正方形
|
||||
</div>
|
||||
>请上传图片为800x800px的正方形</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<br />
|
||||
@ -128,9 +114,7 @@
|
||||
></el-button>
|
||||
</el-col>-->
|
||||
<el-col :lg="{ span: 2, offset: 20 }" :md="2">
|
||||
<el-button type="primary" size="small" @click="uploadImg()"
|
||||
>提 交</el-button
|
||||
>
|
||||
<el-button type="primary" size="small" @click="uploadImg()">提 交</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
@ -146,12 +130,11 @@ import {
|
||||
uploadVideoUrl,
|
||||
uploadTrainingCategoryPicture,
|
||||
updatePoserHeads,
|
||||
uploadUrl,
|
||||
uploadUrl
|
||||
} from "@/api/system/stationAvatar.js";
|
||||
|
||||
export default {
|
||||
components: { VueCropper },
|
||||
|
||||
props: ["img", "type", "item", "tovideo"],
|
||||
data() {
|
||||
return {
|
||||
@ -168,17 +151,17 @@ export default {
|
||||
autoCrop: true, // 是否默认生成截图框
|
||||
autoCropWidth: 300, // 默认生成截图框宽度
|
||||
autoCropHeight: 300, // 默认生成截图框高度
|
||||
fixedBox: true, // 固定截图框大小 不允许改变
|
||||
fixedBox: true // 固定截图框大小 不允许改变
|
||||
},
|
||||
previews: {},
|
||||
items: {},
|
||||
//显示上传按钮
|
||||
videoForm: {
|
||||
showVideoPath: null, //回显的变量
|
||||
showVideoPath: null //回显的变量
|
||||
},
|
||||
video: {
|
||||
VideoPath: null, //回显的变量
|
||||
},
|
||||
VideoPath: null //回显的变量
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -206,12 +189,12 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
tovideo: {
|
||||
handler(newimg, oldimg) {},
|
||||
handler(newimg, oldimg) {}
|
||||
},
|
||||
item: {
|
||||
handler(newimg, oldimg) {
|
||||
this.items = this.item;
|
||||
},
|
||||
}
|
||||
},
|
||||
img: {
|
||||
handler(newimg, oldimg) {
|
||||
@ -222,13 +205,13 @@ export default {
|
||||
} else {
|
||||
this.options.img = baseurl + this.img;
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
type: {
|
||||
handler(newimg, oldimg) {
|
||||
this.types = this.type;
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 编辑头像
|
||||
@ -288,12 +271,13 @@ export default {
|
||||
formData.append("file", this.previews.data);
|
||||
formData.append("type", this.types);
|
||||
if (this.types == "itemDirectoryUrl") {
|
||||
uploadVideoUrl(formData).then((response) => {
|
||||
this.$modal.msgSuccess("上传视频中,请耐心等待");
|
||||
uploadVideoUrl(formData).then(response => {
|
||||
this.video.VideoPath = baseurl + response.imgUrl;
|
||||
this.$emit("imgUrl", response.imgUrl);
|
||||
this.items.itemDirectoryUrl = response.imgUrl;
|
||||
this.$emit("item", JSON.stringify(this.items));
|
||||
console.log(this.video,this.options)
|
||||
console.log(this.video, this.options);
|
||||
this.openimg = false;
|
||||
});
|
||||
} else if (
|
||||
@ -301,25 +285,25 @@ export default {
|
||||
this.types == "trainingItemContentUrl" ||
|
||||
this.types == "trainingItemPosterUrl"
|
||||
) {
|
||||
uploadUrl(formData).then((response) => {
|
||||
uploadUrl(formData).then(response => {
|
||||
this.options.img = baseurl + response.imgUrl;
|
||||
this.$emit("imgUrl", response.imgUrl);
|
||||
this.openimg = false;
|
||||
});
|
||||
} else if (this.types == "trainingCategoryPictureUrl") {
|
||||
uploadTrainingCategoryPicture(formData).then((response) => {
|
||||
uploadTrainingCategoryPicture(formData).then(response => {
|
||||
this.options.img = baseurl + response.imgUrl;
|
||||
this.$emit("imgUrl", response.imgUrl);
|
||||
this.openimg = false;
|
||||
});
|
||||
} else if (this.types == "posterVideoUrl") {
|
||||
updatePoserHeads(formData).then((response) => {
|
||||
updatePoserHeads(formData).then(response => {
|
||||
this.video.VideoPath = baseurl + response.imgUrl;
|
||||
this.$emit("imgUrl", response.imgUrl);
|
||||
this.openimg = false;
|
||||
});
|
||||
} else {
|
||||
updateNurseStationHeads(formData).then((response) => {
|
||||
updateNurseStationHeads(formData).then(response => {
|
||||
this.options.img = baseurl + response.imgUrl;
|
||||
this.$emit("imgUrl", response.imgUrl);
|
||||
if (this.types == "attributePitureUrl") {
|
||||
@ -361,8 +345,8 @@ export default {
|
||||
closeDialog() {
|
||||
this.imgs = "";
|
||||
this.visible = false;
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user