index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932
  1. <template>
  2. <div class="app-container">
  3. <el-row>
  4. <el-col :span="24">
  5. <div class="cell">
  6. <div class="cell-title">
  7. <div class="title-left">
  8. <div class="title">数据中台</div>
  9. </div>
  10. </div>
  11. <div class="cell-body">
  12. <el-row type="flex">
  13. <el-col :span="24">
  14. <div class="header">
  15. <div class="icon"></div>
  16. <div class="title">经营概况</div>
  17. </div>
  18. <div class="content">
  19. <div class="con-con con-bg-1">
  20. <div class="con-title">民宿总数</div>
  21. <div class="con-num">{{ total_number_of_accommodation }}</div>
  22. </div>
  23. <div class="con-con con-bg-2">
  24. <div class="con-title">今日访问量</div>
  25. <div class="con-num">{{ todays_traffic }}</div>
  26. <div v-if="more_traffic_today_than_yesterday >= 0" class="con-num">较昨天 ▲ {{ more_traffic_today_than_yesterday }}</div>
  27. <div v-else class="con-num">较昨天 ▼ {{ more_traffic_today_than_yesterday }}</div>
  28. </div>
  29. <div class="con-con con-bg-3">
  30. <div class="con-title">今日销售额</div>
  31. <div class="con-num">{{ todays_sales }}</div>
  32. <div v-if="sales_are_higher_today_than_yesterday >= 0" class="con-num">较昨天 ▲ {{ sales_are_higher_today_than_yesterday }}
  33. </div>
  34. <div v-else class="con-num">较昨天 ▼ {{ sales_are_higher_today_than_yesterday }}</div>
  35. </div>
  36. <div class="con-con con-bg-4">
  37. <div class="con-title">今日订单量</div>
  38. <div class="con-num">{{ order_quantity_today }}</div>
  39. <div v-if="todays_order_volume_is_higher_than_yesterday >= 0" class="con-num">较昨天 ▲
  40. {{ todays_order_volume_is_higher_than_yesterday }}
  41. </div>
  42. <div v-else class="con-num">较昨天 ▼ {{ todays_order_volume_is_higher_than_yesterday }}</div>
  43. </div>
  44. </div>
  45. </el-col>
  46. </el-row>
  47. <el-row type="flex">
  48. <el-col :span="6">
  49. <div class="header">
  50. <div class="icon"></div>
  51. <div class="title">订单状态占比</div>
  52. </div>
  53. <div class="content">
  54. <div ref="chartPie" style="width: 400px; height: 330px;"></div>
  55. </div>
  56. </el-col>
  57. <el-col :span="6">
  58. <div class="header">
  59. <div class="icon"></div>
  60. <div class="title">民宿统计</div>
  61. </div>
  62. <div class="content">
  63. <div ref="chartBar" style="width: 400px; height: 330px;"></div>
  64. </div>
  65. </el-col>
  66. <el-col :span="12">
  67. <div class="head">
  68. <div class="header">
  69. <div class="icon"></div>
  70. <div class="title">访问量趋势</div>
  71. </div>
  72. <div class="ctrs">
  73. <el-button-group>
  74. <el-button size="mini" :class="{ active: activeVisitButton === 'activeVisitButton1' }"
  75. @click="toggleVisitButton('activeVisitButton1')">今日</el-button>
  76. <el-button size="mini" :class="{ active: activeVisitButton === 'activeVisitButton2' }"
  77. @click="toggleVisitButton('activeVisitButton2')">本周</el-button>
  78. <el-button size="mini" :class="{ active: activeVisitButton === 'activeVisitButton3' }"
  79. @click="toggleVisitButton('activeVisitButton3')">本月</el-button>
  80. </el-button-group>
  81. <el-date-picker ref="datePickerRef" v-model="visit_date" type="daterange" align="right" unlink-panels
  82. range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期" class="custom-date-picker">
  83. </el-date-picker>
  84. </div>
  85. </div>
  86. <div class="content">
  87. <div ref="chartArea" style="width: 100%; height: 330px; box-sizing: border-box;"></div>
  88. </div>
  89. </el-col>
  90. </el-row>
  91. <el-row type="flex">
  92. <el-col :span="12">
  93. <div class="head">
  94. <div class="header">
  95. <div class="icon"></div>
  96. <div class="title">用户画像</div>
  97. </div>
  98. <div class="ctrs">
  99. <el-button-group>
  100. <el-button size="mini" :class="{ active: activeUserButton === 'activeUserButton1' }"
  101. @click="toggleUserButton('activeUserButton1')">今日</el-button>
  102. <el-button size="mini" :class="{ active: activeUserButton === 'activeUserButton2' }"
  103. @click="toggleUserButton('activeUserButton2')">本月</el-button>
  104. <el-button size="mini" :class="{ active: activeUserButton === 'activeUserButton3' }"
  105. @click="toggleUserButton('activeUserButton3')">本年</el-button>
  106. </el-button-group>
  107. </div>
  108. </div>
  109. <div class="content">
  110. <div class="left-pie">
  111. <div ref="chartUserPie" style="width: 100%; height: 330px; box-sizing: border-box;"></div>
  112. </div>
  113. <div class="right-bar">
  114. <div ref="chartUserBar" style="width: 100%; height: 330px; box-sizing: border-box;"></div>
  115. </div>
  116. </div>
  117. </el-col>
  118. <el-col :span="6">
  119. <div class="head">
  120. <div class="header">
  121. <div class="icon"></div>
  122. <div class="title">订单量排行</div>
  123. </div>
  124. <div class="ctrs">
  125. <el-button-group>
  126. <el-button size="mini" :class="{ active: activeOrderButton === 'activeOrderButton1' }"
  127. @click="toggleOrderButton('activeOrderButton1')">今日</el-button>
  128. <el-button size="mini" :class="{ active: activeOrderButton === 'activeOrderButton2' }"
  129. @click="toggleOrderButton('activeOrderButton2')">本月</el-button>
  130. <el-button size="mini" :class="{ active: activeOrderButton === 'activeOrderButton3' }"
  131. @click="toggleOrderButton('activeOrderButton3')">本年</el-button>
  132. </el-button-group>
  133. </div>
  134. </div>
  135. <div class="content">
  136. <el-table :data="tableOrderData" style="width: 100%" height="330">
  137. <el-table-column fixed prop="rark" label="排行" align="center" width="80px">
  138. </el-table-column>
  139. <el-table-column prop="hotelName" label="民宿名称" align="center">
  140. </el-table-column>
  141. <el-table-column prop="bookNum" label="订单量" align="center">
  142. </el-table-column>
  143. </el-table>
  144. </div>
  145. </el-col>
  146. <el-col :span="6">
  147. <div class="head">
  148. <div class="header">
  149. <div class="icon"></div>
  150. <div class="title">销售额排行榜</div>
  151. </div>
  152. <div class="ctrs">
  153. <el-button-group>
  154. <el-button size="mini" :class="{ active: activeSellButton === 'activeSellButton1' }"
  155. @click="toggleSellButton('activeSellButton1')">今日</el-button>
  156. <el-button size="mini" :class="{ active: activeSellButton === 'activeSellButton2' }"
  157. @click="toggleSellButton('activeSellButton2')">本月</el-button>
  158. <el-button size="mini" :class="{ active: activeSellButton === 'activeSellButton3' }"
  159. @click="toggleSellButton('activeSellButton3')">本年</el-button>
  160. </el-button-group>
  161. </div>
  162. </div>
  163. <div class="content">
  164. <el-table :data="tableSellData" style="width: 100%" height="330">
  165. <el-table-column fixed prop="rark" label="排行" align="center" width="80px">
  166. </el-table-column>
  167. <el-table-column prop="hotelName" label="民宿名称" align="center">
  168. </el-table-column>
  169. <el-table-column prop="salesAmount" label="销售额" align="center">
  170. </el-table-column>
  171. </el-table>
  172. </div>
  173. </el-col>
  174. </el-row>
  175. </div>
  176. </div>
  177. </el-col>
  178. </el-row>
  179. </div>
  180. </template>
  181. <script>
  182. import * as echarts from 'echarts';
  183. import {
  184. getOrderData,
  185. getHomestayStatistics,
  186. getOrderVolumeRanking,
  187. getQuerySalesRankings,
  188. getManagementProfile
  189. } from '@/api/data';
  190. import {
  191. getDateComponents
  192. } from '@/js/common';
  193. export default {
  194. data() {
  195. return {
  196. total_number_of_accommodation: 0,
  197. todays_traffic: 0,
  198. more_traffic_today_than_yesterday: 0,
  199. todays_sales: 0,
  200. sales_are_higher_today_than_yesterday: '0.00',
  201. order_quantity_today: 0,
  202. todays_order_volume_is_higher_than_yesterday: 0,
  203. tableOrderData: [], // 订单量排行
  204. tableSellData: [], // 销售量排行
  205. chartOrderPieData: [], // 订单状态占比数据
  206. chartUserPieData: [{
  207. value: 335,
  208. name: '男'
  209. },
  210. {
  211. value: 310,
  212. name: '女'
  213. }
  214. ],
  215. chartBarData: [{
  216. value: 335,
  217. name: '中源乡'
  218. },
  219. {
  220. value: 310,
  221. name: '中源乡1'
  222. },
  223. {
  224. value: 234,
  225. name: '中源乡2'
  226. },
  227. {
  228. value: 135,
  229. name: '中源乡3'
  230. },
  231. {
  232. value: 1548,
  233. name: '中源乡4'
  234. },
  235. {
  236. value: 1548,
  237. name: '中源乡5'
  238. }
  239. ],
  240. chartUserBarData: [{
  241. value: 335,
  242. name: '24岁及以下'
  243. },
  244. {
  245. value: 310,
  246. name: '25-30岁'
  247. },
  248. {
  249. value: 234,
  250. name: '31-35岁'
  251. },
  252. {
  253. value: 135,
  254. name: '36-40岁'
  255. },
  256. {
  257. value: 1548,
  258. name: '41岁及以上'
  259. }
  260. ],
  261. chartPie: null,
  262. chartBar: null,
  263. chartArea: null,
  264. visit_date: null,
  265. activeVisitButton: 'activeVisitButton2',
  266. activeUserButton: 'activeUserButton2',
  267. activeOrderButton: 'activeOrderButton2',
  268. activeSellButton: 'activeSellButton2',
  269. }
  270. },
  271. created() {
  272. },
  273. mounted() {
  274. // 获取订单状态占比数据
  275. this.getOrderData()
  276. // 查询各县民宿数量 民宿统计
  277. this.getHomestayStatistics()
  278. // 查询订单量排行
  279. this.getOrderVolumeRanking(2)
  280. // 查询销售额排行
  281. this.getQuerySalesRankings(2)
  282. // 查询经营概况
  283. this.getManagementProfile()
  284. this.pieUser()
  285. this.barUser()
  286. this.area()
  287. // 自适应窗口大小
  288. window.addEventListener('resize', () => {
  289. this.chartPie.resize();
  290. this.chartBar.resize();
  291. });
  292. },
  293. methods: {
  294. toggleVisitButton(buttonName) {
  295. this.activeVisitButton = buttonName;
  296. },
  297. toggleUserButton(buttonName) {
  298. this.activeUserButton = buttonName;
  299. },
  300. // 销售排行不同时间切换
  301. toggleSellButton(buttonName) {
  302. if (buttonName === 'activeSellButton1') {
  303. this.getQuerySalesRankings(1)
  304. } else if (buttonName === 'activeSellButton2') {
  305. this.getQuerySalesRankings(2)
  306. } else if (buttonName === 'activeSellButton3') {
  307. this.getQuerySalesRankings(3)
  308. } else {
  309. this.$message.error('未知时间')
  310. }
  311. this.activeSellButton = buttonName;
  312. },
  313. getManagementProfile() {
  314. getManagementProfile().then((res) => {
  315. // console.log(res);
  316. if (typeof res.code == 'undefined' || res.code == '') {
  317. this.$message.error('返回数据格式问题,code未获取到!');
  318. return;
  319. }
  320. if (res.code === 200) {
  321. // bookNumyDay;//昨日订单量
  322. // salesAmountyDay;//昨日销售量
  323. const tempdata = res.data
  324. this.total_number_of_accommodation = tempdata.hotelSum // 民宿总数
  325. // 访问量
  326. this.todays_traffic = 0
  327. this.more_traffic_today_than_yesterday = 0
  328. // 销售额
  329. this.todays_sales = tempdata.salesAmountDay // 今日销售量
  330. this.sales_are_higher_today_than_yesterday = tempdata.salesAmountGrowth.toFixed(2) // 销售量增长量
  331. // 订单量
  332. this.order_quantity_today = tempdata.bookNumDay // 今日订单量
  333. this.todays_order_volume_is_higher_than_yesterday = tempdata.bookNumGrowth // 订单量增长量
  334. } else {
  335. this.$message.error(res.message);
  336. }
  337. }).catch((err) => {
  338. // console.log(err);
  339. this.$message.error(err.message);
  340. })
  341. },
  342. /**
  343. * 查询销售额排行
  344. */
  345. getQuerySalesRankings(param) {
  346. getQuerySalesRankings(param).then((res) => {
  347. // console.log(res);
  348. if (typeof res.code == 'undefined' || res.code == '') {
  349. this.$message.error('返回数据格式问题,code未获取到!');
  350. return;
  351. }
  352. if (res.code === 200) {
  353. this.tableSellData = []
  354. for (var i = 0; i < res.data.length; i++) {
  355. this.tableSellData.push({
  356. rark: res.data[i].rank,
  357. bookNum: res.data[i].bookNum,
  358. hotelName: res.data[i].hotelName,
  359. salesAmount: res.data[i].salesAmount
  360. })
  361. }
  362. } else {
  363. this.$message.error(res.message);
  364. }
  365. }).catch((err) => {
  366. // console.log(err);
  367. this.$message.error(err.message);
  368. })
  369. },
  370. // 订单排行不同时间切换
  371. toggleOrderButton(buttonName) {
  372. if (buttonName === 'activeOrderButton1') {
  373. this.getOrderVolumeRanking(1)
  374. } else if (buttonName === 'activeOrderButton2') {
  375. this.getOrderVolumeRanking(2)
  376. } else if (buttonName === 'activeOrderButton3') {
  377. this.getOrderVolumeRanking(3)
  378. } else {
  379. this.$message.error('未知时间')
  380. }
  381. this.activeOrderButton = buttonName;
  382. },
  383. /**
  384. * 查询订单量排行
  385. */
  386. getOrderVolumeRanking(param) {
  387. getOrderVolumeRanking(param).then((res) => {
  388. // console.log(res);
  389. if (typeof res.code == 'undefined' || res.code == '') {
  390. this.$message.error('返回数据格式问题,code未获取到!');
  391. return;
  392. }
  393. if (res.code === 200) {
  394. this.tableOrderData = []
  395. for (var i = 0; i < res.data.length; i++) {
  396. this.tableOrderData.push({
  397. rark: res.data[i].rank,
  398. bookNum: res.data[i].bookNum,
  399. hotelName: res.data[i].hotelName,
  400. salesAmount: res.data[i].salesAmount
  401. })
  402. }
  403. } else {
  404. this.$message.error(res.message);
  405. }
  406. }).catch((err) => {
  407. // console.log(err);
  408. this.$message.error(err.message);
  409. })
  410. },
  411. /**
  412. * 查询各县民宿数量 民宿统计
  413. */
  414. getHomestayStatistics() {
  415. getHomestayStatistics().then((res) => {
  416. // console.log(res);
  417. if (typeof res.code == 'undefined' || res.code == '') {
  418. this.$message.error('返回数据格式问题,code未获取到!');
  419. return;
  420. }
  421. if (res.code === 200) {
  422. this.chartBarData = []
  423. for (var i = 0; i < res.data.length; i++) {
  424. this.chartBarData.push({
  425. value: res.data[i].hotelNum,
  426. name: res.data[i].hposition
  427. })
  428. }
  429. this.bar()
  430. } else {
  431. this.$message.error(res.message);
  432. }
  433. }).catch((err) => {
  434. // console.log(err);
  435. this.$message.error(err.message);
  436. })
  437. },
  438. // 查询各县民宿数量 民宿统计
  439. bar() {
  440. this.chartBar = echarts.init(this.$refs.chartBar);
  441. this.chartBar.setOption({
  442. tooltip: {
  443. trigger: 'axis',
  444. axisPointer: {
  445. type: 'line',
  446. label: {
  447. backgroundColor: '#6a7985'
  448. }
  449. }
  450. },
  451. legend: {
  452. type: 'plain',
  453. orient: 'horizontal',
  454. left: 'center',
  455. top: 'bottom'
  456. },
  457. grid: {
  458. left: 0,
  459. top: 0,
  460. right: 15,
  461. bottom: 0,
  462. containLabel: true
  463. },
  464. xAxis: {
  465. type: 'value'
  466. },
  467. yAxis: {
  468. type: 'category',
  469. axisLabel: {
  470. show: true,
  471. interval: 0,
  472. // rotate: 30
  473. formatter: function(params) {
  474. var newParamsName = ""; // 最终拼接成的字符串
  475. var paramsNameNumber = params.length; // 实际标签的字数
  476. var provideNumber = 6; // 每行能显示的字的个数
  477. var rowNumber = Math.ceil(paramsNameNumber / provideNumber); // 换行的话,需要显示几行,向上取整
  478. /**
  479. * 判断标签的个数是否大于规定的个数, 如果大于,则进行换行处理 如果不大于,即等于或小于,就返回原标签
  480. */
  481. // 条件等同于rowNumber>1
  482. if (paramsNameNumber > provideNumber) {
  483. /** 循环每一行,p表示行 */
  484. for (var p = 0; p < rowNumber; p++) {
  485. var tempStr = ""; // 表示每一次截取的字符串
  486. var start = p * provideNumber; // 开始截取的位置
  487. var end = start + provideNumber; // 结束截取的位置
  488. // 此处特殊处理最后一行的索引值
  489. if (p == rowNumber - 1) {
  490. // 最后一次不换行
  491. tempStr = params.substring(start, paramsNameNumber);
  492. } else {
  493. // 每一次拼接字符串并换行
  494. // tempStr = params.substring(start, end) + "\n";
  495. tempStr = params.substring(start, end) + "…";
  496. }
  497. newParamsName += tempStr; // 最终拼成的字符串
  498. break;
  499. }
  500. } else {
  501. // 将旧标签的值赋给新标签
  502. newParamsName = params;
  503. }
  504. //将最终的字符串返回
  505. return newParamsName
  506. }
  507. },
  508. data: this.chartBarData.map(item => item.name)
  509. },
  510. series: [{
  511. type: 'bar',
  512. data: this.chartBarData,
  513. itemStyle: {
  514. color: '#8080FF'
  515. }
  516. }]
  517. });
  518. },
  519. /**
  520. * 获取订单状态占比数据
  521. */
  522. getOrderData() {
  523. getOrderData().then((res) => {
  524. // console.log(res);
  525. if (typeof res.code == 'undefined' || res.code == '') {
  526. this.$message.error('返回数据格式问题,code未获取到!');
  527. return;
  528. }
  529. if (res.code === 200) {
  530. this.chartOrderPieData = []
  531. for (var i = 0; i < res.data.length; i++) {
  532. this.chartOrderPieData.push({
  533. value: res.data[i].statusNum,
  534. name: res.data[i].orderStatusName
  535. })
  536. }
  537. this.orderPie()
  538. } else {
  539. this.$message.error(res.message);
  540. }
  541. }).catch((err) => {
  542. // console.log(err);
  543. this.$message.error(err.message);
  544. })
  545. },
  546. // 订单状态占比 饼图
  547. orderPie() {
  548. this.chartPie = echarts.init(this.$refs.chartPie);
  549. this.chartPie.setOption({
  550. tooltip: {
  551. trigger: "item",
  552. },
  553. legend: {
  554. orient: 'horizontal',
  555. left: 'center',
  556. top: 'bottom'
  557. },
  558. grid: {
  559. left: '3%',
  560. right: '4%',
  561. bottom: '28%',
  562. top: '3%'
  563. },
  564. series: [{
  565. type: 'pie',
  566. radius: ['30%', '50%'],
  567. data: this.chartOrderPieData,
  568. label: {
  569. show: true,
  570. position: 'outer',
  571. distance: 0,
  572. formatter: '{c}'
  573. },
  574. emphasis: {
  575. label: {
  576. show: true,
  577. fontWeight: 'bold'
  578. }
  579. }
  580. }]
  581. });
  582. },
  583. // 饼图
  584. pieUser() {
  585. this.chartUserPie = echarts.init(this.$refs.chartUserPie);
  586. this.chartUserPie.setOption({
  587. tooltip: {
  588. trigger: "item",
  589. },
  590. title: {
  591. text: '客户性别占比',
  592. left:'center',
  593. textAlign: 'left',
  594. textStyle: {
  595. fontSize: 14
  596. }
  597. },
  598. legend: {
  599. orient: 'horizontal',
  600. bottom: 10
  601. },
  602. grid: {
  603. left: '3%',
  604. right: '4%',
  605. bottom: '3%',
  606. top: '3%'
  607. },
  608. series: [{
  609. type: 'pie',
  610. radius: ['30%', '50%'],
  611. data: this.chartUserPieData,
  612. label: {
  613. show: true,
  614. position: 'outer',
  615. distance: 0,
  616. formatter: '{c}'
  617. },
  618. emphasis: {
  619. label: {
  620. show: true,
  621. fontWeight: 'bold'
  622. }
  623. }
  624. }]
  625. });
  626. },
  627. // 柱形图
  628. barUser() {
  629. this.chartUserBar = echarts.init(this.$refs.chartUserBar);
  630. this.chartUserBar.setOption({
  631. tooltip: {
  632. trigger: 'axis',
  633. axisPointer: {
  634. type: 'line',
  635. label: {
  636. backgroundColor: '#6a7985'
  637. }
  638. }
  639. },
  640. title: {
  641. text: '人群年龄占比',
  642. left:'center',
  643. textStyle: {
  644. fontSize: 14
  645. }
  646. },
  647. legend: {
  648. type: 'plain',
  649. orient: 'horizontal',
  650. bottom: 10
  651. },
  652. grid: {
  653. left: '8%',
  654. right: '5%',
  655. bottom: '3%',
  656. containLabel: true
  657. },
  658. xAxis: {
  659. type: 'value',
  660. },
  661. yAxis: {
  662. type: 'category',
  663. axisLabel: {
  664. show: true,
  665. interval: 0,
  666. // rotate: 60
  667. },
  668. data: this.chartUserBarData.map(item => item.name)
  669. },
  670. series: [{
  671. type: 'bar',
  672. data: this.chartUserBarData,
  673. itemStyle: {
  674. color: '#8080FF'
  675. }
  676. }]
  677. });
  678. },
  679. // 面积图
  680. area() {
  681. this.chartArea = echarts.init(this.$refs.chartArea);
  682. this.chartArea.setOption({
  683. tooltip: {
  684. trigger: 'axis',
  685. axisPointer: {
  686. type: 'shadow',
  687. label: {
  688. backgroundColor: '#6a7985'
  689. }
  690. }
  691. },
  692. grid: {
  693. left: '8%',
  694. right: '5%',
  695. bottom: '3%',
  696. containLabel: true
  697. },
  698. xAxis: {
  699. type: 'category',
  700. data: ['08-01', '08-02', '08-03', '08-04', '08-05', '08-06', '08-07'],
  701. },
  702. yAxis: {
  703. type: 'value',
  704. },
  705. series: [{
  706. type: 'line',
  707. areaStyle: {},
  708. data: [65, 59, 80, 81, 56, 55, 40],
  709. itemStyle: {
  710. color: '#4CBAFF'
  711. }
  712. }],
  713. });
  714. },
  715. }
  716. }
  717. </script>
  718. <style lang="scss" scoped>
  719. .app-container {
  720. background-color: #EFF2F7;
  721. padding: 10px;
  722. .el-row {
  723. .el-col {
  724. padding: 10px;
  725. .cell {
  726. padding: 30px;
  727. border-radius: 10px;
  728. background-color: #FFFFFF;
  729. // box-shadow: 5px 5px 15px #979797;
  730. box-shadow: 0px 3px 21px 0px rgba(60, 108, 254, 0.16);
  731. .cell-title {
  732. display: flex;
  733. align-items: center;
  734. margin-bottom: 30px;
  735. padding-bottom: 30px;
  736. border-bottom: 1px solid #CCCCCC;
  737. .title-left {
  738. display: flex;
  739. align-items: center;
  740. cursor: pointer;
  741. box-sizing: border-box;
  742. .title {
  743. text-align: center;
  744. font-size: 22px;
  745. font-family: Microsoft YaHei-3970(82674968);
  746. font-weight: bold;
  747. }
  748. }
  749. }
  750. .cell-body {
  751. background-color: #EFF2F7;
  752. padding: 6px;
  753. .el-row {
  754. .el-col {
  755. margin: 6px;
  756. border-radius: 6px;
  757. background-color: #FFFFFF;
  758. .head {
  759. display: flex;
  760. justify-content: space-between;
  761. }
  762. .header {
  763. display: flex;
  764. .icon {
  765. width: 5px;
  766. height: 20px;
  767. background-color: #8080FF;
  768. margin-right: 8px;
  769. }
  770. .title {
  771. font-size: 18px;
  772. font-weight: 500;
  773. }
  774. }
  775. .ctrs {
  776. display: flex;
  777. justify-content: space-between;
  778. .custom-date-picker {
  779. width: 260px;
  780. font-size: 14px;
  781. height: 28px;
  782. margin-left: 10px;
  783. }
  784. }
  785. .content {
  786. display: flex;
  787. justify-content: space-around;
  788. padding-top: 20px;
  789. color: #FFFFFF;
  790. .left-pie {
  791. width: 50%;
  792. }
  793. .right-bar {
  794. width: 50%;
  795. }
  796. .con-con {
  797. width: 300px;
  798. height: 130px;
  799. padding: 15px 50px;
  800. border-radius: 10px;
  801. display: flex;
  802. flex-direction: column;
  803. justify-content: space-around;
  804. .con-title {
  805. font-size: 20px;
  806. font-weight: 600;
  807. }
  808. .con-num {
  809. font-size: 18px;
  810. font-weight: 600;
  811. }
  812. }
  813. .con-bg-1 {
  814. background: linear-gradient(to right, #0BBEFE, #7DFDD9);
  815. }
  816. .con-bg-2 {
  817. background: linear-gradient(to right, #09BDFE, #01A7F0);
  818. }
  819. .con-bg-3 {
  820. background: linear-gradient(to right, #F286A0, #FCC587);
  821. }
  822. .con-bg-4 {
  823. background: linear-gradient(to right, #FAC2EB, #A28DD1);
  824. }
  825. ::v-deep .el-table__row .cell {
  826. white-space: nowrap !important;
  827. }
  828. ::v-deep .el-table__row:nth-child(1) td:nth-child(1) .cell,
  829. ::v-deep .el-table__row:nth-child(2) td:nth-child(1) .cell,
  830. ::v-deep .el-table__row:nth-child(3) td:nth-child(1) .cell,
  831. ::v-deep .el-table__row:nth-child(4) td:nth-child(1) .cell,
  832. ::v-deep .el-table__row:nth-child(5) td:nth-child(1) .cell {
  833. display: block;
  834. width: 30px;
  835. height: 30px;
  836. line-height: 30px;
  837. text-align: center;
  838. margin-left: 26px;
  839. border-radius: 50%;
  840. color: #FFFFFF !important;
  841. }
  842. ::v-deep .el-table__row:nth-child(1) td:nth-child(1) .cell {
  843. background-color: #f73131;
  844. box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.5);
  845. }
  846. ::v-deep .el-table__row:nth-child(2) td:nth-child(1) .cell {
  847. background-color: #f60 !important;
  848. box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.5);
  849. }
  850. ::v-deep .el-table__row:nth-child(3) td:nth-child(1) .cell {
  851. background-color: #ffc20d !important;
  852. box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.5);
  853. }
  854. ::v-deep .el-table__row:nth-child(4) td:nth-child(1) .cell {
  855. background-color: #c8c6c7 !important;
  856. box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.5);
  857. }
  858. ::v-deep .el-table__row:nth-child(5) td:nth-child(1) .cell {
  859. background-color: #c8c6c7 !important;
  860. box-shadow: 1px 1px 3px 1px rgba(0, 0, 0, 0.5);
  861. }
  862. }
  863. }
  864. }
  865. }
  866. }
  867. }
  868. }
  869. }
  870. </style>
  871. <style>
  872. .el-date-editor .el-range__icon,
  873. .el-date-editor .el-range__close-icon,
  874. .el-date-editor .el-range-separator {
  875. height: 28px;
  876. line-height: 28px;
  877. }
  878. .el-button-group .el-button.active {
  879. color: #fff;
  880. background-color: #8080FF;
  881. }
  882. </style>