From 3c75ba788897a524771bfde12feddcc94aaf14c6 Mon Sep 17 00:00:00 2001
From: huanghongfeng <huanghongfeng@hnkhzn.com>
Date: 星期二, 22 四月 2025 11:26:02 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiXinLaiRui/LunDuiYa
---
项目代码/WMS/WIDESEA_WMSClient/src/views/charts/chart.vue | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 101 insertions(+), 0 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/charts/chart.vue" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/charts/chart.vue"
new file mode 100644
index 0000000..3b0695a
--- /dev/null
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/views/charts/chart.vue"
@@ -0,0 +1,101 @@
+<template>
+ <div class="m-charts">
+ <el-tabs
+ v-model="name"
+ @tab-click="tabClick"
+ type="border-card"
+ style="height: 100%; width: 100%; box-shadow: none"
+ >
+ <el-tab-pane name="bar">
+ <template #label>
+ <span><i class="el-icon-date"></i> 鏌辩姸鍥� </span>
+ </template>
+ <div
+ :style="{ height: heigth + 'px', width: width + 'px' }"
+ id="bar-0001"
+ ></div>
+ </el-tab-pane>
+ <el-tab-pane name="pie" :lazy="false" label="娑堟伅涓績">
+ <template #label>
+ <span><i class="el-icon-date"></i> 楗肩姸鍥� </span>
+ </template>
+ <div
+ :style="{ height: heigth + 'px', width: width + 'px' }"
+ id="pie-0001"
+ ></div>
+ </el-tab-pane>
+ <el-tab-pane name="line" :lazy="false" label="瑙掕壊绠$悊">
+ <template #label>
+ <span><i class="el-icon-date"></i> 鎶樼嚎鍥� </span>
+ </template>
+ <div
+ :style="{ height: heigth + 'px', width: width + 'px' }"
+ id="line-0001"
+ ></div>
+ </el-tab-pane>
+ </el-tabs>
+ </div>
+</template>
+<script>
+let echarts = require("echarts");
+import options from "./chartOptions";
+let $bar;
+let $pie;
+let $line;
+export default {
+ mounted() {
+ $bar = echarts.init(document.getElementById("bar-0001"));
+ $bar.setOption(this.options.bar);
+ },
+ created() {
+ this.heigth = document.documentElement.clientHeight - 190;
+ this.width = document.documentElement.clientWidth - 240;
+ },
+ methods: {
+ tabClick(name) {
+ if (name.props.name == "pie") {
+ if (!$pie) {
+ $pie = echarts.init(document.getElementById("pie-0001"));
+ $pie.setOption(this.options.pie);
+
+ }
+ } else if (name.props.name == "line") {
+ if (!$line) {
+ $line = echarts.init(document.getElementById("line-0001"));
+ $line.setOption(this.options.line);
+
+ }
+ }
+ },
+ },
+ data() {
+ return {
+ name: "bar",
+ heigth: 450,
+ width: 1000,
+ options: options,
+ };
+ },
+};
+</script>
+<style lang="less" scoped>
+.m-charts {
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background: #f1f1f1;
+ margin: auto 0;
+ padding: 12px;
+ .m-tabs {
+ background: white;
+ }
+}
+.m-charts ::v-deep(.el-tabs__content) {
+ height: calc(100% - 45px);
+}
+.m-charts ::v-deep(.el-tab-pane) {
+ height: 100%;
+}
+</style>
\ No newline at end of file
--
Gitblit v1.9.3