refactor:基于 lint 处理排版
This commit is contained in:
@@ -28,7 +28,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns(): VxeTableGridOptions<SystemAreaApi.SystemArea>['columns'] {
|
||||
export function useGridColumns(): VxeTableGridOptions<SystemAreaApi.Area>['columns'] {
|
||||
return [
|
||||
{
|
||||
field: 'id',
|
||||
|
||||
@@ -3,7 +3,6 @@ import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { OnActionClickFn } from '#/adapter/vxe-table';
|
||||
import type { SystemDeptApi } from '#/api/system/dept';
|
||||
import type { SystemUserApi } from '#/api/system/user';
|
||||
|
||||
import { useAccess } from '@vben/access';
|
||||
|
||||
@@ -124,9 +123,9 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns(
|
||||
onActionClick?: OnActionClickFn<SystemDeptApi.SystemDept>,
|
||||
onActionClick?: OnActionClickFn<SystemDeptApi.Dept>,
|
||||
getLeaderName?: (userId: number) => string | undefined,
|
||||
): VxeTableGridOptions<SystemDeptApi.SystemDept>['columns'] {
|
||||
): VxeTableGridOptions<SystemDeptApi.Dept>['columns'] {
|
||||
return [
|
||||
{
|
||||
field: 'name',
|
||||
@@ -192,7 +191,7 @@ export function useGridColumns(
|
||||
{
|
||||
code: 'delete',
|
||||
show: hasAccessByCodes(['system:dept:delete']),
|
||||
disabled: (row: SystemDeptApi.SystemDept) => {
|
||||
disabled: (row: SystemDeptApi.Dept) => {
|
||||
return !!(row.children && row.children.length > 0);
|
||||
},
|
||||
},
|
||||
|
||||
@@ -26,7 +26,7 @@ const [FormModal, formModalApi] = useVbenModal({
|
||||
destroyOnClose: true,
|
||||
});
|
||||
|
||||
const userList = ref<SystemUserApi.SystemUser[]>([]);
|
||||
const userList = ref<SystemUserApi.User[]>([]);
|
||||
|
||||
/** 获取负责人名称 */
|
||||
const getLeaderName = (userId: number) => {
|
||||
@@ -51,17 +51,17 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 添加下级部门 */
|
||||
function onAppend(row: SystemDeptApi.SystemDept) {
|
||||
function onAppend(row: SystemDeptApi.Dept) {
|
||||
formModalApi.setData({ parentId: row.id }).open();
|
||||
}
|
||||
|
||||
/** 编辑部门 */
|
||||
function onEdit(row: SystemDeptApi.SystemDept) {
|
||||
function onEdit(row: SystemDeptApi.Dept) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除部门 */
|
||||
async function onDelete(row: SystemDeptApi.SystemDept) {
|
||||
async function onDelete(row: SystemDeptApi.Dept) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
@@ -80,10 +80,7 @@ async function onDelete(row: SystemDeptApi.SystemDept) {
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemDeptApi.SystemDept>) {
|
||||
function onActionClick({ code, row }: OnActionClickParams<SystemDeptApi.Dept>) {
|
||||
switch (code) {
|
||||
case 'append': {
|
||||
onAppend(row);
|
||||
|
||||
@@ -14,7 +14,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemDeptApi.SystemDept>();
|
||||
const formData = ref<SystemDeptApi.Dept>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['部门'])
|
||||
@@ -35,7 +35,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as SystemDeptApi.SystemDept;
|
||||
const data = (await formApi.getValues()) as SystemDeptApi.Dept;
|
||||
try {
|
||||
await (formData.value?.id ? updateDept(data) : createDept(data));
|
||||
// 关闭并提示
|
||||
@@ -54,7 +54,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
let data = modalApi.getData<SystemDeptApi.SystemDept>();
|
||||
let data = modalApi.getData<SystemDeptApi.Dept>();
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import { useDataFormSchema } from '../data';
|
||||
defineOptions({ name: 'SystemDictDataForm' });
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemDictDataApi.SystemDictData>();
|
||||
const formData = ref<SystemDictDataApi.DictData>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['字典数据'])
|
||||
@@ -41,8 +41,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data =
|
||||
(await formApi.getValues()) as SystemDictDataApi.SystemDictData;
|
||||
const data = (await formApi.getValues()) as SystemDictDataApi.DictData;
|
||||
try {
|
||||
await (formData.value?.id ? updateDictData(data) : createDictData(data));
|
||||
// 关闭并提示
|
||||
@@ -62,7 +61,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<
|
||||
SystemDictDataApi.SystemDictData | { dictType?: string }
|
||||
SystemDictDataApi.DictData | { dictType?: string }
|
||||
>();
|
||||
|
||||
// 如果有ID,表示是编辑
|
||||
|
||||
@@ -18,7 +18,7 @@ import { $t } from '#/locales';
|
||||
import { useTypeFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemDictTypeApi.SystemDictType>();
|
||||
const formData = ref<SystemDictTypeApi.DictType>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['字典类型'])
|
||||
@@ -39,8 +39,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data =
|
||||
(await formApi.getValues()) as SystemDictTypeApi.SystemDictType;
|
||||
const data = (await formApi.getValues()) as SystemDictTypeApi.DictType;
|
||||
try {
|
||||
await (formData.value?.id ? updateDictType(data) : createDictType(data));
|
||||
// 关闭并提示
|
||||
@@ -59,7 +58,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemDictTypeApi.SystemDictType>();
|
||||
const data = modalApi.getData<SystemDictTypeApi.DictType>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -48,14 +48,14 @@ function onEdit(row: any) {
|
||||
}
|
||||
|
||||
/** 删除字典类型 */
|
||||
async function onDelete(row: SystemDictTypeApi.SystemDictType) {
|
||||
async function onDelete(row: SystemDictTypeApi.DictType) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('common.processing'),
|
||||
duration: 0,
|
||||
key: 'process_message',
|
||||
});
|
||||
try {
|
||||
await deleteDictType(row.id);
|
||||
await deleteDictType(row.id as number);
|
||||
message.success({
|
||||
content: $t('common.operationSuccess'),
|
||||
key: 'process_message',
|
||||
@@ -81,6 +81,7 @@ function onActionClick({ code, row }: OnActionClickParams) {
|
||||
}
|
||||
|
||||
/** 表格事件 */
|
||||
// TODO @芋艿:这里有爆红
|
||||
const gridEvents: VxeGridListeners<RowType> = {
|
||||
cellClick: ({ row }) => {
|
||||
emit('select', row.type);
|
||||
|
||||
@@ -43,7 +43,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemLoginLogApi.SystemLoginLog>(
|
||||
export function useGridColumns<T = SystemLoginLogApi.LoginLog>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -36,7 +36,7 @@ async function onExport() {
|
||||
}
|
||||
|
||||
/** 查看登录日志详情 */
|
||||
function onDetail(row: SystemLoginLogApi.SystemLoginLog) {
|
||||
function onDetail(row: SystemLoginLogApi.LoginLog) {
|
||||
detailModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ function onDetail(row: SystemLoginLogApi.SystemLoginLog) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemLoginLogApi.SystemLoginLog>) {
|
||||
}: OnActionClickParams<SystemLoginLogApi.LoginLog>) {
|
||||
switch (code) {
|
||||
case 'detail': {
|
||||
onDetail(row);
|
||||
@@ -79,7 +79,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemLoginLogApi.SystemLoginLog>,
|
||||
} as VxeTableGridOptions<SystemLoginLogApi.LoginLog>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Descriptions } from 'ant-design-vue';
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { DICT_TYPE } from '#/utils/dict';
|
||||
|
||||
const formData = ref<SystemLoginLogApi.SystemLoginLog>();
|
||||
const formData = ref<SystemLoginLogApi.LoginLog>();
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
@@ -19,7 +19,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemLoginLogApi.SystemLoginLog>();
|
||||
const data = modalApi.getData<SystemLoginLogApi.LoginLog>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemMailAccountApi.SystemMailAccount>(
|
||||
export function useGridColumns<T = SystemMailAccountApi.MailAccount>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -37,12 +37,12 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 编辑邮箱账号 */
|
||||
function onEdit(row: SystemMailAccountApi.SystemMailAccount) {
|
||||
function onEdit(row: SystemMailAccountApi.MailAccount) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除邮箱账号 */
|
||||
async function onDelete(row: SystemMailAccountApi.SystemMailAccount) {
|
||||
async function onDelete(row: SystemMailAccountApi.MailAccount) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.mail]),
|
||||
duration: 0,
|
||||
@@ -64,7 +64,7 @@ async function onDelete(row: SystemMailAccountApi.SystemMailAccount) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemMailAccountApi.SystemMailAccount>) {
|
||||
}: OnActionClickParams<SystemMailAccountApi.MailAccount>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
@@ -103,7 +103,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemMailAccountApi.SystemMailAccount>,
|
||||
} as VxeTableGridOptions<SystemMailAccountApi.MailAccount>,
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
||||
@@ -18,7 +18,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemMailAccountApi.SystemMailAccount>();
|
||||
const formData = ref<SystemMailAccountApi.MailAccount>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['邮箱账号'])
|
||||
@@ -43,7 +43,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data =
|
||||
(await formApi.getValues()) as SystemMailAccountApi.SystemMailAccount;
|
||||
(await formApi.getValues()) as SystemMailAccountApi.MailAccount;
|
||||
try {
|
||||
await (formData.value?.id
|
||||
? updateMailAccount(data)
|
||||
@@ -64,7 +64,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemMailAccountApi.SystemMailAccount>();
|
||||
const data = modalApi.getData<SystemMailAccountApi.MailAccount>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemMailLogApi.SystemMailLog>(
|
||||
export function useGridColumns<T = SystemMailLogApi.MailLog>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -25,7 +25,7 @@ function onRefresh() {
|
||||
}
|
||||
|
||||
/** 查看邮件日志 */
|
||||
function onDetail(row: SystemMailLogApi.SystemMailLog) {
|
||||
function onDetail(row: SystemMailLogApi.MailLog) {
|
||||
detailModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ function onDetail(row: SystemMailLogApi.SystemMailLog) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemMailLogApi.SystemMailLog>) {
|
||||
}: OnActionClickParams<SystemMailLogApi.MailLog>) {
|
||||
switch (code) {
|
||||
case 'detail': {
|
||||
onDetail(row);
|
||||
@@ -68,7 +68,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemMailLogApi.SystemMailLog>,
|
||||
} as VxeTableGridOptions<SystemMailLogApi.MailLog>,
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Descriptions } from 'ant-design-vue';
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { DICT_TYPE } from '#/utils/dict';
|
||||
|
||||
const formData = ref<SystemMailLogApi.SystemMailLog>();
|
||||
const formData = ref<SystemMailLogApi.MailLog>();
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
@@ -19,7 +19,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemMailLogApi.SystemMailLog>();
|
||||
const data = modalApi.getData<SystemMailLogApi.MailLog>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import type { VbenFormSchema } from '#/adapter/form';
|
||||
import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type { SystemMailAccountApi } from '#/api/system/mail/account';
|
||||
import type { SystemMailTemplateApi } from '#/api/system/mail/template';
|
||||
|
||||
import { useAccess } from '@vben/access';
|
||||
@@ -192,7 +191,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemMailTemplateApi.SystemMailTemplate>(
|
||||
export function useGridColumns<T = SystemMailTemplateApi.MailTemplate>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
getAccountMail?: (accountId: number) => string | undefined,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
|
||||
@@ -26,7 +26,7 @@ import { useGridColumns, useGridFormSchema } from './data';
|
||||
import Form from './modules/form.vue';
|
||||
import SendForm from './modules/send-form.vue';
|
||||
|
||||
const accountList = ref<SystemMailAccountApi.SystemMailAccount[]>([]);
|
||||
const accountList = ref<SystemMailAccountApi.MailAccount[]>([]);
|
||||
|
||||
/** 获取邮箱账号 */
|
||||
const getAccountMail = (accountId: number) => {
|
||||
@@ -54,17 +54,17 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 编辑邮件模板 */
|
||||
function onEdit(row: SystemMailTemplateApi.SystemMailTemplate) {
|
||||
function onEdit(row: SystemMailTemplateApi.MailTemplate) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 发送测试邮件 */
|
||||
function onSend(row: SystemMailTemplateApi.SystemMailTemplate) {
|
||||
function onSend(row: SystemMailTemplateApi.MailTemplate) {
|
||||
sendModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除邮件模板 */
|
||||
async function onDelete(row: SystemMailTemplateApi.SystemMailTemplate) {
|
||||
async function onDelete(row: SystemMailTemplateApi.MailTemplate) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
@@ -86,7 +86,7 @@ async function onDelete(row: SystemMailTemplateApi.SystemMailTemplate) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemMailTemplateApi.SystemMailTemplate>) {
|
||||
}: OnActionClickParams<SystemMailTemplateApi.MailTemplate>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
@@ -129,7 +129,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemMailTemplateApi.SystemMailTemplate>,
|
||||
} as VxeTableGridOptions<SystemMailTemplateApi.MailTemplate>,
|
||||
});
|
||||
|
||||
/** 初始化 */
|
||||
|
||||
@@ -18,7 +18,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemMailTemplateApi.SystemMailTemplate>();
|
||||
const formData = ref<SystemMailTemplateApi.MailTemplate>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['邮件模板'])
|
||||
@@ -40,7 +40,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data =
|
||||
(await formApi.getValues()) as SystemMailTemplateApi.SystemMailTemplate;
|
||||
(await formApi.getValues()) as SystemMailTemplateApi.MailTemplate;
|
||||
try {
|
||||
await (formData.value?.id
|
||||
? updateMailTemplate(data)
|
||||
@@ -61,7 +61,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemMailTemplateApi.SystemMailTemplate>();
|
||||
const data = modalApi.getData<SystemMailTemplateApi.MailTemplate>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import { sendMail } from '#/api/system/mail/template';
|
||||
import { useSendMailFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemMailTemplateApi.SystemMailTemplate>();
|
||||
const formData = ref<SystemMailTemplateApi.MailTemplate>();
|
||||
|
||||
const [Form, formApi] = useVbenForm({
|
||||
layout: 'horizontal',
|
||||
@@ -62,7 +62,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 获取数据
|
||||
const data = modalApi.getData<SystemMailTemplateApi.SystemMailTemplate>();
|
||||
const data = modalApi.getData<SystemMailTemplateApi.MailTemplate>();
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
data.unshift({
|
||||
id: 0,
|
||||
name: '顶级部门',
|
||||
} as SystemMenuApi.SystemMenu);
|
||||
} as SystemMenuApi.Menu);
|
||||
return handleTree(data);
|
||||
},
|
||||
class: 'w-full',
|
||||
@@ -270,8 +270,8 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns(
|
||||
onActionClick: OnActionClickFn<SystemMenuApi.SystemMenu>,
|
||||
): VxeTableGridOptions<SystemMenuApi.SystemMenu>['columns'] {
|
||||
onActionClick: OnActionClickFn<SystemMenuApi.Menu>,
|
||||
): VxeTableGridOptions<SystemMenuApi.Menu>['columns'] {
|
||||
return [
|
||||
{
|
||||
field: 'name',
|
||||
|
||||
@@ -37,17 +37,17 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 添加下级菜单 */
|
||||
function onAppend(row: SystemMenuApi.SystemMenu) {
|
||||
function onAppend(row: SystemMenuApi.Menu) {
|
||||
formModalApi.setData({ pid: row.id }).open();
|
||||
}
|
||||
|
||||
/** 编辑菜单 */
|
||||
function onEdit(row: SystemMenuApi.SystemMenu) {
|
||||
function onEdit(row: SystemMenuApi.Menu) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除菜单 */
|
||||
async function onDelete(row: SystemMenuApi.SystemMenu) {
|
||||
async function onDelete(row: SystemMenuApi.Menu) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
@@ -66,10 +66,7 @@ async function onDelete(row: SystemMenuApi.SystemMenu) {
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemMenuApi.SystemMenu>) {
|
||||
function onActionClick({ code, row }: OnActionClickParams<SystemMenuApi.Menu>) {
|
||||
switch (code) {
|
||||
case 'append': {
|
||||
onAppend(row);
|
||||
|
||||
@@ -14,7 +14,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemMenuApi.SystemMenu>();
|
||||
const formData = ref<SystemMenuApi.Menu>();
|
||||
const getTitle = computed(() =>
|
||||
formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['菜单'])
|
||||
@@ -35,7 +35,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as SystemMenuApi.SystemMenu;
|
||||
const data = (await formApi.getValues()) as SystemMenuApi.Menu;
|
||||
try {
|
||||
await (formData.value?.id ? updateMenu(data) : createMenu(data));
|
||||
// 关闭并提示
|
||||
@@ -54,7 +54,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
let data = modalApi.getData<SystemMenuApi.SystemMenu>();
|
||||
let data = modalApi.getData<SystemMenuApi.Menu>();
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemNoticeApi.SystemNotice>(
|
||||
export function useGridColumns<T = SystemNoticeApi.Notice>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -33,12 +33,12 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 编辑公告 */
|
||||
function onEdit(row: SystemNoticeApi.SystemNotice) {
|
||||
function onEdit(row: SystemNoticeApi.Notice) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除公告 */
|
||||
async function onDelete(row: SystemNoticeApi.SystemNotice) {
|
||||
async function onDelete(row: SystemNoticeApi.Notice) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.title]),
|
||||
duration: 0,
|
||||
@@ -57,7 +57,7 @@ async function onDelete(row: SystemNoticeApi.SystemNotice) {
|
||||
}
|
||||
|
||||
/** 推送公告 */
|
||||
async function onPush(row: SystemNoticeApi.SystemNotice) {
|
||||
async function onPush(row: SystemNoticeApi.Notice) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.processing', ['推送']),
|
||||
duration: 0,
|
||||
@@ -78,7 +78,7 @@ async function onPush(row: SystemNoticeApi.SystemNotice) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemNoticeApi.SystemNotice>) {
|
||||
}: OnActionClickParams<SystemNoticeApi.Notice>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
@@ -121,7 +121,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemNoticeApi.SystemNotice>,
|
||||
} as VxeTableGridOptions<SystemNoticeApi.Notice>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemNoticeApi.SystemNotice>();
|
||||
const formData = ref<SystemNoticeApi.Notice>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['公告'])
|
||||
@@ -35,7 +35,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as SystemNoticeApi.SystemNotice;
|
||||
const data = (await formApi.getValues()) as SystemNoticeApi.Notice;
|
||||
try {
|
||||
await (formData.value?.id ? updateNotice(data) : createNotice(data));
|
||||
// 关闭并提示
|
||||
@@ -54,7 +54,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemNoticeApi.SystemNotice>();
|
||||
const data = modalApi.getData<SystemNoticeApi.Notice>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemNotifyMessageApi.SystemNotifyMessage>(
|
||||
export function useGridColumns<T = SystemNotifyMessageApi.NotifyMessage>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -25,7 +25,7 @@ function onRefresh() {
|
||||
}
|
||||
|
||||
/** 查看站内信详情 */
|
||||
function onDetail(row: SystemNotifyMessageApi.SystemNotifyMessage) {
|
||||
function onDetail(row: SystemNotifyMessageApi.NotifyMessage) {
|
||||
detailModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ function onDetail(row: SystemNotifyMessageApi.SystemNotifyMessage) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemNotifyMessageApi.SystemNotifyMessage>) {
|
||||
}: OnActionClickParams<SystemNotifyMessageApi.NotifyMessage>) {
|
||||
switch (code) {
|
||||
case 'detail': {
|
||||
onDetail(row);
|
||||
@@ -68,7 +68,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemNotifyMessageApi.SystemNotifyMessage>,
|
||||
} as VxeTableGridOptions<SystemNotifyMessageApi.NotifyMessage>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Descriptions } from 'ant-design-vue';
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { DICT_TYPE } from '#/utils/dict';
|
||||
|
||||
const formData = ref<SystemNotifyMessageApi.SystemNotifyMessage>();
|
||||
const formData = ref<SystemNotifyMessageApi.NotifyMessage>();
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
@@ -19,7 +19,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemNotifyMessageApi.SystemNotifyMessage>();
|
||||
const data = modalApi.getData<SystemNotifyMessageApi.NotifyMessage>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemNotifyMessageApi.SystemNotifyMessage>(
|
||||
export function useGridColumns<T = SystemNotifyMessageApi.NotifyMessage>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
<script lang="ts" setup>
|
||||
import type { OnActionClickParams, VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type {
|
||||
OnActionClickParams,
|
||||
VxeTableGridOptions,
|
||||
} from '#/adapter/vxe-table';
|
||||
import type { SystemNotifyMessageApi } from '#/api/system/notify/message';
|
||||
|
||||
import { DocAlert } from '#/components/doc-alert';
|
||||
import Detail from './modules/detail.vue';
|
||||
import { Page, useVbenModal } from '@vben/common-ui';
|
||||
import { MdiCheckboxMarkedCircleOutline } from '@vben/icons';
|
||||
|
||||
import { Button, message } from 'ant-design-vue';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
@@ -14,8 +16,10 @@ import {
|
||||
updateAllNotifyMessageRead,
|
||||
updateNotifyMessageRead,
|
||||
} from '#/api/system/notify/message';
|
||||
import { DocAlert } from '#/components/doc-alert';
|
||||
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
import Detail from './modules/detail.vue';
|
||||
|
||||
const [DetailModal, detailModalApi] = useVbenModal({
|
||||
connectedComponent: Detail,
|
||||
@@ -28,12 +32,12 @@ function onRefresh() {
|
||||
}
|
||||
|
||||
/** 查看站内信详情 */
|
||||
function onDetail(row: SystemNotifyMessageApi.SystemNotifyMessage) {
|
||||
function onDetail(row: SystemNotifyMessageApi.NotifyMessage) {
|
||||
detailModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 标记一条站内信已读 */
|
||||
async function onRead(row: SystemNotifyMessageApi.SystemNotifyMessage) {
|
||||
async function onRead(row: SystemNotifyMessageApi.NotifyMessage) {
|
||||
message.loading({
|
||||
content: '正在标记已读...',
|
||||
duration: 0,
|
||||
@@ -63,7 +67,7 @@ async function onMarkRead() {
|
||||
return;
|
||||
}
|
||||
|
||||
const ids = rows.map((row: SystemNotifyMessageApi.SystemNotifyMessage) => row.id);
|
||||
const ids = rows.map((row: SystemNotifyMessageApi.NotifyMessage) => row.id);
|
||||
message.loading({
|
||||
content: '正在标记已读...',
|
||||
duration: 0,
|
||||
@@ -99,7 +103,10 @@ async function onMarkAllRead() {
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
function onActionClick({ code, row }: OnActionClickParams<SystemNotifyMessageApi.SystemNotifyMessage>) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemNotifyMessageApi.NotifyMessage>) {
|
||||
switch (code) {
|
||||
case 'detail': {
|
||||
onDetail(row);
|
||||
@@ -139,10 +146,11 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
search: true,
|
||||
},
|
||||
checkboxConfig: {
|
||||
checkMethod: (params: { row: SystemNotifyMessageApi.SystemNotifyMessage }) => !params.row.readStatus,
|
||||
checkMethod: (params: { row: SystemNotifyMessageApi.NotifyMessage }) =>
|
||||
!params.row.readStatus,
|
||||
highlight: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemNotifyMessageApi.SystemNotifyMessage>,
|
||||
} as VxeTableGridOptions<SystemNotifyMessageApi.NotifyMessage>,
|
||||
});
|
||||
</script>
|
||||
<template>
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Descriptions } from 'ant-design-vue';
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { DICT_TYPE } from '#/utils/dict';
|
||||
|
||||
const formData = ref<SystemNotifyMessageApi.SystemNotifyMessage>();
|
||||
const formData = ref<SystemNotifyMessageApi.NotifyMessage>();
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
@@ -19,7 +19,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemNotifyMessageApi.SystemNotifyMessage>();
|
||||
const data = modalApi.getData<SystemNotifyMessageApi.NotifyMessage>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
@@ -43,6 +43,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
<Descriptions.Item label="发送人">
|
||||
{{ formData?.templateNickname }}
|
||||
</Descriptions.Item>
|
||||
<!-- TODO @芋艿:报错 -->
|
||||
<Descriptions.Item label="发送时间">
|
||||
{{ formatDateTime(formData?.createTime) }}
|
||||
</Descriptions.Item>
|
||||
|
||||
@@ -64,7 +64,10 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
label: '模板类型',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE, 'number'),
|
||||
options: getDictOptions(
|
||||
DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE,
|
||||
'number',
|
||||
),
|
||||
class: 'w-full',
|
||||
placeholder: '请选择模板类型',
|
||||
},
|
||||
@@ -128,7 +131,10 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
label: '模板类型',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE, 'number'),
|
||||
options: getDictOptions(
|
||||
DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE,
|
||||
'number',
|
||||
),
|
||||
allowClear: true,
|
||||
placeholder: '请选择模板类型',
|
||||
},
|
||||
@@ -221,7 +227,7 @@ export function useSendNotifyFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemNotifyTemplateApi.SystemNotifyTemplate>(
|
||||
export function useGridColumns<T = SystemNotifyTemplateApi.NotifyTemplate>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import type { OnActionClickParams, VxeTableGridOptions } from '#/adapter/vxe-table';
|
||||
import type {
|
||||
OnActionClickParams,
|
||||
VxeTableGridOptions,
|
||||
} from '#/adapter/vxe-table';
|
||||
import type { SystemNotifyTemplateApi } from '#/api/system/notify/template';
|
||||
|
||||
import { DocAlert } from '#/components/doc-alert';
|
||||
@@ -10,7 +13,11 @@ import { Download, Plus } from '@vben/icons';
|
||||
import { Button, message } from 'ant-design-vue';
|
||||
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { deleteNotifyTemplate, exportNotifyTemplate, getNotifyTemplatePage } from '#/api/system/notify/template';
|
||||
import {
|
||||
deleteNotifyTemplate,
|
||||
exportNotifyTemplate,
|
||||
getNotifyTemplatePage,
|
||||
} from '#/api/system/notify/template';
|
||||
import { $t } from '#/locales';
|
||||
import { downloadByData } from '#/utils/download';
|
||||
|
||||
@@ -43,17 +50,17 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 编辑站内信模板 */
|
||||
function onEdit(row: SystemNotifyTemplateApi.SystemNotifyTemplate) {
|
||||
function onEdit(row: SystemNotifyTemplateApi.NotifyTemplate) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 发送测试站内信 */
|
||||
function onSend(row: SystemNotifyTemplateApi.SystemNotifyTemplate) {
|
||||
function onSend(row: SystemNotifyTemplateApi.NotifyTemplate) {
|
||||
sendModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除站内信模板 */
|
||||
async function onDelete(row: SystemNotifyTemplateApi.SystemNotifyTemplate) {
|
||||
async function onDelete(row: SystemNotifyTemplateApi.NotifyTemplate) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
@@ -72,7 +79,10 @@ async function onDelete(row: SystemNotifyTemplateApi.SystemNotifyTemplate) {
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
function onActionClick({ code, row }: OnActionClickParams<SystemNotifyTemplateApi.SystemNotifyTemplate>) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemNotifyTemplateApi.NotifyTemplate>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
@@ -115,7 +125,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemNotifyTemplateApi.SystemNotifyTemplate>,
|
||||
} as VxeTableGridOptions<SystemNotifyTemplateApi.NotifyTemplate>,
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -127,11 +137,20 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
<SendModal />
|
||||
<Grid table-title="站内信模板列表">
|
||||
<template #toolbar-tools>
|
||||
<Button type="primary" @click="onCreate" v-access:code="['system:notify-template:create']">
|
||||
<Button
|
||||
type="primary"
|
||||
@click="onCreate"
|
||||
v-access:code="['system:notify-template:create']"
|
||||
>
|
||||
<Plus class="size-5" />
|
||||
{{ $t('ui.actionTitle.create', ['站内信模板']) }}
|
||||
</Button>
|
||||
<Button type="primary" class="ml-2" @click="onExport" v-access:code="['system:notify-template:export']">
|
||||
<Button
|
||||
type="primary"
|
||||
class="ml-2"
|
||||
@click="onExport"
|
||||
v-access:code="['system:notify-template:export']"
|
||||
>
|
||||
<Download class="size-5" />
|
||||
{{ $t('ui.actionTitle.export') }}
|
||||
</Button>
|
||||
|
||||
@@ -5,16 +5,22 @@ import { useVbenModal } from '@vben/common-ui';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import { createNotifyTemplate, getNotifyTemplate, updateNotifyTemplate } from '#/api/system/notify/template';
|
||||
import {
|
||||
createNotifyTemplate,
|
||||
getNotifyTemplate,
|
||||
updateNotifyTemplate,
|
||||
} from '#/api/system/notify/template';
|
||||
import { $t } from '#/locales';
|
||||
import { computed, ref } from 'vue';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemNotifyTemplateApi.SystemNotifyTemplate>();
|
||||
const formData = ref<SystemNotifyTemplateApi.NotifyTemplate>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id ? $t('ui.actionTitle.edit', ['站内信模板']) : $t('ui.actionTitle.create', ['站内信模板']);
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['站内信模板'])
|
||||
: $t('ui.actionTitle.create', ['站内信模板']);
|
||||
});
|
||||
|
||||
const [Form, formApi] = useVbenForm({
|
||||
@@ -31,9 +37,12 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as SystemNotifyTemplateApi.SystemNotifyTemplate;
|
||||
const data =
|
||||
(await formApi.getValues()) as SystemNotifyTemplateApi.NotifyTemplate;
|
||||
try {
|
||||
await (formData.value?.id ? updateNotifyTemplate(data) : createNotifyTemplate(data));
|
||||
await (formData.value?.id
|
||||
? updateNotifyTemplate(data)
|
||||
: createNotifyTemplate(data));
|
||||
// 关闭并提示
|
||||
await modalApi.close();
|
||||
emit('success');
|
||||
@@ -51,7 +60,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemNotifyTemplateApi.SystemNotifyTemplate>();
|
||||
const data = modalApi.getData<SystemNotifyTemplateApi.NotifyTemplate>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { ref } from 'vue';
|
||||
import { useSendNotifyFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemNotifyTemplateApi.SystemNotifyTemplate>();
|
||||
const formData = ref<SystemNotifyTemplateApi.NotifyTemplate>();
|
||||
|
||||
const [Form, formApi] = useVbenForm({
|
||||
layout: 'horizontal',
|
||||
@@ -37,7 +37,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
paramsObj[param] = values[`param_${param}`];
|
||||
});
|
||||
}
|
||||
const data: SystemNotifyTemplateApi.SystemNotifySendReqVO = {
|
||||
const data: SystemNotifyTemplateApi.NotifySendReqVO = {
|
||||
userId: values.userId,
|
||||
userType: values.userType,
|
||||
templateCode: formData.value?.code || '',
|
||||
@@ -65,7 +65,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 获取数据
|
||||
const data = modalApi.getData<SystemNotifyTemplateApi.SystemNotifyTemplate>();
|
||||
const data = modalApi.getData<SystemNotifyTemplateApi.NotifyTemplate>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemOAuth2ClientApi.SystemOAuth2Client>(
|
||||
export function useGridColumns<T = SystemOAuth2ClientApi.OAuth2Client>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -37,12 +37,12 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 编辑 OAuth2 客户端 */
|
||||
function onEdit(row: SystemOAuth2ClientApi.SystemOAuth2Client) {
|
||||
function onEdit(row: SystemOAuth2ClientApi.OAuth2Client) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除 OAuth2 客户端 */
|
||||
async function onDelete(row: SystemOAuth2ClientApi.SystemOAuth2Client) {
|
||||
async function onDelete(row: SystemOAuth2ClientApi.OAuth2Client) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
@@ -64,7 +64,7 @@ async function onDelete(row: SystemOAuth2ClientApi.SystemOAuth2Client) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemOAuth2ClientApi.SystemOAuth2Client>) {
|
||||
}: OnActionClickParams<SystemOAuth2ClientApi.OAuth2Client>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
@@ -103,7 +103,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemOAuth2ClientApi.SystemOAuth2Client>,
|
||||
} as VxeTableGridOptions<SystemOAuth2ClientApi.OAuth2Client>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemOAuth2ClientApi.SystemOAuth2Client>();
|
||||
const formData = ref<SystemOAuth2ClientApi.OAuth2Client>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', [' OAuth2.0 客户端'])
|
||||
@@ -43,7 +43,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data =
|
||||
(await formApi.getValues()) as SystemOAuth2ClientApi.SystemOAuth2Client;
|
||||
(await formApi.getValues()) as SystemOAuth2ClientApi.OAuth2Client;
|
||||
try {
|
||||
await (formData.value?.id
|
||||
? updateOAuth2Client(data)
|
||||
@@ -64,7 +64,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemOAuth2ClientApi.SystemOAuth2Client>();
|
||||
const data = modalApi.getData<SystemOAuth2ClientApi.OAuth2Client>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemOAuth2TokenApi.SystemOAuth2Token>(
|
||||
export function useGridColumns<T = SystemOAuth2TokenApi.OAuth2Token>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -25,7 +25,7 @@ function onRefresh() {
|
||||
}
|
||||
|
||||
/** 删除 OAuth2 令牌 */
|
||||
async function onDelete(row: SystemOAuth2TokenApi.SystemOAuth2Token) {
|
||||
async function onDelete(row: SystemOAuth2TokenApi.OAuth2Token) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', ['令牌']),
|
||||
duration: 0,
|
||||
@@ -47,7 +47,7 @@ async function onDelete(row: SystemOAuth2TokenApi.SystemOAuth2Token) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemOAuth2TokenApi.SystemOAuth2Token>) {
|
||||
}: OnActionClickParams<SystemOAuth2TokenApi.OAuth2Token>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
@@ -82,7 +82,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemOAuth2TokenApi.SystemOAuth2Token>,
|
||||
} as VxeTableGridOptions<SystemOAuth2TokenApi.OAuth2Token>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemOperateLogApi.SystemOperateLog>(
|
||||
export function useGridColumns<T = SystemOperateLogApi.OperateLog>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -36,7 +36,7 @@ async function onExport() {
|
||||
}
|
||||
|
||||
/** 查看操作日志详情 */
|
||||
function onDetail(row: SystemOperateLogApi.SystemOperateLog) {
|
||||
function onDetail(row: SystemOperateLogApi.OperateLog) {
|
||||
detailModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ function onDetail(row: SystemOperateLogApi.SystemOperateLog) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemOperateLogApi.SystemOperateLog>) {
|
||||
}: OnActionClickParams<SystemOperateLogApi.OperateLog>) {
|
||||
switch (code) {
|
||||
case 'detail': {
|
||||
onDetail(row);
|
||||
@@ -79,7 +79,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemOperateLogApi.SystemOperateLog>,
|
||||
} as VxeTableGridOptions<SystemOperateLogApi.OperateLog>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { formatDateTime } from '@vben/utils';
|
||||
|
||||
import { Descriptions } from 'ant-design-vue';
|
||||
|
||||
const formData = ref<SystemOperateLogApi.SystemOperateLog>();
|
||||
const formData = ref<SystemOperateLogApi.OperateLog>();
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
@@ -16,7 +16,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemOperateLogApi.SystemOperateLog>();
|
||||
const data = modalApi.getData<SystemOperateLogApi.OperateLog>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemPostApi.SystemPost>(
|
||||
export function useGridColumns<T = SystemPostApi.Post>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -40,12 +40,12 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 编辑岗位 */
|
||||
function onEdit(row: SystemPostApi.SystemPost) {
|
||||
function onEdit(row: SystemPostApi.Post) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除岗位 */
|
||||
async function onDelete(row: SystemPostApi.SystemPost) {
|
||||
async function onDelete(row: SystemPostApi.Post) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
@@ -64,10 +64,7 @@ async function onDelete(row: SystemPostApi.SystemPost) {
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemPostApi.SystemPost>) {
|
||||
function onActionClick({ code, row }: OnActionClickParams<SystemPostApi.Post>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
@@ -106,7 +103,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemPostApi.SystemPost>,
|
||||
} as VxeTableGridOptions<SystemPostApi.Post>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemPostApi.SystemPost>();
|
||||
const formData = ref<SystemPostApi.Post>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['岗位'])
|
||||
@@ -35,7 +35,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as SystemPostApi.SystemPost;
|
||||
const data = (await formApi.getValues()) as SystemPostApi.Post;
|
||||
try {
|
||||
await (formData.value?.id ? updatePost(data) : createPost(data));
|
||||
// 关闭并提示
|
||||
@@ -54,7 +54,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemPostApi.SystemPost>();
|
||||
const data = modalApi.getData<SystemPostApi.Post>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemRoleApi.SystemRole>(
|
||||
export function useGridColumns<T = SystemRoleApi.Role>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -49,7 +49,7 @@ async function onExport() {
|
||||
}
|
||||
|
||||
/** 编辑角色 */
|
||||
function onEdit(row: SystemRoleApi.SystemRole) {
|
||||
function onEdit(row: SystemRoleApi.Role) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 删除角色 */
|
||||
async function onDelete(row: SystemRoleApi.SystemRole) {
|
||||
async function onDelete(row: SystemRoleApi.Role) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
@@ -78,20 +78,17 @@ async function onDelete(row: SystemRoleApi.SystemRole) {
|
||||
}
|
||||
|
||||
/** 分配角色的数据权限 */
|
||||
function onAssignDataPermission(row: SystemRoleApi.SystemRole) {
|
||||
function onAssignDataPermission(row: SystemRoleApi.Role) {
|
||||
assignDataPermissionFormApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 分配角色的菜单权限 */
|
||||
function onAssignMenu(row: SystemRoleApi.SystemRole) {
|
||||
function onAssignMenu(row: SystemRoleApi.Role) {
|
||||
assignMenuFormApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemRoleApi.SystemRole>) {
|
||||
function onActionClick({ code, row }: OnActionClickParams<SystemRoleApi.Role>) {
|
||||
switch (code) {
|
||||
case 'assign-data-permission': {
|
||||
onAssignDataPermission(row);
|
||||
@@ -138,7 +135,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemRoleApi.SystemRole>,
|
||||
} as VxeTableGridOptions<SystemRoleApi.Role>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ import { useAssignDataPermissionFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
|
||||
const deptTree = ref<SystemDeptApi.SystemDept[]>([]); // 部门树
|
||||
const deptTree = ref<SystemDeptApi.Dept[]>([]); // 部门树
|
||||
const deptLoading = ref(false); // 加载部门列表
|
||||
const isAllSelected = ref(false); // 全选状态
|
||||
const isExpanded = ref(false); // 展开状态
|
||||
@@ -64,7 +64,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
if (!isOpen) {
|
||||
return;
|
||||
}
|
||||
const data = modalApi.getData<SystemRoleApi.SystemRole>();
|
||||
const data = modalApi.getData<SystemRoleApi.Role>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ async function loadDeptTree() {
|
||||
deptLoading.value = true;
|
||||
try {
|
||||
const data = await getDeptList();
|
||||
deptTree.value = handleTree(data) as SystemDeptApi.SystemDept[];
|
||||
deptTree.value = handleTree(data) as SystemDeptApi.Dept[];
|
||||
} finally {
|
||||
deptLoading.value = false;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import { useAssignMenuFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
|
||||
const menuTree = ref<SystemDeptApi.SystemDept[]>([]); // 菜单树
|
||||
const menuTree = ref<SystemDeptApi.Dept[]>([]); // 菜单树
|
||||
const menuLoading = ref(false); // 加载菜单列表
|
||||
const isAllSelected = ref(false); // 全选状态
|
||||
const isExpanded = ref(false); // 展开状态
|
||||
@@ -59,7 +59,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
if (!isOpen) {
|
||||
return;
|
||||
}
|
||||
const data = modalApi.getData<SystemRoleApi.SystemRole>();
|
||||
const data = modalApi.getData<SystemRoleApi.Role>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ async function loadMenuTree() {
|
||||
menuLoading.value = true;
|
||||
try {
|
||||
const data = await getMenuList();
|
||||
menuTree.value = handleTree(data) as SystemDeptApi.SystemDept[];
|
||||
menuTree.value = handleTree(data) as SystemDeptApi.Dept[];
|
||||
} finally {
|
||||
menuLoading.value = false;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemRoleApi.SystemRole>();
|
||||
const formData = ref<SystemRoleApi.Role>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['角色'])
|
||||
@@ -35,7 +35,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as SystemRoleApi.SystemRole;
|
||||
const data = (await formApi.getValues()) as SystemRoleApi.Role;
|
||||
try {
|
||||
await (formData.value?.id ? updateRole(data) : createRole(data));
|
||||
// 关闭并提示
|
||||
@@ -54,7 +54,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemRoleApi.SystemRole>();
|
||||
const data = modalApi.getData<SystemRoleApi.Role>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemSmsChannelApi.SystemSmsChannel>(
|
||||
export function useGridColumns<T = SystemSmsChannelApi.SmsChannel>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -45,12 +45,12 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 编辑短信渠道 */
|
||||
function onEdit(row: SystemSmsChannelApi.SystemSmsChannel) {
|
||||
function onEdit(row: SystemSmsChannelApi.SmsChannel) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除短信渠道 */
|
||||
async function onDelete(row: SystemSmsChannelApi.SystemSmsChannel) {
|
||||
async function onDelete(row: SystemSmsChannelApi.SmsChannel) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.signature]),
|
||||
duration: 0,
|
||||
@@ -72,7 +72,7 @@ async function onDelete(row: SystemSmsChannelApi.SystemSmsChannel) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemSmsChannelApi.SystemSmsChannel>) {
|
||||
}: OnActionClickParams<SystemSmsChannelApi.SmsChannel>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
@@ -111,7 +111,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemSmsChannelApi.SystemSmsChannel>,
|
||||
} as VxeTableGridOptions<SystemSmsChannelApi.SmsChannel>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemSmsChannelApi.SystemSmsChannel>();
|
||||
const formData = ref<SystemSmsChannelApi.SmsChannel>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['短信渠道'])
|
||||
@@ -42,8 +42,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data =
|
||||
(await formApi.getValues()) as SystemSmsChannelApi.SystemSmsChannel;
|
||||
const data = (await formApi.getValues()) as SystemSmsChannelApi.SmsChannel;
|
||||
try {
|
||||
await (formData.value?.id
|
||||
? updateSmsChannel(data)
|
||||
@@ -64,7 +63,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemSmsChannelApi.SystemSmsChannel>();
|
||||
const data = modalApi.getData<SystemSmsChannelApi.SmsChannel>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemSmsLogApi.SystemSmsLog>(
|
||||
export function useGridColumns<T = SystemSmsLogApi.SmsLog>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -36,7 +36,7 @@ async function onExport() {
|
||||
}
|
||||
|
||||
/** 查看短信日志详情 */
|
||||
function onDetail(row: SystemSmsLogApi.SystemSmsLog) {
|
||||
function onDetail(row: SystemSmsLogApi.SmsLog) {
|
||||
detailModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ function onDetail(row: SystemSmsLogApi.SystemSmsLog) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemSmsLogApi.SystemSmsLog>) {
|
||||
}: OnActionClickParams<SystemSmsLogApi.SmsLog>) {
|
||||
switch (code) {
|
||||
case 'detail': {
|
||||
onDetail(row);
|
||||
@@ -79,7 +79,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemSmsLogApi.SystemSmsLog>,
|
||||
} as VxeTableGridOptions<SystemSmsLogApi.SmsLog>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import { Descriptions } from 'ant-design-vue';
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { DICT_TYPE } from '#/utils/dict';
|
||||
|
||||
const formData = ref<SystemSmsLogApi.SystemSmsLog>();
|
||||
const formData = ref<SystemSmsLogApi.SmsLog>();
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
async onOpenChange(isOpen: boolean) {
|
||||
@@ -19,7 +19,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemSmsLogApi.SystemSmsLog>();
|
||||
const data = modalApi.getData<SystemSmsLogApi.SmsLog>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -203,7 +203,7 @@ export function useSendSmsFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemSmsTemplateApi.SystemSmsTemplate>(
|
||||
export function useGridColumns<T = SystemSmsTemplateApi.SmsTemplate>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -51,17 +51,17 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 编辑短信模板 */
|
||||
function onEdit(row: SystemSmsTemplateApi.SystemSmsTemplate) {
|
||||
function onEdit(row: SystemSmsTemplateApi.SmsTemplate) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 发送测试短信 */
|
||||
function onSend(row: SystemSmsTemplateApi.SystemSmsTemplate) {
|
||||
function onSend(row: SystemSmsTemplateApi.SmsTemplate) {
|
||||
sendModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除短信模板 */
|
||||
async function onDelete(row: SystemSmsTemplateApi.SystemSmsTemplate) {
|
||||
async function onDelete(row: SystemSmsTemplateApi.SmsTemplate) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
@@ -83,7 +83,7 @@ async function onDelete(row: SystemSmsTemplateApi.SystemSmsTemplate) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemSmsTemplateApi.SystemSmsTemplate>) {
|
||||
}: OnActionClickParams<SystemSmsTemplateApi.SmsTemplate>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
@@ -126,7 +126,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemSmsTemplateApi.SystemSmsTemplate>,
|
||||
} as VxeTableGridOptions<SystemSmsTemplateApi.SmsTemplate>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemSmsTemplateApi.SystemSmsTemplate>();
|
||||
const formData = ref<SystemSmsTemplateApi.SmsTemplate>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['短信模板'])
|
||||
@@ -43,7 +43,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data =
|
||||
(await formApi.getValues()) as SystemSmsTemplateApi.SystemSmsTemplate;
|
||||
(await formApi.getValues()) as SystemSmsTemplateApi.SmsTemplate;
|
||||
try {
|
||||
await (formData.value?.id
|
||||
? updateSmsTemplate(data)
|
||||
@@ -64,7 +64,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemSmsTemplateApi.SystemSmsTemplate>();
|
||||
const data = modalApi.getData<SystemSmsTemplateApi.SmsTemplate>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import { sendSms } from '#/api/system/sms/template';
|
||||
import { useSendSmsFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemSmsTemplateApi.SystemSmsTemplate>();
|
||||
const formData = ref<SystemSmsTemplateApi.SmsTemplate>();
|
||||
|
||||
const [Form, formApi] = useVbenForm({
|
||||
layout: 'horizontal',
|
||||
@@ -38,7 +38,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
paramsObj[param] = values[`param_${param}`];
|
||||
});
|
||||
}
|
||||
const data: SystemSmsTemplateApi.SystemSmsSendReqVO = {
|
||||
const data: SystemSmsTemplateApi.SmsSendReqVO = {
|
||||
mobile: values.mobile,
|
||||
templateCode: formData.value?.code || '',
|
||||
templateParams: paramsObj,
|
||||
@@ -65,7 +65,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 获取数据
|
||||
const data = modalApi.getData<SystemSmsTemplateApi.SystemSmsTemplate>();
|
||||
const data = modalApi.getData<SystemSmsTemplateApi.SmsTemplate>();
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemSocialClientApi.SystemSocialClient>(
|
||||
export function useGridColumns<T = SystemSocialClientApi.SocialClient>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -37,12 +37,12 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 编辑社交客户端 */
|
||||
function onEdit(row: SystemSocialClientApi.SystemSocialClient) {
|
||||
function onEdit(row: SystemSocialClientApi.SocialClient) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除社交客户端 */
|
||||
async function onDelete(row: SystemSocialClientApi.SystemSocialClient) {
|
||||
async function onDelete(row: SystemSocialClientApi.SocialClient) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
@@ -64,7 +64,7 @@ async function onDelete(row: SystemSocialClientApi.SystemSocialClient) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemSocialClientApi.SystemSocialClient>) {
|
||||
}: OnActionClickParams<SystemSocialClientApi.SocialClient>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
@@ -103,7 +103,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemSocialClientApi.SystemSocialClient>,
|
||||
} as VxeTableGridOptions<SystemSocialClientApi.SocialClient>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemSocialClientApi.SystemSocialClient>();
|
||||
const formData = ref<SystemSocialClientApi.SocialClient>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['社交客户端'])
|
||||
@@ -40,7 +40,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data =
|
||||
(await formApi.getValues()) as SystemSocialClientApi.SystemSocialClient;
|
||||
(await formApi.getValues()) as SystemSocialClientApi.SocialClient;
|
||||
try {
|
||||
await (formData.value?.id
|
||||
? updateSocialClient(data)
|
||||
@@ -61,7 +61,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemSocialClientApi.SystemSocialClient>();
|
||||
const data = modalApi.getData<SystemSocialClientApi.SocialClient>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemSocialUserApi.SystemSocialUser>(
|
||||
export function useGridColumns<T = SystemSocialUserApi.SocialUser>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -25,7 +25,7 @@ const [DetailModal, detailModalApi] = useVbenModal({
|
||||
// }
|
||||
|
||||
/** 查看详情 */
|
||||
function onDetail(row: SystemSocialUserApi.SystemSocialUser) {
|
||||
function onDetail(row: SystemSocialUserApi.SocialUser) {
|
||||
detailModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ function onDetail(row: SystemSocialUserApi.SystemSocialUser) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemSocialUserApi.SystemSocialUser>) {
|
||||
}: OnActionClickParams<SystemSocialUserApi.SocialUser>) {
|
||||
switch (code) {
|
||||
case 'detail': {
|
||||
onDetail(row);
|
||||
@@ -68,7 +68,7 @@ const [Grid] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemSocialUserApi.SystemSocialUser>,
|
||||
} as VxeTableGridOptions<SystemSocialUserApi.SocialUser>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import { DictTag } from '#/components/dict-tag';
|
||||
import { $t } from '#/locales';
|
||||
import { DICT_TYPE } from '#/utils/dict';
|
||||
|
||||
const formData = ref<SystemSocialUserApi.SystemSocialUser>();
|
||||
const formData = ref<SystemSocialUserApi.SocialUser>();
|
||||
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
title: $t('ui.actionTitle.detail'),
|
||||
|
||||
@@ -182,7 +182,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemTenantApi.SystemTenant>(
|
||||
export function useGridColumns<T = SystemTenantApi.Tenant>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
getPackageName?: (packageId: number) => string | undefined,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
|
||||
@@ -23,7 +23,7 @@ import { downloadByData } from '#/utils/download';
|
||||
import { useGridColumns, useGridFormSchema } from './data';
|
||||
import Form from './modules/form.vue';
|
||||
|
||||
const tenantPackageList = ref<SystemTenantPackageApi.SystemTenantPackage[]>([]);
|
||||
const tenantPackageList = ref<SystemTenantPackageApi.TenantPackage[]>([]);
|
||||
|
||||
/** 获取套餐名称 */
|
||||
const getPackageName = (packageId: number) => {
|
||||
@@ -55,12 +55,12 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 编辑租户 */
|
||||
function onEdit(row: SystemTenantApi.SystemTenant) {
|
||||
function onEdit(row: SystemTenantApi.Tenant) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除租户 */
|
||||
async function onDelete(row: SystemTenantApi.SystemTenant) {
|
||||
async function onDelete(row: SystemTenantApi.Tenant) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
@@ -82,7 +82,7 @@ async function onDelete(row: SystemTenantApi.SystemTenant) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemTenantApi.SystemTenant>) {
|
||||
}: OnActionClickParams<SystemTenantApi.Tenant>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
@@ -121,7 +121,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemTenantApi.SystemTenant>,
|
||||
} as VxeTableGridOptions<SystemTenantApi.Tenant>,
|
||||
});
|
||||
|
||||
/** 初始化 */
|
||||
|
||||
@@ -14,7 +14,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemTenantApi.SystemTenant>();
|
||||
const formData = ref<SystemTenantApi.Tenant>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value
|
||||
? $t('ui.actionTitle.edit', ['租户'])
|
||||
@@ -35,7 +35,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as SystemTenantApi.SystemTenant;
|
||||
const data = (await formApi.getValues()) as SystemTenantApi.Tenant;
|
||||
try {
|
||||
await (formData.value ? updateTenant(data) : createTenant(data));
|
||||
// 关闭并提示
|
||||
@@ -54,7 +54,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemTenantApi.SystemTenant>();
|
||||
const data = modalApi.getData<SystemTenantApi.Tenant>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemTenantPackageApi.SystemTenantPackage>(
|
||||
export function useGridColumns<T = SystemTenantPackageApi.TenantPackage>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
): VxeTableGridOptions['columns'] {
|
||||
return [
|
||||
|
||||
@@ -36,12 +36,12 @@ function onCreate() {
|
||||
}
|
||||
|
||||
/** 编辑租户套餐 */
|
||||
function onEdit(row: SystemTenantPackageApi.SystemTenantPackage) {
|
||||
function onEdit(row: SystemTenantPackageApi.TenantPackage) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除租户套餐 */
|
||||
async function onDelete(row: SystemTenantPackageApi.SystemTenantPackage) {
|
||||
async function onDelete(row: SystemTenantPackageApi.TenantPackage) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
||||
duration: 0,
|
||||
@@ -63,7 +63,7 @@ async function onDelete(row: SystemTenantPackageApi.SystemTenantPackage) {
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemTenantPackageApi.SystemTenantPackage>) {
|
||||
}: OnActionClickParams<SystemTenantPackageApi.TenantPackage>) {
|
||||
switch (code) {
|
||||
case 'delete': {
|
||||
onDelete(row);
|
||||
@@ -103,7 +103,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemTenantPackageApi.SystemTenantPackage>,
|
||||
} as VxeTableGridOptions<SystemTenantPackageApi.TenantPackage>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -21,13 +21,13 @@ import { handleTree } from '#/utils/tree';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemTenantPackageApi.SystemTenantPackage>();
|
||||
const formData = ref<SystemTenantPackageApi.TenantPackage>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value
|
||||
? $t('ui.actionTitle.edit', ['套餐'])
|
||||
: $t('ui.actionTitle.create', ['套餐']);
|
||||
});
|
||||
const menuTree = ref<SystemDeptApi.SystemDept[]>([]); // 菜单树
|
||||
const menuTree = ref<SystemDeptApi.Dept[]>([]); // 菜单树
|
||||
const menuLoading = ref(false); // 加载菜单列表
|
||||
const isAllSelected = ref(false); // 全选状态
|
||||
const isExpanded = ref(false); // 展开状态
|
||||
@@ -48,7 +48,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data =
|
||||
(await formApi.getValues()) as SystemTenantPackageApi.SystemTenantPackage;
|
||||
(await formApi.getValues()) as SystemTenantPackageApi.TenantPackage;
|
||||
try {
|
||||
await (formData.value
|
||||
? updateTenantPackage(data)
|
||||
@@ -70,7 +70,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
if (!isOpen) {
|
||||
return;
|
||||
}
|
||||
const data = modalApi.getData<SystemTenantPackageApi.SystemTenantPackage>();
|
||||
const data = modalApi.getData<SystemTenantPackageApi.TenantPackage>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ async function loadMenuTree() {
|
||||
menuLoading.value = true;
|
||||
try {
|
||||
const data = await getMenuList();
|
||||
menuTree.value = handleTree(data) as SystemDeptApi.SystemDept[];
|
||||
menuTree.value = handleTree(data) as SystemDeptApi.Dept[];
|
||||
} finally {
|
||||
menuLoading.value = false;
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemUserApi.SystemUser>(
|
||||
export function useGridColumns<T = SystemUserApi.User>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
onStatusChange?: (
|
||||
newStatus: number,
|
||||
|
||||
@@ -65,7 +65,7 @@ async function onExport() {
|
||||
|
||||
/** 选择部门 */
|
||||
const searchDeptId = ref<number | undefined>(undefined);
|
||||
async function onDeptSelect(dept: SystemDeptApi.SystemDept) {
|
||||
async function onDeptSelect(dept: SystemDeptApi.Dept) {
|
||||
searchDeptId.value = dept.id;
|
||||
onRefresh();
|
||||
}
|
||||
@@ -81,12 +81,12 @@ function onImport() {
|
||||
}
|
||||
|
||||
/** 编辑用户 */
|
||||
function onEdit(row: SystemUserApi.SystemUser) {
|
||||
function onEdit(row: SystemUserApi.User) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除用户 */
|
||||
async function onDelete(row: SystemUserApi.SystemUser) {
|
||||
async function onDelete(row: SystemUserApi.User) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.username]),
|
||||
duration: 0,
|
||||
@@ -105,12 +105,12 @@ async function onDelete(row: SystemUserApi.SystemUser) {
|
||||
}
|
||||
|
||||
/** 重置密码 */
|
||||
function onResetPassword(row: SystemUserApi.SystemUser) {
|
||||
function onResetPassword(row: SystemUserApi.User) {
|
||||
resetPasswordModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 分配角色 */
|
||||
function onAssignRole(row: SystemUserApi.SystemUser) {
|
||||
function onAssignRole(row: SystemUserApi.User) {
|
||||
assignRoleModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ function onAssignRole(row: SystemUserApi.SystemUser) {
|
||||
/** 更新用户状态 */
|
||||
async function onStatusChange(
|
||||
newStatus: number,
|
||||
row: SystemUserApi.SystemUser,
|
||||
row: SystemUserApi.User,
|
||||
): Promise<boolean | undefined> {
|
||||
return new Promise((resolve, reject) => {
|
||||
Modal.confirm({
|
||||
@@ -147,10 +147,7 @@ async function onStatusChange(
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemUserApi.SystemUser>) {
|
||||
function onActionClick({ code, row }: OnActionClickParams<SystemUserApi.User>) {
|
||||
switch (code) {
|
||||
case 'assign-role': {
|
||||
onAssignRole(row);
|
||||
@@ -198,7 +195,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemUserApi.SystemUser>,
|
||||
} as VxeTableGridOptions<SystemUserApi.User>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemUserApi.SystemUser>();
|
||||
const data = modalApi.getData<SystemUserApi.User>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import { getSimpleDeptList } from '#/api/system/dept';
|
||||
import { handleTree } from '#/utils/tree';
|
||||
|
||||
const emit = defineEmits(['select']);
|
||||
const deptList = ref<SystemDeptApi.SystemDept[]>([]); // 部门列表
|
||||
const deptList = ref<SystemDeptApi.Dept[]>([]); // 部门列表
|
||||
const deptTree = ref<any[]>([]); // 部门树
|
||||
const expandedKeys = ref<number[]>([]); // 展开的节点
|
||||
const loading = ref(false); // 加载状态
|
||||
|
||||
@@ -14,7 +14,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemUserApi.SystemUser>();
|
||||
const formData = ref<SystemUserApi.User>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['用户'])
|
||||
@@ -35,7 +35,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as SystemUserApi.SystemUser;
|
||||
const data = (await formApi.getValues()) as SystemUserApi.User;
|
||||
try {
|
||||
await (formData.value?.id ? updateUser(data) : createUser(data));
|
||||
// 关闭并提示
|
||||
@@ -54,7 +54,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemUserApi.SystemUser>();
|
||||
const data = modalApi.getData<SystemUserApi.User>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemUserApi.SystemUser>();
|
||||
const data = modalApi.getData<SystemUserApi.User>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user