|
|
<!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('车辆基础信息列表')" />
|
|
|
<style>
|
|
|
.car-no-link {
|
|
|
color: #1c84c6;
|
|
|
font-weight: 600;
|
|
|
text-decoration: none;
|
|
|
border-bottom: 1px solid rgba(28, 132, 198, 0.35);
|
|
|
padding-bottom: 2px;
|
|
|
}
|
|
|
|
|
|
.car-no-link:hover,
|
|
|
.car-no-link:focus {
|
|
|
color: #0f6fa8;
|
|
|
text-decoration: none;
|
|
|
border-bottom-color: #0f6fa8;
|
|
|
}
|
|
|
|
|
|
.lifecycle-drawer-mask {
|
|
|
position: fixed;
|
|
|
top: 0;
|
|
|
right: 0;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
z-index: 1980;
|
|
|
display: none;
|
|
|
background: rgba(0, 0, 0, 0.18);
|
|
|
}
|
|
|
|
|
|
.lifecycle-drawer {
|
|
|
position: fixed;
|
|
|
top: 0;
|
|
|
right: 0;
|
|
|
z-index: 1981;
|
|
|
width: 66.6667%;
|
|
|
height: 100%;
|
|
|
background: #f3f3f4;
|
|
|
box-shadow: -4px 0 18px rgba(0, 0, 0, 0.18);
|
|
|
transform: translateX(100%);
|
|
|
transition: transform 0.24s ease;
|
|
|
}
|
|
|
|
|
|
.lifecycle-drawer.open {
|
|
|
transform: translateX(0);
|
|
|
}
|
|
|
|
|
|
.lifecycle-drawer-header {
|
|
|
height: 48px;
|
|
|
padding: 0 14px 0 18px;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
background: #fff;
|
|
|
border-bottom: 1px solid #e7eaec;
|
|
|
}
|
|
|
|
|
|
.lifecycle-drawer-title {
|
|
|
color: #2f4050;
|
|
|
font-weight: 600;
|
|
|
font-size: 15px;
|
|
|
max-width: calc(100% - 70px);
|
|
|
overflow: hidden;
|
|
|
text-overflow: ellipsis;
|
|
|
white-space: nowrap;
|
|
|
}
|
|
|
|
|
|
.lifecycle-drawer-close {
|
|
|
width: 32px;
|
|
|
height: 32px;
|
|
|
border: 0;
|
|
|
background: transparent;
|
|
|
color: #676a6c;
|
|
|
font-size: 20px;
|
|
|
line-height: 32px;
|
|
|
}
|
|
|
|
|
|
.lifecycle-drawer-close:hover {
|
|
|
color: #ed5565;
|
|
|
}
|
|
|
|
|
|
.lifecycle-drawer iframe {
|
|
|
width: 100%;
|
|
|
height: calc(100% - 48px);
|
|
|
border: 0;
|
|
|
display: block;
|
|
|
background: #f3f3f4;
|
|
|
}
|
|
|
|
|
|
@media (max-width: 991px) {
|
|
|
.lifecycle-drawer {
|
|
|
width: 92%;
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
</head>
|
|
|
<body class="gray-bg">
|
|
|
<div class="container-div">
|
|
|
<div class="row">
|
|
|
<div class="col-sm-12 search-collapse">
|
|
|
<form id="formId">
|
|
|
<div class="select-list">
|
|
|
<ul>
|
|
|
<li>
|
|
|
<p>车牌:</p>
|
|
|
<input type="text" name="carNo"/>
|
|
|
</li>
|
|
|
<li>
|
|
|
<p>所属车队:</p>
|
|
|
<input type="text" name="team"/>
|
|
|
</li>
|
|
|
<li>
|
|
|
<p>线路:</p>
|
|
|
<input type="text" name="line"/>
|
|
|
</li>
|
|
|
<li>
|
|
|
<p>车型:</p>
|
|
|
<input type="text" name="type"/>
|
|
|
</li>
|
|
|
<li>
|
|
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
|
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
|
|
|
|
<div class="btn-group-sm" id="toolbar" role="group">
|
|
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:car:add">
|
|
|
<i class="fa fa-plus"></i> 添加
|
|
|
</a>
|
|
|
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:car:edit">
|
|
|
<i class="fa fa-edit"></i> 修改
|
|
|
</a>
|
|
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:car:remove">
|
|
|
<i class="fa fa-remove"></i> 删除
|
|
|
</a>
|
|
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:car:export">
|
|
|
<i class="fa fa-download"></i> 导出
|
|
|
</a>
|
|
|
<a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="system:car:import">
|
|
|
<i class="fa fa-upload"></i> 导入
|
|
|
</a>
|
|
|
</div>
|
|
|
<div class="col-sm-12 select-table table-striped">
|
|
|
<table id="bootstrap-table"></table>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="lifecycle-drawer-mask" id="lifecycleDrawerMask" onclick="closeLifecycleDrawer()"></div>
|
|
|
<div class="lifecycle-drawer" id="lifecycleDrawer">
|
|
|
<div class="lifecycle-drawer-header">
|
|
|
<div class="lifecycle-drawer-title" id="lifecycleDrawerTitle">车辆详情</div>
|
|
|
<button type="button" class="lifecycle-drawer-close" onclick="closeLifecycleDrawer()" title="关闭">×</button>
|
|
|
</div>
|
|
|
<iframe id="lifecycleFrame" src="about:blank"></iframe>
|
|
|
</div>
|
|
|
<th:block th:include="include :: footer" />
|
|
|
<script th:inline="javascript">
|
|
|
var editFlag = [[${@permission.hasPermi('system:car:edit')}]];
|
|
|
var removeFlag = [[${@permission.hasPermi('system:car:remove')}]];
|
|
|
var prefix = ctx + "tyre/car";
|
|
|
|
|
|
$(function() {
|
|
|
var options = {
|
|
|
url: prefix + "/list",
|
|
|
createUrl: prefix + "/add",
|
|
|
updateUrl: prefix + "/edit/{id}",
|
|
|
removeUrl: prefix + "/remove",
|
|
|
exportUrl: prefix + "/export",
|
|
|
importUrl: prefix + "/importData",
|
|
|
importTemplateUrl: prefix + "/importTemplate",
|
|
|
modalName: "车辆基础信息",
|
|
|
columns: [{
|
|
|
checkbox: true
|
|
|
},
|
|
|
{
|
|
|
field : 'id',
|
|
|
title : '主键',
|
|
|
visible: false
|
|
|
},
|
|
|
{
|
|
|
field : 'carNo',
|
|
|
title : '车牌',
|
|
|
formatter: function(value, row, index) {
|
|
|
var carNo = $.common.nullToStr(value);
|
|
|
if (!carNo) {
|
|
|
return '-';
|
|
|
}
|
|
|
// 车牌号作为生命周期入口,统一编码放入 data 属性,避免中文车牌或特殊字符破坏 onclick。
|
|
|
return '<a class="car-no-link" href="javascript:void(0)" data-car-no="' + encodeURIComponent(carNo) + '" onclick="openLifecycleDrawer(this)">' + escapeHtml(carNo) + '</a>';
|
|
|
}
|
|
|
},
|
|
|
{
|
|
|
field : 'team',
|
|
|
title : '所属车队'
|
|
|
},
|
|
|
{
|
|
|
field : 'line',
|
|
|
title : '线路'
|
|
|
},
|
|
|
{
|
|
|
field : 'type',
|
|
|
title : '车型'
|
|
|
},
|
|
|
{
|
|
|
field : 'remark',
|
|
|
title : '备注'
|
|
|
},
|
|
|
{
|
|
|
field: 'createTime',
|
|
|
title: '创建时间'
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
|
align: 'center',
|
|
|
formatter: function(value, row, index) {
|
|
|
var actions = [];
|
|
|
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> ');
|
|
|
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('');
|
|
|
}
|
|
|
}]
|
|
|
};
|
|
|
$.table.init(options);
|
|
|
});
|
|
|
|
|
|
function openLifecycleDrawer(target) {
|
|
|
var carNo = decodeURIComponent($(target).attr("data-car-no") || "");
|
|
|
if (!carNo) {
|
|
|
// 没有车牌就无法建立生命周期主线,直接拦截避免后端产生无意义查询。
|
|
|
$.modal.alertWarning("车牌号为空,无法查看生命周期报表");
|
|
|
return;
|
|
|
}
|
|
|
$("#lifecycleDrawerTitle").text("车辆详情 - " + carNo);
|
|
|
$("#lifecycleFrame").attr("src", prefix + "/lifecycle/view/" + encodeURIComponent(carNo));
|
|
|
$("#lifecycleDrawerMask").show();
|
|
|
$("#lifecycleDrawer").addClass("open");
|
|
|
}
|
|
|
|
|
|
function closeLifecycleDrawer() {
|
|
|
$("#lifecycleDrawer").removeClass("open");
|
|
|
$("#lifecycleDrawerMask").hide();
|
|
|
// 关闭时清空 iframe,避免用户继续操作已隐藏的生命周期页面。
|
|
|
$("#lifecycleFrame").attr("src", "about:blank");
|
|
|
}
|
|
|
|
|
|
function openMaintenanceOrderTabFromLifecycle() {
|
|
|
// 子 iframe 不直接创建页签:由车辆列表页所在主 iframe 调用 RuoYi openTab,才能正确挂到后台页签容器。
|
|
|
$.modal.openTab("维保工单列表", ctx + "tyre/order");
|
|
|
closeLifecycleDrawer();
|
|
|
}
|
|
|
|
|
|
function escapeHtml(value) {
|
|
|
return String(value)
|
|
|
.replace(/&/g, "&")
|
|
|
.replace(/</g, "<")
|
|
|
.replace(/>/g, ">")
|
|
|
.replace(/"/g, """)
|
|
|
.replace(/'/g, "'");
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|
|
|
<!-- 导入区域 -->
|
|
|
<script id="importTpl" type="text/template">
|
|
|
<form enctype="multipart/form-data" class="mt20 mb10">
|
|
|
<div class="col-xs-offset-1">
|
|
|
<input type="file" id="file" name="file"/>
|
|
|
<div class="mt10 pt5">
|
|
|
<input type="checkbox" id="updateSupport" name="updateSupport" title="如果车辆已经存在,更新这条数据。"> 是否更新已经存在的车辆数据
|
|
|
<a onclick="$.table.importTemplate()" class="btn btn-default btn-xs"><i class="fa fa-file-excel-o"></i> 下载模板</a>
|
|
|
</div>
|
|
|
<font color="red" class="pull-left mt10">
|
|
|
提示:仅允许导入“xls”或“xlsx”格式文件!
|
|
|
</font>
|
|
|
</div>
|
|
|
</form>
|
|
|
</script>
|
|
|
</html>
|