13937891274
2022-05-13 98afe8baf13424c60cf3573b8d4f6ee2cb253634
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<template xmlns="http://www.w3.org/1999/html">
    <div class="whole">
        <div class="left-tree">
            <el-tree
                :data="data"
                node-key="id"
                default-expand-all
                @node-drag-start="handleDragStart"
                @node-drag-enter="handleDragEnter"
                @node-drag-leave="handleDragLeave"
                @node-drag-over="handleDragOver"
                @node-drag-end="handleDragEnd"
                @node-drop="handleDrop"
                draggable
                :allow-drop="allowDrop"
                :allow-drag="allowDrag">
                 <span slot-scope="{ node, data }" class="slot-t-node">
              <template>
                <i
                    v-if="data.ChildItems&&data.ChildItems.length"
                    :class="{
                    'el-icon-folder': !node.expanded, // 节点收缩时的图标
                    'el-icon-folder-opened': node.expanded, // 节点展开时的图标
                  }"
                    style="color: #409eff;"
                />
                <i v-else class="el-icon-folder-add" style="color: #EC933A;" />
                <span>{{ node.label }}</span>
              </template>
            </span>
            </el-tree>
        </div>
        <div class="right-table">
            <table border="1" style="background: #FFFFFF;width: 100%;">
                <tr>
                    <td class="table_td" style="text-align: right;">模板名称:</td>
                    <td>
                        <input class="input" style="line-height: 24px;height: 24px;">
                    </td>
                </tr>
                <tr>
                    <td class="table_td" style="text-align: right;">模板导入:</td>
                    <td style="line-height: 24px;height: 24px;">
                        <input class="input" type="file" style="color: red;">
                        <button class="btn" style="margin-left: 120px;">导入</button>
                        <button class="btn">下载模板</button>
                    </td>
                </tr>
                <tr class="table_tr">
                    <td colspan="4" align="center">
                        <button class="btn">预览</button>
                    </td>
                </tr>
            </table>
        </div>
    </div>
</template>
 
<script>
export default {
    name: "index" ,
    data() {
        return {
            data: [{
                id: 1,
                label: '隐患排查清单',
                icon:'el-icon-folder',
                children: [{
                    id: 4,
                    label: '现场管理清单',
                    icon:'el-icon-folder',
                },
                {
                    id: 5,
                    label: '基础管理清单',
                    icon:'el-icon-success',
                }]
            }],
            defaultProps: {
                children: 'children',
                label: 'label'
            },
        };
    },
    mounted(){
        this.getAllColumns()
    },
    methods: {
        handleDragStart(node, ev) {
            console.log('drag start', node);
        },
        handleDragEnter(draggingNode, dropNode, ev) {
            console.log('tree drag enter: ', dropNode.label);
        },
        handleDragLeave(draggingNode, dropNode, ev) {
            console.log('tree drag leave: ', dropNode.label);
        },
        handleDragOver(draggingNode, dropNode, ev) {
            console.log('tree drag over: ', dropNode.label);
        },
        handleDragEnd(draggingNode, dropNode, dropType, ev) {
            console.log('tree drag end: ', dropNode && dropNode.label, dropType);
        },
        handleDrop(draggingNode, dropNode, dropType, ev) {
            console.log('tree drop: ', dropNode.label, dropType);
        },
        allowDrop(draggingNode, dropNode, type) {
            if (dropNode.data.label === '二级 3-1') {
                return type !== 'inner';
            } else {
                return true;
            }
        },
        allowDrag(draggingNode) {
            return draggingNode.data.label.indexOf('三级 3-2-2') === -1;
        },
        // 获取表格数据进行渲染
        getAllColumns() {
            var data = this.$route.query
        },
        handleChange(file, fileList) {
            this.fileList = fileList.slice(-3);
        }
    }
}
</script>
 
<style scoped>
.whole{
    display: flex;
}
.left-tree{
    width: 15%;
}
.left-tree .el-tree{
    background: #f0f6e4;
    height: 400px;
    overflow-y: scroll;
    border: 1px solid #000;
}
/deep/ .is-leaf{
    background: transparent !important;
    width: 5px;
    height: 5px;
    background-size: 100%;
    margin-right: 5px;
}
/deep/ .el-icon-caret-right:before{
    content: '';
}
.right-table{
    width: 85%;
}
table,table tr th, table tr td {
    border:1px solid #ccc;
}
.table_td{
    background: #e4edf4;
}
.table_tr{
    background: #e4edf4;
    line-height: 40px;
    height: 40px;
}
table{
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.input{
    background: #f9f9f9;
    border-width: 1px;
    margin: 5px 0;
}
.btn{
    background: url(../../assets/btn.gif) no-repeat;
    width: 76px;
    height: 26px;
    line-height: 26px;
    font-size: 14px;
    border: none;
    color: #fff;
    cursor: pointer;
    overflow: visible;
}
</style>