移除考试配置中的考场名称字段,更新路由以支持新子页面

This commit is contained in:
hello8693 2025-03-21 20:48:54 +08:00
parent 3563145d18
commit 3889f73fcf
4 changed files with 31 additions and 12 deletions

View File

@ -7,9 +7,7 @@
<t-form-item label="考试信息" name="message"> <t-form-item label="考试信息" name="message">
<t-input v-model="localProfile.message"></t-input> <t-input v-model="localProfile.message"></t-input>
</t-form-item> </t-form-item>
<t-form-item label="考场名称" name="room">
<t-input v-model="localProfile.room"></t-input>
</t-form-item>
</t-form> </t-form>
</div> </div>
</template> </template>

View File

@ -19,11 +19,6 @@ export interface ExamConfig {
*/ */
message: string message: string
/**
* The room where the exam will take place.
*/
room: string
/** /**
* An array of information related to the exam. * An array of information related to the exam.
*/ */

View File

@ -1,6 +1,9 @@
import { createRouter, createWebHashHistory } from 'vue-router' import { createRouter, createWebHashHistory } from 'vue-router'
import EditorView from '../views/EditorView.vue' import EditorView from '../views/EditorView.vue'
import HomeView from '@renderer/views/HomeView.vue' import HomeView from '@renderer/views/HomeView.vue'
import MainpageView from '@renderer/views/home/MainpageView.vue'
import PluginView from '@renderer/views/home/PluginView.vue'
import PlayerHomeView from '@renderer/views/home/PlayerHomeView.vue'
const router = createRouter({ const router = createRouter({
history: createWebHashHistory(import.meta.env.BASE_URL), history: createWebHashHistory(import.meta.env.BASE_URL),
@ -9,7 +12,34 @@ const router = createRouter({
path: '/', path: '/',
name: 'home', name: 'home',
component: HomeView, component: HomeView,
children: [
{
path: 'mainpage',
name: 'mainpage',
component: MainpageView,
},
{
path: 'playerhome',
name: 'playerhome',
component: PlayerHomeView,
},
{
path: 'pluginpage',
name: 'pluginpage',
component: PluginView,
}
],
}, },
{
path: '/editor',
name: 'editor',
component: EditorView,
},
{
path: '/playerview',
name: 'playerview',
component: () => import('../views/PlayerView.vue'),
}
], ],
}) })

View File

@ -38,7 +38,6 @@ const windowTitle = ref('ExamAware Editor')
const eaProfile = reactive<ExamConfig>({ const eaProfile = reactive<ExamConfig>({
examName: '未命名考试', examName: '未命名考试',
message: '考试信息', message: '考试信息',
room: '114考场',
examInfos: [], examInfos: [],
}) })
const currentExamIndex = ref<number | null>(null) const currentExamIndex = ref<number | null>(null)
@ -59,7 +58,6 @@ function handleConfigFileUpload(file: File) {
Object.assign(eaProfile, { Object.assign(eaProfile, {
examName: parsed.examName, examName: parsed.examName,
message: parsed.message, message: parsed.message,
room: parsed.room,
examInfos: parsed.examInfos, examInfos: parsed.examInfos,
}) })
saveProfileToLocalStorage() saveProfileToLocalStorage()
@ -156,7 +154,6 @@ const menuData: MenuOptions = {
onClick: () => { onClick: () => {
eaProfile.examName = '未命名考试' eaProfile.examName = '未命名考试'
eaProfile.message = '考试信息' eaProfile.message = '考试信息'
eaProfile.room = '114考场'
currentExamIndex.value = null currentExamIndex.value = null
eaProfile.examInfos = [] eaProfile.examInfos = []
saveProfileToLocalStorage() saveProfileToLocalStorage()
@ -224,7 +221,6 @@ const menuData: MenuOptions = {
function updateProfile(newProfile: ExamConfig) { function updateProfile(newProfile: ExamConfig) {
eaProfile.examName = newProfile.examName eaProfile.examName = newProfile.examName
eaProfile.message = newProfile.message eaProfile.message = newProfile.message
eaProfile.room = newProfile.room
eaProfile.examInfos = newProfile.examInfos eaProfile.examInfos = newProfile.examInfos
saveProfileToLocalStorage() saveProfileToLocalStorage()
} }