From d52bec880c2cea496d0b97b587b1c464b0dacc4e Mon Sep 17 00:00:00 2001 From: Chang Liu Date: Thu, 1 Feb 2024 23:03:58 +0800 Subject: [PATCH] X --- .../SchemaView/SchemaSidebarEditView.vue | 15 ---- .../SchemaView/SchemaSidebarReadOnlyView.vue | 69 ++++++++++--------- src/components/SchemaView/SchemaViewMain.vue | 20 ++---- 3 files changed, 43 insertions(+), 61 deletions(-) diff --git a/src/components/SchemaView/SchemaSidebarEditView.vue b/src/components/SchemaView/SchemaSidebarEditView.vue index f0414cd..dbeaaa9 100644 --- a/src/components/SchemaView/SchemaSidebarEditView.vue +++ b/src/components/SchemaView/SchemaSidebarEditView.vue @@ -36,10 +36,6 @@
-
- {{ rdf }} RDF graph -
-
{{ relGroup }} group @@ -261,17 +257,6 @@ export default { } return this.schema.relTables.find(t => t.name === this.label).group; }, - - rdf() { - if (!this.schema || !this.label) { - return null; - } - if (this.isNode) { - return this.schema.nodeTables.find(t => t.name === this.label).rdf; - } - return this.schema.relTables.find(t => t.name === this.label).rdf; - }, - tableProperties() { if (this.isEditingLabel) { if (this.isNode) { diff --git a/src/components/SchemaView/SchemaSidebarReadOnlyView.vue b/src/components/SchemaView/SchemaSidebarReadOnlyView.vue index 06d3ed0..cfb6ad5 100644 --- a/src/components/SchemaView/SchemaSidebarReadOnlyView.vue +++ b/src/components/SchemaView/SchemaSidebarReadOnlyView.vue @@ -5,16 +5,20 @@ - {{ hoveredLabel }} + {{ label }}
-
+
-
+
+ {{ rdf }} RDF graph +
+ +
-
+
- - + + - + - +
- Name - - Type - NameType
- There are no properties in this table - There are no properties in this table
{{ property.name }} - PK + PK {{ property.type }} @@ -90,42 +82,53 @@ export default { type: Object, required: true, }, - hoveredLabel: { + label: { type: String, required: true, }, - hoveredIsNode: { + isNode: { type: Boolean, required: true, }, }, computed: { ...mapStores(useSettingsStore), + + rdf() { + if (!this.schema || !this.label) { + return null; + } + if (this.isNode) { + return this.schema.nodeTables.find(t => t.name === this.label).rdf; + } + return this.schema.relTables.find(t => t.name === this.label).rdf; + }, + source() { - if (!this.schema || !this.hoveredLabel || this.hoveredIsNode) { + if (!this.schema || !this.label || this.isNode) { return null; } - return this.schema.relTables.find(t => t.name === this.hoveredLabel).src; + return this.schema.relTables.find(t => t.name === this.label).src; }, destination() { - if (!this.schema || !this.hoveredLabel || this.hoveredIsNode) { + if (!this.schema || !this.label || this.isNode) { return null; } - return this.schema.relTables.find(t => t.name === this.hoveredLabel).dst; + return this.schema.relTables.find(t => t.name === this.label).dst; }, tableProperties() { - if (!this.schema || !this.hoveredLabel) { + if (!this.schema || !this.label) { return []; } - if (this.hoveredIsNode) { + if (this.isNode) { return this.schema.nodeTables - .find(t => t.name === this.hoveredLabel) + .find(t => t.name === this.label) .properties; } else { return this.schema.relTables - .find(t => t.name === this.hoveredLabel) + .find(t => t.name === this.label) .properties; } }, diff --git a/src/components/SchemaView/SchemaViewMain.vue b/src/components/SchemaView/SchemaViewMain.vue index b85c5b9..5f64597 100644 --- a/src/components/SchemaView/SchemaViewMain.vue +++ b/src/components/SchemaView/SchemaViewMain.vue @@ -1,8 +1,5 @@