折线图修改

This commit is contained in:
xixi 2024-04-22 11:16:09 +08:00
parent 2cbc151da5
commit b3ed8112bb
5 changed files with 216 additions and 202 deletions

View File

@ -8,7 +8,7 @@
<script> <script>
export default { export default {
name: 'App', name: 'App'
// created() { // created() {
// (function () { // (function () {
// function setRootFontSize() { // function setRootFontSize() {
@ -40,7 +40,6 @@ export default {
} }
/* body{ /* body{
width: 1920px; width: 1920px;
height: 928px; height: 928px;
@ -54,5 +53,4 @@ export default {
} }
</style> </style>

View File

@ -22,7 +22,9 @@ export function getGqyajzb() {
} }
export function getRysshyqk () { export function getRysshyqk () {
return request({ return request({
url: `${baseUrl}/servicecity/app/data-external-release/get-user-dynamic-position`, // url: `${baseUrl}/servicecity/app/data-external-release/get-user-dynamic-position`,
// url: `${baseUrl}/servicecity/app/data-external-release/get-case-handle-year`,
url: `http://192.168.0.4:7022/servicecity/app/data-external-release/get-case-handle-year`,
method: 'GET' method: 'GET'
}) })
} }

View File

@ -12,8 +12,11 @@ export default {
return { return {
data: [], data: [],
times: [], times: [],
number: [], // number: [],
rysshyqkUrl:'http://219.147.99.164:8082/servicecity/route/bigdata/list-hour-user-rysshyqk.html', //
bossCount: [],
zgyCount: [],
rysshyqkUrl: 'http://219.147.99.164:8082/servicecity/route/bigdata/list-hour-user-rysshyqk.html'
} }
}, },
computed: { computed: {
@ -25,7 +28,6 @@ export default {
// this.gr() // this.gr()
// }, 300); // }, 300);
}, },
mounted () { mounted () {
}, },
@ -33,108 +35,120 @@ export default {
}, },
methods: { methods: {
fn (url) { fn (url) {
// eslint-disable-next-line no-undef
layer.open({ layer.open({
type: 2, type: 2,
content: url, content: url,
area: ['80%', '80%'], area: ['80%', '80%'],
title:'' , title: ''
}); })
}, },
gr () { gr () {
let myChart = this.$echarts.init(this.$refs.line); let myChart = this.$echarts.init(this.$refs.line)
// //
var tootipTimer = null; var tootipTimer = null
let option = { let option = {
grid: { grid: {
left: "3%", left: '3%',
right: "7%", right: '7%',
bottom: "5%", bottom: '5%',
top: "10%", top: '10%',
containLabel: true, containLabel: true
}, },
xAxis: { xAxis: {
type: "category", type: 'category',
data: this.times, data: this.times,
axisTick: { axisTick: {
alignWithLabel: true, alignWithLabel: true,
lineStyle: { lineStyle: {
color: "#fff", color: '#fff'
}, // x } // x
}, },
axisLabel: { axisLabel: {
textStyle: { textStyle: {
color: "#fff", color: '#fff'
}, }
}, }
}, },
yAxis: { yAxis: {
type: "value", type: 'value',
axisLabel: { axisLabel: {
textStyle: { textStyle: {
color: "#fff", color: '#fff'
}, }
}, },
splitLine: { splitLine: {
show: true, show: true,
lineStyle: { lineStyle: {
color: "#fff", color: '#fff'
}, }
}, }
}, },
tooltip: { tooltip: {
show: true, show: true,
borderWidth: 0, borderWidth: 0,
trigger: "axis", trigger: 'axis',
axisPointer: { axisPointer: {
type: "line", type: 'line'
}, }
// formatter: function (param) { // formatter: function (param) {
// return + param.name ; // return + param.name ;
// } // }
}, },
series: [ series: [
{ {
data: this.number, data: this.bossCount,
type: "line", type: 'line'
smooth: true, //
areaStyle: { // smooth: true,
color: "#e1e3eb", // 线
// areaStyle: {
// color: '#e1e3eb'
// }
}, },
}, {
], data: this.zgyCount,
}; type: 'line'
myChart.setOption(option); // smooth: true,
// areaStyle: {
// color: '#e1e3eb'
// }
}
]
}
myChart.setOption(option)
let sizeFun = function () { let sizeFun = function () {
myChart.resize(); myChart.resize()
}; }
window.addEventListener("resize", sizeFun); window.addEventListener('resize', sizeFun)
tootipTimer && tootipTimer.clearLoop(); tootipTimer && tootipTimer.clearLoop()
tootipTimer = null; tootipTimer = null
// //
tootipTimer = window.loopShowTooltip(myChart, option, { tootipTimer = window.loopShowTooltip(myChart, option, {
interval: 2000, // interval: 2000, //
loopSeries: true, // loopSeries: true //
}); })
}, },
async getRysshyqk () { async getRysshyqk () {
try { try {
const res = await getRysshyqk() const res = await getRysshyqk()
this.data = res.data.list this.data = res.data.countClass
// console.log(this.data); console.log(res)
this.data.forEach(item => { this.data.forEach(item => {
this.times.push(item.time) this.times.push(item.dateTime)
this.number.push(item.value) this.bossCount.push(item.bossCount)
this.zgyCount.push(item.zgyCount)
}) })
this.$nextTick(() => { this.$nextTick(() => {
this.gr(); this.gr()
}) })
} catch (error) { } catch (error) {
console.log('数据获取失败'); console.log('数据获取失败')
}
} }
} }
},
}; }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@ -32,18 +32,19 @@
<script> <script>
import calendar from "@/components/ddzhxt/calendar.vue"; import calendar from '@/components/ddzhxt/calendar.vue'
import ajqk from "@/components/ddzhxt/ajqk.vue"; import ajqk from '@/components/ddzhxt/ajqk.vue'
import gqyajzb from "@/components/ddzhxt/gqyajzb.vue"; import gqyajzb from '@/components/ddzhxt/gqyajzb.vue'
import ajlx from "@/components/ddzhxt/ajlx.vue"; import ajlx from '@/components/ddzhxt/ajlx.vue'
import ajjz from "@/components/ddzhxt/ajjz.vue"; import ajjz from '@/components/ddzhxt/ajjz.vue'
import ajclmyd from "@/components/ddzhxt/ajclmyd.vue"; import ajclmyd from '@/components/ddzhxt/ajclmyd.vue'
import gyfajqktj from "@/components/ddzhxt/gyfajqktj.vue"; import gyfajqktj from '@/components/ddzhxt/gyfajqktj.vue'
import ditu from "@/components/ddzhxt/ditu.vue"; import ditu from '@/components/ddzhxt/ditu.vue'
import rysshyqk from "@/components/ddzhxt/rysshyqk.vue"; import rysshyqk from '@/components/ddzhxt/rysshyqk.vue'
import titles from "@/components/ddzhxt/titles.vue"; import titles from '@/components/ddzhxt/titles.vue'
import ajdt from "@/components/ddzhxt/ajdt.vue"; import ajdt from '@/components/ddzhxt/ajdt.vue'
import { getBumen, getJiezhen, getErjiye } from "@/api/ddzhxt.js" // eslint-disable-next-line no-unused-vars
import { getBumen, getJiezhen, getErjiye } from '@/api/ddzhxt.js'
export default { export default {
components: { components: {
@ -57,7 +58,7 @@ export default {
ditu, ditu,
rysshyqk, rysshyqk,
titles, titles,
ajdt, ajdt
}, },
data () { data () {
return { return {
@ -69,7 +70,7 @@ export default {
ajlxUrl: 'http://219.147.99.164:8082/servicecity/route/bigdata/list-case-info-ajlxtop10.html', ajlxUrl: 'http://219.147.99.164:8082/servicecity/route/bigdata/list-case-info-ajlxtop10.html',
ajjzUrl: 'http://219.147.99.164:8082/servicecity/route/bigdata/list-case-info-7dayajjz.html', ajjzUrl: 'http://219.147.99.164:8082/servicecity/route/bigdata/list-case-info-7dayajjz.html',
ajclmydUrl: 'http://219.147.99.164:8082/servicecity/route/bigdata/list-grade-ratio-ajmyd.html', ajclmydUrl: 'http://219.147.99.164:8082/servicecity/route/bigdata/list-grade-ratio-ajmyd.html',
gyfajqktjUrl:'http://219.147.99.164:8082/servicecity/route/bigdata/list-report-case-gyfajqk.html', gyfajqktjUrl: 'http://219.147.99.164:8082/servicecity/route/bigdata/list-report-case-gyfajqk.html'
// windowContent: '' // windowContent: ''
} }
}, },
@ -91,9 +92,8 @@ export default {
// console.log(data); // console.log(data);
this.data = data this.data = data
} catch (error) { } catch (error) {
console.log('数据获取失败'); console.log('数据获取失败')
} }
}, },
async getJiezhen () { async getJiezhen () {
try { try {
@ -101,44 +101,44 @@ export default {
// console.log(data); // console.log(data);
this.data2 = data this.data2 = data
} catch (error) { } catch (error) {
console.log('数据获取失败'); console.log('数据获取失败')
} }
}, },
fn (url) { fn (url) {
// const res = await getErjiye() // const res = await getErjiye()
// console.log(res.data); // console.log(res.data);
// console.log(123); // console.log(123);
// this.windowContent = res.data; // this.windowContent = res.data;
// eslint-disable-next-line no-undef
layer.open({ layer.open({
type: 2, type: 2,
// content: '<div style="color:#00ffff; font-size:50px;"></div>',//contentURLiframecontent: ['http://sentsin.com', 'no'] // content: '<div style="color:#00ffff; font-size:50px;"></div>',//contentURLiframecontent: ['http://sentsin.com', 'no']
// content: 'static/html/list-case-info-ajlx.html', // content: 'static/html/list-case-info-ajlx.html',
content: url, // `<iframe src="data:text/html;charset=utf-8,${}"></iframe>`, //'http://127.0.0.1/servicecity/route/bigdata/list-case-info-ajlx.html', content: url, // `<iframe src="data:text/html;charset=utf-8,${}"></iframe>`, //'http://127.0.0.1/servicecity/route/bigdata/list-case-info-ajlx.html',
area: ['85%', '80%'], area: ['85%', '80%'],
title:'' , title: ''
// skin: 'demo-class' // skin: 'demo-class'
}); })
// window.open('http://219.147.99.164:8082/servicecity/route/bigdata/list-case-info-ajlx.html') // window.open('http://219.147.99.164:8082/servicecity/route/bigdata/list-case-info-ajlx.html')
// this.$alert(res, { // this.$alert(res, {
// dangerouslyUseHTMLString: true // dangerouslyUseHTMLString: true
// }); // });
}, },
fn2 (imgSrc) { fn2 (imgSrc) {
// eslint-disable-next-line no-undef
layer.open({ layer.open({
type: 1, type: 1,
content: `<div style="padding:15px"><img src="${imgSrc}" style="width:100%"/></div>`, content: `<div style="padding:15px"><img src="${imgSrc}" style="width:100%"/></div>`,
area: ['85%', '80%'], area: ['85%', '80%'],
title:'' , title: ''
// skin: 'demo-class' // skin: 'demo-class'
}); })
} }
} }
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.ddzhxt { .ddzhxt {

View File

@ -7,7 +7,7 @@ import jcxxxt from '@/pages/jcxxxt/jcxxxts.vue'
import detailDitu from '@/components/ddzhxt/detail-ditu.vue' import detailDitu from '@/components/ddzhxt/detail-ditu.vue'
Router.prototype.openUrl = function (url, type) { Router.prototype.openUrl = function (url, type) {
window.open(url, !type ? '_self': type); window.open(url, !type ? '_self' : type)
} }
Vue.use(Router) Vue.use(Router)
@ -16,7 +16,7 @@ export default new Router({
routes: [{ routes: [{
path: '/', path: '/',
name: 'ddzhxt', name: 'ddzhxt',
component: ddzhxt, component: ddzhxt
// meta:{ // meta:{
// title:'ddzhxt' // title:'ddzhxt'
// } // }
@ -24,7 +24,7 @@ export default new Router({
{ {
path: '/zhdjxt', path: '/zhdjxt',
name: 'zhdjxt', name: 'zhdjxt',
component: zhdjxt, component: zhdjxt
// meta:{ // meta:{
// title:'zhdjxt' // title:'zhdjxt'
// } // }
@ -32,7 +32,7 @@ export default new Router({
{ {
path: '/jcxxxt', path: '/jcxxxt',
name: 'jcxxxt', name: 'jcxxxt',
component: jcxxxt, component: jcxxxt
// meta:{ // meta:{
// title:'jcxxxt' // title:'jcxxxt'
// } // }
@ -40,10 +40,10 @@ export default new Router({
{ {
path: '/detailDitu', path: '/detailDitu',
name: 'detailDitu', name: 'detailDitu',
component: detailDitu, component: detailDitu
// meta:{ // meta:{
// title:'jcxxxt' // title:'jcxxxt'
// } // }
}, }
] ]
}) })