report.vue 8.4 KB

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