liyongli 2 ani în urmă
părinte
comite
7f4ae60180

+ 5 - 1
.gitignore

@@ -1,3 +1,7 @@
 node_modules
 dist
-yarn-error.log
+yarn-error.log
+
+.env.development
+.env.production
+.env.local

+ 2 - 2
package.json

@@ -3,8 +3,8 @@
   "version": "0.0.0",
   "description": "",
   "scripts": {
-    "dev": "vite",
-    "build": "vite build",
+    "dev": "vite --mode development",
+    "build": "vite build --mode production",
     "serve": "vite preview"
   },
   "license": "MIT",

+ 2 - 1
src/assets/style/BigScreenHome.css

@@ -209,7 +209,8 @@
 }
 
 .home .TabBtn {
-  flex: 1;
+  display: inline-block;
+  width: 6em;
   padding: 5px 0 5px 5px;
   white-space: nowrap;
   /* display: inline-block;

+ 16 - 15
src/assets/style/CommonBigScreenHome.css

@@ -1,5 +1,5 @@
 .home {
-  background-image: url("/src/assets/img/bg@3x.jpg");
+  background-image: url('/src/assets/img/bg@3x.jpg');
   background-size: 100% 100%;
   width: 100%;
   height: 100%;
@@ -57,7 +57,7 @@
   font-size: 18pt;
   color: #ff9900;
   font-weight: 600;
-  font-family: "微软雅黑";
+  font-family: '微软雅黑';
 }
 
 .icons {
@@ -114,7 +114,7 @@
   font-size: 17px;
 }
 .livRang .head::before {
-  content: " ";
+  content: ' ';
   float: left;
   display: block;
   margin-left: -10px;
@@ -208,7 +208,8 @@
 }
 
 .home .TabBtn {
-    flex: 1;
+  display: inline-block;
+  width: 6em;
   padding: 5px 0 5px 5px;
   white-space: nowrap;
   /* display: inline-block;
@@ -226,20 +227,20 @@
 }
 
 .tabIcon {
-    width: 100%;
-    vertical-align: middle;
-    margin-right: 3px;
+  width: 100%;
+  vertical-align: middle;
+  margin-right: 3px;
 }
 
-.newMdia{
-    width: 100%;
+.newMdia {
+  width: 100%;
 }
 
 .btn {
-    float: right;
-    background-color: #1a62eb;
-    border-radius: 5px;
-    padding: 3px 5px;
-    cursor: pointer;
-    font-weight: 500;
+  float: right;
+  background-color: #1a62eb;
+  border-radius: 5px;
+  padding: 3px 5px;
+  cursor: pointer;
+  font-weight: 500;
 }

+ 3 - 6
src/base/config.js

@@ -1,8 +1,5 @@
 export default {
-  gaodeToken: "8584ad854bd9ff5135f64529a44da7ed",
-//   baseUrl: "https://restapi.amap.com/v3/",
-  baseUrl: "http://172.16.101.20:8762/v3/",
-  localBaseUrl: "https://big-screen.sxtvs.net",
-//   localBaseUrl: "http://172.16.101.20:8762",
-  webToke: "2165bf5621d55140e00ba9abf9fb5c45"
+  gaodeToken: import.meta.env.VITE_WEB_GAODE_TOKEN  || "",
+  localBaseUrl: import.meta.env.VITE_DATA_BASE_URL  || "",
+  webToke: import.meta.env.VITE_WEB_TOKEN  || ""
 };

+ 4 - 4
src/pages/CommonBigScreen/Home.jsx

@@ -60,7 +60,7 @@ function BigScreenHome() {
             setoriData(d || {})
             setHeadTitle([
                 {
-                    title: "传统媒体-覆盖终端",
+                    title: "覆盖终端",
                     value: d.media_overview.data.totalUser,
                     path: [
                         {
@@ -70,7 +70,7 @@ function BigScreenHome() {
                     ]
                 },
                 {
-                    title: "传统媒体-日活跃用户",
+                    title: "日活跃用户",
                     value: d.media_overview.data.activeUser,
                     path: [
                         {
@@ -104,7 +104,7 @@ function BigScreenHome() {
                     ]
                 },
                 {
-                    title: "传统媒体-日收视次数",
+                    title: "日收视次数",
                     value: d.media_overview.data.watchCount,
                     path: [
                         {
@@ -114,7 +114,7 @@ function BigScreenHome() {
                     ]
                 },
                 {
-                    title: "传统媒体-昨日收视时长",
+                    title: "昨日收视时长",
                     value: (d.media_overview.data.timeCount / 60).toFixed(0),
                     path: [
                         {

+ 1 - 1
src/pages/CommonBigScreen/components/Column_g2.jsx

@@ -149,7 +149,7 @@ function Column(prop) {
                 .annotation()
                 .text({
                     position: [item.type, item.value],
-                    content: item.value,
+                    content: item.value + '%',
                     style: {
                         textAlign: 'center',
                         fill: "#fff"

+ 16 - 4
src/pages/CommonBigScreen/components/ListeningRate_g2.jsx

@@ -1,5 +1,5 @@
 import { onMount } from "solid-js";
-import { Chart,registerShape } from '@antv/g2';
+import { Chart, registerShape } from '@antv/g2';
 // import DataSet from '@antv/data-set';
 
 import "../../../assets/style/CommonBigScreenHome.css"
@@ -26,9 +26,9 @@ registerShape('point', 'circular', {
         const width = cfg.size;
         return [
             { x: x - width / 2, y },
-            { x, y: y + width*2 },
+            { x, y: y + width * 2 },
             { x: x + width / 2, y },
-            { x, y: y - width*2 },
+            { x, y: y - width * 2 },
         ];
     },
     // 2. 绘制
@@ -111,6 +111,18 @@ function ListeningRate(prop) {
                     },
                     offsetX: 30,
                 });
+
+            chart
+                .annotation()
+                .text({
+                    position: [item.type, item.value],
+                    content: item.value + '%',
+                    style: {
+                        textAlign: 'center',
+                        fill: '#fff',
+                    },
+                    offsetX: -30,
+                });
         });
         index = 0;
         chart.point().position('type*value').shape('circular');
@@ -121,7 +133,7 @@ function ListeningRate(prop) {
     })
     return (
         <div class="livRang" style={{
-            height:`${prop.height}px`
+            height: `${prop.height}px`
         }}>
             <div class="head">{prop.title}</div>
             <div ref={$canvas}></div>

+ 4 - 4
src/pages/bigScreen/Home.jsx

@@ -60,7 +60,7 @@ function BigScreenHome() {
             setoriData(d || {})
             setHeadTitle([
                 {
-                    title: "传统媒体-覆盖终端",
+                    title: "覆盖终端",
                     value: d.media_overview.data.totalUser,
                     path: [
                         {
@@ -70,7 +70,7 @@ function BigScreenHome() {
                     ]
                 },
                 {
-                    title: "传统媒体-日活跃用户",
+                    title: "日活跃用户",
                     value: d.media_overview.data.activeUser,
                     path: [
                         {
@@ -104,7 +104,7 @@ function BigScreenHome() {
                     ]
                 },
                 {
-                    title: "传统媒体-日收视次数",
+                    title: "日收视次数",
                     value: d.media_overview.data.watchCount,
                     path: [
                         {
@@ -114,7 +114,7 @@ function BigScreenHome() {
                     ]
                 },
                 {
-                    title: "传统媒体-昨日收视时长",
+                    title: "昨日收视时长",
                     value: (d.media_overview.data.timeCount / 60).toFixed(0),
                     path: [
                         {

+ 1 - 1
src/pages/bigScreen/components/Column_g2.jsx

@@ -149,7 +149,7 @@ function Column(prop) {
                 .annotation()
                 .text({
                     position: [item.type, item.value],
-                    content: item.value,
+                    content: item.value + '%',
                     style: {
                         textAlign: 'center',
                         fill: "#fff"

+ 15 - 4
src/pages/bigScreen/components/ListeningRate_g2.jsx

@@ -1,5 +1,5 @@
 import { onMount } from "solid-js";
-import { Chart,registerShape } from '@antv/g2';
+import { Chart, registerShape } from '@antv/g2';
 // import DataSet from '@antv/data-set';
 
 import "../../../assets/style/BigScreenHome.css"
@@ -26,9 +26,9 @@ registerShape('point', 'circular', {
         const width = cfg.size;
         return [
             { x: x - width / 2, y },
-            { x, y: y + width*2 },
+            { x, y: y + width * 2 },
             { x: x + width / 2, y },
-            { x, y: y - width*2 },
+            { x, y: y - width * 2 },
         ];
     },
     // 2. 绘制
@@ -111,6 +111,17 @@ function ListeningRate(prop) {
                     },
                     offsetX: 30,
                 });
+            chart
+                .annotation()
+                .text({
+                    position: [item.type, item.value],
+                    content: item.value + '%',
+                    style: {
+                        textAlign: 'center',
+                        fill: '#fff',
+                    },
+                    offsetX: -30,
+                });
         });
         index = 0;
         chart.point().position('type*value').shape('circular');
@@ -121,7 +132,7 @@ function ListeningRate(prop) {
     })
     return (
         <div class="livRang" style={{
-            height:`${prop.height}px`
+            height: `${prop.height}px`
         }}>
             <div class="head">{prop.title}</div>
             <div ref={$canvas}></div>