!99 feat: 新增完善 ele 的请求、路由、百度统计、概览、登录、系统管理模块
Merge pull request !99 from puhui999/dev-new
This commit is contained in:
@@ -53,8 +53,7 @@
|
||||
"pinia": "catalog:",
|
||||
"vue": "catalog:",
|
||||
"vue-dompurify-html": "catalog:",
|
||||
"vue-router": "catalog:",
|
||||
"vxe-table": "catalog:"
|
||||
"vue-router": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/crypto-js": "catalog:"
|
||||
|
||||
79
apps/web-antd/src/adapter/style.css
Normal file
79
apps/web-antd/src/adapter/style.css
Normal file
@@ -0,0 +1,79 @@
|
||||
/* 来自 @vben/plugins/vxe-table style.css */
|
||||
:root {
|
||||
--vxe-ui-font-color: hsl(var(--foreground));
|
||||
--vxe-ui-font-primary-color: hsl(var(--primary));
|
||||
|
||||
/* --vxe-ui-font-lighten-color: #babdc0;
|
||||
--vxe-ui-font-darken-color: #86898e; */
|
||||
--vxe-ui-font-disabled-color: hsl(var(--foreground) / 50%);
|
||||
|
||||
/* base */
|
||||
--vxe-ui-base-popup-border-color: hsl(var(--border));
|
||||
--vxe-ui-input-disabled-color: hsl(var(--border) / 60%);
|
||||
|
||||
/* --vxe-ui-base-popup-box-shadow: 0px 12px 30px 8px rgb(0 0 0 / 50%); */
|
||||
|
||||
/* layout */
|
||||
--vxe-ui-layout-background-color: hsl(var(--background));
|
||||
--vxe-ui-table-resizable-line-color: hsl(var(--heavy));
|
||||
|
||||
/* --vxe-ui-table-fixed-left-scrolling-box-shadow: 8px 0px 10px -5px hsl(var(--accent));
|
||||
--vxe-ui-table-fixed-right-scrolling-box-shadow: -8px 0px 10px -5px hsl(var(--accent)); */
|
||||
|
||||
/* input */
|
||||
--vxe-ui-input-border-color: hsl(var(--border));
|
||||
|
||||
/* --vxe-ui-input-placeholder-color: #8d9095; */
|
||||
|
||||
/* --vxe-ui-input-disabled-background-color: #262727; */
|
||||
|
||||
/* loading */
|
||||
--vxe-ui-loading-background-color: hsl(var(--overlay-content));
|
||||
|
||||
/* table */
|
||||
--vxe-ui-table-header-background-color: hsl(var(--accent));
|
||||
--vxe-ui-table-border-color: hsl(var(--border));
|
||||
--vxe-ui-table-row-hover-background-color: hsl(var(--accent-hover));
|
||||
--vxe-ui-table-row-striped-background-color: hsl(var(--accent) / 60%);
|
||||
--vxe-ui-table-row-hover-striped-background-color: hsl(var(--accent));
|
||||
--vxe-ui-table-row-radio-checked-background-color: hsl(var(--accent));
|
||||
--vxe-ui-table-row-hover-radio-checked-background-color: hsl(
|
||||
var(--accent-hover)
|
||||
);
|
||||
--vxe-ui-table-row-checkbox-checked-background-color: hsl(var(--accent));
|
||||
--vxe-ui-table-row-hover-checkbox-checked-background-color: hsl(
|
||||
var(--accent-hover)
|
||||
);
|
||||
--vxe-ui-table-row-current-background-color: hsl(var(--accent));
|
||||
--vxe-ui-table-row-hover-current-background-color: hsl(var(--accent-hover));
|
||||
--vxe-ui-font-primary-tinge-color: hsl(var(--primary));
|
||||
--vxe-ui-font-primary-lighten-color: hsl(var(--primary) / 60%);
|
||||
--vxe-ui-font-primary-darken-color: hsl(var(--primary));
|
||||
|
||||
/* height: auto !important; */
|
||||
|
||||
/* --vxe-ui-table-fixed-scrolling-box-shadow-color: rgb(0 0 0 / 80%); */
|
||||
}
|
||||
|
||||
.vxe-tools--operate {
|
||||
margin-right: 0.25rem;
|
||||
margin-left: 0.75rem;
|
||||
}
|
||||
|
||||
.vxe-table-custom--checkbox-option:hover {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
.vxe-toolbar {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.vxe-buttons--wrapper:not(:empty),
|
||||
.vxe-tools--operate:not(:empty),
|
||||
.vxe-tools--wrapper:not(:empty) {
|
||||
padding: 0.6em 0;
|
||||
}
|
||||
|
||||
.vxe-tools--operate:not(:has(button)) {
|
||||
margin-left: 0;
|
||||
}
|
||||
@@ -4,7 +4,11 @@ import { h } from 'vue';
|
||||
|
||||
import { IconifyIcon } from '@vben/icons';
|
||||
import { $te } from '@vben/locales';
|
||||
import { setupVbenVxeTable, useVbenVxeGrid } from '@vben/plugins/vxe-table';
|
||||
import {
|
||||
AsyncComponents,
|
||||
setupVbenVxeTable,
|
||||
useVbenVxeGrid,
|
||||
} from '@vben/plugins/vxe-table';
|
||||
import { isFunction, isString } from '@vben/utils';
|
||||
|
||||
import { Button, Image, Popconfirm, Switch } from 'ant-design-vue';
|
||||
@@ -14,6 +18,8 @@ import { $t } from '#/locales';
|
||||
|
||||
import { useVbenForm } from './form';
|
||||
|
||||
import '#/adapter/style.css';
|
||||
|
||||
setupVbenVxeTable({
|
||||
configVxeTable: (vxeUI) => {
|
||||
vxeUI.setConfig({
|
||||
@@ -111,6 +117,7 @@ setupVbenVxeTable({
|
||||
loading: row[loadingKey] ?? false,
|
||||
'onUpdate:checked': onChange,
|
||||
};
|
||||
|
||||
async function onChange(newVal: any) {
|
||||
row[loadingKey] = true;
|
||||
try {
|
||||
@@ -122,6 +129,7 @@ setupVbenVxeTable({
|
||||
row[loadingKey] = false;
|
||||
}
|
||||
}
|
||||
|
||||
return h(Switch, finallyProps);
|
||||
},
|
||||
});
|
||||
@@ -280,6 +288,10 @@ setupVbenVxeTable({
|
||||
});
|
||||
|
||||
export { useVbenVxeGrid };
|
||||
|
||||
const [VxeTable, VxeColumn, VxeToolbar] = AsyncComponents;
|
||||
export { VxeColumn, VxeTable, VxeToolbar };
|
||||
|
||||
// add by 芋艿:from https://github.com/vbenjs/vue-vben-admin/blob/main/playground/src/adapter/vxe-table.ts#L264-L270
|
||||
export type OnActionClickParams<T = Recordable<any>> = {
|
||||
code: string;
|
||||
|
||||
@@ -17,8 +17,6 @@ import { initComponentAdapter } from './adapter/component';
|
||||
import App from './app.vue';
|
||||
import { router } from './router';
|
||||
|
||||
import 'vxe-table/styles/cssvar.scss'; // TODO @puhui999:这个必须导入哇?我看 use-vxe-grid.vue 已经导入了
|
||||
|
||||
async function bootstrap(namespace: string) {
|
||||
// 初始化组件适配器
|
||||
await initComponentAdapter();
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
<!-- add by puhui999:vxe table 工具栏二次封装,提供给 vxe 原生列表使用 -->
|
||||
<script setup lang="ts">
|
||||
import type { VxeToolbarInstance } from 'vxe-table';
|
||||
import type { VxeToolbarInstance } from '#/adapter/vxe-table';
|
||||
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { useContentMaximize, useRefresh } from '@vben/hooks';
|
||||
import { Fullscreen, RefreshCw, Search } from '@vben/icons';
|
||||
import { Expand, MsRefresh, Search, TMinimize } from '@vben/icons';
|
||||
|
||||
import { Button } from 'ant-design-vue';
|
||||
import { VxeToolbar } from 'vxe-table';
|
||||
import { Button, Tooltip } from 'ant-design-vue';
|
||||
|
||||
import { VxeToolbar } from '#/adapter/vxe-table';
|
||||
|
||||
/** 列表工具栏封装 */
|
||||
defineOptions({ name: 'TableToolbar' });
|
||||
@@ -20,7 +21,8 @@ const props = defineProps<{
|
||||
const emits = defineEmits(['update:hiddenSearch']);
|
||||
|
||||
const toolbarRef = ref<VxeToolbarInstance>();
|
||||
const { toggleMaximizeAndTabbarHidden } = useContentMaximize();
|
||||
const { toggleMaximizeAndTabbarHidden, contentIsMaximize } =
|
||||
useContentMaximize();
|
||||
const { refresh } = useRefresh();
|
||||
|
||||
/** 隐藏搜索栏 */
|
||||
@@ -37,20 +39,41 @@ defineExpose({
|
||||
<VxeToolbar ref="toolbarRef" custom>
|
||||
<template #toolPrefix>
|
||||
<slot></slot>
|
||||
<!-- TODO @puhui999:貌似 icon 没和 vxe 对上。可以考虑用 /Users/yunai/Java/yudao-ui-admin-vben-v5/packages/icons/src/iconify -->
|
||||
<Button class="ml-2 font-[8px]" shape="circle" @click="onHiddenSearchBar">
|
||||
<Search :size="15" />
|
||||
</Button>
|
||||
<Button class="ml-2 font-[8px]" shape="circle" @click="refresh">
|
||||
<RefreshCw :size="15" />
|
||||
</Button>
|
||||
<Button
|
||||
class="ml-2 font-[8px]"
|
||||
shape="circle"
|
||||
@click="toggleMaximizeAndTabbarHidden"
|
||||
>
|
||||
<Fullscreen :size="15" />
|
||||
</Button>
|
||||
<Tooltip placement="bottom">
|
||||
<template #title>
|
||||
<div class="max-w-[200px]">搜索</div>
|
||||
</template>
|
||||
<Button
|
||||
class="ml-2 font-[8px]"
|
||||
shape="circle"
|
||||
@click="onHiddenSearchBar"
|
||||
>
|
||||
<Search :size="15" />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip placement="bottom">
|
||||
<template #title>
|
||||
<div class="max-w-[200px]">刷新</div>
|
||||
</template>
|
||||
<Button class="ml-2 font-[8px]" shape="circle" @click="refresh">
|
||||
<MsRefresh :size="15" />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
<Tooltip placement="bottom">
|
||||
<template #title>
|
||||
<div class="max-w-[200px]">
|
||||
{{ contentIsMaximize ? '还原' : '全屏' }}
|
||||
</div>
|
||||
</template>
|
||||
<Button
|
||||
class="ml-2 font-[8px]"
|
||||
shape="circle"
|
||||
@click="toggleMaximizeAndTabbarHidden"
|
||||
>
|
||||
<Expand v-if="!contentIsMaximize" :size="15" />
|
||||
<TMinimize v-else :size="15" />
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</template>
|
||||
</VxeToolbar>
|
||||
</template>
|
||||
|
||||
1
apps/web-antd/src/hooks/index.ts
Normal file
1
apps/web-antd/src/hooks/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './use-table-toolbar';
|
||||
42
apps/web-antd/src/hooks/use-table-toolbar.ts
Normal file
42
apps/web-antd/src/hooks/use-table-toolbar.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import type { VxeTableInstance, VxeToolbarInstance } from '#/adapter/vxe-table';
|
||||
import type { TableToolbar } from '#/components/table-toolbar';
|
||||
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
export function useTableToolbar() {
|
||||
const hiddenSearchBar = ref(false); // 隐藏搜索栏
|
||||
const tableToolbarRef = ref<InstanceType<typeof TableToolbar>>();
|
||||
const tableRef = ref<VxeTableInstance>();
|
||||
const isBound = ref<boolean>(false);
|
||||
|
||||
/** 挂载 toolbar 工具栏 */
|
||||
async function bindTableToolbar() {
|
||||
const table = tableRef.value;
|
||||
const tableToolbar = tableToolbarRef.value;
|
||||
if (table && tableToolbar) {
|
||||
setTimeout(async () => {
|
||||
const toolbar = tableToolbar.getToolbarRef();
|
||||
if (!toolbar) {
|
||||
console.error('[toolbar 挂载失败] Table toolbar not found');
|
||||
}
|
||||
await table.connect(toolbar as VxeToolbarInstance);
|
||||
isBound.value = true;
|
||||
}, 1000); // 延迟挂载确保 toolbar 正确挂载
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
() => tableRef.value,
|
||||
(val) => {
|
||||
if (!val || isBound.value) return;
|
||||
bindTableToolbar();
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
return {
|
||||
hiddenSearchBar,
|
||||
tableToolbarRef,
|
||||
tableRef,
|
||||
};
|
||||
}
|
||||
@@ -1,9 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableInstance } from 'vxe-table';
|
||||
|
||||
import type { Demo01ContactApi } from '#/api/infra/demo/demo01';
|
||||
|
||||
import { h, nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { h, onMounted, reactive, ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
import { Download, Plus } from '@vben/icons';
|
||||
@@ -22,8 +20,8 @@ import {
|
||||
RangePicker,
|
||||
Select,
|
||||
} from 'ant-design-vue';
|
||||
import { VxeColumn, VxeTable } from 'vxe-table';
|
||||
|
||||
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
|
||||
import {
|
||||
deleteDemo01Contact,
|
||||
exportDemo01Contact,
|
||||
@@ -32,6 +30,7 @@ import {
|
||||
import { ContentWrap } from '#/components/content-wrap';
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { TableToolbar } from '#/components/table-toolbar';
|
||||
import { useTableToolbar } from '#/hooks';
|
||||
import { $t } from '#/locales';
|
||||
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
@@ -120,20 +119,10 @@ async function onExport() {
|
||||
}
|
||||
}
|
||||
|
||||
/** 隐藏搜索栏 */
|
||||
const hiddenSearchBar = ref(false);
|
||||
const tableToolbarRef = ref<InstanceType<typeof TableToolbar>>();
|
||||
const tableRef = ref<VxeTableInstance>();
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
await getList();
|
||||
await nextTick();
|
||||
// 挂载 toolbar 工具栏
|
||||
const table = tableRef.value;
|
||||
const tableToolbar = tableToolbarRef.value;
|
||||
if (table && tableToolbar) {
|
||||
await table.connect(tableToolbar.getToolbarRef()!);
|
||||
}
|
||||
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -192,7 +181,6 @@ onMounted(async () => {
|
||||
|
||||
<!-- 列表 -->
|
||||
<ContentWrap title="示例联系人">
|
||||
<!-- TODO @puhui999:暗黑模式下,会有个黑底 -->
|
||||
<template #extra>
|
||||
<TableToolbar
|
||||
ref="tableToolbarRef"
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableInstance } from 'vxe-table';
|
||||
|
||||
import type { Demo02CategoryApi } from '#/api/infra/demo/demo02';
|
||||
|
||||
import { h, nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { h, onMounted, reactive, ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
import { Download, Plus } from '@vben/icons';
|
||||
@@ -15,8 +13,8 @@ import {
|
||||
} from '@vben/utils';
|
||||
|
||||
import { Button, Form, Input, message, RangePicker } from 'ant-design-vue';
|
||||
import { VxeColumn, VxeTable } from 'vxe-table';
|
||||
|
||||
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
|
||||
import {
|
||||
deleteDemo02Category,
|
||||
exportDemo02Category,
|
||||
@@ -24,6 +22,7 @@ import {
|
||||
} from '#/api/infra/demo/demo02';
|
||||
import { ContentWrap } from '#/components/content-wrap';
|
||||
import { TableToolbar } from '#/components/table-toolbar';
|
||||
import { useTableToolbar } from '#/hooks';
|
||||
import { $t } from '#/locales';
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
@@ -112,11 +111,6 @@ async function onExport() {
|
||||
}
|
||||
}
|
||||
|
||||
/** 隐藏搜索栏 */
|
||||
const hiddenSearchBar = ref(false);
|
||||
const tableToolbarRef = ref<InstanceType<typeof TableToolbar>>();
|
||||
const tableRef = ref<VxeTableInstance>();
|
||||
|
||||
/** 切换树形展开/收缩状态 */
|
||||
const isExpanded = ref(true);
|
||||
function toggleExpand() {
|
||||
@@ -125,15 +119,9 @@ function toggleExpand() {
|
||||
}
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
await getList();
|
||||
await nextTick();
|
||||
// 挂载 toolbar 工具栏
|
||||
const table = tableRef.value;
|
||||
const tableToolbar = tableToolbarRef.value;
|
||||
if (table && tableToolbar) {
|
||||
await table.connect(tableToolbar.getToolbarRef()!);
|
||||
}
|
||||
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableInstance } from 'vxe-table';
|
||||
|
||||
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/erp';
|
||||
|
||||
import { h, nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { h, onMounted, reactive, ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
import { Download, Plus } from '@vben/icons';
|
||||
@@ -24,8 +22,8 @@ import {
|
||||
Select,
|
||||
Tabs,
|
||||
} from 'ant-design-vue';
|
||||
import { VxeColumn, VxeTable } from 'vxe-table';
|
||||
|
||||
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
|
||||
import {
|
||||
deleteDemo03Student,
|
||||
exportDemo03Student,
|
||||
@@ -34,6 +32,7 @@ import {
|
||||
import { ContentWrap } from '#/components/content-wrap';
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { TableToolbar } from '#/components/table-toolbar';
|
||||
import { useTableToolbar } from '#/hooks';
|
||||
import { $t } from '#/locales';
|
||||
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
@@ -137,21 +136,10 @@ async function onExport() {
|
||||
}
|
||||
}
|
||||
|
||||
/** 隐藏搜索栏 */
|
||||
const hiddenSearchBar = ref(false);
|
||||
const tableToolbarRef = ref<InstanceType<typeof TableToolbar>>();
|
||||
const tableRef = ref<VxeTableInstance>();
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
await getList();
|
||||
await nextTick();
|
||||
// 挂载 toolbar 工具栏
|
||||
const table = tableRef.value;
|
||||
const tableToolbar = tableToolbarRef.value;
|
||||
if (table && tableToolbar) {
|
||||
await table.connect(tableToolbar.getToolbarRef()!);
|
||||
}
|
||||
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableInstance } from 'vxe-table';
|
||||
|
||||
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/erp';
|
||||
|
||||
import { h, nextTick, onMounted, reactive, ref, watch } from 'vue';
|
||||
@@ -17,14 +15,15 @@ import {
|
||||
Pagination,
|
||||
RangePicker,
|
||||
} from 'ant-design-vue';
|
||||
import { VxeColumn, VxeTable } from 'vxe-table';
|
||||
|
||||
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
|
||||
import {
|
||||
deleteDemo03Course,
|
||||
getDemo03CoursePage,
|
||||
} from '#/api/infra/demo/demo03/erp';
|
||||
import { ContentWrap } from '#/components/content-wrap';
|
||||
import { TableToolbar } from '#/components/table-toolbar';
|
||||
import { useTableToolbar } from '#/hooks';
|
||||
import { $t } from '#/locales';
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
@@ -129,21 +128,10 @@ watch(
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
/** 隐藏搜索栏 */
|
||||
const hiddenSearchBar = ref(false);
|
||||
const tableToolbarRef = ref<InstanceType<typeof TableToolbar>>();
|
||||
const tableRef = ref<VxeTableInstance>();
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
await getList();
|
||||
await nextTick();
|
||||
// 挂载 toolbar 工具栏
|
||||
const table = tableRef.value;
|
||||
const tableToolbar = tableToolbarRef.value;
|
||||
if (table && tableToolbar) {
|
||||
await table.connect(tableToolbar.getToolbarRef()!);
|
||||
}
|
||||
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableInstance } from 'vxe-table';
|
||||
|
||||
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/erp';
|
||||
|
||||
import { h, nextTick, onMounted, reactive, ref, watch } from 'vue';
|
||||
@@ -17,14 +15,15 @@ import {
|
||||
Pagination,
|
||||
RangePicker,
|
||||
} from 'ant-design-vue';
|
||||
import { VxeColumn, VxeTable } from 'vxe-table';
|
||||
|
||||
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
|
||||
import {
|
||||
deleteDemo03Grade,
|
||||
getDemo03GradePage,
|
||||
} from '#/api/infra/demo/demo03/erp';
|
||||
import { ContentWrap } from '#/components/content-wrap';
|
||||
import { TableToolbar } from '#/components/table-toolbar';
|
||||
import { useTableToolbar } from '#/hooks';
|
||||
import { $t } from '#/locales';
|
||||
import { getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
@@ -129,21 +128,10 @@ watch(
|
||||
{ immediate: true },
|
||||
);
|
||||
|
||||
/** 隐藏搜索栏 */
|
||||
const hiddenSearchBar = ref(false);
|
||||
const tableToolbarRef = ref<InstanceType<typeof TableToolbar>>();
|
||||
const tableRef = ref<VxeTableInstance>();
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
await getList();
|
||||
await nextTick();
|
||||
// 挂载 toolbar 工具栏
|
||||
const table = tableRef.value;
|
||||
const tableToolbar = tableToolbarRef.value;
|
||||
if (table && tableToolbar) {
|
||||
await table.connect(tableToolbar.getToolbarRef()!);
|
||||
}
|
||||
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableInstance } from 'vxe-table';
|
||||
|
||||
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
|
||||
|
||||
import { h, nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { h, onMounted, reactive, ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
import { Download, Plus } from '@vben/icons';
|
||||
@@ -24,8 +22,8 @@ import {
|
||||
Select,
|
||||
Tabs,
|
||||
} from 'ant-design-vue';
|
||||
import { VxeColumn, VxeTable } from 'vxe-table';
|
||||
|
||||
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
|
||||
import {
|
||||
deleteDemo03Student,
|
||||
exportDemo03Student,
|
||||
@@ -34,6 +32,7 @@ import {
|
||||
import { ContentWrap } from '#/components/content-wrap';
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { TableToolbar } from '#/components/table-toolbar';
|
||||
import { useTableToolbar } from '#/hooks';
|
||||
import { $t } from '#/locales';
|
||||
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
@@ -133,21 +132,10 @@ async function onExport() {
|
||||
}
|
||||
}
|
||||
|
||||
/** 隐藏搜索栏 */
|
||||
const hiddenSearchBar = ref(false);
|
||||
const tableToolbarRef = ref<InstanceType<typeof TableToolbar>>();
|
||||
const tableRef = ref<VxeTableInstance>();
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
await getList();
|
||||
await nextTick();
|
||||
// 挂载 toolbar 工具栏
|
||||
const table = tableRef.value;
|
||||
const tableToolbar = tableToolbarRef.value;
|
||||
if (table && tableToolbar) {
|
||||
await table.connect(tableToolbar.getToolbarRef()!);
|
||||
}
|
||||
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableInstance } from 'vxe-table';
|
||||
|
||||
import type { VxeTableInstance } from '#/adapter/vxe-table';
|
||||
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
|
||||
|
||||
import { h, ref, watch } from 'vue';
|
||||
@@ -8,8 +7,8 @@ import { h, ref, watch } from 'vue';
|
||||
import { Plus } from '@vben/icons';
|
||||
|
||||
import { Button, Input } from 'ant-design-vue';
|
||||
import { VxeColumn, VxeTable } from 'vxe-table';
|
||||
|
||||
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
|
||||
import { getDemo03CourseListByStudentId } from '#/api/infra/demo/demo03/normal';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ import { nextTick, ref, watch } from 'vue';
|
||||
|
||||
import { formatDateTime } from '@vben/utils';
|
||||
|
||||
import { VxeColumn, VxeTable } from 'vxe-table';
|
||||
|
||||
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
|
||||
import { getDemo03CourseListByStudentId } from '#/api/infra/demo/demo03/normal';
|
||||
import { ContentWrap } from '#/components/content-wrap';
|
||||
|
||||
const props = defineProps<{
|
||||
studentId?: number; // 学生编号(主表的关联字段)
|
||||
|
||||
@@ -5,8 +5,7 @@ import { nextTick, ref, watch } from 'vue';
|
||||
|
||||
import { formatDateTime } from '@vben/utils';
|
||||
|
||||
import { VxeColumn, VxeTable } from 'vxe-table';
|
||||
|
||||
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
|
||||
import { getDemo03GradeByStudentId } from '#/api/infra/demo/demo03/normal';
|
||||
|
||||
const props = defineProps<{
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableInstance } from 'vxe-table';
|
||||
|
||||
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
|
||||
|
||||
import { h, nextTick, onMounted, reactive, ref } from 'vue';
|
||||
import { h, onMounted, reactive, ref } from 'vue';
|
||||
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
import { Download, Plus } from '@vben/icons';
|
||||
@@ -23,8 +21,8 @@ import {
|
||||
RangePicker,
|
||||
Select,
|
||||
} from 'ant-design-vue';
|
||||
import { VxeColumn, VxeTable } from 'vxe-table';
|
||||
|
||||
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
|
||||
import {
|
||||
deleteDemo03Student,
|
||||
exportDemo03Student,
|
||||
@@ -33,6 +31,7 @@ import {
|
||||
import { ContentWrap } from '#/components/content-wrap';
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { TableToolbar } from '#/components/table-toolbar';
|
||||
import { useTableToolbar } from '#/hooks';
|
||||
import { $t } from '#/locales';
|
||||
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
|
||||
|
||||
@@ -127,21 +126,10 @@ async function onExport() {
|
||||
}
|
||||
}
|
||||
|
||||
/** 隐藏搜索栏 */
|
||||
const hiddenSearchBar = ref(false);
|
||||
const tableToolbarRef = ref<InstanceType<typeof TableToolbar>>();
|
||||
const tableRef = ref<VxeTableInstance>();
|
||||
|
||||
/** 初始化 */
|
||||
onMounted(async () => {
|
||||
await getList();
|
||||
await nextTick();
|
||||
// 挂载 toolbar 工具栏
|
||||
const table = tableRef.value;
|
||||
const tableToolbar = tableToolbarRef.value;
|
||||
if (table && tableToolbar) {
|
||||
await table.connect(tableToolbar.getToolbarRef()!);
|
||||
}
|
||||
const { hiddenSearchBar, tableToolbarRef, tableRef } = useTableToolbar();
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import type { VxeTableInstance } from 'vxe-table';
|
||||
|
||||
import type { VxeTableInstance } from '#/adapter/vxe-table';
|
||||
import type { Demo03StudentApi } from '#/api/infra/demo/demo03/normal';
|
||||
|
||||
import { h, ref, watch } from 'vue';
|
||||
@@ -8,8 +7,8 @@ import { h, ref, watch } from 'vue';
|
||||
import { Plus } from '@vben/icons';
|
||||
|
||||
import { Button, Input } from 'ant-design-vue';
|
||||
import { VxeColumn, VxeTable } from 'vxe-table';
|
||||
|
||||
import { VxeColumn, VxeTable } from '#/adapter/vxe-table';
|
||||
import { getDemo03CourseListByStudentId } from '#/api/infra/demo/demo03/normal';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user