|
|
@@ -13,7 +13,7 @@ const solutions = ref([]);
|
|
|
const selectedSolutions = reactive([]);
|
|
|
const totalProfit = ref({});
|
|
|
|
|
|
-const jcOptions = reactive({
|
|
|
+const psOptions = reactive({
|
|
|
bet: 10000,
|
|
|
rebate: 12,
|
|
|
});
|
|
|
@@ -39,34 +39,34 @@ const totalProfitValue = computed(() => {
|
|
|
const sol1 = formatSolution(preSolution, gamesEvents);
|
|
|
const sol2 = formatSolution(subSolution, gamesEvents);
|
|
|
|
|
|
- const jcScale = jcOptions.bet / profit.jc_base ?? 10000;
|
|
|
- const jcRebate = jcOptions.bet * jcOptions.rebate / 100;
|
|
|
+ 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] * jcScale);
|
|
|
+ profitInfo[key] = fixFloat(profit[key] * psScale);
|
|
|
}
|
|
|
else if (key.startsWith('win_')) {
|
|
|
- profitInfo[key] = fixFloat(profit[key] * jcScale + jcRebate);
|
|
|
+ profitInfo[key] = fixFloat(profit[key] * psScale + psRebate);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- const jcInfo = [];
|
|
|
+ const psInfo = [];
|
|
|
const outPreSol = [];
|
|
|
const outSubSol = [];
|
|
|
|
|
|
const solutions = [sol1, sol2].filter(item => item);
|
|
|
solutions.forEach((item, index) => {
|
|
|
- const { sol: { jc_index }, cpr } = item;
|
|
|
+ const { sol: { ps_index }, cpr } = item;
|
|
|
const newCpr = [...cpr];
|
|
|
- const jc_info = newCpr.splice(jc_index, 1);
|
|
|
- jcInfo.push({ ...jc_info[0] });
|
|
|
+ const ps_info = newCpr.splice(ps_index, 1);
|
|
|
+ psInfo.push({ ...ps_info[0] });
|
|
|
newCpr.forEach((c, i) => {
|
|
|
let side = '';
|
|
|
- if (jc_index == 0) {
|
|
|
+ if (ps_index == 0) {
|
|
|
if (i == 0) {
|
|
|
side = "B"
|
|
|
}
|
|
|
@@ -74,7 +74,7 @@ const totalProfitValue = computed(() => {
|
|
|
side = "M";
|
|
|
}
|
|
|
}
|
|
|
- else if (jc_index == 1) {
|
|
|
+ else if (ps_index == 1) {
|
|
|
if (i == 0) {
|
|
|
side = "A";
|
|
|
}
|
|
|
@@ -99,36 +99,34 @@ const totalProfitValue = computed(() => {
|
|
|
})
|
|
|
});
|
|
|
|
|
|
- return { solutions, profit: profitInfo, jcInfo, outPreSol, outSubSol };
|
|
|
+ return { solutions, profit: profitInfo, psInfo, outPreSol, outSubSol };
|
|
|
});
|
|
|
|
|
|
const solutionsList = computed(() => {
|
|
|
const startTimestamp = selectedSolutions[0]?.timestamp ?? 0;
|
|
|
return solutions.value.map(item => {
|
|
|
const selected = selectedSolutions.findIndex(sol => sol.sid === item.sid) >= 0;
|
|
|
- const disabled = !selected && (item.info.jc.timestamp < startTimestamp + 1000 * 60 * 60 * 2);
|
|
|
+ const disabled = !selected && (item.info.ps.timestamp < startTimestamp + 1000 * 60 * 60 * 2);
|
|
|
const currentSol = { ...item.sol };
|
|
|
|
|
|
- const jcScale = jcOptions.bet / currentSol.jc_base;
|
|
|
- const jcRebate = jcOptions.bet * jcOptions.rebate / 100;
|
|
|
+ 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] * jcScale);
|
|
|
+ currentSol[key] = fixFloat(currentSol[key] * psScale);
|
|
|
}
|
|
|
else if (key.startsWith('win_')) {
|
|
|
- currentSol[key] = fixFloat(currentSol[key] * jcScale + jcRebate);
|
|
|
+ currentSol[key] = fixFloat(currentSol[key] * psScale + psRebate);
|
|
|
}
|
|
|
});
|
|
|
- // console.log(new Date(item.info.jc.timestamp), new Date(startTimestamp), disabled);
|
|
|
return { ...item, sol: currentSol, selected, disabled };
|
|
|
- })
|
|
|
- // .filter(item => !item.disabled);
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
const getSolutions = async () => {
|
|
|
try {
|
|
|
- const data = await requestClient.get('/triangle/get_solutions');
|
|
|
+ const data = await requestClient.get('/pstery/get_solutions');
|
|
|
return data;
|
|
|
}
|
|
|
catch (error) {
|
|
|
@@ -141,7 +139,7 @@ const getSolutions = async () => {
|
|
|
const calcTotalProfit = async () => {
|
|
|
const [sid1, sid2] = selectedSolutions.map(item => item.sid);
|
|
|
try {
|
|
|
- const totalProfit = await requestClient.post('/triangle/calc_total_profit', { sid1, sid2, gold_side_jc: 10000 });
|
|
|
+ const totalProfit = await requestClient.post('/pstery/calc_total_profit', { sid1, sid2, gold_side_ps: 10000 });
|
|
|
return totalProfit;
|
|
|
}
|
|
|
catch (error) {
|
|
|
@@ -160,6 +158,9 @@ const parseIorKey = (iorKey) => {
|
|
|
const formatJcEvents = (events) => {
|
|
|
const eventsMap = {};
|
|
|
Object.keys(events).forEach(key => {
|
|
|
+ if (key == 'ior_rh_05' || key == 'ior_rc_05') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
const { type, side, ratio } = parseIorKey(key);
|
|
|
let ratioKey, index;
|
|
|
if (type === 'r') {
|
|
|
@@ -174,7 +175,15 @@ const formatJcEvents = (events) => {
|
|
|
}
|
|
|
else if (type === 'm') {
|
|
|
ratioKey = 0;
|
|
|
- index = 1;
|
|
|
+ if (side == 'h') {
|
|
|
+ index = 0;
|
|
|
+ }
|
|
|
+ else if (side == 'c') {
|
|
|
+ index = 2;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ index = 1;
|
|
|
+ }
|
|
|
}
|
|
|
else if (type === 'wm') {
|
|
|
if (side === 'h') {
|
|
|
@@ -207,7 +216,7 @@ const formatJcEvents = (events) => {
|
|
|
});
|
|
|
return Object.keys(eventsMap).sort((a, b) => b.localeCompare(a)).map(key => {
|
|
|
return [key, ...eventsMap[key]];
|
|
|
- });
|
|
|
+ }).filter(item => item.length == 4 && !item.some(v => !v));
|
|
|
}
|
|
|
|
|
|
const rivalIor = (ior) => {
|
|
|
@@ -247,9 +256,11 @@ const formatEvents = (events, cprKeys) => {
|
|
|
}
|
|
|
else if (type === 'm') {
|
|
|
ratioKey = 'm';
|
|
|
- values[0] = { key: '', value: 0 };
|
|
|
- values[1] = { key, value: events[key] ?? 0 };
|
|
|
- values[2] = { key: '', value: 0 };
|
|
|
+ if (side == 'n') {
|
|
|
+ values[0] = { key: 'ior_mh', value: events['ior_mh'] ?? 0 };
|
|
|
+ values[1] = { key: 'ior_mn', value: events['ior_mn'] ?? 0 };
|
|
|
+ values[2] = { key: 'ior_mc', value: events['ior_mc'] ?? 0 };
|
|
|
+ }
|
|
|
}
|
|
|
else if (type === 'wm') {
|
|
|
ratioKey = `wm_${Math.abs(ratio)}`;
|
|
|
@@ -289,17 +300,17 @@ const formatSolution = (solution, eventsList) => {
|
|
|
|
|
|
const cprKeys = cpr.map(item => item.k);
|
|
|
|
|
|
- const jcEvents = eventsList.jc?.[info.jc.eventId] ?? {};
|
|
|
const psEvents = eventsList.ps?.[info.ps.eventId] ?? {};
|
|
|
const obEvents = eventsList.ob?.[info.ob.eventId] ?? {};
|
|
|
+ const hgEvents = eventsList.hg?.[info.hg.eventId] ?? {};
|
|
|
|
|
|
- info.jc.events = formatJcEvents(jcEvents);
|
|
|
- info.ps.events = formatEvents(psEvents, cprKeys);
|
|
|
+ info.ps.events = formatJcEvents(psEvents);
|
|
|
info.ob.events = formatEvents(obEvents, cprKeys);
|
|
|
+ info.hg.events = formatEvents(hgEvents, cprKeys);
|
|
|
|
|
|
- info.jc.dateTime = dayjs(info.jc.timestamp).format('YYYY-MM-DD HH:mm:ss');
|
|
|
info.ps.dateTime = dayjs(info.ps.timestamp).format('YYYY-MM-DD HH:mm:ss');
|
|
|
info.ob.dateTime = dayjs(info.ob.timestamp).format('YYYY-MM-DD HH:mm:ss');
|
|
|
+ info.hg.dateTime = dayjs(info.hg.timestamp).format('YYYY-MM-DD HH:mm:ss');
|
|
|
|
|
|
cpr.forEach(item => {
|
|
|
const { k, p } = item;
|
|
|
@@ -366,39 +377,39 @@ onUnmounted(() => {
|
|
|
<div class="contents-header transition-all duration-200" :style="headerStyle">
|
|
|
<div class="solution-options">
|
|
|
<Form layout="inline">
|
|
|
- <Form.Item label="JC 投注">
|
|
|
- <InputNumber size="small" placeholder="JC投注" min="1000" v-model:value="jcOptions.bet" />
|
|
|
+ <Form.Item label="PS 投注">
|
|
|
+ <InputNumber size="small" placeholder="PS投注" min="1000" v-model:value="psOptions.bet" />
|
|
|
</Form.Item>
|
|
|
- <Form.Item label="JC 返点">
|
|
|
- <InputNumber size="small" placeholder="JC返点" min="0" v-model:value="jcOptions.rebate" />
|
|
|
+ <Form.Item label="PS 返点">
|
|
|
+ <InputNumber size="small" placeholder="PS返点" min="0" v-model:value="psOptions.rebate" />
|
|
|
</Form.Item>
|
|
|
</Form>
|
|
|
</div>
|
|
|
<div class="solution-header">
|
|
|
- <span>JC</span>
|
|
|
<span>PS</span>
|
|
|
<span>OB</span>
|
|
|
+ <span>HG</span>
|
|
|
<em>利润</em>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="solution-list">
|
|
|
<div class="solution-item"
|
|
|
- v-for="{ sid, sol: { win_average }, info: { jc, ps, ob }, selected, disabled } in solutionsList" :key="sid"
|
|
|
+ v-for="{ sid, sol: { win_average }, info: { ps, ob, hg }, selected, disabled } in solutionsList" :key="sid"
|
|
|
:class="{ 'selected': selected, 'disabled': disabled }">
|
|
|
- <MatchCard platform="jc" :eventId="jc.eventId" :leagueName="jc.leagueName" :teamHomeName="jc.teamHomeName"
|
|
|
- :teamAwayName="jc.teamAwayName" :dateTime="jc.dateTime" :eventInfo="jc.eventInfo" :events="jc.events ?? []"
|
|
|
- :matchNumStr="jc.matchNumStr" :selected="jc.selected ?? []" />
|
|
|
-
|
|
|
<MatchCard platform="ps" :eventId="ps.eventId" :leagueName="ps.leagueName" :teamHomeName="ps.teamHomeName"
|
|
|
- :teamAwayName="ps.teamAwayName" :dateTime="ps.dateTime" :events="ps.events ?? []"
|
|
|
- :selected="ps.selected ?? []" />
|
|
|
+ :teamAwayName="ps.teamAwayName" :dateTime="ps.dateTime" :eventInfo="ps.eventInfo" :events="ps.events ?? []"
|
|
|
+ :matchNumStr="ps.matchNumStr" :selected="ps.selected ?? []" />
|
|
|
|
|
|
<MatchCard platform="ob" :eventId="ob.eventId" :leagueName="ob.leagueName" :teamHomeName="ob.teamHomeName"
|
|
|
:teamAwayName="ob.teamAwayName" :dateTime="ob.dateTime" :events="ob.events ?? []"
|
|
|
:selected="ob.selected ?? []" />
|
|
|
|
|
|
- <div class="solution-profit" @click="!disabled && toggleSolution(sid, jc.timestamp)">{{ win_average }}</div>
|
|
|
+ <MatchCard platform="hg" :eventId="hg.eventId" :leagueName="hg.leagueName" :teamHomeName="hg.teamHomeName"
|
|
|
+ :teamAwayName="hg.teamAwayName" :dateTime="hg.dateTime" :events="hg.events ?? []"
|
|
|
+ :selected="hg.selected ?? []" />
|
|
|
+
|
|
|
+ <div class="solution-profit" @click="!disabled && toggleSolution(sid, ps.timestamp)">{{ win_average }}</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="list-empty" v-if="!solutionsList.length">暂无数据</div>
|
|
|
@@ -412,31 +423,31 @@ onUnmounted(() => {
|
|
|
>
|
|
|
<div class="solution-total-profit" v-if="totalProfitValue.solutions.length">
|
|
|
<div class="solution-item"
|
|
|
- v-for="{ sid, info: { jc, ps, ob } } in totalProfitValue.solutions" :key="sid">
|
|
|
- <MatchCard platform="jc" :eventId="jc.eventId" :leagueName="jc.leagueName" :teamHomeName="jc.teamHomeName"
|
|
|
- :teamAwayName="jc.teamAwayName" :dateTime="jc.dateTime" :eventInfo="jc.eventInfo" :events="jc.events ?? []"
|
|
|
- :matchNumStr="jc.matchNumStr" :selected="jc.selected ?? []" />
|
|
|
-
|
|
|
+ v-for="{ sid, info: { ps, ob, hg } } in totalProfitValue.solutions" :key="sid">
|
|
|
<MatchCard platform="ps" :eventId="ps.eventId" :leagueName="ps.leagueName" :teamHomeName="ps.teamHomeName"
|
|
|
- :teamAwayName="ps.teamAwayName" :dateTime="ps.dateTime" :events="ps.events ?? []"
|
|
|
- :selected="ps.selected ?? []" />
|
|
|
+ :teamAwayName="ps.teamAwayName" :dateTime="ps.dateTime" :eventInfo="ps.eventInfo" :events="ps.events ?? []"
|
|
|
+ :matchNumStr="ps.matchNumStr" :selected="ps.selected ?? []" />
|
|
|
|
|
|
<MatchCard platform="ob" :eventId="ob.eventId" :leagueName="ob.leagueName" :teamHomeName="ob.teamHomeName"
|
|
|
:teamAwayName="ob.teamAwayName" :dateTime="ob.dateTime" :events="ob.events ?? []"
|
|
|
:selected="ob.selected ?? []" />
|
|
|
+
|
|
|
+ <MatchCard platform="hg" :eventId="hg.eventId" :leagueName="hg.leagueName" :teamHomeName="hg.teamHomeName"
|
|
|
+ :teamAwayName="hg.teamAwayName" :dateTime="hg.dateTime" :events="hg.events ?? []"
|
|
|
+ :selected="hg.selected ?? []" />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="profit-info">
|
|
|
<table>
|
|
|
<tr>
|
|
|
<th></th>
|
|
|
- <td>JC</td>
|
|
|
+ <td>PS</td>
|
|
|
<td colspan="2">第一场</td>
|
|
|
<td colspan="2">第二场</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<th>赔率</th>
|
|
|
- <td>{{ totalProfitValue.jcInfo[0]?.v }}: {{ totalProfitValue.jcInfo[1]?.v }}</td>
|
|
|
+ <td>{{ totalProfitValue.psInfo[0]?.v }}: {{ totalProfitValue.psInfo[1]?.v }}</td>
|
|
|
<td>{{ totalProfitValue.outPreSol[0]?.p }}: {{ totalProfitValue.outPreSol[0]?.v }}</td>
|
|
|
<td>{{ totalProfitValue.outPreSol[1]?.p }}: {{ totalProfitValue.outPreSol[1]?.v }}</td>
|
|
|
<td>{{ totalProfitValue.outSubSol[0]?.p }}: {{ totalProfitValue.outSubSol[0]?.v }}</td>
|
|
|
@@ -444,7 +455,7 @@ onUnmounted(() => {
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<th>下注</th>
|
|
|
- <td>{{ jcOptions.bet }}</td>
|
|
|
+ <td>{{ psOptions.bet }}</td>
|
|
|
<td>{{ totalProfitValue.outPreSol[0]?.g }}</td>
|
|
|
<td>{{ totalProfitValue.outPreSol[1]?.g }}</td>
|
|
|
<td>{{ totalProfitValue.outSubSol[0]?.g }}</td>
|
|
|
@@ -452,7 +463,7 @@ onUnmounted(() => {
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<th>利润</th>
|
|
|
- <td>{{ totalProfitValue.profit.win_jc }}</td>
|
|
|
+ <td>{{ totalProfitValue.profit.win_ps }}</td>
|
|
|
<td colspan="2">{{ totalProfitValue.profit.win_target }}</td>
|
|
|
<td colspan="2">{{ totalProfitValue.profit.win_target }}</td>
|
|
|
</tr>
|