mirror of
https://github.com/earthjasonlin/star-rail-warp-export.git
synced 2025-07-05 06:00:15 +08:00
feat: Refine import and export functions
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
"ui.button.load": "Load data",
|
||||
"ui.button.update": "Update",
|
||||
"ui.button.directUpdate": "Direct update",
|
||||
"ui.button.files": "Export Files",
|
||||
"ui.button.files": "Import/Export",
|
||||
"ui.button.excel": "Export Excel",
|
||||
"ui.button.uigf": "Export UIGF",
|
||||
"ui.button.import": "Import UIGF",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"ui.button.load": "加载数据",
|
||||
"ui.button.update": "更新数据",
|
||||
"ui.button.directUpdate": "直接更新",
|
||||
"ui.button.files": "导出文件",
|
||||
"ui.button.files": "导入/导出",
|
||||
"ui.button.excel": "导出Excel",
|
||||
"ui.button.uigf":"导出UIGF",
|
||||
"ui.button.import":"导入UIGF",
|
||||
|
@ -3,7 +3,7 @@
|
||||
"ui.button.load": "載入資料",
|
||||
"ui.button.update": "更新資料",
|
||||
"ui.button.directUpdate": "直接更新",
|
||||
"ui.button.files": "匯出檔案",
|
||||
"ui.button.files": "導入/匯出",
|
||||
"ui.button.excel": "匯出 Excel",
|
||||
"ui.button.uigf": "匯出 UIGF",
|
||||
"ui.button.import":"導入 UIGF",
|
||||
|
@ -127,7 +127,7 @@ const importUIGF = async () => {
|
||||
gacha_type: recordEntry.gacha_type,
|
||||
item_id: recordEntry.item_id,
|
||||
count: recordEntry.count ?? "1",
|
||||
time: convertTimeZone(recordEntry.time, uidData.timezone, region_time_zone),
|
||||
time: recordEntry.time,
|
||||
name: idTargetLangJson?.[recordEntry.item_id].name ?? recordEntry.name,
|
||||
item_type: idTargetLangJson?.[recordEntry.item_id].item_type ?? recordEntry.item_type,
|
||||
rank_type: recordEntry.rank_type,
|
||||
@ -150,7 +150,7 @@ const importUIGF = async () => {
|
||||
} else {
|
||||
data = { result: mergedData, time: Date.now(), uid: dataMap.get(uidData.uid).uid, lang: targetLang, region_time_zone: dataMap.get(uidData.uid).region_time_zone, deleted: dataMap.get(uidData.uid).deleted }
|
||||
}
|
||||
|
||||
|
||||
saveData(data, '')
|
||||
changeCurrent(uidData.uid)
|
||||
dataMap.set(uidData.uid, data)
|
||||
|
@ -443,9 +443,9 @@ const fetchData = async (urlOverride) => {
|
||||
localTimeZone = region_time_zone
|
||||
}
|
||||
}
|
||||
list.forEach(item => {
|
||||
item.time = convertTimeZone(item.time, region_time_zone, localTimeZone)
|
||||
})
|
||||
// list.forEach(item => {
|
||||
// item.time = convertTimeZone(item.time, region_time_zone, localTimeZone)
|
||||
// })
|
||||
const logs = list.map((item) => {
|
||||
const { id, item_id, item_type, name, rank_type, time, gacha_id, gacha_type, count} = item
|
||||
return { id, item_id, item_type, name, rank_type, time, gacha_id, gacha_type, count }
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="space-x-3">
|
||||
<el-button type="primary" :icon="state.status === 'init' ? 'milk-tea': 'refresh-right'" class="focus:outline-none" :disabled="!allowClick()" plain @click="fetchData()" :loading="state.status === 'loading'">{{state.status === 'init' ? ui.button.load: ui.button.update}}</el-button>
|
||||
<el-dropdown :disabled="!gachaData" @command="exportCommand">
|
||||
<el-button :disabled="!gachaData" icon="download" class="focus:outline-none" type="success" plain>
|
||||
<el-button :disabled="!gachaData" icon="folder-opened" class="focus:outline-none" type="success" plain>
|
||||
{{ui.button.files}}
|
||||
<el-icon class="el-icon--right"><arrow-down /></el-icon>
|
||||
</el-button>
|
||||
@ -12,10 +12,10 @@
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="excel">{{ui.button.excel}}</el-dropdown-item>
|
||||
<el-dropdown-item command="uigf-json">{{ui.button.uigf}}</el-dropdown-item>
|
||||
<el-dropdown-item command="import-json" divided>{{ui.button.import}}</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<el-button @click="importData()" icon="upload" class="focus:outline-none" type="success" plain>{{ui.button.import}}</el-button>
|
||||
<el-tooltip v-if="detail && state.status !== 'loading'" :content="ui.hint.newAccount" placement="bottom">
|
||||
<el-button @click="newUser()" plain icon="plus" class="focus:outline-none"></el-button>
|
||||
</el-tooltip>
|
||||
@ -290,6 +290,8 @@ const exportCommand = (type) => {
|
||||
saveExcel()
|
||||
} else if (type === 'uigf-json') {
|
||||
exportUIGFJSON()
|
||||
} else if (type === 'import-json') {
|
||||
importData()
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -8,9 +8,13 @@ const itemCount = (map, name) => {
|
||||
}
|
||||
}
|
||||
|
||||
const order = ['11', '12', '1', '2']
|
||||
|
||||
const gachaDetail = (data) => {
|
||||
const detailMap = new Map()
|
||||
for (let [key, value] of data) {
|
||||
for (let key of order) {
|
||||
if (!data.has(key)) return
|
||||
let value = data.get(key)
|
||||
let detail = {
|
||||
count3: 0, count4: 0, count5: 0,
|
||||
count3w: 0, count4w: 0, count5w: 0, count4c: 0, count5c: 0,
|
||||
|
Reference in New Issue
Block a user