-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #213 from little3201/develop
添加页面
- Loading branch information
Showing
70 changed files
with
1,501 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
/node_modules | ||
.eslintrc.cjs | ||
/src-ssr | ||
/quasar.config.*.temporary.compiled* | ||
/quasar.config.* | ||
.temporary.compiled* |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import { api } from 'boot/axios' | ||
import { SERVER_URL } from 'src/constants' | ||
import type { Pagination, Schema, Field } from 'src/models' | ||
|
||
/** | ||
* Retrieve rows | ||
* @param pagination Pagination and sort parameters | ||
* @param filters Optional filter or sort parameters | ||
* @param filters Optional filter or sort parameters | ||
* @returns Rows data | ||
*/ | ||
export const retrieveSchemas = (pagination: Pagination, filters?: object) => { | ||
return api.get(SERVER_URL.SCHEMA, { params: { ...pagination, page: pagination.page - 1, ...filters } }) | ||
} | ||
|
||
export const retrieveSchemaFields = (id: number) => { | ||
return api.get(`${SERVER_URL.SCHEMA}/${id}/fields`) | ||
} | ||
|
||
export const retrieveSchemaPreview = (id: number) => { | ||
return api.get(`${SERVER_URL.SCHEMA}/${id}/preview`) | ||
} | ||
|
||
/** | ||
* Fetch a specific row | ||
* @param id Row ID | ||
* @returns Row data | ||
*/ | ||
export const fetchSchema = (id: number) => { | ||
return api.get(`${SERVER_URL.SCHEMA}/${id}`) | ||
} | ||
|
||
/** | ||
* Create a new row | ||
* @param row Row data | ||
* @returns Created row | ||
*/ | ||
export const createSchema = (row: Schema) => { | ||
return api.post(SERVER_URL.SCHEMA, row) | ||
} | ||
|
||
/** | ||
* Check if a specific row exists by name | ||
* @param name Row name | ||
* @param id Row ID | ||
* @returns Row data | ||
*/ | ||
export const checkSchemaExists = (name: string, id?: number) => { | ||
return api.get(`${SERVER_URL.SCHEMA}/exists`, { params: { name, id } }) | ||
} | ||
|
||
/** | ||
* Modify an existing row | ||
* @param id Row ID | ||
* @param row Updated row data | ||
* @returns Modified row | ||
*/ | ||
export const modifySchema = (id: number, row: Schema) => { | ||
return api.put(`${SERVER_URL.SCHEMA}/${id}`, row) | ||
} | ||
|
||
/** | ||
* Sync a existing row | ||
* @param id Row ID | ||
* @returns Created row | ||
*/ | ||
export const syncSchema = (id: number) => { | ||
return api.patch(`${SERVER_URL.SCHEMA}/${id}/sync`) | ||
} | ||
|
||
/** | ||
* Generate | ||
* @param id Row ID | ||
* @returns Created row | ||
*/ | ||
export const generateSchema = (id: number) => { | ||
return api.get(`${SERVER_URL.SCHEMA}/${id}/download`, { responseType: 'blob' }) | ||
} | ||
|
||
/** | ||
* Remove a row | ||
* @param id Row ID | ||
* @returns Deletion status | ||
*/ | ||
export const removeSchema = (id: number) => { | ||
return api.delete(`${SERVER_URL.SCHEMA}/${id}`) | ||
} | ||
|
||
/** | ||
* Config rows | ||
* @param id Row ID | ||
* @param row rows data | ||
* @returns | ||
*/ | ||
export const configSchemaFields = (id: number, rows: Array<Field>) => { | ||
return api.patch(`${SERVER_URL.SCHEMA}/${id}/fields`, rows) | ||
} | ||
|
||
/** | ||
* Export rows | ||
* @param ids Rows ID | ||
* @returns | ||
*/ | ||
export const exprotSchemas = (ids?: number[]) => { | ||
const params = ids ? { ids: ids.join(',') } : {} | ||
return api.get(`${SERVER_URL.SCHEMA}/export`, { params, responseType: 'blob' }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import { api } from 'boot/axios' | ||
import { SERVER_URL } from 'src/constants' | ||
import type { Pagination, Template } from 'src/models' | ||
|
||
/** | ||
* Retrieve rows | ||
* @param pagination Pagination and sort parameters | ||
* @param filters Optional filter or sort parameters | ||
* @returns Rows data | ||
*/ | ||
export const retrieveTemplates = (pagination: Pagination, filters?: object) => { | ||
return api.get(SERVER_URL.TEMPLATE, { params: { ...pagination, page: pagination.page - 1, ...filters } }) | ||
} | ||
|
||
/** | ||
* Fetch a specific row | ||
* @param id Row ID | ||
* @returns Row data | ||
*/ | ||
export const fetchTemplate = (id: number) => { | ||
return api.get(`${SERVER_URL.TEMPLATE}/${id}`) | ||
} | ||
|
||
/** | ||
* Check if a specific row exists by name | ||
* @param name Row name | ||
* @param id Row ID | ||
* @returns Row data | ||
*/ | ||
export const checkTemplateExists = (name: string, suffix: string, version: string, id?: number) => { | ||
return api.get(`${SERVER_URL.TEMPLATE}/exists`, { params: { name, suffix, version, id } }) | ||
} | ||
|
||
/** | ||
* Create a new row | ||
* @param row Row data | ||
* @returns Created row | ||
*/ | ||
export const createTemplate = (row: Template) => { | ||
return api.post(SERVER_URL.TEMPLATE, row) | ||
} | ||
|
||
/** | ||
* Modify an existing row | ||
* @param id Row ID | ||
* @param row Updated row data | ||
* @returns Modified row | ||
*/ | ||
export const modifyTemplate = (id: number, row: Template) => { | ||
return api.put(`${SERVER_URL.TEMPLATE}/${id}`, row) | ||
} | ||
|
||
/** | ||
* Enable or Disable an existing row | ||
* @param id Row ID | ||
* @returns Enable or Disable result | ||
*/ | ||
export const enableTemplate = (id: number) => { | ||
return api.patch(`${SERVER_URL.TEMPLATE}/${id}`) | ||
} | ||
|
||
/** | ||
* Remove a row | ||
* @param id Row ID | ||
* @returns Deletion status | ||
*/ | ||
export const removeTemplate = (id: number) => { | ||
return api.delete(`${SERVER_URL.TEMPLATE}/${id}`) | ||
} | ||
|
||
/** | ||
* Export rows | ||
* @param ids Rows ID | ||
* @returns | ||
*/ | ||
export const exprotTemplates = (ids?: number[]) => { | ||
const params = ids ? { ids: ids.join(',') } : {} | ||
return api.get(`${SERVER_URL.TEMPLATE}/export`, { params, responseType: 'blob' }) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.