donghaolin 4 months ago
parent
commit
47b7b6b67c
  1. 2
      vue/gold-system/src/router/index.js
  2. 2
      vue/gold-system/src/views/audit/rechargeAudit.vue
  3. 2
      vue/gold-system/src/views/audit/refundAudit.vue
  4. 6
      vue/gold-system/src/views/consume/addConsume.vue
  5. 2
      vue/gold-system/src/views/consume/allConsume.vue
  6. 2
      vue/gold-system/src/views/login.vue
  7. 317
      vue/gold-system/src/views/recharge/addRecharge.vue
  8. 2
      vue/gold-system/src/views/recharge/adminRecharge.vue
  9. 2
      vue/gold-system/src/views/recharge/allRecharge.vue
  10. 6
      vue/gold-system/src/views/refund/addRefund.vue
  11. 2
      vue/gold-system/src/views/refund/allRefund.vue
  12. 13
      vue/gold-system/src/views/usergold/index.vue
  13. 2
      vue/gold-system/src/views/usergoldInfo/index.vue
  14. 24
      vue/gold-system/src/views/workspace/index.vue
  15. 181
      vue/gold-system/src/views/z.vue

2
vue/gold-system/src/router/index.js

@ -4,7 +4,7 @@ const router=createRouter({
history:createWebHashHistory(),
routes:[
{path:'/login', name:"login", component:()=>import("../views/login.vue")},
{path:'/',redirect:"/workspace"},
{path:'/',redirect:"/login"},
{path:'/test',component:()=>import("../views/z.vue")},
{
meta:{requireAuth:true},

2
vue/gold-system/src/views/audit/rechargeAudit.vue

@ -573,7 +573,7 @@ onMounted(async function () {
label="充值方式"
width="100px"
/>
<el-table-column prop="paidGold" label="充值金币" width="100px" />
<el-table-column prop="paidGold" label="永久金币" width="100px" />
<el-table-column prop="freeGold" label="免费金币" width="100px" />
<el-table-column
prop="remark"

2
vue/gold-system/src/views/audit/refundAudit.vue

@ -537,7 +537,7 @@ onMounted(async function () {
</el-table-column>
<el-table-column
prop="rechargeCoin"
label="充值金币"
label="永久金币"
width="100px"
/>
<el-table-column prop="freeCoin" label="免费金币" width="100px" />

6
vue/gold-system/src/views/consume/addConsume.vue

@ -241,7 +241,7 @@ function calculateCoins() {
addConsume.value.freeCoin = Math.min(remainingGold, todayFree);
remainingGold -= addConsume.value.freeCoin;
addConsume.value.rechargeCoin = remainingGold; //
addConsume.value.rechargeCoin = remainingGold; //
// allGold
addConsume.value.allGold = originalAllGold;
@ -302,7 +302,7 @@ function calculateCoins() {
/>
</el-form-item>
<div style="display: flex; align-items: center">
<el-form-item prop="rechargeCoin" label="充值金币" style="float: left">
<el-form-item prop="rechargeCoin" label="永久金币" style="float: left">
<el-input
disabled
v-model="addConsume.rechargeCoin"
@ -386,7 +386,7 @@ function calculateCoins() {
<span
style="display: inline; white-space: nowrap; color: #b1b1b1"
v-if="user.buyJb"
>(充值金币:{{ user.buyJb }};免费金币:{{
>(永久金币:{{ user.buyJb }};免费金币:{{
user.free6 + user.free12
}};任务金币:{{ user.coreJb }})</span
>

2
vue/gold-system/src/views/consume/allConsume.vue

@ -383,7 +383,7 @@ getGoods();
{{ scope.row.freeCoin * -1 }}
</template>
</el-table-column>
<el-table-column prop="rechargeCoin" label="充值金币" width="120px"
<el-table-column prop="rechargeCoin" label="永久金币" width="120px"
><template #default="scope">
{{ scope.row.rechargeCoin * -1 }}
</template>

2
vue/gold-system/src/views/login.vue

@ -21,7 +21,7 @@ const login = async function () {
);
if (result.data.code == 200) {
localStorage.setItem("token", result.data.msg);
router.push("/");
router.push("/workspace");
ElMessage.success("登录成功");
console.log("请求成功", result);
} else {

317
vue/gold-system/src/views/recharge/addRecharge.vue

@ -7,6 +7,9 @@ import { ElMessageBox } from "element-plus";
import API from "../../api/index.js";
import moment from "moment";
import { range, re } from "mathjs";
import * as xlsx from 'xlsx';
import _, { before } from 'lodash';
import { th } from "element-plus/es/locales.mjs";
import * as xlsx from "xlsx";
import _ from "lodash";
@ -103,7 +106,7 @@ const Ref = ref(null);
const checkFreeGoldRadio = function (rule, value, callback) {
if (value == "0" || value == null || value == "") {
callback(new Error("请输入充值金币"));
callback(new Error("请输入永久金币"));
} else if (value < 0 || isNaN(value)) {
callback(new Error("请输入正确的格式"));
} else {
@ -292,6 +295,7 @@ const deleteRecharge = function () {
//
// jwcode
const jwcodeList = ref([]);
let jwcodeSet;
// jwcode
const getJwcodeList = async function () {
try {
@ -305,16 +309,34 @@ const getJwcodeList = async function () {
console.log("请求成功", result);
//
jwcodeList.value = result.data;
jwcodeList.value = jwcodeList.value.map((item) => ({
value: item,
label: item,
}));
console.log("精网号", jwcodeList.value);
// set
jwcodeSet = new Set(jwcodeList.value);
console.log("精网号set", jwcodeSet);
} catch (error) {
console.log("请求失败", error);
//
}
};
//
//
const errorCount = ref(0);
//
const validateInput = function (row, index) {
console.log(jwcodeSet.has(row.jwcode), "has");
if (!jwcodeSet.has(row.jwcode) && row.jwcode != '' && row.jwcode != null) {
row.isInputInvalid = true;
row.inputErrorMessage = '精网号不存在';
errorCount.value++;
return;
} else {
row.isInputInvalid = false;
row.inputErrorMessage = '';
errorCount.value--;
}
}
//
const batchRechargeVisible = ref(false);
const jwcodeSelectRef = ref(null);
@ -327,6 +349,11 @@ const batchData = ref([
{
line: 1,
showInput: true,
isInputInvalid: false,
inputErrorMessage: '',
freeGold: "0",
rechargeGold: "0",
paidGold: "0",
},
]);
@ -343,52 +370,6 @@ const batchInit = function () {
openBatchRechargeVisible();
};
//
const addScrollListener = () => {
const SELECTWRAP_DOM = document.querySelector(
".el-select-dropdown .el-select-dropdown__wrap"
);
if (SELECTWRAP_DOM) {
SELECTWRAP_DOM.addEventListener("scroll", function () {
const condition = this.scrollHeight - this.scrollTop <= this.clientHeight;
if (condition) binding.value();
});
}
};
//
const vJwcodeLoadmore = {
mounted(el, binding) {
nextTick(() => {
console.log("el===", el, "binding===", binding);
const SELECTWRAP_DOM = el.querySelector(
".el-select-dropdown .el-select-dropdown__wrap"
);
console.log("SELECTWRAP_DOM===", SELECTWRAP_DOM);
if (SELECTWRAP_DOM) {
SELECTWRAP_DOM.addEventListener("scroll", function () {
/**
* scrollHeight 获取元素内容高度(只读)
* scrollTop 获取或者设置元素的偏移值,
* 常用于:计算滚动条的位置, 当一个元素的容器没有产生垂直方向的滚动条, 那它的scrollTop的值默认为0.
* clientHeight 读取元素的可见高度(只读)
* 如果元素滚动到底, 下面等式返回true, 没有则返回false:
* ele.scrollHeight - ele.scrollTop === ele.clientHeight;
*/
const condition =
this.scrollHeight - this.scrollTop <= this.clientHeight;
if (condition) binding.value();
});
}
});
},
};
//
// const jwcodeSelectScrollerListener = () => {
// console.log(jwcodeSelectRef.value, 'jwcodeSelectRef.value')
// if (jwcodeSelectRef.value) {
// directives.loadmore(jwcodeSelectRef.value, loadMore(rangeNumber.value));
// }
// };
//
const addLineObj = ref(0);
//
@ -396,33 +377,38 @@ const addLine = function () {
batchData.value.unshift({
line: ++i.value,
showInput: true,
isInputInvalid: false,
inputErrorMessage: '',
freeGold: "0",
rechargeGold: "0",
paidGold: "0",
});
};
const loading = ref(true);
//
// const addLines = async function () {
// try {
// for (let j = 0; j < addLineObj.value; j++) {
// batchData.value.unshift({
// line: ++i.value,
// showInput: true,
// });
// }
// ElMessage.success("");
// } catch (error) {
// console.log("", error);
// ElMessage.error("");
// }
// }
const addLines = async function () {
loading.value = true;
try {
loading.value = true; // loadingtrue
console.log(loading.value, "loading.value")
await new Promise(resolve => setTimeout(resolve, 100)); //
// loadingtrue
await nextTick(); //
for (let j = 0; j < addLineObj.value; j++) {
batchData.value.unshift({
line: ++i.value,
showInput: true,
isInputInvalid: false,
inputErrorMessage: '',
freeGold: "0",
rechargeGold: "0",
paidGold: "0",
});
batchData.value.unshift({
line: ++i.value,
showInput: true,
});
}
@ -430,13 +416,49 @@ const addLines = async function () {
await nextTick(); //
loading.value = false; // loadingfalse
ElMessage.success("添加成功");
console.log(batchData.value, "batchData.value");
} catch (error) {
console.log("添加失败", error);
ElMessage.error("添加失败");
//
} finally {
loading.value = false;
console.log(loading.value, "loading.value")
}
};
}
//
// const addLines = async function () {
// try {
// loading.value = true; // loadingtrue
// console.log(loading.value, "loading.value")
// await new Promise(resolve => setTimeout(resolve, 100)); //
// const newItems = Array.from({ length: addLineObj.value }, (_, index) => reactive({
// line: ++i.value,
// showInput: true,
// isInputInvalid: false,
// inputErrorMessage: '',
// freeGold: "0",
// rechargeGold: "0",
// paidGold: "0",
// }));
// batchData.value = [...newItems, ...batchData.value];
// ElMessage.success("");
// console.log(batchData.value, "batchData.value");
// loading.value = false;
// console.log(loading.value, "loading.value")
// } catch (error) {
// console.log("", error);
// ElMessage.error("");
// //
// loading.value = false;
// }
// };
// 使 _.throttle trailing false
const throttledAddLines = _.throttle(addLines, 500, { trailing: false });
// excelref
const uploadRefMap = ref({});
// excel
@ -571,7 +593,7 @@ const changeActivity = function (row) {
}
}
};
//
//
const changePaidGold = function (row) {
console.log("row===", row);
let ratio = 0;
@ -638,6 +660,74 @@ const handleBatchAvatarSuccess = (response, uploadFile) => {
};
//
const batchAdd = async function () {
try {
console.log("batchData===", batchData.value);
let msg = '';
if (batchData.value.length == 0) {
ElMessage({
type: "error",
message: "至少需要输入一条数据!",
});
return;
}
if (errorCount.value > 0) {
console.log("errorCount.value", errorCount.value);
ElMessage({
type: "error",
message: "请检查输入的精网号是否正确!",
});
return;
}
for (let i = 0; i < batchData.value.length; i++) {
batchData.value[i].adminId = adminData.value.adminId;
batchData.value[i].area = adminData.value.area;
batchData.value[i].rechargeWay = "客服充值";
if (
batchData.value[i].jwcode == "" ||
batchData.value[i].jwcode == null) {
msg += `精网号不能为空! <br/>`;
}
if (
batchData.value[i].activityId == "" ||
batchData.value[i].activityId == null) {
msg += `活动不能为空! <br/>`;
}
if (
batchData.value[i].paidGold == "" ||
batchData.value[i].paidGold == null) {
msg += `永久金币不能为空! <br/>`;
}
if (
batchData.value[i].freeGold == "" ||
batchData.value[i].freeGold == null) {
msg += `免费金币不能为空! <br/>`;
}
if (
batchData.value[i].rechargeGold == "" ||
batchData.value[i].rechargeGold == null) {
msg += `充值金额不能为空! <br/>`;
}
if (
batchData.value[i].payWay == "" ||
batchData.value[i].payWay == null) {
msg += `收款方式不能为空! <br/>`;
}
if (
batchData.value[i].rechargeTime == "" ||
batchData.value[i].rechargeTime == null) {
msg += `交款时间不能为空! <br/>`;
}
if (msg != '' && msg != null) {
console.log(batchData.value[i]);
ElMessage({
dangerouslyUseHTMLString: true,
type: "error",
message: msg,
});
return;
}
}
console.log("batchData::", batchData.value);
console.log("batchData===", batchData.value);
let msg = "";
if (batchData.value.length == 0) {
@ -690,27 +780,36 @@ const batchAdd = async function () {
}
console.log("batchData===", batchData.value);
const result = await API.post(
"http://192.168.8.93:10010/recharge/recharge/addmore",
{ ...batchData.value }
);
const result = await API.post(
"http://192.168.8.93:10010/recharge/recharge/addmore",
{ ...batchData.value }
);
if (result.code === 0) {
ElMessage.error("添加失败");
return;
}
if (result.code === 0) {
ElMessage.error("添加失败");
return;
}
ElMessage({
type: "success",
message: "添加成功!",
});
ElMessage({
type: "success",
message: "添加成功!",
});
closeBatchRechargeVisible();
};
closeBatchRechargeVisible();
} catch (error) {
console.log("error===", error);
ElMessage.error("添加失败");
return;
};
}
// 使 _.throttle trailing false
const throttledBatchAdd = _.throttle(batchAdd, 5000, { trailing: false });
const throttledBatchAdd = _.throttle(batchAdd, 2000, { trailing: false });
//
const batchSettingObj = ref({});
const batchSettingObj = ref({
rechargeGold: "0",
paidGold: "0",
freeGold: "0",
});
//
const batchSettingVisible = ref(false);
//
@ -734,7 +833,11 @@ const batchSettingHandleAvatarSuccess = (response, uploadFile) => {
};
//
const cancelBatchSetting = function () {
batchSettingObj.value = {};
batchSettingObj.value = {
rechargeGold: "0",
paidGold: "0",
freeGold: "0",
};
closeBatchSettingVisible();
};
//
@ -808,7 +911,11 @@ const batchSettingConfirm = function () {
batchData.value[i].remark = batchSettingObj.value.remark;
}
}
batchSettingObj.value = {};
batchSettingObj.value = {
rechargeGold: "0",
paidGold: "0",
freeGold: "0",
};
closeBatchSettingVisible();
};
@ -856,7 +963,7 @@ onMounted(async function () {
/>
</el-select>
</el-form-item>
<el-form-item prop="paidGold" label="充值金币">
<el-form-item prop="paidGold" label="永久金币">
<el-input v-model="addRecharge.paidGold" style="width: 100px" />
<p style="margin-right: 20px"></p>
<p>免费金币</p>
@ -989,6 +1096,8 @@ onMounted(async function () {
<span style="color: #2fa1ff; margin-right: 5px" v-if="user.buyJb">{{
user.buyJb + user.free6 + user.free12 + user.coreJb
}}</span>
<span style="display: inline; white-space: nowrap; color: #b1b1b1" v-if="user.buyJb">(永久金币:{{ user.buyJb
}};免费金币:{{
<span
style="display: inline; white-space: nowrap; color: #b1b1b1"
v-if="user.buyJb"
@ -1047,8 +1156,9 @@ onMounted(async function () {
<!-- <el-button type="primary" @click="addLine()" style="margin-right: 10px">新增一行</el-button> -->
<div style="font-weight: bold; font-size: 20px">
<span>添加</span>
<el-input style="width: 60px" v-model="addLineObj"></el-input>
<el-input-number min="1" style="width: 100px;" controls-position="right" v-model="addLineObj"></el-input-number>
<span></span>
<el-button type="primary" @click="throttledAddLines" style="margin-right: 10px">添加</el-button>
<el-button type="primary" @click="addLines()" style="margin-right: 10px"
>添加</el-button
>
@ -1072,6 +1182,8 @@ onMounted(async function () {
>
</el-row>
<el-row>
<el-table id="batchTable" v-loading="loading" :data="batchData" border
max-height="540px" style="height: 540px" @selection-change="handleSelectionChangebatch">
<el-table
:data="batchData"
border
@ -1086,11 +1198,15 @@ onMounted(async function () {
</template>
</el-table-column>
<el-table-column property="jwcode" label="精网号" width="150px">
<!-- <template #default="scope">
<el-input v-if="scope.row.showInput" v-model="scope.row.jwcode" style="width: 110px" />
<span v-else>{{ scope.row.jwcode }}</span>
</template> -->
<template #default="scope">
<el-input v-if="scope.row.showInput" :class="{ 'is-invalid': scope.row.isInputInvalid }"
@blur="validateInput(scope.row)" v-model="scope.row.jwcode" style="width: 110px" />
<p v-if="scope.row.isInputInvalid" class="error-message">{{
scope.row.inputErrorMessage }}</p>
</template>
<!-- <template #default="scope">
<el-select-v2 v-if="scope.row.showInput" filterable clearable v-model="scope.row.jwcode"
placeholder="请选择精网号" style="widows: 110px;" :options="jwcodeList">
<el-select-v2
v-if="scope.row.showInput"
filterable
@ -1102,7 +1218,7 @@ onMounted(async function () {
>
</el-select-v2>
<span v-else>{{ scope.row.jwcode }}</span>
</template>
</template> -->
</el-table-column>
<el-table-column property="activityName" label="活动名称" width="150px">
<template #default="scope">
@ -1125,7 +1241,7 @@ onMounted(async function () {
<span v-else>{{ scope.row.activityName }}</span>
</template>
</el-table-column>
<el-table-column property="paidGold" label="充值金币" width="110px">
<el-table-column property="paidGold" label="永久金币" width="110px">
<template #default="scope">
<el-input
v-if="scope.row.showInput"
@ -1138,6 +1254,8 @@ onMounted(async function () {
</el-table-column>
<el-table-column property="freeGold" label="免费金币" width="110px">
<template #default="scope">
<el-input v-if="scope.row.showInput" v-model="scope.row.freeGold" style="width: 70px" />
<span v-else>{{ scope.row.freeGold }}</span>
<el-input
v-if="scope.row.showInput"
v-model="scope.row.freeGold"
@ -1322,6 +1440,8 @@ onMounted(async function () {
</el-option>
</el-select>
</el-form-item>
<el-form-item label="永久金币">
<el-input v-model="batchSettingObj.paidGold" placeholder="请输入永久金币"></el-input>
<el-form-item label="充值金币">
<el-input
v-model="batchSettingObj.paidGold"
@ -1441,6 +1561,15 @@ p {
</style>
<style>
.error-message {
color: red;
font-size: 8px;
}
.is-invalid .el-input__inner {
border-color: red;
}
.avatar-uploader .el-upload {
border: 1px dashed var(--el-border-color);
border-radius: 6px;

2
vue/gold-system/src/views/recharge/adminRecharge.vue

@ -460,7 +460,7 @@ onMounted(async function () {
width="120px"
sortable
/>
<el-table-column prop="paidGold" label="充值金币" width="100px" />
<el-table-column prop="paidGold" label="永久金币" width="100px" />
<el-table-column prop="freeGold" label="免费金币" width="100px" />
<el-table-column
prop="remark"

2
vue/gold-system/src/views/recharge/allRecharge.vue

@ -423,7 +423,7 @@ onMounted(async function () {
label="充值方式"
width="100px"
/>
<el-table-column prop="paidGold" label="充值金币" width="100px" />
<el-table-column prop="paidGold" label="永久金币" width="100px" />
<el-table-column prop="freeGold" label="免费金币" width="100px" />
<el-table-column
prop="remark"

6
vue/gold-system/src/views/refund/addRefund.vue

@ -120,7 +120,7 @@ const rules = reactive({
taskCoin: [{ required: true, message: "请输入任务金币", trigger: "blur" }],
freeCoin: [{ required: true, message: "请输入免费金币", trigger: "blur" }],
rechargeCoin: [
{ required: true, message: "请输入充值金币", trigger: "blur" },
{ required: true, message: "请输入永久金币", trigger: "blur" },
],
allCoin: [
{ required: true, message: "请选择付款方式", trigger: "blur" },
@ -340,7 +340,7 @@ const handleSelectionChange = (value) => {
</el-form-item>
<div style="display: flex; align-items: center">
<el-form-item prop="rechargeCoin" label="充值金币" style="float: left">
<el-form-item prop="rechargeCoin" label="永久金币" style="float: left">
<el-input
v-model="addRefund.rechargeCoin"
style="width: 100px"
@ -428,7 +428,7 @@ const handleSelectionChange = (value) => {
<span
style="display: inline; white-space: nowrap; color: #b1b1b1"
v-if="user.buyJb"
>(充值金币:{{ user.buyJb }};免费金币:{{
>(永久金币:{{ user.buyJb }};免费金币:{{
user.free6 + user.free12
}};任务金币:{{ user.coreJb }})</span
>

2
vue/gold-system/src/views/refund/allRefund.vue

@ -434,7 +434,7 @@ const checkNumber = function () {
</el-table-column>
<el-table-column
prop="rechargeCoin"
label="充值金币"
label="永久金币"
width="100px"
/>
<el-table-column prop="freeCoin" label="免费金币" width="100px" />

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

@ -47,6 +47,10 @@ const updateType = [
value: "2",
label: "退款",
},
{
value:"3",
label:"其他"
}
];
// //
@ -225,7 +229,7 @@ const json_fields = (row) => {
row.consumePlatform, //
row.firstexam_score, //
row.freeCoin, //
row.rechageCoin, //
row.rechageCoin, //
row.taskCoin, //
row.name, //
moment(row.createTime).format("YYYY-MM-DD HH:mm:ss"), //
@ -544,7 +548,7 @@ const get30 = function () {
<el-col>
<el-card>
<div>
现有金币免费金币{{ Math.abs(freeCoin) }}充值金币{{
现有金币免费金币{{ Math.abs(freeCoin) }}永久金币{{
Math.abs(rechargeCoin)
}}任务金币{{ Math.abs(taskCoin) }}
</div>
@ -593,6 +597,9 @@ const get30 = function () {
<span v-if="scope.row.updateType == 2">
<span>退款</span>
</span>
<span v-if="scope.row.updateType == 3">
<span>其他</span>
</span>
</template>
</el-table-column>
<el-table-column prop="freeCoin" label="免费金币" width="130">
@ -600,7 +607,7 @@ const get30 = function () {
<span>{{ Math.abs(scope.row.freeCoin) }}</span>
</template>
</el-table-column>
<el-table-column prop="rechargeCoin" label="充值金币" width="150">
<el-table-column prop="rechargeCoin" label="永久金币" width="150">
<template #default="scope">
<span>{{ Math.abs(scope.row.rechargeCoin) }}</span>
</template>

2
vue/gold-system/src/views/usergoldInfo/index.vue

@ -243,7 +243,7 @@ onMounted(async function () {
<span>{{ Math.abs(scope.row.free6 + scope.row.free12) }}</span>
</template>
</el-table-column>
<el-table-column prop="buyJb" label="充值金币" width="110">
<el-table-column prop="buyJb" label="永久金币" width="110">
<template #default="scope">
<span>{{ Math.abs(scope.row.buyJb) }}</span>
</template>

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

@ -68,7 +68,7 @@ const gold = [
},
{
value: "充值金币",
label: "充值金币",
label: "永久金币",
},
{
value: "免费金币",
@ -144,7 +144,7 @@ const get = async function () {
option3Data.value = [
{
value: Math.abs(statistics.value.rechargeSumCoin),
name: "充值金币" + " | " + statistics.value.rechargeSumCoin,
name: "永久金币" + " | " + statistics.value.rechargeSumCoin,
},
{
value: Math.abs(statistics.value.freeSumCoin),
@ -160,7 +160,7 @@ const get = async function () {
{
value: Math.abs(getYearConsumeCoin.value.yearSumRechargeCoin),
name:
"充值金币" +
"永久金币" +
" | " +
Math.abs(getYearConsumeCoin.value.yearSumRechargeCoin),
},
@ -184,7 +184,7 @@ const get = async function () {
option5Data.value = [
{
value: Math.abs(getSumCoin.value.todayRecharge),
name: "充值金币" + " | " + getSumCoin.value.todayRecharge,
name: "永久金币" + " | " + getSumCoin.value.todayRecharge,
},
{
value: Math.abs(getSumCoin.value.todayFree),
@ -440,7 +440,7 @@ const getMiddleBar = async function () {
},
series: [
{
name: "充值金币",
name: "永久金币",
color: "#35e383",
type: "bar",
stack: "total",
@ -513,7 +513,7 @@ const getMiddleBar = async function () {
},
series: [
{
name: "充值金币",
name: "永久金币",
color: "#35e383",
type: "bar",
stack: "total",
@ -906,7 +906,7 @@ onMounted(async function () {
},
series: [
{
name: "充值金币",
name: "永久金币",
color: "#35e383",
type: "bar",
stack: "total",
@ -1125,7 +1125,7 @@ onMounted(async function () {
</span>
</p>
<template #footer>
<span>充值{{ formatNum(getSumCoin.todayRecharge) }}
<span>永久{{ formatNum(getSumCoin.todayRecharge) }}
免费{{ formatNum(getSumCoin.todayFree) }}
任务{{ formatNum(getSumCoin.todayTask) }}
</span>
@ -1242,7 +1242,7 @@ onMounted(async function () {
<el-tabs v-model="activeName" class="demo-tabs" @tab-change="handleChange">
<el-tab-pane label="金币充值" name="recharge">
<div>
合计充值金币
合计永久金币
<span class="mid-head-font">{{
formatNum(middleTotalRecharge)
}}</span>
@ -1259,7 +1259,7 @@ onMounted(async function () {
<div id="recharge" style="width: 100%; height: 400px"></div>
<div style="width: 140px">
<div class="goldCategory">
<span>充值金币</span>
<span>永久金币</span>
</div>
<div class="goldCategory">
<span>免费金币</span>
@ -1295,7 +1295,7 @@ onMounted(async function () {
</el-tab-pane>
<el-tab-pane label="金币消费" name="consume">
<div>
合计充值金币
合计永久金币
<span class="mid-head-font">{{
formatNum(middleTotalRecharge)
}}</span>
@ -1312,7 +1312,7 @@ onMounted(async function () {
<div id="consume" style="width: 100%; height: 400px"></div>
<div style="width: 140px">
<div class="goldCategory">
<span>充值金币</span>
<span>永久金币</span>
</div>
<div class="goldCategory">
<span>免费金币</span>

181
vue/gold-system/src/views/z.vue

@ -1,107 +1,130 @@
<script setup>
import { all } from 'axios';
import * as echarts from 'echarts';
import { ref, onMounted, reactive, computed } from "vue";
import { VscInfo } from 'vue-icons-plus/vsc'
import { Bs1CircleFill, Bs2CircleFill, Bs3CircleFill, Bs4Circle, Bs5Circle, Bs6Circle, Bs7Circle, Bs8Circle } from 'vue-icons-plus/bs'
import axios from 'axios';
import { ref, onMounted, reactive, computed, nextTick } from "vue";
//
const option4Data = ref([]);
const a1=ref(1000);
const a2=ref(2000);
const a3=ref(3000);
const a4=ref(4000);
let allData = []
let tableData = []
let elTableHeight = 0 //el-table
let theadHeight = 0 //
let contentHeight = 0 //
let showRowCount = 0 //
let falseBox = 0 //
let scollBoxHeight = 0 //
let scrollTopRowCount = 0 //
//
onMounted(async function () {
option4Data.value = [
{ value: a1.value, name: '1000金币' },
{ value: a2.value, name: '2000金币' },
{ value: a3.value, name: '3000金币' },
{ value: a4.value, name: '4000金币' },
];
// domecharts
var rechargeBar = echarts.init(document.getElementById('main'));
const option = {
tooltip: {
trigger: 'item'
},
legend: {
bottom: '-2%',
left: 'center',
orient: 'vertical'
},
grid: {
top: '0%', // 10%使
},
series: [
{
name: '全年累计消耗金币数(个)\n10000',
type: 'pie',
radius: ['80%', '60%'],
avoidLabelOverlap: false,
label: {
show: true,
position: 'center',
formatter: '{a}',
fontSize: 15,
fontWeight: 'bold'
},
labelLine: {
show: false
},
data: option4Data.value,
color: ['#57a5ff', '#7f29ff', '#f2d113']
}
]
};
// 使
rechargeBar.setOption(option);
})
allData = [];
for (let i = 0; i < 10000; i++) {
allData.push({
name: '张三' + i,
age: 20 + i,
address: '北京市海淀区' + i,
salary: 50000 + i,
date: '2022-01-01'
})
}
scollBoxHeight = 45 * allData.length + 45; //
await new Promise(resolve => setTimeout(resolve, 100)); //
nextTick(() => {
elTableHeight = document.querySelector('.table-box .el-table').offsetHeight;
theadHeight = document.querySelector('.table-box .el-table__header-wrapper').offsetHeight;
contentHeight = elTableHeight - theadHeight;
showRowCount = Math.floor(contentHeight / 45);
// <showRowCount>
tableData = JSON.parse(JSON.stringify(allData)).splice(0, showRowCount);
})
falseBox = document.querySelector('.false-box');
falseBox.addEventListener('scroll', function (e) {
scrollTopRowCount = Math.ceil(e.target.scrollTop / 45);
// <scrollTopRowCount> <showRowCount>
tableData = JSON.parse(JSON.stringify(allData)).splice(scrollTopRowCount, showRowCount);
});
console.log(allData)
console.log(elTableHeight)
console.log(theadHeight)
console.log(contentHeight)
console.log(showRowCount)
console.log(falseBox)
console.log(scollBoxHeight)
console.log(tableData)
const imgrule = ref('..\assets\韩信.png');
})
</script>
<template>
<div>
<el-image :preview-src-list="[imgrule]" preview-teleported="true" src="..\assets\动漫美女.png" alt="美女" style="width: 50px; height: 50px" />
<div class="box" style="width: 1000px; height: 500px; overflow: hidden; position: relative;">
<!-- false-box这是一个用来显示滚动条的方法 -->
<div class="false-box" style="width: 100%; height: 100%; position: absolute; top: 0%; left: 0%; overflow: auto;">
<div class="scroll-box" :style="{ 'height': scollBoxHeight + 'px' }">
<!-- scroll-box是用来撑起盒子的方法 -->
</div>
</div>
<div class="table-box">
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="name" label="姓名" width="180">
</el-table-column>
<el-table-column prop="age" label="年龄" width="180">
</el-table-column>
<el-table-column prop="address" label="地址">
</el-table-column>
<el-table-column prop="salary" label="薪资" width="180">
</el-table-column>
<el-table-column prop="date" label="日期" width="180">
</el-table-column>
</el-table>
</div>
</div>
<div id="main" style="width: 600px;height:400px;"></div>
</template>
<style scoped>
.comparedWithYesterday {
display: flex;
.box {
width: 1000px;
height: 500px;
overflow: hidden;
position: relative;
}
.ranking-item {
margin-bottom: 10px;
.box .false-box {
width: 100%;
height: 100%;
position: absolute;
top: 0%;
left: 0%;
overflow: auto;
}
.ranking-header {
margin-bottom: 10px;
display: flex;
.box .false-box .scroll-box {
width: 100%;
height: 1000px;
position: absolute;
top: 0%;
left: 0%;
}
.goldCategory {
margin-right: 20px;
display: flex;
.box .table-box {
width: calc(100% - 20px);
height: 100%;
position: absolute;
top: 0%;
left: 0%;
}
.bar {
display: flex;
}
.pie {
display: flex;
::v-deep .el-table {
width: 100%;
height: 100%;
}
.el-row {
margin-bottom: 20px;
.el-table .el-table__row {
height: 45px;
}
.el-radio-button {
border: 1px solid grey;
.el-table .el-table__row td {
padding: 0px
}
</style>
Loading…
Cancel
Save