main.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761
  1. <template>
  2. <div class="main-data data-service">
  3. <div class="left">
  4. <div class="left-cont" v-if="leftTopShow || leftMidShow || leftBotShow">
  5. <div
  6. class="left-top"
  7. @click="showDialog(1)"
  8. @mouseover="showDialog(1, 1)"
  9. v-if="leftTopShow"
  10. >
  11. <div class="cont-title-area">
  12. <img
  13. class="cont-title-bg"
  14. src="@/assets/images/main/cont_title_bg.png"
  15. alt=""
  16. />
  17. <div class="cont-title">员工概况</div>
  18. </div>
  19. <div class="components-item">
  20. <employee-profile :appOrg="appOrg"></employee-profile>
  21. </div>
  22. </div>
  23. <div
  24. class="left-middle"
  25. @click="showDialog(2)"
  26. @mouseover="showDialog(2, 1)"
  27. v-if="leftMidShow"
  28. >
  29. <div class="cont-title-area">
  30. <img
  31. class="cont-title-bg"
  32. src="@/assets/images/main/cont_title_bg.png"
  33. alt=""
  34. />
  35. <div class="cont-title">员工健康</div>
  36. </div>
  37. <div class="components-item">
  38. <employee-health :appOrg="appOrg"></employee-health>
  39. </div>
  40. </div>
  41. <div
  42. class="left-bottom"
  43. @click="showDialog(3)"
  44. @mouseover="showDialog(3, 1)"
  45. v-if="leftBotShow"
  46. >
  47. <div class="cont-title-area">
  48. <img
  49. class="cont-title-bg"
  50. src="@/assets/images/main/cont_title_bg.png"
  51. alt=""
  52. />
  53. <div class="cont-title">绿智食堂</div>
  54. </div>
  55. <div class="components-item">
  56. <canteen :appOrg="appOrg"></canteen>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="middle">
  62. <province
  63. v-if="showMap"
  64. ref="province"
  65. @mapClick="onMapClick"
  66. height="920px"
  67. ></province>
  68. <img
  69. v-if="showLocal"
  70. class="build"
  71. src="@/assets/images/build.png"
  72. alt=""
  73. />
  74. <!-- 返回按钮 -->
  75. <div class="bottom-area flex-row align-items-center space-between">
  76. <div class="bottom-left flex-row align-items-center" style="display: flex;">
  77. <div class="left-item">
  78. <el-cascader
  79. v-model="curCompany"
  80. :options="company"
  81. @change="handleCompanyChange"
  82. placeholder="单位"
  83. :show-all-levels="false"
  84. >
  85. <template slot-scope="{ node, data }">
  86. <div style="display: flex; align-items: center">
  87. <img
  88. v-if="data.label == '山西省公司(本部)'"
  89. src="../../../assets/images/main/tiaozhuanlouyu.png"
  90. style="width: 15px; margin-right: 10px"
  91. />
  92. <span
  93. v-else-if="data.value == '1A001' || data.value == '1A002' || data.value == '1A004' || data.value == '1A005'"
  94. style="
  95. display: inline-block;
  96. width: 10px;
  97. height: 10px;
  98. border-radius: 50%;
  99. margin-right: 10px;
  100. background: rgb(255, 180, 74);
  101. "
  102. ></span>
  103. <span
  104. v-else-if="data.value.length == 5 && data.value != '10001'"
  105. style="
  106. display: inline-block;
  107. width: 10px;
  108. height: 10px;
  109. border-radius: 50%;
  110. margin-right: 10px;
  111. background: rgb(74, 194, 29);
  112. "
  113. ></span>
  114. <span
  115. v-else-if="data.value.length == 7"
  116. style="
  117. display: inline-block;
  118. width: 10px;
  119. height: 10px;
  120. border-radius: 50%;
  121. margin-right: 10px;
  122. background: rgb(99, 235, 255);
  123. "
  124. ></span>
  125. <span>{{ data.label }}</span>
  126. </div>
  127. <!-- <div
  128. v-if="data.level == 2"
  129. style="width: 1.5vh;height: 1.5vh;background-color: red;border-radius: 60%;margin-top:10px;margin-left:10px;float:right"
  130. ></div> -->
  131. </template>
  132. </el-cascader>
  133. </div>
  134. <div class="office" disabled>办公区</div>
  135. </div>
  136. <div class="bottom-right">
  137. <img
  138. v-if="showBack"
  139. @click="onBack"
  140. src="@/assets/images/main/back.png"
  141. class="back"
  142. />
  143. </div>
  144. </div>
  145. </div>
  146. <div class="right">
  147. <div class="right-cont" v-if="rightShow">
  148. <div
  149. class="right-top"
  150. @click="showDialog(4)"
  151. @mouseover="showDialog(4, 1)"
  152. >
  153. <div class="cont-title-area">
  154. <img
  155. class="cont-title-bg"
  156. src="@/assets/images/main/cont_title_bg.png"
  157. alt=""
  158. />
  159. <div class="cont-title">共享驿站</div>
  160. </div>
  161. <div class="components-item">
  162. <share-station :key="appOrg" :appOrg="appOrg"></share-station>
  163. </div>
  164. </div>
  165. <div
  166. class="right-middle"
  167. @click="showDialog(5)"
  168. @mouseover="showDialog(5, 1)"
  169. >
  170. <div class="cont-title-area">
  171. <img
  172. class="cont-title-bg"
  173. src="@/assets/images/main/cont_title_bg.png"
  174. alt=""
  175. />
  176. <div class="cont-title">物业服务</div>
  177. </div>
  178. <div class="components-item">
  179. <property :appOrg="appOrg"></property>
  180. </div>
  181. </div>
  182. <div
  183. class="right-bottom"
  184. @click="showDialog(6)"
  185. @mouseover="showDialog(6, 1)"
  186. >
  187. <div class="cont-title-area">
  188. <img
  189. class="cont-title-bg"
  190. src="@/assets/images/main/cont_title_bg.png"
  191. alt=""
  192. />
  193. <div class="cont-title">基础运行数据</div>
  194. </div>
  195. <div class="components-item">
  196. <basic-operation :appOrg="appOrg"></basic-operation>
  197. </div>
  198. </div>
  199. </div>
  200. </div>
  201. <!--弹出层-->
  202. <div
  203. :class="dialogType < 4 ? 'dialog' : 'dialog-r'"
  204. v-if="dialogShow"
  205. @click="closeDialog"
  206. >
  207. <employee-profile-dialog
  208. v-if="dialogType === 1"
  209. @closeDialog="closeDialog"
  210. :appOrg="appOrg"
  211. ></employee-profile-dialog>
  212. <employee-health-dialog
  213. v-if="dialogType === 2"
  214. @closeDialog="closeDialog"
  215. :appOrg="appOrg"
  216. ></employee-health-dialog>
  217. <canteen-dialog
  218. v-if="dialogType === 3"
  219. @foodsClick="onFoodsClick"
  220. @closeDialog="closeDialog"
  221. :appOrg="appOrg"
  222. ></canteen-dialog>
  223. <share-station-dialog
  224. v-if="dialogType === 4"
  225. @closeDialog="closeDialog"
  226. :appOrg="appOrg"
  227. ></share-station-dialog>
  228. <property-dialog
  229. v-if="dialogType === 5"
  230. @closeDialog="closeDialog"
  231. :appOrg="appOrg"
  232. ></property-dialog>
  233. <basic-operation-dialog
  234. v-if="dialogType === 6"
  235. @closeDialog="closeDialog"
  236. :appOrg="appOrg"
  237. ></basic-operation-dialog>
  238. </div>
  239. <!-- 菜谱区域 -->
  240. <div v-if="showCenter" class="dialog-2">
  241. <div class="dialog-center">
  242. <week-foods
  243. v-if="showType === 1"
  244. @closeFoods="onCloseFoods"
  245. @chooseFoods="onChooseFoods"
  246. :appOrg="appOrg"
  247. :week="week"
  248. ></week-foods>
  249. <day-foods
  250. v-if="showType === 2"
  251. @closeFoods="onCloseFoods2"
  252. :appOrg="appOrg"
  253. :week="week"
  254. ></day-foods>
  255. </div>
  256. </div>
  257. </div>
  258. </template>
  259. <script>
  260. import EmployeeProfile from "./employeeProfile.vue";
  261. import EmployeeHealth from "./employeeHealth.vue";
  262. import Canteen from "./canteen.vue";
  263. import ShareStation from "./shareStation.vue";
  264. import Property from "./property.vue";
  265. import BasicOperation from "./basicOperation.vue";
  266. import Province from "../map/province.vue";
  267. import EmployeeProfileDialog from "./employeeProfileDialog.vue";
  268. import ShareStationDialog from "./shareStationDialog.vue";
  269. import PropertyDialog from "./propertyDialog.vue";
  270. import EmployeeHealthDialog from "./employeeHealthDialog.vue";
  271. import CanteenDialog from "./canteenDialog.vue";
  272. import BasicOperationDialog from "./basicOperationDialog.vue";
  273. import WeekFoods from "./weekFoods.vue";
  274. import DayFoods from "./dayFoods.vue";
  275. // 引入json数据
  276. import company from "../data/company.json";
  277. var weeks = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"];
  278. export default {
  279. name: "ServiceMain",
  280. components: {
  281. EmployeeProfile,
  282. EmployeeHealth,
  283. Canteen,
  284. ShareStation,
  285. Property,
  286. BasicOperation,
  287. Province,
  288. EmployeeProfileDialog,
  289. ShareStationDialog,
  290. PropertyDialog,
  291. EmployeeHealthDialog,
  292. CanteenDialog,
  293. BasicOperationDialog,
  294. WeekFoods,
  295. DayFoods,
  296. },
  297. props: {},
  298. data() {
  299. return {
  300. leftTopShow: true,
  301. leftMidShow: true,
  302. leftBotShow: true,
  303. rightShow: true,
  304. dialogShow: false,
  305. dialogType: 0,
  306. curDeep: 1,
  307. showBack: false,
  308. showCenter: false,
  309. showType: 0,
  310. curCompany: [],
  311. company: company,
  312. week: 0, //当前选择的周日情况
  313. showMap: true,
  314. showLocal: false,
  315. appOrg: "0000",
  316. };
  317. },
  318. created() {
  319. let weekIndex = new Date().getDay();
  320. if(weekIndex == 0){//周日
  321. this.week = '周日'
  322. }else{
  323. this.week = weeks[weekIndex - 1]
  324. }
  325. },
  326. destroyed() {},
  327. beforeDestroy() {},
  328. mounted() {},
  329. methods: {
  330. showDialog(type, index = 0) {
  331. setTimeout(() => {
  332. if (type < 4) {
  333. if (type === 2) {
  334. this.leftTopShow = true;
  335. this.leftMidShow = false;
  336. this.leftBotShow = false;
  337. this.rightShow = true;
  338. } else {
  339. this.leftTopShow = false;
  340. this.leftMidShow = false;
  341. this.leftBotShow = false;
  342. this.rightShow = true;
  343. }
  344. } else {
  345. this.leftTopShow = true;
  346. this.leftMidShow = true;
  347. this.leftBotShow = true;
  348. this.rightShow = false;
  349. }
  350. this.dialogShow = true;
  351. this.dialogType = type;
  352. }, index * 200);
  353. },
  354. closeDialog() {
  355. this.leftTopShow = true;
  356. this.leftMidShow = true;
  357. this.leftBotShow = true;
  358. this.rightShow = true;
  359. this.dialogShow = false;
  360. },
  361. //点击地图事件
  362. onMapClick(e) {
  363. this.curDeep = e.deep;
  364. if (e.deep > 1) {
  365. this.showBack = true;
  366. } else {
  367. this.showBack = false;
  368. }
  369. //点击山西省本部
  370. if (e.name == "山西省公司(本部)") {
  371. this.showMap = false;
  372. this.showLocal = true;
  373. this.curCompany = ["10001", "10001"];
  374. this.appOrg = "10001";
  375. } else {
  376. this.showMap = true;
  377. this.showLocal = false;
  378. this.curCompany = e.curCompany;
  379. }
  380. //判断是否点击了子单位
  381. if (e.curCompany && e.curCompany.length > 0) {
  382. let appOrg = e.curCompany[e.curCompany.length - 1];
  383. this.appOrg = appOrg;
  384. }
  385. },
  386. //点击菜谱
  387. onFoodsClick(e) {
  388. // this.leftShow = true;
  389. // this.rightShow = true;
  390. // this.dialogShow = false;
  391. this.showCenter = true;
  392. if (e === 0) {
  393. this.showType = 1;
  394. } else {
  395. this.showType = 2;
  396. }
  397. // else if (e === 1) {
  398. // this.showType = 2;
  399. // }
  400. },
  401. //关闭菜谱
  402. onCloseFoods() {
  403. // this.leftShow = true;
  404. // this.rightShow = true;
  405. // this.dialogShow = false;
  406. this.showCenter = false;
  407. },
  408. //关闭菜谱
  409. onCloseFoods2() {
  410. // this.leftShow = true;
  411. // this.rightShow = true;
  412. // this.dialogShow = false;
  413. // this.showType = 1;
  414. this.showCenter = false;
  415. },
  416. //选择周菜谱 日期
  417. onChooseFoods(week) {
  418. // this.showType = 2;
  419. // this.week = week;
  420. // this.showCenter = false;
  421. },
  422. //返回操作
  423. onBack() {
  424. this.curDeep--;
  425. if (this.curDeep <= 1) {
  426. this.showBack = false;
  427. this.showMap = true;
  428. this.showLocal = false;
  429. this.curCompany = [];
  430. }
  431. this.appOrg = "0000";
  432. this.$refs.province.reloadMap(this.curDeep);
  433. },
  434. //选择公司
  435. handleCompanyChange(e) {
  436. if (e && e.length > 0) {
  437. if (e[1] == "10001") {
  438. this.showMap = false;
  439. this.showLocal = true;
  440. this.showBack = true;
  441. } else {
  442. this.showMap = true;
  443. this.showLocal = false;
  444. }
  445. let appOrg = e[e.length - 1];
  446. this.appOrg = appOrg;
  447. }
  448. if(e[1] == "1A001" || e[1] == "1A002" || e[1] == "1A004" || e[1] == "1A005"){
  449. this.showMap = true;
  450. this.showLocal = false;
  451. this.showBack = true;
  452. // return;
  453. }
  454. this.$refs.province.chooseUnit(e);
  455. },
  456. },
  457. };
  458. </script>
  459. <style lang="scss">
  460. .el-popper {
  461. border: 1px solid #00ffff;
  462. .el-cascader-node:hover,
  463. .el-cascader-node:visited {
  464. background: #15696b !important;
  465. }
  466. .el-cascader-menu {
  467. background: #15696b !important;
  468. color: #fff !important;
  469. border-right: solid 1px #00ffff !important;
  470. }
  471. .el-cascader-node.in-active-path,
  472. .el-cascader-node.is-selectable.in-checked-path,
  473. .el-cascader-node.is-active {
  474. color: #00ffff;
  475. background: #15696b !important;
  476. }
  477. .el-cascader-node__label {
  478. font-size: 12px;
  479. }
  480. .el-cascader-node {
  481. padding: 0 20px 0 0 !important;
  482. }
  483. .el-cascader-node__prefix {
  484. display: none !important;
  485. }
  486. .el-popper .el-cascader-node {
  487. height: 28px !important;
  488. line-height: 28px !important;
  489. }
  490. .el-cascader-node {
  491. height: 28px !important;
  492. line-height: 28px !important;
  493. }
  494. .el-cascader-menu__wrap {
  495. height: 250px !important;
  496. }
  497. }
  498. .data-service {
  499. width: 100%;
  500. height: 100%;
  501. margin: 0 auto;
  502. // background-image: url("../../../assets/images/service_guarantee/bg.jpg");
  503. // background-size: cover;
  504. display: flex;
  505. flex-direction: row;
  506. justify-content: space-between;
  507. .left {
  508. margin: 125px 0 0 40px;
  509. width: 580px;
  510. .left-cont {
  511. width: 100%;
  512. height: 920px;
  513. padding-top: 19px;
  514. background: url("../../../assets/images/main/main_bg.png") no-repeat;
  515. background-size: cover;
  516. }
  517. .components-item {
  518. width: 550px;
  519. height: 237px;
  520. background: url("../../../assets/images/main/components_bg.png") no-repeat;
  521. background-size: cover;
  522. margin-bottom: 28px;
  523. margin-left: 15px;
  524. overflow: hidden;
  525. }
  526. .left-top {
  527. // width: 550px;
  528. // height: 288px;
  529. // background: url("../../../assets/images/service_new/left_top.png")
  530. // no-repeat;
  531. // background-size: cover;
  532. // margin-bottom: 21px;
  533. }
  534. .left-middle {
  535. // width: 550px;
  536. // height: 288px;
  537. // background: url("../../../assets/images/service_new/left_top.png")
  538. // no-repeat;
  539. // background-size: cover;
  540. // margin-bottom: 21px;
  541. }
  542. .left-bottom {
  543. // width: 550px;
  544. // height: 288px;
  545. // background: url("../../../assets/images/service_new/left_top.png")
  546. // no-repeat;
  547. // background-size: cover;
  548. }
  549. }
  550. .middle {
  551. display: flex;
  552. flex: 1;
  553. align-items: center;
  554. justify-content: center;
  555. padding: 125px 0 0 0px;
  556. position: relative;
  557. .bottom-area {
  558. position: absolute;
  559. right: 50px;
  560. left: 50px;
  561. bottom: 50px;
  562. .bottom-left {
  563. .left-item {
  564. width: 180px;
  565. height: 30px;
  566. background: url("../../../assets/images/main/choose_bg_long.png")
  567. no-repeat;
  568. background-size: cover;
  569. input {
  570. background: rgba(255, 255, 255, 0);
  571. border: none;
  572. color: #00ffff;
  573. }
  574. .el-input__icon {
  575. color: #00ffff;
  576. }
  577. }
  578. .office {
  579. margin-left: 10px;
  580. width: 180px;
  581. height: 30px;
  582. line-height: 30px;
  583. padding-left: 15px;
  584. color: #898989;
  585. background: url("../../../assets/images/main/choose_bg_long.png")
  586. no-repeat;
  587. background-size: cover;
  588. font-size: 14px;
  589. }
  590. }
  591. .bottom-right {
  592. .back {
  593. width: 34px;
  594. height: 30px;
  595. cursor: pointer;
  596. }
  597. }
  598. }
  599. }
  600. .right {
  601. margin: 125px 40px 0 0px;
  602. width: 580px;
  603. .right-cont {
  604. width: 100%;
  605. height: 920px;
  606. padding-top: 19px;
  607. background: url("../../../assets/images/main/main_bg.png") no-repeat;
  608. background-size: cover;
  609. }
  610. .components-item {
  611. width: 550px;
  612. height: 237px;
  613. background: url("../../../assets/images/main/components_bg.png") no-repeat;
  614. background-size: cover;
  615. margin-bottom: 28px;
  616. margin-left: 15px;
  617. overflow: hidden;
  618. }
  619. .right-top {
  620. // width: 550px;
  621. // height: 288px;
  622. // background: url("../../../assets/images/service_new/left_top.png")
  623. // no-repeat;
  624. // background-size: cover;
  625. // margin-bottom: 21px;
  626. }
  627. .right-middle {
  628. // width: 550px;
  629. // height: 288px;
  630. // background: url("../../../assets/images/service_new/left_top.png")
  631. // no-repeat;
  632. // background-size: cover;
  633. // margin-bottom: 21px;
  634. }
  635. .right-bottom {
  636. // width: 550px;
  637. // height: 288px;
  638. // background: url("../../../assets/images/service_new/left_top.png")
  639. // no-repeat;
  640. // background-size: cover;
  641. }
  642. }
  643. .dialog {
  644. position: fixed;
  645. top: 125px;
  646. left: 40px;
  647. z-index: 1000;
  648. width: 100%;
  649. }
  650. .dialog-r {
  651. position: fixed;
  652. top: 125px;
  653. right: 40px;
  654. z-index: 10;
  655. width: 100%;
  656. display: flex;
  657. justify-content: flex-end;
  658. }
  659. .dialog-2 {
  660. position: fixed;
  661. left: 0;
  662. top: 0;
  663. right: 0;
  664. bottom: 0;
  665. z-index: 9999;
  666. display: flex;
  667. flex-direction: row;
  668. align-items: center;
  669. justify-content: center;
  670. background: rgba(0, 0, 0, 0.7);
  671. }
  672. .build {
  673. margin: 0 auto;
  674. width: 90%;
  675. height: auto;
  676. object-fit: contain;
  677. }
  678. .slide-fade-enter-active {
  679. animation: bounce-in 5s ease;
  680. }
  681. .slide-fade-leave-active {
  682. animation: bounce-in 5s reverse;
  683. }
  684. .cont-title-area {
  685. display: flex;
  686. flex-direction: row;
  687. align-items: center;
  688. justify-content: center;
  689. position: relative;
  690. margin-bottom: 10px;
  691. img {
  692. width: 284px;
  693. height: 32px;
  694. }
  695. .cont-title {
  696. font-size: 20px;
  697. font-weight: 900;
  698. font-family: "PingFangSC";
  699. width: 100%;
  700. position: absolute;
  701. display: flex;
  702. align-items: center;
  703. justify-content: center;
  704. top: -5px;
  705. color: #fff;
  706. }
  707. }
  708. @keyframes bounce-in {
  709. 0% {
  710. width: 0;
  711. }
  712. 100% {
  713. width: 200px;
  714. }
  715. }
  716. ::-webkit-scrollbar {
  717. width: 3px;
  718. height: 3px;
  719. }
  720. ::-webkit-scrollbar-thumb {
  721. //滑块部分
  722. // border-radius: 5px;
  723. background-color: #58cbbb;
  724. }
  725. ::-webkit-scrollbar-track {
  726. //轨道部分
  727. // box-shadow: inset 0 0 5px #ddd;
  728. background: #ddd;
  729. // border-radius: 5px;
  730. }
  731. }
  732. </style>