|
|
@@ -15,7 +15,7 @@
|
|
|
:disabled="!hasBg">
|
|
|
重置布局
|
|
|
</el-button>
|
|
|
- <el-button @click="handleSave" type="primary"><img :src="SaveIcon">保存为布局</el-button>
|
|
|
+ <el-button @click="handleSave" type="primary">保存</el-button>
|
|
|
</section>
|
|
|
</header>
|
|
|
|
|
|
@@ -58,7 +58,6 @@
|
|
|
<script setup lang="ts">
|
|
|
import { ElMessage, ElInput, ElMessageBox } from 'element-plus';
|
|
|
import { Search, Refresh, UploadFilled } from '@element-plus/icons-vue';
|
|
|
-import SaveIcon from '@/assets/images/camera/save.png'
|
|
|
import rollback from '@/assets/rollback.png'
|
|
|
import { onMounted, onUnmounted, ref, computed, reactive, nextTick } from 'vue';
|
|
|
import { updateMinMapViewLayoutApi, getCamerasByWorkShopId, getWorkshopMiniMapLayoutPCApi, getWorkshopMiniMapLayoutMobileApi } from '@/api/scene/scene';
|
|
|
@@ -244,6 +243,10 @@ const handleAddCamera = (cameraId: string, index: number) => {
|
|
|
|
|
|
const handleSave = () => {
|
|
|
isMap.value = true;
|
|
|
+ if(!hasBg.value && isMap.value){
|
|
|
+ ElMessage.error('请先添加车间地图');
|
|
|
+ return;
|
|
|
+ }
|
|
|
const layout = konvaMap.value.saveLayout();
|
|
|
const cameraList = JSON.parse(layout).cameraList;
|
|
|
if (cameraList.length === 0 && hasBg.value) {
|
|
|
@@ -344,7 +347,6 @@ onBeforeRouteLeave(async () => {
|
|
|
|
|
|
img {
|
|
|
width: 14px;
|
|
|
- margin-right: 6px;
|
|
|
}
|
|
|
}
|
|
|
}
|