Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
09d8c48339
@ -82,6 +82,7 @@
|
|||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
|
:disabled="multiple"
|
||||||
v-hasPermi="['manage:materials:remove']"
|
v-hasPermi="['manage:materials:remove']"
|
||||||
>批量删除</el-button
|
>批量删除</el-button
|
||||||
>
|
>
|
||||||
@ -189,13 +190,12 @@
|
|||||||
prop="materialsFilePath"
|
prop="materialsFilePath"
|
||||||
v-if="form.materialsType == 'VIDEO'"
|
v-if="form.materialsType == 'VIDEO'"
|
||||||
>
|
>
|
||||||
<stationAcatar
|
<trainingAvatar
|
||||||
style="width: 208px"
|
@imgUrl="imgUrl2"
|
||||||
@imgUrl="imgUrl2"
|
:tovideo="form.materialsFilePath"
|
||||||
:tovideo="form.materialsFilePath"
|
:type="'materialsVideoUrl'"
|
||||||
:type="'materialsVideoUrl'"
|
/>
|
||||||
v-if="open"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item
|
<el-form-item
|
||||||
@ -309,10 +309,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import { listMaterials, getMaterials, delMaterials, addMaterials, updateMaterials,crowdInfo } from "@/api/manage/materials";
|
import { listMaterials, getMaterials, delMaterials, addMaterials, updateMaterials,crowdInfo } from "@/api/manage/materials";
|
||||||
import stationAcatar from "../../system/stationAvatar/index.vue";
|
import stationAcatar from "../../system/stationAvatar/index.vue";
|
||||||
|
import trainingAvatar from "../../system/trainingAvatar/index.vue";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Materials",
|
name: "Materials",
|
||||||
components: { stationAcatar },
|
components: { stationAcatar ,trainingAvatar},
|
||||||
dicts: ['crowd_type', 'materials_type', 'video_cover_type'],
|
dicts: ['crowd_type', 'materials_type', 'video_cover_type'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -431,10 +432,14 @@ export default {
|
|||||||
},
|
},
|
||||||
// 素材类型
|
// 素材类型
|
||||||
radioChange(e) {
|
radioChange(e) {
|
||||||
|
if(e=='VIDEO'){
|
||||||
this.form.materialsFilePath=null
|
this.form.materialsFilePath=null
|
||||||
this.form.videoCoverFilePath=null
|
this.form.videoCoverFilePath=null
|
||||||
|
}else if(e=='IMAGE_TEXT'){
|
||||||
|
this.form.materialsFilePath=null
|
||||||
|
this.form.videoCoverFilePath=null
|
||||||
|
|
||||||
console.log(e)
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
// 素材上传
|
// 素材上传
|
||||||
@ -445,7 +450,9 @@ export default {
|
|||||||
imgUrl2(imgUrl) {
|
imgUrl2(imgUrl) {
|
||||||
this.form.materialsFilePath = process.env.VUE_APP_BASE_API + imgUrl;
|
this.form.materialsFilePath = process.env.VUE_APP_BASE_API + imgUrl;
|
||||||
this.form.materialsFilePath = imgUrl;
|
this.form.materialsFilePath = imgUrl;
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 视频封面
|
// 视频封面
|
||||||
imgUrl3(imgUrl) {
|
imgUrl3(imgUrl) {
|
||||||
console.log(this.form.videoCoverFilePath)
|
console.log(this.form.videoCoverFilePath)
|
||||||
@ -456,7 +463,13 @@ export default {
|
|||||||
// 复选框点击事件
|
// 复选框点击事件
|
||||||
changecheck(e, item) {
|
changecheck(e, item) {
|
||||||
this.ids = this.materialsList.map(item => item.checked ? item.id : undefined).filter(e => e)
|
this.ids = this.materialsList.map(item => item.checked ? item.id : undefined).filter(e => e)
|
||||||
// console.log(this.ids)
|
if(this.ids.length>0){
|
||||||
|
this.multiple = false
|
||||||
|
}else{
|
||||||
|
this.multiple = true
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(this.ids)
|
||||||
// console.log(item)
|
// console.log(item)
|
||||||
// console.log(e)
|
// console.log(e)
|
||||||
|
|
||||||
@ -603,6 +616,8 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
|
this.getList();
|
||||||
|
|
||||||
console.log(this.ids)
|
console.log(this.ids)
|
||||||
if(this.ids.length==0){
|
if(this.ids.length==0){
|
||||||
this.$modal.msgError("请先选择一条数据");
|
this.$modal.msgError("请先选择一条数据");
|
||||||
|
|||||||
@ -78,7 +78,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="5">
|
<el-col :span="5">
|
||||||
<div class="left" ref="box">
|
<div class="leftmessage" ref="box">
|
||||||
<div class="name">科室名称</div>
|
<div class="name">科室名称</div>
|
||||||
<div>
|
<div>
|
||||||
<el-input
|
<el-input
|
||||||
@ -160,8 +160,9 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="短信状态"
|
label="短信状态"
|
||||||
align="center"
|
align="right"
|
||||||
prop="textMessageStatus"
|
prop="textMessageStatus"
|
||||||
|
width="90px"
|
||||||
>
|
>
|
||||||
<!-- <template slot-scope="scope">
|
<!-- <template slot-scope="scope">
|
||||||
{{ scope.row.textMessageStatus == "GROUNDING" ? "上架" : "" }}
|
{{ scope.row.textMessageStatus == "GROUNDING" ? "上架" : "" }}
|
||||||
@ -928,8 +929,8 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.left {
|
.leftmessage {
|
||||||
height: 530px;
|
height: 800px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
.name {
|
.name {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
@ -976,6 +977,6 @@ export default {
|
|||||||
// margin-left: 10px; //这个用于圆点居中
|
// margin-left: 10px; //这个用于圆点居中
|
||||||
position: relative;
|
position: relative;
|
||||||
top: 16px;
|
top: 16px;
|
||||||
left: 12px;
|
left: 25px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -52,7 +52,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="服务包价格" prop="packagePrice">
|
<el-form-item label="服务包价格" prop="packagePrice">
|
||||||
<el-input
|
<el-input
|
||||||
oninput="value=value.replace(/[^\d.]/g,'')"
|
oninput="value=value.replace(/[^\d.]/g,'')"
|
||||||
v-model="queryParams.packagePrice"
|
v-model="queryParams.packagePrice"
|
||||||
placeholder="请输入服务包价格"
|
placeholder="请输入服务包价格"
|
||||||
clearable
|
clearable
|
||||||
@ -165,11 +165,7 @@
|
|||||||
:data="servicepackageList"
|
:data="servicepackageList"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column label="序号" align="center" type="index" />
|
||||||
label="序号"
|
|
||||||
align="center"
|
|
||||||
type="index"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="服务包名称"
|
label="服务包名称"
|
||||||
align="center"
|
align="center"
|
||||||
@ -232,8 +228,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-notebook-2
|
icon="el-icon-notebook-2"
|
||||||
"
|
|
||||||
@click="detail(scope.row)"
|
@click="detail(scope.row)"
|
||||||
>详情</el-button
|
>详情</el-button
|
||||||
>
|
>
|
||||||
@ -348,7 +343,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="服务包价格" prop="packagePrice">
|
<el-form-item label="服务包价格" prop="packagePrice">
|
||||||
<el-input
|
<el-input
|
||||||
oninput="value=value.replace(/[^\d.]/g,'')"
|
oninput="value=value.replace(/[^\d.]/g,'')"
|
||||||
v-model="form.packagePrice"
|
v-model="form.packagePrice"
|
||||||
placeholder="请输入服务包价格"
|
placeholder="请输入服务包价格"
|
||||||
style="width: 204px"
|
style="width: 204px"
|
||||||
@ -378,7 +373,11 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="服务包期限" prop="packageTerm">
|
<el-form-item label="服务包期限" prop="packageTerm">
|
||||||
<el-input v-model="form.packageTerm" placeholder="请输入服务包期限" style="width: 208px">
|
<el-input
|
||||||
|
v-model="form.packageTerm"
|
||||||
|
placeholder="请输入服务包期限"
|
||||||
|
style="width: 208px"
|
||||||
|
>
|
||||||
<el-select
|
<el-select
|
||||||
style="width: 60px"
|
style="width: 60px"
|
||||||
slot="append"
|
slot="append"
|
||||||
@ -422,7 +421,7 @@
|
|||||||
:prop="`voList.${index}.serviceContent`"
|
:prop="`voList.${index}.serviceContent`"
|
||||||
>
|
>
|
||||||
<el-select
|
<el-select
|
||||||
style="margin-left:10px"
|
style="margin-left: 10px"
|
||||||
v-model="aitem.serviceContent"
|
v-model="aitem.serviceContent"
|
||||||
placeholder="请选择服务内容"
|
placeholder="请选择服务内容"
|
||||||
@change="changcontent"
|
@change="changcontent"
|
||||||
@ -665,10 +664,19 @@
|
|||||||
<span>{{ formdetail.diseaseTypeName }}</span>
|
<span>{{ formdetail.diseaseTypeName }}</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="服务包名称:" prop="packageVersion">
|
<el-form-item label="服务包名称:" prop="packageVersion">
|
||||||
<span>{{ formdetail.packageName }}</span>
|
<span
|
||||||
|
style="
|
||||||
|
display: inline-block;
|
||||||
|
width: 110px;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
"
|
||||||
|
>{{ formdetail.packageName }}</span
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="价格:" prop="packageVersion">
|
<el-form-item label="价格:" prop="packageVersion">
|
||||||
<span>{{ formdetail.packagePrice }}</span>
|
<span>{{ formdetail.packagePrice }}元</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="服务期限:" prop="packageVersion">
|
<el-form-item label="服务期限:" prop="packageVersion">
|
||||||
<span>{{ formdetail.packageTermAndUnit }}</span>
|
<span>{{ formdetail.packageTermAndUnit }}</span>
|
||||||
@ -763,8 +771,8 @@ export default {
|
|||||||
querydisease: {
|
querydisease: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
diseaseTypeName:null,
|
diseaseTypeName: null,
|
||||||
departmentId:null,
|
departmentId: null,
|
||||||
},
|
},
|
||||||
listdisease: [],
|
listdisease: [],
|
||||||
diseasetotal: 0,
|
diseasetotal: 0,
|
||||||
@ -1021,7 +1029,7 @@ export default {
|
|||||||
serviccontent(serviceWayId).then(response => {
|
serviccontent(serviceWayId).then(response => {
|
||||||
this.optionscontent = response.rows;
|
this.optionscontent = response.rows;
|
||||||
});
|
});
|
||||||
this.form.voList.serviceContent='';
|
this.form.voList.serviceContent = '';
|
||||||
},
|
},
|
||||||
// 服务内容点击事件
|
// 服务内容点击事件
|
||||||
changcontent(e) {
|
changcontent(e) {
|
||||||
@ -1046,7 +1054,6 @@ export default {
|
|||||||
let sum = 0;
|
let sum = 0;
|
||||||
this.DepartmentoList.forEach((item) => {
|
this.DepartmentoList.forEach((item) => {
|
||||||
if (item.countNum != null) {
|
if (item.countNum != null) {
|
||||||
console.log(item.countNum)
|
|
||||||
sum += item.countNum;
|
sum += item.countNum;
|
||||||
}
|
}
|
||||||
this.count = sum;
|
this.count = sum;
|
||||||
@ -1175,6 +1182,17 @@ export default {
|
|||||||
updateBy: null,
|
updateBy: null,
|
||||||
updateTime: null
|
updateTime: null
|
||||||
};
|
};
|
||||||
|
this.optionsway=[],
|
||||||
|
// 服务内容
|
||||||
|
|
||||||
|
this.optionscontent=[],
|
||||||
|
// 服务频次
|
||||||
|
this.optionsfrequency=[
|
||||||
|
{
|
||||||
|
value: '',
|
||||||
|
label: ''
|
||||||
|
}
|
||||||
|
],
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
@ -1196,6 +1214,7 @@ export default {
|
|||||||
// 新增
|
// 新增
|
||||||
handleAdd() {
|
handleAdd() {
|
||||||
this.reset();
|
this.reset();
|
||||||
|
|
||||||
this.getserviceWayList()
|
this.getserviceWayList()
|
||||||
this.form = {
|
this.form = {
|
||||||
voList: [
|
voList: [
|
||||||
@ -1209,8 +1228,6 @@ export default {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
console.log(this.form)
|
console.log(this.form)
|
||||||
|
|
||||||
|
|
||||||
this.form.whetherRelease = 0
|
this.form.whetherRelease = 0
|
||||||
this.form.packageTermUnit = '年'
|
this.form.packageTermUnit = '年'
|
||||||
if (this.itemname) {
|
if (this.itemname) {
|
||||||
@ -1381,7 +1398,7 @@ export default {
|
|||||||
::v-deep .el-input-group {
|
::v-deep .el-input-group {
|
||||||
width: 204px !important;
|
width: 204px !important;
|
||||||
}
|
}
|
||||||
.leftserv{
|
.leftserv {
|
||||||
height: 1000px;
|
height: 1000px;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
.name {
|
.name {
|
||||||
|
|||||||
297
src/views/system/trainingAvatar/index.vue
Normal file
297
src/views/system/trainingAvatar/index.vue
Normal file
@ -0,0 +1,297 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="user-info-head" :class="video.VideoPath ? 'wihi' : ''" @click="editCropper()">
|
||||||
|
<video style="width: 208px; height: 208px" v-bind:src="video.VideoPath" v-if="video.VideoPath"
|
||||||
|
class="avatar video-avatar" controls="controls">您的浏览器不支持视频播放</video>
|
||||||
|
<i class="el-icon-plus avatar-uploader-icon" style="
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
"></i>
|
||||||
|
</div>
|
||||||
|
<el-dialog :title="title" :visible.sync="openimg" width="950px" append-to-body @opened="modalOpened"
|
||||||
|
@close="closeDialog">
|
||||||
|
<el-row>
|
||||||
|
<el-col :xs="24" :md="24" :style="{ height: '350px' }">
|
||||||
|
<div class="avatar-upload-preview">
|
||||||
|
<video v-if="openimg" style="width: 100%; height: 100%" v-bind:src="videoForm.showVideoPath"
|
||||||
|
class="avatar video-avatar" controls="controls">您的浏览器不支持视频播放</video>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<br />
|
||||||
|
<el-progress v-if="progressFlag" :percentage="loadProgress" style="height:30px;padding-bottom:20px"></el-progress>
|
||||||
|
<el-row style="padding-bottom:0px">
|
||||||
|
<el-col :lg="3" :md="2">
|
||||||
|
<el-upload :show-file-list="false" class="upload-demo" ref="upload" :action="uploadurl"
|
||||||
|
:on-preview="handlePreview" :auto-upload="false" :on-change="loadJsonFromFile" :data="filedata"
|
||||||
|
:headers="headers" :on-progress="uploadVideoProcess" :on-success="handleAvatarSuccess">
|
||||||
|
<el-button slot="trigger" size="small" type="primary" style="float:left">选取文件</el-button>
|
||||||
|
</el-upload>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="{ span: 2, offset: 18 }" :md="2">
|
||||||
|
<el-button v-if="uploadbtn" type="primary" size="small" @click="submitUpload">提 交</el-button>
|
||||||
|
<el-button v-else :loading="!uploadbtn" type="primary" size="small">提交中...</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { VueCropper } from "vue-cropper";
|
||||||
|
import { uploadFilefm } from "@/api/system/stationAvatar.js";
|
||||||
|
import { getToken } from "@/utils/auth";
|
||||||
|
export default {
|
||||||
|
components: { VueCropper },
|
||||||
|
props: ["img", "type", "item", "tovideo"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
fileList: [],
|
||||||
|
loadProgress: 0, // 动态显示进度条
|
||||||
|
progressFlag: false, // 关闭进度条
|
||||||
|
uploadbtn: true, //上传中不允许点击
|
||||||
|
imageUrl: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
openimg: false,
|
||||||
|
// 是否显示cropper
|
||||||
|
visible: false,
|
||||||
|
// 弹出层标题
|
||||||
|
title: "上传图片/视频",
|
||||||
|
filedata: {
|
||||||
|
type: ""
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
Authorization: "Bearer " + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
|
||||||
|
},
|
||||||
|
options: {
|
||||||
|
img: null, //裁剪图片的地址
|
||||||
|
autoCrop: true, // 是否默认生成截图框
|
||||||
|
autoCropWidth: 300, // 默认生成截图框宽度
|
||||||
|
autoCropHeight: 300, // 默认生成截图框高度
|
||||||
|
fixedBox: true // 固定截图框大小 不允许改变
|
||||||
|
},
|
||||||
|
previews: {},
|
||||||
|
items: {},
|
||||||
|
//显示上传按钮
|
||||||
|
videoForm: {
|
||||||
|
showVideoPath: null //回显的变量
|
||||||
|
},
|
||||||
|
video: {
|
||||||
|
VideoPath: null //回显的变量
|
||||||
|
},
|
||||||
|
uploadurl: undefined
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.uploadurl =
|
||||||
|
process.env.VUE_APP_BASE_API + "/manage/file/uploadFile";
|
||||||
|
this.uploadbtn = true;
|
||||||
|
this.filedata.type = this.type;
|
||||||
|
this.items = this.item;
|
||||||
|
if (this.tovideo == null) {
|
||||||
|
this.video.VideoPath = null;
|
||||||
|
} else if (this.tovideo == "") {
|
||||||
|
this.video.VideoPath = null;
|
||||||
|
} else {
|
||||||
|
this.videoForm.showVideoPath =
|
||||||
|
process.env.VUE_APP_BASE_API + this.tovideo;
|
||||||
|
this.video.VideoPath = process.env.VUE_APP_BASE_API + this.tovideo;
|
||||||
|
}
|
||||||
|
this.title = "上传视频";
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
tovideo: {
|
||||||
|
handler(newimg, oldimg) {
|
||||||
|
this.uploadbtn = true;
|
||||||
|
if (newimg == null) {
|
||||||
|
this.video.VideoPath = null;
|
||||||
|
this.videoForm.showVideoPath = null
|
||||||
|
} else if (newimg == "") {
|
||||||
|
this.video.VideoPath = null;
|
||||||
|
this.videoForm.showVideoPath = null
|
||||||
|
} else {
|
||||||
|
this.videoForm.showVideoPath = process.env.VUE_APP_BASE_API + newimg;
|
||||||
|
this.video.VideoPath = process.env.VUE_APP_BASE_API + newimg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
item: {
|
||||||
|
handler(newimg, oldimg) {
|
||||||
|
this.uploadbtn = true;
|
||||||
|
this.items = this.item;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
handler(newimg, oldimg) {
|
||||||
|
this.filedata.type = this.type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
uploadVideoProcess(event, file, fileList) {
|
||||||
|
this.progressFlag = true; // 显示进度条
|
||||||
|
this.loadProgress = parseInt(event.percent); // 动态获取文件上传进度
|
||||||
|
if (this.loadProgress >= 100) {
|
||||||
|
this.loadProgress = 100;
|
||||||
|
setTimeout(() => {
|
||||||
|
this.progressFlag = false;
|
||||||
|
}, 1000); // 一秒后关闭进度条
|
||||||
|
}
|
||||||
|
},
|
||||||
|
loadJsonFromFile(file, fileList) {
|
||||||
|
const reader = new FileReader();
|
||||||
|
this.previews.data = file.raw;
|
||||||
|
this.videoForm.showVideoPath = URL.createObjectURL(file.raw);
|
||||||
|
reader.readAsDataURL(file.raw);
|
||||||
|
reader.onload = () => {
|
||||||
|
// this.options.img = reader.result;
|
||||||
|
};
|
||||||
|
},
|
||||||
|
submitUpload() {
|
||||||
|
this.uploadbtn = false;
|
||||||
|
this.$refs.upload.submit();
|
||||||
|
},
|
||||||
|
handlePreview(file) { },
|
||||||
|
// 编辑头像
|
||||||
|
editCropper() {
|
||||||
|
this.openimg = true;
|
||||||
|
},
|
||||||
|
// 打开弹出层结束时的回调
|
||||||
|
modalOpened() {
|
||||||
|
this.visible = true;
|
||||||
|
},
|
||||||
|
// 覆盖默认的上传行为
|
||||||
|
requestUpload() { },
|
||||||
|
// 向左旋转
|
||||||
|
rotateLeft() {
|
||||||
|
this.$refs.cropper.rotateLeft();
|
||||||
|
},
|
||||||
|
// 向右旋转
|
||||||
|
rotateRight() {
|
||||||
|
this.$refs.cropper.rotateRight();
|
||||||
|
},
|
||||||
|
// 图片缩放
|
||||||
|
changeScale(num) {
|
||||||
|
num = num || 1;
|
||||||
|
this.$refs.cropper.changeScale(num);
|
||||||
|
},
|
||||||
|
// 上传预处理
|
||||||
|
beforeUpload(file) {
|
||||||
|
const reader = new FileReader();
|
||||||
|
this.previews.data = file;
|
||||||
|
this.videoForm.showVideoPath = URL.createObjectURL(file);
|
||||||
|
reader.readAsDataURL(file);
|
||||||
|
reader.onload = () => {
|
||||||
|
// this.options.img = reader.result;
|
||||||
|
};
|
||||||
|
},
|
||||||
|
handleAvatarSuccess(res, file) {
|
||||||
|
if (res.code == 200) {
|
||||||
|
this.video.VideoPath = process.env.VUE_APP_BASE_API + res.imgUrl;
|
||||||
|
this.$emit("imgUrl", res.imgUrl);
|
||||||
|
this.$modal.msgSuccess("上传视频成功");
|
||||||
|
this.openimg = false;
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.msg);
|
||||||
|
}
|
||||||
|
this.uploadbtn = true;
|
||||||
|
},
|
||||||
|
// 上传图片
|
||||||
|
uploadImg() {
|
||||||
|
this.uploadbtn = true;
|
||||||
|
let formData = new FormData();
|
||||||
|
if (this.previews.data) {
|
||||||
|
formData.append("file", this.previews.data);
|
||||||
|
formData.append("type", this.filedata.type);
|
||||||
|
this.$modal.msgSuccess("上传视频中,请耐心等待");
|
||||||
|
this.uploadbtn = false;
|
||||||
|
uploadFilefm(formData).then(response => {
|
||||||
|
if (response.code == 200) {
|
||||||
|
this.video.VideoPath =
|
||||||
|
process.env.VUE_APP_BASE_API + response.imgUrl;
|
||||||
|
this.items.itemDirectoryUrl = response.imgUrl;
|
||||||
|
this.$emit("item", JSON.stringify(this.items));
|
||||||
|
|
||||||
|
this.openimg = false;
|
||||||
|
} else {
|
||||||
|
setTimeout(e => {
|
||||||
|
this.openimg = false;
|
||||||
|
}, 1000);
|
||||||
|
}
|
||||||
|
this.uploadbtn = true;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.openimg = false;
|
||||||
|
}
|
||||||
|
// this.videoForm.showVideoPath = null;
|
||||||
|
this.previews.data = null;
|
||||||
|
},
|
||||||
|
// 实时预览
|
||||||
|
realTime(data) {
|
||||||
|
this.previews = data;
|
||||||
|
},
|
||||||
|
// 关闭窗口
|
||||||
|
closeDialog() {
|
||||||
|
this.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.title {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 5%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, 0%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.avatar-upload-preview {
|
||||||
|
position: absolute;
|
||||||
|
top: 0%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, 0%);
|
||||||
|
width: 300px;
|
||||||
|
height: 300px;
|
||||||
|
border-radius: 0%;
|
||||||
|
box-shadow: 0 0 4px #ccc;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-info-head {
|
||||||
|
position: relative;
|
||||||
|
display: inline-block;
|
||||||
|
background: #fafafa;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.user-info-head:hover:after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
color: #eee;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
font-size: 24px;
|
||||||
|
font-style: normal;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
cursor: pointer;
|
||||||
|
line-height: 110px;
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wihi {
|
||||||
|
background-color: #fff;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.wihi:hover:after {
|
||||||
|
transform: translate(50%, 50%);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue
Block a user