|
|
@@ -6,9 +6,9 @@
|
|
|
<!-- <editInspection :caseId="caseId" :currentRecord="currentRecord" :editOrShow="editOrShow" ref="editInspectionRef" /> -->
|
|
|
<photoEdit :caseId="caseId" :title="pageTitle" ref="photoEditRef" />
|
|
|
<!-- 查看页 -->
|
|
|
- <showIndex :caseId="caseId" :currentRecord="currentRecord" :fromRoute="fromRoute" :processingIds="processingIds" :recentAddedItem="recentAddedItem" @playVideo="playVideo" v-if="editOrShow === 'show'" />
|
|
|
+ <showIndex :caseId="caseId" :currentRecord="currentRecord" :fromRoute="fromRoute" @showItem="showItem" :processingIds="processingIds" :recentAddedItem="recentAddedItem" @playVideo="playVideo" v-if="editOrShow === 'show'" />
|
|
|
<!-- 编辑页 -->
|
|
|
- <editIndex :caseId="caseId" :currentRecord="currentRecord" :fromRoute="fromRoute" :processingIds="processingIds" :recentAddedItem="recentAddedItem" @start="startShot" @playVideo="playVideo" v-else />
|
|
|
+ <editIndex :caseId="caseId" :currentRecord="currentRecord" :fromRoute="fromRoute" @showItem="showItem" :processingIds="processingIds" :recentAddedItem="recentAddedItem" @start="startShot" @playVideo="playVideo" v-else />
|
|
|
</div>
|
|
|
<shot v-if="isShot" @close="closeHandler" @append="appendFragment" @playVideo="playVideo"
|
|
|
@updateCover="(cover: string) => $emit('updateCover', cover)" @deleteRecord="$emit('delete')" :record="record" />
|
|
|
@@ -41,6 +41,7 @@ import editIndex from './editIndex.vue';
|
|
|
import { copyCase, updateCaseInfo, exportCaseDetailInfo, getCaseDetailInfo, getCaseInquestInfo, exportCaseInquestInfo } from "@/store/case";
|
|
|
import { getCaseInfoOffline as getCaseInfo, getCaseSceneListOffline as getCaseSceneList, uploadRecordFragments, getUploadRecordProgress } from "@/store/editCsae";
|
|
|
import { RouteName, router } from "@/router";
|
|
|
+import { getFusionAndSceneList, caseFilesTypeGetTree, getRecordCaseVideo } from '@/store/editCsae';
|
|
|
import shot from './components/shot.vue';
|
|
|
import headerTop from './components/headerTop.vue';
|
|
|
import editFilePage from './editFilePage.vue';
|
|
|
@@ -72,6 +73,13 @@ const editFilePageRef = ref<any>(null);
|
|
|
const editInspectionRef = ref<any>(null);
|
|
|
const photoEditRef = ref<any>(null);
|
|
|
const currentRecord = ref<any>({}); // 当前的caseID获取的row
|
|
|
+const fusionList = ref([]);
|
|
|
+const scenes = ref([]);
|
|
|
+const showObj = ref<any>({
|
|
|
+ siteInspection: true,
|
|
|
+ otherFiles: true,
|
|
|
+ screenRecord: true
|
|
|
+});
|
|
|
const pageTitle = computed(() => {
|
|
|
const cr: any = currentRecord.value || {};
|
|
|
return cr?.caseTitle || cr?.tmProject?.projectName || '';
|
|
|
@@ -107,7 +115,53 @@ const loadCaseInfo = async () => {
|
|
|
vueRouter.replace({ name: RouteName.noCase, query: {} });
|
|
|
}
|
|
|
};
|
|
|
-
|
|
|
+const recursiveSearch = (nodes) => {
|
|
|
+ // 如果没有节点,直接返回
|
|
|
+ if (!nodes || !nodes.length) return;
|
|
|
+
|
|
|
+ // 遍历当前节点
|
|
|
+ for (const node of nodes) {
|
|
|
+ // 检查是否符合条件
|
|
|
+ if (node.caseFilesList && node.caseFilesList.length > 0 && node.caseFilesList.some(file => file.filesUrl)) {
|
|
|
+ // 如果只需要第一个,直接返回
|
|
|
+ return true; // 终止递归
|
|
|
+ }
|
|
|
+
|
|
|
+ // 如果有子节点,递归查询
|
|
|
+ if (node.childrenList && node.childrenList.length) {
|
|
|
+ const found = recursiveSearch(node.childrenList);
|
|
|
+ // 如果已经找到第一个,终止递归
|
|
|
+ if(found){
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+const initData = async () => {
|
|
|
+ getFusionAndSceneList({ caseId: caseId.value, type: 'scene' }).then(res => {
|
|
|
+ console.log('getFusionAndSceneList', res)
|
|
|
+ scenes.value = res || []
|
|
|
+ })
|
|
|
+ getFusionAndSceneList({ caseId: caseId.value, type: 'fusion' }).then(res => {
|
|
|
+ console.log('getFusionAndSceneList', res)
|
|
|
+ fusionList.value = res || []
|
|
|
+ })
|
|
|
+
|
|
|
+ caseFilesTypeGetTree(caseId.value).then(res => {
|
|
|
+ showObj.value.siteInspection = recursiveSearch(res.filter(item => item.filesTypeName != '其他资料'))
|
|
|
+ showObj.value.otherFiles = recursiveSearch(res.filter(item => item.filesTypeName == '其他资料'))
|
|
|
+ console.log('caseFilesTypeGetTree', res, showObj.value)
|
|
|
+ // fusionList.value = res || []
|
|
|
+ })
|
|
|
+ getRecordCaseVideo({ caseId: caseId.value }).then(res => {
|
|
|
+ console.log('getRecordCaseVideo', res)
|
|
|
+ showObj.value.screenRecord = res.length > 0;
|
|
|
+ })
|
|
|
+ // const res: any = await caseFilesTypeGetTree(caseId.value!);
|
|
|
+}
|
|
|
+initData()
|
|
|
onMounted(() => {
|
|
|
// 路由守卫已校验分享密码,这里正常加载基本信息
|
|
|
setTimeout(() => {
|
|
|
@@ -291,7 +345,19 @@ const closePreview = () => {
|
|
|
previewVisible.value = false;
|
|
|
palyUrl.value = null;
|
|
|
}
|
|
|
-
|
|
|
+const showItem = (item) => {
|
|
|
+ console.log(item, 'showItem')
|
|
|
+ if(editOrShow.value === 'edit') return true;
|
|
|
+ if(!item) return false;
|
|
|
+ switch (item.key) {
|
|
|
+ case 'scene': return scenes.value.length;
|
|
|
+ case 'mix3d': return fusionList.value.length; // 暂时隐藏
|
|
|
+ case 'siteInspection': return showObj.value.siteInspection; // 暂时隐藏
|
|
|
+ case 'otherFiles': return showObj.value.otherFiles; // 暂时隐藏
|
|
|
+ case 'screenRecord': return showObj.value.screenRecord; // 暂时隐藏
|
|
|
+ default: return true;
|
|
|
+ }
|
|
|
+}
|
|
|
const saveEditSub = async () => {
|
|
|
// 根据当前子编辑页选择对应组件保存
|
|
|
const sub = route.query.editSub as string | '';
|