This commit is contained in:
2024-07-17 17:07:46 +08:00
parent 60bc7b43ee
commit 2aa754d471
48 changed files with 2256 additions and 3804 deletions

View File

@ -327,11 +327,6 @@ onMounted(async () => {
console.error(err)
})
ipcRenderer.on('UPDATE_HINT', (event, message) => {
state.log = message
state.status = 'updated'
})
ipcRenderer.on('AUTHKEY_TIMEOUT', (event, message) => {
state.authkeyTimeout = message
})

View File

@ -8,21 +8,21 @@
<span class="mr-1">{{text.total}}
<span class="text-blue-600">{{detail.total}}</span> {{text.times}}
</span>
<span v-if="type !== '100'">{{text.sum}}<span class="mx-1 text-green-600">{{detail.countMio}}</span>{{text.no5star}}</span>
<span v-if="type !== '100'">{{text.sum}}<span class="mx-1 text-green-600">{{detail.countMio}}</span>{{text.no4star}}</span>
</p>
<p class="text-gray-600 text-xs mb-1">
<span :title="`${text.character}${colon}${detail.count5c}\n${text.weapon}${colon}${detail.count5w}`" class="mr-3 whitespace-pre cursor-help text-yellow-500">
<span class="min-w-10 inline-block">{{text.star5}}{{colon}}{{detail.count5}}</span>
[{{percent(detail.count5, detail.total)}}]
</span>
<br><span :title="`${text.character}${colon}${detail.count4c}\n${text.weapon}${colon}${detail.count4w}`" class="mr-3 whitespace-pre cursor-help text-purple-600">
<span :title="`${text.character}${colon}${detail.count4c}\n${text.weapon}${colon}${detail.count4w}\n${text.bang}${colon}${detail.count4b}`" class="mr-3 whitespace-pre cursor-help text-yellow-500">
<span class="min-w-10 inline-block">{{text.star4}}{{colon}}{{detail.count4}}</span>
[{{percent(detail.count4, detail.total)}}]
</span>
<br><span class="text-blue-500 whitespace-pre">
<br><span :title="`${text.character}${colon}${detail.count3c}\n${text.weapon}${colon}${detail.count3w}\n${text.bang}${colon}${detail.count3b}`" class="mr-3 whitespace-pre cursor-help text-purple-600">
<span class="min-w-10 inline-block">{{text.star3}}{{colon}}{{detail.count3}}</span>
[{{percent(detail.count3, detail.total)}}]
</span>
<br><span class="text-blue-500 whitespace-pre">
<span class="min-w-10 inline-block">{{text.star2}}{{colon}}{{detail.count2}}</span>
[{{percent(detail.count2, detail.total)}}]
</span>
</p>
<p class="text-gray-600 text-xs mb-1" v-if="detail.ssrPos.length">

View File

@ -32,21 +32,23 @@ const props = defineProps({
const chart = ref(null);
const colors = ["#fac858", "#ee6666", "#5470c6", "#91cc75", "#73c0de"];
const colors = ["#eeaa66", "#fac858", "#ee6666", "#5470c6", "#ba66ee", "#91cc75", "#73c0de"];
const parseData = (detail, type) => {
const text = props.i18n.ui.data;
const keys = [
[text.chara5, "count5c"],
[text.weapon5, "count5w"],
[text.bang4, "count4b"],
[text.chara4, "count4c"],
[text.weapon4, "count4w"],
[text.chara3, "count3c"],
[text.bang3, "count3b"],
[text.weapon3, "count3w"],
[text.weapon2, "count2w"]
];
const result = [];
const color = [];
const selected = {
[text.weapon3]: false,
[text.weapon2]: false,
};
keys.forEach((key, index) => {
if (!detail[key[1]]) return;
@ -58,9 +60,9 @@ const parseData = (detail, type) => {
});
if (
type === "100" ||
result.findIndex((item) => item.name.includes("5")) === -1
result.findIndex((item) => item.name.includes("S")) === -1
) {
selected[text.weapon3] = true;
selected[text.weapon2] = true;
}
return [result, color, selected];
};

View File

@ -23,18 +23,6 @@
<el-button type="primary" plain @click="state.showDataDialog = true">{{common.dataManage}}</el-button>
<p class="text-gray-400 text-xs m-1.5">{{text.dataManagerHint}}</p>
</el-form-item>
<el-form-item :label="text.autoUpdate">
<el-switch
@change="saveSetting"
v-model="settingForm.autoUpdate">
</el-switch>
</el-form-item>
<el-form-item :label="text.hideNovice">
<el-switch
@change="saveSetting"
v-model="settingForm.hideNovice">
</el-switch>
</el-form-item>
<el-form-item :label="text.fetchFullHistory">
<el-switch
@change="saveSetting"
@ -54,7 +42,7 @@
</el-form>
<h3 class="text-lg my-4">{{about.title}}</h3>
<p class="text-gray-600 text-xs mt-1">{{about.license}}</p>
<p class="text-gray-600 text-xs mt-1 pb-6">Github: <a @click="openGithub" class="cursor-pointer text-blue-400">https://github.com/biuuu/star-rail-warp-export</a></p>
<p class="text-gray-600 text-xs mt-1 pb-6">Github: <a @click="openGithub" class="cursor-pointer text-blue-400">https://github.com/earthjasonlin/zzz-signal-search-export</a></p>
<el-dialog v-model="state.showDataDialog" :title="common.dataManage" width="90%">
<div class="">
<el-table :data="gachaDataInfo" border stripe>
@ -104,9 +92,7 @@ const settingForm = reactive({
lang: 'zh-cn',
logType: 1,
proxyMode: true,
autoUpdate: true,
fetchFullHistory: false,
hideNovice: true
})
const state = reactive({
@ -119,7 +105,7 @@ const text = computed(() => props.i18n.ui.setting)
const about = computed(() => props.i18n.ui.about)
const saveSetting = async () => {
const keys = ['lang', 'logType', 'proxyMode', 'autoUpdate', 'fetchFullHistory', 'hideNovice']
const keys = ['lang', 'logType', 'proxyMode', 'fetchFullHistory']
for (let key of keys) {
await ipcRenderer.invoke('SAVE_CONFIG', [key, settingForm[key]])
}
@ -136,7 +122,7 @@ const disableProxy = async () => {
await ipcRenderer.invoke('DISABLE_PROXY')
}
const openGithub = () => shell.openExternal('https://github.com/biuuu/star-rail-warp-export')
const openGithub = () => shell.openExternal('https://github.com/earthjasonlin/zzz-signal-search-export')
const openLink = (link) => shell.openExternal(link)
const deleteData = async (uid, action) => {

View File

@ -1,4 +1,4 @@
import { isWeapon, isCharacter } from './utils'
import { isWeapon, isCharacter, isBangboo } from './utils'
const itemCount = (map, name) => {
if (!map.has(name)) {
@ -12,10 +12,11 @@ const gachaDetail = (data) => {
const detailMap = new Map()
for (let [key, value] of data) {
let detail = {
count3: 0, count4: 0, count5: 0,
count3w: 0, count4w: 0, count5w: 0, count4c: 0, count5c: 0,
weapon3: new Map(), weapon4: new Map(), weapon5: new Map(),
char4: new Map(), char5: new Map(),
count2: 0, count3: 0, count4: 0,
count2w: 0, count3w: 0, count4w: 0, count3c: 0, count4c: 0, count3b: 0, count4b: 0,
weapon2: new Map(), weapon3: new Map(), weapon4: new Map(),
char3: new Map(), char4: new Map(),
bang3: new Map(), bang4: new Map(),
date: [],
ssrPos: [], countMio: 0, total: value.length,
}
@ -29,35 +30,41 @@ const gachaDetail = (data) => {
if (!dateMax) dateMax = timestamp
if (dateMin > timestamp) dateMin = timestamp
if (dateMax < timestamp) dateMax = timestamp
if (rank === '3') {
if (rank === '2') {
detail.count2++
detail.countMio++
if (isWeapon(type)) {
detail.count2w++
itemCount(detail.weapon2, name)
}
} else if (rank === '3') {
detail.count3++
detail.countMio++
if (isWeapon(type)) {
detail.count3w++
itemCount(detail.weapon3, name)
} else if (isBangboo(type)) {
detail.count3b++
itemCount(detail.bang3, name)
} else if (isCharacter(type)) {
detail.count3c++
itemCount(detail.char3, name)
}
} else if (rank === '4') {
detail.ssrPos.push([name, index + 1 - lastSSR, time, key])
lastSSR = index + 1
detail.count4++
detail.countMio++
if (isWeapon(type)) {
detail.count4w++
itemCount(detail.weapon4, name)
} else if (isBangboo(type)) {
detail.count4b++
itemCount(detail.bang4, name)
} else if (isCharacter(type)) {
detail.count4c++
itemCount(detail.char4, name)
}
} else if (rank === '5') {
detail.ssrPos.push([name, index + 1 - lastSSR, time, key])
lastSSR = index + 1
detail.count5++
detail.countMio = 0
if (isWeapon(type)) {
detail.count5w++
itemCount(detail.weapon5, name)
} else if (isCharacter(type)) {
detail.count5c++
itemCount(detail.char5, name)
}
}
})
detail.date = [dateMin, dateMax]

View File

@ -1,15 +1,20 @@
import * as IconComponents from '@element-plus/icons-vue'
const weaponTypeNames = new Set([
'光锥', '光錐', 'Lichtkegel', 'Light Cone', 'Conos de luz', 'cônes de lumière', '光円錐', '광추', 'Cones de Luz', 'Световые конусы', 'Nón Ánh Sáng', 'Cône de lumière'
'音擎', 'W-Engines', '音擎'
])
const bangbooTypeNames = new Set([
'邦布', 'Bangboo', '邦布'
])
const characterTypeNames = new Set([
'角色', 'Figur', 'Character', 'Personajes', 'Personnages', 'Karakter', 'キャラクター', '캐릭터', 'Personagens', 'Персонажи', 'ตัวละคร', 'Nhân Vật', 'Personnage'
'代理人', 'Agents', '代理人'
])
const isCharacter = (name) => characterTypeNames.has(name)
const isWeapon = (name) => weaponTypeNames.has(name)
const isBangboo = (name) => bangbooTypeNames.has(name)
const IconInstaller = (app) => {
Object.values(IconComponents).forEach(component => {
@ -20,5 +25,6 @@ const IconInstaller = (app) => {
export {
isWeapon,
isCharacter,
isBangboo,
IconInstaller,
}