|
@@ -1,9 +1,15 @@
|
|
|
<template>
|
|
|
<!-- 全屏 -->
|
|
|
<div v-if="panelVisible" ref="halfpanel" class="halfpanels">
|
|
|
- <span class="close" @click="handelClose">
|
|
|
- <i class="el-icon-close" />
|
|
|
- </span>
|
|
|
+ <el-button
|
|
|
+ class="full"
|
|
|
+ type="text"
|
|
|
+ size="large"
|
|
|
+ :icon="`el-icon-${footerHeight === '100%' ? 'download' : 'upload2'}`"
|
|
|
+ @click="handelFull"
|
|
|
+ />
|
|
|
+ <el-button class="close" type="text" size="large" icon="el-icon-close" @click="handelClose" />
|
|
|
+
|
|
|
<el-tabs
|
|
|
class="custom-half-panels-tabs"
|
|
|
:value="editableTabsValue"
|
|
@@ -27,182 +33,197 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script lang='ts'>
|
|
|
-import { Vue, Component, Prop, Watch } from 'vue-property-decorator'
|
|
|
-import Comps from './loadComps'
|
|
|
-import $ from 'jquery'
|
|
|
-@Component({
|
|
|
- name: 'HalfPanels'
|
|
|
-})
|
|
|
-export default class HalfPanels extends Vue {
|
|
|
- @Prop({ default: [] }) panels: any[]
|
|
|
- @Prop({ default: null }) data: any
|
|
|
- @Prop() panelVisible: boolean
|
|
|
- @Prop() fullpanelVisible: boolean
|
|
|
- @Prop() footerHeight: string
|
|
|
- @Prop() defaultHeight: string
|
|
|
+<script lang="ts">
|
|
|
+ import { Vue, Component, Prop, Watch } from 'vue-property-decorator'
|
|
|
+ import Comps from './loadComps'
|
|
|
+ import $ from 'jquery'
|
|
|
+ @Component({
|
|
|
+ name: 'HalfPanels'
|
|
|
+ })
|
|
|
+ export default class HalfPanels extends Vue {
|
|
|
+ @Prop({ default: [] }) panels: any[]
|
|
|
+ @Prop({ default: null }) data: any
|
|
|
+ @Prop() panelVisible: boolean
|
|
|
+ @Prop() fullpanelVisible: boolean
|
|
|
+ @Prop() footerHeight: string
|
|
|
+ @Prop() defaultHeight: string
|
|
|
|
|
|
- Comps = Comps
|
|
|
- nowHeight = null
|
|
|
+ Comps = Comps
|
|
|
+ nowHeight = null
|
|
|
|
|
|
- get editableTabsValue() {
|
|
|
- return this.$store.state.map.halfP_editableTabsValue
|
|
|
- }
|
|
|
- @Watch('panels', { immediate: true })
|
|
|
- panelsChange() {
|
|
|
- if (this.panels.length > 0) {
|
|
|
- this.$emit('update:panelVisible', true)
|
|
|
- this.$emit('update:footerHeight', this.defaultHeight || '400px')
|
|
|
- } else {
|
|
|
- if (!this.panelVisible) return
|
|
|
- this.$emit('update:panelVisible', false)
|
|
|
- if (this.fullpanelVisible == false) {
|
|
|
- this.$emit('update:footerHeight', '0%')
|
|
|
+ get editableTabsValue() {
|
|
|
+ return this.$store.state.map.halfP_editableTabsValue
|
|
|
+ }
|
|
|
+ @Watch('panels', { immediate: true })
|
|
|
+ panelsChange() {
|
|
|
+ if (this.panels.length > 0) {
|
|
|
+ this.$emit('update:panelVisible', true)
|
|
|
+ this.$emit('update:footerHeight', this.defaultHeight || '400px')
|
|
|
+ } else {
|
|
|
+ if (!this.panelVisible) return
|
|
|
+ this.$emit('update:panelVisible', false)
|
|
|
+ if (this.fullpanelVisible == false) {
|
|
|
+ this.$emit('update:footerHeight', '0%')
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- @Watch('panelVisible')
|
|
|
- panelVisibleChange() {
|
|
|
- if (this.panelVisible == true) {
|
|
|
- this.$store.dispatch('map/delAllFull')
|
|
|
+ @Watch('panelVisible')
|
|
|
+ panelVisibleChange() {
|
|
|
+ if (this.panelVisible == true) {
|
|
|
+ this.$store.dispatch('map/delAllFull')
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- updated() {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.initEvent()
|
|
|
- })
|
|
|
- }
|
|
|
- /**
|
|
|
- * 初始化事件函数
|
|
|
- */
|
|
|
- initEvent() {
|
|
|
- var domObj = $(this.$el)
|
|
|
- var that = this
|
|
|
- domObj
|
|
|
- .find('.dragline')
|
|
|
- .off('mousedown')
|
|
|
- .on('mousedown', function (e) {
|
|
|
- var oldy = e.screenY
|
|
|
- $(document)
|
|
|
- .off('mousemove')
|
|
|
- .on('mousemove', function (e) {
|
|
|
- var newy = e.screenY
|
|
|
- var nowheight = domObj.height()
|
|
|
- var newheight = nowheight + (oldy - newy)
|
|
|
- that.$emit('update:footerHeight', newheight + 'px')
|
|
|
- that.nowHeight = newheight + 'px'
|
|
|
- oldy = newy
|
|
|
- })
|
|
|
+ updated() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.initEvent()
|
|
|
})
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 初始化事件函数
|
|
|
+ */
|
|
|
+ initEvent() {
|
|
|
+ var domObj = $(this.$el)
|
|
|
+ var that = this
|
|
|
+ domObj
|
|
|
+ .find('.dragline')
|
|
|
+ .off('mousedown')
|
|
|
+ .on('mousedown', function (e) {
|
|
|
+ var oldy = e.screenY
|
|
|
+ $(document)
|
|
|
+ .off('mousemove')
|
|
|
+ .on('mousemove', function (e) {
|
|
|
+ var newy = e.screenY
|
|
|
+ var nowheight = domObj.height()
|
|
|
+ var newheight = nowheight + (oldy - newy)
|
|
|
+ that.$emit('update:footerHeight', newheight + 'px')
|
|
|
+ that.nowHeight = newheight + 'px'
|
|
|
+ oldy = newy
|
|
|
+ })
|
|
|
+ })
|
|
|
|
|
|
- $(document)
|
|
|
- .off('mouseup')
|
|
|
- .on('mouseup', function () {
|
|
|
- $(document).off('mousemove')
|
|
|
- that.$emit('update:defaultHeight', that.nowHeight)
|
|
|
- })
|
|
|
- }
|
|
|
- handelClose() {
|
|
|
- // this.$store.dispatch('map/handelClose', data)
|
|
|
- this.$store.dispatch('map/delAllHalf')
|
|
|
- this.$emit('handelClose')
|
|
|
- }
|
|
|
- removeTab(targetName) {
|
|
|
- // console.log('333', targetName)
|
|
|
- this.$store.dispatch('map/delHalfPanels', targetName)
|
|
|
- }
|
|
|
- clickTab(targetName) {
|
|
|
- this.data.activeModel = targetName.name
|
|
|
- const sendData = {
|
|
|
- widgetid: 'HalfPanel',
|
|
|
- id: this.data.activeModel
|
|
|
+ $(document)
|
|
|
+ .off('mouseup')
|
|
|
+ .on('mouseup', function () {
|
|
|
+ $(document).off('mousemove')
|
|
|
+ that.$emit('update:defaultHeight', that.nowHeight)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ handelClose() {
|
|
|
+ // this.$store.dispatch('map/handelClose', data)
|
|
|
+ this.$store.dispatch('map/delAllHalf')
|
|
|
+ this.$emit('handelClose')
|
|
|
+ }
|
|
|
+
|
|
|
+ handelFull() {
|
|
|
+ this.$emit(
|
|
|
+ 'update:footerHeight',
|
|
|
+ this.footerHeight === '100%' ? this.nowHeight || this.defaultHeight || '400px' : '100%'
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
+ removeTab(targetName) {
|
|
|
+ // console.log('333', targetName)
|
|
|
+ this.$store.dispatch('map/delHalfPanels', targetName)
|
|
|
+ }
|
|
|
+ clickTab(targetName) {
|
|
|
+ this.data.activeModel = targetName.name
|
|
|
+ const sendData = {
|
|
|
+ widgetid: 'HalfPanel',
|
|
|
+ id: this.data.activeModel
|
|
|
+ }
|
|
|
+ this.$store.dispatch('map/changeMethod', sendData)
|
|
|
}
|
|
|
- this.$store.dispatch('map/changeMethod', sendData)
|
|
|
}
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
-<style lang='scss' scoped>
|
|
|
-.el-tabs {
|
|
|
- height: 100%;
|
|
|
-}
|
|
|
+<style lang="scss" scoped>
|
|
|
+ .el-tabs {
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
|
|
|
-.el-tabs >>> .el-tabs__header {
|
|
|
- background: #eff0f5;
|
|
|
- color: black;
|
|
|
- margin-bottom: 0px;
|
|
|
- border-top: 1px solid rgb(218, 218, 218);
|
|
|
- .el-tabs__nav-wrap {
|
|
|
- width: calc(100% - 25px);
|
|
|
- .el-tabs__nav-prev {
|
|
|
- color: white;
|
|
|
- }
|
|
|
- .el-tabs__nav-next {
|
|
|
- color: white;
|
|
|
+ .el-tabs >>> .el-tabs__header {
|
|
|
+ background: #eff0f5;
|
|
|
+ color: black;
|
|
|
+ margin-bottom: 0px;
|
|
|
+ border-top: 1px solid rgb(218, 218, 218);
|
|
|
+ .el-tabs__nav-wrap {
|
|
|
+ width: calc(100% - 25px);
|
|
|
+ .el-tabs__nav-prev {
|
|
|
+ color: white;
|
|
|
+ }
|
|
|
+ .el-tabs__nav-next {
|
|
|
+ color: white;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
|
|
|
-.el-tabs >>> .el-tabs__item.is-active {
|
|
|
- // color: #fff;
|
|
|
- background: #fff;
|
|
|
-}
|
|
|
-.el-tabs >>> .el-tabs__item:hover {
|
|
|
- color: black;
|
|
|
-}
|
|
|
-.el-tabs >>> .el-tabs__content {
|
|
|
- height: calc(100% - 42px);
|
|
|
- padding: 0 4px 0px 4px;
|
|
|
-}
|
|
|
-.el-tabs >>> .el-tab-pane {
|
|
|
- height: 100%;
|
|
|
- width: 100%;
|
|
|
-}
|
|
|
-
|
|
|
-.halfpanels {
|
|
|
- z-index: 99;
|
|
|
- position: relative;
|
|
|
- top: 0;
|
|
|
- height: 100%;
|
|
|
- width: 100%;
|
|
|
- user-select: none;
|
|
|
- .close {
|
|
|
- position: absolute;
|
|
|
- top: 10px;
|
|
|
- right: 11px;
|
|
|
- color: rgb(115, 131, 158);
|
|
|
- z-index: 10;
|
|
|
- cursor: pointer;
|
|
|
+ .el-tabs >>> .el-tabs__item.is-active {
|
|
|
+ // color: #fff;
|
|
|
+ background: #fff;
|
|
|
+ }
|
|
|
+ .el-tabs >>> .el-tabs__item:hover {
|
|
|
+ color: black;
|
|
|
+ }
|
|
|
+ .el-tabs >>> .el-tabs__content {
|
|
|
+ height: calc(100% - 42px);
|
|
|
+ padding: 0 4px 0px 4px;
|
|
|
}
|
|
|
- .halfitems {
|
|
|
- background-color: white;
|
|
|
+ .el-tabs >>> .el-tab-pane {
|
|
|
height: 100%;
|
|
|
width: 100%;
|
|
|
}
|
|
|
- .dragline {
|
|
|
- position: absolute;
|
|
|
+
|
|
|
+ .halfpanels {
|
|
|
+ z-index: 99;
|
|
|
+ position: relative;
|
|
|
+ top: 0;
|
|
|
+ height: 100%;
|
|
|
width: 100%;
|
|
|
- height: 3px;
|
|
|
- top: 0px;
|
|
|
- }
|
|
|
- .dragline:hover {
|
|
|
- cursor: s-resize;
|
|
|
- }
|
|
|
- .custom-half-panels-tabs {
|
|
|
- /deep/ .el-tabs__nav {
|
|
|
- height: 43px;
|
|
|
- .el-tabs__item {
|
|
|
- height: 32px;
|
|
|
- line-height: 32px;
|
|
|
- margin: 11px 0 0 5px;
|
|
|
- padding: 0 8px;
|
|
|
- background: #e3e6f2;
|
|
|
- cursor: pointer;
|
|
|
- &.is-active {
|
|
|
- background: #ffffff;
|
|
|
+ user-select: none;
|
|
|
+ .close,
|
|
|
+ .full {
|
|
|
+ position: absolute;
|
|
|
+ top: 8px;
|
|
|
+ right: 10px;
|
|
|
+ color: rgb(115, 131, 158);
|
|
|
+ z-index: 10;
|
|
|
+ cursor: pointer;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .full {
|
|
|
+ right: 35px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .halfitems {
|
|
|
+ background-color: white;
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+ .dragline {
|
|
|
+ position: absolute;
|
|
|
+ width: 100%;
|
|
|
+ height: 3px;
|
|
|
+ top: 0px;
|
|
|
+ }
|
|
|
+ .dragline:hover {
|
|
|
+ cursor: s-resize;
|
|
|
+ }
|
|
|
+ .custom-half-panels-tabs {
|
|
|
+ /deep/ .el-tabs__nav {
|
|
|
+ height: 43px;
|
|
|
+ .el-tabs__item {
|
|
|
+ height: 32px;
|
|
|
+ line-height: 32px;
|
|
|
+ margin: 11px 0 0 5px;
|
|
|
+ padding: 0 8px;
|
|
|
+ background: #e3e6f2;
|
|
|
+ cursor: pointer;
|
|
|
+ &.is-active {
|
|
|
+ background: #ffffff;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
</style>
|