|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
|
|
|
<head>
|
|
|
|
<th:block th:insert="~{include :: header('打印模版设置列表')}" />
|
|
|
|
<th:block th:include="~{include :: bootstrap-fileinput-css}" />
|
|
|
|
</head>
|
|
|
|
<body class="white-bg">
|
|
|
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
|
|
|
<form class="form-horizontal m" id="form-modelmanager-add">
|
|
|
|
<h4 class="form-header h4">打印模版设置信息</h4>
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label is-required">模版编号:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input name="mCode" class="form-control" type="text" required>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label is-required">模版名称:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input name="mName" class="form-control" type="text" required>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label is-required">模版类型:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<select name="mType" class="form-control" th:with="type=${@dict.getType('model_type')}" required >
|
|
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label is-required">模版来源:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<select name="mTypeSrc" id="mTypeSrcid" onchange="imgChange(value)" class="form-control" th:with="type=${@dict.getType('model_type_src')}" required>
|
|
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label">文件名称:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input name="mFilename" id="mFilename" iclass="form-control" type="text" required>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12" >
|
|
|
|
<div id="filediv" class="form-group" style="display: none">
|
|
|
|
<label class="font-noraml">模版文件上传</label>
|
|
|
|
<div class="file-loading" >
|
|
|
|
<input id="singleFile" name="file" type="file" >
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12" >
|
|
|
|
<div class="form-group" id="editordiv" style="display: none">
|
|
|
|
<label class="col-sm-3 control-label">模版内容:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<script id="editor" name="mData" type="text/plain" style="height: 300px;" ></script>
|
|
|
|
<textarea id="mData" style="display: none;">[[*{mData}]]</textarea>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label is-required">纸张类型:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<select name="mPageSize" class="form-control" th:with="type=${@dict.getType('model_page_type')}" required>
|
|
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label">纸张尺寸:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<input name="mPageValue" class="form-control" type="text" th:disabled="${mPageSize}!='UESR'">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<div class="form-group">
|
|
|
|
<label class="col-sm-3 control-label">是否横向:</label>
|
|
|
|
<div class="col-sm-8">
|
|
|
|
<select name="isPageRotate" class="form-control" th:with="type=${@dict.getType('sys_yes_no')}" required>
|
|
|
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- <div class="col-xs-12">-->
|
|
|
|
<!-- <div class="form-group">-->
|
|
|
|
<!-- <label class="col-sm-3 control-label is-required">是否动态参数:</label>-->
|
|
|
|
<!-- <div class="col-sm-8">-->
|
|
|
|
<!-- <select name="isDyparam" class="form-control" th:with="type=${@dict.getType('sys_yes_no')}" required>-->
|
|
|
|
<!-- <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>-->
|
|
|
|
<!-- </select>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<!-- </div>-->
|
|
|
|
<h4 class="form-header h4">模版参数管理信息</h4>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<button type="button" class="btn btn-white btn-sm" onclick="addRow()"><i class="fa fa-plus"> 增加</i></button>
|
|
|
|
<button type="button" class="btn btn-white btn-sm" onclick="sub.delRow()"><i class="fa fa-minus"> 删除</i></button>
|
|
|
|
<div class="col-sm-12 select-table table-striped">
|
|
|
|
<table id="bootstrap-table"></table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<th:block th:include="~{include :: footer}" />
|
|
|
|
<th:block th:include="~{include :: ueditor-js}" />
|
|
|
|
<th:block th:include="~{include :: bootstrap-fileinput-js}" />
|
|
|
|
<script th:inline="javascript">
|
|
|
|
var prefix = ctx + "print/modelmanager"
|
|
|
|
var paramTypeDatas = [[${@dict.getType('param_type')}]];
|
|
|
|
$("#form-modelmanager-add").validate({
|
|
|
|
focusCleanup: true
|
|
|
|
});
|
|
|
|
$(function () {
|
|
|
|
var text = $("#mData").text();
|
|
|
|
var ue = UE.getEditor('editor');
|
|
|
|
ue.ready(function () {
|
|
|
|
ue.setContent(text);
|
|
|
|
});
|
|
|
|
})
|
|
|
|
function submitHandler() {
|
|
|
|
if ($.validate.form()) {
|
|
|
|
$.operate.save(prefix + "/add", $('#form-modelmanager-add').serialize());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function imgChange(value){
|
|
|
|
let elementById = document.getElementById("editordiv");
|
|
|
|
let fileUpload = document.getElementById("filediv");
|
|
|
|
if(value==="STRING"){
|
|
|
|
elementById.style.display="block";
|
|
|
|
fileUpload.style.display="none";
|
|
|
|
}else{
|
|
|
|
elementById.style.display="none";
|
|
|
|
if(value==="FILE"){
|
|
|
|
fileUpload.style.display="block";
|
|
|
|
}else{
|
|
|
|
fileUpload.style.display="none";
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$(function() {
|
|
|
|
var options = {
|
|
|
|
pagination: false,
|
|
|
|
showSearch: false,
|
|
|
|
showRefresh: false,
|
|
|
|
showToggle: false,
|
|
|
|
showColumns: false,
|
|
|
|
sidePagination: "client",
|
|
|
|
columns: [{
|
|
|
|
checkbox: true
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'index',
|
|
|
|
align: 'center',
|
|
|
|
title: "序号",
|
|
|
|
formatter: function (value, row, index) {
|
|
|
|
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
|
|
|
|
return columnIndex + $.table.serialNumber(index);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'paramCode',
|
|
|
|
align: 'center',
|
|
|
|
title: '参数名',
|
|
|
|
formatter: function(value, row, index) {
|
|
|
|
var html = $.common.sprintf("<input class='form-control' type='text' name='winPrintModelParamsList[%s].paramCode' value='%s'>", index, value);
|
|
|
|
return html;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'paramDesc',
|
|
|
|
align: 'center',
|
|
|
|
title: '参数描述',
|
|
|
|
formatter: function(value, row, index) {
|
|
|
|
var html = $.common.sprintf("<input class='form-control' type='text' name='winPrintModelParamsList[%s].paramDesc' value='%s'>", index, value);
|
|
|
|
return html;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
field: 'paramType',
|
|
|
|
align: 'center',
|
|
|
|
title: '参数类型',
|
|
|
|
formatter: function(value, row, index) {
|
|
|
|
var name = $.common.sprintf("winPrintModelParamsList[%s].paramType", index);
|
|
|
|
return $.common.dictToSelect(paramTypeDatas, value, name);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '操作',
|
|
|
|
align: 'center',
|
|
|
|
formatter: function(value, row, index) {
|
|
|
|
var value = $.common.isNotEmpty(row.index) ? row.index : $.table.serialNumber(index);
|
|
|
|
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="sub.delRowByIndex(\'' + value + '\')"><i class="fa fa-remove"></i>删除</a>';
|
|
|
|
}
|
|
|
|
}]
|
|
|
|
};
|
|
|
|
$.table.init(options);
|
|
|
|
});
|
|
|
|
|
|
|
|
function addRow() {
|
|
|
|
var count = $("#" + table.options.id).bootstrapTable('getData').length;
|
|
|
|
var row = {
|
|
|
|
index: $.table.serialNumber(count),
|
|
|
|
paramCode: "",
|
|
|
|
paramDesc: "",
|
|
|
|
paramType: "",
|
|
|
|
}
|
|
|
|
sub.addRow(row);
|
|
|
|
}
|
|
|
|
$(document).ready(function () {
|
|
|
|
// 单图上传
|
|
|
|
$("#singleFile").fileinput({
|
|
|
|
//uploadUrl: ctx + 'common/upload',
|
|
|
|
uploadUrl:"/print/modelmanager/upload",
|
|
|
|
maxFileCount: 1,
|
|
|
|
autoReplace: true
|
|
|
|
}).on('fileuploaded', function (event, data, previewId, index) {
|
|
|
|
var rsp = data.response;
|
|
|
|
//log.info("return url:" + rsp.url)
|
|
|
|
//console.log("reutrn fileName:" + rsp.fileName)
|
|
|
|
//log.info("reutrn newFileName:" + rsp.newFileName)
|
|
|
|
//log.info("return originalFilename:" + rsp.originalFilename)
|
|
|
|
document.getElementById("mFilename").value=rsp.newFileName;
|
|
|
|
}).on('fileremoved', function (event, id, index) {
|
|
|
|
$("input[name='" + event.currentTarget.id + "']").val('')
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|