习题上传:待完善
This commit is contained in:
parent
fcc881a2fa
commit
761f19cf22
|
@ -0,0 +1,65 @@
|
|||
|
||||
import request from '@/utils/request'
|
||||
// 查询知识点列表
|
||||
export function listKnowlegepoint(query) {
|
||||
return request({
|
||||
url: '/point/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 查询一级知识点查下级所有层级
|
||||
export function childKnowlegepoint(query) {
|
||||
return request({
|
||||
url: '/point/child/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 新增
|
||||
export function addKnowlegepoint(data) {
|
||||
return request({
|
||||
url: '/point/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新
|
||||
export function updateKnowlegepoint(data) {
|
||||
return request({
|
||||
url: '/point/update',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 绑定
|
||||
export function bindKnowlegepoint(data) {
|
||||
return request({
|
||||
url: '/point/evalution/bind',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询章节知识点关系
|
||||
export function getBindlist(query) {
|
||||
return request({
|
||||
url: '/point/bind/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 删除
|
||||
export function delKnowlegepoint(data) {
|
||||
return request({
|
||||
url: '/point/bind/delete',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
|
@ -55,7 +55,18 @@
|
|||
</div>
|
||||
|
||||
<div class="page-right">
|
||||
|
||||
<QuesItem ref="refquesItem"
|
||||
:activeVersion="activeParams.version"
|
||||
:activeLession="activeParams.lession"
|
||||
:evalidArr="activeParams.evalidArr"
|
||||
:curLessionList="curLessionList"
|
||||
:isCropper="true"
|
||||
@submit-exam-single-callback="onSubmitExamSingleCallback"
|
||||
@cancel-exam-single-callback="onCancelExamSingleCallback"
|
||||
@cropper-exam-form-item="cropperExamFormItem"
|
||||
:style="{'height':'100%', 'overflow': 'auto', 'padding-top': '10px'}"
|
||||
>
|
||||
</QuesItem>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -72,14 +83,28 @@ import { editListItem } from '@/hooks/useClassTask'
|
|||
import { useGetHomework } from '@/hooks/useGetHomework'
|
||||
import { sessionStore } from '@/utils/store'
|
||||
import { useRouter, useRoute } from 'vue-router'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
|
||||
import { ocrImg2ExamByManualUpl, ocrImg2ItemByManualUpl } from "@/views/classTask/newClassTaskAssign/questionUpload/ocrImg2ExamQues";
|
||||
import QuesItem from "@/views/classTask/newClassTaskAssign/questionUpload/quesItem/index.vue";
|
||||
|
||||
// const Remote = require('@electron/remote')
|
||||
// const fs = require('fs');
|
||||
// const path = require('path');
|
||||
import useUserStore from '@/store/modules/user'
|
||||
const userStore = useUserStore().user
|
||||
const route = useRoute();
|
||||
const { proxy } = getCurrentInstance()
|
||||
const props = defineProps({
|
||||
})
|
||||
const activeParams = reactive({
|
||||
version: {},
|
||||
lession: {},
|
||||
tab: '国家体系',
|
||||
evalidArr: [],//选择的课程id数组
|
||||
versionList: [],//教材版本list
|
||||
lessionList: [],//课文list
|
||||
});
|
||||
|
||||
const propsQueryCourseObj = route.query.courseObj;//作业布置的内容对象
|
||||
const courseObj = reactive({
|
||||
|
@ -120,6 +145,7 @@ const cropOption = reactive({
|
|||
})
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
console.log('propsQueryCourseObj', JSON.parse(propsQueryCourseObj));
|
||||
if(propsQueryCourseObj&&JSON.parse(propsQueryCourseObj)){
|
||||
|
@ -146,7 +172,22 @@ const initHomeWork = async()=> {
|
|||
// taskList.value = res;
|
||||
// tasklist_loading.value = false;
|
||||
}
|
||||
|
||||
const getBase64 = (file) =>{
|
||||
return new Promise(function (resolve, reject) {
|
||||
let reader = new FileReader();
|
||||
let imgResult = "";
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = function () {
|
||||
imgResult = reader.result;
|
||||
};
|
||||
reader.onerror = function (error) {
|
||||
reject(error);
|
||||
};
|
||||
reader.onloadend = function () {
|
||||
resolve(imgResult);
|
||||
};
|
||||
});
|
||||
}
|
||||
/**
|
||||
* @desc: 上传本地图片
|
||||
* @return: {*}
|
||||
|
@ -162,10 +203,35 @@ const handleImportImg = (uploadFile) => {
|
|||
}
|
||||
console.log('uploadFile', uploadFile);
|
||||
// 假设你在渲染进程中
|
||||
getBase64(uploadFile.raw).then(res => {
|
||||
console.log('res-------', res);
|
||||
|
||||
// cropOption.img = window.URL.createObjectURL(uploadFile.raw);
|
||||
cropOption.img = window.URL.createObjectURL(new Blob([uploadFile.raw]));
|
||||
|
||||
// 在 Electron 主进程中使用 URL.createObjectURL
|
||||
// const base64Data = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/...'; // Base64 编码的图片数据
|
||||
// const base64Data = res; // Base64 编码的图片数据
|
||||
// const buffer = Buffer.from(base64Data.split(',')[1], 'base64');
|
||||
// const filePath = path.join(Remote.app.getPath('userData'), 'image.jpg');
|
||||
// console.log(filePath,'???????????????????');
|
||||
// fs.writeFileSync(filePath, buffer);
|
||||
// const buf = fs.readFileSync(filePath)
|
||||
// console.log(buf);
|
||||
// const uint8Buffer = Uint8Array.from(buf)
|
||||
// cropOption.img = window.URL.createObjectURL(new Blob([uint8Buffer]));
|
||||
// cropOption.img = URL.createObjectURL(new Blob([fs.readFileSync(filePath)]));
|
||||
// cropOption.img = URL.createObjectURL(new Blob([buffer]));
|
||||
cropOption.img = res;
|
||||
console.log(cropOption.img);
|
||||
|
||||
|
||||
|
||||
// cropOption.img = window.URL.createObjectURL(new Blob([res]));
|
||||
// console.log(cropOption.img);
|
||||
})
|
||||
// cropOption.img = window.URL.createObjectURL(uploadFile.raw);
|
||||
// cropOption.img = window.URL.createObjectURL(new Blob([uploadFile.raw]));
|
||||
// cropOption.img = window.URL.createObjectURL(new Blob([uploadFile.raw]));
|
||||
// console.log(cropOption.img);
|
||||
ElMessage.success('上传成功');
|
||||
};
|
||||
/**
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { ElMessageBox, ElMessage } from "element-plus";
|
||||
import qs from "qs";
|
||||
import axios from 'axios'
|
||||
import { pyOCRAPI } from "@/api/education/entpcoursework";
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue