From eaa6e8cc48e53d2d3a5fb3cf4e2a01160f6e75c7 Mon Sep 17 00:00:00 2001
From: 龚焕茏 <2842157468@qq.com>
Date: 星期三, 20 三月 2024 11:30:10 +0800
Subject: [PATCH] 数据管理中心

---
 src/main.js |   48 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 47 insertions(+), 1 deletions(-)

diff --git a/src/main.js b/src/main.js
index a8d407c..7944e09 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,7 +1,7 @@
 import Vue from 'vue'
 
 import Cookies from 'js-cookie'
-import {getToken} from "@/utils/auth";
+import { getToken } from "@/utils/auth";
 import Element from 'element-ui'
 import './assets/styles/element-variables.scss'
 
@@ -38,6 +38,15 @@
 // 瀛楀吀鏁版嵁缁勪欢
 import DictData from '@/components/DictData'
 
+// 澶у睆
+import VScaleScreen from 'v-scale-screen'
+import dataV from '@jiaminghi/data-view'
+
+import gsap from 'gsap';
+import { formatNumber } from './utils/format';
+
+
+
 // 鍏ㄥ眬鏂规硶鎸傝浇
 Vue.prototype.getDicts = getDicts
 Vue.prototype.getConfigKey = getConfigKey
@@ -62,6 +71,8 @@
 Vue.use(directive)
 Vue.use(plugins)
 Vue.use(VueMeta)
+Vue.use(VScaleScreen)
+Vue.use(dataV)
 DictData.install()
 
 /**
@@ -79,6 +90,41 @@
 
 Vue.config.productionTip = true
 
+
+// 鍏ㄥ眬鎸囦护
+Vue.directive('roll', {
+  inserted: (el, binding) => {
+    let target = {
+      count: 0
+    };
+    let finalNumber = el.innerText;
+    gsap.to(target, {
+      count: finalNumber,
+      duration: 1,
+      ease: "power2.out",
+      onUpdate: () => {
+        el.innerText = formatNumber(target.count.toFixed(0));
+      }
+    })
+
+  },
+  update: (el, binding) => {
+    let target = {
+      count: el.innerText
+    };
+    let finalNumber = el.getAttribute('value');
+    gsap.to(target, {
+      count: finalNumber,
+      duration: 1,
+      ease: "power2.out",
+      onUpdate: () => {
+        el.innerText = formatNumber(target.count.toFixed(0));
+      }
+    })
+  }
+})
+
+
 new Vue({
   el: '#app',
   router,

--
Gitblit v1.8.0