|
|
@@ -24,6 +24,9 @@
|
|
|
<el-button @click="Refresh">
|
|
|
<img src="@/assets/icon/refresh_default.png" />刷新
|
|
|
</el-button>
|
|
|
+ <el-button @click="OpenSetting()">
|
|
|
+ <img src="@/assets/icon/scan_set_icon.png" />系统设置
|
|
|
+ </el-button>
|
|
|
<el-button type="primary" @click="OpenAddExam" >
|
|
|
<img src="@/assets/icon/add_icon.webp" />新增考试
|
|
|
</el-button>
|
|
|
@@ -75,6 +78,54 @@
|
|
|
/>
|
|
|
</div>
|
|
|
<AddExam ref="addExamRef" :editData="currentEditItem" v-model="showAddExam" @success="HandleSuccess" />
|
|
|
+ <div class="page_dialog">
|
|
|
+ <el-dialog
|
|
|
+ title="系统设置"
|
|
|
+ v-model="showSetting"
|
|
|
+ center
|
|
|
+ class="page_dialog"
|
|
|
+ width="480px"
|
|
|
+ >
|
|
|
+ <div class="dialog_center">
|
|
|
+ <el-form
|
|
|
+
|
|
|
+ ref="addStudentFormRef"
|
|
|
+
|
|
|
+ label-width="220px"
|
|
|
+ >
|
|
|
+
|
|
|
+ <el-form-item label="是否忽略未扫描:" >
|
|
|
+ <el-switch
|
|
|
+ v-model="isNoScan"
|
|
|
+ inline-prompt
|
|
|
+ active-text="是"
|
|
|
+ inactive-text="否"
|
|
|
+ @change="EnterSetting('SCANNED_VALIDATE_FLAG')"
|
|
|
+ />
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="是否忽略客观题异常:" prop="studentCode">
|
|
|
+ <el-switch
|
|
|
+ v-model="isObjectiveError"
|
|
|
+ inline-prompt
|
|
|
+ active-text="是"
|
|
|
+ inactive-text="否"
|
|
|
+ @change="EnterSetting('OBJECTIVE_VALIDATE_FLAG')"
|
|
|
+ />
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <!-- <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="showSetting = false">取 消</el-button>
|
|
|
+ <el-button type="primary" :loading="loadingSubmit"
|
|
|
+ >确 定</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ </template> -->
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -82,7 +133,7 @@
|
|
|
import { ref, reactive,onMounted } from 'vue'
|
|
|
import FiltersItem from '@/components/FiltersItem.vue';
|
|
|
import AddExam from '@/components/AddExam.vue' // 注意路径可能需要调整
|
|
|
-import { getHeadData,getExamList ,deleteExam} from '@/api/exam'
|
|
|
+import { getHeadData,getExamList ,deleteExam,getSchoolSetting,updataSchoolSetting} from '@/api/exam'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
import { getCourseBgColor } from '@/utils/common'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
@@ -92,6 +143,11 @@ const examStore = useExamStore()
|
|
|
const analysisStore = useAnalysisStore()
|
|
|
const router = useRouter()
|
|
|
const showAddExam = ref(false)
|
|
|
+const showSetting = ref(false)//设置
|
|
|
+const isNoScan = ref(true) // 是否校验未扫描
|
|
|
+const isObjectiveError = ref(true) // 是否校验客观题异常
|
|
|
+const loadingSubmit = ref(false)//提交加载中
|
|
|
+
|
|
|
// 新增:用于存储当前编辑的数据,null 表示新增模式
|
|
|
const currentEditItem = ref<any>(null)
|
|
|
|
|
|
@@ -265,6 +321,44 @@ const HandleSuccess = () => {
|
|
|
GoSearch();
|
|
|
}
|
|
|
|
|
|
+//打开系统设置
|
|
|
+const OpenSetting=()=>{
|
|
|
+ showSetting.value=true;
|
|
|
+}
|
|
|
+
|
|
|
+//获取设置
|
|
|
+const GetSetting = async () => {
|
|
|
+
|
|
|
+ const res = await getSchoolSetting();
|
|
|
+ console.log('打印设置数据', res)
|
|
|
+ if(res.code==200)
|
|
|
+ {
|
|
|
+ isNoScan.value = res.data.SCANNED_VALIDATE_FLAG =='0'?true:false;
|
|
|
+ isObjectiveError.value = res.data.OBJECTIVE_VALIDATE_FLAG =='0'?true:false;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+//提交设置
|
|
|
+const EnterSetting=(type:string)=>{
|
|
|
+ console.log('提交设置')
|
|
|
+ let value = type === 'SCANNED_VALIDATE_FLAG' ? isNoScan.value : isObjectiveError.value;
|
|
|
+
|
|
|
+ updataSchoolSetting({
|
|
|
+ settingType: type,
|
|
|
+ settingValue: value ? '0' : '1'//0 忽略 1 不忽略
|
|
|
+ }).then(res=>{
|
|
|
+ console.log('提交设置结果', res)
|
|
|
+ if (res.code == 200) {
|
|
|
+ ElMessage.success('设置成功!')
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
//新增考试
|
|
|
const OpenAddExam = () => {
|
|
|
showAddExam.value = true
|
|
|
@@ -323,8 +417,9 @@ const GotoExam=(item:any) => {
|
|
|
|
|
|
// 组件挂载时获取初始数据
|
|
|
onMounted(() => {
|
|
|
- GetHeadData()
|
|
|
- GoSearch()
|
|
|
+ GetSetting();//获取设置
|
|
|
+ GetHeadData();//获取头部筛选数据
|
|
|
+ GoSearch();//获取列表数据
|
|
|
})
|
|
|
</script>
|
|
|
|