From d4005665a7091c540fb089cd43e533f2a147914e Mon Sep 17 00:00:00 2001 From: hongxilin <17663930442@163.com> Date: Mon, 23 Dec 2024 17:48:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E9=87=91=E5=B8=81=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E9=87=91=E5=B8=81=E6=80=BB=E6=95=B0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F=E4=BF=AE=E6=94=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue/gold-system/README.md | 4 +- vue/gold-system/package-lock.json | 107 +++++++++++++++++ vue/gold-system/package.json | 1 + vue/gold-system/src/views/usergold/index.vue | 161 ++++++++++---------------- vue/gold-system/src/views/workspace/index.vue | 13 ++- 5 files changed, 182 insertions(+), 104 deletions(-) diff --git a/vue/gold-system/README.md b/vue/gold-system/README.md index c861b78..aed662e 100644 --- a/vue/gold-system/README.md +++ b/vue/gold-system/README.md @@ -20,4 +20,6 @@ npm install vue-icons-plus --save 下载外部图标库 npm install echarts 安装echarts组件 -npm install moment 安装moment组件 \ No newline at end of file +npm install moment 安装moment组件 + +npm install mathjs 安装mathjs组件,解决数据计算问题 \ No newline at end of file diff --git a/vue/gold-system/package-lock.json b/vue/gold-system/package-lock.json index a59c9bc..14bc872 100644 --- a/vue/gold-system/package-lock.json +++ b/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", diff --git a/vue/gold-system/package.json b/vue/gold-system/package.json index a2a34b0..a629569 100644 --- a/vue/gold-system/package.json +++ b/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", diff --git a/vue/gold-system/src/views/usergold/index.vue b/vue/gold-system/src/views/usergold/index.vue index 02a1f6e..db7712c 100644 --- a/vue/gold-system/src/views/usergold/index.vue +++ b/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 () {