<!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>
        .input {
            border-radius: 2px;
            height: 38px;
            border-width: 1px;
            border-color: lightgray;
            border-style: solid;
            background-color: white;
            padding-left: 3px;
        }
    </style>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-card">
            <div class="layui-card-body" pad15>
                <table class="layui-hide" id="customer_datagrid_imgs" lay-filter="customer-imgs-operate"></table>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="customer-imgs-operate-bar">
    <div class="layui-btn-group">
        <a class="layui-btn layui-btn-xs" lay-event="order_search"
        >查看</a>
    </div>
</script>

<script src="../../layuiadmin/layui/layui.js"></script>
<script>
    layui.link('../../../layuiadmin/style/autocomplete.css');
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
        , autocomplete: 'autocomplete'
    }).extend({
        index: 'lib/index',
        formSelects: 'formSelects-v4'
    }).use(['index', 'table', 'form', 'autocomplete', 'formSelects', 'laytpl' ], function () {
        var $ = layui.$
            , table = layui.table
            , admin = layui.admin
            , formSelects = layui.formSelects
            , form = layui.form;

        table.render({
            elem: '#customer_datagrid_imgs'
            , url: '/api/imgs.json'
            , cols: [[
                {field: 'sort', title: '类型', width: 100}
                , {field: 'upload_time', title: "上传时间", width: 150}
                , {field: 'notes', title: '备注', width: 200}
                , {field: 'file_size', title: '文件大小', width: 120}
                , {field: 'uploader', title: '上传人', width: 120}
                , {width: 80, align: 'center', fixed: 'right', toolbar: '#customer-imgs-operate-bar'}
            ]]
            , page: true
        });

         //监听工具条
        table.on('tool(customer-imgs-operate)', function (obj) {
            var data = obj.data;
            if (obj.event === 'order_search') {
                // var newPage=window.open();
                // newPage.document.write("<img src="+imgsList[index]+" />")
            }
        });
    });
</script>
</body>
</html>
