增加 首页公司介绍维护

master
wangh 1 year ago
parent a529d072a0
commit b92857cbc7

1
.gitignore vendored

@ -22,6 +22,7 @@ target/
### IntelliJ IDEA ###
.idea
*.iws
*.yml
*.iml
*.ipr

@ -100,7 +100,7 @@ public class ApiController {
@ApiOperation(tags = {"60脱水机"}, value = "设备介绍")
@GetMapping("/home/deviceInfo")
public AjaxResult deviceInfo() {
return success(baseDeviceInfoService.selectBaseDeviceInfoList("60型脱水机"));
return success(baseDeviceInfoService.selectBaseDeviceInfoListByName("60型脱水机"));
}

@ -66,12 +66,12 @@ $(() => {
}
let po = [
{
top: 24,
left: 70
top: 33,
left: 73
},
{
top: 33,
left: 25
left: 38
},
]
console.log(data)
@ -79,7 +79,7 @@ $(() => {
po.forEach((e, i) => {
html += `<div class="status" style="top:${e.top}%;left:${e.left}%">
<div class="icon" style="background-image: url('../../board/img/${imgSrc(data.data[i].state)}.png');"></div>
<span>${data.data[i].state}</span>
<!-- <span>${data.data[i].state}</span>-->
</div>
`
})

@ -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();
}

@ -26,7 +26,7 @@ public interface IBaseDeviceInfoService
* @return
*/
public List<BaseDeviceInfo> selectBaseDeviceInfoList(BaseDeviceInfo baseDeviceInfo);
public List<BaseDeviceInfo> selectBaseDeviceInfoList(String deviceName);
public List<BaseDeviceInfo> selectBaseDeviceInfoListByName(String deviceName);
/**
*

@ -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();
}
}

@ -16,7 +16,7 @@ import com.haiwei.common.core.text.Convert;
* @author wangh
* @date 2023-08-15
*/
@Service("BaseDeviceInfoServiceImpl")
@Service("baseDeviceInfoServiceImpl")
public class BaseDeviceInfoServiceImpl implements IBaseDeviceInfoService
{
@Autowired
@ -99,7 +99,7 @@ public class BaseDeviceInfoServiceImpl implements IBaseDeviceInfoService
}
@Override
public List<BaseDeviceInfo> selectBaseDeviceInfoList(String deviceName) {
public List<BaseDeviceInfo> selectBaseDeviceInfoListByName(String deviceName) {
return baseDeviceInfoMapper.selectBaseDeviceInfoListByDeviceName(deviceName);
}
}

@ -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>

@ -97,41 +97,7 @@
allowClear: true
});
})
$(function() {
$('.summernote').summernote({
lang: 'zh-CN',
dialogsInBody: true,
callbacks: {
onChange: function(contents, $edittable) {
$("input[name='" + this.id + "']").val(contents);
},
// onImageUpload: function(files) {
// var obj = this;
// var data = new FormData();
// data.append("file", files[0]);
// $.ajax({
// type: "post",
// url: ctx + "common/upload",
// data: data,
// cache: false,
// contentType: false,
// processData: false,
// dataType: 'json',
// success: function(result) {
// if (result.code == web_status.SUCCESS) {
// $('#' + obj.id).summernote('insertImage', result.url);
// } else {
// $.modal.alertError(result.msg);
// }
// },
// error: function(error) {
// $.modal.alertWarning("图片上传失败。");
// }
// });
// }
}
});
});
</script>
</body>
</html>

@ -2,6 +2,7 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
<th:block th:include="include :: header('新增看板点位图')"/>
<th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -10,7 +11,7 @@
<label class="col-sm-3 control-label">设备名称:</label>
<div class="col-sm-8">
<select name="deviceName" class="form-control m-b"
th:with="type=${@BaseDeviceInfoServiceImpl.selectBaseDeviceInfoList(null)}">
th:with="type=${@baseDeviceInfoServiceImpl.selectBaseDeviceInfoList(null)}">
<option th:each="dict : ${type}" th:text="${dict.deviceName}"
th:value="${dict.deviceName}"></option>
@ -44,6 +45,8 @@
</form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-js"/>
<script th:inline="javascript">
var prefix = ctx + "manage/base_point_info"
$("#form-base_point_info-add").validate({

@ -12,7 +12,7 @@
<ul>
<li>
<label>设备名称:</label>
<select name="deviceName" th:with="type=${@BaseDeviceInfoServiceImpl.selectBaseDeviceInfoList(null)}">
<select name="deviceName" th:with="type=${@baseDeviceInfoServiceImpl.selectBaseDeviceInfoList(null)}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.deviceName}"
th:value="${dict.deviceName}"></option>

@ -2,6 +2,7 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改看板点位图')" />
<th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -11,7 +12,7 @@
<label class="col-sm-3 control-label">设备名称:</label>
<div class="col-sm-8">
<select name="deviceName" class="form-control m-b" th:field="*{deviceName}"
th:with="type=${@BaseDeviceInfoServiceImpl.selectBaseDeviceInfoList(null)}">
th:with="type=${@baseDeviceInfoServiceImpl.selectBaseDeviceInfoList(null)}">
<option th:each="dict : ${type}" th:text="${dict.deviceName}"
th:value="${dict.deviceName}"></option>
@ -45,6 +46,7 @@
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js"/>
<script th:inline="javascript">
var prefix = ctx + "manage/base_point_info";
$("#form-base_point_info-edit").validate({

@ -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>&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="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…
Cancel
Save