| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362 |
- <!-- -->
- <template>
- <div class="static_info report">
- <div ref="orgchart"></div>
- <div class="chart-template other">
- <!-- <div class="line"></div> -->
- <p>
- <span> 其它(本月) </span>
- </p>
- <div ref="otherchart"></div>
- </div>
- </div>
- </template>
- <script>
- import "./../../board.scss";
- import {
- orgInfo,
- currentMonthVisitInfo,
- orgSecurityInfo,
- } from "@/api/board/cockpit.js";
- import * as echarts from "echarts";
- export default {
- props: {
- orgId: {
- type: String,
- isRequired: true,
- },
- },
- data() {
- return {
- data: {
- org: [],
- visit: [],
- orgSecurity: [],
- },
- };
- },
- components: {},
- computed: {},
- watch: {
- orgId: {
- deep: true,
- handler(val) {
- this.getOrgData();
- this.getOtherData();
- },
- },
- },
- created() {
- // this.types = types;
- // this.maxDisplay = 16;
- // this.refreshTime = 1 * 10 * 1000;
- // this.isMouseOver = false;
- },
- async mounted() {
- window.addEventListener("resize", this.windowResize);
- },
- beforeDestroy() {
- // this.timer && clearInterval(this.timer);
- // this.timer = null;
- window.removeEventListener("resize", this.windowResize);
- },
- methods: {
- // handleClick() {
- // this.getData();
- // },
- handleMouseEnter() {
- this.isMouseOver = true;
- },
- handleMouseLeave() {
- this.isMouseOver = false;
- },
- async getOrgData() {
- let r = (await orgInfo(this.orgId)).data;
- this.org = r;
- this.initOrgMap();
- },
- async getOtherData() {
- this.visit = (await currentMonthVisitInfo(this.orgId)).data;
- this.orgSecurity = (await orgSecurityInfo(this.orgId)).data;
- this.initOtherMap();
- },
- initOtherMap() {
- this.otherChart && this.otherChart.dispose();
- let c = this.$refs["otherchart"];
- // 基于准备好的dom,初始化echarts实例
- this.otherChart = echarts.init(
- c
- // document.getElementById("commAlarmEvent_Chart")
- );
- let t = this;
- // 指定图表的配置项和数据
- var option = {
- // color: ["#82D5AE"],
- tooltip: {
- trigger: "axis",
- confine: true,
- axisPointer: {
- type: "shadow",
- },
- // formatter: "完成率:{c}%",
- },
- legend: {
- show: false,
- textStyle: {
- color: "rgb(245, 245, 245)",
- },
- },
- color: ["#5470c6", "#91cc75", "#fac858"],
- series: [
- {
- name: "来访",
- type: "pie",
- center: ["28%", "50%"],
- startAngle: 120,
- label: {
- // show:false,
- color: "#fff",
-
- formatter: (p) => {
- return `${p.name}\r\n(${p.value},${p.percent}%)`;
- },
- },
- labelLine:{
- // smooth:true
- length:5,
- length2:5,
- },
- data: [
- {
- name: "纸质",
- value: this.visit.paperCount,
- },
- {
- name: "紧急来访",
- value: this.visit.urgencyCount,
- },
- {
- name: "电子",
- value: this.visit.electronicCount,
- },
- ],
- },
- {
- name: "安保",
- type: "pie",
- center: ["72%", "50%"],
- label: {
- // show:false,
- color: "#fff",
- formatter: (p) => {
- return `${p.name}\r\n(${p.value},${p.percent}%)`;
- },
- },
- labelLine:{
- // smooth:true
- length:5,
- length2:5,
- },
- data: [
- {
- name: "未配置保安",
- value: this.orgSecurity.unequippedCount,
- },
- {
- name: "配置保安",
- value: this.orgSecurity.equippedCount,
- },
- ],
- },
- ],
- };
- if (option && typeof option === "object") {
- this.otherChart.setOption(option);
- }
- },
- initOrgMap() {
- this.orgChart && this.orgChart.dispose();
- let c = this.$refs["orgchart"];
- // 基于准备好的dom,初始化echarts实例
- this.orgChart = echarts.init(
- c
- // document.getElementById("commAlarmEvent_Chart")
- );
- let t = this;
- // 指定图表的配置项和数据
- var option = {
- // color: ["#82D5AE"],
- tooltip: {
- trigger: "axis",
- confine: true,
- axisPointer: {
- type: "shadow",
- },
- // formatter: "完成率:{c}%",
- },
- legend: {
- show: false,
- textStyle: {
- color: "rgb(245, 245, 245)",
- },
- },
- // grid: {
- // left: "3%",
- // right: "4%",
- // bottom: "2%",
- // top: "20px",
- // containLabel: true,
- // },
- color: ["#5470c6"],
- series: [
- {
- name: "行社",
- type: "pie",
- radius: ["38%", "45%"],
- center: ["25%", "25%"],
- label: {
- // show:false,
- position: "center",
- color: "#fff",
- formatter: (p) => {
- return `${p.value}\r\n\r\n${p.name}`;
- },
- },
- data: [
- {
- name: "行社",
- value: this.org.hangsheCount,
- },
- ],
- },
- {
- name: "营业网点",
- type: "pie",
- radius: ["38%", "45%"],
- center: ["75%", "25%"],
- label: {
- // show:false,
- position: "center",
- color: "#fff",
- formatter: (p) => {
- return `${p.value}\r\n\r\n${p.name}`;
- },
- },
- data: [
- {
- name: "营业网点",
- value: this.org.bankingCount,
- },
- ],
- },
- {
- name: "网点业务库",
- type: "pie",
- radius: ["38%", "45%"],
- center: ["25%", "75%"],
- label: {
- // show:false,
- position: "center",
- color: "#fff",
- formatter: (p) => {
- return `${p.value}\r\n\r\n${p.name}`;
- },
- },
- data: [
- {
- name: "网点业务库",
- value: this.org.bankingStoreCount,
- },
- ],
- },
- {
- name: "离行式自助银行",
- type: "pie",
- radius: ["38%", "45%"],
- center: ["75%", "75%"],
- label: {
- // show:false,
- position: "center",
- color: "#fff",
- formatter: (p) => {
- return `${p.value}\r\n\r\n离行式\r\n自助银行`;
- },
- },
- data: [
- {
- name: "离行式自助银行",
- value: this.org.offlineCount,
- },
- ],
- },
- ],
- };
- if (option && typeof option === "object") {
- this.orgChart.setOption(option);
- }
- },
- windowResize() {
- this.orgChart && this.orgChart.resize();
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .report {
- background-image: linear-gradient(
- to right,
- rgba(27, 33, 57, 0.8) 0%,
- rgba(32, 49, 99, 0.6) 50%,
- rgba(27, 33, 57, 0.8) 100%
- );
- margin-top: 15px;
- width: calc(100% - 0px);
- margin-left: 1px;
- border-top: 3px solid;
- border-image: linear-gradient(
- to right,
- rgba(27, 33, 57, 0.8) 20%,
- rgba(101, 219, 229, 1) 50%,
- rgba(27, 33, 57, 0.8) 80%
- )
- 3;
- }
- .static_info {
- height: calc(100%);
- width: 100%;
- display: flex;
- flex-direction: row;
- margin: 5px;
- & > div {
- height:calc(100% - 10px);
- }
- & > div:first-child {
- width: 35%;
- }
- & > div:nth-child(2) {
- width: 65% !important;
- }
- }
- .other {
- background-image: url(@/assets/board/bg.png);
- background-position: 100%;
- background-color: rgba(8, 8, 8);
- }
- </style>
|