From 553c364ad7c793ac20583407d9f45a9cb96d3da2 Mon Sep 17 00:00:00 2001 From: zhangyanpeng <bob.zhang@highdatas.com> Date: 星期三, 22 一月 2020 18:50:56 +0800 Subject: [PATCH] 调整上传 --- src/views/Overview.vue | 127 ++++++++++++++++++++++++++++++++++++----- 1 files changed, 110 insertions(+), 17 deletions(-) diff --git a/src/views/Overview.vue b/src/views/Overview.vue index a7a4ac1..5ac6c75 100644 --- a/src/views/Overview.vue +++ b/src/views/Overview.vue @@ -2,7 +2,7 @@ <div class="class_overview"> <div style="float: left; width: 100%; height: 50px;"> <span>璇烽�夋嫨椤圭洰锛�</span> - <el-select v-model="value" placeholder="璇烽�夋嫨" size="small"> + <el-select @change="selectChange_" filterable v-model="value" placeholder="璇烽�夋嫨" size="small"> <el-option v-for="item in options" :key="item.value" @@ -11,32 +11,43 @@ </el-option> </el-select> - <el-button type="primary" style="float: right;" @click="addProject">鏂板缓椤圭洰</el-button> </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; 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> - <el-dialog @close="Cancel" width="70%" top="50px" :visible.sync="dialog_1" append-to-body> - <newProject @closeNewProject="closeNewProject"></newProject> - </el-dialog> + </div> </template> <script> - import newProject from '../components/popup/newProject.vue' + export default { - components: { - newProject - }, + data() { return { options: [ @@ -59,20 +70,88 @@ ], 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: { - addProject() { - this.dialog_1 = true; - + 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() { }, - closeNewProject() { - this.dialog_1 = false - }, + selectChange_(val) { + let url = "/api/scheme/getSchemeInfo/" + this.value; + this.$axios.get(url,{ + + }).then(data_ => { + console.log(data_); + // 鍥� + // 璁板綍 + // 浜哄憳 + // 璇︽儏 + //鐩綍 + }).catch(error =>{ + console.log(error); + }) + + } + } } @@ -83,4 +162,18 @@ 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> -- Gitblit v1.8.0