Browse Source

window组件 新增展开面板控制

master
DIAMOND 1 year ago
parent
commit
6e99a53ee4
  1. 29
      src/components/earthMap/components/Window.vue
  2. 12
      src/components/earthMap/toolbar/AddModelWin.vue

29
src/components/earthMap/components/Window.vue

@ -46,7 +46,7 @@ export default defineComponent({
type: Boolean, type: Boolean,
default: true, default: true,
}, },
showcloseButton:{ showcloseButton: {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
@ -90,8 +90,15 @@ export default defineComponent({
type: Function, type: Function,
default: null, default: null,
}, },
/**
* @description 是否展开
*/
expand: {
type: Boolean,
default: true
}
}, },
emits:['cancel','ok','contextMenu','showclick'], emits: ['cancel', 'ok', 'contextMenu', 'showclick'],
setup(props, ctx) { setup(props, ctx) {
const { proxy }: any = getCurrentInstance(); const { proxy }: any = getCurrentInstance();
let langs = ref({ let langs = ref({
@ -104,7 +111,8 @@ export default defineComponent({
cancel: "Cancel" cancel: "Cancel"
} }
}) })
let collapsed = ref(false); // let collapsed = ref(false);
let collapsed = ref(!props.expand); //
let width_ = ref(0); let width_ = ref(0);
let height_ = ref(0); let height_ = ref(0);
let left_ = ref(0); let left_ = ref(0);
@ -128,8 +136,19 @@ export default defineComponent({
return props.confirmtext; return props.confirmtext;
}); });
watch(
() => props.expand,
(value) => {
//
// console.log(value);
collapsed.value = !value;
}
);
onMounted(() => { onMounted(() => {
// console.log("props",props)
// console.log(earth.czm.viewer.container) // console.log(earth.czm.viewer.container)
// console.log("window.$uia", window.$uia); // console.log("window.$uia", window.$uia);
// console.log("window.", window); // console.log("window.", window);
@ -278,7 +297,7 @@ export default defineComponent({
} }
// console.log('w',w); // console.log('w',w);
// console.log('h',h); // console.log('h',h);
updateStyle(); updateStyle();
} }
@ -299,7 +318,7 @@ export default defineComponent({
document.addEventListener("mouseup", up); document.addEventListener("mouseup", up);
} }
return { return {
contextMenu, contextMenu,
updateStyle, updateStyle,

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

@ -1,7 +1,7 @@
<template> <template>
<div class="create-model-modal" v-if="winVisible"> <div class="create-model-modal" v-if="winVisible">
<Window :title="title" @cancel="cancel" @ok="ok" :width="width" :minWidth="600" :height="height" :left="left" <Window :title="title" @cancel="cancel" @ok="ok" :width="width" :minWidth="600" :height="height" :left="left"
:top="top" :floatright="false" :footervisible="true" v-show="!creating"> :top="top" :floatright="false" :footervisible="true" v-show="!creating" :expand="expand">
<div style="display: flex" class="custom-item" v-if="!isUpdateModel"> <div style="display: flex" class="custom-item" v-if="!isUpdateModel">
<label class="custom-label">模型类型:</label> <label class="custom-label">模型类型:</label>
<div class="custom-item-box"> <div class="custom-item-box">
@ -283,10 +283,11 @@ export default defineComponent({
const { createMessage } = useMessage(); const { createMessage } = useMessage();
// const $mitt = mitt(); // const $mitt = mitt();
const userStore = useUserStore(); const userStore = useUserStore();
let expand = ref(true); //
let radarColor = ref({ rgba: { r: 0, g: 255, b: 0, a: 0.5 } }); let radarColor = ref({ rgba: { r: 0, g: 255, b: 0, a: 0.5 } });
let radarRange = ref(0); let radarRange = ref(0);
let radarRadius = ref(0); let radarRadius = ref(0);
//线 //线
let radarShifting = ref(0); let radarShifting = ref(0);
//使 //使
@ -461,14 +462,16 @@ export default defineComponent({
try { try {
if (selectModel.value.value === 'jkd') { if (selectModel.value.value === 'jkd') {
// console.log("jkd"); // console.log("jkd");
expand.value = true;//
currentModel.value = addModel(); currentModel.value = addModel();
// console.log(" currentModel.value", currentModel.value); // console.log(" currentModel.value", currentModel.value);
} else if (selectModel.value.value === 'qy') { } else if (selectModel.value.value === 'qy') {
expand.value = false;//
currentModel.value = addArea(); currentModel.value = addArea();
// currentModel.value = addPolyline(); // currentModel.value = addPolyline();
// console.log(" currentModel.value", currentModel.value); // console.log(" currentModel.value", currentModel.value);
} else { } else {
expand.value = true;//
currentModel.value = addPin(); currentModel.value = addPin();
} }
} catch (e) { } catch (e) {
@ -659,7 +662,7 @@ export default defineComponent({
bindModelProps(model); bindModelProps(model);
minimumPixelSize.value = 80; minimumPixelSize.value = 80;
// //
modelState('creating'); // modelState('creating');
// model.flyTo() // model.flyTo()
return model; return model;
} }
@ -1520,6 +1523,7 @@ export default defineComponent({
getRadarScan, getRadarScan,
pinIconUpload, pinIconUpload,
uploadFileCount, uploadFileCount,
expand,
}; };
}, },
}); });

Loading…
Cancel
Save