From e676ead1a390373188aec1a57dbc2ba31e6f0f4d Mon Sep 17 00:00:00 2001 From: Jeffrey Hsu Date: Thu, 6 Feb 2025 00:54:05 +0800 Subject: [PATCH] add something --- src/renderer/src/App.vue | 3 +- src/renderer/src/store/index.ts | 32 +++++++----------- src/renderer/src/types/index.ts | 3 ++ src/renderer/src/views/create/CreatePanel.vue | 2 +- src/renderer/src/views/home/HomeStart.vue | 1 - src/renderer/src/views/panel/PanelIndex.vue | 33 +++++++++++++++++-- 6 files changed, 48 insertions(+), 26 deletions(-) diff --git a/src/renderer/src/App.vue b/src/renderer/src/App.vue index e2a4583..ba3277b 100644 --- a/src/renderer/src/App.vue +++ b/src/renderer/src/App.vue @@ -22,6 +22,7 @@ import { onMounted, ref, watch } from 'vue' import NoTextLogo from '@renderer/components/logo/NoTextLogo.vue' import { emitter } from '@renderer/utils/mitt' import { useRoute } from 'vue-router' +import { Close, Finished, FullScreen, Minus } from '@element-plus/icons-vue' const showTitleBar = ref(false) const showCopyright = ref(false) @@ -57,7 +58,7 @@ watch(
达成情况评价报告生成工具
diff --git a/src/renderer/src/store/index.ts b/src/renderer/src/store/index.ts index 336f625..fbfdf41 100644 --- a/src/renderer/src/store/index.ts +++ b/src/renderer/src/store/index.ts @@ -78,14 +78,18 @@ export const useGlobalStore = defineStore('global', () => { let classStr = '' if (classList.length > 0) { - try { - // 假设字符串格式为:两位数字 + 非空白字符(基础部分),后面紧跟中文括号括起的数字部分 - const reg = /^([0-9]{2}\S+?)((\d+))$/ - const firstMatch = classList[0].match(reg) - if (!firstMatch) { - throw new Error('输入字符串格式不正确') + // 假设字符串格式为:两位数字 + 非空白字符(基础部分),后面紧跟中文括号括起的数字部分 + const reg = /^([0-9]{2}\S+?)((\d+))$/ + const firstMatch = classList[0].match(reg) + if (!firstMatch) { + classStr = '' + for (let i = 0; i < classList.length; i++) { + classStr += classList[i] + if (i !== classList.length - 1) { + classStr += '、' + } } - + } else { const base = firstMatch[1] const startNum = parseInt(firstMatch[2], 10) @@ -94,19 +98,10 @@ export const useGlobalStore = defineStore('global', () => { for (let i = 0; i < classList.length; i++) { classStr += `(${startNum + i})` } - } catch (e) { - console.error(e) - classStr = '' - for (let i = 0; i < classList.length; i++) { - classStr += classList[i] - if (i !== classList.length - 1) { - classStr += '、' - } - } } } - const info: ICourse = { + courseInfo.value = { campus: sheet['A4']['v'].split(':')[1], className: classStr, credit: parseFloat(sheet['E4']['v'].split(':')[1]), @@ -115,9 +110,6 @@ export const useGlobalStore = defineStore('global', () => { name: sheet['E3']['v'].split(':')[1], teacher: sheet['D4']['v'].split(':')[1] } - - console.log(classList) - courseInfo.value = info return true } diff --git a/src/renderer/src/types/index.ts b/src/renderer/src/types/index.ts index 1ea63ba..2eba3a6 100644 --- a/src/renderer/src/types/index.ts +++ b/src/renderer/src/types/index.ts @@ -60,5 +60,8 @@ export interface IGoal { importance: 'H' | 'M' | 'L' // 强弱支持 target: string // 目标 indicator: string // 指标点 +} + +export interface IGoalFinal extends IGoal { weight: IGoalWeight[] // 比重 } diff --git a/src/renderer/src/views/create/CreatePanel.vue b/src/renderer/src/views/create/CreatePanel.vue index a5d5b59..b57f289 100644 --- a/src/renderer/src/views/create/CreatePanel.vue +++ b/src/renderer/src/views/create/CreatePanel.vue @@ -51,7 +51,7 @@ onMounted(() => {