Authored by 鲁尚清

电子税务局大屏页面搭建

Showing 47 changed files with 1387 additions and 739 deletions
... ... @@ -130,18 +130,42 @@
}
.screen-right #right-top {
height: 26%;
height: 32%;
position: relative;
}
.screen-right #right-center {
height: 37%;
height: 35%;
position: relative;
}
.screen-right #right-bottom {
height: 37%;
height: 33%;
position: relative;
}
.screen-right #right-top .monitoring-bar{
height: 100%;
position: relative;
text-align: left;
}
.cpu-dropdown{
text-align: right;
}
.cpu-dropdown .el-dropdown .el-dropdown-selfdefine{
color:#ffffff;
cursor: pointer;
margin-right: 15px;
}
.el-dropdown__popper .el-dropdown-menu{
background-color: rgba(0,0,0,0.5);
border:none;
}
.el-dropdown-menu__item{
color:#ffffff;
}
.el-dropdown__popper.el-popper[role="tooltip"]{
border:none;
background-color: rgba(0,0,0,0);
}
.screen-bottom {
width: 100%;
height: 34%;
... ... @@ -167,3 +191,12 @@
width: 25%;
position: relative;
}
.icon-arrow{
background-image: url("/vue3/src/assets/images/digitalDp/icon-arrow.png");
width:12px;
height:12px;
background-size: 100%;
display: inline-block;
background-repeat: no-repeat;
background-position: center;
}
\ No newline at end of file
... ...
.declare-container,.declare-lineChart{
background: url("/vue3/src/assets/images/zjdp/img-bg.png");
background-position: center;
/* background: url("/vue3/src/assets/images/zjdp/img-bg.png");
background-position: center;*/
}
.declare-container{
... ...
... ... @@ -4,6 +4,13 @@
justify-content: center;
padding: 5px 0;
}
.declare-report .declare-report-num{
background-image: url("/vue3/src/assets/images/digitalDp/text-bg.png");
background-repeat: no-repeat;
background-position: center;
background-size: contain;
margin-top: 20px;
}
.declare-report .grid-content img{
padding-right:10%;
border-right:1px solid #ffffff;
... ...
... ... @@ -59,6 +59,12 @@ body{font-size: 15px;}
height: 550px;
}
.declare-lineChart{
height:100%;
}
.monitoring-bar{
height:50%;
}
.screen-nav{
margin-bottom: 30px;
padding-right: 20px;
... ...
... ... @@ -104,12 +104,6 @@ const routes = [{
path: '/zjdaping',
name: 'zjdaping',
component: () => myImport('views/zjdaping/index')
},
{
path:'/zjdapingchart',
name:'zjdapingchart',
component: () => myImport('views/zjdaping/components/barChart/index')
}
];
... ...
<div class="com-container">
<div class="com-chart" id="availability_ref"></div>
<div class="com-container available-chart" id="availability_ref" style="text-align: left" >
<img :style="comtitleImgStyle" src="/vue3/src/assets/images/digitalDp/title-availability.png" alt="">
<LineChart :optionData="optionData" v-if="optionData"></LineChart>
<!--<div class="com-chart" ></div>
<div class="topfive-box-title">
<img :style="comtitleImgStyle" src="./src/assets/img/box_title_bykk_zj_1.png" class="available-title-img"> <!-- bor1_6 -->
<img :style="comtitleImgStyle" src="./src/assets/img/box_title_bykk_zj_1.png" class="available-title-img"> &lt;!&ndash; bor1_6 &ndash;&gt;
<span :style="comtitleTextStyle" class="available-title-size">业务可用性</span>
</div>
</div>-->
</div>
\ No newline at end of file
... ...
export default {
name: 'Availability',
name: 'availability',
template: '',
components: {},
data () {
components: {
'LineChart': Vue.defineAsyncComponent(
() => myImport('views/zjdaping/components/lineChart/index')
)
},
data(){
return {
chartInstance: null,
allData: {
polyline: {
title: "业务可用性",
unit: "%",
data: {
name: "占比",
data: ["67","70","80","71","90","92","72","70","56","45","89","100"]
}
},
xAxis: {
time: ["01:00", "02:00", "03:00", "04:00", "05:00", "06:00", "07:00", "08:00", "09:00", "10:00", "11:00", "12:00"]
}
},
titleFontSize: 20,
startValue: 0, // 区域缩放的起点值
endValue: 6, // 区域缩放的终点值
timerId: null // 定时器的标识
domainName:sessionStorage.getItem('domainName'),
apiUrl:'/api-web/sxview/getBusinessAvailability',
resourceStatisticsData:'',
optionData:'',
ySeriesCommon:[],
titleFontSize: 30,
}
},
mounted () {
this.initChart()
this.getData()
window.addEventListener('resize', this.screenAdapter)
this.screenAdapter()
},
unmounted () {
window.removeEventListener('resize', this.screenAdapter)
clearInterval(this.timerId)
},
computed: {
comtitleTextStyle () {
return {
... ... @@ -42,159 +25,290 @@ export default {
},
comtitleImgStyle () {
return {
// height: this.titleFontSize + 'px',
width: this.titleFontSize * 8 + 'px'
height: this.titleFontSize * 2.1 + 'px'
}
}
},
methods: {
initChart () {
this.chartInstance = echarts.init(document.getElementById('availability_ref'))
const initOption = {
grid: {
top: '25%',
left: '3%',
right: '6%',
bottom: '3%',
containLabel: true
},
legend: {
right: '2%',
top: '5%'
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
// 挂载完
Vue.onMounted(() => {
proxy.screenAdapter();
proxy.getData();
})
const getData=()=> {
$.get(proxy.domainName + proxy.apiUrl, function (res) {
const data = res;
if (data && data.data) {
let resData = data.data;
}
// proxy.optionInit();
})
proxy.optionInit();
}
const optionInit=()=>{
let data3=[350, 350, 350, 350, 350, 350, 350];
let data4=[220, 182, 191, 234, 290, 330, 310];
let data2=[100, 100, 100, 100, 100, 100, 100];
let data1=[12.3, 7.56, 66.6, 5.44, 66.6, 5.44,6.52];
let min1=proxy.calMin([data1,data2]);
let max1=proxy.calMax([data1,data2]);
let min2=proxy.calMin([data3,data4]);
let max2=proxy.calMax([data3,data4]);
//业务双y轴数据
proxy.ySeriesCommon=[
{
name:'可用性',
type: 'line',
smooth:true,
// stack: 'Total',
show:false,
data:data3,
yAxisIndex:1,
showSymbol:false,
itemStyle : {
normal : {
color:"#97d5f4",//tooltip里的小圆点颜色
lineStyle:{
color:'#97d5f4',
width:1
}
}
},
areaStyle: {
// color:'rgba(151,213,244,0.4)',
normal:{
color:new echarts.graphic.LinearGradient(0, 0, 0, .6, [{ //关键在这里, 设置面积渐变
offset: 0,
color: '#97d5f4' //这里是我设置的渐变的颜色从线条颜色变为透明
}, {
offset: 1,
color: 'rgba(151,213,244,0.1)'
}])
}
},
},
xAxis: {
type: 'category',
boundaryGap: false,
axisLabel: {
textStyle: {
color: '#E6E8EB'
{
name:'成功率',
type: 'line',
smooth:true,
// stack: 'Total',
show:false,
data:data1,
yAxisIndex:0,
showSymbol:false,
itemStyle : {
normal : {
color:"#efe0a7",//tooltip里的小圆点颜色
lineStyle:{
color:'#efe0a7',
width:1
}
}
}
},
areaStyle: {
color:'rgba(239,224,167,0)'
},
},
yAxis: {
type: 'value',
splitLine: {
show: false
{
name:'响应率',
type: 'line',
smooth:true,
// stack: 'Total',
show:false,
data:data2,
yAxisIndex:0,
showSymbol:false,
itemStyle : {
normal : {
color:"#e5abd1",//tooltip里的小圆点颜色
lineStyle:{
color:'#e5abd1',
width:1
}
}
},
axisLabel: {
textStyle: {
color: '#E6E8EB'
areaStyle: {
color:'rgba(229,171,209,0)'
},
},
{
name:'交易量',
type: 'line',
smooth:true,
// stack: 'Total',
show:false,
data:data4,
yAxisIndex:1,
showSymbol:false,
itemStyle : {
normal : {
color:"#97aaff",//tooltip里的小圆点颜色
lineStyle:{
color:'#97aaff',
width:1,
}
}
}
},
areaStyle: {
color:'rgba(151,170,255,0)'
},
}
}
this.chartInstance.setOption(initOption)
},
getData () {
// await this.$http.get()
// const { data: ret } = await this.$http.get('responsemonitor')
// this.allData = ret
// console.log(ret)
this.updateChart()
this.startInterval()
},
updateChart () {
// 半透明的颜色值
const colorArr1 = [
'rgba(11, 168, 44, 0.5)',
'rgba(44, 110, 255, 0.5)',
'rgba(22, 242, 217, 0.5)',
'rgba(254, 33, 30, 0.5)',
'rgba(250, 105, 0, 0.5)'
]
// 全透明的颜色值
const colorArr2 = [
'rgba(11, 168, 44, 0)',
'rgba(44, 110, 255, 0)',
'rgba(22, 242, 217, 0)',
'rgba(254, 33, 30, 0)',
'rgba(250, 105, 0, 0)'
]
const timeArr = this.allData.xAxis.today
const seriesData = this.allData.polyline.data.data
const seriesName = this.allData.polyline.data.name
// 图例的数据
const legendArr = this.allData.polyline.data.data.map(item => {
return item.name
// let xAxisDataLength=proxy.ySeriesCommon[0].length;
let xAxisData=[];
for(let i=0;i<=24;i++){
if(i%4==0){
xAxisData.push(i+':00')
}
}
let legendData=[];
$.each(proxy.ySeriesCommon,function (i,v){
legendData.push(v.name)
})
console.log(legendArr)
const title = this.allData.polyline.title
const unit = this.allData.polyline.unit
const dataOption = {
// title: {
// text: '{Sunny| 业务可用性 }',
// show: true
// },
xAxis: {
data: timeArr
proxy.legendData=legendData;
proxy.optionData = {
title: {
text: ''
},
tooltip: {
trigger: 'axis',
backgroundColor:'rgba(50,50,50,0.7)',
borderColor:"#333",
textStyle:{
color:"#fff",
align:'left'
}
},
legend: {
data: legendArr
data: proxy.legendData,
itemHeight:0,//图例圆圈大小设置
y:'0px',
textStyle: {
color: '#ffffff',
fontsize:"12px"
}
},
dataZoom: {
show: false,
startValue: this.startValue,
endValue: this.endValue
grid: {
top:'15%',
left: '3%',
right: '4%',
// bottom: '3%',
containLabel: true,
},
series: [
xAxis: {
type: 'category',
boundaryGap: false,
data: xAxisData,
axisLine:{
show:false,//是否显示坐标线
},
axisTick: {
show: false //是否显示坐标刻度
},
axisLabel:{
color:'#ffffff',
},
},
yAxis:[
{
name: seriesName,
type: 'line',
data: seriesData,
smooth: true,
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr1[2]
}, // %0的颜色值
{
offset: 1,
color: colorArr2[2]
} // 100%的颜色值
])
type: 'value',
axisLabel: {
formatter: '{value} %'//以百分比显示
},
splitLine:{
lineStyle: {
color:'#0a1b31'
}
},
min:0,
max:100,
splitNumber:5,
interval:(100-0)/5
}, {
name: '单位:万',
type: 'value',
axisLabel: {
show: true,
interval: 'right',//居中显示
},
splitLine:{
lineStyle: {
color:'#0a1b31'
}
},
min:min2,
max:max2,
splitNumber:5,
interval:(max2-min2)/5
},
],
series: proxy.ySeriesCommon,
itemStyle:{
showSymbol:false
}
};
}
//计算最大值
const calMax=(arr)=>{
let max=0;
arr.forEach((el)=>{
el.forEach((el1)=>{
if(!(el1 === undefined || el1 === '')){
if(max<el1){
max=el1;
}
}
]
}
this.chartInstance.setOption(dataOption)
},
screenAdapter () {
this.titleFontSize = document.getElementById('availability_ref').offsetWidth / 100 * 3.6
const adapterOption = {
legend: {
itemWidth: this.titleFontSize,
itemHeight: this.titleFontSize,
itemGap: this.titleFontSize,
textStyle: {
fontSize: this.titleFontSize / 2
})
})
let maxint=Math.ceil(max/9.5);
let maxval=maxint * 10;//让显示的刻度是整数
return maxval;
}
//计算最小值
const calMin=(arr)=>{
let min=0;
arr.forEach((el)=>{
el.forEach((el1)=>{
if(!(el1 === undefined || el1 === '')){
if(min>el1){
min=el1;
}
}
}
}
this.chartInstance.setOption(adapterOption)
this.chartInstance.resize()
},
startInterval () {
if (this.timerId) {
clearInterval(this.timerId)
}
let index = 12
/*this.timerId = setInterval(() => {
this.startValue++
this.endValue++
// this.allData.polyline.data
// console.log((this.allData.polyline.data)[0].data.length)
if ((this.allData.polyline.data).length > 0) {
index = (this.allData.polyline.data)[0].data.length
}
if (this.endValue > index - 1) {
this.startValue = 0
this.endValue = 6
}
console.log(this.startValue)
console.log(this.endValue)
this.updateChart()
}, 5000)*/
})
})
let minint=Math.floor(min/10);
let minval=minint * 10;//让显示的刻度是整数
return minval;
}
const screenAdapter=()=>{
proxy.titleFontSize = document.getElementById('availability_ref').offsetWidth / 100 * 3.6
}
return{
calMax,
calMin,
optionInit,
getData,
screenAdapter
}
}
}
}
\ No newline at end of file
... ...
<div class="com-container">
<div class="com-chart" id="bandwidthcpu_ref"></div>
<div class="com-container"id="bandwidthcpu_ref">
<LineChart :optionData="optionData" v-if="optionData"></LineChart>
</div>
\ No newline at end of file
... ...
export default {
name: 'BandwidthCpu',
template: '',
components: {},
components: {
'LineChart': Vue.defineAsyncComponent(
() => myImport('views/zjdaping/components/lineChart/index')
)
},
data () {
return {
chartInstance: null,
optionData:'',
allData: {
polyline: {
title: "带宽占用监控",
... ... @@ -27,7 +31,6 @@ export default {
}
},
mounted () {
this.initChart()
this.getData()
window.addEventListener('resize', this.screenAdapter)
this.screenAdapter()
... ... @@ -37,46 +40,7 @@ export default {
clearInterval(this.timerId)
},
methods: {
initChart () {
this.chartInstance = echarts.init(document.getElementById('bandwidthcpu_ref'))
const initOption = {
grid: {
top: '15%',
left: '5%',
right: '4%',
bottom: '20%',
containLabel: true
},
legend: {
right: '10%',
top: '5%',
textStyle: {
color: 'wihte'
}
},
xAxis: {
type: 'category',
boundaryGap: false,
axisLabel: {
textStyle: {
color: '#E6E8EB'
}
}
},
yAxis: {
type: 'value',
splitLine: {
show: false
},
axisLabel: {
textStyle: {
color: '#E6E8EB'
}
}
}
}
this.chartInstance.setOption(initOption)
},
async getData () {
// await this.$http.get()
// const { data: ret } = await this.$http.get('bandwidthcpu')
... ... @@ -88,17 +52,19 @@ export default {
updateChart () {
// 半透明的颜色值
const colorArr1 = [
'rgba(11, 168, 44, 0.5)',
'rgba(35, 255, 255, 0.5)',
'rgba(44, 110, 255, 0.5)',
'rgba(22, 242, 217, 0.5)',
'rgba(11, 168, 44, 0.5)',
'rgba(254, 33, 30, 0.5)',
'rgba(250, 105, 0, 0.5)'
]
// 全透明的颜色值
// 全透明的颜色值
const colorArr2 = [
'rgba(11, 168, 44, 0)',
'rgba(35, 255, 255, 0)',
'rgba(44, 110, 255, 0)',
'rgba(22, 242, 217, 0)',
'rgba(11, 168, 44, 0)',
'rgba(254, 33, 30, 0)',
'rgba(250, 105, 0, 0)'
]
... ... @@ -109,6 +75,16 @@ export default {
type: 'line',
data: item.data,
smooth: true,
showSymbol:false,
itemStyle : {
normal : {
color:colorArr1[index],//tooltip里的小圆点颜色
lineStyle:{
color:colorArr1[index],
width:2,
}
}
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
... ... @@ -129,29 +105,86 @@ export default {
})
const title = this.allData.polyline.title
const unit = this.allData.polyline.unit
const dataOption = {
const seriesData=seriesArr;
let xAxisData=timeArr;
this.optionData = {
title: {
text: title,
left: 'center',
bottom: '8%'
},
xAxis: {
data: timeArr
bottom: '8%',
textStyle: {
fontSize: this.titleFontSize*0.5,
color:'#ffffff'
}
},
yAxis: {
name: unit
tooltip: {
trigger: 'axis',
backgroundColor:'rgba(50,50,50,0.7)',
borderColor:"#333",
textStyle:{
color:"#fff",
align:'left'
}
},
legend: {
data: legendArr
data: legendArr,
itemHeight:0,//图例圆圈大小设置
right: '5%',
top: '5%',
textStyle: {
color: '#ffffff',
fontsize:"12px"
}
},
dataZoom: {
show: false,
startValue: this.startValue,
endValue: this.endValue
grid: {
top: '15%',
left: '3%',
right: '4%',
bottom: '20%',
containLabel: true
},
series: seriesArr
}
this.chartInstance.setOption(dataOption)
xAxis: {
type: 'category',
boundaryGap: false,
data: xAxisData,
axisLine:{
show:false,//是否显示坐标线
},
axisTick: {
show: false //是否显示坐标刻度
},
axisLabel:{
color:'#ffffff',
},
},
yAxis: {
type: 'value',
name:unit,
nameTextStyle:{
color:'#ffffff',
padding:[0,0,0,-20]
},
axisLabel: {
color:'#ffffff',
// formatter: '{value} %'//以百分比显示
},
axisLine:{
show:true,//是否显示坐标线
},
splitLine:{
lineStyle: {
color:'#0a1b31'
}
}
},
series: seriesData
};
},
screenAdapter () {
this.titleFontSize = document.getElementById('bandwidthcpu_ref').offsetWidth / 100 * 3.6
... ... @@ -182,8 +215,7 @@ export default {
}
}
}
this.chartInstance.setOption(adapterOption)
this.chartInstance.resize()
},
startInterval () {
if (this.timerId) {
... ...
<div class="com-container">
<div class="com-chart" id="declarecpu_ref"></div>
<div class="com-container" id="declarecpu_ref">
<LineChart :optionData="optionData" v-if="optionData"></LineChart>
<!-- <div class="com-chart" id="declarecpu_ref"></div>-->
</div>
\ No newline at end of file
... ...
export default {
name: 'ResponseMonitor',
template: '',
components: {},
components: {
'LineChart': Vue.defineAsyncComponent(
() => myImport('views/zjdaping/components/lineChart/index')
)
},
data () {
return {
chartInstance: null,
legendData:'',
optionData:'',
allData: {
polyline: {
title: "申报库CPU监控",
... ... @@ -22,94 +27,88 @@ export default {
}
},
startValue: 0, // 区域缩放的起点值
endValue: 6, // 区域缩放的终点值
timerId: null // 定时器的标识
endValue: 9, // 区域缩放的终点值
timerId: null, // 定时器的标识
titleFontSize: 30,
curve: 'KPIDA0ACBBP',
rateTitle: 'KPIDA0ACBBK',
numerTitle: 'KPIDA0ACBBG'
}
},
mounted () {
this.initChart()
this.getData()
this.getData(this)
window.addEventListener('resize', this.screenAdapter)
this.screenAdapter()
},
unmounted () {
window.removeEventListener('resize', this.screenAdapter)
// window.removeEventListener('resize', this.screenAdapter)
clearInterval(this.timerId)
},
methods: {
initChart () {
// this.chartInstance = this.$echarts.init(this.$refs.declarecpu_ref, 'chalk')
this.chartInstance = echarts.init(document.getElementById('declarecpu_ref'))
const initOption = {
grid: {
top: '15%',
left: '3%',
right: '4%',
bottom: '20%',
containLabel: true
},
legend: {
right: '10%',
top: '5%',
textStyle: {
color: 'wihte'
}
},
xAxis: {
type: 'category',
boundaryGap: false,
axisLabel: {
textStyle: {
color: '#E6E8EB'
}
}
},
yAxis: {
type: 'value',
splitLine: {
show: false
},
axisLabel: {
textStyle: {
color: '#E6E8EB'
}
}
getData (that) {
const { proxy } = Vue.getCurrentInstance();
/* var params = {
curve: that.curve,
rateTitle: that.rateTitle,
numerTitle: that.numerTitle
};
proxy.$http.get("/api-web/bigScreen/declarePolyline", params, function (res) {
if(res.success){
console.log('9**',res.obj)
that.allData = res.obj;
that.updateChart()
}
}
this.chartInstance.setOption(initOption)
},
async getData () {
// await this.$http.get()
// const { data: ret } = await this.$http.get('declarecpu')
// this.allData = ret
// console.log(ret)
this.updateChart()
this.startInterval()
});*/
that.updateChart()
},
updateChart () {
// 半透明的颜色值
const colorArr1 = [
'rgba(11, 168, 44, 0.5)',
'rgba(35, 255, 255, 0.5)',
'rgba(44, 110, 255, 0.5)',
'rgba(22, 242, 217, 0.5)',
'rgba(11, 168, 44, 0.5)',
'rgba(254, 33, 30, 0.5)',
'rgba(250, 105, 0, 0.5)'
]
// 全透明的颜色值
// 全透明的颜色值
const colorArr2 = [
'rgba(11, 168, 44, 0)',
'rgba(35, 255, 255, 0)',
'rgba(44, 110, 255, 0)',
'rgba(22, 242, 217, 0)',
'rgba(11, 168, 44, 0)',
'rgba(254, 33, 30, 0)',
'rgba(250, 105, 0, 0)'
]
const timeArr = this.allData.xAxis.today
const seriesArr = this.allData.polyline.data.map((item, index) => {
return {
const seriesArr = this.allData.polyline.data;
this.declareNumer = this.allData.polyline.declareNumer
let seriesData=[];
$.each(seriesArr,function (index,item){
seriesData .push({
name: item.name,
type: 'line',
data: item.data,
smooth: true,
showSymbol:false,
itemStyle : {
normal : {
color:colorArr1[index],//tooltip里的小圆点颜色
lineStyle:{
color:colorArr1[index],
width:2,
}
}
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
... ... @@ -122,84 +121,130 @@ export default {
} // 100%的颜色值
])
}
}
})
})
// 图例的数据
const legendArr = this.allData.polyline.data.map(item => {
return item.name
})
const title = this.allData.polyline.title
const unit = this.allData.polyline.unit
const dataOption = {
//x轴数据
// let xAxisDataLength=seriesData.length;
// let xAxisData=[];
// for(let i=1;i<=xAxisDataLength;i++){
// xAxisData.push(i)
// }
let xAxisData=timeArr;
this.optionData = {
title: {
text: title,
text: '申报库CPU监控',
left: 'center',
bottom: '8%'
},
xAxis: {
data: timeArr
bottom: '8%',
textStyle: {
fontSize: this.titleFontSize*0.5,
color:'#ffffff'
}
},
yAxis: {
name: unit
tooltip: {
trigger: 'axis',
backgroundColor:'rgba(50,50,50,0.7)',
borderColor:"#333",
textStyle:{
color:"#fff",
align:'left'
}
},
legend: {
data: legendArr
},
dataZoom: {
show: false,
startValue: this.startValue,
endValue: this.endValue
},
series: seriesArr
}
this.chartInstance.setOption(dataOption)
},
screenAdapter () {
this.titleFontSize = document.getElementById('declarecpu_ref').offsetWidth / 100 * 3.6
const adapterOption = {
title: {
data: legendArr,
itemHeight:0,//图例圆圈大小设置
right: '5%',
top: '5%',
textStyle: {
fontSize: this.titleFontSize,
color: 'white'
color: '#ffffff',
fontsize:"12px"
}
},
grid: {
top: '15%',
left: '3%',
right: '4%',
bottom: '20%',
containLabel: true
},
xAxis: {
type: 'category',
boundaryGap: false,
data: xAxisData,
axisLine:{
show:false,//是否显示坐标线
},
axisTick: {
show: false //是否显示坐标刻度
},
axisLabel:{
color:'#ffffff',
},
},
yAxis: {
top: this.titleFontSize,
nameTextStyle: {
padding: [0, 0, -(this.titleFontSize / 2), -(this.titleFontSize)], // 修改位置
fontSize: this.titleFontSize / 2,
color: 'white'
type: 'value',
name:'cpu%',
nameTextStyle:{
color:'#ffffff',
padding:[0,0,0,-20]
},
axisLabel: {
color:'#ffffff',
// formatter: '{value} %'//以百分比显示
},
axisLine:{
show:true,//是否显示坐标线
},
splitLine:{
lineStyle: {
color:'#0a1b31'
}
}
},
series: seriesData
};
},
screenAdapter () {
this.titleFontSize = document.getElementById('declarecpu_ref').offsetWidth / 100 * 3.6
console.log(this.titleFontSize)
const adapterOption = {
legend: {
itemWidth: this.titleFontSize,
itemHeight: this.titleFontSize,
itemGap: this.titleFontSize,
textStyle: {
fontSize: this.titleFontSize / 1.5
fontSize: this.titleFontSize / 2
}
}
}
this.chartInstance.setOption(adapterOption)
this.chartInstance.resize()
},
startInterval () {
if (this.timerId) {
clearInterval(this.timerId)
}
let index = 12
let index = 10
/*this.timerId = setInterval(() => {
this.startValue++
this.endValue++
if ((this.allData.polyline.data).length > 0) {
index = (this.allData.polyline.data)[0].data.length
if (this.allData.polyline.data.data.length > 0) {
index = this.allData.polyline.data.data.length
}
if (this.endValue > index - 1) {
this.startValue = 0
this.endValue = 6
this.endValue = 9
}
console.log(this.startValue)
console.log(this.endValue)
this.updateChart()
}, 5000)*/
}
... ...
<div class="com-container" id="declarepolyline_ref">
<LineChart :yAxisData="yAxisCommon" :seriesData="ySeriesCommon" :legendData="legendData" :chartId="chartId" v-if="ySeriesCommon.length"></LineChart>
<!-- <div class="com-chart" id="declarepolyline_ref"></div>-->
<!-- <div class="declarepolyline-title" :style="comtitlesizeStyle">
<el-row>
<el-col :span="24">
<div class="grid-content bg-purple-dark">
<img src="./src/assets/img/icon-ysb.png" :style="comimgsizeStyle">
<span>本月应申报</span>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="grid-content bg-purple-dark" :style="comtitletextStyle">
{{declareNumer}}
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="grid-content bg-purple-dark">
<img src="./src/assets/img/icon-sbl.png" :style="comimgsizeStyle">
<span>本月申报率</span>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<div class="grid-content bg-purple-dark" :style="comtitletextStyle">
<span>{{declareRateLeft}}</span><span :style="comboxtextStyle">{{declareRateRight}}</span>
</div>
</el-col>
</el-row>
</div>-->
<div class="com-container">
<LineChart :optionData="optionData" v-if="optionData"></LineChart>
</div>
\ No newline at end of file
... ...
export default {
name: 'declarePolyline',
template: '',
components: {},
components: {
'LineChart': Vue.defineAsyncComponent(
() => myImport('views/zjdaping/components/lineChart/index')
)
},
data () {
return {
chartInstance: null,
... ... @@ -9,6 +13,7 @@ export default {
yAxisCommon:'',
ySeriesCommon:'',
legendData:'',
optionData:'',
// allData: {
// polyline: {
// data: {
... ... @@ -62,53 +67,17 @@ export default {
}
},
mounted () {
this.initChart()
this.getData(this)
window.addEventListener('resize', this.screenAdapter)
// window.addEventListener('resize', this.screenAdapter)
// this.screenAdapter()
},
unmounted () {
window.removeEventListener('resize', this.screenAdapter)
// window.removeEventListener('resize', this.screenAdapter)
clearInterval(this.timerId)
},
methods: {
initChart () {
/*this.chartInstance = echarts.init(document.getElementById('declarepolyline_ref'))
const initOption = {
grid: {
top: '10%',
left: '1%',
right: '30%',
bottom: '1%',
containLabel: true
},
legend: {
right: '2%',
top: '5%'
},
xAxis: {
type: 'category',
boundaryGap: false,
axisLabel: {
textStyle: {
color: '#E6E8EB'
}
}
},
yAxis: {
type: 'value',
splitLine: {
show: false
},
axisLabel: {
textStyle: {
color: '#E6E8EB'
}
}
}
}
this.chartInstance.setOption(initOption)*/
},
getData (that) {
const { proxy } = Vue.getCurrentInstance();
var params = {
... ... @@ -121,7 +90,7 @@ export default {
console.log('9**',res.obj)
that.allData = res.obj;
that.updateChart()
that.startInterval()
// that.startInterval()
}
});
... ... @@ -132,6 +101,7 @@ export default {
'rgba(11, 168, 44, 0.5)',
'rgba(44, 110, 255, 0.5)',
'rgba(22, 242, 217, 0.5)',
'rgba(35, 255, 255, 0.5)',
'rgba(254, 33, 30, 0.5)',
'rgba(250, 105, 0, 0.5)'
]
... ... @@ -140,6 +110,7 @@ export default {
'rgba(11, 168, 44, 0)',
'rgba(44, 110, 255, 0)',
'rgba(22, 242, 217, 0)',
'rgba(35, 255, 255, 0)',
'rgba(254, 33, 30, 0)',
'rgba(250, 105, 0, 0)'
]
... ... @@ -156,72 +127,96 @@ export default {
const legendArr = this.allData.polyline.data.data.map(item => {
return item.name
})
this.yAxisCommon={
type: 'value',
splitLine:{
lineStyle: {
color:'#0a1b31'
}
},
axisLabel:{
color:'#ffffff',
},
//x轴数据
let xAxisDataLength=seriesData.length;
let xAxisData=[];
for(let i=1;i<=xAxisDataLength;i++){
xAxisData.push(i)
}
let ySeriesCommon=[];
this.legendData=legendArr;
ySeriesCommon.push({
name: seriesName,
type: 'line',
data: seriesData,
smooth: true,
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr1[1]
}, // %0的颜色值
{
offset: 1,
color: colorArr2[1]
} // 100%的颜色值
])
}
})
this.optionData = {
title: {
text: ''
},
tooltip: {
trigger: 'axis',
backgroundColor:'rgba(50,50,50,0.7)',
borderColor:"#333",
textStyle:{
color:"#fff",
align:'left'
}
/* const dataOption = {
xAxis: {
data: timeArr
},
legend: {
data: legendArr
data: legendArr,
itemHeight:0,//图例圆圈大小设置
y:'7px',
textStyle: {
color: '#ffffff',
fontsize:"12px"
}
},
dataZoom: {
show: false,
startValue: this.startValue,
endValue: this.endValue
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
},
series: [
{
name: seriesName,
type: 'line',
data: seriesData,
smooth: true,
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr1[1]
}, // %0的颜色值
{
offset: 1,
color: colorArr2[1]
} // 100%的颜色值
])
xAxis: {
type: 'category',
boundaryGap: false,
data: xAxisData,
axisLine:{
show:false,//是否显示坐标线
},
axisTick: {
show: false //是否显示坐标刻度
},
axisLabel:{
color:'#ffffff',
},
},
yAxis: {
axisLabel: {
color:'#ffffff',
formatter: '{value} %'//以百分比显示
},
splitLine:{
lineStyle: {
color:'#0a1b31'
}
},
},
series: {
name: seriesName,
type: 'line',
data: seriesData,
smooth: true,
showSymbol:false,
color:'#01E6E6',
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr1[3]
}, // %0的颜色值
{
offset: 1,
color: colorArr2[3]
} // 100%的颜色值
])
}
]
}
this.chartInstance.setOption(dataOption)*/
},
itemStyle:{
showSymbol:false
}
};
},
screenAdapter () {
this.titleFontSize = document.getElementById('declarepolyline_ref').offsetWidth / 100 * 3.6
... ...
... ... @@ -10,7 +10,7 @@
</el-row>
<el-row>
<el-col :span="24">
<div class="grid-content bg-purple-dark" :style="comtitletextStyle">
<div class="grid-content bg-purple-dark declare-report-num" :style="comtitletextStyle">
{{declareNumer}}
</div>
</el-col>
... ...
<div class="com-container">
<div class="com-chart" id="documentcpu_ref"></div>
<div class="com-container" id="documentcpu_ref">
<LineChart :optionData="optionData" v-if="optionData"></LineChart>
</div>
\ No newline at end of file
... ...
export default {
name: 'DocumentCpu',
template: '',
components: {},
components: {
'LineChart': Vue.defineAsyncComponent(
() => myImport('views/zjdaping/components/lineChart/index')
)
},
data () {
return {
chartInstance: null,
optionData:'',
allData: {
polyline: {
title: "文书库CPU监控",
... ... @@ -27,7 +31,6 @@ export default {
}
},
mounted () {
this.initChart()
this.getData()
window.addEventListener('resize', this.screenAdapter)
this.screenAdapter()
... ... @@ -37,46 +40,7 @@ export default {
clearInterval(this.timerId)
},
methods: {
initChart () {
this.chartInstance = echarts.init(document.getElementById('documentcpu_ref'))
const initOption = {
grid: {
top: '15%',
left: '3%',
right: '4%',
bottom: '20%',
containLabel: true
},
legend: {
right: '10%',
top: '5%',
textStyle: {
color: 'wihte'
}
},
xAxis: {
type: 'category',
boundaryGap: false,
axisLabel: {
textStyle: {
color: '#E6E8EB'
}
}
},
yAxis: {
type: 'value',
splitLine: {
show: false
},
axisLabel: {
textStyle: {
color: '#E6E8EB'
}
}
}
}
this.chartInstance.setOption(initOption)
},
async getData () {
// await this.$http.get()
// const { data: ret } = await this.$http.get('documentcpu')
... ... @@ -88,17 +52,19 @@ export default {
updateChart () {
// 半透明的颜色值
const colorArr1 = [
'rgba(11, 168, 44, 0.5)',
'rgba(35, 255, 255, 0.5)',
'rgba(44, 110, 255, 0.5)',
'rgba(22, 242, 217, 0.5)',
'rgba(11, 168, 44, 0.5)',
'rgba(254, 33, 30, 0.5)',
'rgba(250, 105, 0, 0.5)'
]
// 全透明的颜色值
// 全透明的颜色值
const colorArr2 = [
'rgba(11, 168, 44, 0)',
'rgba(35, 255, 255, 0)',
'rgba(44, 110, 255, 0)',
'rgba(22, 242, 217, 0)',
'rgba(11, 168, 44, 0)',
'rgba(254, 33, 30, 0)',
'rgba(250, 105, 0, 0)'
]
... ... @@ -109,6 +75,16 @@ export default {
type: 'line',
data: item.data,
smooth: true,
showSymbol:false,
itemStyle : {
normal : {
color:colorArr1[index],//tooltip里的小圆点颜色
lineStyle:{
color:colorArr1[index],
width:2,
}
}
},
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
... ... @@ -129,29 +105,90 @@ export default {
})
const title = this.allData.polyline.title
const unit = this.allData.polyline.unit
const dataOption = {
const seriesData=seriesArr;
let xAxisData=timeArr;
this.optionData = {
title: {
text: title,
left: 'center',
bottom: '8%'
},
xAxis: {
data: timeArr
bottom: '8%',
textStyle: {
fontSize: this.titleFontSize*0.5,
color:'#ffffff'
}
},
yAxis: {
name: unit
tooltip: {
trigger: 'axis',
backgroundColor:'rgba(50,50,50,0.7)',
borderColor:"#333",
textStyle:{
color:"#fff",
align:'left'
}
},
legend: {
data: legendArr
data: legendArr,
itemHeight:0,//图例圆圈大小设置
right: '5%',
top: '5%',
textStyle: {
color: '#ffffff',
fontsize:"12px"
}
},
dataZoom: {
show: false,
startValue: this.startValue,
endValue: this.endValue
grid: {
top: '15%',
left: '3%',
right: '4%',
bottom: '20%',
containLabel: true
},
series: seriesArr
}
this.chartInstance.setOption(dataOption)
xAxis: {
type: 'category',
boundaryGap: false,
data: xAxisData,
axisLine:{
show:false,//是否显示坐标线
},
axisTick: {
show: false //是否显示坐标刻度
},
axisLabel:{
color:'#ffffff',
},
},
yAxis: {
type: 'value',
name:unit,
nameTextStyle:{
color:'#ffffff',
padding:[0,0,0,-20]
},
axisLabel: {
color:'#ffffff',
// formatter: '{value} %'//以百分比显示
},
axisLine:{
show:true,//是否显示坐标线
},
splitLine:{
lineStyle: {
color:'#0a1b31'
}
}
},
series: seriesData
};
},
screenAdapter () {
this.titleFontSize = document.getElementById('documentcpu_ref').offsetWidth / 100 * 3.6
... ... @@ -179,8 +216,7 @@ export default {
}
}
}
this.chartInstance.setOption(adapterOption)
this.chartInstance.resize()
},
startInterval () {
if (this.timerId) {
... ...
<div class="monitoring-bar" id="mon-bar">
<img :style="comtitleImgStyle" src="/vue3/src/assets/images/digitalDp/title-monitoring.png" alt="">
<BarChart :optionData="optionData" v-if="optionData"></BarChart>
</div>
... ...
export default {
name: 'monitoring',
template: '',
components: {
'BarChart': Vue.defineAsyncComponent(
() => myImport('views/zjdaping/components/barChart/index')
)
},
data(){
return {
domainName:sessionStorage.getItem('domainName'),
apiUrl:'/api-web/bigScreen/thirtyDayMonitor?kipId=KPI63C5B2E5',
declareLineData:'',
ySeriesCommon:[],
legendData:[],
ySeriesCommonData:[],
titleFontSize: 30,
optionData:''
}
},
computed: {
comtitleImgStyle () {
return {
height: this.titleFontSize * 2.1 + 'px'
}
}
},
setup(props, {attrs, slots, emit}) {
const {proxy} = Vue.getCurrentInstance();
// 挂载完
Vue.onMounted(() => {
proxy.screenAdapter();
$.get(proxy.domainName +proxy.apiUrl,function (res) {
const data = res;
if (data && data.data) {
let monitoringBarData=data.data;
let legendData=[];
$.each(monitoringBarData,function (i,v){
proxy.ySeriesCommonData.unshift(v.value)
legendData.push(i+1)
})
proxy.legendData=legendData
}
// proxy.ySeriesCommon=
proxy.optionInti()
})
})
const optionInti=()=>{
proxy.optionData = {
title: {
text: '',
},
grid: {
top:'4%',
left: '3%',
right: '4%',
// bottom:'0',
// bottom: '8%',
containLabel: true,
},
xAxis: {
type: 'category',
data: props.legendData,
axisLine:{
show:true,//是否显示坐标线
lineStyle: {
color:'#0a1b31'//坐标线颜色
}
},
axisTick: {
show: false //是否显示坐标刻度
},
axisLabel:{
color:'#ffffff',
fontSize: 12
},
},
yAxis: {
type: 'value',
splitLine:{
show:false,
},
axisLine:{
show:true,//是否显示坐标线
lineStyle: {
color:'#0a1b31'//坐标线颜色
}
},
axisLabel:{
color:'#ffffff',
fontSize:12,
formatter:function (value,index){
if(value>=10000 &&value<10000000){
value=value/10000 +"万";
}else if(value>=10000000){
value=value/10000000+"千万";
}
return value;
}
}
},
series: [
{
data: proxy.ySeriesCommonData,
type: 'bar',
showBackground: true,
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.1)'
},
barWidth:8,
itemStyle:{
normal:{
barBorderRadius: [3,3,0,0],
color:new echarts.graphic.LinearGradient(
0,0,0,1,
[
{offset:0,color:'#3ac9fb'},
{offset:1,color:'#2a81f3'}
]
)
// color:"#ff0000"
}
}
}
]
};
}
const screenAdapter=()=>{
proxy.titleFontSize = document.getElementById('mon-bar').offsetWidth / 100 * 3.6
}
return{
optionInti,
screenAdapter
}
}
}
\ No newline at end of file
... ...
<div class="com-container">
<div class="com-chart" id="responsemonitor_ref"></div>
<div class="com-container" id="responsemonitor_ref">
<div class="cpu-dropdown">
<el-dropdown @command="handleCommand" >
<span class="el-dropdown-link">
请选择
<i class="icon-arrow"></i>
</span>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="max">最大值</el-dropdown-item>
<el-dropdown-item command="ave">平均值</el-dropdown-item>
<el-dropdown-item command="min">最小值</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
<!-- <div class="com-chart" id="responsemonitor_ref"></div>-->
<LineChart :optionData="optionData" v-if="optionData"></LineChart>
</div>
\ No newline at end of file
... ...
export default {
name: 'ResponseMonitor',
template: '',
components: {},
components: {
'LineChart': Vue.defineAsyncComponent(
() => myImport('views/zjdaping/components/lineChart/index')
)
},
data () {
return {
chartInstance: null,
optionData:'',
titleFontSize:'30',
allData: {
polyline: {
title: "系统响应请求数监控",
... ... @@ -35,7 +40,7 @@ export default {
},
methods: {
initChart () {
this.chartInstance = echarts.init(document.getElementById('responsemonitor_ref'))
/* this.chartInstance = echarts.init(document.getElementById('responsemonitor_ref'))
const initOption = {
grid: {
top: '15%',
... ... @@ -69,7 +74,7 @@ export default {
}
}
}
this.chartInstance.setOption(initOption)
this.chartInstance.setOption(initOption)*/
},
async getData () {
// await this.$http.get()
... ... @@ -85,6 +90,7 @@ export default {
'rgba(11, 168, 44, 0.5)',
'rgba(44, 110, 255, 0.5)',
'rgba(22, 242, 217, 0.5)',
'rgba(35, 255, 255, 0.5)',
'rgba(254, 33, 30, 0.5)',
'rgba(250, 105, 0, 0.5)'
]
... ... @@ -93,6 +99,7 @@ export default {
'rgba(11, 168, 44, 0)',
'rgba(44, 110, 255, 0)',
'rgba(22, 242, 217, 0)',
'rgba(35, 255, 255, 0)',
'rgba(254, 33, 30, 0)',
'rgba(250, 105, 0, 0)'
]
... ... @@ -101,52 +108,102 @@ export default {
const seriesName = this.allData.polyline.data.name
console.log(seriesName)
// 图例的数据
const legendArr = this.allData.polyline.data.data.map(item => {
return item.name
})
// const legendArr = this.allData.polyline.data.map(item => {
// return item.name
// })
const legendArr=[];
legendArr.push(seriesName);
const title = this.allData.polyline.title
// const unit = this.allData.polyline.unit
const dataOption = {
this.optionData = {
title: {
text: title,
left: '10%',
textStyle: {
color: '#F1F2F5'
fontSize: this.titleFontSize*0.5,
color:'#ffffff'
}
},
xAxis: {
data: timeArr
tooltip: {
trigger: 'axis',
backgroundColor:'rgba(50,50,50,0.7)',
borderColor:"#333",
textStyle:{
color:"#fff",
align:'left'
}
},
legend: {
data: legendArr
data: legendArr,
itemHeight:0,//图例圆圈大小设置
top:'10%',
right:'20%',
textStyle: {
color: '#ffffff',
fontsize:"12px"
}
},
dataZoom: {
show: false,
startValue: this.startValue,
endValue: this.endValue
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
},
series: [
{
name: seriesName,
type: 'line',
data: seriesData,
smooth: true,
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr1[2]
}, // %0的颜色值
{
offset: 1,
color: colorArr2[2]
} // 100%的颜色值
])
xAxis: {
type: 'category',
boundaryGap: false,
data: timeArr,
axisLine:{
show:false,//是否显示坐标线
},
axisTick: {
show: false //是否显示坐标刻度
},
axisLabel:{
color:'#ffffff',
},
},
yAxis: {
axisLabel: {
color:'#ffffff',
},
splitLine:{
lineStyle: {
color:'#0a1b31'
}
},
},
series: {
name: seriesName,
type: 'line',
data: seriesData,
smooth: true,
showSymbol:false,
color:colorArr1[1],
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: colorArr1[1]
}, // %0的颜色值
{
offset: 1,
color: colorArr2[1]
} // 100%的颜色值
])
}
]
}
this.chartInstance.setOption(dataOption)
},
itemStyle:{
showSymbol:false
}
};
},
screenAdapter () {
this.titleFontSize = document.getElementById('responsemonitor_ref').offsetWidth / 100 * 3.6
... ... @@ -165,8 +222,7 @@ export default {
}
}
}
this.chartInstance.setOption(adapterOption)
this.chartInstance.resize()
},
startInterval () {
if (this.timerId) {
... ...
<div class="com-container">
<div class="com-chart" id="topfive_ref"></div>
<div class="topfive-box-title">
<img :style="comtitleImgStyle" src="./src/assets/img/box_title_bykk_zj_1.png" class="topfive-title-img"> <!-- bor1_6 -->
<span :style="comtitleTextStyle" class="topfive-title-size">涉税文书TOP5业务量</span>
<img :style="comtitleImgStyle" src="./src/assets/images/digitalDp/title-topfive.png" class="topfive-title-img"> <!-- bor1_6 -->
<!-- <span :style="comtitleTextStyle" class="topfive-title-size">涉税文书TOP5业务量</span>-->
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -70,14 +70,22 @@ export default {
show: false
}
},
yAxis: {
type: 'category',
axisLabel: {
textStyle: {
color: '#E2E1E6'
}
}
},
yAxis:
{
type: 'category',
axisLabel: {
textStyle: {
color: '#E2E1E6'
}
},
axisLine:{
show:false,//是否显示坐标线
},
axisTick: {
show: false //是否显示坐标刻度
},
},
series: [
{
type: 'bar',
... ... @@ -88,10 +96,18 @@ export default {
label: {
show: true,
position: 'right',
testStyle: {
color: 'white'
}
textStyle: {
color: 'rgba(0,0,0,0)'
},
height:26,
width: 26,
offset:[-10,0],
backgroundColor: {
image: '/vue3/src/assets/images/digitalDp/pro-bg.png'
},
},
itemStyle: {
// 颜色渐变 指明渐变方向,指明不同百分比之下颜色的值 LinearGradient(x1, y1, x2, y2, [])
color: new echarts.graphic.LinearGradient(0, 0, 1, 0, [
... ... @@ -139,9 +155,24 @@ export default {
return item.value
})
const dataOption = {
yAxis: {
yAxis: [{
data: sellerNames
},
{
data:sellerValues,
axisLine:{
show:false,//是否显示坐标线
},
axisTick: {
show: false //是否显示坐标刻度
},
axisLabel: {
textStyle: {
color: '#ffffff'
}
},
}
],
series: [
{
data: sellerValues
... ...
... ... @@ -45,6 +45,7 @@
</div>
<div class="middle-right">
<div class="declare-top">
<!--本月应申报-->
<DeclareReport></DeclareReport>
</div>
<div class="deduction-bottom">
... ... @@ -56,9 +57,10 @@
</section>
<section class="screen-right">
<!--<div id="right-top">
</div>-->
<div id="right-top">
<!--访问监控 柱状图-->
<Monitoring></Monitoring>
</div>
<div id="right-center">
<!-- 业务可用性 折线 -->
<Availability></Availability>
... ...
... ... @@ -26,6 +26,9 @@ export default {
'DeclareLine': Vue.defineAsyncComponent(
() => myImport('views/zjdaping/components/declareLine/index')
),
'Monitoring': Vue.defineAsyncComponent(
() => myImport('views/dp/components/monitoring/index')
),
'DeclareReport': Vue.defineAsyncComponent(
() => myImport('views/dp/components/declareReport/index')
),
... ...
<div id="bar-echart" style="width:100%;height:290px;"></div>
<div id="bar-echart" style="width:100%;height:100%;"></div>
... ...
export default {
name: 'barChart',
template: '',
props:['yAxisData','seriesData','legendData','chartId'],
props:['optionData'],
components: {
},
data(){
... ... @@ -17,8 +17,8 @@ export default {
Vue.onMounted(() => {
const chartDom=proxy.$el
const myChart = echarts.init(chartDom);
let option;
option = {
let option=props.optionData;
/*option = {
title: {
text: '近30天访问量',
x:'center',
... ... @@ -71,9 +71,15 @@ export default {
}
},
series: props.seriesData
};
};*/
window.addEventListener('resize', function () {
myChart.resize();
});
option && myChart.setOption(option);
})
return{
... ...
<div class="declare-lineChart">
<LineChart :yAxisData="yAxisCommon" :seriesData="ySeriesCommon" :legendData="legendData" :chartId="chartId" v-if="ySeriesCommon.length"></LineChart>
<LineChart :optionData="optionData" v-if="optionData"></LineChart>
</div>
... ...
... ... @@ -15,6 +15,7 @@ export default {
yAxisCommon:[],
ySeriesCommon:[],
legendData:[],
optionData:'',
colorData:["#97d5f4",'#efe0a7','#e5abd1'],
chartId:'line-echart-declare'
}
... ... @@ -66,79 +67,85 @@ export default {
})
proxy.ySeriesCommon=ySeriesCommon;
proxy.legendData=legendData;
proxy.optionInit();
}
})
//一般y序列
proxy.yAxisCommon={
type: 'value',
splitLine:{
lineStyle: {
color:'#0a1b31'
}
},
axisLabel:{
color:'#ffffff',
},
}
//一般y轴数据
/* proxy.ySeriesCommon=[
{
name: '网络投票',
type: 'line',
smooth:true,
stack: 'Total',
data: [120, 132, 101, 134, 90, 230, 210],
yAxisIndex:0,
showSymbol:false,
itemStyle : {
normal : {
color:"#97d5f4",//tooltip里的小圆点颜色
lineStyle:{
color:'#97d5f4'
}
}
},
},
{
name: '涉税文书',
type: 'line',
smooth:true,
stack: 'Total',
data: [220, 182, 191, 234, 290, 330, 310],
showSymbol:false,
yAxisIndex:0,
itemStyle : {
color:"#ffffff",
normal : {
color:'#efe0a7',
lineStyle:{
color:'#efe0a7'
}
}
},
},
{
name: '网上申报',
type: 'line',
smooth:true,
stack: 'Total',
data: [150, 232, 201, 154, 190, 330, 410],
yAxisIndex:0,
showSymbol:false,
itemStyle : {
normal : {
color:'#e5abd1',
lineStyle:{
color:'#e5abd1'
}
}
},
},
]*/
})
const optionInit=()=>{
console.log("3232",proxy.ySeriesCommon)
let xAxisDataLength=proxy.ySeriesCommon[0].length;
let xAxisData=[];
for(let i=1;i<=xAxisDataLength;i++){
xAxisData.push(i)
}
proxy.optionData = {
title: {
text: ''
},
tooltip: {
trigger: 'axis',
backgroundColor:'rgba(50,50,50,0.7)',
borderColor:"#333",
textStyle:{
color:"#fff",
align:'left'
}
},
legend: {
data: proxy.legendData,
itemHeight:0,//图例圆圈大小设置
y:'7px',
textStyle: {
color: '#ffffff',
fontsize:"12px"
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
},
xAxis: {
type: 'category',
boundaryGap: false,
data: xAxisData,
axisLine:{
show:false,//是否显示坐标线
},
axisTick: {
show: false //是否显示坐标刻度
},
axisLabel:{
color:'#ffffff',
},
},
yAxis:{
type: 'value',
splitLine:{
lineStyle: {
color:'#0a1b31'
}
},
axisLabel:{
color:'#ffffff',
},
},
series: proxy.ySeriesCommon,
itemStyle:{
showSymbol:false
}
};
}
return{
optionInit
}
}
}
\ No newline at end of file
... ...
<div :id="chartId" style="width:100%;height:225px;"></div>
<div :id="chartId" style="width:100%;height:100%;"></div>
... ...
export default {
name: 'lineChart',
template: '',
props:['yAxisData','seriesData','legendData','chartId'],
// props:['yAxisData','seriesData','legendData','chartId'],
props:['optionData'],
components: {
},
data(){
... ... @@ -21,20 +22,22 @@ export default {
/*$.get(proxy.domainName,function(res){
})*/
proxy.yAxisData=props.yAxisData;
/* proxy.yAxisData=props.yAxisData;
proxy.seriesData=props.seriesData;
proxy.chartId=props.chartId;
// const chartDom = document.getElementById('line-echart-declare');
console.log("**!/",proxy.seriesData)
let xAxisDataLength=proxy.seriesData[0].data.length;
let xAxisData=[];
for(let i=1;i<=xAxisDataLength;i++){
xAxisData.push(i)
}
}*/
const chartDom=proxy.$el
const myChart = echarts.init(chartDom);
let option;
let option=props.optionData;
console.log("testLIne0",chartDom,option)
option = {
/* option = {
title: {
text: ''
},
... ... @@ -64,11 +67,11 @@ export default {
bottom: '3%',
containLabel: true,
},
/*toolbox: {
/!*toolbox: {
feature: {
saveAsImage: {}
}
},*/
},*!/
xAxis: {
type: 'category',
boundaryGap: false,
... ... @@ -90,7 +93,7 @@ export default {
itemStyle:{
showSymbol:false
}
};
};*/
option && myChart.setOption(option);
... ...
<div class="monitoring-bar">
<BarChart :yAxisData="yAxisCommon" :seriesData="ySeriesCommon" :legendData="legendData" :chartId="chartId" v-if="ySeriesCommon.length"></BarChart>
<BarChart :optionData="optionData" v-if="optionData"></BarChart>
</div>
... ...
export default {
name: 'performance',
name: 'monitoringMonth',
template: '',
components: {
'BarChart': Vue.defineAsyncComponent(
... ... @@ -15,6 +15,7 @@ export default {
ySeriesCommon:[],
legendData:[],
ySeriesCommonData:[],
optionData:''
}
},
... ... @@ -37,7 +38,65 @@ export default {
})
proxy.legendData=legendData
}
proxy.ySeriesCommon=[
// proxy.ySeriesCommon=
proxy.optionInti()
})
})
const optionInti=()=>{
proxy.optionData = {
title: {
text: '近30天访问量',
x:'center',
y:'7px',
textStyle:{
color:"#ffffff",
fontSize:14
}
},
xAxis: {
type: 'category',
data: props.legendData,
axisLine:{
show:true,//是否显示坐标线
lineStyle: {
color:'#0a1b31'//坐标线颜色
}
},
axisTick: {
show: false //是否显示坐标刻度
},
axisLabel:{
color:'#ffffff',
fontSize: 12
},
},
yAxis: {
type: 'value',
splitLine:{
show:false,
},
axisLine:{
show:true,//是否显示坐标线
lineStyle: {
color:'#0a1b31'//坐标线颜色
}
},
axisLabel:{
color:'#ffffff',
fontSize:12,
formatter:function (value,index){
if(value>=10000 &&value<10000000){
value=value/10000 +"万";
}else if(value>=10000000){
value=value/10000000+"千万";
}
return value;
}
}
},
series: [
{
data: proxy.ySeriesCommonData,
type: 'bar',
... ... @@ -61,11 +120,11 @@ export default {
}
}
]
})
})
};
}
return{
optionInti
}
}
}
\ No newline at end of file
... ...
... ... @@ -4,6 +4,6 @@
</div>
<div class="performance-lineChart">
<LineChart :yAxisData="yAxisDataPerformance" :seriesData="seriesDataPerformance" v-if="seriesDataPerformance"></LineChart>
<LineChart :optionData="optionData" v-if="optionData"></LineChart>
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -9,10 +9,10 @@ export default {
data(){
return {
domainName:sessionStorage.getItem('domainName'),
apiUrl:'/api-web/bigScreen/getMachineRoomInfoList',
apiUrl:'/api-web/sxview/getBusinessAvailability',
resourceStatisticsData:'',
yAxisDataPerformance:[],
seriesDataPerformance:[]
optionData:'',
ySeriesCommon:[]
}
},
setup(props, {attrs, slots, emit}) {
... ... @@ -21,6 +21,24 @@ export default {
// 挂载完
Vue.onMounted(() => {
proxy.getData();
})
const getData=()=>{
$.get(proxy.domainName +proxy.apiUrl,function (res) {
const data = res;
if (data && data.data) {
let resData=data.data;
}
// proxy.optionInit();
})
proxy.optionInit();
}
const optionInit=()=>{
let data3=[350, 350, 350, 350, 350, 350, 350];
let data4=[220, 182, 191, 234, 290, 330, 310];
let data2=[100, 100, 100, 100, 100, 100, 100];
... ... @@ -30,43 +48,8 @@ export default {
let max1=proxy.calMax([data1,data2]);
let min2=proxy.calMin([data3,data4]);
let max2=proxy.calMax([data3,data4]);
//业务性能指标y序列
proxy.yAxisDataPerformance=[
{
type: 'value',
axisLabel: {
formatter: '{value} %'//以百分比显示
},
splitLine:{
lineStyle: {
color:'#0a1b31'
}
},
min:0,
max:100,
splitNumber:10,
interval:(100-0)/10
}, {
name: '单位:万',
type: 'value',
axisLabel: {
show: true,
interval: 'right',//居中显示
},
splitLine:{
lineStyle: {
color:'#0a1b31'
}
},
min:min2,
max:max2,
splitNumber:10,
interval:(max2-min2)/10
},
]
//业务双y轴数据
proxy.seriesDataPerformance=[
proxy.ySeriesCommon=[
{
name:'可用性',
type: 'line',
... ... @@ -166,7 +149,105 @@ export default {
},
}
]
})
// let xAxisDataLength=proxy.ySeriesCommon[0].length;
let xAxisData=[];
for(let i=0;i<=24;i++){
if(i%4==0){
xAxisData.push(i+':00')
}
}
let legendData=[];
$.each(proxy.ySeriesCommon,function (i,v){
legendData.push(v.name)
})
proxy.legendData=legendData;
proxy.optionData = {
title: {
text: ''
},
tooltip: {
trigger: 'axis',
backgroundColor:'rgba(50,50,50,0.7)',
borderColor:"#333",
textStyle:{
color:"#fff",
align:'left'
}
},
legend: {
data: proxy.legendData,
itemHeight:0,//图例圆圈大小设置
y:'7px',
textStyle: {
color: '#ffffff',
fontsize:"12px"
}
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true,
},
xAxis: {
type: 'category',
boundaryGap: false,
data: xAxisData,
axisLine:{
show:false,//是否显示坐标线
},
axisTick: {
show: false //是否显示坐标刻度
},
axisLabel:{
color:'#ffffff',
},
},
yAxis:[
{
type: 'value',
axisLabel: {
formatter: '{value} %'//以百分比显示
},
splitLine:{
lineStyle: {
color:'#0a1b31'
}
},
min:0,
max:100,
splitNumber:10,
interval:(100-0)/10
}, {
name: '单位:万',
type: 'value',
axisLabel: {
show: true,
interval: 'right',//居中显示
},
splitLine:{
lineStyle: {
color:'#0a1b31'
}
},
min:min2,
max:max2,
splitNumber:10,
interval:(max2-min2)/10
},
],
series: proxy.ySeriesCommon,
itemStyle:{
showSymbol:false
}
};
}
//计算最大值
const calMax=(arr)=>{
let max=0;
... ... @@ -203,7 +284,9 @@ export default {
return{
calMax,
calMin
calMin,
getData,
optionInit
}
}
}
\ No newline at end of file
... ...