feat: 字典
This commit is contained in:
parent
fdd1d19c8e
commit
d7d8784bb4
@ -1,6 +1,6 @@
|
|||||||
import type { DictType } from './dict-type-model';
|
import type { DictType } from './dict-type-model';
|
||||||
|
|
||||||
import type { ID, IDS, PageQuery } from '#/api/common';
|
import type { ID, IDS, PageQuery, PageResult } from '#/api/common';
|
||||||
|
|
||||||
import { commonExport } from '#/api/helper';
|
import { commonExport } from '#/api/helper';
|
||||||
import { requestClient } from '#/api/request';
|
import { requestClient } from '#/api/request';
|
||||||
@ -18,8 +18,8 @@ enum Api {
|
|||||||
* @param params 请求参数
|
* @param params 请求参数
|
||||||
* @returns list
|
* @returns list
|
||||||
*/
|
*/
|
||||||
export function dictList(params?: PageQuery) {
|
export function dictTypeList(params?: PageQuery) {
|
||||||
return requestClient.get<DictType[]>(Api.dictTypeList, { params });
|
return requestClient.get<PageResult<DictType>>(Api.dictTypeList, { params });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -27,7 +27,7 @@ export function dictList(params?: PageQuery) {
|
|||||||
* @param data 表单参数
|
* @param data 表单参数
|
||||||
* @returns blob
|
* @returns blob
|
||||||
*/
|
*/
|
||||||
export function dictExport(data: any) {
|
export function dictTypeExport(data: any) {
|
||||||
return commonExport(Api.dictTypeExport, data);
|
return commonExport(Api.dictTypeExport, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
import type { FormSchemaGetter } from '#/adapter';
|
import type { FormSchemaGetter, VxeGridProps } from '#/adapter';
|
||||||
|
|
||||||
import { getPopupContainer } from '@vben/utils';
|
import { getPopupContainer } from '@vben/utils';
|
||||||
|
|
||||||
|
import { renderDictTag } from '#/utils/render';
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
component: 'Select',
|
component: 'Select',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
|
placeholder: 'TODO: 字典类型',
|
||||||
getPopupContainer,
|
getPopupContainer,
|
||||||
},
|
},
|
||||||
fieldName: 'dictType',
|
fieldName: 'dictType',
|
||||||
@ -18,6 +21,43 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const columns: VxeGridProps['columns'] = [
|
||||||
|
{ type: 'checkbox', width: 60 },
|
||||||
|
{
|
||||||
|
title: '字典标签',
|
||||||
|
field: 'cssClass',
|
||||||
|
slots: {
|
||||||
|
default: ({ row }) => {
|
||||||
|
const { dictValue } = row;
|
||||||
|
return renderDictTag(dictValue, [row as any]);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '字典键值',
|
||||||
|
field: 'dictValue',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '字典排序',
|
||||||
|
field: 'dictSort',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '备注',
|
||||||
|
field: 'remark',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
field: 'createTime',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'action',
|
||||||
|
fixed: 'right',
|
||||||
|
slots: { default: 'action' },
|
||||||
|
title: '操作',
|
||||||
|
width: 180,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
export const drawerSchema: FormSchemaGetter = () => [
|
export const drawerSchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
|
@ -1,63 +1,203 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { Recordable } from '@vben/types';
|
||||||
|
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
|
||||||
import { useVbenDrawer } from '@vben/common-ui';
|
import { Page, useVbenDrawer, type VbenFormProps } from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
|
||||||
|
|
||||||
import { Card } from 'ant-design-vue';
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter';
|
import { useVbenVxeGrid, type VxeGridProps } from '#/adapter';
|
||||||
|
import {
|
||||||
|
dictDataExport,
|
||||||
|
dictDataList,
|
||||||
|
dictDataRemove,
|
||||||
|
} from '#/api/system/dict/dict-data';
|
||||||
|
import { downloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
import { emitter } from '../mitt';
|
import { emitter } from '../mitt';
|
||||||
import { querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
import dictDataDrawer from './dict-data-drawer.vue';
|
import dictDataDrawer from './dict-data-drawer.vue';
|
||||||
|
|
||||||
|
const dictType = ref('');
|
||||||
|
|
||||||
|
const formOptions: VbenFormProps = {
|
||||||
|
commonConfig: {
|
||||||
|
labelWidth: 80,
|
||||||
|
},
|
||||||
|
schema: querySchema(),
|
||||||
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3',
|
||||||
|
};
|
||||||
|
|
||||||
|
const gridOptions: VxeGridProps = {
|
||||||
|
checkboxConfig: {
|
||||||
|
// 高亮
|
||||||
|
highlight: true,
|
||||||
|
// 翻页时保留选中状态
|
||||||
|
reserve: true,
|
||||||
|
// 点击行选中
|
||||||
|
// trigger: 'row',
|
||||||
|
},
|
||||||
|
columns,
|
||||||
|
height: 'auto',
|
||||||
|
keepSource: true,
|
||||||
|
pagerConfig: {},
|
||||||
|
proxyConfig: {
|
||||||
|
ajax: {
|
||||||
|
query: async ({ page }, formValues = {}) => {
|
||||||
|
// 区间选择器处理
|
||||||
|
if (formValues?.createTime) {
|
||||||
|
formValues.params = {
|
||||||
|
beginTime: dayjs(formValues.createTime[0]).format(
|
||||||
|
'YYYY-MM-DD 00:00:00',
|
||||||
|
),
|
||||||
|
endTime: dayjs(formValues.createTime[1]).format(
|
||||||
|
'YYYY-MM-DD 23:59:59',
|
||||||
|
),
|
||||||
|
};
|
||||||
|
Reflect.deleteProperty(formValues, 'createTime');
|
||||||
|
} else {
|
||||||
|
Reflect.deleteProperty(formValues, 'params');
|
||||||
|
}
|
||||||
|
|
||||||
|
const params: any = {
|
||||||
|
pageNum: page.currentPage,
|
||||||
|
pageSize: page.pageSize,
|
||||||
|
...formValues,
|
||||||
|
};
|
||||||
|
if (dictType.value) {
|
||||||
|
params.dictType = dictType.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return await dictDataList(params);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rowConfig: {
|
||||||
|
isHover: true,
|
||||||
|
keyField: 'dictCode',
|
||||||
|
},
|
||||||
|
round: true,
|
||||||
|
align: 'center',
|
||||||
|
showOverflow: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
const checked = ref(false);
|
||||||
|
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||||
|
formOptions,
|
||||||
|
gridOptions,
|
||||||
|
gridEvents: {
|
||||||
|
checkboxChange: (e: any) => {
|
||||||
|
checked.value = e.records.length > 0;
|
||||||
|
},
|
||||||
|
checkboxAll: (e: any) => {
|
||||||
|
checked.value = e.records.length > 0;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const [DictDataDrawer, drawerApi] = useVbenDrawer({
|
const [DictDataDrawer, drawerApi] = useVbenDrawer({
|
||||||
connectedComponent: dictDataDrawer,
|
connectedComponent: dictDataDrawer,
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
drawerApi.setData({ dictType: 'aa_bb_cc' });
|
drawerApi.setData({ dictType: dictType.value });
|
||||||
drawerApi.open();
|
drawerApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
const [QueryForm] = useVbenForm({
|
async function handleEdit(record: Recordable<any>) {
|
||||||
// 默认展开
|
drawerApi.setData({
|
||||||
collapsed: false,
|
dictType: dictType.value,
|
||||||
// 所有表单项共用,可单独在表单内覆盖
|
dictCode: record.dictCode,
|
||||||
commonConfig: {
|
});
|
||||||
// 所有表单项
|
drawerApi.open();
|
||||||
componentProps: {
|
}
|
||||||
class: 'w-full',
|
|
||||||
|
async function handleDelete(row: Recordable<any>) {
|
||||||
|
await dictDataRemove(row.dictCode);
|
||||||
|
await tableApi.query();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleMultiDelete() {
|
||||||
|
const rows = tableApi.grid.getCheckboxRecords();
|
||||||
|
const ids = rows.map((row: any) => row.dictCode);
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
okType: 'danger',
|
||||||
|
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||||
|
onOk: async () => {
|
||||||
|
await dictDataRemove(ids);
|
||||||
|
await tableApi.query();
|
||||||
},
|
},
|
||||||
},
|
});
|
||||||
schema: querySchema(),
|
}
|
||||||
// 是否可展开
|
|
||||||
showCollapseButton: true,
|
|
||||||
submitButtonOptions: {
|
|
||||||
text: '查询',
|
|
||||||
},
|
|
||||||
wrapperClass: 'grid-cols-1 md:grid-cols-2',
|
|
||||||
});
|
|
||||||
|
|
||||||
const testValue = ref('');
|
emitter.on('rowClick', async (value) => {
|
||||||
|
dictType.value = value;
|
||||||
emitter.on('rowClick', (dictType) => {
|
await tableApi.query();
|
||||||
testValue.value = dictType;
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="flex flex-col gap-4">
|
<Page :auto-content-height="true">
|
||||||
<Card>
|
<BasicTable>
|
||||||
<QueryForm />
|
<template #toolbar-actions>
|
||||||
</Card>
|
<span class="pl-[7px] text-[16px]">字典数据列表</span>
|
||||||
<Card>
|
</template>
|
||||||
<a-button type="primary" @click="handleAdd">
|
<template #toolbar-tools>
|
||||||
{{ $t('pages.common.add') }}
|
<Space>
|
||||||
</a-button>
|
<a-button
|
||||||
</Card>
|
v-access:code="['system:dict:export']"
|
||||||
{{ testValue }}
|
@click="downloadExcel(dictDataExport, '字典数据', {})"
|
||||||
<DictDataDrawer />
|
>
|
||||||
</div>
|
{{ $t('pages.common.export') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
:disabled="!checked"
|
||||||
|
danger
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['system:dict:remove']"
|
||||||
|
@click="handleMultiDelete"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
:disabled="dictType === ''"
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['system:dict:add']"
|
||||||
|
@click="handleAdd"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.add') }}
|
||||||
|
</a-button>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
<template #action="{ row }">
|
||||||
|
<a-button
|
||||||
|
size="small"
|
||||||
|
type="link"
|
||||||
|
v-access:code="['system:dict:edit']"
|
||||||
|
@click="handleEdit(row)"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.edit') }}
|
||||||
|
</a-button>
|
||||||
|
<Popconfirm
|
||||||
|
placement="left"
|
||||||
|
title="确认删除?"
|
||||||
|
@confirm="handleDelete(row)"
|
||||||
|
>
|
||||||
|
<a-button
|
||||||
|
danger
|
||||||
|
size="small"
|
||||||
|
type="link"
|
||||||
|
v-access:code="['system:dict:remove']"
|
||||||
|
@click.stop=""
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</a-button>
|
||||||
|
</Popconfirm>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<DictDataDrawer @reload="tableApi.query()" />
|
||||||
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
@ -6,8 +6,17 @@ import DictTypePanel from './type/index.vue';
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Page content-class="flex flex-col gap-[16px] lg:flex-row">
|
<Page :auto-content-height="true" content-class="flex flex-col lg:flex-row">
|
||||||
<DictTypePanel class="flex-1" />
|
<DictTypePanel class="flex-1 overflow-hidden" />
|
||||||
<DictDataPanel class="flex-1" />
|
<DictDataPanel class="flex-1 overflow-hidden" />
|
||||||
</Page>
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/**
|
||||||
|
TODO: ugly code
|
||||||
|
*/
|
||||||
|
:deep(.p-4) {
|
||||||
|
padding: 6px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { type FormSchemaGetter, z } from '#/adapter';
|
import { type FormSchemaGetter, type VxeGridProps, z } from '#/adapter';
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
@ -13,6 +13,33 @@ export const querySchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const columns: VxeGridProps['columns'] = [
|
||||||
|
{ type: 'checkbox', width: 60 },
|
||||||
|
{
|
||||||
|
title: '字典名称',
|
||||||
|
field: 'dictName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '字典类型',
|
||||||
|
field: 'dictType',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '备注',
|
||||||
|
field: 'remark',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '创建时间',
|
||||||
|
field: 'createTime',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'action',
|
||||||
|
fixed: 'right',
|
||||||
|
slots: { default: 'action' },
|
||||||
|
title: '操作',
|
||||||
|
width: 180,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
export const modalSchema: FormSchemaGetter = () => [
|
export const modalSchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
component: 'Input',
|
component: 'Input',
|
||||||
|
@ -1,65 +1,197 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import type { Recordable } from '@vben/types';
|
||||||
import { $t } from '@vben/locales';
|
|
||||||
|
|
||||||
import { Card } from 'ant-design-vue';
|
import { ref } from 'vue';
|
||||||
import { uniqueId } from 'lodash-es';
|
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter';
|
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
|
|
||||||
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
|
import { useVbenVxeGrid, type VxeGridProps } from '#/adapter';
|
||||||
|
import {
|
||||||
|
dictTypeExport,
|
||||||
|
dictTypeList,
|
||||||
|
dictTypeRemove,
|
||||||
|
} from '#/api/system/dict/dict-type';
|
||||||
|
import { downloadExcel } from '#/utils/file/download';
|
||||||
|
|
||||||
import { emitter } from '../mitt';
|
import { emitter } from '../mitt';
|
||||||
import { querySchema } from './data';
|
import { columns, querySchema } from './data';
|
||||||
import dictTypeModel from './dict-type-model.vue';
|
import dictTypeModal from './dict-type-modal.vue';
|
||||||
|
|
||||||
defineOptions({ name: 'DictTypePanel' });
|
const formOptions: VbenFormProps = {
|
||||||
|
commonConfig: {
|
||||||
|
labelWidth: 70,
|
||||||
|
},
|
||||||
|
schema: querySchema(),
|
||||||
|
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3',
|
||||||
|
};
|
||||||
|
|
||||||
|
const gridOptions: VxeGridProps = {
|
||||||
|
checkboxConfig: {
|
||||||
|
// 高亮
|
||||||
|
highlight: true,
|
||||||
|
// 翻页时保留选中状态
|
||||||
|
reserve: true,
|
||||||
|
// 点击行选中
|
||||||
|
// trigger: 'row',
|
||||||
|
},
|
||||||
|
columns,
|
||||||
|
height: 'auto',
|
||||||
|
keepSource: true,
|
||||||
|
pagerConfig: {},
|
||||||
|
proxyConfig: {
|
||||||
|
ajax: {
|
||||||
|
query: async ({ page }, formValues = {}) => {
|
||||||
|
// 区间选择器处理
|
||||||
|
if (formValues?.createTime) {
|
||||||
|
formValues.params = {
|
||||||
|
beginTime: dayjs(formValues.createTime[0]).format(
|
||||||
|
'YYYY-MM-DD 00:00:00',
|
||||||
|
),
|
||||||
|
endTime: dayjs(formValues.createTime[1]).format(
|
||||||
|
'YYYY-MM-DD 23:59:59',
|
||||||
|
),
|
||||||
|
};
|
||||||
|
Reflect.deleteProperty(formValues, 'createTime');
|
||||||
|
} else {
|
||||||
|
Reflect.deleteProperty(formValues, 'params');
|
||||||
|
}
|
||||||
|
|
||||||
|
return await dictTypeList({
|
||||||
|
pageNum: page.currentPage,
|
||||||
|
pageSize: page.pageSize,
|
||||||
|
...formValues,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
rowConfig: {
|
||||||
|
isHover: true,
|
||||||
|
keyField: 'dictId',
|
||||||
|
},
|
||||||
|
round: true,
|
||||||
|
align: 'center',
|
||||||
|
showOverflow: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
const checked = ref(false);
|
||||||
|
const lastDictType = ref('');
|
||||||
|
|
||||||
|
const [BasicTable, tableApi] = useVbenVxeGrid({
|
||||||
|
formOptions,
|
||||||
|
gridOptions,
|
||||||
|
gridEvents: {
|
||||||
|
cellClick: (e: any) => {
|
||||||
|
const { row } = e;
|
||||||
|
if (lastDictType.value === row.dictType) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
emitter.emit('rowClick', row.dictType);
|
||||||
|
lastDictType.value = row.dictType;
|
||||||
|
},
|
||||||
|
checkboxChange: (e: any) => {
|
||||||
|
checked.value = e.records.length > 0;
|
||||||
|
},
|
||||||
|
checkboxAll: (e: any) => {
|
||||||
|
checked.value = e.records.length > 0;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
const [DictTypeModal, modalApi] = useVbenModal({
|
const [DictTypeModal, modalApi] = useVbenModal({
|
||||||
connectedComponent: dictTypeModel,
|
connectedComponent: dictTypeModal,
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleAdd() {
|
function handleAdd() {
|
||||||
modalApi.setData({ update: false });
|
modalApi.setData({});
|
||||||
modalApi.open();
|
modalApi.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
const [QueryForm] = useVbenForm({
|
async function handleEdit(record: Recordable<any>) {
|
||||||
// 默认展开
|
modalApi.setData({ id: record.dictId });
|
||||||
collapsed: false,
|
modalApi.open();
|
||||||
// 所有表单项共用,可单独在表单内覆盖
|
}
|
||||||
commonConfig: {
|
|
||||||
// 所有表单项
|
|
||||||
componentProps: {
|
|
||||||
class: 'w-full',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
schema: querySchema(),
|
|
||||||
// 是否可展开
|
|
||||||
showCollapseButton: true,
|
|
||||||
submitButtonOptions: {
|
|
||||||
text: '查询',
|
|
||||||
},
|
|
||||||
wrapperClass: 'grid-cols-1 md:grid-cols-2',
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleRowClickTest() {
|
async function handleDelete(row: Recordable<any>) {
|
||||||
emitter.emit('rowClick', uniqueId('mitt-'));
|
await dictTypeRemove(row.dictId);
|
||||||
|
await tableApi.query();
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleMultiDelete() {
|
||||||
|
const rows = tableApi.grid.getCheckboxRecords();
|
||||||
|
const ids = rows.map((row: any) => row.dictId);
|
||||||
|
Modal.confirm({
|
||||||
|
title: '提示',
|
||||||
|
okType: 'danger',
|
||||||
|
content: `确认删除选中的${ids.length}条记录吗?`,
|
||||||
|
onOk: async () => {
|
||||||
|
await dictTypeRemove(ids);
|
||||||
|
await tableApi.query();
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="flex flex-col gap-4">
|
<Page :auto-content-height="true">
|
||||||
<Card>
|
<BasicTable>
|
||||||
<QueryForm />
|
<template #toolbar-actions>
|
||||||
</Card>
|
<span class="pl-[7px] text-[16px]">字典类型列表</span>
|
||||||
<Card>
|
</template>
|
||||||
<a-button type="primary" @click="handleAdd">
|
<template #toolbar-tools>
|
||||||
{{ $t('pages.common.add') }}
|
<Space>
|
||||||
</a-button>
|
<a-button danger type="primary">缓存(TODO)</a-button>
|
||||||
</Card>
|
<a-button
|
||||||
<Card>
|
v-access:code="['system:dict:export']"
|
||||||
<a-button @click="handleRowClickTest">测试mitt</a-button>
|
@click="downloadExcel(dictTypeExport, '字典类型数据', {})"
|
||||||
左侧向右侧传值
|
>
|
||||||
</Card>
|
{{ $t('pages.common.export') }}
|
||||||
<DictTypeModal />
|
</a-button>
|
||||||
</div>
|
<a-button
|
||||||
|
:disabled="!checked"
|
||||||
|
danger
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['system:dict:remove']"
|
||||||
|
@click="handleMultiDelete"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</a-button>
|
||||||
|
<a-button
|
||||||
|
type="primary"
|
||||||
|
v-access:code="['system:dict:add']"
|
||||||
|
@click="handleAdd"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.add') }}
|
||||||
|
</a-button>
|
||||||
|
</Space>
|
||||||
|
</template>
|
||||||
|
<template #action="{ row }">
|
||||||
|
<a-button
|
||||||
|
size="small"
|
||||||
|
type="link"
|
||||||
|
v-access:code="['system:dict:edit']"
|
||||||
|
@click="handleEdit(row)"
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.edit') }}
|
||||||
|
</a-button>
|
||||||
|
<Popconfirm
|
||||||
|
placement="left"
|
||||||
|
title="确认删除?"
|
||||||
|
@confirm="handleDelete(row)"
|
||||||
|
>
|
||||||
|
<a-button
|
||||||
|
danger
|
||||||
|
size="small"
|
||||||
|
type="link"
|
||||||
|
v-access:code="['system:dict:remove']"
|
||||||
|
@click.stop=""
|
||||||
|
>
|
||||||
|
{{ $t('pages.common.delete') }}
|
||||||
|
</a-button>
|
||||||
|
</Popconfirm>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<DictTypeModal @reload="tableApi.query()" />
|
||||||
|
</Page>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user