Files
SIPAIIS_WMS_JSSW/WebRoot/jsp/user/extSystemEdit.jsp

197 lines
8.5 KiB
Plaintext
Raw Permalink Normal View History

2026-01-16 14:13:44 +08:00
<%@page import="com.sipai.entity.user.ExtSystem"%>
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<% request.setAttribute("RequestMode", ExtSystem.RequestMode); %>
<% request.setAttribute("SystemType", ExtSystem.SystemType); %>
<style type="text/css">
.select2-container .select2-selection--single{
height:34px;
line-height: 34px;
}
.select2-selection__arrow{
margin-top:3px;
}
</style>
<script type="text/javascript">
/* $(function() {
$.post(ext.contextPath + "/work/workshop/getlist4Combo.do", {}, function(data) {
var selelct =$("#workshopid").select2({
data: data,
placeholder:'请选择',//默认文字提示
allowClear: false,//允许清空
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct.val('${extsystem.workshopid}').trigger("change");
},'json'); }); */
$(function() {
var type= $(this).val();
var unitId='${extSystem.workshopid}';
$.post(ext.contextPath + "/work/workshop/geList4Select.do", {type:type,unitId:unitId}, function(data) {
var selelct =$("#workshopid").select2({
data: data,
placeholder:'请选择',//默认文字提示
allowClear: false,//允许清空
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
language: "zh-CN",
minimumInputLength: 0,
minimumResultsForSearch: 10,//数据超过十个启用搜索框
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
});
selelct.val('${extSystem.workshopid}').trigger("change");
},'json');
//getFileList();
})
function doupdate() {
$("#subForm").bootstrapValidator('validate');//提交验证
setTimeout(function(){
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
$("#subForm").bootstrapValidator('validate');//提交验证
$.post(ext.contextPath + "/user/extsystem/update.do", $("#subForm").serialize(), function(data) {
if (data.res == 1) {
$("#subModal").modal("hide");
$("#table").bootstrapTable('refresh');
}else if(data.res == 0){
showAlert('d','保存失败');
}else{
showAlert('d',data.res);
}
},'json');
}
}, 100);
}
//输入框验证
$("#subForm").bootstrapValidator({
live: 'disabled',//验证时机enabled是内容有变化就验证默认disabled和submitted是提交再验证
fields: {
name: {
validators: {
notEmpty: {
message: '名称不能为空'
},
},
},
url: {
validators: {
notEmpty: {
message: '请求链接不能为空'
},
},
},
mode: {
validators: {
notEmpty: {
message: '请求模式不能为空'
},
},
},
type: {
validators: {
notEmpty: {
message: '系统类型不能为空'
}
}
},
status: {
validators: {
notEmpty: {
message: '启用状态不能为空'
}
}
},
}
});
</script>
<div class="modal fade" id="subModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span></button>
<h4 class="modal-title">编辑界面</h4>
</div>
<div class="modal-body">
<!-- 新增界面formid强制为subForm -->
<form class="form-horizontal" id="subForm">
<div id="alertDiv"></div>
<input id ="id" name="id" type="hidden" value="${extSystem.id}"/>
<!-- 界面提醒div强制id为alertdiv -->
<div class="form-group">
<label class="col-sm-2 control-label">*名称</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="name" name ="name" placeholder="名称" value="${extSystem.name}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*请求链接</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="url" name ="url" placeholder="请求链接" value="${extSystem.url}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*请求方式</label>
<div class="col-sm-10">
<select class="form-control select2 " id="mode" name ="mode" style="width: 220px;">
<c:forEach var="item" items="${RequestMode}" >
<option value='${item}' <c:if test='${item == extSystem.mode}'> selected</c:if> >${item}</option>
</c:forEach>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*系统类型</label>
<div class="col-sm-10">
<select class="form-control select2 " id="type" name ="type" style="width: 220px;">
<c:forEach var="item" items="${SystemType}" >
<option value='${item}' <c:if test='${item == extSystem.type}'> selected</c:if> >${item}</option>
</c:forEach>
</select>
</div>
</div>
<!-- <div class="form-group">
<label class="col-sm-2 control-label">所属车间</label>
<div class="col-sm-10">
<select class="form-control select2 " id="workshopid" name ="workshopid" style="width: 220px;">
</select>
</div>
</div> -->
<div class="form-group">
<label class="col-sm-2 control-label">命名空间</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="namespace" name ="namespace" placeholder="命名空间" value="${extSystem.namespace}">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">*启用状态</label>
<div class="col-sm-10">
<select class="form-control select2 " id="status" name ="status" style="width: 220px;">
<option value="true" <c:if test="${extSystem.status=='true'}">selected</c:if>">启用</option>
<option value="false" <c:if test="${extSystem.status=='false'}">selected</c:if>">停用</option>
</select>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default pull-left" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doupdate()">保存</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>