Browse Source

bug修复以及ip访问

Hongxilin
hongxilin 7 months ago
parent
commit
967243a4e4
  1. 3
      vue/gold-system/package.json
  2. 17
      vue/gold-system/src/assets/css/common.css
  3. 2
      vue/gold-system/src/router/index.js
  4. 13
      vue/gold-system/src/views/audit/rechargeAudit.vue
  5. 33
      vue/gold-system/src/views/audit/refundAudit.vue
  6. 15
      vue/gold-system/src/views/managerecharge/activity.vue
  7. 8
      vue/gold-system/src/views/recharge/adminRecharge.vue
  8. 4
      vue/gold-system/src/views/recharge/allRecharge.vue
  9. 97
      vue/gold-system/src/views/usergold/index.vue
  10. 117
      vue/gold-system/src/views/workspace/index.vue
  11. 1
      vue/gold-system/vite.config.ts

3
vue/gold-system/package.json

@ -6,7 +6,8 @@
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview"
"preview": "vite preview",
"serve": "vite - service serve --host 0.0.0.0 --port 8080"
},
"dependencies": {
"@element-plus/icons-vue": "^2.3.1",

17
vue/gold-system/src/assets/css/common.css

@ -24,6 +24,7 @@
display: block;
background-color: grey;
}
.yellow-dot {
margin: 7px 5px 0px 0px;
width: 10px;
@ -46,4 +47,20 @@
height: 10px;
display: block;
background-color: #5f8ff5;
}
.red-triangle {
width: 0;
height: 0;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-bottom: 10px solid red;
}
.green-triangle {
width: 0;
height: 0;
border-left: 7px solid transparent;
border-right: 7px solid transparent;
border-top: 10px solid green;
}

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

@ -3,7 +3,7 @@ import { createRouter,createWebHashHistory } from 'vue-router';
const router=createRouter({
history:createWebHashHistory(),
routes:[
{path:'/',redirect:"/index"},
{path:'/',redirect:"/workspace"},
{
path:'/index',component:()=>import("../views/index.vue"),
children:[

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

@ -6,6 +6,13 @@ import { AiFillRead } from "vue-icons-plus/ai";
import axios from 'axios';
import moment from 'moment';
//
//
const admin = ref({
adminId: 1,
name: '赵刚',
area: '中国'
})
//
const tableData = ref([]);
// ======================================
@ -233,7 +240,8 @@ const checkNumber = function () {
//
const pass = function (row) {
//
passObj.value.auditId = row.rechargeId;
passObj.value.adminId = admin.value.adminId;
passObj.value.auditId = row.auditId;
passObj.value.status = 1;
console.log('通过对象', passObj.value);
}
@ -273,7 +281,8 @@ const closeRejectVisible = function () {
//
const reject = function (row) {
//
rejectObj.value.auditId = row.rechargeId;
rejectObj.value.adminId = admin.value.adminId;
rejectObj.value.auditId = row.auditId;
rejectObj.value.status = 2;
rejectObj.value.reson = '';
console.log('驳回对象', rejectObj.value);

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

@ -6,6 +6,13 @@ import { AiFillRead } from "vue-icons-plus/ai";
import axios from 'axios';
import moment from 'moment';
//
//
const admin = ref({
adminId: 1,
name: '赵刚',
area: '中国'
})
//
const tableData = ref([]);
// ======================================
@ -21,7 +28,7 @@ const total = ref(100);
//
const getTime = ref([]);
//
const activity = ref([]);
const product = ref([]);
//
const allData = ref([]);
//
@ -52,7 +59,7 @@ const refundType = [
//
const tableHeight = computed(function () {
return (getObj.value.pageSize + 2) * 60 + 'px';
return (getObj.value.pageSize + 1) * 50 + 'px';
});
// ref
@ -97,6 +104,8 @@ const get = async function (val) {
//
const reset = function () {
consumeDetail.value.area = '';
consumeDetail.value.refundType='';
consumeDetail.value.refundGoods='';
consumeDetail.value.startDate = '';
consumeDetail.value.endDate = '';
getTime.value = {};
@ -158,16 +167,16 @@ const handleClick = function (tab, event) {
}
}
//
const getActivity = async function () {
const getProduct = async function () {
try {
// POST
const result = await axios.post('http://192.168.8.93:10010/recharge/activity/select', {});
const result = await axios.post('http://192.168.8.93:10020/product', {});
//
console.log('请求成功', result);
//
activity.value = result.data.data;
console.log('activity', activity.value);
product.value = result.data.data;
console.log('产品', product.value);
} catch (error) {
console.log('请求失败', error);
//
@ -219,7 +228,8 @@ const checkNumber = function () {
//
const pass = function (row) {
//
passObj.value.auditId = row.rechargeId;
passObj.value.adminId=admin.value.adminId;
passObj.value.auditId = row.auditId;
passObj.value.status = 1;
console.log('通过对象', passObj.value);
}
@ -259,7 +269,8 @@ const closeRejectVisible = function () {
//
const reject = function (row) {
//
rejectObj.value.auditId = row.rechargeId;
rejectObj.value.adminId=admin.value.adminId;
rejectObj.value.auditId = row.auditId;
rejectObj.value.status = 2;
rejectObj.value.reson = '';
console.log('驳回对象', rejectObj.value);
@ -310,7 +321,7 @@ const rules = reactive({
//
onMounted(async function () {
await get();
getActivity();
getProduct();
await getArea();
})
@ -336,8 +347,8 @@ onMounted(async function () {
<el-text class="mx-1" size="large">退款商品</el-text>
<el-select v-model="consumeDetail.refundGoods" placeholder="请选择退款商品" size="large"
style="width: 240px">
<el-option v-for="item in payWay" :key="item.value" :label="item.label"
:value="item.value" />
<el-option v-for="item in product" :key="item.name" :label="item.name"
:value="item.name" />
</el-select>
</div>

15
vue/gold-system/src/views/managerecharge/activity.vue

@ -26,8 +26,8 @@ const getObj = ref({
})
//
const addObj = ref({
add: '',
})
add:''
});
//
//
const delObj = ref({});
@ -100,7 +100,6 @@ const addActicity = function () {
addObj.value = {};
addObj.value.adminId = admin.value.adminId;
addObj.value.adminName = admin.value.name;
addObj.value.dept = admin.value.area;
addObj.value.freeGold = '0';
addObj.value.rechargeRatio = 0;
addObj.value.startTime = null;
@ -111,6 +110,7 @@ const addActicity = function () {
//
const add = async function () {
Ref.value.validate(async (valid) => {
console.log('valid', valid);
if (valid) {
try {
console.log('添加对象', addObj.value);
@ -141,7 +141,6 @@ const add = async function () {
}
})
}
// =========================================================
//
@ -174,8 +173,10 @@ const checkFreeGoldRadio = function (rule, value, callback) {
if (addObj.value.freeGold == 1) {
if (value == '0' || value == null || value == '') {
callback(new Error('请输入免费金币兑换比'))
}else if(value<0||typeof value!='number') {
}else if(value<0||isNaN(value)) {
callback(new Error('请输入正确的格式'));
}else{
callback();
}
} else {
callback()
@ -356,7 +357,7 @@ onMounted(async function () {
<el-dialog v-model="addActivityVisible" title="新增活动" width="500" :before-close="closeAddActivityVisible">
<template #footer>
<el-form :model="addObj" ref="Ref" :rules="rules" label-width="auto" style="max-width: 600px">
<el-form ref="Ref" :model="addObj" :rules="rules" label-width="auto" style="max-width: 600px">
<el-form-item prop="activityName" label="活动名称:">
<el-input v-model="addObj.activityName" placeholder="请输入活动名称" style="width: 220px;" />
@ -384,7 +385,7 @@ onMounted(async function () {
<el-date-picker v-model="addObj.endTime" type="date" placeholder="请选择结束时间" />
</el-form-item>
<el-form-item prop="adminName" label="添加人:">
<el-form-item label="添加人:">
<el-input v-model="addObj.adminName" disabled style="width: 220px;" />
</el-form-item>

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

@ -59,6 +59,10 @@ const payWay = [
value: '借记卡',
label: '借记卡',
},
{
value: '现金充值',
label: '现金充值',
},
]
// ==========================================================
//
@ -382,10 +386,10 @@ onMounted(async function () {
<el-table-column prop="createTime" label="提交时间" width="200px" />
<el-table-column fixed="right" prop="operation" label="操作" width="150px">
<template #default="scope">
<el-popconfirm title="确定将此条活动修改(删除)吗?" @confirm="delConfirm">
<el-popconfirm title="确定将此条活动删除吗?" @confirm="delConfirm">
<template #reference>
<el-button type="primary" text @click="del(scope.row)">
修改
删除
</el-button>
</template>
<template #actions="{ confirm, cancel }">

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

@ -52,6 +52,10 @@ const payWay = [
value: '借记卡',
label: '借记卡',
},
{
value: '现金充值',
label: '现金充值',
},
]
//

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

@ -2,21 +2,31 @@
import { ref, onMounted, reactive, computed } from "vue";
import ElementPlus from "element-plus";
import axios from 'axios';
import { ta } from "element-plus/es/locales.mjs";
//
const tableData = ref([]);
//
const tableAllData=ref([]);
//
const rechargeCoin = ref(0);
const freeCoin = ref(0);
const taskCoin = ref(0);
// ===========================================
//
const total = ref(100);
//
const getTime = ref([]);
// detail
const detail = ref({});
//
const getAllObj =ref({});
//
const getObj = ref({
pageNum: 1,
pageSize: 5,
});
//
const total = ref(100);
//
const getTime = ref([]);
//
const updateType = [
{
@ -35,10 +45,9 @@ const updateType = [
//
const tableHeight = computed(function () {
return (getObj.value.pageSize + 2) * 60 + 'px';
return (getObj.value.pageSize ) * 50 + 'px';
});
//
// ===========================================================================
//
@ -61,15 +70,23 @@ const get = async function (val) {
console.log('搜索参数', getObj.value);
// POST
const result = await axios.post('http://192.168.8.93:10040/detail', { ...getObj.value, detail: { ...detail.value } });
const result2 = await axios.post('http://192.168.8.93:10040/detail', { ...getAllObj.value, detail: { ...detail.value } });
//
console.log('请求成功', result);
console.log('请求成功2', result2);
//
tableData.value = result.data.data.list;
console.log('tableData', tableData.value);
tableAllData.value = result2.data.data;
console.log('tableAllData', tableAllData.value);
//
total.value = result.data.data.total;
console.log('total', total.value);
//
rechargeCoin.value=tableAllData.value.reduce((pre, cur) => pre + cur.rechargeCoin, 0);
freeCoin.value=tableAllData.value.reduce((pre, cur) => pre + cur.freeCoin, 0);
taskCoin.value=tableAllData.value.reduce((pre, cur) => pre + cur.taskCoin, 0);
console.log('各金币总数', rechargeCoin.value, freeCoin.value, taskCoin.value);
} catch (error) {
console.log('请求失败', error);
//
@ -139,7 +156,7 @@ onMounted(async function () {
</div>
<div class="head-card-element">
<el-text class="mx-1" size="large">更新时间</el-text>
<el-time-picker v-model="getTime" is-range range-separator="" start-placeholder="起始时间"
<el-date-picker v-model="getTime" type="daterange" range-separator="" start-placeholder="起始时间"
end-placeholder="结束时间" />
</div>
<div class="head-card-btn">
@ -154,11 +171,11 @@ onMounted(async function () {
<el-col>
<el-card>
<div>
现有金币免费金币充值金币任务金币
现有金币免费金币{{freeCoin}}充值金币{{rechargeCoin}}任务金币{{taskCoin}}
</div>
<div>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="name" label="姓名" />
<el-table :data="tableData" :height="tableHeight" style="width: 100%">
<el-table-column prop="uname" label="姓名" />
<el-table-column prop="jwcode" label="精网号" />
<el-table-column prop="area" label="所属地区" />
<el-table-column prop="gold" label="更新数量">
@ -167,37 +184,55 @@ onMounted(async function () {
</template>
</el-table-column>
<el-table-column prop="updateType" label="更新类型" />
<el-table-column prop="freeCoin" label="免费金币" />
<el-table-column prop="rechargeCoin" label="充值金币" />
<el-table-column prop="taskCoin" label="任务金币" />
<el-table-column prop="name" label="提交人" />
<el-table-column prop="createTime" label="更新时间" />
<el-table-column prop="freeCoin" label="免费金币" />
<el-table-column prop="rechargeCoin" label="充值金币" />
<el-table-column prop="taskCoin" label="任务金币" />
<el-table-column prop="name" label="提交人" />
<el-table-column prop="createTime" label="更新时间" />
</el-table>
</div>
<!-- 分页 -->
<el-pagination background layout="prev, pager, next" :total="total" />
<!-- 分页 -->
<div class="pagination">
<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, 6, 7, 8, 9, 10]" :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">
<div>跳至</div>
<el-input v-model="getObj.pageNum" style="width: 40px;" @change="checkNumber" />
<div></div>
</el-pagination>
</div>
</el-card>
</el-col>
</el-row>
</template>
<style scoped>
.status {
display: flex;
}
<style scoped>
.pagination {
display: flex;
}
.status {
display: flex;
}
.head-card {
display: flex;
}
.head-card {
display: flex;
}
.head-card-element {
margin-right: 20px;
}
.head-card-element {
margin-right: 20px;
}
.head-card-btn {
margin-left: auto;
}
.head-card-btn {
margin-left: auto;
}
</style>

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

@ -4,8 +4,11 @@ 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';
//
//
const totalData = ref({});
//
const getObj = ref({
goldType: '',
@ -170,12 +173,13 @@ const option3 = {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
bottom: '1%',
left: 'center',
orient: 'vertical'
},
series: [
{
name: 'Access From',
name: '全年累计金币数',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
@ -194,12 +198,11 @@ const option3 = {
show: false
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
{ value: 1048, name: '充值金币' },
{ value: 735, name: '免费金币' },
{ value: 580, name: '任务金币' },
],
color: ['#57a5ff', '#7f29ff', '#f2d113']
}
]
};
@ -208,12 +211,13 @@ const option4 = {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
bottom: '1%',
left: 'center',
orient: 'vertical'
},
series: [
{
name: 'Access From',
name: '全年累计消耗金币数',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
@ -232,12 +236,11 @@ const option4 = {
show: false
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
{ value: 1048, name: '充值金币' },
{ value: 735, name: '免费金币' },
{ value: 580, name: '任务金币' },
],
color: ['#57a5ff', '#7f29ff', '#f2d113']
}
]
};
@ -246,12 +249,19 @@ const option5 = {
trigger: 'item'
},
legend: {
top: '5%',
left: 'center'
bottom: '1%',
left: 'center',
orient: 'vertical'
},
grid: {
top: '10%', // 10%使
bottom: '20%', // 10%
left: '10%',
right: '10%'
},
series: [
{
name: 'Access From',
name: '当前金币余量',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
@ -270,12 +280,11 @@ const option5 = {
show: false
},
data: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
]
{ value: 1048, name: '充值金币' },
{ value: 735, name: '免费金币' },
{ value: 580, name: '任务金币' },
],
color: ['#57a5ff', '#7f29ff', '#f2d113']
}
]
};
@ -289,7 +298,7 @@ const option6 = {
},
series: [
{
name: 'Access From',
name: '当前金币余量',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
@ -325,6 +334,22 @@ const list = ref([]);
const get = function () {
console.log(getObj.value);
}
// 1
const get1 = async function () {
try {
// POST
const result = await axios.post('http://192.168.8.147:10070/statistics/getSumCoin');
//
console.log('请求成功', result);
//
totalData.value = result.data.data;
console.log('totalData', totalData.value);
} catch (error) {
console.log('请求失败', error);
//
}
}
//
const allPlatform = function () {
list.value = [
@ -366,9 +391,20 @@ const HomilyLink = function () {
getObj.value.platform = 'HomilyLink';
get();
}
//
//
const formatNum = function (val) {
console.log(val);
if (val === undefined) {
return ''; // toString
} else {
return val.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
}
};
onMounted(function () {
get();
get1();
// domecharts
var rechargeBar = echarts.init(document.getElementById('recharge'));
// 使
@ -414,9 +450,24 @@ onMounted(function () {
<el-card>
<p>当前金币余量
</p>
<p>数据待填充</p>
<p>较前一天数据待填充</p>
<template #footer>充值 免费 任务</template>
<p>
{{ formatNum(totalData.todayTotalCoin) }}
</p>
<p>
<span v-if="totalData.coinDifference > 0">
<div class="comparedWithYesterday">
<span>较前一天 {{ formatNum(totalData.coinDifference) }}</span>
<span class="red-triangle" style="margin: 6px 0px 0px 7px;"></span>
</div>
</span>
<span v-if="totalData.coinDifference < 0">
<div class="comparedWithYesterday">
<span>较前一天 {{ formatNum(totalData.coinDifference) }}</span>
<span class="green-triangle" style="margin: 6px 0px 0px 7px;"></span>
</div>
</span>
</p>
<template #footer>充值{{formatNum(totalData.todayRecharge)}} 免费{{formatNum(totalData.todayFree)}} 任务{{formatNum(totalData.todayTask)}}</template>
</el-card>
</el-col>
<el-col :span="6">
@ -608,6 +659,10 @@ onMounted(function () {
</template>
<style scoped>
.comparedWithYesterday {
display: flex;
}
.ranking-item {
margin-bottom: 10px;
}

1
vue/gold-system/vite.config.ts

@ -4,4 +4,5 @@ import vue from '@vitejs/plugin-vue'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
})
Loading…
Cancel
Save