77 lines
1.5 KiB
Vue
77 lines
1.5 KiB
Vue
<template>
|
|
<view>
|
|
<view v-if="tableData.length != 0">
|
|
<view style="height: 250px">
|
|
<qiun-data-charts
|
|
:chartData="chartData.chartData"
|
|
:echartsApp="true"
|
|
:eopts="chartData.eopts"
|
|
/>
|
|
</view>
|
|
<view style="margin-top: 20px">
|
|
<Table :tableData="tableData" />
|
|
</view>
|
|
</view>
|
|
<view
|
|
style="
|
|
height: calc(100vh - 160px);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background-color: #fff;
|
|
margin-top: 10px;
|
|
"
|
|
v-else
|
|
>
|
|
<image src="../../../../static/empty.png" mode=""></image>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
<script>
|
|
import drpOptions from "./chartOptions.js";
|
|
import Table from "./jcsjTable.vue";
|
|
export default {
|
|
components: {
|
|
Table,
|
|
},
|
|
data() {
|
|
return {
|
|
show: false,
|
|
chartData: {},
|
|
tableData: [],
|
|
};
|
|
},
|
|
methods: {
|
|
async getKrData() {
|
|
uni.showLoading({
|
|
title: "加载中...",
|
|
mask: true,
|
|
});
|
|
try {
|
|
const { data } = await uni.$http.post("/gunshiApp/tsg/stZvarlB/list");
|
|
if (data.code == 200) {
|
|
this.tableData = [...data.data];
|
|
}
|
|
} catch (error) {
|
|
uni.$showMsg();
|
|
}
|
|
},
|
|
},
|
|
watch: {
|
|
tableData(n, o) {
|
|
if (n.length > 0) {
|
|
uni.hideLoading();
|
|
this.chartData = {
|
|
...drpOptions(n),
|
|
};
|
|
this.show = true;
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
this.getKrData();
|
|
},
|
|
};
|
|
</script>
|
|
<style lang="scss">
|
|
</style> |