+ add guest view

This commit is contained in:
tix 2018-02-02 16:36:47 +08:00
parent c7329d0fc7
commit f929657671
9 changed files with 1562 additions and 369 deletions

View File

@ -16,7 +16,6 @@ router.post('/', function (req, res, next) {
var password = req.body.password;
var hashedPassword = crypto.createHash('md5').update(password).digest('hex');
models_eco_v1.login(username).then(function (data) {
console.log(data);
if (data) {
if (data.password === hashedPassword) {
req.session.user = data;

View File

@ -34,10 +34,10 @@
<img src="/images/logo.png" alt="三江源">
<img src="/images/title.png" alt="三江源">
<% if(user) {%>
<a href="/logout"><span><i class="anticon anticon-logout"></i></span></a>
<a href="/logout" title="退出登录"><span><i class="anticon anticon-logout"></i> 退出</span></a>
<span style="float:right;"><%= user.realname %></span>
<% } else { %>
<a href="/login"><span><i class="anticon anticon-login"></i></span></a>
<a href="/login" title="用户登录"><span><i class="anticon anticon-user"></i> 登录</span></a>
<% } %>
</div>
<ul class="main-nav-menu navbar-nav">

File diff suppressed because one or more lines are too long

View File

@ -14388,6 +14388,13 @@
$.extend($.fn.bootstrapTable.columnDefaults, {
sortable: true
});
loadStationMap('sjy_station_forest');
</script>
<script type="text/javascript">
var user = "<%= user %>";
if (user) {
$('.bt_table_station_forest').bootstrapTable({
url: '/api/gis/sjy_station_forest',
search: 'true',
@ -14419,8 +14426,30 @@
title: '海拔(米)'
}]
});
loadStationMap('sjy_station_forest');
}
else {
$('.bt_table_station_forest').bootstrapTable({
url: '/api/gis/sjy_station_forest',
search: 'true',
showRefresh: 'true',
showToggle: 'true',
showColumns: 'true',
pagination: 'true',
pageSize: '20',
columns: [{
field: 'sta_name',
title: '站(点)名称'
}, {
field: 'sta_code',
title: '站(点)代码'
}, {
field: 'obs_type',
title: '类型'
}, {
field: 'county',
title: '所属行政区域'
}]
});
}
</script>

View File

@ -40033,6 +40033,13 @@
$.extend($.fn.bootstrapTable.columnDefaults, {
sortable: true
});
loadStationMap('sjy_station_grassland');
</script>
<script type="text/javascript">
var user = "<%= user %>";
if (user) {
$('.bt_table_sjy_station_grassland').bootstrapTable({
url: '/api/gis/sjy_station_grassland',
search: 'true',
@ -40064,7 +40071,30 @@
title: '海拔(米)'
}]
});
loadStationMap('sjy_station_grassland');
}
else {
$('.bt_table_sjy_station_grassland').bootstrapTable({
url: '/api/gis/sjy_station_grassland',
search: 'true',
showRefresh: 'true',
showToggle: 'true',
showColumns: 'true',
pagination: 'true',
pageSize: '20',
columns: [{
field: 'sta_name',
title: '站(点)名称'
}, {
field: 'sta_code',
title: '站(点)代码'
}, {
field: 'address',
title: '年份'
}, {
field: 'obs_type',
title: '类型'
}]
});
}
</script>

View File

@ -22091,6 +22091,13 @@
title: '水位'
}]
});
loadStationMap('sjy_station_hydrology');
</script>
<script type="text/javascript">
var user = "<%= user %>";
if (user) {
$('.bt_table_sjy_station_hydrology').bootstrapTable({
url: '/api/gis/sjy_station_hydrology',
search: 'true',
@ -22120,7 +22127,28 @@
title: '海拔(米)'
}]
});
loadStationMap('sjy_station_hydrology');
}
else {
$('.bt_table_sjy_station_hydrology').bootstrapTable({
url: '/api/gis/sjy_station_hydrology',
search: 'true',
showRefresh: 'true',
showToggle: 'true',
showColumns: 'true',
columns: [{
field: 'id',
title: '序号'
}, {
field: 'sta_name',
title: '站(点)名称'
}, {
field: 'sta_type',
title: '站(点)属性'
}, {
field: 'county',
title: '所属行政区域'
}]
});
}
</script>

View File

@ -956,38 +956,6 @@
$.extend($.fn.bootstrapTable.columnDefaults, {
sortable: true
});
$('.bt_table').bootstrapTable({
url: '/api/gis/sjy_station_weather',
search: 'true',
showRefresh: 'true',
showToggle: 'true',
showColumns: 'true',
columns: [{
field: 'id',
title: '序号'
}, {
field: 'sta_name',
title: '站(点)名称'
}, {
field: 'sta_type',
title: '站(点)属性'
}, {
field: 'county',
title: '所属行政区域'
}, {
field: 'longitude',
title: '经度',
class: 'tc_100'
}, {
field: 'latitude',
title: '纬度',
class: 'tc_100'
}, {
field: 'altitude',
title: '海拔(米)',
class: 'tc_100'
}]
});
$('.bt_table_weather_month').bootstrapTable({
url: '/api/eco/sjy_weather_month',
@ -1041,3 +1009,64 @@
$('.fixed-table-toolbar').append('<div class="search pull-left">年份选择:</div>');
</script>
<script type="text/javascript">
var user = "<%= user %>";
if (user) {
$('.bt_table').bootstrapTable({
url: '/api/gis/sjy_station_weather',
search: 'true',
showRefresh: 'true',
showToggle: 'true',
showColumns: 'true',
columns: [{
field: 'id',
title: '序号'
}, {
field: 'sta_name',
title: '站(点)名称'
}, {
field: 'sta_type',
title: '站(点)属性'
}, {
field: 'county',
title: '所属行政区域'
}, {
field: 'longitude',
title: '经度',
class: 'tc_100'
}, {
field: 'latitude',
title: '纬度',
class: 'tc_100'
}, {
field: 'altitude',
title: '海拔(米)',
class: 'tc_100'
}]
});
}
else {
$('.bt_table').bootstrapTable({
url: '/api/gis/sjy_station_weather',
search: 'true',
showRefresh: 'true',
showToggle: 'true',
showColumns: 'true',
columns: [{
field: 'id',
title: '序号'
}, {
field: 'sta_name',
title: '站(点)名称'
}, {
field: 'sta_type',
title: '站(点)属性'
}, {
field: 'county',
title: '所属行政区域'
}]
});
}
</script>

View File

@ -3931,6 +3931,13 @@
$.extend($.fn.bootstrapTable.columnDefaults, {
sortable: true
});
loadStationMap('sjy_station_water_soil_conservation');
</script>
<script type="text/javascript">
var user = "<%= user %>";
if (user) {
$('.bt_table_station_wetland').bootstrapTable({
url: '/api/gis/sjy_station_wetland',
search: 'true',
@ -3960,8 +3967,29 @@
title: '海拔(米)'
}]
});
loadStationMap('sjy_station_water_soil_conservation');
}
else {
$('.bt_table_station_wetland').bootstrapTable({
url: '/api/gis/sjy_station_wetland',
search: 'true',
showRefresh: 'true',
showToggle: 'true',
showColumns: 'true',
columns: [{
field: 'sta_name',
title: '站(点)名称'
}, {
field: 'sta_code',
title: '站(点)代码'
}, {
field: 'obs_type',
title: '类型'
}, {
field: 'county',
title: '所属行政区域'
}]
});
}
</script>

View File

@ -2822,6 +2822,13 @@
title: '长度比'
}]
});
loadStationMap('sjy_station_wetland');
</script>
<script type="text/javascript">
var user = "<%= user %>";
if (user) {
$('.bt_table_station_wetland').bootstrapTable({
url: '/api/gis/sjy_station_wetland',
search: 'true',
@ -2851,7 +2858,28 @@
title: '海拔(米)'
}]
});
loadStationMap('sjy_station_wetland');
}
else {
$('.bt_table_station_wetland').bootstrapTable({
url: '/api/gis/sjy_station_wetland',
search: 'true',
showRefresh: 'true',
showToggle: 'true',
showColumns: 'true',
columns: [{
field: 'sta_name',
title: '站(点)名称'
}, {
field: 'sta_code',
title: '站(点)代码'
}, {
field: 'obs_type',
title: '类型'
}, {
field: 'county',
title: '所属行政区域'
}]
});
}
</script>