123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- <!DOCTYPE html>
- <html class="x-admin-sm">
- <head>
- <meta charset="UTF-8">
- <meta name="renderer" content="webkit">
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
- <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
- <link rel="shortcut icon" href="https://osscold.baozhida.cn/favicon.ico">
- <link rel="bookmark" href="https://osscold.baozhida.cn/favicon.ico">
- <link rel="stylesheet" href="https://osscold.baozhida.cn/css/font.css">
- <link rel="stylesheet" href="https://osscold.baozhida.cn/css/xadmin.css">
- <script src="https://osscold.baozhida.cn/lib/layui/layui.js" charset="utf-8"></script>
- <script type="text/javascript" src="https://osscold.baozhida.cn/js/xadmin.js"></script>
- </head>
- <body>
- <div class="x-nav">
- <span class="layui-breadcrumb">
- <a href="">首页</a>
- <a><cite>宝智达</cite></a>
- </span>
- <a class="layui-btn layui-btn-normal" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
- <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
- </a>
- </div>
- <div class="layui-fluid">
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md12">
- <div class="layui-card">
- <div class="layui-card-body ">
- <form class="layui-form layui-col-space5">
- <div class="layui-input-inline layui-show-xs-block">
- <input value="{{.Name}}" type="text" name="Name" placeholder="请输入 名称" autocomplete="off" class="layui-input"></div>
- <div class="layui-input-inline layui-show-xs-block">
- <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="sreach">
- <i class="layui-icon"></i></button>
- </div>
- </form>
- </div>
- <div class="layui-card-header">
- <!-- <button class="layui-btn layui-btn-danger" onclick="delAll()">-->
- <!-- <i class="layui-icon"></i>批量删除</button>-->
- <button class="layui-btn layui-btn-normal" onclick="xadmin.open('添加','User_?id=0',500,600,false);">
- <i class="layui-icon"></i>添加</button></div>
- <div class="layui-card-body ">
- <table class="layui-table layui-form">
- <thead>
- <tr>
- <th>编号</th>
- <th>名称</th>
- <th>账号</th>
- <th>权限</th>
- <th>电话</th>
- <th>邮箱</th>
- <th>性别</th>
- <th>备注</th>
- <th>创建时间</th>
- <th width="75px">操作</th></tr>
- </thead>
- <tbody>
- {{range $index, $elem := .List}}
- <tr>
- <td>{{$elem.Admin_uuid}}</td>
- <td>{{$elem.Admin_name}}</td>
- <td>{{$elem.Admin_user}}</td>
- <td>
- {{range $index, $elemx := $.Power_List}}
- {{if eq $elem.Admin_power $elemx.Id }}
- {{$elemx.Power_name}}
- {{end}}
- {{end}}
- </td>
- <td>{{$elem.Admin_telephone}}</td>
- <td>{{$elem.Admin_mail}}</td>
- <td>
- {{if eq $elem.Admin_gender 0 }}
- 未知
- {{end}}
- {{if eq $elem.Admin_gender 1 }}
- 男
- {{end}}
- {{if eq $elem.Admin_gender 2 }}
- 女
- {{end}}
- </td>
- <td>{{$elem.Admin_text}}</td>
- <td>{{$elem.CreateTime}}</td>
- <td class="td-manage" >
- <div style="float: left">
- <a title="无钥匙登陆" style="color: #05a000" onclick="User_entry(this,'{{$elem.Admin_uuid}}');" href="javascript:;">
- <i class="layui-icon" style="margin-right: 4px"></i>无钥匙登陆</a>
- <a title="同步分类" style="color: #a03eff;" onclick="DeviceClass_Syn('{{$elem.Admin_uuid}}');" href="javascript:;">
- <i class="iconfont" style="margin-right: 4px"></i>同步分类</a>
- </div>
- <div style="float: left;margin-bottom: 8px">
- <a title="编辑" style="color: #008cff;" onclick="xadmin.open('编辑','User_?id={{$elem.Id}}&Admin_uuid={{$elem.Admin_uuid}}',500,600,false);" href="javascript:;">
- <i class="layui-icon" ></i>编辑</a>
- <a title="删除" style="color: #ff3636" onclick="member_del(this,'{{$elem.Admin_uuid}}')" href="javascript:;">
- <i class="layui-icon"></i>删除</a>
- </div>
- </td>
- </tr>
- {{end}}
- </tbody>
- </table>
- </div>
- <div class="layui-card-body ">
- <div class="page">
- <div>
- {{range $index, $elem := .Pages}}
- {{if eq $elem.A 1}}
- <a class="prev" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}"><<</a>
- {{end}}
- {{if eq $elem.A 2}}
- <a class="num" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}">{{$elem.V}}</a>
- {{end}}
- {{if eq $elem.A 3}}
- <span class="current">{{$elem.V}}</span>
- {{end}}
- {{if eq $elem.A 4}}
- <a class="num" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}">{{$elem.V}}</a>
- {{end}}
- {{if eq $elem.A 5}}
- <a class="next" href="?page={{$elem.V}}&Name={{$.Name}}&Class_1={{$.Class_1}}">>></a>
- {{end}}
- {{end}}
- </div>
- Page:{{.Page}}-
- Page_size:{{.Page_size}}-
- cnt:{{.cnt}}
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- <script>
- layui.use(['laydate', 'form'],
- function() {
- var laydate = layui.laydate;
- //执行一个laydate实例
- laydate.render({
- elem: '#start' //指定元素
- });
- //执行一个laydate实例
- laydate.render({
- elem: '#end' //指定元素
- });
- });
- /*用户-删除*/
- function member_del(obj, Admin_uuid) {
- layer.confirm('确认要删除吗?',
- function(index) {
- //发异步删除数据
- $(obj).parents("tr").remove();
- $.ajax({
- type: 'POST',
- url: 'User_Del',//发送请求
- data: {Admin_uuid:Admin_uuid},
- success: function(result) {
- console.log(result)
- if (result.Code == 200 ){
- layer.msg('已删除!', {
- icon: 1,
- time: 2000
- });
- window.location.reload();
- }else {
- layer.msg('删除失败!', {
- time: 2000
- });
- }
- }
- });
- });
- }
- /*用户-无钥匙进入*/
- function User_entry(obj, Admin_uuid) {
- layer.confirm('确认要 无钥匙进入 子账号吗?(确定后本账户将会退出登陆)',
- function(index) {
- $.ajax({
- type: 'POST',
- url: 'User_Entry',//发送请求
- data: {
- Admin_uuid:Admin_uuid
- },
- success: function(result) {
- console.log(result)
- if (result.Code == 200 ){
- window.parent.location.reload();
- }else {
- layer.msg('失败!', {
- time: 2000
- });
- }
- }
- });
- // window.open("/Index", "_blank");
- });
- }
- /*用户-无钥匙进入*/
- function DeviceClass_Syn(Admin_uuid) {
- layer.confirm('确认要 同步分类 子账号吗?',
- function(index) {
- var loading = layer.load(0, {
- shade: false,
- time: 99*1000
- });
- $.ajax({
- type: 'POST',
- url: '../Device/DeviceClass_Syn',//发送请求
- data: {
- Admin_uuid:Admin_uuid
- },
- success: function(result) {
- layer.close(loading)
- console.log(result)
- if (result.Code != 200) {
- layer.msg(result.Msg);
- return
- }
- layer.msg("成功同步传感器分类数量:"+result.Data);
- }
- });
- // window.open("/Index", "_blank");
- });
- }
- </script>
- </html>
|