提交 8f88821b authored 作者: taojinlong's avatar taojinlong

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

......@@ -12,7 +12,7 @@ import lombok.Data;
@Data
public class PanelDesignDTO extends PanelDesign {
//当前视图是否在仪表中显示
//当前视图是否在仪表中显示
private boolean keepFlag = false;
//当前视图是否已经进行样式初始化
......
......@@ -102,7 +102,7 @@ public class ChartViewService {
return dto;
}
// 过滤来自仪表的条件
// 过滤来自仪表的条件
List<ChartExtFilterRequest> extFilterList = new ArrayList<>();
if (ObjectUtils.isNotEmpty(requestList.getFilter())) {
for (ChartExtFilterRequest request : requestList.getFilter()) {
......
......@@ -86,7 +86,7 @@ public class PanelGroupService {
panelGroupMapper.insert(request);
} else if ("toDefaultPanel".equals(request.getOptType())) {
panelId = UUID.randomUUID().toString();
// 转存为默认仪表
// 转存为默认仪表
PanelGroupWithBLOBs newDefaultPanel = panelGroupMapper.selectByPrimaryKey(request.getId());
newDefaultPanel.setPanelType(PanelConstants.PANEL_TYPE_SYSTEM);
newDefaultPanel.setNodeType(PanelConstants.PANEL_NODE_TYPE_PANEL);
......
......@@ -19,6 +19,7 @@ import io.dataease.controller.sys.request.SysUserPwdRequest;
import io.dataease.controller.sys.request.SysUserStateRequest;
import io.dataease.controller.sys.response.SysUserGridResponse;
import io.dataease.controller.sys.response.SysUserRole;
import io.dataease.i18n.Translator;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
......@@ -78,6 +79,7 @@ public class SysUserService {
@Transactional
public int save(SysUserCreateRequest request) {
checkUsername(request);
SysUser user = BeanUtils.copyBean(new SysUser(), request);
long now = System.currentTimeMillis();
user.setCreateTime(now);
......@@ -106,6 +108,7 @@ public class SysUserService {
@CacheEvict(value = AuthConstants.USER_CACHE_NAME, key = "'user' + #request.userId")
@Transactional
public int update(SysUserCreateRequest request) {
checkUsername(request);
if (StringUtils.isEmpty(request.getPassword())) {
request.setPassword(null);
}
......@@ -235,4 +238,16 @@ public class SysUserService {
sysUserMapper.updateByPrimaryKeySelective(sysUser);
}
private void checkUsername(SysUserCreateRequest request) {
SysUserExample sysUserExample = new SysUserExample();
SysUserExample.Criteria criteria = sysUserExample.createCriteria();
if (request.getUserId() != null) {
criteria.andUserIdNotEqualTo(request.getUserId());
}
criteria.andUsernameEqualTo(request.getUsername());
List<SysUser> sysUsers = sysUserMapper.selectByExample(sysUserExample);
if (CollectionUtils.isNotEmpty(sysUsers)) {
throw new RuntimeException(Translator.get("i18n_username_exists"));
}
}
}
......@@ -40,7 +40,7 @@ DROP TABLE IF EXISTS `datasource`;
CREATE TABLE `datasource` (
`id` varchar(50) NOT NULL DEFAULT '' COMMENT 'ID',
`name` varchar(50) NOT NULL COMMENT '名称',
`desc` varchar(50) NOT NULL COMMENT '描述',
`desc` varchar(50) COMMENT '描述',
`type` varchar(50) NOT NULL COMMENT '类型',
`configuration` longtext NOT NULL COMMENT '详细信息',
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
......@@ -288,7 +288,7 @@ CREATE TABLE `chart_view` (
`create_time` bigint(13) DEFAULT NULL COMMENT '创建时间',
`update_time` bigint(13) DEFAULT NULL COMMENT '更新时间',
`snapshot` longtext COMMENT '缩略图 ',
`style_priority` varchar(255) DEFAULT 'panel' COMMENT '样式优先级 panel 仪表 view 视图',
`style_priority` varchar(255) DEFAULT 'panel' COMMENT '样式优先级 panel 仪表 view 视图',
PRIMARY KEY (`id`),
KEY `IDX_TABLE_ID` (`table_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
......@@ -307,7 +307,7 @@ CREATE TABLE `panel_design` (
`update_time` bigint(13) DEFAULT NULL COMMENT '修改时间',
`update_person` varchar(255) DEFAULT NULL COMMENT '修改人',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='仪表和组件的关联关系 组件分为普通视图和系统组件';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='仪表和组件的关联关系 组件分为普通视图和系统组件';
DROP TABLE IF EXISTS `panel_group`;
CREATE TABLE `panel_group` (
......@@ -318,10 +318,10 @@ CREATE TABLE `panel_group` (
`node_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹',
`create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人',
`create_time` bigint(13) NULL DEFAULT NULL COMMENT '创建时间',
`panel_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '仪表类型 system 系统内置 self 用户自建 ',
`panel_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '仪表类型 system 系统内置 self 用户自建 ',
`panel_style` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT 'panel 样式',
`panel_data` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT 'panel 数据',
`source` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据来源 导入 或者 其他仪表另存',
`source` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据来源 导入 或者 其他仪表另存',
`extend1` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`extend2` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
......@@ -362,7 +362,7 @@ CREATE TABLE `panel_template` (
`create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
`create_time` bigint(13) DEFAULT NULL COMMENT '创建时间',
`snapshot` longtext COMMENT '缩略图',
`template_type` varchar(255) DEFAULT NULL COMMENT '仪表类型 system 系统内置 self 用户自建 ',
`template_type` varchar(255) DEFAULT NULL COMMENT '仪表类型 system 系统内置 self 用户自建 ',
`template_style` longtext COMMENT 'template 样式',
`template_data` longtext COMMENT 'template 数据',
`dynamic_data` longtext COMMENT '预存数据',
......@@ -401,7 +401,7 @@ CREATE TABLE `panel_template` (
`create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
`create_time` bigint(13) DEFAULT NULL COMMENT '创建时间',
`snapshot` longtext COMMENT '缩略图',
`template_type` varchar(255) DEFAULT NULL COMMENT '仪表类型 system 系统内置 self 用户自建 ',
`template_type` varchar(255) DEFAULT NULL COMMENT '仪表类型 system 系统内置 self 用户自建 ',
`template_style` longtext COMMENT 'template 样式',
`template_data` longtext COMMENT 'template 数据',
`dynamic_data` longtext COMMENT '预存数据',
......
......@@ -35,7 +35,7 @@ INSERT INTO `sys_menu` VALUES (25, 34, 0, 2, '删除连接', NULL, NULL, 999, NU
INSERT INTO `sys_menu` VALUES (26, 34, 0, 2, '编辑连接', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'datasource:edit', NULL, NULL, 1614931234105, 1614931234105);
INSERT INTO `sys_menu` VALUES (27, 34, 0, 2, '校验连接', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'datasource:validate', NULL, NULL, 1614931268578, 1614931268578);
INSERT INTO `sys_menu` VALUES (28, 2, 0, 2, '修改密码', NULL, NULL, 999, NULL, NULL, b'0', b'0', b'0', 'user:editPwd', NULL, NULL, 1615275128262, 1615275128262);
INSERT INTO `sys_menu` VALUES (30, 0, 0, 1, '仪表', 'panel', 'panel/index', 1, NULL, '/panel', b'0', b'0', b'0', 'panel:read', NULL, NULL, NULL, 1619081449067);
INSERT INTO `sys_menu` VALUES (30, 0, 0, 1, '仪表', 'panel', 'panel/index', 1, NULL, '/panel', b'0', b'0', b'0', 'panel:read', NULL, NULL, NULL, 1619081449067);
INSERT INTO `sys_menu` VALUES (34, 0, 4, 1, '数据源', 'datasource', 'system/datasource/index', 4, NULL, '/datasource', b'0', b'0', b'0', 'datasource:read', NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (35, 1, 0, 1, '用户表单', 'system-user-form', 'system/user/form', 10, '', 'user-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL);
INSERT INTO `sys_menu` VALUES (36, 1, 0, 1, '菜单表单', 'system-menu-form', 'system/menu/form', 11, '', 'menu-form', b'0', b'0', b'1', NULL, NULL, NULL, NULL, NULL);
......@@ -108,8 +108,8 @@ INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUE
INSERT INTO `system_parameter`(`param_key`, `param_value`, `type`, `sort`) VALUES ('ui.title', '', 'text', 5);
BEGIN;
INSERT INTO `panel_group`(`id`, `name`, `pid`, `level`, `node_type`, `create_by`, `create_time`, `panel_type`, `panel_style`, `panel_data`, `source`, `extend1`, `extend2`, `remark`) VALUES ('default_panel', 'i18n_default_panel', '0', -1, 'folder', 'admin', NULL, 'system', NULL, NULL, NULL, NULL, NULL, '系统内置 默认仪表');
INSERT INTO `panel_group`(`id`, `name`, `pid`, `level`, `node_type`, `create_by`, `create_time`, `panel_type`, `panel_style`, `panel_data`, `source`, `extend1`, `extend2`, `remark`) VALUES ('panel_list', 'i18n_panel_list', '0', -1, 'folder', 'admin', NULL, 'self', NULL, NULL, NULL, NULL, NULL, '系统内置 仪表列表');
INSERT INTO `panel_group`(`id`, `name`, `pid`, `level`, `node_type`, `create_by`, `create_time`, `panel_type`, `panel_style`, `panel_data`, `source`, `extend1`, `extend2`, `remark`) VALUES ('default_panel', 'i18n_default_panel', '0', -1, 'folder', 'admin', NULL, 'system', NULL, NULL, NULL, NULL, NULL, '系统内置 默认仪表');
INSERT INTO `panel_group`(`id`, `name`, `pid`, `level`, `node_type`, `create_by`, `create_time`, `panel_type`, `panel_style`, `panel_data`, `source`, `extend1`, `extend2`, `remark`) VALUES ('panel_list', 'i18n_panel_list', '0', -1, 'folder', 'admin', NULL, 'self', NULL, NULL, NULL, NULL, NULL, '系统内置 仪表列表');
COMMIT;
......
......@@ -185,7 +185,7 @@ authsource_name_already_exists=Authentication source name already exists
authsource_name_is_null=Authentication source name cannot be empty
authsource_configuration_is_null=Authentication source configuration cannot be empty
个人信息=Personal Information
仪表盘=Panel
仪表板=Dashboard
修改密码=Change Password
创建用户=Create User
创建组织=Create Organization
......@@ -233,11 +233,12 @@ i18n_chart_count=Count*
i18n_excel_have_merge_region=Excel has merged region
i18n_cron_expression_error=Cron expression error
i18n_same_folder_can_not_repeat=Same Folder Can Not Repeat
i18n_default_panel=Default Panel
i18n_panel_list=Panel
i18n_default_panel=Default Dashboard
i18n_panel_list=Dashboard
i18n_processing_data=Processing data now, Refresh later
i18n_union_already_exists=Union relation already exists
i18n_union_field_exists=The same field can't in two dataset
i18n_cron_time_error=Start time can't greater then end time
i18n_auth_source_be_canceled=This Auth Resource Already Be Canceled
i18n_username_exists=ID is already exists
......@@ -187,7 +187,7 @@ authsource_name_is_null=认证源名称不能为空
authsource_configuration_is_null=认证源配置不能为空
个人信息=个人信息
仪表盘=仪表盘
仪表板=仪表板
修改密码=修改密码
创建用户=创建用户
创建组织=创建组织
......@@ -235,10 +235,11 @@ i18n_chart_count=记录数*
i18n_excel_have_merge_region=Excel存在合并单元格
i18n_cron_expression_error=Cron表达式校验错误
i18n_same_folder_can_not_repeat=相同的目录下名称不能重复
i18n_default_panel=默认仪表
i18n_panel_list=仪表
i18n_default_panel=默认仪表
i18n_panel_list=仪表
i18n_processing_data=正在处理数据,稍后刷新
i18n_union_already_exists=关联关系已存在
i18n_union_field_exists=两个数据集之间关联不能出现多次相同字段
i18n_cron_time_error=开始时间不能大于结束时间
i18n_auth_source_be_canceled=当前资源授权权限已经被取消
i18n_username_exists=用户ID已存在
......@@ -187,7 +187,7 @@ authsource_name_already_exists=認證源名稱已經存在
authsource_name_is_null=認證源名稱不能為空
authsource_configuration_is_null=認證源配置不能為空
個人信息=個人信息
儀表盤=儀表盤
儀表板=儀表板
修改密碼=修改密碼
創建用戶=創建用戶
創建組織=創建組織
......@@ -227,18 +227,19 @@ i18n_auth_view=查看
i18n_auth_use=使用
i18n_auth_export=導出
i18n_auth_manage=管理
i18n_auth_grant=
i18n_auth_grant=
i18n_template_system=系統模板
i18n_template_self=用戶模板
i18n_name_cant_repeat_same_group=同一分組下名稱不能重復
i18n_chart_count=記錄數*
i18n_excel_have_merge_region=Excel存在合並單元格
i18n_cron_expression_error=Cron表達式校驗錯誤
i18n_same_folder_can_not_repeat=相同的目录下名称不能重复
i18n_default_panel=认仪表盘
i18n_panel_list=仪表盘
i18n_same_folder_can_not_repeat=相同的目錄下名稱不能重復
i18n_default_panel=認儀表板
i18n_panel_list=儀表板
i18n_processing_data=正在處理數據,稍後刷新
i18n_union_already_exists=關聯關系已存在
i18n_union_field_exists=兩個數據集之間關聯不能出現多次相同字段
i18n_cron_time_error=開始時間不能大於結束時間
i18n_auth_source_be_canceled=当前资源授权权限已经被取消
i18n_auth_source_be_canceled=當前資源授權權限已經被取消
i18n_username_exists=用戶ID已存在
......@@ -82,6 +82,14 @@ export default {
'canvasStyleData'
])
},
watch: {
componentData: {
handler(newVal, oldVla) {
this.restore()
},
deep: true
}
},
mounted() {
const _this = this
const erd = elementResizeDetectorMaker()
......@@ -119,6 +127,7 @@ export default {
},
handleScaleChange() {
if (this.componentData) {
debugger
const componentData = deepCopy(this.componentData)
componentData.forEach(component => {
Object.keys(component.style).forEach(key => {
......
<template>
<div>
<div class="toolbar">
<div class="canvas-config">
<div class="canvas-config" style="margin-right: 10px">
<span> {{ $t('panel.canvas_size') }} </span>
<input v-model="canvasStyleData.width">
<span>*</span>
<input v-model="canvasStyleData.height">
</div>
<div class="canvas-config" style="margin-right: 10px">
<span> {{ $t('panel.canvas_scale') }} </span>
<input v-model="scale" @input="handleScaleChange"> %
</div>
<el-tooltip :content="$t('panel.style')">
<el-button class="el-icon-magic-stick" size="mini" circle @click="showPanel" />
</el-tooltip>
<!-- <div class="canvas-config" style="margin-right: 10px">-->
<!-- <span> {{ $t('panel.canvas_scale') }} </span>-->
<!-- <input v-model="scale" @input="handleScaleChange"> %-->
<!-- </div>-->
<el-tooltip :content="$t('panel.undo') ">
<el-button class="el-icon-refresh-right" size="mini" circle @click="undo" />
</el-tooltip>
......@@ -59,6 +54,14 @@ import {
} from '@/views/panel/panel'
export default {
name: 'Toolbar',
props: {
buttonActive: {
type: Boolean,
required: false,
default: false
}
},
data() {
return {
isShowPreview: false,
......@@ -172,6 +175,10 @@ export default {
const fileResult = res.target.result
const img = new Image()
img.onload = () => {
const scaleWith = img.width / 400
const scaleHeight = img.height / 200
let scale = scaleWith > scaleHeight ? scaleWith : scaleHeight
scale = scale > 1 ? scale : 1
this.$store.commit('addComponent', {
component: {
...commonAttr,
......@@ -184,8 +191,8 @@ export default {
...commonStyle,
top: 0,
left: 0,
width: img.width,
height: img.height
width: img.width / scale,
height: img.height / scale
}
}
})
......@@ -291,4 +298,13 @@ export default {
}
}
}
.button-show{
background-color: #ebf2fe!important;
}
.button-closed{
background-color: #ffffff!important;
}
</style>
......@@ -69,7 +69,7 @@ export default {
// deep监听panel 如果改变 提交到 store
canvasStyleData: {
handler(newVal, oldVla) {
// this.chart.stylePriority == panel 优先使用仪表样式
// this.chart.stylePriority == panel 优先使用仪表样式
this.mergeStyle()
},
deep: true
......@@ -77,7 +77,9 @@ export default {
// 监听外部的样式变化
outStyle: {
handler(newVal, oldVla) {
this.$refs[this.element.propValue.id].chartResize()
if (this.$refs[this.element.propValue.id]) {
this.$refs[this.element.propValue.id].chartResize()
}
},
deep: true
}
......@@ -126,7 +128,7 @@ export default {
},
methods: {
mergeStyle() {
// this.chart.stylePriority == panel 优先使用仪表样式
// this.chart.stylePriority == panel 优先使用仪表样式
if ((this.requestStatus === 'success' || this.requestStatus === 'merging') && this.chart.stylePriority === 'panel' && this.canvasStyleData.chart) {
const customAttrChart = JSON.parse(this.chart.customAttr)
const customStyleChart = JSON.parse(this.chart.customStyle)
......
......@@ -833,7 +833,7 @@ export default {
group: 'Catalogue',
panel: 'Dashboard',
groupAdd: 'Create Catalogue',
panelAdd: 'Create Panle',
panelAdd: 'Create Dashboard',
delete: 'Delete',
move_to: 'Move',
rename: 'Rename',
......@@ -847,7 +847,7 @@ export default {
back: 'Back',
view: 'Chart',
edit: 'Edit',
panel_list: 'Panel',
panel_list: 'Dashboard',
module: 'Component',
filter_module: 'Filter Component',
select_by_module: 'Select by Component',
......@@ -855,21 +855,21 @@ export default {
user_template: 'User Template',
add_category: 'Add Category',
filter_keywords: 'Enter keywords to filter',
dashboard_theme: 'Panel Theme',
dashboard_theme: 'Dashboard Theme',
table: 'Table',
gap: 'Gap',
no_gap: 'No Gap',
component_gap: 'Component Gap',
photo: 'Photo',
default_panel: 'Default Panel',
default_panel: 'Default Dashboard',
create_public_links: 'Create public links',
to_default: 'Save To Default',
to_default_panel: 'Save To Default Panel',
to_default_panel: 'Save To Default Dashboard',
store: 'Store',
save_to_panel: 'Save to template',
export_to_panel: 'Export to template',
preview: 'Preview',
select_panel_from_left: 'Please select panel from left',
select_panel_from_left: 'Please select Dashboard from left',
template_nale: 'Template name',
template: 'Template',
category: 'Category',
......@@ -898,7 +898,7 @@ export default {
insert_picture: 'Insert Picture',
redo: 'Redo',
undo: 'Undo',
panelNull: 'This is a Empty Panel,You Can Edit and Enrich It',
panelNull: 'This is a Empty Dashboard,You Can Edit and Enrich It',
copy: 'Copy',
paste: 'Paste',
cut: 'Cut',
......@@ -939,7 +939,7 @@ export default {
linkAuth: 'Datasource Permissions',
datasetAuth: 'Dataset Permissions',
chartAuth: 'Chart Permissions',
panelAuth: 'Panel Permissions',
panelAuth: 'Dashboard Permissions',
deptHead: 'All Dept',
roleHead: 'All Role',
userHead: 'All User',
......
......@@ -87,6 +87,7 @@ export default {
password_error: '密碼不小於8位'
},
commons: {
close: '关闭',
icon: '圖標',
all: '全部',
enable: '啟用',
......@@ -664,7 +665,7 @@ export default {
start_angle: '起始角度',
end_angle: '結束角度',
style_priority: '樣式優先級',
dashboard: '儀表',
dashboard: '儀表',
dimension_color: '維度顏色',
quota_color: '指標顏色',
dimension_font_size: '維度字體大小',
......@@ -830,10 +831,10 @@ export default {
share: '分享',
datalist: '視圖列表',
group: '目錄',
panel: '儀表',
panel_list: '儀表',
panel: '儀表',
panel_list: '儀表',
groupAdd: '新建目錄',
panelAdd: '新建儀表',
panelAdd: '新建儀表',
delete: '刪除',
move_to: '移動到',
rename: '重命名',
......@@ -854,21 +855,21 @@ export default {
user_template: '用戶模板',
add_category: '添加分類',
filter_keywords: '輸入關鍵字進行過濾',
dashboard_theme: '儀表主題',
dashboard_theme: '儀表主題',
table: '表格',
gap: '有間隙',
no_gap: '無間隙',
component_gap: '組件間隙',
photo: '圖片',
default_panel: '默認儀表',
default_panel: '默認儀表',
create_public_links: '創建公共鏈接',
to_default: '另存为默认',
to_default_panel: '另存为默认儀表',
to_default_panel: '另存为默认儀表',
store: '收藏',
save_to_panel: '保存為模板',
export_to_panel: '導出為模板',
preview: '預覽',
select_panel_from_left: '請從左側選擇儀表',
select_panel_from_left: '請從左側選擇儀表',
template_nale: '模板名稱',
template: '模板',
category: '分類',
......@@ -897,7 +898,7 @@ export default {
insert_picture: '插入圖片',
redo: '重做',
undo: '撤銷',
panelNull: '这是个空的儀表,可以通过编辑来丰富内容',
panelNull: '这是个空的儀表,可以通过编辑来丰富内容',
copy: '复制',
paste: '粘贴',
cut: '剪切',
......@@ -938,14 +939,14 @@ export default {
linkAuth: '數據源權限',
datasetAuth: '數據集權限',
chartAuth: '視圖權限',
panelAuth: '儀表權限',
panelAuth: '儀表權限',
deptHead: '所有组织',
roleHead: '所有角色',
userHead: '所有用戶',
linkAuthHead: '所有數據源',
datasetAuthHead: '所有數據',
chartAuthHead: '所有視圖',
panelAuthHead: '所有儀表',
panelAuthHead: '所有儀表',
view: '查看',
use: '使用',
export: '導出',
......
......@@ -665,7 +665,7 @@ export default {
start_angle: '起始角度',
end_angle: '结束角度',
style_priority: '样式优先级',
dashboard: '仪表',
dashboard: '仪表',
dimension_color: '维度颜色',
quota_color: '指标颜色',
dimension_font_size: '维度字体大小',
......@@ -831,10 +831,10 @@ export default {
share: '分享',
datalist: '视图列表',
group: '目录',
panel: '仪表',
panel_list: '仪表',
panel: '仪表',
panel_list: '仪表',
groupAdd: '新建目录',
panelAdd: '新建仪表',
panelAdd: '新建仪表',
delete: '删除',
move_to: '移动到',
rename: '重命名',
......@@ -855,21 +855,21 @@ export default {
user_template: '用户模板',
add_category: '添加分类',
filter_keywords: '输入关键字进行过滤',
dashboard_theme: '仪表主题',
dashboard_theme: '仪表主题',
table: '表格',
gap: '有间隙',
no_gap: '无间隙',
component_gap: '组件间隙',
photo: '图片',
default_panel: '默认仪表',
default_panel: '默认仪表',
create_public_links: '创建公共链接',
to_default: '另存为默认',
to_default_panel: '另存为默认仪表',
to_default_panel: '另存为默认仪表',
store: '收藏',
save_to_panel: '保存为模板',
export_to_panel: '导出为模板',
preview: '预览',
select_panel_from_left: '请从左侧选择仪表',
select_panel_from_left: '请从左侧选择仪表',
template_nale: '模板名称',
template: '模板',
category: '分类',
......@@ -940,7 +940,7 @@ export default {
linkAuth: '数据源权限',
datasetAuth: '数据集权限',
chartAuth: '视图权限',
panelAuth: '仪表权限',
panelAuth: '仪表权限',
menuAuth: '菜单和操作权限',
deptHead: '所有组织',
roleHead: '所有角色',
......@@ -948,7 +948,7 @@ export default {
linkAuthHead: '所有数据源',
datasetAuthHead: '所有数据',
chartAuthHead: '所有视图',
panelAuthHead: '所有仪表',
panelAuthHead: '所有仪表',
menuAuthHead: '所有菜单和操作',
view: '查看',
use: '使用',
......
......@@ -39,7 +39,7 @@ const data = {
...lock.state,
editMode: 'edit', // 编辑器模式 edit preview
canvasStyleData: DEFAULT_COMMON_CANVAS_STYLE, // 页面全局数据 //扩展公共样式 公共的仪表样式,用来实时响应样式的变化
canvasStyleData: DEFAULT_COMMON_CANVAS_STYLE, // 页面全局数据 //扩展公共样式 公共的仪表样式,用来实时响应样式的变化
componentData: [], // 画布组件数据
curComponent: null,
curComponentIndex: null,
......
......@@ -237,3 +237,4 @@ div:focus {
.el-popper{
position: fixed!important;
}
......@@ -24,9 +24,7 @@ export function baseRadarOption(chart_option, chart) {
// 处理data
if (chart.data) {
chart_option.title.text = chart.title
chart.data.x.forEach(function(ele) {
chart_option.radar.indicator.push({ name: ele })
})
const maxValues = []
for (let i = 0; i < chart.data.series.length; i++) {
const y = chart.data.series[i]
// color
......@@ -40,7 +38,13 @@ export function baseRadarOption(chart_option, chart) {
chart_option.legend.data.push(y.name)
y.value = JSON.parse(JSON.stringify(y.data))
chart_option.series[0].data.push(y)
maxValues.push(Math.max.apply(null, y.value))
}
const max = Math.max.apply(null, maxValues)
chart.data.x.forEach(function(ele) {
chart_option.radar.indicator.push({ name: ele, max: max })
})
}
// console.log(chart_option);
componentStyle(chart_option, chart)
......
......@@ -53,7 +53,7 @@ export default {
methods: {
preDraw() {
// 基于准备好的dom,初始化echarts实例
// 渲染echart等待dom加载完毕,渲染之前先尝试销毁具有相同id的echart 放置多次切换仪表有重复id情况
// 渲染echart等待dom加载完毕,渲染之前先尝试销毁具有相同id的echart 放置多次切换仪表有重复id情况
new Promise((resolve) => { resolve() }).then(() => {
// 此dom为echarts图标展示dom
this.myChart = this.$echarts.getInstanceByDom(document.getElementById(this.chartId))
......
......@@ -43,7 +43,7 @@
<br>
地图 : {a}(系列名称),{b}(区域名称),{c}(合并数值), {d}(无)
<br>
饼图、仪表、漏斗图: {a}(系列名称),{b}(数据项名称),{c}(数值), {d}(百分比)
饼图、仪表、漏斗图: {a}(系列名称),{b}(数据项名称),{c}(数值), {d}(百分比)
</div>
<i class="el-icon-info" style="cursor: pointer;" />
</el-tooltip>
......
......@@ -557,7 +557,7 @@ export default {
this.$warning(this.$t('chart.title_limit'))
return
}
// 从仪表入口关闭
// 从仪表入口关闭
bus.$emit('PanelSwitchComponent', { name: 'PanelEdit' })
this.$emit('switchComponent', { name: '' })
},
......
......@@ -8,19 +8,19 @@
</el-col>
<!--横向工具栏-->
<el-col :span="16">
<Toolbar @showPanel="showPanel" @close-left-panel="closeLeftPanel" @previewFullScreen="previewFullScreen" />
<Toolbar :button-active="show&&showIndex===2" @showPanel="showPanel" @close-left-panel="closeLeftPanel" @previewFullScreen="previewFullScreen" />
</el-col>
</el-header>
<de-container>
<de-aside-container class="ms-aside-container">
<div style="width: 60px; left: 0px; top: 0px; bottom: 0px; position: absolute">
<div style="width: 60px;height: 100%;overflow: hidden auto;position: relative;margin: 0px auto;">
<div style="width: 60px; left: 0px; top: 0px; bottom: 0px; position: absolute">
<div style="width: 60px;height: 100%;overflow: hidden auto;position: relative;margin: 0px auto; font-size: 14px">
<!-- 视图图表 -->
<div class="button-div-class" style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 32px auto 0px;font-size:150%;">
<el-button circle class="el-icon-circle-plus-outline" size="mini" @click="showPanel(0)" />
<div class="button-div-class" style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px;">
<el-button :class="show&&showIndex===0? 'button-show':'button-closed'" circle class="el-icon-circle-plus-outline" size="mini" @click="showPanel(0)" />
</div>
<!-- 视图文字 -->
<div style="position: relative; margin: 18px auto 30px">
<div style="position: relative; margin: 18px auto 16px;">
<div style="max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;">
{{ $t('panel.view') }}
</div>
......@@ -30,10 +30,10 @@
<div style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;" />
</div>
<!-- 过滤组件 -->
<div tabindex="-1" style="position: relative; margin: 20px auto">
<div tabindex="-1" style="position: relative; margin: 16px auto">
<div style="height: 60px; position: relative">
<div class="button-div-class" style=" text-align: center;line-height: 1;position: absolute;inset: 0px 0px 45px; ">
<el-button circle class="el-icon-s-tools" size="mini" @click="showPanel(1)" />
<el-button circle :class="show&&showIndex===1? 'button-show':'button-closed'" class="el-icon-s-tools" size="mini" @click="showPanel(1)" />
</div>
<div style=" position: absolute;left: 0px;right: 0px;bottom: 10px; height: 16px;">
<div style=" max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;">
......@@ -42,6 +42,25 @@
</div>
</div>
</div>
<!-- 分割线 -->
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
<div style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;" />
</div>
<!-- 视图图表 -->
<div class="button-div-class" style=" width: 24px;height: 24px;text-align: center;line-height: 1;position: relative;margin: 16px auto 0px;">
<el-button :class="show&&showIndex===2? 'button-show':'button-closed'" circle class="el-icon-magic-stick" size="mini" @click="showPanel(2)" />
</div>
<!-- 视图文字 -->
<div style="position: relative; margin: 18px auto 16px;">
<div style="max-width: 100%;text-align: center;white-space: nowrap;text-overflow: ellipsis;position: relative;flex-shrink: 0;">
{{ $t('panel.style') }}
</div>
</div>
<!-- 视图分割线 -->
<div style="height: 1px; position: relative; margin: 0px auto;background-color:#E6E6E6;">
<div style="width: 60px;height: 1px;line-height: 1px;text-align: center;white-space: pre;text-overflow: ellipsis;position: relative;flex-shrink: 0;" />
</div>
</div>
</div>
<!-- <div ref="leftPanel" :class="{show:show}" class="leftPanel-container">-->
......@@ -72,7 +91,7 @@
>
<view-select v-show=" show && showIndex===0" />
<filter-group v-show=" show &&showIndex===1" />
<subject-setting v-show=" show &&showIndex===2" />
<subject-setting v-show=" show &&showIndex===2" />
</el-drawer>
<div
......@@ -259,7 +278,13 @@ export default {
},
showPanel(type) {
if (this.showIndex === -1 || this.showIndex === type) {
this.$nextTick(() => (this.show = !this.show))
this.$nextTick(() => {
if (this.show) {
this.showIndex === -1
}
this.show = !this.show
}
)
}
this.showIndex = type
},
......@@ -479,5 +504,12 @@ export default {
.el-main >>> .el-drawer__body{
overflow-y: auto;
}
.button-show{
background-color: #ebf2fe!important;
}
.button-closed{
background-color: #ffffff!important;
}
</style>
......@@ -5,6 +5,7 @@
<span class="header-title">{{ $t('panel.default_panel') }}</span>
<div class="block">
<el-tree
ref="default_panel_tree"
:default-expanded-keys="expandedArray"
:data="defaultData"
node-key="id"
......@@ -149,7 +150,7 @@
v-dialogDrag
:title="authTitle"
:visible.sync="authVisible"
width="500px"
width="800px"
class="dialog-css"
>
<grant-auth v-if="authVisible" :resource-id="authResourceId" @close-grant="closeGrant" />
......@@ -164,7 +165,7 @@
>
<link-generate v-if="linkVisible" :resource-id="linkResourceId" />
</el-dialog>
<!--新建仪表dialog-->
<!--新建仪表dialog-->
<el-dialog v-dialogDrag :title="panelDialogTitle" :visible.sync="editPanel.visible" :show-close="true" width="600px">
<edit-panel v-if="editPanel.visible" :edit-panel="editPanel" @closeEditPanelDialog="closeEditPanelDialog" @newPanelSave="newPanelSave" />
</el-dialog>
......@@ -203,7 +204,7 @@ export default {
return {
lastActiveNode: null, // 激活的节点 在这个节点下面动态放置子节点
lastActiveNodeData: null,
activeTree: 'self', // 识别当前操作的树类型self 是仪表盘列表树 system 是默认仪表盘
activeTree: 'self', // 识别当前操作的树类型self 是仪表板列表树 system 是默认仪表板
editPanelModel: {
titlePre: null,
titleSuf: null,
......@@ -247,7 +248,7 @@ export default {
},
editPanel: {
titlePre: null,
titleSuf: '仪表',
titleSuf: '仪表',
visible: false,
optType: 'new',
panelInfo: {
......@@ -364,6 +365,10 @@ export default {
this.defaultTree()
// 默认展开 同时点击 新增的节点
if (panelInfo && panelInfo.panelType === 'self' && this.lastActiveNodeData.id) {
if (this.editPanel.optType === 'rename') {
this.lastActiveNodeData.name = panelInfo.name
return
}
if (!this.lastActiveNodeData.children) {
this.$set(this.lastActiveNodeData, 'children', [])
}
......@@ -404,6 +409,7 @@ export default {
case 'rename':
this.editPanel = {
visible: true,
optType: 'rename',
titlePre: this.$t('commons.edit'),
panelInfo: {
id: param.data.id,
......@@ -634,9 +640,11 @@ export default {
this.$nextTick(() => {
// 延迟设置CurrentKey
this.$refs.panel_list_tree.setCurrentKey(panelInfo.id)
// 去除default_tree 的影响
this.$refs.default_panel_tree.setCurrentKey(null)
this.$nextTick(() => {
document.querySelector('.is-current').firstChild.click()
// 如果是仪表盘列表的仪表盘 直接进入编辑界面
// 如果是仪表板列表的仪表板 直接进入编辑界面
if (panelInfo.nodeType === 'panel') {
this.edit(this.lastActiveNodeData, this.lastActiveNode)
}
......@@ -650,6 +658,8 @@ export default {
this.$nextTick(() => {
// 延迟设置CurrentKey
this.$refs.panel_list_tree.setCurrentKey(panelInfo.id)
// 去除default_tree 的影响
this.$refs.default_panel_tree.setCurrentKey(null)
this.$nextTick(() => {
document.querySelector('.is-current').firstChild.click()
})
......
......@@ -46,6 +46,14 @@ export default {
return this.$store.state.panel.mainActiveName
}
},
watch: {
// 切换展示页面后 重新点击一下当前节点
'$store.state.panel.mainActiveName': function(newVal, oldVal) {
if (newVal === 'PanelMain' && this.lastActiveNode && this.lastActiveNodeData) {
this.activeNodeAndClickOnly(this.lastActiveNodeData)
}
}
},
mounted() {
this.$store.dispatch('panel/setMainActiveName', 'PanelMain')
},
......
......@@ -2,7 +2,7 @@
<el-row style="height: 100%;width: 100%;">
<el-col v-if="panelInfo.name.length>0" class="panel-design">
<el-row class="panel-design-head">
<!--仪表头部区域-->
<!--仪表头部区域-->
<el-col :span="12" style="text-overflow:ellipsis;overflow: hidden;white-space: nowrap;font-size: 14px">
<span>{{ panelInfo.name || '测试仪表板' }}</span>
</el-col>
......@@ -37,7 +37,7 @@
</el-col>
</el-row>
<!-- 仪表预览区域-->
<!-- 仪表预览区域-->
<el-row class="panel-design-preview">
<div ref="imageWrapper" style="width: 100%;height: 100%">
<Preview v-if="showMain" />
......
......@@ -76,7 +76,7 @@ export default {
}
.template-img {
height: 130px;
height: 112px;
width: 200px;
margin: 0 auto;
box-shadow: 0 0 2px 0 rgba(31,31,31,0.15), 0 1px 2px 0 rgba(31,31,31,0.15);
......
......@@ -102,7 +102,7 @@ export default {
authType: 'chart'
},
{
tabName: '仪表',
tabName: '仪表',
head: '所有仪表板',
direction: 'source',
authType: 'panel'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论