From 11317bf89e4d4194f84229c3d89a786b323c6be4 Mon Sep 17 00:00:00 2001 From: kimi <kimi42345@gmail.com> Date: 星期四, 23 一月 2020 15:16:16 +0800 Subject: [PATCH] merge --- src/components/square.vue | 31 +++++++++++++++++++++++++------ 1 files changed, 25 insertions(+), 6 deletions(-) diff --git a/src/components/square.vue b/src/components/square.vue index 6c3b130..f7c0a4c 100644 --- a/src/components/square.vue +++ b/src/components/square.vue @@ -51,7 +51,7 @@ </div> <span slot="footer" class="dialog-footer"> - <el-button v-if="selectOne.attachment && selectOne.attachment != ''" type="primary" @click="download">涓� 杞�</el-button> + <el-button v-if="selectOne.attachment && selectOne.attachment != ''" type="primary" @click="download(selectOne)">涓� 杞�</el-button> </span> </el-dialog> @@ -73,7 +73,8 @@ ref="upload" :on-change="onChange" :on-exceed="handleExceed" - :file-list="fileList"> + :on-success="uploadSuccess" + > <el-button size="small" type="primary">鐐瑰嚮涓婁紶</el-button> <div slot="tip" class="el-upload__tip">涓嶈秴杩�50M</div> </el-upload> @@ -83,7 +84,9 @@ <el-button type="primary" @click="createTopic">纭� 瀹�</el-button> </div> </el-dialog> - + <div style="width: 0px; height: 0px;"> + <iframe ref="frame_export" style="width: 0px; height: 0px;"></iframe> + </div> </div> </template> @@ -133,7 +136,19 @@ this.getData(); }, methods: { + download(val) { + if(val) { + this.$refs.frame_export.src = "/api/api/file/download/" + val.id; + }else { + this.$message({message:'鑾峰彇鍦板潃澶辫触', type: 'warning'}); + } + + }, + uploadSuccess() { + this.dialogFormVisible = false; + }, onChange(file, fileList) { + this.fileList = []; this.fileList = fileList; }, createTopic() { @@ -198,9 +213,12 @@ this.query_(); }, query_() { - this.getData(this.formInline); + this.getData(this.formInline, true); }, - getData(query) { + getData(query,empty) { + if(empty) { + this.dataList = []; + } let me = this; this.loading = true this.loading_table = true; @@ -218,7 +236,8 @@ console.log(data_); if(data_.data.success) { me.dataList.push.apply(me.dataList, data_.data.data.records) - me.total = data_.data.data.total; + me.t + otal = data_.data.data.total; me.pageno = data_.data.data.pageno; me.maxPage = data_.data.data.maxPage; -- Gitblit v1.8.0