add
kimi
2020-01-22 c1805e1e6f41a370546e70a07d5f4496ad4b341d
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
<template>
    <div class="class_overview">
        <div style="float: left; width: 100%; height: 50px;">
            <span>请选择项目:</span>
            <el-select @change="selectChange_" v-model="value" placeholder="请选择" size="small">
                <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
                </el-option>
            </el-select>
            
            
        </div>
        <div style="float: left; margin-left: 1%; width: 69%; height: 80vh; ">
            <div class="z_shadow" style="float: left; margin: 10px; margin-top: 0px; width: 46%; height: 43%; border: 1px solid #e4eef9;"></div>
            <div class="z_shadow" style="float: left; margin: 10px; margin-top: 0px; width: 46%; height: 43%; border: 1px solid #e4eef9;"></div>
            <div class="z_shadow" style="float: left; margin: 10px; width: 46%; height: 43%; border: 1px solid #e4eef9;"></div>
            <div class="z_shadow" style="float: left; margin: 10px; padding: 10px; box-sizing: border-box; width: 46%; height: 43%; border: 1px solid #e4eef9;">
                <h3 style="margin: 0px;">文档库</h3>
                <div class="files_div">
                    <div style="width: 0px; height: 0px;">
                      <iframe ref="frame_export" style="width: 0px; height: 0px;"></iframe>
                    </div>
                    <div v-if="fileLevel > 0">
                        <el-button  type="text" size="mini" @click="upFile_click">上一级</el-button>
                    </div>
                    <div v-for="(file, k) in fileList" :key="k" @click="file_click(file)" class="file_div">
                        <i v-if="file.type==='isfiles'" class="el-icon-folder"></i>
                        <i v-else-if="file.type==='isfile'" class="el-icon-tickets"></i>
                        <span>{{file.name}}</span>
                    </div>
                    
                </div>
            </div>
        </div>
        <div class="z_shadow" style="float: right; margin-right: 1%; width: 28%; height: 70vh; border: 1px solid #e4eef9;"></div>
        
        
        
        
    </div>
</template>
 
<script>
    
    
    export default {
        
        data() {
            return {
                options: [
                    {
                        value: '选项1',
                        label: '项目1'
                    }, {
                        value: '选项2',
                        label: '项目2'
                    }, {
                        value: '选项3',
                        label: '项目3'
                    }, {
                        value: '选项4',
                        label: '项目4'
                    }, {
                        value: '选项5',
                        label: '项目5'
                    }
                ],
                value: '',
                dialog_1: false,
                fileLevel: 0,
                fileList: [],
            }
        },
        mounted() {
            this.initSelect();
            
            let fileList1 = [
                    {name: "文件名称1", type: "isfile", path: ""},
                    {name: "文件名称2", type: "isfile", path: ""},
                    {name: "文件夹名称", type: "isfiles", path: ""},
                ];
            this.fileList = fileList1;
        },
        
        methods: {
            initSelect() {
                var me = this;
                this.$axios.get("/api/scheme/all")
                    .then(data_ => {
                        console.log(data_);
                        if(data_.data.success){
                            me.options = [];
                            var datas = data_.data.data;
                            datas.forEach(function(one){
                                var item = {
                                    value:one.id,
                                    label:one.name
                                } 
                                me.options.push(item);
                            });
                        }
                    }).catch(error => {
                        console.log(error);
                    })
            },
            file_click(file) {
                if (file.type == 'isfiles') {
                    let fileList2 = [
                        {name: "子文件名称1", type: "isfile", path: ""},
                        {name: "子文件名称2", type: "isfile", path: ""},
                        {name: "子文件夹名称", type: "isfiles", path: ""},
                    ];
                    this.fileList = fileList2;
                    this.fileLevel ++;
                }
                else {
                    //下载
                    this.$refs.frame_export.src = "";
                }
            },
            upFile_click() {
                this.fileLevel --;
                
                let fileList2 = [
                    {name: "文件名称1", type: "isfile", path: ""},
                    {name: "文件名称2", type: "isfile", path: ""},
                    {name: "文件夹名称", type: "isfiles", path: ""},
                ];
                this.fileList = fileList2;
            },
            
            Cancel() {
                
            },
            selectChange_(val) {
                let url = "/api/scheme/getSchemeInfo/" + this.value;
                this.$axios.get(url,{
                  
                }).then(data_ => {
                  console.log(data_);
                    // 图
                    // 记录
                    // 人员
                    // 详情
                    //目录
                }).catch(error =>{
                    console.log(error);
                })
                
            }
            
        }
        
    }
</script>
 
<style>
    .class_overview {
        text-align: left;
        background-color: #dee0e2;
    }
    
    .files_div{
        height: 90%;
        overflow: auto;
    }
    .file_div {
        width: 30%;
        height: 20px;
        float: left;
    }
    .file_div :hover {
        cursor: pointer;
        font-weight: bold;
    }
</style>