mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-04 01:10:36 +00:00
chore: 初始化uniapp前端项目基础框架
新增项目配置、静态资源、工具类、状态管理、API接口、组件库集成等全套基础代码,完成项目初始化搭建
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
import { http } from '@/http'
|
||||
|
||||
const SYSTEM_BASE = '/system'
|
||||
|
||||
/**
|
||||
* 工单管理 API
|
||||
* 与 web 端 module_system/ticket.ts 对齐(完整字段定义)
|
||||
*/
|
||||
export const TicketAPI = {
|
||||
getPage(params?: Record<string, any>): Promise<PageResult<TicketItem>> {
|
||||
return http.Get(`${SYSTEM_BASE}/ticket/list`, params)
|
||||
},
|
||||
getDetail(id: number): Promise<TicketItem> {
|
||||
return http.Get(`${SYSTEM_BASE}/ticket/detail/${id}`)
|
||||
},
|
||||
create(data: TicketForm): Promise<TicketItem> {
|
||||
return http.Post(`${SYSTEM_BASE}/ticket/create`, data)
|
||||
},
|
||||
update(id: number, data: Record<string, any>): Promise<TicketItem> {
|
||||
return http.Put(`${SYSTEM_BASE}/ticket/update/${id}`, data)
|
||||
},
|
||||
remove(ids: number[]): Promise<void> {
|
||||
return http.Delete(`${SYSTEM_BASE}/ticket/delete`, { ids: JSON.stringify(ids) })
|
||||
},
|
||||
batch(data: { ids: number[], status: number, assigned_id?: number }): Promise<void> {
|
||||
return http.Put(`${SYSTEM_BASE}/ticket/batch`, data)
|
||||
},
|
||||
exportTickets(params?: Record<string, any>): Promise<unknown> {
|
||||
return http.Post(`${SYSTEM_BASE}/ticket/export`, params)
|
||||
},
|
||||
getComments(ticketId: number, params?: Record<string, any>): Promise<PageResult<TicketComment>> {
|
||||
return http.Get(`${SYSTEM_BASE}/ticket/${ticketId}/comments`, params)
|
||||
},
|
||||
createComment(ticketId: number, data: { content: string }): Promise<TicketComment> {
|
||||
return http.Post(`${SYSTEM_BASE}/ticket/${ticketId}/comments`, data)
|
||||
},
|
||||
}
|
||||
|
||||
export interface TicketForm extends BaseFormType {
|
||||
title: string
|
||||
ticket_content?: string
|
||||
summary?: string
|
||||
ticket_type: string
|
||||
images?: string
|
||||
reply?: string
|
||||
assigned_id?: number
|
||||
status?: number
|
||||
description?: string
|
||||
}
|
||||
|
||||
export interface TicketItem extends BaseType {
|
||||
title?: string
|
||||
ticket_content?: string
|
||||
summary?: string
|
||||
ticket_type?: string
|
||||
status?: string | number
|
||||
assigned_id?: number
|
||||
assigned_by?: CommonType
|
||||
images?: string
|
||||
reply?: string
|
||||
description?: string
|
||||
}
|
||||
|
||||
export interface TicketComment extends BaseType {
|
||||
ticket_id?: number
|
||||
user_id?: number
|
||||
username?: string
|
||||
content?: string
|
||||
created_by_name?: string
|
||||
}
|
||||
Reference in New Issue
Block a user