feat(projects): 优化控制台输出和 sql 导入文件

This commit is contained in:
xlsea
2025-12-06 16:37:25 +08:00
parent a0f6a57990
commit bfb7169e73
5 changed files with 30 additions and 28 deletions
+4 -1
View File
@@ -27,12 +27,15 @@ UPDATE `sys_menu` SET `icon` = 'tabler:login-2', `menu_name` = 'route.monitor_lo
UPDATE `sys_menu` SET `icon` = 'gg:debug', `menu_name` = 'route.demo_demo' WHERE `menu_id` = 1500;
UPDATE `sys_menu` SET `icon` = 'gg:debug', `menu_name` = 'route.demo_tree' WHERE `menu_id` = 1506;
UPDATE `sys_menu` SET `path` = 'oss/config', `component` = 'system/oss-config/index', `icon` = 'hugeicons:configuration-01', `menu_name` = 'route.system_oss-config' WHERE `menu_id` = 133;
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (9, 'route.about', 0, 99, 'about', 'about/index', '', 1, 1, 'C', '0', '0', '', 'fluent:book-information-24-regular', 103, 1, sysdate(), null, null, '关于页面');
-- IFrame 类型
UPDATE `sys_menu` SET `component` = 'FrameView', `query_param` = 'https://ruoyi.xlsea.cn/admin/', `is_frame` = 2, `icon` = 'bx:bxl-spring-boot', `menu_name` = 'menu.monitor_admin' WHERE `menu_id` = 117;
UPDATE `sys_menu` SET `component` = 'FrameView', `query_param` = 'https://preview.snailjob.opensnail.com/', `is_frame` = 2, `icon` = 'gridicons:scheduled', `menu_name` = 'menu.monitor_snail-job' WHERE `menu_id` = 120;
-- 外链类型
UPDATE `sys_menu` SET `path` = 'https://gitee.com/xlsea/ruoyi-plus-soybean', `component` = 'FrameView', `icon` = 'local-icon-gitee', `menu_name` = 'RuoYi-Plus-Soybean' WHERE `menu_id` = 4;
UPDATE `sys_menu` SET `menu_name` = 'RuoYi-Vue-Plus', `order_num` = 100, `path` = 'https://gitee.com/dromara/RuoYi-Vue-Plus', `component` = 'FrameView', `remark` = 'RuoYi-Vue-Plus 仓库地址' WHERE `menu_id` = 4;
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (7, 'Soybean Admin', 0, 100, 'https://github.com/soybeanjs', 'FrameView', '', 0, 0, 'M', '0', '0', '', 'mdi:github', 103, 1, sysdate(), null, null, 'Soybean Admin 仓库地址');
INSERT INTO `sys_menu` (`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, `visible`, `status`, `perms`, `icon`, `create_dept`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (8, 'RuoYi-Plus-Soybean', 0, 100, 'https://gitee.com/xlsea/ruoyi-plus-soybean', 'FrameView', '', 0, 0, 'M', '0', '0', '', 'local-icon-gitee', 103, 1, sysdate(), null, null, 'RuoYi-Plus-Soybean 仓库地址');
-- plus-ui 需要禁用的页面
UPDATE `sys_menu` SET `status` = '1' WHERE `menu_id` IN ( '116', '130', '131', '132', '11700', '11701' );
+1 -1
View File
@@ -47,7 +47,7 @@ export const generatedRoutes: GeneratedRoute[] = [
title: 'about',
i18nKey: 'route.about',
icon: 'fluent:book-information-24-regular',
order: 1000
order: 99
}
},
{
-11
View File
@@ -123,17 +123,6 @@ const dynamicConstantRoutes: ElegantRoute[] = [
icon: 'material-symbols:account-circle-full',
hideInMenu: true
}
},
{
name: 'about',
path: '/about',
component: 'layout.base$view.about',
meta: {
title: 'about',
i18nKey: 'route.about',
icon: 'fluent:book-information-24-regular',
order: 1000
}
}
];
+7 -4
View File
@@ -17,18 +17,21 @@ export const initSSE = (url: string) => {
const sseUrl = `${url}?Authorization=Bearer ${token}&clientid=${import.meta.env.VITE_APP_CLIENT_ID}`;
const { data, error } = useEventSource(sseUrl, [], {
autoReconnect: {
retries: 10,
delay: 3000,
retries: 5,
delay: 5000,
onFailed() {
// eslint-disable-next-line no-console
console.error('Failed to connect after 10 retries');
console.warn('Failed to connect to SSE after 5 attempts.');
}
}
});
watch(error, () => {
if (!error.value || error.value?.isTrusted) {
return;
}
// eslint-disable-next-line no-console
console.error('SSE connection error:', error.value);
console.error('SSE connection error:\n', error.value);
error.value = null;
});
@@ -111,6 +111,9 @@ const isIframeType = computed(() => model.value.isFrame === '2');
// 本地图标类型
const isLocalIcon = computed(() => iconType.value === '2');
// 布局类型禁用
const layoutDisabled = computed(() => !(isMenu.value && model.value.parentId === 0));
// 本地图标
const localIcons = getLocalMenuIcons();
const localIconOptions = localIcons.map<SelectOption>(item => ({
@@ -171,7 +174,7 @@ function processComponent(component: string | null | undefined): string {
if (isIframeType.value || isExternalType.value) {
return 'FrameView';
}
if (isMenu.value && isBlankLayout) {
if (isMenu.value && isBlankLayout.value) {
return `layout.blank$view.${component?.replaceAll('/', '_')}`;
}
if (isMenu.value && isInternalType.value) {
@@ -257,6 +260,18 @@ watch(
}
);
watch(
layoutDisabled,
() => {
if (!layoutDisabled.value) {
return;
}
layoutType.value = '0';
model.value.visible = '0';
},
{ immediate: true }
);
watch(visible, () => {
if (visible.value) {
handleInitModel();
@@ -268,13 +283,6 @@ function handleLayoutChange(value: string) {
model.value.visible = value as Api.Common.VisibleStatus;
}
function handleParentIdChange(value?: CommonType.IdType | null) {
if (value !== 0 && isBlankLayout) {
layoutType.value = '0';
model.value.visible = '0';
}
}
function onCreate() {
return {
key: '',
@@ -294,7 +302,6 @@ function onCreate() {
:immediate="false"
:options="treeData as []"
:placeholder="$t('page.system.menu.form.parentId.required')"
@update:value="handleParentIdChange"
/>
</NFormItemGi>
<NFormItemGi v-if="!isBtn" :span="12" :label="$t('page.system.menu.menuType')" path="menuType">
@@ -307,14 +314,14 @@ function onCreate() {
/>
</NRadioGroup>
</NFormItemGi>
<NFormItemGi v-if="isMenu && model.parentId === 0" :span="12" path="layout">
<NFormItemGi :span="12" path="layout">
<template #label>
<div class="flex-center">
<FormTip :content="$t('page.system.menu.layoutTip')" />
<span>{{ $t('page.system.menu.layout') }}</span>
</div>
</template>
<NRadioGroup v-model:value="layoutType" @update:value="handleLayoutChange">
<NRadioGroup v-model:value="layoutType" :disabled="layoutDisabled" @update:value="handleLayoutChange">
<NRadio v-for="item in menuLayoutOptions" :key="item.value" :value="item.value" :label="item.label" />
</NRadioGroup>
</NFormItemGi>