|
@@ -15,8 +15,7 @@
|
|
|
<el-card v-for="layout in layoutList" :key="layout.id" shadow="hover" class="layout-cards">
|
|
<el-card v-for="layout in layoutList" :key="layout.id" shadow="hover" class="layout-cards">
|
|
|
<div class="layout-card" @click="handleClickCompany(layout.id, layout.name)">
|
|
<div class="layout-card" @click="handleClickCompany(layout.id, layout.name)">
|
|
|
<div v-if="layout.layout">
|
|
<div v-if="layout.layout">
|
|
|
- <MapContainerSmall ref="mapContainerRef" :bg-image-url="layout.layout" :show-shops="layout.shopList"
|
|
|
|
|
- class="content-pic" />
|
|
|
|
|
|
|
+ <SmallMapContainer :bg-image-url="layout.layout" :show-shops="layout.shopList" />
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div v-else>
|
|
<div v-else>
|
|
@@ -25,11 +24,12 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
- <span class="footer--default">{{ layout.name }}</span>
|
|
|
|
|
|
|
+ <el-tooltip popper-class="tooltip--custom" effect="dark" :content="layout.name" placement="bottom-start"
|
|
|
|
|
+ v-if="layout.name.length > 15">
|
|
|
|
|
+ <span class="footer--default footer-ellipsis">{{ layout.name }}</span>
|
|
|
|
|
+ </el-tooltip>
|
|
|
|
|
+ <span class="footer--default" v-else>{{ layout.name }}</span>
|
|
|
<div class="icons">
|
|
<div class="icons">
|
|
|
- <!-- <el-image v-if="layout.layout" :src="preview" :preview-src-list="[layout.layout]" hide-on-click-modal
|
|
|
|
|
- fit="cover" /> -->
|
|
|
|
|
-
|
|
|
|
|
<img :src="edit" @click="handleClickCompany(layout.id, layout.name)" />
|
|
<img :src="edit" @click="handleClickCompany(layout.id, layout.name)" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
@@ -52,7 +52,6 @@
|
|
|
import rollback from '@/assets/rollback.png';
|
|
import rollback from '@/assets/rollback.png';
|
|
|
import empty from '@/assets/images/table/table-empty.png';
|
|
import empty from '@/assets/images/table/table-empty.png';
|
|
|
import noLayout from '@/assets/images/page-config/no-layout.png';
|
|
import noLayout from '@/assets/images/page-config/no-layout.png';
|
|
|
-import preview from '@/assets/images/table/table-preview.png';
|
|
|
|
|
import edit from '@/assets/images/table/table-edit.png';
|
|
import edit from '@/assets/images/table/table-edit.png';
|
|
|
import router from '@/router';
|
|
import router from '@/router';
|
|
|
import { CompanyInfoList, LayoutInfoList } from '@/types/scene-layout/type';
|
|
import { CompanyInfoList, LayoutInfoList } from '@/types/scene-layout/type';
|
|
@@ -67,6 +66,10 @@ import {
|
|
|
} from '@/api/scene/scene';
|
|
} from '@/api/scene/scene';
|
|
|
import { computed, onMounted, ref } from 'vue';
|
|
import { computed, onMounted, ref } from 'vue';
|
|
|
import MapContainerSmall from '@/views/page-config/component/mapContainer/MapContainerSmall.vue';
|
|
import MapContainerSmall from '@/views/page-config/component/mapContainer/MapContainerSmall.vue';
|
|
|
|
|
+import WorkShopMapSmall from './workshopMap/WorkShopMapSmall.vue';
|
|
|
|
|
+const SmallMapContainer = computed(()=>{
|
|
|
|
|
+ return props.layoutType === LayoutConfigType.scene ? MapContainerSmall : WorkShopMapSmall
|
|
|
|
|
+})
|
|
|
const props = defineProps<{
|
|
const props = defineProps<{
|
|
|
layoutType: LayoutConfigType.scene | LayoutConfigType.camera
|
|
layoutType: LayoutConfigType.scene | LayoutConfigType.camera
|
|
|
}>()
|
|
}>()
|
|
@@ -123,16 +126,20 @@ const getLayoutInfoImg = (layoutType: LayoutConfigType.scene | LayoutConfigType.
|
|
|
scenePlatformApiMap[viewType]({ companyIds: idList }).then((res) => {
|
|
scenePlatformApiMap[viewType]({ companyIds: idList }).then((res) => {
|
|
|
res.map((companyWithLayout) => {
|
|
res.map((companyWithLayout) => {
|
|
|
let img
|
|
let img
|
|
|
|
|
+ let shopList
|
|
|
try {
|
|
try {
|
|
|
- img = JSON.parse(companyWithLayout.layout).bgInfo.img;
|
|
|
|
|
|
|
+ const layout = JSON.parse(companyWithLayout.layout)
|
|
|
|
|
+ img = layout.bgInfo.img;
|
|
|
|
|
+ shopList = layout.shopList;
|
|
|
} catch {
|
|
} catch {
|
|
|
- img = ''
|
|
|
|
|
|
|
+ img = '';
|
|
|
|
|
+ shopList = ''
|
|
|
}
|
|
}
|
|
|
const curCompany = layoutList.value.find(
|
|
const curCompany = layoutList.value.find(
|
|
|
(company) => company.id === companyWithLayout.targetId,
|
|
(company) => company.id === companyWithLayout.targetId,
|
|
|
);
|
|
);
|
|
|
curCompany!.layout = img;
|
|
curCompany!.layout = img;
|
|
|
- curCompany!.shopList = JSON.parse(companyWithLayout.layout).shopList;
|
|
|
|
|
|
|
+ curCompany!.shopList = shopList;
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
break;
|
|
break;
|
|
@@ -140,12 +147,18 @@ const getLayoutInfoImg = (layoutType: LayoutConfigType.scene | LayoutConfigType.
|
|
|
cameraPlatformApiMap[viewType]({ workshopIdList: idList }).then((res) => {
|
|
cameraPlatformApiMap[viewType]({ workshopIdList: idList }).then((res) => {
|
|
|
res.map((workshopWithLayout) => {
|
|
res.map((workshopWithLayout) => {
|
|
|
let img
|
|
let img
|
|
|
|
|
+ let shopList
|
|
|
try {
|
|
try {
|
|
|
- img = JSON.parse(workshopWithLayout.layout).bgImgUrl;
|
|
|
|
|
|
|
+ const layout = JSON.parse(workshopWithLayout.layout)
|
|
|
|
|
+ img = layout.bgImgUrl;
|
|
|
|
|
+ shopList = layout.cameraList;
|
|
|
} catch {
|
|
} catch {
|
|
|
img = ''
|
|
img = ''
|
|
|
|
|
+ shopList = ''
|
|
|
}
|
|
}
|
|
|
- layoutList.value.find((workshop) => workshop.id === workshopWithLayout.targetId)!.layout = img
|
|
|
|
|
|
|
+ const curWorkshop = layoutList.value.find((workshop) => workshop.id === workshopWithLayout.targetId)
|
|
|
|
|
+ curWorkshop!.layout = img;
|
|
|
|
|
+ curWorkshop!.shopList = shopList;
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
break;
|
|
break;
|
|
@@ -155,7 +168,7 @@ const getLayoutInfoImg = (layoutType: LayoutConfigType.scene | LayoutConfigType.
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
viewType.value = Number(router.currentRoute.value.query.viewType);
|
|
viewType.value = Number(router.currentRoute.value.query.viewType);
|
|
|
companyList.value = await getCompanyListApi();
|
|
companyList.value = await getCompanyListApi();
|
|
|
- if (!companyList.value) return;
|
|
|
|
|
|
|
+ if (!companyList.value || companyList.value.length === 0) return;
|
|
|
const savedCompanyId = sessionStorage.getItem('selectCompanyId');
|
|
const savedCompanyId = sessionStorage.getItem('selectCompanyId');
|
|
|
selectCompany.value = savedCompanyId ? Number(savedCompanyId) : companyList.value[0].id;
|
|
selectCompany.value = savedCompanyId ? Number(savedCompanyId) : companyList.value[0].id;
|
|
|
layoutList.value = await getLayoutInfoList(props.layoutType)
|
|
layoutList.value = await getLayoutInfoList(props.layoutType)
|
|
@@ -166,8 +179,14 @@ onMounted(async () => {
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.footer--default {
|
|
.footer--default {
|
|
|
|
|
+ width: 160px;
|
|
|
opacity: 0.45;
|
|
opacity: 0.45;
|
|
|
}
|
|
}
|
|
|
|
|
+.footer-ellipsis{
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
.scene-layout {
|
|
.scene-layout {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
@@ -291,3 +310,9 @@ onMounted(async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|
|
|
|
|
+<style>
|
|
|
|
|
+.tooltip--custom{
|
|
|
|
|
+ width: 200px;
|
|
|
|
|
+ opacity: 0.8;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|