feat(*): 分镜与资产 - 完善五类资产、候选去重、搜索、中文镜头编号与分类整理
This commit is contained in:
1 parent
ce6e20f749
commit
f548681787
53 files changed
+816
-188
No files matched your search
@@ -12,6 +12,7 @@ import { AssetLibraryCard, AssetLibraryCardMedia } from "@/components/assets/ass
|
||||
import { saveAs } from "file-saver";
|
||||
|
||||
import { useCopyText } from "@/hooks/use-copy-text";
|
||||
import { ASSET_CATEGORY_OPTIONS, assetCategoryLabel } from "@/lib/asset-category";
|
||||
import { resourceStorageLabel, resourceStorageLocation, resourceStorageTitle } from "@/lib/canvas/resource-storage-status";
|
||||
import { formatBytes, readFileAsDataUrl, readImageMeta } from "@/lib/image-utils";
|
||||
import { uploadImage } from "@/services/image-storage";
|
||||
@@ -48,13 +49,7 @@ const kindOptions = [
|
||||
|
||||
const categoryOptions = [
|
||||
{ label: "全部分类", value: "all" },
|
||||
{ label: "角色", value: "character" },
|
||||
{ label: "场景", value: "environment" },
|
||||
{ label: "服饰", value: "wardrobe" },
|
||||
{ label: "道具", value: "prop" },
|
||||
{ label: "武器", value: "weapon" },
|
||||
{ label: "画风", value: "style" },
|
||||
{ label: "其他", value: "other" },
|
||||
...ASSET_CATEGORY_OPTIONS,
|
||||
];
|
||||
|
||||
const assetKindIcons: Record<LibraryAsset["kind"], LucideIcon> = {
|
||||
@@ -781,10 +776,6 @@ function assetSearchText(asset: LibraryAsset) {
|
||||
return [asset.title, asset.source || "", asset.note || "", assetCategoryLabel(asset.category), (asset.tags || []).join(" "), asset.kind === "text" ? asset.data.content : asset.data.mimeType].join(" ").toLowerCase();
|
||||
}
|
||||
|
||||
function assetCategoryLabel(category?: AssetCategory) {
|
||||
return categoryOptions.find((item) => item.value === (category || "other"))?.label || "其他";
|
||||
}
|
||||
|
||||
function assetProjectLabel(asset: LibraryAsset) {
|
||||
const projectName = asset.metadata?.projectName;
|
||||
if (typeof projectName === "string" && projectName.trim()) return projectName;
|
||||
|
||||
Reference in new issue
Block a user