From 5d9e0a311ddad5b63fe3f38e0ffc020dd3044d25 Mon Sep 17 00:00:00 2001 From: Molunerfinn Date: Tue, 19 Jun 2018 13:45:07 +0800 Subject: [PATCH] Updated: gallery functions --- .../components/SettingView/Gallery.vue | 70 ++++++++++++++++++- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/src/renderer/components/SettingView/Gallery.vue b/src/renderer/components/SettingView/Gallery.vue index 65ab404..cb0a601 100644 --- a/src/renderer/components/SettingView/Gallery.vue +++ b/src/renderer/components/SettingView/Gallery.vue @@ -5,6 +5,18 @@ + + +
+ {{ item.name }} +
+
+ +
+ 批量删除 +
+
+
- + @@ -63,12 +76,31 @@ export default { imgInfo: { id: null, imgUrl: '' - } + }, + choosedList: {}, + choosedPicBed: [] } }, created () { this.getGallery() }, + watch: { + choosedPicBed (val) { + if (val.length > 0) { + this.images = [] + let arr = [] + val.forEach(item => { + arr = arr.concat(this.$db.read().get('uploaded').filter({type: item}).reverse().value()) + }) + this.images = arr + } else { + this.images = this.$db.read().get('uploaded').slice().reverse().value() + } + }, + choosedList (val) { + console.log(val) + } + }, methods: { getGallery () { this.images = this.$db.read().get('uploaded').slice().reverse().value() @@ -134,6 +166,14 @@ export default { } this.dialogVisible = false this.getGallery() + }, + choosePicBed (type) { + let idx = this.choosedPicBed.indexOf(type) + if (idx !== -1) { + this.choosedPicBed.splice(idx, 1) + } else { + this.choosedPicBed.push(type) + } } } } @@ -146,14 +186,30 @@ export default { margin 10px auto .sub-title font-size 14px +.item-base + background #2E2E2E + text-align center + margin-bottom 10px + padding 6px 0 + cursor pointer + font-size 13px + transition all .2s ease-in-out + &.delete + cursor not-allowed + &.delete.active + cursor pointer + background #49B1F5 + color #fff #gallery-view + .pull-right + float right .gallery-list height 360px box-sizing border-box padding 8px 0 overflow-y auto overflow-x hidden - .el-col + &__img height 150px position relative margin-bottom 16px @@ -193,4 +249,12 @@ export default { .blueimp-gallery .title top 30px + .handle-bar + color #ddd + .pic-bed-item + @extend .item-base + &:hover, + &.active + background #49B1F5 + color #fff \ No newline at end of file