fix:1,优化
parent
713ddce547
commit
9eba581f57
|
@ -135,7 +135,6 @@ const timeTypeChange = (val) => {
|
|||
getTimeFnTop(dayjs().subtract(1, 'day').startOf('day')),
|
||||
getTimeFnTop(dayjs().subtract(1, 'day').endOf('day'))
|
||||
];
|
||||
console.log(dateRange.value);
|
||||
}else{
|
||||
dateRange.value = getTimeFn(dayjs().startOf('day'));
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<el-form-item :label="t('时间')" prop="dateRange">
|
||||
<el-date-picker v-model="dateRange"
|
||||
:editable="false" type="datetimerange" :start-placeholder="t('开始时间')"
|
||||
:end-placeholder="t('结束时间')" format="YYYY-MM-DD" value-format="YYYY-MM-DD HH:mm:ss" />
|
||||
:end-placeholder="t('结束时间')" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" />
|
||||
</el-form-item>
|
||||
</template>
|
||||
<template #right>
|
||||
|
@ -155,6 +155,7 @@ import Crontab from '@/components/Crontab'
|
|||
import CustomSelect from '@/components/CustomSelect'
|
||||
import { parseTime } from '@/utils/ruoyi'; // 时间格式化
|
||||
import { id } from "element-plus/es/locales.mjs";
|
||||
import dayjs from 'dayjs';
|
||||
const router = useRouter();
|
||||
const { proxy } = getCurrentInstance();
|
||||
const { ff_tenant_type, ff_tenant_status,ff_tenant_agent_approval_status,ff_tenant_agent_commission_type } = proxy.useDict("ff_tenant_type", "ff_tenant_status","ff_tenant_agent_approval_status","ff_tenant_agent_commission_type");
|
||||
|
@ -179,7 +180,10 @@ const withdrawn = ref(0);
|
|||
const total = ref(0);
|
||||
const invite = ref(0);
|
||||
const take = ref(0);
|
||||
const dateRange = ref([]);
|
||||
const dateRange = ref([
|
||||
dayjs().startOf('day').format('YYYY-MM-DD HH:mm:ss'),
|
||||
dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss')
|
||||
]);
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
|
@ -213,7 +217,6 @@ function getList() {
|
|||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
/** 取消按钮 */
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
|
|
|
@ -47,8 +47,8 @@
|
|||
default: () => ({})
|
||||
},
|
||||
currencyType: {
|
||||
type: Array,
|
||||
default:()=>[]
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
// 卡片数据
|
||||
|
|
|
@ -48,8 +48,8 @@
|
|||
default: () => ({})
|
||||
},
|
||||
currencyType: {
|
||||
type: Array,
|
||||
default:()=>[]
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
// 卡片数据
|
||||
|
|
|
@ -179,8 +179,8 @@ import { el } from 'element-plus/es/locales.mjs';
|
|||
|
||||
const props = defineProps({
|
||||
currencyType: {
|
||||
type: Array,
|
||||
default: () => ['VND']
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
const operateTimeType = ref('day'); // 操作时间类型
|
||||
|
@ -237,7 +237,7 @@ import { el } from 'element-plus/es/locales.mjs';
|
|||
let obj = {
|
||||
operationType:tabPosition.value,
|
||||
timeZone:timeZones,
|
||||
currencyCode:props.currencyType.join(","),
|
||||
currencyCode:props.currencyType,
|
||||
startTime:finalTimestamp(dateRange.value[0]),
|
||||
endTime:finalTimestamp(dateRange.value[1]),
|
||||
}
|
||||
|
|
|
@ -2,8 +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 filterable :placeholder="t('请选择币种')" style="width: 220px;"
|
||||
@change="getHomeIndexs" @allSelect="getHomeIndexs"></CheckboxSelect>
|
||||
<CustomSelect v-model="currencyCodes" :options="currencyOptions" collapse-tags collapse-tags-tooltip filterable :placeholder="t('请选择币种')" style="width: 220px;"
|
||||
@change="getHomeIndexs"></CustomSelect>
|
||||
|
||||
<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;"
|
||||
|
@ -24,8 +25,8 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
<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>
|
||||
<CustomSelect v-model="currencyCodes" :options="currencyOptions" collapse-tags collapse-tags-tooltip filterable :placeholder="t('请选择币种')" style="width: 220px;"
|
||||
@change="getHomeIndexs"></CustomSelect>
|
||||
<CheckboxSelect v-model="platformCodes" dataType="platformSelectList" collapse-tags collapse-tags-tooltip filterable :placeholder="t('请选择平台')" style="width: 220px;"
|
||||
@change="getHomerealTimeFocusTenants" @allSelect="getHomerealTimeFocusTenants"></CheckboxSelect>
|
||||
</div>
|
||||
|
@ -54,15 +55,25 @@ import TodayRankingCard from "./components/TodayRankingCard";
|
|||
// import RecentlyCard from "./components/RecentlyCard";
|
||||
import OperationCard from "./components/OperationCard";
|
||||
import CurrencySelect from '@/components/CurrencySelect'; // 币种选择
|
||||
import CustomSelect from '@/components/CustomSelect';
|
||||
import { getLocalStorage } from "@/utils/auth";
|
||||
import CheckboxSelect from '@/components/CheckboxSelect';
|
||||
import auth from '@/plugins/auth'
|
||||
import {getHomeIndex,getHomerealTimeFocusTenant} from "@/api/home";
|
||||
import { nextTick } from "vue";
|
||||
const currencyCodes = ref(['VND']);
|
||||
const currencyCodes = ref('VND');
|
||||
const platformCodes = ref([]);
|
||||
const tenantKeys = ref([]);
|
||||
const cardData = ref({});
|
||||
const loadings = ref(true);
|
||||
const currencyOptions = ref([]);
|
||||
let resData = getLocalStorage('currencySelect');
|
||||
currencyOptions.value = resData.map(item => {
|
||||
return {
|
||||
label: `${item.currencyName}(${item.currencyCode})`,
|
||||
value: item.currencyCode
|
||||
}
|
||||
});
|
||||
const getHomeIndexs = async () => {
|
||||
|
||||
// 获取当前时间
|
||||
|
@ -74,7 +85,7 @@ const startOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate()).ge
|
|||
// 当天结束时间(23:59:59.999)
|
||||
const endOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999).getTime();
|
||||
let obj = {
|
||||
currencyCode:currencyCodes.value.join(","),
|
||||
currencyCode:currencyCodes.value,
|
||||
platformCodes:platformCodes.value.join(","),
|
||||
tenantKeys:tenantKeys.value.join(","),
|
||||
startTime:startOfDay,
|
||||
|
@ -99,7 +110,7 @@ const startOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate()).ge
|
|||
// 当天结束时间(23:59:59.999)
|
||||
const endOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999).getTime();
|
||||
let obj = {
|
||||
currencyCode:currencyCodes.value.join(","),
|
||||
currencyCode:currencyCodes.value,
|
||||
platformCodes:platformCodes.value.join(","),
|
||||
startTime:startOfDay,
|
||||
endTime:endOfDay,
|
||||
|
|
|
@ -221,11 +221,20 @@ function getSuperCommonCurrencySelect() {
|
|||
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 : [];
|
||||
|
@ -235,6 +244,7 @@ const loading2 = ref(false);
|
|||
|
||||
const changeCurrency = (val) => {
|
||||
loading2.value = true;
|
||||
console.log(tenantSystemPlatforms.value.length);
|
||||
formAll.tenantSystemPlatforms = findByConditions(tenantSystemPlatforms.value, { currencyCode: val });
|
||||
totalPlatform.value = formAll.tenantSystemPlatforms.length;
|
||||
nextTick(() => {
|
||||
|
|
|
@ -29,7 +29,8 @@
|
|||
</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="false" :inactive-value="true"
|
||||
<base-switch v-model="row.stopStatus" v-hasPermi="['super:platform:switch']" active-text="开启"
|
||||
inactive-text="关闭" :active-value="false" :inactive-value="true"
|
||||
:before-change="() => beforeSwitchChange(row, 'stopStatus')" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -128,17 +129,26 @@
|
|||
<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('平台代码')">
|
||||
<el-descriptions-item label-width="150" label-align="right">
|
||||
<template #label>
|
||||
{{ t('平台代码') }} <span style="color: red;position: relative;top: 3px;">*</span>
|
||||
</template>
|
||||
<el-form-item label-width="0" style="width: 100%;" prop="platformCode">
|
||||
<el-input v-model="rowOpenRevise.platformCode" style="width: 400px;" :placeholder="t('请输入平台代码')"> </el-input>
|
||||
<el-input v-model="rowOpenRevise.platformCode" disabled style="width: 400px;" :placeholder="t('请输入平台代码')"> </el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-width="150" label-align="right" :label="t('平台展示代码')">
|
||||
<el-descriptions-item label-width="150" label-align="right">
|
||||
<template #label>
|
||||
{{ t('平台展示代码') }} <span style="color: red;position: relative;top: 3px;">*</span>
|
||||
</template>
|
||||
<el-form-item label-width="0" style="width: 100%;" prop="platformShowCode">
|
||||
<el-input v-model="rowOpenRevise.platformShowCode" style="width: 400px;" :placeholder="t('请输入平台展示代码')"> </el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-width="150" label-align="right" :label="t('平台名称')">
|
||||
<el-descriptions-item label-width="150" label-align="right" >
|
||||
<template #label>
|
||||
{{ t('平台名称') }} <span style="color: red;position: relative;top: 3px;">*</span>
|
||||
</template>
|
||||
<el-form-item label-width="0" style="width: 100%;" prop="platformName">
|
||||
<el-input v-model="rowOpenRevise.platformName" style="width: 400px;" :placeholder="t('请输入平台名称')"> </el-input>
|
||||
</el-form-item>
|
||||
|
@ -150,14 +160,20 @@
|
|||
<el-radio-button :value="0" >{{ t('多币种') }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-width="150" label-align="right" :label="t('平台信息')">
|
||||
<el-descriptions-item label-width="150" label-align="right">
|
||||
<template #label>
|
||||
{{ t('平台信息') }} <span style="color: red;position: relative;top: 3px;">*</span>
|
||||
</template>
|
||||
<div style="width: 100%;display: flex;flex-wrap: wrap;">
|
||||
<el-form-item label-width="0" style="width: 100%;" prop="platformInfo">
|
||||
<el-input type="textarea" rows="4" v-model="rowOpenRevise.platformInfo" style="width: 400px;" :placeholder="t('请输入平台信息')"> </el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-width="150" label-align="right" :label="t('地址信息')">
|
||||
<el-descriptions-item label-width="150" label-align="right">
|
||||
<template #label>
|
||||
{{ t('地址信息') }} <span style="color: red;position: relative;top: 3px;">*</span>
|
||||
</template>
|
||||
<div style="width: 100%;display: flex;flex-wrap: wrap;">
|
||||
<el-form-item label-width="0" style="width: 100%;" prop="urlInfo">
|
||||
<el-input type="textarea" rows="4" v-model="rowOpenRevise.urlInfo" style="width: 400px;" :placeholder="t('请输入语言信息')"> </el-input>
|
||||
|
@ -165,14 +181,20 @@
|
|||
</div>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label-width="150" label-align="right" :label="t('语言信息')">
|
||||
<el-descriptions-item label-width="150" label-align="right">
|
||||
<template #label>
|
||||
{{ t('语言信息') }} <span style="color: red;position: relative;top: 3px;">*</span>
|
||||
</template>
|
||||
<div style="width: 100%;display: flex;flex-wrap: wrap;">
|
||||
<el-form-item label-width="0" style="width: 100%;" prop="langInfo">
|
||||
<el-input type="textarea" rows="4" v-model="rowOpenRevise.langInfo" style="width: 400px;" :placeholder="t('请输入语言信息')"> </el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-width="150" label-align="right" :label="t('币种信息')">
|
||||
<el-descriptions-item label-width="150" label-align="right" >
|
||||
<template #label>
|
||||
{{ t('币种信息') }} <span style="color: red;position: relative;top: 3px;">*</span>
|
||||
</template>
|
||||
<div style="width: 100%;display: flex;flex-wrap: wrap;">
|
||||
<el-form-item label-width="0" style="width: 100%;" prop="currencyInfo">
|
||||
<el-input type="textarea" rows="4" v-model="rowOpenRevise.currencyInfo" style="width: 400px;" :placeholder="t('请输入币种信息')"> </el-input>
|
||||
|
@ -180,7 +202,10 @@
|
|||
<!-- {{ rowOpenRevise.currencyInfo }} -->
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-width="150" label-align="right" :label="t('扩展信息')">
|
||||
<el-descriptions-item label-width="150" label-align="right" >
|
||||
<template #label>
|
||||
{{ t('扩展信息') }} <span style="color: red;position: relative;top: 3px;">*</span>
|
||||
</template>
|
||||
<div style="width: 100%;display: flex;flex-wrap: wrap;">
|
||||
<el-form-item label-width="0" style="width: 100%;" prop="extInfo">
|
||||
<el-input type="textarea" rows="4" v-model="rowOpenRevise.extInfo" style="width: 400px;" :placeholder="t('请输入币种信息')"> </el-input>
|
||||
|
@ -188,7 +213,10 @@
|
|||
<!-- {{ rowOpenRevise.currencyInfo }} -->
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label-width="150" label-align="right" :label="t('密钥信息')">
|
||||
<el-descriptions-item label-width="150" label-align="right">
|
||||
<template #label>
|
||||
{{ t('密钥信息') }} <span style="color: red;position: relative;top: 3px;">*</span>
|
||||
</template>
|
||||
<div style="width: 100%;display: flex;flex-wrap: wrap;">
|
||||
<el-form-item label-width="0" style="width: 100%;" prop="keyInfo">
|
||||
<el-input type="textarea" rows="8" v-model="rowOpenRevise.keyInfo" style="width: 100%;" :placeholder="t('请输入密钥信息')"> </el-input>
|
||||
|
|
Loading…
Reference in New Issue