374 lines
16 KiB
Plaintext
374 lines
16 KiB
Plaintext
|
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
|||
|
|
<%@page import="com.sipai.entity.process.DataVisualFrame" %>
|
|||
|
|
<%request.setAttribute("Type_structure", DataVisualFrame.Type_structure); %>
|
|||
|
|
<%request.setAttribute("Type_frame", DataVisualFrame.Type_frame); %>
|
|||
|
|
<%request.setAttribute("Active_0", DataVisualFrame.Active_0); %>
|
|||
|
|
<%request.setAttribute("Active_1", DataVisualFrame.Active_1); %>
|
|||
|
|
|
|||
|
|
<!-- bootstrap switch -->
|
|||
|
|
<link rel="stylesheet"
|
|||
|
|
href="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.min.css"/>
|
|||
|
|
<script type="text/javascript"
|
|||
|
|
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
|||
|
|
charset="utf-8"></script>
|
|||
|
|
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
|||
|
|
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js"
|
|||
|
|
charset="utf-8"></script>
|
|||
|
|
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js"
|
|||
|
|
charset="utf-8"></script>
|
|||
|
|
|
|||
|
|
<style type="text/css">
|
|||
|
|
|
|||
|
|
</style>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
var masterId = '${dataVisualFrame.id}';
|
|||
|
|
var tbName = 'tb_pro_dataVisual_frame_file'; //数据表
|
|||
|
|
var nameSpace = 'dataVisual';//保存文件夹
|
|||
|
|
var previews = new Array();
|
|||
|
|
var previewConfigs = new Array();
|
|||
|
|
|
|||
|
|
var fileinput = function () {
|
|||
|
|
$.post(ext.contextPath + '/base/fileinput.do', {
|
|||
|
|
masterId: masterId,
|
|||
|
|
tbName: tbName,
|
|||
|
|
nameSpace: nameSpace
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#fileInputDiv").html(data);
|
|||
|
|
openModal('fileInputModal');
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//名称定义不可修改
|
|||
|
|
var getFileList = function () {
|
|||
|
|
$.post(ext.contextPath + '/base/getInputFileList.do', {masterId: masterId, tbName: tbName}, function (data) {
|
|||
|
|
//console.info(data)
|
|||
|
|
if (data.length > 0) {
|
|||
|
|
previews = new Array();
|
|||
|
|
// $('#maintenancefile').show();
|
|||
|
|
for (var i = 0; i < data.length; i++) {
|
|||
|
|
var previewConfig = new Object();
|
|||
|
|
var path = data[i].abspath;
|
|||
|
|
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
|||
|
|
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
|
|||
|
|
previews.push(path);
|
|||
|
|
previewConfig['width'] = '50px';
|
|||
|
|
previewConfig['caption'] = data[i].filename;
|
|||
|
|
previewConfig['key'] = data[i].id;
|
|||
|
|
previewConfigs.push(previewConfig);
|
|||
|
|
}
|
|||
|
|
showFileInput("dataVisualFrameFile");
|
|||
|
|
} else {
|
|||
|
|
$('#dataVisualFrameFile').hide();
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
function showFileInput(ctrlName) {
|
|||
|
|
var control = $('#' + ctrlName);
|
|||
|
|
control.fileinput('destroy');
|
|||
|
|
control.fileinput({
|
|||
|
|
language: 'zh', //设置语言
|
|||
|
|
showUpload: false, //是否显示上传按钮
|
|||
|
|
showRemove: false,
|
|||
|
|
showCaption: false,//是否显示标题
|
|||
|
|
showBrowse: false,//选择按钮
|
|||
|
|
showClose: false,//右上角关闭按钮
|
|||
|
|
dropZoneEnabled: false,//是否显示拖拽区域
|
|||
|
|
fileActionSettings: {
|
|||
|
|
showDrag: false
|
|||
|
|
},
|
|||
|
|
browseClass: "btn btn-primary", //按钮样式
|
|||
|
|
maxFileCount: 10, //表示允许同时上传的最大文件个数
|
|||
|
|
enctype: 'multipart/form-data',
|
|||
|
|
validateInitialCount: true,
|
|||
|
|
previewFileIcon: "<i class='glyphicon glyphicon-king'></i>",
|
|||
|
|
initialPreviewAsData: true,
|
|||
|
|
initialPreview: previews,
|
|||
|
|
initialPreviewConfig: previewConfigs,
|
|||
|
|
layoutTemplates: {
|
|||
|
|
actionUpload: ''
|
|||
|
|
},
|
|||
|
|
deleteUrl: ext.contextPath + "/base/deleteInputFile.do",
|
|||
|
|
deleteExtraData: function () { //传参
|
|||
|
|
var data = {
|
|||
|
|
"tbName": tbName
|
|||
|
|
};
|
|||
|
|
return data;
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$('#kvFileinputModal').on("hidden.bs.modal", function () {
|
|||
|
|
$(this).removeData("bs.modal");
|
|||
|
|
//modal重复打开会导致前面的滚动条失去作用
|
|||
|
|
$('.modal').css("overflow", "auto");
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function dosave() {
|
|||
|
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
|||
|
|
if ($("#subForm").data('bootstrapValidator').isValid()) {
|
|||
|
|
//获取验证结果,如果成功,执行下面代码
|
|||
|
|
$.post(ext.contextPath + "/process/dataVisualFrame/doFrameUpdate.do", $("#subForm").serialize() + "&oldmorder=$(#oldmorder).val()" + "&oldpid=$(#oldpid).val()", function (data) {
|
|||
|
|
if (data.code == 1) {
|
|||
|
|
// initFrameTreeView();
|
|||
|
|
// closeModal("subModal");
|
|||
|
|
initTreeView();
|
|||
|
|
} else if (data.code == 0) {
|
|||
|
|
showAlert('d', data.msg);
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.code);
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$("#subForm").bootstrapValidator({
|
|||
|
|
live: 'disabled',//验证时机,enabled是内容有变化就验证(默认),disabled和submitted是提交再验证
|
|||
|
|
fields: {
|
|||
|
|
name: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '名称不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
morder: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '排序不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
code: {
|
|||
|
|
validators: {
|
|||
|
|
notEmpty: {
|
|||
|
|
message: '编码不能为空'
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
function dodel(id) {
|
|||
|
|
swal({
|
|||
|
|
text: "您确定要删除此记录?",
|
|||
|
|
dangerMode: true,
|
|||
|
|
buttons: {
|
|||
|
|
cancel: {
|
|||
|
|
text: "取消",
|
|||
|
|
value: null,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-default btn-sm",
|
|||
|
|
closeModal: true,
|
|||
|
|
},
|
|||
|
|
confirm: {
|
|||
|
|
text: "确定",
|
|||
|
|
value: true,
|
|||
|
|
visible: true,
|
|||
|
|
className: "btn btn-danger btn-sm",
|
|||
|
|
closeModal: true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
})
|
|||
|
|
.then(function (willDelete) {
|
|||
|
|
if (willDelete) {
|
|||
|
|
$.post(ext.contextPath + '/process/dataVisualFrame/doFrameDelete.do', {id: id}, function (data) {
|
|||
|
|
if (data.code == 1) {
|
|||
|
|
initTreeView();
|
|||
|
|
} else {
|
|||
|
|
showAlert('d', data.msg, 'alertDiv');
|
|||
|
|
}
|
|||
|
|
}, 'json');
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
$(function () {
|
|||
|
|
$("#type").select2({minimumResultsForSearch: -1}).val("${dataVisualFrame.type}").trigger("change");
|
|||
|
|
$("#active").select2({minimumResultsForSearch: -1}).val("${dataVisualFrame.active}").trigger("change");
|
|||
|
|
|
|||
|
|
getFileList();
|
|||
|
|
$('#url').html(window.location.host + ext.contextPath + "/process/dataVisualFrame/view.do?frameId=${dataVisualFrame.id}&unitId=" + unitId)
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
function typechange(is) {
|
|||
|
|
var st = is.value;
|
|||
|
|
if (st == '${Type_frame}') {
|
|||
|
|
$("#frameSt").css('display', 'block');
|
|||
|
|
} else if (st == '${Type_structure}') {
|
|||
|
|
$("#frameSt").css('display', 'none');
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var showMenu4SelectFun = function () {
|
|||
|
|
$.post(ext.contextPath + '/process/dataVisualFrame/showMenu4Select.do', {
|
|||
|
|
formId: "subForm",
|
|||
|
|
hiddenId: "pid",
|
|||
|
|
textId: "pname",
|
|||
|
|
ownId: '${dataVisualFrame.id}',
|
|||
|
|
menuType: '${param.menuType}'
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#menu4SelectDiv").html(data);
|
|||
|
|
openModal("menu4SelectModal")
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var showUser4SelectsFun = function () {
|
|||
|
|
var userIds = $("#rolepeople").val();
|
|||
|
|
$.post(ext.contextPath + '/user/userForSelectByStructure.do', {
|
|||
|
|
formId: "subForm",
|
|||
|
|
hiddenId: "rolepeople",
|
|||
|
|
textId: "rolepeopleName",
|
|||
|
|
userIds: userIds
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#user4SelectDiv").html(data);
|
|||
|
|
openModal("user4SelectModal");
|
|||
|
|
});
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
function doCopy() {
|
|||
|
|
$.post(ext.contextPath + '/process/dataVisualFrame/showMenu4SelectForCopy.do', {
|
|||
|
|
ownId: '${dataVisualFrame.id}',
|
|||
|
|
menuType: '${param.menuType}'
|
|||
|
|
}, function (data) {
|
|||
|
|
$("#menu4SelectDiv").html(data);
|
|||
|
|
openModal("menu4SelectModal")
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
function doSyncMq() {
|
|||
|
|
$.post(ext.contextPath + '/process/dataVisualFrame/getFrameContentToMqtt.do', {
|
|||
|
|
id: '${dataVisualFrame.id}',
|
|||
|
|
menuType: '${param.menuType}'
|
|||
|
|
}, function (data) {
|
|||
|
|
showAlert('s', "执行完成", 'alertDiv');
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
</script>
|
|||
|
|
<div class="box box-primary">
|
|||
|
|
<div class="box-header with-border">
|
|||
|
|
<h3 class="box-title">详情</h3>
|
|||
|
|
|
|||
|
|
<div class="box-tools pull-right">
|
|||
|
|
<a onclick="doSyncMq()" class="btn btn-box-tool" data-toggle="tooltip" title="同步Mqtt"><i
|
|||
|
|
class="fa fa-undo"></i></a>
|
|||
|
|
<a onclick="doCopy()" class="btn btn-box-tool" data-toggle="tooltip" title="拷贝"><i
|
|||
|
|
class="fa fa-copy"></i></a>
|
|||
|
|
<a onclick="dosave()" class="btn btn-box-tool" data-toggle="tooltip" title="保存"><i
|
|||
|
|
class="glyphicon glyphicon-floppy-disk"></i></a>
|
|||
|
|
<a onclick="dodel('${dataVisualFrame.id}')" class="btn btn-box-tool" data-toggle="tooltip" title="删除"><i
|
|||
|
|
class="glyphicon glyphicon-trash"></i></a>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<!-- /.box-header -->
|
|||
|
|
<div class="box-body ">
|
|||
|
|
<form class="form-horizontal" id="subForm" autocomplete="off">
|
|||
|
|
<!-- 界面提醒div强制id为alertDiv -->
|
|||
|
|
<div id="alertDiv"></div>
|
|||
|
|
<input type="hidden" name="id" id="id" value="${dataVisualFrame.id}"/>
|
|||
|
|
<input type="hidden" name="pid" id="pid" value="${dataVisualFrame.pid}"/>
|
|||
|
|
<input type="hidden" name="oldmorder" id="oldmorder" value="${dataVisualFrame.morder}"/>
|
|||
|
|
<input type="hidden" name="oldpid" id="oldpid" value="${dataVisualFrame.pid}"/>
|
|||
|
|
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">*名称</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="name" name="name" placeholder="名称"
|
|||
|
|
value="${dataVisualFrame.name}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">所属层级</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="pname" name="pname" placeholder="所属层级"
|
|||
|
|
onclick="showMenu4SelectFun();" value="${dataVisualFrame.pname}" readonly>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">类型</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id="type" name="type" class="form-control select2" onchange="typechange(this);">
|
|||
|
|
<option value="${Type_structure}">结构</option>
|
|||
|
|
<option value="${Type_frame}">画面</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">启用</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<select id="active" name="active" class="form-control select2">
|
|||
|
|
<option value="${Active_1}">启用</option>
|
|||
|
|
<option value="${Active_0}">禁用</option>
|
|||
|
|
</select>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">顺序</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="number" class="form-control" id="morder" name="morder" placeholder="顺序"
|
|||
|
|
value="${dataVisualFrame.morder}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div id="frameSt" style="display: none;">
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">宽度</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="width" name="width" placeholder="宽度"
|
|||
|
|
value="${dataVisualFrame.width}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">高度</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="height" name="height" placeholder="高度"
|
|||
|
|
value="${dataVisualFrame.height}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">背景色</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="background" name="background" placeholder="背景色"
|
|||
|
|
value="${dataVisualFrame.background}">
|
|||
|
|
</div>
|
|||
|
|
<label class="col-sm-2 control-label">编码</label>
|
|||
|
|
<div class="col-sm-4">
|
|||
|
|
<input type="text" class="form-control" id="code" name="code" placeholder="编码"
|
|||
|
|
value="${dataVisualFrame.code}">
|
|||
|
|
</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="style" name="style" placeholder="样式"
|
|||
|
|
value="${dataVisualFrame.style}">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">查看人员</label>
|
|||
|
|
<div class="col-sm-10">
|
|||
|
|
<textarea type="text" style="height: 80px;" class="form-control" id="rolepeopleName"
|
|||
|
|
name="rolepeopleName" placeholder="查看人员" onclick="showUser4SelectsFun();"
|
|||
|
|
readonly>${dataVisualFrame.rolepeopleName}</textarea>
|
|||
|
|
<input id="rolepeople" name="rolepeople" type="hidden"
|
|||
|
|
value="${dataVisualFrame.rolepeople}"/>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<label class="col-sm-2 control-label">浏览链接:</label>
|
|||
|
|
<div id="url" class="col-sm-10" style="line-height: 34px;">
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
<div class="form-group">
|
|||
|
|
<div class="col-sm-2">
|
|||
|
|
<button type="button" class="btn btn-default btn-file" onclick="fileinput()" id="btn_save"><i
|
|||
|
|
class="fa fa-paperclip"></i>上传图片
|
|||
|
|
</button>
|
|||
|
|
</div>
|
|||
|
|
<div class="col-sm-6">
|
|||
|
|
<input type="file" name="dataVisualFrameFile" id="dataVisualFrameFile" multiple
|
|||
|
|
class="file-loading"/>
|
|||
|
|
</div>
|
|||
|
|
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
</form>
|
|||
|
|
</div>
|
|||
|
|
</div>
|
|||
|
|
|