完成部分教师端前端代码,作业模块还没完成

This commit is contained in:
zlm133588 2025-03-01 20:40:30 +08:00
parent 812ec9c74c
commit c829cb4718
50 changed files with 6212 additions and 3960 deletions

0
.gitignore vendored Normal file
View File

8
.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

9
.idea/AUTO_SCORE.iml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

14
.idea/compiler.xml Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile default="true" name="Default" enabled="true" />
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="AES" />
</profile>
</annotationProcessing>
</component>
</project>

7
.idea/encodings.xml Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/AES/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/AES/src/main/resources" charset="UTF-8" />
</component>
</project>

20
.idea/jarRepositories.xml Normal file
View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

14
.idea/misc.xml Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/AES/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

9
.idea/modules.xml Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/AES/AES.iml" filepath="$PROJECT_DIR$/AES/AES.iml" />
<module fileurl="file://$PROJECT_DIR$/.idea/AUTO_SCORE.iml" filepath="$PROJECT_DIR$/.idea/AUTO_SCORE.iml" />
</modules>
</component>
</project>

124
.idea/uiDesigner.xml Normal file
View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

6
.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

8
AES-front/.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,69 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="LINE_SEPARATOR" value="&#10;" />
<option name="RIGHT_MARGIN" value="50" />
<option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" />
<HTMLCodeStyleSettings>
<option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
<option name="HTML_QUOTE_STYLE" value="Single" />
<option name="HTML_ENFORCE_QUOTES" value="true" />
</HTMLCodeStyleSettings>
<JSCodeStyleSettings version="0">
<option name="USE_SEMICOLON_AFTER_STATEMENT" value="false" />
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="USE_DOUBLE_QUOTES" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</JSCodeStyleSettings>
<TypeScriptCodeStyleSettings version="0">
<option name="USE_SEMICOLON_AFTER_STATEMENT" value="false" />
<option name="FORCE_SEMICOLON_STYLE" value="true" />
<option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
<option name="USE_DOUBLE_QUOTES" value="false" />
<option name="FORCE_QUOTE_STYlE" value="true" />
<option name="ENFORCE_TRAILING_COMMA" value="Remove" />
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
<option name="SPACES_WITHIN_IMPORTS" value="true" />
</TypeScriptCodeStyleSettings>
<VueCodeStyleSettings>
<option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
<option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
</VueCodeStyleSettings>
<codeStyleSettings language="HTML">
<option name="SOFT_MARGINS" value="100" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="KEEP_SIMPLE_CLASSES_IN_ONE_LINE" value="true" />
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="SOFT_MARGINS" value="100" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<option name="SOFT_MARGINS" value="100" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Vue">
<option name="SOFT_MARGINS" value="100" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>

View File

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="file://$PROJECT_DIR$" libraries="{Node.js Core}" />
</component>
</project>

6
AES-front/.idea/misc.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/AES-front.iml" filepath="$PROJECT_DIR$/.idea/AES-front.iml" />
</modules>
</component>
</project>

6
AES-front/.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

View File

@ -86,5 +86,19 @@
"vite-plugin-html": "^3.2.2",
"vite-plugin-mock": "2.9.6",
"vite-plugin-svg-icons": "^2.0.1"
},
"pnpm": {
"ignoredBuiltDependencies": [
"bufferutil",
"es5-ext",
"vue-demi",
"vue-echarts"
],
"onlyBuiltDependencies": [
"bufferutil",
"es5-ext",
"vue-demi",
"vue-echarts"
]
}
}

File diff suppressed because it is too large Load Diff

View File

@ -6,4 +6,9 @@ export default {
getTeacherInfo: () => request.post('/adminusers/getTeacherInfo'),
updateTeacherNoPassword: (data) => request.post('/adminusers/updateTeacherNoPassword', data),
getTeacherSignList: () => request.post('/adminusers/getTeacherSignList'),
// findAllClassPage: (data) => request.post('/classes/findAllClassPage', data),
// findAllClasses: (data) => request.post('/classes/findAllClasses', data),
// findAllCoursesPage: (data) => request.post('/course/findAllCoursesPage', data)
signTeacher: (data) => request.post('/adminusers/signTeacher', data, { noNeedToken: true })
}

View File

@ -11,8 +11,15 @@
:show-require-mark="false">
<div>
<div class="grid md:flex md:flex-wrap md:gap-x-1">
<n-form-item label="学校:" class="flex-item" style="margin-left: -30px">
<n-select v-model:value="assistantInfoValue.schoolId" :options="options" filterable style="min-width: 140px"></n-select>
<!-- <n-form-item label="学校:" class="flex-item" style="margin-left: -30px">-->
<!-- <n-select v-model:value="assistantInfoValue.schoolId" :options="options" filterable style="min-width: 140px"></n-select>-->
<!-- </n-form-item>-->
<n-form-item label="姓名:"
class="flex-item"
style="margin-left: -30px">
<n-input
v-model:value="assistantInfoValue.name"
style="min-width: 80px" placeholder=""></n-input>
</n-form-item>
<n-form-item style="margin-left: 20px">
<n-button type="primary" @click="search">自定义查询</n-button>
@ -52,7 +59,8 @@ import { useRouter } from 'vue-router';
const userStore = useUserStore()
const router = useRouter()
const loading = ref(true)
const assistantList = ref([])
const assistantList =
ref([{no:"2132312131",id:"1",account:"lisi",name:"李四",role:"助教",email:"2475525791@qq.com"}])
const options=ref([])
const paginationReactive = reactive({
page: 1,
@ -66,6 +74,7 @@ const paginationReactive = reactive({
const assistantInfoValue = ref({
schoolId:0,
id:1,
name:'',
pageNum:paginationReactive.page,
pageSize:paginationReactive.pageSize
});
@ -89,17 +98,17 @@ const columns = [
{
key: 'name',
title: '姓名',
width: '80',
width: '70',
},
{
key: 'role',
title: '角色',
width: '80',
width: '70',
},
{
key: 'email',
title: '邮箱',
width: '80',
width: '100',
},
{
key: 'actions',

View File

@ -44,7 +44,7 @@ const router = useRouter()
const route = useRoute()
const classInfoRef = ref(null)
const loading = ref(true)
const classList = ref([])
const classList = ref([{no:"2132312131",account:"lisi",name:"李四",email:"2475525791@qq.com"}])
const {clId} = route.params
const options = ref([])

View File

@ -11,14 +11,14 @@
<div style="display: flex">
<div v-if="userStore.getRole().length>0 && userStore.getRole().some((r)=>r==='admin')">
<div style="display: flex">
<n-form-item label="学校:">
<n-select
v-model:value="classInfoValue.id"
:options="options"
filterable
placeholder=""
style="min-width: 140px"></n-select>
</n-form-item>
<!-- <n-form-item label="学校:">-->
<!-- <n-select-->
<!-- v-model:value="classInfoValue.id"-->
<!-- :options="options"-->
<!-- filterable-->
<!-- placeholder=""-->
<!-- style="min-width: 140px"></n-select>-->
<!-- </n-form-item>-->
<n-form-item label="教师:" path="name" class="flex-item">
<n-select v-model:value="classInfoValue.teacherId"
:options="options1"
@ -68,8 +68,8 @@ const userStore = useUserStore()
const router = useRouter()
const classInfoRef = ref(null)
const loading = ref(true)
const classList = ref([])
const options = ref([])
const classList =
ref([{name:"C++班级",teacherName:"hqb",studentNum:"50",createTime:"2025-2-17",inviteCode:"46FJSJXHA"}])
const options1=ref([])
const role=userStore.getRole()
const teacherId=ref()
@ -156,7 +156,6 @@ if (role[0]=='admin'){
{
onClickStudent: () => onStudentClass(row),
onClickAssistant: () => onAssistantClass(row),
onClickExam: () => onExamClass(row),
onClickEdit: () => onEditClass(row),
onClickDelete: () => onDeleteClass(row),
}
@ -200,7 +199,6 @@ if (role[0]=='admin'){
{
onClickStudent: () => onStudentClass(row),
onClickAssistant: () => onAssistantClass(row),
onClickExam: () => onExamClass(row),
onClickEdit: () => onEditClass(row),
onClickDelete: () => onDeleteClass(row),
}
@ -264,20 +262,19 @@ const onDeleteClass = async (classid)=>{
$message.error("删除失败")
}
}
const onExamClass = async (classid)=>{
const {id} = classid
await router.push({name: 'AdminClassExam', params: {clId: id}, query: {teacherName: classid.teacherName,Id:classid.teacherId}})
}
const onStudentClass = async (classid)=>{
const {id} = classid
// const {id} = classid
const id=1
await router.push({name: 'AdminClassStudents', params: {clId: id}})
}
const onAssistantClass = async (classid)=>{
const {id} = classid
// const {id} = classid
const id=1
await router.push({name: 'AdminClassAssistant', params: {clId: id}})
}
const onEditClass = async (classid)=>{
const {id} = classid
// const {id} = classid
const id=1
await router.push({name: 'AdminClassEdit', params: {clId: id}})
}
const search=async ()=>{

View File

@ -34,7 +34,8 @@ const userStore = useUserStore()
const router = useRouter()
const route = useRoute()
const loading = ref(true)
const classList = ref([])
const classList =
ref([{studentNo:"211310509",chineseName:"张三",username:"zhangsan",banji:"计算机2101",email:"2286848422@qq.com"}])
const {clId} = route.params
const cIId=parseInt(clId)
const options = ref([])

View File

@ -19,11 +19,11 @@
">
助教信息
</n-button>
<n-button type="primary" size="small" @click="onExam" style="--n-width: 70px;margin-left:15px ;padding: 0 0" v-if="
userStore.getRole().length > 0 && (userStore.getRole().some((r) => r === 'admin'|| userStore.getRole().some((r) => r === 'teacher')))
">
编程考试
</n-button>
<!-- <n-button type="primary" size="small" @click="onExam" style="&#45;&#45;n-width: 70px;margin-left:15px ;padding: 0 0" v-if="-->
<!-- userStore.getRole().length > 0 && (userStore.getRole().some((r) => r === 'admin'|| userStore.getRole().some((r) => r === 'teacher')))-->
<!-- ">-->
<!-- 编程考试-->
<!-- </n-button>-->
</div>
</div>
</template>

View File

@ -62,7 +62,7 @@
<script setup>
import {onMounted, reactive, ref} from "vue";
import ProblemActions from "@/views/admin/problem/components/ProblemActions.vue";
import ProblemActions from "@/views/admin/question/components/ProblemActions.vue";
import api from "@/api/admin";
import {useRoute, useRouter} from 'vue-router';
import AssistantAction from "@/views/admin/class/components/assistant-action.vue";

View File

@ -0,0 +1,49 @@
<template>
<div class="grid md:flex md:flex-wrap md:gap-x-1" :class="{'justify-center': !showStudentInfoButton}">
<div>
<n-button type="info" size="small" @click="onAdd" style="--n-width: 120px;margin-left: 5px">
添加班级到课程
</n-button>
<n-button
v-if="showStudentInfoButton"
type="info"
size="small"
@click="onStudent"
style="--n-width: 80px;margin-left: 5px"
>
学生信息
</n-button>
<n-button
v-if="showStudentInfoButton"
type="info"
size="small"
@click="onAssistant"
style="--n-width: 80px;margin-left: 5px"
>
助教信息
</n-button>
</div>
</div>
</template>
<script setup>
const emit = defineEmits(['clickAdd', 'clickStudentInfo','clickAssistant'])
const props = defineProps({
showStudentInfoButton: {
type: Boolean,
default: false
}
})
const onAdd = () => {
emit('clickAdd')
}
const onStudent = () => {
emit('clickStudentInfo')
}
const onAssistant = ()=>{
emit('clickAssistant')
}
</script>

View File

@ -7,16 +7,40 @@
<n-button type="primary" size="small" @click="onDelete" style="--n-width: 70px;margin: 0px 20px">
删除
</n-button>
<n-button type="primary" size="small" @click="onBanji" style="--n-width: 70px;margin: 0px 20px">
参与班级
</n-button>
<n-button type="primary" size="small"
@click="onAddQuestion"
style="margin-left: 12px">作业添加</n-button>
<n-button type="primary" size="small"
@click="onQuestion"
style="--n-width: 70px;margin: 0px 20px">
作业列表
</n-button>
<n-button type="primary" size="small" @click="onEdit" style="--n-width: 70px;margin: 0px 20px">
作业库
</n-button>
</div>
</div>
</template>
<script setup>
const emit = defineEmits(['clickDelete'],['clickEdit'])
const emit =
defineEmits(['clickDelete'],['clickEdit'],['clickAdd'],['clickBanji'],['clickQuestion'])
const onDelete = ()=>{
emit('clickDelete')
}
const onEdit = ()=>{
emit('clickEdit')
}
const onAddQuestion = ()=>{
emit('clickAdd')
}
const onBanji = ()=>{
emit('clickBanji')
}
const onQuestion = ()=>{
emit('clickQuestion')
}
</script>

View File

@ -2,7 +2,10 @@
<n-scrollbar x-scrollable style="max-height: 100vh">
<CommonPage show-footer>
<div>
<n-form ref="courseInfoRef" :model="courseInfoValue" :rules="rules" size="small" :label-width="180" inline >
<n-form ref="courseInfoRef"
:model="courseInfoValue"
:rules="rules" size="small"
:label-width="280" inline >
<n-form-item label="" path="input">
<div >
<div style="display: flex; align-items: center; margin-bottom: 20px;">
@ -16,17 +19,18 @@
</n-form>
</div>
<n-data-table
remote
:single-line="false"
ref="table"
:columns="columns"
:data="courseList"
:loading="loading"
:pagination="paginationReactive"
:row-key="rowKey"
style="width: 550px;--n-td-padding:0px 12px"
@update:page="onChangePage"
@update:page-size="onUpdatePageSize"
remote
:single-line="false"
ref="table"
:columns="columns"
:data="courseList"
:loading="loading"
:pagination="paginationReactive"
:row-key="rowKey"
style="width:1000px;--n-td-padding:0px
12px"
@update:page="onChangePage"
@update:page-size="onUpdatePageSize"
/>
</CommonPage>
@ -44,7 +48,7 @@ const router = useRouter()
const rules=ref(null)
const courseInfoRef = ref(null)
const loading = ref(true)
const courseList = ref([])
const courseList = ref([{ name: 'C++课程'}])
const paginationReactive = reactive({
page: 1,
pageSize: 10,
@ -59,26 +63,29 @@ const courseInfoValue = ref({
pageNum:paginationReactive.page,
pageSize:paginationReactive.pageSize,
});
const onAdd = ()=>{
router.push({name: 'AdminCourseAdd'})
}
const columns = [
{
key: 'name',
title: '课程名称',
width: '80',
width: '75',
},
{
key: 'actions',
title: '操作',
width: '50',
width: '150',
render(row) {
return h(
CourseActions,
{
onClickEdit: () => onEditCourses(row),
onClickDelete: () => onDeleteCourses(row),
}
CourseActions,
{
onClickEdit: () => onEditCourses(row),
onClickDelete: () =>
onDeleteCourses(row),
onClickBanji: () => onBanjiExam(row),
onClickAdd:()=>onAddQuestion(row),
onClickQuestion:()=>onQuestion(row)
}
);
}
}
@ -89,9 +96,9 @@ const queryByPage = async (currentPage)=>{
courseInfoValue.value.pageSize=paginationReactive.pageSize
try {
const res = await api.findAllCoursesPage(
{
...courseInfoValue.value
}
{
...courseInfoValue.value
}
)
const {pageNum, pageSize, total, list} = res.data
paginationReactive.page = pageNum
@ -115,7 +122,8 @@ const sub = async ()=>{
})
}
const onDeleteCourses = async (courses)=>{
const {id} = courses
// const {id} = courses
const id=1
try {
await api.deletecoursesInfo({id})
$message.success("删除成功")
@ -126,7 +134,8 @@ const onDeleteCourses = async (courses)=>{
}
}
const onEditCourses=async (courses)=>{
const {id} = courses
// const {id} = courses
const id=1
await router.push({name: 'AdminCourseEdit', params: {chId: id}})
}
const onUpdatePageSize = (pageSize) => {
@ -134,6 +143,36 @@ const onUpdatePageSize = (pageSize) => {
paginationReactive.page = 1;
queryByPage(1)
}
const onBanjiExam= async (classId)=>{
// const { id } = classId
const id=1
try {
await router.push({ name:
'AdminClassManage', query: { classId: id
} })
}catch (err){
$message.error('无法查看')
}
}
const onQuestion= async (classId)=>{
// const { id } = classId
const id=1
try {
await router.push({ name:
'AdminProblemList', query: { classId: id
} })
}catch (err){
$message.error('无法查看')
}
}
const onAdd = ()=>{
router.push({name: 'AdminCourseAdd'})
}
const onAddQuestion= ()=>{
router.push({name: 'AdminProblemAdd'})
}
const rowKey = (rowData) => {
return rowData.id
}
@ -141,12 +180,12 @@ onMounted(()=>{
queryByPage(paginationReactive.page)
})
watch(
()=>router.currentRoute.value.fullPath,
()=>{
if (router.currentRoute.value.fullPath==='/admin/course/course-list') {
queryByPage(paginationReactive.page)
}
()=>router.currentRoute.value.fullPath,
()=>{
if (router.currentRoute.value.fullPath==='/admin/course/course-list') {
queryByPage(paginationReactive.page)
}
}
)
</script>
<style scoped>

View File

@ -0,0 +1,272 @@
<template>
<CommonPage>
<div style="display: flex; align-items: center; margin-bottom: 10px">
<n-form ref="userInfoRef" size="small" :label-width="200" inline>
<n-form-item label="" path="input">
<div style="display: flex; align-items: center;">
<!-- <div v-if="userStore.getRole().length > 0 && userStore.getRole().some(r => r === 'admin')" style="display: flex; align-items: center;">-->
<!-- <span style="width: 40px; margin-left: 18px">学校</span>-->
<!-- <n-select-->
<!-- v-model:value="teacherInfoValue.schoolId"-->
<!-- :options="options1"-->
<!-- filterable-->
<!-- style="min-width: 80px; width: 200px"-->
<!-- />-->
<!-- </div>-->
<!-- <div v-if="userStore.getRole().length > 0 && userStore.getRole().some(r => r === 'teacher') && otherSchool" style="display: flex; align-items: center;">-->
<!-- <span style="width: 40px; margin-left: 18px">学校</span>-->
<!-- <n-select-->
<!-- v-model:value="teacherInfoValue.schoolId"-->
<!-- :options="options1"-->
<!-- filterable-->
<!-- style="min-width: 80px; width: 200px"-->
<!-- />-->
<!-- </div>-->
<span style="width: 40px; margin-left: 30px">教师</span>
<n-select
v-model:value="teacherInfoValue.teacherId"
:options="options2"
style="min-width: 80px; width: 100px; margin-right: 12px"
/>
</div>
<n-button
style="margin-left: 30px"
type="primary"
:loading="queryLoading"
@click="getClassesNotInExam"
>
查询
</n-button>
<n-checkbox
ml-20
size="medium"
v-if="userStore.getRole().length > 0 && userStore.getRole().some(r => r === 'teacher')"
v-model:checked="otherSchool"
@update:checked="handleCheckedChange">
其它学校班级
</n-checkbox>
</n-form-item>
</n-form>
</div>
<n-data-table
remote
:data="classes"
:columns="columns"
:pagination="paginationReactive"
:loading="loading"
style="--n-td-padding: 2px 5px;"
class="mb-70 min-w-600 overflow-auto"
/>
</CommonPage>
</template>
<script setup>
import CommonPage from '@/components/page/CommonPage.vue'
import {h, onMounted, ref, watch} from 'vue'
import {useUserStore} from '@/store'
import ExamClassesAddActions from "./components/ExamClassesAddAction.vue";
import api from '@/api/admin'
import {formatDateTime} from '@/utils'
import {useRoute, useRouter} from 'vue-router'
import {NButton} from 'naive-ui'
const router = useRouter()
const userStore = useUserStore()
const route = useRoute()
const { examId, history } = route.query
const role = ref(userStore.getRole())
const options1 =
ref([])
const options2 = ref([])
const queryLoading = ref(false)
const teacherInfoValue = ref({
schoolId: '1',
teacherId: '',
})
const teacherId = ref(0)
const classes = ref([{id:1,name:'班级1',teacherName:'黄秋波',studentNum:40}])
const loading = ref(false)
const otherSchool = ref(false)
const columns = [
{
title: '编号',
key: 'id',
align: 'center',
},
{
title: '班级名称',
key: 'name',
align: 'center',
width: 300,
},
{
title: '教师',
key: 'teacherName',
align: 'center',
},
{
title: '学生数',
key: 'studentNum',
align: 'center',
},
{
title: '创建时间',
key: 'createTime',
width: 200,
align: 'center',
render(row) {
return formatDateTime(row.createTime)
},
},
{
title: '操作',
align: 'center',
width:'333px',
render(row) {
const isAdmin = userStore.getRole().some((r) => r === 'admin');
const isTeacher = userStore.getName() === row.teacherName;
return h(
ExamClassesAddActions,
{
onClickAdd: () => addClassToExam(row),
onClickStudentInfo: () => onStudentClass(row),
showStudentInfoButton: isAdmin || isTeacher,
onClickAssistant: () => onAssistantClass(row),
}
);
}, },
]
const paginationReactive = reactive({
page: 1,
pageSize: 10,
showSizePicker: true,
pageSizes: [10, 20, 50],
onChange: (page) => {
paginationReactive.page = page
getClassesNotInExam()
},
onUpdatePageSize: (pageSize) => {
paginationReactive.pageSize = pageSize
paginationReactive.page = 1
getClassesNotInExam()
},
prefix({ itemCount }) {
return `总共 ${itemCount} 条`
},
})
const onAssistantClass = async (classId)=>{
const {id} = classId
await router.push({name: 'AdminClassAssistant', params: {clId: id}})
}
const getSchools = async () => {
try {
const res = await api.findAllSchools()
const transformData = res.data.map((item) => ({
label: item.name,
value: item.id,
}))
transformData.unshift({
label: '全部',
value: 0,
})
teacherInfoValue.value.schoolId = parseInt(userStore.getSchoolId(), 10)
options1.value = transformData
} catch (error) {
console.log(error)
$message.error('获取学校的信息失败')
}
}
const queryByPage1 = async (query) => {
const res = await api.findAllAdminusersBySchoolId({
schoolId: query,
})
const transformedData = res.data.map((item) => ({
label: item.name,
value: item.id,
}))
if(res.data.length > 0) {
transformedData.unshift({
label: '全部',
value: 0,
})
teacherInfoValue.value.teacherId = 0
if (userStore.getRole().includes('teacher')) {
teacherInfoValue.value.teacherId = parseInt(userStore.getId(), 10)
}
}
else {
transformedData.unshift({
label: '无',
value: 0,
})
teacherInfoValue.value.teacherId = 0
}
options2.value = transformedData
await getClassesNotInExam()
}
watch(
() => teacherInfoValue.value.schoolId,
(newVal) => {
teacherInfoValue.value.teacherId = ''
options2.value = []
queryByPage1(newVal)
}
)
const onStudentClass = (classId)=>{
const {id} = classId
router.push({name: 'AdminClassStudents',params:{clId: id}})
}
const addClassToExam = async (classId) => {
const {id} = classId
try {
await api.addClassToExam({
examId: examId,
classId: id,
history:history
})
$message.success('添加成功')
classes.value = classes.value.filter((item) => item.id !== classId.id);
} catch (error) {
console.log(error);
}
}
const getClassesNotInExam = async () => {
try {
loading.value = true
const res = await api.findClassNotInExam({
examId: examId,
teacherId: teacherInfoValue.value.teacherId,
id: teacherInfoValue.value.schoolId,
pageNum: paginationReactive.page,
pageSize: paginationReactive.pageSize,
history:history
})
classes.value = res.data.list
paginationReactive.itemCount = res.data.total
} catch (error) {
console.log(error)
} finally {
loading.value = false
}
}
const handleCheckedChange = (checked) => {
otherSchool.value = checked
if(!checked) {
teacherInfoValue.value.schoolId = parseInt(userStore.getSchoolId(), 10)
}
}
onMounted(() => {
queryByPage1()
getSchools()
})
</script>

View File

@ -15,19 +15,19 @@
label-width="300px"
>
<div class="grid md:gap-x-30">
<n-form-item label="选择学校(从下拉框选择)" path="schoolId">
<n-select
v-model:value="formValue.schoolId"
filterable
placeholder="搜索学校(输入学校名字)"
:options="schoolOptions"
@search="handleSearchSchool"
/>
</n-form-item>
<!-- <n-form-item label="选择学校(从下拉框选择)" path="schoolId">-->
<!-- <n-select-->
<!-- v-model:value="formValue.schoolId"-->
<!-- filterable-->
<!-- placeholder="搜索学校(输入学校名字)"-->
<!-- :options="schoolOptions"-->
<!-- @search="handleSearchSchool"-->
<!-- />-->
<!-- </n-form-item>-->
<n-form-item label="工号">
<n-input
v-model:value="formValue.no"
@blur="findExistUser"
@blur='findExistUser'
placeholder=""
></n-input>
</n-form-item>
@ -104,7 +104,7 @@ const options= ['teacher', 'assistant'].map((v) => ({
}))
const formRef = ref(null)
const formValue = ref({
schoolId: null,
// schoolId: null,
no: '',
account:'',
name: '',
@ -118,9 +118,9 @@ const formValue = ref({
answer: '',
})
const schoolOptions = ref([])
// const schoolOptions = ref([])
const formRules = {
schoolId: requiredRule('学校'),
// schoolId: requiredRule('学校'),
name: requiredRule('姓名'),
email: emailRule(false),
password: strictPasswordRule(),
@ -128,20 +128,20 @@ const formRules = {
question: requiredRule('问题'),
answer: requiredRule('答案'),
}
const handleSearchSchool = async (query) => {
const res = await api.getSchoolByschoolName({
name: query,
})
schoolOptions.value = res.data.map((item) => ({
label: item.name,
value: item.id + '',
}))
}
// const handleSearchSchool = async (query) => {
// const res = await api.getSchoolByschoolName({
// name: query,
// })
// schoolOptions.value = res.data.map((item) => ({
// label: item.name,
// value: item.id + '',
// }))
// }
const findExistUser = async () => {
const res = await api.findAdminuserByno({
no: formValue.value.no,
schoolId:formValue.value.schoolId
no: formValue.value.no
// schoolId:formValue.value.schoolId
})
if (res.data) {
const { account, name, email,no,question,answer} = res.data

View File

@ -1,22 +1,28 @@
<template>
<div flex-col gap-y-10 style="width: 30px">
<div flex>
<n-button type="info" size="small" @click="onEdit" style="--n-width: 60px;margin-left: 8px">
编辑
<n-button type="primary" size="small"
@click="onEdit"
style="--n-width: 80px;margin-left: 8px">
修改设置
</n-button>
<n-button type="info" size="small" @click="onDelete" style="--n-width: 60px;margin-left: 8px">
删除
<n-button type="primary" size="small"
@click="onReview"
style="--n-width:
60px;margin-left: 8px">
批阅
</n-button>
</div>
</div>
</template>
<script setup>
const emit = defineEmits(['clickDelete','clickEdit'])
const emit =
defineEmits(['clickDelete','clickReview'])
const onEdit = ()=>{
emit('clickEdit')
}
const onDelete = ()=>{
emit('clickDelete')
const onReview = ()=>{
emit('clickReview')
}
</script>

View File

@ -1,3 +1,339 @@
<template>
作业列表
</template>
<n-scrollbar x-scrollable style="max-height: 100vh">
<CommonPage show-footer>
<div style="margin-top: 0px">
<n-form ref="ProblemInfoRef"
:model="ProblemInfoValue"
:rules="rules"
label-placement="left"
size="small"
:label-width="60" >
<div style="display: flex">
<div v-if="userStore.getRole().length>0 && userStore.getRole().some((r)=>r==='admin')">
<div style="display: flex">
<n-form-item label="班级:"
path="name" Problem="flex-item">
<n-select
v-model:value="ProblemInfoValue.ProblemId"
:options="options1"
style="min-width: 80px;width: 140px"></n-select>
</n-form-item>
<n-form-item style="margin-left: 10px">
<n-button type="primary" @click="search" style="margin-left: 10px;margin-right: 20px">查询</n-button>
</n-form-item>
</div>
</div>
</div>
</n-form>
</div>
<n-data-table
remote
:single-line="false"
ref="table"
:columns="columns"
:data="ProblemList"
:loading="loading"
:pagination="paginationReactive"
:row-key="rowKey"
:scroll-x="900"
style="width: 1180px;--n-td-padding:0px 5px;"
@update:page="onChangePage"
@update:page-size="onUpdatePageSize"
/>
</CommonPage>
</n-scrollbar>
</template>
<script setup>
import {ref, reactive, onMounted, watch} from 'vue'
import api from '@/api/admin';
import ProblemActions from
'./components/ProblemActions.vue';
import {formatDateTime} from '@/utils';
import { useUserStore } from '@/store';
import { useRouter } from 'vue-router';
const rules=ref(null)
const userStore = useUserStore()
const router = useRouter()
const ProblemInfoRef = ref(null)
const loading = ref(true)
const ProblemList =
ref([{title:"C++班级",timeRange:"2025-02-17 20:00:00 - 2025-2-28 23:00:00",daipi:"50",yijiao:"60",weijiao:"20"}])
const options1=ref([])
const role=userStore.getRole()
const teacherId=ref()
const paginationReactive = reactive({
page: 1,
pageSize: 50,
showSizePicker: true,
pageSizes: [50, 100,150],
prefix ({ itemCount }) {
return `总共 ${itemCount} 条`
}
})
const ProblemInfoValue = ref({
pageNum:paginationReactive.page,
pageSize:paginationReactive.pageSize,
id:0,
teacherId:'',
});
const onAdd = ()=>{
router.push({name: 'AdminProblemAdd'})
}
const queryByPage1=async (value)=>{
if (userStore.getRole().some((r) => r === 'admin')) {
const res = await api.findAllAdminusersBySchoolId({
schoolId: value,
})
const transformedData = res.data.map((item) => ({
label: item.name,
value: item.id,
}))
transformedData.unshift({
label: '全部',
value: 0,
})
ProblemInfoValue.value.teacherId = 0
options1.value = transformedData
}
}
watch(()=>ProblemInfoValue.value.id,
(newVal)=>{
ProblemInfoValue.value.teacherId=''
options1.value=[]
queryByPage1(newVal)
})
let columns
if (role[0]=='admin'){
columns = [
{
key: 'title',
title: '作业标题',
width: '200',
},
{
key: 'timeRange',
title: '作答时间',
width: '300',
},
{
key: 'daipi',
title: '待批',
width: '60',
align:'center'
},
{
key: 'yijiao',
title: '已交',
width: '60',
align:'center'
},
{
key: 'weijiao',
title: '未交',
width: '60',
align:'center'
},
{
key: 'actions',
title: '操作',
width: '450',
render(row) {
return h(
ProblemActions,
{
onClickEdit: () => onEditProblem(row),
onClickReview: () =>
onReviewProblem(row),
}
);
}
}
]
}else {
columns = [
{
key: 'name',
title: '班级名称',
width: '260',
},
{
key: 'studentNum',
title: '学生数',
width: '80',
},
{
key: 'createTime',
title: '创建时间',
width: '190',
render: (row) => {
return row["createTime"]=formatDateTime(row["createTime"]);
}
},
{
key: 'inviteCode',
title: '邀请码',
width: '130',
},
{
key: 'actions',
title: '操作',
width: '450',
render(row) {
if(role[0]==='teacher'){
return h(
ProblemActions,
{
onClickStudent: () => onStudentProblem(row),
onClickAssistant: () => onAssistantProblem(row),
onClickEdit: () => onEditProblem(row),
onClickDelete: () => onDeleteProblem(row),
}
);
}
if(role[0]==='assistant'){
return h(
ProblemActions,
{
onClickStudent: () => onStudentProblem(row),
}
);
}
}
}
]
}
const queryByPage = async (currentPage)=>{
loading.value = true;
try {
ProblemInfoValue.value.pageSize=paginationReactive.pageSize
const res = await api.findAllProblemPage(
{
...ProblemInfoValue.value
}
);
console.log(res.data)
if (userStore.getRole().some((r) => r === 'admin')){
const res1=await api.findAllShoolsInAdminusers()
const list1=res1.data
const transformedDatas=list1.map(item => ({
label: item.name,
value: item.id,
}));
transformedDatas.unshift({
label: '全部',
value: 0,
});
options.value=transformedDatas;
}
const {pageNum, pageSize, total, list} = res.data
paginationReactive.page = pageNum
paginationReactive.pageSize = pageSize
paginationReactive.itemCount = total
ProblemList.value=list.map((item,i)=>{return item;})
} catch (err) {
} finally {
loading.value = false;
}
}
const onDeleteProblem = async (problemid)=>{
const {id} = problemid
try {
const res = await api.deleteProblem({id})
$message.success("删除成功")
if (!loading.value) {
await queryByPage()
}
}catch (err){
$message.error("删除失败")
}
}
const onStudentProblem = async (problemid)=>{
// const {id} = problemid
const id=1
await router.push({name: 'AdminProblemStudents', params: {clId: id}})
}
const onAssistantProblem = async (problemid)=>{
// const {id} = problemid
const id=1
await router.push({name: 'AdminProblemAssistant', params: {clId: id}})
}
const onEditProblem = async (problemid)=>{
const {id} = problemid
await router.push({name: 'AdminProblemEdit', params: {clId: id}})
}
const search=async ()=>{
loading.value=true
try {
if (userStore.getRole().some((r)=>r==='admin')){
const res=await api.findAllProblemPage({
...ProblemInfoValue.value
})
const { pageNum, pageSize, total, list } = res.data
paginationReactive.page = pageNum
paginationReactive.pageSize = pageSize
paginationReactive.itemCount = total
ProblemList.value=list.map((item,i)=>{return item;})
}
}catch (err){
}finally {
loading.value=false
}
}
const handleSearchSchool = async (query) => {
const res = await api.getSchoolByschoolName({
name: query,
})
options.value = res.data.map((item) => ({
label: item.name,
value: item.id,
}))
}
const rowProps = (row) => {
let style = "cursor: pointer;"
// 定义点击事件处理器
const onClick = () => {
window.open(`${import.meta.env.VITE_HOST}/#/user/contest/${examId}/problems/${row.id}`, '_blank')
}
return {
style,
onClick
}
}
const rowKey = (rowData) => {
return rowData.id
}
const onUpdatePageSize = (pageSize) => {
paginationReactive.pageSize = pageSize;
paginationReactive.page = 1;
if (!loading.value) {
queryByPage(1)
}
}
const onChangePage = (page) => {
paginationReactive.page = page;
ProblemInfoValue.value.pageNum=page
if (!loading.value) {
queryByPage(page)
}
}
onMounted(()=>{
queryByPage()
})
watch(
()=>router.currentRoute.value.fullPath,
()=>{
if
(router.currentRoute.value.fullPath==='/admin/problem/problem-list') {
queryByPage(paginationReactive.page)
}
}
)
</script>
<style>
</style>

View File

@ -0,0 +1,6 @@
<template>
作业库
</template>
<script setup>
</script>

View File

@ -42,7 +42,7 @@ export default {
{
name: 'AdminProblemList',
path: 'problem-list',
component: () => import('./problem/problem-list.vue'),
component: () => import('@/views/admin/problem/problem-list.vue'),
meta: {
title: '作业列表',
icon: 'eva:list-fill',
@ -54,7 +54,7 @@ export default {
{
name: 'AdminProblemAdd',
path: 'problem-add',
component: () => import('./problem/problem-add.vue'),
component: () => import('@/views/admin/problem/problem-add.vue'),
meta: {
title: '作业添加',
icon: 'ic:baseline-add',
@ -63,6 +63,18 @@ export default {
keepAlive: true,
},
},
{
name: 'AdminProblemStore',
path: 'problem-store',
component: () => import('@/views/admin/problem/problem-store.vue'),
meta: {
title: '作业库',
icon: 'ic:baseline-add',
role: ['admin', 'teacher'],
requireAuth: true,
keepAlive: true,
},
},
],
},
{
@ -112,6 +124,18 @@ export default {
requireAuth: true,
},
},
{
name: 'AdminClassManage',
path: 'view-classes-not-in-exam',
isHidden: true,
component: () => import('./course/view-classes-not-in-exam.vue'),
meta: {
title: '添加班级到考试',
role: ['admin', 'teacher', 'assistant'],
requireAuth: true,
keepAlive: true,
},
},
],
},
{

View File

@ -11,14 +11,14 @@
:show-require-mark="false">
<div>
<div class="grid md:flex md:flex-wrap md:gap-x-1">
<n-form-item label="学校:" class="flex-item" style="margin-left: -30px">
<n-select
v-model:value="studentInfoValue.schoolId"
:options="options"
filterable
placeholder=""
style="min-width: 140px"></n-select>
</n-form-item>
<!-- <n-form-item label="学校:" class="flex-item" style="margin-left: -30px">-->
<!-- <n-select-->
<!-- v-model:value="studentInfoValue.schoolId"-->
<!-- :options="options"-->
<!-- filterable-->
<!-- placeholder=""-->
<!-- style="min-width: 140px"></n-select>-->
<!-- </n-form-item>-->
<n-form-item label="学号:" path="name" class="flex-item">
<n-input v-model:value="studentInfoValue.studentNo"
placeholder=""
@ -67,7 +67,8 @@ const rules=ref(null)
const route = useRoute()
const options=ref([])
const loading = ref(true)
const studentList = ref([])
const studentList =
ref([{stId:1,studentNo:"211310509",chineseName:"张三",username:"zhangsan",banji:"计算机2101",email:"2286848422@qq.com"}])
const {clId} = route.params
const paginationReactive = reactive({
page: 1,
@ -209,7 +210,8 @@ const queryByPage = async (currentPage)=>{
}
}
const onPasswordClass = async (classId)=>{
const {id} = classId
// const {id} = classId
const id=1
if (classId.username==='请学生注册'){
$message.error("请先注册在进行此操作")
}else {
@ -217,7 +219,8 @@ const onPasswordClass = async (classId)=>{
}
}
const onEditClass = async (classId)=>{
const {id} = classId
// const {id} = classId
const id=1
await router.push({name: 'StudentEdits', params: {clId: id}, query: {id: clId}})
}
const onDeleteClass = async (classId)=>{

View File

@ -42,7 +42,8 @@ import TeacherListAction from "@/views/admin/teacher/components/teacher-list-act
const router = useRouter()
const options=ref([])
const loading = ref(true)
const teacherList = ref([])
const teacherList =
ref([{tcId:"1",account:"zzp",no:21313357,name:"教师1",role:"teacher",email:"zzp@163.com",status:true}])
const rules=ref(null)
const paginationReactive = reactive({
page: 1,
@ -78,11 +79,11 @@ const columns = [
width: '90',
align:'center',
},
{
key: 'schoolname',
title: '学校',
width: '90',
},
// {
// key: 'schoolname',
// title: '学校',
// width: '90',
// },
{
key: 'role',
title: '角色',
@ -173,7 +174,8 @@ const onAdd= async ()=>{
}
const onPasswordClass = async (classId)=>{
const {id} = classId
// const {id} = classId
const id=1
if (classId.username===null || classId.username===''){
$message.error("请先注册在进行此操作")
}else {
@ -181,7 +183,8 @@ const onPasswordClass = async (classId)=>{
}
}
const onEditClass = async (classId)=>{
const {id} = classId
// const {id} = classId
const id=1
await router.push({name: 'TeacherEdit', params: {clId: id}})
}
const onDeleteClass = async (classId)=>{

View File

@ -15,6 +15,13 @@ export default defineConfig(({ command, mode }) => {
return {
base: VITE_PUBLIC_PATH || '/',
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler'
}
}
},
resolve: {
alias: {
'~': rootPath,

View File

@ -14,6 +14,7 @@
<spring-boot.version>2.6.13</spring-boot.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-redis</artifactId>
@ -24,6 +25,11 @@
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.2</version> <!-- 使用适当的版本
-->
</dependency><dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.2.2</version>

View File

@ -1,4 +0,0 @@
package com.example.aes.report.model;
public class Classes {
}

View File

@ -44,8 +44,8 @@ public class AccountController {
Adminusers adminusers = accountDao.getAdminUserByID(Integer.parseInt(userId));
map.put("name",adminusers.getName());
map.put("username",adminusers.getAccount());
String schoolId= String.valueOf(adminusers.getSchoolId());
map.put("schoolId",schoolId);
// String schoolId= String.valueOf(adminusers.getSchoolId());
// map.put("schoolId",schoolId);
}
// 判断proxyRole是否存在

View File

@ -35,6 +35,70 @@ public class AdminusersController {
}
return RespBean.error("不具备权限");
}
// @PostMapping("/signTeacher")
// public RespBean signTeacher(@RequestBody PMAdminusers pmadminusers) // 注册教师
// {
// pmadminusers.setSessionId(pmadminusers.getSessionId().substring(64));
// // 设置statu为未审核
// pmadminusers.setStatus("待审核");
// /*
// * UUID uuid = UUID.randomUUID();
// * pmadminusers.setUuid(uuid.toString().replaceAll("\\-", ""));
// */
// PMAdminusers pma = adminusersServiceI
// .getAdminuserByAccount(pmadminusers.getAccount());
// if (pma != null) {
// if (pma.getQuestion().equals("") || pma.getQuestion().equals(null)) {
// boolean result = adminusersServiceI
// .updateQueAndAnsByaccount(pma);
// if (result == true) {
// return RespBean.ok("申请注册教师成功,请注意查收激活邮件!");
// } else {
// return RespBean.error("注册教师失败");
// }
// } else {
// return RespBean.error("用户名重复,请修改用户名");
// }
//
// } else {
// boolean result = adminusersServiceI.addTeacher(pmadminusers);
// if (result == true) {
// return RespBean.ok("注册教师成功");
// } else {
// return RespBean.error("注册教师失败");
// }
/*
* try {
*
* SendMail mail = new SendMail(); // 收信人 String[] list =
* {pmadminusers.getEmail()}; //mail.setMailTo(list, "cc");
* mail.setMailTo(list, "to"); // 发信人
* mail.setMailFrom("dhuoj_noreply@163.com"); //
* mail.setMailFrom("duzhen"); // 邮件主题
* mail.setSubject("OJ系统教师注册激活邮件"); // 邮件发送时间 mail.setSendDate(new
* Date()); // html格式邮件 // 邮件内容 String context = "<html>" + "<body>"
* +
* "您的OJ系统账号已创建,如果这是您在进行的操作,请点击链接(如果点击无效,请复制以下链接并在浏览器中打开)激活账号:<br>"
* +
* "<a href='http://218.193.156.209:8080/oj/admin/activeTeacher.jsp?account="
* +pmadminusers.getAccount()+"&uuid="+pmadminusers.getUuid()+
* "'>http://218.193.156.209:8080/oj/admin/activeTeacher.jsp?account="
* +pmadminusers.getAccount()+"&uuid="+pmadminusers.getUuid()+"</a>"
* + "</body>" + "</html>"; mail.addHtmlContext(context); // txt格式邮件
* // mail.addTextContext(""); mail.send();
* System.out.println("send success"); boolean
* result=adminusersServiceI.addTeacher(pmadminusers);
* if(result==true){ logger.info("注册教师成功"); j.setSuccess(true);
* j.setMsg("申请注册教师成功,请注意查收激活邮件!"); super.writeJson(j); }else{
* logger.info("注册教师失败"); j.setSuccess(false); j.setMsg("注册教师失败");
* super.writeJson(j); }
*
* } catch (Exception e) { e.printStackTrace();
* logger.info("注册教师邮件发送失败,请联系管理员11249242@qq.com");
* j.setSuccess(false);
* j.setMsg("注册教师邮件发送失败,请联系管理员11249242@qq.com"); super.writeJson(j);
* }
*/
}
}

View File

@ -177,7 +177,7 @@ public class UserController {
public RespBean findUserByStudentNoSchoolId(@RequestBody Users user, HttpServletRequest request) // 根据学号学校Id获取学生的信息
{
String studentNo = user.getStudentNo();
int schoolId = user.getSchoolId();
// int schoolId = user.getSchoolId();
DecodeToken decodeToken = null;
try {
decodeToken = new DecodeToken(request);
@ -189,7 +189,7 @@ public class UserController {
if (role.equals("student") && !decodeToken.getStudentNo().equals(studentNo)) {
return RespBean.error("请尝试安全操作");
}
user = userService.findUserByStudentNoSchoolId(studentNo, schoolId); // 用户信息
user = userService.findUserByStudentNoSchoolId(studentNo); // 用户信息
if (user != null) {
return RespBean.ok("获取学生信息成功", user);
} else {
@ -318,7 +318,7 @@ public class UserController {
Users pmuser = userService.findStudentByusername(user.getUsername());
if (pmuser == null) {
Users u = userService.findUserByStudentNoSchoolId(user.getStudentNo(), user.getSchoolId()); // 用户信息
Users u = userService.findUserByStudentNoSchoolId(user.getStudentNo()); // 用户信息
if (u != null) {
if (StringUtils.isBlank(u.getUsername())) {
user.setSessionId(user.getSessionId().substring(64));
@ -362,7 +362,7 @@ public class UserController {
pmUser.setSolved(users.getSolved());
pmUser.setSubmit(users.getSubmit());
pmUser.setMessageCondition(users.getMessageCondition());
pmUser.setSchoolId(users.getSchoolId());
// pmUser.setSchoolId(users.getSchoolId());
pmUser.setUuid(users.getUuid());
pmUser.setQuestion(users.getQuestion());
pmUser.setAnswer(users.getAnswer());

View File

@ -277,9 +277,10 @@ public class UserDaoImpl extends BaseDaoImpl<Users> implements UserDaoI {
@Override
public int updateUser(Users user) {
String hql = "update Users set username=:username, password=:password, studentNo=:studentNo," +
" chineseName=:chineseName, banji=:banji, createDate=:createDate, Email=:Email," +
" chineseName=:chineseName, " +
"banji=:banji, createDate=:createDate, email=:Email," +
" solved=:solved, submit=:submit, answer=:answer, messageCondition=:messageCondition," +
" question=:question, uuid=:uuid, schoolId=:schoolId, pwd=:pwd where id=:id";
" question=:question, uuid=:uuid, pwd=:pwd where id=:id";
Query q = this.getCurrentSession().createQuery(hql);
q.setParameter("username", user.getUsername());
q.setParameter("password", user.getPassword());
@ -294,7 +295,7 @@ public class UserDaoImpl extends BaseDaoImpl<Users> implements UserDaoI {
q.setParameter("messageCondition", user.getMessageCondition());
q.setParameter("question", user.getQuestion());
q.setParameter("uuid", user.getUuid());
q.setParameter("schoolId", user.getSchoolId());
// q.setParameter("schoolId", user.getSchoolId());
q.setParameter("pwd", user.getPwd());
q.setParameter("id", user.getId());

View File

@ -16,7 +16,7 @@ public class Adminusers implements java.io.Serializable {
// Fields
private Integer id;
private Integer schoolId;
// private Integer schoolId;
private String account;
private String password;
private String name;
@ -38,25 +38,25 @@ public class Adminusers implements java.io.Serializable {
/** minimal constructor */
public Adminusers(String account, String password, String name,
String role, String email, Integer schoolId) {
String role, String email) {
this.account = account;
this.password = password;
this.name = name;
this.role = role;
this.email = email;
this.schoolId = schoolId;
// this.schoolId = schoolId;
}
/** full constructor */
public Adminusers(String account, String password, String name,
String role, String email, Integer schoolId, Integer active,
String role, String email, Integer active,
String uuid, String question, String answer) {
this.account = account;
this.password = password;
this.name = name;
this.role = role;
this.email = email;
this.schoolId = schoolId;
// this.schoolId = schoolId;
this.active = active;
this.uuid = uuid;
this.question = question;
@ -120,14 +120,14 @@ public class Adminusers implements java.io.Serializable {
this.email = email;
}
@Column(name = "schoolId", nullable = false, length = 11)
public Integer getSchoolId() {
return schoolId;
}
public void setSchoolId(Integer schoolId) {
this.schoolId = schoolId;
}
// @Column(name = "schoolId", nullable = false, length = 11)
// public Integer getSchoolId() {
// return schoolId;
// }
//
// public void setSchoolId(Integer schoolId) {
// this.schoolId = schoolId;
// }
@Column(name = "active", nullable = false, length = 1)
public Integer getActive() {

View File

@ -27,7 +27,7 @@ public class Users implements java.io.Serializable {
private Integer solved;
private Integer submit;
private String messageCondition;
private Integer schoolId;
// private Integer schoolId;
private String uuid;
private String question;
private String answer;
@ -51,7 +51,7 @@ public class Users implements java.io.Serializable {
public Users(String username, String password, String studentNo,
String chineseName, String banji, Date createDate, String email,
Integer solved, Integer submit, String messageCondition,
Integer schoolId, String uuid, String question, String answer, String pwd) {
String uuid, String question, String answer, String pwd) {
this.username = username;
this.password = password;
this.studentNo = studentNo;
@ -62,7 +62,7 @@ public class Users implements java.io.Serializable {
this.solved = solved;
this.submit = submit;
this.messageCondition = messageCondition;
this.schoolId = schoolId;
// this.schoolId = schoolId;
this.uuid = uuid;
this.question = question;
this.answer = answer;
@ -99,14 +99,14 @@ public class Users implements java.io.Serializable {
this.password = password;
}
@Column(name = "schoolId", unique = true, nullable = false)
public Integer getSchoolId() {
return this.schoolId;
}
public void setSchoolId(Integer schoolId) {
this.schoolId = schoolId;
}
// @Column(name = "schoolId", unique = true, nullable = false)
// public Integer getSchoolId() {
// return this.schoolId;
// }
//
// public void setSchoolId(Integer schoolId) {
// this.schoolId = schoolId;
// }
// 这里根据学号来索引用户,
@Column(name = "studentNo", unique = true, nullable = false, length = 20)

View File

@ -55,7 +55,7 @@ public interface UserServiceI {
public List<PMUser> findStudentsByCondition(String studentNo,
String chineseName, String stu_userName);
public Users findUserByStudentNoSchoolId(String studentNo, int schoolId);
public Users findUserByStudentNoSchoolId(String studentNo);
public boolean updateSignStudent(PMUser user);// 修改学生注册信息

View File

@ -175,8 +175,8 @@ public class UserServiceImpl implements UserServiceI {
Users theUser = userDao.get(Users.class, user.getId());
theUser.setPassword(user.getSessionId());
theUser.setPwd(user.getPassword());
if (theUser.getSchoolId() == null)
theUser.setSchoolId(1);
// if (theUser.getSchoolId() == null)
// theUser.setSchoolId(1);
userDao.save(theUser);
return true;
} else {
@ -230,7 +230,7 @@ public class UserServiceImpl implements UserServiceI {
u.setStudentNo(studentNo);
u.setCreateDate(createDate);
u.setBanji(banji);
u.setSchoolId(schoolId);
// u.setSchoolId(schoolId);
u.setUsername("");
u.setPassword("");
userDao.save(u);
@ -374,11 +374,11 @@ public class UserServiceImpl implements UserServiceI {
}
@Override
public Users findUserByStudentNoSchoolId(String studentNo, int schoolId) {
public Users findUserByStudentNoSchoolId(String studentNo) {
// TODO Auto-generated method stub
// TODO Auto-generated method stub
String hql = "from Users where studentNo='" + studentNo
+ "' and schoolId='" + schoolId + "'";
+ "' and schoolId='" ;
Users user = userDao.get(hql);
if (user != null) {
return user;
@ -416,7 +416,7 @@ public class UserServiceImpl implements UserServiceI {
// TODO Auto-generated method stub
String hql = "update Users set banji='" + user.getBanji()
+ "'where studentNo='" + user.getStudentNo()
+ "' and schoolId='" + user.getSchoolId() + "'";
+ "' and schoolId='" ;
int result = userDao.executeHql(hql);
if (result == 1)
return true;
@ -444,7 +444,7 @@ public class UserServiceImpl implements UserServiceI {
u.setPassword(password);
u.setPwd(pwd);
u.setChineseName(chineseName);
u.setSchoolId(schoolId);
// u.setSchoolId(schoolId);
u.setStudentNo(studentNo);
u.setCreateDate(createDate);
u.setBanji(banji);

View File

@ -1,3 +0,0 @@
Manifest-Version: 1.0
Main-Class: edu.dhu.Oj2Application