Authored by 马力

Merge branch 'dev_开关控制' into grey

... ... @@ -23,6 +23,11 @@ module.exports=function(app) {
/* 编辑页面 */
app.get("/operations/gate/:id","operations.gate.Edit","gate_findGateByID", function (response) {
// 日期处理
response.data.createTimeStr = toDate(response.data.createTime);
response.data.updateTimeStr = toDate(response.data.updateTime);
// 转化成 json 页面直接获取
this.$extend = {
moduleName: "运营管理",
... ... @@ -41,3 +46,13 @@ module.exports=function(app) {
app.post("/operations/gate/delete", "gate_gateDelete");
}
function toDate(seconds) {
if (!seconds || seconds <= 0) { return ''; }
var date = new Date(seconds * 1000);
return fixTwo(date.getFullYear()) + '-' + fixTwo((date.getMonth() + 1)) + '-' + fixTwo(date.getDate()) + ' ' + fixTwo(date.getHours()) + ':' + fixTwo(date.getMinutes()) + ':' + fixTwo(date.getSeconds());
}
function fixTwo(number) {
return number < 10? "0" + number: number;
}
... ...
... ... @@ -63,6 +63,11 @@
</select>
</div>
</div>
<%if data%>
<div class="form-group">
<label class="col-sm-4 control-label">创建时间 :<% data.createTimeStr %> &nbsp;&nbsp;&nbsp;更改时间 :<% data.updateTimeStr %></label>
</div>
<%/if%>
</div>
</div>
</div>
... ...