data.js 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131
  1. import echarts from "echarts"
  2. const rowLimit = (params, max) => {
  3. let result = ''
  4. //一行显示几个字
  5. let rowMax = max
  6. let rowNumber = Math.ceil(params.length / rowMax)
  7. // 超过 3 个字换行
  8. if (params.length > 3) {
  9. for (let p = 0; p < rowNumber; p++) {
  10. let tempStr = ''
  11. let start = p * rowMax
  12. let end = start + rowMax
  13. if (p == rowNumber - 1) {
  14. tempStr = params.substring(start, params.length);
  15. } else {
  16. tempStr = params.substring(start, end) + '\n'
  17. }
  18. result += tempStr
  19. }
  20. } else {
  21. result = params
  22. }
  23. return result
  24. }
  25. export const acceptOption1 = {
  26. // 图表标题
  27. title: {
  28. show: true,
  29. text: '检测受理类型',
  30. textStyle: {
  31. color: '#fff',
  32. fontSize: 20,
  33. fontWeight: '600'
  34. },
  35. textAlign: 'center',
  36. left: '50%',
  37. top: '20px'
  38. },
  39. grid: {
  40. top: '80px'
  41. },
  42. xAxis: {
  43. type: 'category',
  44. data: ['理化', '微生物', '细胞活率', '残留检测', '细胞鉴别'],
  45. axisTick: {
  46. alignWithLabel: true
  47. },
  48. axisLabel: {
  49. style: {
  50. fill: '#fff'
  51. },
  52. formatter (params) {
  53. return rowLimit(params, 2)
  54. }
  55. },
  56. axisLine: {
  57. lineStyle: {
  58. color: '#fff'
  59. }
  60. }
  61. // axisLabel: {
  62. // inside: true,
  63. // color: "#000",
  64. // },
  65. // axisTick: {
  66. // show: true,
  67. // },
  68. // axisLine: {
  69. // show: true,
  70. // },
  71. // z: 10
  72. },
  73. yAxis: {
  74. type: 'value',
  75. name: '',
  76. nameTextStyle: {
  77. color: '#fff',
  78. fontSize: 14
  79. },
  80. splitLine: {
  81. show: false
  82. },
  83. axisLine: {
  84. lineStyle: {
  85. color: '#fff'
  86. }
  87. }
  88. },
  89. series: [{
  90. type: 'bar',
  91. name: '',
  92. data: [],
  93. barMaxWidth: '35px',
  94. itemStyle: {
  95. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  96. { offset: 0, color: "#83bff6" },
  97. { offset: 0.5, color: "#188df0" },
  98. { offset: 1, color: "#188df0" },
  99. ]),
  100. label: {
  101. show: true,
  102. position: 'top',
  103. textStyle: {
  104. color: '#fff',
  105. fontSize: 14
  106. },
  107. formatter (params) {
  108. return params.value ? params.value : ''
  109. }
  110. }
  111. },
  112. emphasis: {
  113. itemStyle: {
  114. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  115. { offset: 0, color: "#2378f7" },
  116. { offset: 0.7, color: "#2378f7" },
  117. { offset: 1, color: "#83bff6" },
  118. ])
  119. }
  120. }
  121. }],
  122. tooltip: {
  123. show: true,
  124. trigger: 'axis'
  125. }
  126. }
  127. export const colors = [
  128. '#d20962',
  129. '#f47721',
  130. '#7ac143',
  131. '#00a78e',
  132. '#00bce4',
  133. '#7d3f98',
  134. '#037ef3',
  135. '#f85a40',
  136. '#00c16e',
  137. '#12CBC4',
  138. '#b4a996',
  139. '#7552cc',
  140. '#67809f',
  141. '#f19066'
  142. ]
  143. export function* getRandomColor (shuffledColors) {
  144. let index = 0
  145. while (index < shuffledColors.length) {
  146. yield shuffledColors[index]
  147. index++
  148. }
  149. }
  150. let colorList = []
  151. export const acceptOption = {
  152. title: {
  153. show: true,
  154. text: '检测类型',
  155. textStyle: {
  156. color: '#fff',
  157. fontSize: 20,
  158. fontWeight: '600'
  159. },
  160. textAlign: 'center',
  161. left: '50%',
  162. top: '20px'
  163. },
  164. legend: {
  165. // type: 'scroll',
  166. orient: 'horizontal',
  167. show: true,
  168. left: 'center',
  169. bottom: 10,
  170. // right: 10,
  171. // top: 100,
  172. formatter (params) {
  173. let l = 7
  174. if (params.length > l) {
  175. return params.substring(0, l) + '\n' + params.substring(l)
  176. }
  177. return params
  178. },
  179. // formatter: ['{a|{name}}'].join('\n'),
  180. // textStyle: {
  181. // rich: {
  182. // a: {
  183. // width: 80,
  184. // overflow: 'break',
  185. // lineHeight: 12
  186. // }
  187. // }
  188. // },
  189. z: 3,
  190. itemWidth: 25,
  191. itemHeight: 14,
  192. itemGap: 10,
  193. data: []
  194. },
  195. series: [
  196. {
  197. name: '任务完成情况',
  198. type: 'pie',
  199. radius: '55%',
  200. center: ['50%', '50%'],
  201. data: [],
  202. itemStyle: {
  203. emphasis: {
  204. shadowBlur: 10,
  205. shadowOffsetX: 0,
  206. shadowColor: 'rgba(0, 0, 0, 0.5)'
  207. },
  208. normal: {
  209. label: {
  210. show: true,
  211. position: 'outer',
  212. // formatter: `占比:{d}%\n\n\r{b}:{c}`,
  213. formatter: `{b}:{d}%`,
  214. fontSize: 14
  215. },
  216. labelLine: {
  217. show: true
  218. }
  219. }
  220. }
  221. }
  222. ],
  223. color: colorList,
  224. tooltip: {
  225. show: true,
  226. trigger: 'item',
  227. formatter: '任务情况<br/>{b}:{c}<br/>占比:{d}%'
  228. }
  229. }
  230. export const taskOption = {
  231. // 图表标题
  232. title: {
  233. show: true,
  234. text: '检测任务情况',
  235. textStyle: {
  236. color: '#fff',
  237. fontSize: 20,
  238. fontWeight: '600'
  239. },
  240. textAlign: 'center',
  241. left: '50%',
  242. top: '20px'
  243. },
  244. grid: {
  245. top: '80px',
  246. bottom: '30px'
  247. },
  248. xAxis: {
  249. type: 'category',
  250. data: ['委托', '任务分配', '检测', '报告'],
  251. axisTick: {
  252. alignWithLabel: true
  253. },
  254. axisLabel: {
  255. style: {
  256. fill: '#fff'
  257. },
  258. formatter (params) {
  259. return rowLimit(params, 2)
  260. }
  261. },
  262. axisLine: {
  263. lineStyle: {
  264. color: '#fff'
  265. }
  266. }
  267. },
  268. yAxis: {
  269. type: 'value',
  270. name: '',
  271. nameTextStyle: {
  272. color: '#fff',
  273. fontSize: 14
  274. },
  275. splitLine: {
  276. show: false
  277. },
  278. axisLine: {
  279. lineStyle: {
  280. color: '#fff'
  281. }
  282. }
  283. },
  284. series: [{
  285. type: 'bar',
  286. name: '',
  287. data: [],
  288. barWidth: '24px',
  289. barGap: '20%',
  290. barMaxWidth: '35px',
  291. itemStyle: {
  292. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  293. { offset: 0, color: "#83bff6" },
  294. { offset: 0.5, color: "#188df0" },
  295. { offset: 1, color: "#188df0" },
  296. ])
  297. },
  298. emphasis: {
  299. itemStyle: {
  300. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  301. { offset: 0, color: "#2378f7" },
  302. { offset: 0.7, color: "#2378f7" },
  303. { offset: 1, color: "#83bff6" },
  304. ])
  305. }
  306. },
  307. label: {
  308. show: true,
  309. position: 'top',
  310. textStyle: {
  311. color: '#fff',
  312. fontSize: 14
  313. },
  314. formatter (params) {
  315. return params.value ? params.value : ''
  316. }
  317. }
  318. }],
  319. tooltip: {
  320. show: true,
  321. trigger: 'axis'
  322. }
  323. }
  324. export const trustOption = {
  325. legend: {
  326. data: [
  327. {
  328. name: '委托',
  329. itemStyle: {
  330. color: '#00baff'
  331. }
  332. },
  333. {
  334. name: '受理',
  335. itemStyle: {
  336. color: '#f5d94e'
  337. }
  338. }
  339. ],
  340. textStyle: {
  341. color: '#fff',
  342. },
  343. bottom: 10
  344. },
  345. title: {
  346. show: true,
  347. text: '检测委托受理量',
  348. textStyle: {
  349. color: '#fff',
  350. fontSize: 20,
  351. fontWeight: '600'
  352. },
  353. textAlign: 'center',
  354. left: '50%',
  355. top: '20px'
  356. },
  357. grid: {
  358. top: '80px'
  359. },
  360. xAxis: {
  361. type: 'category',
  362. data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
  363. axisTick: {
  364. alignWithLabel: true
  365. },
  366. axisLabel: {
  367. style: {
  368. fill: '#fff'
  369. }
  370. },
  371. axisLine: {
  372. lineStyle: {
  373. color: '#fff'
  374. }
  375. }
  376. },
  377. yAxis: {
  378. type: 'value',
  379. name: '',
  380. nameTextStyle: {
  381. color: '#fff',
  382. fontSize: 14
  383. },
  384. splitLine: {
  385. show: false
  386. },
  387. axisLabel: {
  388. style: {
  389. fill: '#fff'
  390. }
  391. },
  392. axisLine: {
  393. lineStyle: {
  394. color: '#fff'
  395. }
  396. }
  397. },
  398. series: [
  399. {
  400. type: 'bar',
  401. name: '委托',
  402. data: [],
  403. barMaxWidth: '35px',
  404. barStyle: {
  405. fill: 'rgba(0, 186, 255, 0.4)'
  406. },
  407. itemStyle: {
  408. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  409. { offset: 0, color: "#83bff6" },
  410. { offset: 0.5, color: "#188df0" },
  411. { offset: 1, color: "#188df0" },
  412. ])
  413. },
  414. emphasis: {
  415. itemStyle: {
  416. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  417. { offset: 0, color: "#2378f7" },
  418. { offset: 0.7, color: "#2378f7" },
  419. { offset: 1, color: "#83bff6" },
  420. ])
  421. }
  422. },
  423. label: {
  424. show: true,
  425. position: 'top',
  426. textStyle: {
  427. color: '#fff',
  428. fontSize: 14
  429. },
  430. formatter (params) {
  431. return params.value ? params.value : ''
  432. }
  433. }
  434. },
  435. {
  436. type: 'line',
  437. name: '受理',
  438. data: [],
  439. symbol: 'circle',
  440. symbolSize: 10,
  441. lineArea: {
  442. show: true,
  443. gradient: ['rgba(245, 217, 79, 0.8)', 'rgba(245, 217, 79, 0.2)']
  444. },
  445. itemStyle: {
  446. color: '#f5d94e'
  447. },
  448. label: {
  449. show: true,
  450. position: 'right',
  451. textStyle: {
  452. color: '#f5d94e',
  453. fontSize: 14
  454. },
  455. formatter (params) {
  456. return params.value ? params.value : ''
  457. }
  458. }
  459. }
  460. ],
  461. tooltip: {
  462. show: true,
  463. trigger: 'axis'
  464. }
  465. }
  466. export const reportOptionTask = {
  467. title: {
  468. show: true,
  469. text: '检测任务月度完成量',
  470. textStyle: {
  471. color: '#fff',
  472. fontSize: 20,
  473. fontWeight: '600'
  474. },
  475. textAlign: 'center',
  476. left: '50%',
  477. top: '20px'
  478. },
  479. grid: {
  480. top: '80px'
  481. },
  482. xAxis: {
  483. type: 'category',
  484. data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
  485. axisTick: {
  486. alignWithLabel: true
  487. },
  488. axisLabel: {
  489. style: {
  490. fill: '#fff'
  491. }
  492. },
  493. axisLine: {
  494. lineStyle: {
  495. color: '#fff'
  496. }
  497. }
  498. },
  499. yAxis: {
  500. type: 'value',
  501. name: '',
  502. nameTextStyle: {
  503. color: '#fff',
  504. fontSize: 14
  505. },
  506. splitLine: {
  507. show: false
  508. },
  509. axisLine: {
  510. lineStyle: {
  511. color: '#fff'
  512. }
  513. }
  514. },
  515. series: [{
  516. type: 'bar',
  517. name: '',
  518. data: [],
  519. barMaxWidth: '35px',
  520. itemStyle: {
  521. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  522. { offset: 0, color: "#83bff6" },
  523. { offset: 0.5, color: "#188df0" },
  524. { offset: 1, color: "#188df0" },
  525. ])
  526. },
  527. emphasis: {
  528. itemStyle: {
  529. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  530. { offset: 0, color: "#2378f7" },
  531. { offset: 0.7, color: "#2378f7" },
  532. { offset: 1, color: "#83bff6" },
  533. ])
  534. }
  535. },
  536. label: {
  537. show: true,
  538. position: 'top',
  539. textStyle: {
  540. color: '#fff',
  541. fontSize: 14
  542. },
  543. formatter (params) {
  544. return params.value ? params.value : ''
  545. }
  546. }
  547. }],
  548. tooltip: {
  549. show: true,
  550. trigger: 'axis'
  551. }
  552. }
  553. export const reportOption = {
  554. title: {
  555. show: true,
  556. text: '检测报告月度发放量',
  557. textStyle: {
  558. color: '#fff',
  559. fontSize: 20,
  560. fontWeight: '600'
  561. },
  562. textAlign: 'center',
  563. left: '50%',
  564. top: '20px'
  565. },
  566. grid: {
  567. top: '80px'
  568. },
  569. xAxis: {
  570. type: 'category',
  571. data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
  572. axisTick: {
  573. alignWithLabel: true
  574. },
  575. axisLabel: {
  576. style: {
  577. fill: '#fff'
  578. }
  579. },
  580. axisLine: {
  581. lineStyle: {
  582. color: '#fff'
  583. }
  584. }
  585. },
  586. yAxis: {
  587. type: 'value',
  588. name: '',
  589. nameTextStyle: {
  590. color: '#fff',
  591. fontSize: 14
  592. },
  593. splitLine: {
  594. show: false
  595. },
  596. axisLine: {
  597. lineStyle: {
  598. color: '#fff'
  599. }
  600. }
  601. },
  602. series: [{
  603. type: 'bar',
  604. name: '',
  605. data: [],
  606. barMaxWidth: '35px',
  607. itemStyle: {
  608. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  609. { offset: 0, color: "#83bff6" },
  610. { offset: 0.5, color: "#188df0" },
  611. { offset: 1, color: "#188df0" },
  612. ])
  613. },
  614. emphasis: {
  615. itemStyle: {
  616. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  617. { offset: 0, color: "#2378f7" },
  618. { offset: 0.7, color: "#2378f7" },
  619. { offset: 1, color: "#83bff6" },
  620. ])
  621. }
  622. },
  623. label: {
  624. show: true,
  625. position: 'top',
  626. textStyle: {
  627. color: '#fff',
  628. fontSize: 14
  629. },
  630. formatter (params) {
  631. return params.value ? params.value : ''
  632. }
  633. }
  634. }],
  635. tooltip: {
  636. show: true,
  637. trigger: 'axis'
  638. }
  639. }
  640. export const sampleOption = {
  641. title: {
  642. show: true,
  643. text: '样品受理情况',
  644. textStyle: {
  645. color: '#fff',
  646. fontSize: 20,
  647. fontWeight: '600'
  648. },
  649. textAlign: 'center',
  650. left: '50%',
  651. top: '20px'
  652. },
  653. grid: {
  654. top: '80px'
  655. },
  656. xAxis: {
  657. type: 'category',
  658. data: ['已委托未收样', '已收样', '已收不合格', '留样'],
  659. axisTick: {
  660. alignWithLabel: true
  661. },
  662. axisLabel: {
  663. style: {
  664. fill: '#fff'
  665. },
  666. formatter (params) {
  667. return rowLimit(params, 3)
  668. }
  669. },
  670. axisLine: {
  671. lineStyle: {
  672. color: '#fff'
  673. }
  674. }
  675. },
  676. yAxis: {
  677. type: 'value',
  678. name: '',
  679. nameTextStyle: {
  680. color: '#fff',
  681. fontSize: 14
  682. },
  683. splitLine: {
  684. show: false
  685. },
  686. axisLine: {
  687. lineStyle: {
  688. color: '#fff'
  689. }
  690. }
  691. },
  692. series: [{
  693. type: 'bar',
  694. name: '',
  695. data: [],
  696. barMaxWidth: '35px',
  697. itemStyle: {
  698. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  699. { offset: 0, color: "#83bff6" },
  700. { offset: 0.5, color: "#188df0" },
  701. { offset: 1, color: "#188df0" },
  702. ])
  703. },
  704. emphasis: {
  705. itemStyle: {
  706. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  707. { offset: 0, color: "#2378f7" },
  708. { offset: 0.7, color: "#2378f7" },
  709. { offset: 1, color: "#83bff6" },
  710. ])
  711. }
  712. },
  713. label: {
  714. show: true,
  715. position: 'top',
  716. textStyle: {
  717. color: '#fff',
  718. fontSize: 14
  719. },
  720. formatter (params) {
  721. return params.value ? params.value : ''
  722. }
  723. }
  724. }],
  725. tooltip: {
  726. show: true,
  727. trigger: 'axis'
  728. }
  729. }
  730. export const monthOption = {
  731. legend: {
  732. data: [
  733. {
  734. name: '任务总数',
  735. itemStyle: {
  736. color: '#00baff'
  737. }
  738. },
  739. {
  740. name: '已完成',
  741. itemStyle: {
  742. color: '#f5d94e'
  743. }
  744. }
  745. ],
  746. textStyle: {
  747. color: '#fff',
  748. },
  749. bottom: 10
  750. },
  751. title: {
  752. show: true,
  753. text: '检测任务月度完成量',
  754. textStyle: {
  755. color: '#fff',
  756. fontSize: 20,
  757. fontWeight: '600'
  758. },
  759. textAlign: 'center',
  760. left: '50%',
  761. top: '20px'
  762. },
  763. grid: {
  764. top: '80px'
  765. },
  766. xAxis: {
  767. type: 'category',
  768. data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
  769. axisTick: {
  770. alignWithLabel: true
  771. },
  772. axisLabel: {
  773. style: {
  774. fill: '#fff'
  775. }
  776. },
  777. axisLine: {
  778. lineStyle: {
  779. color: '#fff'
  780. }
  781. }
  782. },
  783. yAxis: {
  784. type: 'value',
  785. name: '',
  786. nameTextStyle: {
  787. color: '#fff',
  788. fontSize: 14
  789. },
  790. splitLine: {
  791. show: false
  792. },
  793. axisLabel: {
  794. style: {
  795. fill: '#fff'
  796. }
  797. },
  798. axisLine: {
  799. lineStyle: {
  800. color: '#fff'
  801. }
  802. }
  803. },
  804. series: [
  805. {
  806. type: 'bar',
  807. name: '任务总数',
  808. data: [],
  809. barMaxWidth: '35px',
  810. barStyle: {
  811. fill: 'rgba(0, 186, 255, 0.4)'
  812. },
  813. itemStyle: {
  814. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  815. { offset: 0, color: "#83bff6" },
  816. { offset: 0.5, color: "#188df0" },
  817. { offset: 1, color: "#188df0" },
  818. ])
  819. },
  820. emphasis: {
  821. itemStyle: {
  822. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  823. { offset: 0, color: "#2378f7" },
  824. { offset: 0.7, color: "#2378f7" },
  825. { offset: 1, color: "#83bff6" },
  826. ])
  827. }
  828. },
  829. label: {
  830. show: true,
  831. position: 'top',
  832. textStyle: {
  833. color: '#fff',
  834. fontSize: 14
  835. },
  836. formatter (params) {
  837. return params.value ? params.value : ''
  838. }
  839. }
  840. },
  841. {
  842. type: 'line',
  843. name: '已完成',
  844. data: [],
  845. symbol: 'circle',
  846. symbolSize: 10,
  847. lineArea: {
  848. show: true,
  849. gradient: ['rgba(245, 217, 79, 0.8)', 'rgba(245, 217, 79, 0.2)']
  850. },
  851. itemStyle: {
  852. color: '#f5d94e'
  853. },
  854. label: {
  855. show: true,
  856. position: 'right',
  857. textStyle: {
  858. color: '#f5d94e',
  859. fontSize: 14
  860. },
  861. formatter (params) {
  862. return params.value ? params.value : ''
  863. }
  864. }
  865. }
  866. ],
  867. tooltip: {
  868. show: true,
  869. trigger: 'axis'
  870. }
  871. }
  872. export const yearOption = {
  873. title: {
  874. show: true,
  875. text: '检测任务年度完成量',
  876. textStyle: {
  877. color: '#fff',
  878. fontSize: 20,
  879. fontWeight: '600'
  880. },
  881. textAlign: 'center',
  882. left: '50%',
  883. top: '20px'
  884. },
  885. legend: {
  886. orient: 'horizontal',
  887. show: true,
  888. left: 'center',
  889. bottom: 10,
  890. z: 3,
  891. itemWidth: 25,
  892. itemHeight: 14,
  893. itemGap: 10,
  894. data: [
  895. {
  896. name: '未完成',
  897. textStyle: {
  898. color: '#ff6347'
  899. }
  900. },
  901. {
  902. name: '已完成',
  903. textStyle: {
  904. color: '#3f3'
  905. }
  906. }
  907. ]
  908. },
  909. series: [
  910. {
  911. name: '任务完成情况',
  912. type: 'pie',
  913. radius: '55%',
  914. center: ['50%', '50%'],
  915. data: [],
  916. itemStyle: {
  917. emphasis: {
  918. shadowBlur: 10,
  919. shadowOffsetX: 0,
  920. shadowColor: 'rgba(0, 0, 0, 0.5)'
  921. },
  922. normal: {
  923. label: {
  924. show: true,
  925. position: 'outer',
  926. formatter: `占比:{d}%\n\n\r{b}:{c}`,
  927. // formatter: `{b}:{c}\n\n\r占比:{d}%`,
  928. fontSize: 14
  929. },
  930. labelLine: {
  931. show: true
  932. }
  933. }
  934. }
  935. }
  936. ],
  937. color: ['#ff6347', '#3f3'],
  938. tooltip: {
  939. show: true,
  940. trigger: 'item',
  941. formatter: '任务情况<br/>{b}:{c}<br/>占比:{d}%'
  942. }
  943. }
  944. // 假数据
  945. export const satisfaction = {
  946. title: {
  947. show: true,
  948. text: '客户满意度',
  949. textStyle: {
  950. color: '#fff',
  951. fontSize: 20,
  952. fontWeight: '600'
  953. },
  954. textAlign: 'center',
  955. left: '50%',
  956. top: '20px'
  957. },
  958. legend: {
  959. orient: 'horizontal',
  960. show: true,
  961. left: 'center',
  962. bottom: 10,
  963. z: 3,
  964. itemWidth: 25,
  965. itemHeight: 14,
  966. itemGap: 10,
  967. data: [
  968. {
  969. name: '不满意',
  970. textStyle: {
  971. color: '#d20962'
  972. }
  973. },
  974. {
  975. name: '满意',
  976. textStyle: {
  977. color: '#188df0'
  978. }
  979. }
  980. ]
  981. },
  982. series: [
  983. {
  984. name: '满意度占比',
  985. type: 'pie',
  986. radius: '55%',
  987. center: ['50%', '50%'],
  988. data: [
  989. {
  990. name: '不满意',
  991. value: 5
  992. },
  993. {
  994. name: '满意',
  995. value: 995
  996. }
  997. ],
  998. itemStyle: {
  999. emphasis: {
  1000. shadowBlur: 10,
  1001. shadowOffsetX: 0,
  1002. shadowColor: 'rgba(0, 0, 0, 0.5)'
  1003. },
  1004. normal: {
  1005. label: {
  1006. show: true,
  1007. position: 'outer',
  1008. formatter: `占比:{d}%`,
  1009. fontSize: 14,
  1010. color: '#fff'
  1011. },
  1012. labelLine: {
  1013. show: true
  1014. }
  1015. }
  1016. }
  1017. }
  1018. ],
  1019. color: ['#d20962', new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  1020. { offset: 0, color: "#83bff6" },
  1021. { offset: 0.5, color: "#188df0" },
  1022. { offset: 1, color: "#188df0" },
  1023. ])],
  1024. tooltip: {
  1025. show: true,
  1026. trigger: 'item',
  1027. formatter: '统计情况<br/>{b}:{c}<br/>占比:{d}%'
  1028. }
  1029. }
  1030. export const contract = {
  1031. title: {
  1032. show: true,
  1033. text: '合同履约率',
  1034. textStyle: {
  1035. color: '#fff',
  1036. fontSize: 20,
  1037. fontWeight: '600'
  1038. },
  1039. textAlign: 'center',
  1040. left: '50%',
  1041. top: '20px'
  1042. },
  1043. legend: {
  1044. orient: 'horizontal',
  1045. show: true,
  1046. left: 'center',
  1047. bottom: 10,
  1048. z: 3,
  1049. itemWidth: 25,
  1050. itemHeight: 14,
  1051. itemGap: 10,
  1052. data: [
  1053. {
  1054. name: '未履约',
  1055. textStyle: {
  1056. color: '#d20962'
  1057. }
  1058. },
  1059. {
  1060. name: '已履约',
  1061. textStyle: {
  1062. color: '#188df0'
  1063. }
  1064. }
  1065. ]
  1066. },
  1067. series: [
  1068. {
  1069. name: '任务完成情况',
  1070. type: 'pie',
  1071. radius: '55%',
  1072. center: ['50%', '50%'],
  1073. data: [
  1074. {
  1075. name: '未履约',
  1076. value: 0
  1077. },
  1078. {
  1079. name: '已履约',
  1080. value: 100
  1081. }
  1082. ],
  1083. itemStyle: {
  1084. emphasis: {
  1085. shadowBlur: 10,
  1086. shadowOffsetX: 0,
  1087. shadowColor: 'rgba(0, 0, 0, 0.5)'
  1088. },
  1089. normal: {
  1090. label: {
  1091. show: true,
  1092. position: 'outer',
  1093. formatter: `占比:{d}%`,
  1094. fontSize: 14,
  1095. color: '#fff'
  1096. },
  1097. labelLine: {
  1098. show: true
  1099. }
  1100. }
  1101. }
  1102. }
  1103. ],
  1104. color: ['#d20962', new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  1105. { offset: 0, color: "#83bff6" },
  1106. { offset: 0.5, color: "#188df0" },
  1107. { offset: 1, color: "#188df0" },
  1108. ])],
  1109. tooltip: {
  1110. show: true,
  1111. trigger: 'item',
  1112. formatter: '统计情况<br/>{b}:{c}<br/>占比:{d}%'
  1113. }
  1114. }