mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-09-07 13:42:13 +08:00
feat: add vue3 codegen(preview)
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { useAxios } from '@/hooks/web/useAxios'
|
||||
import { ${simpleClassName}VO,${simpleClassName}PageReqVO,${simpleClassName}ExcelReqVO } from './types'
|
||||
|
||||
const request = useAxios()
|
||||
|
||||
#set ($baseURL = "/${table.moduleName}/${simpleClassName_strikeCase}")
|
||||
// 查询${table.classComment}列表
|
||||
export const getPostPageApi = async (params: ${simpleClassName}PageReqVO) => {
|
||||
return await request.get({ url: '${baseURL}/page', params })
|
||||
}
|
||||
|
||||
// 查询${table.classComment}详情
|
||||
export const getPostApi = async (id: number) => {
|
||||
return await request.get({ url: '${baseURL}/get?id=' + id })
|
||||
}
|
||||
|
||||
// 新增${table.classComment}
|
||||
export const createPostApi = async (data: ${simpleClassName}VO) => {
|
||||
return await request.post({ url: '${baseURL}/create', data })
|
||||
}
|
||||
|
||||
// 修改${table.classComment}
|
||||
export const updatePostApi = async (data: ${simpleClassName}VO) => {
|
||||
return await request.put({ url: '${baseURL}/update', data })
|
||||
}
|
||||
|
||||
// 删除${table.classComment}
|
||||
export const deletePostApi = async (id: number) => {
|
||||
return await request.delete({ url: '${baseURL}/delete?id=' + id })
|
||||
}
|
||||
|
||||
// 导出${table.classComment} Excel
|
||||
export const exportPostApi = async (params: ${simpleClassName}ExcelReqVO) => {
|
||||
return await request.get({ url: '${baseURL}/export-excel', params, responseType: 'blob' })
|
||||
}
|
Reference in New Issue
Block a user