|
|
@ -1,6 +1,5 @@ |
|
|
|
<template> |
|
|
|
<div ref="xbsjmodelbox" class="xbsj-model-box" :class="{ 'xbsj-model-box-close': collapsed }" :style="windowstyle" |
|
|
|
@click="showclick"> |
|
|
|
<div ref="xbsjmodelbox" class="xbsj-model-box" :class="{ 'xbsj-model-box-close': collapsed }" :style="windowstyle" @click="showclick"> |
|
|
|
<i @mousedown="startResize" ref="barbr" class="bar" :class="{ hidden: collapsed }"></i> |
|
|
|
<!-- 标题 --> |
|
|
|
<div class="xbsj-model-header" ref="xbsjmodelheader" @mousedown="startMove"> |
|
|
@ -9,9 +8,12 @@ |
|
|
|
<span class="xbsj-model-close" @click.stop="cancel" v-if="showcloseButton"></span> |
|
|
|
</div> |
|
|
|
<!-- 内容 --> |
|
|
|
<div class="xbsj-model-content" |
|
|
|
:class="{ 'xbsj-model-closetatus-body': collapsed, 'xbsj-model-nofooter': footervisible }" ref="xbsjmodelbody" |
|
|
|
@contextmenu.prevent="contextMenu"> |
|
|
|
<div |
|
|
|
class="xbsj-model-content" |
|
|
|
:class="{ 'xbsj-model-closetatus-body': collapsed, 'xbsj-model-nofooter': footervisible }" |
|
|
|
ref="xbsjmodelbody" |
|
|
|
@contextmenu.prevent="contextMenu" |
|
|
|
> |
|
|
|
<div class="xbsj-model-content-box"> |
|
|
|
<slot></slot> |
|
|
|
</div> |
|
|
@ -25,8 +27,8 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script lang="ts"> |
|
|
|
import { computed, defineComponent, getCurrentInstance, h, nextTick, onBeforeMount, onMounted, onUnmounted, ref, toRefs, watch, } from "vue"; |
|
|
|
export default defineComponent({ |
|
|
|
import { computed, defineComponent, getCurrentInstance, h, nextTick, onBeforeMount, onMounted, onUnmounted, ref, toRefs, watch } from 'vue'; |
|
|
|
export default defineComponent({ |
|
|
|
name: 'Window', |
|
|
|
// components: {}, |
|
|
|
props: { |
|
|
@ -95,22 +97,22 @@ export default defineComponent({ |
|
|
|
*/ |
|
|
|
expand: { |
|
|
|
type: Boolean, |
|
|
|
default: true |
|
|
|
} |
|
|
|
default: true, |
|
|
|
}, |
|
|
|
}, |
|
|
|
emits: ['cancel', 'ok', 'contextMenu', 'showclick'], |
|
|
|
setup(props, ctx) { |
|
|
|
const { proxy }: any = getCurrentInstance(); |
|
|
|
let langs = ref({ |
|
|
|
zh: { |
|
|
|
ok: "确定", |
|
|
|
cancel: "取消" |
|
|
|
ok: '确定', |
|
|
|
cancel: '取消', |
|
|
|
}, |
|
|
|
en: { |
|
|
|
ok: "OK", |
|
|
|
cancel: "Cancel" |
|
|
|
} |
|
|
|
}) |
|
|
|
ok: 'OK', |
|
|
|
cancel: 'Cancel', |
|
|
|
}, |
|
|
|
}); |
|
|
|
// let collapsed = ref(false); |
|
|
|
let collapsed = ref(!props.expand); //初始化展开状态 |
|
|
|
let width_ = ref(0); |
|
|
@ -120,17 +122,17 @@ export default defineComponent({ |
|
|
|
let windowstyle = ref({}); |
|
|
|
|
|
|
|
//ref |
|
|
|
let xbsjmodelheader = ref() |
|
|
|
let xbsjmodelbox = ref() |
|
|
|
let xbsjmodelheader = ref(); |
|
|
|
let xbsjmodelbox = ref(); |
|
|
|
//计算属性 |
|
|
|
const compCancelText = computed(() => { |
|
|
|
if (props.canceltext == "") { |
|
|
|
if (props.canceltext == '') { |
|
|
|
return langs.value.zh.cancel; |
|
|
|
} |
|
|
|
return props.canceltext; |
|
|
|
}); |
|
|
|
const compOkText = computed(() => { |
|
|
|
if (props.confirmtext == "") { |
|
|
|
if (props.confirmtext == '') { |
|
|
|
return langs.value.zh.ok; |
|
|
|
} |
|
|
|
return props.confirmtext; |
|
|
@ -145,8 +147,6 @@ export default defineComponent({ |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
// console.log("props",props) |
|
|
|
// console.log(earth.czm.viewer.container) |
|
|
@ -166,17 +166,17 @@ export default defineComponent({ |
|
|
|
top_.value = props.top; |
|
|
|
|
|
|
|
updateStyle(); |
|
|
|
}) |
|
|
|
}); |
|
|
|
|
|
|
|
function contextMenu() { |
|
|
|
ctx.emit("contextMenu"); |
|
|
|
ctx.emit('contextMenu'); |
|
|
|
} |
|
|
|
function updateStyle() { |
|
|
|
windowstyle.value = { |
|
|
|
width: width_.value + "px", |
|
|
|
height: height_.value + "px", |
|
|
|
top: top_.value + "px", |
|
|
|
left: left_.value + "px" |
|
|
|
width: width_.value + 'px', |
|
|
|
height: height_.value + 'px', |
|
|
|
top: top_.value + 'px', |
|
|
|
left: left_.value + 'px', |
|
|
|
}; |
|
|
|
} |
|
|
|
function collapse() { |
|
|
@ -184,13 +184,13 @@ export default defineComponent({ |
|
|
|
proxy.$parent.refShow = !proxy.$parent.refShow; |
|
|
|
} |
|
|
|
function cancel() { |
|
|
|
ctx.emit("cancel"); |
|
|
|
ctx.emit('cancel'); |
|
|
|
} |
|
|
|
function ok() { |
|
|
|
ctx.emit("ok"); |
|
|
|
ctx.emit('ok'); |
|
|
|
} |
|
|
|
function showclick() { |
|
|
|
ctx.emit("showclick"); |
|
|
|
ctx.emit('showclick'); |
|
|
|
} |
|
|
|
function startMove(e) { |
|
|
|
e = e || event; |
|
|
@ -233,17 +233,11 @@ export default defineComponent({ |
|
|
|
left_.value = left; |
|
|
|
} |
|
|
|
|
|
|
|
if ( |
|
|
|
top > navheight && |
|
|
|
top <= maxHeight - (collapsed.value ? headerHeight : height_.value) |
|
|
|
) { |
|
|
|
if (top > navheight && top <= maxHeight - (collapsed.value ? headerHeight : height_.value)) { |
|
|
|
top_.value = top; |
|
|
|
} else if (top <= navheight && top_.value < top) { |
|
|
|
top_.value = top; |
|
|
|
} else if ( |
|
|
|
top > maxHeight - (collapsed.value ? headerHeight : height_.value) && |
|
|
|
top_.value > top |
|
|
|
) { |
|
|
|
} else if (top > maxHeight - (collapsed.value ? headerHeight : height_.value) && top_.value > top) { |
|
|
|
top_.value = top; |
|
|
|
} |
|
|
|
|
|
|
@ -254,13 +248,13 @@ export default defineComponent({ |
|
|
|
var conbox = window.$uia._vm.$refs.mainUI.$el; |
|
|
|
function up() { |
|
|
|
// conbox.removeEventListener("mousemove", move); |
|
|
|
document.removeEventListener("mousemove", move); |
|
|
|
document.removeEventListener("mouseup", up); |
|
|
|
document.removeEventListener('mousemove', move); |
|
|
|
document.removeEventListener('mouseup', up); |
|
|
|
} |
|
|
|
|
|
|
|
// conbox.addEventListener("mousemove", move); |
|
|
|
document.addEventListener("mousemove", move); |
|
|
|
document.addEventListener("mouseup", up); |
|
|
|
document.addEventListener('mousemove', move); |
|
|
|
document.addEventListener('mouseup', up); |
|
|
|
} |
|
|
|
function startResize(e: any) { |
|
|
|
e = e || event; |
|
|
@ -302,23 +296,22 @@ export default defineComponent({ |
|
|
|
} |
|
|
|
|
|
|
|
// var conbox = this.$root.$refs.mainUI.$el; |
|
|
|
var conbox = window.$uia._vm.$refs.mainUI.$el |
|
|
|
var conbox = window.$uia._vm.$refs.mainUI.$el; |
|
|
|
|
|
|
|
function up() { |
|
|
|
if (props.resized) { |
|
|
|
props.resized(); |
|
|
|
} |
|
|
|
// conbox.removeEventListener("mousemove", move); |
|
|
|
document.removeEventListener("mousemove", move); |
|
|
|
document.removeEventListener("mouseup", up); |
|
|
|
document.removeEventListener('mousemove', move); |
|
|
|
document.removeEventListener('mouseup', up); |
|
|
|
} |
|
|
|
|
|
|
|
// conbox.addEventListener("mousemove", move); |
|
|
|
document.addEventListener("mousemove", move); |
|
|
|
document.addEventListener("mouseup", up); |
|
|
|
document.addEventListener('mousemove', move); |
|
|
|
document.addEventListener('mouseup', up); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
contextMenu, |
|
|
|
updateStyle, |
|
|
@ -339,25 +332,13 @@ export default defineComponent({ |
|
|
|
langs, |
|
|
|
xbsjmodelheader, |
|
|
|
xbsjmodelbox, |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<style> |
|
|
|
.xbsj-model-box { |
|
|
|
.xbsj-model-box { |
|
|
|
position: absolute; |
|
|
|
background: rgba(71, 71, 71, 0.8); |
|
|
|
top: 200px; |
|
|
@ -365,35 +346,37 @@ export default defineComponent({ |
|
|
|
border-radius: 3px; |
|
|
|
overflow: hidden; |
|
|
|
z-index: 9; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-content { |
|
|
|
.xbsj-model-content { |
|
|
|
/* overflow-x: auto; |
|
|
|
overflow-y: auto; */ |
|
|
|
position: relative; |
|
|
|
padding: 5px; |
|
|
|
text-align: left; |
|
|
|
width: calc(100% - 10px); |
|
|
|
/* width: calc(100% - 10px); */ |
|
|
|
width: 100%; |
|
|
|
margin: 0 auto; |
|
|
|
transition: all 0.5s linear; |
|
|
|
height: calc(100% - 40px); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-content-box { |
|
|
|
.xbsj-model-content-box { |
|
|
|
overflow-x: auto; |
|
|
|
overflow-y: auto; |
|
|
|
width: 100%; |
|
|
|
height: calc(100% - 10px); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-nofooter { |
|
|
|
.xbsj-model-nofooter { |
|
|
|
height: calc(100% - 82px); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-content p { |
|
|
|
.xbsj-model-content p { |
|
|
|
color: #1fffff; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-header { |
|
|
|
.xbsj-model-header { |
|
|
|
cursor: all-scroll; |
|
|
|
word-break: keep-all; |
|
|
|
white-space: nowrap; |
|
|
@ -412,9 +395,9 @@ export default defineComponent({ |
|
|
|
text-align: left; |
|
|
|
user-select: none; |
|
|
|
display: flex; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-close { |
|
|
|
.xbsj-model-close { |
|
|
|
cursor: pointer; |
|
|
|
position: absolute; |
|
|
|
top: 50%; |
|
|
@ -426,15 +409,15 @@ export default defineComponent({ |
|
|
|
/* background: url(../../../images/model_close.png) no-repeat; */ |
|
|
|
background: url(../../../assets/earthMap/components/model_close.png) no-repeat; |
|
|
|
background-size: contain; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-close:hover { |
|
|
|
.xbsj-model-close:hover { |
|
|
|
/* background: url(../../../images/model_close_hover.png) no-repeat; */ |
|
|
|
background: url(../../../assets/earthMap/components/model_close_hover.png) no-repeat; |
|
|
|
background-size: contain; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-arrow { |
|
|
|
.xbsj-model-arrow { |
|
|
|
cursor: pointer; |
|
|
|
position: absolute; |
|
|
|
top: 50%; |
|
|
@ -447,19 +430,19 @@ export default defineComponent({ |
|
|
|
background: url(../../../assets/earthMap/components/model_arrow.png) no-repeat; |
|
|
|
background-size: contain; |
|
|
|
transition: all 0.5s linear; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-arrow:hover { |
|
|
|
.xbsj-model-arrow:hover { |
|
|
|
/* background: url(../../../images/model_arrow_hover.png) no-repeat; */ |
|
|
|
background: url(../../../assets/earthMap/components/model_arrow_hover.png) no-repeat; |
|
|
|
background-size: contain; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-close:hover { |
|
|
|
.xbsj-model-close:hover { |
|
|
|
color: #47f0ff; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-footer { |
|
|
|
.xbsj-model-footer { |
|
|
|
margin: 0; |
|
|
|
padding: 6px 0; |
|
|
|
text-align: right; |
|
|
@ -467,9 +450,9 @@ export default defineComponent({ |
|
|
|
position: absolute; |
|
|
|
bottom: 0; |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.btn { |
|
|
|
.btn { |
|
|
|
min-width: 60px; |
|
|
|
text-align: center; |
|
|
|
vertical-align: middle; |
|
|
@ -479,77 +462,77 @@ export default defineComponent({ |
|
|
|
text-decoration: none; |
|
|
|
border-radius: 3px; |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-footer .cancelBtn:focus, |
|
|
|
.xbsj-model-footer .cancelBtn:hover { |
|
|
|
.xbsj-model-footer .cancelBtn:focus, |
|
|
|
.xbsj-model-footer .cancelBtn:hover { |
|
|
|
color: #1fffff; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-footer .confirmBtn:focus, |
|
|
|
.xbsj-model-footer .confirmBtn:hover { |
|
|
|
.xbsj-model-footer .confirmBtn:focus, |
|
|
|
.xbsj-model-footer .confirmBtn:hover { |
|
|
|
color: #1fffff; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-footer .confirm-btn .marginLeft { |
|
|
|
.xbsj-model-footer .confirm-btn .marginLeft { |
|
|
|
margin-left: 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.cancelBtn { |
|
|
|
.cancelBtn { |
|
|
|
border: 1px solid #666666; |
|
|
|
background-color: rgba(0, 0, 0, 0.5); |
|
|
|
color: #dddddd; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.confirmBtn { |
|
|
|
.confirmBtn { |
|
|
|
border: 1px solid #666666; |
|
|
|
background-color: rgba(0, 0, 0, 0.5); |
|
|
|
color: #dddddd; |
|
|
|
margin-right: 24px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
button+button { |
|
|
|
button + button { |
|
|
|
margin-left: 15px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-box .bar { |
|
|
|
.xbsj-model-box .bar { |
|
|
|
position: absolute; |
|
|
|
z-index: 2; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-box i.bart, |
|
|
|
.xbsj-model-box i.barb { |
|
|
|
.xbsj-model-box i.bart, |
|
|
|
.xbsj-model-box i.barb { |
|
|
|
height: 4px; |
|
|
|
left: -1px; |
|
|
|
right: -1px; |
|
|
|
cursor: n-resize; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-box i.bart { |
|
|
|
.xbsj-model-box i.bart { |
|
|
|
top: -1px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-box i.barb { |
|
|
|
.xbsj-model-box i.barb { |
|
|
|
bottom: -1px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-box i.barr, |
|
|
|
.xbsj-model-box i.barl { |
|
|
|
.xbsj-model-box i.barr, |
|
|
|
.xbsj-model-box i.barl { |
|
|
|
width: 4px; |
|
|
|
top: -1px; |
|
|
|
bottom: -1px; |
|
|
|
cursor: e-resize; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-box i.barl { |
|
|
|
.xbsj-model-box i.barl { |
|
|
|
left: -1px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-box i.barr { |
|
|
|
.xbsj-model-box i.barr { |
|
|
|
right: -1px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-box i.bar { |
|
|
|
.xbsj-model-box i.bar { |
|
|
|
width: 14px; |
|
|
|
height: 14px; |
|
|
|
cursor: nw-resize; |
|
|
@ -558,9 +541,9 @@ button+button { |
|
|
|
/* background: rgba(221, 221, 221, 0.4); */ |
|
|
|
background: url(../../../images/model_right_bottom.png) no-repeat; |
|
|
|
background-size: cover; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-box .closestatus { |
|
|
|
.xbsj-model-box .closestatus { |
|
|
|
transform: rotate(-180deg); |
|
|
|
-ms-transform: rotate(-180deg); |
|
|
|
/* IE 9 */ |
|
|
@ -569,18 +552,17 @@ button+button { |
|
|
|
-webkit-transform: rotate(-180deg); |
|
|
|
/* Safari 和 Chrome */ |
|
|
|
-o-transform: rotate(-180deg); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-box .xbsj-model-closetatus-body { |
|
|
|
.xbsj-model-box .xbsj-model-closetatus-body { |
|
|
|
height: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.xbsj-model-box-close { |
|
|
|
.xbsj-model-box-close { |
|
|
|
height: 40px !important; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.hidden { |
|
|
|
.hidden { |
|
|
|
display: none; |
|
|
|
} |
|
|
|
} |
|
|
|
</style> |
|
|
|
|
|
|
|