From e520101af1ec9b4b54171d09b9f4d1f3a7f16725 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Mon, 7 Jun 2021 17:08:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E6=8A=A5=E9=94=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../canvas/components/Editor/Shape.vue | 10 ++- .../canvas/custom-component/UserView.vue | 64 +++++++++---------- .../system/authority/components/LazyTree.vue | 8 ++- .../src/views/system/datasource/index.vue | 2 +- 4 files changed, 44 insertions(+), 40 deletions(-) diff --git a/frontend/src/components/canvas/components/Editor/Shape.vue b/frontend/src/components/canvas/components/Editor/Shape.vue index 2fdc44c1b8..2191c2886e 100644 --- a/frontend/src/components/canvas/components/Editor/Shape.vue +++ b/frontend/src/components/canvas/components/Editor/Shape.vue @@ -36,15 +36,18 @@ export default { }, element: { require: true, - type: Object + type: Object, + default: null }, defaultStyle: { require: true, - type: Object + type: Object, + default: null }, index: { require: true, - type: [Number, String] + type: [Number, String], + default: null } }, data() { @@ -200,6 +203,7 @@ export default { pointList.forEach(point => { const angle = mod360(initialAngle[point] + rotate) const len = angleToCursor.length + // eslint-disable-next-line no-constant-condition while (true) { lastMatchIndex = (lastMatchIndex + 1) % len const angleLimit = angleToCursor[lastMatchIndex] diff --git a/frontend/src/components/canvas/custom-component/UserView.vue b/frontend/src/components/canvas/custom-component/UserView.vue index aef84fac77..77a6809e46 100644 --- a/frontend/src/components/canvas/custom-component/UserView.vue +++ b/frontend/src/components/canvas/custom-component/UserView.vue @@ -40,7 +40,8 @@ export default { components: { ChartComponent, TableNormal, LabelNormal }, props: { element: { - type: Object + type: Object, + default: null }, filter: { type: Object, @@ -59,38 +60,6 @@ export default { } } }, - watch: { - '$store.getters.conditions': function(newVal, oldVal) { - this.filter.filter = newVal - this.getData(this.element.propValue.viewId) - }, - filter(val) { - this.getData(this.element.propValue.viewId) - }, - // deep监听panel 如果改变 提交到 store - canvasStyleData: { - handler(newVal, oldVla) { - // this.chart.stylePriority == panel 优先使用仪表板样式 - this.mergeStyle() - }, - deep: true - }, - // 监听外部的样式变化 - outStyle: { - handler(newVal, oldVla) { - if (this.$refs[this.element.propValue.id]) { - this.$refs[this.element.propValue.id].chartResize() - } - }, - deep: true - } - }, - created() { - this.refId = uuid.v1 - }, - computed: mapState([ - 'canvasStyleData' - ]), data() { return { refId: null, @@ -120,8 +89,35 @@ export default { message: null } }, + computed: mapState([ + 'canvasStyleData' + ]), + watch: { + filter(val) { + this.getData(this.element.propValue.viewId) + }, + // deep监听panel 如果改变 提交到 store + canvasStyleData: { + handler(newVal, oldVla) { + // this.chart.stylePriority == panel 优先使用仪表板样式 + this.mergeStyle() + }, + deep: true + }, + // 监听外部的样式变化 + outStyle: { + handler(newVal, oldVla) { + if (this.$refs[this.element.propValue.id]) { + this.$refs[this.element.propValue.id].chartResize() + } + }, + deep: true + } + }, + created() { - this.filter.filter = this.$store.getters.conditions + this.refId = uuid.v1 + // this.filter.filter = this.$store.getters.conditions this.getData(this.element.propValue.viewId) }, mounted() { diff --git a/frontend/src/views/system/authority/components/LazyTree.vue b/frontend/src/views/system/authority/components/LazyTree.vue index 126e2f0b92..c341d1cb1c 100644 --- a/frontend/src/views/system/authority/components/LazyTree.vue +++ b/frontend/src/views/system/authority/components/LazyTree.vue @@ -57,7 +57,8 @@ export default { }, authCondition: { type: Object, - required: false + required: false, + default: null }, dataInfo: { type: Object, @@ -67,7 +68,10 @@ export default { type: String, required: true }, - attachActiveName: String, + attachActiveName: { + type: String, + default: null + }, defaultProps: { type: Object, required: false, diff --git a/frontend/src/views/system/datasource/index.vue b/frontend/src/views/system/datasource/index.vue index f3c0b77c96..f476f3c2b7 100644 --- a/frontend/src/views/system/datasource/index.vue +++ b/frontend/src/views/system/datasource/index.vue @@ -92,7 +92,7 @@ import LayoutContent from '@/components/business/LayoutContent' import ComplexTable from '@/components/business/complex-table' -import { checkPermission, hasDataPermission } from '@/utils/permission' +import { hasDataPermission } from '@/utils/permission' import { formatCondition } from '@/utils/index' import { dsGrid, addDs, editDs, delDs, validateDs } from '@/api/system/datasource'