|
@@ -23,7 +23,7 @@
|
|
|
style="width: 244px"
|
|
style="width: 244px"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="table-layout" v-if="origin.length">
|
|
|
|
|
|
|
+ <div class="table-layout">
|
|
|
<Tabs v-model:activeKey="type">
|
|
<Tabs v-model:activeKey="type">
|
|
|
<TabPane v-for="current in types" :key="current" :tab="current">
|
|
<TabPane v-for="current in types" :key="current" :tab="current">
|
|
|
<Table
|
|
<Table
|
|
@@ -45,13 +45,13 @@
|
|
|
</TabPane>
|
|
</TabPane>
|
|
|
</Tabs>
|
|
</Tabs>
|
|
|
</div>
|
|
</div>
|
|
|
- <div style="padding: 1px" v-else>
|
|
|
|
|
|
|
+ <!-- <div style="padding: 1px" v-else>
|
|
|
<Empty
|
|
<Empty
|
|
|
:description="keyword.length ? $t('sys.unSearchData') : $t('sys.undata')"
|
|
:description="keyword.length ? $t('sys.unSearchData') : $t('sys.undata')"
|
|
|
:image="Empty.PRESENTED_IMAGE_SIMPLE"
|
|
:image="Empty.PRESENTED_IMAGE_SIMPLE"
|
|
|
className="ant-empty ant-empty-normal"
|
|
className="ant-empty ant-empty-normal"
|
|
|
/>
|
|
/>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div> -->
|
|
|
</div>
|
|
</div>
|
|
|
</Modal>
|
|
</Modal>
|
|
|
|
|
|
|
@@ -118,17 +118,23 @@ const handleTableChange: TableProps["onChange"] = (pag) => {
|
|
|
params.value.pageSize = pag.pageSize!;
|
|
params.value.pageSize = pag.pageSize!;
|
|
|
params.value.pageNum = pag.current!;
|
|
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 meshList = ref<Scene[]>([])
|
|
|
const cloudList = ref<Scene[]>([])
|
|
const cloudList = ref<Scene[]>([])
|
|
|
const params = computed(() => type.value === ui18n.t('scene.typeRaws.0') ? meshParams.value : cloudParams.value)
|
|
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
|
|
let loadCount = 0
|
|
|
watchEffect(() => {
|
|
watchEffect(() => {
|
|
|
const list = type.value === ui18n.t('scene.typeRaws.2') ? meshList : cloudList
|
|
const list = type.value === ui18n.t('scene.typeRaws.2') ? meshList : cloudList
|
|
|
const currentCount = ++loadCount
|
|
const currentCount = ++loadCount
|
|
|
- fetchScenesAll(params.value).then((data) => {
|
|
|
|
|
|
|
+ fetchScenesAll({...params.value, sceneName: keyword.value, }).then((data) => {
|
|
|
console.log('====>', currentCount, loadCount, params.value)
|
|
console.log('====>', currentCount, loadCount, params.value)
|
|
|
if (currentCount === loadCount) {
|
|
if (currentCount === loadCount) {
|
|
|
|
|
|
|
@@ -145,7 +151,7 @@ const typeFilterScenes = computed(() => {
|
|
|
const typeScenes: any = {};
|
|
const typeScenes: any = {};
|
|
|
for (const type of types.value) {
|
|
for (const type of types.value) {
|
|
|
typeScenes[type] = origin.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);
|
|
.filter((item) => item.type === type);
|
|
|
}
|
|
}
|
|
|
return typeScenes;
|
|
return typeScenes;
|
|
@@ -165,12 +171,21 @@ const rowSelection: any = ref({
|
|
|
|
|
|
|
|
hideSelectAll: true,
|
|
hideSelectAll: true,
|
|
|
onChange: (ids: string[]) => {
|
|
onChange: (ids: string[]) => {
|
|
|
- console.error(ids)
|
|
|
|
|
|
|
+ const key = typeFilterScenes.value[type.value].map((item: any) => item.num).join('')
|
|
|
ids = ids.filter(id => !selectIds.value.includes(id))
|
|
ids = ids.filter(id => !selectIds.value.includes(id))
|
|
|
- cache[type.value] = ids
|
|
|
|
|
|
|
+ if (!cache[type.value]) {
|
|
|
|
|
+ cache[type.value] = {}
|
|
|
|
|
+ }
|
|
|
|
|
+ cache[type.value][key] = ids
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
const curIds = [...selectIds.value]
|
|
const curIds = [...selectIds.value]
|
|
|
- for (const key in cache) {
|
|
|
|
|
- curIds.push(...cache[key])
|
|
|
|
|
|
|
+ for (const keyp in cache) {
|
|
|
|
|
+ for (const key in cache[keyp]) {
|
|
|
|
|
+ curIds.push(...cache[keyp][key])
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
selects.value = curIds
|
|
selects.value = curIds
|
|
|
},
|
|
},
|
|
@@ -214,19 +229,19 @@ const addModelHandler = createLoadPack(async (attachs: any[]) => {
|
|
|
if (fuseModelsLoaded.value) {
|
|
if (fuseModelsLoaded.value) {
|
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
|
stop();
|
|
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 asyncTimeout(100);
|
|
|
await save();
|
|
await save();
|
|
@@ -264,6 +279,7 @@ const selectModel = async () => {
|
|
|
});
|
|
});
|
|
|
if (!list?.length) return;
|
|
if (!list?.length) return;
|
|
|
list = list.filter(item => item.uploadId)
|
|
list = list.filter(item => item.uploadId)
|
|
|
|
|
+
|
|
|
// const modelList = await Promise.all(list.map(item => uploadMaterialToModel(item.uploadId!)))
|
|
// const modelList = await Promise.all(list.map(item => uploadMaterialToModel(item.uploadId!)))
|
|
|
const attachs: any[] = []
|
|
const attachs: any[] = []
|
|
|
for (let i = 0; i < list.length; i++) {
|
|
for (let i = 0; i < list.length; i++) {
|