From ae198793df6f96acaf31c28c60e1b32b9f7abba8 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Tue, 13 Apr 2010 11:38:29 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat(=E8=BF=87=E6=BB=A4=E5=99=A8):=20?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=97=B6=E9=97=B4=E8=BF=87=E6=BB=A4=E5=99=A8?= =?UTF-8?q?=E8=B7=9F=E9=9A=8F=E4=BB=AA=E8=A1=A8=E6=9D=BF=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/widget/deWidget/DeDate.vue | 62 ++++++++++++++----- 1 file changed, 47 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/widget/deWidget/DeDate.vue b/frontend/src/components/widget/deWidget/DeDate.vue index 6984086ed7..d50ac2a3fd 100644 --- a/frontend/src/components/widget/deWidget/DeDate.vue +++ b/frontend/src/components/widget/deWidget/DeDate.vue @@ -27,7 +27,7 @@ import { ApplicationContext } from '@/utils/ApplicationContext' import { timeSection } from '@/utils' import bus from '@/utils/bus' import customInput from '@/components/widget/deWidget/customInput' - +import { mapState } from 'vuex' export default { mixins: [customInput], props: { @@ -59,7 +59,8 @@ export default { operator: 'between', values: null, onFocus: false, - show: true + show: true, + timer: null } }, computed: { @@ -126,10 +127,19 @@ export default { return ['00:00:00', '23:59:59'] } return null - } + }, + ...mapState([ + 'canvasStyleData' + ]) }, watch: { + canvasStyleData: { + handler(newVal, oldVla) { + this.canvasStyleDataInit() + }, + deep: true + }, 'viewIds': function(value, old) { if (typeof value === 'undefined' || value === old) return this.setCondition() @@ -163,18 +173,8 @@ export default { } }, created() { - if (this.element.options.attrs.default && this.element.options.attrs.default.isDynamic) { - if (this.element.options.attrs.default) { - const widget = ApplicationContext.getService(this.element.serviceName) - this.values = widget.dynamicDateFormNow(this.element) - this.dateChange(this.values) - } - return - } - if (this.element.options.value) { - this.values = this.fillValueDerfault() - this.dateChange(this.values) - } + this.loadInit() + this.canvasStyleDataInit() }, mounted() { bus.$on('onScroll', this.onScroll) @@ -187,6 +187,38 @@ export default { bus.$off('reset-default-value', this.resetDefaultValue) }, methods: { + loadInit() { + if (this.element.options.attrs.default && this.element.options.attrs.default.isDynamic) { + if (this.element.options.attrs.default) { + const widget = ApplicationContext.getService(this.element.serviceName) + this.values = widget.dynamicDateFormNow(this.element) + this.dateChange(this.values) + } + return + } + if (this.element.options.value) { + this.values = this.fillValueDerfault() + this.dateChange(this.values) + } + }, + canvasStyleDataInit() { + if (this.inDraw && this.canvasStyleData.refreshViewEnable && this.element.options.attrs.default && this.element.options.attrs.default.isDynamic) { + this.searchCount = 0 + this.timer && clearInterval(this.timer) + let refreshTime = 300000 + if (this.canvasStyleData.refreshTime && this.canvasStyleData.refreshTime > 0) { + if (this.canvasStyleData.refreshUnit === 'second') { + refreshTime = this.canvasStyleData.refreshTime * 1000 + } else { + refreshTime = this.canvasStyleData.refreshTime * 60000 + } + } + this.timer = setInterval(() => { + this.loadInit() + this.searchCount++ + }, refreshTime) + } + }, clearHandler() { this.values = null }, From 5d99219c7c8eb46ac977b2b3ad1a28a64a58caef Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Thu, 13 Apr 2023 12:33:01 +0800 Subject: [PATCH 2/7] =?UTF-8?q?fix(=E5=85=AC=E5=85=B1=E8=BF=9E=E6=8E=A5):?= =?UTF-8?q?=20=E5=AF=BC=E5=87=BAexcel=E6=B2=A1=E6=9C=89=E9=81=AE=E7=BD=A9?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=8C=89=E9=92=AE=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/customComponent/UserView.vue | 10 +++++--- .../canvas/customComponent/UserViewDialog.vue | 25 ++++++++++++------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/frontend/src/components/canvas/customComponent/UserView.vue b/frontend/src/components/canvas/customComponent/UserView.vue index f4f5e244b9..88dfff4408 100644 --- a/frontend/src/components/canvas/customComponent/UserView.vue +++ b/frontend/src/components/canvas/customComponent/UserView.vue @@ -144,7 +144,7 @@ v-if="showChartInfoType==='enlarge' && hasDataPermission('export',panelInfo.privileges)&& showChartInfo && showChartInfo.type !== 'symbol-map'" class="el-icon-picture-outline" size="mini" - :disabled ="imageDownloading" + :disabled="imageDownloading" @click="exportViewImg" > {{ $t('chart.export_img') }} @@ -152,7 +152,7 @@ { + this.dialogLoading = false + }) }, exportViewImg() { this.imageDownloading = true diff --git a/frontend/src/components/canvas/customComponent/UserViewDialog.vue b/frontend/src/components/canvas/customComponent/UserViewDialog.vue index 9dfeda1a2a..db5ab9106b 100644 --- a/frontend/src/components/canvas/customComponent/UserViewDialog.vue +++ b/frontend/src/components/canvas/customComponent/UserViewDialog.vue @@ -1,6 +1,6 @@