From 8142f07ce761698eff00dce5072fbaa9cc5a337a Mon Sep 17 00:00:00 2001 From: Charles7c Date: Wed, 10 Apr 2024 22:13:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/system/index.ts | 1 + src/apis/system/storage.ts | 29 ++++ src/apis/system/type.ts | 25 +++ src/views/system/storage/AddStorageModal.vue | 166 +++++++++++++++++++ src/views/system/storage/index.vue | 146 ++++++++++++++++ src/views/system/storage/type.ts | 14 ++ 6 files changed, 381 insertions(+) create mode 100644 src/apis/system/storage.ts create mode 100644 src/views/system/storage/AddStorageModal.vue create mode 100644 src/views/system/storage/index.vue create mode 100644 src/views/system/storage/type.ts diff --git a/src/apis/system/index.ts b/src/apis/system/index.ts index 5a39b44..236debc 100644 --- a/src/apis/system/index.ts +++ b/src/apis/system/index.ts @@ -1,2 +1,3 @@ export * from './dept' export * from './log' +export * from './storage' diff --git a/src/apis/system/storage.ts b/src/apis/system/storage.ts new file mode 100644 index 0000000..7b44840 --- /dev/null +++ b/src/apis/system/storage.ts @@ -0,0 +1,29 @@ +import http from '@/utils/http' +import type * as System from './type' + +const BASE_URL = '/system/storage' + +/** @desc 查询存储列表 */ +export function listStorage(query: System.StorageQuery) { + return http.get>(`${BASE_URL}`, query) +} + +/** @desc 查询存储详情 */ +export function getStorage(id: string) { + return http.get(`${BASE_URL}/${id}`) +} + +/** @desc 新增存储 */ +export function addStorage(data: any) { + return http.post(`${BASE_URL}`, data) +} + +/** @desc 修改存储 */ +export function updateStorage(data: any, id: string) { + return http.put(`${BASE_URL}/${id}`, data) +} + +/** @desc 删除存储 */ +export function deleteStorage(id: string) { + return http.del(`${BASE_URL}/${id}`) +} diff --git a/src/apis/system/type.ts b/src/apis/system/type.ts index 46ed7aa..f7cc7fa 100644 --- a/src/apis/system/type.ts +++ b/src/apis/system/type.ts @@ -52,3 +52,28 @@ export interface LogQuery extends PageQuery { createTime?: string status?: number } + +/** 系统存储类型 */ +export type StorageResp = { + id: string + name: string + code: string + type: number + accessKey: string + secretKey: string + endpoint: string + bucketName: string + domain: string + description: string + isDefault: boolean + sort: number + status: number + createUserString: string + createTime: string + updateUserString: string + updateTime: string +} +export interface StorageQuery extends PageQuery { + description?: string + status?: number +} \ No newline at end of file diff --git a/src/views/system/storage/AddStorageModal.vue b/src/views/system/storage/AddStorageModal.vue new file mode 100644 index 0000000..0ff961a --- /dev/null +++ b/src/views/system/storage/AddStorageModal.vue @@ -0,0 +1,166 @@ + + + diff --git a/src/views/system/storage/index.vue b/src/views/system/storage/index.vue new file mode 100644 index 0000000..29ea166 --- /dev/null +++ b/src/views/system/storage/index.vue @@ -0,0 +1,146 @@ + + + + + diff --git a/src/views/system/storage/type.ts b/src/views/system/storage/type.ts new file mode 100644 index 0000000..d329730 --- /dev/null +++ b/src/views/system/storage/type.ts @@ -0,0 +1,14 @@ +export interface StorageReq { + name: string + code: string + type: number + accessKey: string + secretKey: string + endpoint: string + bucketName: string + domain: string + sort: number + description: string + isDefault: boolean + status: 1 | 2 +}