Browse Source

地图创建区域需要与绘画组件融合

master
DIAMOND 9 months ago
parent
commit
7cfc07c70e
  1. 14
      src/components/earthMap/Toolbar.vue
  2. 2666
      src/components/earthMap/toolbar/AddModelWin.vue
  3. 34
      src/components/earthMap/toolbar/DrawShape.vue
  4. 11
      src/components/earthMap/toolbar/DrawShapeMilitary.vue

14
src/components/earthMap/Toolbar.vue

@ -95,7 +95,7 @@
<KeyControlAreaList v-if="keyControlAreaListShow"></KeyControlAreaList> <KeyControlAreaList v-if="keyControlAreaListShow"></KeyControlAreaList>
<NotificationModel v-if="notificationModelShow"></NotificationModel> <NotificationModel v-if="notificationModelShow"></NotificationModel>
<WarnList v-if="WarnListShow"></WarnList> <WarnList v-if="WarnListShow"></WarnList>
<DrawShape v-if="drawShapeShow"></DrawShape> <DrawShape v-if="drawShapeShow" :drawShapePackage="drawShapePackage"></DrawShape>
<DrawShapeMilitary v-if="drawShapeMilitaryShow"></DrawShapeMilitary> <DrawShapeMilitary v-if="drawShapeMilitaryShow"></DrawShapeMilitary>
</div> </div>
</template> </template>
@ -131,6 +131,7 @@
import { defHttp } from '/@/utils/http/axios'; import { defHttp } from '/@/utils/http/axios';
import $ from 'jquery'; import $ from 'jquery';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import TestCom from './TestCom.vue'; import TestCom from './TestCom.vue';
@ -154,6 +155,7 @@
const { proxy }: any = getCurrentInstance(); const { proxy }: any = getCurrentInstance();
// const { userInfo } = useUserStore(); // const { userInfo } = useUserStore();
const userStore = useUserStore(); const userStore = useUserStore();
const { createMessage } = useMessage();
let _viewer = ref(); let _viewer = ref();
let show = ref(true); let show = ref(true);
let modalVisible = ref(false); let modalVisible = ref(false);
@ -179,6 +181,7 @@
const notificationModelShow = ref(false); const notificationModelShow = ref(false);
const WarnListShow = ref(false); const WarnListShow = ref(false);
const drawShapeShow = ref(false); const drawShapeShow = ref(false);
const drawShapePackage = ref(null);
const drawShapeMilitaryShow = ref(false); const drawShapeMilitaryShow = ref(false);
// //
@ -235,6 +238,11 @@
$mitt.on('warnInfoMan', function () { $mitt.on('warnInfoMan', function () {
warnInfoMan(); warnInfoMan();
}); });
//res.show,res
$mitt.on('drawShapeShow', function (res:any) {
drawShapeShow.value = res.show;
drawShapePackage.value = res
});
} }
// //
//disposers //disposers
@ -946,6 +954,8 @@
// //
function drawShape() { function drawShape() {
//
drawShapePackage.value = null
drawShapeShow.value = !drawShapeShow.value; drawShapeShow.value = !drawShapeShow.value;
} }
//- //-
@ -1019,7 +1029,6 @@
// $mitt.emit('windowCancel') // $mitt.emit('windowCancel')
// com = addModelWin // com = addModelWin
// console.log("proxy"); // console.log("proxy");
addModelWinShow.value = true; addModelWinShow.value = true;
break; break;
case 'roamPathList': case 'roamPathList':
@ -1138,6 +1147,7 @@
notificationModelShow, notificationModelShow,
WarnListShow, WarnListShow,
drawShapeShow, drawShapeShow,
drawShapePackage,
drawShapeMilitaryShow, drawShapeMilitaryShow,
drawShapeMilitaryIMG, drawShapeMilitaryIMG,
test, test,

2666
src/components/earthMap/toolbar/AddModelWin.vue

File diff suppressed because it is too large

34
src/components/earthMap/toolbar/DrawShape.vue

@ -15,6 +15,9 @@
</template> </template>
<a-collapse-panel key="1" header="线" :style="customStyle"> <a-collapse-panel key="1" header="线" :style="customStyle">
<div class="toolBoxImg"> <div class="toolBoxImg">
<p class="tb-img-p" title="实线" @click="draw('Polyline')">
<img :src="solidLine" alt="实线" />
</p>
<p class="tb-img-p" title="圆弧" @click="draw('GeoArc')"> <p class="tb-img-p" title="圆弧" @click="draw('GeoArc')">
<img :src="arc" alt="圆弧" /> <img :src="arc" alt="圆弧" />
</p> </p>
@ -30,9 +33,7 @@
<!-- <p class="tb-img-p" title="曲线箭头" @click="drawCurveArrow"> <!-- <p class="tb-img-p" title="曲线箭头" @click="drawCurveArrow">
<img :src="curveArrow" alt="曲线箭头" /> <img :src="curveArrow" alt="曲线箭头" />
</p> --> </p> -->
<p class="tb-img-p" title="实线" @click="draw('Polyline')">
<img :src="solidLine" alt="实线" />
</p>
</div> </div>
</a-collapse-panel> </a-collapse-panel>
<a-collapse-panel key="2" header="面" :style="customStyle"> <a-collapse-panel key="2" header="面" :style="customStyle">
@ -227,6 +228,10 @@ const props = defineProps({
type: Boolean, type: Boolean,
default: false, default: false,
}, },
drawShapePackage: {
type: Object,
default: null,
},
}); });
const { proxy }: any = getCurrentInstance(); const { proxy }: any = getCurrentInstance();
@ -237,6 +242,19 @@ const activeKey = ref(['1', '2']);
const customStyle = 'background: rgb(255 255 255 / 0%);border-radius: 4px;border: 0;overflow: hidden'; const customStyle = 'background: rgb(255 255 255 / 0%);border-radius: 4px;border: 0;overflow: hidden';
const earthUI = window.$uia // ui const earthUI = window.$uia // ui
let title = ref(props.title)
onMounted(() => {
//
if (props.drawShapePackage != null) {
console.log("绘画组件正在调用", props.drawShapePackage);
if (props.drawShapePackage.title != null)
//title
title.value = props.drawShapePackage.title
}
})
function draw(type: String = '') { function draw(type: String = '') {
let t = null let t = null
switch (type) { switch (type) {
@ -304,7 +322,15 @@ function draw(type: String = '') {
console.log("错误"); console.log("错误");
break; break;
} }
return editUI(t) // t
if (props.drawShapePackage &&
props.drawShapePackage.from &&
props.drawShapePackage.from == 'addArea') {
$mitt.emit('addAreaFinished', t)
return
}
else
return editUI(t)
} }
function cancel() { function cancel() {

11
src/components/earthMap/toolbar/DrawShapeMilitary.vue

@ -40,9 +40,14 @@
<p class="tb-img-p" title="曲线箭头" @click="draw('GeoCurveArrow')"> <p class="tb-img-p" title="曲线箭头" @click="draw('GeoCurveArrow')">
<img :src="curveArrow" alt="曲线箭头" /> <img :src="curveArrow" alt="曲线箭头" />
</p> </p>
<p class="tb-img-p" title="单次箭头" @click="draw('GeoSimpleArrow')"> <!-- //
/**
* 报错Reaction doesn't converge to a stable state after 100 iterations.
* Probably there is a cycle in the reactive function: Reaction
/ -->
<!-- <p class="tb-img-p" title="单次箭头" @click="draw('GeoSimpleArrow')">
<img :src="simpleArrow" alt="单次箭头" /> <img :src="simpleArrow" alt="单次箭头" />
</p> </p> -->
<p class="tb-img-p" title="平尾箭头" @click="draw('GeoArrow')"> <p class="tb-img-p" title="平尾箭头" @click="draw('GeoArrow')">
<img :src="flatArrow" alt="平尾箭头" /> <img :src="flatArrow" alt="平尾箭头" />
</p> </p>
@ -394,8 +399,10 @@ function saveInStore(obj: any) {
function editUI(obj: any, objConfig: any = null) { function editUI(obj: any, objConfig: any = null) {
console.log("obj", obj); console.log("obj", obj);
obj.creating = true; obj.creating = true;
// if (obj.showType == "forkedTail") return
earthUI.showPropertyWindow(obj) earthUI.showPropertyWindow(obj)
nextTick(() => { nextTick(() => {
// ui // ui
const mainUI = earthUI._vm.$refs.mainUI const mainUI = earthUI._vm.$refs.mainUI
// uiRef // uiRef

Loading…
Cancel
Save