达成情况评价报告生成工具
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(() => {
-