|
|
@@ -95,6 +95,7 @@ import { fetchScenesAll, SceneType, uploadMaterialToModel, type Scene } from "@/
|
|
|
import { activeModel, getSceneModel, sceneModelMap } from "@/sdk";
|
|
|
import { selectMaterials } from "@/components/materials/quisk";
|
|
|
import { custom } from "@/env";
|
|
|
+import { formatDate } from "@/utils";
|
|
|
import { actionItems, currentItem } from "@/views/merge";
|
|
|
|
|
|
type Key = string;
|
|
|
@@ -193,12 +194,39 @@ const rowSelection: any = ref({
|
|
|
curIds.push(...cache[keyp][key])
|
|
|
}
|
|
|
}
|
|
|
- selects.value = curIds
|
|
|
+ selects.value = deduplicateBySuffix(curIds) || []
|
|
|
+
|
|
|
},
|
|
|
getCheckboxProps: (record: Scene) => ({
|
|
|
disabled: selectIds.value.includes(record.num),
|
|
|
}),
|
|
|
});
|
|
|
+/**
|
|
|
+ * 根据字符串中----ll----之后的部分进行去重,保留第一次出现的元素
|
|
|
+ * @param {string[]} strList - 待去重的字符串列表
|
|
|
+ * @returns {string[]} 去重后的字符串列表
|
|
|
+ */
|
|
|
+function deduplicateBySuffix(strList: string[]) {
|
|
|
+ // 用对象记录已出现的后缀(key:后缀,value:完整字符串)
|
|
|
+ const seenSuffix = {};
|
|
|
+
|
|
|
+ // 遍历列表中的每个字符串
|
|
|
+ strList.forEach(str => {
|
|
|
+ // 分割字符串,获取----ll----之后的部分
|
|
|
+ const parts = str.split('----ll----');
|
|
|
+ // 确保分割后有后缀部分
|
|
|
+ if (parts.length >= 2) {
|
|
|
+ const suffix:string = parts[1];
|
|
|
+ // 仅当后缀未出现过时,才记录
|
|
|
+ if (!seenSuffix[suffix]) {
|
|
|
+ seenSuffix[suffix] = str;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 提取对象的value,转为数组返回
|
|
|
+ return Object.values(seenSuffix);
|
|
|
+}
|
|
|
const cloumns = [
|
|
|
{
|
|
|
width: "400px",
|
|
|
@@ -215,6 +243,10 @@ const cloumns = [
|
|
|
title: "拍摄/创建时间",
|
|
|
dataIndex: "createTime",
|
|
|
key: "createTime",
|
|
|
+ customRender:({text})=>{
|
|
|
+ return text?formatDate(new Date(text), 'yyyy-MM-dd hh:mm'):""
|
|
|
+
|
|
|
+ }
|
|
|
},
|
|
|
];
|
|
|
|