Browse Source

客户金币明细金币总数数据获取方式修改。

Hongxilin
hongxilin 5 months ago
parent
commit
d4005665a7
  1. 4
      vue/gold-system/README.md
  2. 107
      vue/gold-system/package-lock.json
  3. 1
      vue/gold-system/package.json
  4. 161
      vue/gold-system/src/views/usergold/index.vue
  5. 13
      vue/gold-system/src/views/workspace/index.vue

4
vue/gold-system/README.md

@ -20,4 +20,6 @@ npm install vue-icons-plus --save 下载外部图标库
npm install echarts 安装echarts组件
npm install moment 安装moment组件
npm install moment 安装moment组件
npm install mathjs 安装mathjs组件,解决数据计算问题

107
vue/gold-system/package-lock.json

@ -12,6 +12,7 @@
"axios": "^1.7.8",
"echarts": "^5.5.1",
"element-plus": "^2.8.8",
"mathjs": "^14.0.1",
"moment": "^2.30.1",
"vue": "^3.5.12",
"vue-icons-plus": "^0.1.7",
@ -57,6 +58,18 @@
"node": ">=6.0.0"
}
},
"node_modules/@babel/runtime": {
"version": "7.26.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/runtime/-/runtime-7.26.0.tgz",
"integrity": "sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw==",
"license": "MIT",
"dependencies": {
"regenerator-runtime": "^0.14.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/types": {
"version": "7.26.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/@babel/types/-/types-7.26.0.tgz",
@ -1133,6 +1146,19 @@
"node": ">= 0.8"
}
},
"node_modules/complex.js": {
"version": "2.4.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/complex.js/-/complex.js-2.4.2.tgz",
"integrity": "sha512-qtx7HRhPGSCBtGiST4/WGHuW+zeaND/6Ld+db6PbrulIB1i2Ev/2UPiqcmpQNPSyfBKraC0EOvOKCB5dGZKt3g==",
"license": "MIT",
"engines": {
"node": "*"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/rawify"
}
},
"node_modules/csstype": {
"version": "3.1.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/csstype/-/csstype-3.1.3.tgz",
@ -1152,6 +1178,12 @@
"dev": true,
"license": "MIT"
},
"node_modules/decimal.js": {
"version": "10.4.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/decimal.js/-/decimal.js-10.4.3.tgz",
"integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==",
"license": "MIT"
},
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/delayed-stream/-/delayed-stream-1.0.0.tgz",
@ -1254,6 +1286,12 @@
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
"license": "MIT"
},
"node_modules/escape-latex": {
"version": "1.2.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/escape-latex/-/escape-latex-1.2.0.tgz",
"integrity": "sha512-nV5aVWW1K0wEiUIEdZ4erkGGH8mDxGyxSeqPzRNtWP7ataw+/olFObw7hujFWlVjNsaDFw5VZ5NzVSIqRgfTiw==",
"license": "MIT"
},
"node_modules/estree-walker": {
"version": "2.0.2",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/estree-walker/-/estree-walker-2.0.2.tgz",
@ -1294,6 +1332,19 @@
"node": ">= 6"
}
},
"node_modules/fraction.js": {
"version": "5.2.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/fraction.js/-/fraction.js-5.2.1.tgz",
"integrity": "sha512-Ah6t/7YCYjrPUFUFsOsRLMXAdnYM+aQwmojD2Ayb/Ezr82SwES0vuyQ8qZ3QO8n9j7W14VJuVZZet8U3bhSdQQ==",
"license": "MIT",
"engines": {
"node": ">= 12"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/rawify"
}
},
"node_modules/fsevents": {
"version": "2.3.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/fsevents/-/fsevents-2.3.3.tgz",
@ -1319,6 +1370,12 @@
"he": "bin/he"
}
},
"node_modules/javascript-natural-sort": {
"version": "0.7.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/javascript-natural-sort/-/javascript-natural-sort-0.7.1.tgz",
"integrity": "sha512-nO6jcEfZWQXDhOiBtG2KvKyEptz7RVbpGP4vTD2hLBdmNQSsCiicO2Ioinv6UI4y9ukqnBpy+XZ9H6uLNgJTlw==",
"license": "MIT"
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/lodash/-/lodash-4.17.21.tgz",
@ -1351,6 +1408,29 @@
"@jridgewell/sourcemap-codec": "^1.5.0"
}
},
"node_modules/mathjs": {
"version": "14.0.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/mathjs/-/mathjs-14.0.1.tgz",
"integrity": "sha512-yyJgLwC6UXuve724np8tHRMYaTtb5UqiOGQkjwbSXgH8y1C/LcJ0pvdNDZLI2LT7r+iExh2Y5HwfAY+oZFtGIQ==",
"license": "Apache-2.0",
"dependencies": {
"@babel/runtime": "^7.25.7",
"complex.js": "^2.2.5",
"decimal.js": "^10.4.3",
"escape-latex": "^1.2.0",
"fraction.js": "^5.2.1",
"javascript-natural-sort": "^0.7.1",
"seedrandom": "^3.0.5",
"tiny-emitter": "^2.1.0",
"typed-function": "^4.2.1"
},
"bin": {
"mathjs": "bin/cli.js"
},
"engines": {
"node": ">= 18"
}
},
"node_modules/memoize-one": {
"version": "6.0.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/memoize-one/-/memoize-one-6.0.0.tgz",
@ -1481,6 +1561,12 @@
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
"license": "MIT"
},
"node_modules/regenerator-runtime": {
"version": "0.14.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==",
"license": "MIT"
},
"node_modules/rollup": {
"version": "4.27.4",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/rollup/-/rollup-4.27.4.tgz",
@ -1519,6 +1605,12 @@
"fsevents": "~2.3.2"
}
},
"node_modules/seedrandom": {
"version": "3.0.5",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/seedrandom/-/seedrandom-3.0.5.tgz",
"integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==",
"license": "MIT"
},
"node_modules/semver": {
"version": "7.6.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/semver/-/semver-7.6.3.tgz",
@ -1541,12 +1633,27 @@
"node": ">=0.10.0"
}
},
"node_modules/tiny-emitter": {
"version": "2.1.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==",
"license": "MIT"
},
"node_modules/tslib": {
"version": "2.3.0",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==",
"license": "0BSD"
},
"node_modules/typed-function": {
"version": "4.2.1",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/typed-function/-/typed-function-4.2.1.tgz",
"integrity": "sha512-EGjWssW7Tsk4DGfE+5yluuljS1OGYWiI1J6e8puZz9nTMM51Oug8CD5Zo4gWMsOhq5BI+1bF+rWTm4Vbj3ivRA==",
"license": "MIT",
"engines": {
"node": ">= 18"
}
},
"node_modules/typescript": {
"version": "5.6.3",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/typescript/-/typescript-5.6.3.tgz",

1
vue/gold-system/package.json

@ -14,6 +14,7 @@
"axios": "^1.7.8",
"echarts": "^5.5.1",
"element-plus": "^2.8.8",
"mathjs": "^14.0.1",
"moment": "^2.30.1",
"vue": "^3.5.12",
"vue-icons-plus": "^0.1.7",

161
vue/gold-system/src/views/usergold/index.vue

@ -20,8 +20,8 @@ const taskCoin = ref(0);
const total = ref(100);
//
const getTime = ref([]);
// detail
const detail = ref({});
// detailY
const detailY = ref({});
//
const getAllObj = ref({});
//
@ -33,15 +33,15 @@ const getObj = ref({
//
const updateType = [
{
value: "充值",
value: "0",
label: "充值",
},
{
value: "消费",
value: "1",
label: "消费",
},
{
value: "退款",
value: "2",
label: "退款",
},
];
@ -63,22 +63,22 @@ const get = async function (val) {
//
if (getTime.value != null) {
if (getTime.value.startDate != "" && getTime.value.endDate != "") {
detail.value.startDate = getTime.value[0];
detail.value.endDate = getTime.value[1];
detailY.value.startDate = getTime.value[0];
detailY.value.endDate = getTime.value[1];
}
} else {
detail.value.startDate = "";
detail.value.endDate = "";
detailY.value.startDate = "";
detailY.value.endDate = "";
}
console.log("搜索参数", getObj.value);
// POST
const result = await API.post("http://192.168.8.93:10010/detail", {
const result = await API.post("http://192.168.8.93:10010/detailY", {
...getObj.value,
detail: { ...detail.value },
detailY: { ...detailY.value },
});
const result2 = await API.post("http://192.168.8.93:10010/detail", {
const result2 = await API.post("http://192.168.8.93:10010/detailY", {
...getAllObj.value,
detail: { ...detail.value },
detailY: { ...detailY.value },
});
//
console.log("请求成功", result);
@ -92,14 +92,14 @@ const get = async function (val) {
total.value = result.data.total;
console.log("total", total.value);
//
rechargeCoin.value = 0;
freeCoin.value = 0;
taskCoin.value = 0;
for (let i = 0; i < tableAllData.value.length; i++) {
rechargeCoin.value += tableAllData.value[i].rechargeCoin;
freeCoin.value += tableAllData.value[i].freeCoin;
taskCoin.value += tableAllData.value[i].taskCoin;
}
rechargeCoin.value = tableAllData.value.sumR;
freeCoin.value = tableAllData.value.sumF;
taskCoin.value = tableAllData.value.sumT;
// for (let i = 0; i < tableAllData.value.length; i++) {
// rechargeCoin.value += tableAllData.value[i].rechargeCoin;
// freeCoin.value += tableAllData.value[i].freeCoin;
// taskCoin.value += tableAllData.value[i].taskCoin;
// }
console.log(
"各金币总数",
rechargeCoin.value,
@ -118,10 +118,10 @@ const search = function () {
};
//
const reset = function () {
detail.value.jwcode = "";
detail.value.updateType = "";
detail.value.startDate = "";
detail.value.endDate = "";
detailY.value.jwcode = "";
detailY.value.updateType = "";
detailY.value.startDate = "";
detailY.value.endDate = "";
getTime.value = {};
};
//
@ -219,39 +219,18 @@ onMounted(async function () {
<div class="head-card">
<div class="head-card-element">
<el-text class="mx-1" size="large">精网号</el-text>
<el-input
v-model="detail.jwcode"
style="width: 240px"
placeholder="请输入精网号"
clearable
/>
<el-input v-model="detailY.jwcode" style="width: 240px" placeholder="请输入精网号" clearable />
</div>
<div class="head-card-element">
<el-text class="mx-1" size="large">更新类型</el-text>
<el-select
v-model="detail.updateType"
placeholder="请选择更新类型"
size="large"
style="width: 240px"
clearable
>
<el-option
v-for="item in updateType"
:key="item.value"
:label="item.label"
:value="item.value"
/>
<el-select v-model="detailY.updateType" placeholder="请选择更新类型" size="large" style="width: 240px" clearable>
<el-option v-for="item in updateType" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</div>
<div class="head-card-element">
<el-text class="mx-1" size="large">更新时间</el-text>
<el-date-picker
v-model="getTime"
type="daterange"
range-separator="至"
start-placeholder="起始时间"
end-placeholder="结束时间"
/>
<el-date-picker v-model="getTime" type="datetimerange" range-separator="" start-placeholder="起始时间"
end-placeholder="结束时间" />
</div>
<div class="head-card-btn">
<el-button @click="reset()">重置</el-button>
@ -265,9 +244,9 @@ onMounted(async function () {
<el-col>
<el-card>
<div>
现有金币免费金币{{ freeCoin }}充值金币{{
rechargeCoin
}}任务金币{{ taskCoin }}
现有金币免费金币{{ Math.abs(freeCoin) }}充值金币{{
Math.abs(rechargeCoin)
}}任务金币{{ Math.abs(taskCoin) }}
</div>
<div>
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
@ -277,9 +256,9 @@ onMounted(async function () {
<el-table-column prop="gold" label="更新数量" width="160">
<template #default="scope">
<span>{{
scope.row.rechargeCoin +
scope.row.freeCoin +
scope.row.taskCoin
Math.abs(scope.row.rechargeCoin +
scope.row.freeCoin +
scope.row.taskCoin)
}}</span>
</template>
</el-table-column>
@ -297,16 +276,29 @@ onMounted(async function () {
</span>
</template>
</el-table-column>
<el-table-column prop="freeCoin" label="免费金币" width="130" />
<el-table-column prop="rechargeCoin" label="充值金币" width="150" />
<el-table-column prop="taskCoin" label="任务金币" width="130" />
<el-table-column prop="freeCoin" label="免费金币" width="130">
<template #default="scope">
<span>{{
Math.abs(scope.row.freeCoin)
}}</span>
</template>
</el-table-column>
<el-table-column prop="rechargeCoin" label="充值金币" width="150">
<template #default="scope">
<span>{{
Math.abs(scope.row.rechargeCoin)
}}</span>
</template>
</el-table-column>
<el-table-column prop="taskCoin" label="任务金币" width="130">
<template #default="scope">
<span>{{
Math.abs(scope.row.taskCoin)
}}</span>
</template>
</el-table-column>
<el-table-column prop="name" label="提交人" width="150" />
<el-table-column
prop="createTime"
label="更新时间"
width="210"
show-overflow-tooltip
>
<el-table-column prop="createTime" label="更新时间" width="210" show-overflow-tooltip>
<template #default="scope">
<span>{{
moment(scope.row.createTime).format("YYYY-MM-DD HH:mm:ss")
@ -319,42 +311,17 @@ onMounted(async function () {
<!-- 分页 -->
<!-- 分页 -->
<div class="pagination" style="margin-top: 20px">
<el-pagination
background
:page-size="getObj.pageSize"
layout="slot"
:total="total"
>
<el-pagination background :page-size="getObj.pageSize" layout="slot" :total="total">
<div>{{ total }},每页</div>
<el-select
v-model="getObj.pageSize"
class="page-size"
@change="get()"
style="width: 80px"
>
<el-option
v-for="item in [5, 10, 20, 50, 100]"
:key="item"
:label="item"
:value="item"
></el-option>
<el-select v-model="getObj.pageSize" class="page-size" @change="get()" style="width: 80px">
<el-option v-for="item in [5, 10, 20, 50, 100]" :key="item" :label="item" :value="item"></el-option>
</el-select>
<div></div>
</el-pagination>
<el-pagination
background
layout="prev, pager, next,slot"
:page-size="getObj.pageSize"
:total="total"
:current-page="getObj.pageNum"
@current-change="get"
>
<el-pagination background layout="prev, pager, next,slot" :page-size="getObj.pageSize" :total="total"
:current-page="getObj.pageNum" @current-change="get">
<div>跳至</div>
<el-input
v-model="getObj.pageNum"
style="width: 40px"
@change="checkNumber"
/>
<el-input v-model="getObj.pageNum" style="width: 40px" @change="checkNumber" />
<div></div>
</el-pagination>
</div>

13
vue/gold-system/src/views/workspace/index.vue

@ -6,6 +6,7 @@ import * as bs from "vue-icons-plus/bs";
import axios, { all } from "axios";
import API from "../../api/index";
import moment from "moment";
import * as math from 'mathjs';
//
//
@ -390,13 +391,13 @@ const getMiddleBar = async function () {
middleTotalFree.value = 0;
middleTotalTask.value = 0;
middleRecharge.value.forEach((number) => {
middleTotalRecharge.value += number;
middleTotalRecharge.value = math.add(math.bignumber(middleTotalRecharge.value), math.bignumber(number));
});
middleFree.value.forEach((number) => {
middleTotalFree.value += number;
middleTotalFree.value = math.add(math.bignumber(middleTotalFree.value), math.bignumber(number));
});
middleTask.value.forEach((number) => {
middleTotalTask.value += number;
middleTotalTask.value = math.add(math.bignumber(middleTotalTask.value), math.bignumber(number));
});
console.log("middleCategory", middleCategory.value);
@ -671,7 +672,7 @@ const thisWeek = function () {
const dayOfWeek = current.getDay(); // 0 1
const diff = current.getDate() - dayOfWeek + (dayOfWeek === 0 ? -6 : 1); //
const startDate = new Date(current.getFullYear(), current.getMonth(), diff);
const endDate = new Date(current.getFullYear(), current.getMonth(), diff + 6);
const endDate = new Date();
searchTime.value = [startDate, endDate];
search();
// console.log("searchTime", moment(searchTime.value[0]).format("YYYY-MM-DD") + "" + moment(searchTime.value[1]).format("YYYY-MM-DD"))
@ -680,7 +681,7 @@ const thisWeek = function () {
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);
const endDate = new Date();
searchTime.value = [startDate, endDate];
search();
// console.log("searchTime", moment(searchTime.value[0]).format("YYYY-MM-DD") + "" + moment(searchTime.value[1]).format("YYYY-MM-DD"))
@ -689,7 +690,7 @@ const thisMonth = function () {
const thisYear = function () {
const current = new Date();
const startDate = new Date(current.getFullYear(), 0, 1);
const endDate = new Date(current.getFullYear() + 1, 0, 0);
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"))

Loading…
Cancel
Save