<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sptg="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
    </head>
    <body>
        <div class="layui-fluid">
            <div class="layui-card">
                <!-- 查询条件 -->
                <div class="layui-form layui-card-header layuiadmin-card-header-auto" style="padding:0;">
                    <!-- 表格+头部按钮 -->
                    <div class="layui-card-body" style="padding:0;">
                        <div style="padding-bottom: 10px;">
                            <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="add"  sptg:security="device:app:package:add">上传新包</button>
                        </div>
                        <table id="data_entity_table" lay-filter="data_table_event"></table>
                    </div>
                </div>
            </div>
        </div>
        <input type="hidden" id="deviceType" value="1"/>
    </body>

    <!-- javascript -->
    <script type="text/javascript" th:src="@{'/layui/layui.js'}" charset="utf-8"></script>
    <script type="text/javascript">
        layui.config({
            base: '/' //静态资源所在路径
        });
    </script>
    <script type="text/javascript" th:src="@{'/js/device/device-admin-app-package-manage.js'}" charset="utf-8"></script>

    <!--操作-->
    <script type="text/html" id="table-operate">
        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"  sptg:security="device:app:package:edit">修改</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete" sptg:security="device:app:package:delete">删除</a>
    </script>
    <!-- 强制升级 -->
    <script type="text/html" id="is-force-update">
        {{#  if(d.isForceUpdate == 1){ }}
        <span>是</span>
        {{# } else if(d.isForceUpdate == 2){ }}
        <span>否</span>
        {{#  } }}
    </script>
    <!-- 强制升级 -->
    <script type="text/html" id="package_type">
        {{#  if(d.packageType == 1){ }}
        <span class="layui-badge layui-bg-green">Android</span>
        {{# } else if(d.packageType == 2){ }}
        <span class="layui-badge layui-bg-black">IOS</span>
        {{# }else {}}
        <span class="layui-badge layui-bg-blue">设备</span>
        {{#  } }}
    </script>
    <!-- 启用状态 -->
    <script type="text/html" id="switch_is_enable">
        <input type="checkbox" name="isEnable" lay-skin="switch" lay-filter="switch_is_enable"  kid="{{ d.id }}"
               lay-text="启用|禁用" {{ d.isEnable == 1 ? 'checked' : '' }} />
    </script>
</html>