feat: i18n

pull/1/MERGE
xingyuv 2023-03-22 11:33:11 +08:00
parent a917f52f4f
commit 60d43c077c
26 changed files with 233 additions and 224 deletions

View File

@ -20,9 +20,8 @@
## 开发进度 ## 开发进度
- axios token刷新 未完成 - axios token刷新 未完成
- router 增加基础首页 未完成 - 系统管理 页面适配 80%
- 系统管理 页面适配 进行中 - 基础设施 页面适配 30%
- 基础设施 页面适配 进行中
- 支付管理 页面适配 未完成 - 支付管理 页面适配 未完成
- 工作流 页面适配 未完成 - 工作流 页面适配 未完成

View File

@ -1,6 +1,9 @@
export default { export default {
create: 'Create', create: 'Create',
edit: 'Edit', edit: 'Edit',
test: 'Test',
delete: 'Delete', delete: 'Delete',
detail: 'Detail' detail: 'Detail',
export: 'Export',
import: 'Import'
} }

View File

@ -7,7 +7,10 @@ export default {
loadingText: 'Loading...', loadingText: 'Loading...',
saveText: 'Save', saveText: 'Save',
delText: 'Delete', delText: 'Delete',
delMessage: 'Do you want to delete data?',
delSuccessText: 'Delete success', delSuccessText: 'Delete success',
exportTitle: 'Export',
exportMessage: 'Do you want to export data?',
exportSuccessText: 'Export success', exportSuccessText: 'Export success',
resetText: 'Reset', resetText: 'Reset',
searchText: 'Search', searchText: 'Search',

View File

@ -1,6 +1,9 @@
export default { export default {
create: '新增', create: '新增',
edit: '修改', edit: '修改',
test: '测试',
delete: '删除', delete: '删除',
detail: '详情' detail: '详情',
export: '导出',
import: '导入'
} }

View File

@ -7,7 +7,10 @@ export default {
loadingText: '加载中...', loadingText: '加载中...',
saveText: '保存', saveText: '保存',
delText: '删除', delText: '删除',
delMessage: '是否要删除数据?',
delSuccessText: '删除成功', delSuccessText: '删除成功',
exportTitle: '导出',
exportMessage: '是否要导出数据?',
exportSuccessText: '导出成功', exportSuccessText: '导出成功',
resetText: '重置', resetText: '重置',
searchText: '搜索', searchText: '搜索',

View File

@ -2,9 +2,9 @@
<div> <div>
<BasicTable @register="register" @fetch-success="onFetchSuccess"> <BasicTable @register="register" @fetch-success="onFetchSuccess">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="info" @click="expandAll"></a-button> <a-button type="info" @click="expandAll">{{ t('component.tree.expandAll') }}</a-button>
<a-button type="info" @click="collapseAll"></a-button> <a-button type="info" @click="collapseAll">{{ t('component.tree.unExpandAll') }}</a-button>
</template> </template>
<template #leader="{ text }"> <template #leader="{ text }">
<span> {{ userNicknameFormat(text) }} </span> <span> {{ userNicknameFormat(text) }} </span>
@ -15,13 +15,15 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -35,18 +37,19 @@
</div> </div>
</template> </template>
<script lang="ts" setup name="Dept"> <script lang="ts" setup name="Dept">
import { BasicTable, useTable, TableAction } from '@/components/Table' import { nextTick, ref, onMounted } from 'vue'
import { deleteDeptApi, getDeptPageApi } from '@/api/system/dept' import { handleTree } from '@/utils/tree'
import { columns, searchFormSchema } from './dept.data' import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal' import { useModal } from '@/components/Modal'
import DeptModel from './DeptModel.vue' import DeptModel from './DeptModel.vue'
import { useMessage } from '@/hooks/web/useMessage' import { BasicTable, useTable, TableAction } from '@/components/Table'
import { handleTree } from '@/utils/tree'
import { nextTick, ref } from 'vue'
import { getListSimpleUsersApi } from '@/api/system/user' import { getListSimpleUsersApi } from '@/api/system/user'
import { onMounted } from 'vue' import { deleteDeptApi, getDeptPageApi } from '@/api/system/dept'
import { columns, searchFormSchema } from './dept.data'
const { createConfirm, createMessage } = useMessage() const { t } = useI18n()
const { createMessage } = useMessage()
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
const [register, { expandAll, collapseAll, getForm, reload }] = useTable({ const [register, { expandAll, collapseAll, getForm, reload }] = useTable({
@ -67,8 +70,8 @@ const [register, { expandAll, collapseAll, getForm, reload }] = useTable({
showIndexColumn: false, showIndexColumn: false,
canResize: false, canResize: false,
actionColumn: { actionColumn: {
width: 120, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -87,7 +90,6 @@ async function getUserList() {
} }
function userNicknameFormat(row) { function userNicknameFormat(row) {
console.info(row)
if (!row.leaderUserId) { if (!row.leaderUserId) {
return '未设置' return '未设置'
} }
@ -113,20 +115,12 @@ function handleEdit(record: Recordable) {
} }
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
createConfirm({
title: '删除',
iconType: 'warning',
content: '是否要删除数据?',
async onOk() {
await deleteDeptApi(record.id) await deleteDeptApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
})
}
function onFetchSuccess() { function onFetchSuccess() {
//
nextTick(expandAll) nextTick(expandAll)
} }

View File

@ -2,7 +2,7 @@
<div> <div>
<BasicTable @register="registerTable" :searchInfo="searchInfo"> <BasicTable @register="registerTable" :searchInfo="searchInfo">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"></a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }}</a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -10,15 +10,15 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
tooltip: '编辑字典数据', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
tooltip: '删除字典数据', label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -33,12 +33,13 @@
</template> </template>
<script lang="ts" setup name="DictData"> <script lang="ts" setup name="DictData">
import { watch } from 'vue' import { watch } from 'vue'
import { BasicTable, useTable, TableAction } from '@/components/Table' import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal' import { useModal } from '@/components/Modal'
import DictDataModel from './DictDataModel.vue' import DictDataModel from './DictDataModel.vue'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { dataColumns, dataSearchFormSchema } from './dict.data' import { dataColumns, dataSearchFormSchema } from './dict.data'
import { deleteDictDataApi, getDictDataPageApi } from '@/api/system/dict/data' import { deleteDictDataApi, getDictDataPageApi } from '@/api/system/dict/data'
import { useMessage } from '@/hooks/web/useMessage'
const props = defineProps({ const props = defineProps({
searchInfo: { searchInfo: {
@ -47,9 +48,9 @@ const props = defineProps({
} }
}) })
const { createConfirm, createMessage } = useMessage() const { t } = useI18n()
const { createMessage } = useMessage()
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
// const searchInfo = reactive<Recordable>({})
const [registerTable, { reload }] = useTable({ const [registerTable, { reload }] = useTable({
title: '字典数据列表', title: '字典数据列表',
@ -64,8 +65,8 @@ const [registerTable, { reload }] = useTable({
showTableSetting: true, showTableSetting: true,
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 120, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -85,18 +86,11 @@ function handleEdit(record: Recordable) {
}) })
} }
function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
createConfirm({
title: '删除',
iconType: 'warning',
content: '是否要删除数据?',
async onOk() {
await deleteDictDataApi(record.id) await deleteDictDataApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
})
}
watch( watch(
() => props.searchInfo, () => props.searchInfo,

View File

@ -2,7 +2,7 @@
<div class="flex"> <div class="flex">
<BasicTable @register="registerTable" class="w-1/2 xl:w-1/2" @row-click="handleRowClick"> <BasicTable @register="registerTable" class="w-1/2 xl:w-1/2" @row-click="handleRowClick">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"></a-button> <a-button type="primary" @click="handleCreate">{{ t('action.create') }}</a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -10,15 +10,15 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
tooltip: '编辑字典分类', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
tooltip: '删除字典分类', label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -34,15 +34,17 @@
</template> </template>
<script lang="ts" setup name="Dict"> <script lang="ts" setup name="Dict">
import { reactive } from 'vue' import { reactive } from 'vue'
import { BasicTable, useTable, TableAction } from '@/components/Table' import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal' import { useModal } from '@/components/Modal'
import DictData from './DictData.vue' import DictData from './DictData.vue'
import DictTypeModel from './DictTypeModel.vue' import DictTypeModel from './DictTypeModel.vue'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { typeColumns, typeSearchFormSchema } from './dict.type' import { typeColumns, typeSearchFormSchema } from './dict.type'
import { deleteDictTypeApi, getDictTypePageApi } from '@/api/system/dict/type' import { deleteDictTypeApi, getDictTypePageApi } from '@/api/system/dict/type'
import { useMessage } from '@/hooks/web/useMessage'
const { createConfirm, createMessage } = useMessage() const { t } = useI18n()
const { createMessage } = useMessage()
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
const searchInfo = reactive<Recordable>({}) const searchInfo = reactive<Recordable>({})
@ -58,8 +60,8 @@ const [registerTable, { reload }] = useTable({
showTableSetting: true, showTableSetting: true,
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 120, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -84,15 +86,8 @@ function handleEdit(record: Recordable) {
} }
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
createConfirm({
title: '删除',
iconType: 'warning',
content: '是否要删除数据?',
async onOk() {
await deleteDictTypeApi(record.id) await deleteDictTypeApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
})
}
</script> </script>

View File

@ -2,8 +2,8 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" @click="handleExport"> </a-button> <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -11,15 +11,15 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: '修改', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
label: '删除', label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -33,13 +33,13 @@
</div> </div>
</template> </template>
<script lang="ts" setup name="ErrorCode"> <script lang="ts" setup name="ErrorCode">
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { ErrorCodePageReqVO, deleteErrorCodeApi, excelErrorCodeApi, getErrorCodePageApi } from '@/api/system/errorCode'
import { useModal } from '@/components/Modal'
import ErrorCodeModel from './ErrorCodeModel.vue'
import { columns, searchFormSchema } from './errorCode.data'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage' import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import ErrorCodeModel from './ErrorCodeModel.vue'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { ErrorCodePageReqVO, deleteErrorCodeApi, excelErrorCodeApi, getErrorCodePageApi } from '@/api/system/errorCode'
import { columns, searchFormSchema } from './errorCode.data'
const { t } = useI18n() const { t } = useI18n()
const { createConfirm, createMessage } = useMessage() const { createConfirm, createMessage } = useMessage()
@ -57,7 +57,7 @@ const [registerTable, { getForm, reload }] = useTable({
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 160, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -78,9 +78,9 @@ function handleEdit(record: Recordable) {
async function handleExport() { async function handleExport() {
createConfirm({ createConfirm({
title: '导出', title: t('common.exportTitle'),
iconType: 'warning', iconType: 'warning',
content: '是否要导出数据?', content: t('common.exportMessage'),
async onOk() { async onOk() {
await excelErrorCodeApi(getForm().getFieldsValue() as ErrorCodePageReqVO) await excelErrorCodeApi(getForm().getFieldsValue() as ErrorCodePageReqVO)
createMessage.success(t('common.exportSuccessText')) createMessage.success(t('common.exportSuccessText'))
@ -90,7 +90,7 @@ async function handleExport() {
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deleteErrorCodeApi(record.id) await deleteErrorCodeApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
</script> </script>

View File

@ -2,17 +2,17 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="warning" @click="handleExport"> </a-button> <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
</template> </template>
</BasicTable> </BasicTable>
</div> </div>
</template> </template>
<script lang="ts" setup name="LoginLog"> <script lang="ts" setup name="LoginLog">
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { BasicTable, useTable } from '@/components/Table' import { BasicTable, useTable } from '@/components/Table'
import { LoginLogReqVO, exportLoginLogApi, getLoginLogPageApi } from '@/api/system/loginLog' import { LoginLogReqVO, exportLoginLogApi, getLoginLogPageApi } from '@/api/system/loginLog'
import { columns, searchFormSchema } from './loginLog.data' import { columns, searchFormSchema } from './loginLog.data'
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
const { t } = useI18n() const { t } = useI18n()
const { createConfirm, createMessage } = useMessage() const { createConfirm, createMessage } = useMessage()
@ -31,9 +31,9 @@ const [registerTable, { getForm }] = useTable({
async function handleExport() { async function handleExport() {
createConfirm({ createConfirm({
title: '导出', title: t('common.exportTitle'),
iconType: 'warning', iconType: 'warning',
content: '是否要导出数据?', content: t('common.exportMessage'),
async onOk() { async onOk() {
await exportLoginLogApi(getForm().getFieldsValue() as LoginLogReqVO) await exportLoginLogApi(getForm().getFieldsValue() as LoginLogReqVO)
createMessage.success(t('common.exportSuccessText')) createMessage.success(t('common.exportSuccessText'))

View File

@ -2,7 +2,7 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -10,15 +10,15 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: '修改', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
label: '删除', label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -32,13 +32,15 @@
</div> </div>
</template> </template>
<script lang="ts" setup name="MailAccount"> <script lang="ts" setup name="MailAccount">
import { BasicTable, useTable, TableAction } from '@/components/Table' import { useI18n } from '@/hooks/web/useI18n'
import { deleteMailAccountApi, getMailAccountPageApi } from '@/api/system/mail/account' import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal' import { useModal } from '@/components/Modal'
import AccountModel from './AccountModel.vue' import AccountModel from './AccountModel.vue'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteMailAccountApi, getMailAccountPageApi } from '@/api/system/mail/account'
import { columns, searchFormSchema } from './account.data' import { columns, searchFormSchema } from './account.data'
import { useMessage } from '@/hooks/web/useMessage'
const { t } = useI18n()
const { createMessage } = useMessage() const { createMessage } = useMessage()
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
const [registerTable, { reload }] = useTable({ const [registerTable, { reload }] = useTable({
@ -54,7 +56,7 @@ const [registerTable, { reload }] = useTable({
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 160, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -75,7 +77,7 @@ function handleEdit(record: Recordable) {
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deleteMailAccountApi(record.id) await deleteMailAccountApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
</script> </script>

View File

@ -2,7 +2,7 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -10,15 +10,15 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: '修改', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
label: '删除', label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -32,13 +32,15 @@
</div> </div>
</template> </template>
<script lang="ts" setup name="MailTemplate"> <script lang="ts" setup name="MailTemplate">
import { BasicTable, useTable, TableAction } from '@/components/Table' import { useI18n } from '@/hooks/web/useI18n'
import { deleteMailTemplateApi, getMailTemplatePageApi } from '@/api/system/mail/template' import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal' import { useModal } from '@/components/Modal'
import TemplateModel from './TemplateModel.vue' import TemplateModel from './TemplateModel.vue'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteMailTemplateApi, getMailTemplatePageApi } from '@/api/system/mail/template'
import { columns, searchFormSchema } from './template.data' import { columns, searchFormSchema } from './template.data'
import { useMessage } from '@/hooks/web/useMessage'
const { t } = useI18n()
const { createMessage } = useMessage() const { createMessage } = useMessage()
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
const [registerTable, { reload }] = useTable({ const [registerTable, { reload }] = useTable({
@ -54,7 +56,7 @@ const [registerTable, { reload }] = useTable({
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 160, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -75,7 +77,7 @@ function handleEdit(record: Recordable) {
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deleteMailTemplateApi(record.id) await deleteMailTemplateApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
</script> </script>

View File

@ -2,9 +2,9 @@
<div> <div>
<BasicTable @register="register"> <BasicTable @register="register">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="info" @click="expandAll"></a-button> <a-button type="info" @click="expandAll">{{ t('component.tree.expandAll') }}</a-button>
<a-button type="info" @click="collapseAll"></a-button> <a-button type="info" @click="collapseAll">{{ t('component.tree.unExpandAll') }}</a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -12,15 +12,15 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: '修改', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
label: '删除', label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -34,14 +34,16 @@
</div> </div>
</template> </template>
<script lang="ts" setup name="Menu"> <script lang="ts" setup name="Menu">
import { handleTree } from '@/utils/tree'
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import DeptModel from './MenuModel.vue'
import { BasicTable, useTable, TableAction } from '@/components/Table' import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteMenuApi, getMenuListApi } from '@/api/system/menu' import { deleteMenuApi, getMenuListApi } from '@/api/system/menu'
import { columns, searchFormSchema } from './menu.data' import { columns, searchFormSchema } from './menu.data'
import { useModal } from '@/components/Modal'
import DeptModel from './MenuModel.vue'
import { useMessage } from '@/hooks/web/useMessage'
import { handleTree } from '@/utils/tree'
const { t } = useI18n()
const { createMessage } = useMessage() const { createMessage } = useMessage()
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
@ -64,7 +66,7 @@ const [register, { expandAll, collapseAll, getForm, reload }] = useTable({
canResize: false, canResize: false,
actionColumn: { actionColumn: {
width: 160, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -89,7 +91,7 @@ function handleEdit(record: Recordable) {
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deleteMenuApi(record.id) await deleteMenuApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
</script> </script>

View File

@ -2,7 +2,7 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -10,15 +10,15 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: '修改', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
label: '删除', label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -32,13 +32,15 @@
</div> </div>
</template> </template>
<script lang="ts" setup name="Notice"> <script lang="ts" setup name="Notice">
import { BasicTable, useTable, TableAction } from '@/components/Table' import { useI18n } from '@/hooks/web/useI18n'
import { deleteNoticeApi, getNoticePageApi } from '@/api/system/notice' import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal' import { useModal } from '@/components/Modal'
import NoticeModal from './NoticeModel.vue' import NoticeModal from './NoticeModel.vue'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteNoticeApi, getNoticePageApi } from '@/api/system/notice'
import { columns, searchFormSchema } from './notice.data' import { columns, searchFormSchema } from './notice.data'
import { useMessage } from '@/hooks/web/useMessage'
const { t } = useI18n()
const { createMessage } = useMessage() const { createMessage } = useMessage()
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
const [registerTable, { reload }] = useTable({ const [registerTable, { reload }] = useTable({
@ -54,7 +56,7 @@ const [registerTable, { reload }] = useTable({
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 160, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -75,7 +77,7 @@ function handleEdit(record: Recordable) {
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deleteNoticeApi(record.id) await deleteNoticeApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
</script> </script>

View File

@ -2,7 +2,7 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -10,15 +10,15 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: '修改', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
label: '删除', label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -32,13 +32,15 @@
</div> </div>
</template> </template>
<script lang="ts" setup name="Client"> <script lang="ts" setup name="Client">
import { BasicTable, useTable, TableAction } from '@/components/Table' import { useI18n } from '@/hooks/web/useI18n'
import { deleteOAuth2ClientApi, getOAuth2ClientPageApi } from '@/api/system/oauth2/client' import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal' import { useModal } from '@/components/Modal'
import ClientModel from './ClientModel.vue' import ClientModel from './ClientModel.vue'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteOAuth2ClientApi, getOAuth2ClientPageApi } from '@/api/system/oauth2/client'
import { columns, searchFormSchema } from './client.data' import { columns, searchFormSchema } from './client.data'
import { useMessage } from '@/hooks/web/useMessage'
const { t } = useI18n()
const { createMessage } = useMessage() const { createMessage } = useMessage()
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
const [registerTable, { reload }] = useTable({ const [registerTable, { reload }] = useTable({
@ -54,7 +56,7 @@ const [registerTable, { reload }] = useTable({
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 160, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -75,7 +77,7 @@ function handleEdit(record: Recordable) {
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deleteOAuth2ClientApi(record.id) await deleteOAuth2ClientApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
</script> </script>

View File

@ -23,11 +23,13 @@
</div> </div>
</template> </template>
<script lang="ts" setup name="Token"> <script lang="ts" setup name="Token">
import { useI18n } from '@/hooks/web/useI18n'
import { BasicTable, useTable, TableAction } from '@/components/Table' import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteAccessTokenApi, getAccessTokenPageApi } from '@/api/system/oauth2/token' import { deleteAccessTokenApi, getAccessTokenPageApi } from '@/api/system/oauth2/token'
import { columns, searchFormSchema } from './token.data' import { columns, searchFormSchema } from './token.data'
import { useMessage } from '@/hooks/web/useMessage' import { useMessage } from '@/hooks/web/useMessage'
const { t } = useI18n()
const { createMessage } = useMessage() const { createMessage } = useMessage()
const [registerTable, { reload }] = useTable({ const [registerTable, { reload }] = useTable({
title: 'Token列表', title: 'Token列表',
@ -42,7 +44,7 @@ const [registerTable, { reload }] = useTable({
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 100, width: 100,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -50,7 +52,7 @@ const [registerTable, { reload }] = useTable({
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deleteAccessTokenApi(record.id) await deleteAccessTokenApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
</script> </script>

View File

@ -2,7 +2,7 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="warning" @click="handleExport"> </a-button> <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
</template> </template>
</BasicTable> </BasicTable>
</div> </div>
@ -31,9 +31,9 @@ const [registerTable, { getForm }] = useTable({
async function handleExport() { async function handleExport() {
createConfirm({ createConfirm({
title: '导出', title: t('common.exportTitle'),
iconType: 'warning', iconType: 'warning',
content: '是否要导出数据?', content: t('common.exportMessage'),
async onOk() { async onOk() {
await exportOperateLogApi(getForm().getFieldsValue() as OperateLogPageReqVO) await exportOperateLogApi(getForm().getFieldsValue() as OperateLogPageReqVO)
createMessage.success(t('common.exportSuccessText')) createMessage.success(t('common.exportSuccessText'))

View File

@ -2,8 +2,8 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" @click="handleExport"> </a-button> <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -11,15 +11,15 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: '修改', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
label: '删除', label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -33,17 +33,18 @@
</div> </div>
</template> </template>
<script lang="ts" setup name="Post"> <script lang="ts" setup name="Post">
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { PostExportReqVO, deletePostApi, exportPostApi, getPostPageApi } from '@/api/system/post'
import { useModal } from '@/components/Modal'
import PostModel from './PostModel.vue'
import { columns, searchFormSchema } from './post.data'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage' import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import PostModel from './PostModel.vue'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { PostExportReqVO, deletePostApi, exportPostApi, getPostPageApi } from '@/api/system/post'
import { columns, searchFormSchema } from './post.data'
const { t } = useI18n() const { t } = useI18n()
const { createConfirm, createMessage } = useMessage() const { createConfirm, createMessage } = useMessage()
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
const [registerTable, { getForm, reload }] = useTable({ const [registerTable, { getForm, reload }] = useTable({
title: '岗位列表', title: '岗位列表',
api: getPostPageApi, api: getPostPageApi,
@ -57,7 +58,7 @@ const [registerTable, { getForm, reload }] = useTable({
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 160, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -78,9 +79,9 @@ function handleEdit(record: Recordable) {
async function handleExport() { async function handleExport() {
createConfirm({ createConfirm({
title: '导出', title: t('common.exportTitle'),
iconType: 'warning', iconType: 'warning',
content: '是否要导出数据?', content: t('common.exportMessage'),
async onOk() { async onOk() {
await exportPostApi(getForm().getFieldsValue() as PostExportReqVO) await exportPostApi(getForm().getFieldsValue() as PostExportReqVO)
createMessage.success(t('common.exportSuccessText')) createMessage.success(t('common.exportSuccessText'))
@ -90,7 +91,7 @@ async function handleExport() {
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deletePostApi(record.id) await deletePostApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
</script> </script>

View File

@ -2,8 +2,8 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" @click="handleExport"> </a-button> <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -11,7 +11,7 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: '修改', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
} }
]" ]"
@ -28,10 +28,10 @@
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
label: '删除',
color: 'error', color: 'error',
label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -45,13 +45,13 @@
</div> </div>
</template> </template>
<script lang="ts" setup name="Role"> <script lang="ts" setup name="Role">
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { RoleExportReqVO, deleteRoleApi, exportRoleApi, getRolePageApi } from '@/api/system/role'
import { useModal } from '@/components/Modal'
import RoleModel from './RoleModel.vue'
import { columns, searchFormSchema } from './role.data'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage' import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal'
import RoleModel from './RoleModel.vue'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { RoleExportReqVO, deleteRoleApi, exportRoleApi, getRolePageApi } from '@/api/system/role'
import { columns, searchFormSchema } from './role.data'
const { t } = useI18n() const { t } = useI18n()
const { createConfirm, createMessage } = useMessage() const { createConfirm, createMessage } = useMessage()
@ -69,7 +69,7 @@ const [registerTable, { getForm, reload }] = useTable({
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 160, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -90,9 +90,9 @@ function handleEdit(record: Recordable) {
async function handleExport() { async function handleExport() {
createConfirm({ createConfirm({
title: '导出', title: t('common.exportTitle'),
iconType: 'warning', iconType: 'warning',
content: '是否要导出数据?', content: t('common.exportMessage'),
async onOk() { async onOk() {
await exportRoleApi(getForm().getFieldsValue() as RoleExportReqVO) await exportRoleApi(getForm().getFieldsValue() as RoleExportReqVO)
createMessage.success(t('common.exportSuccessText')) createMessage.success(t('common.exportSuccessText'))
@ -102,7 +102,7 @@ async function handleExport() {
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deleteRoleApi(record.id) await deleteRoleApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
</script> </script>

View File

@ -2,8 +2,8 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" @click="handleExport"> </a-button> <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -11,15 +11,15 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: '修改', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
label: '删除', label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -62,7 +62,7 @@ const [registerTable, { getForm, reload }] = useTable({
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 160, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -83,9 +83,9 @@ function handleEdit(record: Recordable) {
async function handleExport() { async function handleExport() {
createConfirm({ createConfirm({
title: '导出', title: t('common.exportTitle'),
iconType: 'warning', iconType: 'warning',
content: '是否要导出数据?', content: t('common.exportMessage'),
async onOk() { async onOk() {
await exportSensitiveWordApi(getForm().getFieldsValue() as SensitiveWordExportReqVO) await exportSensitiveWordApi(getForm().getFieldsValue() as SensitiveWordExportReqVO)
createMessage.success(t('common.exportSuccessText')) createMessage.success(t('common.exportSuccessText'))
@ -95,7 +95,7 @@ async function handleExport() {
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deleteSensitiveWordApi(record.id) await deleteSensitiveWordApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
</script> </script>

View File

@ -38,7 +38,7 @@ const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data
} }
}) })
const getTitle = computed(() => (!unref(isUpdate) ? '新增岗位' : '编辑岗位')) const getTitle = computed(() => (!unref(isUpdate) ? '新增短信模版' : '编辑短信模版'))
async function handleSubmit() { async function handleSubmit() {
try { try {

View File

@ -2,7 +2,7 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="warning" @click="handleExport"> </a-button> <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
</template> </template>
</BasicTable> </BasicTable>
</div> </div>
@ -31,9 +31,9 @@ const [registerTable, { getForm }] = useTable({
async function handleExport() { async function handleExport() {
createConfirm({ createConfirm({
title: '导出', title: t('common.exportTitle'),
iconType: 'warning', iconType: 'warning',
content: '是否要导出数据?', content: t('common.exportMessage'),
async onOk() { async onOk() {
await exportSmsLogApi(getForm().getFieldsValue() as SmsLogExportReqVO) await exportSmsLogApi(getForm().getFieldsValue() as SmsLogExportReqVO)
createMessage.success(t('common.exportSuccessText')) createMessage.success(t('common.exportSuccessText'))

View File

@ -2,8 +2,8 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" @click="handleExport"> </a-button> <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -11,20 +11,20 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: '测试', label: t('action.test'),
onClick: handleSendSms.bind(null, record) onClick: handleSendSms.bind(null, record)
}, },
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: '修改', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
label: '删除', label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -62,7 +62,7 @@ const [registerTable, { getForm, reload }] = useTable({
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 240, width: 240,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -87,9 +87,9 @@ function handleEdit(record: Recordable) {
async function handleExport() { async function handleExport() {
createConfirm({ createConfirm({
title: '导出', title: t('common.exportTitle'),
iconType: 'warning', iconType: 'warning',
content: '是否要导出数据?', content: t('common.exportMessage'),
async onOk() { async onOk() {
await exportSmsTemplateApi(getForm().getFieldsValue() as SmsTemplateExportReqVO) await exportSmsTemplateApi(getForm().getFieldsValue() as SmsTemplateExportReqVO)
createMessage.success(t('common.exportSuccessText')) createMessage.success(t('common.exportSuccessText'))
@ -99,7 +99,7 @@ async function handleExport() {
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deleteSmsTemplateApi(record.id) await deleteSmsTemplateApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
</script> </script>

View File

@ -2,8 +2,8 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" @click="handleExport"> </a-button> <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -11,15 +11,15 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: '修改', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
label: '删除', label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -57,7 +57,7 @@ const [registerTable, { getForm, reload }] = useTable({
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 160, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -78,9 +78,9 @@ function handleEdit(record: Recordable) {
async function handleExport() { async function handleExport() {
createConfirm({ createConfirm({
title: '导出', title: t('common.exportTitle'),
iconType: 'warning', iconType: 'warning',
content: '是否要导出数据?', content: t('common.exportMessage'),
async onOk() { async onOk() {
await exportTenantApi(getForm().getFieldsValue() as TenantExportReqVO) await exportTenantApi(getForm().getFieldsValue() as TenantExportReqVO)
createMessage.success(t('common.exportSuccessText')) createMessage.success(t('common.exportSuccessText'))
@ -90,7 +90,7 @@ async function handleExport() {
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deleteTenantApi(record.id) await deleteTenantApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
</script> </script>

View File

@ -2,7 +2,7 @@
<div> <div>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"> </a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -10,15 +10,15 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: '修改', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
label: '删除', label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -32,13 +32,15 @@
</div> </div>
</template> </template>
<script lang="ts" setup name="TenantPackage"> <script lang="ts" setup name="TenantPackage">
import { BasicTable, useTable, TableAction } from '@/components/Table' import { useI18n } from '@/hooks/web/useI18n'
import { deleteTenantPackageApi, getTenantPackagePageApi } from '@/api/system/tenantPackage' import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal' import { useModal } from '@/components/Modal'
import TenantPackageModel from './TenantPackageModel.vue' import TenantPackageModel from './TenantPackageModel.vue'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { deleteTenantPackageApi, getTenantPackagePageApi } from '@/api/system/tenantPackage'
import { columns, searchFormSchema } from './tenantPackage.data' import { columns, searchFormSchema } from './tenantPackage.data'
import { useMessage } from '@/hooks/web/useMessage'
const { t } = useI18n()
const { createMessage } = useMessage() const { createMessage } = useMessage()
const [registerModal, { openModal }] = useModal() const [registerModal, { openModal }] = useModal()
const [registerTable, { reload }] = useTable({ const [registerTable, { reload }] = useTable({
@ -54,7 +56,7 @@ const [registerTable, { reload }] = useTable({
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 160, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -75,7 +77,7 @@ function handleEdit(record: Recordable) {
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deleteTenantPackageApi(record.id) await deleteTenantPackageApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }
</script> </script>

View File

@ -3,8 +3,8 @@
<DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" /> <DeptTree class="w-1/4 xl:w-1/5" @select="handleSelect" />
<BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo"> <BasicTable @register="registerTable" class="w-3/4 xl:w-4/5" :searchInfo="searchInfo">
<template #toolbar> <template #toolbar>
<a-button type="primary" @click="handleCreate"></a-button> <a-button type="primary" @click="handleCreate"> {{ t('action.create') }} </a-button>
<a-button type="warning" @click="handleExport"> </a-button> <a-button type="warning" @click="handleExport"> {{ t('action.export') }} </a-button>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -12,15 +12,15 @@
:actions="[ :actions="[
{ {
icon: 'clarity:note-edit-line', icon: 'clarity:note-edit-line',
label: '编辑', label: t('action.edit'),
onClick: handleEdit.bind(null, record) onClick: handleEdit.bind(null, record)
}, },
{ {
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
color: 'error', color: 'error',
label: '删除', label: t('action.delete'),
popConfirm: { popConfirm: {
title: '是否确认删除', title: t('common.delMessage'),
placement: 'left', placement: 'left',
confirm: handleDelete.bind(null, record) confirm: handleDelete.bind(null, record)
} }
@ -35,14 +35,14 @@
</template> </template>
<script lang="ts" setup name="User"> <script lang="ts" setup name="User">
import { reactive } from 'vue' import { reactive } from 'vue'
import { BasicTable, useTable, TableAction } from '@/components/Table' import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
import { useModal } from '@/components/Modal' import { useModal } from '@/components/Modal'
import UserModel from './UserModel.vue' import UserModel from './UserModel.vue'
import DeptTree from './DeptTree.vue' import DeptTree from './DeptTree.vue'
import { BasicTable, useTable, TableAction } from '@/components/Table'
import { columns, searchFormSchema } from './user.data' import { columns, searchFormSchema } from './user.data'
import { UserExportReqVO, deleteUserApi, exportUserApi, getUserPageApi } from '@/api/system/user' import { UserExportReqVO, deleteUserApi, exportUserApi, getUserPageApi } from '@/api/system/user'
import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage'
const { t } = useI18n() const { t } = useI18n()
const { createConfirm, createMessage } = useMessage() const { createConfirm, createMessage } = useMessage()
@ -63,7 +63,7 @@ const [registerTable, { getForm, reload }] = useTable({
showIndexColumn: false, showIndexColumn: false,
actionColumn: { actionColumn: {
width: 160, width: 160,
title: '操作', title: t('common.action'),
dataIndex: 'action', dataIndex: 'action',
fixed: 'right' fixed: 'right'
} }
@ -77,9 +77,9 @@ function handleCreate() {
async function handleExport() { async function handleExport() {
createConfirm({ createConfirm({
title: '导出', title: t('common.exportTitle'),
iconType: 'warning', iconType: 'warning',
content: '是否要导出数据?', content: t('common.exportMessage'),
async onOk() { async onOk() {
await exportUserApi(getForm().getFieldsValue() as UserExportReqVO) await exportUserApi(getForm().getFieldsValue() as UserExportReqVO)
createMessage.success(t('common.exportSuccessText')) createMessage.success(t('common.exportSuccessText'))
@ -96,7 +96,7 @@ function handleEdit(record: Recordable) {
async function handleDelete(record: Recordable) { async function handleDelete(record: Recordable) {
await deleteUserApi(record.id) await deleteUserApi(record.id)
createMessage.success('删除成功') createMessage.success(t('common.delSuccessText'))
reload() reload()
} }