123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452 |
- <script setup>
- import { ref, onMounted, onUnmounted } from "vue";
- import autofit from 'autofit.js';
- import dayjs from 'dayjs';
- import WaterYield from "./components/WaterYield";
- import WaterQuality from "./components/WaterQuality";
- import ContinueData from "./components/ContinueData";
- import DataBox from "./components/dataBox";
- import GongYi from "./components/gongyi";
- import { editPassword } from '@/components';
- import TheUserAvatar from '@/components/Layout/TheUserAvatar.vue';
- import { screenApi } from "@/api/screen"
- let timer = "";
- let dataTimer = "";
- const updateTime = ref();
- const gongyiData = ref([])
- const screenData = ref({});
- const reportData = ref({})
- const currentTime = ref({
- time: '',
- weekday: '',
- date: '',
- })
- // 日期 - header使用
- const getCurrentWeekDay = () => {
- const weekEnum = { 0: '星期日', 1: '星期一', 2: '星期二', 3: '星期三', 4: '星期四', 5: '星期五', 6: '星期六' };
- const time = dayjs(new Date()).format('HH:mm:ss');
- const weekday = weekEnum[dayjs().day()];
- const date = dayjs().format('YYYY-MM-DD');
- currentTime.value = { time, weekday, date };
- }
- // 获取大屏分析数据
- const getRealTimeData = () => {
- screenApi.realTimeData().then(res => {
- screenData.value = res.data;
- updateTime.value = `更新时间:${res.data.testHour}`
- })
- }
- // 获取工艺管控 助手
- const getWarningList = () => {
- screenApi.warningList().then(res => {
- gongyiData.value = res.data || []
- })
- }
- // 获取文字数据
- const getLeastShortReport = () => {
- screenApi.getLeastShortReport().then(res => {
- reportData.value = res.data
- })
- }
- onMounted(() => {
- // 时钟开始计时
- getCurrentWeekDay();
- // 图表数据
- getRealTimeData();
- // 文字数据
- getLeastShortReport();
- // 工艺
- getWarningList();
- autofit.init({
- dw: 1920,
- dh: 1080,
- el: "#screen-view-black",
- resize: true,
- })
- timer = setInterval(getCurrentWeekDay, 1 * 1000);
- dataTimer = setInterval(() => {
- getRealTimeData();
- getLeastShortReport();
- getWarningList();
- }, 60 * 60 * 1000);
- })
- onUnmounted(() => {
- clearInterval(timer);
- clearInterval(dataTimer);
- })
- </script>
- <template>
- <div class="screen-view-black" id="screen-view-black">
- <header class="header">
- <div class="header-left">
- <div class="time">{{ currentTime.time }}</div>
- <div class="line"></div>
- <ul class="date">
- <li>{{ currentTime.weekday }}</li>
- <li>{{ currentTime.date }}</li>
- </ul>
- </div>
- <div class="header-right flex items-center justify-end pr-[18px]">
- <div class="select-factory"></div>
- <TheUserAvatar></TheUserAvatar>
- <editPassword></editPassword>
- </div>
- </header>
- <main class="main">
- <!-- 导航菜单 -->
- <div class="menu-container">
- <ul class="menu-list justify-end">
- <li class="item mr-[20px] active">
- <RouterLink to="/"><span>智慧总控</span></RouterLink>
- </li>
- <li class="item">
- <RouterLink to="/answer"><span>专家问答</span></RouterLink>
- </li>
- </ul>
- <ul class="menu-list justify-start">
- <li class="item mr-[20px]">
- <RouterLink to="/water-warn"><span>智能分析</span></RouterLink>
- </li>
- <li class="item">
- <RouterLink to="/work"><span>智能助手</span></RouterLink>
- </li>
- </ul>
- </div>
- <div class="screen-container">
- <div class="factory">
- <img class="w-full h-full" src="@/assets/images/screenViewBlack/img-factory.png" alt="">
- <img class="coord img-a" src="@/assets/images/screenViewBlack/img-coord-a.png" alt="">
- <img class="coord img-b" src="@/assets/images/screenViewBlack/img-coord-b.png" alt="">
- <img class="coord img-c" src="@/assets/images/screenViewBlack/img-coord-c.png" alt="">
- </div>
- <div class="content">
- <div class="left">
- <WaterYield :screenData="screenData"></WaterYield>
- <WaterQuality :screenData="screenData" class="pt-[20px]"></WaterQuality>
- </div>
- <div class="middle">
- <div class="middle-wrap">
- <span class="text-[#9E9E9E] pb-[8px] text-[12px]">{{ updateTime }}</span>
- <RouterLink to="/answer" class="inp-box">
- <span>输入您的问题或需求</span>
- <img src="@/assets/images/screenViewBlack/img-start.png" alt="">
- </RouterLink>
- </div>
- </div>
- <div class="right">
- <ContinueData :screenData="screenData"></ContinueData>
- <DataBox :reportData="reportData" class="pt-[20px]"></DataBox>
- <GongYi :gongyiData="gongyiData"></GongYi>
- </div>
- </div>
- </div>
- </main>
- </div>
- </template>
- <style lang="scss" scoped>
- // 主体背景颜色
- $primary-bg-color: #040d1c;
- .screen-view-black {
- position: relative;
- display: flex;
- flex-flow: column;
- width: 100vw;
- height: 100vh;
- min-width: 1200px;
- min-height: 700px;
- background: $primary-bg-color;
- background-size: 100% 100%;
- overflow: hidden;
- }
- .header {
- display: flex;
- align-items: start;
- justify-content: space-between;
- flex-shrink: 0;
- height: 98px;
- padding: 20px 50px 0 50px;
- background: url(@/assets/images/screenViewBlack/bg-header.png) center center no-repeat;
- background-size: 100% 100%;
- .header-left {
- display: flex;
- align-items: center;
- .time {
- width: 160px;
- color: #FFF;
- text-shadow: 0px 1px 3px rgba(5, 12, 25, 0.54);
- font-family: D-DIN-PRO-700-Bold;
- font-size: 36px;
- font-style: normal;
- font-weight: 700;
- line-height: normal;
- letter-spacing: 4.32px;
- }
- .line {
- width: 1px;
- height: 28px;
- margin: 0 20px 0 15px;
- background: rgba(157, 197, 232, 0.36);
- }
- .date {
- color: #CDD6E3;
- text-align: center;
- font-size: 16px;
- font-weight: bold;
- letter-spacing: 1.92px;
- line-height: normal;
- font-style: normal;
- li:nth-child(1) {
- color: #CDD6E3;
- }
- li:nth-child(2) {
- color: #CDD6E3;
- font-family: D-DIN-PRO-700-Bold;
- font-size: 12px;
- letter-spacing: 1.44px;
- }
- }
- }
- .header-right {
- .select-factory {
- width: 114px;
- height: 34px;
- margin-right: 16px;
- background: url(@/assets/images/screenViewBlack/bg-select.png) center center no-repeat;
- background-size: 100% 100%;
- cursor: pointer;
- }
- }
- }
- .main {
- flex: 1;
- display: flex;
- flex-flow: column;
- padding: 0 30px 14px 30px;
- .menu-container {
- display: flex;
- align-items: center;
- justify-content: space-between;
- .menu-list {
- display: flex;
- align-items: center;
- width: 540px;
- height: 86px;
- .item {
- width: 172px;
- height: 46px;
- text-align: center;
- font-family: YouSheBiaoTiHei;
- font-size: 24px;
- font-style: normal;
- font-weight: 400;
- line-height: 40px;
- letter-spacing: 1px;
- cursor: pointer;
- transition: all 0.8s;
- span {
- transition: all 0.3s;
- background: linear-gradient(182deg, #02A3F8 11.72%, #83D2FB 38.89%, #FFF 98.7%);
- background-clip: text;
- -webkit-background-clip: text;
- -webkit-text-fill-color: transparent;
- }
- }
- }
- .menu-list:nth-child(1) {
- .item {
- background: url(@/assets/images/screenViewBlack/bg-left.png) center center no-repeat;
- background-size: 100% 100%;
- &:hover {
- background: url(@/assets/images/screenViewBlack/bg-left-active.png) center center no-repeat;
- background-size: 100% 100%;
- span {
- background: linear-gradient(182deg, #00FFE4, #FFF 78.7%);
- background-clip: text;
- }
- }
- }
- .active {
- background: url(@/assets/images/screenViewBlack/bg-left-active.png) center center no-repeat;
- background-size: 100% 100%;
- span {
- background: linear-gradient(182deg, #00FFE4, #FFF 78.7%);
- background-clip: text;
- }
- }
- }
- .menu-list:nth-child(2) {
- .item {
- background: url(@/assets/images/screenViewBlack/bg-right.png) center center no-repeat;
- background-size: 100% 100%;
- &:hover {
- background: url(@/assets/images/screenViewBlack/bg-right-active.png) center center no-repeat;
- background-size: 100% 100%;
- span {
- background: linear-gradient(182deg, #00FFE4, #FFF 78.7%);
- background-clip: text;
- }
- }
- }
- .active {
- background: url(@/assets/images/screenViewBlack/bg-right-active.png) center center no-repeat;
- background-size: 100% 100%;
- span {
- background: linear-gradient(182deg, #00FFE4, #FFF 78.7%);
- background-clip: text;
- }
- }
- }
- }
- @keyframes jump {
- 0%, 100% {
- transform: translateY(0);
- }
- 50% {
- transform: translateY(-10px); /* 调整这个值来控制跳跃的高度 */
- }
- }
- .screen-container {
- position: relative;
- background: $primary-bg-color;
- .factory {
- position: absolute;
- top: 50%;
- left: 50%;
- transform: translate(-50%, -50%);
- width: 1408px;
- height: 792px;
- .coord {
- position: absolute;
- width: 108px;
- height: 82px;
- }
- .img-a {
- top: 370px;
- left: 320px;
- animation: jump 1.5s ease-in-out infinite;
- animation-delay: 0.2s;
- }
- .img-b {
- top: 280px;
- left: 650px;
- animation: jump 1.5s ease-in-out infinite;
- animation-delay: 0.6s;
- }
- .img-c {
- top: 226px;
- right: 330px;
- animation: jump 1.5s ease-in-out infinite;
- animation-delay: 0.4s;
- }
- }
- .content {
- position: relative;
- display: flex;
- ;
- justify-content: space-between;
- .left,
- .right {
- width: 540px;
- }
- .middle {
- flex-shrink: 0;
- flex: 1;
- display: flex;
- flex-flow: column;
- justify-content: flex-end;
- padding: 0 50px 30px 50px;
- .middle-wrap {
- display: flex;
- flex-flow: column;
- align-items: flex-end;
- .inp-box {
- display: flex;
- align-items: center;
- justify-content: space-between;
- width: 100%;
- height: 60px;
- padding: 0 14px;
- background: url(@/assets/images/screenViewBlack/bg-input.png) center center no-repeat;
- background-size: 100% 100%;
- span {
- color: rgba(255, 255, 255, 0.80);
- text-shadow: 0px 0px 8px rgba(201, 253, 243, 0.50);
- font-size: 15px;
- font-weight: 400;
- line-height: 22px;
- }
- img {
- width: 56px;
- height: 36px;
- }
- }
- }
- }
- }
- }
- }
- </style>
- <style lang="scss">
- #screen-view-black {
- .header .header-right {
- .name {
- color: #fff;
- }
- }
- }
- </style>
|