orgadminhome.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. <template>
  2. <view class="container">
  3. <!-- 头部 start -->
  4. <view class="head">
  5. <u-navbar :is-fixed="false" :border-bottom="false" :is-back="false" title=""
  6. :background="{ background: '#0BB9C8' }">
  7. <view class="nav-wrap">
  8. <!-- <picker mode="selector" :range="positionArr" range-key="name" @change="changePicker"
  9. class="picker-box">
  10. {{ position }}
  11. <u-icon name="arrow-down" class="arrow" size="18" color="#C9C9C9"></u-icon>
  12. </picker> -->
  13. <view style="width: 100%;height: auto;align-items: center;text-align: center;" v-if="!focus">
  14. <text style="color: #ffffff; font-size: 20px;">运维系统</text>
  15. </view>
  16. <!-- <image src="/static/images/rider.png" class="rider" mode="widthFix" v-if="!focus"></image>
  17. -->
  18. <!-- <view class="search-input" v-else>
  19. <u-search height="50" placeholder="关键字" @blur="handleSearchBlur" :show-action="false"
  20. v-model="keyword"></u-search>
  21. </view> -->
  22. <!-- <view class="tool">
  23. <image src="/static/images/home/search.png" class="icon search-icon" mode="widthFix"
  24. @click="handleFocus" v-if="!focus"></image>
  25. <image src="/static/images/home/message.png" class="icon message-icon" mode="widthFix"></image>
  26. <image src="/static/images/home/qr.png" class="icon qr-icon" mode="widthFix"></image>
  27. </view> -->
  28. </view>
  29. </u-navbar>
  30. <!-- <view class="head-bg"></view>
  31. <swiper class="swiper-box" :indicator-dots="false" :autoplay="true" :interval="3000" :duration="1000">
  32. <swiper-item v-for="(item, index) in bannerList" :key="index">
  33. <navigator :url="item.url" hover-class="none" class="swiper-item">
  34. <image :src="item.img" class="banner"></image>
  35. </navigator>
  36. </swiper-item>
  37. </swiper> -->
  38. </view>
  39. <!-- 头部 end -->
  40. <!-- 头部按钮 start -->
  41. <view class="nav">
  42. <u-grid :col="4" :border="false">
  43. <u-grid-item bg-color="transparent" v-for="(item, index) in navButton" :key="index">
  44. <navigator :url="item.url" hover-class="none" class="nav-item" open-type="navigate">
  45. <image :src="item.img" mode="widthFix" class="nav-item-img"></image>
  46. <view class="nav-item-name">{{ item.name }}</view>
  47. </navigator>
  48. </u-grid-item>
  49. </u-grid>
  50. </view>
  51. <!-- 头部按钮 end -->
  52. <!-- <view class="video-box">
  53. <view class="video-body">
  54. <video style="width: 640rpx; height: 480rpx;" src="/static/video/test.mp4"></video>
  55. </view>
  56. <view class="video-title" style="margin-top: 5px;">
  57. <view class="text">新闻视频提要:据报道....</view>
  58. </view>
  59. </view> -->
  60. <!-- 公告 start -->
  61. <view class="notice-box">
  62. <image src="/static/images/home/notice.png" class="img" mode="widthFix"></image>
  63. <view class="notice-info">
  64. <navigator hover-class="none" class="notice-cell" v-for="(item, index) in noticeList" :key="index">
  65. <!-- <image :src="item.img" class="icon" mode="widthFix"></image> -->
  66. <view class="text">{{item.title}}</view>
  67. <u-icon name="arrow-right" size="12" color="#C9C9C9"></u-icon>
  68. </navigator>
  69. </view>
  70. </view>
  71. <!-- 公告 end -->
  72. <!-- 服务按钮 start -->
  73. <!-- <view class="service-box">
  74. <u-grid :col="4" :border="false">
  75. <u-grid-item bg-color="transparent" v-for="(item, index) in serviceButton" :key="index">
  76. <navigator url="" hover-class="none" class="service-item">
  77. <image :src="item.img" mode="widthFix" class="img"></image>
  78. <view class="name">{{ item.name }}</view>
  79. </navigator>
  80. </u-grid-item>
  81. <u-grid-item bg-color="transparent" key="8">
  82. <navigator url="/pages/service/service" hover-class="none" class="service-item">
  83. <image src="/static/images/home/s8.png" mode="widthFix" class="img"></image>
  84. <view class="name">更多</view>
  85. </navigator>
  86. </u-grid-item>
  87. </u-grid>
  88. </view> -->
  89. <!-- 服务按钮 end -->
  90. <!-- 新闻模块 start -->
  91. <view class="news">
  92. <navigator hover-class="none" url="/pages/check-order/checkorderlist" class="cell">
  93. <view class="ctitle">工单动态</view>
  94. <view class="more">
  95. 更多
  96. <u-icon name="arrow-right" color="#A6ABB5" size="16"></u-icon>
  97. </view>
  98. </navigator>
  99. <view class="news-list">
  100. <navigator url="/pages/news/detail" hover-class="none" class="news-item"
  101. v-for="(item, index) in lastCheckOrderList" :key="index">
  102. <view class="left">
  103. <view class="info">
  104. <text>{{item.orderDesc}}</text>
  105. </view>
  106. <view class="date">
  107. <image src="/static/images/home/date.png" class="icon" mode=""></image>
  108. <text>{{item.updateTime}}</text>
  109. </view>
  110. </view>
  111. <!-- <image src="" mode="" class="img"></image> -->
  112. </navigator>
  113. <!-- <u-loadmore :status="status" /> -->
  114. </view>
  115. </view>
  116. <!-- 新闻模块 end -->
  117. <view class="news">
  118. <navigator hover-class="none" url="/pages/equipment-inspection/equipmentinspectionplanlist" class="cell">
  119. <view class="ctitle">巡检动态</view>
  120. <view class="more">
  121. 更多
  122. <u-icon name="arrow-right" color="#A6ABB5" size="16"></u-icon>
  123. </view>
  124. </navigator>
  125. <view class="news-list">
  126. <navigator url="/pages/news/detail" hover-class="none" class="news-item"
  127. v-for="(item, index) in lastEquipmentInspectionList" :key="index">
  128. <view class="left">
  129. <view class="info">
  130. <text>{{item.reportDesc}}</text>
  131. </view>
  132. <view class="date">
  133. <image src="/static/images/home/date.png" class="icon" mode=""></image>
  134. <text>{{item.createTime}}</text>
  135. </view>
  136. </view>
  137. <!-- <image src="" mode="" class="img"></image> -->
  138. </navigator>
  139. <!-- <u-loadmore :status="status" /> -->
  140. </view>
  141. </view>
  142. </view>
  143. </template>
  144. <script>
  145. import {
  146. fakePosition,
  147. fakeBannerList,
  148. fakeNavButton,
  149. fakeServiceButton
  150. } from "@/api/mock/home.js";
  151. import http from '@/http/api.js';
  152. export default {
  153. components: {
  154. },
  155. data() {
  156. return {
  157. position: '',
  158. positionArr: [],
  159. status: 'loadmore',
  160. list: 15,
  161. page: 0,
  162. keyword: '',
  163. focus: false,
  164. bannerList: [],
  165. noticeList: [],
  166. warningList: [],
  167. newsList: [{}, {}],
  168. navButton: [],
  169. serviceButton: [],
  170. lastCheckOrderList: [],
  171. lastEquipmentInspectionList: [],
  172. };
  173. },
  174. onLoad() {
  175. // 后续将改为与后端联动
  176. // 加载banner数据
  177. fakePosition().then(data => {
  178. this.position = data.position;
  179. this.positionArr = data.positionArr;
  180. });
  181. // 加载banner数据
  182. fakeBannerList().then(data => {
  183. this.bannerList = data;
  184. });
  185. // 加载通知公告数据
  186. // fakeNoticeList().then(data => {
  187. // this.noticeList = data;
  188. // });
  189. // const noticeListTmp = [{
  190. // id: '1',
  191. // title: '2022年度巡检计划已经发布'
  192. // }];
  193. // this.noticeList = noticeListTmp;
  194. this.getLastNotice();
  195. this.getLastCheckOrder();
  196. this.getLastEquipmentInspectionReport();
  197. // const lastCheckOrderListTmp = [{
  198. // id: '1',
  199. // processDesc: '河道 45222222维修工单创建',
  200. // reportDate: '2022年8月20日 12时'
  201. // }];
  202. // this.lastCheckOrderList=lastCheckOrderListTmp;
  203. // const lastEquipmentInspectionListTmp = [{
  204. // id: '1',
  205. // equipmentInspectionDesc: '测站河道 45222222 已经完成巡检填报',
  206. // reportDate: '2022年8月20日 15时'
  207. // }];
  208. // this.lastEquipmentInspectionList=lastEquipmentInspectionListTmp;
  209. // 加载顶部按钮数据
  210. fakeNavButton().then(data => {
  211. this.navButton = data;
  212. });
  213. // 加载服务按钮数据
  214. fakeServiceButton().then(data => {
  215. this.serviceButton = data;
  216. });
  217. },
  218. onReachBottom() {
  219. // 后续将改为与后端联动
  220. if (this.page >= 3) return;
  221. this.status = 'loading';
  222. this.page = ++this.page;
  223. setTimeout(() => {
  224. this.list += 10;
  225. if (this.page >= 3) this.status = 'nomore';
  226. else this.status = 'loading';
  227. this.newsList.push(...[{}, {}]);
  228. }, 2000);
  229. },
  230. methods: {
  231. getLastNotice(){
  232. const that = this;
  233. http.request({
  234. url: '/galaxy-test/notice/last/list',
  235. method: 'GET'
  236. }).then(res => {
  237. console.log(res.data)
  238. if (res.data != null) {
  239. const len = res.data['length'];
  240. var list = [];
  241. for (var i = 0; i < len; i++) {
  242. let dict = res.data['' + i];
  243. list.push(dict);
  244. }
  245. that.noticeList = list;
  246. }
  247. }).catch(err => {
  248. console.log(err)
  249. })
  250. },
  251. getLastCheckOrder() {
  252. const that = this;
  253. http.request({
  254. url: '/galaxy-test/rtu/check/order/last/list',
  255. method: 'GET'
  256. }).then(res => {
  257. console.log(res.data)
  258. if (res.data != null) {
  259. const len = res.data['length'];
  260. var list = [];
  261. for (var i = 0; i < len; i++) {
  262. let dict = res.data['' + i];
  263. list.push(dict);
  264. }
  265. that.lastCheckOrderList = list;
  266. }
  267. }).catch(err => {
  268. console.log(err)
  269. })
  270. },
  271. getLastEquipmentInspectionReport() {
  272. const that = this;
  273. http.request({
  274. url: '/galaxy-test/equipment/inspection/report/last/list',
  275. method: 'GET'
  276. }).then(res => {
  277. console.log(res.data)
  278. if (res.data != null) {
  279. const len = res.data['length'];
  280. var list = [];
  281. for (var i = 0; i < len; i++) {
  282. let dict = res.data['' + i];
  283. list.push(dict);
  284. }
  285. that.lastEquipmentInspectionList = list;
  286. }
  287. }).catch(err => {
  288. console.log(err)
  289. })
  290. },
  291. changePicker(e) {
  292. console.log(this.pickerArr[e.detail.value].name);
  293. this.position = this.pickerArr[e.detail.value].name;
  294. },
  295. handleFocus() {
  296. this.focus = !this.focus;
  297. },
  298. handleSearchBlur() {
  299. this.focus = false;
  300. }
  301. }
  302. };
  303. </script>
  304. <style lang="scss">
  305. .container {
  306. background-color: #f7f7f7;
  307. min-height: 100vh;
  308. overflow: hidden;
  309. }
  310. .head {
  311. position: relative;
  312. top: 0;
  313. left: 0;
  314. z-index: 1;
  315. }
  316. .head-bg {
  317. position: absolute;
  318. left: 0px;
  319. top: 0px;
  320. z-index: -1;
  321. width: 750rpx;
  322. height: 270rpx;
  323. background: #0bb9c8;
  324. }
  325. .nav-wrap {
  326. width: 100%;
  327. padding: 0 22rpx;
  328. display: flex;
  329. justify-content: space-between;
  330. align-items: center;
  331. .picker-box {
  332. flex: 1;
  333. display: flex;
  334. align-items: center;
  335. justify-content: flex-start;
  336. font-size: 32rpx;
  337. font-family: Microsoft YaHei;
  338. font-weight: bold;
  339. color: #ffffff;
  340. .arrow {
  341. margin-left: 10rpx;
  342. }
  343. }
  344. .rider {
  345. flex-shrink: 0;
  346. width: 131rpx;
  347. height: auto;
  348. }
  349. .search-input {
  350. width: 300rpx;
  351. height: 50rpx;
  352. }
  353. .tool {
  354. flex: 1;
  355. display: flex;
  356. align-items: center;
  357. justify-content: flex-end;
  358. .icon {
  359. height: auto;
  360. }
  361. .search-icon {
  362. width: 40rpx;
  363. margin-right: 34rpx;
  364. }
  365. .message-icon {
  366. width: 32rpx;
  367. margin-right: 27rpx;
  368. }
  369. .qr-icon {
  370. width: 37rpx;
  371. }
  372. }
  373. }
  374. .swiper-box {
  375. margin: 50rpx auto 0;
  376. width: 710rpx;
  377. height: 253rpx;
  378. .swiper-item {
  379. width: 100%;
  380. height: 100%;
  381. .banner {
  382. width: 100%;
  383. height: 100%;
  384. }
  385. }
  386. }
  387. .nav {
  388. margin: 0rpx 0;
  389. box-sizing: border-box;
  390. padding: 0 10rpx;
  391. &-item {
  392. width: 100%;
  393. box-sizing: border-box;
  394. display: flex;
  395. flex-direction: column;
  396. align-items: center;
  397. justify-content: space-between;
  398. height: 130rpx;
  399. &-img {
  400. width: 80rpx;
  401. height: 80rpx;
  402. }
  403. &-name {
  404. font-size: 26rpx;
  405. font-family: PingFang SC;
  406. font-weight: 400;
  407. color: #585b61;
  408. }
  409. }
  410. }
  411. .video-box {
  412. display: flex;
  413. justify-content: flex-start;
  414. flex-direction: column;
  415. width: 100%;
  416. .video-body {
  417. display: flex;
  418. justify-content: center;
  419. flex-direction: row;
  420. }
  421. .video-title {
  422. display: flex;
  423. justify-content: center;
  424. flex-direction: row;
  425. .text {
  426. margin-top: 10rpx;
  427. margin-bottom: 10rpx;
  428. width: 640rpx;
  429. // flex: 1;
  430. min-width: 0;
  431. overflow: hidden;
  432. text-overflow: ellipsis;
  433. display: -webkit-box;
  434. -webkit-line-clamp: 1;
  435. -webkit-box-orient: vertical;
  436. }
  437. }
  438. }
  439. .notice-box {
  440. display: flex;
  441. align-items: center;
  442. background: #ffffff;
  443. border-radius: 20px 20px 20px 20px;
  444. margin: 0 20rpx;
  445. padding: 30rpx 20rpx;
  446. .img {
  447. width: 75rpx;
  448. height: auto;
  449. margin-right: 36rpx;
  450. margin-left: 10rpx;
  451. }
  452. .notice-info {
  453. flex: 1;
  454. .notice-cell:first-of-type {
  455. margin-bottom: 15rpx;
  456. }
  457. }
  458. .notice-cell {
  459. display: flex;
  460. align-items: center;
  461. font-size: 24rpx;
  462. font-family: PingFang SC;
  463. font-weight: 500;
  464. color: #585b61;
  465. .icon {
  466. width: 63rpx;
  467. margin-right: 18rpx;
  468. }
  469. .text {
  470. flex: 1;
  471. min-width: 0;
  472. overflow: hidden;
  473. text-overflow: ellipsis;
  474. display: -webkit-box;
  475. -webkit-line-clamp: 1;
  476. -webkit-box-orient: vertical;
  477. }
  478. }
  479. }
  480. .service-box {
  481. background: #ffffff;
  482. border-radius: 20px 20px 20px 20px;
  483. margin: 30rpx 20rpx 0;
  484. padding: 0rpx 20rpx;
  485. .service-item {
  486. display: flex;
  487. flex-direction: column;
  488. justify-content: space-between;
  489. align-items: center;
  490. width: 100%;
  491. height: 120rpx;
  492. font-size: 26rpx;
  493. font-family: PingFang SC;
  494. font-weight: 500;
  495. color: #585b61;
  496. .img {
  497. width: 70rpx;
  498. height: auto;
  499. }
  500. }
  501. }
  502. .news {
  503. background: #ffffff;
  504. border-radius: 20px 20px 20px 20px;
  505. margin: 30rpx 20rpx 60rpx;
  506. padding: 30rpx 20rpx;
  507. .cell {
  508. display: flex;
  509. justify-content: space-between;
  510. align-items: center;
  511. .ctitle {
  512. font-size: 32rpx;
  513. font-family: PingFang SC;
  514. font-weight: bold;
  515. color: #585b61;
  516. }
  517. .more {
  518. display: flex;
  519. align-items: center;
  520. font-size: 26rpx;
  521. font-family: PingFang SC;
  522. font-weight: 500;
  523. color: #a6abb5;
  524. }
  525. }
  526. .news-list {
  527. margin-top: 30rpx;
  528. .news-item {
  529. &:not(:last-of-type) {
  530. padding: 0 0 30rpx;
  531. margin-bottom: 30rpx;
  532. border-bottom: 1px solid #eeeeee;
  533. }
  534. display: flex;
  535. align-items: center;
  536. justify-content: space-between;
  537. .left {
  538. flex: 1;
  539. height: 160rpx;
  540. display: flex;
  541. flex-direction: column;
  542. justify-content: space-around;
  543. .info {
  544. min-width: 0;
  545. overflow: hidden;
  546. text-overflow: ellipsis;
  547. display: -webkit-box;
  548. -webkit-line-clamp: 2;
  549. -webkit-box-orient: vertical;
  550. font-size: 28rpx;
  551. font-family: PingFang SC;
  552. font-weight: 500;
  553. color: #585b61;
  554. line-height: 36rpx;
  555. }
  556. .date {
  557. display: flex;
  558. align-items: center;
  559. .icon {
  560. width: 21rpx;
  561. height: 21rpx;
  562. margin-right: 9rpx;
  563. }
  564. font-size: 26rpx;
  565. font-family: PingFang SC;
  566. font-weight: 500;
  567. color: #a6abb5;
  568. }
  569. }
  570. .img {
  571. flex-shrink: 0;
  572. width: 252rpx;
  573. height: 160rpx;
  574. border-radius: 20rpx;
  575. background-color: #82848a;
  576. }
  577. }
  578. }
  579. }
  580. </style>