feat: icon enum

pull/1/MERGE
xingyuv 2023-03-22 16:59:39 +08:00
parent 51beba6968
commit a438064ea6
25 changed files with 437 additions and 68 deletions

View File

@ -50,3 +50,23 @@ export enum RouterTransitionEnum {
FADE_BOTTOM = 'fade-bottom',
FADE_SCALE = 'fade-scale'
}
export enum IconEnum {
VIEW = 'ant-design:file-search-outlined',
ADD = 'ant-design:plus-outlined',
IMPORT = 'ant-design:vertical-align-top-outlined',
EXPORT = 'ant-design:vertical-align-bottom-outlined',
TEST = 'ant-design:deployment-unit-outlined',
EDIT = 'clarity:note-edit-line',
AUTH = 'ant-design:safety-certificate-outlined',
DATA = 'clarity:note-edit-line',
DELETE = 'ant-design:delete-outlined',
SEARCH = 'ant-design:search-outlined',
RESET = 'ant-design:sync-outlined',
UPLOAD = 'ant-design:cloud-upload-outlined',
DOWNLOAD = 'ant-design:cloud-download-outlined',
PREVIEW = 'ant-design:eye-outlined',
ADD_FOLD = 'ant-design:folder-add-outlined',
LOG = 'ant-design:exception-outlined',
PASSWORD = 'ant-design:key-outlined'
}

View File

@ -0,0 +1,54 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup name="FileConfigModal">
import { ref, computed, unref } from 'vue'
import { BasicModal, useModalInner } from '@/components/Modal'
import { BasicForm, useForm } from '@/components/Form'
import { formSchema } from './ficleConfig.data'
import { createFileConfigApi, getFileConfigApi, updateFileConfigApi } from '@/api/infra/fileConfig'
const emit = defineEmits(['success', 'register'])
const isUpdate = ref(true)
const rowId = ref()
const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { span: 24 },
schemas: formSchema,
showActionButtonGroup: false,
actionColOptions: { span: 23 }
})
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields()
setModalProps({ confirmLoading: false })
isUpdate.value = !!data?.isUpdate
if (unref(isUpdate)) {
const res = await getFileConfigApi(data.record.id)
rowId.value = res.id
setFieldsValue({ ...res })
}
})
const getTitle = computed(() => (!unref(isUpdate) ? '新增文件配置' : '编辑文件配置'))
async function handleSubmit() {
try {
const values = await validate()
setModalProps({ confirmLoading: true })
if (unref(isUpdate)) {
await updateFileConfigApi(values)
} else {
await createFileConfigApi(values)
}
closeModal()
emit('success')
} finally {
setModalProps({ confirmLoading: false })
}
}
</script>

View File

@ -0,0 +1,178 @@
import { BasicColumn, FormSchema, useRender } from '@/components/Table'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
export const columns: BasicColumn[] = [
{
title: '编号',
dataIndex: 'id',
width: 100
},
{
title: '配置名',
dataIndex: 'name',
width: 180
},
{
title: '存储器',
dataIndex: 'storage',
width: 100,
customRender: ({ text }) => {
return useRender.renderDict(text, DICT_TYPE.INFRA_FILE_STORAGE)
}
},
{
title: '主配置',
dataIndex: 'master',
width: 180,
customRender: ({ text }) => {
return useRender.renderDict(text, DICT_TYPE.INFRA_BOOLEAN_STRING)
}
},
{
title: '备注',
dataIndex: 'remark',
width: 180
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 180,
customRender: ({ text }) => {
return useRender.renderDate(text)
}
}
]
export const searchFormSchema: FormSchema[] = [
{
label: '配置名',
field: 'name',
component: 'Input',
colProps: { span: 8 }
},
{
label: '存储器',
field: 'storage',
component: 'Select',
componentProps: {
options: getIntDictOptions(DICT_TYPE.INFRA_FILE_STORAGE)
},
colProps: { span: 8 }
},
{
label: '创建时间',
field: 'createTime',
component: 'RangePicker',
colProps: { span: 8 }
}
]
export const formSchema: FormSchema[] = [
{
label: '编号',
field: 'id',
show: false,
component: 'Input'
},
{
label: '配置名',
field: 'name',
required: true,
component: 'Input'
},
{
label: '存储器',
field: 'storage',
component: 'Select',
required: true,
dynamicDisabled: ({ values }) => !!values.id,
componentProps: {
options: getIntDictOptions(DICT_TYPE.INFRA_FILE_STORAGE)
}
},
{
label: '基础路径',
field: 'config.basePath',
required: true,
ifShow: ({ values }) => values.storage >= 10 && values.storage <= 12,
component: 'Input'
},
{
label: '主机地址',
field: 'config.host',
required: true,
ifShow: ({ values }) => values.storage >= 11 && values.storage <= 12,
component: 'Input'
},
{
label: '主机端口',
field: 'config.port',
required: true,
ifShow: ({ values }) => values.storage >= 11 && values.storage <= 12,
component: 'Input'
},
{
label: '用户名',
field: 'config.username',
required: true,
ifShow: ({ values }) => values.storage >= 11 && values.storage <= 12,
component: 'Input'
},
{
label: '密码',
field: 'config.password',
required: true,
ifShow: ({ values }) => values.storage >= 11 && values.storage <= 12,
component: 'Input'
},
{
label: '连接模式',
field: 'config.basePath',
required: true,
ifShow: ({ values }) => values.storage === 11,
component: 'Select',
componentProps: {
options: [
{ lable: '主动模式', key: 'Active', value: 'Active' },
{ lable: '被动模式', key: 'Passive', value: 'Passive' }
]
}
},
{
label: '节点地址',
field: 'config.endpoint',
required: true,
ifShow: ({ values }) => values.storage === 20,
component: 'Input'
},
{
label: '存储 bucket',
field: 'config.bucket',
required: true,
ifShow: ({ values }) => values.storage === 20,
component: 'Input'
},
{
label: 'accessKey',
field: 'config.accessKey',
ifShow: ({ values }) => values.storage === 20,
component: 'Input'
},
{
label: 'accessSecret',
field: 'config.accessSecret',
ifShow: ({ values }) => values.storage === 20,
component: 'Input'
},
{
label: '自定义域名',
field: 'config.domain',
required: true,
component: 'Input'
},
{
label: '备注',
field: 'remark',
component: 'InputTextArea'
}
]

View File

@ -1,3 +1,100 @@
<template>
<div>开发中</div>
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.TEST, label: t('action.test'), onClick: handleTest.bind(null, record) },
{ icon: IconEnum.AUTH, label: '主配置', onClick: handleMaster.bind(null, record) },
{
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
title: t('common.delMessage'),
placement: 'left',
confirm: handleDelete.bind(null, record)
}
}
]"
/>
</template>
</template>
</BasicTable>
<PostModal @register="registerModal" @success="reload()" />
</div>
</template>
<script lang="ts" setup name="FileConfig">
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import PostModal from './FileConfigModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteFileConfigApi, getFileConfigPageApi, testFileConfigApi, updateFileConfigMasterApi } from '@/api/infra/fileConfig'
import { columns, searchFormSchema } from './ficleConfig.data'
const { t } = useI18n()
const { createConfirm, createMessage, createSuccessModal } = useMessage()
const [registerModal, { openModal }] = useModal()
const [registerTable, { reload }] = useTable({
title: '文件配置列表',
api: getFileConfigPageApi,
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema
},
useSearchForm: true,
showTableSetting: true,
showIndexColumn: false,
actionColumn: {
width: 240,
title: t('common.action'),
dataIndex: 'action',
fixed: 'right'
}
})
function handleCreate() {
openModal(true, {
isUpdate: false
})
}
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true
})
}
async function handleTest(record: Recordable) {
const res = await testFileConfigApi(record.id)
createSuccessModal({ content: res })
}
function handleMaster(record: Recordable) {
createConfirm({
title: '主配置',
iconType: 'warning',
content: '是否确认修改配置编号为"' + record.id + '"的数据项为主配置?',
async onOk() {
await updateFileConfigMasterApi(record.id)
createMessage.success('配置成功')
}
})
}
async function handleDelete(record: Recordable) {
await deleteFileConfigApi(record.id)
createMessage.success(t('common.delSuccessText'))
reload()
}
</script>

View File

@ -2,7 +2,7 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> IP </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> IP </a-button>
</template>
</BasicTable>
<AreaModal @register="registerModal" @success="reload()" />
@ -11,6 +11,7 @@
<script lang="ts" setup name="Area">
import { useModal } from '@/components/Modal'
import AreaModal from './AreaModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable } from '@/components/Table'
import { getAreaTree } from '@/api/system/area'
import { columns } from './area.data'

View File

@ -2,7 +2,7 @@
<div>
<BasicTable @register="register" @fetch-success="onFetchSuccess">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="info" @click="expandAll">{{ t('component.tree.expandAll') }}</a-button>
<a-button type="info" @click="collapseAll">{{ t('component.tree.unExpandAll') }}</a-button>
</template>
@ -13,9 +13,9 @@
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -39,6 +39,7 @@ import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import DeptModal from './DeptModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { getListSimpleUsersApi } from '@/api/system/user'
import { deleteDeptApi, getDeptPageApi } from '@/api/system/dept'

View File

@ -2,15 +2,15 @@
<div>
<BasicTable @register="registerTable" :searchInfo="searchInfo">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }}</a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -33,6 +33,7 @@ import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import DictDataModal from './DictDataModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { dataColumns, dataSearchFormSchema } from './dict.data'
import { deleteDictDataApi, getDictDataPageApi } from '@/api/system/dict/data'

View File

@ -2,15 +2,15 @@
<div class="flex">
<BasicTable @register="registerTable" class="w-1/2 xl:w-1/2" @row-click="handleRowClick">
<template #toolbar>
<a-button type="primary" @click="handleCreate">{{ t('action.create') }}</a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -35,6 +35,7 @@ import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import DictData from './DictData.vue'
import DictTypeModal from './DictTypeModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { typeColumns, typeSearchFormSchema } from './dict.type'
import { deleteDictTypeApi, getDictTypePageApi } from '@/api/system/dict/type'

View File

@ -2,16 +2,16 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" :preIcon="IconEnum.EXPORT" @click="handleExport"> {{ t('action.export') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -33,6 +33,7 @@ import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import ErrorCodeModal from './ErrorCodeModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { ErrorCodePageReqVO, deleteErrorCodeApi, excelErrorCodeApi, getErrorCodePageApi } from '@/api/system/errorCode'
import { columns, searchFormSchema } from './errorCode.data'

View File

@ -2,15 +2,15 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -32,6 +32,7 @@ import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import AccountModal from './AccountModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteMailAccountApi, getMailAccountPageApi } from '@/api/system/mail/account'
import { columns, searchFormSchema } from './account.data'

View File

@ -2,15 +2,15 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -32,6 +32,7 @@ import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import TemplateModal from './TemplateModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteMailTemplateApi, getMailTemplatePageApi } from '@/api/system/mail/template'
import { columns, searchFormSchema } from './template.data'

View File

@ -2,7 +2,7 @@
<div>
<BasicTable @register="register">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="info" @click="expandAll">{{ t('component.tree.expandAll') }}</a-button>
<a-button type="info" @click="collapseAll">{{ t('component.tree.unExpandAll') }}</a-button>
</template>
@ -10,9 +10,9 @@
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -35,6 +35,7 @@ import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import MenuModal from './MenuModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteMenuApi, getMenuListApi } from '@/api/system/menu'
import { columns, searchFormSchema } from './menu.data'

View File

@ -2,15 +2,15 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -32,6 +32,7 @@ import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import NoticeModal from './NoticeModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteNoticeApi, getNoticePageApi } from '@/api/system/notice'
import { columns, searchFormSchema } from './notice.data'

View File

@ -2,15 +2,15 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -32,6 +32,7 @@ import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import ClientModal from './ClientModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteOAuth2ClientApi, getOAuth2ClientPageApi } from '@/api/system/oauth2/client'
import { columns, searchFormSchema } from './client.data'

View File

@ -6,7 +6,7 @@
<TableAction
:actions="[
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: '强退',
popConfirm: {
@ -24,6 +24,7 @@
</template>
<script lang="ts" setup name="Token">
import { useI18n } from '@/hooks/web/useI18n'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteAccessTokenApi, getAccessTokenPageApi } from '@/api/system/oauth2/token'
import { columns, searchFormSchema } from './token.data'

View File

@ -2,17 +2,18 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
<a-button type="warning" :preIcon="IconEnum.EXPORT" @click="handleExport"> {{ t('action.export') }} </a-button>
</template>
</BasicTable>
</div>
</template>
<script lang="ts" setup name="OperateLog">
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable } from '@/components/Table'
import { OperateLogPageReqVO, exportOperateLogApi, getOperateLogPageApi } from '@/api/system/operatelog'
import { columns, searchFormSchema } from './operateLog.data'
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
const { t } = useI18n()
const { createConfirm, createMessage } = useMessage()

View File

@ -2,16 +2,16 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" :preIcon="IconEnum.EXPORT" @click="handleExport"> {{ t('action.export') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -33,6 +33,7 @@ import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import PostModal from './PostModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { PostExportReqVO, deletePostApi, exportPostApi, getPostPageApi } from '@/api/system/post'
import { columns, searchFormSchema } from './post.data'

View File

@ -2,18 +2,18 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" :preIcon="IconEnum.EXPORT" @click="handleExport"> {{ t('action.export') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) }]"
:actions="[{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) }]"
:dropDownActions="[
{ icon: 'clarity:note-edit-line', label: '菜单权限', onClick: handleEdit.bind(null, record) },
{ icon: 'clarity:note-edit-line', label: '数据权限', onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: '菜单权限', onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: '数据权限', onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -35,6 +35,7 @@ import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import RoleModal from './RoleModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { RoleExportReqVO, deleteRoleApi, exportRoleApi, getRolePageApi } from '@/api/system/role'
import { columns, searchFormSchema } from './role.data'

View File

@ -2,16 +2,16 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" :preIcon="IconEnum.EXPORT" @click="handleExport"> {{ t('action.export') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -37,6 +37,7 @@ import {
getSensitiveWordPageApi
} from '@/api/system/sensitiveWord'
import { useModal } from '@/components/Modal'
import { IconEnum } from '@/enums/appEnum'
import SensitiveWordModal from './SensitiveWordModal.vue'
import { columns, searchFormSchema } from './sensitiveWord.data'
import { useI18n } from '@/hooks/web/useI18n'

View File

@ -2,15 +2,15 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -32,6 +32,7 @@ import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import SmsChannelModal from './SmsChannelModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteSmsChannelApi, getSmsChannelPageApi } from '@/api/system/sms/smsChannel'
import { columns, searchFormSchema } from './smsChannel.data'

View File

@ -2,17 +2,17 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" :preIcon="IconEnum.EXPORT" @click="handleExport"> {{ t('action.export') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.test'), onClick: handleSendSms.bind(null, record) },
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.TEST, label: t('action.test'), onClick: handleSendSms.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -33,6 +33,7 @@
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { SmsTemplateExportReqVO, deleteSmsTemplateApi, exportSmsTemplateApi, getSmsTemplatePageApi } from '@/api/system/sms/smsTemplate'
import { useModal } from '@/components/Modal'
import { IconEnum } from '@/enums/appEnum'
import SmsTemplateModal from './SmsTemplateModal.vue'
import { columns, searchFormSchema } from './smsTemplate.data'
import { useI18n } from '@/hooks/web/useI18n'
@ -53,7 +54,7 @@ const [registerTable, { getForm, reload }] = useTable({
showTableSetting: true,
showIndexColumn: false,
actionColumn: {
width: 180,
width: 240,
title: t('common.action'),
dataIndex: 'action',
fixed: 'right'

View File

@ -2,16 +2,16 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" :preIcon="IconEnum.EXPORT" @click="handleExport"> {{ t('action.export') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -33,6 +33,7 @@ import { BasicTable, useTable, TableAction } from '@/components/Table'
import { TenantExportReqVO, deleteTenantApi, exportTenantApi, getTenantPageApi } from '@/api/system/tenant'
import { useModal } from '@/components/Modal'
import TenantModal from './TenantModal.vue'
import { IconEnum } from '@/enums/appEnum'
import { columns, searchFormSchema } from './tenant.data'
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'

View File

@ -2,15 +2,15 @@
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -31,6 +31,7 @@
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import { IconEnum } from '@/enums/appEnum'
import TenantPackageModal from './TenantPackageModal.vue'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteTenantPackageApi, getTenantPackagePageApi } from '@/api/system/tenantPackage'

View File

@ -3,16 +3,16 @@
<DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
<BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
<template #toolbar>
<a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
<a-button type="primary" :preIcon="IconEnum.ADD" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" :preIcon="IconEnum.EXPORT" @click="handleExport"> {{ t('action.export') }} </a-button>
</template>
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'">
<TableAction
:actions="[
{ icon: 'clarity:note-edit-line', label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{ icon: IconEnum.EDIT, label: t('action.edit'), onClick: handleEdit.bind(null, record) },
{
icon: 'ant-design:delete-outlined',
icon: IconEnum.DELETE,
color: 'error',
label: t('action.delete'),
popConfirm: {
@ -36,6 +36,7 @@ import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import UserModal from './UserModal.vue'
import DeptTree from './DeptTree.vue'
import { IconEnum } from '@/enums/appEnum'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { columns, searchFormSchema } from './user.data'
import { UserExportReqVO, deleteUserApi, exportUserApi, getUserPageApi } from '@/api/system/user'