| | |
| | | countCountryDimension, |
| | | countProvinceDimension, |
| | | GetServicesVisitsCount, |
| | | countZhPipeMapLength, |
| | | countLargeCategories, |
| | | countProjectType, |
| | | countProjectDown |
| | | } from "@/api/screen.js" |
| | | export default { |
| | | props: { |
| | |
| | | project: { |
| | | type: String, |
| | | default: "全国项目", |
| | | }, |
| | | params: { |
| | | type: Object, |
| | | default: () => null, |
| | | }, |
| | | project: { |
| | | type: String, |
| | | default: "全国项目", |
| | | }, |
| | | title: { |
| | | type: String, |
| | | default: "", |
| | | }, |
| | | }, |
| | | data() { |
| | |
| | | }, |
| | | grid: { |
| | | right: "5%", |
| | | top: '10%', |
| | | top: "10%", |
| | | left: "5%", |
| | | bottom: "17%", |
| | | containLabel: true |
| | | containLabel: true, |
| | | }, |
| | | |
| | | xAxis: { |
| | |
| | | lineStyle: { |
| | | color: "#fff", |
| | | }, |
| | | show: false, |
| | | }, |
| | | nameRotate: 45, |
| | | axisTick: { |
| | | show: false, |
| | | alignWithLabel: true, |
| | | }, |
| | | axisLabel: { |
| | |
| | | }, |
| | | series: [ |
| | | { |
| | | name: "服务访问次数", |
| | | name: this.title, |
| | | type: "line", |
| | | showAllSymbol: false, |
| | | lineStyle: { |
| | |
| | | }, |
| | | project: { |
| | | deep: true, |
| | | immediate: true, |
| | | handler(newVal) { |
| | | let requsetFn = null |
| | | switch (newVal) { |
| | | case "全球项目": |
| | | requsetFn = countCountryDimension |
| | | requsetFn = countLargeCategories |
| | | break |
| | | case "全国项目": |
| | | requsetFn = countProvinceDimension |
| | | requsetFn = countLargeCategories |
| | | break |
| | | |
| | | case "全球管网图": |
| | | requsetFn = countZhPipeMapLength |
| | | break |
| | | case "全国管网图": |
| | | requsetFn = countZhPipeMapLength |
| | | break |
| | | default: |
| | | requsetFn = GetServicesVisitsCount |
| | | |
| | | break |
| | | } |
| | | this.initData(requsetFn) |
| | | requsetFn && this.initData(requsetFn) |
| | | |
| | | this.setOptions(this.option) |
| | | }, |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.initData() |
| | | // this.initData() |
| | | this.initChart() |
| | | if (this.autoResize) { |
| | | window.addEventListener("resize", this.resizeHandler) |
| | |
| | | }, |
| | | methods: { |
| | | resizeHandler() { |
| | | this.chart.resize() |
| | | this.chart && this.chart.resize() |
| | | }, |
| | | initChart() { |
| | | this.chart = echarts.init(this.$refs.chart, "", { |
| | |
| | | this.chart && this.chart.clear() |
| | | }, |
| | | async initData(requsetFn = GetServicesVisitsCount) { |
| | | const res = await requsetFn() |
| | | const res = await requsetFn(this.params) |
| | | if (res.code == 200) { |
| | | this.dataList = res.result |
| | | console.log("requsetFn", res) |