提交 2d749d76 authored 作者: taojinlong's avatar taojinlong

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

package io.dataease.auth.service.impl;
import com.google.gson.Gson;
import io.dataease.auth.api.dto.CurrentRoleDto;
import io.dataease.auth.entity.SysUserEntity;
import io.dataease.base.domain.SysUser;
......@@ -34,7 +33,7 @@ public class AuthUserServiceImpl implements AuthUserService {
@Resource
private SysUserMapper sysUserMapper;
@Resource
private ExtPluginSysMenuMapper extPluginSysMenuMapper;
private DynamicMenuServiceImpl dynamicMenuService;
/**
* 此处需被F2CRealm登录认证调用 也就是说每次请求都会被调用 所以最好加上缓存
......@@ -66,7 +65,7 @@ public class AuthUserServiceImpl implements AuthUserService {
@Override
public List<String> permissions(Long userId){
// 用户登录获取菜单权限时同时更新插件菜单表
this.syncPluginMenu();
dynamicMenuService.syncPluginMenu();
List<String> permissions;
SysUser sysUser = sysUserMapper.selectByPrimaryKey(userId);
if(sysUser.getIsAdmin()!=null&&sysUser.getIsAdmin()){
......@@ -103,15 +102,4 @@ public class AuthUserServiceImpl implements AuthUserService {
LogUtil.info("正在清除用户缓存【{}】",userId);
}
@Transactional
public void syncPluginMenu() {
List<PluginSysMenu> pluginSysMenuList = PluginUtils.pluginMenus();
int i = extPluginSysMenuMapper.deletePluginMenu();
LogUtil.info("删除插件菜单记录数{}", i);
if(CollectionUtils.isNotEmpty(pluginSysMenuList)){
LogUtil.info("待插入插件菜单记录是"+new Gson().toJson(pluginSysMenuList));
extPluginSysMenuMapper.savePluginMenu(pluginSysMenuList);
}
}
}
......@@ -6,11 +6,15 @@ import io.dataease.auth.service.DynamicMenuService;
import io.dataease.base.domain.SysMenu;
import io.dataease.base.domain.SysMenuExample;
import io.dataease.base.mapper.SysMenuMapper;
import io.dataease.base.mapper.ext.ExtPluginSysMenuMapper;
import io.dataease.plugins.common.dto.PluginSysMenu;
import io.dataease.plugins.util.PluginUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
......@@ -22,6 +26,9 @@ public class DynamicMenuServiceImpl implements DynamicMenuService {
@Autowired(required = false)
private SysMenuMapper sysMenuMapper;
@Resource
private ExtPluginSysMenuMapper extPluginSysMenuMapper;
@Override
public List<DynamicMenuDto> load(String userId) {
SysMenuExample sysMenuExample = new SysMenuExample();
......@@ -109,4 +116,13 @@ public class DynamicMenuServiceImpl implements DynamicMenuService {
private Boolean isParent(Long pid){
return null == pid || pid==0L;
}
@Transactional
public void syncPluginMenu() {
List<PluginSysMenu> pluginSysMenuList = PluginUtils.pluginMenus();
extPluginSysMenuMapper.deletePluginMenu();
if(CollectionUtils.isNotEmpty(pluginSysMenuList)){
extPluginSysMenuMapper.savePluginMenu(pluginSysMenuList);
}
}
}
......@@ -6,6 +6,7 @@ import io.dataease.dto.chart.ChartCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.provider.QueryProvider;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
......@@ -366,6 +367,9 @@ public class DorisQueryProvider extends QueryProvider {
for (ChartCustomFilterDTO request : requestList) {
String value = request.getValue();
DatasetTableField field = request.getField();
if (ObjectUtils.isEmpty(field)) {
continue;
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
filter.append(" AND FROM_UNIXTIME(cast(")
.append(field.getDataeaseName())
......
......@@ -6,6 +6,7 @@ import io.dataease.dto.chart.ChartCustomFilterDTO;
import io.dataease.dto.chart.ChartViewFieldDTO;
import io.dataease.provider.QueryProvider;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
......@@ -374,6 +375,9 @@ public class MysqlQueryProvider extends QueryProvider {
for (ChartCustomFilterDTO request : requestList) {
String value = request.getValue();
DatasetTableField field = request.getField();
if (ObjectUtils.isEmpty(field)) {
continue;
}
if (field.getDeType() == 1 && field.getDeExtractType() != 1) {
filter.append(" AND FROM_UNIXTIME(cast(")
.append(field.getOriginName())
......
......@@ -261,4 +261,4 @@ i18n_custom_ds_delete=自定義數據集所關聯數據被刪除,無法正常
i18n_sql_add_not_matching=增量添加 sql 的數據列與數據集不匹配,
i18n_sql_delete_not_matching=增量刪除 sql 的數據列與數據集不匹配,
i18n_cst_ds_tb_or_field_deleted=自定義數據集所關聯數據被刪除或字段發生變化,無法正常顯示
i18n_no_all_delete_privilege_folder=该目录下存在没有管理权限或查看权限的资源,无法删
i18n_no_all_delete_privilege_folder=該目錄下存在沒有管理權限或查看權限的資源,無法刪
......@@ -68,11 +68,12 @@ export function listDatasource() {
})
}
export function getTable(id) {
export function getTable(id, hideMsg = false) {
return request({
url: '/dataset/table/get/' + id,
loading: true,
method: 'post'
method: 'post',
hideMsg: hideMsg
})
}
......
......@@ -3,13 +3,13 @@
<div class="toolbar">
<div class="canvas-config" style="margin-right: 10px">
<el-switch v-model="canvasStyleData.auxiliaryMatrix" :width="35" label="矩阵设计" name="auxiliaryMatrix" />
<span>矩阵设计</span>
<el-switch v-model="canvasStyleData.auxiliaryMatrix" :width="35" name="auxiliaryMatrix" />
<span>{{ $t('panel.matrix_design') }}</span>
</div>
<div class="canvas-config" style="margin-right: 10px">
<el-switch v-model="canvasStyleData.selfAdaption" :width="35" label="自适应画布区域" name="selfAdaption" />
<span>自适应画布区域 </span>
<el-switch v-model="canvasStyleData.selfAdaption" :width="35" name="selfAdaption" />
<span>{{ $t('panel.canvas_self_adaption') }} </span>
</div>
<div class="canvas-config" style="margin-right: 55px">
......
......@@ -999,6 +999,7 @@ export default {
default_panel_name: 'Default Dashboard Name',
source_panel_name: 'Source Dashboard Name',
content_style: 'Content Style',
canvas_self_adaption: 'Canvas Self Adaption'
},
plugin: {
local_install: 'Local installation',
......
差异被折叠。
......@@ -998,7 +998,8 @@ export default {
content: '内容',
default_panel_name: '默认仪表板名称',
source_panel_name: '原仪表板名称',
content_style: '内容样式'
content_style: '内容样式',
canvas_self_adaption: '自适应画布区域'
},
plugin: {
local_install: '本地安装',
......
......@@ -53,6 +53,7 @@ export const filterAsyncRouter = (routers) => { // 遍历后台传来的路由
router.component = loadView(component)
}
}
router.name && fillMeta(router)
if (router.children && router.children.length) {
router.children = filterAsyncRouter(router.children)
}
......@@ -66,6 +67,14 @@ export const filterAsyncRouter = (routers) => { // 遍历后台传来的路由
})
}
// 后台设计时未考虑activeMenu字段 这里先前端处理一下
export const fillMeta = (router) => {
router.name.includes('system-user-form') && (router.meta.activeMenu = '/system/user')
router.name.includes('system-role-form') && (router.meta.activeMenu = '/system/role')
router.name.includes('system-dept-form') && (router.meta.activeMenu = '/system/dept')
// return router
}
// 包装一层父级目录
export const decorate = (router) => {
const parent = {
......
<template>
<el-row style="height: 100%;overflow-y: hidden;width: 100%;">
<span v-show="false">{{ tableRefresh }}</span>
<el-row style="height: 26px;">
<el-popover
placement="right-start"
......@@ -92,6 +93,12 @@ export default {
tabStatus: false
}
},
computed: {
tableRefresh() {
this.initTable(this.param)
return this.$store.state.dataset.table
}
},
watch: {
'param': function() {
this.initTable(this.param)
......@@ -107,9 +114,11 @@ export default {
if (id !== null) {
this.fields = []
this.data = []
getTable(id).then(response => {
getTable(id, true).then(response => {
this.table = response.data
this.initPreviewData(this.page)
}).catch(res => {
this.$emit('switchComponent', { name: '' })
})
}
},
......
......@@ -561,8 +561,8 @@ export default {
// this.tableTree()
this.refreshNodeBy(table.sceneId)
// this.$router.push('/dataset/home')
this.$emit('switchComponent', { name: '' })
this.$store.dispatch('dataset/setTable', null)
// this.$emit('switchComponent', { name: 'ViewTable', param: table.id })
this.$store.dispatch('dataset/setTable', new Date().getTime())
})
} else {
// this.$message({
......@@ -609,8 +609,8 @@ export default {
// this.tableTree()
this.refreshNodeBy(data.sceneId)
// this.$router.push('/dataset/home')
this.$emit('switchComponent', { name: '' })
this.$store.dispatch('dataset/setTable', null)
// this.$emit('switchComponent', { name: '' })
this.$store.dispatch('dataset/setTable', new Date().getTime())
})
}).catch(() => {
})
......
......@@ -20,14 +20,14 @@
<background-color-selector v-if="chart" class="attr-selector" :chart="chart" @onChangeBackgroundForm="onChangeBackgroundForm" />
</el-row>
</el-collapse-item>
<el-collapse-item :title="$t('chart.shape_attr')" name="graphical">
<el-collapse-item :title="$t('panel.table')" name="table">
<el-row style="background-color: #f7f8fa; margin: 5px">
<color-selector :source-type="'panelEchart'" class="attr-selector" :chart="chart" @onColorChange="onColorChange" />
<color-selector index="10002" :source-type="'panelTable'" class="attr-selector" :chart="tableChart" @onColorChange="onTableColorChange" />
</el-row>
</el-collapse-item>
<el-collapse-item :title="$t('panel.table')" name="table">
<el-collapse-item :title="$t('chart.shape_attr')" name="graphical">
<el-row style="background-color: #f7f8fa; margin: 5px">
<color-selector index="10002" :source-type="'panelTable'" class="attr-selector" :chart="tableChart" @onColorChange="onTableColorChange" />
<color-selector :source-type="'panelEchart'" class="attr-selector" :chart="chart" @onColorChange="onColorChange" />
</el-row>
</el-collapse-item>
</el-collapse>
......
......@@ -141,7 +141,7 @@ export default {
if (!(element.type in types)) {
types[element.type] = []
// newArr.push(...element, ...{ children: types[element.type] })
newArr.push({ id: element.type, name: element.type, type: 'folder', children: types[element.type] })
newArr.push({ id: element.type, name: this.transTypeToName(element.type), type: 'folder', children: types[element.type] })
}
types[element.type].push(element)
// newArr.children.push({ id: element.id, label: element.name })
......@@ -149,6 +149,14 @@ export default {
return newArr
},
transTypeToName(type) {
if (type === 'mysql') {
return 'MySQL'
} else if (type === 'sqlServer') {
return 'SQL Server'
}
},
addFolder() {
this.switchMain('DsForm')
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论