提交修改

pg_adapter
dshclm 6 months ago
parent a738d3cf8d
commit c1d6d95bbb

@ -85,7 +85,11 @@
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-search"></i>详细</a> ');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
if (row.state == 1){
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" disabled><i class="fa fa-edit"></i>编辑</a> ');
}
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}

@ -0,0 +1,119 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('涉密场所修改')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: jasny-bootstrap-css" />
</head>
<style>
.highlight {
background-color: yellow;
}
</style>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="app">
<form class="form-horizontal m" id="form-place-add" th:object="${tdPlace}">
<input name="userId" type="hidden" th:field="*{id}" />
<h4 class="form-header h4">变更前</h4>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label">变更前场所名称:</label>
<div class="col-sm-10">
<!-- <input name="meetingTitle" readonly placeholder="请输入变更前场所名称" th:field="*{placeName}" class="form-control m-b" type="text">-->
<div id="placeName" contenteditable="false" style="border-radius: 5px; padding: 10px;background-color: #eee">[[${tdPlace.placeName}]]</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label">变更前场所规范:</label>
<div class="col-sm-10">
<!-- <textarea id="placeRule" name="placeRule" readonly rows="4" placeholder="请输入变更前场所规范" th:field="*{placeRule}" class="form-control"></textarea>-->
<div id="placeRule" contenteditable="false" style="border-radius: 5px; padding: 10px;background-color: #eee">[[${tdPlace.placeRule}]]</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label">备注:</label>
<div class="col-sm-10">
<textarea name="remark" readonly rows="4" placeholder="请输入备注" th:field="*{remark}" class="form-control"></textarea>
</div>
</div>
</div>
</div>
<h4 class="form-header h4">变更后</h4>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label is-required">变更后场所名称:</label>
<div class="col-sm-10">
<!-- <input name="afterName" maxlength="50" disabled placeholder="请输入变更后场所名称" th:field="*{afterName}" class="form-control m-b" type="text">-->
<div id="afterName" contenteditable="false" style="border-radius: 5px; padding: 10px;background-color: #eee">[[${tdPlace.afterName}]]</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label">变更后场所规范:</label>
<div class="col-sm-10">
<!-- <textarea id="afterRule" name="afterRule" rows="4" disabled placeholder="请输入变更后场所规范" th:field="*{afterRule}" class="form-control"></textarea>-->
<div id="afterRule" contenteditable="false" style="border-radius: 5px; padding: 10px;background-color: #eee">[[${tdPlace.afterRule}]]</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-2 control-label">备注:</label>
<div class="col-sm-10">
<textarea name="remark" rows="4" placeholder="请输入备注" disabled th:field="*{remark}" class="form-control"></textarea>
</div>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: jasny-bootstrap-js" />
<script th:inline="javascript">
// function changeTest(strA,strB) {
// var placeRuleDiv = document.getElementById(strA);
// var afterNameDiv = document.getElementById(strB);
// var initialPlaceRuleValue = placeRuleDiv.innerText || placeRuleDiv.textContent;
// var initialAfterNameValue = afterNameDiv.innerText || afterNameDiv.textContent;
// if (initialPlaceRuleValue !== initialAfterNameValue) {
// var diffIndexes = [];
//
// for (var i = 0; i < Math.max(initialPlaceRuleValue.length, initialAfterNameValue.length); i++) {
// if (initialPlaceRuleValue[i] !== initialAfterNameValue[i]) {
// diffIndexes.push(i);
// }
// }
// var highlightedHtml = '';
// var currentDiffIndex = 0;
// for (var j = 0; j < initialAfterNameValue.length; j++) {
// if (currentDiffIndex < diffIndexes.length && j === diffIndexes[currentDiffIndex]) {
// highlightedHtml += '<span style="background-color: yellow;">' + initialAfterNameValue[j] + '</span>';
// currentDiffIndex++;
// } else {
// highlightedHtml += initialAfterNameValue[j];
// }
// }
// afterNameDiv.innerHTML = highlightedHtml;
// }
// }
// changeTest('placeRule','afterRule');
// changeTest('placeName','afterName');
</script>
</body>
</html>

@ -0,0 +1,59 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('涉密场所变更')" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: jasny-bootstrap-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content" id="app">
<form class="form-horizontal m" id="form-place-add" th:object="${tdPlace}">
<input name="userId" type="hidden" th:field="*{id}" />
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">变更后场所名称:</label>
<div class="col-sm-9">
<input name="afterName" maxlength="50" required placeholder="请输入变更后场所名称" class="form-control m-b" type="text">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-3 control-label">变更后场所规范:</label>
<div class="col-sm-9">
<textarea name="afterRule" rows="4" placeholder="请输入变更后场所规范" class="form-control"></textarea>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-9">
<textarea name="remark" rows="4" placeholder="请输入备注" class="form-control"></textarea>
</div>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: jasny-bootstrap-js" />
<script th:inline="javascript">
var prefix = ctx + "system/placeChange"
$("#form-place-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-place-add').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,129 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('涉密场所变更')" />
</head>
<body class="gray-bg">
<div class="container-div" id="app">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>变更后场所名称:</label>
<input type="text" name="afterName"></input>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var detailFlag = [[${@permission.hasPermi('system:placeChange:detail')}]];
var editFlag = [[${@permission.hasPermi('system:placeChange:edit')}]];
var prefix = ctx + "system/placeChange";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
detailUrl: prefix + "/detail/{id}",
modalName: "涉密场所变更",
columns: [{
checkbox: true
},
{
field: 'id',
title: 'ID',
visible: false
},
{
field: 'afterName',
title: '变更后场所名称',
align: "left"
},
{
field: 'afterRule',
title: '变更后场所规范',
width: '45',
widthUnit: '%'
},
{
field: 'createTime',
title: '创建时间',
sortable: true
},
{
field: 'afterTime',
title: '变更时间',
sortable: true
},
{
field: 'state',
title: '状态',
formatter: function(value, row, index) {
if (value == 0) {
return "<span class='badge' style='background-color: #c61c63;color: #fff;'>删除</span>";
} else if (value == 1) {
return "<span class='badge' style='background-color: #f8ac59;color: #fff;'>登记</span>";
} else if (value == 2) {
return "<span class='badge' style='background-color: #1c84c6;color: #fff;'>变更</span>";
}
}
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="detail(\'' + row.id + '\')"><i class="fa fa-search"></i>详细</a> ');
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>变更</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
});
function edit(id) {
table.set();
if ($.common.isEmpty(id) && table.options.type == table_type.bootstrapTreeTable) {
var row = $("#" + table.options.id).bootstrapTreeTable('getSelections')[0];
if ($.common.isEmpty(row)) {
$.modal.alertWarning("请至少选择一条记录");
return;
}
var url = table.options.updateUrl.replace("{id}", row[table.options.uniqueId]);
$.modal.open(table.options.modalName, url);
} else {
$.modal.open(table.options.modalName, $.operate.editUrl(id));
}
}
function detail(id, width, height) {
table.set();
var _url = $.operate.detailUrl(id);
var options = {
title: '变更详情',
width: width,
height: height,
url: _url,
skin: 'layui-layer-gray',
btn: ['关闭'],
yes: function (index, layero) {
$.modal.close(index);
}
};
$.modal.openOptions(options);
}
</script>
</body>
</html>
Loading…
Cancel
Save