|
|
<!DOCTYPE html>
|
|
|
<html>
|
|
|
|
|
|
<head>
|
|
|
<meta charset="utf-8">
|
|
|
<title></title>
|
|
|
<link rel="stylesheet" href="../layui/css/layui.css" />
|
|
|
<style>
|
|
|
.woo-tool-text-delimiter {
|
|
|
width: 1px;
|
|
|
height: 12px;
|
|
|
background: #EEEEEE;
|
|
|
display: inline-block;
|
|
|
margin: 0 6px 0 4px;
|
|
|
}
|
|
|
|
|
|
.woo-theme-color {
|
|
|
color: #1e9fff !important;
|
|
|
}
|
|
|
|
|
|
.woo-tool-span {
|
|
|
margin: 0 3px;
|
|
|
position: relative;
|
|
|
top: -1px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
|
|
|
.layui-card-body .layui-form {
|
|
|
margin-top: 0 !important;
|
|
|
}
|
|
|
|
|
|
.layui-form-select {
|
|
|
width: 300px;
|
|
|
}
|
|
|
</style>
|
|
|
</head>
|
|
|
|
|
|
<body class="layui-form">
|
|
|
|
|
|
<div class="layui-card" style="margin-bottom: 10px !important;">
|
|
|
<div class="layui-card-body">
|
|
|
<div class="layui-form-item" style="margin: 10px 0 5px 0 !important;">
|
|
|
<div class="layui-form-item layui-inline">
|
|
|
<label class="layui-form-label" style="width: auto;">充电桩名称:</label>
|
|
|
<div class="layui-input-inline" id="orgTypeView">
|
|
|
<input type="text" id="equipmentName" lay-affix="clear" lay-filter="clear"
|
|
|
placeholder="请输入充电桩名称" class="layui-input">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-form-item layui-inline">
|
|
|
<label class="layui-form-label" style="width: auto;">充电桩编号:</label>
|
|
|
<div class="layui-input-inline" id="orgTypeView">
|
|
|
<input type="text" id="equipmentSn" lay-affix="clear" lay-filter="clear" placeholder="请输入充电桩编号"
|
|
|
class="layui-input">
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-form-item layui-inline">
|
|
|
<label class="layui-form-label" style="width: auto;">充电站:</label>
|
|
|
<div class="layui-input-inline" id="station">
|
|
|
</div>
|
|
|
<script id="stationScript" type="text/html">
|
|
|
<select id="stationId" lay-filter="stationFilter">
|
|
|
<option value="">全部</option>
|
|
|
{{# layui.each(d, function(index, item){ }}
|
|
|
<option value="{{item.id}}">{{item.stationName}}</option>
|
|
|
{{# }); }}
|
|
|
</select>
|
|
|
</script>
|
|
|
</div>
|
|
|
<div class="layui-form-item layui-inline" style="margin-left: 100px;">
|
|
|
<button class="layui-btn" lay-submit lay-filter="user-query">
|
|
|
<i class="layui-icon layui-icon-search"></i>
|
|
|
查询
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="layui-card">
|
|
|
<div class="layui-card-body">
|
|
|
<table id="data-table"></table>
|
|
|
<script type="text/html" id="sblx">
|
|
|
{{# if(d.equipmentType === 1){ }}
|
|
|
<span>直流设备</span>
|
|
|
{{# } else { }}
|
|
|
<span>交流设备</span>
|
|
|
{{# } }}
|
|
|
</script>
|
|
|
|
|
|
<script type="text/html" id="sbzt">
|
|
|
{{# if(d.status === 1){ }}
|
|
|
<span>建设中</span>
|
|
|
{{# } else if(d.status === 5) { }}
|
|
|
<span>关闭下线</span>
|
|
|
{{# } else if(d.status === 6) { }}
|
|
|
<span>维护中</span>
|
|
|
{{# } else if(d.status === 50) { }}
|
|
|
<span>正常使用</span>
|
|
|
{{# } else { }}
|
|
|
<span>未知</span>
|
|
|
{{# } }}
|
|
|
</script>
|
|
|
|
|
|
<script type="text/html" id="table-bar">
|
|
|
<span class="woo-tool-span woo-tool-text-span" lay-event="edit"><a
|
|
|
class="woo-theme-color">修改名称</a></span>
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<script src="../layui/layui.js"></script>
|
|
|
<script src="../../../lib/base64.js"></script>
|
|
|
|
|
|
<script>
|
|
|
layui.use(function () {
|
|
|
var table = layui.table;
|
|
|
var form = layui.form;
|
|
|
var $ = layui.jquery;
|
|
|
var common = layui.common;
|
|
|
var laytpl = layui.laytpl;
|
|
|
|
|
|
function getJwt() {
|
|
|
var token = "";
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/ZhuQue/wxgzh/getJwt",
|
|
|
success: function (res) {
|
|
|
if (res.code === 200) {
|
|
|
token = res.data.token;
|
|
|
} else {
|
|
|
token = ""
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
return token;
|
|
|
}
|
|
|
|
|
|
getStationList();
|
|
|
|
|
|
function getStationList() {
|
|
|
var _token = getJwt();
|
|
|
$.ajax({
|
|
|
type: "GET",
|
|
|
async: false,
|
|
|
url: "/saas/station/selectSaasStationList?departmentId=&operatorId=",
|
|
|
headers: {
|
|
|
'Authorization': _token
|
|
|
},
|
|
|
success: function (res) {
|
|
|
var stationSelectTpl = stationScript.innerHTML,
|
|
|
stationView = document.getElementById('station');
|
|
|
laytpl(stationSelectTpl).render(res.data, function (html) {
|
|
|
stationView.innerHTML = html;
|
|
|
});
|
|
|
form.render();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
tableRender();
|
|
|
|
|
|
function tableRender() {
|
|
|
|
|
|
var _token = getJwt();
|
|
|
|
|
|
if (_token) {
|
|
|
table.render({
|
|
|
elem: '#data-table',
|
|
|
url: '/saas/equipment/sassSelectEquipmentPageInfo?operatorId=&departmentId=&manufacturerSn=&stationName=&status=',
|
|
|
headers: {
|
|
|
//'Authorization': 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjp7Im1vYmlsZSI6InN1cGVyYWRtaW4ifSwiZXhwIjoxNzI5ODIwMzgzLCJpYXQiOjE3MjkyMTU1ODN9.XmqFi3IsUk31YpnyWrh7ehgK1MLXVT1KrugowHpfjUY'
|
|
|
'Authorization': _token
|
|
|
|
|
|
},
|
|
|
request: {
|
|
|
pageName: 'pageNum', // 页码的参数名称,默认:page
|
|
|
limitName: 'pageSize' // 每页数据条数的参数名,默认:limit
|
|
|
},
|
|
|
where: {
|
|
|
equipmentName: $("#equipmentName").val(),
|
|
|
equipmentSn: $("#equipmentSn").val(),
|
|
|
stationIdsStr: $("#stationId").val(),
|
|
|
},
|
|
|
height: 'full-135',
|
|
|
page: {
|
|
|
limit: 20
|
|
|
, layout: ['count', 'prev', 'page', 'next', 'skip']
|
|
|
, prev: "上一页"
|
|
|
, next: "下一页"
|
|
|
},
|
|
|
cols: [[
|
|
|
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
|
|
|
{ title: '充电桩名称', field: 'equipmentName', align: 'center' },
|
|
|
{ title: '充电桩编号', field: 'equipmentSn', align: 'center', width: "15%" },
|
|
|
{ title: '设备类型', align: 'center', templet: '#sblx', width: "10%" },
|
|
|
{ title: '功率', field: 'power', align: 'center', width: "10%" },
|
|
|
{ title: '电流', field: 'ratedCurrent', align: 'center', width: "10%" },
|
|
|
{ title: '刷卡方式', field: 'isUseCardMsg', align: 'center', width: "10%" },
|
|
|
{ title: '状态', align: 'center', templet: '#sbzt', width: "10%" },
|
|
|
{ title: '操作', toolbar: '#table-bar', align: 'center', width: "10%" }
|
|
|
]],
|
|
|
skin: 'line',
|
|
|
defaultToolbar: [],
|
|
|
parseData: function (res) {
|
|
|
if (res.code === 1000) {
|
|
|
return {
|
|
|
"code": 0,
|
|
|
"msg": "",
|
|
|
"count": res.data.total,
|
|
|
"data": res.data.list
|
|
|
};
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
} else {
|
|
|
layer.msg("获取签名失败!", {
|
|
|
icon: 2,
|
|
|
time: 2000
|
|
|
});
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
form.on('submit(user-query)', function () {
|
|
|
|
|
|
tableRender();
|
|
|
|
|
|
// 阻止表单的默认提交行为
|
|
|
return false;
|
|
|
});
|
|
|
|
|
|
table.on('tool(data-table)', function (obj) {
|
|
|
if (obj.event === 'edit') {
|
|
|
layer.open({
|
|
|
type: 2,
|
|
|
title: '修改名称',
|
|
|
area: ['600px', '180px'],
|
|
|
shade: 0.1,
|
|
|
content: './update.html?id=' + obj.data.id + '&name=' + encodeURIComponent(Base64.encode(obj.data.equipmentName))
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
</script>
|
|
|
</body>
|
|
|
|
|
|
</html> |