|
|
@@ -28,9 +28,7 @@
|
|
|
<el-button :icon="Refresh" :disabled="!hasBg"> 替换照片 </el-button>
|
|
|
</el-upload>
|
|
|
|
|
|
- <el-button :icon="Refresh" :disabled="!hasBg" @click="clearLayout">
|
|
|
- 重置布局
|
|
|
- </el-button>
|
|
|
+ <el-button :icon="Refresh" :disabled="!hasBg" @click="clearLayout"> 重置布局 </el-button>
|
|
|
|
|
|
<el-button @click="handleSave" type="primary" :disabled="!companyId"> 保存 </el-button>
|
|
|
</div>
|
|
|
@@ -81,9 +79,7 @@
|
|
|
:headers="getHeaders()"
|
|
|
>
|
|
|
<img src="~@/assets/images/img-upload.png" />
|
|
|
- <div class="upload-tips-text">
|
|
|
- 请上传1920*1080尺寸的布局背景图,其他尺寸会影响布局准确性!
|
|
|
- </div>
|
|
|
+ <div class="upload-tips-text"> 请上传1920*1080尺寸的布局背景图,其他尺寸会影响布局准确性! </div>
|
|
|
</el-upload>
|
|
|
</div>
|
|
|
<div class="shop-tag-edit-area" v-if="hasBg">
|
|
|
@@ -91,12 +87,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <ConfigFinish
|
|
|
- :visible="visibleResult"
|
|
|
- :status="configStatus"
|
|
|
- @on-close="closeResult"
|
|
|
- class="feedback-position"
|
|
|
- />
|
|
|
+ <ConfigFinish :visible="visibleResult" :status="configStatus" @on-close="closeResult" class="feedback-position" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -127,8 +118,7 @@
|
|
|
import { ViewType } from '@/types/page-config/type';
|
|
|
|
|
|
const mapEditor = useMapEditor();
|
|
|
- const { bgImg, addedShops, activeShopId, showShops, mapHeight, mapWidth } =
|
|
|
- storeToRefs(mapEditor);
|
|
|
+ const { bgImg, addedShops, activeShopId, showShops, mapHeight, mapWidth } = storeToRefs(mapEditor);
|
|
|
const { addShop, addBg, calcLayout, resetMap, createMap, deleteShop } = mapEditor;
|
|
|
|
|
|
const router = useRouter();
|
|
|
@@ -148,7 +138,7 @@
|
|
|
|
|
|
const companyId = ref<number>();
|
|
|
const companyName = ref<string>();
|
|
|
- const viewType = ref<number>();
|
|
|
+ const viewType = ref<ViewType>();
|
|
|
|
|
|
const shopList = ref<ShopType[]>([]); // 车间列表
|
|
|
|
|
|
@@ -156,20 +146,13 @@
|
|
|
const mapContainerStageSize = reactive({ height: 0, width: 0 });
|
|
|
// // mapContainer缩放比例
|
|
|
const scale = computed(() =>
|
|
|
- Math.min(
|
|
|
- mapContainerStageSize.width / mapWidth.value,
|
|
|
- mapContainerStageSize.height / mapHeight.value,
|
|
|
- ),
|
|
|
+ Math.min(mapContainerStageSize.width / mapWidth.value, mapContainerStageSize.height / mapHeight.value),
|
|
|
);
|
|
|
|
|
|
const defaultLayoutString = ref(''); // 默认布局的string,用于点击返回时判断是否未保存布局就离开
|
|
|
|
|
|
const handleBeforeUpload = (rawFile) => {
|
|
|
- if (
|
|
|
- rawFile.type !== 'image/jpg' &&
|
|
|
- rawFile.type !== 'image/jpeg' &&
|
|
|
- rawFile.type !== 'image/png'
|
|
|
- ) {
|
|
|
+ if (rawFile.type !== 'image/jpg' && rawFile.type !== 'image/jpeg' && rawFile.type !== 'image/png') {
|
|
|
ElMessage.error('请上传jpg、jpeg、png格式的图片!');
|
|
|
return false;
|
|
|
}
|
|
|
@@ -317,6 +300,7 @@
|
|
|
layout,
|
|
|
targetId: companyId.value || 2,
|
|
|
labelId: label.value || 1,
|
|
|
+ viewType: viewType.value!,
|
|
|
};
|
|
|
if (!layoutId.value) {
|
|
|
uploadCompanyLayout(param).then((res) => {
|
|
|
@@ -324,11 +308,9 @@
|
|
|
ElMessage.success('保存成功');
|
|
|
});
|
|
|
} else {
|
|
|
- updateCompanyLayout({ ...param, id: layoutId.value, viewType: viewType.value! }).then(
|
|
|
- (_res) => {
|
|
|
- ElMessage.success('更新成功');
|
|
|
- },
|
|
|
- );
|
|
|
+ updateCompanyLayout({ ...param, id: layoutId.value }).then((_res) => {
|
|
|
+ ElMessage.success('更新成功');
|
|
|
+ });
|
|
|
}
|
|
|
defaultLayoutString.value = layout;
|
|
|
};
|
|
|
@@ -383,7 +365,6 @@
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
-
|
|
|
.page-head {
|
|
|
height: 54px;
|
|
|
padding-left: 15px;
|