mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-21 11:29:20 +08:00
types: modify table type name (#199)
This commit is contained in:
parent
6893c70df0
commit
7bda678d7c
@ -28,8 +28,8 @@ export function updateTableDataApi(data: Table.CreateOrUpdateTableRequestData) {
|
||||
}
|
||||
|
||||
/** 查 */
|
||||
export function getTableDataApi(params: Table.GetTableRequestData) {
|
||||
return request<Table.GetTableResponseData>({
|
||||
export function getTableDataApi(params: Table.TableRequestData) {
|
||||
return request<Table.TableResponseData>({
|
||||
url: "table",
|
||||
method: "get",
|
||||
params
|
||||
|
@ -4,7 +4,7 @@ export interface CreateOrUpdateTableRequestData {
|
||||
password?: string
|
||||
}
|
||||
|
||||
export interface GetTableRequestData {
|
||||
export interface TableRequestData {
|
||||
/** 当前页码 */
|
||||
currentPage: number
|
||||
/** 查询条数 */
|
||||
@ -15,7 +15,7 @@ export interface GetTableRequestData {
|
||||
phone?: string
|
||||
}
|
||||
|
||||
export interface GetTableData {
|
||||
export interface TableData {
|
||||
createTime: string
|
||||
email: string
|
||||
id: string
|
||||
@ -25,7 +25,7 @@ export interface GetTableData {
|
||||
username: string
|
||||
}
|
||||
|
||||
export type GetTableResponseData = ApiResponseData<{
|
||||
list: GetTableData[]
|
||||
export type TableResponseData = ApiResponseData<{
|
||||
list: TableData[]
|
||||
total: number
|
||||
}>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref, watch } from "vue"
|
||||
import { createTableDataApi, deleteTableDataApi, updateTableDataApi, getTableDataApi } from "@/api/table"
|
||||
import { type CreateOrUpdateTableRequestData, type GetTableData } from "@/api/table/types/table"
|
||||
import { type CreateOrUpdateTableRequestData, type TableData } from "@/api/table/types/table"
|
||||
import { type FormInstance, type FormRules, ElMessage, ElMessageBox } from "element-plus"
|
||||
import { Search, Refresh, CirclePlus, Delete, Download, RefreshRight } from "@element-plus/icons-vue"
|
||||
import { usePagination } from "@/hooks/usePagination"
|
||||
@ -51,7 +51,7 @@ const resetForm = () => {
|
||||
//#endregion
|
||||
|
||||
//#region 删
|
||||
const handleDelete = (row: GetTableData) => {
|
||||
const handleDelete = (row: TableData) => {
|
||||
ElMessageBox.confirm(`正在删除用户:${row.username},确认删除?`, "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
@ -66,14 +66,14 @@ const handleDelete = (row: GetTableData) => {
|
||||
//#endregion
|
||||
|
||||
//#region 改
|
||||
const handleUpdate = (row: GetTableData) => {
|
||||
const handleUpdate = (row: TableData) => {
|
||||
dialogVisible.value = true
|
||||
formData.value = cloneDeep(row)
|
||||
}
|
||||
//#endregion
|
||||
|
||||
//#region 查
|
||||
const tableData = ref<GetTableData[]>([])
|
||||
const tableData = ref<TableData[]>([])
|
||||
const searchFormRef = ref<FormInstance | null>(null)
|
||||
const searchData = reactive({
|
||||
username: "",
|
||||
|
@ -2,7 +2,7 @@
|
||||
import { nextTick, reactive, ref } from "vue"
|
||||
import { type ElMessageBoxOptions, ElMessageBox, ElMessage } from "element-plus"
|
||||
import { deleteTableDataApi, getTableDataApi } from "@/api/table"
|
||||
import { type GetTableResponseData } from "@/api/table/types/table"
|
||||
import { type TableResponseData } from "@/api/table/types/table"
|
||||
import RoleColumnSolts from "./tsx/RoleColumnSolts"
|
||||
import StatusColumnSolts from "./tsx/StatusColumnSolts"
|
||||
import {
|
||||
@ -142,7 +142,7 @@ const xGridOpt: VxeGridProps = reactive({
|
||||
let total = 0
|
||||
let result: RowMeta[] = []
|
||||
/** 加载数据 */
|
||||
const callback = (res: GetTableResponseData) => {
|
||||
const callback = (res: TableResponseData) => {
|
||||
if (res?.data) {
|
||||
// 总数
|
||||
total = res.data.total
|
||||
|
Loading…
x
Reference in New Issue
Block a user