data is virtual complete

This commit is contained in:
winter_born
2026-04-15 14:56:21 +08:00
parent f210bcc168
commit 55f0be6eb8

View File

@@ -1,50 +1,83 @@
<template> <template>
<view> <view>
<view id="chart" style="width: 100%; height: 400px;"></view>
<view id="pie" style="width: 100%; height: 400px;"></view>
<view id="category" style="width: 100%; height: 400px;"></view>
</view> </view>
</template> </template>
<script> <script>
import * as echarts from "../../js_sdk/u-charts/echarts.min.js"
export default { export default {
data() { data() {
return { return {
chart: null,
category: null,
pie: null
} }
}, },
methods: { mounted() {
async requests(gest,path){ this.$nextTick(() => {
let test this.chart = echarts.init(document.getElementById('chart'))
if(gest=="get"){ this.chart.setOption({
let text = await fetch(`http://124.93.196.45:10091/Neusoft/times-model${path}`,{ color: ['#614321', '#456124'],
method:"GET", xAxis: {
headers:{ data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
"Content-Type":"application/json", },
"Authorization":(await this.requests("POST","/app/login")) yAxis: {},
} series: [{
type: 'bar',
data: [23, 24, 18, 25, 27, 100, 25]
}, {
type: 'bar',
data: [23, 24, 18, 25, 27, 42, 25]
}]
}) })
}else if(gest="POST"){ })
let text = await fetch(`http://124.93.196.45:10091/Neusoft/times-model${path}`,{ this.$nextTick(() => {
method:"GET", this.pie = echarts.init(document.getElementById("pie"))
headers:{ this.pie.setOption({
"Content-Type":"application/json", series: [{
type: "pie",
data: [{
value: 10,
name: "10%"
}, {
value: 20,
name: "20%"
}, {
value: 25,
name: "25%"
}, {
value: 10,
name: "10%"
}, {
value: 15,
name: "15%"
}, {
value: 20,
name: "20%"
}]
}]
})
})
this.$nextTick(() => {
this.category = echarts.init(document.getElementById("category"))
this.category.setOption({
xAxis: {
data: [30, 20, 31, 41, 73, 42, 25]
}, },
body:JSON.stringify({ yAxis: {},
"password": "0CYdq6Hn", series: [{
"username": "6dOMIgIU" type: "line",
data: [23, 24, 18, 25, 27, 42, 25]
}, {
type: "line",
data: [32, 24, 42, 25, 72, 42, 25]
}]
}) })
}) })
} }
const data = await text
console.log(data);
}
},
async mounted(){
let get=[]
}
} }
</script> </script>
<style>
</style>