fix:1,修改

main
YuanJian 2025-08-29 09:26:00 +08:00
parent 9eba581f57
commit 05598451be
18 changed files with 577 additions and 150 deletions

BIN
dist.rar 100644

Binary file not shown.

View File

@ -30,6 +30,14 @@ export function createTenantCreate(data) {
method: 'put',
data: data
})
}
//谷歌验证解除
export function updateSuperResetGoogleCode(data) {
return request({
url: '/super/tenant/resetGoogleCode',
method: 'put',
data: data
})
}
//更新商户
export function updateSuperTenantEdit(data) {

View File

@ -0,0 +1,83 @@
<!-- 字典下拉框选择组件 -->
<template>
<el-select v-model="model" :placeholder="t('请选择')">
<el-option v-for="item in optionsData" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</template>
<script setup>
import { getLocalStorage } from "@/utils/auth";
const props = defineProps({
// key
dictKey: {
type: String,
default: ''
},
// localStoragekey
localKey: {
type: String,
default: ''
},
//
isDefault: {
type: Boolean,
default: false
},
//
addOptions: {
type: Object
},
config: { //
type: Object,
default: {
hasCheckAll: true,
filterValue: []
}
}
});
const { proxy } = getCurrentInstance();
const model = defineModel(); //
const optionsData = ref([]); //
//
const { dictKey, localKey, addOptions, isDefault } = props;
// localStorage
if (localKey) {
const _optionsData = [];
switch (localKey) {
case 'langList':
const langList = getLocalStorage('langList')?.filter(v => v.langType == 1 && v.langStatus); //
langList.forEach(v => {
_optionsData.push({
label: v.name,
value: v.id
});
});
break;
}
optionsData.value = _optionsData?.filter(item => {
return !props.config.filterValue.includes(item.value);
});
} else {
optionsData.value = proxy.useDict(dictKey)[dictKey]?.filter(item => {
return !props.config.filterValue.includes(item.value);
});
}
//
if (addOptions) {
optionsData.value.unshift(addOptions);
}
//
if (isDefault) {
model.value = optionsData.value[0].value;
}
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,115 @@
<template>
<el-form-item :prop="keyName">
<el-select v-model="queryParams[keyName]" :placeholder="t('请选择')" :style="'width:' + width[0] + 'px'"
@change="keyChange('selectChange')">
<el-option v-for="item in queryParamsList" :key="item.value" :label="t(item.label)" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item :prop="queryParams[keyName]" v-if="queryParams[keyName]" :style="'width:' + width[1] + 'px'">
<!-- 数字输入框 -->
<NumberInput v-if="inputType === 'number'" v-model="queryParams[queryParams[keyName]]"
:placeholder="t(inputPlaceholder || `请输入${currentLabel}`)" @keyup.enter="handleQuery" clearable
@clear="handleQuery" :maxlength="inputConfig.maxlength" :isCalculable="false" :show-word-limit="inputConfig.showWordLimit">
</NumberInput>
<!-- 下拉选择框字典放到inputConfig.dictKey -->
<custom-select v-else-if="inputType === 'select' && showLoding" :placeholder="t(inputPlaceholder || `请选择${currentLabel}`)" v-model="queryParams[queryParams[keyName]]" @change="handleQuery" clearable
@clear="handleQuery" :options="inputConfig.options"></custom-select>
<!-- 普通输入框 -->
<el-input v-else v-model="queryParams[queryParams[keyName]]"
:placeholder="t(inputPlaceholder || `请输入${currentLabel}`)" @keyup.enter="handleQuery" clearable
@clear="handleQuery" :maxlength="inputConfig.maxlength" :show-word-limit="inputConfig.showWordLimit" />
</el-form-item>
</template>
<script setup>
import NumberInput from "@/components/NumberInput/index.vue"; //
import DictSelect from "@/components/DictSelect/index.vue"; //
import CustomSelect from "@/components/CustomSelect/index.vue";
import { el } from "element-plus/es/locales.mjs";
import { nextTick } from "vue";
const props = defineProps({
width: {
type: Array,
default: [120, 160]
},
keyName: {
type: String,
default: 'searchType'
},
queryParamsList: {
type: Array,
default: []
},
queryParams: {
type: Object,
default: {}
}
});
const queryParams = defineModel();
queryParams.value = props.queryParams;
const currentLabel = ref(''), inputPlaceholder = ref(''); //
const inputType = ref(''); //
const inputConfig = ref({}); // input
const showLoding = ref(true);
//
const keyChange = (type) => {
props.queryParamsList.forEach(item => {
if (item.value === queryParams.value[props.keyName]) {
// placeholder
if (item.placeholder) {
inputPlaceholder.value = item.placeholder
} else {
inputPlaceholder.value = '';
currentLabel.value = item.label;
}
// value
inputType.value = item.inputType || '';
inputConfig.value = item.inputConfig || {}
} else {
//
queryParams.value[item.value] = null
}
});
showLoding.value = false;
setTimeout(() => {
showLoding.value = true;
},500)
if (type === 'selectChange') handleQuery();
}
//
const clearAll = () => {
props.queryParamsList.forEach(item => {
//searchType
if (item.value !== 'searchType') {
delete queryParams.value[item.value];
}else {
queryParams.value[item.value] = props.queryParams.searchType;
}
})
}
//
let flag = true;
watch(() => queryParams.value[props.keyName], val => {
if (val && flag) {
keyChange();
flag = false;
}
}, { immediate: true });
//
const emits = defineEmits(['handleQuery']);
const handleQuery = () => {
emits('handleQuery');
}
defineExpose({
keyChange,
clearAll,
})
</script>
<style lang="scss" scoped></style>

View File

@ -17,6 +17,7 @@
<tags-view v-if="needTagsView" />
</div>
<app-main />
<settings ref="settingRef" />
</div>
</template>

View File

@ -387,7 +387,7 @@ function handleView(row) {
currencyAgreement:row.currencyAgreement,
tenantType: 1,
}
getSelectPlatform();
// getSelectPlatform();
openView.value = true;
}
@ -408,7 +408,7 @@ function getSelectPlatform() {
/** 新增按钮操作 */
function handleAdd() {
reset();
getSelectPlatform();
// getSelectPlatform();
open.value = true;
form.value.proportion = 20;
title.value = proxy.t('添加代理');

View File

@ -2,7 +2,7 @@
<div class="app-container">
<table-search-card :leftSpan="24" :model="queryParams" @getList="getList" @handleQuery="handleQuery" @resetQuery="resetQuery">
<template #left>
<table-search-date v-model:dateRange="dateRange" v-model:operateTimeType="operateTimeType"></table-search-date>
<table-search-date ref="searchDateRef" v-model:dateRange="dateRange" @dateChange="handleQuery" v-model:operateTimeType="operateTimeType"></table-search-date>
<el-form-item :label="t('商户账号')" prop="tenantKey">
<el-input
v-model="queryParams.tenantKey"
@ -199,12 +199,13 @@
queryParams.value.pageNo = 1;
getList();
}
const searchDateRef = ref(null);
/** 重置按钮操作 */
function resetQuery() {
dateRange.value = [];
operateTimeType.value = "day";
proxy.resetForm("queryRef");
handleQuery();
searchDateRef.value.timeTypeChange(operateTimeType.value)
}
//

View File

@ -17,7 +17,7 @@
<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>
<span class="" :style="card.cardClass =='pink' ? 'cursor: pointer;':card.cardClass =='green'?'cursor: pointer;':'cursor: pointer;'" @click="goPage(card.cardClass)">{{ card.value }}</span>
</div>
<div class="card-subtitle" v-html="card.subtitle" @click="handleClick"></div>
</div>
@ -57,9 +57,9 @@
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('新增代理数')+`<a href="#" class="link" data-type="bigR">${props?.cardData?.newAgents||0}</a> `,
subtitle: proxy.t('新增会员数')+`<a class="link" data-type="first" >${props?.cardData?.newMembers || 0}</a>`+proxy.t('人')
+' '+proxy.t('新增商户数')+ `<a class="link" data-type="newTenants">${props?.cardData?.newTenants || 0}</a>`
+' '+proxy.t('新增代理数')+`<a class="link" data-type="bigR">${props?.cardData?.newAgents||0}</a> `,
cardClass: 'orange'
},
{
@ -106,92 +106,58 @@
}
]);
const handleClick = (e) => {
// const type = e.target.dataset.type
// let path = '';
// let typeDay = '';
// let activeName = '';
// let timeType = '';
// if (type == 'first') {
// path = '/member/member';
// typeDay = 'day';
// timeType = 3;
// }else if (type == 'proxy') {
// path = '/agent/agent-info';
// typeDay = 'day';
// timeType = '';
// }else if (type == 'totalCharge') {
// path = '/member/member';
// typeDay = '';
// timeType = 3;
// }else if (type == 'totalAgent') {
// path = '/agent/agent-info';
// typeDay = '';
// timeType = '';
// }else if (type == 'differenceRecharge') {
// path = '/finance/recharge-order';
// typeDay = 'day';
// timeType = '';
// }else if (type == 'differenceWithdrawal') {
// path = '/finance/withdrawal';
// typeDay = 'day';
// timeType = '';
// activeName = 'allWithdrawal';
// }else if (type == 'betOnNoteOrder') {
// path = '/game/details';
// typeDay = 'day';
// timeType = '';
// activeName = 'details';
// }else if (type == 'discountParticipants') {
// path = '/discounts/discount-details';
// typeDay = 'day';
// timeType = '';
// activeName = '';
// }
// else if (type == 'discountTask') {
// path = '/discounts/task';
// typeDay = '';
// timeType = '';
// activeName = '';
// }else if (type == 'discountActivity') {
// path = '/discounts/activity-center';
// typeDay = '';
// timeType = '';
// activeName = '';
// }
// proxy.$router.push({
// path: path,
// query: {
// activeName: activeName,
// operateTimeType: typeDay,
// timeType:timeType,
// currencyType:props.currencyType,
// }
// });
const type = e.target.dataset.type
let path = '';
let typeDay = '';
let activeName = '';
let timeType = '';
if (type == 'first') {
path = '/member';
}else if (type == 'newTenants') {
path = '/Merchant/businessInformation';
}else if (type == 'bigR') {
path = '/Agents/agentInformation';
}
proxy.$router.push({
path: path,
query: {
activeName: activeName,
operateTimeType: typeDay,
timeType:timeType,
currencyType:props.currencyType,
}
});
}
// proxy.t('')+(props?.cardData?.profit||0)+' '+
const goPage = (cardClass) => {
// let path = '';
// let typeDay = '';
// if (cardClass == 'orange'){
// path = '/member/member';
// typeDay = 'day';
// }else if (cardClass == 'blue'){
// path = '/member/member';
// typeDay = '';
// }else if (cardClass == 'yellow'){
// path = '/game/details';
// typeDay = 'day';
// }else if (cardClass == 'purple'){
// path = '/discounts/discount-details';
// typeDay = 'day';
// }
// proxy.$router.push({
// path: path,
// query: {
// activeName: 'details',
// operateTimeType: typeDay
// }
// });
let path = '';
let typeDay = '';
if (cardClass == 'orange'){
path = '/Merchant/businessInformation';
typeDay = 'day';
}else if (cardClass == 'blue'){
path = '/Merchant/businessInformation';
typeDay = '';
}else if (cardClass == 'pink'){
path = '/Finance/prepaymentRecord';
typeDay = 'day';
}else if (cardClass == 'yellow'){
path = '/gameRecords';
typeDay = 'day';
}else if (cardClass == 'green'){
path = '/Merchant/businessInformation';
typeDay = 'day';
}else if (cardClass == 'purple'){
path = '/Agents/agentInformation';
typeDay = 'day';
}
proxy.$router.push({
path: path,
query: {
activeName: 'details',
operateTimeType: typeDay
}
});
}
</script>

View File

@ -55,7 +55,7 @@ const timeTypeChange = (val) => {
case 'week':
dateRange.value = [
dayjs().subtract(6, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'),
dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss')
dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss.SSS')
]
break
case 'month':
@ -150,9 +150,9 @@ const dateRangeChange = (dataValue) => {
const end = new Date(dataValue[1]);
start.setHours(0, 0, 0); // 00:00:00
end.setHours(23, 59, 59); // 23:59:59
end.setHours(23, 59, 59,999); // 23:59:59
dateRange.value[0] = dayjs(start).format('YYYY-MM-DD HH:mm:ss');
dateRange.value[1] = dayjs(end).format('YYYY-MM-DD HH:mm:ss');
dateRange.value[1] = dayjs(end).format('YYYY-MM-DD HH:mm:ss.SSS');
}
//
@ -163,7 +163,7 @@ const dateRangeChange = (dataValue) => {
//
const getTimeFn = (startTime) => {
return [startTime.format('YYYY-MM-DD HH:mm:ss'), dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss')];
return [startTime.format('YYYY-MM-DD HH:mm:ss'), dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss.SSS')];
}
//

View File

@ -2,7 +2,7 @@
<div class="app-container">
<table-search-card :model="queryParams" @getList="getList" @handleQuery="handleQuery" @resetQuery="resetQuery">
<template #left>
<table-search-date v-model:dateRange="dateRange" v-model:operateTimeType="operateTimeType"></table-search-date>
<table-search-date ref="searchDateRef" v-model:dateRange="dateRange" @dateChange="handleQuery" v-model:operateTimeType="operateTimeType"></table-search-date>
<el-form-item :label="t('商户账号')" prop="tenantKey">
<el-input
v-model="queryParams.tenantKey"
@ -27,7 +27,7 @@
<el-table v-loading="loading" class="c-table-main" :data="agentList" border>
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<el-table-column :label="t('订单号')" width="160" align="center" prop="orderId" :show-overflow-tooltip="true" />
<el-table-column :label="t('商户账号')" align="center" prop="tenantKey" :show-overflow-tooltip="true" />
<el-table-column :label="t('商户账号')" align="center" prop="tenantKey" min-width="150" />
<!-- <el-table-column :label="t('前缀')" width="100" align="center" prop="tenantSn" /> -->
<el-table-column :label="t('平台币种')" align="center" prop="currencyCode" :show-overflow-tooltip="true" />
<el-table-column :label="t('汇率')" width="100" align="center" prop="exchangeRate" >
@ -72,7 +72,7 @@
</template>
</el-table-column>
<el-table-column :label="t('创建时间')" align="center" prop="createTime" :show-overflow-tooltip="true">
<el-table-column :label="t('创建时间')" align="center" prop="createTime" min-width="180">
<template #default="scope">{{ parseTime(scope.row.createTime) }}</template>
</el-table-column>
<el-table-column :label="t('操作')" align="center" width="200" class-name="small-padding fixed-width">
@ -220,7 +220,7 @@
import TableSearchDate from '@/components/TableSearchDate'
import Crontab from '@/components/Crontab'
import { parseTime } from '@/utils/ruoyi'; //
import { nextTick } from "vue";
import { nextTick, onMounted } from "vue";
const router = useRouter();
const { proxy } = getCurrentInstance();
const { ff_tenant_type, ff_tenant_status } = proxy.useDict("ff_tenant_type", "ff_tenant_status");
@ -339,13 +339,14 @@ const usdtSelect = ref([
queryParams.value.pageNum = 1;
getList();
}
const searchDateRef = ref(null);
/** 重置按钮操作 */
function resetQuery() {
dateRange.value = [];
operateTimeType.value = "";
operateTimeType.value = "day";
proxy.resetForm("queryRef");
handleQuery();
searchDateRef.value.timeTypeChange(operateTimeType.value)
}
//
const forcedCancel = (row) => {
@ -482,8 +483,12 @@ const paymentOpen = ref(false);
}
});
}
//
onMounted(() => {
getsuperCommonCurrencySelect();
getList();
})
</script>
<style scoped lang="scss">

View File

@ -151,8 +151,8 @@ const router = useRouter();
const { proxy } = getCurrentInstance();
const loginForm = ref({
username: "admin",
password: "aaa111",
username: "",
password: "",
rememberMe: false,
isShowEnabled: false,
code: "",

View File

@ -92,6 +92,15 @@
<el-button type="primary" @click="queryCode('add')" :disabled="!formAll.tenantSystemPlatforms.length">+0.5</el-button>
</div>
</div>
<div style="display: flex;margin-left: 120px;justify-content: space-between;margin-bottom: 10px;">
<div>
<CustomSelect v-if="showLoding2" v-model="searchPlatformCode" clearable :options="sys_job_status" filterable placeholder="请选择游戏平台" style="width: 200px" />
<CustomSelect v-model="searchCurrencyCode" :options="currencySelectArr" clearable placeholder="请选择币种" style="width: 200px"/>
</div>
<div>
<el-button type="primary" @click="searchSystemPlatforms">{{ t('') }}</el-button>
</div>
</div>
<el-table :data="formAll.tenantSystemPlatforms" loading="loading2" class="scoreRatioTable">
<el-table-column :label="t('平台')" align="center" prop="platformCode" />
@ -134,6 +143,7 @@
</template>
<script setup>
import { superTenantList, createTenantCreate,updateSuperTenantResetPwd,getSuperTenant,superTenantQuotaList,updateSuperTenantQuotaUpdate,superCommonTimeZone } from "@/api/super/tenant.js";
import { getPlatformShowSelect } from "@/api/super/platform.js";
import { nextTick, ref } from "vue";
import { getLocalStorage } from "@/utils/auth";
import NumberInput from '@/components/NumberInput'
@ -180,6 +190,7 @@ const formAll = reactive({ // 表单验证数据
realBalance: [],
})
const currencySelectArr = ref([]);
const PlatformRatioAll = ref([]);
let res = getLocalStorage('currencySelect');
currencySelectArr.value = res.map(item => {
return { label:`${item.currencyName}(${item.currencyCode})`, value: item.currencyCode }
@ -218,6 +229,8 @@ const rules = ref({
numbers.value = Number(itemObj.useCost)- Number(itemObj.cost);
totalPlatform.value = resData.length;
tenantSystemPlatforms.value = JSON.parse(JSON.stringify(resData));
PlatformRatioAll.value = JSON.parse(JSON.stringify(resData));
nextTick(() => {
changeCurrency('VND')
});
@ -225,11 +238,20 @@ const rules = ref({
function findByConditions(arr, conditions = {}) {
// conditions
if (conditions.currencyCode == '') {
let arr11 = [];
arr.map(item => {
arr11.push(...item.list);
})
return arr11||[];
// ref
const arr11 = ref([]);
//
const mergeData = async () => {
for (let i = 0; i < arr.length; i++) {
arr11.value.push(...arr[i].list);
if (i % 1 == 0) {
// 20
await new Promise(resolve => setTimeout(resolve, 100));
}
}
};
mergeData();
return arr11.value || [];
}
const found = arr.find(item => item.currencyCode == conditions.currencyCode);
return found ? found.list : [];
@ -240,11 +262,35 @@ const loading2 = ref(false);
const changeCurrency = (val) => {
loading2.value = true;
formAll.tenantSystemPlatforms = findByConditions(tenantSystemPlatforms.value, { currencyCode: val });
PlatformRatioAll.value = findByConditions(tenantSystemPlatforms.value, { currencyCode: val });
totalPlatform.value = formAll.tenantSystemPlatforms.length;
nextTick(() => {
loading2.value = false;
});
};
const searchPlatformCode = ref('');
const searchCurrencyCode = ref('');
//
const searchSystemPlatforms = () => {
const result = [];
PlatformRatioAll.value.forEach(item => {
//
const match =
(searchPlatformCode.value && searchCurrencyCode.value)
? item.platformCode === searchPlatformCode.value && item.currencyCode === searchCurrencyCode.value
: (searchPlatformCode.value ? item.platformCode === searchPlatformCode.value : false) ||
(searchCurrencyCode.value ? item.currencyCode === searchCurrencyCode.value : false);
if (match) {
result.push(item);
}
});
formAll.tenantSystemPlatforms = result;
};
const loading1 = ref(false);
/** 获取货币 */
function getSuperCommonCurrencySelect() {
@ -313,11 +359,24 @@ const handleBlur = (row) => {
// this.$message.warning(`${cost}`);
}
}
const sys_job_status = ref([]);
const showLoding2 = ref(true);
const getsuperCommonPlatformTypeSelect = async () => {
showLoding2.value = false;
getPlatformShowSelect().then(response => {
sys_job_status.value = response.data.map(item => {
return { label: item.platformName, value: item.platformCode }
});
showLoding2.value = true;
});
}
//
nextTick(() => {
getSelectPlatform();
getSuperCommonCurrencySelect();
superCommonTimeZones();
getsuperCommonPlatformTypeSelect();
})
// DEMO

View File

@ -16,7 +16,7 @@
</el-form-item>
</el-form>
<div>
<el-button @click="handleAddType" type="primary" v-h="['super:tenant:quota:add']" plain icon="Plus"></el-button>
<el-button @click="handleAddType" type="primary" v-hasPermi="['super:tenant:quota:add']" plain icon="Plus"></el-button>
</div>
</div>
<el-table :data="platAdjustmentList" class="" border>
@ -44,10 +44,8 @@
<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;">
<el-button @click="handleAdd($event,row)"></el-button>
</div>
</template>
</el-table-column>
</el-table>
@ -99,6 +97,11 @@
</NumberInput>
</div>
</el-form-item>
<el-form-item label="平台额度" prop="platformBalanceJson">
<div style="width: 100%;">
{{sumPlatformBalance(formAdjustment.platformBalanceJson)}}
</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" />
@ -152,9 +155,13 @@ const props = defineProps({ // 父组件向子组件传值
})
let resData = getLocalStorage('currencySelect');
const currencyCodesOptions = ref([]);
currencyCodesOptions.value = resData.map(item => {
return { label:`${item.currencyName}(${item.currencyCode})`, value: item.currencyCode }
})
currencyCodesOptions.value = [
{ label: '全部', value: '0' },
...resData.map(item => ({
label: `${item.currencyName}(${item.currencyCode})`,
value: item.currencyCode
}))
];
const currencySelectAll = getLocalStorage('currencySelect').map(item => {
return {...item, label: item.currencyCode, value: item.currencyCode }
});
@ -281,16 +288,20 @@ const platAdjustment = ref({
pageSize: 100,
orderByColumn: 'currencyCode',
isAsc: 'asc',
tenantKey: ''
tenantKey: '',
currencyCode:'0',
});
const totalAdjustment = ref(0);
const platAdjustmentList = ref([]);
const handleAdjustment = (row) => {
platAdjustment.value.tenantKey = row.tenantKey;
superTenantQuotaList(platAdjustment.value).then(response => {
let obj = {
...platAdjustment.value,
currencyCode: platAdjustment.value.currencyCode == 0 ? '' : platAdjustment.value.currencyCode,
}
superTenantQuotaList(obj).then(response => {
platAdjustmentList.value = response.rows;
totalAdjustment.value = response.total;
})
}
@ -384,31 +395,48 @@ superCommonCurrencySelects();
superCommonQuotaTypeSelects();
const openCreditType = ref(false);
const handleAddType = (value) => {
if (!platAdjustment.value.currencyCode){
if (!platAdjustment.value.currencyCode || platAdjustment.value.currencyCode == 0){
ElMessage.warning('请选择币种!');
return
}
// openCreditType.value = true;
visible.value = true;
formAdjustment.value.id = '';
formAdjustment.value.platformBalanceJson = '{}';
if ( platAdjustmentList.value.length == 0 ){
formAdjustment.value.realBalance = 0;
formAdjustment.value.creditBalance = 0;
formAdjustment.value.platformBalanceJson = '{}';
}else{
formAdjustment.value.id = platAdjustmentList.value[0]?.id;
formAdjustment.value.realBalance = platAdjustmentList.value[0]?.realBalance;
formAdjustment.value.platformBalanceJson = platAdjustmentList.value[0]?.platformBalanceJson;
formAdjustment.value.creditBalance = platAdjustmentList.value[0]?.creditBalance;
}
formAdjustment.value.balanceReal = 0;
formAdjustment.value.balanceCredit = 0;
formAdjustment.value.tenantKey = props.modifyDate.tenantKey;
formAdjustment.value.currencyCode = platAdjustment.value.currencyCode;
visible.value = false;
setTimeout(() => {
visible.value = true;
}, 50);
}
const visible = ref(false);
const handleAdd = (value,row) => {
let rowOpen = JSON.parse(JSON.stringify(row));
visible.value = true;
formAdjustment.value.id = rowOpen.id;
formAdjustment.value = rowOpen;
formAdjustment.value.balanceReal = 0;
formAdjustment.value.balanceCredit = 0;
visible.value = false;
nextTick(()=>{
visible.value = true;
})
}
const onSubmit = () => {
proxy.$refs["formAdjustmentRef"].validate(valid => {
if (valid) {
let numBalance = 0;
if(Number(formAdjustment.value.balanceReal) <= 0 || Number(formAdjustment.value.balanceCredit) <= 0){
if(Number(formAdjustment.value.balanceReal) < 0 || Number(formAdjustment.value.balanceCredit) < 0){
formAdjustment.value.isOut = false;
if (formAdjustment.value.balanceReal !=0){
numBalance = Math.abs(formAdjustment.value.balanceReal);
@ -427,6 +455,9 @@ const onSubmit = () => {
id: formAdjustment.value.id,
balance:numBalance,
googleCode: formAdjustment.value.googleCode,
tenantKey: formAdjustment.value.tenantKey,
currencyCode: formAdjustment.value.currencyCode,
quotaType: props.modifyDate.tenantType == 1?'BALANCE':'REPUTATION',
isOut: formAdjustment.value.isOut,
remark: formAdjustment.value.remark
}

View File

@ -65,6 +65,15 @@
:disabled="!formAll.tenantSystemPlatforms.length">+0.5</el-button>
</div>
</div>
<div style="display: flex;margin-left: 120px;justify-content: space-between;margin-bottom: 10px;">
<div>
<CustomSelect v-if="showLoding2" v-model="searchPlatformCode" clearable :options="sys_job_status" filterable placeholder="请选择游戏平台" style="width: 200px" />
<CustomSelect v-model="searchCurrencyCode" :options="currencySelectArr" clearable placeholder="请选择币种" style="width: 200px"/>
</div>
<div>
<el-button type="primary" @click="searchSystemPlatforms">{{ t('') }}</el-button>
</div>
</div>
<el-table :data="formAll.tenantSystemPlatforms" ref="myTable" class="scoreRatioTable" >
<!-- <el-table-column :label="t('id')" align="center" >
<template #default="{row,$index}">
@ -106,6 +115,7 @@
</template>
<script setup>
import { updateSuperTenantEdit } from "@/api/super/tenant.js";
import { getPlatformShowSelect } from "@/api/super/platform.js";
import { superPlatformSystem } from "@/api/agent";
import { getLocalStorage } from "@/utils/auth";
import { nextTick, ref } from "vue";
@ -145,7 +155,7 @@ const forceUpdateTable = async () => {
// allData 1000
// 10
let index = 0
const batchSize = 20
const batchSize = 100
const loadBatch = () => {
if (index < props.modifyDate.tenantSystemPlatforms.length) {
@ -156,6 +166,7 @@ const forceUpdateTable = async () => {
// UI
requestAnimationFrame(loadBatch)
}
PlatformRatioAll.value = props.modifyDate.tenantSystemPlatforms;
oldForm.value = JSON.stringify(formAll);
}
loadBatch()
@ -179,6 +190,7 @@ const formAll = reactive({ // 表单验证数据
realBalance: [],
})
const currencySelectArr = ref([]);
const PlatformRatioAll = ref([]);
let res = getLocalStorage('currencySelect');
currencySelectArr.value = res.map(item => {
return { label:`${item.currencyName}(${item.currencyCode})`, value: item.currencyCode }
@ -198,7 +210,30 @@ function getSelectPlatform() {
let resData = getLocalStorage('tenantSystemPlatforms');
tenantSystemPlatforms.value = resData;
}
const searchPlatformCode = ref('');
const searchCurrencyCode = ref('');
//
const searchSystemPlatforms = () => {
const result = [];
PlatformRatioAll.value.forEach(item => {
//
const match =
(searchPlatformCode.value && searchCurrencyCode.value)
? item.platformCode === searchPlatformCode.value && item.currencyCode === searchCurrencyCode.value
: (searchPlatformCode.value ? item.platformCode === searchPlatformCode.value : false) ||
(searchCurrencyCode.value ? item.currencyCode === searchCurrencyCode.value : false);
if (match) {
result.push(item);
}
});
if (result.length > 0) {
formAll.tenantSystemPlatforms = result;
}else{
formAll.tenantSystemPlatforms = PlatformRatioAll.value;
}
};
const loading1 = ref(false);
/** 获取货币 */
function getSuperCommonCurrencySelect() {
@ -246,21 +281,35 @@ const changeCurrency = (val) => {
loading2.value = true;
console.log(tenantSystemPlatforms.value.length);
formAll.tenantSystemPlatforms = findByConditions(tenantSystemPlatforms.value, { currencyCode: val });
PlatformRatioAll.value = findByConditions(tenantSystemPlatforms.value, { currencyCode: val });
totalPlatform.value = formAll.tenantSystemPlatforms.length;
nextTick(() => {
loading2.value = false;
});
};
const sys_job_status = ref([]);
const showLoding2 = ref(true);
const getsuperCommonPlatformTypeSelect = async () => {
showLoding2.value = false;
getPlatformShowSelect().then(response => {
sys_job_status.value = response.data.map(item => {
return { label: item.platformName, value: item.platformCode }
});
showLoding2.value = true;
});
}
//
nextTick(() => {
getSelectPlatform();
getSuperCommonCurrencySelect();
getsuperCommonPlatformTypeSelect();
})
// DEMO
nextTick(() => {
//
// formAll.tenantSystemPlatforms = props.modifyDate.tenantSystemPlatforms;
PlatformRatioAll.value = props.modifyDate.tenantSystemPlatforms;
formAll.account = props.modifyDate.account;
formAll.tenantType = props.modifyDate.tenantType;
formAll.scoreRatio = props.modifyDate.scoreRatio;

View File

@ -29,7 +29,17 @@
<span v-if="row.agentAccount">{{ t('') }}: {{ row.agentAccount }}</span>
</template>
</el-table-column>
<el-table-column :label="t('商户账号')" align="center" prop="tenantKey" width="160px" :show-overflow-tooltip="true" />
<el-table-column :label="t('商户账号')" align="center" prop="tenantKey" width="170px" >
<template #default="{row}">
<div style="width: 100%;text-align: left;">{{ t('账号') }} {{ row.tenantKey }}</div>
<div style="width: 100%;text-align: left;">{{ t('谷歌') }}
<span v-if="row.googleCode == null || row.googleCode == ''" style="color: #909399;">{{ t('') }}</span>
<span v-else style="color: #1ab394;">{{ t('已绑定') }} <el-button link type="primary" @click="handleUnbindGoogle(row)" v-hasPermi="['super:tenant:resetGoogleCode']">{{ t('') }}</el-button></span>
</div>
</template>
</el-table-column>
<el-table-column :label="t('商户额度')" width="100" align="center" >
<template #default="{row}">
<el-button link type="primary" @click="handleAdjustment(row)" v-hasPermi="['super:tenant:quota:update']">{{ t('') }}</el-button>
@ -183,7 +193,7 @@
</template>
<script setup name="Agent">
import { superTenantList, createTenantCreate,updateSuperTenantResetPwd,getSuperTenant,superTenantQuotaList,updateSuperTenantQuotaUpdate,updateSuperTenantSwitch } from "@/api/super/tenant.js";
import { superTenantList, createTenantCreate,updateSuperTenantResetPwd,updateSuperResetGoogleCode,getSuperTenant,superTenantQuotaList,updateSuperTenantQuotaUpdate,updateSuperTenantSwitch } from "@/api/super/tenant.js";
import { superPlatformSystem } from "@/api/agent";
import { getLocalStorage } from "@/utils/auth";
import AddMerchantsDialog from './components/AddMerchantsDialog'
@ -316,6 +326,25 @@ const beforeSwitchChange = async (row, undateKeys) => {
openResetTiele.value = "对接信息";
ConnectionArr.value = row;
}
//
const handleUnbindGoogle = (row) => {
proxy.$confirm('确定解除绑定吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(row)
updateSuperResetGoogleCode({
id: row.id,
}).then(res => {
proxy.$modal.msgSuccess(proxy.t('解除成功'));
getList();
})
}).catch(() => {});
}
const handleCopy = async(text) => {
// API HTTPS localhost
if (navigator.clipboard && window.isSecureContext) {

View File

@ -16,6 +16,7 @@
<el-table-column :label="t('操作')" align="center">
<template #default="scope">
<el-button link type="primary" @click="handleView(scope.row)">{{ t('') }}</el-button>
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['sys:notice:remove']">{{ t('') }}</el-button>
</template>
</el-table-column>
</el-table>
@ -72,7 +73,7 @@
</template>
<script setup name="Commission">
import { listNotice,createSysNotice } from "@/api/notice";
import { listNotice,createSysNotice,sysNoticeDelete } from "@/api/notice";
import Crontab from '@/components/Crontab'
import { parseTime } from '@/utils/ruoyi'; //
const router = useRouter();
@ -109,10 +110,13 @@ const data = reactive({
isAsc:'desc'
},
rules: {
account: [{ required: true, message: proxy.t('商户账号不能为空'), trigger: "blur" }],
password: [{ required: true, message: proxy.t('密码不能为空'), trigger: "blur" }],
scoreRatio: [{ required: true, message: proxy.t('买分比例不能为空'), trigger: "blur" }],
tenantType: [{ required: true, message: proxy.t('商户模式不能为空'), trigger: "change" }],
title: [
{ required: true, message: "请输入标题", trigger: "change" }
],
content: [
{ required: true, message: "请输入内容", trigger: "change" }
]
}
});
@ -165,6 +169,16 @@ function handleView(row) {
openView.value = true;
}
//
function handleDelete(row) {
proxy.$modal.confirm(proxy.t('确认删除标题名称为“ ' + row?.title + ' ”的数据?')).then(() => {
return sysNoticeDelete(row.id);
}).then(() => {
getList();
proxy.$modal.msgSuccess(proxy.t('删除成功!'));
}).catch(() => { });
}
function queryCode(type) {
form.value.tenantAgentPlatforms = form.value.tenantAgentPlatforms.map((item, index) => {
if (type === 'del' && item.cost > tenantAgentPlatforms.value[index].cost) {

View File

@ -5,6 +5,11 @@
<el-form-item :label="t('游戏平台')" prop="platformCode">
<CustomSelect v-if="showLoding2" v-model="queryParams.platformCode" :options="sys_job_status" filterable placeholder="请选择游戏平台" style="width: 200px" />
</el-form-item>
<select-input-form ref="selectInputFormRef" :queryParamsList="queryParamsList" :queryParams="queryParams">
</select-input-form>
<el-form-item :label="t('状态')" prop="stopStatus">
<CustomSelect v-model="queryParams.stopStatus" :options="stopStatusOptions" filterable placeholder="请选择状态" style="width: 200px" />
</el-form-item>
</template>
<template #right>
<el-form-item>
@ -228,6 +233,7 @@
import NumberInput from '@/components/NumberInput'
import CustomSelect from '@/components/CustomSelect'
import BaseSwitch from '@/components/BaseSwitch'
import SelectInputForm from '@/components/SelectInputForm';
import { id } from "element-plus/es/locales.mjs";
import { nextTick, ref } from "vue";
const router = useRouter();
@ -257,7 +263,20 @@ import { nextTick, ref } from "vue";
});
const oldForm = shallowRef({ });
const queryParamsList = reactive([{
label: proxy.t('游戏ID'),
value: 'gameId',
},{ //
label: proxy.t('游戏编码'),
value: 'gameCode',
},{ //
label: proxy.t('游戏名称'),
value: 'gameName',
}])
const stopStatusOptions = [
{ label: proxy.t('启用'), value: false },
{ label: proxy.t('关闭'), value: true },
]
const rulesInterface = reactive({
})
const platformTypeOptions = [
@ -308,7 +327,8 @@ import { nextTick, ref } from "vue";
queryParams: {
pageNum: 1,
pageSize: 10,
platformCode: "",
platformCode: "AE",
searchType:'gameId'
},
rules: {
account: [{ required: true, message: proxy.t('商户账号不能为空'), trigger: "blur" }],

View File

@ -2,10 +2,10 @@
<div class="app-container">
<table-search-card :model="queryParams" @getList="getList" @handleQuery="handleQuery" @resetQuery="resetQuery">
<template #left>
<el-form-item :label="t('接口名称')" prop="platformName">
<el-input v-model="queryParams.platformName" style="width: 200px" placeholder="请输入接口名称" clearable />
<el-form-item :label="t('厂商名称')" prop="platformName">
<el-input v-model="queryParams.platformName" style="width: 200px" placeholder="请输入厂商名称" clearable />
</el-form-item>
<el-form-item :label="t('游戏平台')" prop="platformShowCode">
<el-form-item :label="t('平台编码')" prop="platformShowCode">
<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">
@ -127,7 +127,9 @@
<!-- 修改平台 -->
<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">
<custom-select v-if="versionItem.length !=0" v-model="versionValue" :options="versionItem" @change="switchingVersions" style="width: 200px;margin-bottom: 10px;"></custom-select>
<el-descriptions border :column="2" class="c-descriptions" >
<el-descriptions-item label-width="150" label-align="right">
<template #label>
@ -235,7 +237,7 @@
</el-dialog>
<!-- 详情/修改对话框 -->
<el-dialog v-model="openView" align-center width="1300px" append-to-body>
<el-dialog v-if="openView" v-model="openView" align-center width="1300px" append-to-body>
<template #header>
<div style="width: 100%;text-align: center;">{{ titlePlatForm }}</div>
</template>
@ -317,9 +319,8 @@ import { ref } from "vue";
{ label: "开启", value: false },
{ label: "关闭", value: true },
])
const versionItem = ref([]);//
const formInterface = reactive({
});
const oldForm = shallowRef({ });
@ -650,23 +651,34 @@ const switchBeforeChange = () => {
const titlePlatForm = ref('');
const handleRevise = (row) => {
titlePlatForm.value = proxy.t('修改');
tenantSystemPlatformDTOSRow.value = row.tenantSystemPlatformDTOS;
let objForm = JSON.parse(JSON.stringify(row.tenantSystemPlatformDTOS));
tenantSystemPlatformDTOSRow.value = objForm;
oldForm.value = JSON.stringify(tenantSystemPlatformDTOSRow.value);
openView.value = false;
setTimeout(() => {
openView.value = true;
}, 100);
}
const openInterface = ref(false);
const rowInterface = ref({});
//
const handleInterface = (row) => {
getSuperPlatformInf(row.id).then(response => {
Object.assign(formInterface, response.data);
oldForm.value = JSON.stringify(formInterface);
openInterface.value = true;
})
}
const openRevise = ref(false);
const versionValue = ref('');
const formInterfaceVersion = ref({});
const platformHistoryList = ref([]);
const rowOpenRevise = reactive({});
const handleOpenRevise = (row) => {
getSuperPlatformInf(row.id).then(response => {
@ -678,11 +690,45 @@ const switchBeforeChange = () => {
rowOpenRevise.extInfo = JSON.stringify(rowOpenRevise.extInfo);
rowOpenRevise.urlInfo = JSON.stringify(rowOpenRevise.urlInfo);
oldForm.value = JSON.stringify(rowOpenRevise);
formInterfaceVersion.value = response.data;
let arr = [];
arr.push({
label: proxy.t('当前版本'),
value: 0
});
platformHistoryList.value = response.data.platformHistoryList;
response.data.platformHistoryList.map(item => {
arr.push({
label: proxy.t('历史版本')+item.versionCode,
value: item.versionCode
})
});
versionItem.value = arr;
openRevise.value = true;
})
}
//
const switchingVersions = (value) =>{
if (value == 0){
Object.assign(formInterface, formInterfaceVersion.value);
}else{
platformHistoryList.value.map(item => {
if (item.versionCode == value){
let objitem = JSON.parse(item.content);
Object.assign(formInterface, objitem);
rowOpenRevise.platformInfo = JSON.stringify(objitem.platformInfo);
rowOpenRevise.keyInfo = JSON.stringify(objitem.keyInfo);
rowOpenRevise.langInfo = JSON.stringify(objitem.langInfo);
rowOpenRevise.currencyInfo = JSON.stringify(objitem.currencyInfo);
rowOpenRevise.extInfo = JSON.stringify(objitem.extInfo);
rowOpenRevise.urlInfo = JSON.stringify(objitem.urlInfo);
}
})
}
}
/** 详细信息 */
function handleView(row) {
titlePlatForm.value = proxy.t('详情');