admin
2021-07-03 ea68e8f8c00c0178037a9f1cc6dc1663bde913b8
service-push/src/main/resources/static/pushplatform-appinfo-list.html
File was renamed from service-push/src/main/resources/static/source-get-list.html
@@ -20,6 +20,18 @@
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="./js/utils.js"></script>
    <script>
        var form = {
            "app.id": 123,
            "app.name": "测试",
            id: 12312312,
            name: "测试123"
        };
        var obj = formUtil.formFieldsToJSON(form);
        console.log(JSON.stringify(obj));
    </script>
</head>
<body>
@@ -27,7 +39,7 @@
            <span class="layui-breadcrumb">
                <a href="">来源管理</a>
                <a>
                    <cite>获取来源列表</cite></a>
                    <cite>三方推送平台应用信息</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
       onclick="location.reload()" title="刷新">
@@ -51,7 +63,7 @@
                        <div class="layui-inline layui-show-xs-block">
                            <select name="appCode" lay-verify="required" lay-search="">
                                <option value="">直接选择或搜索应用</option>
                                <option v-for="item in appList" :value="item.appCode">{{item.appName}}</option>
                                <option v-for="item in appList" :value="item.appCode">{{item.name}}</option>
                            </select>
                        </div>
@@ -75,7 +87,7 @@
</body>
<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
        <button class="layui-btn" onclick="xadmin.open('添加来源','./source-get-add.html',500,580)"><i
        <button class="layui-btn" onclick="xadmin.open('添加推送平台应用信息','./pushplatform-appinfo-add.html',500,580)"><i
                class="layui-icon"></i>添加
        </button>
@@ -92,7 +104,7 @@
        <!--<i class="layui-icon">&#xe669;</i>-->
        <!--</a>-->
        <a title="删除" onclick="member_del(this,{{d.LAY_INDEX }},{{d.id}})" href="javascript:;">
        <a title="删除" onclick="member_del(this,{{d.LAY_INDEX }},'{{d.id}}')" href="javascript:;">
            <i class="layui-icon">&#xe640;</i>
        </a>
    </div>
@@ -143,13 +155,6 @@
        });
    }
    function member_resume(obj, index, id) {
        layer.confirm('确认要恢复吗?', function (index) {
            //发异步删除数据
            // $(obj).parents("tr").remove();
            layer.msg('已恢复!', {icon: 1, time: 1000});
        });
    }
</script>
<script>
@@ -185,7 +190,7 @@
                    });
                },
                deleteList: function (ids, success) {
                    ksapp.post("/admin/api/source/get/delete", {ids: JSON.stringify(ids)}, function (e) {
                    ksapp.post("/admin/api/pushplatform-app/delete", {ids: JSON.stringify(ids)}, function (e) {
                        if (e.code == 0) {
                            success();
                        } else {
@@ -196,7 +201,7 @@
                },
                update: function (id, params) {
                    params.id = id;
                    ksapp.post("/admin/api/source/get/update", params, function (e) {
                    ksapp.postJSON("/admin/api/pushplatform-app/update", params, function (e) {
                        if (e.code == 0) {
                            layer.msg("修改成功");
                        } else
@@ -208,7 +213,7 @@
                getAppList: function () {//应用列表
                    ksapp.post("/admin/api/app/list", {page: 1, limit: 100}, function (e) {
                        if (e.code == 0) {
                            app.appList = e.data.data;
                            app.appList = e.data.list;
                            layui.use("form", function (e) {
                                var form = layui.form;
                                form.render();
@@ -243,7 +248,7 @@
                        app.start = ksapp.getQueryParam("start");
                        app.end = ksapp.getQueryParam("end");
                        var table = layui.table;
                        var url = "/admin/api/source/get/list";
                        var url = "/admin/api/pushplatform-app/list";
                        tableIns = table.render({
                            elem: '#table_list',
                            url: url,
@@ -251,23 +256,31 @@
                            totalRow: true,
                            cols: [
                                [{type: 'checkbox', title: "ID"},
                                    {field: 'id', width: 80, sort: true, title: "ID"},
                                    {field: 'icon', templet:'#iconTpl', edit: 'text', sort: true, width: 150, title: "图标"},
                                    {field: 'sourceName', edit: 'text', sort: true, width: 150, title: "来源名称"},
                                    {field: 'sourceCode', edit: 'text', sort: true, width: 120, title: "来源标识"},
                                    {field: 'state', edit: 'text',templet:'#stateTpl', sort: true, width: 120, title: "状态"},
                                    {field: 'weight', edit: 'text', sort: true, width: 80, title: "权重"},
                                    {field: 'goldCorn', edit: 'text', sort: true, width: 100, title: "金币数量"},
                                    {field: 'maxDayCount', edit: 'text', sort: true, width: 100, title: "每日最大次数"},
                                    {field: 'minTimeSpan', edit: 'text', sort: true, width: 100, title: "每次间隔时间(秒)"},
                                    {field: 'sourceDesc', edit: 'text', width: 200, title: "来源简介"},
                                    {field: 'remarks', edit: 'text', width: 200, title: "备注"},
                                    {field: 'createTime', sort: true, width: 150, title: "创建时间"},
                                    {field: 'updateTime', sort: true, width: 150, title: "修改时间"},
                                    {field: 'id', width: 120, sort: true, title: "ID"},
                                    {field: 'appCode', width: 120, title: "应用标识"},
                                    {field: 'appName', width: 120, title: "应用名称"},
                                    // {field: 'status', width: 80, title: "状态", templet: "#statusContainer"},
                                    {fixed: 'right', width: 150, title: "操作", toolbar: '#deleteContainer'},
                                    {field: 'platform', width: 80, title: "推送平台"},
                                    {
                                        field: "pushAppInfo.appId",
                                        edit: 'text',
                                        width: 200,
                                        title: "appId"
                                    },
                                    {
                                        field: 'pushAppInfo.appKey',
                                        edit: 'text',
                                        width: 120,
                                        title: "appKey"
                                    },
                                    {
                                        field: 'pushAppInfo.appSecret',
                                        edit: 'text',
                                        width: 200,
                                        title: "appSecret"
                                    },
                                    {field: 'pushAppInfo.packageName', edit: 'text', width: 120, title: "包名"},
                                    {field: 'createTime', sort: true, width: 140, title: "创建时间"},
                                    {field: 'updateTime', sort: true, width: 140, title: "修改时间"},
                                    {fixed: 'right', width: 80, title: "操作", toolbar: '#deleteContainer'},
                                ]
                            ],
@@ -275,18 +288,25 @@
                            parseData: function (res) { //res 即为原始返回的数据
                                if (res.code != 0)
                                    return;
                                if( res.data.data==null)
                                if (res.data.list == null)
                                    return;
                                for (var i = 0; i < res.data.data.length; i++) {
                                    res.data.data[i].appName = res.data.data[i].app.appName;
                                    res.data.data[i].appCode = res.data.data[i].app.appCode;
                                for (var i = 0; i < res.data.list.length; i++) {
                                    //将对象转换为属性
                                    var pushAppInfo = res.data.list[i].pushAppInfo;
                                    delete   res.data.list[i].pushAppInfo;
                                    for (key in pushAppInfo) {
                                        res.data.list[i]["pushAppInfo." + key] = pushAppInfo[key];
                                    }
                                }
                                console.log(res.data.list)
                                return {
                                    "code": res.code, //解析接口状态
                                    "msg": res.msg, //解析提示文本
                                    "count": res.data.count, //解析数据长度
                                    "data": res.data.data //解析数据列表
                                    "data": res.data.list //解析数据列表
                                };
                            }
                            //,…… //其他参数
@@ -299,7 +319,12 @@
                                    field = obj.field; //得到字段
                                //修改接口
                                var params = {id: data.id};
                                params[field] = value;
                                if (field.indexOf(".") > -1) {
                                    var keys = field.split(".");
                                    params[keys[0]] = {};
                                    params[keys[0]][keys[1]] = value;
                                } else
                                    params[field] = value;
                                app.update(data.id, params);
                            });
@@ -337,22 +362,7 @@
</script>
<script>
<script type="text/html" id="iconTpl">
    {{#  if(d.icon ){ }}
    <img src="{{d.icon}}" style="height:100%;" />
    {{#  } else { }}
    {{#  } }}
</script>
<script type="text/html" id="stateTpl">
    {{#  if(d.state==1 ){ }}
    <span>外显</span>
    {{#  } else if(d.state==2) { }}
    <span>不外显</span>
    {{#  } else { }}
    <span>禁用</span>
    {{#  } }}
</script>
</html>