Compare commits

..

No commits in common. "2b5b365e2f61f02c17ace36c35bd99ae69dd0968" and "c33c0d923e87752dfbf97d04c78fcb6205b8ac0b" have entirely different histories.

5 changed files with 93 additions and 145 deletions

View File

@ -83,7 +83,7 @@ export const constantRoutes = [
path: 'questionUpload',
component: () => import('@/views/classTask/newClassTaskAssign/questionUpload/index.vue'),
name: 'questionUpload',
meta: { title: '习题上传', showBread: true }
meta: { title: '习题上传' }
},
{
path: 'aiKolors',

View File

@ -5,7 +5,6 @@ import { JYApiListCT, JYApiListOriginYear, JYApiListSO} from "@/utils/examQuesti
const useClassTaskStore = defineStore('classTask',{
state: () => ({
isOpenQuestUploadView: false, // 是否打开习题上传的页面
classListIds: [],
entpCourseWorkTypeList: [
{value: 0, label: "不限"},

View File

@ -149,14 +149,10 @@ import { useGetHomework } from '@/hooks/useGetHomework'
import { sessionStore } from '@/utils/store'
import { useRouter, useRoute } from 'vue-router'
import useUserStore from '@/store/modules/user'
import useClassTaskStore from '@/store/modules/classTask'
const userStore = useUserStore().user
const route = useRoute();
const router = useRouter()
const { proxy } = getCurrentInstance()
const useClassTaskStores = useClassTaskStore();
const props = defineProps({
currentCourse: Object,
})
@ -193,7 +189,6 @@ const boardLoading = ref(false);
const fileLoading = ref(false); // loading
onMounted(() => {
console.log("----onMounted-------")
currentRow.value = {id:0};
if(propsQueryCourseObj){
if(JSON.parse(propsQueryCourseObj)){
@ -221,28 +216,7 @@ onMounted(() => {
}
}
initHomeWork();
isInToMyQuestion(); //
})
//
const isInToMyQuestion = () => {
console.log('isOpenQuestUploadView',useClassTaskStores.isOpenQuestUploadView);
if(useClassTaskStores.isOpenQuestUploadView){
useClassTaskStores.isOpenQuestUploadView = false;
currentRow.value = {id:1}; //
activeAptTab.value = "个人题库";
//
classWorkForm.id = 0;
classWorkForm.uniquekey = ""; //
classWorkForm.worktype = "习题训练"; //
classWorkForm.title = ""; //
classWorkForm.quizlist = []; //
classWorkForm.chooseWorkLists = []; // list
classWorkForm.fileHomeworkList = []; //
classWorkForm.whiteboardObj = ""; // -
classWorkForm.question = ""; // -
}
}
watch(() => props.currentCourse, (newVal, oldVal) => {
if(newVal){
courseObj.textbookId = newVal.textbookId //

View File

@ -74,7 +74,7 @@
<script setup>
import "vue-cropper/dist/index.css";
import { VueCropper } from "vue-cropper";
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick, onUnmounted } from 'vue'
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue'
import { ElMessage } from 'element-plus'
import { cloneDeep } from 'lodash'
@ -88,8 +88,6 @@ import { useRouter, useRoute } from 'vue-router'
import { ocrImg2ExamByManualUpl, ocrImg2ItemByManualUpl } from "@/views/classTask/newClassTaskAssign/questionUpload/ocrImg2ExamQues";
import QuesItem from "@/views/classTask/newClassTaskAssign/questionUpload/quesItem/index.vue";
import useClassTaskStore from '@/store/modules/classTask'
// const Remote = require('@electron/remote')
// const fs = require('fs');
@ -98,9 +96,7 @@ import useUserStore from '@/store/modules/user'
const userStore = useUserStore().user
const route = useRoute();
const router = useRouter()
const { proxy } = getCurrentInstance();
const useClassTaskStores = useClassTaskStore();
const { proxy } = getCurrentInstance()
const props = defineProps({
})
@ -155,7 +151,6 @@ const cropOption = reactive({
onMounted(() => {
useClassTaskStores.isOpenQuestUploadView = true; //
console.log('propsQueryCourseObj', JSON.parse(propsQueryCourseObj));
if(propsQueryCourseObj&&JSON.parse(propsQueryCourseObj)){
courseObj.textbookId = JSON.parse(propsQueryCourseObj).bookObj //
@ -166,13 +161,7 @@ onMounted(() => {
}
initHomeWork();
})
onUnmounted(()=>{
// 1s isOpenQuestUploadView
setTimeout(()=>{
useClassTaskStores.isOpenQuestUploadView = false; //
console.log('onUnmounted 习题上传');
}, 1000)
})
/**
* 获取 entpcourseid 获取作业列表

View File

@ -1,7 +1,6 @@
import { ElMessageBox, ElMessage } from "element-plus";
import qs from "qs";
import axios from 'axios'
import request from '@/utils/request'
import { pyOCRAPI } from "@/api/education/entpcoursework";
@ -17,13 +16,6 @@ const baidubceConfig = {
'client_secret': 'oWb0M0YWMmZPMQIhIUkJX99ddr7h61qf',
};
export function getOcrContent(data) {
return request({
url: '/ocr/exam',
method: 'post',
data: data
})
}
/**
@ -234,36 +226,30 @@ const ocrImg2Json = async (urlBase64) => {
ElMessage.error("未检测到截图图片, 请截取图片后再识别");
return null;
}
let base64Code = urlBase64.split(",")[1];
const resOcr = await getOcrContent({ base64Code: base64Code });
if (resOcr.code !== 200) {
ElMessage.error("图片识别错误");
const resToken = await bdyAPI_getToken();
if (resToken.status !== 200) {
ElMessage.error("百度智能云用户标识有误");
return null;
}
// const resToken = await bdyAPI_getToken();
// if (resToken.status !== 200) {
// ElMessage.error("百度智能云用户标识有误");
// return null;
// }
// const token = resToken.data?.access_token;
// let base64Code = urlBase64.split(",")[1];
// const query = {
// image: base64Code, //图片地址(base64)
// line_probability: false, //是否返回每行识别结果的置信度。默认为false
// disp_line_poly: false, //是否返回每行的四角点坐标。默认为false
// words_type: 'handprint_mix', //文字类型。 默认:印刷文字识别 = handwring_only手写文字识别 = handprint_mix 手写印刷混排识别
// layout_analysis: false, //是否分析文档版面包括layout图、表、标题、段落、目录attribute栏、页眉、页脚、页码、脚注的分析输出
// recg_long_division: false, //是否检测并识别手写竖式
// recg_formula: true, //控制是否检测并识别公式默认为false
// }
const token = resToken.data?.access_token;
let base64Code = urlBase64.split(",")[1];
const query = {
image: base64Code, //图片地址(base64)
line_probability: false, //是否返回每行识别结果的置信度。默认为false
disp_line_poly: false, //是否返回每行的四角点坐标。默认为false
words_type: 'handprint_mix', //文字类型。 默认:印刷文字识别 = handwring_only手写文字识别 = handprint_mix 手写印刷混排识别
layout_analysis: false, //是否分析文档版面包括layout图、表、标题、段落、目录attribute栏、页眉、页脚、页码、脚注的分析输出
recg_long_division: false, //是否检测并识别手写竖式
recg_formula: true, //控制是否检测并识别公式默认为false
}
// const resOcr = await bdyAPI_getOcrContent(token, base64Code, query);
// if (resOcr.status !== 200) {
// ElMessage.error("百度智能云图片识别错误");
// return null;
// }
const resOcr = await bdyAPI_getOcrContent(token, base64Code, query);
if (resOcr.status !== 200) {
ElMessage.error("百度智能云图片识别错误");
return null;
}
return resOcr;
}