|
@@ -49,7 +49,8 @@
|
|
|
import CtDialog from '@/components/CtDialog'
|
|
|
import textUI from '@/components/FormUI/TextInput'
|
|
|
import { getDict } from '@/hooks/web/useDictionaries'
|
|
|
-import { inject, reactive, ref } from 'vue'
|
|
|
+import { reactive, ref } from 'vue'
|
|
|
+import { useRoute } from 'vue-router'; const route = useRoute()
|
|
|
defineOptions({ name:'common-components-areaTree'})
|
|
|
const emits = defineEmits(['checkedInput'])
|
|
|
|
|
@@ -72,13 +73,12 @@ const num = 10
|
|
|
|
|
|
let treeList = ref()
|
|
|
const show = ref(false)
|
|
|
-const query = inject('routeQuery')
|
|
|
// 获取区域数据
|
|
|
getDict('areaTreeData', {}, 'areaTreeData').then(({ data }) => {
|
|
|
const arr = data?.length && data || []
|
|
|
treeList.value = [arr]
|
|
|
- if (query && query.city) { // 刷新回显
|
|
|
- const city = query.city
|
|
|
+ if (route.query && route.query.city) { // 刷新回显
|
|
|
+ const city = route.query.city
|
|
|
const levelCountArr = city.split('__')
|
|
|
levelCountArr?.forEach((areaIds, levelIndex) => {
|
|
|
const idArr = areaIds.split('_')
|