From 5ed4e2d509abde9d903331912fbf0633ae48408b Mon Sep 17 00:00:00 2001
From: hongxilin <17663930442@163.com>
Date: Mon, 16 Dec 2024 17:51:22 +0800
Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E7=94=A8=E4=BA=86=E4=B8=AD=E6=96=87?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE=EF=BC=8C=E5=9C=A8=E5=85=85=E5=80=BC=E5=AE=A1?=
=?UTF-8?q?=E6=A0=B8=E4=BF=AE=E6=94=B9=E7=8A=B6=E6=80=81=E6=97=B6=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E4=BA=86rechargeId=EF=BC=8C=E4=BF=AE=E5=A4=8D?=
=?UTF-8?q?=E4=BA=86=E6=B4=BB=E5=8A=A8=E7=AE=A1=E7=90=86=E9=A1=B5=E5=88=86?=
=?UTF-8?q?=E9=A1=B5=E6=B2=A1=E6=B3=95=E7=82=B9=E5=87=BB=E7=9A=84=E9=97=AE?=
=?UTF-8?q?=E9=A2=98=EF=BC=8C=E6=B7=BB=E5=8A=A0=E4=BA=86=E5=B7=A5=E4=BD=9C?=
=?UTF-8?q?=E5=8F=B0=E9=97=A8=E5=BA=97=E6=8E=92=E5=90=8D=E9=80=9A=E8=BF=87?=
=?UTF-8?q?=E6=97=B6=E9=97=B4=E6=9F=A5=E8=AF=A2=E7=9A=84=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E3=80=82?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
vue/gold-system/src/main.ts | 9 +-
vue/gold-system/src/util/http.js | 2 +-
vue/gold-system/src/views/audit/rechargeAudit.vue | 1 +
.../src/views/managerecharge/activity.vue | 17 +-
vue/gold-system/src/views/workspace/index.vue | 306 ++++++++++++---------
5 files changed, 187 insertions(+), 148 deletions(-)
diff --git a/vue/gold-system/src/main.ts b/vue/gold-system/src/main.ts
index 68a9507..5f84645 100644
--- a/vue/gold-system/src/main.ts
+++ b/vue/gold-system/src/main.ts
@@ -2,6 +2,7 @@ import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import ElementPlus from 'element-plus'
+import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import './assets/css/common.css'; // 引入公共CSS文件
@@ -9,7 +10,9 @@ import './assets/css/common.css'; // 引入公共CSS文件
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
- app.component(key, component)
- }
+ app.component(key, component)
+}
-app.use(ElementPlus).use(router).mount('#app');
+app.use(ElementPlus, {
+ locale: zhCn,
+}).use(router).mount('#app');
diff --git a/vue/gold-system/src/util/http.js b/vue/gold-system/src/util/http.js
index e9aabc2..48e95c6 100644
--- a/vue/gold-system/src/util/http.js
+++ b/vue/gold-system/src/util/http.js
@@ -21,7 +21,7 @@ export default function (options) {
//status:HTTP状态码,例如200表示请求成功。
//data:服务器返回的数据。
// statusText:HTTP状态文本,例如"OK"表示请求成功。
- console.log(data);
+ // console.log(data);
if (status == 200) {
return data;
} else {
diff --git a/vue/gold-system/src/views/audit/rechargeAudit.vue b/vue/gold-system/src/views/audit/rechargeAudit.vue
index 18764bd..d9e1aac 100644
--- a/vue/gold-system/src/views/audit/rechargeAudit.vue
+++ b/vue/gold-system/src/views/audit/rechargeAudit.vue
@@ -295,6 +295,7 @@ const pass = function (row) {
passObj.value.adminId = admin.value.adminId;
passObj.value.auditId = row.auditId;
passObj.value.status = 1;
+ passObj.value.rechargeId=row.rechargeId;
console.log("通过对象", passObj.value);
};
diff --git a/vue/gold-system/src/views/managerecharge/activity.vue b/vue/gold-system/src/views/managerecharge/activity.vue
index ba46c6d..13d34dc 100644
--- a/vue/gold-system/src/views/managerecharge/activity.vue
+++ b/vue/gold-system/src/views/managerecharge/activity.vue
@@ -22,15 +22,9 @@ const getAdminData = async function () {
console.log("请求失败", error);
}
};
-getAdminData();
+
//变量
-// 用户对象假的
-const admin = ref({
- adminId: 1,
- name: "赵刚",
- area: "中国",
-});
//活动表格数据
const tableData = ref([]);
//分页总条目
@@ -122,8 +116,8 @@ const addActicity = function () {
console.log("Date", new Date());
//添加对象初始化操作
addObj.value = {};
- addObj.value.adminId = admin.value.adminId;
- addObj.value.adminName = admin.value.name;
+ addObj.value.adminId = adminData.value.adminId;
+ addObj.value.adminName = adminData.value.name;
addObj.value.freeGold = "0";
addObj.value.rechargeRatio = 0;
addObj.value.startTime = null;
@@ -278,6 +272,7 @@ const checkNumber = function () {
// 挂载
onMounted(async function () {
+ await getAdminData();
get();
});
@@ -381,12 +376,12 @@ onMounted(async function () {
共{{ total }}条,每页
-
+
条
+ :current-page="getObj.pageNum" @current-change="get">
跳至
页
diff --git a/vue/gold-system/src/views/workspace/index.vue b/vue/gold-system/src/views/workspace/index.vue
index cfb0fe3..f638b7c 100644
--- a/vue/gold-system/src/views/workspace/index.vue
+++ b/vue/gold-system/src/views/workspace/index.vue
@@ -5,6 +5,7 @@ import { VscInfo } from "vue-icons-plus/vsc";
import * as bs from "vue-icons-plus/bs";
import axios, { all } from "axios";
import API from "../../api/index";
+import moment from "moment";
// 变量
// 加载对象
@@ -15,6 +16,9 @@ const statistics = ref({});
const getYearConsumeCoin = ref({});
const getDayConsumeCoin = ref({});
+// 中间统计图搜索参数
+const searchTime = ref([]);
+
// 月份柱状图
// 充值
const payTotalRecharge = ref(0);
@@ -277,13 +281,13 @@ const get = async function () {
ERPData.value.forEach((item, index) =>
item == ""
? (ERPData.value[index] = {
- value: 0,
- name: "第" + (index + 1) + "学科" + 0,
- })
+ value: 0,
+ name: "第" + (index + 1) + "学科" + 0,
+ })
: (ERPData.value[index] = {
- value: item[0],
- name: "第" + (index + 1) + "学科" + item[0],
- })
+ value: item[0],
+ name: "第" + (index + 1) + "学科" + item[0],
+ })
);
console.log("ERPData", ERPData.value);
HCData.value = [
@@ -303,13 +307,13 @@ const get = async function () {
HCData.value.forEach((item, index) =>
item == ""
? (HCData.value[index] = {
- value: 0,
- name: "第" + (index + 1) + "学科" + 0,
- })
+ value: 0,
+ name: "第" + (index + 1) + "学科" + 0,
+ })
: (HCData.value[index] = {
- value: item[0],
- name: "第" + (index + 1) + "学科" + item[0],
- })
+ value: item[0],
+ name: "第" + (index + 1) + "学科" + item[0],
+ })
);
console.log("HCData", HCData.value);
LinkData.value = [
@@ -329,13 +333,13 @@ const get = async function () {
LinkData.value.forEach((item, index) =>
item == ""
? (LinkData.value[index] = {
- value: 0,
- name: "第" + (index + 1) + "学科" + 0,
- })
+ value: 0,
+ name: "第" + (index + 1) + "学科" + 0,
+ })
: (LinkData.value[index] = {
- value: item[0],
- name: "第" + (index + 1) + "学科" + item[0],
- })
+ value: item[0],
+ name: "第" + (index + 1) + "学科" + item[0],
+ })
);
console.log("LinkData", LinkData.value);
goldData.value = [
@@ -355,13 +359,13 @@ const get = async function () {
goldData.value.forEach((item, index) =>
item == ""
? (goldData.value[index] = {
- value: 0,
- name: "第" + (index + 1) + "学科" + 0,
- })
+ value: 0,
+ name: "第" + (index + 1) + "学科" + 0,
+ })
: (goldData.value[index] = {
- value: item[0],
- name: "第" + (index + 1) + "学科" + item[0],
- })
+ value: item[0],
+ name: "第" + (index + 1) + "学科" + item[0],
+ })
);
console.log("goldData", goldData.value);
allData.value = [
@@ -500,6 +504,105 @@ const handleChange = function () {
goldType.value = "全部类型";
getAreaRank();
};
+// 时间范围控制
+const disabledDate = function (date) {
+ const currentDate = new Date();
+ const startDate = new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1);
+ const endDate = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0);
+ if(date >= startDate && date <= endDate){
+ return false;
+ }
+ return true;
+}
+// 本日
+const today = function () {
+ const current = new Date();
+ const startDate = new Date(
+ current.getFullYear(),
+ current.getMonth(),
+ current.getDate()
+ );
+ const endDate = new Date(
+ current.getFullYear(),
+ current.getMonth(),
+ current.getDate() + 1
+ );
+ searchTime.value = [startDate, endDate];
+ search();
+ // console.log("searchTime", moment(searchTime.value[0]).format("YYYY-MM-DD") + "至" + moment(searchTime.value[1]).format("YYYY-MM-DD"))
+
+};
+// 本周
+const thisWeek= function () {
+ const current = new Date();
+ const startDate = new Date(
+ current.getFullYear(),
+ current.getMonth(),
+ current.getDate() - 6
+ );
+ const endDate = new Date(
+ current.getFullYear(),
+ current.getMonth(),
+ current.getDate() + 1
+ );
+ searchTime.value = [startDate, endDate];
+ search();
+ // console.log("searchTime", moment(searchTime.value[0]).format("YYYY-MM-DD") + "至" + moment(searchTime.value[1]).format("YYYY-MM-DD"))
+};
+// 本月
+const thisMonth = function () {
+ const current = new Date();
+ const startDate = new Date(
+ current.getFullYear(),
+ current.getMonth(),
+ 1
+ );
+ const endDate = new Date(
+ current.getFullYear(),
+ current.getMonth()+1,
+ 0
+ );
+ searchTime.value = [startDate, endDate];
+ search();
+ // console.log("searchTime", moment(searchTime.value[0]).format("YYYY-MM-DD") + "至" + moment(searchTime.value[1]).format("YYYY-MM-DD"))
+};
+// 本年
+const thisYear = function () {
+ const current = new Date();
+ const startDate = new Date(
+ current.getFullYear(),
+ 0,
+ 1
+ );
+ const endDate = new Date(
+ current.getFullYear()+1,
+ 0,
+ 0
+ );
+ searchTime.value = [startDate, endDate];
+ search();
+ // console.log("searchTime", moment(searchTime.value[0]).format("YYYY-MM-DD") + "至" + moment(searchTime.value[1]).format("YYYY-MM-DD"))
+};
+const allTime=function(){
+ searchTime.value=["",""];
+ search();
+}
+// 根据时间搜索
+const search=function(){
+ console.log("searchTime", moment(searchTime.value[0]).format("YYYY-MM-DD") + "至" + moment(searchTime.value[1]).format("YYYY-MM-DD"))
+ getAreaRankObj.value.searchStartTime = moment(searchTime.value[0]).format("YYYY-MM-DD");
+ getAreaRankObj.value.searchEndTime = moment(searchTime.value[1]).format("YYYY-MM-DD");
+ if(getAreaRankObj.value.searchStartTime=="Invalid date"){
+ delete getAreaRankObj.value.searchStartTime;
+ }
+ if(getAreaRankObj.value.searchEndTime=="Invalid date"){
+ delete getAreaRankObj.value.searchEndTime;
+ }
+ console.log("getAreaRankObj", getAreaRankObj.value);
+ getAreaRank();
+}
+
+
// 切换平台
const changePlatform = function () {
console.log("changePlatform", platform.value);
@@ -906,37 +1009,26 @@ onMounted(async function () {
较前一天 {{ formatNum(getSumCoin.coinDifference) }}
-
+
较前一天 {{ formatNum(getSumCoin.coinDifference) }}
-
+
较前一天 {{ formatNum(getSumCoin.coinDifference) }}
-
+
- 充值{{ formatNum(getSumCoin.todayRecharge) }} 免费{{
- formatNum(getSumCoin.todayFree)
- }}
- 任务{{ formatNum(getSumCoin.todayTask) }}
+ 充值{{ formatNum(getSumCoin.todayRecharge) }} 免费{{
+ formatNum(getSumCoin.todayFree)
+ }}
+ 任务{{ formatNum(getSumCoin.todayTask) }}
@@ -948,8 +1040,7 @@ onMounted(async function () {
折合新币累计金额 {{ formatNum(Math.abs(statistics.totalSumCoin)) }}
- 昨日新增
+ 昨日新增
{{ formatNum(Math.abs(statistics.totalYesterdaySumCoin)) }}
,其中充值
{{ formatNum(Math.abs(statistics.rechargeYesterdaySumCoin)) }}
@@ -966,12 +1057,10 @@ onMounted(async function () {
消费 {{ formatNum(Math.abs(getYearConsumeCoin.yearConsumeCoin)) }};
退款 {{ formatNum(Math.abs(getYearConsumeCoin.yearRefundCoin)) }}
- 昨日新增消耗
+ 昨日新增消耗
{{ formatNum(Math.abs(getDayConsumeCoin.daysumCoin)) }} ; 消费
{{ formatNum(Math.abs(getDayConsumeCoin.dayConsumeCoin)) }} ; 退款
- {{ formatNum(Math.abs(getDayConsumeCoin.dayRefundCoin)) }}
+ {{ formatNum(Math.abs(getDayConsumeCoin.dayRefundCoin)) }}
@@ -984,78 +1073,63 @@ onMounted(async function () {
周同比 {{ statistics.weekOverWeekRate }}%
-
+
周同比 {{ statistics.weekOverWeekRate }}%
-
+
周同比 {{ statistics.weekOverWeekRate }}%
-
+
日环比{{ statistics.dayOverDayRate }}%
-
+
日环比{{ statistics.dayOverDayRate }}%
-
+
日环比{{ statistics.dayOverDayRate }}%
-
+
- 昨日充值人数
+ 昨日充值人数
{{ formatNum(Math.abs(statistics.rechargeCountYesterday)) }}
,其中首充
{{ formatNum(Math.abs(statistics.firstRechargeCountYesterday)) }}
- 人
+ 人
-
+
+ 全部
+ 今日
+ 本周
+ 本月
+ 本年
+
+
+
+
合计:充值金币:
@@ -1068,7 +1142,10 @@ onMounted(async function () {
{{ formatNum(payTotalTask) }}
-
+
+
+
+
@@ -1085,31 +1162,15 @@ onMounted(async function () {
-
+
{{
index + 1
@@ -1157,31 +1218,15 @@ onMounted(async function () {
-
+
{{
index + 1
@@ -1220,14 +1265,8 @@ onMounted(async function () {