index.vue 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634
  1. <template>
  2. <div class="portal-home min-h-screen bg-[#eef3f9] text-[#17345f]">
  3. <Header />
  4. <main class="mx-auto max-w-[1400px] px-3 pb-8 pt-20">
  5. <section class="hero-banner overflow-hidden rounded-[6px] relative">
  6. <div class="">
  7. <!-- 轮播容器 -->
  8. <div class="carousel-container relative h-full">
  9. <!-- 轮播项 -->
  10. <div
  11. class="carousel-slide absolute inset-0 transition-opacity duration-500 ease-in-out"
  12. v-for="(slide, index) in slides"
  13. :key="index"
  14. v-show="currentIndex === index"
  15. :class="{
  16. 'opacity-100': currentIndex === index,
  17. 'opacity-0': currentIndex !== index,
  18. 'z-10': currentIndex === index,
  19. 'z-0 pointer-events-none': currentIndex !== index,
  20. }"
  21. >
  22. <div class="hero-copy carousel-caption">
  23. <div class="hero-script text-[68px] font-italic text-[#0c4eb5]">
  24. HELLO
  25. </div>
  26. <p class="hero-text mt-6 text-[24px] text-[#5f6f83]">
  27. {{ slide.text }}
  28. </p>
  29. </div>
  30. <!-- 轮播背景图 -->
  31. <div class="hero-visual absolute inset-0">
  32. <img
  33. :src="slide.image"
  34. alt="Banner"
  35. class="w-full h-full object-cover"
  36. />
  37. </div>
  38. </div>
  39. <!-- 指示器 -->
  40. <div
  41. class="carousel-indicators absolute bottom-4 left-1/2 z-30 flex transform -translate-x-1/2 space-x-2"
  42. >
  43. <span
  44. v-for="(_, i) in slides"
  45. :key="i"
  46. @click="currentIndex = i"
  47. :class="{
  48. 'bg-[#0c4eb5]': currentIndex === i,
  49. 'bg-[#2f333c]/50': currentIndex !== i,
  50. }"
  51. class="w-3 h-3 rounded-full transition-colors"
  52. ></span>
  53. </div>
  54. </div>
  55. </div>
  56. </section>
  57. <section class="portal-mobile-shortcuts mt-3 md:hidden!">
  58. <button
  59. type="button"
  60. class="portal-mobile-shortcut flex flex-col items-center justify-center cursor-pointer"
  61. @click="router.push('/flow')"
  62. >
  63. <img src="../assets//images/flow.png" alt="" class="w-10 h-10" />
  64. 流程门户
  65. </button>
  66. <button
  67. v-hasPermi="['portal:dashboard:view']"
  68. type="button"
  69. class="portal-mobile-shortcut flex flex-col items-center justify-center cursor-pointer"
  70. @click="router.push('/drive')"
  71. >
  72. <img src="../assets//images/driveicon.png" alt="" class="w-10 h-10" />
  73. 驾驶舱门户
  74. </button>
  75. <button
  76. type="button"
  77. class="portal-mobile-shortcut flex flex-col items-center justify-center cursor-pointer"
  78. >
  79. <img src="../assets//images/report.png" alt="" class="w-10 h-10" />
  80. 报表门户
  81. </button>
  82. </section>
  83. <section class="mt-3 grid gap-4 xl:grid-cols-[1.74fr_0.74fr] grid-cols-1">
  84. <div class="space-y-4">
  85. <article
  86. v-for="section in portalSections"
  87. :key="section.code"
  88. class="platform-block rounded-sm"
  89. :style="{ minHeight: section.height }"
  90. >
  91. <div class="platform-block__header">
  92. <div class="platform-block__title-wrap">
  93. <p class="platform-block__title">{{ section.title }}</p>
  94. <span class="platform-block__subtitle">{{
  95. section.subtitle
  96. }}</span>
  97. </div>
  98. <span class="platform-block__watermark">{{ section.code }}</span>
  99. </div>
  100. <div
  101. v-if="section.apps?.length"
  102. class="grid grid-cols-[repeat(2,minmax(0,1fr))] gap-2 p-6 px-3 md:px-6 md:grid-cols-[repeat(4,minmax(0,1fr))]"
  103. >
  104. <button
  105. v-for="(app, appIndex) in section.apps"
  106. :key="`${section.code}-${appIndex}-${app.label}`"
  107. type="button"
  108. :class="[
  109. 'platform-app',
  110. boldLabes.includes(app.label)
  111. ? 'platform-app--active'
  112. : 'platform-app--ghost',
  113. ]"
  114. @click="handlePortalAppClick(app)"
  115. >
  116. <span class="platform-app__icon">
  117. <img
  118. v-if="app.image"
  119. :src="app.image"
  120. :alt="app.label"
  121. class="h-7 w-7 object-contain rounded-md"
  122. />
  123. <Icon
  124. v-else
  125. :icon="app.icon || 'mdi:dots-grid'"
  126. class="text-[24px]"
  127. />
  128. </span>
  129. <span
  130. class="platform-app__label text-[#004098] md:text-sm text-[12px] text-left"
  131. >{{ app.label }}</span
  132. >
  133. </button>
  134. </div>
  135. </article>
  136. </div>
  137. <aside class="space-y-4">
  138. <section class="side-card side-card--notice rounded-md p-2">
  139. <div class="side-card__header w-[95%] ml-[8px]">
  140. <div class="notice-tabs">
  141. <button
  142. v-for="tab in noticeTabs"
  143. :key="tab.key"
  144. type="button"
  145. :class="[
  146. 'notice-tab',
  147. activeNoticeTab === tab.key ? 'notice-tab--active' : '',
  148. ]"
  149. @click="handleNoticeTabChange(tab.key)"
  150. >
  151. {{ tab.label }}
  152. </button>
  153. </div>
  154. <button type="button" class="side-card__more">
  155. <Icon
  156. icon="mdi:dots-horizontal"
  157. class="text-[22px]"
  158. @click="handleNoticeMoreClick"
  159. />
  160. </button>
  161. </div>
  162. <div class="space-y-2 p-2 pt-3">
  163. <div
  164. v-if="!userStore.getUser.username"
  165. class="flex h-full items-center justify-center"
  166. >
  167. <div class="text-[#8a9ab0] pt-5">登录后查看</div>
  168. </div>
  169. <div
  170. v-if="!currentNoticeList.length && userStore.getUser.username"
  171. class="flex h-[120px] items-center justify-center text-[#8a9ab0]"
  172. >
  173. 暂无数据
  174. </div>
  175. <article
  176. v-if="userStore.getUser.username"
  177. v-for="notice in currentNoticeList"
  178. :key="notice.id"
  179. class="notice-item cursor-pointer"
  180. @click="handleNoticeItemClick(notice)"
  181. >
  182. <div class="notice-item__desc">{{ notice.docsubject }}</div>
  183. <div class="date text-[12px] text-[#9cadc0]">
  184. {{ notice.docvaliddate }}
  185. </div>
  186. </article>
  187. </div>
  188. </section>
  189. <section
  190. class="side-card side-card--notice rounded-md p-2"
  191. :style="{ minHeight: '190px' }"
  192. >
  193. <div class="side-card__header w-[91%] ml-[15px]">
  194. <div class="notice-badge px-2">{{ todoPanelTitle }}</div>
  195. <button
  196. type="button"
  197. class="side-card__more"
  198. @click="router.push('/todo-list')"
  199. >
  200. 全部任务
  201. </button>
  202. </div>
  203. <div class="space-y-2 p-4 pt-2">
  204. <div
  205. v-if="!userStore.getUser.username"
  206. class="flex h-full items-center justify-center"
  207. >
  208. <div class="text-[#8a9ab0] pt-10">登录后查看</div>
  209. </div>
  210. <div
  211. v-if="!oaTasks.length && userStore.getUser.username"
  212. class="flex h-full items-center justify-center"
  213. >
  214. <div class="text-[#8a9ab0] pt-10">暂无待办</div>
  215. </div>
  216. <article
  217. v-if="userStore.getUser.username"
  218. v-for="task in oaTasks"
  219. :key="task.requestId"
  220. @click="handleTask(task)"
  221. class="todo-item rounded-md cursor-pointer"
  222. >
  223. <div class="flex min-w-0 items-start justify-between gap-3">
  224. <div class="min-w-0">
  225. <div
  226. class="truncate text-[14px] font-semibold text-[#0d4a9d]"
  227. >
  228. {{ task.requestName }}
  229. </div>
  230. <div class="mt-1 text-[12px] text-[#8a9ab0]">
  231. 创建人:{{ task.creatorName }} · {{ task.createTime }}
  232. </div>
  233. </div>
  234. <span
  235. :class="['todo-item__tag', getTagClass(task.requesLevel)]"
  236. >{{ getTagName(task.requesLevel) }}</span
  237. >
  238. </div>
  239. </article>
  240. </div>
  241. </section>
  242. <section
  243. class="side-card side-card--content p-2 rounded-md"
  244. :style="{ minHeight: '180px' }"
  245. >
  246. <div class="side-card__header w-[90%] ml-[15px]">
  247. <div class="notice-badge">{{ newsPanelTitle }}</div>
  248. <button type="button" class="side-card__more" @click="goNews">
  249. <Icon icon="mdi:dots-horizontal" class="text-[22px]" />
  250. </button>
  251. </div>
  252. <div class="space-y-2 p-4 pt-2">
  253. <div
  254. v-if="!userStore.getUser.username"
  255. class="flex h-full items-center justify-center"
  256. >
  257. <div class="text-[#8a9ab0] pt-10">登录后查看</div>
  258. </div>
  259. <div
  260. v-if="!newsList.length && userStore.getUser.username"
  261. class="flex h-full items-center justify-center"
  262. >
  263. <div class="text-[#8a9ab0] pt-10">暂无新闻</div>
  264. </div>
  265. <article
  266. v-for="news in newsList"
  267. :key="news.id"
  268. class="news-mini cursor-pointer rounded-md"
  269. @click="handleNoticeItemClick(news)"
  270. >
  271. <div class="min-w-0 flex-1">
  272. <div
  273. class="line-clamp-1 text-[13px] font-semibold leading-[1.45] text-[#41597d]"
  274. >
  275. {{ news.docsubject }}
  276. </div>
  277. <div class="mt-2 text-[12px] text-[#9cadc0]">
  278. {{ news.docvaliddate }}
  279. </div>
  280. </div>
  281. </article>
  282. </div>
  283. </section>
  284. <section
  285. v-if="userStore.getUser.username"
  286. class="side-card side-card--placeholder rounded-md"
  287. :style="{ minHeight: '78px', backgroundColor: '#3575e4' }"
  288. >
  289. <div class="placeholder-panel flex flex-col text-left">
  290. <!-- <div class="text-sm">需要帮助?</div> -->
  291. <div class="text-[10px]">遇到系统操作问题,需要帮助</div>
  292. <div
  293. class="bg-white text-sm text-center text-[#004098] py-1 px-2 rounded-full mt-2 w-[30%] cursor-pointer"
  294. @click="openConsult"
  295. >
  296. 立即咨询
  297. </div>
  298. </div>
  299. </section>
  300. </aside>
  301. </section>
  302. </main>
  303. <el-dialog v-model="dialogVisible" title="提示" width="500">
  304. <template #header="{ close, titleId, titleClass }">
  305. <div class="my-header">
  306. <h4 :id="titleId" class="flex gap-2 items-center">
  307. <Icon
  308. :icon="'si:warning-line'"
  309. color="#ef6c1a"
  310. size="16"
  311. class="text-[20px]"
  312. /><span class="text-black">提示</span>
  313. </h4>
  314. </div>
  315. </template>
  316. <span class="text-black">SRM系统尚未正式上线使用</span>
  317. <template #footer>
  318. <div class="dialog-footer">
  319. <el-button @click="dialogVisible = false">取消</el-button>
  320. <el-button type="primary" color="#063e8d" @click="confirmSrm">
  321. 继续访问
  322. </el-button>
  323. </div>
  324. </template>
  325. </el-dialog>
  326. <Footer />
  327. </div>
  328. </template>
  329. <script setup lang="ts">
  330. import { computed, onMounted, onUnmounted, reactive, ref } from "vue";
  331. import * as authUtil from "@/utils/auth";
  332. import * as dd from "dingtalk-jsapi";
  333. import Header from "@components/home/header.vue";
  334. import Footer from "@components/home/Footer.vue";
  335. import { useRouter } from "vue-router";
  336. import axios from "axios";
  337. import { Icon } from "@iconify/vue";
  338. import { ElLoading, ElMessageBox } from "element-plus";
  339. import {
  340. getMCSsoToken,
  341. ssoLogin,
  342. zentaoSsoLogin,
  343. getOATasks,
  344. getNotices,
  345. getRedHeadFiles,
  346. getNews,
  347. srmLogin,
  348. } from "@/api/user";
  349. import { useUserStore } from "@/stores/useUserStore";
  350. import { getAccessToken } from "@/utils/auth";
  351. import { deleteUserCache } from "@hooks/useCache";
  352. import { manualLogoutKey, reloginCancelKey } from "@/config/axios/service";
  353. import banner1 from "@/assets/images/banner1.png";
  354. import banner2 from "@/assets/images/banner2.jpg";
  355. import banner3 from "@/assets/images/banner3.jpg";
  356. import oaimage from "@/assets/images/oa.jpg";
  357. import crmimage from "@/assets/images/crm.jpg";
  358. import ehrimage from "@/assets/images/ehr.jpg";
  359. import scmimage from "@/assets/images/scm.png";
  360. import erpimage from "@/assets/images/fm.jpg";
  361. import driveimage from "@/assets/images/drive.jpg";
  362. import pmsimage from "@/assets/images/pms.jpeg";
  363. import zhonghangimage from "@/assets/images/中航.png";
  364. import lianyouimage from "@/assets/images/lianyou.jpeg";
  365. import qhseimage from "@/assets/images/qhse.jpg";
  366. import zuanjingimage from "@/assets/images/zuanjing.jpeg";
  367. import yalieimage from "@/assets/images/yalie.png";
  368. import zhuqiimage from "@/assets/images/zhuqi.png";
  369. import pmimage from "@/assets/images/pm.jpg";
  370. import dataimage from "@/assets/images/data.jpg";
  371. import thinkimage from "@/assets/images/think.jpg";
  372. import aiimage from "@/assets/images/ai.png";
  373. import agentimage from "@/assets/images/agent.jpeg";
  374. import videoimage from "@/assets/images/video.png";
  375. import fileagent from "@/assets/images/fileagent.png";
  376. import zhiduagent from "@/assets/images/zhiduagent.png";
  377. import jishuimage2 from "@/assets/images/jishuimage.png";
  378. import zhanlueimage from "@/assets/images/zhanlue.jpg"; // 战略解码
  379. import safeimage from "@/assets/images/safe.png"; // 安全合规管理
  380. import zuzhiimage from "@/assets/images/zuzhi.jpg";
  381. import youimage from "@/assets/images/youcnag.png"; // ai智能体
  382. import hongpan from "@/assets/images/鸿盘.jpg"; // ai智能体
  383. type PortalApp = {
  384. label: string;
  385. icon?: string;
  386. image?: string;
  387. active?: boolean;
  388. };
  389. type PortalSection = {
  390. code: string;
  391. title: string;
  392. subtitle: string;
  393. height: string;
  394. apps?: PortalApp[];
  395. };
  396. type NoticeItem = {
  397. id?: string | number;
  398. title?: string;
  399. desc?: string;
  400. docsubject?: string;
  401. };
  402. const router = useRouter();
  403. const userStore = useUserStore();
  404. const todoPanelTitle = "待办中心";
  405. const newsPanelTitle = "新闻中心";
  406. const noticeTabs = [
  407. { key: "redHead", label: "红头文件" },
  408. { key: "notice", label: "通知公告" },
  409. ] as const;
  410. type NoticeTabKey = (typeof noticeTabs)[number]["key"];
  411. const portalSections: PortalSection[] = [
  412. {
  413. code: "数",
  414. title: "数字化运营平台",
  415. subtitle: "高效协同 · 战略洞察",
  416. height: "220px",
  417. apps: [
  418. {
  419. label: "OA办公",
  420. image: oaimage,
  421. active: true,
  422. },
  423. { label: "客户管理(CRM)", image: crmimage },
  424. { label: "人力资源(EHR)", image: ehrimage },
  425. { label: "供应商管理(SRM)", image: scmimage },
  426. { label: "经营驾驶舱(MC)", image: driveimage },
  427. { label: "项目管理(PM)", image: pmimage },
  428. { label: "开发需求管理", image: jishuimage2 },
  429. { label: "鸿盘", image: hongpan },
  430. { label: "财务管理(FM)", image: erpimage },
  431. { label: "技术研发管理(R&D)", image: jishuimage2 },
  432. { label: "战略解码与执行", image: zhanlueimage },
  433. { label: "组织资产管理", image: zuzhiimage },
  434. { label: "风控合规管理", image: safeimage },
  435. ],
  436. },
  437. {
  438. code: "智",
  439. title: "智慧指挥平台",
  440. subtitle: "高效协同 · 战略洞察",
  441. height: "210px",
  442. apps: [
  443. { label: "设备管理(PMS)", image: pmsimage, active: true },
  444. { label: "中航北斗", image: zhonghangimage },
  445. { label: "质量安全管理(QHSE)", image: qhseimage },
  446. { label: "智慧连油", image: lianyouimage },
  447. { label: "智慧注气", image: zhuqiimage },
  448. { label: "视频中心(VCS)", image: videoimage },
  449. { label: "智能钻井", image: zuanjingimage },
  450. { label: "智慧压裂", image: yalieimage },
  451. { label: "数字油藏", image: youimage },
  452. ],
  453. },
  454. {
  455. code: "AI",
  456. title: "Chat BI平台",
  457. subtitle: "高效协同 · 战略洞察",
  458. height: "160px",
  459. apps: [
  460. { label: "全局数据治理(数据中台)", image: dataimage, active: true },
  461. { label: "智能决策", image: thinkimage },
  462. { label: "行业AI大模型", image: aiimage },
  463. { label: "AI智能体(智能交互)", image: agentimage },
  464. { label: "工艺文件智能体", image: fileagent },
  465. { label: "集团制度智能体", image: zhiduagent },
  466. ],
  467. },
  468. ];
  469. let boldLabes = ref([
  470. "OA办公",
  471. "客户管理(CRM)",
  472. "设备管理(PMS)",
  473. "中航北斗",
  474. "智慧连油",
  475. "质量安全管理(QHSE)",
  476. "智慧注气",
  477. "视频中心(VCS)",
  478. "开发需求管理",
  479. "经营驾驶舱(MC)",
  480. "项目管理(PM)",
  481. "鸿盘",
  482. "智能钻井",
  483. "供应商管理(SRM)",
  484. ]);
  485. const getGreeting = () => {
  486. const hour = new Date().getHours();
  487. if (hour < 12) return "早上好";
  488. if (hour < 18) return "下午好";
  489. return "晚上好";
  490. };
  491. // 添加轮播数据
  492. const slides = ref([
  493. {
  494. image: banner1,
  495. text: getGreeting() + ",保持热爱,奔赴目标!",
  496. },
  497. {
  498. image: banner2,
  499. text: "数字化转型,驱动未来增长",
  500. },
  501. {
  502. image: banner3,
  503. text: "智慧平台,赋能高效协同",
  504. },
  505. ]);
  506. // 当前索引
  507. const currentIndex = ref(0);
  508. let slideTimer: ReturnType<typeof setInterval> | null = null;
  509. // 下一页
  510. const nextSlide = () => {
  511. currentIndex.value = (currentIndex.value + 1) % slides.value.length;
  512. };
  513. const activeNoticeTab = ref<NoticeTabKey>("redHead");
  514. const noticeListMap = ref<Record<NoticeTabKey, NoticeItem[]>>({
  515. notice: [],
  516. redHead: [],
  517. });
  518. const newsList = ref([]);
  519. const currentNoticeList = computed(
  520. () => noticeListMap.value[activeNoticeTab.value] ?? [],
  521. );
  522. const loadHomeData = async () => {
  523. await loadNoticeList(activeNoticeTab.value);
  524. if (!userStore.getUser.username) return;
  525. const [oaRes, newsRes] = await Promise.all([
  526. getOATasks({
  527. id: userStore.getUser.username,
  528. pageNum: 1,
  529. pageSize: 10,
  530. }),
  531. getNews({
  532. pageNum: 1,
  533. pageSize: 10,
  534. }),
  535. ]);
  536. oaTasks.value = oaRes.todoList.slice(0, 3);
  537. newsList.value = newsRes.list.slice(0, 3);
  538. };
  539. const loadNoticeList = async (tabKey: NoticeTabKey) => {
  540. const requestApi = tabKey === "notice" ? getNotices : getRedHeadFiles;
  541. const res = await requestApi({
  542. pageNum: 1,
  543. pageSize: 10,
  544. });
  545. noticeListMap.value[tabKey] = (res?.list || []).slice(0, 3);
  546. };
  547. let currentTabKey = ref<NoticeTabKey>("redHead");
  548. const handleNoticeTabChange = async (tabKey: NoticeTabKey) => {
  549. activeNoticeTab.value = tabKey;
  550. currentTabKey.value = tabKey;
  551. // if (noticeListMap.value[tabKey].length) return;
  552. if (userStore.getUser.username) {
  553. await loadNoticeList(tabKey);
  554. }
  555. };
  556. const handleNoticeMoreClick = () => {
  557. router.push({
  558. path: "/notice-redhead",
  559. query: {
  560. tabKey: currentTabKey.value,
  561. },
  562. });
  563. };
  564. const protectedOpen = (url: string) => {
  565. if (userStore.getUser.username && getAccessToken()) {
  566. window.open(url, "_blank");
  567. } else {
  568. router.push({ path: "/login" });
  569. }
  570. };
  571. let dialogVisible = ref(false);
  572. const confirmSrm = async () => {
  573. dialogVisible.value = false;
  574. if (userStore.getUser.username && getAccessToken()) {
  575. const res = await srmLogin({
  576. username: userStore.getUser.username,
  577. });
  578. if (res) {
  579. window.open(
  580. `https://srmqas.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${JSON.parse(res).msg}`,
  581. "_blank",
  582. );
  583. }
  584. } else {
  585. router.push({ path: "/login" });
  586. }
  587. };
  588. const handlePortalAppClick = async (app: PortalApp) => {
  589. if (!app.label) return;
  590. if (app.label === "项目管理(PM)") {
  591. protectedOpen(
  592. `${import.meta.env.VITE_PMS_URL}/portalLogin?username=${userStore.getUser.username}&source=yyhy`,
  593. );
  594. }
  595. if (app.label === "OA办公") {
  596. if (userStore.getUser.username && getAccessToken()) {
  597. const res = await ssoLogin({ username: userStore.getUser.username });
  598. if (res) {
  599. window.open(
  600. `https://yfoa.keruioil.com/wui/index.html?ssoToken=${res}#/main`,
  601. "_blank",
  602. );
  603. }
  604. } else {
  605. router.push({ path: "/login" });
  606. }
  607. }
  608. if (app.label === "客户管理(CRM)") {
  609. protectedOpen(
  610. `https://crm-tencent.xiaoshouyi.com/global/sso/callback/00APEB9EEEA9B2E338B686B7ECFA8585808C.action?token=${getAccessToken()}`,
  611. );
  612. }
  613. if (app.label === "设备管理(PMS)") {
  614. protectedOpen(
  615. `${import.meta.env.VITE_PMS_URL}/portalLogin?username=${userStore.getUser.username}`,
  616. );
  617. }
  618. if (app.label === "中航北斗") {
  619. protectedOpen("https://zhbdgps.cn");
  620. }
  621. if (app.label === "智慧连油") {
  622. protectedOpen(
  623. `${import.meta.env.VITE_PMS_URL}/portalLogin?username=${userStore.getUser.username}&source=zhly`,
  624. );
  625. }
  626. if (app.label === "智慧注气") {
  627. protectedOpen(
  628. `${import.meta.env.VITE_PMS_URL}/portalLogin?username=${userStore.getUser.username}&source=znzq`,
  629. );
  630. }
  631. if (app.label === "视频中心(VCS)") {
  632. protectedOpen(
  633. `${import.meta.env.VITE_PMS_URL}/portalLogin?username=${userStore.getUser.username}&source=spzx`,
  634. );
  635. }
  636. if (app.label === "质量安全管理(QHSE)") {
  637. protectedOpen(
  638. `${import.meta.env.VITE_PMS_URL}/portalLogin?username=${userStore.getUser.username}&source=qhse`,
  639. );
  640. }
  641. if (app.label === "经营驾驶舱(MC)") {
  642. if (userStore.getUser.username && getAccessToken()) {
  643. const res = await getMCSsoToken();
  644. if (res) {
  645. window.open(
  646. `https://report.deepoil.cc/webroot/decision/v10/entry/access/9fb42908-894a-4373-a6be-ce046a42851d?preview=true&page_number=1&ssoToken=${res}`,
  647. "_blank",
  648. );
  649. }
  650. } else {
  651. router.push({ path: "/login" });
  652. }
  653. }
  654. if (app.label === "开发需求管理") {
  655. if (userStore.getUser.username && getAccessToken()) {
  656. const res = await zentaoSsoLogin({
  657. username: userStore.getUser.username,
  658. });
  659. if (res) {
  660. window.open(
  661. `http://project.deepoil.cc/zentao/api.php?m=user&f=apilogin&account=${res.jobNumber}&code=${res.code}&time=${res.timestamp}&token=${res.token}`,
  662. "_blank",
  663. );
  664. }
  665. } else {
  666. router.push({ path: "/login" });
  667. }
  668. }
  669. if (app.label === "供应商管理(SRM)") {
  670. // ElMessageBox.confirm("即将跳转到供应商管理系统,是否继续?", "提示", {
  671. // confirmButtonText: "继续",
  672. // cancelButtonText: "取消",
  673. // }).then(async () => {});
  674. dialogVisible.value = true;
  675. // if (userStore.getUser.username && getAccessToken()) {
  676. // const res = await srmLogin({
  677. // username: userStore.getUser.username,
  678. // });
  679. // if (res) {
  680. // window.open(
  681. // `https://srmqas.deepoil.cc/#/mixed-page/view/MXP00048?Authorization=${JSON.parse(res).msg}`,
  682. // "_blank",
  683. // );
  684. // }
  685. // } else {
  686. // router.push({ path: "/login" });
  687. // }
  688. }
  689. if (app.label === "智能钻井") {
  690. if (userStore.getUser.username && getAccessToken()) {
  691. window.open(`http://172.21.0.224:8001/#/login`, "_blank");
  692. } else {
  693. router.push({ path: "/login" });
  694. }
  695. }
  696. if (app.label === "鸿盘") {
  697. if (userStore.getUser.username && getAccessToken()) {
  698. window.open(`https://pan.keruioil.com:52180`, "_blank");
  699. } else {
  700. router.push({ path: "/login" });
  701. }
  702. }
  703. };
  704. async function loginWithDingTalk() {
  705. const ddCorpId = import.meta.env.VITE_DD_CORPID;
  706. const ddClientId = import.meta.env.VITE_DD_CLIENTID;
  707. if (!ddCorpId || !ddClientId) return false;
  708. return await new Promise<boolean>((resolve) => {
  709. dd.requestAuthCode({
  710. corpId: ddCorpId,
  711. clientId: ddClientId,
  712. success: async (res: any) => {
  713. try {
  714. const { code } = res;
  715. const response = await axios.post(
  716. import.meta.env.BASE_URL + "/admin-api/system/auth/h5SocialLogin",
  717. {
  718. code,
  719. type: 20,
  720. state: new Date().getTime(),
  721. },
  722. {
  723. headers: {
  724. "Content-Type": "application/json",
  725. "tenant-id": 1,
  726. },
  727. },
  728. );
  729. deleteUserCache();
  730. userStore.resetState();
  731. authUtil.setToken(response.data.data);
  732. sessionStorage.removeItem(manualLogoutKey);
  733. sessionStorage.removeItem(reloginCancelKey);
  734. await userStore.setUserInfoAction();
  735. resolve(true);
  736. } catch (error) {
  737. console.log("dingTalk login error :>> ", error);
  738. resolve(false);
  739. }
  740. },
  741. fail: (err: any) => {
  742. console.log("err :>> ", err);
  743. resolve(false);
  744. },
  745. });
  746. });
  747. }
  748. async function dingTalkAutoLogin() {
  749. const ua = window.navigator.userAgent.toLowerCase();
  750. if (
  751. (ua.includes("dingtalk") || ua.includes("dingtalkwork")) &&
  752. !userStore.getUser.username &&
  753. !getAccessToken()
  754. ) {
  755. return await loginWithDingTalk();
  756. }
  757. return false;
  758. }
  759. const getTagClass = (tag: string) => {
  760. return tag === "0"
  761. ? "bg-[#dbe8ff] text-[#3f74ff]"
  762. : tag === "1"
  763. ? "bg-[#ffe1e3] text-[#ff5d66]"
  764. : tag === "2"
  765. ? "bg-[#dfe8f3] text-[#6f7f94]"
  766. : "bg-[#dbe8ff] text-[#3f74ff]";
  767. };
  768. const getTagName = (tag: string) => {
  769. return tag === "0"
  770. ? "正常"
  771. : tag === "1"
  772. ? "重要"
  773. : tag === "2"
  774. ? "紧急"
  775. : "正常";
  776. };
  777. let oaTasks = ref([]);
  778. onMounted(async () => {
  779. slideTimer = setInterval(nextSlide, 5000);
  780. await dingTalkAutoLogin();
  781. await loadHomeData();
  782. });
  783. const handleNoticeItemClick = async (notice) => {
  784. const res = await ssoLogin({
  785. username: userStore.getUser.username,
  786. });
  787. if (res) {
  788. const ua = window.navigator.userAgent.toLowerCase();
  789. if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
  790. dd.biz.util.openLink({
  791. url:
  792. "https://yfoa.keruioil.com/wui/index.html" +
  793. "?ssoToken=" +
  794. res +
  795. "#/main", // 先跳你的 SSO 链接
  796. onSuccess: () => {
  797. // 延迟跳目标业务地址(和你原来 setTimeout 逻辑一致)
  798. setTimeout(() => {
  799. dd.biz.util.openLink({
  800. url: `https://yfoa.keruioil.com/spa/document/index.jsp?openAttachment=0&id=${notice.id}`,
  801. });
  802. }, 100);
  803. },
  804. });
  805. } else {
  806. const loading = ElLoading.service({
  807. lock: true,
  808. text: "正在跳转,请稍候...",
  809. background: "rgba(0, 0, 0, 0.7)",
  810. });
  811. const newTab = window.open("", "_blank");
  812. newTab.location.href =
  813. "https://yfoa.keruioil.com/wui/index.html" +
  814. "?ssoToken=" +
  815. res +
  816. "#/main";
  817. setTimeout(function () {
  818. newTab.location.href = `https://yfoa.keruioil.com/spa/document/index.jsp?openAttachment=0&id=${notice.id}`;
  819. setTimeout(() => {
  820. loading.close();
  821. }, 500);
  822. }, 100);
  823. }
  824. }
  825. };
  826. const handleTask = async (row) => {
  827. const res = await ssoLogin({
  828. username: userStore.getUser.username,
  829. });
  830. if (res) {
  831. const ua = window.navigator.userAgent.toLowerCase();
  832. if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
  833. dd.biz.util.openLink({
  834. url:
  835. "https://yfoa.keruioil.com/wui/index.html" +
  836. "?ssoToken=" +
  837. res +
  838. "#/main", // 先跳你的 SSO 链接
  839. onSuccess: () => {
  840. // 延迟跳目标业务地址(和你原来 setTimeout 逻辑一致)
  841. setTimeout(() => {
  842. dd.biz.util.openLink({
  843. url: `https://yfoa.keruioil.com/spa/workflow/static4form/index.html?_rdm=1776063595284#/main/workflow/req?requestid=${row.requestId}`,
  844. });
  845. }, 100);
  846. },
  847. });
  848. } else {
  849. const loading = ElLoading.service({
  850. lock: true,
  851. text: "正在跳转,请稍候...",
  852. background: "rgba(0, 0, 0, 0.7)",
  853. });
  854. const newTab = window.open("", "_blank");
  855. newTab.location.href =
  856. "https://yfoa.keruioil.com/wui/index.html" +
  857. "?ssoToken=" +
  858. res +
  859. "#/main";
  860. setTimeout(function () {
  861. newTab.location.href = `https://yfoa.keruioil.com/spa/workflow/static4form/index.html?_rdm=1776063595284#/main/workflow/req?requestid=${row.requestId}`;
  862. setTimeout(() => {
  863. loading.close();
  864. }, 500);
  865. }, 100);
  866. }
  867. }
  868. };
  869. const openConsult = async () => {
  870. const res = await ssoLogin({
  871. username: userStore.getUser.username,
  872. });
  873. if (res) {
  874. const ua = window.navigator.userAgent.toLowerCase();
  875. if (ua.includes("dingtalk") || ua.includes("dingtalkwork")) {
  876. dd.biz.util.openLink({
  877. url:
  878. "https://yfoa.keruioil.com/wui/index.html" +
  879. "?ssoToken=" +
  880. res +
  881. "#/main", // 先跳你的 SSO 链接
  882. onSuccess: () => {
  883. // 延迟跳目标业务地址(和你原来 setTimeout 逻辑一致)
  884. setTimeout(() => {
  885. dd.biz.util.openLink({
  886. url: `https://yfoa.keruioil.com/spa/workflow/static4form/index.html?_rdm=1778289187850#/main/workflow/req?iscreate=1&workflowid=488`,
  887. });
  888. }, 100);
  889. },
  890. });
  891. } else {
  892. const loading = ElLoading.service({
  893. lock: true,
  894. text: "正在跳转,请稍候...",
  895. background: "rgba(0, 0, 0, 0.7)",
  896. });
  897. const newTab = window.open("", "_blank");
  898. newTab.location.href =
  899. "https://yfoa.keruioil.com/wui/index.html" +
  900. "?ssoToken=" +
  901. res +
  902. "#/main";
  903. setTimeout(function () {
  904. newTab.location.href = `https://yfoa.keruioil.com/spa/workflow/static4form/index.html?_rdm=1778289187850#/main/workflow/req?iscreate=1&workflowid=488`;
  905. setTimeout(() => {
  906. loading.close();
  907. }, 500);
  908. }, 100);
  909. }
  910. }
  911. };
  912. const goNews = () => {
  913. router.push("/news");
  914. };
  915. onUnmounted(() => {
  916. if (slideTimer) {
  917. clearInterval(slideTimer);
  918. slideTimer = null;
  919. }
  920. });
  921. </script>
  922. <style scoped>
  923. .portal-home {
  924. --portal-blue: #2f6fdb;
  925. --portal-blue-dark: #1b57bc;
  926. --portal-blue-soft: #d7e7ff;
  927. --portal-panel: #deebfb;
  928. --portal-panel-soft: #edf5ff;
  929. --portal-line: #a8c4f2;
  930. background-color: #eef3f9;
  931. background-image: url("../assets//images/bg666.png");
  932. background-position: center bottom;
  933. background-repeat: no-repeat;
  934. background-size: 100% auto;
  935. background-attachment: fixed;
  936. }
  937. .hero-banner {
  938. position: relative;
  939. min-height: 220px;
  940. background: linear-gradient(
  941. 90deg,
  942. rgba(255, 255, 255, 0.96) 0%,
  943. rgba(241, 247, 255, 0.92) 36%,
  944. rgba(223, 237, 255, 0.95) 100%
  945. );
  946. box-shadow: 0 16px 34px rgba(59, 112, 190, 0.08);
  947. }
  948. .hero-banner::before {
  949. content: "";
  950. position: absolute;
  951. inset: 0;
  952. background:
  953. linear-gradient(140deg, rgba(206, 223, 247, 0.25) 0%, transparent 28%),
  954. radial-gradient(
  955. circle at 74% 24%,
  956. rgba(83, 146, 255, 0.14),
  957. transparent 18%
  958. ),
  959. radial-gradient(
  960. circle at 88% 16%,
  961. rgba(255, 255, 255, 0.94),
  962. transparent 14%
  963. );
  964. pointer-events: none;
  965. }
  966. .hero-banner__inner {
  967. position: relative;
  968. z-index: 1;
  969. display: grid;
  970. min-height: 220px;
  971. grid-template-columns: minmax(260px, 1fr) minmax(360px, 1.3fr);
  972. align-items: center;
  973. gap: 24px;
  974. padding: 22px 36px 18px 58px;
  975. }
  976. .hero-copy {
  977. /* padding-top: 10px; */
  978. }
  979. .hero-script {
  980. color: #0c4eb5;
  981. font-size: 68px;
  982. font-style: italic;
  983. font-weight: 500;
  984. letter-spacing: 0.04em;
  985. line-height: 1;
  986. font-family: "Comic Sans MS", "Segoe Script", cursive;
  987. }
  988. .hero-text {
  989. margin-top: 18px;
  990. color: #5f6f83;
  991. font-size: 24px;
  992. letter-spacing: 0.1em;
  993. }
  994. .hero-progress {
  995. margin-top: 48px;
  996. display: flex;
  997. align-items: center;
  998. gap: 12px;
  999. }
  1000. .hero-progress__active {
  1001. height: 4px;
  1002. width: 56px;
  1003. border-radius: 999px;
  1004. background: #1f67d1;
  1005. }
  1006. .hero-progress__line {
  1007. height: 3px;
  1008. width: 64px;
  1009. border-radius: 999px;
  1010. background: rgba(49, 113, 207, 0.18);
  1011. }
  1012. .hero-visual {
  1013. position: relative;
  1014. min-height: 180px;
  1015. }
  1016. .hero-orb,
  1017. .hero-cube,
  1018. .hero-ring {
  1019. position: absolute;
  1020. }
  1021. .hero-orb {
  1022. display: flex;
  1023. align-items: center;
  1024. justify-content: center;
  1025. border-radius: 28px;
  1026. background: linear-gradient(
  1027. 180deg,
  1028. rgba(255, 255, 255, 0.98),
  1029. rgba(226, 239, 255, 0.95)
  1030. );
  1031. color: #65a4ff;
  1032. box-shadow:
  1033. 0 18px 35px rgba(65, 122, 206, 0.14),
  1034. inset 0 1px 0 rgba(255, 255, 255, 0.88);
  1035. }
  1036. .hero-orb::after {
  1037. content: "";
  1038. position: absolute;
  1039. inset: auto 16px 10px;
  1040. height: 10px;
  1041. border-radius: 999px;
  1042. background: rgba(93, 154, 255, 0.12);
  1043. filter: blur(8px);
  1044. }
  1045. .hero-orb--cloud {
  1046. left: 10%;
  1047. top: 28px;
  1048. height: 106px;
  1049. width: 126px;
  1050. transform: rotate(-10deg);
  1051. }
  1052. .hero-orb--shield {
  1053. left: 46%;
  1054. top: 64px;
  1055. height: 118px;
  1056. width: 120px;
  1057. transform: rotate(8deg);
  1058. }
  1059. .hero-orb--chart {
  1060. right: 4%;
  1061. top: 0;
  1062. height: 138px;
  1063. width: 150px;
  1064. transform: rotate(6deg);
  1065. }
  1066. .hero-cube {
  1067. background: linear-gradient(
  1068. 180deg,
  1069. rgba(255, 255, 255, 0.94),
  1070. rgba(226, 239, 255, 0.9)
  1071. );
  1072. box-shadow: 0 18px 35px rgba(65, 122, 206, 0.1);
  1073. }
  1074. .hero-cube--one {
  1075. left: 26%;
  1076. top: -2px;
  1077. height: 46px;
  1078. width: 46px;
  1079. transform: rotate(36deg);
  1080. }
  1081. .hero-cube--two {
  1082. left: 33%;
  1083. top: 18px;
  1084. height: 34px;
  1085. width: 34px;
  1086. transform: rotate(32deg);
  1087. }
  1088. .hero-ring {
  1089. left: 13%;
  1090. top: 108px;
  1091. height: 42px;
  1092. width: 128px;
  1093. border-radius: 999px;
  1094. background: rgba(83, 146, 255, 0.1);
  1095. box-shadow: inset 0 0 0 10px rgba(238, 245, 255, 0.72);
  1096. }
  1097. .platform-block {
  1098. overflow: hidden;
  1099. background: linear-gradient(180deg, #dce9fb 0%, #d9e8fb 100%);
  1100. box-shadow: 0 12px 28px rgba(58, 110, 187, 0.08);
  1101. }
  1102. .platform-block__header {
  1103. display: flex;
  1104. align-items: center;
  1105. justify-content: space-between;
  1106. min-height: 44px;
  1107. padding: 0 24px 0 34px;
  1108. background: linear-gradient(90deg, #316fd8 0%, #82aef0 100%);
  1109. }
  1110. .platform-block__title-wrap {
  1111. display: flex;
  1112. align-items: baseline;
  1113. gap: 28px;
  1114. min-width: 0;
  1115. }
  1116. .platform-block__title {
  1117. color: #fff;
  1118. font-size: 18px;
  1119. min-width: 0;
  1120. flex: 0 1 auto;
  1121. white-space: nowrap;
  1122. overflow: hidden;
  1123. text-overflow: ellipsis;
  1124. letter-spacing: 0.03em;
  1125. }
  1126. .platform-block__subtitle {
  1127. color: rgba(255, 255, 255, 0.95);
  1128. font-size: 13px;
  1129. font-weight: 600;
  1130. flex: 0 0 auto;
  1131. white-space: nowrap;
  1132. }
  1133. .platform-block__watermark {
  1134. color: rgba(255, 255, 255, 0.4);
  1135. font-size: 44px;
  1136. font-weight: 800;
  1137. line-height: 1;
  1138. letter-spacing: 0.04em;
  1139. }
  1140. .platform-app {
  1141. display: flex;
  1142. width: 100%;
  1143. min-width: 0;
  1144. min-height: 34px;
  1145. align-items: center;
  1146. justify-content: flex-start;
  1147. gap: 5px;
  1148. border-radius: 8px;
  1149. padding: 0 5px;
  1150. font-size: 14px;
  1151. cursor: pointer;
  1152. transition:
  1153. transform 0.2s ease,
  1154. box-shadow 0.2s ease,
  1155. background 0.2s ease;
  1156. }
  1157. .platform-app:hover {
  1158. transform: translateY(-1px);
  1159. }
  1160. .platform-app--active {
  1161. background: rgba(255, 255, 255, 0.66);
  1162. font-weight: bold;
  1163. }
  1164. .platform-app--ghost {
  1165. background: rgba(255, 255, 255, 0.66);
  1166. color: #53719b;
  1167. }
  1168. .platform-app__icon {
  1169. display: inline-flex;
  1170. align-items: center;
  1171. justify-content: center;
  1172. color: currentColor;
  1173. }
  1174. .platform-app__label {
  1175. min-width: 0;
  1176. flex: 1;
  1177. white-space: nowrap;
  1178. overflow: hidden;
  1179. text-overflow: ellipsis;
  1180. }
  1181. .portal-mobile-shortcuts {
  1182. display: grid;
  1183. grid-template-columns: repeat(3, minmax(0, 1fr));
  1184. gap: 8px;
  1185. }
  1186. .portal-mobile-shortcut {
  1187. min-width: 0;
  1188. border: 0;
  1189. border-radius: 10px;
  1190. padding: 10px 8px;
  1191. background: linear-gradient(180deg, #ffffff 0%, #5b90e4 100%);
  1192. color: #0d4a9d;
  1193. font-size: 13px;
  1194. font-weight: 600;
  1195. box-shadow: 0 6px 16px rgba(58, 110, 187, 0.08);
  1196. }
  1197. .side-card {
  1198. overflow: hidden;
  1199. background: #e8f1f8;
  1200. /* box-shadow: 0 12px 28px rgba(58, 110, 187, 0.06); */
  1201. }
  1202. .side-card--content {
  1203. padding-top: 10px;
  1204. }
  1205. .side-card__header {
  1206. display: flex;
  1207. align-items: center;
  1208. justify-content: space-between;
  1209. min-height: 20px;
  1210. padding-right: 10px;
  1211. border-radius: 100px;
  1212. background: #d5e6fc;
  1213. }
  1214. .notice-badge {
  1215. position: relative;
  1216. display: inline-flex;
  1217. align-items: center;
  1218. justify-content: center;
  1219. height: 25px;
  1220. min-width: 70px;
  1221. /* padding: 0 5px 0 10px; */
  1222. background: #004098;
  1223. color: #fff;
  1224. font-size: 14px;
  1225. font-weight: bold;
  1226. border-radius: 100px;
  1227. }
  1228. .notice-tabs {
  1229. display: inline-flex;
  1230. align-items: center;
  1231. gap: 8px;
  1232. }
  1233. .notice-tab {
  1234. height: 25px;
  1235. min-width: 68px;
  1236. padding: 0 14px;
  1237. border: 0;
  1238. border-radius: 999px;
  1239. background: transparent;
  1240. color: #4d6f98;
  1241. font-size: 14px;
  1242. font-weight: 700;
  1243. cursor: pointer;
  1244. transition:
  1245. background 0.2s ease,
  1246. color 0.2s ease;
  1247. }
  1248. .notice-tab--active {
  1249. background: #004098;
  1250. color: #fff;
  1251. }
  1252. .notice-badge::after {
  1253. content: "";
  1254. position: absolute;
  1255. top: 0;
  1256. right: -15px;
  1257. }
  1258. .side-card__more {
  1259. display: inline-flex;
  1260. align-items: center;
  1261. justify-content: center;
  1262. border: 0;
  1263. background: transparent;
  1264. color: #0f53b4;
  1265. cursor: pointer;
  1266. font-size: 12px;
  1267. }
  1268. .notice-item {
  1269. background: #fff;
  1270. padding: 8px 14px;
  1271. box-shadow: 0 8px 22px rgba(63, 107, 169, 0.06);
  1272. border-radius: 10px;
  1273. }
  1274. .notice-item:hover {
  1275. box-shadow: 0 12px 28px rgba(63, 107, 169, 0.1);
  1276. transition: all 0.2s ease;
  1277. transform: translateY(-1px);
  1278. }
  1279. .notice-item__title,
  1280. .notice-item__desc {
  1281. color: #507698;
  1282. font-size: 13px;
  1283. line-height: 1.5;
  1284. display: -webkit-box;
  1285. -webkit-box-orient: vertical;
  1286. -webkit-line-clamp: 1;
  1287. overflow: hidden;
  1288. }
  1289. .panel-title {
  1290. padding: 0 16px;
  1291. color: #2f4d79;
  1292. font-size: 15px;
  1293. font-weight: 700;
  1294. }
  1295. .todo-item {
  1296. background: rgba(255, 255, 255, 0.88);
  1297. padding: 8px 14px;
  1298. box-shadow: 0 8px 22px rgba(63, 107, 169, 0.05);
  1299. }
  1300. .todo-item__tag {
  1301. display: inline-flex;
  1302. align-items: center;
  1303. border-radius: 999px;
  1304. padding: 2px 8px;
  1305. font-size: 11px;
  1306. font-weight: 600;
  1307. white-space: nowrap;
  1308. }
  1309. .news-mini {
  1310. display: flex;
  1311. align-items: center;
  1312. gap: 12px;
  1313. background: rgba(255, 255, 255, 0.88);
  1314. padding: 5px 12px;
  1315. box-shadow: 0 8px 22px rgba(63, 107, 169, 0.05);
  1316. border: none;
  1317. }
  1318. .news-mini:hover {
  1319. box-shadow: 0 12px 28px rgba(63, 107, 169, 0.1);
  1320. transition: all 0.2s ease;
  1321. transform: translateY(-1px);
  1322. }
  1323. .placeholder-panel {
  1324. display: flex;
  1325. height: 100%;
  1326. /* align-items: center; */
  1327. padding: 16px;
  1328. justify-content: start;
  1329. color: #fff;
  1330. font-size: 16px;
  1331. font-weight: 600;
  1332. letter-spacing: 0.08em;
  1333. }
  1334. @media (max-width: 1279px) {
  1335. .hero-banner__inner {
  1336. grid-template-columns: 1fr;
  1337. padding: 28px 28px 20px;
  1338. }
  1339. .hero-script {
  1340. font-size: 52px;
  1341. }
  1342. .hero-text {
  1343. font-size: 18px;
  1344. }
  1345. .hero-progress {
  1346. margin-top: 28px;
  1347. }
  1348. .hero-visual {
  1349. min-height: 220px;
  1350. }
  1351. }
  1352. @media (max-width: 767px) {
  1353. .platform-block__header {
  1354. padding: 0 16px 0 18px;
  1355. }
  1356. .platform-block__title-wrap {
  1357. gap: 12px;
  1358. flex-wrap: wrap;
  1359. }
  1360. .platform-block__title {
  1361. font-size: 16px;
  1362. }
  1363. .platform-block__subtitle {
  1364. font-size: 12px;
  1365. }
  1366. .platform-block__watermark {
  1367. font-size: 34px;
  1368. }
  1369. .hero-banner__inner {
  1370. padding: 24px 18px 20px;
  1371. }
  1372. .hero-script {
  1373. font-size: 44px;
  1374. }
  1375. .hero-progress {
  1376. margin-top: 22px;
  1377. }
  1378. }
  1379. .carousel-container {
  1380. position: relative;
  1381. height: 220px;
  1382. overflow: hidden;
  1383. }
  1384. .carousel-slide {
  1385. position: relative;
  1386. background-size: cover;
  1387. background-position: center;
  1388. }
  1389. .hero-visual img {
  1390. width: 100%;
  1391. height: 100%;
  1392. object-fit: cover;
  1393. }
  1394. .carousel-caption {
  1395. position: absolute;
  1396. left: 40px;
  1397. top: 40%;
  1398. z-index: 2;
  1399. transform: translateY(-50%);
  1400. text-align: left;
  1401. }
  1402. .carousel-indicators {
  1403. display: flex;
  1404. gap: 8px;
  1405. z-index: 30;
  1406. }
  1407. .carousel-indicators button {
  1408. width: 12px;
  1409. height: 12px;
  1410. border-radius: 50%;
  1411. cursor: pointer;
  1412. transition: all 0.3s ease;
  1413. box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
  1414. }
  1415. .carousel-container {
  1416. position: relative;
  1417. /* 确保容器在移动端有合适的高度,或者使用 aspect-ratio */
  1418. height: 220px;
  1419. width: 100%;
  1420. overflow: hidden;
  1421. }
  1422. .carousel-slide {
  1423. position: absolute;
  1424. inset: 0; /* 确保填满父容器 */
  1425. width: 100%;
  1426. height: 100%;
  1427. }
  1428. .hero-visual {
  1429. position: absolute;
  1430. inset: 0; /* 关键:让背景层填满整个 slide */
  1431. width: 100%;
  1432. height: 100%;
  1433. }
  1434. .hero-visual img {
  1435. width: 100%;
  1436. height: 100%;
  1437. /* 关键修改:使用 cover 确保图片填满容器且不留白,即使部分被裁剪 */
  1438. object-fit: cover;
  1439. /* 如果希望完整显示图片但可能有留白,改用 object-fit: contain; 但通常 banner 推荐 cover */
  1440. display: block; /* 消除 img 默认的底部间隙 */
  1441. }
  1442. /* 移动端适配优化 */
  1443. @media (max-width: 768px) {
  1444. .carousel-container {
  1445. /* 移动端可以适当减小高度,或者保持比例 */
  1446. height: 220px;
  1447. }
  1448. .carousel-caption {
  1449. /* 移动端调整文字位置,避免遮挡图片或超出屏幕 */
  1450. left: 20px;
  1451. right: 20px;
  1452. top: 50%;
  1453. transform: translateY(-50%);
  1454. text-align: center; /* 移动端居中通常更好看 */
  1455. }
  1456. .hero-script {
  1457. font-size: 40px; /* 适当减小字体 */
  1458. }
  1459. .hero-text {
  1460. font-size: 16px;
  1461. margin-top: 10px;
  1462. }
  1463. }
  1464. </style>