|
@@ -25,19 +25,19 @@
|
|
|
>
|
|
|
{{ item.name }}
|
|
|
</div>
|
|
|
- <div class="tab-content2">
|
|
|
- <div
|
|
|
- v-for="(item, index) in menu[menuActive1].children[menuActive2].children"
|
|
|
- :key="index"
|
|
|
- :class="menuActive2 === index ? 'tab tab_active' : 'tab'"
|
|
|
- @click="clickTab3(item)"
|
|
|
- >
|
|
|
- {{ item.name }}
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
+ <div class="tab-content2">
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in menu[menuActive1].children[menuActive2].children"
|
|
|
+ :key="index"
|
|
|
+ :class="menuActive3 === index ? 'tab tab_active' : 'tab'"
|
|
|
+ @click="clickTab3(item, index)"
|
|
|
+ >
|
|
|
+ {{ item.name }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-show="menuActive1 === 1" class="tab-content">历史记录</div>
|
|
|
+ <div v-show="menuActive1 === 1" class="tab-content">历史预案</div>
|
|
|
<div v-show="textEditState.showTextEdit" class="text-edit-container">
|
|
|
<el-input v-model="textEditState.text" :rows="8" type="textarea" />
|
|
|
<div class="edit-box">
|
|
@@ -55,6 +55,8 @@
|
|
|
<el-button type="primary" size="large" @click="addText">确定</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <!--绘制提示信息-->
|
|
|
+ <div v-show="tipTitle !== ''" class="tipTitle">{{ tipTitle }}</div>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
@@ -70,8 +72,9 @@ const getMouseTool = inject('getMouseTool');
|
|
|
const updateMouseToolState = inject('updateMouseToolState');
|
|
|
const undo = inject('undo');
|
|
|
|
|
|
-const menuActive1 = ref(0);
|
|
|
-const menuActive2 = ref(0);
|
|
|
+const menuActive1 = ref<string | number>(0);
|
|
|
+const menuActive2 = ref<string | number>(0);
|
|
|
+const menuActive3 = ref<string | number>('');
|
|
|
const menu = ref([
|
|
|
{
|
|
|
name: '标绘工具',
|
|
@@ -80,10 +83,10 @@ const menu = ref([
|
|
|
name: '基本工具',
|
|
|
value: 'basicTools',
|
|
|
children: [
|
|
|
- {
|
|
|
- name: '直箭头',
|
|
|
- value: 'straightArrow'
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // name: '直箭头',
|
|
|
+ // value: 'straightArrow'
|
|
|
+ // },
|
|
|
{
|
|
|
name: '矩形',
|
|
|
value: 'rectangle'
|
|
@@ -92,10 +95,10 @@ const menu = ref([
|
|
|
name: '任意面',
|
|
|
value: 'polygon'
|
|
|
},
|
|
|
- {
|
|
|
- name: '任意线',
|
|
|
- value: 'anyLine'
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // name: '任意线',
|
|
|
+ // value: 'anyLine'
|
|
|
+ // },
|
|
|
{
|
|
|
name: '圆',
|
|
|
value: 'circle'
|
|
@@ -110,7 +113,7 @@ const menu = ref([
|
|
|
},
|
|
|
{
|
|
|
name: '面积',
|
|
|
- value: ''
|
|
|
+ value: 'measureArea'
|
|
|
}
|
|
|
]
|
|
|
},
|
|
@@ -150,6 +153,34 @@ const textEditState = reactive({
|
|
|
text: '',
|
|
|
lnglat: []
|
|
|
});
|
|
|
+watch(
|
|
|
+ () => props.drawing,
|
|
|
+ () => {
|
|
|
+ if (!props.drawing) {
|
|
|
+ menuActive3.value = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+);
|
|
|
+const tipTitle = computed(() => {
|
|
|
+ let res = '';
|
|
|
+ if (
|
|
|
+ menu.value[menuActive1.value] &&
|
|
|
+ menu.value[menuActive1.value].children &&
|
|
|
+ menu.value[menuActive1.value].children[menuActive2.value] &&
|
|
|
+ menu.value[menuActive1.value].children[menuActive2.value].children &&
|
|
|
+ menu.value[menuActive1.value].children[menuActive2.value].children[menuActive3.value]
|
|
|
+ ) {
|
|
|
+ const data = menu.value[menuActive1.value].children[menuActive2.value].children[menuActive3.value];
|
|
|
+ if (data.value === 'straightArrow') {
|
|
|
+ res = '单击开始、单击结束';
|
|
|
+ } else if (['rectangle', 'polygon', 'anyLine', 'circle'].includes(data.value)) {
|
|
|
+ res = '鼠标按住拖曳,松开鼠标结束标绘';
|
|
|
+ } else if (['straightLine', 'measureArea'].includes(data.value)) {
|
|
|
+ res = '单击开始,移动,单击改变方向,双击结束';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+});
|
|
|
|
|
|
// 点击一级菜单
|
|
|
const clickTab = (value: number) => {
|
|
@@ -160,12 +191,11 @@ const clickTab2 = (value: number) => {
|
|
|
menuActive2.value = value;
|
|
|
};
|
|
|
// 点击三级菜单
|
|
|
-const clickTab3 = (item) => {
|
|
|
+const clickTab3 = (item, index) => {
|
|
|
const type = item.value;
|
|
|
- if (
|
|
|
- props.mouseToolState.graphicsType !== type ||
|
|
|
- (props.mouseToolState.graphicsType === 'marker' && props.mouseToolState.title !== item.name)
|
|
|
- ) {
|
|
|
+ let flag: boolean;
|
|
|
+ if (props.mouseToolState.graphicsType !== type || (props.mouseToolState.graphicsType === 'marker' && props.mouseToolState.title !== item.name)) {
|
|
|
+ flag = true;
|
|
|
if (type === 'text') {
|
|
|
handleTextEdit();
|
|
|
} else if (type === 'marker') {
|
|
@@ -185,10 +215,14 @@ const clickTab3 = (item) => {
|
|
|
props.mouseToolState.graphicsType = type;
|
|
|
}
|
|
|
} else {
|
|
|
+ flag = false;
|
|
|
textEditState.showTextEdit = false;
|
|
|
emits('updateDrawing', false);
|
|
|
props.mouseToolState.graphicsType = '';
|
|
|
}
|
|
|
+ if (flag) {
|
|
|
+ menuActive3.value = index;
|
|
|
+ }
|
|
|
};
|
|
|
const handleTextEdit = () => {
|
|
|
const map = getMap();
|
|
@@ -206,7 +240,7 @@ const addText = () => {
|
|
|
const data = {
|
|
|
graphicsType: 'text',
|
|
|
lineWidth: props.mouseToolState.lineWidth,
|
|
|
- color: props.mouseToolState.lineWidth,
|
|
|
+ color: props.mouseToolState.color,
|
|
|
text: textEditState.text,
|
|
|
fontColor: textEditState.fontColor,
|
|
|
fontSize: textEditState.fontSize,
|
|
@@ -245,6 +279,38 @@ const changeDrawing = () => {
|
|
|
:deep(.el-color-dropdown__link-btn) {
|
|
|
display: none;
|
|
|
}
|
|
|
+
|
|
|
+.tabs1 {
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+.tab-content {
|
|
|
+ display: flex;
|
|
|
+ margin-top: 20px;
|
|
|
+ .tab-content2 {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ margin-left: 20px;
|
|
|
+ .tab {
|
|
|
+ padding: 0 10px;
|
|
|
+ height: 50px;
|
|
|
+ line-height: 50px;
|
|
|
+ border: 1px solid #000;
|
|
|
+ border-radius: 8px;
|
|
|
+ margin-right: 8px;
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover {
|
|
|
+ border: 1px solid #40a2e7;
|
|
|
+ background-color: #40a2e7;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .tab_active {
|
|
|
+ border: 1px solid #40a2e7;
|
|
|
+ background-color: #40a2e7;
|
|
|
+ color: #fff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
.text-edit-container {
|
|
|
position: fixed;
|
|
|
top: 500px;
|
|
@@ -273,4 +339,16 @@ const changeDrawing = () => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.tipTitle {
|
|
|
+ position: fixed;
|
|
|
+ top: 300px;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ z-index: 2;
|
|
|
+ padding: 10px 30px;
|
|
|
+ font-size: 38px;
|
|
|
+ color: #fff;
|
|
|
+ background-color: rgba(0, 0, 0, 0.4);
|
|
|
+ border-radius: 10px;
|
|
|
+}
|
|
|
</style>
|