Browse Source

chore: table style

master
wangxiang 1 year ago
parent
commit
7af55bb486
  1. 4
      src/components/Table/src/components/TableHeader.vue
  2. 20
      src/views/system/devtools/genTable/genTable.data.ts
  3. 72
      src/views/system/devtools/genTable/index.vue

4
src/components/Table/src/components/TableHeader.vue

@ -160,8 +160,8 @@
&__tableTitle { &__tableTitle {
flex: 1; flex: 1;
display: flex; display: flex;
flex-wrap: wrap; align-items: center;
align-content: flex-start; justify-content: flex-start;
> * { > * {
margin-right: 4px; margin-right: 4px;

20
src/views/system/devtools/genTable/genTable.data.ts

@ -4,6 +4,26 @@ import {h} from 'vue';
import {Tag} from 'ant-design-vue'; import {Tag} from 'ant-design-vue';
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{
title: '模板名称',
dataIndex: 'name',
},
{
title: '模板名称',
dataIndex: 'name',
},
{
title: '模板名称',
dataIndex: 'name',
},
{
title: '模板名称',
dataIndex: 'name',
},
{
title: '模板名称',
dataIndex: 'name',
},
{ {
title: '模板名称', title: '模板名称',
dataIndex: 'name', dataIndex: 'name',

72
src/views/system/devtools/genTable/index.vue

@ -1,14 +1,35 @@
<template> <template>
<div> <PageWrapper
contentClass="flex"
contentFullHeight
fixedHeight
dense
>
<div class="m-4 mr-0 overflow-hidden bg-white w-1/4 xl:w-1/5">
<BasicTree title="流程分类"
toolbar
search
defaultExpandAll
:clickRowToExpand="false"
:treeData="state.treeData"
:fieldNames="{ key: 'id', title: 'name' }"
@select="handleSelect"
/>
</div>
<BasicTable <BasicTable
class="w-3/4 xl:w-4/5"
@register="registerTable" @register="registerTable"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<template #toolbar> <template #tableTitle>
<a-button <a-button
type="primary" type="primary"
@click="handleAdd()" @click="handleAdd()"
>新增</a-button> >新增</a-button>
<a-button
type="primary"
@click="handleAdd()"
>数据库导入表单</a-button>
<a-button <a-button
type="primary" type="primary"
:disabled="state.single" :disabled="state.single"
@ -18,7 +39,27 @@
type="primary" type="primary"
:disabled="state.multiple" :disabled="state.multiple"
@click="handleDel()" @click="handleDel()"
>删除</a-button> >移除</a-button>
<a-button
type="primary"
:disabled="state.single"
@click="handleEdit()"
>生成代码</a-button>
<a-button
type="primary"
:disabled="state.single"
@click="handleEdit()"
>创建菜单</a-button>
<a-button
type="primary"
:disabled="state.single"
@click="handleEdit()"
>添加到java类型</a-button>
<a-button
type="primary"
:disabled="state.single"
@click="handleEdit()"
>获取流程表单</a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -30,22 +71,29 @@
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
label: '复制', label: '移除',
icon: 'fa-regular:copy', icon: 'ant-design:delete-outlined',
onClick: handleCopy.bind(null, record) color: 'error',
}, onClick: handleDel.bind(null, record)
}]"
:dropDownActions="[
{ {
label: '删除', label: '删除',
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
onClick: handleDel.bind(null, record) onClick: handleDel.bind(null, record)
},
{
label: '同步数据库',
icon: 'fa-regular:copy',
onClick: handleCopy.bind(null, record)
}]" }]"
/> />
</template> </template>
</template> </template>
</BasicTable> </BasicTable>
<GenTableModal @register="registerModal" @success="handleRefreshTable"/> <GenTableModal @register="registerModal" @success="handleRefreshTable"/>
</div> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
@ -56,10 +104,13 @@
import GenTableModal from './GenTableModal.vue'; import GenTableModal from './GenTableModal.vue';
import { columns, searchFormSchema } from './genTable.data'; import { columns, searchFormSchema } from './genTable.data';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import {PageWrapper} from '/@/components/Page';
import {BasicTree, TreeItem} from '/@/components/Tree';
interface TableState { interface TableState {
single: boolean; single: boolean;
multiple: boolean; multiple: boolean;
treeData: TreeItem[];
} }
/** 通用变量统一声明区域 */ /** 通用变量统一声明区域 */
@ -67,7 +118,8 @@
// //
single: true, single: true,
// //
multiple: true multiple: true,
treeData: []
}); });
const { createConfirm, createMessage } = useMessage(); const { createConfirm, createMessage } = useMessage();
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
@ -93,7 +145,7 @@
width: 220, width: 220,
title: '操作', title: '操作',
dataIndex: 'action', dataIndex: 'action',
fixed: false fixed: 'right'
}, },
handleSearchInfoFn: () => clearSelectedRowKeys() handleSearchInfoFn: () => clearSelectedRowKeys()
}); });

Loading…
Cancel
Save