增加 首页公司介绍维护
parent
a529d072a0
commit
b92857cbc7
@ -0,0 +1,138 @@
|
||||
package com.haiwei.manage.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
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.haiwei.common.annotation.Log;
|
||||
import com.haiwei.common.enums.BusinessType;
|
||||
import com.haiwei.manage.domain.BaseCompany;
|
||||
import com.haiwei.manage.service.IBaseCompanyService;
|
||||
import com.haiwei.common.core.controller.BaseController;
|
||||
import com.haiwei.common.core.domain.AjaxResult;
|
||||
import com.haiwei.common.utils.poi.ExcelUtil;
|
||||
import com.haiwei.common.core.page.TableDataInfo;
|
||||
|
||||
import static com.haiwei.common.core.domain.AjaxResult.success;
|
||||
|
||||
/**
|
||||
* 公司内容介绍Controller
|
||||
*
|
||||
* @author wangh
|
||||
* @date 2023-10-27
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/manage/company")
|
||||
public class BaseCompanyController extends BaseController
|
||||
{
|
||||
private String prefix = "manage/company";
|
||||
|
||||
@Autowired
|
||||
private IBaseCompanyService baseCompanyService;
|
||||
|
||||
@RequiresPermissions("manage:company:view")
|
||||
@GetMapping()
|
||||
public String company()
|
||||
{
|
||||
return prefix + "/company";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公司内容介绍列表
|
||||
*/
|
||||
@RequiresPermissions("manage:company:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BaseCompany baseCompany)
|
||||
{
|
||||
startPage();
|
||||
List<BaseCompany> list = baseCompanyService.selectBaseCompanyList(baseCompany);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(tags = {"首页"}, value = "公司介绍")
|
||||
@GetMapping("/home/queryCompany")
|
||||
@ResponseBody
|
||||
public AjaxResult queryCompany() {
|
||||
return success(baseCompanyService.selectBaseCompanyName());
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出公司内容介绍列表
|
||||
*/
|
||||
@RequiresPermissions("manage:company:export")
|
||||
@Log(title = "公司内容介绍", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BaseCompany baseCompany)
|
||||
{
|
||||
List<BaseCompany> list = baseCompanyService.selectBaseCompanyList(baseCompany);
|
||||
ExcelUtil<BaseCompany> util = new ExcelUtil<BaseCompany>(BaseCompany.class);
|
||||
return util.exportExcel(list, "company");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公司内容介绍
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存公司内容介绍
|
||||
*/
|
||||
@RequiresPermissions("manage:company:add")
|
||||
@Log(title = "公司内容介绍", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BaseCompany baseCompany)
|
||||
{
|
||||
return toAjax(baseCompanyService.insertBaseCompany(baseCompany));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公司内容介绍
|
||||
*/
|
||||
@GetMapping("/edit/{objid}")
|
||||
public String edit(@PathVariable("objid") Long objid, ModelMap mmap)
|
||||
{
|
||||
BaseCompany baseCompany = baseCompanyService.selectBaseCompanyById(objid);
|
||||
mmap.put("baseCompany", baseCompany);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存公司内容介绍
|
||||
*/
|
||||
@RequiresPermissions("manage:company:edit")
|
||||
@Log(title = "公司内容介绍", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BaseCompany baseCompany)
|
||||
{
|
||||
return toAjax(baseCompanyService.updateBaseCompany(baseCompany));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公司内容介绍
|
||||
*/
|
||||
@RequiresPermissions("manage:company:remove")
|
||||
@Log(title = "公司内容介绍", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(baseCompanyService.deleteBaseCompanyByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.haiwei.manage.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.haiwei.common.annotation.Excel;
|
||||
import com.haiwei.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 公司内容介绍对象 base_company
|
||||
*
|
||||
* @author wangh
|
||||
* @date 2023-10-27
|
||||
*/
|
||||
public class BaseCompany extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** null */
|
||||
private Long objid;
|
||||
|
||||
/** 公司介绍 */
|
||||
@Excel(name = "公司介绍")
|
||||
private String companyInfo;
|
||||
|
||||
public void setObjid(Long objid)
|
||||
{
|
||||
this.objid = objid;
|
||||
}
|
||||
|
||||
public Long getObjid()
|
||||
{
|
||||
return objid;
|
||||
}
|
||||
public void setCompanyInfo(String companyInfo)
|
||||
{
|
||||
this.companyInfo = companyInfo;
|
||||
}
|
||||
|
||||
public String getCompanyInfo()
|
||||
{
|
||||
return companyInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("objid", getObjid())
|
||||
.append("companyInfo", getCompanyInfo())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.haiwei.manage.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.haiwei.manage.domain.BaseCompany;
|
||||
|
||||
/**
|
||||
* 公司内容介绍Mapper接口
|
||||
*
|
||||
* @author wangh
|
||||
* @date 2023-10-27
|
||||
*/
|
||||
public interface BaseCompanyMapper
|
||||
{
|
||||
/**
|
||||
* 查询公司内容介绍
|
||||
*
|
||||
* @param objid 公司内容介绍ID
|
||||
* @return 公司内容介绍
|
||||
*/
|
||||
public BaseCompany selectBaseCompanyById(Long objid);
|
||||
|
||||
/**
|
||||
* 查询公司内容介绍列表
|
||||
*
|
||||
* @param baseCompany 公司内容介绍
|
||||
* @return 公司内容介绍集合
|
||||
*/
|
||||
public List<BaseCompany> selectBaseCompanyList(BaseCompany baseCompany);
|
||||
|
||||
/**
|
||||
* 新增公司内容介绍
|
||||
*
|
||||
* @param baseCompany 公司内容介绍
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseCompany(BaseCompany baseCompany);
|
||||
|
||||
/**
|
||||
* 修改公司内容介绍
|
||||
*
|
||||
* @param baseCompany 公司内容介绍
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseCompany(BaseCompany baseCompany);
|
||||
|
||||
/**
|
||||
* 删除公司内容介绍
|
||||
*
|
||||
* @param objid 公司内容介绍ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseCompanyById(Long objid);
|
||||
|
||||
/**
|
||||
* 批量删除公司内容介绍
|
||||
*
|
||||
* @param objids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseCompanyByIds(String[] objids);
|
||||
|
||||
String selectBaseCompanyName();
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.haiwei.manage.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.haiwei.manage.domain.BaseCompany;
|
||||
|
||||
/**
|
||||
* 公司内容介绍Service接口
|
||||
*
|
||||
* @author wangh
|
||||
* @date 2023-10-27
|
||||
*/
|
||||
public interface IBaseCompanyService
|
||||
{
|
||||
/**
|
||||
* 查询公司内容介绍
|
||||
*
|
||||
* @param objid 公司内容介绍ID
|
||||
* @return 公司内容介绍
|
||||
*/
|
||||
public BaseCompany selectBaseCompanyById(Long objid);
|
||||
|
||||
/**
|
||||
* 查询公司内容介绍列表
|
||||
*
|
||||
* @param baseCompany 公司内容介绍
|
||||
* @return 公司内容介绍集合
|
||||
*/
|
||||
public List<BaseCompany> selectBaseCompanyList(BaseCompany baseCompany);
|
||||
|
||||
/**
|
||||
* 新增公司内容介绍
|
||||
*
|
||||
* @param baseCompany 公司内容介绍
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseCompany(BaseCompany baseCompany);
|
||||
|
||||
/**
|
||||
* 修改公司内容介绍
|
||||
*
|
||||
* @param baseCompany 公司内容介绍
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseCompany(BaseCompany baseCompany);
|
||||
|
||||
/**
|
||||
* 批量删除公司内容介绍
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseCompanyByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除公司内容介绍信息
|
||||
*
|
||||
* @param objid 公司内容介绍ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseCompanyById(Long objid);
|
||||
|
||||
String selectBaseCompanyName();
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.haiwei.manage.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.haiwei.common.utils.DateUtils;
|
||||
import com.haiwei.framework.util.ShiroUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.haiwei.manage.mapper.BaseCompanyMapper;
|
||||
import com.haiwei.manage.domain.BaseCompany;
|
||||
import com.haiwei.manage.service.IBaseCompanyService;
|
||||
import com.haiwei.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 公司内容介绍Service业务层处理
|
||||
*
|
||||
* @author wangh
|
||||
* @date 2023-10-27
|
||||
*/
|
||||
@Service
|
||||
public class BaseCompanyServiceImpl implements IBaseCompanyService
|
||||
{
|
||||
@Autowired
|
||||
private BaseCompanyMapper baseCompanyMapper;
|
||||
|
||||
/**
|
||||
* 查询公司内容介绍
|
||||
*
|
||||
* @param objid 公司内容介绍ID
|
||||
* @return 公司内容介绍
|
||||
*/
|
||||
@Override
|
||||
public BaseCompany selectBaseCompanyById(Long objid)
|
||||
{
|
||||
return baseCompanyMapper.selectBaseCompanyById(objid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询公司内容介绍列表
|
||||
*
|
||||
* @param baseCompany 公司内容介绍
|
||||
* @return 公司内容介绍
|
||||
*/
|
||||
@Override
|
||||
public List<BaseCompany> selectBaseCompanyList(BaseCompany baseCompany)
|
||||
{
|
||||
return baseCompanyMapper.selectBaseCompanyList(baseCompany);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增公司内容介绍
|
||||
*
|
||||
* @param baseCompany 公司内容介绍
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBaseCompany(BaseCompany baseCompany)
|
||||
{
|
||||
baseCompany.setUpdateBy(ShiroUtils.getLoginName());
|
||||
baseCompany.setUpdateTime(DateUtils.getNowDate());
|
||||
return baseCompanyMapper.insertBaseCompany(baseCompany);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改公司内容介绍
|
||||
*
|
||||
* @param baseCompany 公司内容介绍
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBaseCompany(BaseCompany baseCompany)
|
||||
{
|
||||
baseCompany.setUpdateBy(ShiroUtils.getLoginName());
|
||||
baseCompany.setUpdateTime(DateUtils.getNowDate());
|
||||
return baseCompanyMapper.updateBaseCompany(baseCompany);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公司内容介绍对象
|
||||
*
|
||||
* @param ids 需要删除的数据ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseCompanyByIds(String ids)
|
||||
{
|
||||
return baseCompanyMapper.deleteBaseCompanyByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除公司内容介绍信息
|
||||
*
|
||||
* @param objid 公司内容介绍ID
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBaseCompanyById(Long objid)
|
||||
{
|
||||
return baseCompanyMapper.deleteBaseCompanyById(objid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String selectBaseCompanyName() {
|
||||
return baseCompanyMapper.selectBaseCompanyName();
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('公司内容介绍', '2045', '1', '/manage/company', 'C', '0', 'manage:company:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '公司内容介绍菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
|
||||
declare @parentId as int
|
||||
SELECT @parentId = SCOPE_IDENTITY();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('公司内容介绍查询', @parentId, '1', '#', 'F', '0', 'manage:company:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('公司内容介绍新增', @parentId, '2', '#', 'F', '0', 'manage:company:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('公司内容介绍修改', @parentId, '3', '#', 'F', '0', 'manage:company:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('公司内容介绍删除', @parentId, '4', '#', 'F', '0', 'manage:company:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('公司内容介绍导出', @parentId, '5', '#', 'F', '0', 'manage:company:export', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
|
@ -0,0 +1,69 @@
|
||||
<?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.haiwei.manage.mapper.BaseCompanyMapper">
|
||||
|
||||
<resultMap type="BaseCompany" id="BaseCompanyResult">
|
||||
<result property="objid" column="objid" />
|
||||
<result property="companyInfo" column="company_info" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseCompanyVo">
|
||||
select objid, company_info, update_by, update_time from base_company
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseCompanyName" resultType="string">
|
||||
select top 1 company_info from base_company order by update_time desc
|
||||
</select>
|
||||
<select id="selectBaseCompanyList" parameterType="BaseCompany" resultMap="BaseCompanyResult">
|
||||
<include refid="selectBaseCompanyVo"/>
|
||||
<where>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseCompanyById" parameterType="Long" resultMap="BaseCompanyResult">
|
||||
<include refid="selectBaseCompanyVo"/>
|
||||
where objid = #{objid}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseCompany" parameterType="BaseCompany">
|
||||
insert into base_company
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="objid != null">objid,</if>
|
||||
<if test="companyInfo != null">company_info,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="objid != null">#{objid},</if>
|
||||
<if test="companyInfo != null">#{companyInfo},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBaseCompany" parameterType="BaseCompany">
|
||||
update base_company
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="companyInfo != null">company_info = #{companyInfo},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where objid = #{objid}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseCompanyById" parameterType="Long">
|
||||
delete from base_company where objid = #{objid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseCompanyByIds" parameterType="String">
|
||||
delete from base_company where objid in
|
||||
<foreach item="objid" collection="array" open="(" separator="," close=")">
|
||||
#{objid}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增公司内容介绍')" />
|
||||
<th:block th:include="include :: summernote-css"/>
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-company-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">公司介绍:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="companyInfo" class="form-control" type="hidden">
|
||||
<div class="summernote" id="companyInfo"></div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: summernote-js"/>
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "manage/company"
|
||||
$("#form-company-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-company-add').serialize());
|
||||
}
|
||||
}
|
||||
$(function() {
|
||||
$('.summernote').summernote({
|
||||
lang: 'zh-CN',
|
||||
dialogsInBody: true,
|
||||
callbacks: {
|
||||
onChange: function(contents, $edittable) {
|
||||
$("input[name='" + this.id + "']").val(contents);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,90 @@
|
||||
<!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>-->
|
||||
<!-- <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>-->
|
||||
<!-- <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</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="manage:company:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="manage:company:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="manage:company:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="manage:company:export">
|
||||
<i class="fa fa-download"></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('manage:company:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('manage:company:remove')}]];
|
||||
var prefix = ctx + "manage/company";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "公司内容介绍",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'objid',
|
||||
title: 'null',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'companyInfo',
|
||||
title: '公司介绍'
|
||||
},
|
||||
{
|
||||
field: 'updateBy',
|
||||
title: '修改人'
|
||||
},
|
||||
{
|
||||
field: 'updateTime',
|
||||
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.objid + '\')"><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.objid + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改公司内容介绍')" />
|
||||
<th:block th:include="include :: summernote-css"/>
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-company-edit" th:object="${baseCompany}">
|
||||
<input name="objid" th:field="*{objid}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">公司介绍:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="companyInfo" th:field="*{companyInfo}" class="form-control" type="hidden">
|
||||
<div class="summernote" id="companyInfo"></div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<th:block th:include="include :: summernote-js"/>
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "manage/company";
|
||||
$("#form-company-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-company-edit').serialize());
|
||||
}
|
||||
}
|
||||
$(function() {
|
||||
$('.summernote').each(function(i) {
|
||||
$('#' + this.id).summernote({
|
||||
lang: 'zh-CN',
|
||||
dialogsInBody: true,
|
||||
callbacks: {
|
||||
onChange: function(contents, $edittable) {
|
||||
$("input[name='" + this.id + "']").val(contents);
|
||||
},
|
||||
}
|
||||
});
|
||||
var content = $("input[name='" + this.id + "']").val();
|
||||
$('#' + this.id).summernote('code', content);
|
||||
})
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue