fix: 修正站内信前端文件 ESLint/Prettier 格式以恢复 CI 构建部署
站内信前端文件(api/system/index.ts、notice.ts、views/system/notice/*)有 16 处 ESLint/Prettier 格式错误,导致 Jenkins verify:commit 失败、Build 与 Deploy Static 被跳过,线上前端未更新(旧 dist 无 notice 路由)→ 菜单 404 不显示。 eslint --fix 修复格式,本地 verify:commit(lint+typecheck)已通过。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
81af5b5bdf
commit
15e588f80e
@ -2,6 +2,6 @@ export * from './dept';
|
||||
export * from './dict';
|
||||
export * from './log';
|
||||
export * from './menu';
|
||||
export * from './role';
|
||||
export * from './notice';
|
||||
export * from './role';
|
||||
export * from './user';
|
||||
|
||||
@ -49,14 +49,15 @@ export namespace SystemNoticeApi {
|
||||
}
|
||||
|
||||
async function getNoticeList(params: Recordable<any>) {
|
||||
return requestClient.get<SystemNoticeApi.PageResult<SystemNoticeApi.NoticeItem>>(
|
||||
'/system/notice/list',
|
||||
{ params },
|
||||
);
|
||||
return requestClient.get<
|
||||
SystemNoticeApi.PageResult<SystemNoticeApi.NoticeItem>
|
||||
>('/system/notice/list', { params });
|
||||
}
|
||||
|
||||
async function getNoticeDetail(id: string) {
|
||||
return requestClient.get<SystemNoticeApi.NoticeItem>(`/system/notice/detail/${id}`);
|
||||
return requestClient.get<SystemNoticeApi.NoticeItem>(
|
||||
`/system/notice/detail/${id}`,
|
||||
);
|
||||
}
|
||||
|
||||
async function createNotice(data: SystemNoticeApi.NoticeInput) {
|
||||
@ -74,7 +75,10 @@ async function deleteNotice(id: string) {
|
||||
return requestClient.delete(`/system/notice/${id}`);
|
||||
}
|
||||
|
||||
async function toggleNoticeStatus(id: string, status: SystemNoticeApi.NoticeItem['status']) {
|
||||
async function toggleNoticeStatus(
|
||||
id: string,
|
||||
status: SystemNoticeApi.NoticeItem['status'],
|
||||
) {
|
||||
return requestClient.post('/system/notice/toggle', undefined, {
|
||||
params: {
|
||||
id,
|
||||
@ -101,4 +105,3 @@ export {
|
||||
toggleNoticeTop,
|
||||
updateNotice,
|
||||
};
|
||||
|
||||
|
||||
@ -74,7 +74,10 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
rules: z
|
||||
.string()
|
||||
.min(1, $t('ui.formRules.required', [$t('system.notice.title')]))
|
||||
.max(120, $t('ui.formRules.maxLength', [$t('system.notice.title'), 120])),
|
||||
.max(
|
||||
120,
|
||||
$t('ui.formRules.maxLength', [$t('system.notice.title'), 120]),
|
||||
),
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
@ -86,7 +89,10 @@ export function useFormSchema(): VbenFormSchema[] {
|
||||
label: $t('system.notice.summary'),
|
||||
rules: z
|
||||
.string()
|
||||
.max(200, $t('ui.formRules.maxLength', [$t('system.notice.summary'), 200])),
|
||||
.max(
|
||||
200,
|
||||
$t('ui.formRules.maxLength', [$t('system.notice.summary'), 200]),
|
||||
),
|
||||
},
|
||||
{
|
||||
component: 'TextArea',
|
||||
|
||||
@ -106,24 +106,21 @@ const rowActions: Array<KtTableRowAction<SystemNoticeApi.NoticeItem>> = [
|
||||
permissionCodes: ['System:Notice:Edit'],
|
||||
},
|
||||
{
|
||||
confirm: (row) =>
|
||||
$t('system.notice.toggleStatusConfirm', [row.title]),
|
||||
confirm: (row) => $t('system.notice.toggleStatusConfirm', [row.title]),
|
||||
key: 'toggle',
|
||||
label: $t('system.notice.toggle'),
|
||||
onClick: onToggleStatus,
|
||||
permissionCodes: ['System:Notice:Edit'],
|
||||
},
|
||||
{
|
||||
confirm: (row) =>
|
||||
$t('system.notice.toggleTopConfirm', [row.title]),
|
||||
confirm: (row) => $t('system.notice.toggleTopConfirm', [row.title]),
|
||||
key: 'top',
|
||||
label: $t('system.notice.topToggle'),
|
||||
onClick: onToggleTop,
|
||||
permissionCodes: ['System:Notice:Edit'],
|
||||
},
|
||||
{
|
||||
confirm: (row) =>
|
||||
$t('system.notice.deleteConfirm', [row.title]),
|
||||
confirm: (row) => $t('system.notice.deleteConfirm', [row.title]),
|
||||
danger: true,
|
||||
key: 'delete',
|
||||
label: $t('common.delete'),
|
||||
@ -224,7 +221,11 @@ function onRefresh() {
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'isTop'">
|
||||
<Tag :color="record.isTop ? 'warning' : 'default'">
|
||||
{{ record.isTop ? $t('system.notice.topYes') : $t('system.notice.topNo') }}
|
||||
{{
|
||||
record.isTop
|
||||
? $t('system.notice.topYes')
|
||||
: $t('system.notice.topNo')
|
||||
}}
|
||||
</Tag>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'level'">
|
||||
@ -233,7 +234,9 @@ function onRefresh() {
|
||||
</Tag>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'status'">
|
||||
<Tag :color="getNoticeStatusOption(record.status)?.color || 'default'">
|
||||
<Tag
|
||||
:color="getNoticeStatusOption(record.status)?.color || 'default'"
|
||||
>
|
||||
{{ getNoticeStatusOption(record.status)?.label || record.status }}
|
||||
</Tag>
|
||||
</template>
|
||||
|
||||
@ -8,10 +8,7 @@ import { useVbenModal } from '@vben/common-ui';
|
||||
import { Button } from 'antdv-next';
|
||||
|
||||
import { useVbenForm } from '#/adapter/form';
|
||||
import {
|
||||
createNotice,
|
||||
updateNotice,
|
||||
} from '#/api/system/notice';
|
||||
import { createNotice, updateNotice } from '#/api/system/notice';
|
||||
import { $t } from '#/locales';
|
||||
|
||||
import { useFormSchema } from '../data';
|
||||
@ -43,11 +40,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
|
||||
try {
|
||||
const currentId = formData.value?.id;
|
||||
if (currentId) {
|
||||
await updateNotice(currentId, data);
|
||||
} else {
|
||||
await createNotice(data);
|
||||
}
|
||||
await (currentId ? updateNotice(currentId, data) : createNotice(data));
|
||||
modalApi.close();
|
||||
emit('success');
|
||||
} finally {
|
||||
@ -92,4 +85,3 @@ function resetForm() {
|
||||
</template>
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user