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