|
@@ -8,7 +8,7 @@
|
|
|
<!-- 插入下拉多选框或者日期选择框 -->
|
|
|
<slot></slot>
|
|
|
</div>
|
|
|
- <div class="echarts-radio">
|
|
|
+ <div class="echarts-radio" v-if="isXFTJTab1 === 'yes'">
|
|
|
<el-form ref="formRef" :model="formData" label-width="80px">
|
|
|
<div class="flexBox">
|
|
|
<el-form-item label="检查年度" label-width="70px">
|
|
@@ -24,7 +24,7 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="问题名称">
|
|
|
- <el-select size="mini" v-model="formData.formSelect2" @change="change2(formData.formSelect2)" >
|
|
|
+ <el-select size="mini" v-model="formData.formSelect2" @change="change2(formData.formSelect2)">
|
|
|
<el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
@@ -37,7 +37,10 @@
|
|
|
<el-radio @change="changRadio(item)" v-model="radio" :label="item.prop" v-for="item in radioLabel" :key="item.prop">{{ item.label }}</el-radio>
|
|
|
</div> -->
|
|
|
</div>
|
|
|
- <div :id="echartsId" style="width: 750px; height: 400px" ref="charts"></div>
|
|
|
+ <div class="echarts-radio" v-if="isPie || isXFTJTab1 === 'no'">
|
|
|
+ <el-radio @change="changRadio(item)" v-model="radio" :label="item.prop" v-for="item in radioLabel" :key="item.prop">{{ item.label }}</el-radio>
|
|
|
+ </div>
|
|
|
+ <div :id="echartsId" style="width: 900px; height: 400px" ref="charts"></div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -93,6 +96,16 @@ export default {
|
|
|
isTwoBar: {
|
|
|
type: String,
|
|
|
default: 'no'
|
|
|
+ },
|
|
|
+ // 是否时消防统计的第二大页
|
|
|
+ isXFTJTab1: {
|
|
|
+ type: String,
|
|
|
+ default: 'no'
|
|
|
+ },
|
|
|
+ // 用来判断改变第二大页的小柱的名字
|
|
|
+ isTabs1: {
|
|
|
+ type: String,
|
|
|
+ default: 'no'
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
@@ -128,8 +141,8 @@ export default {
|
|
|
tjwd: '',
|
|
|
// 绑定选择日期范围
|
|
|
yearChoose: '',
|
|
|
- radio: 'total',
|
|
|
- filterc:'data1',
|
|
|
+ radio: 'data1',
|
|
|
+ filterc: 'data1',
|
|
|
newKeys: [],
|
|
|
newTableList: [],
|
|
|
newUnit: '',
|
|
@@ -154,23 +167,23 @@ export default {
|
|
|
// }
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 单选框改变事件
|
|
|
+ changRadio(item) {
|
|
|
+ this.$emit('change-radio', this.radio)
|
|
|
+ this.setTable(this.xStr, 'total', this.radio, 'data2', 'data3')
|
|
|
+ this.echartsInit(this.echartsId, this.type, this.newUnit, this.x, this.y, this.isX, this.isY)
|
|
|
+ },
|
|
|
// 改变多选框数据格式
|
|
|
- change1(value)
|
|
|
- {
|
|
|
- this.$emit('changeData', value);
|
|
|
-
|
|
|
+ change1(value) {
|
|
|
+ this.$emit('changeData', value)
|
|
|
},
|
|
|
- change2(value)
|
|
|
- {
|
|
|
+ change2(value) {
|
|
|
//alert(value);
|
|
|
- this.filterc=value;
|
|
|
-
|
|
|
+ this.filterc = value
|
|
|
|
|
|
- this.setTable(this.xStr, this.radio,this.filterc)
|
|
|
+ this.setTable(this.xStr, 'total', this.filterc)
|
|
|
|
|
|
this.echartsInit(this.echartsId, this.type, this.newUnit, this.x, this.y, this.isX, this.isY)
|
|
|
-
|
|
|
-
|
|
|
},
|
|
|
changeSelectSJGS() {
|
|
|
let options = []
|
|
@@ -179,7 +192,7 @@ export default {
|
|
|
return true
|
|
|
})
|
|
|
array.forEach((item, index) => {
|
|
|
- if (index==0) this.formData.formSelect2 =item.prop;
|
|
|
+ if (index == 0) this.formData.formSelect2 = item.prop
|
|
|
let obj = {
|
|
|
label: '',
|
|
|
value: ''
|
|
@@ -188,7 +201,7 @@ export default {
|
|
|
obj.value = item.prop
|
|
|
options.push(obj)
|
|
|
})
|
|
|
- this.formData.formSelect1 ='01';
|
|
|
+ this.formData.formSelect1 = '01'
|
|
|
this.options2 = options
|
|
|
},
|
|
|
startTime() {},
|
|
@@ -239,29 +252,32 @@ export default {
|
|
|
// console.log(this.radioLabel)
|
|
|
// },
|
|
|
// 改变table中X轴的数据的数据格式 参数是 x轴对应的数据名字,y轴对应的数据名字
|
|
|
- setTable(xAxis,yAxis1, yAxis2) {
|
|
|
+ setTable(xAxis, yAxis1, yAxis2, yAxis3, yAxis4) {
|
|
|
// x轴
|
|
|
let arrX = []
|
|
|
let arrY = []
|
|
|
let arrYa = []
|
|
|
let arrYb = []
|
|
|
+ // 大页2中的小柱
|
|
|
+ // let arrYc = []
|
|
|
this.newTableList.forEach((item) => {
|
|
|
arrX.push(item[xAxis])
|
|
|
arrYa.push(item[yAxis1])
|
|
|
arrYb.push(item[yAxis2])
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- arrY[0]={};
|
|
|
- arrY[0].label='已检查机构总数';
|
|
|
- arrY[0].data=arrYa;
|
|
|
+ // arrYc.push(item[yAxis3] + ',' + item[yAxis4])
|
|
|
+ })
|
|
|
+ console.log(arrYb)
|
|
|
+ arrY[0] = {}
|
|
|
+ arrY[0].label = '已检查机构总数'
|
|
|
+ arrY[0].data = arrYa
|
|
|
|
|
|
- arrY[1]={};
|
|
|
- if (this.formData.formSelect1=='01')
|
|
|
- arrY[1].label=this.options1[0].label;
|
|
|
- else
|
|
|
- arrY[1].label=this.options1[1].label;
|
|
|
- arrY[1].data=arrYb;
|
|
|
+ arrY[1] = {}
|
|
|
+ if (this.formData.formSelect1 == '01') arrY[1].label = this.options1[0].label
|
|
|
+ else arrY[1].label = this.options1[1].label
|
|
|
+ arrY[1].data = arrYb
|
|
|
+ // if (this.isTabs1 === 'yes') {
|
|
|
+ // arrY[1].data = arrYc
|
|
|
+ // }
|
|
|
this.x = arrX
|
|
|
this.y = arrY
|
|
|
if (this.isfftj === true) {
|
|
@@ -283,7 +299,7 @@ export default {
|
|
|
rich: {
|
|
|
name: {}
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
// 是否显示xy轴
|
|
|
let isShow = true
|
|
|
let yAxis = yData
|
|
@@ -294,21 +310,17 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-
|
|
|
var myChart = this.$echarts.init(document.getElementById(id))
|
|
|
var option = {
|
|
|
// color: ['#288DEF'],
|
|
|
- title: {
|
|
|
- },
|
|
|
+ title: {},
|
|
|
tooltip: {
|
|
|
trigger: 'axis',
|
|
|
axisPointer: {
|
|
|
type: 'shadow'
|
|
|
}
|
|
|
},
|
|
|
- legend: {
|
|
|
-
|
|
|
- },
|
|
|
+ legend: {},
|
|
|
xAxis: {
|
|
|
type: isX,
|
|
|
show: isShow,
|
|
@@ -333,26 +345,27 @@ export default {
|
|
|
color: '#000',
|
|
|
nameLocation: 'start'
|
|
|
},
|
|
|
- data: xAxis
|
|
|
+ data: xAxis,
|
|
|
+ axisLabel: {}
|
|
|
},
|
|
|
series: [
|
|
|
{
|
|
|
- type: "bar",
|
|
|
+ type: 'bar',
|
|
|
data: yAxis[0].data,
|
|
|
radius: ['35%', '65%'],
|
|
|
hoverAnimation: true,
|
|
|
avoidLabelOverlap: false,
|
|
|
- name:yAxis[0].label,
|
|
|
- label:labelOption
|
|
|
+ name: yAxis[0].label,
|
|
|
+ label: labelOption
|
|
|
},
|
|
|
{
|
|
|
- type: "bar",
|
|
|
+ type: 'bar',
|
|
|
data: yAxis[1].data,
|
|
|
radius: ['35%', '65%'],
|
|
|
hoverAnimation: true,
|
|
|
avoidLabelOverlap: false,
|
|
|
- name:yAxis[1].label,
|
|
|
- label:labelOption
|
|
|
+ name: yAxis[1].label,
|
|
|
+ label: labelOption
|
|
|
}
|
|
|
]
|
|
|
}
|
|
@@ -369,11 +382,11 @@ export default {
|
|
|
labelKeys(newVal) {
|
|
|
this.newKeys = newVal
|
|
|
this.changeSelectSJGS()
|
|
|
-
|
|
|
},
|
|
|
tableList(newVal) {
|
|
|
this.newTableList = newVal
|
|
|
- this.setTable(this.xStr, this.radio,this.filterc)
|
|
|
+ console.log(this.newTableList)
|
|
|
+ this.setTable(this.xStr, 'total', this.filterc, 'data2', 'data3')
|
|
|
this.echartsInit(this.echartsId, this.type, this.newUnit, this.x, this.y, this.isX, this.isY)
|
|
|
}
|
|
|
}
|