105 lines
4.3 KiB
HTML
105 lines
4.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
|
|
<head>
|
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
|
<link href="/jscss/style.css" rel="stylesheet" type="text/css" />
|
|
<script type="text/javascript" charset="utf-8" src="/jscss/theme.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="container">
|
|
<form class="search" onsubmit="table.search(this,'btn');return false;">
|
|
<div>
|
|
<div class="sinps"></div>
|
|
<div class="sbtns">
|
|
<button class="lang btn" type="submit">查询</button>
|
|
<a class="lang btn" onclick="edit(0)">添加</a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<div class="table">
|
|
<div class="loading col-24">Loading...</div>
|
|
<ul class="list row"></ul>
|
|
<div>
|
|
<div class="btmbtn">
|
|
<a class="lang btn def" onclick="ciyfn.select_all(table)">全选</a>
|
|
<a class="lang btn def" onclick="ciyfn.select_diff(table)">反选</a>
|
|
|
|
|
<a class="lang btn dag" onclick="ciyfn.select_callfunc(table, this,'del','已选{n}条,是否批量删除?',{},function(json){table.delline(json)})">批量删除</a>
|
|
</div>
|
|
<div class="page"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript" src="/jscss/ciy.js"></script>
|
|
<script type="text/javascript" src="/jscss/ciytable.js"></script>
|
|
<script type="text/javascript" src="../common.js"></script>
|
|
<script type="text/javascript">
|
|
'use strict';
|
|
var table;
|
|
var Glob = {};
|
|
ciyfn.pageload(function () {
|
|
table = new ciyclass.cardtable({
|
|
dom: '.table'
|
|
, url: 'init'
|
|
, pagecount: window.innerWidth > 992 ? 9 : 6
|
|
, fn_beforedata: function (json) {
|
|
ciyfn.fillsearch({
|
|
dom: '.search'
|
|
, data: json
|
|
});
|
|
return json;
|
|
}
|
|
, fn_lihtml: function (ldat) {
|
|
var ds = ldat['power'].split('.');
|
|
var p1 = 0;
|
|
var p2 = 0;
|
|
for (var d in ds) {
|
|
if (ds[d] == '')
|
|
continue;
|
|
if (isNaN(parseInt(ds[d].charAt(ds[d].length - 1))))
|
|
p2++;
|
|
else
|
|
p1++;
|
|
}
|
|
var powerhtml = '';
|
|
if (p1 > 0)
|
|
powerhtml += '<code>' + ciyfn.lang('主权限') + p1 + ciyfn.lang('项') + '</code>';
|
|
if (p2 > 0)
|
|
powerhtml += '<code>' + ciyfn.lang('子权限') + p2 + ciyfn.lang('项') + '</code>';
|
|
if (powerhtml == '')
|
|
powerhtml = '<kbd class="lang">无</kbd>';
|
|
return `<li data-id="${ldat.id}" class="col-24 col-sm-12 col-md-8">
|
|
<div class="ciy-list" style="height:9em;">
|
|
<div class="l1">${ldat.name}</div>
|
|
<div class="rt">${powerhtml}</div>
|
|
<div class="l2">${ldat.memo}</div>
|
|
<div class="lb txt-smm"> 更新: ${ciyfn.todatetime(ldat.uptimes)}</div>
|
|
<div class="rb"><a class="lang btn" onclick="edit(${ldat.id})">修改</a></div>
|
|
</div>
|
|
</li>`;//测试es6真实普及率
|
|
}
|
|
});
|
|
table.callpage(1);
|
|
|
|
});
|
|
function edit(id) {
|
|
ciyfn.alert({
|
|
title: id == 0 ? '添加' : '修改'
|
|
, width: 'pc'
|
|
, height: 'pc'
|
|
, frame: 'rigger/role_u.html?id=' + id
|
|
, cb: function (opn) {
|
|
opn.close();
|
|
table.updateline(opn.inputs);
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html> |