|
|
@@ -38,7 +38,7 @@
|
|
|
</span>
|
|
|
</el-row>
|
|
|
<el-row style="padding: 1px">
|
|
|
- <el-button style="float: right; padding: 5px;" icon="el-icon-share" type="text" @click="onShareAlbum">分享</el-button>
|
|
|
+ <el-button style="float: right; padding: 5px;" icon="el-icon-share" type="text" @click="onShareAlbum(album.albumId)">分享</el-button>
|
|
|
<router-link style="text-decoration-line: none" target="_blank" :to="`/disk/album/${album.albumId}`">
|
|
|
<el-button style="float: right; padding: 5px" icon="el-icon-view" type="text" @click="true">查看</el-button>
|
|
|
</router-link>
|
|
|
@@ -91,11 +91,44 @@
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ :visible.sync="showCreateShareDialog"
|
|
|
+ width="100%"
|
|
|
+ center
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <el-form ref="createAlbumForm" :model="createShareForm">
|
|
|
+ <el-form-item label="过期时间" label-width="120px" prop="title">
|
|
|
+ <el-input
|
|
|
+ v-model="createShareForm.expireAt"
|
|
|
+ style="margin-left: 5px"
|
|
|
+ clearable
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="选择用户" label-width="120px" prop="title">
|
|
|
+ <el-checkbox-group v-model="createShareForm.shareToList">
|
|
|
+ <el-checkbox v-for="user in userContactList" :key="user.userIdStr" :label="user.username" />
|
|
|
+ </el-checkbox-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-plus"
|
|
|
+ style="margin-left: 10px"
|
|
|
+ @click="createShare"
|
|
|
+ >
|
|
|
+ 分享相册
|
|
|
+ </el-button>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { createAlbum, getAlbumList } from '@/api/disk'
|
|
|
+import { createAlbum, createShare, getAlbumList } from '@/api/disk'
|
|
|
+import { getUserContact } from '@/api/user'
|
|
|
|
|
|
export default {
|
|
|
name: 'DiskAlbumIndex',
|
|
|
@@ -112,6 +145,13 @@ export default {
|
|
|
createAlbumForm: {
|
|
|
albumName: null,
|
|
|
fileType: 1001
|
|
|
+ },
|
|
|
+ userContactList: [],
|
|
|
+ // ****************************************************************************************************************
|
|
|
+ showCreateShareDialog: false,
|
|
|
+ createShareForm: {
|
|
|
+ albumId: null,
|
|
|
+ shareToList: []
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -152,8 +192,28 @@ export default {
|
|
|
this.$message.info(resp.msg)
|
|
|
})
|
|
|
},
|
|
|
- onShareAlbum() {
|
|
|
- this.$message.info('share album')
|
|
|
+ onShareAlbum(albumId) {
|
|
|
+ this.createShareForm.albumId = albumId
|
|
|
+ getUserContact(1).then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.userContactList = resp.data
|
|
|
+ this.showCreateShareDialog = true
|
|
|
+ } else {
|
|
|
+ this.$message.error(resp.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ createShare() {
|
|
|
+ createShare(this.createShareForm).then(resp => {
|
|
|
+ this.$message.info(resp.msg)
|
|
|
+ }).finally(() => {
|
|
|
+ this.showCreateShareDialog = false
|
|
|
+ this.createShareForm = {
|
|
|
+ albumId: null,
|
|
|
+ expireAt: null,
|
|
|
+ shareToList: []
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|