Bladeren bron

代码暂存

zhangqi 1 jaar geleden
bovenliggende
commit
6bd694dce4
5 gewijzigde bestanden met toevoegingen van 777 en 90 verwijderingen
  1. 711 79
      package-lock.json
  2. 1 1
      package.json
  3. 2 0
      src/views/dataDashboard/index.vue
  4. 53 0
      src/views/dataDashboard/modules/test.vue
  5. 10 10
      vite.config.js

File diff suppressed because it is too large
+ 711 - 79
package-lock.json


+ 1 - 1
package.json

@@ -9,7 +9,7 @@
     "preview": "vite preview"
   },
   "dependencies": {
-    "@antv/g2": "^4.2.10",
+    "@antv/g2": "^5.1.14",
     "@antv/g2plot": "^2.4.31",
     "@wangeditor/editor": "^5.1.23",
     "@wangeditor/editor-for-vue": "^5.1.12",

+ 2 - 0
src/views/dataDashboard/index.vue

@@ -1,5 +1,6 @@
 <template>
   <div v-if="nowAccount.usertype == 0 || nowAccount.usertype == 1">
+    <test></test>
     <part1 class="radius"/>
     <part2 class="radius"/>
     <part3 class="radius"/>
@@ -41,6 +42,7 @@
 import { ref } from 'vue'
 import { useAuthStore } from '@/stores/modules/auth'
 import { storeToRefs } from 'pinia'
+import test from './modules/test.vue'
 
 import part1 from './modules/part_1.vue'
 import part2 from './modules/part_2.vue'

+ 53 - 0
src/views/dataDashboard/modules/test.vue

@@ -0,0 +1,53 @@
+<template>
+  <div class="y-container mt-10">
+    <div style="width: 100%;height:400px" id="cont"></div>
+  </div>
+  </template>
+  
+  <script setup>
+  import { Chart } from '@antv/g2';
+  import { ref,onMounted,defineProps,watch } from 'vue';
+  import Api from '@/api/api'
+  import utils from '@/utils/utils'
+  const data = [{"x":0.0,"y":0.0},{"x":0.05,"y":1265.0},{"x":0.1,"y":2668.0},{"x":0.15,"y":4063.0},{"x":0.18,"y":4894.0},{"x":0.2,"y":5450.0},{"x":0.22,"y":6000.0},{"x":0.25,"y":6810.0},{"x":0.28,"y":7630.0},{"x":0.3,"y":8160.0},{"x":0.32,"y":8960.0},{"x":0.35,"y":10150.0},{"x":0.4,"y":14650.0},{"x":0.45,"y":18720.0},{"x":0.5,"y":22310.0},{"x":0.55,"y":25420.0},{"x":0.6,"y":28090.0},{"x":0.65,"y":30350.0},{"x":0.7,"y":30960.0},{"x":0.75,"y":30960.0},{"x":0.8,"y":30960.0},{"x":0.85,"y":30960.0},{"x":0.9,"y":30960.0},{"x":0.95,"y":30960.0},{"x":1.0,"y":30960.0}]
+  const initColumn = ()=>{
+    const charts = new Chart({
+      container: 'cont',
+      autoFit: true,
+      options:{
+        type: 'interval', // 创建一个 Interval 标记
+        data: [
+          // 绑定数据
+          { genre: 'Sports', sold: 275 },
+          { genre: 'Strategy', sold: 115 },
+          { genre: 'Action', sold: 120 },
+          { genre: 'Shooter', sold: 350 },
+          { genre: 'Other', sold: 150 },
+        ],
+        encode: {
+          x: 'genre', // 编码 x 通道
+          y: 'sold', // 编码 y 通道
+        },
+      },
+      
+    });
+    console.log(charts)
+
+    // charts.interval().data(data).encode('x', 'year').encode('y', 'sales');
+
+    charts.render();
+  }
+  onMounted(()=>{
+    setTimeout(() => {
+      initColumn()
+    }, 1000);
+  })
+  </script>
+  <style scoped>
+  .flex{
+    display: flex;
+    align-items: center;
+    justify-content: space-between;
+  }
+  </style>
+  

+ 10 - 10
vite.config.js

@@ -11,23 +11,23 @@ export default defineConfig({
     }
   },
   //正式地址
-  define: {
-    'process.env': {
-      'BASE_API':"https://cucu.cnyunl.com:8079",
-      'BASE_WS':"wss://cucu.cnyunl.com:8079/" 
-    }
-  },
-  // 测试地址
   // define: {
   //   'process.env': {
-  //     'BASE_API':"http://61.164.207.46:8200",
-  //     'BASE_WS':"ws://61.164.207.46:8200/"
+  //     'BASE_API':"https://cucu.cnyunl.com:8079",
+  //     'BASE_WS':"wss://cucu.cnyunl.com:8079/" 
   //   }
   // },
+  // 测试地址
+  define: {
+    'process.env': {
+      'BASE_API':"http://61.164.207.46:8200",
+      'BASE_WS':"ws://61.164.207.46:8200/"
+    }
+  },
   server: {
     proxy: {
       "/api": {
-        target: "http://192.168.3.29:8080/",
+        target: "http://61.164.207.46:8200/",
         // target: "https://cucu.cnyunl.com:8079/",
         ws: true,
         changeOrigin: true,

Some files were not shown because too many files changed in this diff