feat(work): 添加系统配置功能- 在工作台页面增加系统配置入口

- 新增系统配置页面路径和样式
This commit is contained in:
Ky10
2024-11-14 18:32:28 +08:00
parent 34f230e2ed
commit e5525dfd62
2 changed files with 132 additions and 0 deletions

109
src/api/system/config.ts Normal file
View File

@@ -0,0 +1,109 @@
// import request from "@/utils/request";
import request from "@/utils/request";
const CONFIG_BASE_URL = "/api/v1/config";
const ConfigAPI = {
/** 获取系统配置分页数据 */
getPage(queryParams: ConfigPageQuery) {
return request<PageResult<ConfigPageVO[]>>({
url: `${CONFIG_BASE_URL}/page`,
method: "GET",
data: queryParams,
});
},
/**
* 获取系统配置表单数据
*
* @param id ConfigID
* @returns Config表单数据
*/
getFormData(id: number) {
return request<ConfigForm>({
url: `${CONFIG_BASE_URL}/${id}/form`,
method: "GET",
});
},
/** 添加系统配置*/
add(data: ConfigForm) {
return request({
url: `${CONFIG_BASE_URL}`,
method: "POST",
data: data,
});
},
/**
* 更新系统配置
*
* @param id ConfigID
* @param data Config表单数据
*/
update(id: number, data: ConfigForm) {
return request({
url: `${CONFIG_BASE_URL}/${id}`,
method: "PUT",
data: data,
});
},
/**
* 删除系统配置
*
* @param ids 系统配置ID
*/
deleteById(id: number) {
return request({
url: `${CONFIG_BASE_URL}/${id}`,
method: "DELETE",
});
},
refreshCache() {
return request({
url: `${CONFIG_BASE_URL}`,
method: "POST",
header: {
"Content-Type": "application/json",
"X-HTTP-Method-Override": "PATCH",
},
});
},
};
export default ConfigAPI;
/** $系统配置分页查询参数 */
export interface ConfigPageQuery extends PageQuery {
/** 搜索关键字 */
keywords?: string;
}
/** 系统配置表单对象 */
export interface ConfigForm {
/** 主键 */
id?: number;
/** 配置名称 */
configName?: string;
/** 配置键 */
configKey?: string;
/** 配置值 */
configValue?: string;
/** 描述、备注 */
remark?: string;
}
/** 系统配置分页对象 */
export interface ConfigPageVO {
/** 主键 */
id?: number;
/** 配置名称 */
configName?: string;
/** 配置键 */
configKey?: string;
/** 配置值 */
configValue?: string;
/** 描述、备注 */
remark?: string;
}

View File

@@ -0,0 +1,23 @@
<template>
<view class="work" />
</template>
<script lang="ts">
export default {
data() {
return {};
},
};
</script>
<style lang="scss" scoped>
/* stylelint-disable selector-type-no-unknown */
page {
background: #f8f8f8;
}
/* stylelint-enable selector-type-no-unknown */
.work {
padding: 40rpx 0;
}
</style>