修改提交
This commit is contained in:
parent
bbc2a09197
commit
f8b09a14f0
@ -1,19 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div class="user-info-head" :class="video.VideoPath ? 'wihi' : ''" @click="editCropper()">
|
||||||
class="user-info-head"
|
|
||||||
:class="video.VideoPath ? 'wihi' : ''"
|
|
||||||
@click="editCropper()"
|
|
||||||
>
|
|
||||||
<video
|
<video
|
||||||
style="width: 208px; height: 208px"
|
style="width: 208px; height: 208px"
|
||||||
v-if="video.VideoPath"
|
v-if="video.VideoPath"
|
||||||
v-bind:src="video.VideoPath"
|
v-bind:src="video.VideoPath"
|
||||||
class="avatar video-avatar"
|
class="avatar video-avatar"
|
||||||
controls="controls"
|
controls="controls"
|
||||||
>
|
>您的浏览器不支持视频播放</video>
|
||||||
您的浏览器不支持视频播放
|
|
||||||
</video>
|
|
||||||
<img
|
<img
|
||||||
v-if="options.img"
|
v-if="options.img"
|
||||||
v-bind:src="options.img"
|
v-bind:src="options.img"
|
||||||
@ -61,14 +55,8 @@
|
|||||||
v-bind:src="videoForm.showVideoPath"
|
v-bind:src="videoForm.showVideoPath"
|
||||||
class="avatar video-avatar"
|
class="avatar video-avatar"
|
||||||
controls="controls"
|
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 v-else></div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
@ -78,9 +66,7 @@
|
|||||||
types != 'posterPictureUrl' &&
|
types != 'posterPictureUrl' &&
|
||||||
types != 'itemDirectoryUrl'
|
types != 'itemDirectoryUrl'
|
||||||
"
|
"
|
||||||
>
|
>请上传图片为800x800px的正方形</div>
|
||||||
请上传图片为800x800px的正方形
|
|
||||||
</div>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<br />
|
<br />
|
||||||
@ -127,16 +113,8 @@
|
|||||||
></el-button>
|
></el-button>
|
||||||
</el-col>-->
|
</el-col>-->
|
||||||
<el-col :lg="{ span: 2, offset: 19 }" :md="2">
|
<el-col :lg="{ span: 2, offset: 19 }" :md="2">
|
||||||
<el-button
|
<el-button v-if="uploadbtn" type="primary" size="small" @click="uploadImg()">提 交</el-button>
|
||||||
v-if="uploadbtn"
|
<el-button v-else :loading="!uploadbtn" type="primary" size="small">提 交 中...</el-button>
|
||||||
type="primary"
|
|
||||||
size="small"
|
|
||||||
@click="uploadImg()"
|
|
||||||
>提 交</el-button
|
|
||||||
>
|
|
||||||
<el-button v-else :loading="!uploadbtn" type="primary" size="small"
|
|
||||||
>提 交 中...</el-button
|
|
||||||
>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -152,7 +130,7 @@ import {
|
|||||||
uploadVideoUrl,
|
uploadVideoUrl,
|
||||||
uploadTrainingCategoryPicture,
|
uploadTrainingCategoryPicture,
|
||||||
updatePoserHeads,
|
updatePoserHeads,
|
||||||
uploadUrl,
|
uploadUrl
|
||||||
} from "@/api/system/stationAvatar.js";
|
} from "@/api/system/stationAvatar.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -174,17 +152,17 @@ export default {
|
|||||||
autoCrop: true, // 是否默认生成截图框
|
autoCrop: true, // 是否默认生成截图框
|
||||||
autoCropWidth: 300, // 默认生成截图框宽度
|
autoCropWidth: 300, // 默认生成截图框宽度
|
||||||
autoCropHeight: 300, // 默认生成截图框高度
|
autoCropHeight: 300, // 默认生成截图框高度
|
||||||
fixedBox: true, // 固定截图框大小 不允许改变
|
fixedBox: true // 固定截图框大小 不允许改变
|
||||||
},
|
},
|
||||||
previews: {},
|
previews: {},
|
||||||
items: {},
|
items: {},
|
||||||
//显示上传按钮
|
//显示上传按钮
|
||||||
videoForm: {
|
videoForm: {
|
||||||
showVideoPath: null, //回显的变量
|
showVideoPath: null //回显的变量
|
||||||
},
|
},
|
||||||
video: {
|
video: {
|
||||||
VideoPath: null, //回显的变量
|
VideoPath: null //回显的变量
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -212,12 +190,12 @@ export default {
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
tovideo: {
|
tovideo: {
|
||||||
handler(newimg, oldimg) {},
|
handler(newimg, oldimg) {}
|
||||||
},
|
},
|
||||||
item: {
|
item: {
|
||||||
handler(newimg, oldimg) {
|
handler(newimg, oldimg) {
|
||||||
this.items = this.item;
|
this.items = this.item;
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
img: {
|
img: {
|
||||||
handler(newimg, oldimg) {
|
handler(newimg, oldimg) {
|
||||||
@ -228,13 +206,13 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.options.img = baseurl + this.img;
|
this.options.img = baseurl + this.img;
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
handler(newimg, oldimg) {
|
handler(newimg, oldimg) {
|
||||||
this.types = this.type;
|
this.types = this.type;
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 编辑头像
|
// 编辑头像
|
||||||
@ -297,7 +275,7 @@ export default {
|
|||||||
if (this.types == "itemDirectoryUrl") {
|
if (this.types == "itemDirectoryUrl") {
|
||||||
this.$modal.msgSuccess("上传视频中,请耐心等待");
|
this.$modal.msgSuccess("上传视频中,请耐心等待");
|
||||||
this.uploadbtn = false;
|
this.uploadbtn = false;
|
||||||
uploadVideoUrl(formData).then((response) => {
|
uploadVideoUrl(formData).then(response => {
|
||||||
if (response.code == 200) {
|
if (response.code == 200) {
|
||||||
this.video.VideoPath = baseurl + response.imgUrl;
|
this.video.VideoPath = baseurl + response.imgUrl;
|
||||||
this.$emit("imgUrl", response.imgUrl);
|
this.$emit("imgUrl", response.imgUrl);
|
||||||
@ -305,8 +283,7 @@ export default {
|
|||||||
this.$emit("item", JSON.stringify(this.items));
|
this.$emit("item", JSON.stringify(this.items));
|
||||||
this.openimg = false;
|
this.openimg = false;
|
||||||
} else {
|
} else {
|
||||||
this.$emit("item", "false");
|
setTimeout(e => {
|
||||||
setTimeout((e) => {
|
|
||||||
this.openimg = false;
|
this.openimg = false;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
@ -317,32 +294,44 @@ export default {
|
|||||||
this.types == "trainingItemContentUrl" ||
|
this.types == "trainingItemContentUrl" ||
|
||||||
this.types == "trainingItemPosterUrl"
|
this.types == "trainingItemPosterUrl"
|
||||||
) {
|
) {
|
||||||
uploadUrl(formData).then((response) => {
|
uploadUrl(formData).then(response => {
|
||||||
if (response.code == 200) {
|
if (response.code == 200) {
|
||||||
this.options.img = baseurl + response.imgUrl;
|
this.options.img = baseurl + response.imgUrl;
|
||||||
this.$emit("imgUrl", response.imgUrl);
|
this.$emit("imgUrl", response.imgUrl);
|
||||||
this.openimg = false;
|
this.openimg = false;
|
||||||
} else {
|
} else {
|
||||||
this.$emit("item", "false");
|
setTimeout(e => {
|
||||||
setTimeout((e) => {
|
|
||||||
this.openimg = false;
|
this.openimg = false;
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (this.types == "trainingCategoryPictureUrl") {
|
} else if (this.types == "trainingCategoryPictureUrl") {
|
||||||
uploadTrainingCategoryPicture(formData).then((response) => {
|
uploadTrainingCategoryPicture(formData).then(response => {
|
||||||
|
if (response.code == 200) {
|
||||||
this.options.img = baseurl + response.imgUrl;
|
this.options.img = baseurl + response.imgUrl;
|
||||||
this.$emit("imgUrl", response.imgUrl);
|
this.$emit("imgUrl", response.imgUrl);
|
||||||
this.openimg = false;
|
this.openimg = false;
|
||||||
|
} else {
|
||||||
|
setTimeout(e => {
|
||||||
|
this.openimg = false;
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else if (this.types == "posterVideoUrl") {
|
} else if (this.types == "posterVideoUrl") {
|
||||||
updatePoserHeads(formData).then((response) => {
|
updatePoserHeads(formData).then(response => {
|
||||||
|
if (response.code == 200) {
|
||||||
this.video.VideoPath = baseurl + response.imgUrl;
|
this.video.VideoPath = baseurl + response.imgUrl;
|
||||||
this.$emit("imgUrl", response.imgUrl);
|
this.$emit("imgUrl", response.imgUrl);
|
||||||
this.openimg = false;
|
this.openimg = false;
|
||||||
|
} else {
|
||||||
|
setTimeout(e => {
|
||||||
|
this.openimg = false;
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
updateNurseStationHeads(formData).then((response) => {
|
updateNurseStationHeads(formData).then(response => {
|
||||||
|
if (response.code == 200) {
|
||||||
this.options.img = baseurl + response.imgUrl;
|
this.options.img = baseurl + response.imgUrl;
|
||||||
this.$emit("imgUrl", response.imgUrl);
|
this.$emit("imgUrl", response.imgUrl);
|
||||||
if (this.types == "attributePitureUrl") {
|
if (this.types == "attributePitureUrl") {
|
||||||
@ -370,6 +359,11 @@ export default {
|
|||||||
this.$emit("item", JSON.stringify(this.items));
|
this.$emit("item", JSON.stringify(this.items));
|
||||||
}
|
}
|
||||||
this.openimg = false;
|
this.openimg = false;
|
||||||
|
} else {
|
||||||
|
setTimeout(e => {
|
||||||
|
this.openimg = false;
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -386,8 +380,8 @@ export default {
|
|||||||
closeDialog() {
|
closeDialog() {
|
||||||
this.imgs = "";
|
this.imgs = "";
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user