tianyunperfect 1 year ago
parent
commit
c807a561b2
1 changed files with 17 additions and 8 deletions
  1. 17 8
      simple-demo/send_memos.html

+ 17 - 8
simple-demo/send_memos.html

@@ -17,6 +17,14 @@
             border: 1px solid #b7b6b6;
         }
 
+        .img {
+            border: 1px solid #b7b6b6;
+            max-width: 200px;
+            max-height: 200px;
+            margin: 10px 10px 0 0 !important;
+            cursor: pointer
+        }
+
         .editClass button {
             display: inline;
             /*margin-top: 5px;*/
@@ -89,10 +97,11 @@
                 <!-- 添加发送按钮 -->
                 <el-button style="margin-left: 20px; width: 10%; font-size: 2rem" @click="sendData" :disabled="!sendBtnAble">记录</el-button>
             </div>
+            <!--style="height: 200px; margin: 10px 10px 0 0; cursor: pointer"-->
             <el-image v-for="item in tmpFileIds"
                       :src="'https://memos_assert.tianyunperfect.cn/' + item['internal_path'] + '?width=150'"
                       :preview-src-list="['https://memos_assert.tianyunperfect.cn/' + item['internal_path']]"
-                      style="height: 200px; margin: 10px 10px 0 0; cursor: pointer"></el-image>
+                      class="img"></el-image>
             <div v-if="tmpFileIds.length>0">
 
             </div>
@@ -130,7 +139,7 @@
                         <el-image v-for="img in resourceMap[item.id]"
                                   :src="'https://memos_assert.tianyunperfect.cn/' + img['internal_path'] + '?width=150'"
                                   :preview-src-list="['https://memos_assert.tianyunperfect.cn/' + img['internal_path']]"
-                                  style="max-height: 200px;max-width: 300px; margin: 10px 10px 0 0; cursor: pointer">
+                                  class="img">
 
                         </el-image>
                     </div>
@@ -173,7 +182,7 @@
                 <div v-for="img in cloneFileIds">
                     <el-image :src="'https://memos_assert.tianyunperfect.cn/' + img['internal_path'] + '?width=150'"
                               :preview-src-list="['https://memos_assert.tianyunperfect.cn/' + img['internal_path']]"
-                              style="max-height: 200px;max-width: 300px; margin: 10px 10px 0 0; cursor: pointer">
+                              class="img">
                     </el-image>
                     <div @click="delPic(img)">删除</div>
                 </div>
@@ -219,7 +228,7 @@
             commonTags: ['todo', '日记', '梦记', '美食', '备份', '歌曲', '电影', '随笔', '社会', '人生'],
             upload_url: 'https://memos.tianyunperfect.cn/api/v1/resource/blob',
             tmpFileIds: [],
-            cloneFileIds:[]
+            cloneFileIds: []
         },
         watch: {
             tagChecked: function () {
@@ -243,8 +252,8 @@
             this.search();
         },
         methods: {
-            delPic(img){
-              // 根据id从  cloneFileIds 删除
+            delPic(img) {
+                // 根据id从  cloneFileIds 删除
                 let index = this.cloneFileIds.findIndex(item => item.id === img.id);
                 if (index !== -1) {
                     this.cloneFileIds.splice(index, 1);
@@ -319,7 +328,7 @@
                     });
                 }
             },
-            handlePaste2(e){
+            handlePaste2(e) {
                 let file = this.getFileFromPaste(e);
                 // 对复制黏贴的类型进行判断,若是非文件类型,比如复制黏贴的文字,则不会调用上传文件的函数
                 if (file) {
@@ -436,7 +445,7 @@
             },
             edit(item) {
                 this.tmpItem = item;
-                this.cloneFileIds=this.getCloneResourceIds(item.id)
+                this.cloneFileIds = this.getCloneResourceIds(item.id)
                 this.dialogVisible = true;
                 // 获取焦点
                 this.$nextTick(() => {