fix:1,优化
parent
555cbe39be
commit
713ddce547
|
@ -7,4 +7,13 @@ export function superGameList(query) {
|
|||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// 拉取数据
|
||||
export function superFetchDataExcute(data) {
|
||||
return request({
|
||||
url: '/super/fetchData/excute',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
|
@ -32,6 +32,14 @@ export function superGameList(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
// 第三方余额
|
||||
export function superQueryBalance(query) {
|
||||
return request({
|
||||
url: '/super/member/queryBalance',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 更新游戏
|
||||
export function createGameuUpdate(data) {
|
||||
return request({
|
||||
|
@ -64,6 +72,7 @@ export function createGameuUpdateStatus(data) {
|
|||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 平台状态
|
||||
export function createPlatformSwitch(data) {
|
||||
return request({
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('币种')" prop="currencyCode">
|
||||
<CustomSelect v-if="showLoding1" v-model="queryParams.currencyCode" :options="sys_job_group" placeholder="请选择币种" style="width: 200px" />
|
||||
<CustomSelect v-if="showLoding1" v-model="queryParams.currencyCode" clearable filterable :options="sys_job_group" placeholder="请选择币种" style="width: 200px" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="t('游戏类型')" prop="gameType">
|
||||
<CustomSelect v-model="queryParams.gameType" dictKey="ff_game_type" placeholder="请选择游戏类型" style="width: 200px" />
|
||||
|
@ -49,7 +49,7 @@
|
|||
<CustomSelect v-if="showLoding2" v-model="queryParams.gameType" :options="sys_job_statusSelect" placeholder="请选择平台类型" style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('游戏平台')" prop="platformCode">
|
||||
<CustomSelect v-if="showLoding2" v-model="queryParams.platformCode" :options="sys_job_status" placeholder="请选择平台类型" style="width: 200px" />
|
||||
<CustomSelect v-if="showLoding2" v-model="queryParams.platformCode" filterable :options="sys_job_status" placeholder="请选择平台类型" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #right>
|
||||
|
@ -112,7 +112,7 @@
|
|||
import { listAgent, createAgent, selectPlatform } from "@/api/agent";
|
||||
import { superTenantQuotaflow,getSuperBetlist,superCommonPlatSelect } from "@/api/super/tenant";
|
||||
import { getLocalStorage } from "@/utils/auth";
|
||||
import CustomSelect from '@/components/CustomSelect'
|
||||
import CustomSelect from '@/components/CustomSelect';
|
||||
import TableSearchDate from '@/components/TableSearchDate'
|
||||
import Crontab from '@/components/Crontab'
|
||||
import { parseTime } from '@/utils/ruoyi'; // 时间格式化
|
||||
|
@ -140,13 +140,14 @@
|
|||
{ label: proxy.t('商户账号'), value: "account" },
|
||||
{ label: proxy.t('商户状态'), value: "status" },
|
||||
]);
|
||||
const dateRange = ref([]),operateTimeType = ref("");
|
||||
const dateRange = ref([]),operateTimeType = ref("day");
|
||||
const formatType = 'YYYY-MM-DD HH:mm:ss'; // 时间格式
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
currencyCode:'VND',
|
||||
tenantKey: "",
|
||||
},
|
||||
rules: {
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
<el-card :class="['card', card.cardClass]">
|
||||
<div class="card-content">
|
||||
<div class="card-left">
|
||||
<div class="card-title">{{ card.title }}<span v-if="card.cardClass == 'orange' ||card.cardClass == 'yellow' " class="percentage">{{ card.percentage }}</span></div>
|
||||
<div class="card-title">{{ card.title }}</div>
|
||||
|
||||
<div class="card-value">
|
||||
<span class="" :style="card.cardClass =='pink' ? '':card.cardClass =='green'?'':'cursor: pointer;'" @click="goPage(card.cardClass)">{{ card.value }}</span>
|
||||
</div>
|
||||
|
@ -53,26 +54,26 @@
|
|||
// 卡片数据
|
||||
const cards = ref([
|
||||
{
|
||||
title: proxy.t('今日新增'),
|
||||
value: props?.cardData?.totalNewMembers || 0,
|
||||
percentage: (props?.cardData?.newMembersRate || 0) + '%',
|
||||
title: proxy.t('新增商户数'),
|
||||
value: props?.cardData?.newTenants || 0,
|
||||
percentage: '',
|
||||
subtitle: proxy.t('新增会员数')+`<a href="#" class="link" data-type="first" >${props?.cardData?.newMembers || 0}</a>`+proxy.t('人')
|
||||
+proxy.t('新增商户数')+ `<a href="#" class="link" data-type="proxy">${props?.cardData?.newTenants || 0}</a>`+proxy.t('人')
|
||||
+proxy.t('新增代理数')+`<a href="#" class="link" data-type="bigR">${props?.cardData?.newAgents||0}</a> `+proxy.t('人'),
|
||||
+proxy.t('新增商户数')+ `<a href="#" class="link" data-type="proxy">${props?.cardData?.newTenants || 0}</a>`
|
||||
+proxy.t('新增代理数')+`<a href="#" class="link" data-type="bigR">${props?.cardData?.newAgents||0}</a> `,
|
||||
cardClass: 'orange'
|
||||
},
|
||||
{
|
||||
title: proxy.t('总用户统计'),
|
||||
value: props?.cardData?.totalCount||0,
|
||||
title: proxy.t('总商户统计'),
|
||||
value: props?.cardData?.totalTenants||0,
|
||||
percentage: '',
|
||||
subtitle: proxy.t('会员总数')+`<a href="#" class="link" data-type="totalCharge" >${(props?.cardData?.totalMembers||0)}</a>`+proxy.t('人')
|
||||
+' '+proxy.t('商户总数')+`<a href="#" class="link" data-type="totalAgent" >${(props?.cardData?.totalTenants||0)}</a>`+proxy.t('人')
|
||||
+' '+proxy.t('代理总数')+`<a href="#" class="link" data-type="totalBigR">${props?.cardData?.totalAgents||0}</a>`+proxy.t('人次'),
|
||||
+' '+proxy.t('商户总数')+`<a href="#" class="link" data-type="totalAgent" >${(props?.cardData?.totalTenants||0)}</a>`
|
||||
+' '+proxy.t('代理总数')+`<a href="#" class="link" data-type="totalBigR">${props?.cardData?.totalAgents||0}</a>`,
|
||||
cardClass: 'blue',
|
||||
},
|
||||
{
|
||||
title: proxy.t('充提差额'),
|
||||
value: `${props?.cardData?.diffAmount ||0}(U)`,
|
||||
title: proxy.t('商户充值总额'),
|
||||
value: `${props?.cardData?.totalRecharge ||0}(U)`,
|
||||
percentage: '',
|
||||
subtitle: proxy.t('今日充值总额')+`<a href="#" class="link" data-type="differenceRecharge" >${(props?.cardData?.totalRecharge||0)}</a>`
|
||||
+' '+proxy.t('今日充值人数')+`<a href="#" class="link" data-type="differenceWithdrawal" >${(props?.cardData?.totalRechargeUsers||0)}</a>`+proxy.t('人')
|
||||
|
@ -81,16 +82,16 @@
|
|||
cardClass: 'pink',
|
||||
},
|
||||
{
|
||||
title: proxy.t('今日投注'),
|
||||
value: `${props?.cardData?.totalBetAmount ||0}(U)`,
|
||||
percentage: (props?.cardData?.betRate||0)+'%',
|
||||
title: proxy.t('投注金额/输赢金额'),
|
||||
value: `${props?.cardData?.totalBetAmount ||0}(U)/${props?.cardData?.totalProfitLoss ||0}(U)`,
|
||||
percentage:'',
|
||||
subtitle: proxy.t('今日注单总数')+`<a href="#" class="link" data-type="betOnNoteOrder" >${(props?.cardData?.totalBets||0)}</a>`
|
||||
+' '+proxy.t('今日杀率')+`<a href="#" class="link" data-type="betOnKillRate" >${(props?.cardData?.killRate||0)}%</a>`,
|
||||
cardClass: 'yellow',
|
||||
},
|
||||
{
|
||||
title: proxy.t('今日损益'),
|
||||
value: `${props?.cardData?.totalProfitLoss ||0}(U)`,
|
||||
title: proxy.t('商户可用余额'),
|
||||
value: `${Number(props?.cardData?.currentBalance+props?.cardData?.platformBalance).toFixed(4) ||0}(U)`,
|
||||
percentage: '',
|
||||
subtitle: proxy.t('当前商户可用余额')+`<a href="#" class="link" data-type="profitStock" >${(props?.cardData?.currentBalance||0)}</a>`+'(U)'
|
||||
+' '+ proxy.t('当前商户平台余额')+`<a href="#" class="link" data-type="profitStock" >${(props?.cardData?.platformBalance||0)}</a>`+'(U)',
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<el-form-item prop="operateTimeType">
|
||||
<el-radio-group v-model="operateTimeType" @change="timeTypeChange">
|
||||
<!-- <el-radio-button :label="t('日')" value="day" /> -->
|
||||
<el-radio-button :label="t('日')" value="day" />
|
||||
<el-radio-button :label="t('周')" value="week" />
|
||||
<el-radio-button :label="t('月')" value="month" />
|
||||
</el-radio-group>
|
||||
|
@ -10,7 +10,7 @@
|
|||
<el-form-item prop="dateRange">
|
||||
<el-date-picker v-model="dateRange" :shortcuts="shortcuts" :style="`width: ${dateType == 'datetimerange' ? '380px' : '250px'}`"
|
||||
:editable="false" :disabledDate="disabledDate" :type="dateType" :start-placeholder="t('开始时间')"
|
||||
:end-placeholder="t('结束时间')" :format="formatType" value-format="YYYY-MM-DD" @change="dateRangeChange"
|
||||
:end-placeholder="t('结束时间')" :format="formatType" value-format="YYYY-MM-DD HH:mm:ss" @change="dateRangeChange"
|
||||
:clearable="clearable" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
@ -31,7 +31,7 @@ const props = defineProps({
|
|||
});
|
||||
|
||||
const operateTimeType = defineModel('operateTimeType'), dateRange = defineModel('dateRange');
|
||||
const formatType = 'YYYY-MM-DD'; // 时间格式
|
||||
const formatType = 'YYYY-MM-DD HH:mm:ss'; // 时间格式
|
||||
const emits = defineEmits(['dateChange']);
|
||||
const isFirst = ref(true); // 是否第一次加载
|
||||
|
||||
|
@ -54,8 +54,8 @@ const timeTypeChange = (val) => {
|
|||
break
|
||||
case 'week':
|
||||
dateRange.value = [
|
||||
dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD'),
|
||||
dayjs().endOf('day').format('YYYY-MM-DD')
|
||||
dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
||||
dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss')
|
||||
]
|
||||
break
|
||||
case 'month':
|
||||
|
@ -151,8 +151,8 @@ const dateRangeChange = (dataValue) => {
|
|||
|
||||
start.setHours(0, 0, 0); // 设置开始时间为当天的00:00:00点
|
||||
end.setHours(23, 59, 59); // 设置结束时间为当天的23:59:59
|
||||
dateRange.value[0] = dayjs(start).format('YYYY-MM-DD');
|
||||
dateRange.value[1] = dayjs(end).format('YYYY-MM-DD');
|
||||
dateRange.value[0] = dayjs(start).format('YYYY-MM-DD HH:mm:ss');
|
||||
dateRange.value[1] = dayjs(end).format('YYYY-MM-DD HH:mm:ss');
|
||||
}
|
||||
|
||||
// 初始化时不触发父组件的查询
|
||||
|
@ -163,7 +163,7 @@ const dateRangeChange = (dataValue) => {
|
|||
|
||||
// 生成日期区间
|
||||
const getTimeFn = (startTime) => {
|
||||
return [startTime.format('YYYY-MM-DD'), dayjs().endOf('day').format('YYYY-MM-DD')];
|
||||
return [startTime.format('YYYY-MM-DD HH:mm:ss'), dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss')];
|
||||
}
|
||||
|
||||
// 父组件重置
|
||||
|
|
|
@ -154,9 +154,9 @@
|
|||
</el-table-column>
|
||||
</el-table>
|
||||
</div> -->
|
||||
<div class="resclass">
|
||||
<!-- <div class="resclass">
|
||||
<el-button type="primary">... 查看更多</el-button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -180,10 +180,10 @@ import { el } from 'element-plus/es/locales.mjs';
|
|||
const props = defineProps({
|
||||
currencyType: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
default: () => ['VND']
|
||||
}
|
||||
})
|
||||
const operateTimeType = ref('week'); // 操作时间类型
|
||||
const operateTimeType = ref('day'); // 操作时间类型
|
||||
const dataList = ref([]);
|
||||
const getList = () => {
|
||||
let obj = {
|
||||
|
@ -237,6 +237,7 @@ import { el } from 'element-plus/es/locales.mjs';
|
|||
let obj = {
|
||||
operationType:tabPosition.value,
|
||||
timeZone:timeZones,
|
||||
currencyCode:props.currencyType.join(","),
|
||||
startTime:finalTimestamp(dateRange.value[0]),
|
||||
endTime:finalTimestamp(dateRange.value[1]),
|
||||
}
|
||||
|
|
|
@ -239,7 +239,7 @@ import { nextTick } from "vue";
|
|||
const openCron = ref(false);
|
||||
const expression = ref("");
|
||||
const tenantAgentPlatforms = ref([]);
|
||||
const dateRange = ref([]),operateTimeType = ref("");
|
||||
const dateRange = ref([]),operateTimeType = ref("day");
|
||||
const loadingButton = ref(false);
|
||||
const formAll = reactive({
|
||||
currencyAgreement:'0',
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
<div class="app-container home" style="padding: 0px;">
|
||||
<div class="main_box" >
|
||||
<div style="margin-bottom: 15px;" v-hasPermi="['home:data:admin']">
|
||||
<CheckboxSelect v-model="currencyCodes" dataType="currency" collapse-tags collapse-tags-tooltip :placeholder="t('请选择币种')" style="width: 220px;"
|
||||
<CheckboxSelect v-model="currencyCodes" dataType="currency" collapse-tags collapse-tags-tooltip filterable :placeholder="t('请选择币种')" style="width: 220px;"
|
||||
@change="getHomeIndexs" @allSelect="getHomeIndexs"></CheckboxSelect>
|
||||
<CheckboxSelect v-model="platformCodes" dataType="platformSelectList" collapse-tags collapse-tags-tooltip :placeholder="t('请选择平台')" style="width: 220px;"
|
||||
<CheckboxSelect v-model="platformCodes" dataType="platformSelectList" collapse-tags collapse-tags-tooltip filterable :placeholder="t('请选择平台')" style="width: 220px;"
|
||||
@change="getHomeIndexs" @allSelect="getHomeIndexs"></CheckboxSelect>
|
||||
<CheckboxSelect v-model="tenantKeys" dataType="tenantSelectList" collapse-tags collapse-tags-tooltip :placeholder="t('请选择商户')" style="width: 220px;"
|
||||
@change="getHomeIndexs" @allSelect="getHomeIndexs"></CheckboxSelect>
|
||||
|
@ -23,10 +23,10 @@
|
|||
<operation-card :currencyType="currencyCodes"></operation-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div style="margin-bottom: 15px;" v-hasPermi="['home:data:tenant']">
|
||||
<CheckboxSelect v-model="currencyCodes" dataType="currency" collapse-tags collapse-tags-tooltip :placeholder="t('请选择币种')" style="width: 220px;"
|
||||
<div style="margin-bottom: 15px;" v-if="auth.hasPermi('home:data:tenant')" v-hasPermi="['home:data:tenant']">
|
||||
<CheckboxSelect v-model="currencyCodes" dataType="currency" collapse-tags collapse-tags-tooltip filterable :placeholder="t('请选择币种')" style="width: 220px;"
|
||||
@change="getHomerealTimeFocusTenants" @allSelect="getHomerealTimeFocusTenants"></CheckboxSelect>
|
||||
<CheckboxSelect v-model="platformCodes" dataType="platformSelectList" collapse-tags collapse-tags-tooltip :placeholder="t('请选择平台')" style="width: 220px;"
|
||||
<CheckboxSelect v-model="platformCodes" dataType="platformSelectList" collapse-tags collapse-tags-tooltip filterable :placeholder="t('请选择平台')" style="width: 220px;"
|
||||
@change="getHomerealTimeFocusTenants" @allSelect="getHomerealTimeFocusTenants"></CheckboxSelect>
|
||||
</div>
|
||||
<el-row v-hasPermi="['home:data:tenant']">
|
||||
|
@ -58,7 +58,7 @@ import CheckboxSelect from '@/components/CheckboxSelect';
|
|||
import auth from '@/plugins/auth'
|
||||
import {getHomeIndex,getHomerealTimeFocusTenant} from "@/api/home";
|
||||
import { nextTick } from "vue";
|
||||
const currencyCodes = ref([]);
|
||||
const currencyCodes = ref(['VND']);
|
||||
const platformCodes = ref([]);
|
||||
const tenantKeys = ref([]);
|
||||
const cardData = ref({});
|
||||
|
|
|
@ -311,6 +311,7 @@ const gooleCode = ref('');// google验证码
|
|||
const goodDialogShow = ref(false);
|
||||
const handleClose = () => {
|
||||
goodDialogVisible.value = false;
|
||||
loading.value = false;
|
||||
};
|
||||
const clickVisible = () => {
|
||||
loading.value = false;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('币种')" prop="currencyCode">
|
||||
<CustomSelect v-if="showLoding1" v-model="queryParams.currencyCode" :options="sys_job_group" placeholder="请选择币种" style="width: 200px" />
|
||||
<CustomSelect v-if="showLoding1" v-model="queryParams.currencyCode" filterable :options="sys_job_group" clearable placeholder="请选择币种" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #right>
|
||||
|
@ -39,13 +39,21 @@
|
|||
<el-table v-loading="loading" :data="agentList" class="c-table-main" border>
|
||||
<!-- <el-table-column type="selection" width="55" align="center" /> -->
|
||||
<el-table-column :label="t('商户账号')" align="center" prop="tenantKey" />
|
||||
<el-table-column :label="t('平台')" align="center" prop="platformCode" :show-overflow-tooltip="true" />
|
||||
<el-table-column :label="t('玩家账号')" align="center" prop="memberAccount" :show-overflow-tooltip="true" />
|
||||
<el-table-column :label="t('三方玩家账号')" align="center" prop="gameAccount" :show-overflow-tooltip="true" />
|
||||
<el-table-column :label="t('平台')" align="center" prop="platformCode" />
|
||||
<el-table-column :label="t('玩家账号')" align="center" prop="memberAccount" />
|
||||
<el-table-column :label="t('三方玩家账号')" align="center" prop="gameAccount" />
|
||||
<el-table-column :label="t('平台币种')" align="center" prop="currencyCode" />
|
||||
<el-table-column :label="t('创建时间')" align="center" prop="createTime" :show-overflow-tooltip="true">
|
||||
<el-table-column :label="t('创建时间')" align="center" prop="createTime" >
|
||||
<template #default="scope">{{ parseTime(scope.row.createTime) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="t('第三方余额')" align="center" min-width="130" prop="useCost">
|
||||
<template #default="scope">
|
||||
|
||||
<span v-if="scope.row.balance > 0" class="text-navy">{{ scope.row.balance }}</span>
|
||||
<span v-if="scope.row.balance <= 0" class="text-danger">{{ scope.row.balance }}</span>
|
||||
<el-button link type="primary" @click="handleQueryBalance(scope.row)">{{ t('查看余额') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column :label="t('操作')" align="center" width="200" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleView(scope.row)" v-hasPermi="['agent:tenant:view']">{{ t('详情') }}</el-button>
|
||||
|
@ -158,6 +166,8 @@
|
|||
<script setup name="Agent">
|
||||
import { listAgent, createAgent, selectPlatform } from "@/api/agent";
|
||||
import { getSuperMemberList } from "@/api/super/tenant";
|
||||
import {superQueryBalance} from "@/api/super/platform";
|
||||
|
||||
import { getLocalStorage } from "@/utils/auth";
|
||||
import CustomSelect from '@/components/CustomSelect'
|
||||
import Crontab from '@/components/Crontab'
|
||||
|
@ -188,6 +198,7 @@ import { nextTick } from "vue";
|
|||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orderByColumn: "create_time",
|
||||
currencyCode: "VND",
|
||||
isAsc:'desc',
|
||||
memberAccount: "",
|
||||
gameAccount:""
|
||||
|
@ -291,7 +302,13 @@ import { nextTick } from "vue";
|
|||
open.value = true;
|
||||
title.value = proxy.t('添加商户');
|
||||
}
|
||||
|
||||
const handleQueryBalance = (row) => {
|
||||
superQueryBalance(row).then(res => {
|
||||
row.balance = res.data.balance
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
function queryCode(type) {
|
||||
form.value.tenantAgentPlatforms = form.value.tenantAgentPlatforms.map((item, index) => {
|
||||
if (type === 'del' && item.cost > tenantAgentPlatforms.value[index].cost) {
|
||||
|
|
|
@ -1,20 +1,23 @@
|
|||
<template>
|
||||
<!-- 添加或修改定时任务对话框 -->
|
||||
<el-dialog v-model="showDialog" align-center width="920px" append-to-body>
|
||||
<el-dialog v-model="showDialog" align-center width="1500px" style="height: 700px;" append-to-body>
|
||||
|
||||
<template #header>
|
||||
<div style="width: 100%;text-align: center;">{{ t('调额') }}</div>
|
||||
</template>
|
||||
<el-scrollbar max-height="600px">
|
||||
<el-scrollbar max-height="700px">
|
||||
<div style="width: 100%;display: flex;justify-content: space-between;">
|
||||
<el-form ref="form" :model="form" label-width="120px">
|
||||
<!-- <el-form-item :label="t('商户账号')" prop="tenantKey">
|
||||
<el-input v-model="form.tenantKey" style="width: 240px;" placeholder="请输入商户账号" />
|
||||
</el-form-item> -->
|
||||
<el-form-item :label="t('额度类型')" prop="quotaType">
|
||||
<CustomSelect v-if="loding1" v-model="platAdjustment.quotaType" :options="quotaTypeArr" @change="handleAdjustment(modifyDate);" placeholder="请选择类型" style="width: 200px" />
|
||||
<el-form-item :label="t('币种类型')" prop="currencyCode">
|
||||
<CustomSelect v-model="platAdjustment.currencyCode" :options="currencyCodesOptions" filterable @change="handleAdjustment(modifyDate);" placeholder="请选择类型" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div><el-button @click="handleAddType" type="primary" v-h="['super:tenant:quota:add']" plain icon="Plus">新增</el-button></div>
|
||||
<div>
|
||||
<el-button @click="handleAddType" type="primary" v-h="['super:tenant:quota:add']" plain icon="Plus">新增</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="platAdjustmentList" class="" border>
|
||||
<el-table-column :label="t('商户账号')" align="center" prop="tenantKey" />
|
||||
|
@ -23,26 +26,25 @@
|
|||
{{ row.currencyCode ? row.currencyCode : '--' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="t('平台')" align="center" prop="platformName">
|
||||
<el-table-column :label="t('可用额度')" align="center" prop="cost">
|
||||
<template #default="{ row }">
|
||||
{{ row.platformName ? row.platformName : '--' }}
|
||||
{{ row.realBalance }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="t('额度类型')" align="center" prop="cost">
|
||||
<el-table-column :label="t('信誉额度')" align="center" prop="cost">
|
||||
<template #default="{ row }">
|
||||
{{ row.quotaTypeName }}
|
||||
<!-- <span v-if="row.quotaType == 'BALANCE'">{{ t('可用额度') }}</span>
|
||||
<span v-if="row.quotaType == 'DEPOSIT'">{{ t('押金') }}</span>
|
||||
<span v-if="row.quotaType == 'REAL_BALANCE'">{{ t('信誉额度') }}</span> -->
|
||||
{{ row.creditBalance }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="t('游戏额度')" align="center" prop="balance" width="230px">
|
||||
<el-table-column :label="t('平台额度')" align="center" prop="balance">
|
||||
<template #default="{ row }">
|
||||
<span>{{sumPlatformBalance(row.platformBalanceJson)}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="t('操作')" align="center" prop="balance" width="130px">
|
||||
<template #default="{ row }">
|
||||
<div style="display: flex;justify-content: space-between;align-items: center;">
|
||||
<span>{{ getcurrencySign(row.currencyCode) }}{{ row.balance }}</span>
|
||||
<!-- <el-button @click="handleReduce($event,row)">-</el-button>
|
||||
<el-input v-model="row.balance" disabled :min="0" @change="handleChange($event,row)" :max="9999999999999999" />
|
||||
<el-button @click="handleAdd($event,row)">+</el-button> -->
|
||||
|
||||
<el-button @click="handleAdd($event,row)">调额</el-button>
|
||||
</div>
|
||||
|
||||
|
@ -56,7 +58,8 @@
|
|||
<el-dialog :title="t('新增')" align-center v-model="openCreditType" width="520px" append-to-body>
|
||||
<el-form ref="formCreditTypes" v-if="openCreditType" :model="formCreditType" :rules="rulesCreditType" label-width="120px">
|
||||
<el-form-item :label="t('额度类型')" prop="quotaType">
|
||||
<CustomSelect v-if="loding1" v-model="formCreditType.quotaType" :options="quotaTypeArr" placeholder="请选择类型" style="width: 200px" />
|
||||
<CustomSelect v-if="loding1" v-model="formCreditType.quotaType" :disabledOptions="modifyDate.tenantType == 1?['REPUTATION']:['BALANCE']" :options="quotaTypeArr" placeholder="请选择类型" style="width: 200px" />
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('币种')" prop="currencyCode">
|
||||
<CustomSelect v-model="formCreditType.currencyCode" :options="currencyCodeArr" placeholder="请选择币种" style="width: 200px" />
|
||||
|
@ -72,30 +75,39 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog v-if="visible" v-model="visible" align-center :title="t('调额')" width="500px">
|
||||
<el-dialog v-if="visible" v-model="visible" align-center :title="t('调额')" width="920px">
|
||||
<el-descriptions :column="1" border>
|
||||
<!-- <el-descriptions-item label="商户ID">kooriookami</el-descriptions-item> -->
|
||||
<el-descriptions-item label="商户名称">{{formAdjustment.tenantKey}}</el-descriptions-item>
|
||||
<el-descriptions-item label="币种">{{formAdjustment.currencyCode}}</el-descriptions-item>
|
||||
|
||||
</el-descriptions>
|
||||
<el-divider />
|
||||
<div style="width: 100%;display: flex;margin-bottom: 8px;align-items: center;">
|
||||
<div style="width: 120px;text-align: right;padding-right: 12px;">
|
||||
<span style="font-size: 16px;">{{ t('余额') }}</span>
|
||||
</div>
|
||||
<div><span style="color: #FF4D4F;">{{getcurrencySign(formAdjustment.currencyCode)}} {{ formAdjustment.balance||'00' }}</span></div>
|
||||
</div>
|
||||
<el-form :model="formAdjustment" :rules="rulesAdjustment" ref="formAdjustmentRef" label-width="120px">
|
||||
<el-form-item label="额度" prop="balance">
|
||||
<div>
|
||||
<NumberInput v-model="formAdjustment.balance" :minus="true" digit="4" :placeholder="t('请输入额度')">
|
||||
|
||||
<template #prepend>{{ getcurrencySign(formAdjustment.currencyCode) }}</template>
|
||||
<el-form :model="formAdjustment" :rules="rulesAdjustment" ref="formAdjustmentRef" label-width="120px">
|
||||
<el-form-item label="可用额度" prop="balanceReal">
|
||||
<div style="width: 100%;">
|
||||
<NumberInput style="width: 100%;" v-model="formAdjustment.balanceReal" :disabled="modifyDate.tenantType == 2" :minus="true" digit="4" :placeholder="t('请输入额度')">
|
||||
<template #prepend>{{ getcurrencySign(formAdjustment.currencyCode) }} {{ formAdjustment.realBalance }}</template>
|
||||
</NumberInput>
|
||||
</div>
|
||||
<div>
|
||||
{{ t('如需扣余额,则输入负数,例如:-10.50') }}
|
||||
</el-form-item>
|
||||
<el-form-item label="信誉额度" prop="balanceCredit">
|
||||
<div style="width: 100%;">
|
||||
<NumberInput style="width: 100%;" v-model="formAdjustment.balanceCredit" :disabled="modifyDate.tenantType == 1" :minus="true" digit="4" :placeholder="t('请输入额度')">
|
||||
<template #prepend>{{ getcurrencySign(formAdjustment.currencyCode) }} {{ formAdjustment.creditBalance }}</template>
|
||||
</NumberInput>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="平台额度" prop="platformBalanceJson">
|
||||
<el-table :data="parsePlatformBalance(formAdjustment.platformBalanceJson)" height="200" ref="myTable" >
|
||||
<el-table-column :label="t('平台')" align="center" prop="name" />
|
||||
<el-table-column :label="t('余额')" align="center" prop="balance" />
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
<div style="margin-left: 120px;margin-bottom: 10px;">
|
||||
{{ t('如需扣余额,则输入负数,例如:-10.50') }}
|
||||
</div>
|
||||
<el-form-item :label="t('谷歌验证码')" prop="googleCode">
|
||||
<el-input v-model="formAdjustment.googleCode" :placeholder="t('请输入谷歌验证码')" />
|
||||
</el-form-item>
|
||||
|
@ -138,6 +150,11 @@ const props = defineProps({ // 父组件向子组件传值
|
|||
}
|
||||
|
||||
})
|
||||
let resData = getLocalStorage('currencySelect');
|
||||
const currencyCodesOptions = ref([]);
|
||||
currencyCodesOptions.value = resData.map(item => {
|
||||
return { label:`${item.currencyName}(${item.currencyCode})`, value: item.currencyCode }
|
||||
})
|
||||
const currencySelectAll = getLocalStorage('currencySelect').map(item => {
|
||||
return {...item, label: item.currencyCode, value: item.currencyCode }
|
||||
});
|
||||
|
@ -179,7 +196,6 @@ const formCreditType = ref({
|
|||
})
|
||||
const getcurrencySign = (val) => {
|
||||
let currencySignItem = currencySelectAll.find(item => item.value == val);
|
||||
console.log(currencySignItem)
|
||||
return currencySignItem.currencySign
|
||||
}
|
||||
const rulesCreditType = ref({
|
||||
|
@ -196,7 +212,68 @@ const rules = ref({
|
|||
realBalanceNum: [{ required: true, message: proxy.t('信誉额度不能为空'), trigger: "change" }],
|
||||
})
|
||||
const rulesAdjustment = ref({
|
||||
balance: [{ required: true, message: proxy.t('调额额度不能为空'), trigger: "change" }],
|
||||
balanceReal: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
// 1. 如果禁用,不校验
|
||||
if (props.modifyDate.tenantType == 2) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
// 2. 必填
|
||||
if (value === '' || value === null || value === undefined) {
|
||||
return callback(new Error("请输入可用额度"));
|
||||
}
|
||||
|
||||
const num = Number(value);
|
||||
const realBalance = Number(formAdjustment.value.realBalance);
|
||||
|
||||
// 3. 如果是负数,绝对值不能超过 realBalance
|
||||
if (num < 0) {
|
||||
if (Math.abs(num) > realBalance) {
|
||||
return callback(
|
||||
new Error(`要减的额度绝对值不能超过可用余额 ${realBalance}`)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 通过
|
||||
return callback();
|
||||
},
|
||||
trigger: "change"
|
||||
}
|
||||
],
|
||||
balanceCredit: [
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
// 1. 如果禁用,不校验
|
||||
if (props.modifyDate.tenantType == 1) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
// 2. 必填
|
||||
if (value === '' || value === null || value === undefined) {
|
||||
return callback(new Error("请输入额度"));
|
||||
}
|
||||
|
||||
const num = Number(value);
|
||||
const creditBalance = Number(formAdjustment.value.creditBalance);
|
||||
|
||||
// 3. 如果是负数,绝对值不能超过 creditBalance
|
||||
if (num < 0) {
|
||||
if (Math.abs(num) > creditBalance) {
|
||||
return callback(
|
||||
new Error(`要减的额度绝对值不能超过信誉余额 ${creditBalance}`)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 通过
|
||||
return callback();
|
||||
},
|
||||
trigger: "change"
|
||||
}
|
||||
],
|
||||
googleCode: [{ required: true, message: proxy.t('谷歌验证码不能为空'), trigger: "change" }],
|
||||
})
|
||||
const platAdjustment = ref({
|
||||
|
@ -216,6 +293,43 @@ const handleAdjustment = (row) => {
|
|||
|
||||
})
|
||||
}
|
||||
|
||||
//
|
||||
const sumPlatformBalance = (jsonStr) => {
|
||||
|
||||
try {
|
||||
// 转成对象
|
||||
const obj = JSON.parse(jsonStr);
|
||||
|
||||
// 累加所有 value
|
||||
return Object.values(obj).reduce((sum, val) => sum + Number(val), 0).toFixed(4);
|
||||
} catch (e) {
|
||||
// console.error("JSON 解析失败:", e);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
//
|
||||
const parsePlatformBalance = (jsonStr) => {
|
||||
|
||||
try {
|
||||
const obj = JSON.parse(jsonStr);
|
||||
|
||||
// 遍历生成数组
|
||||
const result = Object.entries(obj).map(([key, value]) => {
|
||||
// 取前缀("_" 前面的部分,比如 "AG_VND_FALSE" → "AG")
|
||||
const name = key.split("_")[0];
|
||||
return {
|
||||
name,
|
||||
balance: Number(value)
|
||||
};
|
||||
});
|
||||
|
||||
return result;
|
||||
} catch (e) {
|
||||
// console.error("JSON 解析失败:", e);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
//修改时数据更新区域
|
||||
nextTick(() => {
|
||||
handleAdjustment(props.modifyDate);
|
||||
|
@ -270,37 +384,44 @@ superCommonCurrencySelects();
|
|||
superCommonQuotaTypeSelects();
|
||||
const openCreditType = ref(false);
|
||||
const handleAddType = (value) => {
|
||||
openCreditType.value = true;
|
||||
if (!platAdjustment.value.currencyCode){
|
||||
ElMessage.warning('请选择币种!');
|
||||
return
|
||||
}
|
||||
// openCreditType.value = true;
|
||||
visible.value = true;
|
||||
formAdjustment.value.id = '';
|
||||
formAdjustment.value.platformBalanceJson = '{}';
|
||||
formAdjustment.value.realBalance = 0;
|
||||
formAdjustment.value.creditBalance = 0;
|
||||
formAdjustment.value.tenantKey = props.modifyDate.tenantKey;
|
||||
formAdjustment.value.currencyCode = platAdjustment.value.currencyCode;
|
||||
}
|
||||
const visible = ref(false);
|
||||
const handleAdd = (value,row) => {
|
||||
let rowOpen = JSON.parse(JSON.stringify(row));
|
||||
visible.value = true;
|
||||
formAdjustment.value.id = row.id;
|
||||
formAdjustment.value.googleCode = '';
|
||||
formAdjustment.value.balance = row.balance
|
||||
formAdjustment.value.currencyCode = row.currencyCode;
|
||||
formAdjustment.value.tenantKey = row.tenantKey;
|
||||
|
||||
|
||||
}
|
||||
//减金额
|
||||
const handleReduce = (value,row) => {
|
||||
visible.value = true;
|
||||
formAdjustment.value.id = row.id;
|
||||
formAdjustment.value.isOut = false;
|
||||
formAdjustment.value.googleCode = '';
|
||||
formAdjustment.value.balance = ''
|
||||
formAdjustment.value.id = rowOpen.id;
|
||||
formAdjustment.value = rowOpen;
|
||||
}
|
||||
const onSubmit = () => {
|
||||
proxy.$refs["formAdjustmentRef"].validate(valid => {
|
||||
if (valid) {
|
||||
let numBalance = 0;
|
||||
if(Number(formAdjustment.value.balance) <= 0){
|
||||
if(Number(formAdjustment.value.balanceReal) <= 0 || Number(formAdjustment.value.balanceCredit) <= 0){
|
||||
formAdjustment.value.isOut = false;
|
||||
numBalance = Math.abs(formAdjustment.value.balance)
|
||||
}else{
|
||||
if (formAdjustment.value.balanceReal !=0){
|
||||
numBalance = Math.abs(formAdjustment.value.balanceReal);
|
||||
}else if (formAdjustment.value.balanceCredit !=0){
|
||||
numBalance = Math.abs(formAdjustment.value.balanceCredit);
|
||||
}
|
||||
}else{
|
||||
formAdjustment.value.isOut = true;
|
||||
numBalance = formAdjustment.value.balance
|
||||
if (formAdjustment.value.balanceReal !=0){
|
||||
numBalance = formAdjustment.value.balanceReal
|
||||
}else if (formAdjustment.value.balanceCredit ==0){
|
||||
numBalance = formAdjustment.value.balanceCredit;
|
||||
}
|
||||
}
|
||||
let obj = {
|
||||
id: formAdjustment.value.id,
|
||||
|
@ -359,6 +480,8 @@ function submitForm() {
|
|||
openCreditType.value = false;
|
||||
formCreditTypes.value?.resetFields()
|
||||
handleAdjustment(props.modifyDate);
|
||||
}).catch(() => {
|
||||
loadingButton.value = false;
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
<div class="app-container">
|
||||
<table-search-card :leftSpan="20" :model="queryParams" @getList="getList" @handleQuery="handleQuery" @resetQuery="resetQuery">
|
||||
<template #left>
|
||||
<table-search-date v-model:dateRange="dateRange" v-model:operateTimeType="operateTimeType"></table-search-date>
|
||||
<el-form-item :label="t('商户账号')" prop="tenantKey">
|
||||
<el-input
|
||||
v-model="queryParams.tenantKey"
|
||||
|
@ -30,7 +31,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('币种')" prop="currencyCode">
|
||||
<CustomSelect v-if="showLoding1" v-model="queryParams.currencyCode" :options="sys_job_group" placeholder="请选择币种" style="width: 200px" />
|
||||
<CustomSelect v-if="showLoding1" v-model="queryParams.currencyCode" filterable :options="sys_job_group" placeholder="请选择币种" style="width: 200px" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item :label="t('平台类型')" prop="platformCode">
|
||||
<CustomSelect v-if="showLoding2" v-model="queryParams.platformCode" :options="sys_job_status" placeholder="请选择平台类型" style="width: 200px" />
|
||||
|
@ -39,10 +40,10 @@
|
|||
<CustomSelect v-model="queryParams.quotaType" :options="quotaTypeArr" placeholder="请选择类型" style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('游戏平台')" prop="platformCode">
|
||||
<CustomSelect v-if="showLoding3" v-model="queryParams.platformCode" :options="quotaplatformCodeArr" placeholder="请选择平台" style="width: 200px" />
|
||||
<CustomSelect v-if="showLoding3" v-model="queryParams.platformCode" :options="quotaplatformCodeArr" filterable placeholder="请选择平台" style="width: 200px" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="t('开始时间')" prop="params.beginTime">
|
||||
<!-- <el-form-item :label="t('开始时间')" prop="params.beginTime">
|
||||
<el-date-picker
|
||||
v-model="queryParams.params.beginTime"
|
||||
type="date"
|
||||
|
@ -57,7 +58,7 @@
|
|||
:placeholder="t('请选择结束时间')"
|
||||
:default-value="new Date()"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
</template>
|
||||
<!-- <template #right>
|
||||
<el-button type="primary" @click="handleAdd">{{ t('新增商户') }}</el-button>
|
||||
|
@ -72,12 +73,12 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column :label="t('前缀')" width="100" align="center" prop="tenantSn" /> -->
|
||||
<el-table-column :label="t('玩家账号')" align="center" prop="memberAccount" :show-overflow-tooltip="true" >
|
||||
<el-table-column :label="t('玩家账号')" align="center" prop="memberAccount" min-width="120px" :show-overflow-tooltip="true" >
|
||||
<template #default="{row}">
|
||||
{{ row.memberAccount? row.memberAccount : '--' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="t('游戏账号')" align="center" prop="gameAccount" :show-overflow-tooltip="true" >
|
||||
<el-table-column :label="t('游戏账号')" align="center" prop="gameAccount" min-width="130px" :show-overflow-tooltip="true" >
|
||||
<template #default="{row}">
|
||||
{{ row.gameAccount? row.gameAccount : '--' }}
|
||||
</template>
|
||||
|
@ -220,14 +221,15 @@
|
|||
import { getLocalStorage } from "@/utils/auth";
|
||||
import CopyIcon from '@/components/CopyIcon'
|
||||
import CustomSelect from '@/components/CustomSelect'
|
||||
import TableSearchDate from '@/components/TableSearchDate'
|
||||
import IconTips from '@/components/IconTips'
|
||||
import { parseTime } from '@/utils/ruoyi'; // 时间格式化
|
||||
import { nextTick } from "vue";
|
||||
import { nextTick, onMounted } from "vue";
|
||||
import { get } from "@vueuse/core";
|
||||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { ff_tenant_type, ff_tenant_status } = proxy.useDict("ff_tenant_type", "ff_tenant_status");
|
||||
|
||||
const dateRange = ref([]),operateTimeType = ref("day");
|
||||
|
||||
const agentList = ref([]);
|
||||
const open = ref(false);
|
||||
|
@ -248,17 +250,22 @@ import { get } from "@vueuse/core";
|
|||
{ label: proxy.t('商户账号'), value: "account" },
|
||||
{ label: proxy.t('商户状态'), value: "status" },
|
||||
]);
|
||||
const today = new Date();
|
||||
const yyyy = today.getFullYear();
|
||||
const mm = String(today.getMonth() + 1).padStart(2, '0');
|
||||
const dd = String(today.getDate()).padStart(2, '0');
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orderByColumn:'createTime',
|
||||
currencyCode: 'VND',
|
||||
isAsc:'desc',
|
||||
params:{
|
||||
beginTime:'',
|
||||
endTime:'',
|
||||
},
|
||||
// params:{
|
||||
// beginTime: `${yyyy}-${mm}-${dd} 00:00:00`,
|
||||
// endTime: `${yyyy}-${mm}-${dd} 23:59:59`
|
||||
// },
|
||||
tenantKey: "",
|
||||
memberAccount:''
|
||||
},
|
||||
|
@ -279,7 +286,7 @@ import { get } from "@vueuse/core";
|
|||
/** 查询列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
superTenantQuotaflow(queryParams.value).then(response => {
|
||||
superTenantQuotaflow(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => {
|
||||
agentList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
|
@ -427,10 +434,13 @@ const getsuperCommonPlatformTypeSelect = async () => {
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
getList();
|
||||
getsuperCommonCurrencySelect();
|
||||
getsuperCommonPlatformTypeSelect();
|
||||
//初始化
|
||||
onMounted(() => {
|
||||
getList();
|
||||
getsuperCommonCurrencySelect();
|
||||
getsuperCommonPlatformTypeSelect();
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<table-search-card :model="queryParams" @getList="getList" @handleQuery="handleQuery" @resetQuery="resetQuery">
|
||||
<template #left>
|
||||
<el-form-item :label="t('游戏平台')" prop="platformCode">
|
||||
<CustomSelect v-if="showLoding2" v-model="queryParams.platformCode" :options="sys_job_status" placeholder="请选择游戏平台" style="width: 200px" />
|
||||
<CustomSelect v-if="showLoding2" v-model="queryParams.platformCode" :options="sys_job_status" filterable placeholder="请选择游戏平台" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #right>
|
||||
|
@ -39,7 +39,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column :label="t('状态')" align="center" prop="stopStatus" >
|
||||
<template #default="{row}">
|
||||
<base-switch v-model="row.stopStatus" v-hasPermi="['super:platform:switch']" :active-value="true" :inactive-value="false"
|
||||
<base-switch v-model="row.stopStatus" v-hasPermi="['super:platform:switch']" :active-value="false" :inactive-value="true"
|
||||
:before-change="() => beforeSwitchChange(row, 'stopStatus')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -170,9 +170,12 @@
|
|||
</el-form-item>
|
||||
<div style="height: 20px;"></div>
|
||||
</el-form>
|
||||
<div style="margin-bottom: 10px;text-align: right;" v-if="rowOpenRevise.id != ''">
|
||||
<CustomSelect v-model="currencyCodes" :options="currencyCodesOptions" placeholder="请选择币种" style="width: 200px;margin-right: 10px;" />
|
||||
<el-button type="primary" @click="addCurrency">{{ t('新增') }}</el-button>
|
||||
<div style="margin-bottom: 10px;display: flex;justify-content: space-between;" v-if="rowOpenRevise.id != ''">
|
||||
<div>{{ t('禁用币种') }}</div>
|
||||
<div>
|
||||
<CustomSelect v-model="currencyCodes" :options="currencyCodesOptions" filterable placeholder="请选择币种" style="width: 200px;margin-right: 10px;" />
|
||||
<el-button type="primary" @click="addCurrency">{{ t('新增') }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table v-if="rowOpenRevise.id != ''" :data="rowOpenRevise.gameCurrencies" row-key="id" border>
|
||||
<el-table-column prop="gameId" label="游戏ID" />
|
||||
|
@ -489,6 +492,8 @@ const switchBeforeChange = () => {
|
|||
const handleOpenRevise = (row) => {
|
||||
Object.assign(rowOpenRevise, row);
|
||||
openRevise.value = true;
|
||||
currencyCodes.value = 'VND';
|
||||
|
||||
}
|
||||
const gameCurrencies = ref([]);
|
||||
|
||||
|
@ -533,7 +538,7 @@ const gameCurrencies = ref([]);
|
|||
// form.value.tenantAgentPlatforms = response.data;
|
||||
// tenantAgentPlatforms.value = JSON.parse(JSON.stringify(response.data));
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<el-input v-model="queryParams.platformName" style="width: 200px" placeholder="请输入接口名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('游戏平台')" prop="platformShowCode">
|
||||
<CustomSelect v-if="showLoding2" v-model="queryParams.platformShowCode" :options="sys_job_status" placeholder="请选择游戏平台" style="width: 200px" />
|
||||
<CustomSelect v-if="showLoding2" v-model="queryParams.platformShowCode" filterable :options="sys_job_status" placeholder="请选择游戏平台" style="width: 200px" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="t('开启状态')" prop="stopStatus">
|
||||
<CustomSelect v-if="showLoding2" v-model="queryParams.stopStatus" :options="stopStatusOptions" placeholder="请选择开启状态" style="width: 200px" />
|
||||
|
@ -125,7 +125,7 @@
|
|||
</el-dialog>
|
||||
|
||||
<!-- 修改平台 -->
|
||||
<el-dialog :title="rowOpenRevise.id == '' ? t('新增平台') : t('修改平台')" align-center v-model="openRevise" width="1300px" append-to-body>
|
||||
<el-dialog v-if="openRevise" :title="rowOpenRevise.id == '' ? t('新增平台') : t('修改平台')" align-center v-model="openRevise" width="1300px" append-to-body>
|
||||
<el-form ref="openReviseRef" :model="rowOpenRevise" :rules="ruleForm" label-width="120px">
|
||||
<el-descriptions border :column="2" class="c-descriptions" >
|
||||
<el-descriptions-item label-width="150" label-align="right" :label="t('平台代码')">
|
||||
|
@ -259,6 +259,7 @@
|
|||
<script setup name="Agent">
|
||||
import { superPlatformList, createPlatformUpdate,createPlatformAdd,superGameList,createGameuUpdate,getSuperPlatformInf,createPlatformSwitch,getPlatformShowSelect,updatePlatformCurrency } from "@/api/super/platform.js";
|
||||
import { superCommonPlatformTypeSelect } from "@/api/super/tenant";
|
||||
import { getSuperPlatformSelectList } from "@/api/home";
|
||||
import Crontab from '@/components/Crontab'
|
||||
import { getLocalStorage } from '@/utils/auth'
|
||||
import { parseTime } from '@/utils/ruoyi'; // 时间格式化
|
||||
|
@ -524,7 +525,7 @@ const sys_job_status = ref([]);
|
|||
const showLoding2 = ref(true);
|
||||
const getsuperCommonPlatformTypeSelect = async () => {
|
||||
showLoding2.value = false;
|
||||
getPlatformShowSelect().then(response => {
|
||||
getSuperPlatformSelectList({}).then(response => {
|
||||
sys_job_status.value = response.data.map(item => {
|
||||
return { label: item.platformName, value: item.platformCode }
|
||||
});
|
||||
|
@ -701,9 +702,15 @@ const switchBeforeChange = () => {
|
|||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
rowOpenRevise.id = '';
|
||||
rowOpenRevise.type = 1;
|
||||
openRevise.value = true;
|
||||
openRevise.value = false;
|
||||
nextTick(() => {
|
||||
openRevise.value = true;
|
||||
Object.keys(rowOpenRevise).forEach(key => {
|
||||
delete rowOpenRevise[key]
|
||||
})
|
||||
rowOpenRevise.id = '';
|
||||
rowOpenRevise.type = 1;
|
||||
});
|
||||
}
|
||||
|
||||
function queryCode(type) {
|
||||
|
|
|
@ -180,7 +180,7 @@ const multiple = ref(true);
|
|||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const dateRange = ref([]);
|
||||
|
||||
const oldForm = shallowRef({ });
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
|
@ -263,6 +263,9 @@ function handleUpdate(row) {
|
|||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改参数";
|
||||
setTimeout(() => {
|
||||
oldForm.value = JSON.stringify(form.value);
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -271,11 +274,15 @@ function submitForm() {
|
|||
proxy.$refs["configRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.configId != undefined) {
|
||||
updateConfig(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
if (JSON.stringify(form.value) != oldForm.value) {
|
||||
updateConfig(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}else{
|
||||
open.value = false;
|
||||
}
|
||||
} else {
|
||||
addConfig(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
|
|
|
@ -0,0 +1,189 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
|
||||
<div style="width: 600px;text-align: center;border: 1px solid #ccc;border-radius: 5px; margin: 0 auto;padding: 15px;">
|
||||
<el-form ref="openReviseRef" :model="rowOpenRevise" :rules="ruleForm" label-width="120px">
|
||||
<el-form-item label="platformCode" style="width: 100%;" prop="platformCode">
|
||||
<CustomSelect v-if="showLoding2" v-model="rowOpenRevise.platformCode" :options="sys_job_status" placeholder="请选择游戏平台" style="width: 100%" />
|
||||
</el-form-item>
|
||||
<el-form-item label="currencyCode" style="width: 100%;" prop="currencyCode">
|
||||
<CustomSelect v-model="rowOpenRevise.currencyCode" :options="currencyCodesOptions" placeholder="请选择币种" style="width: 100%;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="fetchType" style="width: 100%;" prop="fetchType">
|
||||
<el-input v-model="rowOpenRevise.fetchType" style="width: 100%;" :placeholder="t('请输入fetchType')"> </el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="last_start_time" style="width: 100%;" prop="last_start_time">
|
||||
<el-date-picker
|
||||
v-model="rowOpenRevise.last_start_time"
|
||||
type="datetime"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
style="width: 100%;"
|
||||
placeholder="last_start_time"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="last_end_time" style="width: 100%;" prop="last_end_time">
|
||||
<el-date-picker
|
||||
v-model="rowOpenRevise.last_end_time"
|
||||
style="width: 100%;"
|
||||
type="datetime"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
placeholder="last_end_time"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="last_version_key" style="width: 100%;" prop="last_version_key">
|
||||
<NumberInput v-model="rowOpenRevise.last_version_key" :digit="4" style="width: 100%;" :placeholder="t('请输入last_version_key')"> </NumberInput>
|
||||
</el-form-item>
|
||||
<el-form-item label="last_cursor" style="width: 100%;" prop="last_cursor">
|
||||
<el-input v-model="rowOpenRevise.last_cursor" style="width: 100%;" :placeholder="t('请输入last_cursor')"> </el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="last_page" style="width: 100%;" prop="last_page">
|
||||
<NumberInput v-model="rowOpenRevise.last_page" style="width: 100%;" :placeholder="t('请输入last_page')"> </NumberInput>
|
||||
</el-form-item>
|
||||
<div style="margin-top: 10px;width: 100%;">
|
||||
<el-button type="primary" @click="submitInterface">{{t('执行')}}</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Agent">
|
||||
import { superGameList } from "@/api/super/platform.js";
|
||||
import { superFetchDataExcute} from "@/api/super/gameManagement.js";
|
||||
import { getSuperPlatformSelectList } from "@/api/home";
|
||||
import CustomSelect from '@/components/CustomSelect'
|
||||
import { getLocalStorage } from '@/utils/auth'
|
||||
import NumberInput from '@/components/NumberInput'
|
||||
import { finalTimestamp } from '@/utils/ruoyi'
|
||||
import { nextTick, ref } from "vue";
|
||||
const { proxy } = getCurrentInstance();
|
||||
let resData = getLocalStorage('currencySelect');
|
||||
const currencyCodesOptions = ref([]);
|
||||
currencyCodesOptions.value = resData.map(item => {
|
||||
return { label:`${item.currencyName}(${item.currencyCode})`, value: item.currencyCode }
|
||||
})
|
||||
|
||||
const agentList = ref([]);
|
||||
const loading = ref(true);
|
||||
const total = ref(0);
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
platformCode: "",
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
const { queryParams, form } = toRefs(data);
|
||||
const loadingButton = ref(false);
|
||||
const oldForm = shallowRef({ });
|
||||
const rowOpenRevise = reactive({
|
||||
|
||||
});
|
||||
const ruleForm = reactive({
|
||||
platformCode: [
|
||||
{ required: true, message: '请选择游戏平台', trigger: 'change' }
|
||||
],
|
||||
currencyCode:[
|
||||
{ required: true, message: '请选择币种', trigger: 'change' }
|
||||
],
|
||||
fetchType:[
|
||||
{ required: true, message: '请输入fetchType', trigger: 'change' }
|
||||
],
|
||||
last_start_time: [
|
||||
{ required: true, message: '请输入last_start_time', trigger: 'change' }
|
||||
],
|
||||
last_end_time: [
|
||||
{ required: true, message: '请输入last_end_time', trigger: 'change' }
|
||||
]
|
||||
});
|
||||
/** 查询列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
superGameList(queryParams.value).then(response => {
|
||||
const _data = response.rows;
|
||||
agentList.value = _data;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
const sys_job_status = ref([]);
|
||||
const showLoding2 = ref(true);
|
||||
const getsuperCommonPlatformTypeSelect = async () => {
|
||||
showLoding2.value = false;
|
||||
getSuperPlatformSelectList({}).then(response => {
|
||||
sys_job_status.value = response.data.map(item => {
|
||||
return { label: item.platformName, value: item.platformCode }
|
||||
});
|
||||
showLoding2.value = true;
|
||||
});
|
||||
}
|
||||
getsuperCommonPlatformTypeSelect();
|
||||
getList();
|
||||
|
||||
const openReviseRef = ref(null);
|
||||
const submitInterface = () => {
|
||||
|
||||
proxy.$refs["openReviseRef"].validate(valid => {
|
||||
if (valid) {
|
||||
|
||||
loadingButton.value = true;
|
||||
if (JSON.stringify(rowOpenRevise) != oldForm.value) {
|
||||
let obj = {
|
||||
platformCode:rowOpenRevise.platformCode,
|
||||
currencyCode:rowOpenRevise.currencyCode,
|
||||
fetchType:rowOpenRevise.fetchType,
|
||||
last_start_time:finalTimestamp(rowOpenRevise.last_start_time),
|
||||
last_end_time:finalTimestamp(rowOpenRevise.last_end_time),
|
||||
last_version_key:rowOpenRevise.last_version_key,
|
||||
last_cursor:rowOpenRevise.last_cursor,
|
||||
last_page:rowOpenRevise.last_page,
|
||||
}
|
||||
|
||||
superFetchDataExcute(obj).then(response => {
|
||||
loadingButton.value = false;
|
||||
proxy.$modal.msgSuccess(proxy.t('操作成功'));
|
||||
openRevise.value = false;
|
||||
getList();
|
||||
}).catch(() => {
|
||||
loadingButton.value = false;
|
||||
});
|
||||
} else {
|
||||
loadingButton.value = false;
|
||||
openRevise.value = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.label-scoreRatio{
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: right;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
span{
|
||||
width: 120px;
|
||||
text-align: right;
|
||||
font-weight: 700;
|
||||
padding-right: 12px;
|
||||
}
|
||||
}
|
||||
.scoreRatioTable{
|
||||
width: calc(100% - 120px);
|
||||
margin-left: 120px;
|
||||
}
|
||||
.fixed-label-width {
|
||||
width: 200px; /* 设置您想要的固定宽度 */
|
||||
}
|
||||
:deep(.el-descriptions__label.el-descriptions__cell.is-bordered-label){
|
||||
width: 180px!important;
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue