素材信息

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' 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({ return request({
url: '/system/department/listWechatTemplateNum', url: '/manage/propaganda/selectNumByDept',
method: 'get', method: 'get',
params: query params: query
}) })

View File

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

View File

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

View File

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