build: 编译通过
This commit is contained in:
parent
b93178ec85
commit
078818928f
|
|
@ -96,8 +96,6 @@
|
|||
import { ref } from "vue";
|
||||
import { storeToRefs } from "pinia";
|
||||
import {
|
||||
Menu,
|
||||
Trash2,
|
||||
ExternalLink,
|
||||
Pin,
|
||||
Archive,
|
||||
|
|
@ -141,12 +139,6 @@ const showMoreMenu = ref(false);
|
|||
const settingsStore = useSettingsStore();
|
||||
const { settings } = storeToRefs(settingsStore);
|
||||
|
||||
function handleClear() {
|
||||
if (confirm("确定要清空当前对话吗?此操作不可恢复。")) {
|
||||
emit("clear");
|
||||
}
|
||||
}
|
||||
|
||||
function handleShare() {
|
||||
showMoreMenu.value = false;
|
||||
emit("share");
|
||||
|
|
|
|||
|
|
@ -49,16 +49,7 @@
|
|||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
import {
|
||||
MessageSquare,
|
||||
Code,
|
||||
Image,
|
||||
FileText,
|
||||
ChevronRight,
|
||||
Keyboard,
|
||||
Zap,
|
||||
Globe,
|
||||
Lightbulb,
|
||||
PenTool,
|
||||
} from "@/components/icons";
|
||||
import promptData from "@/assets/prompt.json";
|
||||
import type { Suggestion } from "@/types/chat";
|
||||
|
|
|
|||
|
|
@ -178,8 +178,7 @@ function showThrottledToast(message: string, type: "error" = "error") {
|
|||
}
|
||||
|
||||
// 计算属性
|
||||
const charCount = computed(() => inputText.value.length);
|
||||
const isUploading = computed(() => attachments.value.some((a) => a.uploading));
|
||||
const charCount = computed(() => inputText.value.length);
|
||||
const isProcessingAttachments = computed(() =>
|
||||
attachments.value.some((a) => a.uploading || a.deleting),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -160,8 +160,6 @@ import { ref } from "vue";
|
|||
import MarkdownRender from "markstream-vue";
|
||||
import { setCustomComponents } from "markstream-vue";
|
||||
import {
|
||||
Bot,
|
||||
User,
|
||||
AlertCircle,
|
||||
RefreshCw,
|
||||
Zap,
|
||||
|
|
@ -170,7 +168,6 @@ import {
|
|||
Check,
|
||||
} from "@/components/icons";
|
||||
import { NImage, NImageGroup } from "naive-ui";
|
||||
import MessageActions from "./MessageActions.vue";
|
||||
import { formatFileSize, getFileIcon } from "@/utils/helpers";
|
||||
import type { Message, Suggestion, Attachment, VideoInfo } from "@/types/chat";
|
||||
import ThinkingNode from "./components/ThinkingNode.vue";
|
||||
|
|
@ -223,11 +220,6 @@ function handleToggleSelect() {
|
|||
emit("toggle-select");
|
||||
}
|
||||
|
||||
// 处理分享按钮点击(进入选择模式)
|
||||
function handleShareClick() {
|
||||
emit("enter-select-mode");
|
||||
}
|
||||
|
||||
function getFileEmoji(mimeType?: string) {
|
||||
return getFileIcon(mimeType || "");
|
||||
}
|
||||
|
|
@ -248,18 +240,6 @@ function textCopy(data: any) {
|
|||
}
|
||||
}
|
||||
|
||||
function handleCopy() {
|
||||
emit("copy");
|
||||
}
|
||||
|
||||
function handleLike() {
|
||||
emit("like");
|
||||
}
|
||||
|
||||
function handleDislike() {
|
||||
emit("dislike");
|
||||
}
|
||||
|
||||
setCustomComponents("playground-demo", {
|
||||
think: ThinkingNode,
|
||||
vmr_container: EChartsContainerNode,
|
||||
|
|
|
|||
|
|
@ -135,12 +135,10 @@ import { useChatStore } from "@/stores/chat";
|
|||
import { useSettingsStore } from "@/stores/settings";
|
||||
import { chatApi } from "@/services/api.ts";
|
||||
import ConversationItem from "./ConversationItem.vue";
|
||||
import ShareButton from "./ShareButton.vue";
|
||||
import {
|
||||
Plus,
|
||||
Pin,
|
||||
ChevronDown,
|
||||
Check,
|
||||
ChevronUp,
|
||||
} from "@/components/icons";
|
||||
|
||||
|
|
|
|||
|
|
@ -55,48 +55,10 @@ const defaultColors = [
|
|||
'#ec4899', // pink
|
||||
]
|
||||
|
||||
function formatFileSize(size?: number) {
|
||||
if (!size || size <= 0) return ''
|
||||
const units = ['B', 'KB', 'MB', 'GB']
|
||||
let value = size
|
||||
let unitIndex = 0
|
||||
|
||||
while (value >= 1024 && unitIndex < units.length - 1) {
|
||||
value /= 1024
|
||||
unitIndex += 1
|
||||
}
|
||||
|
||||
const display = value >= 10 || unitIndex === 0 ? Math.round(value) : value.toFixed(1)
|
||||
return `${display} ${units[unitIndex]}`
|
||||
}
|
||||
|
||||
function getCardTitle(card: CardItem, index: number) {
|
||||
return card.title || card.name || `Card ${index + 1}`
|
||||
}
|
||||
|
||||
function getCardDescription(card: CardItem) {
|
||||
if (card.description) return card.description
|
||||
|
||||
const labels: Record<string, string> = {
|
||||
image: '图片',
|
||||
file: '文件',
|
||||
video: '视频',
|
||||
}
|
||||
|
||||
const kind = labels[card.type || ''] || '附件'
|
||||
const size = formatFileSize(card.size)
|
||||
|
||||
if (card.uploading) {
|
||||
return size ? `${kind} · 上传中 · ${size}` : `${kind} · 上传中`
|
||||
}
|
||||
|
||||
if (card.deleting) {
|
||||
return size ? `${kind} · 删除中 · ${size}` : `${kind} · 删除中`
|
||||
}
|
||||
|
||||
return size ? `${kind} · ${size}` : kind
|
||||
}
|
||||
|
||||
function getCardIcon(card: CardItem) {
|
||||
if (card.icon) return card.icon
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue