Skip to content

Commit

Permalink
feat: refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
tx7do committed Jul 9, 2023
1 parent 610ef14 commit 1487596
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<PageWrapper dense contentFullHeight>
<BasicTable @register="registerTable">
<template #bodyCell="{ column, record }">
<TableAction v-if="column.dataIndex === 'action'" :actions="createActions(record)" />
<TableAction
v-if="(column as BasicColumn).dataIndex === 'action'"
:actions="createActions(record)"
/>
</template>
</BasicTable>
</PageWrapper>
Expand All @@ -15,16 +18,14 @@
TableAction,
ActionItem,
EditRecordRow,
BasicColumn,
} from '/@/components/Table';
import { PageWrapper } from '/@/components/Page';
import { useGo } from '/@/hooks/web/usePage';
import { journalColumns, postSearchFormSchema } from './data';
import { ListComment } from '/@/api/blog/comment';
const go = useGo();
const [registerTable, { reload }] = useTable({
const [registerTable] = useTable({
//title: '列表',
api: ListComment,
columns: journalColumns,
Expand Down
11 changes: 6 additions & 5 deletions blog-frontend/blog-admin/src/views/blog/comments/post-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<PageWrapper dense contentFullHeight>
<BasicTable @register="registerTable">
<template #bodyCell="{ column, record }">
<TableAction v-if="column.dataIndex === 'action'" :actions="createActions(record)" />
<TableAction
v-if="(column as BasicColumn).dataIndex === 'action'"
:actions="createActions(record)"
/>
</template>
</BasicTable>
</PageWrapper>
Expand All @@ -15,16 +18,14 @@
TableAction,
ActionItem,
EditRecordRow,
BasicColumn,
} from '/@/components/Table';
import { PageWrapper } from '/@/components/Page';
import { useGo } from '/@/hooks/web/usePage';
import { postColumns, postSearchFormSchema } from './data';
import { ListComment } from '/@/api/blog/comment';
const go = useGo();
const [registerTable, { reload }] = useTable({
const [registerTable] = useTable({
//title: '列表',
api: ListComment,
columns: postColumns,
Expand Down
11 changes: 6 additions & 5 deletions blog-frontend/blog-admin/src/views/blog/comments/sheet-page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
<PageWrapper dense contentFullHeight>
<BasicTable @register="registerTable">
<template #bodyCell="{ column, record }">
<TableAction v-if="column.dataIndex === 'action'" :actions="createActions(record)" />
<TableAction
v-if="(column as BasicColumn).dataIndex === 'action'"
:actions="createActions(record)"
/>
</template>
</BasicTable>
</PageWrapper>
Expand All @@ -15,16 +18,14 @@
TableAction,
ActionItem,
EditRecordRow,
BasicColumn,
} from '/@/components/Table';
import { PageWrapper } from '/@/components/Page';
import { useGo } from '/@/hooks/web/usePage';
import { sheetColumns, postSearchFormSchema } from './data';
import { ListComment } from '/@/api/blog/comment';
const go = useGo();
const [registerTable, { reload }] = useTable({
const [registerTable] = useTable({
//title: '列表',
api: ListComment,
columns: sheetColumns,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</template>
<template #bodyCell="{ column, record }">
<TableAction
v-if="column.dataIndex === 'action'"
v-if="(column as BasicColumn).dataIndex === 'action'"
:actions="[
{
icon: 'clarity:note-edit-line',
Expand All @@ -30,7 +30,7 @@

<script lang="ts" setup>
import { nextTick } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { BasicTable, useTable, TableAction, BasicColumn } from '/@/components/Table';
import { useDrawer } from '/@/components/Drawer';
import { ListCategory } from '/@/api/blog/category';
Expand Down
8 changes: 6 additions & 2 deletions blog-frontend/blog-admin/src/views/blog/posts/list/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
<a-button preIcon="ant-design:delete" @click="handleTrash"> 回收站 </a-button>
</template>
<template #bodyCell="{ column, record }">
<TableAction v-if="column.dataIndex === 'action'" :actions="createActions(record)" />
<TableAction
v-if="(column as BasicColumn).dataIndex === 'action'"
:actions="createActions(record)"
/>
</template>
</BasicTable>
</PageWrapper>
Expand All @@ -19,6 +22,7 @@
TableAction,
ActionItem,
EditRecordRow,
BasicColumn,
} from '/@/components/Table';
import { PageWrapper } from '/@/components/Page';
import { useGo } from '/@/hooks/web/usePage';
Expand All @@ -28,7 +32,7 @@
const go = useGo();
const [registerTable, { reload }] = useTable({
const [registerTable] = useTable({
title: '列表',
api: ListPost,
columns,
Expand Down
8 changes: 6 additions & 2 deletions blog-frontend/blog-admin/src/views/blog/posts/tags/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
</a-button>
</template>
<template #bodyCell="{ column, record }">
<TableAction v-if="column.dataIndex === 'action'" :actions="createActions(record)" />
<TableAction
v-if="(column as BasicColumn).dataIndex === 'action'"
:actions="createActions(record)"
/>
</template>
</BasicTable>
</PageWrapper>
Expand All @@ -20,6 +23,7 @@
TableAction,
ActionItem,
EditRecordRow,
BasicColumn,
} from '/@/components/Table';
import { PageWrapper } from '/@/components/Page';
import { useGo } from '/@/hooks/web/usePage';
Expand All @@ -29,7 +33,7 @@
const go = useGo();
const [registerTable, { reload }] = useTable({
const [registerTable] = useTable({
title: '全部标签',
api: ListTag,
columns,
Expand Down

0 comments on commit 1487596

Please sign in to comment.