|
|
@@ -14,11 +14,6 @@ const selectedSolutions = reactive([]);
|
|
|
const totalProfit = ref({});
|
|
|
const loopActive = ref(false);
|
|
|
|
|
|
-const psOptions = reactive({
|
|
|
- bet: 10000,
|
|
|
- rebate: 0,
|
|
|
-});
|
|
|
-
|
|
|
const totalProfitVisible = ref(false);
|
|
|
|
|
|
const fixFloat = (number, x = 2) => {
|
|
|
@@ -40,21 +35,6 @@ const totalProfitValue = computed(() => {
|
|
|
const sol1 = formatSolution(preSolution, gamesEvents);
|
|
|
const sol2 = formatSolution(subSolution, gamesEvents);
|
|
|
|
|
|
- const psScale = psOptions.bet / profit.ps_base ?? 10000;
|
|
|
- const psRebate = psOptions.bet * psOptions.rebate / 100;
|
|
|
- const profitInfo = {};
|
|
|
- Object.keys(profit).forEach(key => {
|
|
|
- if (key == 'win_diff') {
|
|
|
- return;
|
|
|
- }
|
|
|
- if (key.startsWith('gold')) {
|
|
|
- profitInfo[key] = fixFloat(profit[key] * psScale);
|
|
|
- }
|
|
|
- else if (key.startsWith('win_')) {
|
|
|
- profitInfo[key] = fixFloat(profit[key] * psScale + psRebate);
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
const psInfo = [];
|
|
|
const outPreSol = [];
|
|
|
const outSubSol = [];
|
|
|
@@ -108,19 +88,9 @@ const solutionsList = computed(() => {
|
|
|
return solutions.value.map(item => {
|
|
|
const selected = selectedSolutions.findIndex(sol => sol.sid === item.sid) >= 0;
|
|
|
const disabled = false && !selected && (item.info.ps.timestamp < startTimestamp + 1000 * 60 * 60 * 2);
|
|
|
- const currentSol = { ...item.sol };
|
|
|
-
|
|
|
- const psScale = psOptions.bet / currentSol.inner_base;
|
|
|
- const psRebate = psOptions.bet * psOptions.rebate / 100;
|
|
|
-
|
|
|
- Object.keys(currentSol).forEach(key => {
|
|
|
- if (key.startsWith('gold_')) {
|
|
|
- currentSol[key] = fixFloat(currentSol[key] * psScale);
|
|
|
- }
|
|
|
- else if (key.startsWith('win_')) {
|
|
|
- currentSol[key] = fixFloat(currentSol[key] * psScale + psRebate);
|
|
|
- }
|
|
|
- });
|
|
|
+ const { sol: { inner_base, win_average } } = item;
|
|
|
+ const win_average_rate = fixFloat(win_average / inner_base * 100);
|
|
|
+ const currentSol = { ...item.sol, win_average_rate };
|
|
|
return { ...item, sol: currentSol, selected, disabled };
|
|
|
});
|
|
|
});
|
|
|
@@ -140,7 +110,7 @@ const getSolutions = async () => {
|
|
|
const calcTotalProfit = async () => {
|
|
|
const sids = selectedSolutions.map(item => item.sid);
|
|
|
try {
|
|
|
- const totalProfit = await requestClient.post('/pstery/calc_total_profit', [...sids, psOptions.bet]);
|
|
|
+ const totalProfit = await requestClient.post('/pstery/calc_total_profit', [...sids]);
|
|
|
return totalProfit;
|
|
|
}
|
|
|
catch (error) {
|
|
|
@@ -176,7 +146,8 @@ const formatPsEvents = (events) => {
|
|
|
return PS_IOR_KEYS.map(([label, ...keys]) => {
|
|
|
const match = keys.map(key => ({
|
|
|
key,
|
|
|
- value: events[key] ?? 0
|
|
|
+ value: events[key]?.v ?? 0,
|
|
|
+ origin: events[key]?.r
|
|
|
}));
|
|
|
return {
|
|
|
label,
|
|
|
@@ -295,8 +266,9 @@ const formatEvents = (events, cprKeys) => {
|
|
|
eventsMap[ratioKey] = new Array(3).fill(undefined);
|
|
|
}
|
|
|
|
|
|
- const value = events[key] ?? 0;
|
|
|
- eventsMap[ratioKey][index] = { key, value };
|
|
|
+ const value = events[key]?.v ?? 0;
|
|
|
+ const origin = events[key]?.r;
|
|
|
+ eventsMap[ratioKey][index] = { key, value, origin };
|
|
|
});
|
|
|
|
|
|
return Object.keys(eventsMap).sort((a, b) => a.localeCompare(b)).map(key => {
|
|
|
@@ -398,16 +370,16 @@ onUnmounted(() => {
|
|
|
<div class="solution-container">
|
|
|
|
|
|
<div class="contents-header transition-all duration-200" :style="headerStyle">
|
|
|
- <div class="solution-options">
|
|
|
+ <!-- <div class="solution-options">
|
|
|
<Form layout="inline">
|
|
|
<Form.Item label="PS 投注">
|
|
|
<InputNumber size="small" placeholder="PS投注" min="1000" v-model:value="psOptions.bet" />
|
|
|
</Form.Item>
|
|
|
- <!-- <Form.Item label="PS 返点">
|
|
|
+ <Form.Item label="PS 返点">
|
|
|
<InputNumber size="small" placeholder="PS返点" min="0" v-model:value="psOptions.rebate" />
|
|
|
- </Form.Item> -->
|
|
|
+ </Form.Item>
|
|
|
</Form>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<div class="solution-header">
|
|
|
<span>PS</span>
|
|
|
<span>OB</span>
|
|
|
@@ -418,22 +390,22 @@ onUnmounted(() => {
|
|
|
|
|
|
<div class="solution-list">
|
|
|
<div class="solution-item"
|
|
|
- v-for="{ sid, sol: { win_average, win_profit_rate, cross_type }, info: { ps, ob, hg }, selected, disabled } in solutionsList" :key="sid"
|
|
|
+ v-for="{ sid, sol: { win_average_rate, win_profit_rate, cross_type }, info: { ps, ob, hg }, selected, disabled } in solutionsList" :key="sid"
|
|
|
:class="{ 'selected': selected, 'disabled': disabled }">
|
|
|
<MatchCard platform="ps" :eventId="ps.eventId" :leagueName="ps.leagueName" :teamHomeName="ps.teamHomeName"
|
|
|
:teamAwayName="ps.teamAwayName" :dateTime="ps.dateTime" :eventInfo="ps.eventInfo" :events="ps.events ?? []"
|
|
|
- :matchNumStr="ps.matchNumStr" :selected="ps.selected ?? []" />
|
|
|
+ :matchNumStr="ps.matchNumStr" :selected="ps.selected ?? []" :stage="ps.stage" :score="ps.score" />
|
|
|
|
|
|
<MatchCard platform="ob" :eventId="ob.eventId" :leagueName="ob.leagueName" :teamHomeName="ob.teamHomeName"
|
|
|
:teamAwayName="ob.teamAwayName" :dateTime="ob.dateTime" :events="ob.events ?? []"
|
|
|
- :selected="ob.selected ?? []" />
|
|
|
+ :selected="ob.selected ?? []" :stage="ob.stage" :score="ob.score" />
|
|
|
|
|
|
<MatchCard platform="hg" :eventId="hg.eventId" :leagueName="hg.leagueName" :teamHomeName="hg.teamHomeName"
|
|
|
:teamAwayName="hg.teamAwayName" :dateTime="hg.dateTime" :events="hg.events ?? []"
|
|
|
- :selected="hg.selected ?? []" />
|
|
|
+ :selected="hg.selected ?? []" :stage="hg.stage" :score="hg.score" />
|
|
|
|
|
|
<div class="solution-profit" @click="!disabled && toggleSolution(sid, ps.timestamp)">
|
|
|
- <p>{{ win_average }}</p>
|
|
|
+ <p>{{ win_average_rate }}%</p>
|
|
|
<p>{{ win_profit_rate }}%</p>
|
|
|
<p>{{ cross_type }}</p>
|
|
|
</div>
|
|
|
@@ -541,7 +513,7 @@ onUnmounted(() => {
|
|
|
}
|
|
|
|
|
|
.solution-container {
|
|
|
- padding-top: 74px;
|
|
|
+ padding-top: 31px;
|
|
|
}
|
|
|
|
|
|
.solution-item {
|