|
@@ -1,436 +0,0 @@
|
|
|
-<!DOCTYPE html>
|
|
|
-<html>
|
|
|
-<head>
|
|
|
- <meta charset="utf-8">
|
|
|
- <title>租户管理</title>
|
|
|
- <meta name="renderer" content="webkit">
|
|
|
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
|
- <meta name="viewport"
|
|
|
- content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
|
|
- <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
|
|
|
- <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
|
|
|
- <link rel="stylesheet" type="text/css" href="../../layuiadmin/style/formSelects-v4.css"/>
|
|
|
- <style type="text/css">
|
|
|
- .LAY-btns .layui-nav {padding-left:0;padding-right:10px;top:-4px;margin: 0 10px;border: 0;background-color: #009688;}
|
|
|
- .LAY-btns .layui-nav .layui-nav-item{line-height: 30px;}
|
|
|
- .LAY-btns .layui-nav .layui-nav-child{top:34px;}
|
|
|
- .LAY-btns .layui-nav .layui-nav-bar{display: none;}
|
|
|
- .LAY-btns .layui-nav .layui-nav-child dd.layui-this a{color:#333;background-color:#fff;}
|
|
|
- .LAY-btns .layui-nav .layui-nav-child dd.layui-this a:hover {background-color: #f2f2f2;color: #000;}
|
|
|
- .seach_items {display:inline-block;margin-right: 5px; margin-top: 5px;}
|
|
|
- </style>
|
|
|
-</head>
|
|
|
-<body>
|
|
|
-
|
|
|
-<div class="layui-fluid">
|
|
|
- <div class="layui-card">
|
|
|
- <div class="layui-card-body" pad15>
|
|
|
- <div class="layui-row layui-col-space15">
|
|
|
- <div class="layui-col-md12">
|
|
|
- <div class="layui-row LAY-btns" style="margin-bottom: 10px;">
|
|
|
- <div class="layui-col-md5">
|
|
|
- <button class="layui-btn" style="margin-bottom: 10px" id="btn_batch"><i
|
|
|
- class="layui-icon layui-icon-upload"></i>批量上传代码
|
|
|
- </button>
|
|
|
- <button class="layui-btn" style="margin-bottom: 10px" id="btn_update"><i
|
|
|
- class="layui-icon layui-icon-edit"></i>更新状态
|
|
|
- </button>
|
|
|
- <button class="layui-btn" style="margin-bottom: 10px" id="btn_unit"><i
|
|
|
- class="layui-icon layui-icon-add-1"></i>添加插件
|
|
|
- </button>
|
|
|
- <button class="layui-btn" style="margin-bottom: 10px" id="btn_release"><i
|
|
|
- class="layui-icon layui-icon-add-1"></i>发布
|
|
|
- </button>
|
|
|
- <button class="layui-btn" style="margin-bottom: 10px" id="btn_cert"><i
|
|
|
- class="layui-icon layui-icon-add-1"></i>上传证书
|
|
|
- </button>
|
|
|
- </div>
|
|
|
- <div class="layui-col-md7">
|
|
|
- <form class="layui-form" lay-filter="query-form-element">
|
|
|
- <div class="seach_items">
|
|
|
- <input type="text" name="tenant_name" autocomplete="off" class="layui-input"
|
|
|
- placeholder="租户"/>
|
|
|
- </div>
|
|
|
- <div class="seach_items">
|
|
|
- <input type="text" name="user_version" autocomplete="off" class="layui-input"
|
|
|
- placeholder="当前版本"/>
|
|
|
- </div>
|
|
|
- <div class="seach_items">
|
|
|
- <select name="audit_status" style="width: 40px;">
|
|
|
- <option value="">审核状态</option>
|
|
|
- <option value="0">审核通过</option>
|
|
|
- <option value="1">审核拒绝</option>
|
|
|
- <option value="2">审核中</option>
|
|
|
- <option value="3">已撤回</option>
|
|
|
- <option value="4">审核延后</option>
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- <div class="seach_items">
|
|
|
- <input type="text" name="wait_audit_version" autocomplete="off" class="layui-input"
|
|
|
- placeholder="待审核版本"/>
|
|
|
- </div>
|
|
|
- <div class="seach_items">
|
|
|
- <input type="text" name="wait_audit_template" autocomplete="off" class="layui-input"
|
|
|
- placeholder="待审核模板"/>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div class="seach_items">
|
|
|
- <button class="layui-btn" lay-submit lay-filter="query-form-element"><i
|
|
|
- class="layui-icon layui-icon-search"></i>查询
|
|
|
- </button>
|
|
|
- </div>
|
|
|
- </form>
|
|
|
- </div>
|
|
|
- <div style="clear: both;"></div>
|
|
|
-
|
|
|
- </div>
|
|
|
- <table class="layui-hide" id="datagrid" lay-filter="datagrid-operate"></table>
|
|
|
-
|
|
|
- <script type="text/html" id="datagrid-operate-bar">
|
|
|
- <div class="layui-btn-group">
|
|
|
- <a class="layui-btn layui-btn-xs" lay-event="upload">上传代码</a>
|
|
|
- </div>
|
|
|
- <div class="layui-btn-group">
|
|
|
- <a class="layui-btn layui-btn-xs" lay-event="update">更新状态</a>
|
|
|
- </div>
|
|
|
- <div class="layui-btn-group">
|
|
|
- <a class="layui-btn layui-btn-xs" lay-event="key">设置秘钥</a>
|
|
|
- </div>
|
|
|
- <!--div class="layui-btn-group">
|
|
|
- <a class="layui-btn layui-btn-xs" lay-event="tenant">设置商户</a>
|
|
|
- </div-->
|
|
|
- <div class="layui-btn-group">
|
|
|
- <a class="layui-btn layui-btn-xs" lay-event="unit">添加插件</a>
|
|
|
- </div>
|
|
|
- <div class="layui-btn-group">
|
|
|
- <a class="layui-btn layui-btn-xs" lay-event="release">发布</a>
|
|
|
- </div>
|
|
|
- </script>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
-</div>
|
|
|
-
|
|
|
-<script src="../../layuiadmin/layui/layui.js?t=1"></script>
|
|
|
-<script>
|
|
|
- layui.config({
|
|
|
- base: '../../../layuiadmin/' //静态资源所在路径
|
|
|
- }).extend({
|
|
|
- index: 'lib/index' //主入口模块
|
|
|
- , formSelects: 'formSelects-v4'
|
|
|
- }).use(['index', 'table', 'form', 'upload'], function () {
|
|
|
- var $ = layui.$
|
|
|
- , table = layui.table
|
|
|
- , admin = layui.admin
|
|
|
- , form = layui.form;
|
|
|
- table.render({
|
|
|
- elem: '#datagrid'
|
|
|
- , url: '/admin/wechatapp/'
|
|
|
- , cols: [[
|
|
|
- {type: 'checkbox', width: 50}
|
|
|
- , {field: 'tenant_name', title: '租户名称', width: 100}
|
|
|
- , {field: 'principal_name', title: '主体名称', width: 100}
|
|
|
- , {field: 'user_version', title: '当前程序版本', width: 150}
|
|
|
- , {field: 'template_id', title: '当前模板', width: 100}
|
|
|
- , {field: 'audit_status_text', title: '审核状态', width: 100}
|
|
|
- , {field: 'reject_reason', title: '拒绝原因', width: 100}
|
|
|
- , {field: 'auditid', title: '待审核ID', width: 100}
|
|
|
- , {field: 'wait_audit_version', title: '待审核版本', width: 100}
|
|
|
- , {field: 'wait_audit_template', title: '待审核模板', width: 100}
|
|
|
- , {field: 'nick_name', title: '昵称', width: 100}
|
|
|
- , {field: 'authorize_text', title: '授权', width: 80}
|
|
|
- , {field: 'authorizer_appid', title: '授权方appid', width: 150}
|
|
|
- , {field: 'access_token_gtime', title: '获取令牌时间', width: 200}
|
|
|
- , {field: 'expires_in', title: '令牌有效期', width: 100}
|
|
|
- , {title: "操作", width: 360, align: 'left', fixed: 'right', toolbar: '#datagrid-operate-bar'}
|
|
|
- ]]
|
|
|
- , page: true
|
|
|
- , height: 'full-108'
|
|
|
- });
|
|
|
- var _params;
|
|
|
- form.on('submit(query-form-element)', function (data) {
|
|
|
- //layer.msg(JSON.stringify(data.field));
|
|
|
- _params = data.field;
|
|
|
- table.reload('datagrid', {
|
|
|
- where: data.field
|
|
|
- , page: {curr: 1}
|
|
|
- });
|
|
|
- layer.closeAll();
|
|
|
- return false;
|
|
|
- });
|
|
|
- //监听工具条
|
|
|
- table.on('tool(datagrid-operate)', function (obj) {
|
|
|
- var data = obj.data;
|
|
|
- table.editdata = data;
|
|
|
- if (obj.event === 'upload') {
|
|
|
- layer.open({
|
|
|
- type: 2,
|
|
|
- title: '上传代码',
|
|
|
- shadeClose: false,
|
|
|
- area: ['550px', '400px'],
|
|
|
- btn: ['保存', '取消'],
|
|
|
- yes: function (index, dom) {
|
|
|
- layui.onSubmitChild = function (data) {
|
|
|
- // 关闭当前弹层
|
|
|
- layer.close(index);
|
|
|
- table.reload("datagrid", {});
|
|
|
- };
|
|
|
- layui.submitChild()
|
|
|
- },
|
|
|
- btn2: function (index, layero) {
|
|
|
- layer.close(index);//关闭当前按钮
|
|
|
- },
|
|
|
- content: 'upload.html?id=' + data.id
|
|
|
- });
|
|
|
- } else if (obj.event === 'key') {
|
|
|
- layer.open({
|
|
|
- type: 2,
|
|
|
- title: '设置密钥',
|
|
|
- shadeClose: false,
|
|
|
- area: ['550px', '300px'],
|
|
|
- btn: ['保存', '取消'],
|
|
|
- yes: function (index, dom) {
|
|
|
- layui.submitChild();
|
|
|
- },
|
|
|
- btn2: function (index, layero) {
|
|
|
- layer.close(index);//关闭当前按钮
|
|
|
- },
|
|
|
- content: 'set_key.html?id=' + data.id
|
|
|
- });
|
|
|
- } else if (obj.event === 'tenant') {
|
|
|
- layer.open({
|
|
|
- type: 2,
|
|
|
- title: '设置商户',
|
|
|
- shadeClose: false,
|
|
|
- area: ['550px', '300px'],
|
|
|
- btn: ['保存', '取消'],
|
|
|
- yes: function (index, dom) {
|
|
|
- layui.onSubmitChild = function (data) {
|
|
|
- layer.close(index);
|
|
|
- table.reload('datagrid', {});
|
|
|
- };
|
|
|
- layui.submitChild();
|
|
|
- },
|
|
|
- btn2: function (index, layero) {
|
|
|
- layer.close(index);//关闭当前按钮
|
|
|
- },
|
|
|
- content: 'set_tenant.html?id=' + data.id
|
|
|
- });
|
|
|
- } else if (obj.event === "update") {
|
|
|
- layer.confirm('确定要更新吗?', function (index) {
|
|
|
- layer.close(index);
|
|
|
- var ids = [];
|
|
|
- ids.push(data.id);
|
|
|
- layui.admin.req({
|
|
|
- url: '/admin/wechatapp/refresh_audit_status/',
|
|
|
- data: {ids: JSON.stringify(ids)},
|
|
|
- type: 'post'
|
|
|
- , done: function (res) {
|
|
|
- layer.msg('更新成功!', {icon: 6});
|
|
|
- table.reload('datagrid', {});
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- } else if (obj.event === 'unit') {
|
|
|
- layer.confirm('确定要上传插件吗?', function (index) {
|
|
|
- layer.close(index);
|
|
|
- var ids = [];
|
|
|
- ids.push(data.id);
|
|
|
- layui.admin.req({
|
|
|
- url: '/admin/wechatapp/add_plugin/',
|
|
|
- data: {ids: JSON.stringify(ids)},
|
|
|
- type: 'post'
|
|
|
- , done: function (res) {
|
|
|
- layer.msg('更新成功!', {icon: 6});
|
|
|
- table.reload('datagrid', {});
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- } else if (obj.event === 'release') {
|
|
|
- layer.confirm('确定要发布吗?', function (index) {
|
|
|
- layer.close(index);
|
|
|
- var ids = [];
|
|
|
- ids.push(data.id);
|
|
|
- layui.admin.req({
|
|
|
- url: '/admin/wechatapp/release/',
|
|
|
- data: {ids: JSON.stringify(ids)},
|
|
|
- type: 'post'
|
|
|
- , done: function (res) {
|
|
|
- layer.msg('发布成功!', {icon: 6});
|
|
|
- table.reload('datagrid', {});
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- $('#btn_add').on('click', function () {
|
|
|
- layer.open({
|
|
|
- type: 2,
|
|
|
- title: '添加',
|
|
|
- shadeClose: false,
|
|
|
- area: ['450px', '250px'],
|
|
|
- btn: ['保存', '取消'],
|
|
|
- yes: function (index, dom) {
|
|
|
- layui.onSubmitChild = function (data) {
|
|
|
- layer.close(index);
|
|
|
- table.reload('datagrid', {});
|
|
|
- };
|
|
|
- layui.submitChild();
|
|
|
- },
|
|
|
- btn2: function (index, layero) {
|
|
|
- layer.close(index);//关闭当前按钮
|
|
|
- },
|
|
|
- content: 'edit.html'
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- //批量上传代码
|
|
|
- $('#btn_batch').on('click', function () {
|
|
|
- var ids = [];
|
|
|
- for (var i in table.cache['datagrid']) {
|
|
|
- if (table.cache['datagrid'][i].LAY_CHECKED) {
|
|
|
- ids.push(table.cache['datagrid'][i].id)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (ids.length === 0) {
|
|
|
- layer.msg('请至少选择一条记录!', {icon: 5});
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- layer.open({
|
|
|
- type: 2,
|
|
|
- title: '上传代码',
|
|
|
- shadeClose: false,
|
|
|
- area: ['550px', '400px'],
|
|
|
- btn: ['保存', '取消'],
|
|
|
- yes: function (index, dom) {
|
|
|
- layui.onSubmitChild = function (data) {
|
|
|
- layer.close(index);
|
|
|
- table.reload('datagrid', {});
|
|
|
- };
|
|
|
- layui.submitChild();
|
|
|
- },
|
|
|
- btn2: function (index, layero) {
|
|
|
- layer.close(index);//关闭当前按钮
|
|
|
- },
|
|
|
- content: 'upload.html?ids=' + ids
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- //更新状态
|
|
|
- $('#btn_update').on('click', function () {
|
|
|
- var update_ids = [];
|
|
|
- for (var i in table.cache['datagrid']) {
|
|
|
- if (table.cache['datagrid'][i].LAY_CHECKED) {
|
|
|
- update_ids.push(table.cache['datagrid'][i].id)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (update_ids.length === 0) {
|
|
|
- layer.msg('请至少选择一条记录!', {icon: 5});
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- layer.confirm('确定要更新吗?', function (index) {
|
|
|
- layer.close(index);
|
|
|
- admin.req({
|
|
|
- url: '/admin/wechatapp/refresh_audit_status/',
|
|
|
- data: {ids: JSON.stringify(update_ids)},
|
|
|
- type: 'post',
|
|
|
- done: function (res) {
|
|
|
- table.reload('datagrid', {});
|
|
|
- layer.msg('更新成功!', {icon: 6});
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- //添加插件
|
|
|
- $('#btn_unit').on('click', function () {
|
|
|
- var update_ids = [];
|
|
|
- for (var i in table.cache['datagrid']) {
|
|
|
- if (table.cache['datagrid'][i].LAY_CHECKED) {
|
|
|
- update_ids.push(table.cache['datagrid'][i].id)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (update_ids.length === 0) {
|
|
|
- layer.msg('请至少选择一条记录!', {icon: 5});
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- layer.confirm('确定要添加插件吗?', function (index) {
|
|
|
- layer.close(index);
|
|
|
- admin.req({
|
|
|
- url: '/admin/wechatapp/add_plugin/',
|
|
|
- data: {ids: JSON.stringify(update_ids)},
|
|
|
- type: 'post',
|
|
|
- done: function (res) {
|
|
|
- table.reload('datagrid', {});
|
|
|
- layer.msg('更新成功!', {icon: 6});
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- $('#btn_release').on('click', function () {
|
|
|
- var update_ids = [];
|
|
|
- for (var i in table.cache['datagrid']) {
|
|
|
- if (table.cache['datagrid'][i].LAY_CHECKED) {
|
|
|
- update_ids.push(table.cache['datagrid'][i].id)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (update_ids.length === 0) {
|
|
|
- layer.msg('请至少选择一条记录!', {icon: 5});
|
|
|
- return false;
|
|
|
- }
|
|
|
-
|
|
|
- layer.confirm('确定要发布吗?', function (index) {
|
|
|
- layer.close(index);
|
|
|
- admin.req({
|
|
|
- url: '/admin/wechatapp/release/',
|
|
|
- data: {ids: JSON.stringify(update_ids)},
|
|
|
- type: 'post',
|
|
|
- done: function (res) {
|
|
|
- table.reload('datagrid', {});
|
|
|
- layer.msg('发布成功!', {icon: 6});
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- $('#btn_cert').on('click', function () {
|
|
|
- var checkStatus = table.checkStatus('datagrid')
|
|
|
- , data = checkStatus.data;
|
|
|
- if (data.length !== 1) {
|
|
|
- layer.msg('请选择一条记录', {icon: 5});
|
|
|
- return false;
|
|
|
- }
|
|
|
- layer.open({
|
|
|
- type: 2,
|
|
|
- title: '上传',
|
|
|
- area: ['600px', '450px'],
|
|
|
- btn: ['保存', '取消'],
|
|
|
- yes: function (index, dom) {
|
|
|
- layui.onSubmitChild = function (data) {
|
|
|
- layer.close(index);
|
|
|
- table.reload('datagrid', {});
|
|
|
- };
|
|
|
- layui.submitChild();
|
|
|
- },
|
|
|
- btn2: function (index, layero) {
|
|
|
- layer.close(index);//关闭当前按钮
|
|
|
- },
|
|
|
- content: 'upload_cert.html?id=' + data[0].id
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
-</script>
|
|
|
-</body>
|
|
|
-</html>
|
|
|
-
|