From 32299104e753c86e5c0da501acf8274c9372e472 Mon Sep 17 00:00:00 2001 From: junjie Date: Thu, 6 May 2021 15:34:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=8C=E6=A0=B7=E5=BC=8F=E3=80=81=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E8=B0=83=E6=95=B4=E6=97=B6=EF=BC=8C=E4=B8=8D=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E8=AE=A1=E7=AE=97=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/view/ChartEdit.vue | 65 +++++++++++++++------ 1 file changed, 46 insertions(+), 19 deletions(-) diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index 1389f848d2..8fc2719451 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -97,7 +97,7 @@
@@ -331,7 +331,8 @@ export default { { required: true, message: this.$t('commons.input_content'), trigger: 'change' } ] }, - tabStatus: false + tabStatus: false, + data: {} } }, computed: { @@ -373,7 +374,7 @@ export default { this.quota = response.data.quota }) }, - save() { + save(getData) { const view = JSON.parse(JSON.stringify(this.view)) view.id = this.view.id view.sceneId = this.view.sceneId @@ -417,7 +418,14 @@ export default { view.customFilter = JSON.stringify(view.customFilter) post('/chart/view/save', view).then(response => { // this.get(response.data.id); - this.getData(response.data.id) + // this.getData(response.data.id) + + if (getData) { + this.getData(response.data.id) + } else { + this.getChart(response.data.id) + } + this.$store.dispatch('chart/setChartSceneData', null) this.$store.dispatch('chart/setChartSceneData', response.data) }) @@ -441,7 +449,26 @@ export default { this.view.customFilter = this.view.customFilter ? JSON.parse(this.view.customFilter) : {} // 将视图传入echart组件 this.chart = response.data - console.log(JSON.stringify(this.chart)) + this.data = response.data.data + // console.log(JSON.stringify(this.chart)) + }) + } else { + this.view = {} + } + }, + getChart(id) { + if (id) { + post('/chart/view/get/' + id, {}).then(response => { + this.initTableData(response.data.tableId) + this.view = JSON.parse(JSON.stringify(response.data)) + this.view.xaxis = this.view.xaxis ? JSON.parse(this.view.xaxis) : [] + this.view.yaxis = this.view.yaxis ? JSON.parse(this.view.yaxis) : [] + this.view.customAttr = this.view.customAttr ? JSON.parse(this.view.customAttr) : {} + this.view.customStyle = this.view.customStyle ? JSON.parse(this.view.customStyle) : {} + this.view.customFilter = this.view.customFilter ? JSON.parse(this.view.customFilter) : {} + + response.data.data = this.data + this.chart = response.data }) } else { this.view = {} @@ -450,26 +477,26 @@ export default { // 左边往右边拖动时的事件 start1(e) { - console.log(e) + // console.log(e) e.clone.className = 'item-on-move' e.item.className = 'item-on-move' }, end1(e) { - console.log(e) + // console.log(e) e.clone.className = 'item' e.item.className = 'item' this.refuseMove(e) this.removeCheckedKey(e) - this.save() + this.save(true) }, // 右边往左边拖动时的事件 start2(e) { - console.log(e) + // console.log(e) }, end2(e) { - console.log(e) + // console.log(e) this.removeDuplicateKey(e) - this.save() + this.save(true) }, removeCheckedKey(e) { const that = this @@ -518,7 +545,7 @@ export default { }, // move回调方法 onMove(e, originalEvent) { - console.log(e) + // console.log(e) this.moveId = e.draggedContext.element.id // //不允许停靠 // if (e.relatedContext.element.id == 1) return false; @@ -529,12 +556,12 @@ export default { }, dimensionItemChange(item) { - this.save() + this.save(true) }, dimensionItemRemove(item) { this.view.xaxis.splice(item.index, 1) - this.save() + this.save(true) }, quotaItemChange(item) { @@ -544,12 +571,12 @@ export default { // ele.summary = item.summary // } // }) - this.save() + this.save(true) }, quotaItemRemove(item) { this.view.yaxis.splice(item.index, 1) - this.save() + this.save(true) }, onColorChange(val) { @@ -606,7 +633,7 @@ export default { }, saveDimensionFilter() { this.view.xaxis[this.dimensionItem.index].filter = this.dimensionItem.filter - this.save() + this.save(true) this.closeDimensionFilter() }, @@ -619,7 +646,7 @@ export default { }, saveQuotaFilter() { this.view.yaxis[this.quotaItem.index].filter = this.quotaItem.filter - this.save() + this.save(true) this.closeQuotaFilter() }, @@ -633,7 +660,7 @@ export default { } else if (this.itemForm.renameType === 'dimension') { this.view.xaxis[this.itemForm.index].name = this.itemForm.name } - this.save() + this.save(true) this.closeRename() }, closeRename() { From 484d931fd6d4174b91caedf9fcea7f060a15facb Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 6 May 2021 15:43:57 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E5=88=9D=E5=A7=8B=E5=AF=86?= =?UTF-8?q?=E7=A0=81=E5=92=8C=E7=99=BB=E5=BD=95=E8=B6=85=E6=97=B6=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=AE=BE=E7=BD=AE=E5=9C=A8dataease.properties?= =?UTF-8?q?=E9=87=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/java/io/dataease/auth/util/JWTUtils.java | 6 ++++-- backend/src/main/resources/application.properties | 8 +++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/dataease/auth/util/JWTUtils.java b/backend/src/main/java/io/dataease/auth/util/JWTUtils.java index 8dbed6faf2..452c38812b 100644 --- a/backend/src/main/java/io/dataease/auth/util/JWTUtils.java +++ b/backend/src/main/java/io/dataease/auth/util/JWTUtils.java @@ -85,8 +85,10 @@ public class JWTUtils { public static boolean loginExpire(String token){ if (Login_Interval==0) { String property = CommonBeanFactory.getBean(Environment.class).getProperty("dataease.login_timeout"); - int seconds = StringUtils.isNotEmpty(property) ? Integer.parseInt(property): (10*60); - Login_Interval = seconds * 1000; + // 默认超时时间是8h + int minute = StringUtils.isNotEmpty(property) ? Integer.parseInt(property): (8*60); + // 分钟换算成毫秒 + Login_Interval = minute * 1000 * 60; } Long now = System.currentTimeMillis(); Long lastOperateTime = tokenLastOperateTime(token); diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 69f15f7e2a..0f07e87ea1 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -62,10 +62,12 @@ spring.mvc.log-request-details=true pagehelper.PageRowBounds=true #excel等用户上传文件路径 upload.file.path=/opt/dataease/data/upload/ + +#初始密码和登录超时时间移到/opt/dataease/conf/dataease.properties #用户初始密码,如果不设置默认是DataEase123.. -dataease.init_password=DataEase123456 -#登录超时时间单位s 设置默认30分钟 如果雨不设置 默认10分钟也就是10*60 -dataease.login_timeout=1800 +#dataease.init_password=DataEase123456 +#登录超时时间单位min +#dataease.login_timeout=480 From 6096f85edacb3137f5c6293145a9c8386410fc51 Mon Sep 17 00:00:00 2001 From: junjie Date: Thu, 6 May 2021 15:44:04 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat(=E8=A7=86=E5=9B=BE):=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E8=A7=86=E5=9B=BE=E9=AB=98=E5=BA=A6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/chart/components/table/TableNormal.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/chart/components/table/TableNormal.vue b/frontend/src/views/chart/components/table/TableNormal.vue index 4936bf98c5..3e0055582c 100644 --- a/frontend/src/views/chart/components/table/TableNormal.vue +++ b/frontend/src/views/chart/components/table/TableNormal.vue @@ -113,7 +113,7 @@ export default { const that = this setTimeout(function() { const currentHeight = document.documentElement.clientHeight - const tableMaxHeight = currentHeight - 56 - 40 - 84 - that.$refs.title.offsetHeight - 8 * 2 - 20 + const tableMaxHeight = currentHeight - 56 - 40 - 84 - that.$refs.title.offsetHeight - 20 let tableHeight if (that.chart.data) { tableHeight = (that.chart.data.tableRow.length + 2) * 36