diff --git a/src/api/gallery.js b/src/api/gallery.js
new file mode 100644
index 00000000..917cd168
--- /dev/null
+++ b/src/api/gallery.js
@@ -0,0 +1,23 @@
+import service from '@/utils/service'
+
+const baseUrl = '/api/admin/galleries'
+
+const galleryApi = {}
+
+galleryApi.query = params => {
+ return service({
+ url: baseUrl,
+ params: params,
+ method: 'get'
+ })
+}
+
+galleryApi.create = (gallery) => {
+ return service({
+ url: baseUrl,
+ data: gallery,
+ method: 'post'
+ })
+}
+
+export default galleryApi
diff --git a/src/views/attachment/AttachmentList.vue b/src/views/attachment/AttachmentList.vue
index 0d6d5bcd..2e041c0e 100644
--- a/src/views/attachment/AttachmentList.vue
+++ b/src/views/attachment/AttachmentList.vue
@@ -142,6 +142,7 @@
v-model="drawerVisiable"
v-if="selectAttachment"
:attachment="selectAttachment"
+ :addToGallery="true"
@delete="handleDelete"
/>
diff --git a/src/views/attachment/components/AttachmentDetailDrawer.vue b/src/views/attachment/components/AttachmentDetailDrawer.vue
index 4f7d5312..2b169bd7 100644
--- a/src/views/attachment/components/AttachmentDetailDrawer.vue
+++ b/src/views/attachment/components/AttachmentDetailDrawer.vue
@@ -120,6 +120,18 @@
+
+ 添加到图库
+
import { mixin, mixinDevice } from '@/utils/mixin.js'
import attachmentApi from '@/api/attachment'
+import galleryApi from '@/api/gallery'
export default {
name: 'AttachmentDetailDrawer',
@@ -142,7 +155,8 @@ export default {
data() {
return {
detailLoading: true,
- editable: false
+ editable: false,
+ gallery: {}
}
},
model: {
@@ -154,6 +168,11 @@ export default {
type: Object,
required: true
},
+ addToGallery: {
+ type: Boolean,
+ required: false,
+ default: false
+ },
visiable: {
type: Boolean,
required: false,
@@ -220,6 +239,18 @@ export default {
this.$message.error('复制失败')
})
},
+ handleAddToGallery() {
+ this.gallery['name'] = this.attachment.name
+ this.gallery['thumbnail'] = this.attachment.thumbPath
+ this.gallery['url'] = this.attachment.path
+ this.gallery['description'] = ''
+ this.gallery['takeTime'] = ''
+ this.gallery['location'] = ''
+ this.gallery['team'] = ''
+ galleryApi.create(this.gallery).then(response => {
+ this.$message.success('添加成功!')
+ })
+ },
onClose() {
this.$emit('close', false)
}
diff --git a/src/views/sheet/SheetList.vue b/src/views/sheet/SheetList.vue
index f86a8598..e62aaf4f 100644
--- a/src/views/sheet/SheetList.vue
+++ b/src/views/sheet/SheetList.vue
@@ -46,11 +46,6 @@
slot="action"
slot-scope="text, record"
>
- 查看
-
编辑
+
+ 查看
diff --git a/src/views/sheet/internal/GalleryList.vue b/src/views/sheet/internal/GalleryList.vue
index 13408aed..4bf55dbb 100644
--- a/src/views/sheet/internal/GalleryList.vue
+++ b/src/views/sheet/internal/GalleryList.vue
@@ -1,10 +1,262 @@
-
+
-