|
@@ -170,7 +170,7 @@ import ChooseTemplate from './components/chooseTemplate.vue';
|
|
|
import EditorQuestion from './components/EditorQuestion.vue';
|
|
import EditorQuestion from './components/EditorQuestion.vue';
|
|
|
|
|
|
|
|
import { ElMessageBox,ElMessage } from 'element-plus'
|
|
import { ElMessageBox,ElMessage } from 'element-plus'
|
|
|
-import { getSmartQuestionList,getTemplateInfo,setQuestion,saveQuestion,deleteAllQuestion,deleteSingleQuestion} from '@/api/exam'
|
|
|
|
|
|
|
+import { getSmartQuestionList,getTemplateInfo,setQuestion,saveQuestion,deleteAllQuestion,deleteSingleQuestion,getExamProcess} from '@/api/exam'
|
|
|
import scanCommon from '@/utils/scanCommon.ts'
|
|
import scanCommon from '@/utils/scanCommon.ts'
|
|
|
import { useThrottleFn } from '@vueuse/core';
|
|
import { useThrottleFn } from '@vueuse/core';
|
|
|
|
|
|
|
@@ -339,6 +339,11 @@ const MultiClick=(answer:any,item:any)=>{
|
|
|
|
|
|
|
|
//删除全部 需要二次弹窗确认提示
|
|
//删除全部 需要二次弹窗确认提示
|
|
|
const DeleteAll=()=>{
|
|
const DeleteAll=()=>{
|
|
|
|
|
+ if(tableData.value.length==0)
|
|
|
|
|
+ {
|
|
|
|
|
+ ElMessage.error("您还没有添加题目哦!")
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
console.log("打印删除全部")
|
|
console.log("打印删除全部")
|
|
|
ElMessageBox.confirm('确认删除所有题目吗?', '提示', {
|
|
ElMessageBox.confirm('确认删除所有题目吗?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
@@ -354,7 +359,8 @@ const DeleteAll=()=>{
|
|
|
if(res.code == 200)
|
|
if(res.code == 200)
|
|
|
{
|
|
{
|
|
|
ElMessage.success("删除成功!")
|
|
ElMessage.success("删除成功!")
|
|
|
- GetSmartQuestionList();
|
|
|
|
|
|
|
+ GetExamStatus();//获取考试状态
|
|
|
|
|
+ // GetSmartQuestionList();
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -366,6 +372,12 @@ const DeleteAll=()=>{
|
|
|
//确定完成
|
|
//确定完成
|
|
|
const FinishQuestion=async ()=>{
|
|
const FinishQuestion=async ()=>{
|
|
|
console.log("打印完成")
|
|
console.log("打印完成")
|
|
|
|
|
+
|
|
|
|
|
+ if(tableData.value.length==0)
|
|
|
|
|
+ {
|
|
|
|
|
+ ElMessage.error("请添加题目!")
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
ElMessageBox.confirm('确认完成吗?', '提示', {
|
|
ElMessageBox.confirm('确认完成吗?', '提示', {
|
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
cancelButtonText: '取消',
|
|
@@ -378,7 +390,8 @@ const FinishQuestion=async ()=>{
|
|
|
if(res.code == 200)
|
|
if(res.code == 200)
|
|
|
{
|
|
{
|
|
|
ElMessage.success("保存成功!")
|
|
ElMessage.success("保存成功!")
|
|
|
- GetSmartQuestionList();
|
|
|
|
|
|
|
+
|
|
|
|
|
+ GetExamStatus();//获取考试状态
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|
|
@@ -387,6 +400,32 @@ const FinishQuestion=async ()=>{
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+//获取考试状态
|
|
|
|
|
+const GetExamStatus=async ()=>{
|
|
|
|
|
+ const param = {
|
|
|
|
|
+ examSubjectId:examSubjectId.value
|
|
|
|
|
+ }
|
|
|
|
|
+ getExamProcess(param).then((res: any) => {
|
|
|
|
|
+ console.log('打印考试流程状态返回', res)
|
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
|
+ const newStateStr = res.data;
|
|
|
|
|
+ console.log('打印考试流程状态', newStateStr)
|
|
|
|
|
+ // 替换为 Store Commit/Action
|
|
|
|
|
+ examStore.setExamState(newStateStr);//设置状态数据
|
|
|
|
|
+ if(newStateStr.includes(1))
|
|
|
|
|
+ {
|
|
|
|
|
+
|
|
|
|
|
+ router.push('/exam/scanList')
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ {
|
|
|
|
|
+ //未完成 不跳转
|
|
|
|
|
+ GetSmartQuestionList();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
//确定编辑
|
|
//确定编辑
|
|
|
const EditorAnswerEnter=async (item:any)=>{
|
|
const EditorAnswerEnter=async (item:any)=>{
|
|
|
console.log("打印确定编辑",item)
|
|
console.log("打印确定编辑",item)
|
|
@@ -438,6 +477,9 @@ const EditorSingle=(item:any)=>{
|
|
|
}
|
|
}
|
|
|
// 打开扫描仪器
|
|
// 打开扫描仪器
|
|
|
const GotoScan = useThrottleFn(() => {
|
|
const GotoScan = useThrottleFn(() => {
|
|
|
|
|
+
|
|
|
|
|
+ ElMessage.warning("暂未开放,敬请期待!")
|
|
|
|
|
+ return;
|
|
|
// showSelectType.value = 'scan';
|
|
// showSelectType.value = 'scan';
|
|
|
console.log("打印打开扫描仪器",scanCommon.isClientConnected())
|
|
console.log("打印打开扫描仪器",scanCommon.isClientConnected())
|
|
|
if (!scanClientConnected.value) {
|
|
if (!scanClientConnected.value) {
|