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刷新 未完成
- router 增加基础首页 未完成
- 系统管理 页面适配 进行中
- 基础设施 页面适配 进行中
- 系统管理 页面适配 80%
- 基础设施 页面适配 30%
- 支付管理 页面适配 未完成
- 工作流 页面适配 未完成

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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