data.js 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. import echarts from "echarts"
  2. export const acceptOption1 = {
  3. // 图表标题
  4. title: {
  5. show: true,
  6. text: '检测受理类型',
  7. textStyle: {
  8. color: '#fff',
  9. fontSize: 20,
  10. fontWeight: '600'
  11. },
  12. textAlign: 'center',
  13. left: '50%',
  14. top: '20px'
  15. },
  16. xAxis: {
  17. type: 'category',
  18. data: ['理化', '微生物', '细胞活率', '残留检测', '细胞鉴别'],
  19. axisTick: {
  20. alignWithLabel: true
  21. },
  22. axisLabel: {
  23. style: {
  24. fill: '#fff'
  25. },
  26. formatter: function (params) {
  27. let result = ''
  28. //一行显示几个字
  29. let rowMax = 2
  30. let rowNumber = Math.ceil(params.length / rowMax)
  31. // 超过 3 个字换行
  32. if (params.length > 3) {
  33. for (let p = 0; p < rowNumber; p++) {
  34. let tempStr = ''
  35. let start = p * rowMax
  36. let end = start + rowMax
  37. if (p == rowNumber - 1) {
  38. tempStr = params.substring(start, params.length);
  39. } else {
  40. tempStr = params.substring(start, end) + '\n'
  41. }
  42. result += tempStr
  43. }
  44. } else {
  45. result = params
  46. }
  47. return result
  48. }
  49. },
  50. axisLine: {
  51. lineStyle: {
  52. color: '#fff'
  53. }
  54. }
  55. // axisLabel: {
  56. // inside: true,
  57. // color: "#000",
  58. // },
  59. // axisTick: {
  60. // show: true,
  61. // },
  62. // axisLine: {
  63. // show: true,
  64. // },
  65. // z: 10
  66. },
  67. yAxis: {
  68. type: 'value',
  69. name: '',
  70. nameTextStyle: {
  71. color: '#fff',
  72. fontSize: 14
  73. },
  74. splitLine: {
  75. show: false
  76. },
  77. axisLine: {
  78. lineStyle: {
  79. color: '#fff'
  80. }
  81. }
  82. },
  83. series: [{
  84. type: 'bar',
  85. name: '',
  86. data: [],
  87. barMaxWidth: '35px',
  88. itemStyle: {
  89. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  90. { offset: 0, color: "#83bff6" },
  91. { offset: 0.5, color: "#188df0" },
  92. { offset: 1, color: "#188df0" },
  93. ])
  94. },
  95. emphasis: {
  96. itemStyle: {
  97. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  98. { offset: 0, color: "#2378f7" },
  99. { offset: 0.7, color: "#2378f7" },
  100. { offset: 1, color: "#83bff6" },
  101. ])
  102. }
  103. }
  104. }],
  105. tooltip: {
  106. show: true,
  107. trigger: 'axis'
  108. }
  109. }
  110. export const acceptList = [
  111. '无菌检查',
  112. '支原体检查',
  113. '内毒素',
  114. '细胞计数与活率',
  115. '免疫评估',
  116. '细胞标志蛋白检测',
  117. '干细胞三项诱导分化',
  118. '细胞外源病毒因子检测',
  119. '干细胞生物学效力检测',
  120. 'CAR-T',
  121. '残留物检测',
  122. '干细胞成瘤性检测',
  123. '干细胞的免疫学反应检测',
  124. '核型分析',
  125. '细胞形态',
  126. '感染八项',
  127. '衣原体检查',
  128. '结核杆菌',
  129. '新项目与方法',
  130. '基础科研'
  131. ]
  132. const colors = [
  133. '#d20962',
  134. '#f47721',
  135. '#7ac143',
  136. '#00a78e',
  137. '#00bce4',
  138. '#7d3f98',
  139. '#037ef3',
  140. '#f85a40',
  141. '#00c16e',
  142. '#ffd900',
  143. '#0cb9c1',
  144. '#7552cc'
  145. ]
  146. let colorList = []
  147. const getOptions = () => {
  148. let res = []
  149. colorList = []
  150. acceptList.forEach(item => {
  151. let random = parseInt(Math.random() * 12)
  152. let obj = {
  153. name: item,
  154. textStyle: {
  155. color: colors[random]
  156. }
  157. }
  158. res.push(obj)
  159. colorList.push(colors[random])
  160. })
  161. return res
  162. }
  163. export const acceptOption = {
  164. title: {
  165. show: true,
  166. text: '检测类型',
  167. textStyle: {
  168. color: '#fff',
  169. fontSize: 20,
  170. fontWeight: '600'
  171. },
  172. textAlign: 'center',
  173. left: '50%',
  174. top: '20px'
  175. },
  176. legend: {
  177. type: 'scroll',
  178. orient: 'vertical',
  179. show: true,
  180. // left: 'center',
  181. // bottom: 10,
  182. right: 10,
  183. top: 50,
  184. z: 3,
  185. itemWidth: 25,
  186. itemHeight: 14,
  187. itemGap: 10,
  188. data: getOptions()
  189. },
  190. series: [
  191. {
  192. name: '任务完成情况',
  193. type: 'pie',
  194. radius: '55%',
  195. center: ['35%', '50%'],
  196. data: [],
  197. itemStyle: {
  198. emphasis: {
  199. shadowBlur: 10,
  200. shadowOffsetX: 0,
  201. shadowColor: 'rgba(0, 0, 0, 0.5)'
  202. },
  203. normal: {
  204. label: {
  205. show: true,
  206. position: 'outer',
  207. // formatter: `占比:{d}%\n\n\r{b}:{c}`,
  208. formatter: `{b}:{c}`,
  209. fontSize: 12
  210. },
  211. labelLine: {
  212. show: true
  213. }
  214. }
  215. }
  216. }
  217. ],
  218. color: colorList,
  219. tooltip: {
  220. show: true,
  221. trigger: 'item',
  222. formatter: '任务情况<br/>{b}:{c}<br/>占比:{d}%'
  223. }
  224. }
  225. export const taskOption = {
  226. // 图表标题
  227. title: {
  228. show: true,
  229. text: '检测任务情况',
  230. textStyle: {
  231. color: '#fff',
  232. fontSize: 20,
  233. fontWeight: '600'
  234. },
  235. textAlign: 'center',
  236. left: '50%',
  237. top: '20px'
  238. },
  239. xAxis: {
  240. type: 'category',
  241. data: ['委托', '任务分配', '检测', '报告'],
  242. axisTick: {
  243. alignWithLabel: true
  244. },
  245. axisLabel: {
  246. style: {
  247. fill: '#fff'
  248. }
  249. },
  250. axisLine: {
  251. lineStyle: {
  252. color: '#fff'
  253. }
  254. }
  255. },
  256. yAxis: {
  257. type: 'value',
  258. name: '',
  259. nameTextStyle: {
  260. color: '#fff',
  261. fontSize: 14
  262. },
  263. splitLine: {
  264. show: false
  265. },
  266. axisLine: {
  267. lineStyle: {
  268. color: '#fff'
  269. }
  270. }
  271. },
  272. series: [{
  273. type: 'bar',
  274. name: '',
  275. data: [],
  276. barMaxWidth: '35px',
  277. itemStyle: {
  278. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  279. { offset: 0, color: "#83bff6" },
  280. { offset: 0.5, color: "#188df0" },
  281. { offset: 1, color: "#188df0" },
  282. ])
  283. },
  284. emphasis: {
  285. itemStyle: {
  286. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  287. { offset: 0, color: "#2378f7" },
  288. { offset: 0.7, color: "#2378f7" },
  289. { offset: 1, color: "#83bff6" },
  290. ])
  291. }
  292. }
  293. }],
  294. tooltip: {
  295. show: true,
  296. trigger: 'axis'
  297. }
  298. }
  299. export const trustOption = {
  300. legend: {
  301. data: [
  302. {
  303. name: '委托',
  304. itemStyle: {
  305. color: '#00baff'
  306. }
  307. },
  308. {
  309. name: '受理',
  310. itemStyle: {
  311. color: '#f5d94e'
  312. }
  313. }
  314. ],
  315. textStyle: {
  316. color: '#fff',
  317. },
  318. bottom: 10
  319. },
  320. title: {
  321. show: true,
  322. text: '检测委托受理量',
  323. textStyle: {
  324. color: '#fff',
  325. fontSize: 20,
  326. fontWeight: '600'
  327. },
  328. textAlign: 'center',
  329. left: '50%',
  330. top: '20px'
  331. },
  332. xAxis: {
  333. type: 'category',
  334. data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
  335. axisTick: {
  336. alignWithLabel: true
  337. },
  338. axisLabel: {
  339. style: {
  340. fill: '#fff'
  341. }
  342. },
  343. axisLine: {
  344. lineStyle: {
  345. color: '#fff'
  346. }
  347. }
  348. },
  349. yAxis: {
  350. type: 'value',
  351. name: '',
  352. nameTextStyle: {
  353. color: '#fff',
  354. fontSize: 14
  355. },
  356. splitLine: {
  357. show: false
  358. },
  359. axisLabel: {
  360. style: {
  361. fill: '#fff'
  362. }
  363. },
  364. axisLine: {
  365. lineStyle: {
  366. color: '#fff'
  367. }
  368. }
  369. },
  370. series: [
  371. {
  372. type: 'bar',
  373. name: '委托',
  374. data: [],
  375. barMaxWidth: '35px',
  376. barStyle: {
  377. fill: 'rgba(0, 186, 255, 0.4)'
  378. },
  379. itemStyle: {
  380. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  381. { offset: 0, color: "#83bff6" },
  382. { offset: 0.5, color: "#188df0" },
  383. { offset: 1, color: "#188df0" },
  384. ])
  385. },
  386. emphasis: {
  387. itemStyle: {
  388. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  389. { offset: 0, color: "#2378f7" },
  390. { offset: 0.7, color: "#2378f7" },
  391. { offset: 1, color: "#83bff6" },
  392. ])
  393. }
  394. }
  395. },
  396. {
  397. type: 'line',
  398. name: '受理',
  399. data: [],
  400. symbol: 'circle',
  401. symbolSize: 10,
  402. lineArea: {
  403. show: true,
  404. gradient: ['rgba(245, 217, 79, 0.8)', 'rgba(245, 217, 79, 0.2)']
  405. },
  406. itemStyle: {
  407. color: '#f5d94e'
  408. }
  409. }
  410. ],
  411. tooltip: {
  412. show: true,
  413. trigger: 'axis'
  414. }
  415. }
  416. export const sampleOption = {
  417. title: {
  418. show: true,
  419. text: '样品受理情况',
  420. textStyle: {
  421. color: '#fff',
  422. fontSize: 20,
  423. fontWeight: '600'
  424. },
  425. textAlign: 'center',
  426. left: '50%',
  427. top: '20px'
  428. },
  429. xAxis: {
  430. type: 'category',
  431. data: ['已委托未收样', '已收样', '已收不合格', '留样'],
  432. axisTick: {
  433. alignWithLabel: true
  434. },
  435. axisLabel: {
  436. style: {
  437. fill: '#fff'
  438. },
  439. formatter: function (params) {
  440. let result = ''
  441. //一行显示几个字
  442. let rowMax = 3
  443. let rowNumber = Math.ceil(params.length / rowMax)
  444. if (params.length > rowMax) {
  445. for (let p = 0; p < rowNumber; p++) {
  446. let tempStr = ''
  447. let start = p * rowMax
  448. let end = start + rowMax
  449. if (p == rowNumber - 1) {
  450. tempStr = params.substring(start, params.length);
  451. } else {
  452. tempStr = params.substring(start, end) + '\n'
  453. }
  454. result += tempStr
  455. }
  456. } else {
  457. result = params
  458. }
  459. return result
  460. }
  461. },
  462. axisLine: {
  463. lineStyle: {
  464. color: '#fff'
  465. }
  466. }
  467. },
  468. yAxis: {
  469. type: 'value',
  470. name: '',
  471. nameTextStyle: {
  472. color: '#fff',
  473. fontSize: 14
  474. },
  475. splitLine: {
  476. show: false
  477. },
  478. axisLine: {
  479. lineStyle: {
  480. color: '#fff'
  481. }
  482. }
  483. },
  484. series: [{
  485. type: 'bar',
  486. name: '',
  487. data: [],
  488. barMaxWidth: '35px',
  489. itemStyle: {
  490. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  491. { offset: 0, color: "#83bff6" },
  492. { offset: 0.5, color: "#188df0" },
  493. { offset: 1, color: "#188df0" },
  494. ])
  495. },
  496. emphasis: {
  497. itemStyle: {
  498. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  499. { offset: 0, color: "#2378f7" },
  500. { offset: 0.7, color: "#2378f7" },
  501. { offset: 1, color: "#83bff6" },
  502. ])
  503. }
  504. }
  505. }],
  506. tooltip: {
  507. show: true,
  508. trigger: 'axis'
  509. }
  510. }
  511. export const monthOption = {
  512. legend: {
  513. data: [
  514. {
  515. name: '任务总数',
  516. itemStyle: {
  517. color: '#00baff'
  518. }
  519. },
  520. {
  521. name: '已完成',
  522. itemStyle: {
  523. color: '#f5d94e'
  524. }
  525. }
  526. ],
  527. textStyle: {
  528. color: '#fff',
  529. },
  530. bottom: 10
  531. },
  532. title: {
  533. show: true,
  534. text: '检测任务月度完成量',
  535. textStyle: {
  536. color: '#fff',
  537. fontSize: 20,
  538. fontWeight: '600'
  539. },
  540. textAlign: 'center',
  541. left: '50%',
  542. top: '20px'
  543. },
  544. xAxis: {
  545. type: 'category',
  546. data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
  547. axisTick: {
  548. alignWithLabel: true
  549. },
  550. axisLabel: {
  551. style: {
  552. fill: '#fff'
  553. }
  554. },
  555. axisLine: {
  556. lineStyle: {
  557. color: '#fff'
  558. }
  559. }
  560. },
  561. yAxis: {
  562. type: 'value',
  563. name: '',
  564. nameTextStyle: {
  565. color: '#fff',
  566. fontSize: 14
  567. },
  568. splitLine: {
  569. show: false
  570. },
  571. axisLabel: {
  572. style: {
  573. fill: '#fff'
  574. }
  575. },
  576. axisLine: {
  577. lineStyle: {
  578. color: '#fff'
  579. }
  580. }
  581. },
  582. series: [
  583. {
  584. type: 'bar',
  585. name: '任务总数',
  586. data: [],
  587. barMaxWidth: '35px',
  588. barStyle: {
  589. fill: 'rgba(0, 186, 255, 0.4)'
  590. },
  591. itemStyle: {
  592. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  593. { offset: 0, color: "#83bff6" },
  594. { offset: 0.5, color: "#188df0" },
  595. { offset: 1, color: "#188df0" },
  596. ])
  597. },
  598. emphasis: {
  599. itemStyle: {
  600. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  601. { offset: 0, color: "#2378f7" },
  602. { offset: 0.7, color: "#2378f7" },
  603. { offset: 1, color: "#83bff6" },
  604. ])
  605. }
  606. }
  607. },
  608. {
  609. type: 'line',
  610. name: '已完成',
  611. data: [],
  612. symbol: 'circle',
  613. symbolSize: 10,
  614. lineArea: {
  615. show: true,
  616. gradient: ['rgba(245, 217, 79, 0.8)', 'rgba(245, 217, 79, 0.2)']
  617. },
  618. itemStyle: {
  619. color: '#f5d94e'
  620. }
  621. }
  622. ],
  623. tooltip: {
  624. show: true,
  625. trigger: 'axis'
  626. }
  627. }
  628. export const yearOption = {
  629. title: {
  630. show: true,
  631. text: '检测任务年度完成量',
  632. textStyle: {
  633. color: '#fff',
  634. fontSize: 20,
  635. fontWeight: '600'
  636. },
  637. textAlign: 'center',
  638. left: '50%',
  639. top: '20px'
  640. },
  641. legend: {
  642. orient: 'horizontal',
  643. show: true,
  644. left: 'center',
  645. bottom: 10,
  646. z: 3,
  647. itemWidth: 25,
  648. itemHeight: 14,
  649. itemGap: 10,
  650. data: [
  651. {
  652. name: '未完成',
  653. textStyle: {
  654. color: '#ff6347'
  655. }
  656. },
  657. {
  658. name: '已完成',
  659. textStyle: {
  660. color: '#3f3'
  661. }
  662. }
  663. ]
  664. },
  665. series: [
  666. {
  667. name: '任务完成情况',
  668. type: 'pie',
  669. radius: '55%',
  670. center: ['50%', '50%'],
  671. data: [],
  672. itemStyle: {
  673. emphasis: {
  674. shadowBlur: 10,
  675. shadowOffsetX: 0,
  676. shadowColor: 'rgba(0, 0, 0, 0.5)'
  677. },
  678. normal: {
  679. label: {
  680. show: true,
  681. position: 'outer',
  682. formatter: `占比:{d}%\n\n\r{b}:{c}`,
  683. // formatter: `{b}:{c}\n\n\r占比:{d}%`,
  684. fontSize: 12
  685. },
  686. labelLine: {
  687. show: true
  688. }
  689. }
  690. }
  691. }
  692. ],
  693. color: ['#ff6347', '#3f3'],
  694. tooltip: {
  695. show: true,
  696. trigger: 'item',
  697. formatter: '任务情况<br/>{b}:{c}<br/>占比:{d}%'
  698. }
  699. }