index.vue 34 KB

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