update icon

This commit is contained in:
quantulr
2024-03-01 17:29:36 +08:00
parent dc29644a2e
commit 184f041784
8 changed files with 292 additions and 168 deletions

View File

@ -0,0 +1,7 @@
import request from "@/utils/request";
export const listNews = (params) => request({
url: "/app/news/list",
method: "GET",
params
});

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

View File

@ -1,7 +1,8 @@
<template>
<div class="webHead">
<div class="site-title">
{{t('common.siteTitle')}}
<img class="site-logo" :src="sitelogo"/>
<span>{{ t('common.siteTitle') }}</span>
</div>
<el-row style="height: 80px">
<el-col :span="16">
@ -129,7 +130,7 @@
"
class="user-avatar"
/>
<i class="el-icon-caret-bottom" />
<i class="el-icon-caret-bottom"/>
</div>
<!-- </template> -->
<!-- </el-popover> -->
@ -185,15 +186,16 @@
</template>
<script setup>
import { computed, reactive, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import {computed, reactive, ref, watch} from "vue";
import {useRoute, useRouter} from "vue-router";
import useUserStore from "@/store/modules/user";
import { getCategory } from "@/api/website/solution";
import { useI18n } from "vue-i18n";
import {getCategory} from "@/api/website/solution";
import {useI18n} from "vue-i18n";
import useSettingsStore from "@/store/modules/settings";
import defaultAvatar from "@/assets/logo/avatar.png";
import modal from "@/plugins/modal";
import sitelogo from "@/assets/logo/咸海logo.png"
const userStore = useUserStore();
let state = reactive({});
@ -203,14 +205,14 @@ const router = useRouter();
const baseUrl = ref(import.meta.env.VITE_APP_BASE_API);
const categoryList = ref([]);
// 当前的语言
const { locale, t } = useI18n();
const {locale, t} = useI18n();
const solutionNameField = computed(() => {
return locale.value === "zh" ? "name" : `${locale.value}Name`;
});
const settingsStore = useSettingsStore();
const loadCategoryList = async () => {
const { data } = await getCategory();
const {data} = await getCategory();
categoryList.value = data;
};
loadCategoryList();
@ -242,7 +244,7 @@ function handlePage() {
// routeData = router.resolve({ path: "/identity/index" });
// }
// window.open(routeData.href, "_blank");
const routeData = router.resolve({ path: "/identity/index" });
const routeData = router.resolve({path: "/identity/index"});
window.open(routeData.href, "_blank");
}
@ -268,7 +270,8 @@ function logout() {
location.href = "/";
});
})
.catch(() => {});
.catch(() => {
});
}
</script>
@ -368,7 +371,7 @@ dt {
}
.profile-menu-group {
height: 71px;
height: 75px;
flex: 2;
justify-content: space-between;
align-items: center;
@ -394,7 +397,7 @@ dt {
}
.webHead {
.site-title{
.site-title {
height: 80px;
display: flex;
justify-content: start;
@ -402,7 +405,15 @@ dt {
font-size: 24px;
margin-left: 32px;
font-weight: bold;
.site-logo {
width: 30px;
height: 30px;
object-fit: cover;
margin-right: 4px;
}
}
.switch-locale {
position: absolute;
top: 50%;

View File

@ -1,7 +1,7 @@
<script setup>
import AMapLoader from "@amap/amap-jsapi-loader";
import { computed, onMounted, ref, shallowRef, toRefs, watch } from "vue";
import { init, registerMap } from "echarts";
import {computed, onMounted, ref, shallowRef, toRefs, watch} from "vue";
import {init, registerMap} from "echarts";
import {
countAchievementByArea,
countAchievementByCity,
@ -23,11 +23,11 @@ import backBtnPng from "@/assets/images/map_back.png";
import RegionPagine from "@/views/website/home/comp/RegionPagine.vue";
import html2canvas from "html2canvas";
import anime from "animejs";
import { useI18n } from "vue-i18n";
import {useI18n} from "vue-i18n";
import geoJSONRU from "@/assets/world.json";
import { countryOptions } from "@/utils/parameter";
import {countryOptions} from "@/utils/parameter";
const { t, locale } = useI18n();
const {t, locale} = useI18n();
const leftBoxPageNum = ref(1);
const rightBoxPageNum = ref(1);
const mapRef = ref(null);
@ -41,7 +41,7 @@ const props = defineProps({
default: 0,
},
});
const { mapIndex } = toRefs(props);
const {mapIndex} = toRefs(props);
const emit = defineEmits(["changeMapIndex"]);
const methods = [
{
@ -103,10 +103,10 @@ const options = {
orient: "horizontal", //图例排列方向
padding: 5,
pieces: [
{ gte: 0, lte: 99, label: "99", color: "#CAE9FD" },
{ gte: 100, lte: 299, label: "100-299", color: "#7ED2F7" },
{ gte: 300, lte: 499, label: "299-499", color: "#039DDD" },
{ gte: 500, label: "500", color: "#0D4884" },
{gte: 0, lte: 99, label: "99", color: "#CAE9FD"},
{gte: 100, lte: 299, label: "100-299", color: "#7ED2F7"},
{gte: 300, lte: 499, label: "299-499", color: "#039DDD"},
{gte: 500, label: "500", color: "#0D4884"},
],
textStyle: {
color: "#fff",
@ -204,7 +204,7 @@ const loadChinaDistrict = (adcode) => {
};
});
registerMap("map", { geoJSON, specialAreas: {} });
registerMap("map", {geoJSON, specialAreas: {}});
options.series[0].data = mapData.value;
myEcharts.value.setOption(options);
loading.value = false;
@ -220,13 +220,13 @@ const loadI18nDistrict = async () => {
value: 0,
};
});
registerMap("map", { geoJSON: geoJSONRU, specialAreas: {} });
registerMap("map", {geoJSON: geoJSONRU, specialAreas: {}});
myEcharts.value.setOption(options);
let result;
try {
result = await methods[mapIndex.value]["method"]();
} catch (e) {
result = { data: {} };
result = {data: {}};
}
areaCount.value =
result?.data?.count?.map((el) => {
@ -354,7 +354,8 @@ const handleScroll = async (ev) => {
return;
}
isScrolling.value = true;
playScrollAnimation(direction, () => {});
playScrollAnimation(direction, () => {
});
if (direction === "down" && mapIndex.value < methods.length - 1) {
emit("changeMapIndex", mapIndex.value + 1);
} else if (direction === "up" && mapIndex.value > 0) {
@ -369,7 +370,8 @@ watch(mapIndex, (newVal, oldVal) => {
}
isScrolling.value = true;
const direction = newVal > oldVal ? "down" : "up";
playScrollAnimation(direction, () => {});
playScrollAnimation(direction, () => {
});
// if (locale.value === "zh") {
// loadChinaDistrict("100000");
// } else {
@ -523,7 +525,7 @@ watch(mapIndex, (newVal, oldVal) => {
> .title {
position: absolute;
top: 20px;
top: 16px;
width: 100%;
text-align: center;
font-size: 24px;
@ -565,7 +567,8 @@ watch(mapIndex, (newVal, oldVal) => {
.th {
display: flex;
color: white;
font-size: 14px;
font-size: 12px;
.title,
.count {
width: 60px;

View File

@ -81,6 +81,10 @@
<div class="val">{{ state.data.patent_count }}</div>
<div class="des">{{ t("quantityOverview.patent") }}</div>
</div>
<div>
<div class="val">{{ state.data.achievement_count }}</div>
<div class="des">{{ t("quantityOverview.achievement") }}</div>
</div>
<div>
<div class="val">{{ state.data.expert_count }}</div>
<div class="des">
@ -116,14 +120,14 @@
<script setup>
// TODO:成果搜索添加按成果介绍搜索,需求搜索添加按需求描述搜索,添加实验室搜索
import { computed, onMounted, reactive, ref } from "vue";
import { banner, getAllCount } from "@/api/website/home";
import { useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
import {computed, onMounted, reactive, ref} from "vue";
import {banner, getAllCount} from "@/api/website/home";
import {useRouter} from "vue-router";
import {useI18n} from "vue-i18n";
const router = useRouter();
const { t } = useI18n();
const {t} = useI18n();
const testEnter = (ev) => {
ev.stopPropagation();
ev.preventDefault();
@ -157,7 +161,7 @@ const handleDetail = async (mode, keyword, queryType) => {
await queryRef.value.validate();
const routeData = router.resolve({
path: `/searchList/${mode}`,
query: { keyword, queryType },
query: {keyword, queryType},
});
void router.push(routeData);
};
@ -199,7 +203,7 @@ const switchTab = (index) => {
};
onMounted(() => {
banner({ locals: "首页背景" }).then((resp) => {
banner({locals: "首页背景"}).then((resp) => {
state.banner = resp.data[0].images;
});

View File

@ -0,0 +1,91 @@
<script setup>
import {reactive, ref, toRefs} from "vue";
import {listNews} from "@/api/website/home/news";
import Pagination from "@/components/Pagination/index.vue";
const file_base_url = `${import.meta.env.VITE_APP_BASE_API}/file`
const total = ref(0)
const newsList = ref([])
const data = reactive({
queryParams: {
pageNum: 1,
pageSize: 4,
classification: "0"
}
})
const {queryParams} = toRefs(data)
const getList = () => {
listNews(queryParams.value).then(resp => {
newsList.value = resp.rows
total.value = resp.total
})
}
const handleTabChange = (tab) => {
queryParams.value.classification = tab
getList()
}
getList()
</script>
<template>
<div class="app-container" style="height: 100%">
<el-tabs @tab-change="handleTabChange" v-model="queryParams.classification">
<el-tab-pane name="0" label="新闻"></el-tab-pane>
<el-tab-pane name="1" label="政策"></el-tab-pane>
</el-tabs>
<div class="news-list">
<div class="news-item" v-for="item in newsList">
<img class="news-cover" alt="cover" :src="`${file_base_url}/${item.cover}`"/>
<p class="news-content">
{{ item.content }}
</p>
</div>
</div>
<!-- <pagination :total="total"/>-->
</div>
</template>
<style scoped lang="scss">
.app-container {
display: flex;
flex-direction: column;
.news-list {
align-items: start;
//flex: 1;
//display: grid;
//grid-template-columns: repeat(2, minmax(0, 1fr));
//grid-template-rows: repeat(2, minmax(0, 1fr));
//gap: 16px;
//padding: 12px;
display: flex;
flex-wrap: wrap;
align-content: flex-start;
height: calc(100vh - 240px);
.news-item {
display: flex;
justify-content: space-between;
padding: 12px;
width: 50%;
height: 50%;
.news-cover {
flex: 2;
width: 80%;
height: 100%;
object-fit: cover;
}
.news-content {
overflow-y: hidden;
flex: 3;
margin-left: 16px;
}
}
}
}
</style>

View File

@ -2,10 +2,10 @@
<div ref="fullPageRef" v-loading="loading" class="fullPage">
<div class="indicator">
<div
v-for="idx in 6"
v-for="idx in 7"
:id="idx.toString()"
:key="idx"
:class="`${indicatorActiveIndex == idx ? 'active' : ''}`"
:class="`${indicatorActiveIndex === idx ? 'active' : ''}`"
class="point"
@click="handleIndicatorClick(idx)"
></div>
@ -52,10 +52,11 @@
</template>
<script setup>
import { computed, onMounted, reactive, ref, shallowRef } from "vue";
import {computed, onMounted, reactive, ref, shallowRef} from "vue";
import index0 from "./comp/index0.vue";
import index1 from "./comp/index1.vue";
import index8 from "./comp/index8.vue";
import index9 from "@/views/website/home/comp/index9.vue";
const loading = ref(true);
setTimeout(() => {
@ -153,6 +154,11 @@ let state = reactive({
zIndex: 1,
title: "index1",
},
{
comp: shallowRef(index9),
zIndex: 1,
title: "index9",
},
{
comp: shallowRef(index0),
zIndex: 1,
@ -174,7 +180,9 @@ const indicatorActiveIndex = computed(() => {
if (state.fullpage.current === 1) {
return 1;
} else if (state.fullpage.current === 2) {
return mapIndex.value + 2;
return 2
} else if (state.fullpage.current === 3) {
return mapIndex.value + 3;
} else {
return state.fullpage.current + 3;
}

View File

@ -32,8 +32,8 @@ export default defineConfig(({mode, command}) => {
// https://cn.vitejs.dev/config/#server-proxy
"/dev-api": {
// target: "http://101.34.131.16:1618",
target: "http://129.211.170.150/api",
// target: "http://192.168.0.201:1618",
// target: "http://129.211.170.150/api",
target: "http://192.168.0.200:1619",
// target: 'http://172.18.3.127:1618',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, ""),