Xiao_123 před 7 měsíci
rodič
revize
d987011f61
1 změnil soubory, kde provedl 6 přidání a 1 odebrání
  1. 6 1
      hooks/useDictionaries.js

+ 6 - 1
hooks/useDictionaries.js

@@ -14,7 +14,12 @@ import {
 const setDict = (type, val) => {
 const setDict = (type, val) => {
   if (type === 'areaTreeData') {
   if (type === 'areaTreeData') {
     const obj = val.data.find(e => e.name === '中国')
     const obj = val.data.find(e => e.name === '中国')
-    val = obj?.children ? obj.children : []
+    val.data = obj?.children ? obj.children.map(e =>{
+      // 市辖区直接显示区
+      const municipality = e.children && e.children.length && e.children[0].name === '市辖区'
+      if (municipality && e.children[0].children?.length) e.children = e.children[0].children
+      return e
+    }) : []
   }
   }
   // 一小时过期
   // 一小时过期
   const currentTime = new Date()
   const currentTime = new Date()