mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 16:56:38 +08:00
fix(ui): ui调整
This commit is contained in:
parent
960d294aa2
commit
fcd86fbebd
@ -1,2 +0,0 @@
|
|||||||
VITE_PROXY_BASE_URL="/api"
|
|
||||||
VITE_TARGET_URL="http://172.22.11.2:5678"
|
|
@ -1,4 +1,4 @@
|
|||||||
lockfileVersion: '6.0'
|
lockfileVersion: '6.1'
|
||||||
|
|
||||||
settings:
|
settings:
|
||||||
autoInstallPeers: true
|
autoInstallPeers: true
|
||||||
|
@ -38,30 +38,32 @@ onActivated(handleSearch);
|
|||||||
<template>
|
<template>
|
||||||
<div class="search-table">
|
<div class="search-table">
|
||||||
<div class="search-table-header">
|
<div class="search-table-header">
|
||||||
<div>
|
<div class="search-table-header-option">
|
||||||
<slot name="header-title">{{ props.headerTitle }}</slot>
|
<div>
|
||||||
</div>
|
<slot name="header-title">{{ props.headerTitle }}</slot>
|
||||||
<div class="header-option">
|
</div>
|
||||||
<slot name="header-option" :formData="formData" :reload="handleSearch" />
|
<div class="header-option">
|
||||||
|
<slot name="header-option" :formData="formData" :reload="handleSearch" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<FormSection
|
||||||
|
v-model="formData"
|
||||||
|
:columns="columns"
|
||||||
|
:submitting="tableConfig.loading as boolean"
|
||||||
|
@request="handleSearch"
|
||||||
|
>
|
||||||
|
<template v-for="slot in Object.keys($slots)" #[slot]="config">
|
||||||
|
<slot :name="slot" v-bind="{ ...config, reload: handleSearch }" />
|
||||||
|
</template>
|
||||||
|
</FormSection>
|
||||||
</div>
|
</div>
|
||||||
<FormSection
|
|
||||||
v-model="formData"
|
|
||||||
:columns="columns"
|
|
||||||
:submitting="tableConfig.loading as boolean"
|
|
||||||
@request="handleSearch"
|
|
||||||
>
|
|
||||||
<template v-for="slot in Object.keys($slots)" #[slot]="config">
|
|
||||||
<slot :name="slot" v-bind="{ ...config, reload: handleSearch }" />
|
|
||||||
</template>
|
|
||||||
</FormSection>
|
|
||||||
<div ref="tableContainerRef" class="search-table-container">
|
<div ref="tableContainerRef" class="search-table-container">
|
||||||
<ATable
|
<ATable
|
||||||
v-bind="{
|
v-bind="{
|
||||||
...$attrs,
|
...$attrs,
|
||||||
...tableConfig,
|
...tableConfig,
|
||||||
...props,
|
...props,
|
||||||
scroll: useTableScroll(_columns, tableContainerRef as HTMLElement),
|
scroll: useTableScroll(_columns),
|
||||||
columns: _columns,
|
columns: _columns,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
@ -74,14 +76,18 @@ onActivated(handleSearch);
|
|||||||
</template>
|
</template>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.search-table {
|
.search-table {
|
||||||
display: flex;
|
position: relative;
|
||||||
flex-direction: column;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
.search-table-container {
|
.search-table-container {
|
||||||
flex: 1;
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
.search-table-header {
|
.search-table-header {
|
||||||
|
background: #fff;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
.search-table-header-option {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
@ -1,20 +1,11 @@
|
|||||||
import type { TableColumnData } from "@arco-design/web-vue";
|
|
||||||
import type { SearchTableColumns, SearchColumns } from "./type";
|
import type { SearchTableColumns, SearchColumns } from "./type";
|
||||||
|
|
||||||
export function useTableXScroll(columns: TableColumnData[]) {
|
export function useTableScroll(columns: SearchTableColumns[]) {
|
||||||
return columns.reduce((prev, curr) => {
|
|
||||||
const width = curr.width ?? 150;
|
|
||||||
return prev + width;
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useTableScroll(columns: SearchTableColumns[], container?: HTMLElement) {
|
|
||||||
const x = columns.reduce((prev, curr) => {
|
const x = columns.reduce((prev, curr) => {
|
||||||
const width = curr.hideInTable ? 0 : curr.width ?? 150;
|
const width = curr.hideInTable ? 0 : curr.width ?? 150;
|
||||||
return prev + width;
|
return prev + width;
|
||||||
}, 0);
|
}, 0);
|
||||||
const y = container?.clientHeight ?? undefined;
|
return { x };
|
||||||
return { x, y };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getDefaultFormData(columns: SearchTableColumns[]) {
|
export function getDefaultFormData(columns: SearchTableColumns[]) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { createRouter, createWebHistory } from 'vue-router'
|
import { createRouter, createWebHashHistory } from 'vue-router'
|
||||||
import { useAuthStore } from "@/stores/auth";
|
import { useAuthStore } from "@/stores/auth";
|
||||||
import CustomLayout from '@/components/CustomLayout.vue'
|
import CustomLayout from '@/components/CustomLayout.vue'
|
||||||
import menu from './menu'
|
import menu from './menu'
|
||||||
@ -17,7 +17,7 @@ const whiteListRoutes = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHistory(import.meta.env.BASE_URL),
|
history: createWebHashHistory(import.meta.env.BASE_URL),
|
||||||
routes: [
|
routes: [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: '/',
|
||||||
|
@ -29,10 +29,13 @@ const columns = [
|
|||||||
title: "使用代理",
|
title: "使用代理",
|
||||||
dataIndex: "use_proxy",
|
dataIndex: "use_proxy",
|
||||||
slotName: "proxy",
|
slotName: "proxy",
|
||||||
|
align: "center",
|
||||||
|
width: 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "最后使用时间",
|
title: "最后使用时间",
|
||||||
dataIndex: "last_used_at",
|
dataIndex: "last_used_at",
|
||||||
|
width: 180,
|
||||||
render: ({ record }) => {
|
render: ({ record }) => {
|
||||||
return dateFormat(record.last_used_at);
|
return dateFormat(record.last_used_at);
|
||||||
},
|
},
|
||||||
@ -41,10 +44,14 @@ const columns = [
|
|||||||
title: "启用状态",
|
title: "启用状态",
|
||||||
dataIndex: "enabled",
|
dataIndex: "enabled",
|
||||||
slotName: "status",
|
slotName: "status",
|
||||||
|
align: "center",
|
||||||
|
width: 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
slotName: "action",
|
slotName: "action",
|
||||||
|
width: 120,
|
||||||
|
fixed: "right",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -16,8 +16,9 @@ export const save = (data?: Record<string, unknown>) => {
|
|||||||
};
|
};
|
||||||
export const deleting = (id: string | number) => {
|
export const deleting = (id: string | number) => {
|
||||||
return http({
|
return http({
|
||||||
url: `/api/admin/apikey/remove?id=${id}`,
|
url: `/api/admin/apikey/remove`,
|
||||||
method: "get",
|
method: "post",
|
||||||
|
data: { id },
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
export const setStatus = (data) => {
|
export const setStatus = (data) => {
|
||||||
|
@ -44,6 +44,8 @@ const columns = [
|
|||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
slotName: "action",
|
slotName: "action",
|
||||||
|
width: 120,
|
||||||
|
fixed: "right",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -16,8 +16,9 @@ export const save = (data?: Record<string, unknown>) => {
|
|||||||
};
|
};
|
||||||
export const deleting = (id: string | number) => {
|
export const deleting = (id: string | number) => {
|
||||||
return http({
|
return http({
|
||||||
url: `/api/admin/model/remove?id=${id}`,
|
url: `/api/admin/model/remove`,
|
||||||
method: "get",
|
method: "post",
|
||||||
|
data: { id },
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
export const setStatus = (data) => {
|
export const setStatus = (data) => {
|
||||||
|
@ -40,10 +40,13 @@ const columns = [
|
|||||||
title: "启用状态",
|
title: "启用状态",
|
||||||
dataIndex: "enabled",
|
dataIndex: "enabled",
|
||||||
slotName: "status",
|
slotName: "status",
|
||||||
|
align: "center",
|
||||||
|
width: 100
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "更新时间",
|
title: "更新时间",
|
||||||
dataIndex: "updated_at",
|
dataIndex: "updated_at",
|
||||||
|
width: 180,
|
||||||
render: ({ record }) => {
|
render: ({ record }) => {
|
||||||
return dateFormat(record.updated_at);
|
return dateFormat(record.updated_at);
|
||||||
},
|
},
|
||||||
@ -51,6 +54,8 @@ const columns = [
|
|||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
slotName: "action",
|
slotName: "action",
|
||||||
|
width: 120,
|
||||||
|
fixed: "right"
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -8,10 +8,10 @@ export const getList = (params?: Record<string, unknown>) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const remove = (params?: Record<string, unknown>) => {
|
export const remove = (data?: Record<string, unknown>) => {
|
||||||
return http({
|
return http({
|
||||||
url: "/api/admin/reward/remove",
|
url: "/api/admin/reward/remove",
|
||||||
method: "get",
|
method: "post",
|
||||||
params
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,9 @@ export const save = (data?: Record<string, unknown>) => {
|
|||||||
};
|
};
|
||||||
export const deleting = (id: string | number) => {
|
export const deleting = (id: string | number) => {
|
||||||
return http({
|
return http({
|
||||||
url: `/api/admin/role/remove?id=${id}`,
|
url: `/api/admin/role/remove`,
|
||||||
method: "get",
|
method: "post",
|
||||||
|
data: { id }
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
export const setStatus = (data) => {
|
export const setStatus = (data) => {
|
||||||
|
@ -18,8 +18,9 @@ export const save = (data?: Record<string, unknown>) => {
|
|||||||
|
|
||||||
export const deletApi = (id: string | number) => {
|
export const deletApi = (id: string | number) => {
|
||||||
return http({
|
return http({
|
||||||
url: `/api/admin/user/remove?id=${id}`,
|
url: `/api/admin/user/remove`,
|
||||||
method: "get",
|
method: "post",
|
||||||
|
data: { id }
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user