Merge branch 'dev' of github.com:dataease/dataease into dev

This commit is contained in:
taojinlong 2022-03-29 16:00:07 +08:00
commit 38905dcec8
25 changed files with 90 additions and 52 deletions

View File

@ -41,6 +41,7 @@ public class DePermissionAnnotationHandler {
DePermission[] dePermissions = annotation.value();
Object[] args = point.getArgs();
if (logical == Logical.AND) {
access = true;
for (int i = 0; i < dePermissions.length; i++) {
DePermission permission = dePermissions[i];
boolean currentAccess = access(args[permission.paramIndex()], permission, 0);

View File

@ -55,6 +55,10 @@ public class ShiroServiceImpl implements ShiroService {
filterChainDefinitionMap.put("/linkJump/queryPanelJumpInfo/**", ANON);
filterChainDefinitionMap.put("/linkJump/queryTargetPanelJumpInfo", ANON);
//外部跳转参数
filterChainDefinitionMap.put("/outerParams/**", ANON);
filterChainDefinitionMap.put("/tempMobileLink/**", ANON);
filterChainDefinitionMap.put("/de-app/**", ANON);
filterChainDefinitionMap.put("/app.html", ANON);

View File

@ -92,7 +92,8 @@
LEFT JOIN panel_outer_params_info popi ON pop.params_id = popi.params_id
LEFT JOIN panel_outer_params_target_view_info poptvi ON popi.params_info_id = poptvi.params_info_id
WHERE
pop.panel_id = #{panelId}
pop.panel_id = #{panelId} and pop.checked=1
and popi.checked=1
</select>

View File

@ -803,7 +803,7 @@ public class ChartViewService {
pluginViewParam.setPluginChartFieldCustomFilters(fieldFilters);
pluginViewParam.setPluginChartExtFilters(panelFilters);
pluginViewParam.setPluginViewLimit(pluginViewLimit);
pluginViewParam.setUserId(AuthUtils.getUser().getUserId());
// pluginViewParam.setUserId(AuthUtils.getUser().getUserId());
return pluginViewParam;
}

View File

@ -41,7 +41,9 @@
url += '&user=' + encodeURIComponent(user)
}
if (attachParams) {
url += '&attachParams=' + attachParams
console.log('attachParams-bf:'+attachParams+';-af:'+encodeURIComponent(attachParams))
url += '&attachParams=' + encodeURIComponent(attachParams)
}
window.location.href = url
</script>

View File

@ -50,7 +50,7 @@ export default {
if (this.curComponent.type === 'view') {
this.$store.dispatch('chart/setViewId', null)
this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }})
bus.$emit('change_panel_right_draw', true)
}
if (this.curComponent.type === 'custom') {
bus.$emit('component-dialog-edit')

View File

@ -1,6 +1,6 @@
<template>
<div class="bar-main">
<div v-if="!linkageSettingStatus">
<div>
<span v-if="isEdit" :title="$t('panel.edit')">
<i class="icon iconfont icon-edit" @click.stop="edit" />
</span>
@ -51,12 +51,9 @@ export default {
},
methods: {
edit() {
//
this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
this.$store.dispatch('chart/setViewId', null)
this.$store.dispatch('chart/setViewId', this.viewId)
bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.viewId, 'optType': 'edit' }})
bus.$emit('change_panel_right_draw', true)
},
linkageEdit() {

View File

@ -46,9 +46,6 @@ export default {
this.$refs.trackButton.$el.click()
},
edit() {
//
this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
if (this.curComponent.type === 'view') {
this.$store.dispatch('chart/setViewId', null)
this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)

View File

@ -372,7 +372,7 @@ export default {
this.destroyTimeMachine()
this.changeIndex++
this.chartResize(this.changeIndex)
} else {
} else if (this.$refs[this.element.propValue.id]) {
this.chart.isPlugin
? this.$refs[this.element.propValue.id].callPluginInner({ methodName: 'chartResize' })
: this.$refs[this.element.propValue.id].chartResize()

View File

@ -1,16 +1,17 @@
<template>
<el-aside
:width="width"
:width="currentWidth"
class="ms-aside-container"
:style="{'margin-left': !asideHidden ? 0 : '-' + width}"
:style="{'margin-left': !asideHidden ? 0 : '-' + currentWidth}"
>
<slot />
<de-horizontal-drag-bar v-if="showDragBar" />
<de-horizontal-drag-bar v-if="showDragBar" :type="type" />
</el-aside>
</template>
<script>
import DeHorizontalDragBar from './dragbar/DeLeft2RightDragBar'
import { getLayout } from '@/utils/LayoutUtil'
export default {
name: 'DeAsideContainer',
components: { DeHorizontalDragBar },
@ -26,12 +27,21 @@ export default {
showDragBar: {
type: Boolean,
default: true
},
type: {
type: String,
default: null
}
},
data() {
return {
asideHidden: false
}
},
computed: {
currentWidth() {
return this.type && getLayout(this.type) || this.width
}
}
}
</script>

View File

@ -1,10 +1,16 @@
<template>
<div v-left-to-right-drag class="drag-bar" />
<div v-left-to-right-drag="type" class="drag-bar" />
</template>
<script>
export default {
name: 'DeLeft2RightDragBar'
name: 'DeLeft2RightDragBar',
props: {
type: {
type: String,
default: null
}
}
}
</script>

View File

@ -1,8 +1,9 @@
import permission from '@/directive/Permission'
// import dataPermission from '@/directive/DataPermission'
import { setLayout } from '@/utils/LayoutUtil'
export const left2RightDrag = {
inserted(el, binding) {
const value = binding.value
el.onmousedown = function(e) {
const init = e.clientX
const parent = el.parentNode
@ -15,6 +16,8 @@ export const left2RightDrag = {
}
}
document.onmouseup = function() {
value && setLayout(value, parent.style.width)
document.onmousemove = document.onmouseup = null
}
}

View File

@ -1390,6 +1390,7 @@ export default {
sure_bt: 'Confirm'
},
panel: {
json_params_error: 'Third Party Parameters Parsing Failed. Please Check Whether The Parameters Format Is Correct',
inner_padding: 'Inner Padding',
board_radio: 'Board Radio',
background: 'Background',

View File

@ -1391,6 +1391,7 @@ export default {
sure_bt: '確定'
},
panel: {
json_params_error: '第三方参数解析失败,请检查参数格式是否正确',
inner_padding: '内边距',
board_radio: '边框半径',
background: '背景',

View File

@ -1399,6 +1399,7 @@ export default {
sure_bt: '确定'
},
panel: {
json_params_error: '第三方参数解析失败,请检查参数格式是否正确',
inner_padding: '内边距',
board_radio: '边框半径',
background: '背景',

View File

@ -4,7 +4,7 @@
<topbar v-if="!fullHeightFlag && finishLoad" :show-tips="showTips" />
<de-container :style="mainStyle">
<de-aside-container v-if="!sidebar.hide" class="le-aside-container">
<de-aside-container v-if="!sidebar.hide" type="system" class="le-aside-container">
<sidebar class="sidebar-container" />
</de-aside-container>

View File

@ -0,0 +1,17 @@
const defaultLayout = {
panel: '260px',
dataset: '260px',
datasource: '260px',
system: '260px'
}
const STORAGE_KEY = 'global_layout'
export const getLayout = (type) => {
const key = STORAGE_KEY + '_' + type
return localStorage.getItem(key) || defaultLayout[type]
}
export const setLayout = (type, val) => {
const key = STORAGE_KEY + '_' + type
localStorage.setItem(key, val || defaultLayout[type])
}

View File

@ -1,7 +1,7 @@
<template>
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<de-aside-container>
<de-aside-container type="dataset">
<group :save-status="saveStatus" @switchComponent="switchComponent" />
</de-aside-container>
@ -30,7 +30,7 @@ import { removeClass } from '@/utils'
import { checkCustomDs } from '@/api/dataset/dataset'
export default {
name: 'DataSet',
components: { DeMainContainer, DeContainer, DeAsideContainer, Group, DataHome, ViewTable, AddDB, AddSQL, AddExcel, AddCustom, AddApi},
components: { DeMainContainer, DeContainer, DeAsideContainer, Group, DataHome, ViewTable, AddDB, AddSQL, AddExcel, AddCustom, AddApi },
data() {
return {
component: DataHome,

View File

@ -69,7 +69,7 @@ export default {
if (attachParamsEncode) {
try {
const Base64 = require('js-base64').Base64
const attachParam = JSON.parse(Base64.decode(attachParamsEncode))
const attachParam = JSON.parse(decodeURIComponent(Base64.decode(attachParamsEncode)))
getOuterParamsInfo(this.resourceId).then(rsp => {
if (--loadingCount === 0) {
this.show = true
@ -81,6 +81,12 @@ export default {
if (--loadingCount === 0) {
this.show = true
}
this.$message({
message: this.$t('panel.json_params_error'),
type: 'error',
showClose: true
})
console.log('outerParams Decode error', e)
}
}

View File

@ -259,7 +259,7 @@ export default {
this.$emit('outerParamsSetVisibleChange', false)
},
save() {
if (checkRepeat(this.outerParams.outerParamsInfoArray, 'name')) {
if (checkRepeat(this.outerParams.outerParamsInfoArray, 'paramName')) {
this.$message({
message: this.$t('panel.repeat_params'),
type: 'warn',
@ -389,7 +389,7 @@ export default {
}
.bottom {
margin-top: 20px;
margin-top: 15px;
text-align: center;
}
@ -482,7 +482,7 @@ export default {
}
.tree-bottom {
margin-top: 12px;
margin-top: 7px;
text-align: center;
}

View File

@ -634,15 +634,7 @@ export default {
init(panelId) {
const _this = this
_this.initHasStar()
// 使
const componentDataTemp = this.$store.state.panel.componentDataTemp
const canvasStyleDataTemp = this.$store.state.panel.canvasStyleDataTemp
if (componentDataTemp && canvasStyleDataTemp) {
panelInit(JSON.parse(componentDataTemp), JSON.parse(canvasStyleDataTemp))
//
_this.$store.dispatch('panel/setComponentDataTemp', null)
_this.$store.dispatch('panel/setCanvasStyleDataTemp', null)
} else if (panelId) {
if (panelId) {
initPanelData(panelId, function() {
//
initViewCache(panelId)
@ -650,10 +642,6 @@ export default {
setTimeout(() => {
_this.$store.commit('refreshSaveStatus')
}, 500)
// initPanelComponentsData(panelId, function(rsp) {
// _this.$store.commit('initPanelComponents', rsp)//
// _this.$store.commit('recordSnapshot', 'init')//
// })
})
}
},

View File

@ -690,9 +690,6 @@ export default {
this.$store.commit('refreshSnapshot')
this.$store.commit('setComponentData', [])
this.$store.commit('setCanvasStyle', DEFAULT_COMMON_CANVAS_STYLE_STRING)
//
this.$store.dispatch('panel/setComponentDataTemp', null)
this.$store.dispatch('panel/setCanvasStyleDataTemp', null)
this.$store.dispatch('panel/setPanelInfo', data)
bus.$emit('PanelSwitchComponent', { name: 'PanelEdit' })
},

View File

@ -1,6 +1,6 @@
<template>
<de-container>
<de-aside-container>
<de-aside-container type="panel">
<el-tabs v-model="activeName" class="tab-panel" :stretch="true" @tab-click="handleClick">
<el-tab-pane name="PanelList">
<span slot="label"><i class="el-icon-document tablepanel-i" />{{ $t('panel.panel_list') }}</span>

View File

@ -1,11 +1,17 @@
<template>
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<de-aside-container style="padding: 0 0;">
<ds-tree ref="dsTree" :datasource="datasource" @switch-main="switchMain"/>
<de-aside-container style="padding: 0 0;" type="datasource">
<ds-tree ref="dsTree" :datasource="datasource" @switch-main="switchMain" />
</de-aside-container>
<de-main-container>
<component :is="component" v-if="!!component" :params="param" :tData="tData" @refresh-type="refreshType"
@switch-component="switchMain"/>
<component
:is="component"
v-if="!!component"
:params="param"
:t-data="tData"
@refresh-type="refreshType"
@switch-component="switchMain"
/>
</de-main-container>
</de-container>
</template>
@ -20,7 +26,7 @@ import DataHome from './DataHome'
export default {
name: 'DsMain',
components: {DeMainContainer, DeContainer, DeAsideContainer, DsTree, DataHome},
components: { DeMainContainer, DeContainer, DeAsideContainer, DsTree, DataHome },
data() {
return {
component: DataHome,
@ -37,7 +43,7 @@ export default {
methods: {
// main
switchMain(param) {
const {component, componentParam, tData} = param
const { component, componentParam, tData } = param
this.component = DataHome
this.param = null
this.$nextTick(() => {
@ -55,7 +61,7 @@ export default {
})
},
refreshType(datasource) {
this.datasource = datasource;
this.datasource = datasource
this.$refs.dsTree && this.$refs.dsTree.refreshType(datasource)
},
msg2Current(sourceParam) {

View File

@ -1,7 +1,7 @@
<template>
<de-container v-loading="$store.getters.loadingMap[$store.getters.currentPath]">
<de-main-container>
<ds-main ref="dsMain"/>
<ds-main ref="dsMain" />
</de-main-container>
</de-container>
</template>
@ -14,7 +14,7 @@ import bus from '@/utils/bus'
export default {
name: 'Panel',
components: {DeMainContainer, DeContainer, DsMain},
components: { DeMainContainer, DeContainer, DsMain },
data() {
return {
component: DsMain,