龙山汽配专用调整MES-UI前端界面
yusijie
2023-04-26 c4cc34a02e0b382a92dba248b2b09541a376d348
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; 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, maximum-scale=1">
    <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
    <script src="../../layuiadmin/layui/layui.js"></script>
    <script src="../../layuiadmin/treeTable.js"></script>
    <script src="../../layuiadmin/Scripts/json2.js"></script>
    <script src="../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
    <script src="../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../layuiadmin/layui/lay/modules/util.js"></script>
    <style media="screen">
        .custom-tree-item-clicked {
            color: #FC9003
        }
    </style>
</head>
<body>
    <div class="layui-btn-container">
        <button type="button" class="layui-btn" lay-demotransferactive="getData">获取右侧数据</button>
        <button type="button" class="layui-btn" lay-demotransferactive="reload">重载实例</button>
    </div>
    <div id="test7" class="demo-transfer"></div>
    <script src="../../layuiadmin/layui/zgqlayui.js"></script>
    <script src="../../layuiadmin/zgqCustom/zgqCustom.js"></script>
    <script>
        var treeCkData = { id: 0 };
        var TagId = "";
        var TagParentId = "";
 
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index', //主入口模块
        }).use(['tree', 'index', 'form', 'table', 'element', 'laypage', 'laydate', 'transfer'], function () {
            var $ = layui.$
                , admin = layui.admin
                , layer = layui.layer
                , table = layui.table
                , form = layui.form
                , element = layui.element
                , laypage = layui.laypage
                , laydate = layui.laydate
                , util = layui.util
                , tree = layui.tree
                , transfer = layui.transfer
 
           
            //实例调用
            transfer.render({
                elem: '#test7',
                title: ['未分配列表', '已分配列表'],
                showSearch: true,
                height:"600",
                id: 'key123' //定义唯一索引
            })
            //加载数据
            $.ajax({
                url: GetWEBURL() + '/PublicPageMethod/PeopleTransFerList',
                type: "GET",
                success: function (data1) {
                    if (data1.count == 1) {
                        //console.log(data1.data);
                        transfer.render({
                            elem: '#test7',
                            title: ['未分配列表', '已分配列表'],
                            showSearch: true,
                            data: data1.data,
                            height: "600",
                            id: 'key123'
                        })
                    } else {
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(wait);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
            //批量办法定事件
            util.event('lay-demoTransferActive', {
                getData: function (othis) {
                    var getData = transfer.getData('key123'); //获取右侧数据
                    layer.alert(JSON.stringify(getData));
                }
                , reload: function () {
                    //实例重载
                    transfer.reload('key123', {
                        title: ['未分配列表', '已分配列表']
                        , value: ['2', '5', '9']
                        , showSearch: true
                    })
                }
            });
            //以上是layui模块
        });
 
 
    </script>
 
</body>
</html>