report.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. <!-- -->
  2. <template>
  3. <div class="static_info report">
  4. <div ref="orgchart"></div>
  5. <div class="chart-template other">
  6. <!-- <div class="line"></div> -->
  7. <p>
  8. <span> 其它(本月) </span>
  9. </p>
  10. <div ref="otherchart"></div>
  11. </div>
  12. </div>
  13. </template>
  14. <script>
  15. import "./../../board.scss";
  16. import {
  17. orgInfo,
  18. currentMonthVisitInfo,
  19. orgSecurityInfo,
  20. } from "@/api/board/cockpit.js";
  21. import * as echarts from "echarts";
  22. export default {
  23. props: {
  24. orgId: {
  25. type: String,
  26. isRequired: true,
  27. },
  28. },
  29. data() {
  30. return {
  31. data: {
  32. org: [],
  33. visit: [],
  34. orgSecurity: [],
  35. },
  36. };
  37. },
  38. components: {},
  39. computed: {},
  40. watch: {
  41. orgId: {
  42. deep: true,
  43. handler(val) {
  44. this.getOrgData();
  45. this.getOtherData();
  46. },
  47. },
  48. },
  49. created() {
  50. // this.types = types;
  51. // this.maxDisplay = 16;
  52. // this.refreshTime = 1 * 10 * 1000;
  53. // this.isMouseOver = false;
  54. },
  55. async mounted() {
  56. window.addEventListener("resize", this.windowResize);
  57. },
  58. beforeDestroy() {
  59. // this.timer && clearInterval(this.timer);
  60. // this.timer = null;
  61. window.removeEventListener("resize", this.windowResize);
  62. },
  63. methods: {
  64. // handleClick() {
  65. // this.getData();
  66. // },
  67. handleMouseEnter() {
  68. this.isMouseOver = true;
  69. },
  70. handleMouseLeave() {
  71. this.isMouseOver = false;
  72. },
  73. async getOrgData() {
  74. let r = (await orgInfo(this.orgId)).data;
  75. this.org = r;
  76. this.initOrgMap();
  77. },
  78. async getOtherData() {
  79. this.visit = (await currentMonthVisitInfo(this.orgId)).data;
  80. this.orgSecurity = (await orgSecurityInfo(this.orgId)).data;
  81. this.initOtherMap();
  82. },
  83. initOtherMap() {
  84. this.otherChart && this.otherChart.dispose();
  85. let c = this.$refs["otherchart"];
  86. // 基于准备好的dom,初始化echarts实例
  87. this.otherChart = echarts.init(
  88. c
  89. // document.getElementById("commAlarmEvent_Chart")
  90. );
  91. let t = this;
  92. // 指定图表的配置项和数据
  93. var option = {
  94. // color: ["#82D5AE"],
  95. tooltip: {
  96. trigger: "axis",
  97. confine: true,
  98. axisPointer: {
  99. type: "shadow",
  100. },
  101. // formatter: "完成率:{c}%",
  102. },
  103. legend: {
  104. show: false,
  105. textStyle: {
  106. color: "rgb(245, 245, 245)",
  107. },
  108. },
  109. color: ["#5470c6", "#91cc75", "#fac858"],
  110. series: [
  111. {
  112. name: "来访",
  113. type: "pie",
  114. center: ["28%", "50%"],
  115. startAngle: 120,
  116. label: {
  117. // show:false,
  118. color: "#fff",
  119. formatter: (p) => {
  120. return `${p.name}\r\n(${p.value},${p.percent}%)`;
  121. },
  122. },
  123. labelLine:{
  124. // smooth:true
  125. length:5,
  126. length2:5,
  127. },
  128. data: [
  129. {
  130. name: "纸质",
  131. value: this.visit.paperCount,
  132. },
  133. {
  134. name: "紧急来访",
  135. value: this.visit.urgencyCount,
  136. },
  137. {
  138. name: "电子",
  139. value: this.visit.electronicCount,
  140. },
  141. ],
  142. },
  143. {
  144. name: "安保",
  145. type: "pie",
  146. center: ["72%", "50%"],
  147. label: {
  148. // show:false,
  149. color: "#fff",
  150. formatter: (p) => {
  151. return `${p.name}\r\n(${p.value},${p.percent}%)`;
  152. },
  153. },
  154. labelLine:{
  155. // smooth:true
  156. length:5,
  157. length2:5,
  158. },
  159. data: [
  160. {
  161. name: "未配置保安",
  162. value: this.orgSecurity.unequippedCount,
  163. },
  164. {
  165. name: "配置保安",
  166. value: this.orgSecurity.equippedCount,
  167. },
  168. ],
  169. },
  170. ],
  171. };
  172. if (option && typeof option === "object") {
  173. this.otherChart.setOption(option);
  174. }
  175. },
  176. initOrgMap() {
  177. this.orgChart && this.orgChart.dispose();
  178. let c = this.$refs["orgchart"];
  179. // 基于准备好的dom,初始化echarts实例
  180. this.orgChart = echarts.init(
  181. c
  182. // document.getElementById("commAlarmEvent_Chart")
  183. );
  184. let t = this;
  185. // 指定图表的配置项和数据
  186. var option = {
  187. // color: ["#82D5AE"],
  188. tooltip: {
  189. trigger: "axis",
  190. confine: true,
  191. axisPointer: {
  192. type: "shadow",
  193. },
  194. // formatter: "完成率:{c}%",
  195. },
  196. legend: {
  197. show: false,
  198. textStyle: {
  199. color: "rgb(245, 245, 245)",
  200. },
  201. },
  202. // grid: {
  203. // left: "3%",
  204. // right: "4%",
  205. // bottom: "2%",
  206. // top: "20px",
  207. // containLabel: true,
  208. // },
  209. color: ["#5470c6"],
  210. series: [
  211. {
  212. name: "行社",
  213. type: "pie",
  214. radius: ["38%", "45%"],
  215. center: ["25%", "25%"],
  216. label: {
  217. // show:false,
  218. position: "center",
  219. color: "#fff",
  220. formatter: (p) => {
  221. return `${p.value}\r\n\r\n${p.name}`;
  222. },
  223. },
  224. data: [
  225. {
  226. name: "行社",
  227. value: this.org.hangsheCount,
  228. },
  229. ],
  230. },
  231. {
  232. name: "营业网点",
  233. type: "pie",
  234. radius: ["38%", "45%"],
  235. center: ["75%", "25%"],
  236. label: {
  237. // show:false,
  238. position: "center",
  239. color: "#fff",
  240. formatter: (p) => {
  241. return `${p.value}\r\n\r\n${p.name}`;
  242. },
  243. },
  244. data: [
  245. {
  246. name: "营业网点",
  247. value: this.org.bankingCount,
  248. },
  249. ],
  250. },
  251. {
  252. name: "网点业务库",
  253. type: "pie",
  254. radius: ["38%", "45%"],
  255. center: ["25%", "75%"],
  256. label: {
  257. // show:false,
  258. position: "center",
  259. color: "#fff",
  260. formatter: (p) => {
  261. return `${p.value}\r\n\r\n${p.name}`;
  262. },
  263. },
  264. data: [
  265. {
  266. name: "网点业务库",
  267. value: this.org.bankingStoreCount,
  268. },
  269. ],
  270. },
  271. {
  272. name: "离行式自助银行",
  273. type: "pie",
  274. radius: ["38%", "45%"],
  275. center: ["75%", "75%"],
  276. label: {
  277. // show:false,
  278. position: "center",
  279. color: "#fff",
  280. formatter: (p) => {
  281. return `${p.value}\r\n\r\n离行式\r\n自助银行`;
  282. },
  283. },
  284. data: [
  285. {
  286. name: "离行式自助银行",
  287. value: this.org.offlineCount,
  288. },
  289. ],
  290. },
  291. ],
  292. };
  293. if (option && typeof option === "object") {
  294. this.orgChart.setOption(option);
  295. }
  296. },
  297. windowResize() {
  298. this.orgChart && this.orgChart.resize();
  299. },
  300. },
  301. };
  302. </script>
  303. <style lang="scss" scoped>
  304. .report {
  305. background-image: linear-gradient(
  306. to right,
  307. rgba(27, 33, 57, 0.8) 0%,
  308. rgba(32, 49, 99, 0.6) 50%,
  309. rgba(27, 33, 57, 0.8) 100%
  310. );
  311. margin-top: 15px;
  312. width: calc(100% - 0px);
  313. margin-left: 1px;
  314. border-top: 3px solid;
  315. border-image: linear-gradient(
  316. to right,
  317. rgba(27, 33, 57, 0.8) 20%,
  318. rgba(101, 219, 229, 1) 50%,
  319. rgba(27, 33, 57, 0.8) 80%
  320. )
  321. 3;
  322. }
  323. .static_info {
  324. height: calc(100%);
  325. width: 100%;
  326. display: flex;
  327. flex-direction: row;
  328. margin: 5px;
  329. & > div {
  330. height:calc(100% - 10px);
  331. }
  332. & > div:first-child {
  333. width: 35%;
  334. }
  335. & > div:nth-child(2) {
  336. width: 65% !important;
  337. }
  338. }
  339. .other {
  340. background-image: url(@/assets/board/bg.png);
  341. background-position: 100%;
  342. background-color: rgba(8, 8, 8);
  343. }
  344. </style>