diff --git a/src/api/tools/localStorage.js b/src/api/tools/localStorage.js index 2e68c14..c938de3 100644 --- a/src/api/tools/localStorage.js +++ b/src/api/tools/localStorage.js @@ -31,11 +31,4 @@ export function edit(data) { }) } -export function downloadStorage(params) { - return request({ - url: 'api/localStorage/download', - method: 'get', - params, - responseType: 'blob' - }) -} +export default { add, edit, del, delAll } diff --git a/src/api/tools/picture.js b/src/api/tools/picture.js index df9d720..a689c77 100644 --- a/src/api/tools/picture.js +++ b/src/api/tools/picture.js @@ -15,11 +15,4 @@ export function delAll(ids) { }) } -export function downloadPicture(params) { - return request({ - url: 'api/pictures/download', - method: 'get', - params, - responseType: 'blob' - }) -} +export default { del, delAll } diff --git a/src/api/tools/qiniu.js b/src/api/tools/qiniu.js index ce75cba..7b94205 100644 --- a/src/api/tools/qiniu.js +++ b/src/api/tools/qiniu.js @@ -44,11 +44,4 @@ export function delAll(ids) { }) } -export function downloadQiNiu(params) { - return request({ - url: 'api/qiNiuContent/download/list', - method: 'get', - params, - responseType: 'blob' - }) -} +export default { del, download, sync, delAll } diff --git a/src/mixins/crud.js b/src/mixins/crud.js index c429c8d..244fc29 100644 --- a/src/mixins/crud.js +++ b/src/mixins/crud.js @@ -31,6 +31,7 @@ export default { loading: true, // 删除 Loading 属性 delLoading: false, + delAllLoading: false, // 弹窗属性 dialog: false, // Form 表单 @@ -170,6 +171,41 @@ export default { }, afterDelMethod() { }, + /** + * 多选删除提示 + */ + beforeDelAllMethod() { + this.$confirm('你确定删除选中的数据吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.delAllMethod() + }) + }, + /** + * 多选删除 + */ + delAllMethod() { + this.delAllLoading = true + const data = this.$refs.table.selection + const ids = [] + for (let i = 0; i < data.length; i++) { + ids.push(data[i].id) + } + this.crudMethod.delAll(ids).then(() => { + this.delAllLoading = false + this.dleChangePage(ids.length) + this.init() + this.$notify({ + title: '删除成功', + type: 'success', + duration: 2500 + }) + }).catch(() => { + this.delAllLoading = false + }) + }, /** * 显示新增弹窗前可以调用该方法 */ diff --git a/src/views/tools/picture/index.vue b/src/views/tools/picture/index.vue index dc73679..cd90086 100644 --- a/src/views/tools/picture/index.vue +++ b/src/views/tools/picture/index.vue @@ -5,7 +5,7 @@ 搜索 -
- 上传图片 -
-
- 删除 -
+ 上传图片 + 删除
导出
@@ -77,8 +74,14 @@ - - - diff --git a/src/views/tools/storage/local/index.vue b/src/views/tools/storage/local/index.vue index 1479435..bb6c7fa 100644 --- a/src/views/tools/storage/local/index.vue +++ b/src/views/tools/storage/local/index.vue @@ -3,9 +3,9 @@
- + 搜索 -
- 文件上传 - -
+ 文件上传 + -
- 删除 - -
+ 删除 + -
- 导出 -
+ 导出
- + + + + + + + + +
添加文件
+
可上传任意格式文件,且不超过100M
+
+
+
+ +
@@ -106,7 +126,7 @@