Browse Source

数据目录-数据标签详情

Xiao_123 3 ngày trước cách đây
mục cha
commit
07416a406c

+ 2 - 2
src/views/dataBook/components/mGraph.vue

@@ -53,11 +53,11 @@
           >
           </div>
           <div
-            :style="{ 'background-color': node.color + '44', width: 20 * node.text.length + 'px' }"
+            :style="{ 'background-color': node.color + '44', width: 20 * ((node.text || '').length) + 'px' }"
             class="node-text"
             :class="{ 'node-active':  menu.activeId === +node.id }"
           >
-            {{ node.text }}
+            {{ node.text || '' }}
           </div>
         </div>
       </template>

+ 8 - 1
src/views/dataBook/dataLabel/details.vue

@@ -39,7 +39,7 @@ export default {
     }
   },
   created () {
-    this.$route.meta.title = this.$route.params.name
+    this.setPageTitle()
     const savedTab = new URLSearchParams(window.location.search).get('tab')
     if (!savedTab) {
       this.activeIndex = 0
@@ -48,6 +48,13 @@ export default {
     this.activeIndex = this.list.findIndex(e => e.path === savedTab)
   },
   methods: {
+    setPageTitle () {
+      const rawName = this.$route.params.name
+      const decodedName = rawName ? decodeURIComponent(rawName) : ''
+      const title = decodedName || '数据标签详情'
+      this.$route.meta.title = title
+      document.title = title
+    },
     handleClick (item) {
       this.$router.push(`${this.$route.path}?tab=${item.path}`)
     }

+ 2 - 2
src/views/dataBook/dataLabel/index.vue

@@ -18,7 +18,7 @@
         {{ item.group ? '是' : '否' }}
       </template>
       <template #name_zh="{item}">
-        <div>{{ item.name_zh }}</div>
+        <div class="defaultLink" @click="handleDetails(item)">{{ item.name_zh }}</div>
       </template>
       <template #status="{ item }">
         <v-chip
@@ -106,7 +106,7 @@ export default {
       this.init()
     },
     handleDetails (item) {
-      this.$router.push(`${this.$route.path}/details/${item.id}/${item.name_zh}`)
+      this.$router.push(`${this.$route.path}/details/${item.id}/${encodeURIComponent(item.name_zh)}`)
     }
   }
 }