add something

This commit is contained in:
Jeffrey Hsu 2025-02-06 00:54:05 +08:00
parent 71c05fc47e
commit e676ead1a3
6 changed files with 48 additions and 26 deletions

View File

@ -22,6 +22,7 @@ import { onMounted, ref, watch } from 'vue'
import NoTextLogo from '@renderer/components/logo/NoTextLogo.vue' import NoTextLogo from '@renderer/components/logo/NoTextLogo.vue'
import { emitter } from '@renderer/utils/mitt' import { emitter } from '@renderer/utils/mitt'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { Close, Finished, FullScreen, Minus } from '@element-plus/icons-vue'
const showTitleBar = ref(false) const showTitleBar = ref(false)
const showCopyright = ref(false) const showCopyright = ref(false)
@ -57,7 +58,7 @@ watch(
<div class="flex h-screen flex-col overflow-hidden"> <div class="flex h-screen flex-col overflow-hidden">
<div <div
v-if="showTitleBar" v-if="showTitleBar"
class="flex h-10 w-full justify-between overflow-hidden window-title flex-shrink-0" class="flex h-10 w-full justify-between overflow-hidden window-title flex-shrink-0 bg-gray-100"
> >
<!-- 标题 --> <!-- 标题 -->
<div class="pl-4 font-bold leading-10">达成情况评价报告生成工具</div> <div class="pl-4 font-bold leading-10">达成情况评价报告生成工具</div>

View File

@ -78,14 +78,18 @@ export const useGlobalStore = defineStore('global', () => {
let classStr = '' let classStr = ''
if (classList.length > 0) { if (classList.length > 0) {
try { // 假设字符串格式为:两位数字 + 非空白字符(基础部分),后面紧跟中文括号括起的数字部分
// 假设字符串格式为:两位数字 + 非空白字符(基础部分),后面紧跟中文括号括起的数字部分 const reg = /^([0-9]{2}\S+?)(\d+)$/
const reg = /^([0-9]{2}\S+?)(\d+)$/ const firstMatch = classList[0].match(reg)
const firstMatch = classList[0].match(reg) if (!firstMatch) {
if (!firstMatch) { classStr = ''
throw new Error('输入字符串格式不正确') for (let i = 0; i < classList.length; i++) {
classStr += classList[i]
if (i !== classList.length - 1) {
classStr += '、'
}
} }
} else {
const base = firstMatch[1] const base = firstMatch[1]
const startNum = parseInt(firstMatch[2], 10) const startNum = parseInt(firstMatch[2], 10)
@ -94,19 +98,10 @@ export const useGlobalStore = defineStore('global', () => {
for (let i = 0; i < classList.length; i++) { for (let i = 0; i < classList.length; i++) {
classStr += `${startNum + 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], campus: sheet['A4']['v'].split('')[1],
className: classStr, className: classStr,
credit: parseFloat(sheet['E4']['v'].split('')[1]), credit: parseFloat(sheet['E4']['v'].split('')[1]),
@ -115,9 +110,6 @@ export const useGlobalStore = defineStore('global', () => {
name: sheet['E3']['v'].split('')[1], name: sheet['E3']['v'].split('')[1],
teacher: sheet['D4']['v'].split('')[1] teacher: sheet['D4']['v'].split('')[1]
} }
console.log(classList)
courseInfo.value = info
return true return true
} }

View File

@ -60,5 +60,8 @@ export interface IGoal {
importance: 'H' | 'M' | 'L' // 强弱支持 importance: 'H' | 'M' | 'L' // 强弱支持
target: string // 目标 target: string // 目标
indicator: string // 指标点 indicator: string // 指标点
}
export interface IGoalFinal extends IGoal {
weight: IGoalWeight[] // 比重 weight: IGoalWeight[] // 比重
} }

View File

@ -51,7 +51,7 @@ onMounted(() => {
<template> <template>
<div class="flex w-full"> <div class="flex w-full">
<aside class="h-full w-72 shrink-0 border-r border-dashed border-gray-200 bg-blue-50"> <aside class="h-full w-72 shrink-0 border-r border-dashed border-gray-200 bg-gray-100">
<div <div
v-for="(item, index) in asideMenu" v-for="(item, index) in asideMenu"
:key="index" :key="index"

View File

@ -23,7 +23,6 @@ import router from '@renderer/router'
const handleFunctionClick = (ev: 'create' | 'open') => { const handleFunctionClick = (ev: 'create' | 'open') => {
if (ev === 'create') { if (ev === 'create') {
router.push({ name: 'create' }) router.push({ name: 'create' })
console.log(1)
} else if (ev === 'open') { } else if (ev === 'open') {
router.push({ name: 'panel' }) router.push({ name: 'panel' })
} }

View File

@ -20,9 +20,19 @@
<script setup lang="ts"> <script setup lang="ts">
import { useGlobalStore } from '@renderer/store' import { useGlobalStore } from '@renderer/store'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { ref } from 'vue'
import { IGoal } from '@renderer/types'
const store = useGlobalStore() const store = useGlobalStore()
const { courseInfo } = storeToRefs(store) const { courseInfo } = storeToRefs(store)
const tempGoal = ref<IGoal>({ importance: 'H', indicator: '', target: '' })
const tempGoalList = ref<IGoal[]>([])
const showAddGoal = ref(false)
const handleAddNewGoal = () => {
showAddGoal.value = true
}
</script> </script>
<template> <template>
@ -32,7 +42,6 @@ const { courseInfo } = storeToRefs(store)
</div> </div>
<el-divider content-position="left">基本信息</el-divider> <el-divider content-position="left">基本信息</el-divider>
<div class="mx-auto w-full max-w-lg"> <div class="mx-auto w-full max-w-lg">
<el-form :model="courseInfo" label-width="auto" disabled> <el-form :model="courseInfo" label-width="auto" disabled>
<el-form-item label="课号"> <el-form-item label="课号">
@ -63,9 +72,27 @@ const { courseInfo } = storeToRefs(store)
</el-form> </el-form>
</div> </div>
<el-divider content-position="left">课程指标</el-divider> <el-divider content-position="left">课程目标</el-divider>
<div class="mx-auto w-full max-w-lg">
<el-button :disabled="showAddGoal" @click="handleAddNewGoal">添加</el-button>
<div class="mx-auto w-full max-w-lg"></div> <div>
<div v-for="(item, index) in tempGoalList" :key="index">
{{ item.importance }}
{{ item.indicator }}
{{ item.target }}
</div>
<el-form v-show="showAddGoal" v-model="tempGoal">
<el-form-item label="强弱支撑">
<el-select v-model="tempGoal.importance">
<el-option>H</el-option>
<el-option>M</el-option>
<el-option>L</el-option>
</el-select>
</el-form-item>
</el-form>
</div>
</div>
</div> </div>
</template> </template>