CompareData.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
  1. <template>
  2. <div class="compareData">
  3. <!-- /展示的对比数据的模态框 -->
  4. <a-modal v-model="compVisiable" title="数据对比" @ok="handleOk" width="65%" border :footer="null">
  5. <div class="clickHandle">
  6. <a-radio-group v-model="value" @change="radioChange" name="dateGroup">
  7. <a-radio-button value="month" defaultChecked>月对比</a-radio-button>
  8. <a-radio-button value="day">天对比</a-radio-button>
  9. </a-radio-group>
  10. <span v-if="compareSign=='month'" class="selectDate">
  11. <a-range-picker
  12. v-model="monthValue"
  13. :placeholder="['选择月份', '选择月份']"
  14. format="YYYY-MM"
  15. :value="value"
  16. :mode="mode2"
  17. @panelChange="handlePanelChange2"
  18. @change="handleChange"
  19. />
  20. </span>
  21. <span v-else class="selectDate">
  22. <a-range-picker v-model="dateValue" @change="onChange" :disabled-date="disabledDate" />
  23. </span>
  24. <span class="searchBtn">
  25. <a-button type="primary" @click="searchHandle">查询</a-button>
  26. </span>
  27. </div>
  28. <div class="showbox">
  29. <div class="costcompare">
  30. <div>总消耗对比</div>
  31. <p>{{compareSign=='month'?moment(monthValue[0]).format('YYYY-MM') : moment(dateValue[0]).format('YYYY-MM-DD')}}:
  32. <span> {{costcompare.prev|decimalsHandle}}</span>
  33. </p>
  34. <p>{{compareSign=='month'?moment(monthValue[1]).format('YYYY-MM') : moment(dateValue[1]).format('YYYY-MM-DD')}}:
  35. <span> {{costcompare.next|decimalsHandle}} </span>
  36. </p>
  37. <p>环比:
  38. <span class="huanbi"> {{(costcompare.next-costcompare.prev)/costcompare.prev| toPercentage}}
  39. <span
  40. class="greenIcon"
  41. v-if="(costcompare.next-costcompare.prev)/costcompare.prev >0"
  42. ></span>
  43. <span class="redIcon" v-else></span>
  44. </span>
  45. </p>
  46. </div>
  47. <div class="costcompare">
  48. <div>点击数对比</div>
  49. <p>{{compareSign=='month'?moment(monthValue[0]).format('YYYY-MM') : moment(dateValue[0]).format('YYYY-MM-DD')}}:
  50. <span> {{clickcompare.prev |formatCurrency}}</span>
  51. </p>
  52. <p>{{compareSign=='month'?moment(monthValue[1]).format('YYYY-MM') : moment(dateValue[1]).format('YYYY-MM-DD')}}:
  53. <span> {{clickcompare.next |formatCurrency}}</span>
  54. </p>
  55. <p >环比:
  56. <span class="huanbi"> {{
  57. (clickcompare.next-clickcompare.prev)/clickcompare.prev| toPercentage}}
  58. <span
  59. class="greenIcon"
  60. v-if="(clickcompare.next-clickcompare.prev)/clickcompare.prev >0"
  61. ></span>
  62. <span class="redIcon" v-else></span>
  63. </span>
  64. </p>
  65. </div>
  66. <div class="costcompare">
  67. <div>展示数对比</div>
  68. <p>{{compareSign=='month'?moment(monthValue[0]).format('YYYY-MM') : moment(dateValue[0]).format('YYYY-MM-DD')}}:
  69. <span> {{showNumcompare.prev|formatCurrency}} </span>
  70. </p>
  71. <p>{{compareSign=='month'?moment(monthValue[1]).format('YYYY-MM') : moment(dateValue[1]).format('YYYY-MM-DD')}}:
  72. <span> {{showNumcompare.prev|formatCurrency}}</span>
  73. </p>
  74. <p>环比:
  75. <span class="huanbi"> {{(showNumcompare.next-showNumcompare.prev)/showNumcompare.prev| toPercentage}}
  76. <span
  77. class="greenIcon"
  78. v-if="(showNumcompare.next-showNumcompare.prev)/showNumcompare.prev>0"
  79. ></span>
  80. <span class="redIcon" v-else></span>
  81. </span>
  82. </p>
  83. </div>
  84. </div>
  85. <div class="compareChart">
  86. <a-tabs default-active-key="Tcost" @change="compareTab">
  87. <a-tab-pane key="Tcost" tab="总消耗"></a-tab-pane>
  88. <a-tab-pane key="Tclick" tab="点击数"></a-tab-pane>
  89. <a-tab-pane key="TshowNum" tab="展示数"></a-tab-pane>
  90. </a-tabs>
  91. <div id="compareChart" style="width:100%;height:300px" ref="compareChart"></div>
  92. </div>
  93. <div class="tableCompare">
  94. <div class="time">
  95. <a-radio-group v-model="tableTab" @change="tableTabChange">
  96. <a-radio-button
  97. :value="1"
  98. defaultChecked
  99. >{{compareSign=='month'?moment(monthValue[0]).format('YYYY-MM') : moment(dateValue[0]).format('YYYY-MM-DD')}}</a-radio-button>
  100. <a-radio-button
  101. :value="2"
  102. >{{compareSign=='month'?moment(monthValue[1]).format('YYYY-MM') : moment(dateValue[1]).format('YYYY-MM-DD')}}</a-radio-button>
  103. </a-radio-group>
  104. </div>
  105. <a-table
  106. size="middle"
  107. :columns="columns"
  108. :dataSource="tableData"
  109. :pagination="false"
  110. bordered
  111. id="outTable"
  112. :loading="loading"
  113. style="word-break: break-all;"
  114. >
  115. <span
  116. slot="costProportion"
  117. slot-scope="costProportion"
  118. >{{ costProportion | toPercentage }}</span>
  119. <!-- <span slot="statDatetime" slot-scope>{{ dateValue[0].format('YYYY-MM-DD')+'~'+dateValue[1].format('YYYY-MM-DD')}}</span> -->
  120. </a-table>
  121. </div>
  122. </a-modal>
  123. </div>
  124. </template>
  125. <script>
  126. import moment from 'moment'
  127. import { getAction, postAction, downFile, downFilePost } from '@/api/manage'
  128. // 引入基本模板
  129. var echarts = require('echarts')
  130. // 引入柱状图组件
  131. require('echarts/lib/chart/bar')
  132. require('echarts/lib/chart/pie')
  133. require('echarts/lib/chart/line')
  134. // 引入提示框和title组件
  135. require('echarts/lib/component/tooltip')
  136. require('echarts/lib/component/title')
  137. require('echarts/lib/component/graphic')
  138. require('echarts/lib/component/toolbox')
  139. require('echarts/lib/component/legend')
  140. let compareOption = {
  141. tooltip: {
  142. trigger: 'axis',
  143. axisPointer: {
  144. // 坐标轴指示器,坐标轴触发有效
  145. type: 'line' // 默认为直线,可选为:'line' | 'shadow'
  146. }
  147. },
  148. legend: {
  149. data: ['']
  150. },
  151. grid: {
  152. left: '1%',
  153. right: '0%',
  154. bottom: '5%',
  155. top: '10%',
  156. containLabel: true
  157. },
  158. xAxis: [
  159. {
  160. type: 'category',
  161. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  162. axisTick: {
  163. alignWithLabel: true
  164. }
  165. }
  166. ],
  167. yAxis: [
  168. {
  169. type: 'value',
  170. show: true
  171. }
  172. ],
  173. series: [
  174. {
  175. name: '',
  176. type: 'line',
  177. smooth: true,
  178. data: [],
  179. color: '#32CD32'
  180. },
  181. {
  182. name: '',
  183. type: 'line',
  184. smooth: true,
  185. data: [],
  186. color: '#8A2BE2'
  187. }
  188. ]
  189. }
  190. let columns = [
  191. {
  192. title: '日期/时间',
  193. dataIndex: 'statDate',
  194. scopedSlots: { customRender: 'statDate' },
  195. align: 'center',
  196. key: 'statDate'
  197. },
  198. {
  199. title: '消耗(元)',
  200. dataIndex: 'cost',
  201. scopedSlots: { customRender: 'cost' },
  202. align: 'center',
  203. key: 'cost'
  204. },
  205. {
  206. title: '消耗环比',
  207. dataIndex: 'costProportion',
  208. scopedSlots: { customRender: 'costProportion' },
  209. align: 'center',
  210. key: 'costProportion'
  211. },
  212. {
  213. title: '点击数',
  214. dataIndex: 'click',
  215. align: 'center',
  216. scopedSlots: { customRender: 'click' },
  217. key: 'click'
  218. },
  219. {
  220. title: '点击率',
  221. dataIndex: 'clickRate',
  222. align: 'center',
  223. scopedSlots: { customRender: 'clickRate' },
  224. key: 'clickRate'
  225. },
  226. {
  227. title: '展示数',
  228. dataIndex: 'showNum',
  229. align: 'center',
  230. scopedSlots: { customRender: 'showNum' },
  231. key: 'showNum'
  232. },
  233. {
  234. title: '平均千次展现费用(元)',
  235. dataIndex: 'cpm',
  236. align: 'center',
  237. scopedSlots: { customRender: 'cpm' },
  238. key: 'cpm'
  239. },
  240. {
  241. title: '平均点击单价(元)',
  242. dataIndex: 'cp',
  243. align: 'center',
  244. scopedSlots: { customRender: 'cp' },
  245. key: 'cp'
  246. }
  247. ]
  248. let initDay = {
  249. today: {
  250. x: [
  251. '00:00',
  252. '01:00',
  253. '02:00',
  254. '03:00',
  255. '04:00',
  256. '05:00',
  257. '06:00',
  258. '07:00',
  259. '08:00',
  260. '09:00',
  261. '10:00',
  262. '11:00',
  263. '12:00',
  264. '13:00',
  265. '14:00',
  266. '15:00',
  267. '16:00',
  268. '17:00',
  269. '18:00',
  270. '19:00',
  271. '20:00',
  272. '21:00',
  273. '22:00',
  274. '23:00'
  275. ],
  276. y: [],
  277. name: ''
  278. },
  279. yesterday: {
  280. x: [
  281. '00:00',
  282. '01:00',
  283. '02:00',
  284. '03:00',
  285. '04:00',
  286. '05:00',
  287. '06:00',
  288. '07:00',
  289. '08:00',
  290. '09:00',
  291. '10:00',
  292. '11:00',
  293. '12:00',
  294. '13:00',
  295. '14:00',
  296. '15:00',
  297. '16:00',
  298. '17:00',
  299. '18:00',
  300. '19:00',
  301. '20:00',
  302. '21:00',
  303. '22:00',
  304. '23:00'
  305. ],
  306. y: [],
  307. name: ''
  308. }
  309. }
  310. let initMonth = {
  311. today: {
  312. x: [],
  313. y: [],
  314. name: ''
  315. },
  316. yesterday: {
  317. x: [],
  318. y: [],
  319. name: ''
  320. }
  321. }
  322. export default {
  323. props: ['compareVisiable'],
  324. data() {
  325. return {
  326. moment,
  327. compareOption: JSON.parse(JSON.stringify(compareOption)),
  328. //对比的模态框
  329. compVisiable: false,
  330. compareSign: 'month',
  331. //日期选择器
  332. mode2: ['month', 'month'],
  333. value: "month",
  334. dateValue: [],
  335. monthValue: [],
  336. //tab的选中key
  337. tabKey: '',
  338. tabCost: {},
  339. tabClick: {},
  340. tabShowNum: {},
  341. //table
  342. loading: false,
  343. columns,
  344. tableData: [],
  345. tableTab: 1,
  346. smallDate: [],
  347. bigDate: [],
  348. //showbox里的数据
  349. costcompare: {
  350. prev: 0,
  351. next: 0
  352. },
  353. clickcompare: {
  354. prev: 0,
  355. next: 0
  356. },
  357. showNumcompare: {
  358. prev: 0,
  359. next: 0
  360. }
  361. }
  362. },
  363. watch: {
  364. compareVisiable() {
  365. this.compVisiable = this.compareVisiable
  366. },
  367. compVisiable(n) {
  368. // console.log(n)
  369. this.$emit('close_modal', n)
  370. }
  371. },
  372. methods: {
  373. //单选框选择
  374. radioChange(e) {
  375. this.compareSign = e.target.value
  376. // console.log(this.compareSign)
  377. if (this.compareSign == 'day') {
  378. this.sectionHttp({
  379. type: 10,
  380. sign: this.compareSign,
  381. smallDate: this.dateValue[0].format('YYYY-MM-DD'),
  382. bigDate: this.dateValue[1].format('YYYY-MM-DD')
  383. })
  384. } else {
  385. this.sectionHttp({
  386. type: 10,
  387. sign: this.compareSign,
  388. smallDate: this.monthValue[0].format('YYYY-MM'),
  389. bigDate: this.monthValue[1].format('YYYY-MM')
  390. })
  391. }
  392. },
  393. tableTabChange(e) {
  394. this.tableTab = e.target.value
  395. if (e.target.value == '1') {
  396. this.tableData = this.smallDate
  397. } else {
  398. this.tableData = this.bigDate
  399. }
  400. },
  401. //获取echart的值
  402. getEchartData(idName, optionName) {
  403. const chart = this.$refs[idName]
  404. // console.log(chart)
  405. if (chart) {
  406. const myChart = echarts.init(document.getElementById(idName))
  407. myChart.setOption(optionName)
  408. window.addEventListener('resize', function() {
  409. myChart.resize()
  410. })
  411. }
  412. },
  413. //处理echart
  414. sectionHttp(params) {
  415. this.loading = true
  416. this.compareOption = JSON.parse(JSON.stringify(compareOption))
  417. return new Promise((resolve, reject) => {
  418. postAction('/ctop/byteDance/homePage/report/compare', params).then(res => {
  419. // console.log(res)
  420. if (res.success) {
  421. this.loading = false
  422. if (this.compareSign == 'day') {
  423. this.tabCost = JSON.parse(JSON.stringify(initDay))
  424. this.tabClick = JSON.parse(JSON.stringify(initDay))
  425. this.tabShowNum = JSON.parse(JSON.stringify(initDay))
  426. this.compareOption.legend.data = [
  427. this.dateValue[0].format('YYYY-MM-DD'),
  428. this.dateValue[1].format('YYYY-MM-DD')
  429. ]
  430. this.compareOption.series[0].name = this.dateValue[1].format('YYYY-MM-DD')
  431. this.compareOption.series[1].name = this.dateValue[0].format('YYYY-MM-DD')
  432. } else {
  433. this.tabCost = JSON.parse(JSON.stringify(initMonth))
  434. this.tabClick = JSON.parse(JSON.stringify(initMonth))
  435. this.tabShowNum = JSON.parse(JSON.stringify(initMonth))
  436. this.compareOption.legend.data = [
  437. this.monthValue[0].format('YYYY-MM'),
  438. this.monthValue[1].format('YYYY-MM')
  439. ]
  440. this.compareOption.series[0].name = this.monthValue[1].format('YYYY-MM')
  441. this.compareOption.series[1].name = this.monthValue[0].format('YYYY-MM')
  442. res.result.chart.compare.forEach((item, index) => {
  443. this.tabClick.yesterday.x.push(item.statDate.split('-')[2])
  444. this.tabCost.yesterday.x.push(item.statDate.split('-')[2])
  445. this.tabShowNum.yesterday.x.push(item.statDate.split('-')[2])
  446. })
  447. }
  448. res.result.chart.compare.forEach((item, index) => {
  449. this.tabClick.yesterday.y.push(item.click)
  450. this.tabCost.yesterday.y.push(item.cost)
  451. this.tabShowNum.yesterday.y.push(item.showNum)
  452. if (item.afterData) {
  453. this.tabClick.today.y.push(item.afterData.click)
  454. this.tabCost.today.y.push(item.afterData.cost)
  455. this.tabShowNum.today.y.push(item.afterData.showNum)
  456. } else {
  457. this.tabClick.today.y.push(0)
  458. this.tabCost.today.y.push(0)
  459. this.tabShowNum.today.y.push(0)
  460. }
  461. })
  462. this.compareOption.xAxis[0].data = this.tabCost.yesterday.x
  463. this.compareOption.series[0].data = this.tabCost.today.y
  464. this.compareOption.series[1].data = this.tabCost.yesterday.y
  465. this.getEchartData('compareChart', this.compareOption)
  466. //处理表格数据
  467. res.result.list.smallDate.forEach((ele,index) => {
  468. if (!ele.costProportion) {
  469. ele.costProportion = '-'
  470. }
  471. if (ele.statHour || ele.statHour == 0) {
  472. ele.statHour = ele.statHour > 9 ? `${ele.statHour}:00` : ` 0${ele.statHour}:00`
  473. ele.statDate = ele.statDate + ' ' + ele.statHour
  474. }
  475. ele.key=index+1
  476. })
  477. this.smallDate = [...res.result.list.smallDate]
  478. res.result.list.bigDate.forEach((ele,index) => {
  479. if (!ele.costProportion) {
  480. ele.costProportion = '-'
  481. }
  482. if (ele.statHour || ele.statHour == 0) {
  483. ele.statHour = ele.statHour > 9 ? `${ele.statHour}:00` : ` 0${ele.statHour}:00`
  484. ele.statDate = ele.statDate + ' ' + ele.statHour
  485. }
  486. ele.key=index+1
  487. // console.log(ele)
  488. this.costcompare.next += ele.cost
  489. this.clickcompare.next += ele.click
  490. this.showNumcompare.next += ele.showNum
  491. })
  492. if(res.result.list.bigDate.length<res.result.list.smallDate.length){
  493. for (let i = 0; i < res.result.list.bigDate.length; i++) {
  494. this.costcompare.prev += res.result.list.smallDate[i].cost
  495. this.clickcompare.prev += res.result.list.smallDate[i].click
  496. this.showNumcompare.prev += res.result.list.smallDate[i].showNum
  497. }
  498. }else{
  499. for (let i = 0; i < res.result.list.smallDate.length; i++) {
  500. this.costcompare.prev += res.result.list.bigDate[i].cost
  501. this.clickcompare.prev += res.result.list.bigDate[i].click
  502. this.showNumcompare.prev += res.result.list.bigDate[i].showNum
  503. }
  504. }
  505. this.bigDate = [...res.result.list.bigDate]
  506. this.tableData = this.smallDate
  507. }
  508. })
  509. })
  510. },
  511. //对比模块的tab事件
  512. compareTab(key) {
  513. // this.compareOption=JSON.parse(JSON.stringify(compareOption))
  514. if (key == 'Tcost') {
  515. this.compareOption.xAxis[0].data = this.tabCost.yesterday.x
  516. this.compareOption.series[0].data = this.tabCost.today.y
  517. this.compareOption.series[1].data = this.tabCost.yesterday.y
  518. } else if (key == 'Tclick') {
  519. this.compareOption.xAxis[0].data = this.tabClick.yesterday.x
  520. this.compareOption.series[0].data = this.tabClick.today.y
  521. this.compareOption.series[1].data = this.tabClick.yesterday.y
  522. } else {
  523. this.compareOption.xAxis[0].data = this.tabShowNum.yesterday.x
  524. this.compareOption.series[0].data = this.tabShowNum.today.y
  525. this.compareOption.series[1].data = this.tabShowNum.yesterday.y
  526. }
  527. this.getEchartData('compareChart', this.compareOption)
  528. },
  529. //motaikuang
  530. handleOk(e) {
  531. // console.log(e);
  532. this.compVisiabled = false
  533. // this.$emit('update', this.compareVisiabled);
  534. // this.$parent.compareVisiable=false;
  535. },
  536. onChange(date, dateString) {
  537. this.dateValue = date
  538. },
  539. handleChange(value) {
  540. console.log(value)
  541. this.monthValue = value
  542. },
  543. handlePanelChange2(value, mode) {
  544. this.monthValue =value
  545. this.mode2 = [mode[0] === 'date' ? 'month' : mode[0], mode[1] === 'date' ? 'month' : mode[1]]
  546. },
  547. //按钮查询事件
  548. searchHandle() {
  549. if (this.compareSign == 'day') {
  550. this.sectionHttp({
  551. type: 10,
  552. sign: this.compareSign,
  553. smallDate: this.dateValue[0].format('YYYY-MM-DD'),
  554. bigDate: this.dateValue[1].format('YYYY-MM-DD')
  555. })
  556. } else {
  557. this.sectionHttp({
  558. type: 10,
  559. sign: this.compareSign,
  560. smallDate: this.monthValue[0].format('YYYY-MM'),
  561. bigDate: this.monthValue[1].format('YYYY-MM')
  562. })
  563. }
  564. },
  565. disabledDate(current) {
  566. return current && current > moment().subtract(1, 'day')
  567. },
  568. },
  569. mounted() {
  570. this.monthValue = [moment().subtract(1, 'months'), moment()]
  571. this.dateValue = [moment().subtract(1, 'days'), moment()]
  572. },
  573. // activated() {
  574. // this.monthValue=[moment().subtract(1,'months'),moment()]
  575. // this.sectionHttp({
  576. // type:10,
  577. // sign:this.compareSign,
  578. // smallDate:moment().subtract(1,'months').format('YYYY-MM'),
  579. // bigDate:moment().format('YYYY-MM'),
  580. // })
  581. // },
  582. filters: {
  583. //变成百分比
  584. toPercentage(val) {
  585. if (typeof val != 'string') {
  586. return (val * 100).toFixed(2) + '%'
  587. } else {
  588. return val
  589. }
  590. },
  591. //保留两位小数并且变成货币格式
  592. decimalsHandle(val){
  593. val=val.toFixed(2);
  594. let numberStr = val.toString()
  595. let str = numberStr.split('.')
  596. let str0=str[0].split('').reverse();
  597. for (let i = 0; i < str0.length; i++) {
  598. if ((i + 1) % 4 === 0) {
  599. str0.splice(i, 0, ',')
  600. }
  601. }
  602. str0.reverse()
  603. let handleResult = ''
  604. for (let j = 0; j < str0.length; j++) {
  605. handleResult += str0[j]
  606. }
  607. return handleResult+'.'+str[1]
  608. },
  609. //变成货币格式
  610. formatCurrency(val){
  611. let numberStr = val.toString()
  612. let str = numberStr.split('').reverse()
  613. for (let i = 0; i < str.length; i++) {
  614. if ((i + 1) % 4 === 0) {
  615. str.splice(i, 0, ',')
  616. }
  617. }
  618. str.reverse()
  619. let handleResult = ''
  620. for (let j = 0; j < str.length; j++) {
  621. handleResult += str[j]
  622. }
  623. return handleResult
  624. }
  625. }
  626. }
  627. </script>
  628. <style lang="scss" scoped>
  629. .clickHandle {
  630. position: relative;
  631. top: -24px;
  632. left: 0px;
  633. .selectDate {
  634. margin-left: 2rem;
  635. }
  636. .searchBtn {
  637. position: absolute;
  638. top: 5px;
  639. right: 0;
  640. }
  641. }
  642. .time {
  643. margin-bottom: 10px;
  644. }
  645. .showbox {
  646. padding: 10px 0;
  647. display: flex;
  648. justify-content: space-between;
  649. .costcompare {
  650. width: 30%;
  651. border: 1px solid #e0e0e0;
  652. padding-bottom: 20px;
  653. div {
  654. border-bottom: 1px solid #e0e0e0;
  655. padding: 5px 10px;
  656. font-size: 16px;
  657. font-weight: 600;
  658. }
  659. p {
  660. padding: 15px 15px 5px;
  661. margin-bottom: 0;
  662. span{
  663. font-weight: 500;
  664. font-size: 16px;
  665. margin-left: 15px;
  666. }
  667. .huanbi{
  668. font-weight: 500;
  669. font-size: 16px;
  670. position: relative;
  671. display: inline-block;
  672. padding: 0 15px 0;
  673. }
  674. .greenIcon {
  675. width: 0;
  676. height: 0;
  677. border-left: 4px solid transparent;
  678. border-right: 4px solid transparent;
  679. border-bottom: 8px solid green;
  680. position: absolute;
  681. top: 40%;
  682. right: 0;
  683. }
  684. .redIcon {
  685. width: 0;
  686. height: 0;
  687. border-left: 4px solid transparent;
  688. border-right: 4px solid transparent;
  689. border-top: 8px solid red;
  690. position: absolute;
  691. top: 40%;
  692. right: 0;
  693. }
  694. }
  695. }
  696. }
  697. .compareChart {
  698. border: 1px solid #e0e0e0;
  699. margin-bottom: 20px;
  700. }
  701. .tableCompare {
  702. border: 1px solid #e0e0e0;
  703. padding: 1px 20px 15px;
  704. }
  705. </style>