From 4dec32ae829620bb50f4e00014ab6bfa8ea24fa0 Mon Sep 17 00:00:00 2001 From: jmal Date: Sat, 7 Mar 2020 17:55:09 +0800 Subject: [PATCH] =?UTF-8?q?markdown=E7=BC=96=E8=BE=91=E5=99=A8=E9=87=8C?= =?UTF-8?q?=E9=99=90=E5=88=B65M=E5=A4=A7=E5=B0=8F=E7=9A=84=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home/index.vue | 10 +++++++--- src/views/markdown/index.vue | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/views/home/index.vue b/src/views/home/index.vue index ca7ea09..2c59d33 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -176,7 +176,7 @@ > - {{ scope.row.name }} + {{ scope.row.name }} @@ -903,7 +903,7 @@ export default { console.log('selectRowData', this.selectRowData) console.log('rowContextData', this.rowContextData) }, - // cell-style通过返回值可以实现样式变换利用传递过来的数组index循环改变样式 + // cell-style 通过返回值可以实现样式变换利用传递过来的数组index循环改变样式 rowRed({ row, column, rowIndex, columnIndex }) { if (this.indexList.length < 1 && columnIndex === 2 && this.cellMouseIndex === rowIndex) { return { cursor: 'pointer', color: "#19ACF9" } @@ -941,7 +941,6 @@ export default { // 单元格点击事件 cellClick(row, column) { clearTimeout(this.Loop); - console.log(column.index) if(this.editingIndex === -1) { const columnIndex = column.index if (columnIndex === 0) { @@ -1618,6 +1617,11 @@ export default { position: fixed; } + /deep/ .el-table__row /deep/.table-file-name:hover { + cursor: 'pointer'; + color: "#19ACF9" + } + .searchClass{ float: right; width: 30%; diff --git a/src/views/markdown/index.vue b/src/views/markdown/index.vue index bccb99e..633cffb 100644 --- a/src/views/markdown/index.vue +++ b/src/views/markdown/index.vue @@ -57,8 +57,17 @@ }, methods: { $imgAdd(pos, $file) { + console.log('$file.length',$file.size) + const maxSize = 1024 * 1024 * 5 + if($file.size > maxSize){ + this.$message({ + message: '请选择小于5M的图片! 大于5M的图片将无法上传', + type: 'warning', + duration: 3000, + }); + return + } // 第一步.将图片上传到服务器. - console.log('pos',pos,'$file',$file) let data = new FormData(); data.append('filename', this.filename) data.append('username', this.$store.state.user.name) @@ -72,16 +81,14 @@ * 2. 通过$refs获取: html声明ref : `,`$vm`为 `this.$refs.md` */ const url = process.env.VUE_APP_BASE_FILE_API + '/public/image/' + res.data - console.log(url) this.$refs.md.$img2Url(pos, url); }) }, - $imgDel() { - + $imgDel(pos, $file) { + console.log("del",pos,$file) }, // 所有操作都会被解析重新渲染 change(value, render){ - console.log('value',value) // render 为 markdown 解析后的结果[html] this.html = render; },