Commit 6847faeb authored by zhouxudong's avatar zhouxudong

添加系统级别图片

parent a9282811
package com.ruoyi.system.controller;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.SysCommonFile;
import com.ruoyi.system.service.ISysCommonFileService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 系统级别附件(图片、视频)Controller
*
* @author ruoyi
* @date 2023-12-19
*/
@Controller
@RequestMapping("/system/file")
public class SysCommonFileController extends BaseController
{
private String prefix = "file";
@Autowired
private ISysCommonFileService sysCommonFileService;
@RequiresPermissions("system:file:view")
@GetMapping()
public String file()
{
return prefix + "/file";
}
/**
* 查询系统级别附件(图片、视频)列表
*/
@RequiresPermissions("system:file:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(SysCommonFile sysCommonFile)
{
startPage();
List<SysCommonFile> list = sysCommonFileService.selectSysCommonFileList(sysCommonFile);
return getDataTable(list);
}
/**
* 导出系统级别附件(图片、视频)列表
*/
@RequiresPermissions("system:file:export")
@Log(title = "系统级别附件(图片、视频)", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysCommonFile sysCommonFile)
{
List<SysCommonFile> list = sysCommonFileService.selectSysCommonFileList(sysCommonFile);
ExcelUtil<SysCommonFile> util = new ExcelUtil<SysCommonFile>(SysCommonFile.class);
return util.exportExcel(list, "系统级别附件(图片、视频)数据");
}
/**
* 新增系统级别附件(图片、视频)
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存系统级别附件(图片、视频)
*/
@RequiresPermissions("system:file:add")
@Log(title = "系统级别附件(图片、视频)", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(SysCommonFile sysCommonFile)
{
return toAjax(sysCommonFileService.insertSysCommonFile(sysCommonFile));
}
/**
* 修改系统级别附件(图片、视频)
*/
@RequiresPermissions("system:file:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
SysCommonFile sysCommonFile = sysCommonFileService.selectSysCommonFileById(id);
mmap.put("sysCommonFile", sysCommonFile);
return prefix + "/edit";
}
/**
* 修改保存系统级别附件(图片、视频)
*/
@RequiresPermissions("system:file:edit")
@Log(title = "系统级别附件(图片、视频)", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(SysCommonFile sysCommonFile)
{
return toAjax(sysCommonFileService.updateSysCommonFile(sysCommonFile));
}
/**
* 删除系统级别附件(图片、视频)
*/
@RequiresPermissions("system:file:remove")
@Log(title = "系统级别附件(图片、视频)", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(sysCommonFileService.deleteSysCommonFileByIds(ids));
}
}
package com.ruoyi.system.domain;
import lombok.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.Date;
/**
* 系统级别附件(图片、视频)对象 sys_common_file
*
* @author ruoyi
* @date 2023-12-19
*/
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class SysCommonFile {
/** 主键id */
private Long id;
/** 附件地址 */
@Excel(name = "附件地址")
private String imgUrl;
/** 描述信息 */
@Excel(name = "描述信息")
private String description;
/** 是否启用 */
@Excel(name = "是否启用")
private Integer status;
/** 类型 */
@Excel(name = "类型")
private String type;
/** 排序 */
@Excel(name = "排序")
private Integer sort;
/** 图片链接 */
@Excel(name = "图片链接")
private String linkUrl;
/** 附件类型 */
@Excel(name = "附件类型")
private Integer urlType;
/** 视频封面图片 */
@Excel(name = "视频封面图片")
private String videoCover;
/** 备注字段1 */
private String r1;
/** 备注字段2 */
private String r2;
/** 备注字段3 */
private String r3;
/** 乐观锁 */
@Excel(name = "乐观锁")
private Long version;
private Date createTime;
private Date updateTime;
private String createBy;
private String updateBy;
}
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.SysCommonFile;
/**
* 系统级别附件(图片、视频)Mapper接口
*
* @author ruoyi
* @date 2023-12-19
*/
public interface SysCommonFileMapper
{
/**
* 查询系统级别附件(图片、视频)
*
* @param id 系统级别附件(图片、视频)主键
* @return 系统级别附件(图片、视频)
*/
public SysCommonFile selectSysCommonFileById(Long id);
/**
* 查询系统级别附件(图片、视频)列表
*
* @param sysCommonFile 系统级别附件(图片、视频)
* @return 系统级别附件(图片、视频)集合
*/
public List<SysCommonFile> selectSysCommonFileList(SysCommonFile sysCommonFile);
/**
* 新增系统级别附件(图片、视频)
*
* @param sysCommonFile 系统级别附件(图片、视频)
* @return 结果
*/
public int insertSysCommonFile(SysCommonFile sysCommonFile);
/**
* 修改系统级别附件(图片、视频)
*
* @param sysCommonFile 系统级别附件(图片、视频)
* @return 结果
*/
public int updateSysCommonFile(SysCommonFile sysCommonFile);
/**
* 删除系统级别附件(图片、视频)
*
* @param id 系统级别附件(图片、视频)主键
* @return 结果
*/
public int deleteSysCommonFileById(Long id);
/**
* 批量删除系统级别附件(图片、视频)
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteSysCommonFileByIds(String[] ids);
}
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.SysCommonFile;
/**
* 系统级别附件(图片、视频)Service接口
*
* @author ruoyi
* @date 2023-12-19
*/
public interface ISysCommonFileService
{
/**
* 查询系统级别附件(图片、视频)
*
* @param id 系统级别附件(图片、视频)主键
* @return 系统级别附件(图片、视频)
*/
public SysCommonFile selectSysCommonFileById(Long id);
/**
* 查询系统级别附件(图片、视频)列表
*
* @param sysCommonFile 系统级别附件(图片、视频)
* @return 系统级别附件(图片、视频)集合
*/
public List<SysCommonFile> selectSysCommonFileList(SysCommonFile sysCommonFile);
/**
* 新增系统级别附件(图片、视频)
*
* @param sysCommonFile 系统级别附件(图片、视频)
* @return 结果
*/
public int insertSysCommonFile(SysCommonFile sysCommonFile);
/**
* 修改系统级别附件(图片、视频)
*
* @param sysCommonFile 系统级别附件(图片、视频)
* @return 结果
*/
public int updateSysCommonFile(SysCommonFile sysCommonFile);
/**
* 批量删除系统级别附件(图片、视频)
*
* @param ids 需要删除的系统级别附件(图片、视频)主键集合
* @return 结果
*/
public int deleteSysCommonFileByIds(String ids);
/**
* 删除系统级别附件(图片、视频)信息
*
* @param id 系统级别附件(图片、视频)主键
* @return 结果
*/
public int deleteSysCommonFileById(Long id);
}
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysCommonFileMapper;
import com.ruoyi.system.domain.SysCommonFile;
import com.ruoyi.system.service.ISysCommonFileService;
import com.ruoyi.common.core.text.Convert;
/**
* 系统级别附件(图片、视频)Service业务层处理
*
* @author ruoyi
* @date 2023-12-19
*/
@Service
public class SysCommonFileServiceImpl implements ISysCommonFileService
{
@Autowired
private SysCommonFileMapper sysCommonFileMapper;
/**
* 查询系统级别附件(图片、视频)
*
* @param id 系统级别附件(图片、视频)主键
* @return 系统级别附件(图片、视频)
*/
@Override
public SysCommonFile selectSysCommonFileById(Long id)
{
return sysCommonFileMapper.selectSysCommonFileById(id);
}
/**
* 查询系统级别附件(图片、视频)列表
*
* @param sysCommonFile 系统级别附件(图片、视频)
* @return 系统级别附件(图片、视频)
*/
@Override
public List<SysCommonFile> selectSysCommonFileList(SysCommonFile sysCommonFile)
{
return sysCommonFileMapper.selectSysCommonFileList(sysCommonFile);
}
/**
* 新增系统级别附件(图片、视频)
*
* @param sysCommonFile 系统级别附件(图片、视频)
* @return 结果
*/
@Override
public int insertSysCommonFile(SysCommonFile sysCommonFile)
{
sysCommonFile.setCreateTime(DateUtils.getNowDate());
return sysCommonFileMapper.insertSysCommonFile(sysCommonFile);
}
/**
* 修改系统级别附件(图片、视频)
*
* @param sysCommonFile 系统级别附件(图片、视频)
* @return 结果
*/
@Override
public int updateSysCommonFile(SysCommonFile sysCommonFile)
{
sysCommonFile.setUpdateTime(DateUtils.getNowDate());
return sysCommonFileMapper.updateSysCommonFile(sysCommonFile);
}
/**
* 批量删除系统级别附件(图片、视频)
*
* @param ids 需要删除的系统级别附件(图片、视频)主键
* @return 结果
*/
@Override
public int deleteSysCommonFileByIds(String ids)
{
return sysCommonFileMapper.deleteSysCommonFileByIds(Convert.toStrArray(ids));
}
/**
* 删除系统级别附件(图片、视频)信息
*
* @param id 系统级别附件(图片、视频)主键
* @return 结果
*/
@Override
public int deleteSysCommonFileById(Long id)
{
return sysCommonFileMapper.deleteSysCommonFileById(id);
}
}
<?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.ruoyi.system.mapper.SysCommonFileMapper">
<resultMap type="SysCommonFile" id="SysCommonFileResult">
<result property="id" column="id" />
<result property="imgUrl" column="img_url" />
<result property="description" column="description" />
<result property="status" column="status" />
<result property="type" column="type" />
<result property="sort" column="sort" />
<result property="linkUrl" column="link_url" />
<result property="urlType" column="url_type" />
<result property="videoCover" column="video_cover" />
<result property="r1" column="r1" />
<result property="r2" column="r2" />
<result property="r3" column="r3" />
<result property="version" column="version" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectSysCommonFileVo">
select id, img_url, description, status, type, sort, link_url, url_type, video_cover, r1, r2, r3, version, create_by, create_time, update_by, update_time from sys_common_file
</sql>
<select id="selectSysCommonFileList" parameterType="SysCommonFile" resultMap="SysCommonFileResult">
<include refid="selectSysCommonFileVo"/>
<where>
<if test="imgUrl != null and imgUrl != ''"> and img_url = #{imgUrl}</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="status != null "> and status = #{status}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="sort != null "> and sort = #{sort}</if>
<if test="linkUrl != null and linkUrl != ''"> and link_url = #{linkUrl}</if>
<if test="urlType != null "> and url_type = #{urlType}</if>
<if test="videoCover != null and videoCover != ''"> and video_cover = #{videoCover}</if>
<if test="r1 != null and r1 != ''"> and r1 = #{r1}</if>
<if test="r2 != null and r2 != ''"> and r2 = #{r2}</if>
<if test="r3 != null and r3 != ''"> and r3 = #{r3}</if>
<if test="version != null "> and version = #{version}</if>
</where>
</select>
<select id="selectSysCommonFileById" parameterType="Long" resultMap="SysCommonFileResult">
<include refid="selectSysCommonFileVo"/>
where id = #{id}
</select>
<insert id="insertSysCommonFile" parameterType="SysCommonFile" useGeneratedKeys="true" keyProperty="id">
insert into sys_common_file
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="imgUrl != null">img_url,</if>
<if test="description != null">description,</if>
<if test="status != null">status,</if>
<if test="type != null">type,</if>
<if test="sort != null">sort,</if>
<if test="linkUrl != null">link_url,</if>
<if test="urlType != null">url_type,</if>
<if test="videoCover != null">video_cover,</if>
<if test="r1 != null">r1,</if>
<if test="r2 != null">r2,</if>
<if test="r3 != null">r3,</if>
<if test="version != null">version,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="imgUrl != null">#{imgUrl},</if>
<if test="description != null">#{description},</if>
<if test="status != null">#{status},</if>
<if test="type != null">#{type},</if>
<if test="sort != null">#{sort},</if>
<if test="linkUrl != null">#{linkUrl},</if>
<if test="urlType != null">#{urlType},</if>
<if test="videoCover != null">#{videoCover},</if>
<if test="r1 != null">#{r1},</if>
<if test="r2 != null">#{r2},</if>
<if test="r3 != null">#{r3},</if>
<if test="version != null">#{version},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateSysCommonFile" parameterType="SysCommonFile">
update sys_common_file
<trim prefix="SET" suffixOverrides=",">
<if test="imgUrl != null">img_url = #{imgUrl},</if>
<if test="description != null">description = #{description},</if>
<if test="status != null">status = #{status},</if>
<if test="type != null">type = #{type},</if>
<if test="sort != null">sort = #{sort},</if>
<if test="linkUrl != null">link_url = #{linkUrl},</if>
<if test="urlType != null">url_type = #{urlType},</if>
<if test="videoCover != null">video_cover = #{videoCover},</if>
<if test="r1 != null">r1 = #{r1},</if>
<if test="r2 != null">r2 = #{r2},</if>
<if test="r3 != null">r3 = #{r3},</if>
<if test="version != null">version = #{version},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteSysCommonFileById" parameterType="Long">
delete from sys_common_file where id = #{id}
</delete>
<delete id="deleteSysCommonFileByIds" parameterType="String">
delete from sys_common_file where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
......@@ -66,9 +66,6 @@
shiro:hasPermission="carousel:info:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="carousel:info:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
......
......@@ -116,7 +116,7 @@
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.modal.openTab(\'轮播管理\',\'/carousel/info/infoDetail?associationId=' + row.id +'&type='+4+ '\')"><i class="fa fa-edit"></i>轮播管理</a> ');
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.modal.openTab(\'轮播管理\',\'/carousel/info/infoDetail?associationId=' + row.id +'&type='+4+ '\')"><i class="fa fa-edit"></i>轮播&视频管理</a> ');
actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.modal.openTab(\'VR管理\',\'/carousel/VRinfo/infoDetail?associationId=' + row.id +'&type='+4+'&urlType='+3+ '\')"><i class="fa fa-edit"></i>VR管理</a> ');
return actions.join('');
}
......
......@@ -590,7 +590,7 @@
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.modal.openTab(\'产业基金信息\',\'/developmentInfo/industryFund?developmentId=' + row.id + '\')"><i class="fa fa-edit"></i>产业基金管理</a> <br>');
actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.modal.openTab(\'产业用地信息\',\'/developmentInfo/industrialLand?developmentId=' + row.id + '\')"><i class="fa fa-edit"></i>用地管理</a> ');
actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.modal.openTab(\'VR管理\',\'/carousel/VRinfo/infoDetail?associationId=' + row.id +'&type='+1+'&urlType='+3+ '\')"><i class="fa fa-edit"></i>VR管理</a> ');
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.modal.openTab(\'轮播管理\',\'/carousel/info/infoDetail?associationId=' + row.id +'&type='+1+ '\')"><i class="fa fa-edit"></i>轮播管理</a> ');
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.modal.openTab(\'轮播管理\',\'/carousel/info/infoDetail?associationId=' + row.id +'&type='+1+ '\')"><i class="fa fa-edit"></i>轮播&视频管理</a> ');
let isSuper = row.isSuper;
if(isSuper===1){
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.modal.openTab(\'星级详情\',\'/star_object/info/infoDetail?businessId=' + row.id +'&type='+1+ '\')"><i class="fa fa-edit"></i>星级管理</a> ');
......
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增系统级别附件(图片、视频)')" />
<th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-file-add">
<!--<div class="form-group">
<label class="col-sm-3 control-label">附件地址:</label>
<div class="col-sm-8">
<input name="imgUrl" class="form-control" type="text">
</div>
</div>-->
<div class="form-group">
<label class="col-sm-3 control-label">图片地址链接:</label>
<div class="col-sm-8">
<input type="hidden" name="imgUrl" >
<div class="file-loading">
<input class="form-control img-upload" id="imgUrl" name="file" type="file">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">描述信息:</label>
<div class="col-sm-8">
<input name="description" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否启用:</label>
<div class="col-sm-8">
<select name="status" class="form-control m-b" th:with="type=${@dict.getType('sys_carousel_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">使用场景:</label>
<div class="col-sm-8">
<select name="type" class="form-control m-b" th:with="type=${@dict.getType('common_file_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">排序:</label>
<div class="col-sm-8">
<input name="sort" class="form-control" type="number">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">资源类型:</label>
<div class="col-sm-8">
<select id="urlType" name="urlType" class="form-control m-b" th:with="type=${@dict.getType('sys_carousel_urltype')}" >
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">图片链接:</label>
<div class="col-sm-8">
<input name="linkUrl" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">视频封面图片:</label>
<div class="col-sm-8">
<input type="hidden" name="videoCover" >
<div class="file-loading">
<input class="form-control img-upload" id="videoCover" name="file" type="file">
</div>
</div>
<!-- <div class="col-sm-8">
<input name="videoCover" class="form-control" type="text">
</div>-->
</div>
<input name="version" class="form-control" type="hidden">
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
var prefix = ctx + "system/file"
$("#form-file-add").validate({
focusCleanup: true
});
$(".img-upload").each(function (i) {
var val = $("input[name='" + this.id + "']").val()
$(this).fileinput({
// 'uploadUrl': ctx + 'common/upload',
'uploadUrl': ctx + 'sysFile/uploadImgHuawei',
initialPreviewAsData: true,
initialPreview: [val],
maxFileCount: 1,
autoReplace: true
}).on('fileuploaded', function (event, data, previewId, index) {
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
}).on('fileremoved', function (event, id, index) {
$("input[name='" + event.currentTarget.id + "']").val('')
})
$(this).fileinput('_initFileActions');
});
function submitHandler() {
if(!$("input[name='imgUrl']").val()){
$.modal.msgWarning('请点击上传按钮上传文件')
return;
}
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-file-add').serialize());
}
}
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改系统级别附件(图片、视频)')" />
<th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-file-edit" th:object="${sysCommonFile}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">图片地址链接:</label>
<div class="col-sm-8">
<input type="hidden" name="imgUrl" th:field="*{imgUrl}">
<div class="file-loading">
<input class="form-control img-upload" id="imgUrl" name="file" type="file">
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">描述信息:</label>
<div class="col-sm-8">
<input name="description" th:field="*{description}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">是否启用:</label>
<div class="col-sm-8">
<select name="status" class="form-control m-b" th:with="type=${@dict.getType('sys_carousel_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{status}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">使用场景:</label>
<div class="col-sm-8">
<select name="type" class="form-control m-b" th:with="type=${@dict.getType('common_file_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{type}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">排序:</label>
<div class="col-sm-8">
<input name="sort" th:field="*{sort}" class="form-control" type="number">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">资源类型:</label>
<div class="col-sm-8">
<select id="urlType" name="urlType" class="form-control m-b" th:with="type=${@dict.getType('sys_carousel_urltype')}" >
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{urlType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">图片链接:</label>
<div class="col-sm-8">
<input name="linkUrl" th:field="*{linkUrl}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">视频封面图片:</label>
<div class="col-sm-8">
<input type="hidden" name="videoCover" th:field="*{videoCover}">
<div class="file-loading">
<input class="form-control img-upload" id="videoCover" name="file" type="file">
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-fileinput-js"/>
<script th:inline="javascript">
var prefix = ctx + "system/file";
$("#form-file-edit").validate({
focusCleanup: true
});
$(".img-upload").each(function (i) {
var val = $("input[name='" + this.id + "']").val()
$(this).fileinput({
// 'uploadUrl': ctx + 'common/upload',
'uploadUrl': ctx + 'sysFile/uploadImgHuawei',
initialPreviewAsData: true,
initialPreview: [val],
maxFileCount: 1,
autoReplace: true
}).on('fileuploaded', function (event, data, previewId, index) {
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
}).on('fileremoved', function (event, id, index) {
$("input[name='" + event.currentTarget.id + "']").val('')
})
$(this).fileinput('_initFileActions');
});
function submitHandler() {
if(!$("input[name='imgUrl']").val()){
$.modal.msgWarning('请点击上传按钮上传文件')
return;
}
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-file-edit').serialize());
}
}
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('系统级别附件(图片、视频)列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<!-- <form id="formId">
<div class="select-list">
<ul>
<li>
<label>附件地址:</label>
<input type="text" name="imgUrl"/>
</li>
<li>
<label>描述信息:</label>
<input type="text" name="description"/>
</li>
<li>
<label>排序:</label>
<input type="text" name="sort"/>
</li>
<li>
<label>图片链接:</label>
<input type="text" name="linkUrl"/>
</li>
<li>
<label>视频封面图片:</label>
<input type="text" name="videoCover"/>
</li>
<li>
<label>备注字段1:</label>
<input type="text" name="r1"/>
</li>
<li>
<label>备注字段2:</label>
<input type="text" name="r2"/>
</li>
<li>
<label>备注字段3:</label>
<input type="text" name="r3"/>
</li>
<li>
<label>乐观锁:</label>
<input type="text" name="version"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>-->
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:file:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:file:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:file:remove">
<i class="fa fa-remove"></i> 删除
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('system:file:edit')}]];
var removeFlag = [[${@permission.hasPermi('system:file:remove')}]];
var fileType = [[${@dict.getType('common_file_type')}]];
var datasUrlType = [[${@dict.getType('sys_carousel_urltype')}]];
var prefix = ctx + "system/file";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "系统级别附件(图片、视频)",
columns: [{
checkbox: true
},
{
field: 'id',
title: '主键id',
visible: false
},
{
field: 'imgUrl',
formatter: function (value, row, index) {
let urlType = row.urlType;
var actions = [];
if (urlType == 1) {
actions.push('<img style="width:50px;height:50px" src=' + value + '>');
} else if (urlType == 2) {
actions.push
('<video style="width:50px;height:50px" controls>' +
'<source src="' + value + '" type="video/mp4">' +
' 您的浏览器不支持Video标签。' +
'</video>');
}
return actions.join('');
},
title: '附件地址'
},
{
field: 'description',
title: '描述信息'
},
{
field: 'status',
title: '是否启用',
formatter: function (value, row, index) {
return value===1?"是":"否";
}
},
{
field: 'type',
title: '使用场景',
formatter: function (value, row, index) {
return $.table.selectDictLabel(fileType, value);
}
},
{
field: 'linkUrl',
title: '图片链接'
},
{
field: 'urlType',
title: '资源类型',
formatter: function (value, row, index) {
return $.table.selectDictLabel(datasUrlType, value);
}
},
{
field: 'sort',
title: '排序'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>
......@@ -115,7 +115,7 @@
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.modal.openTab(\'轮播管理\',\'/carousel/info/infoDetail?associationId=' + row.id +'&type='+3+ '\')"><i class="fa fa-edit"></i>轮播管理</a> ');
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.modal.openTab(\'轮播管理\',\'/carousel/info/infoDetail?associationId=' + row.id +'&type='+3+ '\')"><i class="fa fa-edit"></i>轮播&视频管理</a> ');
actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.modal.openTab(\'VR管理\',\'/carousel/VRinfo/infoDetail?associationId=' + row.id +'&type='+3+'&urlType='+3+ '\')"><i class="fa fa-edit"></i>VR管理</a> ');
return actions.join('');
}
......
......@@ -408,7 +408,7 @@
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" style="margin-top:5px" href="javascript:void(0)" onclick="$.modal.openTab(\'招商方向信息\',\'/parkinfo/investmentdirection?parkId=' + id + '\')"><i class="fa fa-edit"></i>招商方向管理</a> ');
actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" style="margin-top:5px" href="javascript:void(0)" onclick="$.modal.openTab(\'政策信息\',\'/parkinfo/policy?parkId=' + id + '\')"><i class="fa fa-edit"></i>政策管理</a> <br> ');
actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" style="margin-top:5px" href="javascript:void(0)" onclick="$.modal.openTab(\'VR管理\',\'/carousel/VRinfo/infoDetail?associationId=' + id +'&type='+2+'&urlType='+3+ '\')"><i class="fa fa-edit"></i>VR管理</a>');
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" style="margin-top:5px" href="javascript:void(0)" onclick="$.modal.openTab(\'轮播详情\',\'/carousel/info/infoDetail?associationId=' + id +'&type='+2+'\')"><i class="fa fa-edit"></i>轮播管理</a> ');
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" style="margin-top:5px" href="javascript:void(0)" onclick="$.modal.openTab(\'轮播详情\',\'/carousel/info/infoDetail?associationId=' + id +'&type='+2+'\')"><i class="fa fa-edit"></i>轮播&视频管理</a> ');
actions.push('<a class="btn btn-primary btn-xs ' + editFlag + '" style="margin-top:5px" href="javascript:void(0)" onclick="$.modal.openTab(\'星级详情\',\'/star_object/info/infoDetail?businessId=' + id +'&type='+2+'\')"><i class="fa fa-edit"></i>星级管理</a> ');
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" style="margin-top:5px" href="javascript:void(0)" onclick="$.operate.remove(\'' + id + '\')"><i class="fa fa-remove"></i>删除</a>');
let status = row.status;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment