mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-30 16:03:50 +00:00
chore: 初始化uniapp前端项目基础框架
新增项目配置、静态资源、工具类、状态管理、API接口、组件库集成等全套基础代码,完成项目初始化搭建
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
import type { BatchSetStatus } from './user'
|
||||
import { http } from '@/http'
|
||||
|
||||
const SYSTEM_BASE = '/system'
|
||||
|
||||
/**
|
||||
* 岗位管理 API
|
||||
* 与 web 端 module_system/position.ts 对齐(完整字段定义)
|
||||
*/
|
||||
export const PositionAPI = {
|
||||
getPage(params?: Record<string, any>): Promise<PageResult<PositionItem>> {
|
||||
return http.Get(`${SYSTEM_BASE}/position/list`, params)
|
||||
},
|
||||
getDetail(id: number): Promise<PositionItem> {
|
||||
return http.Get(`${SYSTEM_BASE}/position/detail/${id}`)
|
||||
},
|
||||
create(data: PositionForm): Promise<PositionItem> {
|
||||
return http.Post(`${SYSTEM_BASE}/position/create`, data)
|
||||
},
|
||||
update(id: number, data: PositionForm): Promise<PositionItem> {
|
||||
return http.Put(`${SYSTEM_BASE}/position/update/${id}`, data)
|
||||
},
|
||||
remove(ids: number[]): Promise<void> {
|
||||
return http.Delete(`${SYSTEM_BASE}/position/delete`, { ids: JSON.stringify(ids) })
|
||||
},
|
||||
batchStatus(data: BatchSetStatus): Promise<void> {
|
||||
return http.Patch(`${SYSTEM_BASE}/position/status/batch`, data)
|
||||
},
|
||||
getOptions(): Promise<{ value: number, label: string }[]> {
|
||||
return http.Get(`${SYSTEM_BASE}/position/options`)
|
||||
},
|
||||
exportPositions(params?: Record<string, any>): Promise<unknown> {
|
||||
return http.Post(`${SYSTEM_BASE}/position/export`, params)
|
||||
},
|
||||
}
|
||||
|
||||
export interface PositionForm extends BaseFormType {
|
||||
name?: string
|
||||
code?: string
|
||||
order?: number
|
||||
status?: number
|
||||
description?: string
|
||||
}
|
||||
|
||||
export interface PositionItem extends BaseType, PositionForm {
|
||||
id: number
|
||||
}
|
||||
Reference in New Issue
Block a user