Browse Source

工作台图片

Hongxilin
hongxilin 6 months ago
parent
commit
e6124852be
  1. 181
      vue/gold-system/src/views/workspace/index.vue

181
vue/gold-system/src/views/workspace/index.vue

@ -1,4 +1,5 @@
<script setup> <script setup>
import { all } from 'axios';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { ref, onMounted, reactive, computed } from "vue"; import { ref, onMounted, reactive, computed } from "vue";
import { VscInfo } from 'vue-icons-plus/vsc' import { VscInfo } from 'vue-icons-plus/vsc'
@ -8,9 +9,35 @@ const activeName = ref('recharge')
const platform = ref('all') const platform = ref('all')
onMounted(function () { onMounted(function () {
// domecharts
var myChart = echarts.init(document.getElementById('main'));
// domecharts
var rechargeBar = echarts.init(document.getElementById('recharge'));
//
var option = {
title: {
text: 'ECharts 入门示例'
},
tooltip: {},
legend: {
data: ['销量']
},
xAxis: {
data: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子']
},
yAxis: {},
series: [
{
name: '销量',
type: 'bar',
data: [5, 20, 36, 10, 10, 20]
}
]
};
// 使
rechargeBar.setOption(option);
// domecharts
var consumeBar = echarts.init(document.getElementById('consume'));
// //
var option = { var option = {
title: { title: {
@ -32,11 +59,55 @@ onMounted(function () {
} }
] ]
}; };
// 使
consumeBar.setOption(option);
// domecharts
var yearRechargePie = echarts.init(document.getElementById('yearRecharge'));
var option = {
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
}
]
};
// 使 // 使
myChart.setOption(option);
yearRechargePie.setOption(option);
option = {
// domecharts
var yearConsumePie = echarts.init(document.getElementById('yearConsume'));
var option = {
tooltip: { tooltip: {
trigger: 'item' trigger: 'item'
}, },
@ -74,6 +145,94 @@ onMounted(function () {
} }
] ]
}; };
// 使
yearConsumePie.setOption(option);
// domecharts
var nowGoldPie = echarts.init(document.getElementById('nowGold'));
var option = {
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
}
]
};
// 使
nowGoldPie.setOption(option);
// domecharts
var goldCategoryPie = echarts.init(document.getElementById('goldCategory'));
var option = {
tooltip: {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
}
]
};
// 使
goldCategoryPie.setOption(option);
}) })
@ -123,7 +282,7 @@ onMounted(function () {
<div id="recharge" style="width: 600px;height:400px;"></div> <div id="recharge" style="width: 600px;height:400px;"></div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="金币消费" name="consume"> <el-tab-pane label="金币消费" name="consume">
<div>金币消费</div>
<div id="consume" style="width: 600px;height:400px;"></div>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -138,7 +297,11 @@ onMounted(function () {
<span>金币概览</span> <span>金币概览</span>
</div> </div>
</template> </template>
<p v-for="o in 4" :key="o" class="text item">{{ 'List item ' + o }}</p>
<div class="pie">
<div id="yearRecharge" style="width: 600px;height:400px;"></div>
<div id="yearConsume" style="width: 600px;height:400px;"></div>
<div id="nowGold" style="width: 600px;height:400px;"></div>
</div>
</el-card> </el-card>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -154,13 +317,17 @@ onMounted(function () {
</el-radio-group> </el-radio-group>
</div> </div>
</template> </template>
<div>表格</div>
<div id="goldCategory" style="width: 600px;height:400px;"></div>
</el-card> </el-card>
</el-col> </el-col>
</el-row> </el-row>
</template> </template>
<style scoped> <style scoped>
.pie{
display: flex;
}
.el-row { .el-row {
margin-bottom: 20px; margin-bottom: 20px;
} }

Loading…
Cancel
Save