<id>optional</id>
      <active>true</active>
      <protocol>http</protocol>
      <username></username>
      <password></password>
      <host>127.0.0.1</host>
      <port>7890</port>
      <nonProxyHosts>local.net|some.host.com</nonProxyHosts>
    </proxy>
Merge branch 'main' of github.com:dataease/dataease into main
This commit is contained in:
taojinlong 2021-06-07 12:35:17 +08:00
commit 7e40ea46dd
20 changed files with 101 additions and 57 deletions

View File

@ -88,6 +88,9 @@ public class ChartViewService {
public ChartViewDTO getData(String id, ChartExtRequest requestList) throws Exception { public ChartViewDTO getData(String id, ChartExtRequest requestList) throws Exception {
ChartViewWithBLOBs view = chartViewMapper.selectByPrimaryKey(id); ChartViewWithBLOBs view = chartViewMapper.selectByPrimaryKey(id);
if (ObjectUtils.isEmpty(view)) {
throw new RuntimeException(Translator.get("i18n_chart_delete"));
}
List<ChartViewFieldDTO> xAxis = new Gson().fromJson(view.getXAxis(), new TypeToken<List<ChartViewFieldDTO>>() { List<ChartViewFieldDTO> xAxis = new Gson().fromJson(view.getXAxis(), new TypeToken<List<ChartViewFieldDTO>>() {
}.getType()); }.getType());
List<ChartViewFieldDTO> yAxis = new Gson().fromJson(view.getYAxis(), new TypeToken<List<ChartViewFieldDTO>>() { List<ChartViewFieldDTO> yAxis = new Gson().fromJson(view.getYAxis(), new TypeToken<List<ChartViewFieldDTO>>() {
@ -122,10 +125,16 @@ public class ChartViewService {
// 获取数据集 // 获取数据集
DatasetTable table = dataSetTableService.get(view.getTableId()); DatasetTable table = dataSetTableService.get(view.getTableId());
if (ObjectUtils.isEmpty(table)) {
throw new RuntimeException(Translator.get("i18n_dataset_delete"));
}
// 判断连接方式直连或者定时抽取 table.mode // 判断连接方式直连或者定时抽取 table.mode
List<String[]> data = new ArrayList<>(); List<String[]> data = new ArrayList<>();
if (table.getMode() == 0) {// 直连 if (table.getMode() == 0) {// 直连
Datasource ds = datasourceService.get(table.getDataSourceId()); Datasource ds = datasourceService.get(table.getDataSourceId());
if (ObjectUtils.isEmpty(ds)) {
throw new RuntimeException(Translator.get("i18n_datasource_delete"));
}
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType()); DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());
DatasourceRequest datasourceRequest = new DatasourceRequest(); DatasourceRequest datasourceRequest = new DatasourceRequest();
datasourceRequest.setDatasource(ds); datasourceRequest.setDatasource(ds);

View File

@ -238,6 +238,9 @@ public class DataSetTableService {
} }
if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "db")) { if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "db")) {
Datasource ds = datasourceMapper.selectByPrimaryKey(dataSetTableRequest.getDataSourceId()); Datasource ds = datasourceMapper.selectByPrimaryKey(dataSetTableRequest.getDataSourceId());
if (ObjectUtils.isEmpty(ds)) {
throw new RuntimeException(Translator.get("i18n_datasource_delete"));
}
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType()); DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());
DatasourceRequest datasourceRequest = new DatasourceRequest(); DatasourceRequest datasourceRequest = new DatasourceRequest();
datasourceRequest.setDatasource(ds); datasourceRequest.setDatasource(ds);
@ -258,6 +261,9 @@ public class DataSetTableService {
} }
} else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "sql")) { } else if (StringUtils.equalsIgnoreCase(datasetTable.getType(), "sql")) {
Datasource ds = datasourceMapper.selectByPrimaryKey(dataSetTableRequest.getDataSourceId()); Datasource ds = datasourceMapper.selectByPrimaryKey(dataSetTableRequest.getDataSourceId());
if (ObjectUtils.isEmpty(ds)) {
throw new RuntimeException(Translator.get("i18n_datasource_delete"));
}
DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType()); DatasourceProvider datasourceProvider = ProviderFactory.getProvider(ds.getType());
DatasourceRequest datasourceRequest = new DatasourceRequest(); DatasourceRequest datasourceRequest = new DatasourceRequest();
datasourceRequest.setDatasource(ds); datasourceRequest.setDatasource(ds);

View File

@ -312,23 +312,23 @@ CREATE TABLE `panel_design` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='仪表板和组件的关联关系 组件分为普通视图和系统组件'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='仪表板和组件的关联关系 组件分为普通视图和系统组件';
DROP TABLE IF EXISTS `panel_group`; DROP TABLE IF EXISTS `panel_group`;
CREATE TABLE `panel_group` ( CREATE TABLE `panel_group` (
`id` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL, `id` varchar(50) NOT NULL,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '名称', `name` varchar(255) DEFAULT NULL COMMENT '名称',
`pid` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '父级id', `pid` varchar(255) DEFAULT NULL COMMENT '父级id',
`level` int(10) NULL DEFAULT NULL COMMENT '层级', `level` int(10) DEFAULT NULL COMMENT '层级',
`node_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹', `node_type` varchar(255) DEFAULT NULL COMMENT '节点类型 folder or panel 目录或者文件夹',
`create_by` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '创建人', `create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
`create_time` bigint(13) NULL DEFAULT NULL COMMENT '创建时间', `create_time` bigint(13) DEFAULT NULL COMMENT '创建时间',
`panel_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '仪表板类型 system 系统内置 self 用户自建 ', `panel_type` varchar(255) NOT NULL COMMENT '仪表板类型 system 系统内置 self 用户自建 ',
`panel_style` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT 'panel 样式', `panel_style` longtext NOT NULL COMMENT 'panel 样式',
`panel_data` longtext CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT 'panel 数据', `panel_data` longtext COMMENT 'panel 数据',
`source` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据来源 导入 或者 其他仪表板另存', `source` varchar(255) DEFAULT NULL COMMENT '数据来源 导入 或者 其他仪表板另存',
`extend1` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `extend1` varchar(255) DEFAULT NULL,
`extend2` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `extend2` varchar(255) DEFAULT NULL,
`remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL, `remark` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `panel_view`; DROP TABLE IF EXISTS `panel_view`;

File diff suppressed because one or more lines are too long

View File

@ -249,3 +249,6 @@ i18n_sql_not_empty=SQL can not be empty.
i18n_datasource_not_allow_delete_msg= datasets are using this data source and cannot be deleted i18n_datasource_not_allow_delete_msg= datasets are using this data source and cannot be deleted
i18n_task_name_repeat=Name is used in same data set i18n_task_name_repeat=Name is used in same data set
i18n_id_or_pwd_error=Invalid ID or password i18n_id_or_pwd_error=Invalid ID or password
i18n_datasource_delete=Data source is delete
i18n_dataset_delete=Data set is delete
i18n_chart_delete=Chart is delete

View File

@ -159,7 +159,6 @@ quota_duration_excess_organization=压测时长超过组织限额
import_xmind_count_error=思维导图导入用例数量不能超过 500 条 import_xmind_count_error=思维导图导入用例数量不能超过 500 条
license_valid_license_error=授权认证失败 license_valid_license_error=授权认证失败
import_xmind_not_found=未找到测试用例 import_xmind_not_found=未找到测试用例
test_review_task_notice=测试评审任务通知 test_review_task_notice=测试评审任务通知
test_track.length_less_than=标题过长,字数必须小于 test_track.length_less_than=标题过长,字数必须小于
# check owner # check owner
@ -185,7 +184,6 @@ automation_exec_info=没有测试步骤,无法执行
authsource_name_already_exists=认证源名称已经存在 authsource_name_already_exists=认证源名称已经存在
authsource_name_is_null=认证源名称不能为空 authsource_name_is_null=认证源名称不能为空
authsource_configuration_is_null=认证源配置不能为空 authsource_configuration_is_null=认证源配置不能为空
个人信息=个人信息 个人信息=个人信息
仪表板=仪表板 仪表板=仪表板
修改密码=修改密码 修改密码=修改密码
@ -251,3 +249,6 @@ i18n_sql_not_empty=SQL 不能为空
i18n_datasource_not_allow_delete_msg= 个数据集正在使用此数据源,无法删除 i18n_datasource_not_allow_delete_msg= 个数据集正在使用此数据源,无法删除
i18n_task_name_repeat=同一数据集下任务名称已被使用 i18n_task_name_repeat=同一数据集下任务名称已被使用
i18n_id_or_pwd_error=无效的ID或密码 i18n_id_or_pwd_error=无效的ID或密码
i18n_datasource_delete=当前用到的数据源已被删除
i18n_dataset_delete=当前用到的数据集已被删除
i18n_chart_delete=当前用到的视图已被删除

View File

@ -251,3 +251,6 @@ i18n_sql_not_empty=SQL 不能為空
i18n_datasource_not_allow_delete_msg= 個數據集正在使用此數據源,無法刪除 i18n_datasource_not_allow_delete_msg= 個數據集正在使用此數據源,無法刪除
i18n_task_name_repeat=同一數據集下任務名稱已被使用 i18n_task_name_repeat=同一數據集下任務名稱已被使用
i18n_id_or_pwd_error=無效的ID或密碼 i18n_id_or_pwd_error=無效的ID或密碼
i18n_datasource_delete=當前用到的數據源已被刪除
i18n_dataset_delete=當前用到的數據集已被刪除
i18n_chart_delete=當前用到的視圖已被刪除

View File

@ -89,6 +89,7 @@ export default {
if (this.curComponent) { if (this.curComponent) {
this.cursors = this.getCursor() // this.cursors = this.getCursor() //
} }
this.element.type === 'custom' && (this.pointList = ['l', 'r'])
eventBus.$on('runAnimation', () => { eventBus.$on('runAnimation', () => {
if (this.element === this.curComponent) { if (this.element === this.curComponent) {
@ -221,7 +222,7 @@ export default {
handleMouseDownOnShape(e) { handleMouseDownOnShape(e) {
this.$store.commit('setClickComponentStatus', true) this.$store.commit('setClickComponentStatus', true)
if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape') { if (this.element.component !== 'v-text' && this.element.component !== 'rect-shape' && this.element.component !== 'de-input-search') {
e.preventDefault() e.preventDefault()
} }

View File

@ -66,7 +66,7 @@ import { mapState } from 'vuex'
import { commonStyle, commonAttr } from '@/components/canvas/custom-component/component-list' import { commonStyle, commonAttr } from '@/components/canvas/custom-component/component-list'
import eventBus from '@/components/canvas/utils/eventBus' import eventBus from '@/components/canvas/utils/eventBus'
import { deepCopy } from '@/components/canvas/utils/utils' import { deepCopy } from '@/components/canvas/utils/utils'
import { post } from '@/api/panel/panel' import { panelSave } from '@/api/panel/panel'
import bus from '@/utils/bus' import bus from '@/utils/bus'
import { import {
DEFAULT_COMMON_CANVAS_STYLE DEFAULT_COMMON_CANVAS_STYLE
@ -233,8 +233,13 @@ export default {
panelStyle: JSON.stringify(this.canvasStyleData), panelStyle: JSON.stringify(this.canvasStyleData),
panelData: JSON.stringify(this.componentData) panelData: JSON.stringify(this.componentData)
} }
post('panel/group/save', requestInfo, () => {}) panelSave(requestInfo).then(response => {
this.$message.success('保存成功') this.$message({
message: this.$t('commons.save_success'),
type: 'success',
showClose: true
})
})
}, },
clearCanvas() { clearCanvas() {
this.$store.commit('setComponentData', []) this.$store.commit('setComponentData', [])

View File

@ -1,9 +1,10 @@
<template> <template>
<div v-loading="requestStatus==='waiting'" class="rect-shape"> <div v-loading="requestStatus==='waiting'" class="rect-shape">
<div v-if="requestStatus==='error'" style=";width: 100%;height: 100%;background-color: #ece7e7; text-align: center"> <div v-if="requestStatus==='error'" class="chart-error-class">
<div style="font-size: 12px; color: #9ea6b2;"> <div style="font-size: 12px; color: #9ea6b2;height: 100%;display: flex;align-items: center;justify-content: center;">
{{ $t('panel.error_data') }}<br> {{ message.response.data.message }},{{ $t('chart.chart_show_error') }}
{{ message }} <br>
{{ $t('chart.chart_error_tips') }}
</div> </div>
</div> </div>
<chart-component v-if="requestStatus==='success'&&chart.type && !chart.type.includes('table') && !chart.type.includes('text')" :ref="element.propValue.id" class="chart-class" :chart="chart" /> <chart-component v-if="requestStatus==='success'&&chart.type && !chart.type.includes('table') && !chart.type.includes('text')" :ref="element.propValue.id" class="chart-class" :chart="chart" />
@ -189,4 +190,12 @@ export default {
.table-class{ .table-class{
height: 100%; height: 100%;
} }
.chart-error-class{
text-align: center;
height: calc(100% - 84px);
display: flex;
align-items: center;
justify-content: center;
background-color: #ece7e7;
}
</style> </style>

View File

@ -130,7 +130,7 @@ export function changeStyleWithScale(value) {
export function changeStyleWithScaleHeightInAuto(value) { export function changeStyleWithScaleHeightInAuto(value) {
const scale = store.state.canvasStyleData.scaleHeight ? store.state.canvasStyleData.scaleHeight : 100 const scale = store.state.canvasStyleData.scaleHeight ? store.state.canvasStyleData.scaleHeight : 100
const result = value * scale / 100 const result = value * scale / 100
console.log('heightInAuto=>' + scale + ';' + result) // console.log('heightInAuto=>' + scale + ';' + result)
return result return result
} }
@ -138,7 +138,7 @@ export function changeStyleWithScaleHeightInAuto(value) {
export function changeStyleWithScaleWidthInAuto(value) { export function changeStyleWithScaleWidthInAuto(value) {
const scale = store.state.canvasStyleData.scaleWidth ? store.state.canvasStyleData.scaleWidth : 100 const scale = store.state.canvasStyleData.scaleWidth ? store.state.canvasStyleData.scaleWidth : 100
const result = value * scale / 100 const result = value * scale / 100
console.log('widthInAuto=>' + scale + ';' + result) // console.log('widthInAuto=>' + scale + ';' + result)
return result return result
} }

View File

@ -3,9 +3,10 @@
<el-input <el-input
v-if="options!== null && options.attrs!==null" v-if="options!== null && options.attrs!==null"
v-model="options.value" v-model="options.value"
style="width: 260px" resize="vertical"
:placeholder="options.attrs.placeholder" :placeholder="options.attrs.placeholder"
@keyup.enter.native="search" @keyup.enter.native="search"
@dblclick="setEdit"
> >
<el-button slot="append" icon="el-icon-search" @click="search" /> <el-button slot="append" icon="el-icon-search" @click="search" />
@ -30,7 +31,8 @@ export default {
return { return {
options: null, options: null,
operator: 'like', operator: 'like',
values: null values: null,
canEdit: false
} }
}, },
created() { created() {
@ -48,6 +50,9 @@ export default {
operator: this.operator operator: this.operator
} }
this.inDraw && this.$store.dispatch('conditions/add', param) this.inDraw && this.$store.dispatch('conditions/add', param)
},
setEdit() {
this.canEdit = true
} }
} }
} }

View File

@ -22,7 +22,7 @@ const drawPanel = {
type: 'custom', type: 'custom',
style: { style: {
width: 300, width: 300,
height: 47, height: 45.5,
fontSize: 14, fontSize: 14,
fontWeight: 500, fontWeight: 500,
lineHeight: '', lineHeight: '',

View File

@ -713,7 +713,9 @@ export default {
y_M_d_H_m_s: 'Year Month Day Hour Minute Second', y_M_d_H_m_s: 'Year Month Day Hour Minute Second',
date_sub: 'yyyy-MM-dd', date_sub: 'yyyy-MM-dd',
date_split: 'yyyy/MM/dd', date_split: 'yyyy/MM/dd',
chartName: 'New Chart' chartName: 'New Chart',
chart_show_error: 'can not show normal',
chart_error_tips: 'Please contact admin '
}, },
dataset: { dataset: {
sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default', sheet_warn: 'There are multiple sheet pages, and the first one is extracted by default',

View File

@ -713,7 +713,9 @@ export default {
y_M_d_H_m_s: '年月日時分秒', y_M_d_H_m_s: '年月日時分秒',
date_sub: 'yyyy-MM-dd', date_sub: 'yyyy-MM-dd',
date_split: 'yyyy/MM/dd', date_split: 'yyyy/MM/dd',
chartName: '新建視圖' chartName: '新建視圖',
chart_show_error: '無法正常顯示',
chart_error_tips: '如有疑問請聯系管理員'
}, },
dataset: { dataset: {
sheet_warn: '有多個sheet頁面默認抽取第一個', sheet_warn: '有多個sheet頁面默認抽取第一個',

View File

@ -713,7 +713,9 @@ export default {
y_M_d_H_m_s: '年月日时分秒', y_M_d_H_m_s: '年月日时分秒',
date_sub: 'yyyy-MM-dd', date_sub: 'yyyy-MM-dd',
date_split: 'yyyy/MM/dd', date_split: 'yyyy/MM/dd',
chartName: '新建视图' chartName: '新建视图',
chart_show_error: '无法正常显示',
chart_error_tips: '如有疑问请联系管理员'
}, },
dataset: { dataset: {
sheet_warn: '有多个Sheet页默认抽取第一个', sheet_warn: '有多个Sheet页默认抽取第一个',

View File

@ -72,7 +72,7 @@ const data = {
}, },
setCurComponent(state, { component, index }) { setCurComponent(state, { component, index }) {
console.log('curComponent' + JSON.stringify(component)) // console.log('curComponent' + JSON.stringify(component))
state.curComponent = component state.curComponent = component
state.curComponentIndex = index state.curComponentIndex = index
}, },
@ -87,7 +87,7 @@ const data = {
if (width) curComponent.style.width = parseInt(canvasStyleData.selfAdaption ? (width * 100 / curCanvasScale.scaleWidth) : width) if (width) curComponent.style.width = parseInt(canvasStyleData.selfAdaption ? (width * 100 / curCanvasScale.scaleWidth) : width)
if (height) curComponent.style.height = parseInt(canvasStyleData.selfAdaption ? (height * 100 / curCanvasScale.scaleHeight) : height) if (height) curComponent.style.height = parseInt(canvasStyleData.selfAdaption ? (height * 100 / curCanvasScale.scaleHeight) : height)
if (rotate) curComponent.style.rotate = rotate if (rotate) curComponent.style.rotate = rotate
console.log('setShapeStyle' + JSON.stringify(curComponent)) // console.log('setShapeStyle' + JSON.stringify(curComponent))
}, },
setShapeSingleStyle({ curComponent }, { key, value }) { setShapeSingleStyle({ curComponent }, { key, value }) {

View File

@ -187,6 +187,9 @@ div:focus {
.custom-component-class { .custom-component-class {
width: 100%; width: 100%;
div.el-input-group__append {
width: 10% !important;
}
div { div {
width: 100% !important; width: 100% !important;
} }

View File

@ -264,8 +264,9 @@
<label-normal v-if="httpRequest.status && chart.type && chart.type.includes('text')" :chart="chart" class="table-class" /> <label-normal v-if="httpRequest.status && chart.type && chart.type.includes('text')" :chart="chart" class="table-class" />
<div v-if="!httpRequest.status" class="chart-error-class"> <div v-if="!httpRequest.status" class="chart-error-class">
<div style="font-size: 12px; color: #9ea6b2;height: 100%;display: flex;align-items: center;justify-content: center;"> <div style="font-size: 12px; color: #9ea6b2;height: 100%;display: flex;align-items: center;justify-content: center;">
{{ $t('panel.error_data') }}<br> {{ httpRequest.msg }},{{ $t('chart.chart_show_error') }}
{{ httpRequest.msg }} <br>
{{ $t('chart.chart_error_tips') }}
</div> </div>
</div> </div>
</div> </div>
@ -464,8 +465,8 @@ export default {
this.initTableField(id) this.initTableField(id)
}).catch(err => { }).catch(err => {
this.resetView() this.resetView()
this.httpRequest.status = false this.httpRequest.status = err.response.data.success
this.httpRequest.msg = err this.httpRequest.msg = err.response.data.message
return true return true
}) })
} }
@ -476,8 +477,8 @@ export default {
this.quota = response.data.quota this.quota = response.data.quota
}).catch(err => { }).catch(err => {
this.resetView() this.resetView()
this.httpRequest.status = false this.httpRequest.status = err.response.data.success
this.httpRequest.msg = err this.httpRequest.msg = err.response.data.message
return true return true
}) })
}, },
@ -643,8 +644,8 @@ export default {
this.httpRequest.status = true this.httpRequest.status = true
}).catch(err => { }).catch(err => {
this.resetView() this.resetView()
this.httpRequest.status = false this.httpRequest.status = err.response.data.success
this.httpRequest.msg = err this.httpRequest.msg = err.response.data.message
return true return true
}) })
} else { } else {
@ -668,8 +669,8 @@ export default {
this.httpRequest.status = true this.httpRequest.status = true
}).catch(err => { }).catch(err => {
this.resetView() this.resetView()
this.httpRequest.status = false this.httpRequest.status = err.response.data.success
this.httpRequest.msg = err this.httpRequest.msg = err.response.data.message
return true return true
}) })
} else { } else {

View File

@ -118,6 +118,7 @@ export default {
this.templateInfo.templateStyle = this.importTemplateInfo.panelStyle this.templateInfo.templateStyle = this.importTemplateInfo.panelStyle
this.templateInfo.templateData = this.importTemplateInfo.panelData this.templateInfo.templateData = this.importTemplateInfo.panelData
this.templateInfo.snapshot = this.importTemplateInfo.snapshot this.templateInfo.snapshot = this.importTemplateInfo.snapshot
this.templateInfo.nodeType = 'template'
} }
reader.readAsText(file) reader.readAsText(file)
}, },