提交 e0c66c4d authored 作者: yanpeng's avatar yanpeng

bugfix 1

上级 accf8ee8
<template>
<div class="search-container" v-show="!isShow">
<div class="search-type-tabs" v-if="enableBillTypeSwitch">
<div class="search-type-tab" :class="{ active: billSearchType === 'federal' }"
@click="handleChangeBillSearchType('federal')">
<div
class="search-type-tab"
:class="{ active: billSearchType === 'federal' }"
@click="handleChangeBillSearchType('federal')"
>
联邦议会
</div>
<div class="search-type-tab" :class="{ active: billSearchType === 'state' }"
@click="handleChangeBillSearchType('state')">
<div
class="search-type-tab"
:class="{ active: billSearchType === 'state' }"
@click="handleChangeBillSearchType('state')"
>
州议会
</div>
</div>
<div class="search-main" :class="{ 'search-main-with-tabs': enableBillTypeSwitch }">
<input v-model="store.searchBillText" :placeholder="placeholder" @keyup.enter="handleSearch"
class="search-input" />
<input v-model="store.searchBillText" :placeholder="placeholder" @keyup.enter="handleSearch" class="search-input" />
<div class="search-btn" @click="handleSearch">
<img src="@/assets/icons/search-icon.png" alt />
搜索
......@@ -32,7 +37,7 @@
</div>
</div>
<div class="btn" @click="handleToPosi('position2')">
<div class="btn-text">咨询要闻</div>
<div class="btn-text">资讯要闻</div>
<div class="btn-icon">
<img src="@/assets/icons/arrow-right-icon.png" alt />
</div>
......@@ -62,14 +67,7 @@ import { useWrittingAsstaintStore } from "@/stores/writtingAsstaintStore";
const store = useWrittingAsstaintStore();
const router = useRouter();
const {
countInfo,
containerRef,
placeholder,
areaName,
enableBillTypeSwitch,
defaultBillSearchType
} = defineProps({
const { countInfo, containerRef, placeholder, areaName, enableBillTypeSwitch, defaultBillSearchType } = defineProps({
countInfo: {
type: Array,
default: () => []
......@@ -138,11 +136,9 @@ watchEffect(() => {
if (isShow.value) {
homeMainRef.value.classList.add("scroll-main");
homeMainRef.value.classList.add("scrollHomeMain");
} else {
homeMainRef.value.classList.remove("scroll-main");
homeMainRef.value.classList.remove("scrollHomeMain");
}
store.changeIsShowSearchBar(isShow.value);
......
......@@ -74,7 +74,12 @@
<span>美对华领域打压遏制最新动态</span>
</div>
<div class="title-right-select">
<el-select v-model="selectedFieldForLatest" placeholder="全部领域" class="field-select">
<el-select
v-model="selectedFieldForLatest"
@change="handleFieldChange"
placeholder="全部领域"
class="field-select"
>
<el-option v-for="item in fieldOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
......@@ -131,7 +136,7 @@
<simple-pagination
v-model:current-page="newsCurrentPage"
:page-size="pageSize"
:total="newsList.length"
:total="allNewsList.length"
@page-change="handleNewsPageChange"
/>
</div>
......@@ -215,7 +220,7 @@
<div class="bottom-item">
<div class="bottom-item-title">
<img :src="icon4" alt="" />
<span>美对领域打压遏制时间线</span>
<span>美对领域打压遏制时间线</span>
</div>
<el-select
v-model="selectedFieldTimeline"
......@@ -408,6 +413,12 @@ const newsList = ref([]);
const newsCurrentPage = ref(1);
const pageSize = ref(5); // 每页显示 5 条
const handleFieldChange = domainId => {
console.log("领域改变", domainId);
console.log("领域值 =>", selectedFieldForLatest.value);
getUSGovernmentLatestDynamicData();
};
// 总页数
const totalPages = computed(() => {
return Math.ceil(newsList.value.length / pageSize.value) || 1;
......@@ -445,10 +456,11 @@ const handleNextPage = () => {
const getUSGovernmentLatestDynamicData = async () => {
try {
const params = {
orgId: !!deptValueForLatest.value ? deptValueForLatest.value : null,
domainId: !!selectedFieldForLatest.value ? selectedFieldForLatest.value : null,
pageSize: 50,
currentPage: newsCurrentPage.value
};
console.log("领域值 =>", selectedFieldForLatest.value);
const res = await getUSGovernmentLatestDynamic(params);
if (res.code === 200 && res.data) {
// 将接口数据转换为 newsList 需要的格式
......
......@@ -185,8 +185,8 @@
<simple-pagination
v-model:current-page="rankCurrentPage"
:page-size="pageSize"
:total="rankingList.length"
:page-size="rankingPageSize"
:total="allRankingList.length"
@page-change="handleRankPageChange"
/>
</div>
......@@ -419,6 +419,7 @@ const getUSGovernmentSanctionHistoryData = async () => {
const loadingJointRank = ref(false);
const getUSGovernmentJointSanctionRankData = async () => {
loadingJointRank.value = true;
const params = {};
try {
const res = await getUSGovernmentJointSanctionRank();
if (res.code === 200 && res.data) {
......@@ -487,8 +488,8 @@ const updateDynamicListByPage = () => {
};
const updateRankListByPage = () => {
const start = (rankCurrentPage.value - 1) * pageSize.value;
const end = start + pageSize.value;
const start = (rankCurrentPage.value - 1) * rankingPageSize.value;
const end = start + rankingPageSize.value;
rankingList.value = allRankingList.value.slice(start, end);
};
// 点击科技要闻-跳转详情页
......@@ -785,31 +786,7 @@ const fieldOptions = ref([
{ label: "其他", value: "99" }
]);
const methodOptions = ref([
// { label: "全部制裁手段", value: "" },
// { label: "法案", value: "-1" },
// { label: "政令", value: "-2" },
// { label: "实体清单", value: "1" },
// { label: "特别国民指定清单", value: "2" },
// { label: "涉军企业", value: "3" },
// { label: "行业制裁识别清单", value: "4" },
// { label: "无法核实清单", value: "5" },
// { label: "军事最终用户清单", value: "6" },
// { label: "非SDN中国军工企业名单", value: "7" },
// { label: "拒绝往来人员清单", value: "8" },
// { label: "军事最终用途与最终用户规则", value: "9" },
// { label: "欧盟合并制裁清单", value: "10" },
// { label: "英国制裁清单", value: "11" },
// { label: "加拿大合并自主制裁清单", value: "12" },
// { label: "商业管制清单", value: "13" }
// { label: "232调查", value: "14" },
// { label: "Capta List (CAP) - Treasury Department", value: "15" },
// { label: "ITAR Debarred (DTC) - State Department", value: "16" },
// { label: "Nonproliferation Sanctions (ISN) - State Department", value: "17" },
// { label: "Non-SDN Menu-Based Sanctions List (NS-MBS List) - Treasury Department", value: "18" },
// { label: "Palestinian Legislative Council List (PLC) - Treasury Department", value: "19" },
// { label: "经验证最终用户清单", value: "20" }
]);
const methodOptions = ref([]);
const handleGetSanList = async () => {
const params = {
......@@ -825,16 +802,17 @@ const handleGetSanList = async () => {
value: item.id
};
});
methodValue.value = "";
}
} catch (error) {}
};
watch(
() => methodValue.value,
val => {
getDepartmentListData();
}
);
// watch(
// () => methodValue.value,
// val => {
// getDepartmentListData();
// }
// );
watch(
() => deptValue.value,
......@@ -847,6 +825,7 @@ const allDynamicData = ref([]);
const dynamicList = ref([]);
const newsCurrentPage = ref(1);
const pageSize = ref(5); // 每页显示 5 条
const rankingPageSize = ref(10);
const handleNewsPageChange = page => {
newsCurrentPage.value = page;
......@@ -1662,7 +1641,7 @@ const prev = () => {
// border-radius: 10px;
// border: 1px solid rgb(234, 236, 238);
border-bottom: 1px solid rgb(234, 236, 238);
padding: 12px 24px;
padding: 10px 24px;
margin-bottom: 12px;
box-sizing: border-box;
......
......@@ -6,10 +6,16 @@
<img src="./assets/leftbtn.png" alt class="left-btn" @click="prev" :class="{ disabled: startIndex === 0 }" />
<div class="content">
<div class="carousel-container" :style="{ transform: `translateX(-${startIndex * (307 + 16)}px)` }">
<div class="carousel-item" v-for="item, index in carouselList" :key="index">
<div class="carousel-item" v-for="(item, index) in carouselList" :key="index">
<div class="item-top">
<div class="top-img">
<img :src="ele" :class="{ img1: index !== 0 }" alt v-for="(ele, idx) in item.imageList" :key="idx" />
<img
:src="ele"
:class="{ img1: index !== 0 }"
alt
v-for="(ele, idx) in item.imageList"
:key="idx"
/>
</div>
<div class="top-num">{{ item.count }}</div>
</div>
......@@ -20,13 +26,18 @@
:key="idxx">
{{ ele.industryName }}
</div> -->
<AreaTag v-for="ele, idxx in item.industryList" :key="idxx" :tagName="ele.industryName"></AreaTag>
<AreaTag v-for="(ele, idxx) in item.industryList" :key="idxx" :tagName="ele.industryName"></AreaTag>
</div>
</div>
</div>
</div>
<img src="./assets/rightbtn.png" alt class="right-btn" @click="next"
:class="{ disabled: startIndex >= carouselList.length - 5 }" />
<img
src="./assets/rightbtn.png"
alt
class="right-btn"
@click="next"
:class="{ disabled: startIndex >= carouselList.length - 5 }"
/>
</div>
<!-- 排华联盟分布 -->
......@@ -48,8 +59,13 @@
<div class="item" v-for="(item, index) in countList" :key="index">
<div class="item-left">
<img :src="item.image" alt />
<el-tooltip effect="dark" :content="item.zhName" popper-class="common-prompt-popper" placement="top"
:show-after="500">
<el-tooltip
effect="dark"
:content="item.zhName"
popper-class="common-prompt-popper"
placement="top"
:show-after="500"
>
<span>{{ item.zhName }}</span>
</el-tooltip>
</div>
......@@ -91,13 +107,18 @@
<span>排华联盟最新动态</span>
</div>
<div class="news-content">
<div class="item" v-for="item, index in newsList" :key="index">
<div class="item" v-for="(item, index) in newsList" :key="index">
<div class="item-title">
<img :src="item.image || defaultImg" alt />
<span @click="handleClick(item)">{{ item.title }}</span>
</div>
<el-tooltip effect="dark" :content="item.content" popper-class="common-prompt-popper" placement="top"
:show-after="500">
<el-tooltip
effect="dark"
:content="item.content"
popper-class="common-prompt-popper"
placement="top"
:show-after="500"
>
<div class="item-content">{{ item.content }}</div>
</el-tooltip>
<div class="item-bottom">
......@@ -106,7 +127,7 @@
:key="idx">
<span>{{ ele.industryName }}</span>
</div> -->
<AreaTag v-for="ele, idx in item.industryList" :key="idx" :tagName="ele.industryName"></AreaTag>
<AreaTag v-for="(ele, idx) in item.industryList" :key="idx" :tagName="ele.industryName"></AreaTag>
</div>
<div class="bottom-right">{{ getTime(item.time) }}</div>
</div>
......@@ -123,16 +144,26 @@
<div class="item-title">
<div class="title-left">
<div class="img-list">
<img :src="ele.image || defaultImg" :class="{ img1: index !== 0 }"
@error="e => (e.target.src = defaultImg)" alt v-for="(ele, index) in item.countryList"
:key="index" />
<img
:src="ele.image || defaultImg"
:class="{ img1: index !== 0 }"
@error="e => (e.target.src = defaultImg)"
alt
v-for="(ele, index) in item.countryList"
:key="index"
/>
</div>
<div class="left-content">{{ getContent(item.countryList) }}</div>
</div>
<div class="title-right">{{ item.statementList?.length }}次合作</div>
</div>
<div class="item-content">
<div class="content-list" v-for="(ele, idx) in item.statementList" :key="idx" @click="handleClick(ele)">
<div
class="content-list"
v-for="(ele, idx) in item.statementList"
:key="idx"
@click="handleClick(ele)"
>
<div class="list-left">
<!-- <span>{{ getName(ele.industryList) }}</span> -->
<AreaTag v-if="getName(ele.industryList)" :tagName="getName(ele.industryList)"></AreaTag>
......@@ -945,7 +976,7 @@ const initRightDonut = async () => {
value: res.data[i].amount,
x: Math.random() * 10,
y: Math.random() * 10,
symbolSize: res.data[i].amount * 9,
symbolSize: res.data[i].amount * 9
};
// 先判断data中是否包含上述数据
......@@ -985,8 +1016,8 @@ const initRightDonut = async () => {
// text: 'Basic Graph'
},
tooltip: {
trigger: 'item', // 针对Graph的节点/边触发(必配,否则弹框不生效)
triggerOn: 'click',
trigger: "item", // 针对Graph的节点/边触发(必配,否则弹框不生效)
triggerOn: "click",
formatter: function (params) {
// params.data 是当前点击节点的完整数据对象
const { name, value } = params.data;
......@@ -1018,7 +1049,7 @@ const initRightDonut = async () => {
show: true
},
edgeSymbol: ["circle", ""],
edgeSymbolSize: [4, 40],
edgeSymbolSize: [4, 80],
edgeLabel: {
fontSize: 20
},
......
......@@ -26,7 +26,7 @@
</div>
<!-- 资讯要问 -->
<div class="ask" id="position2">
<com-title title="咨询要闻" />
<com-title title="资讯要闻" />
<div class="ask-main">
<askPage />
</div>
......
......@@ -3,8 +3,13 @@
<div class="main-content" ref="homeMainRef">
<div class="home-top-bg"></div>
<!-- 搜索栏部分 -->
<SearchContainer v-if="homeMainRef" :countInfo="statCountInfo" placeholder="搜索规则限制" :containerRef="homeMainRef"
areaName="" />
<SearchContainer
v-if="homeMainRef"
:countInfo="statCountInfo"
placeholder="搜索规则限制"
:containerRef="homeMainRef"
areaName=""
/>
<!-- 最新动态 -->
<div class="newdata" id="position1">
<com-title title="最新动态" />
......@@ -14,7 +19,7 @@
</div>
<!-- 资讯要问 -->
<div class="ask" id="position2">
<com-title title="咨询要闻" />
<com-title title="资讯要闻" />
<div class="ask-main">
<askPage />
</div>
......
......@@ -19,7 +19,7 @@
</div>
</div>
<div class="btn" @click="handleToPosi('position2')">
<div class="btn-text">咨询要闻</div>
<div class="btn-text">资讯要闻</div>
<div class="btn-icon">
<img src="@/assets/icons/arrow-right-icon.png" alt />
</div>
......@@ -29,7 +29,8 @@
<div class="btn-icon">
<img src="@/assets/icons/arrow-right-icon.png" alt />
</div>
</div>,
</div>
,
<div class="btn" @click="handleToPosi('position4')">
<div class="btn-text">资源库</div>
<div class="btn-icon">
......@@ -85,7 +86,7 @@
</div>
</div>
<div class="btn" @click="handleToPosi('position2')">
<div class="btn-text">咨询要闻</div>
<div class="btn-text">资讯要闻</div>
<div class="btn-icon">
<img src="@/assets/icons/arrow-right-icon.png" alt />
</div>
......@@ -113,7 +114,7 @@
</div>
<!-- 资讯要问 -->
<div class="ask" id="position2">
<com-title title="咨询要闻" />
<com-title title="资讯要闻" />
<div class="ask-main">
<askPage />
</div>
......@@ -145,7 +146,7 @@ import askPage from "./components/askPage/index.vue";
import dataSub from "./components/dataSub/index.vue";
import resLib from "./components/resLib/index.vue";
import { useContainerScroll } from "@/hooks/useScrollShow";
import { getStatCount } from '@/api/ruleRestriction/index.js'
import { getStatCount } from "@/api/ruleRestriction/index.js";
// 搜索框
const input = ref("");
......@@ -154,19 +155,19 @@ const { isShow } = useContainerScroll(homeMainRef);
const router = useRouter();
const statCountInfo = ref({})
const statCountInfo = ref({});
const getStatCountInfo = async () => {
try {
const res = await getStatCount();
if (res && res.code === 200) {
// console.log('----getStatCountInfo', res.data)
statCountInfo.value = res.data
statCountInfo.value = res.data;
}
} catch (error) {
console.error("获取首页统计接口失败:", error);
}
}
};
// 搜索功能
const handleSearch = () => {
......@@ -205,8 +206,8 @@ const handleBackHome = () => {
};
onMounted(async () => {
await getStatCountInfo()
})
await getStatCountInfo();
});
</script>
<style scoped lang="scss">
......
......@@ -14,8 +14,14 @@
<div class="main-content" ref="containerRef">
<div class="home-top-bg"></div>
<!-- 搜索栏部分 -->
<SearchContainer style="margin-bottom: 48px;height: fit-content;" v-if="containerRef" :countInfo="countInfo"
placeholder="搜索科研资助实体、资助记录" :containerRef="containerRef" areaName="" />
<SearchContainer
style="margin-bottom: 48px; height: fit-content"
v-if="containerRef"
:countInfo="countInfo"
placeholder="搜索科研资助实体、资助记录"
:containerRef="containerRef"
areaName=""
/>
<!-- <div class="search"> -->
<!-- <div class="search-main">
......@@ -51,7 +57,7 @@
</div>
</div>
<div class="btn" @click="scrollToTop('position2')">
<div class="btn-text">咨询要闻</div>
<div class="btn-text">资讯要闻</div>
<div class="btn-icon">
<img src="@/assets/icons/arrow-right-icon.png" alt="" />
</div>
......@@ -80,7 +86,7 @@
<div class="data-item-name">{{ item.orgNameEn }}</div>
<div v-if="item.orgAbbEn" class="data-item-abb">{{ item.orgAbbEn }}</div>
</div>
<div class="data-item-num" :style="{ color: color[index] }">{{ item.num + '项' }}</div>
<div class="data-item-num" :style="{ color: color[index] }">{{ item.num + "项" }}</div>
</div>
</div>
<!-- 最新动态 -->
......@@ -92,7 +98,7 @@
</div>
<!-- 资讯要问 -->
<div class="ask" id="position2">
<com-title title="咨询要闻" />
<com-title title="资讯要闻" />
<div class="ask-main">
<askPage />
</div>
......@@ -125,10 +131,7 @@ import dataSub from "./components/dataSub/index.vue";
import resLib from "./components/resLib/index.vue";
import scrollToTop from "@/utils/scrollToTop";
import {
getFundSourceOrg
} from "@/api/scientificFunding/overview";
import { getFundSourceOrg } from "@/api/scientificFunding/overview";
import { useContainerScroll } from "@/hooks/useScrollShow";
......@@ -141,21 +144,21 @@ import img06 from "./assets/images/img06.png";
let containerRef = ref(null);
let countInfo = ref([
{
name: '科研资助机构',
name: "科研资助机构",
count: 18
},
{
name: '科研资助动态',
name: "科研资助动态",
count: 633
},
{
name: '科研资助项目',
name: "科研资助项目",
count: 312
},
{
name: '经费总额(亿美元)',
count: '15,556'
},
name: "经费总额(亿美元)",
count: "15,556"
}
]);
// 搜索框
const input = ref("");
......@@ -231,14 +234,14 @@ const color = ref([
"rgba(64, 150, 255, 1)",
"rgb(33, 129, 57)",
"rgb(5, 95, 194)"
])
]);
//// 来源机构列表
const handleGetFundSourceOrg = async () => {
try {
const res = await getFundSourceOrg();
console.log("来源机构列表", res);
if (res.code === 200 && res.data) {
dataList.value = res.data
dataList.value = res.data;
}
} catch (error) {
console.error("获取来源机构列表error", error);
......@@ -246,7 +249,7 @@ const handleGetFundSourceOrg = async () => {
};
onMounted(async () => {
handleGetFundSourceOrg()
handleGetFundSourceOrg();
});
</script>
......@@ -461,7 +464,9 @@ onMounted(async () => {
box-sizing: border-box;
position: relative;
cursor: pointer;
transition: transform 0.3s ease, box-shadow 0.3s ease;
transition:
transform 0.3s ease,
box-shadow 0.3s ease;
display: flex;
align-items: center;
padding: 0px 24px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论