Skip to content

Commit 562d25e

Browse files
authored
Merge branch 'youlaitech:master' into master
2 parents be6ffbc + de086a7 commit 562d25e

File tree

4 files changed

+425
-6
lines changed

4 files changed

+425
-6
lines changed

src/api/config.ts

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
import request from "@/utils/request";
2+
3+
const CONFIG_BASE_URL = "/api/v1/config";
4+
5+
class ConfigAPI {
6+
/** 获取系统配置分页数据 */
7+
static getPage(queryParams?: ConfigPageQuery) {
8+
return request<any, PageResult<ConfigPageVO[]>>({
9+
url: `${CONFIG_BASE_URL}/page`,
10+
method: "get",
11+
params: queryParams,
12+
});
13+
}
14+
/**
15+
* 获取系统配置表单数据
16+
*
17+
* @param id ConfigID
18+
* @returns Config表单数据
19+
*/
20+
static getFormData(id: number) {
21+
return request<any, ConfigForm>({
22+
url: `${CONFIG_BASE_URL}/${id}/form`,
23+
method: "get",
24+
});
25+
}
26+
27+
/** 添加系统配置*/
28+
static add(data: ConfigForm) {
29+
return request({
30+
url: `${CONFIG_BASE_URL}`,
31+
method: "post",
32+
data: data,
33+
});
34+
}
35+
36+
/**
37+
* 更新系统配置
38+
*
39+
* @param id ConfigID
40+
* @param data Config表单数据
41+
*/
42+
static update(id: number, data: ConfigForm) {
43+
return request({
44+
url: `${CONFIG_BASE_URL}/${id}`,
45+
method: "put",
46+
data: data,
47+
});
48+
}
49+
50+
/**
51+
* 删除系统配置
52+
*
53+
* @param ids 系统配置ID
54+
*/
55+
static deleteById(id: number) {
56+
return request({
57+
url: `${CONFIG_BASE_URL}/${id}`,
58+
method: "delete",
59+
});
60+
}
61+
62+
static refreshCache() {
63+
return request({
64+
url: `${CONFIG_BASE_URL}`,
65+
method: "patch",
66+
});
67+
}
68+
}
69+
70+
export default ConfigAPI;
71+
72+
/** $系统配置分页查询参数 */
73+
export interface ConfigPageQuery extends PageQuery {
74+
/** 搜索关键字 */
75+
keywords?: string;
76+
}
77+
78+
/** 系统配置表单对象 */
79+
export interface ConfigForm {
80+
/** 主键 */
81+
id?: number;
82+
/** 配置名称 */
83+
configName?: string;
84+
/** 配置key */
85+
configKey?: string;
86+
/** 配置值 */
87+
configValue?: string;
88+
/** 描述、备注 */
89+
remark?: string;
90+
}
91+
92+
/** 系统配置分页对象 */
93+
export interface ConfigPageVO {
94+
/** 主键 */
95+
id?: number;
96+
/** 配置名称 */
97+
configName?: string;
98+
/** 配置key */
99+
configKey?: string;
100+
/** 配置值 */
101+
configValue?: string;
102+
/** 描述、备注 */
103+
remark?: string;
104+
}

src/styles/index.scss

+4
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@
2626
color: rgb(32 160 255);
2727
}
2828
}
29+
30+
.search-container .el-form .el-input {
31+
width: 16rem !important;
32+
}

0 commit comments

Comments
 (0)