Skip to content
Merged

Dev #403

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 1 addition & 22 deletions backend/app/scripts/data/sys_menu.json
Original file line number Diff line number Diff line change
Expand Up @@ -2682,32 +2682,11 @@
],
"client": "pc"
},
{
"name": "会话聊天",
"type": 2,
"icon": "ri:message-3-line",
"order": 2,
"permission": "module_ai:chat:query",
"route_name": "FaChat",
"route_path": "/ai/fachat",
"component_path": "module_ai/fachat/index",
"status": "0",
"keep_alive": true,
"hidden": false,
"always_show": false,
"title": "会话聊天",
"params": null,
"affix": false,
"redirect": null,
"description": "会话聊天(FaChat)",
"children": [],
"client": "pc"
},
{
"name": "会话记忆",
"type": 2,
"icon": "ri:chat-3-line",
"order": 3,
"order": 2,
"permission": "module_ai:chat:query",
"route_name": "Memory",
"route_path": "/ai/memory",
Expand Down
2 changes: 1 addition & 1 deletion frontend/web/.env
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 【通用】环境变量 - 所有环境共享

# 应用版本号
VITE_VERSION = 3.0.2
VITE_VERSION = 3.0.0

# 开发服务器端口
VITE_PORT = 5180
Expand Down
2 changes: 1 addition & 1 deletion frontend/web/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Vite 会加载:.env、.env.[mode](如 .env.development),后者覆盖前者同名变量。

# ---------- 通用(建议复制到 .env)----------
VITE_VERSION=3.0.2
VITE_VERSION=3.0.0
VITE_PORT=5180
VITE_BASE_URL=/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ defineExpose({
<ElButton type="danger" @click="handleClear" v-ripple>清除数据</ElButton>

<FaTable :data="tableData" style="margin-top: 10px">
<ElTableColumn type="index" label="序号" width="60" />
<ElTableColumn
v-for="key in Object.keys(headers)"
:key="key"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const handleFileChange = async (uploadFile: UploadFile) => {
<ElButton type="danger" @click="handleClear" v-ripple>清除数据</ElButton>

<FaTable :data="tableData" style="margin-top: 10px">
<ElTableColumn type="index" label="序号" width="60" />
<ElTableColumn
v-for="key in Object.keys(headers)"
:key="key"
Expand Down
12 changes: 6 additions & 6 deletions frontend/web/src/components/forms/fa-wang-editor/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
</template>

<script setup lang="ts">
import "@wangeditor/editor/dist/css/style.css";
import "@wangeditor-next/editor/dist/css/style.css";
import { onBeforeUnmount, onMounted, shallowRef, computed } from "vue";
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
import { Editor, Toolbar } from "@wangeditor-next/editor-for-vue";
import { useUserStore } from "@stores/modules/user.store";
import { EmojiText } from "@utils/ui";
import { IDomEditor, IToolbarConfig, IEditorConfig } from "@wangeditor/editor";
import { IDomEditor, IToolbarConfig, IEditorConfig } from "@wangeditor-next/editor";
import request from "@utils/http";
import type { AxiosResponse } from "axios";

Expand Down Expand Up @@ -120,15 +120,15 @@ const editorConfig: Partial<IEditorConfig> = {
fieldName: mergedUploadConfig.value.fieldName,
maxFileSize: mergedUploadConfig.value.maxFileSize,
maxNumberOfFiles: mergedUploadConfig.value.maxNumberOfFiles,
allowedFileTypes: mergedUploadConfig.value.allowedFileTypes,
allowedFileTypes: [...mergedUploadConfig.value.allowedFileTypes],
server: uploadServer.value,
headers: {
Authorization: userStore.accessToken,
},
onSuccess() {
ElMessage.success(`图片上传成功 ${EmojiText[200]}`);
},
onError(file: File, err: any, res: any) {
onError(_file: unknown, err: any, res: any) {
console.error("图片上传失败:", err, res);
ElMessage.error(`图片上传失败 ${EmojiText[500]}`);
},
Expand All @@ -140,7 +140,7 @@ const editorConfig: Partial<IEditorConfig> = {
const uploadConfig = props.uploadConfig;
if (uploadConfig?.isCustomUpload && uploadConfig.server && editorConfig.MENU_CONF) {
const uploadServerUrl = uploadConfig.server;
editorConfig.MENU_CONF.uploadImage.customUpload = async (file: File, insertFn: InsertFnType) => {
editorConfig.MENU_CONF.uploadImage!.customUpload = async (file: File, insertFn: InsertFnType) => {
try {
const formData = new FormData();
formData.append(mergedUploadConfig.value.fieldName, file);
Expand Down
66 changes: 66 additions & 0 deletions frontend/web/src/components/layouts/fa-fast-enter/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,61 @@
</div>
</div>
</ElPopover>

<!-- 礼花效果介绍弹窗(放在 Popover 外,避免被 Popover 销毁) -->
<ElDialog
v-model="fireworksDialogVisible"
title="礼花效果"
width="480px"
:close-on-click-modal="true"
>
<div class="px-2">
<div class="mb-5 flex items-start gap-4">
<div class="flex-cc size-14 rounded-xl bg-gradient-to-br from-purple-400 to-indigo-500">
<FaSvgIcon icon="ri:loader-line" class="text-2xl text-white" />
</div>
<div class="flex-1">
<h4 class="m-0 text-base font-semibold">节日礼花动画</h4>
<p class="mt-1 text-sm text-g-500 leading-relaxed">
根据当前节日自动匹配对应素材的全屏 Canvas 烟花效果,支持多种粒子形状和绚丽色彩。
</p>
</div>
</div>

<ElDivider />

<div class="space-y-3">
<div class="flex items-center gap-3">
<ElTag type="primary" class="!rounded-md !border-0 flex-shrink-0">快捷键</ElTag>
<span class="text-sm text-g-600">
<ElTag size="small" class="!mr-1">Ctrl</ElTag>
+
<ElTag size="small" class="!mx-1">Shift</ElTag>
+
<ElTag size="small" class="!ml-1">P</ElTag>
<span class="mx-2 text-g-400">/</span>
<ElTag size="small" class="!mr-1">⌘</ElTag>
+
<ElTag size="small" class="!mx-1">Shift</ElTag>
+
<ElTag size="small" class="!ml-1">P</ElTag>
</span>
</div>
<div class="flex items-center gap-3">
<ElTag type="success" class="!rounded-md !border-0 flex-shrink-0">节日素材</ElTag>
<span class="text-sm text-g-600">
礼花素材与当前节日配置一致,自动匹配春节、元宵、中秋等传统节日主题
</span>
</div>
<div class="flex items-center gap-3">
<ElTag type="warning" class="!rounded-md !border-0 flex-shrink-0">触发方式</ElTag>
<span class="text-sm text-g-600">
页面加载时自动检测节日并连发,也可通过快捷键手动触发一次
</span>
</div>
</div>
</div>
</ElDialog>
</template>

<script setup lang="ts">
Expand All @@ -69,6 +124,7 @@ defineOptions({ name: "FaFastEnter" });

const router = useRouter();
const popoverRef = ref();
const fireworksDialogVisible = ref(false);

// 使用快速入口配置
const { enabledApplications, enabledQuickLinks } = useFastEnter();
Expand Down Expand Up @@ -104,6 +160,11 @@ const handleNavigate = (
* @param application 应用配置对象
*/
const handleApplicationClick = (application: FastEnterApplication): void => {
if (application.isDialog) {
popoverRef.value?.hide();
fireworksDialogVisible.value = true;
return;
}
handleNavigate(application.routeName, application.link, application.routeQuery);
};

Expand All @@ -112,6 +173,11 @@ const handleApplicationClick = (application: FastEnterApplication): void => {
* @param quickLink 快速链接配置对象
*/
const handleQuickLinkClick = (quickLink: FastEnterQuickLink): void => {
if (quickLink.isDialog) {
popoverRef.value?.hide();
fireworksDialogVisible.value = true;
return;
}
handleNavigate(quickLink.routeName, quickLink.link, quickLink.routeQuery);
};
</script>
29 changes: 25 additions & 4 deletions frontend/web/src/components/tables/fa-table-header/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@
<ElCheckbox v-model="isHeaderBackground" :value="true">
{{ t("table.headerBackground") }}
</ElCheckbox>
<ElCheckbox v-model="highlightCurrentRow" :value="true">
{{ t("table.highlightCurrentRow") }}
</ElCheckbox>
</div>
</ElPopover>
<slot name="right"></slot>
Expand Down Expand Up @@ -179,7 +182,7 @@ interface Props {
}

const props = withDefaults(defineProps<Props>(), {
fullClass: "fa-page-view",
fullClass: "fa-table-card",
layout: "search,refresh,size,fullscreen,columns,rowDrag,settings",
showSearchBar: undefined,
});
Expand Down Expand Up @@ -224,7 +227,8 @@ const tableSizeOptions = [
];

const tableStore = useTableStore();
const { tableSize, isZebra, isBorder, isHeaderBackground, isRowDrag } = storeToRefs(tableStore);
const { tableSize, isZebra, isBorder, isHeaderBackground, isRowDrag, highlightCurrentRow } =
storeToRefs(tableStore);

const toggleRowDrag = () => {
tableStore.setIsRowDrag(!isRowDrag.value);
Expand Down Expand Up @@ -289,12 +293,29 @@ const isFullScreen = ref(false);
/** 保存原始的 overflow 样式,用于退出全屏时恢复 */
const originalOverflow = ref("");

/**
* 查找可全屏的容器元素
* 优先取 .fa-table-card 的父级(包含搜索栏 + 表格卡片),其次降级到 fullClass
*/
const findFullscreenContainer = (): HTMLElement | null => {
const headerEl = document.getElementById("fa-table-header");
if (headerEl) {
const card = headerEl.closest(`.${props.fullClass}`);
if (card?.parentElement) {
// 取父级 — 通常包裹了搜索栏 + 表格卡片
return card.parentElement as HTMLElement;
}
if (card) return card as HTMLElement;
}
return document.querySelector(`.${props.fullClass}`);
};

/**
* 切换全屏状态
* 进入全屏时会隐藏页面滚动条,退出时恢复原状态
*/
const toggleFullScreen = () => {
const el = document.querySelector(`.${props.fullClass}`);
const el = findFullscreenContainer();
if (!el) return;

isFullScreen.value = !isFullScreen.value;
Expand Down Expand Up @@ -336,7 +357,7 @@ onUnmounted(() => {
// 如果组件在全屏状态下被卸载,恢复页面滚动状态
if (isFullScreen.value) {
document.body.style.overflow = originalOverflow.value;
const el = document.querySelector(`.${props.fullClass}`);
const el = findFullscreenContainer();
if (el) {
el.classList.remove("el-full-screen");
}
Expand Down
12 changes: 10 additions & 2 deletions frontend/web/src/components/tables/fa-table/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,15 @@ const elTableRef = ref<InstanceType<typeof ElTable> | null>(null);
const paginationRef = ref<HTMLElement>();
const tableHeaderRef = ref<HTMLElement>();
const tableStore = useTableStore();
const { isBorder, isZebra, tableSize, isFullScreen, isHeaderBackground, isRowDrag } =
storeToRefs(tableStore);
const {
isBorder,
isZebra,
tableSize,
isFullScreen,
isHeaderBackground,
isRowDrag,
highlightCurrentRow,
} = storeToRefs(tableStore);

/** 分页配置接口 */
interface PaginationConfig {
Expand Down Expand Up @@ -306,6 +313,7 @@ const mergedTableProps = computed(() => ({
border: border.value,
size: size.value,
headerCellStyle: headerCellStyle.value,
highlightCurrentRow: highlightCurrentRow.value,
// Element Plus 默认值为 true,未显式传入时不应被 FaTable 覆盖成 false。
selectOnIndeterminate: hasExplicitTableProp("selectOnIndeterminate")
? props.selectOnIndeterminate
Expand Down
20 changes: 10 additions & 10 deletions frontend/web/src/config/modules/fastEnter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ const fastEnterConfig: FastEnterConfig = {
routeName: "DashboardAnalysis",
},
{
name: "礼花效果",
description: "动画特效展示",
icon: "ri:loader-line",
iconColor: "#7A7FFF",
name: "定价",
description: "价格方案与套餐选择",
icon: "ri:money-cny-box-line",
iconColor: "#FF6B35",
enabled: true,
order: 3,
routeName: "Fireworks",
routeName: "FastlinkPricing",
},
{
name: "聊天",
Expand All @@ -44,7 +44,7 @@ const fastEnterConfig: FastEnterConfig = {
iconColor: "#13DEB9",
enabled: true,
order: 4,
routeName: "Chat",
routeName: "FastlinkFachat",
},
{
name: "官方文档",
Expand Down Expand Up @@ -77,7 +77,7 @@ const fastEnterConfig: FastEnterConfig = {
name: "操作手册",
description: "产品操作指南",
icon: "ri:book-2-line",
iconColor: "#38C0FC",
iconColor: "#009688",
enabled: true,
order: 8,
routeName: "FastlinkTutorial",
Expand All @@ -104,16 +104,16 @@ const fastEnterConfig: FastEnterConfig = {
routeName: "Login",
},
{
name: "定价",
name: "礼花效果",
enabled: true,
order: 4,
routeName: "FastlinkPricing",
isDialog: true,
},
{
name: "个人中心",
enabled: true,
order: 5,
routeName: "Profile",
routeName: "FastlinkProfile",
},
{
name: "留言管理",
Expand Down
4 changes: 4 additions & 0 deletions frontend/web/src/locales/langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,9 @@
"workplace": {
"title": "Workbench"
},
"fachat": {
"title": "Fachat"
},
"changelog": {
"title": "Release notes"
},
Expand Down Expand Up @@ -620,6 +623,7 @@
"zebra": "Zebra",
"border": "Border",
"headerBackground": "Header BG",
"highlightCurrentRow": "Highlight Row",
"toolbar": {
"hideSearch": "Hide search area",
"showSearch": "Show search area",
Expand Down
Loading