bug fix and performance improvements
This commit is contained in:
@ -51,3 +51,11 @@ export const updateAchievement = (data) => {
|
||||
data,
|
||||
});
|
||||
};
|
||||
|
||||
// /app/laboratory/importTemplate
|
||||
export const labAchievementTemplate = () =>
|
||||
request({
|
||||
url: "/app/laboratory/importTemplate",
|
||||
method: "GET",
|
||||
responseType: "blob",
|
||||
});
|
||||
|
@ -15,3 +15,10 @@ export const deleteTechnologyProject = (ids) => {
|
||||
method: "DELETE",
|
||||
});
|
||||
};
|
||||
|
||||
export const researchArchievementTemplate = () =>
|
||||
request({
|
||||
url: "/app/research/importTemplate",
|
||||
method: "GET",
|
||||
responseType: "blob",
|
||||
});
|
||||
|
@ -264,3 +264,24 @@ export function getCasNavigation() {
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// /app/map/expertMap
|
||||
export const getExpertMap = () =>
|
||||
request({
|
||||
url: "/app/map/expertMap",
|
||||
method: "get",
|
||||
});
|
||||
|
||||
// /app/map/enterpriseMap
|
||||
export const getEnterpriseMap = () =>
|
||||
request({
|
||||
url: "/app/map/enterpriseMap",
|
||||
method: "get",
|
||||
});
|
||||
|
||||
// /app/map/achievementMap
|
||||
export const getAchievementMap = () =>
|
||||
request({
|
||||
url: "/app/map/achievementMap",
|
||||
method: "get",
|
||||
});
|
@ -31,6 +31,13 @@ const tips = {
|
||||
// 下载文件出现错误,请联系管理员!
|
||||
downloadFileError:
|
||||
"Ошибка загрузки файла, пожалуйста, свяжитесь с администратором!",
|
||||
importTip:"Инструкция по импорту",
|
||||
keywordsImportTip:
|
||||
"Ключевые слова/Приложения клиентов, разделенные символом | (искусственный интеллект|квантовые вычисления)",
|
||||
industryImportTip:
|
||||
"Область принадлежности (>соединение уровней снизу вверх, разделенных символом |)",
|
||||
industryImportExample:
|
||||
'На примере: "Авиация и космонавтика>Космическая технология>Технология разработки носителей ракет|Биотехнологии и новая медицина>Традиционная медицина и природные лекарства>Технология разработки инновационных лекарств"',
|
||||
};
|
||||
|
||||
export default tips;
|
||||
|
@ -26,6 +26,11 @@ const tips = {
|
||||
backendInterfaceConnectionException: "后端接口连接异常",
|
||||
// 下载文件出现错误,请联系管理员!
|
||||
downloadFileError: "下载文件出现错误,请联系管理员!",
|
||||
importTip:"导入说明",
|
||||
keywordsImportTip: "关键词/应用客户 多个用{'|'}隔开 (人工智能{'|'}量子计算)",
|
||||
industryImportTip: "所属领域 (>拼接上下级 多个用{'|'}隔开) ",
|
||||
industryImportExample:
|
||||
"例如 : 航空航天>航天技术>运载火箭技术{'|'}生物与新医药>中药、天然药物>创新药物研发技术",
|
||||
};
|
||||
|
||||
export default tips;
|
||||
|
@ -368,35 +368,42 @@ export const countryOptions = [
|
||||
key: "zh",
|
||||
zh: "中国",
|
||||
ru: "Китай",
|
||||
en: "China",
|
||||
},
|
||||
{
|
||||
key: "ru",
|
||||
zh: "俄罗斯",
|
||||
ru: "Россия",
|
||||
en: "Russia",
|
||||
},
|
||||
{
|
||||
key: "tj",
|
||||
zh: "塔吉克斯坦",
|
||||
ru: "Таджикистан",
|
||||
en: "Tajikistan",
|
||||
},
|
||||
{
|
||||
key: "tm",
|
||||
zh: "土库曼斯坦",
|
||||
ru: "Туркменистан",
|
||||
en: "Turkmenistan",
|
||||
},
|
||||
{
|
||||
key: "uz",
|
||||
zh: "乌兹别克斯坦",
|
||||
ru: "Узбекистан",
|
||||
en: "Uzbekistan",
|
||||
},
|
||||
{
|
||||
key: "kz",
|
||||
zh: "哈萨克斯坦",
|
||||
ru: "Казахстан",
|
||||
en: "Kazakhstan",
|
||||
},
|
||||
{
|
||||
key: "kg",
|
||||
zh: "吉尔吉斯斯坦",
|
||||
ru: "Кыргызстан",
|
||||
}
|
||||
en: "Kyrgyzstan",
|
||||
},
|
||||
];
|
||||
|
@ -40,24 +40,27 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col v-if="route.name === 'LabAchievement'" :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- icon="UploadFilled"-->
|
||||
<!-- size="small"-->
|
||||
<!-- type="primary"-->
|
||||
<!-- @click="handleImport"-->
|
||||
<!-- >{{ t("admin.form.importAchievement") }}-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col v-if="route.name === 'LabAchievement'" :span="1.5">
|
||||
<el-button icon="plus" size="small" type="primary" @click="handleAdd"
|
||||
>{{
|
||||
t("admin.form.add", {
|
||||
type: t("admin.common.achievement"),
|
||||
})
|
||||
}}
|
||||
<el-col
|
||||
v-if="route.name === 'LabAchievement' && locale === 'zh'"
|
||||
:span="1.5"
|
||||
>
|
||||
<el-button
|
||||
icon="UploadFilled"
|
||||
size="small"
|
||||
type="primary"
|
||||
@click="handleImport"
|
||||
>{{ t("admin.form.importAchievement") }}
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col v-if="route.name === 'LabAchievement'" :span="1.5">
|
||||
<el-button icon="plus" size="small" type="primary" @click="handleAdd"
|
||||
>{{
|
||||
t("admin.form.add", {
|
||||
type: t("admin.common.achievement"),
|
||||
})
|
||||
}}
|
||||
</el-button>
|
||||
</el-col>-->
|
||||
<right-toolbar
|
||||
v-model:showSearch="showSearch"
|
||||
@queryTable="getList"
|
||||
@ -156,25 +159,30 @@
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
type="primary"
|
||||
@click="
|
||||
saveAs(
|
||||
xlsl,
|
||||
`${t('admin.common.achievementImportTemplate')}.xlsx`
|
||||
)
|
||||
"
|
||||
@click="downloadImportTemplate"
|
||||
>{{ t("tips.downloadTemplate") }}
|
||||
</el-link>
|
||||
<br />
|
||||
<span>{{ t('tips.importTip') }}</span>
|
||||
<ol style="text-align: left">
|
||||
<li>{{ t("tips.keywordsImportTip") }}</li>
|
||||
<li>
|
||||
{{ t("tips.industryImportTip") }}
|
||||
<br />
|
||||
{{ t("tips.industryImportExample") }}
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
<div class="el-upload__tip text-center">
|
||||
<span style="color: red">{{ t("tips.importInstructions") }}</span>
|
||||
<el-link
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
type="primary"
|
||||
@click="saveAs(importTip, `${t('tips.importInstructions')}.txt`)"
|
||||
><!--下载-->{{ t("common.download") }}
|
||||
</el-link>
|
||||
</div>
|
||||
<!-- <div class="el-upload__tip text-center">-->
|
||||
<!-- <span style="color: red">{{ t("tips.importInstructions") }}</span>-->
|
||||
<!-- <el-link-->
|
||||
<!-- :underline="false"-->
|
||||
<!-- style="font-size: 12px; vertical-align: baseline"-->
|
||||
<!-- type="primary"-->
|
||||
<!-- @click="saveAs(importTip, `${t('tips.importInstructions')}.txt`)"-->
|
||||
<!-- ><!–下载–>{{ t("common.download") }}-->
|
||||
<!-- </el-link>-->
|
||||
<!-- </div>-->
|
||||
</template>
|
||||
</el-upload>
|
||||
<template #footer>
|
||||
@ -198,6 +206,7 @@ import { getCurrentInstance, reactive, ref, toRefs } from "vue";
|
||||
import {
|
||||
achievementList,
|
||||
deleteAchievements,
|
||||
labAchievementTemplate,
|
||||
laboratoryAchievementList,
|
||||
} from "@/api/admin/laboratory/achievement";
|
||||
import { getToken } from "@/utils/auth";
|
||||
@ -208,7 +217,7 @@ import { useI18n } from "vue-i18n";
|
||||
import dayjs from "dayjs";
|
||||
import modal from "@/plugins/modal";
|
||||
|
||||
const { t } = useI18n();
|
||||
const { t, locale } = useI18n();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
@ -349,5 +358,10 @@ const handleAdd = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const downloadImportTemplate = async () => {
|
||||
const blob = await labAchievementTemplate();
|
||||
saveAs(blob, `${t("admin.common.achievementImportTemplate")}.xlsx`);
|
||||
};
|
||||
|
||||
getList();
|
||||
</script>
|
||||
</script>
|
@ -42,7 +42,7 @@
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
v-if="route.name === 'ResearchAchievement'"
|
||||
v-if="route.name === 'ResearchAchievement' && locale === 'zh'"
|
||||
icon="UploadFilled"
|
||||
size="small"
|
||||
type="primary"
|
||||
@ -147,25 +147,30 @@
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
type="primary"
|
||||
@click="
|
||||
saveAs(
|
||||
xlsl,
|
||||
`${t('admin.common.achievementImportTemplate')}.xlsx`
|
||||
)
|
||||
"
|
||||
@click="downloadImportTemplate"
|
||||
>{{ t("tips.downloadTemplate") }}
|
||||
</el-link>
|
||||
</div>
|
||||
<div class="el-upload__tip text-center">
|
||||
<span style="color: red">{{ t("tips.importInstructions") }}</span>
|
||||
<el-link
|
||||
:underline="false"
|
||||
style="font-size: 12px; vertical-align: baseline"
|
||||
type="primary"
|
||||
@click="saveAs(importTip, `${t('tips.importInstructions')}.txt`)"
|
||||
><!--下载-->
|
||||
{{ t("common.download") }}
|
||||
</el-link>
|
||||
<br />
|
||||
<span>{{ t('tips.importTip') }}</span>
|
||||
<ol style="text-align: left">
|
||||
<li>{{ t("tips.keywordsImportTip") }}</li>
|
||||
<li>
|
||||
{{ t("tips.industryImportTip") }}
|
||||
<br />
|
||||
{{ t("tips.industryImportExample") }}
|
||||
</li>
|
||||
</ol>
|
||||
<!-- <span style="color: red">{{ t("tips.importInstructions") }}</span>-->
|
||||
<!-- <el-link-->
|
||||
<!-- :underline="false"-->
|
||||
<!-- style="font-size: 12px; vertical-align: baseline"-->
|
||||
<!-- type="primary"-->
|
||||
<!-- @click="saveAs(importTip, `${t('tips.importInstructions')}.txt`)"-->
|
||||
<!-- ><!–下载–>-->
|
||||
<!-- {{ t("common.download") }}-->
|
||||
<!-- </el-link>-->
|
||||
</div>
|
||||
</template>
|
||||
</el-upload>
|
||||
@ -198,9 +203,10 @@ import importTip from "@/assets/achievement_import_description.txt?url";
|
||||
import { saveAs } from "file-saver";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import dayjs from "dayjs";
|
||||
import {UploadFilled} from "@element-plus/icons-vue";
|
||||
import { UploadFilled } from "@element-plus/icons-vue";
|
||||
import { researchArchievementTemplate } from "@/api/admin/laboratory/research-project";
|
||||
|
||||
const { t } = useI18n();
|
||||
const { t, locale } = useI18n();
|
||||
const router = useRouter();
|
||||
|
||||
const dataList = ref([]);
|
||||
@ -320,5 +326,10 @@ function submitFileForm() {
|
||||
uploadRef.value.submit();
|
||||
}
|
||||
|
||||
const downloadImportTemplate = async () => {
|
||||
const blob = await researchArchievementTemplate();
|
||||
saveAs(blob, `${t("admin.common.achievementImportTemplate")}.xlsx`);
|
||||
};
|
||||
|
||||
getList();
|
||||
</script>
|
||||
</script>
|
@ -15,6 +15,9 @@ import {
|
||||
countExpertByArea,
|
||||
countExpertByCity,
|
||||
countExpertByProvince,
|
||||
getAchievementMap,
|
||||
getEnterpriseMap,
|
||||
getExpertMap,
|
||||
} from "@/api/website/home";
|
||||
import backBtnPng from "@/assets/images/map_back.png";
|
||||
import RegionPagine from "@/views/website/home/comp/RegionPagine.vue";
|
||||
@ -22,6 +25,7 @@ import html2canvas from "html2canvas";
|
||||
import anime from "animejs";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import geoJSONRU from "@/assets/world.json";
|
||||
import { countryOptions } from "@/utils/parameter";
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const leftBoxPageNum = ref(1);
|
||||
@ -43,6 +47,7 @@ const methods = [
|
||||
{
|
||||
name: "expert",
|
||||
title: computed(() => t("map.expertMap")),
|
||||
method: getExpertMap,
|
||||
byProvince: countExpertByProvince,
|
||||
byCity: countExpertByCity,
|
||||
byArea: countExpertByArea,
|
||||
@ -51,6 +56,7 @@ const methods = [
|
||||
name: "technology",
|
||||
// title: "技术分布地图",
|
||||
title: computed(() => t("map.technologyMap")),
|
||||
method: getAchievementMap,
|
||||
byProvince: countAchievementByProvince,
|
||||
byCity: countAchievementByCity,
|
||||
byArea: countAchievementByArea,
|
||||
@ -67,6 +73,7 @@ const methods = [
|
||||
name: "enterprise",
|
||||
// title: "企业分布地图",
|
||||
title: computed(() => t("map.companyMap")),
|
||||
method: getEnterpriseMap,
|
||||
byProvince: countEnterpriseByProvince,
|
||||
byCity: countEnterpriseByCity,
|
||||
byArea: countEnterpriseByArea,
|
||||
@ -109,7 +116,8 @@ const options = {
|
||||
tooltip: {
|
||||
//提示框信息
|
||||
trigger: "item",
|
||||
formatter: "{b}\n{c}人",
|
||||
formatter: "{b}\n{c}",
|
||||
valueFormatter: (value) => (value + locale.value === "zh" ? "人" : "людей"),
|
||||
},
|
||||
series: [
|
||||
{
|
||||
@ -204,7 +212,7 @@ const loadChinaDistrict = (adcode) => {
|
||||
});
|
||||
};
|
||||
|
||||
const loadRussiaDistrict = () => {
|
||||
const loadI18nDistrict = async () => {
|
||||
mapData.value = geoJSONRU.features.map((el) => {
|
||||
const areaProp = el.properties;
|
||||
return {
|
||||
@ -213,6 +221,40 @@ const loadRussiaDistrict = () => {
|
||||
};
|
||||
});
|
||||
registerMap("map", { geoJSON: geoJSONRU, specialAreas: {} });
|
||||
myEcharts.value.setOption(options);
|
||||
let result;
|
||||
try {
|
||||
result = await methods[mapIndex.value]["method"]();
|
||||
} catch (e) {
|
||||
result = { data: {} };
|
||||
}
|
||||
areaCount.value =
|
||||
result?.data?.count?.map((el) => {
|
||||
return {
|
||||
name: countryOptions.find((ct) => el.country === ct.key)?.[
|
||||
locale.value
|
||||
],
|
||||
count: el.count,
|
||||
};
|
||||
}) ?? [];
|
||||
industryCount.value = Object.keys(result.data?.industry ?? {}).map(
|
||||
(key) => ({
|
||||
name: key,
|
||||
count: result.data.industry[key],
|
||||
})
|
||||
);
|
||||
mapData.value = geoJSONRU.features.map((el) => {
|
||||
const areaProp = el.properties;
|
||||
return {
|
||||
name: areaProp.name,
|
||||
value:
|
||||
result.data?.count?.find(
|
||||
(el) =>
|
||||
countryOptions.find((ct) => ct.key === el.country)?.en ===
|
||||
areaProp.name
|
||||
)?.count ?? 0,
|
||||
};
|
||||
});
|
||||
options.series[0].data = mapData.value;
|
||||
myEcharts.value.setOption(options);
|
||||
// TODO:get count
|
||||
@ -231,7 +273,7 @@ onMounted(async () => {
|
||||
// loadChinaDistrict("100000");
|
||||
// } else {
|
||||
// }
|
||||
loadRussiaDistrict();
|
||||
loadI18nDistrict();
|
||||
});
|
||||
|
||||
/**
|
||||
@ -267,7 +309,10 @@ const playScrollAnimation = (direction, start) => {
|
||||
html2canvas(pageWrap, {
|
||||
// width: pageWrap.offsetWidth / 5,
|
||||
// height: pageWrap.offsetHeight / 5,
|
||||
scale: 1 / 5,
|
||||
}).then((canvas) => {
|
||||
canvas.style.width = "100%";
|
||||
canvas.style.height = "100%";
|
||||
canvas.addEventListener("wheel", (ev) => {
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
@ -328,7 +373,7 @@ watch(mapIndex, (newVal, oldVal) => {
|
||||
// if (locale.value === "zh") {
|
||||
// loadChinaDistrict("100000");
|
||||
// } else {
|
||||
loadRussiaDistrict();
|
||||
loadI18nDistrict();
|
||||
// }
|
||||
});
|
||||
|
||||
@ -349,9 +394,9 @@ watch(mapIndex, (newVal, oldVal) => {
|
||||
<div class="title">{{ methods[mapIndex].title.value }}</div>
|
||||
<div v-if="loading" class="loading-modal"></div>
|
||||
<!-- 返回上一级按钮 -->
|
||||
<div class="back-btn" @click="">
|
||||
<img :src="backBtnPng" alt="back" />
|
||||
</div>
|
||||
<!-- <div class="back-btn" @click="">
|
||||
<img :src="backBtnPng" alt="back" />
|
||||
</div>-->
|
||||
<!-- 人数表格 -->
|
||||
<div class="count-table area">
|
||||
<div class="table">
|
||||
@ -529,7 +574,9 @@ watch(mapIndex, (newVal, oldVal) => {
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 160px;
|
||||
border-right: 1px solid #0054ff;
|
||||
word-break: break-all;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user