feat: change test view to basic jtag upload and download page

This commit is contained in:
2025-05-09 21:44:51 +08:00
parent 10918a997c
commit 020674a277
10 changed files with 859 additions and 128 deletions

45
src/stores/dialog.ts Normal file
View File

@@ -0,0 +1,45 @@
import { ref, computed } from 'vue'
import { defineStore } from 'pinia'
import { isUndefined } from 'lodash';
export const useDialogStore = defineStore('dialog', () => {
type Title = "Error" | "Info" | "Warn";
const isDialogOpen = ref(false);
const dialogTitle = ref<Title>("Error");
const dialogContent = ref("这是一个错误");
function openDialog(title: Title, content?: string) {
if (!isUndefined(content) && content.length != 0)
dialogContent.value = content;
dialogTitle.value = title;
isDialogOpen.value = true;
}
function closeDialog() {
isDialogOpen.value = false;
}
function info(content?: string) {
openDialog("Info", content);
}
function error(content?: string) {
openDialog("Error", content);
}
function warn(content?: string) {
openDialog("Warn", content);
}
return {
isDialogOpen,
dialogTitle,
dialogContent,
openDialog,
closeDialog,
info,
error,
warn
}
})