182 lines
7.2 KiB
HTML
182 lines
7.2 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>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<div class="table">
|
|
<div class="topbtn">
|
|
<a class="lang btn" onclick="edit(0)">添加调试用户</a>
|
|
<a class="lang btn warn" onclick="writen()">写入登录页面</a>
|
|
</div>
|
|
<div class="loading col-24">Loading...</div>
|
|
<div class="list"></div>
|
|
<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>
|
|
<div id="alert_edit" style="display:none;">
|
|
<div class="char3 row">
|
|
<div class="ciy-form col-24 col-sm-8">
|
|
<label class="lang imp">子系统</label>
|
|
<div>
|
|
<ciy-select com="targettype" />
|
|
</div>
|
|
</div>
|
|
<div class="ciy-form col-24 col-sm-16">
|
|
<label class="lang">开关</label>
|
|
<div>
|
|
<ciy-switch com="isuse" />
|
|
</div>
|
|
</div>
|
|
<div class="ciy-form col-24 col-sm-8">
|
|
<label class="imp">显示名</label>
|
|
<div>
|
|
<input type="text" name="name" style="width:100%;" />
|
|
</div>
|
|
</div>
|
|
<div class="ciy-form col-24 col-sm-8">
|
|
<label class="imp">用户名</label>
|
|
<div>
|
|
<input type="text" name="user" style="width:100%;" />
|
|
</div>
|
|
</div>
|
|
<div class="ciy-form col-24 col-sm-8">
|
|
<label class="imp">密码</label>
|
|
<div>
|
|
<input type="text" name="pass" style="width:100%;" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="alert_write" style="display:none;">
|
|
<div class="char3 row">
|
|
<div class="ciy-form col-24 col-sm-12">
|
|
<label class="lang imp">子系统</label>
|
|
<div>
|
|
<ciy-select com="targettype" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/javascript" src="/jscss/ciy.js"></script>
|
|
<script type="text/javascript" src="/jscss/ciycmp.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.table({
|
|
dom: '.table'
|
|
, url: 'init'
|
|
, pagecount: 10
|
|
, fn_beforedata: function (json) {
|
|
ciyfn.fillsearch({
|
|
searchdom: '.search'
|
|
, data: json
|
|
});
|
|
return json;
|
|
}
|
|
, fn_tdcontent: function (key, datashow, field, data) {
|
|
if (key == '_btn') {
|
|
var html = '';
|
|
html += '<a class="lang btn" onclick="menubtn(this, \'edit\')">修改</a>';
|
|
return html;
|
|
}
|
|
}
|
|
});
|
|
table.callpage(1);
|
|
});
|
|
function menubtn(dom, btn) {
|
|
var id = $5(dom).parent('tr').attr('data-id');
|
|
if (btn == 'edit') {
|
|
edit(id);
|
|
}
|
|
}
|
|
function edit(id) {
|
|
ciyfn.alert({
|
|
title: id == 0 ? '新建' : '修改'
|
|
, width: 'pc'
|
|
, content: document.getElementById("alert_edit").innerHTML
|
|
//, noparent:true
|
|
, fn_showed: function (doc, dom) {
|
|
Glob.edit = id;
|
|
if (id == 0 && !table.data[0])
|
|
table.data[0] = { isuse: 1 };
|
|
$5('[name=id]', dom).val(table.data[id].id);
|
|
ciycmp({ dom: $5('[com=targettype]', dom), value: table.data[id].targettype, range: 'targettype' });
|
|
ciycmp({ dom: $5('[com=isuse]', dom), value: table.data[id].isuse });
|
|
$5('[name=name]', dom).val(table.data[id].name);
|
|
$5('[name=user]', dom).val(table.data[id].user);
|
|
$5('[name=pass]', dom).val(table.data[id].pass);
|
|
}
|
|
, cb: function (opn) {
|
|
if (opn.btn == "关闭")
|
|
return opn.close();
|
|
opn.inputs.id = id;
|
|
if (ciyfn.throttle(opn.dombtn)) return;
|
|
ciyfn.callfunc('update', opn.inputs, function (json) {
|
|
table.updateline(json);
|
|
opn.close();
|
|
ciyfn.toast('提交成功');
|
|
});
|
|
},
|
|
btns: ["提交", "*关闭"]
|
|
});
|
|
}
|
|
function writen() {
|
|
ciyfn.alert({
|
|
title: '写入登录页面'
|
|
, width: 'mb'
|
|
, content: document.getElementById("alert_write").innerHTML
|
|
//, noparent:true
|
|
, fn_showed: function (doc, dom) {
|
|
ciycmp({ dom: $5('[com=targettype]', dom), range: 'targettype' });
|
|
}
|
|
, cb: function (opn) {
|
|
if (opn.btn == "关闭")
|
|
return opn.close();
|
|
if (ciyfn.throttle(opn.dombtn)) return;
|
|
if (opn.btn == "写入") {
|
|
ciyfn.callfunc("getlocal", opn.inputs, function (json) {
|
|
ciyfn.setstorage('_debuguser' + opn.inputs.targettype, json.list);
|
|
ciyfn.toast('写入缓存成功');
|
|
});
|
|
}
|
|
if (opn.btn == "清除") {
|
|
ciyfn.removestorage('_debuguser' + opn.inputs.targettype);
|
|
ciyfn.toast('已关闭');
|
|
}
|
|
},
|
|
btns: ["写入", "!清除", "*关闭"]
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
|
|
</html> |