| | |
| | | // å½å®¶ç»´åº¦-æ°éç»è®¡ |
| | | export function countCountryDimension(params) { |
| | | return request.get("/oneMap/countCountryDimension", { params: params }) |
| | | } |
| | | } |
| | | |
| | | //æå¡è®¿é®æ¬¡æ° |
| | | export function GetServicesVisitsCount(){ |
| | | return request.get("/oneMap/countDataServiceType") |
| | | } |
| | | |
| | | //æç
§ç±»å«è®¿é®ç»è®¡è®¿é®æ¬¡æ° |
| | | export function GetTypeVisitsCount(){ |
| | | return request.get("/oneMap/countLargeCategories") |
| | | } |
| | |
| | | return { |
| | | YXState: true, |
| | | yxImg: require("../../assets/img/Screen/yximg.png"), |
| | | currMenu: "项ç®å±ç¤º", |
| | | currMenu: "ä¸é¢å±ç¤º", |
| | | currProject: "", |
| | | searchName: "", |
| | | menuList: [ |
| | | { |
| | | menuName: "项ç®å±ç¤º", |
| | | menuName: "ä¸é¢å±ç¤º", |
| | | children: [ |
| | | // { |
| | | // name: "å
¨å½ç®¡ç½å¾", |
| | | // id: "qggwt", |
| | | // }, |
| | | // { |
| | | // name: "å
¨ç管ç½å¾", |
| | | // id: "qqgwt", |
| | | // }, |
| | | { |
| | | name: "å
¨å½ç®¡ç½å¾", |
| | | id: "qggwt", |
| | | }, |
| | | { |
| | | name: "å
¨ç管ç½å¾", |
| | | id: "qqgwt", |
| | | }, |
| | | { |
| | | name: "å
¨å½é¡¹ç®", |
| | | id: "qgxm", |
| | |
| | | ], |
| | | }, |
| | | { |
| | | menuName: "å·¥ç¨å±ç¤º", |
| | | menuName: "项ç®å±ç¤º", |
| | | children: [ |
| | | { |
| | | name: "ä¸ä¿ä¸çº¿ç®¡éå·¥ç¨", |
| | |
| | | case "å·¥ç¨å·¡è§": |
| | | this.showPathLine(child) |
| | | break |
| | | case "å·¥ç¨å±ç¤º": |
| | | case "项ç®å±ç¤º": |
| | | this.DisplayCurrentProject(child) |
| | | break |
| | | case "项ç®å±ç¤º": |
| | | case "ä¸é¢å±ç¤º": |
| | | this.changeProject(child) |
| | | break |
| | | default: |
| | | break |
| | | } |
| | | }, |
| | | |
| | | //å·¥ç¨å·¡è§ |
| | | async showPathLine(params) { |
| | | const line = wktToGeoJSON(params.wkt) |
| | | const position = line.coordinates[0] |
| | |
| | | async getCountProjectDisplay() { |
| | | const res = await countProjectLocation() |
| | | if (res.code === 200) { |
| | | const menu = this.menuList.find(item => item.menuName == "å·¥ç¨å±ç¤º") |
| | | const menu = this.menuList.find(item => item.menuName == "项ç®å±ç¤º") |
| | | menu.children = res.result.map(item => { |
| | | return { |
| | | name: item.projname, |
| | |
| | | |
| | | } |
| | | }, |
| | | //ä¸é¢å±ç¤º |
| | | changeProject(params) { |
| | | this.$bus.$emit('changeProject', params.name) |
| | | } |
| | |
| | | <img :src="leftImg" @click="ChangeLeft" /> |
| | | </div> |
| | | <div class="leftContainer" v-if="ChartDisplay"> |
| | | <div class="current1" style="height: 27%;" id="leftCurrent1"> |
| | | <div class="current1" id="leftCurrent1"> |
| | | <div class="aside-title">æ°æ®ç³è¯·æ¬¡æ°</div> |
| | | <count-data-apply ></count-data-apply> |
| | | </div> |
| | | <div class="current1" style="height: 27%;" id="leftCurrent2"> |
| | | <div class="aside-title">æå¡ç±»å«</div> |
| | | |
| | | <div class="current1" id="leftCurrent2"> |
| | | <div class="aside-title">ç¨æ·è®¿é®é</div> |
| | | <service-type></service-type> |
| | | </div> |
| | | <div class="current1" style="height: 36%;" id="leftCurrent3"> |
| | | <div class="aside-title">åå¨ä¿¡æ¯</div> |
| | | <div class="current1" id="leftCurrent3"> |
| | | <div class="aside-title">项ç®åå¨ä¿¡æ¯</div> |
| | | <data-storage></data-storage> |
| | | </div> |
| | | </div> |
| | | <div class="leftContainer" v-if="ProjectreeDisplay"> |
| | | <project-tree></project-tree> |
| | | <!-- å
¨çç»è®¡æ¬¡æ° --> |
| | | <div class="leftContainer" v-if="GlobleChartDisplay"> |
| | | <div class="current1" id="leftCurrent1"> |
| | | <div class="aside-title">æ°æ®ç³è¯·æ¬¡æ°</div> |
| | | <count-data-apply ></count-data-apply> |
| | | </div> |
| | | <div class="current1" id="leftCurrent2"> |
| | | <div class="aside-title">ç¨æ·è®¿é®é</div> |
| | | <service-type></service-type> |
| | | </div> |
| | | <div class="current1" id="leftCurrent3"> |
| | | <div class="aside-title">项ç®åå¨ä¿¡æ¯</div> |
| | | <data-storage></data-storage> |
| | | </div> |
| | | </div> |
| | | <!-- å
¨å½é¡¹ç®ç»è®¡æ¬¡æ° --> |
| | | <div class="leftContainer" v-if="CountryChartDisplay"> |
| | | <div class="current1" id="leftCurrent1"> |
| | | <div class="aside-title">æ°æ®ç³è¯·æ¬¡æ°</div> |
| | | <count-data-apply ></count-data-apply> |
| | | </div> |
| | | <div class="current1" id="leftCurrent2"> |
| | | <div class="aside-title">ç¨æ·è®¿é®é</div> |
| | | <service-type></service-type> |
| | | </div> |
| | | <div class="current1" id="leftCurrent3"> |
| | | <div class="aside-title">项ç®åå¨ä¿¡æ¯</div> |
| | | <data-storage></data-storage> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="leftContainer" v-if="ProjectreeDisplay"> |
| | | <project-tree></project-tree> |
| | | </div> --> |
| | | </div> |
| | | </template> |
| | | <script> |
| | |
| | | leftMessage: "init", |
| | | ChartDisplay: true, |
| | | ProjectreeDisplay: false, |
| | | GlobleChartDisplay:false, |
| | | CountryChartDisplay:false, |
| | | leftImg: require("../../assets/img/Screen/rightArrow.png"), |
| | | } |
| | | }, |
| | |
| | | this.leftMessage = "init" |
| | | // this.OpenLeftInitChart(); |
| | | this.$parent.ChangeWidth("leftView") |
| | | |
| | | this.$bus.$on("changeProject", name => { |
| | | |
| | | }) |
| | | |
| | | }, |
| | | //æå¼å·¥ç¨æ |
| | | OpenLeftProjectTree() { |
| | |
| | | .leftContainer { |
| | | height: 100%; |
| | | width: calc(100% - 7px); |
| | | |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: space-around; |
| | | |
| | | .current1 { |
| | | height: 30%; |
| | | height: 32%; |
| | | width: 100%; |
| | | background: url(../../assets/img/Screen/chartbg.png); |
| | | background-size: 100% 100%; |
| | |
| | | background: url(../../assets/img/Screen/contentBg.png); |
| | | background-size: 100% 100%; |
| | | background-repeat: no-repeat; |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | <div class="current"> |
| | | <div class="rightContainer" v-if="ChartDisplay"> |
| | | <div class="current1"> |
| | | <div class="aside-title">å·¥ç¨ç§ç±»</div> |
| | | <div class="aside-title">项ç®ç»è®¡</div> |
| | | <project-category></project-category> |
| | | </div> |
| | | <div class="" style="width: 100%;height: 60%"> |
| | | <div class="aside-title">æä»¶æ ¼å¼</div> |
| | | <div class="content" style="height: calc(100% - 30px)"> |
| | | <div class="current1"> |
| | | <div class="aside-title">æ°æ®ç»è®¡</div> |
| | | <!-- <div class="content" style="height:30px"> |
| | | <div class="header"> |
| | | <div>æ ¼å¼</div> |
| | | <div>æ°é</div> |
| | | </div> |
| | | <file-format></file-format> |
| | | </div> |
| | | </div> --> |
| | | <file-format></file-format> |
| | | </div> |
| | | <div class="current1"> |
| | | <div class="aside-title">æå¡è®¿é®æ¬¡æ°</div> |
| | | |
| | | <Service-Get></Service-Get> |
| | | </div> |
| | | </div> |
| | | <div |
| | | |
| | | <!-- <div |
| | | class="rightContainer2" |
| | | v-if="CourtyDisplay && currentProject =='å
¨ç项ç®'" |
| | | > |
| | |
| | | <country-dimension-pie ref="pieRef"></country-dimension-pie> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="rightContainer2" v-if="CourtyDisplay && currentProject =='å
¨å½é¡¹ç®'"> |
| | | <div class="current1"> |
| | | <div class="aside-title">é¡¹ç®æ°éæ±ç¶å¾</div> |
| | |
| | | <div class="aside-title">é¡¹ç®æ°é饼ç¶å¾</div> |
| | | <province-dimension-pie ref="pieRef"></province-dimension-pie> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | <div class="rightarrow"> |
| | | <img :src="RightImg" @click="ChangeRight" /> |
| | | </div> |
| | |
| | | import CountryDimensionPie from "../chart/CountryDimensionPie.vue" |
| | | import ProvinceDimensionBar from "../chart/CountryProvinceBar.vue" |
| | | import ProvinceDimensionPie from "../chart/CountryProvincePie.vue" |
| | | import ServiceGet from "../chart/ServiceGet.vue" |
| | | import { countCountryDimension, countProvinceDimension } from "@/api/screen.js" |
| | | |
| | | export default { |
| | |
| | | CountryDimensionBar, |
| | | CountryDimensionPie, |
| | | ProvinceDimensionBar, |
| | | ProvinceDimensionPie |
| | | ProvinceDimensionPie, |
| | | ServiceGet, |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | this.ChartDisplay = !this.ChartDisplay |
| | | } |
| | | |
| | | if (this.leftMessage == "projectree") { |
| | | if (this.CourtyDisplay) { |
| | | this.RightImg = require("../../assets/img/Screen/leftArrow.png") |
| | | } else { |
| | | this.RightImg = require("../../assets/img/Screen/rightArrow.png") |
| | | } |
| | | this.CourtyDisplay = !this.CourtyDisplay |
| | | } |
| | | // if (this.leftMessage == "projectree") { |
| | | // if (this.CourtyDisplay) { |
| | | // this.RightImg = require("../../assets/img/Screen/leftArrow.png") |
| | | // } else { |
| | | // this.RightImg = require("../../assets/img/Screen/rightArrow.png") |
| | | // } |
| | | // this.CourtyDisplay = !this.CourtyDisplay |
| | | // } |
| | | |
| | | // this.ChartDisplay = !this.ChartDisplay |
| | | this.$parent.ChangeWidth("right") |
| | |
| | | }, |
| | | |
| | | //æå¼å·¥ç¨æ |
| | | OpenLeftProjectTree() { |
| | | this.ChartDisplay = false |
| | | this.CourtyDisplay = true |
| | | this.leftMessage = "projectree" |
| | | this.$parent.ChangeWidth("leftTree") |
| | | }, |
| | | // OpenLeftProjectTree() { |
| | | // this.ChartDisplay = false |
| | | // this.CourtyDisplay = true |
| | | // this.leftMessage = "projectree" |
| | | // this.$parent.ChangeWidth("leftTree") |
| | | // }, |
| | | }, |
| | | } |
| | | </script> |
| | | <style lang="less"> |
| | | <style lang="less" sc> |
| | | .current { |
| | | height: 100%; |
| | | width: 100%; |
| | |
| | | .rightContainer { |
| | | height: 100%; |
| | | width: calc(100% - 45px); |
| | | |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | |
| | | background-repeat: no-repeat; |
| | | } |
| | | } |
| | | .rightContainer2 { |
| | | height: 100%; |
| | | width: calc(100% - 45px); |
| | | // .rightContainer2 { |
| | | // height: 100%; |
| | | // width: calc(100% - 45px); |
| | | |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | .current1 { |
| | | margin-top: 10px; |
| | | margin-bottom: 30px; |
| | | height: 32%; |
| | | width: 100%; |
| | | background: url(../../assets/img/Screen/chartbg.png); |
| | | background-size: 100% 100%; |
| | | background-repeat: no-repeat; |
| | | // display: flex; |
| | | // flex-direction: column; |
| | | // align-items: center; |
| | | // .current1 { |
| | | // margin-top: 10px; |
| | | // margin-bottom: 30px; |
| | | // height: 30%; |
| | | // width: 100%; |
| | | // background: url(../../assets/img/Screen/chartbg.png); |
| | | // background-size: 100% 100%; |
| | | // background-repeat: no-repeat; |
| | | // } |
| | | // } |
| | | .content { |
| | | width: 100%; |
| | | background: url(../../assets/img/Screen/contentBg.png); |
| | | background-size: 100% 100%; |
| | | background-repeat: no-repeat; |
| | | .header { |
| | | margin: 0px auto; |
| | | padding: 10px 0; |
| | | width: 80%; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | color: #fff; |
| | | font-size: 13px; |
| | | } |
| | | } |
| | | } |
| | | .content { |
| | | width: 100%; |
| | | background: url(../../assets/img/Screen/contentBg.png); |
| | | background-size: 100% 100%; |
| | | background-repeat: no-repeat; |
| | | .header { |
| | | margin: 0px auto; |
| | | padding: 10px 0; |
| | | width: 80%; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | color: #fff; |
| | | font-size: 13px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="top"> |
| | | <div class="topleft"> |
| | | <div |
| | | <!-- <div |
| | | class="topleft1" |
| | | :class="currView == 'chart' ? 'active' : ''" |
| | | @click="OpenInitChart" |
| | |
| | | > |
| | | <img src="../../assets/img/Screen/ptree.png" /> |
| | | <span>å·¥ç¨é¡¹ç®</span> |
| | | </div> |
| | | </div> --> |
| | | </div> |
| | | <div class="topCenter"> |
| | | <div>管ç½ä¸å¼ å¾</div> |
| | |
| | | mounted() { |
| | | this.$bus.$on('changeProject', name => { |
| | | if (name == 'å
¨å½é¡¹ç®' || name == 'å
¨ç项ç®') { |
| | | this.OpenProjectree() |
| | | // this.OpenProjectree() |
| | | } |
| | | }) |
| | | }, |
| | |
| | | this.currView = "tree" |
| | | this.$parent.$refs.mapleft.OpenLeftProjectTree() |
| | | this.$parent.$refs.mapright.OpenLeftProjectTree() |
| | | |
| | | }, |
| | | }, |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="barchar" ref="chart"></div> |
| | | </template> |
| | | |
| | | <script> |
| | | import * as echarts from "echarts" |
| | | import { countCountryDimension } from "@/api/screen.js" |
| | | export default { |
| | | props: { |
| | | width: { |
| | | type: String, |
| | | default: '100%' |
| | | }, |
| | | height: { |
| | | type: String, |
| | | default: '100%' |
| | | }, |
| | | autoResize: { |
| | | type: Boolean, |
| | | default: true |
| | | }, |
| | | // option: { |
| | | // type: Object, |
| | | // required: true |
| | | // }, |
| | | type: { |
| | | type: String, |
| | | default: 'canvas' |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | chart: null, |
| | | dataList: [] |
| | | } |
| | | }, |
| | | computed: { |
| | | option() { |
| | | let data = [ |
| | | { |
| | | country: "è丹", |
| | | count: 1, |
| | | }, |
| | | { |
| | | country: "å°åº¦å°¼è¥¿äº", |
| | | count: 1, |
| | | }, |
| | | { |
| | | country: "é¿èé
", |
| | | count: 1, |
| | | }, |
| | | { |
| | | country: "ä¹å
¹å«å
æ¯å¦", |
| | | count: 1, |
| | | }, |
| | | { |
| | | country: "åè¨å
æ¯å¦", |
| | | count: 2, |
| | | }, |
| | | { |
| | | country: "å§å
çæ", |
| | | count: 1, |
| | | }, |
| | | { |
| | | country: "æ¯éå
°å¡", |
| | | count: 1, |
| | | }, |
| | | { |
| | | country: "ä¸å½", |
| | | count: 17, |
| | | }, |
| | | { |
| | | country: "å
¶ä»", |
| | | count: 1, |
| | | }, |
| | | { |
| | | country: "ååºæ¼æ¯å¦", |
| | | count: 1, |
| | | }, |
| | | { |
| | | country: "æ°å å¡", |
| | | count: 1, |
| | | }, |
| | | ] |
| | | |
| | | let xAxisData = [] |
| | | let yAxisData = [] |
| | | if (this.dataList) { |
| | | data = this.dataList |
| | | } |
| | | data.forEach(item => { |
| | | xAxisData.push(item.country) |
| | | yAxisData.push(item.count) |
| | | }) |
| | | let option = { |
| | | backgroundColor: "transparent", |
| | | tooltip: { |
| | | trigger: "axis", |
| | | axisPointer: { |
| | | type: "shadow", |
| | | }, |
| | | }, |
| | | grid: { |
| | | top: "12%", |
| | | right: "0%", |
| | | left: "0%", |
| | | bottom: "13%", |
| | | containLabel: true, |
| | | }, |
| | | xAxis: [ |
| | | { |
| | | type: "category", |
| | | data: xAxisData, |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: "rgba(255,255,255,0.12)", |
| | | }, |
| | | }, |
| | | interval: 0, |
| | | axisLabel: { |
| | | margin: 10, |
| | | color: "#e2e9ff", |
| | | textStyle: { |
| | | fontSize: 11, |
| | | }, |
| | | formatter: function (value) { |
| | | // |
| | | var ret = "" //æ¼æ¥å \nè¿åçç±»ç®é¡¹ |
| | | var maxLength = 2 //æ¯é¡¹æ¾ç¤ºæåä¸ªæ° |
| | | var valLength = value.length //Xè½´ç±»ç®é¡¹çæåä¸ªæ° |
| | | var rowN = Math.ceil(valLength / maxLength) //ç±»ç®é¡¹éè¦æ¢è¡çè¡æ° |
| | | if (rowN > 1) { |
| | | //å¦æç±»ç®é¡¹çæå大äº3, |
| | | for (var i = 0; i < rowN; i++) { |
| | | var temp = "" //æ¯æ¬¡æªåçå符串 |
| | | var start = i * maxLength //å¼å§æªåçä½ç½® |
| | | var end = start + maxLength //ç»ææªåçä½ç½® |
| | | //è¿éä¹å¯ä»¥å ä¸ä¸ªæ¯å¦æ¯æåä¸è¡ç夿ï¼ä½æ¯ä¸å 乿²¡æå½±åï¼é£å°±ä¸å å§ |
| | | temp = value.substring(start, end) + "\n" |
| | | ret += temp //ååæç»çå符串 |
| | | } |
| | | return ret |
| | | } else { |
| | | return value |
| | | } |
| | | }, |
| | | }, |
| | | }, |
| | | ], |
| | | yAxis: [ |
| | | { |
| | | axisLabel: { |
| | | formatter: "{value}", |
| | | color: "#e2e9ff", |
| | | }, |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | lineStyle: { |
| | | color: "rgba(255,255,255,0.12)", |
| | | }, |
| | | }, |
| | | }, |
| | | ], |
| | | series: [ |
| | | { |
| | | type: "bar", |
| | | data: yAxisData, |
| | | barWidth: "12px", |
| | | itemStyle: { |
| | | normal: { |
| | | color: new echarts.graphic.LinearGradient( |
| | | 0, |
| | | 0, |
| | | 0, |
| | | 1, |
| | | [ |
| | | { |
| | | offset: 0, |
| | | color: "rgba(0,244,255,1)", // 0% å¤çé¢è² |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: "rgba(0,77,167,1)", // 100% å¤çé¢è² |
| | | }, |
| | | ], |
| | | false |
| | | ), |
| | | barBorderRadius: [20, 20, 0, 0], |
| | | shadowColor: "rgba(0,160,221,1)", |
| | | shadowBlur: 4, |
| | | }, |
| | | }, |
| | | label: { |
| | | normal: { |
| | | show: true, |
| | | lineHeight: 14, |
| | | width: 40, |
| | | height: 14, |
| | | backgroundColor: "rgba(0,160,221,0.1)", |
| | | borderRadius: 200, |
| | | position: ["-8", "-20"], |
| | | distance: 1, |
| | | formatter: value => { |
| | | // console.log(value); |
| | | if (value.name == "ä¸å½") { |
| | | return [ |
| | | ` {d|â}", " {a|${value.value}} \n", " {b|}`, |
| | | ].join(",") |
| | | } |
| | | }, |
| | | // formatter: [" {d|â}", " {a|{c}} \n", " {b|}"].join( |
| | | // "," |
| | | // ), |
| | | rich: { |
| | | d: { |
| | | color: "#3CDDCF", |
| | | }, |
| | | a: { |
| | | color: "#fff", |
| | | align: "center", |
| | | }, |
| | | b: { |
| | | width: 1, |
| | | height: 15, |
| | | borderWidth: 1, |
| | | borderColor: "#234e6c", |
| | | align: "left", |
| | | }, |
| | | }, |
| | | }, |
| | | }, |
| | | }, |
| | | ], |
| | | } |
| | | return option |
| | | } |
| | | }, |
| | | watch: { |
| | | // option: { |
| | | // deep: true, |
| | | // handler(newVal) { |
| | | // this.setOptions(newVal) |
| | | // } |
| | | // }, |
| | | currentProject: { |
| | | deep: true, |
| | | handler(newVal) { |
| | | this.initData() |
| | | this.setOptions(this.option) |
| | | } |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.initChart() |
| | | if (this.autoResize) { |
| | | window.addEventListener('resize', this.resizeHandler) |
| | | } |
| | | }, |
| | | beforeDestroy() { |
| | | if (!this.chart) { |
| | | return |
| | | } |
| | | if (this.autoResize) { |
| | | window.removeEventListener('resize', this.resizeHandler) |
| | | } |
| | | this.chart.dispose() |
| | | this.chart = null |
| | | }, |
| | | methods: { |
| | | resizeHandler() { |
| | | this.chart.resize() |
| | | }, |
| | | initChart() { |
| | | this.chart = echarts.init(this.$refs.chart, '', { |
| | | renderer: this.type |
| | | }) |
| | | this.chart.setOption(this.option) |
| | | this.chart.on('click', this.handleClick) |
| | | }, |
| | | handleClick(params) { |
| | | this.$emit('click', params) |
| | | }, |
| | | setOptions(option) { |
| | | this.clearChart() |
| | | this.resizeHandler() |
| | | if (this.chart) { |
| | | this.chart.setOption(option) |
| | | } |
| | | }, |
| | | refresh() { |
| | | this.setOptions(this.option) |
| | | }, |
| | | clearChart() { |
| | | this.chart && this.chart.clear() |
| | | } |
| | | }, |
| | | methods: { |
| | | async initData() { |
| | | |
| | | |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .barchar { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | </style> |
| | |
| | | <script> |
| | | const fileTypeBar = require("@/assets/img/Screen/fileTypeBar.png") |
| | | import * as echarts from "echarts" |
| | | import { countFileFormat } from "@/api/screen.js" |
| | | import { GetTypeVisitsCount } from "@/api/screen.js" |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | this.initChart() |
| | | }, |
| | | methods: { |
| | | |
| | | |
| | | |
| | | async initChart() { |
| | | |
| | | |
| | | let data = [ |
| | | { |
| | | name: "user1", |
| | |
| | | value: 20, |
| | | }, |
| | | ] |
| | | const res = await countFileFormat() |
| | | const res = await GetTypeVisitsCount() |
| | | let xAxis = [] |
| | | let yAxis = [] |
| | | if (res.code == 200) { |
| | | data = res.result.map(item => { |
| | | return { |
| | | name: item.type, |
| | | value: item.number, |
| | | } |
| | | xAxis.push(item.name); |
| | | yAxis.push(item.count); |
| | | }) |
| | | } |
| | | data.sort((a, b) => b.value - a.value) |
| | | data = data.slice(0, 10) |
| | | // console.log(res.result); |
| | | let getArrByKey = (data, k) => { |
| | | let key = k || "value" |
| | | let res = [] |
| | | if (data) { |
| | | data.forEach(function (t) { |
| | | res.push(t[key]) |
| | | }) |
| | | } |
| | | return res |
| | | } |
| | | let getSymbolData = data => { |
| | | let arr = [] |
| | | for (var i = 0; i < data.length; i++) { |
| | | arr.push({ |
| | | value: data[i].value, |
| | | symbolPosition: "end", |
| | | }) |
| | | } |
| | | return arr |
| | | } |
| | | let opt = { |
| | | index: 0, |
| | | } |
| | | let color = ["#A71A2B"] |
| | | data = data.sort((a, b) => { |
| | | return b.value - a.value |
| | | }) |
| | | let option = { |
| | | backgroundColor: "transparent", |
| | | grid: { |
| | | top: "2%", |
| | | bottom: "2%", |
| | | right: "5%", |
| | | left: "10%", |
| | | containLabel: true, |
| | | grid: { |
| | | // 让å¾è¡¨å æ»¡å®¹å¨ |
| | | top: "12%", |
| | | left: "15%", |
| | | right: "10%", |
| | | bottom: "15%", |
| | | }, |
| | | |
| | | xAxis: { |
| | | data: xAxis, |
| | | axisLabel: { |
| | | show: true, |
| | | color: "#ffff", |
| | | }, |
| | | xAxis: { |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | yAxis: [ |
| | | { |
| | | triggerEvent: true, |
| | | show: true, |
| | | inverse: true, |
| | | data: getArrByKey(data, "name"), |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | show: false, |
| | | interval: 0, |
| | | color: "#fff", |
| | | align: "left", |
| | | margin: 0, |
| | | fontSize: 13, |
| | | formatter: function (value, index) { |
| | | return "{title|" + value + "}" |
| | | }, |
| | | rich: { |
| | | title: { |
| | | width: 165, |
| | | }, |
| | | }, |
| | | }, |
| | | axisLine: { |
| | | show: true, |
| | | lineStyle: { |
| | | color: "rgba(95, 180, 237, 0.32)", |
| | | }, |
| | | { |
| | | triggerEvent: true, |
| | | show: true, |
| | | inverse: true, |
| | | data: getArrByKey(data, "name"), |
| | | axisLine: { |
| | | show: false, |
| | | }, |
| | | splitLine: { |
| | | show: false, |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | interval: 0, |
| | | shadowOffsetX: "-20px", |
| | | color: "#fff", |
| | | align: "right", |
| | | verticalAlign: "bottom", |
| | | lineHeight: 20, |
| | | fontSize: 13, |
| | | formatter: function (value, index) { |
| | | return data[index].value |
| | | }, |
| | | }, |
| | | }, |
| | | }, |
| | | yAxis: { |
| | | axisLine: { |
| | | show: false, |
| | | |
| | | }, |
| | | axisTick: { |
| | | show: false, |
| | | }, |
| | | axisLabel: { |
| | | color: "#ffff", |
| | | }, |
| | | // åå²çº¿ |
| | | splitLine: { |
| | | lineStyle: { |
| | | color: "#5d7289", |
| | | width: 1, |
| | | type: "dashed" |
| | | } |
| | | }, |
| | | ], |
| | | series: [ |
| | | { |
| | | name: "XXX", |
| | | type: "pictorialBar", |
| | | }, |
| | | series: [ |
| | | { |
| | | // é¡¶é¨åç |
| | | type: "pictorialBar", |
| | | animation: false, |
| | | itemStyle: { |
| | | color: "rgba(115, 240, 252, 1)", |
| | | }, |
| | | symbolRepeat: false, |
| | | symbolSize: [15, 8], |
| | | symbolMargin: 1, |
| | | z: 10, |
| | | data: data, |
| | | symbolPosition: "end", |
| | | symbolOffset: [0, -4], |
| | | }, |
| | | { |
| | | // åºé¨åç |
| | | type: "pictorialBar", |
| | | animation: false, |
| | | |
| | | symbol: |
| | | "image://data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDYuMC1jMDAyIDc5LjE2NDQ4OCwgMjAyMC8wNy8xMC0yMjowNjo1MyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIyLjAgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaW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(data), |
| | | itemStyle: { |
| | | color: "rgba(50, 96, 225, 0.8)", |
| | | }, |
| | | { |
| | | name: "æ¡", |
| | | type: "bar", |
| | | showBackground: true, |
| | | barBorderRadius: 10, |
| | | yAxisIndex: 0, |
| | | data: data, |
| | | barWidth: 8, |
| | | // align: left, |
| | | itemStyle: { |
| | | normal: { |
| | | color: new echarts.graphic.LinearGradient( |
| | | 0, |
| | | 0, |
| | | 1, |
| | | 0, |
| | | [ |
| | | { |
| | | offset: 0, |
| | | color: "#5A9DFF", |
| | | }, |
| | | { |
| | | offset: 0.7, |
| | | color: "#1878FF", |
| | | }, |
| | | { |
| | | offset: 1, |
| | | color: "#164182", |
| | | }, |
| | | ], |
| | | false |
| | | ), |
| | | barBorderRadius: 5, |
| | | }, |
| | | // color: '#A71A2B', |
| | | barBorderRadius: 2, |
| | | }, |
| | | label: { |
| | | normal: { |
| | | color: "#fff", |
| | | show: true, |
| | | position: ["0px", "-25px"], |
| | | textStyle: { |
| | | fontSize: 14, |
| | | }, |
| | | formatter: function (a, b) { |
| | | return a.name |
| | | }, |
| | | }, |
| | | symbolRepeat: false, |
| | | symbolSize: [15, 8], |
| | | symbolMargin: 1, |
| | | z: 10, |
| | | data: data, |
| | | symbolPosition: "start", |
| | | symbolOffset: [0, 3], |
| | | }, |
| | | { |
| | | barWidth: 15, |
| | | animation: false, |
| | | |
| | | type: "bar", |
| | | label: { |
| | | show: true, |
| | | position: "top", |
| | | textStyle: { |
| | | color: "#ffff", |
| | | }, |
| | | }, |
| | | ], |
| | | } |
| | | itemStyle: { |
| | | color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [ |
| | | { offset: 1, color: "rgba(82, 180, 249, 0.35)" }, |
| | | { offset: 0, color: "rgba(82, 180, 249, 1)" }, |
| | | ]), |
| | | }, |
| | | data: yAxis, |
| | | }, |
| | | ], |
| | | }; |
| | | |
| | | const chart = echarts.init(this.$refs.chart) |
| | | |
| | |
| | | <style lang="less" scoped> |
| | | .file-format { |
| | | width: 100%; |
| | | height: 100%; |
| | | height:calc(100% - 30px); |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div class="project-category"> |
| | | <div class="content"> |
| | | |
| | | <div |
| | | :class="i % 2 ? 'rank2' : 'rank1'" |
| | | v-for="(item, i) in datalist.slice(0, 8)" |
| | | :key="item.projtype" |
| | | > |
| | | <div class="num">{{ item.count }}个</div> |
| | | <div class="name">{{ item.projtype }}</div> |
| | | <div class="bar"> |
| | | <img src="~@/assets/img/Screen/leftBar.png" alt="" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div |
| | | :class="'rank' + i" |
| | | class="rank" |
| | | v-for="(item, i) in datalist.slice(0, 8)" |
| | | :key="item.projtype" |
| | | > |
| | | <div class="num">{{ item.count }}个</div> |
| | | <div class="name">{{ item.projtype }}</div> |
| | | <div class="bar"></div> |
| | | </div> |
| | | |
| | | <!-- <div class="rank rank2"> |
| | | <div class="num">2个</div> |
| | |
| | | .project-category { |
| | | position: relative; |
| | | width: 100%; |
| | | height: 100%; |
| | | height: calc(100% - 30px); |
| | | background: url("~@/assets/img/Screen/projectBg.png") center center; |
| | | background-size: 330px 227px; |
| | | .content { |
| | | position: relative; |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | margin: 0 auto; |
| | | height: 90%; |
| | | justify-content: space-between; |
| | | .rank1, .rank2 { |
| | | // box-sizing: border-box; |
| | | // display: flex; |
| | | // flex-direction: column; |
| | | // width: 160px; |
| | | // flex: 1; |
| | | height: 25px; |
| | | // align-items: end; |
| | | background-size: 100% 100%; |
| | | |
| | | .content { |
| | | display: flex; |
| | | flex-direction: row; |
| | | flex-wrap: wrap; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | width: 100%; |
| | | // height: 85%; |
| | | height: 100%; |
| | | |
| | | .rank { |
| | | width: 35%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | div { |
| | | margin: 2px 0px; |
| | | } |
| | | .num { |
| | | color: #839ecb; |
| | | } |
| | | .name { |
| | | // margin: 6px; |
| | | color: #fff; |
| | | } |
| | | |
| | | .bar { |
| | | width: 61px; |
| | | height: 3px; |
| | | // background: url("~@/assets/img/Screen/leftBar.png"); |
| | | // background-size: 100% 100%; |
| | | img { |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | background-image: url(../../assets/img/Screen/leftBar.png); |
| | | background-size: 100% 100%; |
| | | } |
| | | } |
| | | .rank1 { |
| | | |
| | | .rank0, |
| | | .rank6 { |
| | | width: 35%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: flex-end; |
| | | text-align: right; |
| | | } |
| | | .rank2 { |
| | | |
| | | .rank1, |
| | | .rank7 { |
| | | width: 35%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: flex-start; |
| | | text-align: left; |
| | | } |
| | | |
| | | .rank2, |
| | | .rank4 { |
| | | width: 35%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-items: flex-end; |
| | | |
| | | div { |
| | | width: 80%; |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | align-items: flex-end; |
| | | } |
| | | .bar { |
| | | margin-left: calc(80% - 61px); |
| | | } |
| | | } |
| | | |
| | | .rank3, |
| | | .rank5 { |
| | | width: 35%; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-items: flex-end; |
| | | |
| | | div { |
| | | margin-left: 20%; |
| | | width: 80%; |
| | | align-items: flex-end; |
| | | text-align: left; |
| | | |
| | | .bar { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-items: flex-end; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="CountDataApply" ref="chart"></div> |
| | | </template> |
| | | |
| | | <script> |
| | | import * as echarts from "echarts" |
| | | import { GetServicesVisitsCount } from "@/api/screen.js" |
| | | export default { |
| | | data() { |
| | | return { |
| | | option: {}, |
| | | } |
| | | }, |
| | | mounted() { |
| | | // const option = this.initData() |
| | | this.initChart() |
| | | }, |
| | | methods: { |
| | | async initChart() { |
| | | const res = await GetServicesVisitsCount() |
| | | |
| | | console.log(res.result); |
| | | |
| | | if (res.code == 200) { |
| | | } |
| | | let xAxis = [] |
| | | let yAxis = [] |
| | | |
| | | res.result.forEach(item => { |
| | | xAxis.push(item.type) |
| | | yAxis.push(item.count) |
| | | }) |
| | | |
| | | // let data = [220, 182, 191, 234, 290, 330, 310] |
| | | // const sideData = data.map(item => { |
| | | // return { |
| | | // name: item.name, |
| | | // value: item.number, |
| | | // } |
| | | // }) |
| | | |
| | | let option = { |
| | | tooltip: { |
| | | trigger: "axis" |
| | | }, |
| | | grid: { |
| | | right: "10%", |
| | | top: 30, |
| | | left: '15%', |
| | | bottom:'15%' |
| | | }, |
| | | |
| | | xAxis: { |
| | | type: "category", |
| | | boundaryGap: true, |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: "#fff" |
| | | } |
| | | }, |
| | | nameRotate: 45, |
| | | axisTick: { |
| | | alignWithLabel: true |
| | | }, |
| | | axisLabel: { |
| | | fontFamily: "PingFangSC-Regular", |
| | | }, |
| | | data:xAxis |
| | | }, |
| | | yAxis: { |
| | | axisLine: { |
| | | show: false, |
| | | lineStyle: { |
| | | color: "#fff" |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | fontFamily: "Roboto-Regular", |
| | | }, |
| | | axisTick: { |
| | | show: false |
| | | }, |
| | | // åå²çº¿ |
| | | splitLine: { |
| | | lineStyle: { |
| | | color: "#5d7289", |
| | | width: 1, |
| | | type: "dashed" |
| | | } |
| | | }, |
| | | type: "value" |
| | | }, |
| | | series: [ |
| | | { |
| | | name: "æå¡è®¿é®æ¬¡æ°", |
| | | type: "line", |
| | | showAllSymbol: false, |
| | | lineStyle: { |
| | | color: "#2579D8" |
| | | }, |
| | | itemStyle: { |
| | | color: "#2579D8" |
| | | }, |
| | | smooth: 0.2, |
| | | data: yAxis |
| | | } |
| | | |
| | | ] |
| | | }; |
| | | const chart = echarts.init(this.$refs.chart) |
| | | |
| | | chart.setOption(option) |
| | | window.addEventListener("resize", function () { |
| | | chart.resize() |
| | | }) |
| | | }, |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .CountDataApply { |
| | | width: 100%; |
| | | height:calc(100% - 30px); |
| | | } |
| | | </style> |
| | |
| | | } |
| | | } |
| | | |
| | | if (parm == "leftView" || parm == "leftTree") { |
| | | this.leftWidth = "20%" |
| | | this.rightWidth = "22%" |
| | | } |
| | | if (parm == "leftView") { |
| | | this.leftTree = false |
| | | } |
| | | if (parm == "leftTree") { |
| | | this.leftTree = true |
| | | } |
| | | // if (parm == "leftView" || parm == "leftTree") { |
| | | // this.leftWidth = "20%" |
| | | // this.rightWidth = "22%" |
| | | // } |
| | | // if (parm == "leftView") { |
| | | // this.leftTree = false |
| | | // } |
| | | // if (parm == "leftTree") { |
| | | // this.leftTree = true |
| | | // } |
| | | |
| | | if (parm == "right") { |
| | | if (this.rightWidth == "22%") { |