|
@@ -1,5 +1,10 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <div class="shop-tag-edit-area">
|
|
|
|
|
|
|
+ <div
|
|
|
|
|
+ class="shop-tag-edit-area"
|
|
|
|
|
+ :style="{
|
|
|
|
|
+ opacity: editShop.id === undefined ? 0.4 : 1,
|
|
|
|
|
+ }"
|
|
|
|
|
+ >
|
|
|
<div>
|
|
<div>
|
|
|
<div class="content-title"
|
|
<div class="content-title"
|
|
|
><div class="uploader-title"> <div class="block"></div>标签设置</div>
|
|
><div class="uploader-title"> <div class="block"></div>标签设置</div>
|
|
@@ -11,22 +16,30 @@
|
|
|
src="~@/assets/icons/layout-left.png"
|
|
src="~@/assets/icons/layout-left.png"
|
|
|
alt=""
|
|
alt=""
|
|
|
@click="posAdj(LabelPositionEnum.LEFT)"
|
|
@click="posAdj(LabelPositionEnum.LEFT)"
|
|
|
- style="margin-right: 19px; cursor: pointer"
|
|
|
|
|
- :class="{ active: editShop.posType === LabelPositionEnum.LEFT }"
|
|
|
|
|
|
|
+ style="margin-right: 19px"
|
|
|
|
|
+ :class="{
|
|
|
|
|
+ active: editShop.posType === LabelPositionEnum.LEFT || editShop.id === undefined,
|
|
|
|
|
+ labelActionable: editShop.id !== undefined,
|
|
|
|
|
+ }"
|
|
|
/>
|
|
/>
|
|
|
<img
|
|
<img
|
|
|
src="~@/assets/icons/layout-right.png"
|
|
src="~@/assets/icons/layout-right.png"
|
|
|
alt=""
|
|
alt=""
|
|
|
@click="posAdj(LabelPositionEnum.RIGHT)"
|
|
@click="posAdj(LabelPositionEnum.RIGHT)"
|
|
|
- style="margin-right: 17px; cursor: pointer"
|
|
|
|
|
- :class="{ active: editShop.posType === LabelPositionEnum.RIGHT }"
|
|
|
|
|
|
|
+ style="margin-right: 17px"
|
|
|
|
|
+ :class="{
|
|
|
|
|
+ active: editShop.posType === LabelPositionEnum.RIGHT,
|
|
|
|
|
+ labelActionable: editShop.id !== undefined,
|
|
|
|
|
+ }"
|
|
|
/>
|
|
/>
|
|
|
<img
|
|
<img
|
|
|
src="~@/assets/icons/layout-top.png"
|
|
src="~@/assets/icons/layout-top.png"
|
|
|
alt=""
|
|
alt=""
|
|
|
- style="cursor: pointer"
|
|
|
|
|
@click="posAdj(LabelPositionEnum.TOP)"
|
|
@click="posAdj(LabelPositionEnum.TOP)"
|
|
|
- :class="{ active: editShop.posType === LabelPositionEnum.TOP }"
|
|
|
|
|
|
|
+ :class="{
|
|
|
|
|
+ active: editShop.posType === LabelPositionEnum.TOP,
|
|
|
|
|
+ labelActionable: editShop.id !== undefined,
|
|
|
|
|
+ }"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -37,7 +50,7 @@
|
|
|
v-model.number="editShop.x"
|
|
v-model.number="editShop.x"
|
|
|
type="number"
|
|
type="number"
|
|
|
class="no_number"
|
|
class="no_number"
|
|
|
- style="max-width: 100px"
|
|
|
|
|
|
|
+ :disabled="editShop.id === undefined"
|
|
|
>
|
|
>
|
|
|
<template #prepend>X</template>
|
|
<template #prepend>X</template>
|
|
|
</el-input>
|
|
</el-input>
|
|
@@ -45,7 +58,7 @@
|
|
|
v-model.number="editShop.y"
|
|
v-model.number="editShop.y"
|
|
|
type="number"
|
|
type="number"
|
|
|
class="no_number"
|
|
class="no_number"
|
|
|
- style="max-width: 100px"
|
|
|
|
|
|
|
+ :disabled="editShop.id === undefined"
|
|
|
>
|
|
>
|
|
|
<template #prepend>Y</template>
|
|
<template #prepend>Y</template>
|
|
|
</el-input>
|
|
</el-input>
|
|
@@ -58,7 +71,7 @@
|
|
|
v-model.number="editShop.scaleX"
|
|
v-model.number="editShop.scaleX"
|
|
|
type="number"
|
|
type="number"
|
|
|
class="no_number"
|
|
class="no_number"
|
|
|
- style="max-width: 100px"
|
|
|
|
|
|
|
+ :disabled="editShop.id === undefined"
|
|
|
>
|
|
>
|
|
|
<template #prepend>W</template>
|
|
<template #prepend>W</template>
|
|
|
</el-input>
|
|
</el-input>
|
|
@@ -66,7 +79,7 @@
|
|
|
v-model.number="editShop.scaleY"
|
|
v-model.number="editShop.scaleY"
|
|
|
type="number"
|
|
type="number"
|
|
|
class="no_number"
|
|
class="no_number"
|
|
|
- style="max-width: 100px"
|
|
|
|
|
|
|
+ :disabled="editShop.id === undefined"
|
|
|
>
|
|
>
|
|
|
<template #prepend>H</template>
|
|
<template #prepend>H</template>
|
|
|
</el-input>
|
|
</el-input>
|
|
@@ -87,6 +100,7 @@
|
|
|
show-alpha
|
|
show-alpha
|
|
|
size="small"
|
|
size="small"
|
|
|
color-format="rgb"
|
|
color-format="rgb"
|
|
|
|
|
+ :disabled="editShop.id === undefined"
|
|
|
/><div class="color-content">{{ showColor[0] }} {{ showColor[1] }}</div>
|
|
/><div class="color-content">{{ showColor[0] }} {{ showColor[1] }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -102,6 +116,7 @@
|
|
|
class="fontsize-select"
|
|
class="fontsize-select"
|
|
|
style="width: 50px"
|
|
style="width: 50px"
|
|
|
size="small"
|
|
size="small"
|
|
|
|
|
+ :disabled="editShop.id === undefined"
|
|
|
>
|
|
>
|
|
|
<el-option
|
|
<el-option
|
|
|
v-for="(item, index) in fontSizeList"
|
|
v-for="(item, index) in fontSizeList"
|
|
@@ -111,21 +126,27 @@
|
|
|
/>
|
|
/>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
<div class="color-fontsize-select">
|
|
<div class="color-fontsize-select">
|
|
|
- <el-color-picker v-model="editShop.fontColor" color-format="hex" size="small" />
|
|
|
|
|
|
|
+ <el-color-picker
|
|
|
|
|
+ v-model="editShop.fontColor"
|
|
|
|
|
+ color-format="hex"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ :disabled="editShop.id === undefined"
|
|
|
|
|
+ />
|
|
|
<div class="color-fontSize-content">{{ editShop.fontColor }}</div>
|
|
<div class="color-fontSize-content">{{ editShop.fontColor }}</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<hr />
|
|
<hr />
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="save-wrapper">
|
|
|
|
|
|
|
+ <!-- <div class="save-wrapper">
|
|
|
<el-button type="primary" @click="deleteShop">删除</el-button>
|
|
<el-button type="primary" @click="deleteShop">删除</el-button>
|
|
|
- </div>
|
|
|
|
|
|
|
+ </div> -->
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
- import { computed } from 'vue';
|
|
|
|
|
|
|
+ import { computed, watch } from 'vue';
|
|
|
import { storeToRefs } from 'pinia';
|
|
import { storeToRefs } from 'pinia';
|
|
|
|
|
+ import { cloneDeep } from 'lodash-es';
|
|
|
import { colorRGB2Hex } from '@/utils';
|
|
import { colorRGB2Hex } from '@/utils';
|
|
|
import useMapEditor, { LabelPositionEnum, MapWorkShopInfoItem } from '../stores/useMapEditor';
|
|
import useMapEditor, { LabelPositionEnum, MapWorkShopInfoItem } from '../stores/useMapEditor';
|
|
|
|
|
|
|
@@ -134,13 +155,17 @@
|
|
|
const mapEditor = useMapEditor();
|
|
const mapEditor = useMapEditor();
|
|
|
const { addedShops, showShops, activeShopId } = storeToRefs(mapEditor);
|
|
const { addedShops, showShops, activeShopId } = storeToRefs(mapEditor);
|
|
|
const fontSizeList = Array.from({ length: 11 }, (_, index) => index + 10);
|
|
const fontSizeList = Array.from({ length: 11 }, (_, index) => index + 10);
|
|
|
- const showColor = computed(() => colorRGB2Hex(editShop.value!.bgColor));
|
|
|
|
|
|
|
+ const showColor = computed(() =>
|
|
|
|
|
+ colorRGB2Hex(editShop.value!.bgColor)[0]
|
|
|
|
|
+ ? colorRGB2Hex(editShop.value!.bgColor)
|
|
|
|
|
+ : ['#3aaad1', '100%'],
|
|
|
|
|
+ );
|
|
|
|
|
|
|
|
const editShop = computed(() => {
|
|
const editShop = computed(() => {
|
|
|
const val =
|
|
const val =
|
|
|
showShops.value.find((item) => {
|
|
showShops.value.find((item) => {
|
|
|
return item.id === Number(activeShopId.value);
|
|
return item.id === Number(activeShopId.value);
|
|
|
- }) || ({} as MapWorkShopInfoItem);
|
|
|
|
|
|
|
+ }) || ({ fontSize: 14, fontColor: '#ffffff' } as MapWorkShopInfoItem);
|
|
|
return val;
|
|
return val;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -155,6 +180,14 @@
|
|
|
addedShops.value = addedShops.value.filter((x) => x.id != tempId);
|
|
addedShops.value = addedShops.value.filter((x) => x.id != tempId);
|
|
|
activeShopId.value = undefined;
|
|
activeShopId.value = undefined;
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+ watch(
|
|
|
|
|
+ () => editShop.value,
|
|
|
|
|
+ () => {
|
|
|
|
|
+ addedShops.value = cloneDeep(showShops.value);
|
|
|
|
|
+ },
|
|
|
|
|
+ { deep: true },
|
|
|
|
|
+ );
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
@@ -224,7 +257,6 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.label-setting-content {
|
|
.label-setting-content {
|
|
|
- display: flex;
|
|
|
|
|
margin-top: 12px;
|
|
margin-top: 12px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -234,7 +266,6 @@
|
|
|
background: #f5f5f5;
|
|
background: #f5f5f5;
|
|
|
border-radius: 2px;
|
|
border-radius: 2px;
|
|
|
display: flex;
|
|
display: flex;
|
|
|
-
|
|
|
|
|
margin-top: 12px;
|
|
margin-top: 12px;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -242,11 +273,23 @@
|
|
|
background-color: #cbcdce;
|
|
background-color: #cbcdce;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .labelActionable {
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.save-wrapper {
|
|
.save-wrapper {
|
|
|
margin-top: 40px;
|
|
margin-top: 40px;
|
|
|
text-align: center;
|
|
text-align: center;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .el-input {
|
|
|
|
|
+ width: 180px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ::v-deep .el-input-group__prepend {
|
|
|
|
|
+ width: 10px;
|
|
|
|
|
+ padding: 0 10px;
|
|
|
|
|
+ }
|
|
|
::v-deep .no_number input::-webkit-inner-spin-button,
|
|
::v-deep .no_number input::-webkit-inner-spin-button,
|
|
|
::v-deep .no_number input::-webkit-outer-spin-button {
|
|
::v-deep .no_number input::-webkit-outer-spin-button {
|
|
|
-webkit-appearance: none !important;
|
|
-webkit-appearance: none !important;
|