mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-06 08:32:51 +08:00
🎨 代码格式化
This commit is contained in:
@@ -3,3 +3,5 @@ dist
|
||||
src-tauri/target
|
||||
# Submodules
|
||||
TGAssistant
|
||||
# Package files
|
||||
pnpm-lock.yaml
|
||||
|
||||
@@ -17,7 +17,8 @@ globals:
|
||||
TGApp: readonly
|
||||
window: readonly
|
||||
rules:
|
||||
vue/multi-word-component-names: warn
|
||||
vue/multi-word-component-names: off
|
||||
vue/valid-template-root: off
|
||||
overrides:
|
||||
- files: ["*.ts"]
|
||||
extends: standard-with-typescript
|
||||
@@ -34,9 +35,7 @@ overrides:
|
||||
alphabetize:
|
||||
order: asc
|
||||
caseInsensitive: true
|
||||
"@typescript-eslint/indent":
|
||||
- warn
|
||||
- 2
|
||||
"@typescript-eslint/indent": off
|
||||
"@typescript-eslint/quotes":
|
||||
- error
|
||||
- double
|
||||
@@ -57,31 +56,23 @@ overrides:
|
||||
delimiter: semi
|
||||
requireLast: true
|
||||
"@typescript-eslint/no-import-type-side-effects": error
|
||||
"@typescript-eslint/strict-boolean-expressions":
|
||||
- warn
|
||||
- allowString: false
|
||||
allowNumber: false
|
||||
allowNullableObject: false
|
||||
allowNullableBoolean: false
|
||||
allowNullableString: false
|
||||
allowNullableNumber: false
|
||||
allowAny: false
|
||||
"@typescript-eslint/strict-boolean-expressions": off
|
||||
"@typescript-eslint/consistent-type-assertions":
|
||||
- warn
|
||||
- assertionStyle: angle-bracket # 使用尖括号
|
||||
"@typescript-eslint/naming-convention":
|
||||
- warn
|
||||
- selector: variableLike
|
||||
format: ["camelCase", "UPPER_CASE", "PascalCase", "snake_case"]
|
||||
leadingUnderscore: "allow"
|
||||
trailingUnderscore: "allow"
|
||||
format: [camelCase, UPPER_CASE, PascalCase, snake_case]
|
||||
leadingUnderscore: allow
|
||||
trailingUnderscore: allow
|
||||
"@typescript-eslint/no-non-null-assertion": warn
|
||||
"@typescript-eslint/no-misused-promises": warn
|
||||
"@typescript-eslint/no-misused-promises": off
|
||||
- files: ["*.vue"]
|
||||
parser: vue-eslint-parser
|
||||
parserOptions:
|
||||
parser: "@typescript-eslint/parser"
|
||||
extraFileExtensions: [".vue"]
|
||||
extraFileExtensions: [.vue]
|
||||
rules:
|
||||
import/order:
|
||||
- error
|
||||
@@ -94,9 +85,7 @@ overrides:
|
||||
alphabetize:
|
||||
order: asc
|
||||
caseInsensitive: true
|
||||
"@typescript-eslint/indent":
|
||||
- warn
|
||||
- 2
|
||||
"@typescript-eslint/indent": off
|
||||
"@typescript-eslint/quotes":
|
||||
- error
|
||||
- double
|
||||
@@ -117,27 +106,19 @@ overrides:
|
||||
delimiter: semi
|
||||
requireLast: true
|
||||
"@typescript-eslint/no-import-type-side-effects": error
|
||||
"@typescript-eslint/strict-boolean-expressions":
|
||||
- warn
|
||||
- allowString: false
|
||||
allowNumber: false
|
||||
allowNullableObject: false
|
||||
allowNullableBoolean: false
|
||||
allowNullableString: false
|
||||
allowNullableNumber: false
|
||||
allowAny: false
|
||||
"@typescript-eslint/strict-boolean-expressions": off
|
||||
"@typescript-eslint/consistent-type-assertions":
|
||||
- warn
|
||||
- assertionStyle: angle-bracket # 使用尖括号
|
||||
"@typescript-eslint/naming-convention":
|
||||
- warn
|
||||
- selector: variableLike
|
||||
format: ["camelCase", "UPPER_CASE", "PascalCase", "snake_case"]
|
||||
leadingUnderscore: "allow"
|
||||
trailingUnderscore: "allow"
|
||||
format: [camelCase, UPPER_CASE, PascalCase, snake_case]
|
||||
leadingUnderscore: allow
|
||||
trailingUnderscore: allow
|
||||
"@typescript-eslint/no-non-null-assertion": warn
|
||||
"@typescript-eslint/no-misused-promises": warn
|
||||
- files: ["*.json"]
|
||||
"@typescript-eslint/no-misused-promises": off
|
||||
- files: [package.json, tsconfig.json]
|
||||
parser: jsonc-eslint-parser
|
||||
rules:
|
||||
jsonc/sort-array-values:
|
||||
|
||||
32
package.json
32
package.json
@@ -1,9 +1,8 @@
|
||||
{
|
||||
"name": "TeyvatGuide",
|
||||
"version": "0.3.3",
|
||||
"description": "A Genshin Tool build with Tauri",
|
||||
"private": true,
|
||||
"version": "0.3.3",
|
||||
"author": "BTMuli <bt-muli@outlook.com>",
|
||||
"packageManager": "pnpm@8.9.0",
|
||||
"scripts": {
|
||||
"build": "tauri build",
|
||||
@@ -28,26 +27,27 @@
|
||||
"*.{vue,css}": "stylelint --fix",
|
||||
"*.{ts,vue,css,yml,json,md}": "prettier --write"
|
||||
},
|
||||
"keywords": [
|
||||
"Genshin Impact",
|
||||
"Node",
|
||||
"Tauri",
|
||||
"Typescript",
|
||||
"Vite",
|
||||
"Vuetify"
|
||||
],
|
||||
"author": "BTMuli <bt-muli@outlook.com>",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/BTMuli/TeyvatGuide.git"
|
||||
},
|
||||
"homepage": "https://github.com/BTMuli/TeyvatGuide#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/BTMuli/TeyvatGuide/issues"
|
||||
},
|
||||
"directories": {
|
||||
"doc": "docs"
|
||||
},
|
||||
"homepage": "https://github.com/BTMuli/TeyvatGuide#readme",
|
||||
"keywords": [
|
||||
"Tauri",
|
||||
"Node",
|
||||
"Typescript",
|
||||
"Vite",
|
||||
"Genshin Impact",
|
||||
"Vuetify"
|
||||
],
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/BTMuli/TeyvatGuide.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"@mdi/font": "7.2.96",
|
||||
"@tauri-apps/api": "^1.4.0",
|
||||
|
||||
28
qodana.yaml
28
qodana.yaml
@@ -1,32 +1,32 @@
|
||||
#-------------------------------------------------------------------------------#
|
||||
# -------------------------------------------------------------------------------#
|
||||
# Qodana analysis is configured by qodana.yaml file #
|
||||
# https://www.jetbrains.com/help/qodana/qodana-yaml.html #
|
||||
#-------------------------------------------------------------------------------#
|
||||
# -------------------------------------------------------------------------------#
|
||||
version: "1.0"
|
||||
|
||||
#Specify inspection profile for code analysis
|
||||
# Specify inspection profile for code analysis
|
||||
profile:
|
||||
name: qodana.starter
|
||||
|
||||
#Enable inspections
|
||||
#include:
|
||||
# Enable inspections
|
||||
# include:
|
||||
# - name: <SomeEnabledInspectionId>
|
||||
|
||||
#Disable inspections
|
||||
#exclude:
|
||||
# Disable inspections
|
||||
# exclude:
|
||||
# - name: <SomeDisabledInspectionId>
|
||||
# paths:
|
||||
# - <path/where/not/run/inspection>
|
||||
|
||||
#The following options are only applied in CI/CD environment
|
||||
#These options are ignored during local run
|
||||
# The following options are only applied in CI/CD environment
|
||||
# These options are ignored during local run
|
||||
|
||||
#Execute shell command before Qodana execution
|
||||
#bootstrap: sh ./prepare-qodana.sh
|
||||
# Execute shell command before Qodana execution
|
||||
# bootstrap: sh ./prepare-qodana.sh
|
||||
|
||||
#Install IDE plugins before Qodana execution
|
||||
#plugins:
|
||||
# Install IDE plugins before Qodana execution
|
||||
# plugins:
|
||||
# - id: <plugin.id> #(plugin id can be found at https://plugins.jetbrains.com)
|
||||
|
||||
#Specify Qodana linter for analysis
|
||||
# Specify Qodana linter for analysis
|
||||
linter: jetbrains/qodana-js:latest
|
||||
|
||||
@@ -21,23 +21,23 @@
|
||||
"all": true,
|
||||
"request": true,
|
||||
"scope": [
|
||||
"https://api-takumi.mihoyo.com/*",
|
||||
"https://api-takumi-record.mihoyo.com/*",
|
||||
"https://act-webstatic.mihoyo.com/*",
|
||||
"https://api-static.mihoyo.com/*",
|
||||
"https://api-takumi-record.mihoyo.com/*",
|
||||
"https://api-takumi.mihoyo.com/*",
|
||||
"https://api.geetest.com/*",
|
||||
"https://bbs-api-static.miyoushe.com/*",
|
||||
"https://bbs-api.mihoyo.com/*",
|
||||
"https://bbs-api.miyoushe.com/*",
|
||||
"https://bbs-api-static.miyoushe.com/*",
|
||||
"https://bbs.mihoyo.com/*",
|
||||
"https://enka-api.hut.ao/*",
|
||||
"https://hk4e-api.mihoyo.com/*",
|
||||
"https://hk4e-sdk.mihoyo.com/*",
|
||||
"https://homa.snapgenshin.com/*",
|
||||
"https://passport-api-v4.mihoyo.com/*",
|
||||
"https://passport-api.mihoyo.com/*",
|
||||
"https://passport-api.miyoushe.com/*",
|
||||
"https://passport-api-v4.mihoyo.com/*",
|
||||
"https://act-webstatic.mihoyo.com/*",
|
||||
"https://sdk-webstatic.mihoyo.com/*",
|
||||
"https://homa.snapgenshin.com/*",
|
||||
"https://enka-api.hut.ao/*",
|
||||
"https://api.geetest.com/*"
|
||||
"https://sdk-webstatic.mihoyo.com/*"
|
||||
]
|
||||
},
|
||||
"shell": {
|
||||
@@ -48,21 +48,21 @@
|
||||
"bundle": {
|
||||
"active": true,
|
||||
"icon": [
|
||||
"icons/32x32.png",
|
||||
"icons/128x128.png",
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.ico",
|
||||
"icons/icon.png",
|
||||
"icons/Square30x30Logo.png",
|
||||
"icons/Square44x44Logo.png",
|
||||
"icons/Square71x71Logo.png",
|
||||
"icons/Square89x89Logo.png",
|
||||
"icons/32x32.png",
|
||||
"icons/Square107x107Logo.png",
|
||||
"icons/Square142x142Logo.png",
|
||||
"icons/Square150x150Logo.png",
|
||||
"icons/Square284x284Logo.png",
|
||||
"icons/Square30x30Logo.png",
|
||||
"icons/Square310x310Logo.png",
|
||||
"icons/StoreLogo.png"
|
||||
"icons/Square44x44Logo.png",
|
||||
"icons/Square71x71Logo.png",
|
||||
"icons/Square89x89Logo.png",
|
||||
"icons/StoreLogo.png",
|
||||
"icons/icon.ico",
|
||||
"icons/icon.png"
|
||||
],
|
||||
"identifier": "TeyvatGuide",
|
||||
"targets": ["msi"],
|
||||
|
||||
28
src/App.vue
28
src/App.vue
@@ -11,20 +11,17 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { app, event, fs, tauri, window as TauriWindow } from "@tauri-apps/api";
|
||||
import { onBeforeMount, onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import showSnackbar from "./components/func/snackbar";
|
||||
import TSidebar from "./components/app/t-sidebar.vue";
|
||||
|
||||
import TBackTop from "./components/app/t-backTop.vue";
|
||||
// tauri
|
||||
import { app, event, fs, tauri, window as TauriWindow } from "@tauri-apps/api";
|
||||
// store
|
||||
import { useAppStore } from "./store/modules/app";
|
||||
import { useUserStore } from "./store/modules/user";
|
||||
// utils
|
||||
import TSidebar from "./components/app/t-sidebar.vue";
|
||||
import showSnackbar from "./components/func/snackbar";
|
||||
import { getEmojis } from "./plugins/Mys/request/getEmojis";
|
||||
import TGSqlite from "./plugins/Sqlite";
|
||||
import { useAppStore } from "./store/modules/app";
|
||||
import { useUserStore } from "./store/modules/user";
|
||||
|
||||
const appStore = useAppStore();
|
||||
const isMain = ref<boolean>(false);
|
||||
@@ -69,6 +66,7 @@ async function listenOnInit(): Promise<void> {
|
||||
await checkAppLoad();
|
||||
await checkUserLoad();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
async function emojiLoad(): Promise<void> {
|
||||
@@ -155,11 +153,19 @@ async function initData(): Promise<void> {
|
||||
async function getDeepLink(): Promise<void> {
|
||||
await event.listen("active_deep_link", (e) => {
|
||||
new TauriWindow.WebviewWindow("TeyvatGuide")
|
||||
.show()
|
||||
.center()
|
||||
.then(async () => {
|
||||
if (typeof e.payload !== "string") {
|
||||
showSnackbar({
|
||||
text: "无效的 deep link!",
|
||||
color: "error",
|
||||
timeout: 3000,
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 导入格式: teyvatguide://import_uigf?app=appName
|
||||
// 跳转格式: localhost:4000/achievements/?app=appName
|
||||
if ((<string>e.payload).startsWith("teyvatguide://import_uigf")) {
|
||||
if (e.payload.startsWith("teyvatguide://import_uigf")) {
|
||||
const param = (<string>e.payload).split("teyvatguide://import_uigf/?")[1];
|
||||
let appName = "";
|
||||
if (param) {
|
||||
|
||||
@@ -121,11 +121,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
// tauri
|
||||
import { event } from "@tauri-apps/api";
|
||||
// store
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
|
||||
import { useAppStore } from "../../store/modules/app";
|
||||
import { useUserStore } from "../../store/modules/user";
|
||||
|
||||
@@ -137,8 +135,8 @@ const isDevEnv = ref<boolean>(import.meta.env.MODE === "development");
|
||||
const userInfo = computed(() => {
|
||||
const info = userStore.getBriefInfo();
|
||||
return {
|
||||
nickname: info.nickname || "未登录",
|
||||
avatar: info.avatar || "/source/UI/defaultUser.webp",
|
||||
nickname: info?.nickname ?? "未登录",
|
||||
avatar: info?.avatar ?? "/source/UI/defaultUser.webp",
|
||||
};
|
||||
});
|
||||
const rail = ref(appStore.sidebar.collapse);
|
||||
|
||||
@@ -8,11 +8,9 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed, onMounted } from "vue";
|
||||
// tauri
|
||||
import { event } from "@tauri-apps/api";
|
||||
// store
|
||||
import { computed, onMounted } from "vue";
|
||||
|
||||
import { useAppStore } from "../../store/modules/app";
|
||||
|
||||
// store
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file component func confirm.ts
|
||||
* @description 封装自定义 confirm 组件,通过函数调用的方式,简化 confirm 的使用
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.3
|
||||
* @since Beta v0.3.3
|
||||
*/
|
||||
|
||||
// vue
|
||||
import { h, render, type VNode } from "vue";
|
||||
// confirm
|
||||
|
||||
import confirm from "./confirm.vue";
|
||||
|
||||
const confirmId = "tg-func-confirm";
|
||||
@@ -24,7 +22,7 @@ const renderBox = (props: TGApp.Component.Confirm.Params): VNode => {
|
||||
let confirmInstance: VNode;
|
||||
|
||||
const showConfirm = async (props: TGApp.Component.Confirm.Params): Promise<string | boolean> => {
|
||||
if (confirmInstance) {
|
||||
if (confirmInstance !== undefined) {
|
||||
const boxVue = confirmInstance.component;
|
||||
return boxVue?.exposeProxy?.displayBox(props);
|
||||
} else {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
|
||||
import { h, render, type VNode } from "vue";
|
||||
|
||||
import geetest from "./geetest.vue";
|
||||
|
||||
const geetestId = "tg-func-geetest";
|
||||
@@ -21,7 +22,7 @@ const renderBox = (): VNode => {
|
||||
let geetestInstance: VNode;
|
||||
|
||||
const showGeetest = async (): Promise<boolean> => {
|
||||
if (geetestInstance) {
|
||||
if (geetestInstance !== undefined) {
|
||||
const boxVue = geetestInstance.component;
|
||||
return boxVue?.exposeProxy?.displayBox();
|
||||
} else {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
|
||||
import showSnackbar from "./snackbar";
|
||||
import { useUserStore } from "../../store/modules/user";
|
||||
import TGRequest from "../../web/request/TGRequest";
|
||||
@@ -68,7 +69,6 @@ async function displayBox(): Promise<void> {
|
||||
(captchaObj: TGApp.BBS.Geetest.GeetestCaptcha) => {
|
||||
geetestRef.value.innerHTML = "";
|
||||
captchaObj.appendTo("#geetest");
|
||||
// @eslint-ignore-next-line @typescript-eslint/no-misused-promises
|
||||
captchaObj.onSuccess(async () => {
|
||||
const validate = captchaObj.getValidate();
|
||||
const cookie = {
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file component func snackbar.ts
|
||||
* @description 封装 vuetify 的 snackbar 组件,通过函数调用的方式,简化 snackbar 的使用
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.3
|
||||
* @since Beta v0.3.3
|
||||
*/
|
||||
|
||||
// vue
|
||||
import { h, render, type VNode } from "vue";
|
||||
// snackbar
|
||||
|
||||
import snackbar from "./snackbar.vue";
|
||||
|
||||
const snackbarId = "tg-func-snackbar";
|
||||
@@ -24,7 +22,7 @@ const renderBox = (props: TGApp.Component.Snackbar.Params): VNode => {
|
||||
let snackbarInstance: VNode;
|
||||
|
||||
const showSnackbar = (props: TGApp.Component.Snackbar.Params): void => {
|
||||
if (snackbarInstance) {
|
||||
if (snackbarInstance !== undefined) {
|
||||
const boxVue = snackbarInstance.component;
|
||||
boxVue?.exposeProxy?.displayBox(props);
|
||||
} else {
|
||||
|
||||
@@ -2,22 +2,22 @@
|
||||
<v-chart :option="getPoolData()" autoresize />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { onMounted, provide } from "vue";
|
||||
import VChart, { THEME_KEY } from "vue-echarts";
|
||||
import showSnackbar from "../func/snackbar";
|
||||
// echarts
|
||||
import { use } from "echarts/core";
|
||||
import type { EChartsOption } from "echarts";
|
||||
import { PieChart } from "echarts/charts";
|
||||
import {
|
||||
LegendComponent,
|
||||
TitleComponent,
|
||||
TooltipComponent,
|
||||
ToolboxComponent,
|
||||
} from "echarts/components";
|
||||
import { PieChart } from "echarts/charts";
|
||||
import { use } from "echarts/core";
|
||||
import { LabelLayout } from "echarts/features";
|
||||
import { CanvasRenderer } from "echarts/renderers";
|
||||
import { type EChartsOption } from "echarts";
|
||||
import { onMounted, provide } from "vue";
|
||||
import VChart, { THEME_KEY } from "vue-echarts";
|
||||
|
||||
import showSnackbar from "../func/snackbar";
|
||||
// echarts
|
||||
|
||||
use([
|
||||
TitleComponent,
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { watch } from "vue";
|
||||
|
||||
import GroDataview from "./gro-dataview.vue";
|
||||
|
||||
interface GachaOverviewProps {
|
||||
|
||||
@@ -61,14 +61,12 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import ToCalendar from "../overlay/to-calendar.vue";
|
||||
import TibCalendarItem from "../itembox/tib-calendar-item.vue";
|
||||
// data
|
||||
|
||||
import { AppCalendarData } from "../../data";
|
||||
// utils
|
||||
import { generateShareImg } from "../../utils/TGShare";
|
||||
import TibCalendarItem from "../itembox/tib-calendar-item.vue";
|
||||
import ToCalendar from "../overlay/to-calendar.vue";
|
||||
|
||||
// loading
|
||||
const loading = ref<boolean>(true);
|
||||
|
||||
@@ -48,16 +48,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { ref, onMounted, onUnmounted } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
// store
|
||||
|
||||
import Mys from "../../plugins/Mys";
|
||||
import { useHomeStore } from "../../store/modules/home";
|
||||
// utils
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
import { stamp2LastTime } from "../../utils/toolFunc";
|
||||
// plugins
|
||||
import Mys from "../../plugins/Mys";
|
||||
|
||||
// vue
|
||||
const router = useRouter();
|
||||
|
||||
@@ -44,14 +44,12 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { ref, onMounted, onUnmounted } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
// utils
|
||||
|
||||
import Mys from "../../plugins/Mys";
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
import { stamp2LastTime } from "../../utils/toolFunc";
|
||||
// plugins
|
||||
import Mys from "../../plugins/Mys";
|
||||
|
||||
// vue
|
||||
const router = useRouter();
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
</TOverlay>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed } from "vue";
|
||||
|
||||
import TOverlay from "../main/t-overlay.vue";
|
||||
|
||||
interface HtaOverlayOverviewProps {
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import TibWikiAbyss2 from "../itembox/tib-wiki-abyss-2.vue";
|
||||
|
||||
interface HtaTabTeamProps {
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import TibWikiAbyss from "../itembox/tib-wiki-abyss.vue";
|
||||
|
||||
interface HtaTabUseProps {
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import TibWikiAbyss from "../itembox/tib-wiki-abyss.vue";
|
||||
|
||||
interface HtaTabUseProps {
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
<TItemBox :model-value="box" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { onMounted, ref } from "vue";
|
||||
import TItemBox from "../main/t-itembox.vue";
|
||||
// utils
|
||||
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
// types
|
||||
import TItemBox from "../main/t-itembox.vue";
|
||||
import type { TItemBoxData } from "../main/t-itembox.vue";
|
||||
|
||||
interface TibAbyssDetailProps {
|
||||
|
||||
@@ -2,12 +2,10 @@
|
||||
<TItemBox v-model="box" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { onMounted, ref } from "vue";
|
||||
import TItemBox from "../main/t-itembox.vue";
|
||||
// utils
|
||||
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
// types
|
||||
import TItemBox from "../main/t-itembox.vue";
|
||||
import type { TItemBoxData } from "../main/t-itembox.vue";
|
||||
|
||||
interface TibAbyssOverviewProps {
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
<TItemBox :model-value="box" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed } from "vue";
|
||||
|
||||
import TItemBox from "../main/t-itembox.vue";
|
||||
// types
|
||||
import type { TItemBoxData } from "../main/t-itembox.vue";
|
||||
|
||||
interface TibCalendarItemProps {
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
<TItemBox v-model="box" @click="showData" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import TItemBox from "../main/t-itembox.vue";
|
||||
// types
|
||||
import type { TItemBoxData } from "../main/t-itembox.vue";
|
||||
|
||||
interface TibUrAvatarProps {
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
<TItemBox :model-value="box" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
// vue
|
||||
import { ref, onMounted, computed } from "vue";
|
||||
import TItemBox, { type TItemBoxData } from "../main/t-itembox.vue";
|
||||
// plugins
|
||||
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import TItemBox, { type TItemBoxData } from "../main/t-itembox.vue";
|
||||
|
||||
interface TibWikiAbyssProps {
|
||||
modelValue: string;
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
<TItemBox :model-value="box" />
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
// vue
|
||||
import { ref, onMounted, computed } from "vue";
|
||||
import TItemBox, { type TItemBoxData } from "../main/t-itembox.vue";
|
||||
// plugins
|
||||
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import TItemBox, { type TItemBoxData } from "../main/t-itembox.vue";
|
||||
|
||||
interface TibWikiAbyssProps {
|
||||
modelValue: {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<TItemBox :model-value="box" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed } from "vue";
|
||||
|
||||
import TItemBox, { type TItemBoxData } from "../main/t-itembox.vue";
|
||||
|
||||
interface TibCalendarAvatarProps {
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
<TItemBox :model-value="box" style="cursor: pointer" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed } from "vue";
|
||||
|
||||
import TItemBox from "../main/t-itembox.vue";
|
||||
// types
|
||||
import type { TItemBoxData } from "../main/t-itembox.vue";
|
||||
|
||||
interface TibCalendarWeaponProps {
|
||||
|
||||
@@ -35,16 +35,14 @@
|
||||
</TOverlay>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
// vue
|
||||
import { computed } from "vue";
|
||||
|
||||
import Mys from "../../plugins/Mys";
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
import showSnackbar from "../func/snackbar";
|
||||
import TOverlay from "../main/t-overlay.vue";
|
||||
import TibCalendarItem from "../itembox/tib-calendar-item.vue";
|
||||
import TibCalendarMaterial from "../itembox/tib-calendar-material.vue";
|
||||
// utils
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
// plugins
|
||||
import Mys from "../../plugins/Mys";
|
||||
import TOverlay from "../main/t-overlay.vue";
|
||||
|
||||
interface ToCalendarProps {
|
||||
modelValue: boolean;
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
</TOverlay>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import TOverlay from "../main/t-overlay.vue";
|
||||
|
||||
interface ToChannelProps {
|
||||
|
||||
@@ -17,17 +17,15 @@
|
||||
</TOverlay>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
// vue
|
||||
import QrcodeVue from "qrcode.vue";
|
||||
import { computed, reactive, ref, watch } from "vue";
|
||||
|
||||
import Mys from "../../plugins/Mys";
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import { useUserStore } from "../../store/modules/user";
|
||||
import TGRequest from "../../web/request/TGRequest";
|
||||
import showSnackbar from "../func/snackbar";
|
||||
import TOverlay from "../main/t-overlay.vue";
|
||||
import QrcodeVue from "qrcode.vue";
|
||||
// store
|
||||
import { useUserStore } from "../../store/modules/user";
|
||||
// utils
|
||||
import Mys from "../../plugins/Mys";
|
||||
import TGRequest from "../../web/request/TGRequest";
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
|
||||
interface ToWebLoginProps {
|
||||
modelValue: boolean;
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
</TOverlay>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { ref, watch } from "vue";
|
||||
|
||||
import TOverlay from "../main/t-overlay.vue";
|
||||
|
||||
interface LoadingProps {
|
||||
|
||||
@@ -10,9 +10,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import TuaDetailTitle from "./tua-detail-title.vue";
|
||||
import TuaDetailBattle from "./tua-detail-battle.vue";
|
||||
import TuaDetailTitle from "./tua-detail-title.vue";
|
||||
|
||||
interface TuaDetailLevelProps {
|
||||
modelValue: TGApp.Sqlite.Abyss.Level;
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import TuaDetailTitle from "./tua-detail-title.vue";
|
||||
import TuaDetailLevel from "./tua-detail-level.vue";
|
||||
import TuaDetailTitle from "./tua-detail-title.vue";
|
||||
|
||||
interface TuaDetailProps {
|
||||
modelValue: TGApp.Sqlite.Abyss.Floor;
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed } from "vue";
|
||||
|
||||
import TibAbyssOverview from "../itembox/tib-abyss-overview.vue";
|
||||
|
||||
interface TAOProps {
|
||||
|
||||
@@ -24,9 +24,8 @@
|
||||
</TucDetailDesc>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import TucDetailDesc from "./tuc-detail-desc.vue";
|
||||
import TucDetailConstellation from "./tuc-detail-constellation.vue";
|
||||
import TucDetailDesc from "./tuc-detail-desc.vue";
|
||||
|
||||
interface TucDetailDescConstellationProps {
|
||||
modelValue: TGApp.Sqlite.Character.RoleConstellation;
|
||||
@@ -38,7 +37,7 @@ const props = defineProps<TucDetailDescConstellationProps>();
|
||||
function parseDesc(desc: string): string {
|
||||
const reg = /<color=(.*?)>(.*?)<\/color>/g;
|
||||
let match = reg.exec(desc);
|
||||
while (match) {
|
||||
while (match !== null) {
|
||||
const color = match[1];
|
||||
const text = match[2];
|
||||
desc = desc.replace(match[0], `<span style="color: ${color}">${text}</span>`);
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
</TucDetailDesc>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed } from "vue";
|
||||
|
||||
import TucDetailDesc from "./tuc-detail-desc.vue";
|
||||
import TucDetailItemBox from "./tuc-detail-itembox.vue";
|
||||
|
||||
|
||||
@@ -76,15 +76,15 @@
|
||||
</TOverlay>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed, onMounted, onUpdated, ref } from "vue";
|
||||
import TOverlay from "../main/t-overlay.vue";
|
||||
import TucDetailDescWeapon from "./tuc-detail-desc-weapon.vue";
|
||||
|
||||
import TucDetailConstellation from "./tuc-detail-constellation.vue";
|
||||
import TucDetailDescConstellation from "./tuc-detail-desc-constellation.vue";
|
||||
import TucDetailDescRelic from "./tuc-detail-desc-relic.vue";
|
||||
import TucDetailDescWeapon from "./tuc-detail-desc-weapon.vue";
|
||||
import TucDetailItemBox from "./tuc-detail-itembox.vue";
|
||||
import TucDetailConstellation from "./tuc-detail-constellation.vue";
|
||||
import TucDetailRelic from "./tuc-detail-relic.vue";
|
||||
import TOverlay from "../main/t-overlay.vue";
|
||||
|
||||
interface ToUcDetailProps {
|
||||
modelValue: boolean;
|
||||
|
||||
@@ -36,12 +36,11 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed, onMounted, onUnmounted, ref } from "vue";
|
||||
import TItemBox from "../main/t-itembox.vue";
|
||||
// utils
|
||||
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import { saveImgLocal } from "../../utils/TGShare";
|
||||
import TItemBox from "../main/t-itembox.vue";
|
||||
|
||||
interface TucRoleBoxProps {
|
||||
modelValue: TGApp.Sqlite.Character.UserRole;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed } from "vue";
|
||||
|
||||
import TibUrAvatar from "../itembox/tib-ur-avatar.vue";
|
||||
|
||||
interface TurAvatarGridProps {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed } from "vue";
|
||||
|
||||
import TurHomeSub from "./tur-home-sub.vue";
|
||||
|
||||
interface TurHomeGridProps {
|
||||
|
||||
@@ -34,9 +34,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { onMounted, ref } from "vue";
|
||||
// utils
|
||||
|
||||
import { saveImgLocal } from "../../utils/TGShare";
|
||||
|
||||
interface TurHomeSubProps {
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed } from "vue";
|
||||
|
||||
import TurOverviewSub from "./tur-overview-sub.vue";
|
||||
|
||||
interface TurOverviewGridProps {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed } from "vue";
|
||||
|
||||
import TurWorldSub from "./tur-world-sub.vue";
|
||||
|
||||
interface TurWorldGridProps {
|
||||
|
||||
@@ -35,11 +35,9 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { onMounted, ref } from "vue";
|
||||
// tauri
|
||||
import { event } from "@tauri-apps/api";
|
||||
// utils
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import { saveImgLocal } from "../../utils/TGShare";
|
||||
|
||||
interface TurWorldSubProps {
|
||||
|
||||
10
src/main.ts
10
src/main.ts
@@ -1,23 +1,19 @@
|
||||
/**
|
||||
* @file main.ts
|
||||
* @description Main entry
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Beta v0.3.3
|
||||
*/
|
||||
|
||||
// vue
|
||||
import { createApp } from "vue";
|
||||
import { createVuetify } from "vuetify";
|
||||
|
||||
import App from "./App.vue";
|
||||
// 路由
|
||||
import router from "./router";
|
||||
import store from "./store";
|
||||
// Vuetify
|
||||
|
||||
import "@mdi/font/css/materialdesignicons.css";
|
||||
import "vuetify/styles";
|
||||
import { createVuetify } from "vuetify";
|
||||
// 全局样式
|
||||
import "./assets/index.css";
|
||||
// gt.js
|
||||
import "https://static.geetest.com/static/js/gt.0.4.9.js";
|
||||
|
||||
if (import.meta.env.MODE === "development") {
|
||||
|
||||
@@ -66,20 +66,18 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
|
||||
import showSnackbar from "../../components/func/snackbar";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
import TSubLine from "../../components/main/t-subline.vue";
|
||||
import TuaOverview from "../../components/userAbyss/tua-overview.vue";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
import TuaDetail from "../../components/userAbyss/tua-detail.vue";
|
||||
// store
|
||||
import { useUserStore } from "../../store/modules/user";
|
||||
// utils
|
||||
import TGRequest from "../../web/request/TGRequest";
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import { generateShareImg } from "../../utils/TGShare";
|
||||
import TuaOverview from "../../components/userAbyss/tua-overview.vue";
|
||||
import Hutao from "../../plugins/Hutao";
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import { useUserStore } from "../../store/modules/user";
|
||||
import { generateShareImg } from "../../utils/TGShare";
|
||||
import TGRequest from "../../web/request/TGRequest";
|
||||
|
||||
// store
|
||||
const userStore = useUserStore();
|
||||
|
||||
@@ -41,18 +41,16 @@
|
||||
<ToUcDetail v-model="visible" :data-val="dataVal" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
|
||||
import showSnackbar from "../../components/func/snackbar";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
import TucRoleBox from "../../components/userCharacter/tuc-role-box.vue";
|
||||
import ToUcDetail from "../../components/userCharacter/tuc-detail-overlay.vue";
|
||||
// store
|
||||
import { useUserStore } from "../../store/modules/user";
|
||||
// utils
|
||||
import TucRoleBox from "../../components/userCharacter/tuc-role-box.vue";
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import TGRequest from "../../web/request/TGRequest";
|
||||
import { useUserStore } from "../../store/modules/user";
|
||||
import { generateShareImg } from "../../utils/TGShare";
|
||||
import TGRequest from "../../web/request/TGRequest";
|
||||
|
||||
// store
|
||||
const userStore = useUserStore();
|
||||
|
||||
@@ -41,22 +41,19 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { dialog, path } from "@tauri-apps/api";
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import showSnackbar from "../../components/func/snackbar";
|
||||
|
||||
import showConfirm from "../../components/func/confirm";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
import showSnackbar from "../../components/func/snackbar";
|
||||
import GroEcharts from "../../components/gachaRecord/gro-echarts.vue";
|
||||
import GroOverview from "../../components/gachaRecord/gro-overview.vue";
|
||||
// tauri
|
||||
import { dialog, path } from "@tauri-apps/api";
|
||||
// store
|
||||
import { useUserStore } from "../../store/modules/user";
|
||||
// utils
|
||||
import { backupUigfData, exportUigfData, readUigfData, verifyUigfData } from "../../utils/UIGF";
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import TGRequest from "../../web/request/TGRequest";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
import { AppCharacterData, AppWeaponData } from "../../data";
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import { useUserStore } from "../../store/modules/user";
|
||||
import { backupUigfData, exportUigfData, readUigfData, verifyUigfData } from "../../utils/UIGF";
|
||||
import TGRequest from "../../web/request/TGRequest";
|
||||
|
||||
// store
|
||||
const userStore = useUserStore();
|
||||
@@ -75,12 +72,12 @@ const gachaListCur = ref<TGApp.Sqlite.GachaRecords.SingleTable[]>([]);
|
||||
const tab = ref<string>("");
|
||||
|
||||
onMounted(async () => {
|
||||
loadingTitle.value = `正在获取祈愿 UID 列表`;
|
||||
loadingTitle.value = "正在获取祈愿 UID 列表";
|
||||
selectItem.value = await TGSqlite.getUidList();
|
||||
if (selectItem.value.length === 0) {
|
||||
showSnackbar({
|
||||
color: "error",
|
||||
text: `暂无祈愿数据,请先导入祈愿数据`,
|
||||
text: "暂无祈愿数据,请先导入祈愿数据",
|
||||
});
|
||||
loading.value = false;
|
||||
return;
|
||||
@@ -88,7 +85,7 @@ onMounted(async () => {
|
||||
uidCur.value = selectItem.value[0];
|
||||
loadingTitle.value = `正在获取祈愿数据,默认 UID:${uidCur.value}`;
|
||||
gachaListCur.value = await TGSqlite.getGachaRecords(uidCur.value);
|
||||
loadingTitle.value = `正在渲染数据`;
|
||||
loadingTitle.value = "正在渲染数据";
|
||||
tab.value = "echarts";
|
||||
loading.value = false;
|
||||
showSnackbar({
|
||||
@@ -105,7 +102,7 @@ async function confirmRefresh(): Promise<void> {
|
||||
if (!confirmRes) {
|
||||
showSnackbar({
|
||||
color: "grey",
|
||||
text: `已取消刷新祈愿数据`,
|
||||
text: "已取消刷新祈愿数据",
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -122,7 +119,7 @@ async function confirmRefresh(): Promise<void> {
|
||||
} else {
|
||||
showSnackbar({
|
||||
color: "error",
|
||||
text: `获取 authkey 失败`,
|
||||
text: "获取 authkey 失败",
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -222,7 +219,7 @@ async function handleImportBtn(savePath?: string): Promise<void> {
|
||||
if (!check) {
|
||||
showSnackbar({
|
||||
color: "error",
|
||||
text: `读取 UIGF 文件失败,请检查文件是否符合规范`,
|
||||
text: "读取 UIGF 文件失败,请检查文件是否符合规范",
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -234,7 +231,7 @@ async function handleImportBtn(savePath?: string): Promise<void> {
|
||||
if (!res) {
|
||||
showSnackbar({
|
||||
color: "grey",
|
||||
text: `已取消祈愿数据导入`,
|
||||
text: "已取消祈愿数据导入",
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -244,7 +241,7 @@ async function handleImportBtn(savePath?: string): Promise<void> {
|
||||
loading.value = false;
|
||||
showSnackbar({
|
||||
color: "error",
|
||||
text: `导入的祈愿数据为空`,
|
||||
text: "导入的祈愿数据为空",
|
||||
});
|
||||
} else {
|
||||
await TGSqlite.mergeUIGF(remoteData.info.uid, remoteData.list);
|
||||
@@ -259,7 +256,7 @@ async function handleImportBtn(savePath?: string): Promise<void> {
|
||||
} else {
|
||||
showSnackbar({
|
||||
color: "grey",
|
||||
text: `已取消文件选择`,
|
||||
text: "已取消文件选择",
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -275,13 +272,13 @@ async function handleExportBtn(): Promise<void> {
|
||||
return;
|
||||
}
|
||||
const res = await showConfirm({
|
||||
title: `是否导出祈愿数据?`,
|
||||
title: "是否导出祈愿数据?",
|
||||
text: `UID:${uidCur.value},共 ${gachaList.length} 条数据`,
|
||||
});
|
||||
if (!res) {
|
||||
showSnackbar({
|
||||
color: "grey",
|
||||
text: `已取消祈愿数据导出`,
|
||||
text: "已取消祈愿数据导出",
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -289,7 +286,7 @@ async function handleExportBtn(): Promise<void> {
|
||||
defaultPath: `UIGF_${uidCur.value}.json`,
|
||||
filters: [
|
||||
{
|
||||
name: `UIGF`,
|
||||
name: "UIGF",
|
||||
extensions: ["json"],
|
||||
},
|
||||
],
|
||||
@@ -297,7 +294,7 @@ async function handleExportBtn(): Promise<void> {
|
||||
if (!file) {
|
||||
showSnackbar({
|
||||
color: "grey",
|
||||
text: `已取消文件保存`,
|
||||
text: "已取消文件保存",
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -306,7 +303,7 @@ async function handleExportBtn(): Promise<void> {
|
||||
await exportUigfData(uidCur.value, gachaList, file);
|
||||
loading.value = false;
|
||||
showSnackbar({
|
||||
text: `祈愿数据已成功导出`,
|
||||
text: "祈愿数据已成功导出",
|
||||
});
|
||||
}
|
||||
|
||||
@@ -321,18 +318,18 @@ async function backupGacha(): Promise<void> {
|
||||
if (gachaListCur.value.length === 0) {
|
||||
showSnackbar({
|
||||
color: "error",
|
||||
text: `暂无祈愿数据`,
|
||||
text: "暂无祈愿数据",
|
||||
});
|
||||
return;
|
||||
}
|
||||
const res = await showConfirm({
|
||||
title: `是否备份祈愿数据?`,
|
||||
title: "是否备份祈愿数据?",
|
||||
text: `UID:${uidCur.value},共 ${gachaListCur.value.length} 条数据`,
|
||||
});
|
||||
if (!res) {
|
||||
showSnackbar({
|
||||
color: "grey",
|
||||
text: `已取消祈愿数据备份`,
|
||||
text: "已取消祈愿数据备份",
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -350,18 +347,18 @@ async function deleteGacha(): Promise<void> {
|
||||
if (gachaListCur.value.length === 0) {
|
||||
showSnackbar({
|
||||
color: "error",
|
||||
text: `暂无祈愿数据`,
|
||||
text: "暂无祈愿数据",
|
||||
});
|
||||
return;
|
||||
}
|
||||
const firstConfirm = await showConfirm({
|
||||
title: `是否删除祈愿数据?`,
|
||||
title: "是否删除祈愿数据?",
|
||||
text: `UID:${uidCur.value},共 ${gachaListCur.value.length} 条数据`,
|
||||
});
|
||||
if (!firstConfirm) {
|
||||
showSnackbar({
|
||||
color: "grey",
|
||||
text: `已取消祈愿数据删除`,
|
||||
text: "已取消祈愿数据删除",
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -376,7 +373,7 @@ async function deleteGacha(): Promise<void> {
|
||||
if (secondConfirm === false) {
|
||||
showSnackbar({
|
||||
color: "grey",
|
||||
text: `已取消祈愿数据删除`,
|
||||
text: "已取消祈愿数据删除",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -32,21 +32,19 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
import TSubLine from "../../components/main/t-subline.vue";
|
||||
import TurOverviewGrid from "../../components/userRecord/tur-overview-grid.vue";
|
||||
import TurAvatarGrid from "../../components/userRecord/tur-avatar-grid.vue";
|
||||
import TurWorldGrid from "../../components/userRecord/tur-world-grid.vue";
|
||||
import TurHomeGrid from "../../components/userRecord/tur-home-grid.vue";
|
||||
// store
|
||||
import { useUserStore } from "../../store/modules/user";
|
||||
// utils
|
||||
import TGRequest from "../../web/request/TGRequest";
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import { generateShareImg } from "../../utils/TGShare";
|
||||
|
||||
import showSnackbar from "../../components/func/snackbar";
|
||||
import TSubLine from "../../components/main/t-subline.vue";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
import TurAvatarGrid from "../../components/userRecord/tur-avatar-grid.vue";
|
||||
import TurHomeGrid from "../../components/userRecord/tur-home-grid.vue";
|
||||
import TurOverviewGrid from "../../components/userRecord/tur-overview-grid.vue";
|
||||
import TurWorldGrid from "../../components/userRecord/tur-world-grid.vue";
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import { useUserStore } from "../../store/modules/user";
|
||||
import { generateShareImg } from "../../utils/TGShare";
|
||||
import TGRequest from "../../web/request/TGRequest";
|
||||
|
||||
// store
|
||||
const userStore = useUserStore();
|
||||
|
||||
@@ -37,12 +37,13 @@
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import HtaOverlayOverview from "../../components/hutaoAbyss/hta-overlay-overview.vue";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
import HtaTabUse from "../../components/hutaoAbyss/hta-tab-use.vue";
|
||||
import HtaTabUp from "../../components/hutaoAbyss/hta-tab-up.vue";
|
||||
import HtaTabTeam from "../../components/hutaoAbyss/hta-tab-team.vue";
|
||||
import HtaTabHold from "../../components/hutaoAbyss/hta-tab-hold.vue";
|
||||
import HtaTabTeam from "../../components/hutaoAbyss/hta-tab-team.vue";
|
||||
import HtaTabUp from "../../components/hutaoAbyss/hta-tab-up.vue";
|
||||
import HtaTabUse from "../../components/hutaoAbyss/hta-tab-use.vue";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
// plugins
|
||||
import Hutao from "../../plugins/Hutao";
|
||||
import { generateShareImg } from "../../utils/TGShare";
|
||||
|
||||
@@ -8,14 +8,12 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { ref, computed } from "vue";
|
||||
|
||||
import TibWikiAvatar from "../../components/itembox/tib-wiki-avatar.vue";
|
||||
// utils
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
import { AppCharacterData } from "../../data";
|
||||
// plugins
|
||||
import Mys from "../../plugins/Mys";
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
|
||||
// snackbar
|
||||
const snackbar = ref(false);
|
||||
|
||||
@@ -103,15 +103,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
|
||||
import showSnackbar from "../../components/func/snackbar";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
// utils
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
import { AppGCGData } from "../../data";
|
||||
// plugins
|
||||
import Mys from "../../plugins/Mys";
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
|
||||
// loading
|
||||
const loading = ref<boolean>(true);
|
||||
|
||||
@@ -8,14 +8,12 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { ref, computed } from "vue";
|
||||
|
||||
import TibWikiWeapon from "../../components/itembox/tib-wiki-weapon.vue";
|
||||
// utils
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
import { AppWeaponData } from "../../data";
|
||||
// plugins
|
||||
import Mys from "../../plugins/Mys";
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
|
||||
// snackbar
|
||||
const snackbar = ref<boolean>(false);
|
||||
|
||||
@@ -107,21 +107,18 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { dialog, fs } from "@tauri-apps/api";
|
||||
import { computed, onBeforeMount, onMounted, ref } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
import showSnackbar from "../../components/func/snackbar";
|
||||
|
||||
import showConfirm from "../../components/func/confirm";
|
||||
// tauri
|
||||
import { dialog, fs } from "@tauri-apps/api";
|
||||
// Store
|
||||
import showSnackbar from "../../components/func/snackbar";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
import { AppAchievementSeriesData } from "../../data";
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import { useAchievementsStore } from "../../store/modules/achievements";
|
||||
// Utils
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
import { getUiafHeader, readUiafData, verifyUiafData } from "../../utils/UIAF";
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import { AppAchievementSeriesData } from "../../data";
|
||||
|
||||
// Store
|
||||
const achievementsStore = useAchievementsStore();
|
||||
|
||||
@@ -80,16 +80,14 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
// store
|
||||
import { useAppStore } from "../../store/modules/app";
|
||||
// utils
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
import TGRequest from "../../web/request/TGRequest";
|
||||
import TGUtils from "../../web/utils/TGUtils";
|
||||
import { createTGWindow } from "../../utils/TGWindow";
|
||||
|
||||
// store
|
||||
const appStore = useAppStore();
|
||||
|
||||
@@ -150,25 +150,22 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
import showSnackbar from "../../components/func/snackbar";
|
||||
import showConfirm from "../../components/func/confirm";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
import ToGameLogin from "../../components/overlay/to-gameLogin.vue";
|
||||
// tauri
|
||||
import { app, fs, os } from "@tauri-apps/api";
|
||||
// store
|
||||
import { computed, onMounted, ref } from "vue";
|
||||
|
||||
import showConfirm from "../../components/func/confirm";
|
||||
import showSnackbar from "../../components/func/snackbar";
|
||||
import ToGameLogin from "../../components/overlay/to-gameLogin.vue";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import { useAchievementsStore } from "../../store/modules/achievements";
|
||||
import { useAppStore } from "../../store/modules/app";
|
||||
import { useHomeStore } from "../../store/modules/home";
|
||||
import { useAchievementsStore } from "../../store/modules/achievements";
|
||||
import { useUserStore } from "../../store/modules/user";
|
||||
// utils
|
||||
import { backupUiafData, restoreUiafData } from "../../utils/UIAF";
|
||||
import TGRequest from "../../web/request/TGRequest";
|
||||
import { backupAbyssData, backupCookieData } from "../../web/utils/backupData";
|
||||
import { restoreAbyssData, restoreCookieData } from "../../web/utils/restoreData";
|
||||
import TGSqlite from "../../plugins/Sqlite";
|
||||
import TGRequest from "../../web/request/TGRequest";
|
||||
|
||||
// Store
|
||||
const appStore = useAppStore();
|
||||
|
||||
@@ -6,18 +6,16 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { markRaw, onMounted, onUnmounted, onUpdated, ref } from "vue";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
|
||||
import showConfirm from "../../components/func/confirm";
|
||||
import TCalendar from "../../components/home/t-calendar.vue";
|
||||
import TPool from "../../components/home/t-pool.vue";
|
||||
import TPosition from "../../components/home/t-position.vue";
|
||||
import TCalendar from "../../components/home/t-calendar.vue";
|
||||
// store
|
||||
import { useHomeStore } from "../../store/modules/home";
|
||||
import ToLoading from "../../components/overlay/to-loading.vue";
|
||||
import { useAppStore } from "../../store/modules/app";
|
||||
// utils
|
||||
import { useHomeStore } from "../../store/modules/home";
|
||||
import { getBuildTime } from "../../utils/TGBuild";
|
||||
import showConfirm from "../../components/func/confirm";
|
||||
|
||||
// store
|
||||
const appStore = useAppStore();
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import showGeetest from "../../components/func/geetest";
|
||||
|
||||
const visible = ref<boolean>(false);
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file plugins Hutao request getAvatarCollect.ts
|
||||
* @description 获取角色搭配数据
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file plugins Hutao request getAvatarHoldRate.ts
|
||||
* @description Hutao API 获取角色持有率数据请求方法
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file plugins Hutao request getAvatarUpRate.ts
|
||||
* @description 获取角色上场率数据
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file plugins Hutao request getAvatarUseRate.ts
|
||||
* @description 获取角色使用率
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file plugins Hutao request getOverview.ts
|
||||
* @description 获取深渊概览数据
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file plugins Hutao request getTeamCollect.ts
|
||||
* @description 获取队伍搭配数据
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file plugins Hutao request uploadData.ts
|
||||
* @description Hutao 数据上传请求函数集合
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.1
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import HutaoApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,29 +1,21 @@
|
||||
/**
|
||||
* @file plugins Mys index.ts
|
||||
* @description Mys plugin index
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Beta v0.3.0
|
||||
*/
|
||||
|
||||
// Api
|
||||
import MysApi from "./api";
|
||||
// Post
|
||||
import getPostData from "./request/getPostData";
|
||||
import parsePost from "./utils/parsePost";
|
||||
// Gacha
|
||||
import getGachaData from "./request/getGachaData";
|
||||
import getGachaCard from "./utils/getGachaCard";
|
||||
// Position
|
||||
import getPositionData from "./request/getPositionData";
|
||||
import getPositionCard from "./utils/getPositionCard";
|
||||
// News
|
||||
import getNewsList from "./request/getNewsList";
|
||||
import { getNoticeCard, getActivityCard, getNewsCard } from "./utils/getNewsCard";
|
||||
// Lottery
|
||||
import getLotteryData from "./request/getLotteryData";
|
||||
import getLotteryCard from "./utils/getLotteryCard";
|
||||
// User
|
||||
import { getLoginQr, getLoginStatus } from "./request/doGameLogin";
|
||||
import getGachaData from "./request/getGachaData";
|
||||
import getLotteryData from "./request/getLotteryData";
|
||||
import getNewsList from "./request/getNewsList";
|
||||
import getPositionData from "./request/getPositionData";
|
||||
import getPostData from "./request/getPostData";
|
||||
import getGachaCard from "./utils/getGachaCard";
|
||||
import getLotteryCard from "./utils/getLotteryCard";
|
||||
import { getNoticeCard, getActivityCard, getNewsCard } from "./utils/getNewsCard";
|
||||
import getPositionCard from "./utils/getPositionCard";
|
||||
import parsePost from "./utils/parsePost";
|
||||
|
||||
const Mys = {
|
||||
Api: MysApi,
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file plugins Mys request getGachaData.ts
|
||||
* @description Mys 抽卡请求
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.1
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
|
||||
import MysApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file plugins Mys interface getLotteryData.ts
|
||||
* @description Mys 插件抽奖接口
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.1
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
|
||||
import MysApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file plugins Mys request getNewsList.ts
|
||||
* @description Mys 插件咨讯请求
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.1
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
|
||||
import MysApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file plugins Mys request getPositionData.ts
|
||||
* @description Mys 插件热点追踪请求
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.1
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
|
||||
import MysApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file plugins Mys request getPostData.ts
|
||||
* @description Mys帖子请求
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.1
|
||||
*/
|
||||
|
||||
import { http } from "@tauri-apps/api";
|
||||
|
||||
import MysApi from "../api";
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* @since Beta v0.3.3
|
||||
*/
|
||||
|
||||
import { score } from "wcag-color";
|
||||
import * as colorConvert from "color-convert";
|
||||
import { score } from "wcag-color";
|
||||
|
||||
/**
|
||||
* @description 给定两个16进制颜色值,确认两者是否相近
|
||||
@@ -215,10 +215,10 @@ function LinkTextParser(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLSpa
|
||||
throw new Error(`[LinkTextParser] data.insert is not a string: ${JSON.stringify(data)}`);
|
||||
}
|
||||
if (data.attributes == null) {
|
||||
throw new Error(`[LinkTextParser] data.attributes is not defined`);
|
||||
throw new Error("[LinkTextParser] data.attributes is not defined");
|
||||
}
|
||||
if (!data.attributes.link) {
|
||||
throw new Error(`[LinkTextParser] data.attributes.link is not defined`);
|
||||
throw new Error("[LinkTextParser] data.attributes.link is not defined");
|
||||
}
|
||||
// 创建图标
|
||||
const icon = document.createElement("i");
|
||||
@@ -254,7 +254,7 @@ function parseDivider(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDivEl
|
||||
throw new Error(`[ParseDivider] data.insert is a string: ${data.insert}`);
|
||||
}
|
||||
if (!data.insert.divider) {
|
||||
throw new Error(`[ParseDivider] data.insert.divider is not defined`);
|
||||
throw new Error("[ParseDivider] data.insert.divider is not defined");
|
||||
}
|
||||
// 创建分割线
|
||||
const div = document.createElement("div");
|
||||
@@ -291,7 +291,7 @@ function parseImage(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDivElem
|
||||
throw new Error(`[ParseImage] data.insert is a string: ${data.insert}`);
|
||||
}
|
||||
if (!data.insert.image) {
|
||||
throw new Error(`[ParseImage] data.insert.image is not defined`);
|
||||
throw new Error("[ParseImage] data.insert.image is not defined");
|
||||
}
|
||||
const div = document.createElement("div");
|
||||
// 创建图片
|
||||
@@ -319,7 +319,7 @@ function parseVideo(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDivElem
|
||||
throw new Error(`[ParseVideo] data.insert is a string: ${data.insert}`);
|
||||
}
|
||||
if (data.insert.vod == null && !data.insert.video) {
|
||||
throw new Error(`[ParseVideo] data.insert.vod and data.insert.video is not defined`);
|
||||
throw new Error("[ParseVideo] data.insert.vod and data.insert.video is not defined");
|
||||
}
|
||||
// 创建 div
|
||||
const div = document.createElement("div");
|
||||
@@ -383,7 +383,7 @@ function parseBackup(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDivEle
|
||||
return LotteryParser(data);
|
||||
}
|
||||
if (data.insert.fold == null) {
|
||||
throw new Error(`[ParseBackup] data.insert.fold is not defined`);
|
||||
throw new Error("[ParseBackup] data.insert.fold is not defined");
|
||||
}
|
||||
// 转换
|
||||
const titleJson: TGApp.Plugins.Mys.Post.StructuredContent[] = JSON.parse(data.insert.fold.title);
|
||||
@@ -428,13 +428,13 @@ function LotteryParser(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDivE
|
||||
throw new Error(`[LotteryParser] data.insert is a string: ${data.insert}`);
|
||||
}
|
||||
if (!data.insert.backup_text) {
|
||||
throw new Error(`[LotteryParser] data.insert.backup_text is not defined`);
|
||||
throw new Error("[LotteryParser] data.insert.backup_text is not defined");
|
||||
}
|
||||
if (data.insert.backup_text !== "[抽奖]") {
|
||||
throw new Error(`[LotteryParser] data.insert.backup_text is not [抽奖]`);
|
||||
throw new Error("[LotteryParser] data.insert.backup_text is not [抽奖]");
|
||||
}
|
||||
if (data.insert.lottery == null) {
|
||||
throw new Error(`[LotteryParser] data.insert.lottery is not defined`);
|
||||
throw new Error("[LotteryParser] data.insert.lottery is not defined");
|
||||
}
|
||||
// 创建 div
|
||||
const div = document.createElement("div");
|
||||
@@ -466,7 +466,7 @@ function parseLinkCard(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLDivE
|
||||
throw new Error(`[ParseLinkCard] data.insert is a string: ${data.insert}`);
|
||||
}
|
||||
if (data.insert.link_card == null) {
|
||||
throw new Error(`[ParseLinkCard] data.insert.link_card is not defined`);
|
||||
throw new Error("[ParseLinkCard] data.insert.link_card is not defined");
|
||||
}
|
||||
// 创建 div
|
||||
const div = document.createElement("div");
|
||||
@@ -529,7 +529,7 @@ function parseMention(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLAncho
|
||||
throw new Error(`[ParseMention] data.insert is a string: ${data.insert}`);
|
||||
}
|
||||
if (data.insert.mention == null) {
|
||||
throw new Error(`[ParseMention] data.insert.mention is not defined`);
|
||||
throw new Error("[ParseMention] data.insert.mention is not defined");
|
||||
}
|
||||
// 创建图标
|
||||
const icon = document.createElement("i");
|
||||
@@ -558,7 +558,7 @@ function emojiParser(data: TGApp.Plugins.Mys.Post.StructuredContent): HTMLImageE
|
||||
}
|
||||
const emojis = localStorage.getItem("emojis");
|
||||
if (!emojis) {
|
||||
throw new Error(`[EmojiParser] emojis is not defined`);
|
||||
throw new Error("[EmojiParser] emojis is not defined");
|
||||
}
|
||||
const emojiList: Record<string, string> = JSON.parse(emojis);
|
||||
const emojiName = data.insert.slice(2, -1);
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
|
||||
import Database from "tauri-plugin-sql-api";
|
||||
|
||||
import { getUiafStatus } from "../../utils/UIAF";
|
||||
|
||||
import initDataSql from "./sql/initData";
|
||||
import initTableSql from "./sql/initTable";
|
||||
import {
|
||||
@@ -19,6 +17,7 @@ import {
|
||||
insertRoleData,
|
||||
} from "./sql/insertData";
|
||||
import { importUIAFData, importUIGFData } from "./sql/updateData";
|
||||
import { getUiafStatus } from "../../utils/UIAF";
|
||||
|
||||
class Sqlite {
|
||||
/**
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
/**
|
||||
* @file plugins Sqlite sql initData.ts
|
||||
* @description Sqlite 初始化数据 sql 语句
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { app } from "@tauri-apps/api";
|
||||
// utils
|
||||
import { getBuildTime } from "../../../utils/TGBuild";
|
||||
|
||||
import {
|
||||
insertAchievementData,
|
||||
insertAchievementSeriesData,
|
||||
@@ -21,6 +18,7 @@ import {
|
||||
AppNameCardsData,
|
||||
AppCharacterData,
|
||||
} from "../../../data";
|
||||
import { getBuildTime } from "../../../utils/TGBuild";
|
||||
|
||||
/**
|
||||
* @description 初始化应用表数据
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
* @since Beta v0.3.3
|
||||
*/
|
||||
|
||||
// utils
|
||||
import { timeToSecond } from "../utils/transTime";
|
||||
import { transCharacterData, transFloorData } from "../utils/transAbyssData";
|
||||
import { transUserRoles } from "../utils/transUserRoles";
|
||||
import { timeToSecond } from "../utils/transTime";
|
||||
import { transUserRecord } from "../utils/transUserRecord";
|
||||
import { transUserRoles } from "../utils/transUserRoles";
|
||||
|
||||
/**
|
||||
* @description 插入成就数据
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
/**
|
||||
* @file router index.ts
|
||||
* @description 路由入口
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Beta v0.3.2
|
||||
*/
|
||||
|
||||
import { createRouter, createWebHistory } from "vue-router";
|
||||
|
||||
import routes from "./routes";
|
||||
|
||||
const router = createRouter({
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
/**
|
||||
* @file router modules main.ts
|
||||
* @description 主路由模块
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Beta v0.3.2
|
||||
*/
|
||||
|
||||
// 信息展示
|
||||
import Announcements from "../../pages/common/Announcements.vue";
|
||||
import Home from "../../pages/common/Home.vue";
|
||||
// 数据交互
|
||||
import Achievements from "../../pages/common/Achievements.vue";
|
||||
// 应用配置相关
|
||||
import Announcements from "../../pages/common/Announcements.vue";
|
||||
import Config from "../../pages/common/Config.vue";
|
||||
// 测试页
|
||||
import Home from "../../pages/common/Home.vue";
|
||||
import Test from "../../pages/common/Test.vue";
|
||||
|
||||
const mainRoutes = [
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
/**
|
||||
* @file router modules sub.ts
|
||||
* @description 子路由模块,用于二级窗口
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Alpha v0.1.2
|
||||
*/
|
||||
// 游戏内公告
|
||||
import TAnno from "../../views/t-anno.vue";
|
||||
|
||||
import TAnnoJson from "../../views/t-anno-json.vue";
|
||||
// 咨讯
|
||||
import TNews from "../../views/t-news.vue";
|
||||
// 帖子相关
|
||||
import TPost from "../../views/t-post.vue";
|
||||
import TPostJson from "../../views/t-post-json.vue";
|
||||
// 抽奖
|
||||
import TAnno from "../../views/t-anno.vue";
|
||||
import TLottery from "../../views/t-lottery.vue";
|
||||
import TNews from "../../views/t-news.vue";
|
||||
import TPostJson from "../../views/t-post-json.vue";
|
||||
import TPost from "../../views/t-post.vue";
|
||||
|
||||
const subRoutes = [
|
||||
{
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
/**
|
||||
* @file router routes.ts
|
||||
* @description 路由配置
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.0
|
||||
*/
|
||||
|
||||
// 主路由
|
||||
import mainRoutes from "./modules/main";
|
||||
// 子路由
|
||||
import subRoutes from "./modules/sub";
|
||||
// Wiki 路由
|
||||
import wikiRoutes from "./modules/wiki";
|
||||
// user 路由
|
||||
import userRoutes from "./modules/user";
|
||||
import wikiRoutes from "./modules/wiki";
|
||||
|
||||
// 合并路由
|
||||
const routes = [...mainRoutes, ...subRoutes, ...wikiRoutes, ...userRoutes];
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
/**
|
||||
* @file store modules achievements.ts
|
||||
* @description Achievements store module
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Alpha v0.1.3
|
||||
*/
|
||||
|
||||
// vue
|
||||
import { ref } from "vue";
|
||||
// pinia
|
||||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
|
||||
export const useAchievementsStore = defineStore(
|
||||
"achievements",
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
/**
|
||||
* @file store modules app.ts
|
||||
* @description App store module
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Beta v0.3.3
|
||||
*/
|
||||
|
||||
// vue
|
||||
import { reactive, ref } from "vue";
|
||||
// pinia
|
||||
import { defineStore } from "pinia";
|
||||
// tauri
|
||||
import { path } from "@tauri-apps/api";
|
||||
import { defineStore } from "pinia";
|
||||
import { reactive, ref } from "vue";
|
||||
|
||||
// 用于存储用户数据的路径
|
||||
const userDataDir = `${await path.appLocalDataDir()}userData`;
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
/**
|
||||
* @file store modules home.ts
|
||||
* @description Home store module
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Alpha v0.1.6
|
||||
*/
|
||||
|
||||
// vue
|
||||
import { ref } from "vue";
|
||||
// pinia
|
||||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
|
||||
export const useHomeStore = defineStore(
|
||||
"home",
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
/**
|
||||
* @file store modules user.ts
|
||||
* @description User store module
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Beta v0.3.0
|
||||
*/
|
||||
|
||||
// vue
|
||||
import { ref } from "vue";
|
||||
// pinia
|
||||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
|
||||
export const useUserStore = defineStore(
|
||||
"user",
|
||||
|
||||
@@ -2,11 +2,10 @@
|
||||
* @file utils TGBuild.ts
|
||||
* @description 用于获取 vite 打包时间
|
||||
* @see https://gitee.com/lihanspace/vite-plugin-build-time
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Alpha v0.1.4
|
||||
*/
|
||||
|
||||
import { type Plugin } from "vite";
|
||||
import type { Plugin } from "vite";
|
||||
|
||||
const buildTimeKey = "buildTime";
|
||||
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
/**
|
||||
* @file utils TGShare.ts
|
||||
* @description 生成分享截图并保存到本地
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Beta v0.3.2
|
||||
*/
|
||||
|
||||
// third party
|
||||
import html2canvas from "html2canvas";
|
||||
// tauri
|
||||
import { dialog, fs, http, path } from "@tauri-apps/api";
|
||||
// utils
|
||||
import html2canvas from "html2canvas";
|
||||
|
||||
import showSnackbar from "../components/func/snackbar";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file utils UIAF.ts
|
||||
* @description UIAF工具类
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Alpha v0.2.3
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { app, fs, path } from "@tauri-apps/api";
|
||||
// utils
|
||||
|
||||
import TGSqlite from "../plugins/Sqlite";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/**
|
||||
* @file utils UIGF.ts
|
||||
* @description UIGF工具类
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Beta v0.3.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { app, fs, path } from "@tauri-apps/api";
|
||||
// utils
|
||||
|
||||
import { timestampToDate } from "./t2D";
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,15 +9,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { ref, onMounted, reactive } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import JsonViewer from "vue-json-viewer";
|
||||
import ToLoading from "../components/overlay/to-loading.vue";
|
||||
import TSwitchTheme from "../components/app/t-switchTheme.vue";
|
||||
// tauri
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
// utils
|
||||
import { ref, onMounted, reactive } from "vue";
|
||||
import JsonViewer from "vue-json-viewer";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import TSwitchTheme from "../components/app/t-switchTheme.vue";
|
||||
import ToLoading from "../components/overlay/to-loading.vue";
|
||||
import TGRequest from "../web/request/TGRequest";
|
||||
|
||||
// loading
|
||||
|
||||
@@ -21,18 +21,16 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import ToLoading from "../components/overlay/to-loading.vue";
|
||||
|
||||
import TSwitchTheme from "../components/app/t-switchTheme.vue";
|
||||
import TShareBtn from "../components/main/t-shareBtn.vue";
|
||||
// tauri
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
// utils
|
||||
import ToLoading from "../components/overlay/to-loading.vue";
|
||||
import { saveImgLocal } from "../utils/TGShare";
|
||||
import TGRequest from "../web/request/TGRequest";
|
||||
import TGUtils from "../web/utils/TGUtils";
|
||||
import { saveImgLocal } from "../utils/TGShare";
|
||||
|
||||
// loading
|
||||
const loading = ref<boolean>(true);
|
||||
|
||||
@@ -52,18 +52,15 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { computed, onMounted, onUpdated, reactive, ref } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import JsonViewer from "vue-json-viewer";
|
||||
import ToLoading from "../components/overlay/to-loading.vue";
|
||||
import TSwitchTheme from "../components/app/t-switchTheme.vue";
|
||||
// tauri
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
// store
|
||||
import { useAppStore } from "../store/modules/app";
|
||||
// plugins
|
||||
import { computed, onMounted, onUpdated, reactive, ref } from "vue";
|
||||
import JsonViewer from "vue-json-viewer";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import TSwitchTheme from "../components/app/t-switchTheme.vue";
|
||||
import ToLoading from "../components/overlay/to-loading.vue";
|
||||
import Mys from "../plugins/Mys";
|
||||
import { useAppStore } from "../store/modules/app";
|
||||
|
||||
// loading
|
||||
const loading = ref<boolean>(true);
|
||||
|
||||
@@ -267,17 +267,14 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { onMounted, ref } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
import showSnackbar from "../components/func/snackbar";
|
||||
import ToLoading from "../components/overlay/to-loading.vue";
|
||||
import ToChannel from "../components/overlay/to-channel.vue";
|
||||
// store
|
||||
import { useAppStore } from "../store/modules/app";
|
||||
// plugin
|
||||
import ToLoading from "../components/overlay/to-loading.vue";
|
||||
import Mys from "../plugins/Mys";
|
||||
// utils
|
||||
import { useAppStore } from "../store/modules/app";
|
||||
import { createTGWindow } from "../utils/TGWindow";
|
||||
|
||||
// 路由
|
||||
|
||||
@@ -9,15 +9,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { ref, onMounted, reactive } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import JsonViewer from "vue-json-viewer";
|
||||
import ToLoading from "../components/overlay/to-loading.vue";
|
||||
import TSwitchTheme from "../components/app/t-switchTheme.vue";
|
||||
// tauri
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
// plugins
|
||||
import { ref, onMounted, reactive } from "vue";
|
||||
import JsonViewer from "vue-json-viewer";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
import TSwitchTheme from "../components/app/t-switchTheme.vue";
|
||||
import ToLoading from "../components/overlay/to-loading.vue";
|
||||
import Mys from "../plugins/Mys";
|
||||
|
||||
// loading
|
||||
|
||||
@@ -21,15 +21,13 @@
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
// vue
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import ToLoading from "../components/overlay/to-loading.vue";
|
||||
|
||||
import TSwitchTheme from "../components/app/t-switchTheme.vue";
|
||||
import TShareBtn from "../components/main/t-shareBtn.vue";
|
||||
// tauri
|
||||
import { appWindow } from "@tauri-apps/api/window";
|
||||
// plugins
|
||||
import ToLoading from "../components/overlay/to-loading.vue";
|
||||
import Mys from "../plugins/Mys";
|
||||
|
||||
// loading
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
/**
|
||||
* @file web request genAuthkey.ts
|
||||
* @description 生成 authkey
|
||||
* @author BTMuli <bt-muli@outlook.com>
|
||||
* @since Beta v0.3.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// utils
|
||||
import TGUtils from "../utils/TGUtils";
|
||||
|
||||
import TGConstant from "../constant/TGConstant";
|
||||
import TGUtils from "../utils/TGUtils";
|
||||
|
||||
/**
|
||||
* @description 生成 authkey
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
/**
|
||||
* @file web request getAbyss.ts
|
||||
* @description 获取深渊信息
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Beta v0.3.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import TGApi from "../api/TGApi";
|
||||
// utils
|
||||
import TGUtils from "../utils/TGUtils";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
/**
|
||||
* @file web request getCookieToken.ts
|
||||
* @description 获取 Cookie Token 的请求函数
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Beta v0.3.0
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import TGApi from "../api/TGApi";
|
||||
// utils
|
||||
import TGUtils from "../utils/TGUtils";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
/**
|
||||
* @file web request getGameAccounts.ts
|
||||
* @description 获取游戏账号信息相关请求函数
|
||||
* @author BTMuli<bt-muli@outlook.com>
|
||||
* @since Alpha v0.1.5
|
||||
*/
|
||||
|
||||
// tauri
|
||||
import { http } from "@tauri-apps/api";
|
||||
// api
|
||||
|
||||
import TGApi from "../api/TGApi";
|
||||
// utils
|
||||
import TGUtils from "../utils/TGUtils";
|
||||
import TGConstant from "../constant/TGConstant";
|
||||
import TGUtils from "../utils/TGUtils";
|
||||
|
||||
/**
|
||||
* @description 通过 stoken 获取游戏账号
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user