素材信息

This commit is contained in:
shidongli 2024-03-04 15:07:08 +08:00
parent f282bde78e
commit 4faf77876b
5 changed files with 247 additions and 366 deletions

View File

@ -42,3 +42,13 @@ export function delMaterials(id) {
method: 'delete'
})
}
// 人群列表
export function crowdInfo(query) {
return request({
url: '/manage/crowdInfo/getList',
method: 'get',
params: query
})
}

View File

@ -59,9 +59,9 @@ export function delPropaganda(id) {
}
// 左侧列表
export function listWechatTemplateNum(query) {
export function selectNumByDept(query) {
return request({
url: '/system/department/listWechatTemplateNum',
url: '/manage/propaganda/selectNumByDept',
method: 'get',
params: query
})

View File

@ -86,7 +86,6 @@
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['manage:materials:remove']"
>批量删除</el-button
@ -97,251 +96,53 @@
@queryTable="getList"
></right-toolbar>
</el-row>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tabs
v-model="queryParams.materialsType"
type="card"
@tab-click="handleClick"
>
<el-tab-pane label="图片" name="IMAGE_TEXT"></el-tab-pane>
<el-tab-pane label="视频" name="VIDEO"></el-tab-pane>
</el-tabs>
<div class="bodytopxj">
<div class="bodylist" @click.stop="viewshow">
<el-checkbox v-model="checked"></el-checkbox>
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label" @click.stop="labelchange">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
</div>
<div class="bodylist" v-for="item in materialsList" :key="item.id">
<el-checkbox
v-model="item.checked"
@change="changecheck($event, item)"
></el-checkbox>
<div @click.stop="viewshow(item)">
<img
:src="baseUrl + item.materialsFilePath"
alt=""
v-if="item.materialsFilePath && !item.videoCoverFilePath"
/>
<img
:src="baseUrl + item.videoCoverFilePath"
alt=""
v-if="item.videoCoverFilePath && item.materialsFilePath"
/>
<div class="texttitle">{{ item.name }}</div>
<div class="dataliat">
创建人/创建时间<span>{{ item.createBy }}</span
>/<span>{{ item.createTime }}</span>
</div>
<div class="dataliat">素材来源</div>
<!-- <div class="dataliat">标签暂无</div> -->
<div class="dataliat">标签
<div class="bodylist">
<img src="@/assets/system/userinfo.jpg" alt="" />
<div class="texttitle">测试素材封面</div>
<div class="dataliat">
创建人/创建时间<span>张程程</span>/<span
>555555555555555555555555555555555555</span
>
<span v-if="item.indications">{{ item.indications }}</span>
<span v-if="item.drugName">{{ item.drugName }}</span>
<span v-if="item.applicableDiseases">{{ item.applicableDiseases }}</span>
<span v-if="item.surgicalName">{{ item.surgicalName }}</span>
<span v-if="item.inspectionItems">{{ item.inspectionItems }}</span>
<span v-if="item.checkItems">{{ item.checkItems }}</span>
</div>
</div>
<div class="dataliat">素材来源</div>
<div class="dataliat">标签暂无</div>
<div class="label">标签管理</div>
<div class="label" @click.stop="labelchange(item)">标签管理</div>
</div>
</div>
<!-- <el-table
v-loading="loading"
:data="materialsList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键id" align="center" prop="id" />
<el-table-column label="素材名称" align="center" prop="materialsName" />
<el-table-column
label="
素材类型图文IMAGE_TEXT视频VIDEO"
align="center"
prop="materialsType"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.materials_type"
:value="scope.row.materialsType"
/>
</template>
</el-table-column>
<el-table-column
label="素材选择AI生成AI_GENERATION手动上传MANUAL_UPLOAD"
align="center"
prop="materialsOption"
/>
<el-table-column
label="素材图片/者视频文件存放路径"
align="center"
prop="materialsFilePath"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.video_cover_type"
:value="scope.row.materialsFilePath"
/>
</template>
</el-table-column>
<el-table-column
label="视频封面类型视频首帧VIDEO_FIRST_FRAME手动上传MANUAL_UPLOAD"
align="center"
prop="videoCoverType"
width="100"
>
<template slot-scope="scope">
<image-preview
:src="scope.row.videoCoverType"
:width="50"
:height="50"
/>
</template>
</el-table-column>
<el-table-column
label="视频封面存放路径"
align="center"
prop="videoCoverFilePath"
/>
<el-table-column
label="素材摘要"
align="center"
prop="materialsAbstract"
/>
<el-table-column label="适用症状" align="center" prop="indications" />
<el-table-column
label="适用疾病"
align="center"
prop="applicableDiseases"
/>
<el-table-column label="药物名称" align="center" prop="drugName" />
<el-table-column label="手术名称" align="center" prop="surgicalName" />
<el-table-column label="检查项目" align="center" prop="checkItems" />
<el-table-column label="检验项目" align="center" prop="inspectionItems" />
<el-table-column label="所属人群表id" align="center" prop="crowdId">
<template slot-scope="scope">
<dict-tag
:options="dict.type.crowd_type"
:value="scope.row.crowdId"
/>
</template>
</el-table-column>
<el-table-column label="人群名称" align="center" prop="crowName" />
<el-table-column
label="素材状态全部ALL已上架LISTED未上架NOT_LISTED"
align="center"
prop="materialsStatus"
/>
<el-table-column label="素材备注" align="center" prop="materialsRemark" />
<el-table-column
label="素材排序,值越小排序越靠前"
align="center"
prop="materialsSort"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['manage:materials:edit']"
>修改</el-button
>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['manage:materials:remove']"
>删除</el-button
>
</template>
</el-table-column>
</el-table> -->
<pagination
v-show="total > 0"
@ -363,7 +164,7 @@
<el-form-item label="素材名称" prop="materialsName">
<el-input v-model="form.materialsName" placeholder="请输入素材名称" />
</el-form-item>
<el-form-item label="素材类型">
<el-form-item label="素材类型" prop="materialsType">
<el-radio
v-model="form.materialsType"
label="IMAGE_TEXT"
@ -379,38 +180,38 @@
</el-form-item>
<el-form-item
label="素材上传"
prop="materialsName111"
prop="materialsFilePath"
v-if="form.materialsType == 'IMAGE_TEXT'"
>
<stationAcatar
@imgUrl="imgUrl"
:img="form.propagandaCoverPath"
:type="'propagandaCoverUrl'"
:img="form.materialsFilePath"
:type="'materialsCoverUrl'"
/>
</el-form-item>
<el-form-item
label="视频素材上传"
prop="materialsName111"
prop="materialsFilePath"
v-if="form.materialsType == 'VIDEO'"
>
<stationAcatar
style="width: 208px"
@imgUrl="imgUrl2"
:tovideo="form.posterVideoUrl"
:type="'posterVideoUrl'"
:tovideo="form.materialsFilePath"
:type="'materialsVideoUrl'"
v-if="open"
/>
</el-form-item>
<el-form-item
label="视频封面"
prop="materialsName111"
prop="videoCoverFilePath"
v-if="form.materialsType == 'VIDEO'"
>
<stationAcatar
@imgUrl="imgUrl"
:img="form.propagandaCoverPath"
:type="'propagandaCoverUrl'"
@imgUrl="imgUrl3"
:img="form.videoCoverFilePath"
:type="'materialsCoverUrl'"
/>
</el-form-item>
@ -421,32 +222,7 @@
placeholder="请输入内容"
/>
</el-form-item>
<!-- <el-form-item
label="素材选择AI生成AI_GENERATION手动上传MANUAL_UPLOAD"
>
<file-upload v-model="form.materialsOption" />
</el-form-item> -->
<!-- <el-form-item label="素材图片/者视频文件存放路径">
<el-radio-group v-model="form.materialsFilePath">
<el-radio
v-for="dict in dict.type.video_cover_type"
:key="dict.value"
:label="dict.value"
>{{ dict.label }}</el-radio
>
</el-radio-group>
</el-form-item>
<el-form-item
label="视频封面类型视频首帧VIDEO_FIRST_FRAME手动上传MANUAL_UPLOAD"
>
<image-upload v-model="form.videoCoverType" />
</el-form-item>
<el-form-item label="视频封面存放路径" prop="videoCoverFilePath">
<el-input
v-model="form.videoCoverFilePath"
placeholder="请输入视频封面存放路径"
/>
</el-form-item> -->
<el-form-item label="适用症状" prop="indications">
<el-input v-model="form.indications" placeholder="请输入适用症状" />
@ -472,40 +248,24 @@
placeholder="请输入检验项目"
/>
</el-form-item>
<!-- <el-form-item label="所属人群表id" prop="crowdId">
<el-select v-model="form.crowdId" placeholder="请选择所属人群表id">
<el-option
v-for="dict in dict.type.crowd_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="人群名称" prop="crowName">
<el-select v-model="form.crowName" placeholder="请选择" style="width: 381px;">
<el-select
v-model="form.crowName"
placeholder="请选择"
style="width: 381px"
@change="crowNamechange"
>
<el-option
v-for="item in optionscrowName"
:key="item.value"
:label="item.label"
:value="item.value"
:key="item.id"
:label="item.crowdName"
:value="item.id"
>
</el-option>
</el-select>
<!-- <el-input v-model="form.crowName" placeholder="请输入人群名称" /> -->
</el-form-item>
<!-- <el-form-item label="素材备注" prop="materialsRemark">
<el-input
v-model="form.materialsRemark"
placeholder="请输入素材备注"
/>
</el-form-item>
<el-form-item label="素材排序,值越小排序越靠前" prop="materialsSort">
<el-input
v-model="form.materialsSort"
placeholder="请输入素材排序,值越小排序越靠前"
/>
</el-form-item> -->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -517,34 +277,34 @@
<div class="viewbody">
<div class="left">
<video
v-if="activeName == 'VIDEO'"
v-if="queryParams.materialsType == 'VIDEO'"
ref="myVideo"
src="./text.mp4"
:src="baseUrl + viewform.materialsFilePath"
controls
></video>
<img
src="@/assets/system/userinfo.jpg"
:src="baseUrl + viewform.materialsFilePath"
alt=""
v-if="activeName == 'IMAGE_TEXT'"
v-if="queryParams.materialsType == 'IMAGE_TEXT'"
/>
</div>
<div class="right">
<div class="nametitle">素材名称</div>
<div class="nameitem">半蹲起立练习室早</div>
<div class="nameitem">{{viewform.materialsName}}</div>
<div class="nametitle">创建人员</div>
<div class="nameitem">张宇</div>
<div class="nameitem">{{viewform.createBy}}</div>
<div class="nametitle">创建时间</div>
<div class="nameitem">2024-1-25 15:42</div>
<div class="nameitem">{{viewform.createTime}}</div>
<div class="nametitle">素材摘要</div>
<div class="nameitem">88888888888888888888888888888888888</div>
<div class="nameitem">{{viewform.materialsAbstract}}</div>
<div class="nametitle">素材标签</div>
<div class="nameitem">适用症状</div>
<div class="nameitem">药物名称</div>
<div class="nameitem">适用疾病</div>
<div class="nameitem">手术名称</div>
<div class="nameitem">检验项目</div>
<div class="nameitem">检查项目</div>
<div class="nameitem">人群</div>
<div class="nameitem">适用症状{{viewform.indications}}</div>
<div class="nameitem">药物名称{{viewform.drugName}}</div>
<div class="nameitem">适用疾病{{viewform.applicableDiseases}}</div>
<div class="nameitem">手术名称{{viewform.surgicalName}}</div>
<div class="nameitem">检验项目{{viewform.inspectionItems}}</div>
<div class="nameitem">检查项目{{viewform.checkItems}}</div>
<div class="nameitem">人群{{viewform.crowName}}</div>
</div>
</div>
</el-dialog>
@ -552,7 +312,7 @@
</template>
<script>
import { listMaterials, getMaterials, delMaterials, addMaterials, updateMaterials } from "@/api/manage/materials";
import { listMaterials, getMaterials, delMaterials, addMaterials, updateMaterials,crowdInfo } from "@/api/manage/materials";
import stationAcatar from "../../system/stationAvatar/index.vue";
export default {
@ -561,6 +321,7 @@ export default {
dicts: ['crowd_type', 'materials_type', 'video_cover_type'],
data() {
return {
baseUrl: process.env.VUE_APP_BASE_API,
videoState: false, //
//
studyTime: {
@ -569,8 +330,9 @@ export default {
},
timer: {}, //
pauseTimer: {}, //
checked: true,
checked: false,
openview: false,//
viewform: [],
activeName: 'IMAGE_TEXT',
options: [{
value: 'ALL',
@ -584,13 +346,13 @@ export default {
}],
//
optionscrowName: [
{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
},
// {
// value: '1',
// label: ''
// }, {
// value: '2',
// label: ''
// },
],
optionsly: [{
@ -613,6 +375,7 @@ export default {
loading: true,
//
ids: [],
selectedValues: [], //
//
single: true,
//
@ -633,6 +396,7 @@ export default {
queryParams: {
pageNum: 1,
pageSize: 10,
materialsType: 'IMAGE_TEXT',
materialsName: null,
materialsStatus: null,
createTime: null,
@ -641,6 +405,21 @@ export default {
form: {},
//
rules: {
materialsName: [
{ required: true, message: "素材名称不能为空", trigger: "blur" },
],
materialsType: [
{ required: true, message: "素材类型不能为空", trigger: "blur" },
],
materialsFilePath: [
{ required: true, message: "素材上传不能为空", trigger: "blur" },
],
videoCoverFilePath:[
{ required: true, message: "视频封面不能为空", trigger: "blur" },
],
}
};
},
@ -650,38 +429,70 @@ export default {
methods: {
// /
handleClick(e) {
this.activeName = e.name
this.queryParams.materialsType = e.name
this.getList()
// this.type
console.log(e.name);
},
//
radioChange(e) {
this.form.materialsFilePath=null
this.form.videoCoverFilePath=null
console.log(e)
},
//
imgUrl(imgUrl) {
this.form.propagandaCoverPath = imgUrl;
this.form.materialsFilePath = imgUrl;
},
//
imgUrl2(imgUrl) {
this.videoForm.showVideoPath = process.env.VUE_APP_BASE_API + imgUrl;
this.form.posterVideoUrl = imgUrl;
this.form.materialsFilePath = process.env.VUE_APP_BASE_API + imgUrl;
this.form.materialsFilePath = imgUrl;
},
//
imgUrl3(imgUrl) {
console.log(this.form.videoCoverFilePath)
this.form.videoCoverFilePath = imgUrl;
},
//
changecheck(e, item) {
this.ids = this.materialsList.map(item => item.checked ? item.id : undefined).filter(e => e)
// console.log(this.ids)
// console.log(item)
// console.log(e)
},
//
viewshow() {
viewshow(item) {
console.log(item)
this.openview = true
this.viewform = item
},
getcrowdInfo(){
crowdInfo().then(response=>{
this.optionscrowName=response.data
})
},
//
crowNamechange(e){
this.form.crowdName=this.optionscrowName.find(f=>f.id==e).crowdName
this.form.crowdId=e
// this.form.suitTaskTypeName=this.type.find(f=> f.dictCode==e).dictLabel
console.log(e)
console.log(this.form.crowdName)
},
/** 查询素材信息列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeCreateTime && '' != this.daterangeCreateTime) {
this.queryParams.params["beginCreateTime"] = this.daterangeCreateTime[0];
this.queryParams.params["endCreateTime"] = this.daterangeCreateTime[1];
}
listMaterials(this.queryParams).then(response => {
this.materialsList = response.rows;
this.total = response.total;
@ -700,7 +511,7 @@ export default {
materialsName: null,
materialsType: "IMAGE_TEXT",
materialsOption: 'MANUAL_UPLOAD',
materialsFilePath: "0",
materialsFilePath: null,
videoCoverType: null,
videoCoverFilePath: null,
materialsAbstract: null,
@ -725,11 +536,27 @@ export default {
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
if (this.daterangeCreateTime.length > 0) {
this.queryParams.createTimeStart = this.daterangeCreateTime[0]
this.queryParams.createTimeEnd = this.daterangeCreateTime[1]
}
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeCreateTime = [];
this.queryParams={
pageNum: 1,
pageSize: 10,
materialsType: 'IMAGE_TEXT',
materialsName: null,
materialsStatus: null,
createTimeStart: null,
createTimeEnd: null,
}
this.resetForm("queryForm");
this.handleQuery();
},
@ -744,19 +571,20 @@ export default {
this.reset();
console.log(this.form)
this.open = true;
this.getcrowdInfo()
this.title = "添加素材信息";
},
/** 修改按钮操作 */
labelchange(row) {
labelchange(item) {
this.reset();
this.open = true;
const id = row.id || this.ids
// getMaterials(id).then(response => {
// this.form = response.data;
// this.open = true;
// this.title = "";
// });
const id = item.id || this.ids
getMaterials(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改素材信息";
});
},
/** 提交按钮 */
submitForm() {
@ -780,13 +608,20 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除素材信息编号为"' + ids + '"的数据项?').then(function () {
console.log(this.ids)
if(this.ids.length==0){
this.$modal.msgError("请先选择一条数据");
}else{
const ids = this.ids;
this.$modal.confirm('是否确认删除该素材信息?').then(function () {
return delMaterials(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
}
},
/** 导出按钮操作 */
handleExport() {
@ -800,7 +635,7 @@ export default {
<style lang="scss" scoped>
::v-deep .el-checkbox__inner {
position: absolute !important;
top: -84px;
// top: -84px;
left: 8px;
}
video {
@ -817,6 +652,11 @@ video {
height: 500px;
// background: #989992;
}
img{
height: 100%;
width: 100%;
}
.right {
width: 20%;
// background: red;
@ -837,15 +677,16 @@ video {
white-space: wrap;
align-items: center;
flex-wrap: wrap;
justify-content: space-around;
align-content: space-between;
justify-content: flex-start;
// align-content: space-between;
.bodylist {
width: 19%;
height: 210px;
height: 217px;
border: 2px solid #e2e3e5;
border-radius: 10px;
position: relative;
margin-bottom: 10px;
// margin-bottom: 10px;
margin: 6px;
.texttitle {
font-weight: 700;
margin: 5px 0px 5px 10px;
@ -868,7 +709,7 @@ video {
right: 0px;
right: 18px;
color: #409eff;
bottom: 11px;
bottom:4px;
font-size: 13px;
}
}

View File

@ -604,7 +604,7 @@
</template>
<script>
import { listPropaganda, getPropaganda, delPropaganda, addPropaganda, updatePropaganda, listWechatTemplateNum, copy, updateStatus } from "@/api/manage/propaganda";
import { listPropaganda, getPropaganda, delPropaganda, addPropaganda, updatePropaganda, selectNumByDept, copy, updateStatus } from "@/api/manage/propaganda";
import stationAcatar from "../../system/stationAvatar/index.vue";
import { department, listDisease } from "@/api/manage/script";
export default {
@ -860,7 +860,7 @@ export default {
//
Departmentlist() {
this.loading = true;
listWechatTemplateNum(this.querydepartmen).then(response => {
selectNumByDept(this.querydepartmen).then(response => {
this.DepartmentoList = response.data;
this.loading = false;
});
@ -1057,9 +1057,9 @@ export default {
// },
/** 修改按钮操作 */
handleUpdate(row) {
if (!this.itemname) {
this.$modal.msgError("请先选择科室");
} else {
// if (!this.itemname) {
// this.$modal.msgError("");
// } else {
// this.reset();
const id = row.id || this.ids
getPropaganda(id).then(response => {
@ -1070,7 +1070,7 @@ export default {
this.open = true;
this.title = "修改患者宣教信息";
});
}
// }
},
//
imgUrl(imgUrl) {

View File

@ -9,13 +9,13 @@
controls="controls"
>您的浏览器不支持视频播放</video>
<img
v-if="options.img"
v-if="options.img&&!video.VideoPath"
v-bind:src="options.img"
title="点击上传图片"
style="width: 100px; height: 100px; line-height: 200px"
/>
<i
v-else-if="!options.img && !video.VideoPath"
v-if="!options.img && !video.VideoPath"
class="el-icon-plus avatar-uploader-icon"
style="
position: absolute;
@ -62,9 +62,7 @@
<div
class="title"
v-if="
types != 'posterVideoUrl' &&
types != 'posterPictureUrl' &&
types != 'itemDirectoryUrl'
types == 'materialsCoverUrl'|| types == 'propagandaCoverUrl'
"
>请上传图片为800x800px的正方形</div>
</el-col>
@ -167,12 +165,15 @@ export default {
},
created() {
this.types = this.type;
console.log(this.types)
this.items = this.item;
if (this.tovideo == null) {
this.video.VideoPath = null;
} else if (this.tovideo == "") {
this.video.VideoPath = null;
} else {
console.log(this.tovideo)
this.video.VideoPath = process.env.VUE_APP_BASE_API + this.tovideo;
}
if (this.img == null) {
@ -182,7 +183,7 @@ export default {
} else {
this.options.img = process.env.VUE_APP_BASE_API + this.img;
}
if (this.types == "posterVideoUrl" || this.types == "itemDirectoryUrl") {
if (this.types == "materialsVideoUrl" || this.types == "itemDirectoryUrl") {
this.title = "上传视频";
} else {
this.title = "上传图片";
@ -249,7 +250,7 @@ export default {
//
beforeUpload(file) {
console.log(file)
if (this.types == "posterVideoUrl" || this.types == "itemDirectoryUrl") {
if (this.types == "materialsVideoUrl") {
const reader = new FileReader();
this.previews.data = file;
this.videoForm.showVideoPath = URL.createObjectURL(file);
@ -354,6 +355,35 @@ export default {
});
}
//
else if(this.types == "materialsCoverUrl"){
uploadFilefm(formData).then(response => {
if (response.code == 200) {
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
this.$emit("imgUrl", response.imgUrl);
this.openimg = false;
} else {
setTimeout(e => {
this.openimg = false;
}, 1000);
}
});
}
//
else if(this.types == "materialsVideoUrl"){
uploadFilefm(formData).then(response => {
if (response.code == 200) {
this.options.img = process.env.VUE_APP_BASE_API + response.imgUrl;
this.$emit("imgUrl", response.imgUrl);
this.openimg = false;
} else {
setTimeout(e => {
this.openimg = false;
}, 1000);
}
});
}
else {
updateNurseStationHeads(formData).then(response => {
if (response.code == 200) {