feat:双视频流模块

This commit is contained in:
liujinming 2024-03-25 15:17:10 +08:00
parent 28e071ac29
commit 1b95ce63c2
8 changed files with 1038 additions and 0 deletions

View File

@ -0,0 +1,104 @@
package com.god.web.controller.rescue;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.god.common.annotation.Log;
import com.god.common.core.controller.BaseController;
import com.god.common.core.domain.AjaxResult;
import com.god.common.enums.BusinessType;
import com.god. rescue.domain.RescueStreamConference;
import com.god. rescue.service.IRescueStreamConferenceService;
import com.god.common.utils.poi.ExcelUtil;
import com.god.common.core.page.TableDataInfo;
/**
* streamConferenceController
*
* @author ljm
* @date 2024-03-25
*/
@RestController
@RequestMapping("/rescue/streamConference")
public class RescueStreamConferenceController extends BaseController
{
@Autowired
private IRescueStreamConferenceService rescueStreamConferenceService;
/**
* 查询streamConference列表
*/
@PreAuthorize("@ss.hasPermi('rescue:streamConference:list')")
@GetMapping("/list")
public TableDataInfo list(RescueStreamConference rescueStreamConference)
{
startPage();
List<RescueStreamConference> list = rescueStreamConferenceService.selectRescueStreamConferenceList(rescueStreamConference);
return getDataTable(list);
}
/**
* 导出streamConference列表
*/
@PreAuthorize("@ss.hasPermi('rescue:streamConference:export')")
@Log(title = "streamConference", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RescueStreamConference rescueStreamConference)
{
List<RescueStreamConference> list = rescueStreamConferenceService.selectRescueStreamConferenceList(rescueStreamConference);
ExcelUtil<RescueStreamConference> util = new ExcelUtil<RescueStreamConference>(RescueStreamConference.class);
util.exportExcel(response, list, "streamConference数据");
}
/**
* 获取streamConference详细信息
*/
@PreAuthorize("@ss.hasPermi('rescue:streamConference:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return success(rescueStreamConferenceService.selectRescueStreamConferenceById(id));
}
/**
* 新增streamConference
*/
@PreAuthorize("@ss.hasPermi('rescue:streamConference:add')")
@Log(title = "streamConference", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody RescueStreamConference rescueStreamConference)
{
return toAjax(rescueStreamConferenceService.insertRescueStreamConference(rescueStreamConference));
}
/**
* 修改streamConference
*/
@PreAuthorize("@ss.hasPermi('rescue:streamConference:edit')")
@Log(title = "streamConference", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody RescueStreamConference rescueStreamConference)
{
return toAjax(rescueStreamConferenceService.updateRescueStreamConference(rescueStreamConference));
}
/**
* 删除streamConference
*/
@PreAuthorize("@ss.hasPermi('rescue:streamConference:remove')")
@Log(title = "streamConference", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(rescueStreamConferenceService.deleteRescueStreamConferenceByIds(ids));
}
}

View File

@ -0,0 +1,197 @@
package com.god.rescue.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.god.common.annotation.Excel;
import com.god.common.core.domain.BaseEntity;
/**
* streamConference对象 rescue_stream_conference
*
* @author ljm
* @date 2024-03-25
*/
public class RescueStreamConference extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private String id;
/** 名称 */
@Excel(name = "名称")
private String name;
/** 描述 */
@Excel(name = "描述")
private String description;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date startTime;
/** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date endTime;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 主流视频URl */
@Excel(name = "主流视频URl")
private String primaryStreamUrl;
/** 辅助视频url */
@Excel(name = "辅助视频url")
private String secondaryStreamUrl;
/** 参与人员 */
@Excel(name = "参与人员")
private String person;
/** 主持人 */
@Excel(name = "主持人")
private String moderator;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String creator;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String updater;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setStartTime(Date startTime)
{
this.startTime = startTime;
}
public Date getStartTime()
{
return startTime;
}
public void setEndTime(Date endTime)
{
this.endTime = endTime;
}
public Date getEndTime()
{
return endTime;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setPrimaryStreamUrl(String primaryStreamUrl)
{
this.primaryStreamUrl = primaryStreamUrl;
}
public String getPrimaryStreamUrl()
{
return primaryStreamUrl;
}
public void setSecondaryStreamUrl(String secondaryStreamUrl)
{
this.secondaryStreamUrl = secondaryStreamUrl;
}
public String getSecondaryStreamUrl()
{
return secondaryStreamUrl;
}
public void setPerson(String person)
{
this.person = person;
}
public String getPerson()
{
return person;
}
public void setModerator(String moderator)
{
this.moderator = moderator;
}
public String getModerator()
{
return moderator;
}
public void setCreator(String creator)
{
this.creator = creator;
}
public String getCreator()
{
return creator;
}
public void setUpdater(String updater)
{
this.updater = updater;
}
public String getUpdater()
{
return updater;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("description", getDescription())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.append("status", getStatus())
.append("primaryStreamUrl", getPrimaryStreamUrl())
.append("secondaryStreamUrl", getSecondaryStreamUrl())
.append("person", getPerson())
.append("moderator", getModerator())
.append("creator", getCreator())
.append("updater", getUpdater())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.god.rescue.mapper;
import java.util.List;
import com.god. rescue.domain.RescueStreamConference;
/**
* streamConferenceMapper接口
*
* @author ljm
* @date 2024-03-25
*/
public interface RescueStreamConferenceMapper
{
/**
* 查询streamConference
*
* @param id streamConference主键
* @return streamConference
*/
public RescueStreamConference selectRescueStreamConferenceById(String id);
/**
* 查询streamConference列表
*
* @param rescueStreamConference streamConference
* @return streamConference集合
*/
public List<RescueStreamConference> selectRescueStreamConferenceList(RescueStreamConference rescueStreamConference);
/**
* 新增streamConference
*
* @param rescueStreamConference streamConference
* @return 结果
*/
public int insertRescueStreamConference(RescueStreamConference rescueStreamConference);
/**
* 修改streamConference
*
* @param rescueStreamConference streamConference
* @return 结果
*/
public int updateRescueStreamConference(RescueStreamConference rescueStreamConference);
/**
* 删除streamConference
*
* @param id streamConference主键
* @return 结果
*/
public int deleteRescueStreamConferenceById(String id);
/**
* 批量删除streamConference
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteRescueStreamConferenceByIds(String[] ids);
}

View File

@ -0,0 +1,61 @@
package com.god.rescue.service;
import java.util.List;
import com.god. rescue.domain.RescueStreamConference;
/**
* streamConferenceService接口
*
* @author ljm
* @date 2024-03-25
*/
public interface IRescueStreamConferenceService
{
/**
* 查询streamConference
*
* @param id streamConference主键
* @return streamConference
*/
public RescueStreamConference selectRescueStreamConferenceById(String id);
/**
* 查询streamConference列表
*
* @param rescueStreamConference streamConference
* @return streamConference集合
*/
public List<RescueStreamConference> selectRescueStreamConferenceList(RescueStreamConference rescueStreamConference);
/**
* 新增streamConference
*
* @param rescueStreamConference streamConference
* @return 结果
*/
public int insertRescueStreamConference(RescueStreamConference rescueStreamConference);
/**
* 修改streamConference
*
* @param rescueStreamConference streamConference
* @return 结果
*/
public int updateRescueStreamConference(RescueStreamConference rescueStreamConference);
/**
* 批量删除streamConference
*
* @param ids 需要删除的streamConference主键集合
* @return 结果
*/
public int deleteRescueStreamConferenceByIds(String[] ids);
/**
* 删除streamConference信息
*
* @param id streamConference主键
* @return 结果
*/
public int deleteRescueStreamConferenceById(String id);
}

View File

@ -0,0 +1,96 @@
package com.god.rescue.service.impl;
import java.util.List;
import com.god.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.god. rescue.mapper.RescueStreamConferenceMapper;
import com.god. rescue.domain.RescueStreamConference;
import com.god. rescue.service.IRescueStreamConferenceService;
/**
* streamConferenceService业务层处理
*
* @author ljm
* @date 2024-03-25
*/
@Service
public class RescueStreamConferenceServiceImpl implements IRescueStreamConferenceService
{
@Autowired
private RescueStreamConferenceMapper rescueStreamConferenceMapper;
/**
* 查询streamConference
*
* @param id streamConference主键
* @return streamConference
*/
@Override
public RescueStreamConference selectRescueStreamConferenceById(String id)
{
return rescueStreamConferenceMapper.selectRescueStreamConferenceById(id);
}
/**
* 查询streamConference列表
*
* @param rescueStreamConference streamConference
* @return streamConference
*/
@Override
public List<RescueStreamConference> selectRescueStreamConferenceList(RescueStreamConference rescueStreamConference)
{
return rescueStreamConferenceMapper.selectRescueStreamConferenceList(rescueStreamConference);
}
/**
* 新增streamConference
*
* @param rescueStreamConference streamConference
* @return 结果
*/
@Override
public int insertRescueStreamConference(RescueStreamConference rescueStreamConference)
{
rescueStreamConference.setCreateTime(DateUtils.getNowDate());
return rescueStreamConferenceMapper.insertRescueStreamConference(rescueStreamConference);
}
/**
* 修改streamConference
*
* @param rescueStreamConference streamConference
* @return 结果
*/
@Override
public int updateRescueStreamConference(RescueStreamConference rescueStreamConference)
{
rescueStreamConference.setUpdateTime(DateUtils.getNowDate());
return rescueStreamConferenceMapper.updateRescueStreamConference(rescueStreamConference);
}
/**
* 批量删除streamConference
*
* @param ids 需要删除的streamConference主键
* @return 结果
*/
@Override
public int deleteRescueStreamConferenceByIds(String[] ids)
{
return rescueStreamConferenceMapper.deleteRescueStreamConferenceByIds(ids);
}
/**
* 删除streamConference信息
*
* @param id streamConference主键
* @return 结果
*/
@Override
public int deleteRescueStreamConferenceById(String id)
{
return rescueStreamConferenceMapper.deleteRescueStreamConferenceById(id);
}
}

View File

@ -0,0 +1,116 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.god.rescue.mapper.RescueStreamConferenceMapper">
<resultMap type="RescueStreamConference" id="RescueStreamConferenceResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="description" column="description" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="status" column="status" />
<result property="primaryStreamUrl" column="primary_stream_url" />
<result property="secondaryStreamUrl" column="secondary_stream_url" />
<result property="person" column="person" />
<result property="moderator" column="moderator" />
<result property="creator" column="creator" />
<result property="updater" column="updater" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectRescueStreamConferenceVo">
select id, name, description, start_time, end_time, status, primary_stream_url, secondary_stream_url, person, moderator, creator, updater, create_time, update_time from rescue_stream_conference
</sql>
<select id="selectRescueStreamConferenceList" parameterType="RescueStreamConference" resultMap="RescueStreamConferenceResult">
<include refid="selectRescueStreamConferenceVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="startTime != null "> and start_time = #{startTime}</if>
<if test="endTime != null "> and end_time = #{endTime}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="primaryStreamUrl != null and primaryStreamUrl != ''"> and primary_stream_url = #{primaryStreamUrl}</if>
<if test="secondaryStreamUrl != null and secondaryStreamUrl != ''"> and secondary_stream_url = #{secondaryStreamUrl}</if>
<if test="person != null and person != ''"> and person like concat('%', #{person}, '%')</if>
<if test="moderator != null and moderator != ''"> and moderator like concat('%', #{moderator}, '%')</if>
<if test="creator != null and creator != ''"> and creator = #{creator}</if>
<if test="updater != null and updater != ''"> and updater = #{updater}</if>
</where>
</select>
<select id="selectRescueStreamConferenceById" parameterType="String" resultMap="RescueStreamConferenceResult">
<include refid="selectRescueStreamConferenceVo"/>
where id = #{id}
</select>
<insert id="insertRescueStreamConference" parameterType="RescueStreamConference">
insert into rescue_stream_conference
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="name != null and name != ''">name,</if>
<if test="description != null">description,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="status != null and status != ''">status,</if>
<if test="primaryStreamUrl != null and primaryStreamUrl != ''">primary_stream_url,</if>
<if test="secondaryStreamUrl != null">secondary_stream_url,</if>
<if test="person != null and person != ''">person,</if>
<if test="moderator != null and moderator != ''">moderator,</if>
<if test="creator != null">creator,</if>
<if test="updater != null">updater,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="name != null and name != ''">#{name},</if>
<if test="description != null">#{description},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="status != null and status != ''">#{status},</if>
<if test="primaryStreamUrl != null and primaryStreamUrl != ''">#{primaryStreamUrl},</if>
<if test="secondaryStreamUrl != null">#{secondaryStreamUrl},</if>
<if test="person != null and person != ''">#{person},</if>
<if test="moderator != null and moderator != ''">#{moderator},</if>
<if test="creator != null">#{creator},</if>
<if test="updater != null">#{updater},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateRescueStreamConference" parameterType="RescueStreamConference">
update rescue_stream_conference
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if>
<if test="description != null">description = #{description},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="status != null and status != ''">status = #{status},</if>
<if test="primaryStreamUrl != null and primaryStreamUrl != ''">primary_stream_url = #{primaryStreamUrl},</if>
<if test="secondaryStreamUrl != null">secondary_stream_url = #{secondaryStreamUrl},</if>
<if test="person != null and person != ''">person = #{person},</if>
<if test="moderator != null and moderator != ''">moderator = #{moderator},</if>
<if test="creator != null">creator = #{creator},</if>
<if test="updater != null">updater = #{updater},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRescueStreamConferenceById" parameterType="String">
delete from rescue_stream_conference where id = #{id}
</delete>
<delete id="deleteRescueStreamConferenceByIds" parameterType="String">
delete from rescue_stream_conference where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询streamConference列表
export function listStreamConference(query) {
return request({
url: '/rescue/streamConference/list',
method: 'get',
params: query
})
}
// 查询streamConference详细
export function getStreamConference(id) {
return request({
url: '/rescue/streamConference/' + id,
method: 'get'
})
}
// 新增streamConference
export function addStreamConference(data) {
return request({
url: '/rescue/streamConference',
method: 'post',
data: data
})
}
// 修改streamConference
export function updateStreamConference(data) {
return request({
url: '/rescue/streamConference',
method: 'put',
data: data
})
}
// 删除streamConference
export function delStreamConference(id) {
return request({
url: '/rescue/streamConference/' + id,
method: 'delete'
})
}

View File

@ -0,0 +1,359 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="主持人" prop="moderator">
<el-input
v-model="queryParams.moderator"
placeholder="请输入主持人"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="[' rescue:streamConference:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="[' rescue:streamConference:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="[' rescue:streamConference:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="[' rescue:streamConference:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="streamConferenceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="名称" align="center" prop="name" />
<el-table-column label="主持人" align="center" prop="moderator" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="参与人员" align="center" prop="person" />
<el-table-column label="开始时间" align="center" prop="startTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="结束时间" align="center" prop="endTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="描述" align="center" prop="description" />
<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="[' rescue:streamConference:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="[' rescue:streamConference:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改streamConference对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="主持人" prop="moderator">
<el-input v-model="form.moderator" placeholder="请输入主持人" />
</el-form-item>
<el-form-item label="参与人员" prop="person">
<el-input v-model="form.person" placeholder="请输入参与人员" />
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker clearable
v-model="form.startTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择开始时间">
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker clearable
v-model="form.endTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择结束时间">
</el-date-picker>
</el-form-item>
<el-form-item label="描述" prop="description">
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="主流视频" prop="primaryStreamUrl">
<file-upload v-model="form.primaryStreamUrl" :file-type="type" :file-size="500"/>
</el-form-item>
<el-form-item label="辅助视频" prop="secondaryStreamUrl">
<file-upload v-model="form.secondaryStreamUrl" :file-type="type" :file-size="500"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listStreamConference, getStreamConference, delStreamConference, addStreamConference, updateStreamConference } from "@/api/rescue/streamConference";
export default {
name: "StreamConference",
dicts: ['sys_normal_disable'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// streamConference
streamConferenceList: [],
//
title: "",
//
open: false,
type:['mp4'],
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
description: null,
startTime: null,
endTime: null,
status: null,
primaryStreamUrl: null,
secondaryStreamUrl: null,
person: null,
moderator: null,
creator: null,
updater: null,
},
//
form: {},
//
rules: {
name: [
{ required: true, message: "名称不能为空", trigger: "blur" }
],
status: [
{ required: true, message: "状态不能为空", trigger: "change" }
],
primaryStreamUrl: [
{ required: true, message: "主流视频URl不能为空", trigger: "blur" }
],
person: [
{ required: true, message: "参与人员不能为空", trigger: "blur" }
],
moderator: [
{ required: true, message: "主持人不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询streamConference列表 */
getList() {
this.loading = true;
listStreamConference(this.queryParams).then(response => {
this.streamConferenceList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
name: null,
description: null,
startTime: null,
endTime: null,
status: null,
primaryStreamUrl: null,
secondaryStreamUrl: null,
person: null,
moderator: null,
creator: null,
updater: null,
createTime: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加双视频流会议";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getStreamConference(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改双视频流会议";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateStreamConference(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addStreamConference(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除双视频流会议编号为"' + ids + '"的数据项?').then(function() {
return delStreamConference(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(' rescue/streamConference/export', {
...this.queryParams
}, `streamConference_${new Date().getTime()}.xlsx`)
}
}
};
</script>