提交 3235658f authored 作者: taojinlong's avatar taojinlong

Merge branch 'v1.3' of github.com:dataease/dataease into v1.3

......@@ -15,7 +15,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@Service
......@@ -117,8 +119,10 @@ public class DynamicMenuServiceImpl implements DynamicMenuService {
@Transactional
public void syncPluginMenu() {
List<PluginSysMenu> pluginSysMenuList = PluginUtils.pluginMenus();
extPluginSysMenuMapper.deletePluginMenu();
List<PluginSysMenu> pluginSysMenuList = PluginUtils.pluginMenus();
Set<PluginSysMenu> pluginSysMenuSet = new HashSet<>(pluginSysMenuList);
pluginSysMenuList = new ArrayList<>(pluginSysMenuSet);
if(CollectionUtils.isNotEmpty(pluginSysMenuList)){
extPluginSysMenuMapper.savePluginMenu(pluginSysMenuList);
}
......
差异被折叠。
.dragAndResize
{
position: relative;
user-select: none;
*
{
box-sizing: border-box;
margin: 0;
padding: 0;
}
.item
{
position: absolute;
width: 100px;
height: 100px;
cursor: move;
border: 1px solid;
background-color: #fff;
.resizeHandle
{
position: absolute;
right: 2px;
bottom: 2px;
width: 0;
height: 0;
cursor: nw-resize;
opacity: .5;
border-bottom: 10px solid black;
border-left: 10px solid transparent;
}
}
.moveAnimation
{
transition: top 80ms ease;
}
.canNotDrag
{
cursor: default!important;
}
.cloneNode
{
z-index: 3;
transition: none;
background-color: #bec1c9;
opacity: 0.5;
}
.movingItem
{
position: absolute;
border: none;
&:before
{
position: absolute;
z-index: 2;
top: 0;
left: 0;
width: 100%;
height: 100%;
content: 'movingItem';
background-color: #3d66e7;
}
}
.positionBox
{
position: fixed;
top: 0;
right: 100px;
overflow: auto;
width: 500px;
height: 500px;
border: 1px solid;
}
.coords
{
position: fixed;
right: 100px;
bottom: 200px;
overflow: auto;
width: 200px;
height: 200px;
border: 1px solid;
}
}
......@@ -1429,32 +1429,6 @@ export default {
infoBox.moveItem = item
infoBox.moveItemIndex = index
// infoBox.cloneItem = null
// infoBox.nowItemNode = null
// 通过.item 样式class 来获取最外层的de-drag 最外层的定位
// if (target.attr('class') && target.attr('class').indexOf('item') !== -1) {
// infoBox.nowItemNode = target
// // infoBox.cloneItem = target.clone()
// } else {
// infoBox.nowItemNode = target.parents('.item')
// // infoBox.cloneItem = infoBox.nowItemNode.clone()
// }
// infoBox.cloneItem.addClass('cloneNode')
// 使用deDrag 自己的shadow 进行阴影定位
// $(this.$el).append(infoBox.cloneItem)
// if (infoBox.cloneItem.position()) {
// infoBox.orignX = infoBox.cloneItem.position().left // 克隆对象原始X位置
// infoBox.orignY = infoBox.cloneItem.position().top
// } else {
// infoBox.orignX = 0 // 克隆对象原始X位置
// infoBox.orignY = 0
// infoBox.startX = 0
// infoBox.startY = 0
// }
infoBox.orignX = 0 // 克隆对象原始X位置
infoBox.orignY = 0
infoBox.startX = 0
......@@ -1464,8 +1438,6 @@ export default {
infoBox.oldY = item.y
infoBox.oldSizeX = item.sizex
infoBox.oldSizeY = item.sizey
// infoBox.orignWidth = infoBox.cloneItem.prop('offsetWidth')
// infoBox.orignHeight = infoBox.cloneItem.prop('offsetHeight')
},
onMouseUp(e) {
const vm = this
......@@ -1498,18 +1470,11 @@ export default {
const startY = infoBox.startY
const oldSizeX = infoBox.oldSizeX
const oldSizeY = infoBox.oldSizeY
// const orignWidth = infoBox.orignWidth
// const orignHeight = infoBox.orignHeight
const moveXSize = e.pageX - startX // X方向移动的距离
const moveYSize = e.pageY - startY // Y方向移动的距离
const addSizex = (moveXSize) % vm.cellWidth > (vm.cellWidth / 4 * 1) ? parseInt(((moveXSize) / vm.cellWidth + 1)) : parseInt(((moveXSize) / vm.cellWidth))
const addSizey = (moveYSize) % vm.cellHeight > (vm.cellHeight / 4 * 1) ? parseInt(((moveYSize) / vm.cellHeight + 1)) : parseInt(((moveYSize) / vm.cellHeight))
//
// const nowX = oldSizeX + addSizex > 0 ? oldSizeX + addSizex : 1
// const nowY = oldSizeY + addSizey > 0 ? oldSizeY + addSizey : 1
let nowX = Math.round((item.style.width * this.scalePointWidth) / this.matrixStyle.width)
let nowY = Math.round((item.style.height * this.scalePointHeight) / this.matrixStyle.height)
nowX = nowX > 0 ? nowX : 1
......@@ -1523,16 +1488,6 @@ export default {
})
}
})(addSizex, addSizey), 10)
// let nowWidth = orignWidth + moveXSize
// nowWidth = nowWidth <= vm.baseWidth ? vm.baseWidth : nowWidth
// let nowHeight = orignHeight + moveYSize
// nowHeight = nowHeight <= vm.baseHeight ? vm.baseHeight : nowHeight
// // 克隆元素实时改变大小
// cloneItem.css({
// width: nowWidth,
// height: nowHeight
// })
},
onDragging(e, item) {
const infoBox = this.infoBox
......@@ -1545,40 +1500,12 @@ export default {
vm.dragging.call(null, e, moveItem, moveItem._dragId)
vm.$set(moveItem, 'isPlayer', true)
// this.$set(moveItem, "show", false);
// const nowItemIndex = infoBox.moveItemIndex
// const cloneItem = infoBox.cloneItem
// const startX = infoBox.startX
// const startY = infoBox.startY
// const orignX = infoBox.orignX
// const orignY = infoBox.orignY
const oldX = infoBox.oldX
const oldY = infoBox.oldY
// const moveXSize = e.pageX - startX // X方向移动的距离
// const moveYSize = e.pageY - startY // Y方向移动的距离
//
// const nowCloneItemX = orignX + moveXSize
// const nowCloneItemY = orignY + moveYSize
// temp 临时测试
// let newX = parseInt((nowCloneItemX + (cloneItem.width() / 12) - vm.baseMarginLeft) / vm.cellWidth + 1)
// let newY = parseInt((nowCloneItemY + (cloneItem.height() / 12) - vm.baseMarginTop) / vm.cellHeight + 1)
let newX = Math.round((item.style.left * this.scalePointWidth) / this.matrixStyle.width) + 1
let newY = Math.round((item.style.top * this.scalePointHeight) / this.matrixStyle.height) + 1
// if (this.dragComponentInfo) {
// newX = Math.round(this.dragComponentInfo.x) + 1
// newY = Math.round(this.dragComponentInfo.y) + 1
// } else {
// newX = Math.round((item.style.left * this.scalePointWidth) / this.matrixStyle.width) + 1
// newY = Math.round((item.style.top * this.scalePointHeight) / this.matrixStyle.height) + 1
// }
newX = newX > 0 ? newX : 1
newY = newY > 0 ? newY : 1
// console.log('infoBox==>' + JSON.stringify(this.infoBox))
// console.log('infoBox:startX' + startX + ';startY' + startY + 'orignX' + orignX + 'orignY' + orignY + 'oldX' + oldX + 'oldY' + oldY + 'new:newX=' + newX + ';newY=' + newY)
debounce((function(newX, oldX, newY, oldY) {
return function() {
// console.log('move1')
......@@ -1594,11 +1521,6 @@ export default {
}
}
})(newX, oldX, newY, oldY), 10)
// cloneItem.css({
// left: nowCloneItemX + 'px',
// top: nowCloneItemY + 'px'
// })
},
endMove(e) {
......
......@@ -491,11 +491,11 @@ div:focus {
}
.blackTheme .el-tree-node__content:hover {
background-color: var(--SiderBG) !important;
background-color: var(--MenuHovorBG) !important;
}
.blackTheme .is-current > .el-tree-node__content {
background-color: var(--SiderBG) !important;
background-color: var(--MenuActiveBG) !important;
}
.blackTheme .el-collapse-item__header {
background-color: var(--ContentBG) !important;
......@@ -533,30 +533,30 @@ div:focus {
color: var(--Main) !important;
}
.blackTheme .elx-table--main-wrapper {
.blackTheme:not(.in-panel) .elx-table--main-wrapper {
.body--wrapper {
background-color: var(--TableBG) !important;
}
}
.blackTheme .elx-table {
.blackTheme:not(.in-panel) .elx-table {
color: var(--TableColor) !important;
}
.blackTheme .elx-body--column {
.blackTheme:not(.in-panel) .elx-body--column {
background-image: linear-gradient(var(--TableBorderColor), var(--TableBorderColor)), linear-gradient(var(--TableBorderColor), var(--TableBorderColor)) !important;
}
.blackTheme .elx-header--column {
.blackTheme:not(.in-panel) .elx-header--column {
background-image: linear-gradient(--TableBorderColor, --TableBorderColor), linear-gradient(--TableBorderColor, --TableBorderColor) !important;
}
.blackTheme tr.row--current {
.blackTheme:not(.in-panel) tr.row--current {
background-color: var(--MainBG) !important;
}
.blackTheme tr.elx-body--row:hover {
.blackTheme:not(.in-panel) tr.elx-body--row:hover {
background-color: var(--TableBG) !important;
}
.blackTheme .elx-table--header-border-line {
.blackTheme:not(.in-panel) .elx-table--header-border-line {
border-color: var(--TableBorderColor) !important;
}
......@@ -666,5 +666,9 @@ div:focus {
background-color: #324f62;
}
.blue-color {
color: var(--Main, #0000ff);
}
......@@ -40,7 +40,7 @@
<el-table-column prop="status" :label="$t('dataset.status')">
<template slot-scope="scope">
<span v-if="scope.row.status === 'Completed'" style="color: green">{{ $t('dataset.completed') }}</span>
<span v-if="scope.row.status === 'Underway'" style="color: blue">
<span v-if="scope.row.status === 'Underway'" class="blue-color">
<i class="el-icon-loading" />
{{ $t('dataset.underway') }}
</span>
......@@ -228,10 +228,10 @@
<span v-if="scope.row.status === 'Stopped'" style="color: red">
<div type="danger" style="font-size: 12px">{{ $t('dataset.task.stopped') }}</div>
</span>
<span v-if="scope.row.status === 'Pending'" style="color: blue">
<span v-if="scope.row.status === 'Pending'" class="blue-color">
<el-link type="primary" style="font-size: 12px" @click="changeTaskStatus(scope.row)">{{ $t('dataset.task.pending') }}</el-link>
</span>
<span v-if="scope.row.status === 'Exec'" style="color: blue">
<span v-if="scope.row.status === 'Exec'" class="blue-color">
<i class="el-icon-loading" />
{{ $t('dataset.underway') }}
</span>
......@@ -452,7 +452,7 @@ export default {
cellStyle({ row, column }) {
// 状态列字体颜色
if (row.status === 'Underway' && column === 'status') {
return 'color: blue'
return 'color: var(--Main, #0000ff)'
} else if (row.status === 'Completed' && column === 'status') {
return 'color: green'
} else if (row.status === 'Error' && column === 'status') {
......
<template>
<div id="demo">
<!-- <button @click="getList">getList</button> -->
<div class="head">
<router-link to="/" class="arrow">&larr;</router-link>
<span>基本应用</span>
</div>
<power-drag
ref="cyGridster"
:your-list="myList"
:base-margin-left="baseMarginLeft"
:base-margin-top="baseMarginTop"
:base-width="baseWidth"
:base-height="baseHeight"
>
<!-- <div v-for="(item,index) in myList" :slot="'slot'+index">
</div> -->
<div draggable="true" style="width: 200px;height: 200px;background: #1b6d85">
this is test
</div>
</power-drag>
</div>
</template>
<script>
import drag from '@/components/DeDrag/drag.vue'
import mock from 'mockjs'
import _ from 'lodash'
export default {
name: 'App',
components: {
'power-drag': drag
},
data() {
const list = mock.mock({
// "myList|10": [{
// "id|+1": 1,
// x: '@integer(1,5)',
// y: '@integer(1,5)',
// sizex: '@integer(1,3)',
// sizey: '@integer(1,3)',
// }]
myList: [{
'id': 3,
'x': 6,
'y': 2,
'sizex': 1,
'sizey': 1
}, {
'id': 5,
'x': 4,
'y': 2,
'sizex': 2,
'sizey': 1
}, {
'id': 7,
'x': 1,
'y': 2,
'sizex': 1,
'sizey': 1
}, {
'id': 9,
'x': 7,
'y': 2,
'sizex': 1,
'sizey': 1
}]
})
return {
myList: list.myList,
baseWidth: 0,
baseHeight: 0
}
},
created() {
// 屏幕适配,使得当前布局能在所有分辨率下适用,示例是在1366*638分辨率下完成
const screenWidth = window.innerWidth
const screenHeight = window.innerHeight
this.baseWidth = 90.8333 * (screenWidth / 1366)
this.baseHeight = 100 * (screenHeight / 638)
this.baseMarginLeft = 0
this.baseMarginTop = 0
this.$nextTick(function() {
$('.dragAndResize').css('width', 'calc(100% - ' + (this.baseMarginLeft) + 'px)')
})
},
mounted() {
const gridster = this.$refs['cyGridster'] // 获取gridster实例
gridster.init() // 在适当的时候初始化布局组件
},
methods: {
getList() {
const gridster = this.$refs['cyGridster'] // 获取gridster实例
console.log(JSON.stringify(gridster.getList()))
}
}
}
</script>
<style lang='less' scoped>
body {
overflow-x: hidden;
& * {
box-sizing: border-box;
}
}
#demo {
width: 100%;
padding: 1.5em 0 1.5em 0;
.head {
border-bottom: 1px dashed;
width: 100%;
padding-left: 20px;
height: 50px;
a {
text-decoration: none;
color: black;
}
}
.arrow {
font-size: 20px;
position: relative;
margin-right: 10px;
top: 2px;
}
}
</style>
......@@ -715,7 +715,4 @@ span{
font-size: 12px;
}
.blue-color {
color: var(--Main);
}
</style>
......@@ -253,7 +253,5 @@ export default {
span{
font-size: 12px;
}
.blue-color {
color: var(--Main);
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论