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 './dict';
|
||||||
export * from './log';
|
export * from './log';
|
||||||
export * from './menu';
|
export * from './menu';
|
||||||
export * from './role';
|
|
||||||
export * from './notice';
|
export * from './notice';
|
||||||
|
export * from './role';
|
||||||
export * from './user';
|
export * from './user';
|
||||||
|
|||||||
@ -49,14 +49,15 @@ export namespace SystemNoticeApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getNoticeList(params: Recordable<any>) {
|
async function getNoticeList(params: Recordable<any>) {
|
||||||
return requestClient.get<SystemNoticeApi.PageResult<SystemNoticeApi.NoticeItem>>(
|
return requestClient.get<
|
||||||
'/system/notice/list',
|
SystemNoticeApi.PageResult<SystemNoticeApi.NoticeItem>
|
||||||
{ params },
|
>('/system/notice/list', { params });
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getNoticeDetail(id: string) {
|
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) {
|
async function createNotice(data: SystemNoticeApi.NoticeInput) {
|
||||||
@ -74,7 +75,10 @@ async function deleteNotice(id: string) {
|
|||||||
return requestClient.delete(`/system/notice/${id}`);
|
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, {
|
return requestClient.post('/system/notice/toggle', undefined, {
|
||||||
params: {
|
params: {
|
||||||
id,
|
id,
|
||||||
@ -101,4 +105,3 @@ export {
|
|||||||
toggleNoticeTop,
|
toggleNoticeTop,
|
||||||
updateNotice,
|
updateNotice,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,10 @@ export function useFormSchema(): VbenFormSchema[] {
|
|||||||
rules: z
|
rules: z
|
||||||
.string()
|
.string()
|
||||||
.min(1, $t('ui.formRules.required', [$t('system.notice.title')]))
|
.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',
|
component: 'Input',
|
||||||
@ -86,7 +89,10 @@ export function useFormSchema(): VbenFormSchema[] {
|
|||||||
label: $t('system.notice.summary'),
|
label: $t('system.notice.summary'),
|
||||||
rules: z
|
rules: z
|
||||||
.string()
|
.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',
|
component: 'TextArea',
|
||||||
|
|||||||
@ -106,24 +106,21 @@ const rowActions: Array<KtTableRowAction<SystemNoticeApi.NoticeItem>> = [
|
|||||||
permissionCodes: ['System:Notice:Edit'],
|
permissionCodes: ['System:Notice:Edit'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
confirm: (row) =>
|
confirm: (row) => $t('system.notice.toggleStatusConfirm', [row.title]),
|
||||||
$t('system.notice.toggleStatusConfirm', [row.title]),
|
|
||||||
key: 'toggle',
|
key: 'toggle',
|
||||||
label: $t('system.notice.toggle'),
|
label: $t('system.notice.toggle'),
|
||||||
onClick: onToggleStatus,
|
onClick: onToggleStatus,
|
||||||
permissionCodes: ['System:Notice:Edit'],
|
permissionCodes: ['System:Notice:Edit'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
confirm: (row) =>
|
confirm: (row) => $t('system.notice.toggleTopConfirm', [row.title]),
|
||||||
$t('system.notice.toggleTopConfirm', [row.title]),
|
|
||||||
key: 'top',
|
key: 'top',
|
||||||
label: $t('system.notice.topToggle'),
|
label: $t('system.notice.topToggle'),
|
||||||
onClick: onToggleTop,
|
onClick: onToggleTop,
|
||||||
permissionCodes: ['System:Notice:Edit'],
|
permissionCodes: ['System:Notice:Edit'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
confirm: (row) =>
|
confirm: (row) => $t('system.notice.deleteConfirm', [row.title]),
|
||||||
$t('system.notice.deleteConfirm', [row.title]),
|
|
||||||
danger: true,
|
danger: true,
|
||||||
key: 'delete',
|
key: 'delete',
|
||||||
label: $t('common.delete'),
|
label: $t('common.delete'),
|
||||||
@ -224,7 +221,11 @@ function onRefresh() {
|
|||||||
<template #bodyCell="{ column, record }">
|
<template #bodyCell="{ column, record }">
|
||||||
<template v-if="column.key === 'isTop'">
|
<template v-if="column.key === 'isTop'">
|
||||||
<Tag :color="record.isTop ? 'warning' : 'default'">
|
<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>
|
</Tag>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.key === 'level'">
|
<template v-else-if="column.key === 'level'">
|
||||||
@ -233,7 +234,9 @@ function onRefresh() {
|
|||||||
</Tag>
|
</Tag>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.key === 'status'">
|
<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 }}
|
{{ getNoticeStatusOption(record.status)?.label || record.status }}
|
||||||
</Tag>
|
</Tag>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -8,10 +8,7 @@ import { useVbenModal } from '@vben/common-ui';
|
|||||||
import { Button } from 'antdv-next';
|
import { Button } from 'antdv-next';
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
import { useVbenForm } from '#/adapter/form';
|
||||||
import {
|
import { createNotice, updateNotice } from '#/api/system/notice';
|
||||||
createNotice,
|
|
||||||
updateNotice,
|
|
||||||
} from '#/api/system/notice';
|
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import { useFormSchema } from '../data';
|
import { useFormSchema } from '../data';
|
||||||
@ -43,11 +40,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const currentId = formData.value?.id;
|
const currentId = formData.value?.id;
|
||||||
if (currentId) {
|
await (currentId ? updateNotice(currentId, data) : createNotice(data));
|
||||||
await updateNotice(currentId, data);
|
|
||||||
} else {
|
|
||||||
await createNotice(data);
|
|
||||||
}
|
|
||||||
modalApi.close();
|
modalApi.close();
|
||||||
emit('success');
|
emit('success');
|
||||||
} finally {
|
} finally {
|
||||||
@ -92,4 +85,3 @@ function resetForm() {
|
|||||||
</template>
|
</template>
|
||||||
</Modal>
|
</Modal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user