This commit is contained in:
parent
56a38a5963
commit
70905a7521
|
|
@ -0,0 +1,22 @@
|
|||
package com.bonus.aqgqj.basis.controller;
|
||||
|
||||
import com.bonus.aqgqj.basis.service.ExperimentStandardService;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @className:ExperimentStandardController
|
||||
* @author:cwchen
|
||||
* @date:2024-07-18-11:16
|
||||
* @version:1.0
|
||||
* @description:实验标准管理-controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/experimentStandard/")
|
||||
public class ExperimentStandardController {
|
||||
|
||||
@Resource(name = "ExperimentStandardService")
|
||||
private ExperimentStandardService service;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.bonus.aqgqj.basis.dao;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @className:ExperimentStandardMapper
|
||||
* @author:cwchen
|
||||
* @date:2024-07-18-11:22
|
||||
* @version:1.0
|
||||
* @description:实验标准-mapper
|
||||
*/
|
||||
@Repository(value = "ExperimentStandardMapper")
|
||||
public interface ExperimentStandardMapper {
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.bonus.aqgqj.basis.entity.dto;
|
||||
|
||||
/**
|
||||
* @className:ExperimentStandardDto
|
||||
* @author:cwchen
|
||||
* @date:2024-07-18-11:21
|
||||
* @version:1.0
|
||||
* @description:实验标准-dto
|
||||
*/
|
||||
public class ExperimentStandardDto {
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.bonus.aqgqj.basis.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @className:ExperimentStandardVo
|
||||
* @author:cwchen
|
||||
* @date:2024-07-18-11:21
|
||||
* @version:1.0
|
||||
* @description:实验标准-vo
|
||||
*/
|
||||
@Data
|
||||
public class ExperimentStandardVo {
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package com.bonus.aqgqj.basis.service;
|
||||
|
||||
/**
|
||||
* @className:ExperimentStandardService
|
||||
* @author:cwchen
|
||||
* @date:2024-07-18-11:19
|
||||
* @version:1.0
|
||||
* @description:实验标准管理-service
|
||||
*/
|
||||
public interface ExperimentStandardService {
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.bonus.aqgqj.basis.service.impl;
|
||||
|
||||
import com.bonus.aqgqj.basis.dao.ExperimentStandardMapper;
|
||||
import com.bonus.aqgqj.basis.service.ExperimentStandardService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @className:ExperimentStandardServiceImpl
|
||||
* @author:cwchen
|
||||
* @date:2024-07-18-11:20
|
||||
* @version:1.0
|
||||
* @description:实验标准管理-impl
|
||||
*/
|
||||
@Service(value = "ExperimentStandardService")
|
||||
@Slf4j
|
||||
public class ExperimentStandardServiceImpl implements ExperimentStandardService {
|
||||
|
||||
@Resource(name = "ExperimentStandardMapper")
|
||||
private ExperimentStandardMapper mapper;
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
<?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.bonus.aqgqj.basis.dao.ExperimentStandardMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,153 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="../../css/font-awesome/css/font-awesome.css">
|
||||
<link rel="stylesheet" href="../../js/layui-v2.6.8/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="../../css/dataForm.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
<form class="layui-form form-horizontal" onsubmit="return false" id="form">
|
||||
<fieldset>
|
||||
<div class="layui-form-item" style="margin-top: 2%;">
|
||||
<label class="layui-form-label">上级节点</label>
|
||||
<div class="layui-input-inline">
|
||||
<select class="form-control input-sm layui-select" id="parentId" name="parentId" lay-verify="required"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 2%;">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>字典名称</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="form-control layui-input" placeholder="字典名称" type="text" name="dictName" id="dictName" maxlength="25"
|
||||
lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 2%;">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>字典值</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="form-control layui-input" placeholder="字典值" type="text" name="dictValue" id="dictValue" maxlength="25"
|
||||
lay-verify="required">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 2%;">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>字典编码</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="form-control layui-input" placeholder="字典编码" maxlength="50" name="dictCode" id="dictCode"
|
||||
lay-verify="required"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" style="margin-top: 2%;">
|
||||
<label class="layui-form-label"><i style="padding: 0 10px;">*</i>排序</label>
|
||||
<div class="layui-input-inline">
|
||||
<input class="form-control layui-input" placeholder="排序" type="number" name="sort" id="sort" value="100"
|
||||
lay-verify="required"/>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" id="formSubmit" class="layui-btn" lay-submit="" lay-filter="formData"
|
||||
style="display: none;"></button>
|
||||
<div class="form-actions">
|
||||
<div class="row" align="center">
|
||||
<div class="col-md-12">
|
||||
<button class="btn btn-primary" onclick="closePage()">返回</button>
|
||||
<button class="btn btn-primary" onclick="add()">
|
||||
<i class="fa fa-save"></i> 保存
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="../../js/libs/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/jq.js"></script>
|
||||
<script type="text/javascript" src="../../js/plugin/bootstrapvalidator/bootstrapValidator.min.js"></script>
|
||||
<script type="text/javascript" src="../../js/common.js"></script>
|
||||
<script type="text/javascript" src="../../js/my/ztree-menu.js"></script>
|
||||
<script type="text/javascript" src="../../layui/layui.js"></script>
|
||||
<script type="text/javascript" src="../../js/publicJs.js"></script>
|
||||
<script src="../../js/my/aes.js"></script>
|
||||
<script src="../../js/ajaxRequest.js"></script>
|
||||
<script type="text/javascript">
|
||||
/*// 获取parentId和dictCode的DOM元素
|
||||
var parentIdInput = $("#parentId");
|
||||
var dictCodeInput = $("#dictCode");
|
||||
var dictCodeLabel = $('label[for="dictCode"]');*/
|
||||
initParentDictSelect();
|
||||
layui.use(['form', 'layer', 'util'], function () {
|
||||
layer = layui.layer;
|
||||
form = layui.form;
|
||||
util = layui.util;
|
||||
form.render();
|
||||
form.verify();
|
||||
form.on('submit(formData)', function (data) {
|
||||
saveData();
|
||||
});
|
||||
});
|
||||
|
||||
function add() {
|
||||
$('#formSubmit').trigger('click')
|
||||
}
|
||||
|
||||
function saveData() {
|
||||
$('#form').bootstrapValidator();
|
||||
var bootstrapValidator = $("#form").data('bootstrapValidator');
|
||||
bootstrapValidator.validate();
|
||||
if(!bootstrapValidator.isValid()){
|
||||
return;
|
||||
}
|
||||
var formdata = $("#form").serializeObject();
|
||||
var params={
|
||||
encryptedData:encryptCBC(JSON.stringify(formdata))
|
||||
}
|
||||
let url = dataUrl + "/dicts/add";
|
||||
console.log(params)
|
||||
ajaxRequest(url, "POST", params, true, function () {}, function (result) {
|
||||
console.log(result)
|
||||
if (result.status === 200) {
|
||||
// layer.alert(result.msg, {icon: 2})
|
||||
closePage(1)
|
||||
} else {
|
||||
layer.alert(result.msg, {icon: 2})
|
||||
}
|
||||
}, function (xhr) {
|
||||
error(xhr)
|
||||
});
|
||||
}
|
||||
function closePage(type) {
|
||||
let index = parent.layer.getFrameIndex(window.name); //先得到当前 iframe层的索引
|
||||
parent.layer.close(index); //再执行关闭
|
||||
if (type === 1) {
|
||||
parent.getDictLIst()
|
||||
}
|
||||
}
|
||||
|
||||
/*// 添加事件监听器,当parentId的值发生变化时触发
|
||||
parentIdInput.on("change", function() {
|
||||
// 获取当前选中的parentId值
|
||||
var parentIdValue = parseInt(parentIdInput.val());
|
||||
debugger;
|
||||
console.log(parentIdValue)
|
||||
|
||||
// 检查parentId是否等于0
|
||||
if (parentIdValue === 0) {
|
||||
// 当parentId为0时,设置字典编码字段为必填
|
||||
dictCodeInput.prop("required", true);
|
||||
// 显示星号
|
||||
var starElement = $('<label style="color: red">*</label>');
|
||||
dictCodeLabel.prepend(starElement);
|
||||
} else {
|
||||
console.log(dictCodeInput)
|
||||
// 当parentId不为0时,设置字典编码字段为非必填
|
||||
dictCodeInput.prop("required", false);
|
||||
// 隐藏星号
|
||||
dictCodeLabel.find("label").remove();
|
||||
}
|
||||
});*/
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue