liuxiaoxu
1 month ago
8 changed files with 0 additions and 684 deletions
@ -1,129 +0,0 @@ |
|||
package com.ruoyi.system.controller; |
|||
|
|||
import com.ruoyi.common.annotation.Log; |
|||
import com.ruoyi.common.core.controller.BaseController; |
|||
import com.ruoyi.common.core.domain.AjaxResult; |
|||
import com.ruoyi.common.core.page.TableDataInfo; |
|||
import com.ruoyi.common.enums.BusinessType; |
|||
import com.ruoyi.common.utils.poi.ExcelUtil; |
|||
import com.ruoyi.system.domain.SysUnitConvert; |
|||
import com.ruoyi.system.service.ISysUnitConvertService; |
|||
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.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 单位换算Controller |
|||
* |
|||
* @author sunzhenhu |
|||
* @date 2021-06-16 |
|||
*/ |
|||
@Controller |
|||
@RequestMapping("/unitConvert/unitConvert") |
|||
public class SysUnitConvertController extends BaseController |
|||
{ |
|||
private String prefix = "unitConvert/unitConvert"; |
|||
|
|||
@Autowired |
|||
private ISysUnitConvertService sysUnitConvertService; |
|||
|
|||
@RequiresPermissions("unitConvert:unitConvert:view") |
|||
@GetMapping() |
|||
public String unitConvert() |
|||
{ |
|||
return prefix + "/unitConvert"; |
|||
} |
|||
|
|||
/** |
|||
* 查询单位换算列表 |
|||
*/ |
|||
@RequiresPermissions("unitConvert:unitConvert:list") |
|||
@PostMapping("/list") |
|||
@ResponseBody |
|||
public TableDataInfo list(SysUnitConvert sysUnitConvert) |
|||
{ |
|||
startPage(); |
|||
List<SysUnitConvert> list = sysUnitConvertService.selectSysUnitConvertList(sysUnitConvert); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出单位换算列表 |
|||
*/ |
|||
@RequiresPermissions("unitConvert:unitConvert:export") |
|||
@Log(title = "单位换算", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ResponseBody |
|||
public AjaxResult export(SysUnitConvert sysUnitConvert) |
|||
{ |
|||
List<SysUnitConvert> list = sysUnitConvertService.selectSysUnitConvertList(sysUnitConvert); |
|||
ExcelUtil<SysUnitConvert> util = new ExcelUtil<SysUnitConvert>(SysUnitConvert.class); |
|||
return util.exportExcel(list, "单位换算数据"); |
|||
} |
|||
|
|||
/** |
|||
* 新增单位换算 |
|||
*/ |
|||
@GetMapping("/add") |
|||
public String add() |
|||
{ |
|||
return prefix + "/add"; |
|||
} |
|||
|
|||
/** |
|||
* 新增保存单位换算 |
|||
*/ |
|||
@RequiresPermissions("unitConvert:unitConvert:add") |
|||
@Log(title = "单位换算", businessType = BusinessType.INSERT) |
|||
@PostMapping("/add") |
|||
@ResponseBody |
|||
public AjaxResult addSave(SysUnitConvert sysUnitConvert) |
|||
{ |
|||
int i=sysUnitConvertService.insertSysUnitConvert(sysUnitConvert); |
|||
if (i<0){ |
|||
AjaxResult result=AjaxResult.error("数据重复", null); |
|||
return result; |
|||
|
|||
} |
|||
return toAjax(i); |
|||
} |
|||
|
|||
/** |
|||
* 修改单位换算 |
|||
*/ |
|||
@GetMapping("/edit/{id}") |
|||
public String edit(@PathVariable("id") Integer id, ModelMap mmap) |
|||
{ |
|||
SysUnitConvert sysUnitConvert = sysUnitConvertService.selectSysUnitConvertById(id); |
|||
mmap.put("sysUnitConvert", sysUnitConvert); |
|||
return prefix + "/edit"; |
|||
} |
|||
|
|||
/** |
|||
* 修改保存单位换算 |
|||
*/ |
|||
@RequiresPermissions("unitConvert:unitConvert:edit") |
|||
@Log(title = "单位换算", businessType = BusinessType.UPDATE) |
|||
@PostMapping("/edit") |
|||
@ResponseBody |
|||
public AjaxResult editSave(SysUnitConvert sysUnitConvert) |
|||
{ |
|||
return toAjax(sysUnitConvertService.updateSysUnitConvert(sysUnitConvert)); |
|||
} |
|||
|
|||
/** |
|||
* 删除单位换算 |
|||
*/ |
|||
@RequiresPermissions("unitConvert:unitConvert:remove") |
|||
@Log(title = "单位换算", businessType = BusinessType.DELETE) |
|||
@PostMapping( "/remove") |
|||
@ResponseBody |
|||
public AjaxResult remove(String ids) |
|||
{ |
|||
return toAjax(sysUnitConvertService.deleteSysUnitConvertByIds(ids)); |
|||
} |
|||
} |
@ -1,93 +0,0 @@ |
|||
package com.ruoyi.system.domain; |
|||
|
|||
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; |
|||
|
|||
/** |
|||
* 单位换算对象 sys_unit_convert |
|||
* |
|||
* @author sunzhenhu |
|||
* @date 2021-06-16 |
|||
*/ |
|||
public class SysUnitConvert extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** */ |
|||
private Integer id; |
|||
|
|||
/** 换算起始值 */ |
|||
@Excel(name = "换算起始值") |
|||
private String convertStartValue; |
|||
|
|||
/** 换算起始单位 */ |
|||
@Excel(name = "换算起始单位") |
|||
private String convertStartUnit; |
|||
|
|||
/** 换算结尾值 */ |
|||
@Excel(name = "换算结尾值") |
|||
private String convertEndValue; |
|||
|
|||
/** 换算结尾单位 */ |
|||
@Excel(name = "换算结尾单位") |
|||
private String convertEndUnit; |
|||
|
|||
public void setId(Integer id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Integer getId() |
|||
{ |
|||
return id; |
|||
} |
|||
public void setConvertStartValue(String convertStartValue) |
|||
{ |
|||
this.convertStartValue = convertStartValue; |
|||
} |
|||
|
|||
public String getConvertStartValue() |
|||
{ |
|||
return convertStartValue; |
|||
} |
|||
public void setConvertStartUnit(String convertStartUnit) |
|||
{ |
|||
this.convertStartUnit = convertStartUnit; |
|||
} |
|||
|
|||
public String getConvertStartUnit() |
|||
{ |
|||
return convertStartUnit; |
|||
} |
|||
public void setConvertEndValue(String convertEndValue) |
|||
{ |
|||
this.convertEndValue = convertEndValue; |
|||
} |
|||
|
|||
public String getConvertEndValue() |
|||
{ |
|||
return convertEndValue; |
|||
} |
|||
public void setConvertEndUnit(String convertEndUnit) |
|||
{ |
|||
this.convertEndUnit = convertEndUnit; |
|||
} |
|||
|
|||
public String getConvertEndUnit() |
|||
{ |
|||
return convertEndUnit; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("convertStartValue", getConvertStartValue()) |
|||
.append("convertStartUnit", getConvertStartUnit()) |
|||
.append("convertEndValue", getConvertEndValue()) |
|||
.append("convertEndUnit", getConvertEndUnit()) |
|||
.toString(); |
|||
} |
|||
} |
@ -1,61 +0,0 @@ |
|||
package com.ruoyi.system.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.SysUnitConvert; |
|||
|
|||
/** |
|||
* 单位换算Mapper接口 |
|||
* |
|||
* @author sunzhenhu |
|||
* @date 2021-06-16 |
|||
*/ |
|||
public interface SysUnitConvertMapper |
|||
{ |
|||
/** |
|||
* 查询单位换算 |
|||
* |
|||
* @param id 单位换算ID |
|||
* @return 单位换算 |
|||
*/ |
|||
public SysUnitConvert selectSysUnitConvertById(Integer id); |
|||
|
|||
/** |
|||
* 查询单位换算列表 |
|||
* |
|||
* @param sysUnitConvert 单位换算 |
|||
* @return 单位换算集合 |
|||
*/ |
|||
public List<SysUnitConvert> selectSysUnitConvertList(SysUnitConvert sysUnitConvert); |
|||
|
|||
/** |
|||
* 新增单位换算 |
|||
* |
|||
* @param sysUnitConvert 单位换算 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertSysUnitConvert(SysUnitConvert sysUnitConvert); |
|||
|
|||
/** |
|||
* 修改单位换算 |
|||
* |
|||
* @param sysUnitConvert 单位换算 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateSysUnitConvert(SysUnitConvert sysUnitConvert); |
|||
|
|||
/** |
|||
* 删除单位换算 |
|||
* |
|||
* @param id 单位换算ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysUnitConvertById(Integer id); |
|||
|
|||
/** |
|||
* 批量删除单位换算 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysUnitConvertByIds(String[] ids); |
|||
} |
@ -1,61 +0,0 @@ |
|||
package com.ruoyi.system.service; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.SysUnitConvert; |
|||
|
|||
/** |
|||
* 单位换算Service接口 |
|||
* |
|||
* @author sunzhenhu |
|||
* @date 2021-06-16 |
|||
*/ |
|||
public interface ISysUnitConvertService |
|||
{ |
|||
/** |
|||
* 查询单位换算 |
|||
* |
|||
* @param id 单位换算ID |
|||
* @return 单位换算 |
|||
*/ |
|||
public SysUnitConvert selectSysUnitConvertById(Integer id); |
|||
|
|||
/** |
|||
* 查询单位换算列表 |
|||
* |
|||
* @param sysUnitConvert 单位换算 |
|||
* @return 单位换算集合 |
|||
*/ |
|||
public List<SysUnitConvert> selectSysUnitConvertList(SysUnitConvert sysUnitConvert); |
|||
|
|||
/** |
|||
* 新增单位换算 |
|||
* |
|||
* @param sysUnitConvert 单位换算 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertSysUnitConvert(SysUnitConvert sysUnitConvert); |
|||
|
|||
/** |
|||
* 修改单位换算 |
|||
* |
|||
* @param sysUnitConvert 单位换算 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateSysUnitConvert(SysUnitConvert sysUnitConvert); |
|||
|
|||
/** |
|||
* 批量删除单位换算 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysUnitConvertByIds(String ids); |
|||
|
|||
/** |
|||
* 删除单位换算信息 |
|||
* |
|||
* @param id 单位换算ID |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysUnitConvertById(Integer id); |
|||
} |
@ -1,103 +0,0 @@ |
|||
package com.ruoyi.system.service.impl; |
|||
|
|||
import com.ruoyi.common.core.text.Convert; |
|||
import com.ruoyi.system.domain.SysUnitConvert; |
|||
import com.ruoyi.system.mapper.SysUnitConvertMapper; |
|||
import com.ruoyi.system.service.ISysUnitConvertService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 单位换算Service业务层处理 |
|||
* |
|||
* @author sunzhenhu |
|||
* @date 2021-06-16 |
|||
*/ |
|||
@Service |
|||
public class SysUnitConvertServiceImpl implements ISysUnitConvertService |
|||
{ |
|||
@Autowired |
|||
private SysUnitConvertMapper sysUnitConvertMapper; |
|||
|
|||
/** |
|||
* 查询单位换算 |
|||
* |
|||
* @param id 单位换算ID |
|||
* @return 单位换算 |
|||
*/ |
|||
@Override |
|||
public SysUnitConvert selectSysUnitConvertById(Integer id) |
|||
{ |
|||
return sysUnitConvertMapper.selectSysUnitConvertById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询单位换算列表 |
|||
* |
|||
* @param sysUnitConvert 单位换算 |
|||
* @return 单位换算 |
|||
*/ |
|||
@Override |
|||
public List<SysUnitConvert> selectSysUnitConvertList(SysUnitConvert sysUnitConvert) |
|||
{ |
|||
return sysUnitConvertMapper.selectSysUnitConvertList(sysUnitConvert); |
|||
} |
|||
|
|||
/** |
|||
* 新增单位换算 |
|||
* |
|||
* @param sysUnitConvert 单位换算 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertSysUnitConvert(SysUnitConvert sysUnitConvert) |
|||
{ |
|||
SysUnitConvert temp=new SysUnitConvert(); |
|||
temp.setConvertStartUnit(sysUnitConvert.getConvertStartUnit()); |
|||
temp.setConvertEndUnit(sysUnitConvert.getConvertEndUnit()); |
|||
List<SysUnitConvert> sysUnitConverts = new ArrayList<>(sysUnitConvertMapper.selectSysUnitConvertList(temp)); |
|||
if (sysUnitConverts.size()>0){ |
|||
return -1; |
|||
} |
|||
return sysUnitConvertMapper.insertSysUnitConvert(sysUnitConvert); |
|||
} |
|||
|
|||
/** |
|||
* 修改单位换算 |
|||
* |
|||
* @param sysUnitConvert 单位换算 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateSysUnitConvert(SysUnitConvert sysUnitConvert) |
|||
{ |
|||
return sysUnitConvertMapper.updateSysUnitConvert(sysUnitConvert); |
|||
} |
|||
|
|||
/** |
|||
* 删除单位换算对象 |
|||
* |
|||
* @param ids 需要删除的数据ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteSysUnitConvertByIds(String ids) |
|||
{ |
|||
return sysUnitConvertMapper.deleteSysUnitConvertByIds(Convert.toStrArray(ids)); |
|||
} |
|||
|
|||
/** |
|||
* 删除单位换算信息 |
|||
* |
|||
* @param id 单位换算ID |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteSysUnitConvertById(Integer id) |
|||
{ |
|||
return sysUnitConvertMapper.deleteSysUnitConvertById(id); |
|||
} |
|||
} |
@ -1,53 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('新增单位换算')" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-unitConvert-add"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">换算起始值:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="convertStartValue" class="form-control" type="text" oninput="value=value.replace(/[^\d]/g,'')" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">换算起始单位:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="convertStartUnit" class="form-control m-b" th:with="type=${@dict.getType('unit_convert')}" required> |
|||
<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 is-required" >换算结尾值:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="convertEndValue" class="form-control" oninput="value=value.replace(/[^\d]/g,'')" type="text" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">换算结尾单位:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="convertEndUnit" class="form-control m-b" th:with="type=${@dict.getType('unit_convert')}" required> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "unitConvert/unitConvert" |
|||
$("#form-unitConvert-add").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/add", $('#form-unitConvert-add').serialize()); |
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,54 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" > |
|||
<head> |
|||
<th:block th:include="include :: header('修改单位换算')" /> |
|||
</head> |
|||
<body class="white-bg"> |
|||
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
|||
<form class="form-horizontal m" id="form-unitConvert-edit" th:object="${sysUnitConvert}"> |
|||
<input name="id" th:field="*{id}" type="hidden"> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">换算起始值:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="convertStartValue" th:field="*{convertStartValue}" class="form-control" oninput="value=value.replace(/[^\d]/g,'')" type="text" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">换算起始单位:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="convertStartUnit" class="form-control m-b" th:with="type=${@dict.getType('unit_convert')}" required> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{convertStartUnit}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">换算结尾值:</label> |
|||
<div class="col-sm-8"> |
|||
<input name="convertEndValue" th:field="*{convertEndValue}" class="form-control" oninput="value=value.replace(/[^\d]/g,'')" type="text" required> |
|||
</div> |
|||
</div> |
|||
<div class="form-group"> |
|||
<label class="col-sm-3 control-label is-required">换算结尾单位:</label> |
|||
<div class="col-sm-8"> |
|||
<select name="convertEndUnit" class="form-control m-b" th:with="type=${@dict.getType('unit_convert')}" required> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{convertEndUnit}"></option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</div> |
|||
<th:block th:include="include :: footer" /> |
|||
<script th:inline="javascript"> |
|||
var prefix = ctx + "unitConvert/unitConvert"; |
|||
$("#form-unitConvert-edit").validate({ |
|||
focusCleanup: true |
|||
}); |
|||
|
|||
function submitHandler() { |
|||
if ($.validate.form()) { |
|||
$.operate.save(prefix + "/edit", $('#form-unitConvert-edit').serialize()); |
|||
} |
|||
} |
|||
</script> |
|||
</body> |
|||
</html> |
@ -1,130 +0,0 @@ |
|||
<!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="convertStartValue"/> |
|||
</li> |
|||
<li> |
|||
<label>换算起始单位:</label> |
|||
<select name="convertStartUnit" th:with="type=${@dict.getType('unit_convert')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</li> |
|||
<li> |
|||
<label>换算结尾值:</label> |
|||
<input type="text" name="convertEndValue"/> |
|||
</li> |
|||
<li> |
|||
<label>换算结尾单位:</label> |
|||
<select name="convertEndUnit" th:with="type=${@dict.getType('unit_convert')}"> |
|||
<option value="">所有</option> |
|||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> |
|||
</select> |
|||
</li> |
|||
<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="unitConvert:unitConvert:add"> |
|||
<i class="fa fa-plus"></i> 添加 |
|||
</a> |
|||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="unitConvert:unitConvert:edit"> |
|||
<i class="fa fa-edit"></i> 修改 |
|||
</a> |
|||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="unitConvert:unitConvert:remove"> |
|||
<i class="fa fa-remove"></i> 删除 |
|||
</a> |
|||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="unitConvert:unitConvert: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('unitConvert:unitConvert:edit')}]]; |
|||
var removeFlag = [[${@permission.hasPermi('unitConvert:unitConvert:remove')}]]; |
|||
var convertStartUnitDatas = [[${@dict.getType('unit_convert')}]]; |
|||
var convertEndUnitDatas = [[${@dict.getType('unit_convert')}]]; |
|||
var prefix = ctx + "unitConvert/unitConvert"; |
|||
|
|||
$(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: '', |
|||
visible: false |
|||
}, |
|||
{ |
|||
field: 'convertStartValue', |
|||
title: '换算起始值' |
|||
}, |
|||
{ |
|||
field: 'convertStartUnit', |
|||
title: '换算起始单位', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(convertStartUnitDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
title: '', |
|||
formatter: function(value, row, index) { |
|||
return "="; |
|||
} |
|||
}, |
|||
{ |
|||
field: 'convertEndValue', |
|||
title: '换算结尾值' |
|||
}, |
|||
{ |
|||
field: 'convertEndUnit', |
|||
title: '换算结尾单位', |
|||
formatter: function(value, row, index) { |
|||
return $.table.selectDictLabel(convertEndUnitDatas, value); |
|||
} |
|||
}, |
|||
{ |
|||
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> |
Loading…
Reference in new issue