修改图表数据展示

修改选择icon 后点击其他选择框弹出异常
master
夜笙歌 2 years ago
parent 3dde34def2
commit 480f4ff460

@ -48,28 +48,6 @@
>{{ t('option.add') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['test:test:edit']"
:disabled="single"
icon="Edit"
plain
type="success"
@click="handleUpdate"
>{{ t('option.edit') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['test:test:remove']"
:disabled="multiple"
icon="Delete"
plain
type="danger"
@click="handleDelete"
>{{ t('option.remove') }}
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
v-hasPermi="['test:test:export']"
@ -129,25 +107,6 @@
width="150"/>
<el-table-column label="终端主电源掉电" align="center" prop="mainpowerloss"
width="150"/>
<el-table-column :label="t('option.option')" align="center" class-name="small-padding fixed-width" fixed="right"
width="160">
<template #default="scope">
<el-button
v-hasPermi="['test:test:edit']"
icon="Edit"
type="text"
@click="handleUpdate(scope.row)"
>{{ t('option.edit') }}
</el-button>
<el-button
v-hasPermi="['test:test:remove']"
icon="Delete"
type="text"
@click="handleDelete(scope.row)"
>{{ t('option.remove') }}
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页-->

@ -7,9 +7,11 @@ import * as echarts from 'echarts';
// require('echarts/theme/macarons') // echarts theme
const echart = inject('echart')
import resize from './mixins/resize'
import {toRefs} from "vue";
export default {
mixins: [resize],
expose: ['setData'],
props: {
className: {
type: String,
@ -26,7 +28,13 @@ export default {
},
data() {
return {
chart: null
chart: null,
chartData:[
{value: 320, name: '低压报警'},
{value: 149, name: '高温报警'},
{value: 100, name: '位置报警'},
{value: 59, name: '电池电量报警'}
]
}
},
mounted() {
@ -42,6 +50,10 @@ export default {
this.chart = null
},
methods: {
setData(e) {
console.log(e)
this.initChart()
},
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
@ -62,12 +74,7 @@ export default {
roseType: 'radius',
radius: [15, 95],
center: ['50%', '38%'],
data: [
{ value: 320, name: '低压报警' },
{ value: 149, name: '高温报警' },
{ value: 100, name: '位置报警' },
{ value: 59, name: '电池电量报警' }
],
data: this.chartData,
animationEasing: 'cubicInOut',
animationDuration: 2600
}

@ -186,8 +186,6 @@ export default defineComponent({
X.forEach(res => {
Y1.push(e.SpeedList.find(v => v.time === res)?.speed || 0)
})
console.log(X)
console.log(Y1)
option.value.xAxis.data = X
option.value.series[0].data = Y1
option.value.series[1].data = Y2

@ -42,7 +42,7 @@
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
<div class="chart-wrapper">
<pie-chart />
<pie-chart ref="pieRef"/>
</div>
</el-col>
<el-col :xs="24" :sm="24" :lg="8">
@ -71,6 +71,7 @@
const showSearch = ref(true);
const dateRange = ref([]);
const tempRef = ref();
const pieRef = ref();
//
const queryParams = ref({
@ -96,6 +97,7 @@
function handleQuery() {
getTempdata(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
tempRef.value.setData(response.data);
pieRef.value.setData(response.data);
}).finally(() => {
//loading.value = false;
});

@ -119,7 +119,7 @@
@show="showSelectIcon"
>
<template #reference>
<el-input v-model="form.icon" placeholder="点击选择图标" @blur="showSelectIcon" v-click-outside="hideSelectIcon" readonly>
<el-input ref="iconRef" v-model="form.icon" placeholder="点击选择图标" @input="showSelectIcon" v-click-outside="hideSelectIcon" readonly>
<template #prefix>
<svg-icon
v-if="form.icon"
@ -297,6 +297,7 @@ const isExpandAll = ref(false);
const refreshTable = ref(true);
const showChooseIcon = ref(false);
const iconSelectRef = ref(null);
const iconRef = ref()
const data = reactive({
form: {},
@ -353,6 +354,7 @@ function reset() {
}
/** 展示下拉图标 */
function showSelectIcon() {
console.log('blue')
iconSelectRef.value.reset();
showChooseIcon.value = true;
}

Loading…
Cancel
Save