MenuCard.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733
  1. <template>
  2. <!-- 外边框 -->
  3. <div
  4. ref="menuCard"
  5. v-loading="!menuData"
  6. element-loading-spinner="el-icon-loading"
  7. element-loading-background="rgba(0, 0, 0, 0.8)"
  8. :class="$ifLeftMenu(menuData.title != undefined ? menuData.title : '') ? 'menuMainBoxA' : 'menuMainBox'"
  9. :style="{
  10. width: menuData.boxWidth ? menuData.boxWidth + 'px' : '410px',
  11. height: menuData.boxHeight ? menuData.boxHeight + 'px' : 'auto',
  12. border: menuData.type !== 'chart' && menuData.type !== 'legend' ? '' : '1px solid #2FB8FF',
  13. background: menuData.boxBackground ? menuData.boxBackground : ''
  14. }"
  15. @click="changeMenu()"
  16. >
  17. <!-- 头部 -->
  18. <div class="menuMainBox_top" v-if="menuData.type !== 'chart' && menuData.type !== 'legend'">
  19. <!-- 头部左侧 -->
  20. <div class="menuMainBox_top_left" :style="{ width: menuData.titleWidth ? menuData.titleWidth + '%' : '50%' }">
  21. <!-- 左侧箭头图标 -->
  22. <div class="menuMainBox_top_left_iconS" v-if="menuData.type !== 'imageMenu'"></div>
  23. <div class="menuMainBox_top_left_iconR" v-if="menuData.type === 'imageMenu'">
  24. <div
  25. class="menuMainBox_top_left_iconR_active"
  26. v-if="$ifLeftMenu(menuData.index != undefined ? menuData.title : '')"
  27. ></div>
  28. </div>
  29. <!-- 标题 -->
  30. <div class="menuMainBox_top_left_title">{{ menuData.title }}</div>
  31. <!-- 右侧倾斜图标1 -->
  32. <div class="menuMainBox_top_left_iconE menuMainBox_top_left_iconE1"></div>
  33. <!-- 右侧倾斜图标2 -->
  34. <div class="menuMainBox_top_left_iconE menuMainBox_top_left_iconE2"></div>
  35. </div>
  36. <!-- 右侧两个倾斜方框 -->
  37. <div class="menuMainBox_top_right" :style="{ width: menuData.titleWidth ? 110 - menuData.titleWidth + '%' : '60%' }">
  38. <!-- 方块1 -->
  39. <div class="menuMainBox_top_right_d1"></div>
  40. <!-- 方块2 -->
  41. <div class="menuMainBox_top_right_d2"></div>
  42. </div>
  43. <!-- 右上角三个点(蓝橙蓝) -->
  44. <div class="menuMainBox_top_topRight">
  45. <div></div>
  46. <div></div>
  47. <div></div>
  48. </div>
  49. </div>
  50. <!-- 头部下的折线 -->
  51. <div
  52. class="menuMainBox_topBottom"
  53. v-if="menuData.type !== 'chart' && menuData.type !== 'legend'"
  54. :style="{
  55. left: menuData.titleWidth
  56. ? (menuData.titleWidth <= 40 ? menuData.titleWidth - 39 : menuData.titleWidth - 40) + '%'
  57. : '10%'
  58. }"
  59. >
  60. <!-- 折线右上角圆球 -->
  61. <div></div>
  62. </div>
  63. <div class="menuMainBox_topChart" v-if="menuData.type === 'chart' || menuData.type === 'legend'">
  64. <div class="menuMainBox_topChart_title">
  65. {{ menuData.title }}
  66. </div>
  67. </div>
  68. <!-- -------------------------------------------------主题------------------------------------------ -->
  69. <div class="menuMainBox_main" v-if="menuData.type === 'card'">
  70. <!-- 上部 -->
  71. <div class="menuMainBox_main_top" v-if="!menuData.topSolt">
  72. <slot name="top"></slot>
  73. </div>
  74. <div class="menuMainBox_main_top" v-if="menuData.topSolt">
  75. <TagTableCard
  76. v-if="menuData.topSolt.commonName == 'TagTableCard'"
  77. :echartData="menuData.topSolt.commonData"
  78. @changeMousemoveIndex="changeMousemoveIndex"
  79. />
  80. <div class="menuCardFlex" v-if="menuData.topSolt.commonName == 'TagCard'" :style="{justifyContent: menuData.topSolt.commonData.length > 1 ? 'space-between' : 'center'}">
  81. <TagCard
  82. v-for="(item, index) in menuData.topSolt.commonData"
  83. :data="item"
  84. :index="index"
  85. :chartCardDataIndex="chartCardDataIndex"
  86. :key="item.title"
  87. @changeMousemoveIndex="changeMousemoveIndex"
  88. />
  89. </div>
  90. </div>
  91. <!-- 下部 -->
  92. <div class="menuMainBox_main_bottom" v-if="!menuData.bottomSolt">
  93. <slot name="bottom"></slot>
  94. </div>
  95. <div class="menuMainBox_main_bottom" v-if="menuData.bottomSolt">
  96. <ChartCard
  97. v-if="menuData.bottomSolt.commonName == 'ChartCard'"
  98. :title="menuData.topSolt.commonData[chartCardDataIndex].title"
  99. :categoryData="menuData.topSolt.commonData[chartCardDataIndex].categoryData"
  100. :valueData="menuData.topSolt.commonData[chartCardDataIndex].valueData"
  101. />
  102. </div>
  103. </div>
  104. <div class="menuMainBox_main" v-if="menuData.type === 'chart' || menuData.type === 'legend'">
  105. <div class="menuMainBox_main_all" v-if="!menuData.topSolt && !menuData.bottomSolt">
  106. <slot></slot>
  107. </div>
  108. </div>
  109. <div class="menuMainBox_main_image" v-if="menuData.type === 'imageMenu'">
  110. <div class="menuMainBox_main_image_box" :style="returnImageUrl(menuData.imageUrl, menuData.boxHeight)"></div>
  111. </div>
  112. <!-- 图例属性显示区域 -->
  113. <div v-if="menuData.type === 'legend'" class="legend"></div>
  114. </div>
  115. </template>
  116. <script>
  117. /**
  118. * 模块通用组件(首页和其他页面都有用到,由于综合功能和适配场景较多,配置组合可以联系开发人员:LiuMengxiang)
  119. * @author: LiuMengxiang
  120. * @Date: 2022年11月14-18日
  121. */
  122. import TagTableCard from "@/components/common/TagTableCard.vue";
  123. import ChartCard from "@/components/common/ChartCard.vue";
  124. import TagCard from "@/components/common/TagCard.vue";
  125. export default {
  126. name: "menuCard",
  127. components: { TagTableCard, ChartCard, TagCard },
  128. data() {
  129. return {
  130. chartCardDataIndex: 0
  131. };
  132. },
  133. mounted() {
  134. this.$nextTick(() => {
  135. // 只有第一次创建该页面,或刷新页面时。
  136. if (this.menuData.menuIndex) {
  137. if (this.$ifMenu(this.menuData.menuIndex, this.menuData.subMenuIndex)) {
  138. // 立即修改display为block
  139. this.$refs.menuCard.style.display = "block";
  140. setTimeout(() => {
  141. this.$refs.menuCard.style.transform = "translate(0,0)";
  142. this.$refs.menuCard.style.opacity = "0.9";
  143. });
  144. } else {
  145. // 如果不符合,页面创建时就直接隐藏
  146. this.$refs.menuCard.style.display = "none";
  147. }
  148. }
  149. // 当容器创建完成时,监听窗口改变大小时间
  150. this.$bus.$on("windowOnresize", this.windowOnresize);
  151. });
  152. },
  153. destroy() {
  154. // 当容器销毁时,需要停止监听该事件
  155. this.$bus.$off("windowOnresize");
  156. },
  157. /**
  158. * 公共card组件,接收参数如下:
  159. * menuData =>
  160. * type: 类型【card:卡片;chart:echart组件;imageMenu:图片菜单;legend:图例】(必填)
  161. * title: 标题(必填)
  162. *
  163. * index: 子菜单index(只有当type为imageMenu时有效)(只有type为imageMenu时为必填)
  164. * imageUrl: 菜单图片地址(只有当type为imageMenu时有效)(只有type为imageMenu时为必填)
  165. *
  166. * menuIndex: 显示头部菜单对应index(显示隐藏优化,组合属性)
  167. * subMenuIndex: 显示头部菜单对应subIndex(显示隐藏优化,组合属性)
  168. * minDomWidth: 最小屏幕宽度自动隐藏【单位:Number】(显示隐藏优化,组合属性)
  169. * position: 动画位置【left\right\top\bottom】(显示隐藏优化,组合属性)
  170. *
  171. * boxWidth: 宽,默认为410px【单位:Number】(非必填)
  172. * boxHeight: 高,默认为auto【单位:Number】(非必填)
  173. * boxBackground: 背景色,默认为渐变蓝色【支持#\rgba】(非必填)
  174. * titleWidth: 标题宽度,默认为50【单位:%】(非必填)
  175. * gotoPageInfo: 动态跳转页面信息(非必填)=>{index:要跳转的菜单index,subIndex:要跳转的子菜单index,name:菜单名称}
  176. *
  177. * topSolt: 头部替换插槽组件信息(非必填)=>{commonName:组件名称,commonData:组件支撑数据}
  178. * bottomSolt: 底部替换插槽组件信息(非必填)=>{commonName:组件名称,commonData:组件支撑数据}
  179. *
  180. */
  181. props: ["menuData"],
  182. methods: {
  183. // 当用户使用光标切换交互组件时触发
  184. changeMousemoveIndex(index) {
  185. if (this.chartCardDataIndex != index) {
  186. this.chartCardDataIndex = index;
  187. }
  188. },
  189. // 用户点击菜单标题时,调用全局函数,根据全局暂存对象
  190. changeMenu() {
  191. if (this.menuData != undefined && this.menuData.index != undefined && this.menuData.title != undefined) {
  192. this.$store.commit("changeLeftMenuTitle", this.menuData.title);
  193. if(this.menuData.menuIndex != undefined && this.menuData.subMenuIndex != undefined) {
  194. this.$store.commit("changeBackMenu", {index: this.menuData.menuIndex,subIndex: this.menuData.subMenuIndex});
  195. }
  196. }
  197. if (this.menuData != undefined && this.menuData.gotoPageInfo != undefined) {
  198. this.$store.commit("changeNavSelect", this.menuData.gotoPageInfo);
  199. }
  200. },
  201. // 根据菜单imageURL和boxHeight对象自动生成元素的样式(背景以及高度)
  202. returnImageUrl(imageUrl, boxHeight) {
  203. let returnStyle = "";
  204. if (boxHeight) {
  205. returnStyle += "heihgt:" + (boxHeight - 36) + "px;";
  206. }
  207. returnStyle += "background-image: url('" + imageUrl + "');";
  208. return returnStyle;
  209. },
  210. // 组件显示隐藏时,动画样式返回。
  211. showChange() {
  212. if (this.menuData != undefined && this.menuData.menuIndex != undefined) {
  213. if (this.$ifMenu(this.menuData.menuIndex, this.menuData.subMenuIndex)) {
  214. // 立即修改display为block
  215. this.$refs.menuCard.style.display = "block";
  216. setTimeout(() => {
  217. this.$refs.menuCard.style.transform = "translate(0,0)";
  218. this.$refs.menuCard.style.opacity = "0.9";
  219. });
  220. } else {
  221. // 延迟0.3s后修改display为none
  222. this.$refs.menuCard.style.transform = this.positionTotransform();
  223. this.$refs.menuCard.style.opacity = "0";
  224. setTimeout(() => {
  225. this.$refs.menuCard.style.display = "none";
  226. }, 300);
  227. }
  228. }
  229. },
  230. // 根据组件定位,返回不同的显示隐藏动画位置
  231. positionTotransform() {
  232. switch (this.menuData.position) {
  233. case "left":
  234. return "translate(-50%,0)";
  235. case "right":
  236. return "translate(50%,0)";
  237. case "top":
  238. return "translate(0,-50%)";
  239. case "bottom":
  240. return "translate(0,50%)";
  241. default:
  242. return "translate(0,0)";
  243. }
  244. },
  245. windowOnresize(windowClient) {
  246. // console.log("windowOnresize", windowClient);
  247. try {
  248. if (
  249. windowClient.windowsWidth != undefined &&
  250. this.$ifMenu(this.menuData.menuIndex, this.menuData.subMenuIndex) &&
  251. this.menuData.minDomWidth != null
  252. ) {
  253. if (
  254. this.menuData.minDomWidth < windowClient.windowsWidth &&
  255. this.$refs.menuCard != undefined &&
  256. this.$refs.menuCard.style.display == "none"
  257. ) {
  258. // 立即修改display为block
  259. this.$refs.menuCard.style.display = "block";
  260. setTimeout(() => {
  261. this.$refs.menuCard.style.transform = "translate(0,0)";
  262. this.$refs.menuCard.style.opacity = "0.9";
  263. }, 300);
  264. } else if (
  265. this.menuData.minDomWidth > windowClient.windowsWidth &&
  266. this.$refs.menuCard != undefined &&
  267. this.$refs.menuCard.style.display == "block"
  268. ) {
  269. // 延迟0.3s后修改display为none
  270. this.$refs.menuCard.style.transform = this.positionTotransform();
  271. this.$refs.menuCard.style.opacity = "0";
  272. setTimeout(() => {
  273. this.$refs.menuCard.style.display = "none";
  274. }, 300);
  275. }
  276. }
  277. } catch (error) {
  278. console.error("MenuCard组件出现异常:", error);
  279. }
  280. }
  281. },
  282. watch: {
  283. "$store.state.navSelect": {
  284. handler() {
  285. this.$nextTick(() => {
  286. this.showChange();
  287. });
  288. },
  289. deep: true
  290. }
  291. }
  292. };
  293. </script>
  294. <style lang="less" scoped>
  295. @borderColor: #00aaff;
  296. @borderColor32: #00aaff32;
  297. @borderColor64: #00aaff64;
  298. @topTitleBgLeft: #002645;
  299. @topTitleMinLeft: #002f56;
  300. @lightColor: #74ffff;
  301. .menuMainBox,
  302. .menuMainBoxA {
  303. transition: all 0.3s;
  304. }
  305. .menuMainBox {
  306. position: relative;
  307. z-index: 999;
  308. margin: 10px 5px;
  309. min-height: 60px;
  310. border: 2px solid transparent;
  311. border-image: --webkit-linear-gradient(to top, @borderColor, transparent) 1;
  312. border-image: --moz-linear-gradient(to top, @borderColor, transparent) 1;
  313. border-image: linear-gradient(to top, @borderColor, transparent) 1;
  314. &:hover {
  315. border-image: --webkit-linear-gradient(to top, @lightColor, transparent) 1;
  316. border-image: --moz-linear-gradient(to top, @lightColor, transparent) 1;
  317. border-image: linear-gradient(to top, @lightColor, transparent) 1;
  318. .menuMainBox_top {
  319. background-color: @lightColor;
  320. &_left {
  321. background-image: --webkit-linear-gradient(to left, @lightColor, #007dff);
  322. background-image: --moz-linear-gradient(to left, @lightColor, #007dff);
  323. background-image: linear-gradient(to left, @lightColor, #007dff);
  324. }
  325. }
  326. }
  327. cursor: pointer;
  328. -moz-user-select: none;
  329. -webkit-user-select: none;
  330. -ms-user-select: none;
  331. -khtml-user-select: none;
  332. user-select: none;
  333. // type !== chart
  334. &_top {
  335. position: relative;
  336. width: 100%;
  337. height: 36px;
  338. display: flex;
  339. align-items: center;
  340. flex-wrap: nowrap;
  341. align-content: center;
  342. overflow: hidden;
  343. background-color: @topTitleMinLeft;
  344. &_left {
  345. position: relative;
  346. display: flex;
  347. align-items: center;
  348. flex-wrap: nowrap;
  349. align-content: center;
  350. height: 100%;
  351. background-image: --webkit-linear-gradient(to left, @topTitleMinLeft, @borderColor, @topTitleMinLeft);
  352. background-image: --moz-linear-gradient(to left, @topTitleMinLeft, @borderColor, @topTitleMinLeft);
  353. background-image: linear-gradient(to left, @topTitleMinLeft, @borderColor, @topTitleMinLeft);
  354. border-bottom: 2px solid @borderColor;
  355. &_iconS {
  356. margin: 10px;
  357. width: 20px;
  358. height: 20px;
  359. background-image: linear-gradient(to top, #0071b2, #1deef5);
  360. clip-path: polygon(0 0, 100% 50%, 0 100%, 30% 50%, 0 0);
  361. }
  362. &_iconR {
  363. position: relative;
  364. margin: 15px;
  365. width: 10px;
  366. height: 10px;
  367. background-image: transparent;
  368. border: 1px solid #1deef5;
  369. border-radius: 20px;
  370. &_active {
  371. position: absolute;
  372. transform: translate(-50%, -50%);
  373. top: 50%;
  374. left: 50%;
  375. width: 5px;
  376. height: 5px;
  377. background-color: #1deef5;
  378. border-radius: 20px;
  379. }
  380. }
  381. &_title {
  382. font-size: 28px;
  383. font-family: YouSheBiaoTiHei;
  384. font-weight: 400;
  385. color: #ffffff;
  386. }
  387. &_iconE {
  388. position: absolute;
  389. margin-left: 10px;
  390. width: 15px;
  391. height: 30px;
  392. background-image: linear-gradient(to bottom, transparent, transparent, #00a6c0);
  393. transform: skew(-45deg);
  394. }
  395. &_iconE1 {
  396. right: 27px;
  397. }
  398. &_iconE2 {
  399. right: 7px;
  400. }
  401. }
  402. &_right {
  403. position: absolute;
  404. right: -10%;
  405. height: 100%;
  406. border-top: 2px solid @borderColor;
  407. border-left: 2px solid @borderColor;
  408. transform: skew(-45deg);
  409. background-color: @topTitleBgLeft;
  410. border-image: --webkit-linear-gradient(to right, @borderColor, @topTitleBgLeft) 1;
  411. border-image: --moz-linear-gradient(to right, @borderColor, @topTitleBgLeft) 1;
  412. border-image: linear-gradient(to right, @borderColor, @topTitleBgLeft) 1;
  413. &_d1 {
  414. position: absolute;
  415. left: 10px;
  416. width: 50px;
  417. height: 20px;
  418. background-color: @borderColor64;
  419. }
  420. &_d2 {
  421. position: absolute;
  422. left: 70px;
  423. width: 80px;
  424. height: 10px;
  425. background-color: @borderColor32;
  426. }
  427. }
  428. &_topRight {
  429. position: absolute;
  430. top: 0;
  431. right: 0;
  432. display: flex;
  433. div:nth-child(1) {
  434. width: 5px;
  435. height: 2px;
  436. background-color: @borderColor;
  437. }
  438. div:nth-child(2) {
  439. margin: 0 1px;
  440. width: 5px;
  441. height: 2px;
  442. background-color: #f19b56;
  443. }
  444. div:nth-child(3) {
  445. width: 5px;
  446. height: 2px;
  447. background-color: @borderColor;
  448. }
  449. }
  450. }
  451. &:hover {
  452. .menuMainBox_main_image_box {
  453. background-size: 110% 220px;
  454. }
  455. }
  456. }
  457. // 选中后的样式
  458. .menuMainBoxA {
  459. position: relative;
  460. z-index: 999;
  461. margin: 10px 5px;
  462. min-height: 60px;
  463. border: 2px solid transparent;
  464. border-image: --webkit-linear-gradient(to top, @lightColor, transparent) 1;
  465. border-image: --moz-linear-gradient(to top, @lightColor, transparent) 1;
  466. border-image: linear-gradient(to top, @lightColor, transparent) 1;
  467. cursor: pointer;
  468. -moz-user-select: none;
  469. -webkit-user-select: none;
  470. -ms-user-select: none;
  471. -khtml-user-select: none;
  472. user-select: none;
  473. // type !== chart
  474. .menuMainBox_top {
  475. position: relative;
  476. width: 100%;
  477. height: 36px;
  478. display: flex;
  479. align-items: center;
  480. flex-wrap: nowrap;
  481. align-content: center;
  482. overflow: hidden;
  483. background-color: @lightColor;
  484. &_left {
  485. position: relative;
  486. display: flex;
  487. align-items: center;
  488. flex-wrap: nowrap;
  489. align-content: center;
  490. height: 100%;
  491. border-bottom: 2px solid @borderColor;
  492. background-image: --webkit-linear-gradient(to left, @lightColor, #007dff);
  493. background-image: --moz-linear-gradient(to left, @lightColor, #007dff);
  494. background-image: linear-gradient(to left, @lightColor, #007dff);
  495. &_iconS {
  496. margin: 10px;
  497. width: 20px;
  498. height: 20px;
  499. background-image: linear-gradient(to top, #0071b2, #1deef5);
  500. clip-path: polygon(0 0, 100% 50%, 0 100%, 30% 50%, 0 0);
  501. }
  502. &_iconR {
  503. position: relative;
  504. margin: 15px;
  505. width: 10px;
  506. height: 10px;
  507. background-image: transparent;
  508. border: 1px solid #1deef5;
  509. border-radius: 20px;
  510. &_active {
  511. position: absolute;
  512. transform: translate(-50%, -50%);
  513. top: 50%;
  514. left: 50%;
  515. width: 5px;
  516. height: 5px;
  517. background-color: #1deef5;
  518. border-radius: 20px;
  519. }
  520. }
  521. &_title {
  522. font-size: 28px;
  523. font-family: YouSheBiaoTiHei;
  524. font-weight: 400;
  525. color: #ffffff;
  526. }
  527. &_iconE {
  528. position: absolute;
  529. margin-left: 10px;
  530. width: 15px;
  531. height: 30px;
  532. background-image: linear-gradient(to bottom, transparent, transparent, #00a6c0);
  533. transform: skew(-45deg);
  534. }
  535. &_iconE1 {
  536. right: 27px;
  537. }
  538. &_iconE2 {
  539. right: 7px;
  540. }
  541. }
  542. &_right {
  543. position: absolute;
  544. right: -10%;
  545. height: 100%;
  546. border-top: 2px solid @borderColor;
  547. border-left: 2px solid @borderColor;
  548. transform: skew(-45deg);
  549. background-color: @topTitleBgLeft;
  550. border-image: --webkit-linear-gradient(to right, @borderColor, @topTitleBgLeft) 1;
  551. border-image: --moz-linear-gradient(to right, @borderColor, @topTitleBgLeft) 1;
  552. border-image: linear-gradient(to right, @borderColor, @topTitleBgLeft) 1;
  553. &_d1 {
  554. position: absolute;
  555. left: 10px;
  556. width: 50px;
  557. height: 20px;
  558. background-color: @borderColor64;
  559. }
  560. &_d2 {
  561. position: absolute;
  562. left: 70px;
  563. width: 80px;
  564. height: 10px;
  565. background-color: @borderColor32;
  566. }
  567. }
  568. &_topRight {
  569. position: absolute;
  570. top: 0;
  571. right: 0;
  572. display: flex;
  573. div:nth-child(1) {
  574. width: 5px;
  575. height: 2px;
  576. background-color: @borderColor;
  577. }
  578. div:nth-child(2) {
  579. margin: 0 1px;
  580. width: 5px;
  581. height: 2px;
  582. background-color: #f19b56;
  583. }
  584. div:nth-child(3) {
  585. width: 5px;
  586. height: 2px;
  587. background-color: @borderColor;
  588. }
  589. }
  590. }
  591. &:hover {
  592. .menuMainBox_main_image_box {
  593. background-size: 110% 220px;
  594. }
  595. }
  596. }
  597. // 公共样式
  598. .menuMainBox_topBottom {
  599. position: absolute;
  600. top: 20px;
  601. width: 38%;
  602. height: 20px;
  603. border-bottom: 2px solid @borderColor;
  604. border-right: 2px solid @borderColor;
  605. transform: skew(-45deg);
  606. border-image: --webkit-linear-gradient(to left, @borderColor, transparent) 1;
  607. border-image: --moz-linear-gradient(to left, @borderColor, transparent) 1;
  608. border-image: linear-gradient(to left, @borderColor, transparent) 1;
  609. z-index: 9999;
  610. div {
  611. position: absolute;
  612. top: -2px;
  613. right: -2px;
  614. width: 4px;
  615. height: 4px;
  616. border-radius: 4px;
  617. background-color: @borderColor;
  618. transform: skew(45deg);
  619. }
  620. }
  621. // type === chart
  622. .menuMainBox_topChart {
  623. width: 100%;
  624. height: 30px;
  625. position: relative;
  626. display: flex;
  627. align-items: center;
  628. flex-wrap: nowrap;
  629. justify-content: center;
  630. align-content: center;
  631. background-image: --webkit-linear-gradient(to left, @topTitleMinLeft, @borderColor, @topTitleMinLeft);
  632. background-image: --moz-linear-gradient(to left, @topTitleMinLeft, @borderColor, @topTitleMinLeft);
  633. background-image: linear-gradient(to left, @topTitleMinLeft, @borderColor, @topTitleMinLeft);
  634. &_title {
  635. font-size: 18px;
  636. font-family: PingFang SC;
  637. font-weight: 300;
  638. color: #e6e6e6;
  639. line-height: 60px;
  640. }
  641. }
  642. // 卡片主题
  643. .menuMainBox_main {
  644. position: relative;
  645. padding-top: 10px;
  646. width: 100%;
  647. height: calc(100% - 30px);
  648. background-image: --webkit-linear-gradient(to top, @topTitleMinLeft, @topTitleBgLeft);
  649. background-image: --moz-linear-gradient(to top, @topTitleMinLeft, @topTitleBgLeft);
  650. background-image: linear-gradient(to top, @topTitleMinLeft, @topTitleBgLeft);
  651. box-sizing: border-box;
  652. overflow-x: hidden;
  653. overflow-y: auto;
  654. scrollbar-width: none; /* Firefox */
  655. -ms-overflow-style: none; /* IE 10+ */
  656. &::-webkit-scrollbar {
  657. display: none; /* Chrome Safari */
  658. }
  659. &_top {
  660. margin: 0 10px;
  661. width: calc(100% - 20px);
  662. }
  663. &_bottom {
  664. margin: 0 10px;
  665. width: calc(100% - 20px);
  666. }
  667. &_all {
  668. margin: 0 10px;
  669. width: calc(100% - 20px);
  670. height: calc(100% - 10px);
  671. }
  672. &_image {
  673. margin: 0px 10px;
  674. width: calc(100% - 20px);
  675. height: 210px;
  676. background-size: 100% 200px;
  677. background-repeat: no-repeat;
  678. }
  679. }
  680. // 卡片主题
  681. .menuMainBox_main_image {
  682. position: relative;
  683. margin: 0;
  684. width: 100%;
  685. height: calc(100% - 30px);
  686. &_box {
  687. width: 100%;
  688. height: 200px;
  689. background-size: 100% 200px;
  690. background-repeat: no-repeat;
  691. transition: all 0.3s;
  692. }
  693. }
  694. // 图例上部图片
  695. .legend {
  696. position: absolute;
  697. left: -2px;
  698. top: -13px;
  699. width: 104px;
  700. height: 20px;
  701. background: url("../../assets/home/legend_line.png") no-repeat center;
  702. }
  703. // tagcard
  704. .menuCardFlex {
  705. display: flex;
  706. align-content: center;
  707. align-items: center;
  708. justify-content: space-between;
  709. flex-wrap: nowrap;
  710. position: relative;
  711. .borders {
  712. position: absolute;
  713. left: 50%;
  714. top: 50%;
  715. transform: translate(-50%, -50%) rotate(45deg);
  716. width: 110px;
  717. height: 100px;
  718. background: linear-gradient(to left, @borderColor, @borderColor) left top no-repeat,
  719. linear-gradient(to bottom, @borderColor, @borderColor) left top no-repeat,
  720. linear-gradient(to left, @borderColor, @borderColor) right top no-repeat,
  721. linear-gradient(to bottom, @borderColor, @borderColor) right top no-repeat,
  722. linear-gradient(to left, @borderColor, @borderColor) left bottom no-repeat,
  723. linear-gradient(to bottom, @borderColor, @borderColor) left bottom no-repeat,
  724. linear-gradient(to left, @borderColor, @borderColor) right bottom no-repeat,
  725. linear-gradient(to left, @borderColor, @borderColor) right bottom no-repeat;
  726. background-size: 6px 6px, 6px 6px, 6px 6px, 6px 6px;
  727. }
  728. }
  729. </style>