pageWeek.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859
  1. <template>
  2. <Layout class="page_week">
  3. <div class="page_week_main">
  4. <!-- 选择周报时间 -->
  5. <div class="week_time">
  6. <SelectMonth v-if="!nonereport" ref="selectMonth" :from="from" :isp="ISP" @noReport="noReport" :queryDate="getQueryTime" @selectYm="getSelectTime"></SelectMonth>
  7. <div class="select_report">
  8. <div class="week_report" v-for="(item, index) in weekList" :key="index" @click="selectWeek(index, item)" :class="{weekActive:index==isWeekIndex}">
  9. <div class="week_report_main">
  10. <div class="report_top">
  11. <div class="reoprt_time">
  12. <span class="week_text">周</span>
  13. <span class="week_days">{{dateFormatter(item.startdate * 1000, 'MM月dd日')}}-{{dateFormatter(item.enddate * 1000, 'MM月dd日')}}</span>
  14. <span class="red_point" v-if="item.unread === 1" ref="weekitempoint"></span>
  15. </div>
  16. <div class="repot_gettime">{{item.pushtime}}</div>
  17. </div>
  18. <div class="report_bot">
  19. <span class="push_text">推送数据条数</span>
  20. <div class="push_report">
  21. <span class="push_num">{{item.pushcount}}</span>
  22. <span class="el-icon-arrow-right"></span>
  23. </div>
  24. </div>
  25. </div>
  26. </div>
  27. <bmEmpty v-if="nonereport" functype="week" tip="本周结束后,将为您推送周报,敬请期待~"></bmEmpty>
  28. <Empty tip="暂无数据" v-if="!nodata && !nonereport"></Empty>
  29. </div>
  30. </div>
  31. <!-- 数据报告-周报 -->
  32. <div class="dataReport" v-if="nodata && !nonereport">
  33. <div class="dataReport_main">
  34. <div class="data_r_head">
  35. <div class="data_r_title">数据报告-周报</div>
  36. <div class="data_r_week">({{dateFormatter(start * 1000, 'MM月dd日')}}-{{dateFormatter(end * 1000, 'MM月dd日')}})</div>
  37. </div>
  38. <div class="data_keys" v-if="!ISP">
  39. <span class="keys_label">订阅关键词组:</span>
  40. <span class="list_key">{{keywordsGroup}}</span>
  41. </div>
  42. <div class="data_line"></div>
  43. <div class="data_item">
  44. <p class="item_handle">数据来源:<span v-if="ISP">基于您订阅的项目;</span><span v-else>基于您当前订阅条件所关联的招投标公告数据;</span></p>
  45. <p class="item_handle">项目预算/项目规模:少量预算金额、中标金额未公开或为空的项目,在计算项目总预算、总规模时不参与统计;</p>
  46. <p class="item_handle" v-if="ISP">项目重复统计:一个招标项目可能同属于多个业务条线,故各业务条线的数据统计之和可能大于整体市场的统计。</p>
  47. <p class="item_handle" v-else>项目重复统计:一个招标项目可能同属于多个关键词组,故各关键词组的数据统计之和可能大于整体市场的统计。</p>
  48. </div>
  49. </div>
  50. </div>
  51. <el-tabs class="tabs sticky-tab-container" v-model="tabActiveName" v-if="nodata" :before-leave="beforeTabLeave">
  52. <el-tab-pane label="本周分析" name="1">
  53. <div class="echartsView" v-if="tabActiveName === '1'">
  54. <!-- 本周新增招标项目数量 -->
  55. <div class="newAdd_bid" v-if="newDrawCount.show">
  56. <div class="chart-title">本周新增招标项目数量</div>
  57. <DuoToneChart :datas="newDrawCount.data"></DuoToneChart>
  58. </div>
  59. <!-- 本周新增招标项目预算 -->
  60. <div class="newAdd_bidBudget" v-if="newBudget.show">
  61. <div class="chart-title">本周新增招标项目预算</div>
  62. <BarLineChart :datas="newBudget.data" :options="newBudget.options"></BarLineChart>
  63. </div>
  64. <!-- 本周新增开标项目数量 -->
  65. <div class="newAdd_bidOpen" v-if="newOpenCount.show">
  66. <div class="chart-title">本周新增开标项目数量</div>
  67. <DuoToneChart :datas="newOpenCount.data"></DuoToneChart>
  68. </div>
  69. <!-- 本周新增招标项目规模 -->
  70. <div class="newAdd_scale" v-if="newScale.show">
  71. <div class="chart-title">本周新增开标项目规模</div>
  72. <BarLineChart :datas="newScale.data" :options="newScale.options"></BarLineChart>
  73. </div>
  74. <!-- 项目金额排行榜/本周项目规模排行榜TOP30(同一个东西,名字在p350改了,老报告展示老名字,新报告展示新名字) -->
  75. <template v-if="projectAmount.show">
  76. <ProjectTopTable v-if="useNewVersionReport" title="本周项目规模排行榜TOP30" :isp="ISP" :data="projectAmount.list" type='amount'></ProjectTopTable>
  77. <ProjectTop v-else title="项目金额排行榜" :data="projectAmount.list" type='amount'></ProjectTop>
  78. </template>
  79. <!-- 下周开标提醒 -->
  80. <div v-if="priority.nextweek_bidopen.length > 0">
  81. <CompanyDetail :linkable="useNewVersionReport" title="下周开标提醒" :isp="ISP" :datas="priority" type="bidopen"></CompanyDetail>
  82. </div>
  83. <!-- 重点关注项目 -->
  84. <div v-if="priority.follow_project.length > 0">
  85. <CompanyDetail :isp="ISP" :linkable="useNewVersionReport" title="重点关注项目" :datas="priority" type="project"></CompanyDetail>
  86. </div>
  87. <!-- 重点关注企业/已监控企业本周项目动态(同一个东西,名字在p350改了,老报告展示老名字,新报告展示新名字) -->
  88. <div v-if="priority.follow_ent.length > 0" >
  89. <ProjectTopTable class="follow-ent-module" v-if="useNewVersionReport" title="已监控企业本周项目动态" :isp="ISP" :data="priority.follow_ent" type="followEnt"></ProjectTopTable>
  90. <CompanyDetail v-else :isp="ISP" :linkable="useNewVersionReport" title="重点关注企业" :datas="priority" type="ent"></CompanyDetail>
  91. </div>
  92. </div>
  93. </el-tab-pane>
  94. <el-tab-pane lazy label="本周项目明细" name="2" v-if="useNewVersionReport">
  95. <ProjectDetailsList
  96. :key="detailListKey"
  97. :start="start - 0"
  98. :end="end - 0"
  99. reportType="week"
  100. :isp="ISP"
  101. :from="from"
  102. :subscribeClassList="projectDetailFilters.keywordsGroupList"
  103. :subscribeAreaMap="projectDetailFilters.subscribeAreaMap"
  104. :subscribeBuyerClass="projectDetailFilters.subscribeBuyerClass"
  105. :industryOptions="projectDetailFilters.industryMap"
  106. :showIndustry="showIndustry"
  107. />
  108. </el-tab-pane>
  109. </el-tabs>
  110. </div>
  111. <div class="page_week_artical"></div>
  112. </Layout>
  113. </template>
  114. <script>
  115. import { Tabs, TabPane } from 'element-ui'
  116. import SelectMonth from '@/components/report-data/SelectMonth.vue'
  117. import Layout from '@/components/common/ContentLayout'
  118. import CompanyDetail from '@/components/report-data/CompanyDetail.vue'
  119. import ProjectTop from '@/components/report-data/ProjectTop.vue'
  120. import ProjectTopTable from '@/components/report-data/ProjectTopTable.vue'
  121. import { getReportDetail, getReportIndex } from '@/api/modules'
  122. import { dateFormatter } from '@/utils/globalFunctions'
  123. import DuoToneChart from '@/components/chart/DuoToneChart'
  124. import BarLineChart from '@/components/chart/BarLineChart'
  125. import bmEmpty from '@/components/common/BigMemberEmpty'
  126. import Empty from '@/components/common/Empty'
  127. import ProjectDetailsList from '@/views/reportData/components/ProjectDetailsList.vue'
  128. import { tabsSticky } from '@/utils/mixins/el-tabs-sticky'
  129. export default {
  130. name: 'page_week',
  131. mixins: [tabsSticky],
  132. components: {
  133. [Tabs.name]: Tabs,
  134. [TabPane.name]: TabPane,
  135. SelectMonth,
  136. CompanyDetail,
  137. ProjectTopTable,
  138. ProjectTop,
  139. DuoToneChart,
  140. BarLineChart,
  141. bmEmpty,
  142. Empty,
  143. ProjectDetailsList,
  144. Layout
  145. },
  146. data () {
  147. return {
  148. // 是否历史周报(历史周报部分功能使用旧的)
  149. useNewVersionReport: true,
  150. canQuery: true,
  151. tabActiveName: '1',
  152. isWeekIndex: 0,
  153. start: 0,
  154. end: 0,
  155. keywordsGroup: '',
  156. weekList: [],
  157. nodata: false, // ,没有周报列表显示空组件
  158. nonereport: false, // ,没有周报列表显示空组件
  159. // 本周新增招标项目数量
  160. newDrawCount: {
  161. show: false,
  162. data: []
  163. },
  164. // 本周新增招标项目预算
  165. newBudget: {
  166. show: false,
  167. data: {
  168. columns: ['日期', '项目总预算', '环比增长率(%)-右纵轴'],
  169. rows: []
  170. },
  171. options: {
  172. height: '300px',
  173. colors: ['#0BD991', '#FF9F40'],
  174. settings: {
  175. showLine: ['环比增长率(%)-右纵轴'],
  176. axisSite: { right: ['环比增长率(%)-右纵轴'] }
  177. },
  178. config: this.newBudgetConfig
  179. }
  180. },
  181. // 新增开标项目数量
  182. newOpenCount: {
  183. show: false,
  184. data: []
  185. },
  186. // 本周新增招标项目规模
  187. newScale: {
  188. show: false,
  189. data: {
  190. columns: ['日期', '项目总规模', '环比增长率(%)-右纵轴'],
  191. rows: []
  192. },
  193. options: {
  194. height: '320px',
  195. colors: ['#05A6F3', '#FF9F40'],
  196. settings: {
  197. showLine: ['环比增长率(%)-右纵轴'],
  198. axisSite: { right: ['环比增长率(%)-右纵轴'] }
  199. },
  200. config: this.newScaleConfig
  201. }
  202. },
  203. // 项目金额排行榜
  204. projectAmount: {
  205. show: false,
  206. list: []
  207. },
  208. // 开标提醒、重点关注项目、重点关注企业
  209. priority: {
  210. nextweek_bidopen: [],
  211. follow_ent: [],
  212. follow_project: []
  213. },
  214. scrollTopInfo: {
  215. stickyTop: 0,
  216. 1: 0, // tabName===1
  217. 2: 0 // tabName===2
  218. },
  219. projectDetailFilters: {
  220. keywordsGroupList: [],
  221. subscribeAreaMap: {},
  222. subscribeBuyerClass: [],
  223. industryMap: {}
  224. },
  225. from: '',
  226. showIndustry: true
  227. }
  228. },
  229. watch: {
  230. nodata () {
  231. this.$nextTick(() => {
  232. this.calcStickyTop()
  233. })
  234. }
  235. },
  236. created () {
  237. // from=yyszsyy 运营商专属服务携带参数
  238. this.from = this.$route.query.from || ''
  239. },
  240. mounted () {
  241. const nowtime = dateFormatter(new Date(), 'yyyyMM')
  242. let time = nowtime
  243. if (this.getQueryTime) {
  244. time = this.getQueryTime.ym
  245. }
  246. this.getReportList(time)
  247. if (this.$refs.weekitempoint && this.$refs.weekitempoint.length > 0) {
  248. this.$refs.weekitempoint[0].style.display = 'none'
  249. }
  250. this.calcStickyTop()
  251. },
  252. computed: {
  253. detailListKey () {
  254. return `${this.start}_${this.end}`
  255. },
  256. getQueryTime () {
  257. const paramsDate = this.$route.query.end
  258. if (paramsDate) {
  259. const paramsData = {
  260. year: dateFormatter(paramsDate * 1000, 'yyyy'),
  261. month: Number(dateFormatter(paramsDate * 1000, 'MM')).toString(),
  262. ym: dateFormatter(paramsDate * 1000, 'yyyyMM'),
  263. start: this.$route.query.start,
  264. end: this.$route.query.end
  265. }
  266. return paramsData
  267. }
  268. return false
  269. },
  270. // 运营商专属
  271. ISP () {
  272. return this.$route.query?.from === 'yyszsyy'
  273. }
  274. },
  275. methods: {
  276. dateFormatter,
  277. // 没有一条数据显示bmEmpty空状态组件
  278. noReport () {
  279. this.nonereport = true
  280. },
  281. // 周报列表
  282. getReportList (time) {
  283. getReportIndex({ ym: time, from: this.from }).then((res) => {
  284. if (res.data && res.data.list && res.data.list.length !== 0) {
  285. res.data.list.forEach(function (item, i) {
  286. if (item.pushtime) {
  287. item.pushtime = dateFormatter(item.pushtime * 1000, 'yyyy/MM/dd')
  288. } else {
  289. item.pushtime = ''
  290. }
  291. // 获取现在的时间戳,如果周报的时间大于现在的时间不显示本周周报
  292. const nowtime = new Date().getTime() / 1000
  293. if (item.enddate > nowtime) {
  294. res.data.list = res.data.list.slice(0, i).concat(res.data.list.slice(i + 1, res.data.list.length))
  295. }
  296. })
  297. this.weekList = res.data.list
  298. const queryData = {
  299. start: res.data.list[0].startdate,
  300. end: res.data.list[0].enddate
  301. }
  302. this.isWeekIndex = 0
  303. if (this.canQuery && this.getQueryTime) {
  304. if (this.getQueryTime.ym === time) {
  305. queryData.start = this.getQueryTime.start
  306. queryData.end = this.getQueryTime.end
  307. this.weekList.forEach((v, index) => {
  308. if (String(v.enddate) === queryData.end) {
  309. this.isWeekIndex = index
  310. }
  311. })
  312. }
  313. this.canQuery = false
  314. }
  315. this.getDetail(queryData.start, queryData.end)
  316. this.start = queryData.start
  317. this.end = queryData.end
  318. this.nodata = true
  319. } else {
  320. this.weekList = []
  321. this.nodata = false
  322. }
  323. })
  324. },
  325. // 选择月份
  326. getSelectTime (data) {
  327. console.log(data)
  328. this.getReportList(data)
  329. },
  330. // 选择周报
  331. selectWeek (index, item) {
  332. item.unread = 0
  333. if (this.$refs.weekitempoint && this.$refs.weekitempoint.length > 0) {
  334. // this.$refs.weekitempoint[index].style.display = 'none'
  335. }
  336. this.isWeekIndex = index
  337. this.clickindex = index
  338. this.start = item.startdate
  339. this.end = item.enddate
  340. this.getDetail(item.startdate, item.enddate)
  341. },
  342. // 周报详情
  343. getDetail (start, end) {
  344. getReportDetail({ start: start, end: end, from: this.from }).then(res => {
  345. if (res.error_code === 0) {
  346. if (res.data) {
  347. this.useNewVersionReport = res.data.isNewData
  348. }
  349. // 订阅关键词组
  350. if (res.data && res.data.item && Array.isArray(res.data.item) && res.data.item.length > 0) {
  351. this.projectDetailFilters.keywordsGroupList = this.createKeywordGroupList(res.data.item)
  352. this.keywordsGroup = res.data.item.join('、')
  353. } else {
  354. this.projectDetailFilters.keywordsGroupList = []
  355. this.keywordsGroup = '--'
  356. }
  357. if (res.data && res.data.area) {
  358. this.projectDetailFilters.subscribeAreaMap = res.data.area
  359. } else {
  360. this.projectDetailFilters.subscribeAreaMap = {}
  361. }
  362. if (res.data && res.data.buyerClass) {
  363. this.projectDetailFilters.subscribeBuyerClass = res.data.buyerClass
  364. } else {
  365. this.projectDetailFilters.subscribeBuyerClass = []
  366. }
  367. if (res.data && res.data.industry) {
  368. if (this.ISP) {
  369. this.showIndustry = Object.keys(res.data.industry).length > 0
  370. }
  371. this.projectDetailFilters.industryMap = res.data.industry
  372. } else {
  373. this.showIndustry = !this.ISP
  374. }
  375. // 本周新增招标项目数量
  376. if (res.data.zhao_matchitem && res.data.zhao_matchitem.length > 0) {
  377. this.newDrawCount.show = true
  378. this.newDrawCount.data = this.formatProgressData(res.data.zhao_matchitem)
  379. } else {
  380. this.newDrawCount.show = false
  381. }
  382. // 本周新增招标项目预算
  383. if (res.data.budget && res.data.budget.length > 0) {
  384. this.newBudget.show = true
  385. this.formatNewBudget(res.data.budget)
  386. } else {
  387. this.newBudget.show = false
  388. }
  389. // 本周新增开标项目数量
  390. if (res.data.zhong_matchitem && res.data.zhong_matchitem.length > 0) {
  391. this.newOpenCount.show = true
  392. this.newOpenCount.data = this.formatProgressData(res.data.zhong_matchitem)
  393. } else {
  394. this.newOpenCount.show = false
  395. }
  396. // 本周新增招标项目规模
  397. if (res.data.bidamount && res.data.bidamount.length > 0) {
  398. this.newScale.show = true
  399. this.formatNewScaleData(res.data.bidamount)
  400. } else {
  401. this.newScale.show = false
  402. }
  403. // 项目金额排行榜
  404. if (res.data.project_amount && res.data.project_amount.length > 0) {
  405. if (!this.useNewVersionReport) {
  406. res.data.project_amount.forEach((item) => {
  407. // 万元转换成亿
  408. item.budget = item.budget ? (item.budget / 10000).fixed(2) : 0
  409. item.bidamount = item.bidamount ? (item.bidamount / 10000).fixed(2) : 0
  410. })
  411. }
  412. this.projectAmount.list = res.data.project_amount
  413. this.projectAmount.show = true
  414. } else {
  415. this.projectAmount.show = false
  416. }
  417. // 下周开标提醒
  418. if (res.data.nextweek_bidopen && res.data.nextweek_bidopen.length > 0) {
  419. this.priority.nextweek_bidopen = res.data.nextweek_bidopen
  420. } else {
  421. this.priority.nextweek_bidopen = []
  422. }
  423. // 重点关注企业
  424. if (res.data.follow_ent && res.data.follow_ent.length > 0) {
  425. this.priority.follow_ent = res.data.follow_ent
  426. } else {
  427. this.priority.follow_ent = []
  428. }
  429. // 重点关注项目
  430. if (res.data.follow_project && res.data.follow_project.length > 0) {
  431. this.priority.follow_project = res.data.follow_project
  432. } else {
  433. this.priority.follow_project = []
  434. }
  435. }
  436. })
  437. },
  438. createKeywordGroupList (arr) {
  439. let groupList = []
  440. if (!Array.isArray(arr)) return groupList
  441. groupList = arr.map(item => {
  442. return {
  443. s_item: item,
  444. a_key: []
  445. }
  446. })
  447. return groupList
  448. },
  449. scrollToTab () {
  450. const { stickyTop } = this.scrollTopInfo
  451. setTimeout(() => {
  452. window.scrollTo(0, stickyTop)
  453. }, 10)
  454. },
  455. calcStickyTop () {
  456. const tabs = this.$el.querySelector('.tabs.sticky-tab-container')
  457. if (tabs) {
  458. this.scrollTopInfo.stickyTop = tabs.offsetTop - 64
  459. }
  460. },
  461. recoverScrollTop (targetActiveName) {
  462. const { stickyTop } = this.scrollTopInfo
  463. if (stickyTop <= 0) return
  464. setTimeout(() => {
  465. const scrollTop = this.scrollTopInfo[targetActiveName]
  466. if (scrollTop < stickyTop) {
  467. window.scrollTo(0, stickyTop)
  468. } else {
  469. window.scrollTo(0, scrollTop)
  470. }
  471. }, 10)
  472. },
  473. recordScrollTop (tab) {
  474. const scrolled = $(window).scrollTop()
  475. this.scrollTopInfo[tab] = scrolled
  476. },
  477. beforeTabLeave (targetActiveName) {
  478. this.recordScrollTop(this.tabActiveName)
  479. if (targetActiveName === '1') {
  480. // 恢复到默认位置
  481. this.recoverScrollTop(targetActiveName)
  482. } else if (targetActiveName === '2') {
  483. // 滚动到顶部
  484. this.scrollToTab()
  485. }
  486. return true
  487. },
  488. /* 数据处理 */
  489. // 处理进度条数据
  490. formatProgressData (data) {
  491. if (!data) return
  492. data.forEach((v, i) => {
  493. v.name = v.item
  494. v.value = v.count + '个'
  495. v.parent = v.count / data[0].count * 100 + '%'
  496. })
  497. return data
  498. },
  499. // 处理本周新增招标项目预算
  500. formatNewBudget (data) {
  501. if (!data) return
  502. const budgetRows = []
  503. let count = 0
  504. data.forEach((item, index) => {
  505. count += item.budget
  506. count += item.growthrate
  507. budgetRows.push({
  508. /* eslint-disable */
  509. '日期': item.item,
  510. '项目总预算': Math.round(item.budget),
  511. '环比增长率(%)-右纵轴': item.growthrate.fixed(2)
  512. /* eslint-enable */
  513. })
  514. })
  515. if (count !== 0) {
  516. this.newBudget.show = true
  517. this.newBudget.data.rows = budgetRows
  518. } else {
  519. this.newBudget.show = false
  520. }
  521. },
  522. // 处理本周新增招标项目规模数据
  523. formatNewScaleData (data) {
  524. if (!data) return
  525. const rows = []
  526. let count = 0
  527. data.forEach((item, index) => {
  528. count += item.bidamount
  529. count += item.growthrate
  530. rows.push({
  531. /* eslint-disable */
  532. '日期': item.item,
  533. '项目总规模': Math.round(item.bidamount),
  534. '环比增长率(%)-右纵轴': item.growthrate.fixed(2)
  535. /* eslint-enable */
  536. })
  537. })
  538. if (count !== 0) {
  539. this.newScale.show = true
  540. this.newScale.data.rows = rows
  541. } else {
  542. this.newScale.show = false
  543. }
  544. },
  545. /* 配置处理 */
  546. newBudgetConfig (options) {
  547. options.tooltip.axisPointer.shadowStyle.color = 'rgba(5,166,243,0.1)'
  548. options.yAxis[1].axisLabel.show = true
  549. const maxCountList = this.newBudget.data.rows.map((v) => {
  550. return v['项目总预算']
  551. })
  552. const maxPriceList = this.newBudget.data.rows.map((v) => {
  553. return v['环比增长率(%)-右纵轴']
  554. })
  555. let maxCount = Math.ceil(Math.max.apply(null, maxCountList)).toString()
  556. let maxPrice = Math.ceil(Math.max.apply(null, maxPriceList)).toString()
  557. let minRight = Math.ceil(Math.min.apply(null, maxPriceList)).toString()
  558. maxCount = Math.ceil(maxCount / (Math.pow(10, maxCount.length - 1))) * Math.pow(10, maxCount.length - 1)
  559. maxPrice = Math.ceil(maxPrice / (Math.pow(10, maxPrice.length - 1))) * Math.pow(10, maxPrice.length - 1)
  560. if (minRight.indexOf('-') > -1) {
  561. minRight = '-' + Math.ceil(minRight.replace('-', '') / (Math.pow(10, minRight.replace('-', '').length - 1))) * Math.pow(10, minRight.replace('-', '').length - 1)
  562. } else {
  563. minRight = 0
  564. }
  565. const item = options.yAxis
  566. item[0].min = 0
  567. item[1].min = minRight
  568. item[0].max = maxCount
  569. item[0].interval = Math.ceil(maxCount / 5)
  570. item[1].max = maxPrice
  571. item[1].interval = Math.ceil((maxPrice - minRight) / 5)
  572. options.tooltip.formatter = (params) => {
  573. return this.commonTooltip(params)
  574. }
  575. return options
  576. },
  577. // 本周新增招标项目规模数据配置
  578. newScaleConfig (options) {
  579. options.tooltip.axisPointer.shadowStyle.color = 'rgba(5,166,243,0.1)'
  580. options.yAxis[1].axisLabel.show = true
  581. const maxCountList = this.newScale.data.rows.map((v) => {
  582. return v['项目总规模']
  583. })
  584. const maxPriceList = this.newScale.data.rows.map((v) => {
  585. return v['环比增长率(%)-右纵轴']
  586. })
  587. let maxCount = Math.ceil(Math.max.apply(null, maxCountList)).toString()
  588. let maxPrice = Math.ceil(Math.max.apply(null, maxPriceList)).toString()
  589. let minRight = Math.ceil(Math.min.apply(null, maxPriceList)).toString()
  590. maxCount = Math.ceil(maxCount / (Math.pow(10, maxCount.length - 1))) * Math.pow(10, maxCount.length - 1)
  591. maxPrice = Math.ceil(maxPrice / (Math.pow(10, maxPrice.length - 1))) * Math.pow(10, maxPrice.length - 1)
  592. if (minRight.indexOf('-') > -1) {
  593. minRight = '-' + Math.ceil(minRight.replace('-', '') / (Math.pow(10, minRight.replace('-', '').length - 1))) * Math.pow(10, minRight.replace('-', '').length - 1)
  594. } else {
  595. minRight = 0
  596. }
  597. const item = options.yAxis
  598. item[0].min = 0
  599. item[1].min = minRight
  600. item[0].max = maxCount
  601. item[0].interval = Math.ceil(maxCount / 5)
  602. item[1].max = maxPrice
  603. item[1].interval = Math.ceil((maxPrice - minRight) / 5)
  604. options.tooltip.formatter = (params) => {
  605. let tip = ''
  606. for (let i = 0; i < params.length; i++) {
  607. if (params[i].value === undefined) {
  608. params[i].value = 0
  609. }
  610. if (i === 0) {
  611. tip = tip + params[i].marker + params[i].seriesName + ':' + params[i].value + '万元' + '<br/>'
  612. } else if (i === 1) {
  613. tip = tip + params[i].marker + params[i].seriesName + ':' + params[i].value + '%' + '<br/>'
  614. }
  615. }
  616. tip += '<div style="padding-top:2px;text-align:center;color:#9B9CA3;">' + ' - ' + params[0].name + ' - ' + '</div>'
  617. return tip
  618. }
  619. return options
  620. },
  621. commonTooltip (params) {
  622. let tip = ''
  623. for (let i = 0; i < params.length; i++) {
  624. if (params[i].value === undefined) {
  625. params[i].value = 0
  626. }
  627. if (i === 0) {
  628. tip = tip + params[i].marker + params[i].seriesName + ':' + params[i].value + '万元' + '<br/>'
  629. } else if (i === 1) {
  630. tip = tip + params[i].marker + params[i].seriesName + ':' + params[i].value + '%' + '<br/>'
  631. }
  632. }
  633. tip += '<div style="padding-top:2px;text-align:center;color:#9B9CA3;">' + ' - ' + params[0].name + ' - ' + '</div>'
  634. return tip
  635. }
  636. }
  637. }
  638. </script>
  639. <style lang="scss" scoped>
  640. .page_week{
  641. margin: 32px auto;
  642. display: flex;
  643. justify-content: space-between;
  644. .chart-title{
  645. padding: 32px 0 16px;
  646. font-size: 18px;
  647. color: #1d1d1d;
  648. line-height: 28px;
  649. font-family: 'Microsoft YaHei, Microsoft YaHei-Regular';
  650. }
  651. .page_week_main{
  652. .week_time{
  653. padding-bottom: 24px;
  654. // width: 920px;
  655. // min-height: 349px;
  656. opacity: 1;
  657. background: #ffffff;
  658. border-radius: 4px;
  659. .setHeight{
  660. height: 72px;
  661. overflow: hidden;
  662. }
  663. .select_report{
  664. padding: 0 40px;
  665. margin: 0 auto;
  666. display: flex;
  667. justify-content: space-between;
  668. align-content: space-between;
  669. flex-wrap: wrap;
  670. .week_report{
  671. margin:0 0 16px 0;
  672. padding: 0 16px;
  673. width: 412px;
  674. opacity: 1;
  675. background: #ffffff;
  676. border: 1px solid #ececec;
  677. border-radius: 5px;
  678. cursor: pointer;
  679. .week_report_main{
  680. display: flex;
  681. flex-direction: column;
  682. .report_top{
  683. display: flex;
  684. justify-content: space-between;
  685. align-items: center;
  686. height: 47px;
  687. border-bottom: 1px solid rgba(0,0,0,0.05);
  688. .reoprt_time{
  689. display: flex;
  690. align-items: center;
  691. .week_text{
  692. display: flex;
  693. justify-content: center;
  694. align-items: center;
  695. margin-right: 8px;
  696. width: 24px;
  697. height: 24px;
  698. opacity: 1;
  699. background: #ff9f40;
  700. border-radius: 50%;
  701. font-size: 13px;
  702. font-weight: 500;
  703. color: #ffffff;
  704. }
  705. .week_days{
  706. font-size: 15px;
  707. font-weight: 500;
  708. color: #171826;
  709. }
  710. .red_point{
  711. display: flex;
  712. margin-left: 4px;
  713. width: 8px;
  714. height: 8px;
  715. background: #fb483d;
  716. border-radius: 50%;
  717. }
  718. }
  719. .repot_gettime{
  720. font-size: 13px;
  721. font-weight: 500;
  722. color: #9b9ca3;
  723. line-height: 20px;
  724. }
  725. }
  726. .report_bot{
  727. display: flex;
  728. justify-content: space-between;
  729. align-items: center;
  730. height: 48px;
  731. .push_text{
  732. font-size: 15px;
  733. font-weight: 500;
  734. color: #5f5e64;
  735. }
  736. .push_num{
  737. font-size: 16px;
  738. font-weight: 500;
  739. color: #171826;
  740. line-height: 24px;
  741. }
  742. .el-icon-arrow-right{
  743. margin-left: 4px;
  744. font-size: 16px;
  745. color: #c0c4cc;
  746. }
  747. }
  748. }
  749. }
  750. .weekActive{
  751. border: 2px solid #2cb7ca;
  752. border-radius: 6px;
  753. box-shadow: 0px 4px 8px 0px rgba(0,0,0,0.08);
  754. }
  755. }
  756. }
  757. .dataReport{
  758. margin-top: 32px;
  759. padding: 32px 40px;
  760. width: 100%;
  761. height: auto;
  762. background: #ffffff;
  763. border-radius: 4px;
  764. .dataReport_main{
  765. width: 100%;
  766. .data_r_head{
  767. display: flex;
  768. align-items: flex-end;
  769. .data_r_title{
  770. height: 28px;
  771. opacity: 1;
  772. font-size: 18px;
  773. font-weight: 400;
  774. color: #1d1d1d;
  775. line-height: 28px;
  776. }
  777. .data_r_week{
  778. margin-left: 8px;
  779. font-size: 12px;
  780. color: #999999;
  781. line-height: 20px;
  782. }
  783. }
  784. .data_keys{
  785. margin: 20px 0;
  786. min-height: 24px;
  787. font-size: 14px;
  788. font-weight: 400;
  789. color: #1d1d1d;
  790. line-height: 24px;
  791. }
  792. .data_line{
  793. width: 840px;
  794. height: 1px;
  795. opacity: 1;
  796. background: #ececec;
  797. }
  798. .data_item{
  799. padding-top: 20px;
  800. width: 100%;
  801. font-size: 12px;
  802. color: #999999;
  803. line-height: 20px;
  804. }
  805. }
  806. }
  807. .echartsView{
  808. margin-top: 16px;
  809. padding: 0 40px;
  810. width: 100%;
  811. background: #ffffff;
  812. }
  813. }
  814. }
  815. .follow-ent-module {
  816. padding-top: 0;
  817. }
  818. .tabs {
  819. margin-top: 24px;
  820. background-color: #fff;
  821. ::v-deep {
  822. .el-tabs__content {
  823. overflow: unset;
  824. }
  825. .fixed-nav {
  826. width: 920px;
  827. top: 53px;
  828. box-shadow: inset 0 -1px 0 0 rgb(0, 0, 0, 0.05);
  829. }
  830. .el-tabs__header {
  831. margin: 0;
  832. padding: 0 40px;
  833. border-bottom: 1px solid #ECECEC;
  834. background-color: #fff;
  835. }
  836. .el-tabs__item {
  837. height: 50px;
  838. line-height: 50px;
  839. font-size: 16px;
  840. color: #686868;
  841. &.is-active,
  842. &:hover {
  843. color: #2CB7CA;
  844. }
  845. }
  846. .el-tabs__nav-wrap {
  847. &::after {
  848. content: unset;
  849. }
  850. }
  851. }
  852. }
  853. </style>