|
|
@@ -37,7 +37,7 @@
|
|
|
/>
|
|
|
<div style="padding: 1px" v-else>
|
|
|
<Empty
|
|
|
- :description="$t('sys.unSearchData')"
|
|
|
+ description="暂无搜索结果"
|
|
|
:image="Empty.PRESENTED_IMAGE_SIMPLE"
|
|
|
className="ant-empty ant-empty-normal"
|
|
|
/>
|
|
|
@@ -118,17 +118,23 @@ const handleTableChange: TableProps["onChange"] = (pag) => {
|
|
|
params.value.pageSize = pag.pageSize!;
|
|
|
params.value.pageNum = pag.current!;
|
|
|
};
|
|
|
-const meshParams = ref({ isObj: 1, pageNum: 1, pageSize: 12, total: 0 })
|
|
|
-const cloudParams = ref({ isObj: 0, pageNum: 1, pageSize: 12, total: 0 })
|
|
|
+const meshParams = ref({ isObj: 1, pageNum: 1, pageSize: 12, total: 0, sceneName: '' })
|
|
|
+const cloudParams = ref({ isObj: 0, pageNum: 1, pageSize: 12, total: 0, sceneName: '' })
|
|
|
const meshList = ref<Scene[]>([])
|
|
|
const cloudList = ref<Scene[]>([])
|
|
|
const params = computed(() => type.value === ui18n.t('scene.typeRaws.0') ? meshParams.value : cloudParams.value)
|
|
|
|
|
|
+watch(
|
|
|
+ () => keyword.value,
|
|
|
+ () => (params.value.pageNum = 1),
|
|
|
+ { flush: "sync" }
|
|
|
+);
|
|
|
+
|
|
|
let loadCount = 0
|
|
|
watchEffect(() => {
|
|
|
const list = type.value === ui18n.t('scene.typeRaws.2') ? meshList : cloudList
|
|
|
const currentCount = ++loadCount
|
|
|
- fetchScenesAll(params.value).then((data) => {
|
|
|
+ fetchScenesAll({...params.value, sceneName: keyword.value, }).then((data) => {
|
|
|
console.log('====>', currentCount, loadCount, params.value)
|
|
|
if (currentCount === loadCount) {
|
|
|
|
|
|
@@ -145,7 +151,7 @@ const typeFilterScenes = computed(() => {
|
|
|
const typeScenes: any = {};
|
|
|
for (const type of types.value) {
|
|
|
typeScenes[type] = origin.value
|
|
|
- .filter((item) => item.name && item.num && item.name.includes(keyword.value))
|
|
|
+ .filter((item) => item.name && item.num )
|
|
|
.filter((item) => item.type === type);
|
|
|
}
|
|
|
return typeScenes;
|
|
|
@@ -214,19 +220,19 @@ const addModelHandler = createLoadPack(async (attachs: any[]) => {
|
|
|
if (fuseModelsLoaded.value) {
|
|
|
nextTick(() => {
|
|
|
stop();
|
|
|
- resolve();
|
|
|
+ setTimeout(resolve, 500)
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- items.forEach(item => {
|
|
|
- console.error('--->', item, getSceneModel(item.data), sceneModelMap)
|
|
|
- if (getSceneModel(item.data)) {
|
|
|
- item.data.rotation = getSceneModel(item.data)!.getDefaultRotation();
|
|
|
- console.log('rotate', item.data.rotation)
|
|
|
+ addModels.forEach(item => {
|
|
|
+ if (getSceneModel(item)) {
|
|
|
+ item.rotation = getSceneModel(item)!.getDefaultRotation();
|
|
|
+ // getSceneModel(item)!.putInFrontOfCam()
|
|
|
}
|
|
|
+
|
|
|
});
|
|
|
await asyncTimeout(100);
|
|
|
await save();
|
|
|
@@ -264,6 +270,7 @@ const selectModel = async () => {
|
|
|
});
|
|
|
if (!list?.length) return;
|
|
|
list = list.filter(item => item.uploadId)
|
|
|
+
|
|
|
// const modelList = await Promise.all(list.map(item => uploadMaterialToModel(item.uploadId!)))
|
|
|
const attachs: any[] = []
|
|
|
for (let i = 0; i < list.length; i++) {
|