|
|
@@ -129,23 +129,39 @@
|
|
|
</button>
|
|
|
</div>
|
|
|
<button type="button" class="side-card__more">
|
|
|
- <Icon icon="mdi:dots-horizontal" class="text-[22px]" />
|
|
|
+ <Icon
|
|
|
+ icon="mdi:dots-horizontal"
|
|
|
+ class="text-[22px]"
|
|
|
+ @click="handleNoticeMoreClick"
|
|
|
+ />
|
|
|
</button>
|
|
|
</div>
|
|
|
|
|
|
<div class="space-y-2 p-2 pt-3">
|
|
|
<div
|
|
|
- v-if="!currentNoticeList.length"
|
|
|
+ v-if="!userStore.getUser.username"
|
|
|
+ class="flex h-full items-center justify-center"
|
|
|
+ >
|
|
|
+ <div class="text-[#8a9ab0] pt-5">登录后查看</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-if="!currentNoticeList.length && userStore.getUser.username"
|
|
|
class="flex h-[120px] items-center justify-center text-[#8a9ab0]"
|
|
|
>
|
|
|
暂无数据
|
|
|
</div>
|
|
|
<article
|
|
|
+ v-if="userStore.getUser.username"
|
|
|
v-for="notice in currentNoticeList"
|
|
|
:key="notice.id"
|
|
|
class="notice-item cursor-pointer"
|
|
|
+ @click="handleNoticeItemClick(notice)"
|
|
|
>
|
|
|
<div class="notice-item__desc">{{ notice.docsubject }}</div>
|
|
|
+ <div class="date text-[12px] text-[#9cadc0]">
|
|
|
+ {{ notice.docvaliddate }}
|
|
|
+ </div>
|
|
|
</article>
|
|
|
</div>
|
|
|
</section>
|
|
|
@@ -176,7 +192,7 @@
|
|
|
v-if="!oaTasks.length && userStore.getUser.username"
|
|
|
class="flex h-full items-center justify-center"
|
|
|
>
|
|
|
- <div class="text-[#8a9ab0]">暂无数据</div>
|
|
|
+ <div class="text-[#8a9ab0] pt-10">暂无待办</div>
|
|
|
</div>
|
|
|
|
|
|
<article
|
|
|
@@ -212,29 +228,38 @@
|
|
|
>
|
|
|
<div class="side-card__header w-[90%] ml-[15px]">
|
|
|
<div class="notice-badge">{{ newsPanelTitle }}</div>
|
|
|
- <button type="button" class="side-card__more">
|
|
|
+ <button type="button" class="side-card__more" @click="goNews">
|
|
|
<Icon icon="mdi:dots-horizontal" class="text-[22px]" />
|
|
|
</button>
|
|
|
</div>
|
|
|
<div class="space-y-2 p-4 pt-2">
|
|
|
+ <div
|
|
|
+ v-if="!userStore.getUser.username"
|
|
|
+ class="flex h-full items-center justify-center"
|
|
|
+ >
|
|
|
+ <div class="text-[#8a9ab0] pt-10">登录后查看</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div
|
|
|
+ v-if="!newsList.length && userStore.getUser.username"
|
|
|
+ class="flex h-full items-center justify-center"
|
|
|
+ >
|
|
|
+ <div class="text-[#8a9ab0] pt-10">暂无新闻</div>
|
|
|
+ </div>
|
|
|
<article
|
|
|
v-for="news in newsList"
|
|
|
- :key="news.title"
|
|
|
+ :key="news.id"
|
|
|
class="news-mini cursor-pointer rounded-md"
|
|
|
+ @click="handleNoticeItemClick(news)"
|
|
|
>
|
|
|
- <img
|
|
|
- :src="news.image"
|
|
|
- :alt="news.title"
|
|
|
- class="h-[34px] w-[52px] rounded-[8px] object-cover"
|
|
|
- />
|
|
|
<div class="min-w-0 flex-1">
|
|
|
<div
|
|
|
- class="line-clamp-2 text-[13px] font-semibold leading-[1.45] text-[#41597d]"
|
|
|
+ class="line-clamp-1 text-[13px] font-semibold leading-[1.45] text-[#41597d]"
|
|
|
>
|
|
|
- {{ news.title }}
|
|
|
+ {{ news.docsubject }}
|
|
|
</div>
|
|
|
<div class="mt-2 text-[12px] text-[#9cadc0]">
|
|
|
- {{ news.date }}
|
|
|
+ {{ news.docvaliddate }}
|
|
|
</div>
|
|
|
</div>
|
|
|
</article>
|
|
|
@@ -282,6 +307,7 @@ import {
|
|
|
getOATasks,
|
|
|
getNotices,
|
|
|
getRedHeadFiles,
|
|
|
+ getNews,
|
|
|
} from "@/api/user";
|
|
|
import { useUserStore } from "@/stores/useUserStore";
|
|
|
import { getAccessToken } from "@/utils/auth";
|
|
|
@@ -339,28 +365,9 @@ type NoticeItem = {
|
|
|
docsubject?: string;
|
|
|
};
|
|
|
|
|
|
-type SidePanel = {
|
|
|
- title: string;
|
|
|
- height: string;
|
|
|
-};
|
|
|
-
|
|
|
-type TodoTask = {
|
|
|
- title: string;
|
|
|
- meta: string;
|
|
|
- tag: string;
|
|
|
- tagClass: string;
|
|
|
-};
|
|
|
-
|
|
|
-type NewsItem = {
|
|
|
- title: string;
|
|
|
- date: string;
|
|
|
- image: string;
|
|
|
-};
|
|
|
-
|
|
|
const router = useRouter();
|
|
|
const userStore = useUserStore();
|
|
|
|
|
|
-const noticeLabel = "公告";
|
|
|
const todoPanelTitle = "待办中心";
|
|
|
const newsPanelTitle = "新闻";
|
|
|
const noticeTabs = [
|
|
|
@@ -482,23 +489,7 @@ const noticeListMap = ref<Record<NoticeTabKey, NoticeItem[]>>({
|
|
|
redHead: [],
|
|
|
});
|
|
|
|
|
|
-const newsList: NewsItem[] = [
|
|
|
- {
|
|
|
- title: "科瑞石油成功交付首套自动化钻机",
|
|
|
- date: "2026-04-18",
|
|
|
- image: banner1,
|
|
|
- },
|
|
|
- {
|
|
|
- title: "DeepOil 智慧平台荣获行业创新奖",
|
|
|
- date: "2026-04-15",
|
|
|
- image: banner2,
|
|
|
- },
|
|
|
- {
|
|
|
- title: "数字人才培养“扬帆计划”正式启动",
|
|
|
- date: "2026-04-12",
|
|
|
- image: img3,
|
|
|
- },
|
|
|
-];
|
|
|
+const newsList = ref([]);
|
|
|
|
|
|
const currentNoticeList = computed(
|
|
|
() => noticeListMap.value[activeNoticeTab.value] ?? [],
|
|
|
@@ -514,12 +505,25 @@ const loadNoticeList = async (tabKey: NoticeTabKey) => {
|
|
|
noticeListMap.value[tabKey] = (res?.list || []).slice(0, 3);
|
|
|
};
|
|
|
|
|
|
+let currentTabKey = ref<NoticeTabKey>("notice");
|
|
|
const handleNoticeTabChange = async (tabKey: NoticeTabKey) => {
|
|
|
activeNoticeTab.value = tabKey;
|
|
|
+ currentTabKey.value = tabKey;
|
|
|
|
|
|
- if (noticeListMap.value[tabKey].length) return;
|
|
|
+ // if (noticeListMap.value[tabKey].length) return;
|
|
|
|
|
|
- await loadNoticeList(tabKey);
|
|
|
+ if (userStore.getUser.username) {
|
|
|
+ await loadNoticeList(tabKey);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const handleNoticeMoreClick = () => {
|
|
|
+ router.push({
|
|
|
+ path: "/notice-redhead",
|
|
|
+ query: {
|
|
|
+ tabKey: currentTabKey.value,
|
|
|
+ },
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const protectedOpen = (url: string) => {
|
|
|
@@ -715,11 +719,64 @@ onMounted(async () => {
|
|
|
pageSize: 10,
|
|
|
});
|
|
|
oaTasks.value = res.todoList.slice(0, 3);
|
|
|
+
|
|
|
+ const newList = await getNews({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ });
|
|
|
+
|
|
|
+ newsList.value = newList.list.slice(0, 3);
|
|
|
} finally {
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+const handleNoticeItemClick = async (notice) => {
|
|
|
+ const res = await ssoLogin({
|
|
|
+ username: userStore.getUser.username,
|
|
|
+ });
|
|
|
+
|
|
|
+ if (res) {
|
|
|
+ const ua = window.navigator.userAgent.toLowerCase();
|
|
|
+ if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
|
|
|
+ dd.biz.util.openLink({
|
|
|
+ url:
|
|
|
+ "https://yfoa.keruioil.com/wui/index.html" +
|
|
|
+ "?ssoToken=" +
|
|
|
+ res +
|
|
|
+ "#/main", // 先跳你的 SSO 链接
|
|
|
+ onSuccess: () => {
|
|
|
+ // 延迟跳目标业务地址(和你原来 setTimeout 逻辑一致)
|
|
|
+ setTimeout(() => {
|
|
|
+ dd.biz.util.openLink({
|
|
|
+ url: `https://yfoa.keruioil.com/spa/document/index.jsp?openAttachment=0&id=${notice.id}`,
|
|
|
+ });
|
|
|
+ }, 100);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ const loading = ElLoading.service({
|
|
|
+ lock: true,
|
|
|
+ text: "正在跳转,请稍候...",
|
|
|
+ background: "rgba(0, 0, 0, 0.7)",
|
|
|
+ });
|
|
|
+ const newTab = window.open("", "_blank");
|
|
|
+ newTab.location.href =
|
|
|
+ "https://yfoa.keruioil.com/wui/index.html" +
|
|
|
+ "?ssoToken=" +
|
|
|
+ res +
|
|
|
+ "#/main";
|
|
|
+
|
|
|
+ setTimeout(function () {
|
|
|
+ newTab.location.href = `https://yfoa.keruioil.com/spa/document/index.jsp?openAttachment=0&id=${notice.id}`;
|
|
|
+ setTimeout(() => {
|
|
|
+ loading.close();
|
|
|
+ }, 500);
|
|
|
+ }, 100);
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
const handleTask = async (row) => {
|
|
|
const res = await ssoLogin({
|
|
|
username: userStore.getUser.username,
|
|
|
@@ -766,6 +823,10 @@ const handleTask = async (row) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const goNews = () => {
|
|
|
+ router.push("/news");
|
|
|
+};
|
|
|
+
|
|
|
onUnmounted(() => {
|
|
|
if (slideTimer) {
|
|
|
clearInterval(slideTimer);
|
|
|
@@ -1139,11 +1200,21 @@ onUnmounted(() => {
|
|
|
border-radius: 10px;
|
|
|
}
|
|
|
|
|
|
+.notice-item:hover {
|
|
|
+ box-shadow: 0 12px 28px rgba(63, 107, 169, 0.1);
|
|
|
+ transition: all 0.2s ease;
|
|
|
+ transform: translateY(-1px);
|
|
|
+}
|
|
|
+
|
|
|
.notice-item__title,
|
|
|
.notice-item__desc {
|
|
|
color: #507698;
|
|
|
font-size: 13px;
|
|
|
line-height: 1.5;
|
|
|
+ display: -webkit-box;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+ -webkit-line-clamp: 1;
|
|
|
+ overflow: hidden;
|
|
|
}
|
|
|
|
|
|
.panel-title {
|
|
|
@@ -1179,6 +1250,12 @@ onUnmounted(() => {
|
|
|
border: none;
|
|
|
}
|
|
|
|
|
|
+.news-mini:hover {
|
|
|
+ box-shadow: 0 12px 28px rgba(63, 107, 169, 0.1);
|
|
|
+ transition: all 0.2s ease;
|
|
|
+ transform: translateY(-1px);
|
|
|
+}
|
|
|
+
|
|
|
.placeholder-panel {
|
|
|
display: flex;
|
|
|
height: 100%;
|