forked from github/dataease
feat:画布切换修改
This commit is contained in:
parent
10feea18a9
commit
2d7ad3224b
@ -1,92 +1,96 @@
|
||||
<template>
|
||||
<div class="contextmenu" v-show="menuShow" :style="{ top: menuTop + 'px', left: menuLeft + 'px' }">
|
||||
<ul @mouseup="handleMouseUp">
|
||||
<template v-if="curComponent">
|
||||
<template v-if="!curComponent.isLock">
|
||||
<li @click="copy">复制</li>
|
||||
<li @click="paste">粘贴</li>
|
||||
<li @click="cut">剪切</li>
|
||||
<li @click="deleteComponent">删除</li>
|
||||
<li @click="lock">锁定</li>
|
||||
<li @click="topComponent">置顶</li>
|
||||
<li @click="bottomComponent">置底</li>
|
||||
<li @click="upComponent">上移</li>
|
||||
<li @click="downComponent">下移</li>
|
||||
</template>
|
||||
<li v-else @click="unlock">解锁</li>
|
||||
</template>
|
||||
<li v-else @click="paste">粘贴</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div v-show="menuShow" class="contextmenu" :style="{ top: menuTop + 'px', left: menuLeft + 'px' }">
|
||||
<ul @mouseup="handleMouseUp">
|
||||
<template v-if="curComponent">
|
||||
<template v-if="!curComponent.isLock">
|
||||
<li @click="edit">编辑</li>
|
||||
<li @click="copy">复制</li>
|
||||
<li @click="paste">粘贴</li>
|
||||
<li @click="cut">剪切</li>
|
||||
<li @click="deleteComponent">删除</li>
|
||||
<li @click="lock">锁定</li>
|
||||
<li @click="topComponent">置顶</li>
|
||||
<li @click="bottomComponent">置底</li>
|
||||
<li @click="upComponent">上移</li>
|
||||
<li @click="downComponent">下移</li>
|
||||
</template>
|
||||
<li v-else @click="unlock">解锁</li>
|
||||
</template>
|
||||
<li v-else @click="paste">粘贴</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
copyData: null,
|
||||
}
|
||||
data() {
|
||||
return {
|
||||
copyData: null
|
||||
}
|
||||
},
|
||||
computed: mapState([
|
||||
'menuTop',
|
||||
'menuLeft',
|
||||
'menuShow',
|
||||
'curComponent'
|
||||
]),
|
||||
methods: {
|
||||
edit() {
|
||||
// 编辑组件
|
||||
},
|
||||
computed: mapState([
|
||||
'menuTop',
|
||||
'menuLeft',
|
||||
'menuShow',
|
||||
'curComponent',
|
||||
]),
|
||||
methods: {
|
||||
lock() {
|
||||
this.$store.commit('lock')
|
||||
},
|
||||
|
||||
unlock() {
|
||||
this.$store.commit('unlock')
|
||||
},
|
||||
|
||||
// 点击菜单时不取消当前组件的选中状态
|
||||
handleMouseUp() {
|
||||
this.$store.commit('setClickComponentStatus', true)
|
||||
},
|
||||
|
||||
cut() {
|
||||
this.$store.commit('cut')
|
||||
},
|
||||
|
||||
copy() {
|
||||
this.$store.commit('copy')
|
||||
},
|
||||
|
||||
paste() {
|
||||
this.$store.commit('paste', true)
|
||||
this.$store.commit('recordSnapshot')
|
||||
},
|
||||
|
||||
deleteComponent() {
|
||||
this.$store.commit('deleteComponent')
|
||||
this.$store.commit('recordSnapshot')
|
||||
},
|
||||
|
||||
upComponent() {
|
||||
this.$store.commit('upComponent')
|
||||
this.$store.commit('recordSnapshot')
|
||||
},
|
||||
|
||||
downComponent() {
|
||||
this.$store.commit('downComponent')
|
||||
this.$store.commit('recordSnapshot')
|
||||
},
|
||||
|
||||
topComponent() {
|
||||
this.$store.commit('topComponent')
|
||||
this.$store.commit('recordSnapshot')
|
||||
},
|
||||
|
||||
bottomComponent() {
|
||||
this.$store.commit('bottomComponent')
|
||||
this.$store.commit('recordSnapshot')
|
||||
},
|
||||
lock() {
|
||||
this.$store.commit('lock')
|
||||
},
|
||||
|
||||
unlock() {
|
||||
this.$store.commit('unlock')
|
||||
},
|
||||
|
||||
// 点击菜单时不取消当前组件的选中状态
|
||||
handleMouseUp() {
|
||||
this.$store.commit('setClickComponentStatus', true)
|
||||
},
|
||||
|
||||
cut() {
|
||||
this.$store.commit('cut')
|
||||
},
|
||||
|
||||
copy() {
|
||||
this.$store.commit('copy')
|
||||
},
|
||||
|
||||
paste() {
|
||||
this.$store.commit('paste', true)
|
||||
this.$store.commit('recordSnapshot')
|
||||
},
|
||||
|
||||
deleteComponent() {
|
||||
this.$store.commit('deleteComponent')
|
||||
this.$store.commit('recordSnapshot')
|
||||
},
|
||||
|
||||
upComponent() {
|
||||
this.$store.commit('upComponent')
|
||||
this.$store.commit('recordSnapshot')
|
||||
},
|
||||
|
||||
downComponent() {
|
||||
this.$store.commit('downComponent')
|
||||
this.$store.commit('recordSnapshot')
|
||||
},
|
||||
|
||||
topComponent() {
|
||||
this.$store.commit('topComponent')
|
||||
this.$store.commit('recordSnapshot')
|
||||
},
|
||||
|
||||
bottomComponent() {
|
||||
this.$store.commit('bottomComponent')
|
||||
this.$store.commit('recordSnapshot')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -123,4 +127,4 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
@ -2,6 +2,14 @@
|
||||
<div class="shape" :class="classInfo" @mouseenter="enter" @mouseleave="leave" @click="selectCurComponent" @mousedown="handleMouseDownOnShape">
|
||||
<span v-show="isActive()" class="iconfont icon-xiangyouxuanzhuan" @mousedown="handleRotate" />
|
||||
<span v-show="element.isLock" class="iconfont icon-suo" />
|
||||
|
||||
<!-- <span v-show="isActive()" class="iconfont icon-more">-->
|
||||
<!-- <el-button-->
|
||||
<!-- icon="el-icon-more"-->
|
||||
<!-- type="text"-->
|
||||
<!-- size="small"-->
|
||||
<!-- />-->
|
||||
<!-- </span>-->
|
||||
<div
|
||||
v-for="item in (isActive()? pointList : [])"
|
||||
:key="item"
|
||||
@ -404,4 +412,17 @@ export default {
|
||||
top: 0;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.edit-side {
|
||||
overflow: hidden auto;
|
||||
min-height: 24px;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
|
||||
.icon-more {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: -10px;
|
||||
}
|
||||
</style>
|
||||
|
@ -31,6 +31,12 @@
|
||||
<el-tooltip content="预览">
|
||||
<el-button class="el-icon-view" size="mini" circle @click="preview" />
|
||||
</el-tooltip>
|
||||
|
||||
<span style="float: right;margin-left: 10px">
|
||||
<el-button size="mini" @click="closePanelEdit">
|
||||
关闭
|
||||
</el-button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- 预览 -->
|
||||
@ -46,6 +52,7 @@ import { commonStyle, commonAttr } from '@/components/canvas/custom-component/co
|
||||
import eventBus from '@/components/canvas/utils/eventBus'
|
||||
import { deepCopy } from '@/components/canvas/utils/utils'
|
||||
import { post } from '@/api/panel/panel'
|
||||
import bus from '@/utils/bus'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -77,6 +84,10 @@ export default {
|
||||
this.scale = this.canvasStyleData.scale
|
||||
},
|
||||
methods: {
|
||||
closePanelEdit() {
|
||||
debugger
|
||||
bus.$emit('PanelSwitchComponent', { name: 'PanelMain' })
|
||||
},
|
||||
goFile() {
|
||||
this.$refs.files.click()
|
||||
},
|
||||
|
@ -67,6 +67,7 @@
|
||||
</div>
|
||||
</de-main-container>
|
||||
</de-container>
|
||||
|
||||
</el-container>
|
||||
</template>
|
||||
|
||||
@ -94,6 +95,7 @@ import 'element-ui/lib/theme-chalk/index.css'
|
||||
import '@/components/canvas/styles/reset.css'
|
||||
import { ApplicationContext } from '@/utils/ApplicationContext'
|
||||
export default {
|
||||
name: 'PanelEdit',
|
||||
components: {
|
||||
DeMainContainer,
|
||||
DeContainer,
|
||||
@ -102,11 +104,11 @@ export default {
|
||||
ViewSelect,
|
||||
Editor,
|
||||
Toolbar
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
editView: false,
|
||||
clickNotClose: false,
|
||||
showIndex: -1,
|
||||
activeName: 'attr',
|
||||
|
@ -1,25 +1,5 @@
|
||||
<template>
|
||||
<de-container>
|
||||
|
||||
<de-aside-container>
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane name="PanelList">
|
||||
<span slot="label"><i class="el-icon-document" />列表</span>
|
||||
<panel-list />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="panels_star">
|
||||
<span slot="label"><i class="el-icon-star-off" />收藏</span>
|
||||
开发中...
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="panels_share" :lazy="true">
|
||||
<span slot="label"><i class="el-icon-share" />分享</span>
|
||||
<share-tree v-if="showShare" />
|
||||
</el-tab-pane>
|
||||
|
||||
</el-tabs>
|
||||
|
||||
</de-aside-container>
|
||||
|
||||
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
|
||||
<de-main-container>
|
||||
<component :is="component" :param="param" />
|
||||
</de-main-container>
|
||||
@ -27,45 +7,42 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import bus from '@/utils/bus'
|
||||
import DeMainContainer from '@/components/dataease/DeMainContainer'
|
||||
import DeContainer from '@/components/dataease/DeContainer'
|
||||
import DeAsideContainer from '@/components/dataease/DeAsideContainer'
|
||||
// import Group from './group/Group'
|
||||
import PanelList from './list/PanelList'
|
||||
import PanelViewShow from './list/PanelViewShow'
|
||||
import ShareTree from './GrantAuth/shareTree'
|
||||
import PanelMain from '@/views/panel/list/PanelMain'
|
||||
import ChartEdit from '@/views/chart/view/ChartEdit'
|
||||
import PanelEdit from '@/views/panel/edit'
|
||||
|
||||
export default {
|
||||
name: 'Panel',
|
||||
components: { DeMainContainer, DeContainer, DeAsideContainer, PanelList, PanelViewShow, ShareTree },
|
||||
components: { DeMainContainer, DeContainer, PanelMain, ChartEdit, PanelEdit },
|
||||
data() {
|
||||
return {
|
||||
component: PanelViewShow,
|
||||
param: {},
|
||||
activeName: 'PanelList',
|
||||
showShare: false
|
||||
component: PanelMain,
|
||||
param: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
// 点击分析面板需要刷新分享内容
|
||||
if (tab.name === 'panels_share') {
|
||||
this.refreshShare()
|
||||
mounted() {
|
||||
bus.$on('PanelSwitchComponent', (c) => {
|
||||
debugger
|
||||
console.log(c)
|
||||
this.param = c.param
|
||||
switch (c.name) {
|
||||
case 'PanelEdit':
|
||||
this.component = PanelEdit
|
||||
break
|
||||
case 'ChartEdit':
|
||||
this.component = ChartEdit
|
||||
break
|
||||
default:
|
||||
this.component = PanelMain
|
||||
break
|
||||
}
|
||||
},
|
||||
// switchComponent(c) {
|
||||
// console.log(c)
|
||||
// this.param = c.param
|
||||
// switch (c.name) {
|
||||
// case 'PanelViewShow':
|
||||
// this.component = PanelViewShow
|
||||
// break
|
||||
// }
|
||||
// },
|
||||
refreshShare() {
|
||||
this.showShare = false
|
||||
this.$nextTick(() => (this.showShare = true))
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -80,6 +57,7 @@ export default {
|
||||
|
||||
.ms-main-container {
|
||||
height: calc(100vh - 56px);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
156
frontend/src/views/panel/list/ChartViewEdit.vue
Normal file
156
frontend/src/views/panel/list/ChartViewEdit.vue
Normal file
@ -0,0 +1,156 @@
|
||||
<template>
|
||||
<el-row style="height: 100%;overflow-y: hidden;width: 100%;">
|
||||
<el-row style="display: flex;height: 100%">
|
||||
|
||||
<el-col class="panel-design">
|
||||
<!--TODO 仪表盘设计公共设置区域-->
|
||||
<el-row class="panel-design-head">
|
||||
<span style="float: left;line-height: 40px; color: gray">
|
||||
<span>名称:{{ panelInfo.name || '测试仪表板' }}</span>
|
||||
</span>
|
||||
<span style="float: right;line-height: 40px;">
|
||||
<el-tooltip content="预览">
|
||||
<el-button class="el-icon-view" size="mini" circle />
|
||||
</el-tooltip>
|
||||
</span>
|
||||
</el-row>
|
||||
<!--TODO 仪表盘预览区域-->
|
||||
<section>
|
||||
<Preview />
|
||||
</section>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-row>
|
||||
</template>
|
||||
<script>
|
||||
import ChartEdit from '@/views/chart/view/ChartEdit'
|
||||
|
||||
export default {
|
||||
name: 'ChartViewEdit',
|
||||
components: { ChartEdit },
|
||||
data() {
|
||||
return {
|
||||
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
panelInfo() {
|
||||
return this.$store.state.panel.panelInfo
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.view-list {
|
||||
height: 100%;
|
||||
width: 20%;
|
||||
min-width: 180px;
|
||||
max-width: 220px;
|
||||
border: 1px solid #E6E6E6;
|
||||
border-left: 0 solid;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.view-list-thumbnails-outline {
|
||||
height: 100%;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.view-list-thumbnails {
|
||||
width: 100%;
|
||||
padding: 0px 15px 15px 0px;
|
||||
}
|
||||
|
||||
.panel-design {
|
||||
height: 100%;
|
||||
min-width: 500px;
|
||||
border-top: 1px solid #E6E6E6;
|
||||
}
|
||||
|
||||
.panel-design-head {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.panel-design-show {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border-top: 1px solid #E6E6E6;
|
||||
}
|
||||
|
||||
.padding-lr {
|
||||
padding: 0 6px;
|
||||
}
|
||||
|
||||
.itxst {
|
||||
margin: 10px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.col {
|
||||
width: 40%;
|
||||
flex: 1;
|
||||
padding: 10px;
|
||||
border: solid 1px #eee;
|
||||
border-radius: 5px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.col + .col {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.item {
|
||||
padding: 2px 12px;
|
||||
margin: 3px 3px 0 3px;
|
||||
border: solid 1px #eee;
|
||||
background-color: #f1f1f1;
|
||||
text-align: left;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.item + .item {
|
||||
border-top: none;
|
||||
margin-top: 3px;
|
||||
}
|
||||
|
||||
.item:hover {
|
||||
background-color: #fdfdfd;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.item-axis {
|
||||
padding: 2px 12px;
|
||||
margin: 3px 3px 0 3px;
|
||||
border: solid 1px #eee;
|
||||
background-color: #f1f1f1;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.item-axis:hover {
|
||||
background-color: #fdfdfd;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 600px;
|
||||
border: 1px solid #000;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
@ -519,7 +519,7 @@ export default {
|
||||
},
|
||||
edit(data) {
|
||||
this.$store.dispatch('panel/setPanelInfo', data)
|
||||
this.$router.replace('/panelEdit')
|
||||
bus.$emit('PanelSwitchComponent', { name: 'PanelEdit' })
|
||||
},
|
||||
link(data) {
|
||||
this.linkVisible = true
|
||||
|
68
frontend/src/views/panel/list/PanelMain.vue
Normal file
68
frontend/src/views/panel/list/PanelMain.vue
Normal file
@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<de-container>
|
||||
<de-aside-container>
|
||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
||||
<el-tab-pane name="PanelList">
|
||||
<span slot="label"><i class="el-icon-document" />列表</span>
|
||||
<panel-list />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="panels_star">
|
||||
<span slot="label"><i class="el-icon-star-off" />收藏</span>
|
||||
开发中...
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="panels_share" :lazy="true">
|
||||
<span slot="label"><i class="el-icon-share" />分享</span>
|
||||
<share-tree v-if="showShare" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</de-aside-container>
|
||||
<de-main-container>
|
||||
<PanelViewShow />
|
||||
</de-main-container>
|
||||
</de-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import DeMainContainer from '@/components/dataease/DeMainContainer'
|
||||
import DeContainer from '@/components/dataease/DeContainer'
|
||||
import DeAsideContainer from '@/components/dataease/DeAsideContainer'
|
||||
import PanelList from '../list/PanelList'
|
||||
import PanelViewShow from '../list/PanelViewShow'
|
||||
import ShareTree from '../GrantAuth/shareTree'
|
||||
|
||||
export default {
|
||||
name: 'PanelMain',
|
||||
components: { DeMainContainer, DeContainer, DeAsideContainer, PanelList, PanelViewShow, ShareTree },
|
||||
data() {
|
||||
return {
|
||||
activeName: 'PanelList',
|
||||
showShare: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleClick(tab, event) {
|
||||
// 点击分析面板需要刷新分享内容
|
||||
if (tab.name === 'panels_share') {
|
||||
this.refreshShare()
|
||||
}
|
||||
},
|
||||
refreshShare() {
|
||||
this.showShare = false
|
||||
this.$nextTick(() => (this.showShare = true))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ms-aside-container {
|
||||
height: calc(100vh - 56px);
|
||||
padding: 15px;
|
||||
min-width: 260px;
|
||||
max-width: 460px;
|
||||
}
|
||||
.ms-main-container {
|
||||
height: calc(100vh - 56px);
|
||||
}
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user