新增流程类别
This commit is contained in:
parent
64363ccfed
commit
55768e1d03
@ -14,7 +14,6 @@ import ink.wgink.pojo.result.SuccessResultData;
|
|||||||
import ink.wgink.pojo.result.SuccessResultList;
|
import ink.wgink.pojo.result.SuccessResultList;
|
||||||
import ink.wgink.util.RegexUtil;
|
import ink.wgink.util.RegexUtil;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.activiti.engine.repository.Model;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@ -77,19 +76,20 @@ public class ActivitiController extends DefaultBaseController {
|
|||||||
@ApiOperation(value = "模型列表", notes = "模型列表接口")
|
@ApiOperation(value = "模型列表", notes = "模型列表接口")
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
public List<ModelDTO> list() {
|
public List<ModelDTO> list(@RequestParam(required = false, name = "modelCategory") String modelCategory) {
|
||||||
return activitiService.list();
|
return activitiService.listByCategory(modelCategory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "模型分页列表", notes = "模型分页列表接口")
|
@ApiOperation(value = "模型分页列表", notes = "模型分页列表接口")
|
||||||
@ApiImplicitParams({
|
@ApiImplicitParams({
|
||||||
|
@ApiImplicitParam(name = "modelCategory", value = "模型类别", paramType = "query", dataType = "string"),
|
||||||
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "Integer", defaultValue = "1"),
|
@ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "Integer", defaultValue = "1"),
|
||||||
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "Integer", defaultValue = "20"),
|
@ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "Integer", defaultValue = "20"),
|
||||||
})
|
})
|
||||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||||
@GetMapping("listpage")
|
@GetMapping("listpage")
|
||||||
public SuccessResultList<List<ModelDTO>> listPage(ListPage page) {
|
public SuccessResultList<List<ModelDTO>> listPage(@RequestParam(required = false, name = "modelCategory") String modelCategory, ListPage page) {
|
||||||
return activitiService.listPage(page.getPage(), page.getRows());
|
return activitiService.listPageByCategory(modelCategory, page.getPage(), page.getRows());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,22 @@
|
|||||||
package ink.wgink.module.activiti.controller.route;
|
package ink.wgink.module.activiti.controller.route;
|
||||||
|
|
||||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||||
import ink.wgink.module.activiti.service.activiti.IActivitiModelService;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import org.activiti.engine.RepositoryService;
|
||||||
|
import org.activiti.engine.repository.Model;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: ActivitiRouteController
|
* @ClassName: ActivitiRouteController
|
||||||
* @Description: activiti路由
|
* @Description: activiti路由
|
||||||
@ -21,15 +29,20 @@ import org.springframework.web.servlet.ModelAndView;
|
|||||||
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/activiti")
|
@RequestMapping(ISystemConstant.ROUTE_PREFIX + "/activiti")
|
||||||
public class ActivitiRouteController {
|
public class ActivitiRouteController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RepositoryService repositoryService;
|
||||||
|
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
public ModelAndView list() {
|
public ModelAndView list() {
|
||||||
ModelAndView mv = new ModelAndView("activiti/list");
|
ModelAndView mv = new ModelAndView("activiti/list");
|
||||||
|
mv.addObject("modelCategories", listCategory());
|
||||||
return mv;
|
return mv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("save")
|
@GetMapping("save")
|
||||||
public ModelAndView save() {
|
public ModelAndView save() {
|
||||||
ModelAndView mv = new ModelAndView("activiti/save");
|
ModelAndView mv = new ModelAndView("activiti/save");
|
||||||
|
mv.addObject("modelCategories", listCategory());
|
||||||
return mv;
|
return mv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,4 +52,17 @@ public class ActivitiRouteController {
|
|||||||
return mv;
|
return mv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型列表
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private List<String> listCategory() {
|
||||||
|
Set<String> modelCategorySet = repositoryService.createModelQuery().list().stream().map(Model::getCategory).collect(Collectors.toSet());
|
||||||
|
modelCategorySet.removeIf(modelCategory -> StringUtils.isBlank(modelCategory));
|
||||||
|
ArrayList<String> modelCategories = new ArrayList<>(modelCategorySet);
|
||||||
|
Collections.sort(modelCategories);
|
||||||
|
return modelCategories;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,8 @@ public class ModelDTO {
|
|||||||
private String createTime;
|
private String createTime;
|
||||||
@ApiModelProperty(name = "lastUpdateTime", value = "最后更新时间")
|
@ApiModelProperty(name = "lastUpdateTime", value = "最后更新时间")
|
||||||
private String lastUpdateTime;
|
private String lastUpdateTime;
|
||||||
|
@ApiModelProperty(name = "modelCategory", value = "模型类别")
|
||||||
|
private String modelCategory;
|
||||||
|
|
||||||
public String getId() {
|
public String getId() {
|
||||||
return id == null ? "" : id.trim();
|
return id == null ? "" : id.trim();
|
||||||
@ -85,6 +87,14 @@ public class ModelDTO {
|
|||||||
this.lastUpdateTime = lastUpdateTime;
|
this.lastUpdateTime = lastUpdateTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getModelCategory() {
|
||||||
|
return modelCategory == null ? "" : modelCategory.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModelCategory(String modelCategory) {
|
||||||
|
this.modelCategory = modelCategory;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
final StringBuilder sb = new StringBuilder("{");
|
final StringBuilder sb = new StringBuilder("{");
|
||||||
@ -102,6 +112,8 @@ public class ModelDTO {
|
|||||||
.append(createTime).append('\"');
|
.append(createTime).append('\"');
|
||||||
sb.append(",\"lastUpdateTime\":\"")
|
sb.append(",\"lastUpdateTime\":\"")
|
||||||
.append(lastUpdateTime).append('\"');
|
.append(lastUpdateTime).append('\"');
|
||||||
|
sb.append(",\"modelCategory\":\"")
|
||||||
|
.append(modelCategory).append('\"');
|
||||||
sb.append('}');
|
sb.append('}');
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,8 @@ public class ActivitiVO {
|
|||||||
private String modelKey;
|
private String modelKey;
|
||||||
@ApiModelProperty(name = "modelDescription", value = "模型描述")
|
@ApiModelProperty(name = "modelDescription", value = "模型描述")
|
||||||
private String modelDescription;
|
private String modelDescription;
|
||||||
|
@ApiModelProperty(name = "modelCategory", value = "模型分类")
|
||||||
|
private String modelCategory;
|
||||||
|
|
||||||
public String getModelName() {
|
public String getModelName() {
|
||||||
return modelName == null ? "" : modelName.trim().replaceAll("\\s", "");
|
return modelName == null ? "" : modelName.trim().replaceAll("\\s", "");
|
||||||
@ -49,4 +51,12 @@ public class ActivitiVO {
|
|||||||
public void setModelDescription(String modelDescription) {
|
public void setModelDescription(String modelDescription) {
|
||||||
this.modelDescription = modelDescription;
|
this.modelDescription = modelDescription;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getModelCategory() {
|
||||||
|
return modelCategory == null ? "" : modelCategory.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModelCategory(String modelCategory) {
|
||||||
|
this.modelCategory = modelCategory;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,14 @@ public interface IActivitiService {
|
|||||||
*/
|
*/
|
||||||
List<ModelDTO> list();
|
List<ModelDTO> list();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型列表
|
||||||
|
*
|
||||||
|
* @param modelCategory
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<ModelDTO> listByCategory(String modelCategory);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模型分页列表
|
* 模型分页列表
|
||||||
*
|
*
|
||||||
@ -60,4 +68,13 @@ public interface IActivitiService {
|
|||||||
*/
|
*/
|
||||||
SuccessResultList<List<ModelDTO>> listPage(int page, int rows);
|
SuccessResultList<List<ModelDTO>> listPage(int page, int rows);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型分页列表
|
||||||
|
*
|
||||||
|
* @param modelCategory 类别
|
||||||
|
* @param page
|
||||||
|
* @param rows
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
SuccessResultList<List<ModelDTO>> listPageByCategory(String modelCategory, int page, int rows);
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,7 @@ public class ActivitiServiceImpl extends DefaultBaseService implements IActiviti
|
|||||||
Model model = repositoryService.newModel();
|
Model model = repositoryService.newModel();
|
||||||
model.setName(activitiVO.getModelName());
|
model.setName(activitiVO.getModelName());
|
||||||
model.setKey(activitiVO.getModelKey());
|
model.setKey(activitiVO.getModelKey());
|
||||||
|
model.setCategory(activitiVO.getModelCategory());
|
||||||
model.setMetaInfo(createModelMetaInfo(activitiVO));
|
model.setMetaInfo(createModelMetaInfo(activitiVO));
|
||||||
model.setVersion(1);
|
model.setVersion(1);
|
||||||
LOG.debug("保存模型");
|
LOG.debug("保存模型");
|
||||||
@ -152,13 +153,31 @@ public class ActivitiServiceImpl extends DefaultBaseService implements IActiviti
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ModelDTO> list() {
|
public List<ModelDTO> list() {
|
||||||
return listModelDTO(repositoryService.createModelQuery().list());
|
return listModelDTO(repositoryService.createModelQuery().orderByCreateTime().asc().list());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ModelDTO> listByCategory(String modelCategory) {
|
||||||
|
if(StringUtils.isBlank(modelCategory)) {
|
||||||
|
return list();
|
||||||
|
}
|
||||||
|
return listModelDTO(repositoryService.createModelQuery().modelCategory(modelCategory).orderByCreateTime().asc().list());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SuccessResultList<List<ModelDTO>> listPage(int page, int rows) {
|
public SuccessResultList<List<ModelDTO>> listPage(int page, int rows) {
|
||||||
ModelQuery modelQuery = repositoryService.createModelQuery();
|
ModelQuery modelQuery = repositoryService.createModelQuery();
|
||||||
List<Model> models = modelQuery.orderByCreateTime().asc().listPage(page - 1, rows);
|
List<Model> models = modelQuery.orderByCreateTime().desc().listPage(page - 1, rows);
|
||||||
|
return new SuccessResultList<>(listModelDTO(models), page, modelQuery.count());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SuccessResultList<List<ModelDTO>> listPageByCategory(String modelCategory, int page, int rows) {
|
||||||
|
if(StringUtils.isBlank(modelCategory)) {
|
||||||
|
return listPage(page, rows);
|
||||||
|
}
|
||||||
|
ModelQuery modelQuery = repositoryService.createModelQuery();
|
||||||
|
List<Model> models = modelQuery.modelCategory(modelCategory).orderByCreateTime().desc().listPage(page - 1, rows);
|
||||||
return new SuccessResultList<>(listModelDTO(models), page, modelQuery.count());
|
return new SuccessResultList<>(listModelDTO(models), page, modelQuery.count());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,6 +189,7 @@ public class ActivitiServiceImpl extends DefaultBaseService implements IActiviti
|
|||||||
ModelDTO modelDTO = new ModelDTO();
|
ModelDTO modelDTO = new ModelDTO();
|
||||||
modelDTO.setId(model.getId());
|
modelDTO.setId(model.getId());
|
||||||
modelDTO.setName(model.getName());
|
modelDTO.setName(model.getName());
|
||||||
|
modelDTO.setModelCategory(model.getCategory());
|
||||||
modelDTO.setKey(model.getKey());
|
modelDTO.setKey(model.getKey());
|
||||||
modelDTO.setVersion(model.getVersion());
|
modelDTO.setVersion(model.getVersion());
|
||||||
modelDTO.setDeploymentId(model.getDeploymentId());
|
modelDTO.setDeploymentId(model.getDeploymentId());
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||||
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
<link rel="stylesheet" type="text/css" href="assets/js/vendor/viewer/viewer.min.css">
|
||||||
|
<style>
|
||||||
|
.layui-input, .layui-select, .layui-textarea {height: 30px;}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="layui-fluid layui-anim layui-anim-fadein">
|
<div class="layui-fluid layui-anim layui-anim-fadein">
|
||||||
@ -17,6 +20,17 @@
|
|||||||
<div class="layui-col-md12">
|
<div class="layui-col-md12">
|
||||||
<div class="layui-card">
|
<div class="layui-card">
|
||||||
<div class="layui-card-body">
|
<div class="layui-card-body">
|
||||||
|
<div class="test-table-reload-btn" style="margin-bottom: 10px;">
|
||||||
|
<div class="layui-inline layui-form">
|
||||||
|
<select id="modelCategory" name="modelCategory" lay-filter="modelCategoryFilter">
|
||||||
|
<option value="">选择模型类别</option>
|
||||||
|
<option th:each="modelCategory:${modelCategories}" th:value="${modelCategory}" th:text="${modelCategory}"></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<button type="button" id="search" class="layui-btn layui-btn-sm">
|
||||||
|
<i class="fa fa-lg fa-search"></i> 搜索
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||||
<!-- 表头按钮组 -->
|
<!-- 表头按钮组 -->
|
||||||
<script type="text/html" id="headerToolBar">
|
<script type="text/html" id="headerToolBar">
|
||||||
@ -41,6 +55,7 @@
|
|||||||
}).use(['index', 'table', 'laydate', 'common'], function() {
|
}).use(['index', 'table', 'laydate', 'common'], function() {
|
||||||
var $ = layui.$;
|
var $ = layui.$;
|
||||||
var $win = $(window);
|
var $win = $(window);
|
||||||
|
var form = layui.form;
|
||||||
var table = layui.table;
|
var table = layui.table;
|
||||||
var admin = layui.admin;
|
var admin = layui.admin;
|
||||||
var laydate = layui.laydate;
|
var laydate = layui.laydate;
|
||||||
@ -55,7 +70,7 @@
|
|||||||
id: 'dataTable',
|
id: 'dataTable',
|
||||||
url: top.restAjax.path(tableUrl, []),
|
url: top.restAjax.path(tableUrl, []),
|
||||||
width: admin.screen() > 1 ? '100%' : '',
|
width: admin.screen() > 1 ? '100%' : '',
|
||||||
height: $win.height() - 50,
|
height: $win.height() - 90,
|
||||||
limit: 20,
|
limit: 20,
|
||||||
limits: [20, 40, 60, 80, 100, 200],
|
limits: [20, 40, 60, 80, 100, 200],
|
||||||
toolbar: '#headerToolBar',
|
toolbar: '#headerToolBar',
|
||||||
@ -75,6 +90,15 @@
|
|||||||
return rowData;
|
return rowData;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{field:'modelCategory', width:150, title: '模型类别', align:'center',
|
||||||
|
templet: function(row) {
|
||||||
|
var rowData = row[this.field];
|
||||||
|
if(typeof(rowData) === 'undefined' || rowData == null || rowData == '') {
|
||||||
|
return '-';
|
||||||
|
}
|
||||||
|
return rowData;
|
||||||
|
}
|
||||||
|
},
|
||||||
{field:'key', width:150, title: '模型key', align:'center',
|
{field:'key', width:150, title: '模型key', align:'center',
|
||||||
templet: function(row) {
|
templet: function(row) {
|
||||||
var rowData = row[this.field];
|
var rowData = row[this.field];
|
||||||
@ -167,11 +191,12 @@
|
|||||||
function reloadTable(currentPage) {
|
function reloadTable(currentPage) {
|
||||||
table.reload('dataTable', {
|
table.reload('dataTable', {
|
||||||
url: top.restAjax.path(tableUrl, []),
|
url: top.restAjax.path(tableUrl, []),
|
||||||
where: {},
|
where: {
|
||||||
|
modelCategory: $('#modelCategory').val()
|
||||||
|
},
|
||||||
page: {
|
page: {
|
||||||
curr: currentPage
|
curr: currentPage
|
||||||
},
|
},
|
||||||
height: $win.height() - 50,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
initTable();
|
initTable();
|
||||||
@ -186,6 +211,7 @@
|
|||||||
$(document).on('click', '#search', function() {
|
$(document).on('click', '#search', function() {
|
||||||
reloadTable(1);
|
reloadTable(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
// 事件 - 增删改
|
// 事件 - 增删改
|
||||||
table.on('toolbar(dataTable)', function(obj) {
|
table.on('toolbar(dataTable)', function(obj) {
|
||||||
var layEvent = obj.event;
|
var layEvent = obj.event;
|
||||||
@ -198,7 +224,7 @@
|
|||||||
width: '400px',
|
width: '400px',
|
||||||
height: '350px',
|
height: '350px',
|
||||||
onClose: function() {
|
onClose: function() {
|
||||||
reloadTable();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,13 @@
|
|||||||
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
<link rel="stylesheet" href="assets/fonts/font-awesome/css/font-awesome.css"/>
|
||||||
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="assets/layuiadmin/layui/css/layui.css" media="all">
|
||||||
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
<link rel="stylesheet" href="assets/layuiadmin/style/admin.css" media="all">
|
||||||
|
<style>
|
||||||
|
.input-select-change-box {position: relative;}
|
||||||
|
.input-select-change-btn {position: absolute; top: 0; right: 0;}
|
||||||
|
.layui-form-select dl {max-height: 155px;}
|
||||||
|
#selectChangeBtn {display: none;}
|
||||||
|
#modelCategoryInputBox {display: none;}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="layui-anim layui-anim-fadein">
|
<div class="layui-anim layui-anim-fadein">
|
||||||
@ -33,6 +40,21 @@
|
|||||||
<input type="text" id="modelDescription" name="modelDescription" class="layui-input" value="" placeholder="请输入模型描述" lay-verify="required">
|
<input type="text" id="modelDescription" name="modelDescription" class="layui-input" value="" placeholder="请输入模型描述" lay-verify="required">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="layui-form-item">
|
||||||
|
<label class="layui-form-label">模型分类 *</label>
|
||||||
|
<div class="layui-input-block input-select-change-box">
|
||||||
|
<div id="modelCategoryInputBox">
|
||||||
|
<input type="text" id="modelCategoryInput" name="modelCategory" class="layui-input" value="" placeholder="请输入模型分类" lay-verify="required">
|
||||||
|
</div>
|
||||||
|
<div id="modelCategorySelectBox">
|
||||||
|
<select id="modelCategorySelect" name="modelCategory" lay-verify="required">
|
||||||
|
<option th:each="modelCategory:${modelCategories}" th:value="${modelCategory}" th:text="${modelCategory}"></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<button type="button" id="inputChangeBtn" class="layui-btn layui-btn-xs input-select-change-btn">输入</button>
|
||||||
|
<button type="button" id="selectChangeBtn" class="layui-btn layui-btn-xs input-select-change-btn">选择</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="layui-form-item layui-layout-admin">
|
<div class="layui-form-item layui-layout-admin">
|
||||||
<div class="layui-input-block">
|
<div class="layui-input-block">
|
||||||
<div class="layui-footer" style="left: 0;">
|
<div class="layui-footer" style="left: 0;">
|
||||||
@ -85,6 +107,24 @@
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#inputChangeBtn').click(function() {
|
||||||
|
$(this).hide();
|
||||||
|
$('#selectChangeBtn').show();
|
||||||
|
$('#modelCategorySelectBox').hide();
|
||||||
|
$('#modelCategorySelect').removeAttr('name');
|
||||||
|
$('#modelCategoryInputBox').show();
|
||||||
|
$('#modelCategoryInput').attr('name', 'modelCategory');
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#selectChangeBtn').click(function() {
|
||||||
|
$(this).hide();
|
||||||
|
$('#inputChangeBtn').show();
|
||||||
|
$('#modelCategoryInputBox').hide();
|
||||||
|
$('#modelCategoryInput').removeAttr('name');
|
||||||
|
$('#modelCategorySelectBox').show();
|
||||||
|
$('#modelCategorySelect').attr('name', 'modelCategory');
|
||||||
|
});
|
||||||
|
|
||||||
// 校验
|
// 校验
|
||||||
form.verify({
|
form.verify({
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user