bug fixed
This commit is contained in:
@ -20,14 +20,14 @@
|
||||
<div class="b">暂无</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="rightBox">
|
||||
<div class="rightBox">
|
||||
<div class="head">
|
||||
<div class="a">领域</div>
|
||||
<div class="b">需求数量</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="Object.keys(getIndustry(snapTree)).length > 0"
|
||||
v-for="(v, k) in getIndustry(snapTree)"
|
||||
v-if="Object.keys(industryTree).length > 0"
|
||||
v-for="(v, k) in industryTree"
|
||||
>
|
||||
<div class="a" :title="k">{{ k }}</div>
|
||||
<div class="b">{{ v }}</div>
|
||||
@ -36,7 +36,7 @@
|
||||
<div class="a">暂无</div>
|
||||
<div class="b">暂无</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -52,8 +52,10 @@ import {
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
const loading = shallowRef(true);
|
||||
let treeData = [];
|
||||
const snapTree = shallowRef([]);
|
||||
|
||||
let treeData = {};
|
||||
const snapTree = shallowRef({});
|
||||
const industryTree = shallowRef({});
|
||||
|
||||
const searchRegionData = async (code, level) => {
|
||||
if (level == "province") {
|
||||
@ -67,8 +69,9 @@ const searchRegionData = async (code, level) => {
|
||||
data = snapTree.value;
|
||||
} else {
|
||||
const resp = await countDemandByCity(provcode);
|
||||
snapTree.value = resp.data;
|
||||
data = resp.data;
|
||||
snapTree.value = resp.count;
|
||||
industryTree.value = resp.industry ?? {};
|
||||
data = resp.count;
|
||||
}
|
||||
return data.find((item) => item.code == code) || false;
|
||||
} else if (level == "city") {
|
||||
@ -82,16 +85,20 @@ const searchRegionData = async (code, level) => {
|
||||
data = snapTree.value;
|
||||
} else {
|
||||
const resp = await countDemandByArea(ctcode);
|
||||
snapTree.value = resp.data;
|
||||
data = resp.data;
|
||||
snapTree.value = resp.count;
|
||||
industryTree.value = resp.industry ?? {};
|
||||
data = resp.count;
|
||||
}
|
||||
return data.find((item) => item.code == code) || false;
|
||||
} else {
|
||||
if (treeData.length) {
|
||||
return treeData.find((item) => item.code == code) || false;
|
||||
if (Object.keys(treeData).length) {
|
||||
industryTree.value = treeData.industry ?? {};
|
||||
snapTree.value = treeData.count ?? {};
|
||||
return treeData.count.find((item) => item.code == code) || false;
|
||||
} else {
|
||||
const { data } = await countDemandByProvince();
|
||||
return data.find((item) => item.code == code) || false;
|
||||
const { count, industry } = await countDemandByProvince();
|
||||
industryTree.value = industry ?? {};
|
||||
return count.find((item) => item.code == code) || false;
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -173,10 +180,10 @@ const state = reactive({
|
||||
|
||||
onMounted(() => {
|
||||
// 数据接口
|
||||
const res = { code: 200, message: "ok", data: {} };
|
||||
countDemandByProvince().then((res) => {
|
||||
treeData = res.data;
|
||||
snapTree.value = res.data;
|
||||
countDemandByProvince().then((resp) => {
|
||||
treeData = resp;
|
||||
snapTree.value = resp.count;
|
||||
industryTree.value = resp.industry ?? {};
|
||||
loading.value = false;
|
||||
});
|
||||
// let echartsDomList = document.querySelectorAll('.echartsDom');
|
||||
@ -223,7 +230,7 @@ function goBack() {
|
||||
state.district.search("中国", async (status, result) => {
|
||||
if (status == "complete") {
|
||||
await getData(result.districtList[0], "", 100000);
|
||||
snapTree.value = treeData;
|
||||
snapTree.value = treeData.count;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user