提交 17e424f0 authored 作者: 李智林's avatar 李智林

法案接口更新

上级 d2dbf9a1
......@@ -140,3 +140,16 @@ export function getBillHyly(params) {
params,
})
}
// 根据法案ID获取法案全局信息
/**
* @param {id}
* @header token
*/
export function getBillInfoGlobal(params) {
return request({
method: 'GET',
url: `/api/billInfoBean/summary/${params.id}`,
params,
})
}
\ No newline at end of file
......@@ -127,15 +127,26 @@
</div>
<div class="title">{{ "热门法案" }}</div>
</div>
<div class="box1-header-right" @click="handleClickToDetail">
<div class="box1-header-right" @click="handleClickToDetail()">
{{ "查看详情 >" }}
</div>
</div>
<div class="box1-main">
<div class="box1-main" style="display: block;">
<el-carousel
ref="carouselRef"
height="354px"
:autoplay="true"
:interval="3000"
arrow="never"
indicator-position="none"
@change="handleCarouselChange"
>
<el-carousel-item v-for="(bill, billIndex) in hotBillList" :key="billIndex">
<div class="carousel-content" style="display: flex; height: 100%;">
<div class="box1-main-left">
<div class="box1-main-left-title">
<!-- "H.R.1(119th)-大而美法案" -->
{{ curBill.billName }}
{{ bill.billName }}
</div>
<div class="box1-main-left-info">
<div
......@@ -146,7 +157,7 @@
info3: index === 2,
info4: index === 3
}"
v-for="(item, index) in curBill.hylyList"
v-for="(item, index) in bill.hylyList"
:key="index"
>
{{ item.industryName }}
......@@ -156,19 +167,19 @@
<div class="info1-box">
<div class="icon"></div>
<div class="info1-box-left">{{ "提案人:" }}</div>
<div class="info1-box-right">{{ curBill.tarName }}</div>
<div class="info1-box-right">{{ bill.tarName }}</div>
</div>
<div class="info1-box">
<div class="icon"></div>
<div class="info1-box-left">{{ "提出时间:" }}</div>
<div class="info1-box-right">
{{ curBill.introductionDate }}
{{ bill.introductionDate }}
</div>
</div>
</div>
<div class="box1-main-left-info2">
<div class="info2-item" v-for="(item, index) in curBill.dyqkList" :key="index">
<div class="time-line" v-if="index !== curBill.dyqkList.length - 1"></div>
<div class="info2-item" v-for="(item, index) in bill.dyqkList" :key="index">
<div class="time-line" v-if="index !== bill.dyqkList.length - 1"></div>
<div class="item-icon">
<img src="./assets/images/info2-icon.png" alt="" />
</div>
......@@ -198,6 +209,9 @@
</div>
</div>
</div>
</el-carousel-item>
</el-carousel>
</div>
</div>
<div class="box2">
<div class="box2-header">
......@@ -276,7 +290,7 @@
</div>
<div class="box4-main">
<div class="box4-main-item" v-for="(item, index) in messageList" :key="index">
<div class="left" @click="handleClcikToCharacter(index)">
<div class="left" @click="handleClcikToCharacter(item,index)">
<img :src="item.personImage" alt="" />
</div>
<div class="right">
......@@ -344,10 +358,10 @@
<div class="box7-header-title">{{ "法案提出部门" }}</div>
</div>
<div class="box7-header-right">
<div class="header-right-icon">
<!-- <div class="header-right-icon">
<img src="./assets/images/tips-icon.png" alt="" />
</div>
<div class="header-right-text">{{ "数据来源:美国国会官方网站" }}</div>
</div> -->
<!-- <div class="header-right-text">{{ "数据来源:美国国会官方网站" }}</div> -->
</div>
</div>
<div class="box-center">
......@@ -374,10 +388,10 @@
<div class="box8-header-title">{{ "关键议员提案" }}</div>
</div>
<div class="box8-header-right">
<div class="header-right-icon">
<!-- <div class="header-right-icon">
<img src="./assets/images/tips-icon.png" alt="" />
</div>
<div class="header-right-text">{{ "数据来源:美国国会官方网站" }}</div>
</div> -->
<!-- <div class="header-right-text">{{ "数据来源:美国国会官方网站" }}</div> -->
</div>
</div>
<div class="box-center">
......@@ -397,7 +411,7 @@
class="box8-main-item"
v-for="(item, index) in box8Data"
:key="index"
@click="handleClcikToCharacter(index)"
@click="handleClcikToCharacter(item,index)"
>
<div class="box8-main-item-left">
<img :src="item.img" alt="" referrerpolicy="no-referrer" class="left-img" />
......@@ -427,10 +441,10 @@
<div class="box9-header-title">{{ "涉华法案领域分布" }}</div>
</div>
<div class="box9-header-right">
<div class="header-right-icon">
<!-- <div class="header-right-icon">
<img src="./assets/images/tips-icon.png" alt="" />
</div>
<div class="header-right-text">{{ "数据来源:美国国会官方网站" }}</div>
</div> -->
<!-- <div class="header-right-text">{{ "数据来源:美国国会官方网站" }}</div> -->
</div>
</div>
<div class="box-center">
......@@ -580,7 +594,7 @@
</div>
</div>
<div class="right-main" v-loading="loading">
<div class="right-main-box" v-for="(item, index) in bills" :key="index" @click="handleClickToDetail()">
<div class="right-main-box" v-for="(item, index) in bills" :key="index" @click="handleClickToDetailO(item)">
<div class="header">
<div class="title">{{ item.name }}</div>
<div class="en-title">{{ item.eName }}</div>
......@@ -720,7 +734,8 @@ const formatMessageTime = (timeStr) => {
};
// 跳转人物主页
const handleClcikToCharacter = index => {
const handleClcikToCharacter = (item,index) => {
window.sessionStorage.setItem("memberId", item.memberId);
let type;
if (index === 0) {
type = 2;
......@@ -757,23 +772,22 @@ const { isShow } = useContainerScroll(containerRef);
const hotBillList = ref([]); // 热门法案列表
const curHotBillListIndex = ref(0); // 当前热门法案索引
const carouselRef = ref(null);
const handleCarouselChange = (index) => {
curHotBillListIndex.value = index;
if (hotBillList.value && hotBillList.value.length > 0) {
curBill.value = hotBillList.value[index];
}
};
// 切换热门法案
const handleSwithCurBill = name => {
if (name === "left") {
if (curHotBillListIndex.value === 0) {
curHotBillListIndex.value = hotBillList.value.length - 1;
} else {
curHotBillListIndex.value--;
}
} else {
if (curHotBillListIndex.value === hotBillList.value.length - 1) {
curHotBillListIndex.value = 0;
carouselRef.value.prev();
} else {
curHotBillListIndex.value++;
}
carouselRef.value.next();
}
curBill.value = hotBillList.value[curHotBillListIndex.value];
};
// 当前法案
......@@ -788,9 +802,13 @@ const curBill = ref({
// 查看详情
const handleClickToDetail = () => {
// window.sessionStorage.setItem("billId", curBill.value.billId);
window.sessionStorage.setItem("billId", "119_HR_1");
// router.push("/billLayout");
window.sessionStorage.setItem("billId", curBill.value.billId);
const route = router.resolve("/billLayout");
window.open(route.href, "_blank");
};
// 查看详情 传递参数
const handleClickToDetailO = (item) => {
window.sessionStorage.setItem("billId", item.billId);
const route = router.resolve("/billLayout");
window.open(route.href, "_blank");
};
......@@ -1151,7 +1169,7 @@ const handleGetBills = async () => {
if (res.code === 200) {
if (res.data && res.data.content) {
bills.value = res.data.content.map(item => ({
// id: item.billId,
billId: item.billId,
name: item.billName,
eName: item.billNameEn,
tcr: item.personName,
......@@ -1459,6 +1477,7 @@ const handleBox8Data = async () => {
console.log("关键议员提案", res);
if (res.code === 200 && res.data) {
box8Data.value = res.data.map(item => ({
memberId: item.memberId,
name: item.memberName,
zhiwei: item.position,
img: item.imageUrl,
......@@ -1959,6 +1978,7 @@ onUnmounted(() => {});
justify-content: center;
align-items: center;
cursor: pointer;
z-index: 10;
.icon {
width: 11px;
height: 18px;
......@@ -1979,6 +1999,7 @@ onUnmounted(() => {});
justify-content: center;
align-items: center;
cursor: pointer;
z-index: 10;
.icon {
width: 11px;
height: 18px;
......@@ -2722,7 +2743,7 @@ onUnmounted(() => {});
}
.box5-select {
position: absolute;
top: 50px;
top: 53px;
left: 100px;
z-index: 100;
}
......
......@@ -6,12 +6,12 @@
<div class="layout-main-header-left-box">
<div class="left-box-top">
<div class="icon">
<img src="./assets/images/USA-logo.png" alt="" />
<img :src="billInfoGlobal.imageUrl || USALogo" alt="" />
</div>
<div class="info">
<div class="info-box1">{{ "H.R.1(119th)-大而美法案" }}</div>
<div class="info-box1">{{ billInfoGlobal.billName }}</div>
<div class="info-box2">
{{ "第119届美国国会众议院第1号法案 One Big Beautiful Bill Act" }}
{{ billInfoGlobal.description }} {{ billInfoGlobal.billNameEn }}
</div>
</div>
</div>
......@@ -35,8 +35,8 @@
</div>
<div class="layout-main-header-right-box">
<div class="right-box-top">
<div class="time">{{ "2025年7月" }}</div>
<div class="name">{{ "乔迪·阿灵顿(Jodey Arrington)​​ " }}</div>
<div class="time">{{ billInfoGlobal.introductionDate }}</div>
<div class="name">{{ billInfoGlobal.tarName }}</div>
</div>
<div class="right-box-bottom">
<!-- <el-button type="plain" size="large" icon="Search" @click="handleSwitchActiveName('法案原文')"
......@@ -135,6 +135,7 @@
<script setup>
import { ref, onMounted } from "vue";
import router from "@/router";
import { getBillInfoGlobal } from "@/api/bill";
import icon1 from "./assets/icons/icon1.png";
import icon1Active from "./assets/icons/icon1_active.png";
......@@ -144,9 +145,24 @@ import icon3 from "./assets/icons/icon3.png";
import icon3Active from "./assets/icons/icon3_active.png";
import icon4 from "./assets/icons/icon4.png";
import icon4Active from "./assets/icons/icon4_active.png";
import USALogo from "./assets/images/USA-logo.png";
const activeName = ref("分析报告");
// 获取法案全局信息
const billInfoGlobal = ref({});
const getBillInfoGlobalFn = async () => {
const res = await getBillInfoGlobal({
id: window.sessionStorage.getItem("billId")
});
if (res.code === 200) {
console.log("法案全局信息", res);
if (res.data) {
billInfoGlobal.value = res.data;
}
}
};
const handleSwitchActiveName = name => {
activeName.value = name;
};
......@@ -200,6 +216,7 @@ const handleClickMainHeaderBtn = item => {
};
onMounted(() => {
getBillInfoGlobalFn();
if (window.sessionStorage.getItem("activeTitle")) {
activeTitle.value = window.sessionStorage.getItem("activeTitle");
}
......@@ -377,7 +394,7 @@ onMounted(() => {
margin-left: 9px;
.info-box1 {
color: rgba(59, 65, 75, 1);
font-family: Microsoft YaHei;
font-family: "Microsoft YaHei";
font-size: 20px;
font-weight: 600;
line-height: 22px;
......@@ -387,16 +404,20 @@ onMounted(() => {
}
.info-box2 {
margin-top: 5px;
height: 22px;
// height: 22px;
line-height: 22px;
color: rgba(132, 136, 142, 1);
font-family: Microsoft YaHei;
font-family: "Microsoft YaHei";
font-size: 14px;
font-weight: 400;
line-height: 22px;
letter-spacing: 0px;
text-align: left;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
......
......@@ -1092,6 +1092,19 @@ onMounted(async () => {
.dialog-box1-main {
margin-top: 4px;
margin-left: 18px;
max-height: 120px;
overflow-y: auto;
&::-webkit-scrollbar {
width: 4px;
}
&::-webkit-scrollbar-thumb {
border-radius: 10px;
background: rgba(0, 0, 0, 0.2);
}
&::-webkit-scrollbar-track {
border-radius: 0;
background: rgba(0, 0, 0, 0.1);
}
.item {
display: flex;
.item-left {
......@@ -1107,13 +1120,16 @@ onMounted(async () => {
.item-right {
margin-top: 8px;
margin-left: 9px;
width: 420px;
width: 400px;
height: 22px;
color: rgba(132, 136, 142, 1);
font-family: Microsoft YaHei;
font-size: 14px;
font-weight: 400;
line-height: 22px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论