Compare commits

..

No commits in common. "cbf2c29bb4eb4121e320c0c7c8d90cadee424aa8" and "d25f2521a65ede71e9d7872cb5d097e3dfe52759" have entirely different histories.

6 changed files with 114 additions and 113 deletions

View File

@ -1,42 +0,0 @@
import request from '@/utils/request'
// 新增图片存eos
export function saveUploadFile(data) {
return request({
url: '/education/uploadfile/saveUploadFile',
method: 'post',
headers: {
'Content-Type': 'multipart/form-data'
},
data: data
})
}
// 新增批量图片存eos
export function saveUploadFiles(data) {
return request({
url: '/education/uploadfile/saveUploadFiles',
method: 'post',
headers: {
'Content-Type': 'multipart/form-data'
},
data: data
})
}
// 修改basecomment
export function updateUploadFile(data) {
return request({
url: '/education/uploadfile',
method: 'put',
data: data
})
}
// 删除basecomment
export function delUploadFile(id) {
return request({
url: '/education/uploadfile/' + id,
method: 'delete'
})
}

View File

@ -46,8 +46,7 @@ import "tinymce/plugins/anchor"; //锚点
import { ref, reactive, defineProps, defineEmits, nextTick, onMounted, computed, watch } from 'vue' import { ref, reactive, defineProps, defineEmits, nextTick, onMounted, computed, watch } from 'vue'
import { getStaticUrl } from '@/utils/tool' import { getStaticUrl } from '@/utils/tool'
import useUserStore from '@/store/modules/user' //import { listUploadfile, getUploadFile, delUploadFile, addUploadFile, saveUploadFile } from "@/api/comm/uploadfile";
import { saveUploadFile } from "@/api/file/img";
const emits = defineEmits(["update:modelValue", "setHtml"]); const emits = defineEmits(["update:modelValue", "setHtml"]);
//props便 //props便
@ -109,8 +108,6 @@ const props = defineProps({
}, },
}); });
const userStore = useUserStore().user;
const pasteImgName = ref(''); const pasteImgName = ref('');
const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); // const uploadUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); //
const loading = ref(false); const loading = ref(false);
@ -215,31 +212,29 @@ const init = reactive({
// /() - , [images_upload_handler] // /() - , [images_upload_handler]
file_picker_callback: function(callback, value, meta) { file_picker_callback: function(callback, value, meta) {
return;
// //
// let filetype='.pdf, .txt, .zip, .rar, .7z, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .mp3, .mp4'; let filetype='.pdf, .txt, .zip, .rar, .7z, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .mp3, .mp4';
// let upURL = '/common/upload'; let upURL = '/common/upload';
// // //
// switch(meta.filetype){ switch(meta.filetype){
// case 'image': case 'image':
// filetype='.jpg, .jpeg, .png, .gif'; filetype='.jpg, .jpeg, .png, .gif';
// //upURL='upimg.php'; //upURL='upimg.php';
// break; break;
// case 'media': case 'media':
// filetype='.mp3, .mp4'; filetype='.mp3, .mp4';
// //upURL='upfile.php'; //upURL='upfile.php';
// break; break;
// case 'file': case 'file':
// default: default:
// } }
// // input // input
// let input = document.createElement('input'); let input = document.createElement('input');
// input.setAttribute('type', 'file'); input.setAttribute('type', 'file');
// input.setAttribute('accept', filetype); input.setAttribute('accept', filetype);
// // //
// input.onchange = function() { // input.onchange = function() {
// const file = this.files[0]; // const file = this.files[0];
// const formData = new FormData(); // const formData = new FormData();
@ -255,7 +250,7 @@ const init = reactive({
// }); // });
// }; // };
// input.click(); input.click();
}, },
// /() // /()
@ -283,25 +278,22 @@ const init = reactive({
formData.append("entpcourseid", 0); formData.append("entpcourseid", 0);
formData.append("filetype", "image"); formData.append("filetype", "image");
formData.append("suffix", "image"); formData.append("suffix", "image");
formData.append("status", '1'); formData.append("status", '0');
if(userStore.deptId && userStore.deptId != null){ if(props.upFileParams?.hasOwnProperty('deptId')){
formData.append("entpid", userStore.deptId); formData.append("entpid", props.upFileParams.deptId);
} }
if(userStore.userId && userStore.userId != null){ if(props.upFileParams?.hasOwnProperty('userId')){
formData.append("userid", userStore.userId); formData.append("userid", props.upFileParams.userId);
} }
if(userStore.edudegree && userStore.edudegree != null){ if(props.upFileParams?.hasOwnProperty('edudegree')){
let edudegree = userStore.edudegree.toString(); let edudegree = props.upFileParams.edudegree.toString();
if(edudegree != '' && edudegree.indexOf('年级') == -1){ if(edudegree != '' && edudegree.indexOf('年级') == -1){
edudegree += '年级'; edudegree += '年级';
} }
formData.append("edudegree", edudegree); formData.append("edudegree", edudegree);
} }
if(userStore.edusubject && userStore.edusubject != null){ if(props.upFileParams?.hasOwnProperty('edusubject')){
formData.append("edusubject", userStore.edusubject); formData.append("edusubject", props.upFileParams.edusubject);
}
if(userStore.edustage && userStore.edustage != null){
formData.append("edustage", userStore.edustage);
} }
if(props.upFileParams?.hasOwnProperty('lessionId')){ if(props.upFileParams?.hasOwnProperty('lessionId')){
formData.append("evalid", props.upFileParams.lessionId); formData.append("evalid", props.upFileParams.lessionId);
@ -310,21 +302,18 @@ const init = reactive({
formData.append("filegroup", props.upFileParams.fileAlias); formData.append("filegroup", props.upFileParams.fileAlias);
} }
loading.value = true; loading.value = true;
console.log('formData->', formData);
// //
saveUploadFile(formData) // saveUploadFile(formData)
.then((res) => { // .then((res) => {
console.log('res->', res); // loading.value = false;
loading.value = false; // return resolve(res.fileurl);
return resolve(res.fileurl); // })
}) // .catch((err) => {
.catch((err) => { // loading.value = false;
loading.value = false; // return reject('err:' + err);
return reject('err:' + err); // });
});
} }
), ),

View File

@ -113,7 +113,6 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { Search } from '@element-plus/icons-vue'
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue' import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue'
import { useRouter, useRoute } from 'vue-router' import { useRouter, useRoute } from 'vue-router'

View File

@ -67,13 +67,18 @@
<div class="questForm-item-cover"> <div class="questForm-item-cover">
<el-form-item :label="questForm.worktype == '复合题' ? '背景材料' : questForm.worktype == '主观题' ? '背景资料' : '题目'" prop="title"> <el-form-item :label="questForm.worktype == '复合题' ? '背景材料' : questForm.worktype == '主观题' ? '背景资料' : '题目'" prop="title">
<Tinymce v-model="questForm.title" :upFileParams="{ <Tinymce v-model="questForm.title" :upFileParams="{
deptId: userStore.deptId,
userId: userStore.userId,
edudegree: userStore.edudegree,
edusubject: userStore.edusubject,
lessionId: lessionid, lessionId: lessionid,
fileAlias: '单题上传', fileAlias: '单题上传',
}" }"
/> />
</el-form-item> </el-form-item>
<div class="item-cropper-btn"> <div class="item-cropper-btn">
<el-button v-show="isCropper" circle @click="cropperFormItem('title')"><el-icon><Search /></el-icon></el-button> <!-- <el-button v-show="isCropper" circle icon="Search" @click="cropperFormItem('title')"></el-button> -->
<el-button v-show="isCropper" circle @click="cropperFormItem('title')">识别</el-button>
</div> </div>
</div> </div>
@ -83,6 +88,10 @@
<el-form-item :label=Options(1,index) :prop="`list.${index}.text`" <el-form-item :label=Options(1,index) :prop="`list.${index}.text`"
:rules="{required: true, message: '选项不能为空', trigger: 'blur'}"> :rules="{required: true, message: '选项不能为空', trigger: 'blur'}">
<Tinymce v-model="item.text" :minHeight="150" :upFileParams="{ <Tinymce v-model="item.text" :minHeight="150" :upFileParams="{
deptId: userStore.deptId,
userId: userStore.userId,
edudegree: userStore.edudegree,
edusubject: userStore.edusubject,
lessionId: lessionid, lessionId: lessionid,
fileAlias: '单题上传', fileAlias: '单题上传',
}" /> }" />
@ -98,7 +107,8 @@
</el-form-item> </el-form-item>
</div> </div>
<div class="item-cropper-btn"> <div class="item-cropper-btn">
<el-button v-show="isCropper" circle @click="cropperFormItem('workdesc')"><el-icon><Search /></el-icon></el-button> <!-- <el-button v-show="isCropper" circle icon="Search" @click="cropperFormItem('workdesc')"></el-button> -->
<el-button v-show="isCropper" circle @click="cropperFormItem('workdesc')">识别</el-button>
</div> </div>
</div> </div>
@ -114,6 +124,10 @@
v-model="item.text" v-model="item.text"
:minHeight="150" :minHeight="150"
:upFileParams = "{ :upFileParams = "{
deptId: userStore.deptId,
userId: userStore.userId,
edudegree: userStore.edudegree,
edusubject: userStore.edusubject,
lessionId: lessionid, lessionId: lessionid,
fileAlias: '单题上传', fileAlias: '单题上传',
}" /> }" />
@ -129,7 +143,8 @@
</el-form-item> </el-form-item>
</div> </div>
<div class="item-cropper-btn"> <div class="item-cropper-btn">
<el-button v-show="isCropper" circle @click="cropperFormItem('workdesc')"><el-icon><Search /></el-icon></el-button> <!-- <el-button v-show="isCropper" circle icon="Search" @click="cropperFormItem('workdesc')"></el-button> -->
<el-button v-show="isCropper" circle @click="cropperFormItem('workdesc')">识别</el-button>
</div> </div>
</div> </div>
@ -139,6 +154,10 @@
<el-form-item :label=Options(3,index) :prop="`list.${index}.text`" <el-form-item :label=Options(3,index) :prop="`list.${index}.text`"
:rules="{required: true, message: '填空选项不能为空', trigger: 'blur'}"> :rules="{required: true, message: '填空选项不能为空', trigger: 'blur'}">
<Tinymce v-model="item.text" :minHeight="150" :upFileParams="{ <Tinymce v-model="item.text" :minHeight="150" :upFileParams="{
deptId: userStore.deptId,
userId: userStore.userId,
edudegree: userStore.edudegree,
edusubject: userStore.edusubject,
lessionId: lessionid, lessionId: lessionid,
fileAlias: '单题上传', fileAlias: '单题上传',
}" /> }" />
@ -153,7 +172,8 @@
</el-form-item> </el-form-item>
</div> </div>
<div class="item-cropper-btn"> <div class="item-cropper-btn">
<el-button v-show="isCropper" circle @click="cropperFormItem('workdesc')"></el-button> <!-- <el-button v-show="isCropper" circle icon="Search" @click="cropperFormItem('workdesc')"></el-button> -->
<el-button v-show="isCropper" circle @click="cropperFormItem('workdesc')">识别</el-button>
</div> </div>
</div> </div>
@ -180,12 +200,17 @@
<div v-if="questForm.worktype.indexOf('主观题') != -1" class="questForm-item-cover"> <div v-if="questForm.worktype.indexOf('主观题') != -1" class="questForm-item-cover">
<el-form-item label="答案"> <el-form-item label="答案">
<Tinymce v-model="questForm.workanswer" :upFileParams="{ <Tinymce v-model="questForm.workanswer" :upFileParams="{
deptId: userStore.deptId,
userId: userStore.userId,
edudegree: userStore.edudegree,
edusubject: userStore.edusubject,
lessionId: lessionid, lessionId: lessionid,
fileAlias: '单题上传', fileAlias: '单题上传',
}" /> }" />
</el-form-item> </el-form-item>
<div class="item-cropper-btn"> <div class="item-cropper-btn">
<el-button v-show="isCropper" circle @click="cropperFormItem('workanswer')"><el-icon><Search /></el-icon></el-button> <!-- <el-button v-show="isCropper" circle icon="Search" @click="cropperFormItem('workanswer')"></el-button> -->
<el-button v-show="isCropper" circle @click="cropperFormItem('workanswer')">识别</el-button>
</div> </div>
<!-- subjList --> <!-- subjList -->
@ -262,6 +287,10 @@
<el-form-item :label="`${item.type}目${index+1}.`" :prop="`mulList.params.${index}.title`" :rules="{ <el-form-item :label="`${item.type}目${index+1}.`" :prop="`mulList.params.${index}.title`" :rules="{
required: true, message: '题目不能为空', trigger: 'blur'}" :key='index'> required: true, message: '题目不能为空', trigger: 'blur'}" :key='index'>
<Tinymce v-model="item.title" :minHeight="150" :upFileParams="{ <Tinymce v-model="item.title" :minHeight="150" :upFileParams="{
deptId: userStore.deptId,
userId: userStore.userId,
edudegree: userStore.edudegree,
edusubject: userStore.edusubject,
lessionId: lessionid, lessionId: lessionid,
fileAlias: '单题上传', fileAlias: '单题上传',
}" }"
@ -273,6 +302,10 @@
<el-form-item :label=Options(1,indexOp) :prop="`mulList.params.${index}.options.${indexOp}.text`" <el-form-item :label=Options(1,indexOp) :prop="`mulList.params.${index}.options.${indexOp}.text`"
:rules="{ required: true, message: '单题不能为空', trigger: 'blur' }" :key='indexOp'> :rules="{ required: true, message: '单题不能为空', trigger: 'blur' }" :key='indexOp'>
<Tinymce v-model="itemOp.text" :minHeight="150" :upFileParams="{ <Tinymce v-model="itemOp.text" :minHeight="150" :upFileParams="{
deptId: userStore.deptId,
userId: userStore.userId,
edudegree: userStore.edudegree,
edusubject: userStore.edusubject,
lessionId: lessionid, lessionId: lessionid,
fileAlias: '单题上传', fileAlias: '单题上传',
}" }"
@ -293,6 +326,10 @@
<el-form-item :label=Options(3,indexOp) :prop="`mulList.params.${index}.options.${indexOp}.text`" <el-form-item :label=Options(3,indexOp) :prop="`mulList.params.${index}.options.${indexOp}.text`"
:rules="{required: true, message: '填空选项不能为空', trigger: 'blur'}"> :rules="{required: true, message: '填空选项不能为空', trigger: 'blur'}">
<Tinymce v-model="itemOp.text" :minHeight="150" :upFileParams="{ <Tinymce v-model="itemOp.text" :minHeight="150" :upFileParams="{
deptId: userStore.deptId,
userId: userStore.userId,
edudegree: userStore.edudegree,
edusubject: userStore.edusubject,
lessionId: lessionid, lessionId: lessionid,
fileAlias: '单题上传', fileAlias: '单题上传',
}" }"
@ -313,6 +350,10 @@
<el-form-item :label=Options(1,indexOp) :prop="`mulList.params.${index}.options.${indexOp}.text`" <el-form-item :label=Options(1,indexOp) :prop="`mulList.params.${index}.options.${indexOp}.text`"
:rules="{required: true, message: '多选不能为空', trigger: 'blur'}"> :rules="{required: true, message: '多选不能为空', trigger: 'blur'}">
<Tinymce v-model="itemOp.text" :minHeight="150" :upFileParams="{ <Tinymce v-model="itemOp.text" :minHeight="150" :upFileParams="{
deptId: userStore.deptId,
userId: userStore.userId,
edudegree: userStore.edudegree,
edusubject: userStore.edusubject,
lessionId: lessionid, lessionId: lessionid,
fileAlias: '单题上传', fileAlias: '单题上传',
}" }"
@ -343,6 +384,10 @@
<div v-if="item.type == '主观题'"> <div v-if="item.type == '主观题'">
<el-form-item :label=Options(6,indexOp) :prop="`mulList.params.${index}.options.${indexOp}.text`"> <el-form-item :label=Options(6,indexOp) :prop="`mulList.params.${index}.options.${indexOp}.text`">
<Tinymce v-model="itemOp.text" :upFileParams="{ <Tinymce v-model="itemOp.text" :upFileParams="{
deptId: userStore.deptId,
userId: userStore.userId,
edudegree: userStore.edudegree,
edusubject: userStore.edusubject,
lessionId: lessionid, lessionId: lessionid,
fileAlias: '单题上传', fileAlias: '单题上传',
}" /> }" />
@ -358,12 +403,17 @@
<Tinymce <Tinymce
v-model="questForm.method" v-model="questForm.method"
:upFileParams = "{ :upFileParams = "{
deptId: userStore.deptId,
userId: userStore.userId,
edudegree: userStore.edudegree,
edusubject: userStore.edusubject,
lessionId: lessionid, lessionId: lessionid,
fileAlias: '单题上传', fileAlias: '单题上传',
}" /> }" />
</el-form-item> </el-form-item>
<div class="item-cropper-btn"> <div class="item-cropper-btn">
<el-button v-show="isCropper" circle @click="cropperFormItem('method')"><el-icon><Search /></el-icon></el-button> <!-- <el-button v-show="isCropper" circle icon="Search" @click="cropperFormItem('method')"></el-button> -->
<el-button v-show="isCropper" circle @click="cropperFormItem('method')">识别</el-button>
</div> </div>
</div> </div>
@ -372,12 +422,17 @@
<el-form-item label="答案解答" prop="analyse"> <el-form-item label="答案解答" prop="analyse">
<Tinymce v-model="questForm.analyse" <Tinymce v-model="questForm.analyse"
:upFileParams = "{ :upFileParams = "{
deptId: userStore.deptId,
userId: userStore.userId,
edudegree: userStore.edudegree,
edusubject: userStore.edusubject,
lessionId: lessionid, lessionId: lessionid,
fileAlias: '单题上传', fileAlias: '单题上传',
}" /> }" />
</el-form-item> </el-form-item>
<div class="item-cropper-btn"> <div class="item-cropper-btn">
<el-button v-show="isCropper" circle @click="cropperFormItem('analyse')"><el-icon><Search /></el-icon></el-button> <!-- <el-button v-show="isCropper" circle icon="Search" @click="cropperFormItem('analyse')"></el-button> -->
<el-button v-show="isCropper" circle @click="cropperFormItem('analyse')">识别</el-button>
</div> </div>
</div> </div>
@ -386,12 +441,17 @@
<el-form-item label="答案点评" prop="discuss"> <el-form-item label="答案点评" prop="discuss">
<Tinymce v-model="questForm.discuss" <Tinymce v-model="questForm.discuss"
:upFileParams = "{ :upFileParams = "{
deptId: userStore.deptId,
userId: userStore.userId,
edudegree: userStore.edudegree,
edusubject: userStore.edusubject,
lessionId: lessionid, lessionId: lessionid,
fileAlias: '单题上传', fileAlias: '单题上传',
}" /> }" />
</el-form-item> </el-form-item>
<div class="item-cropper-btn"> <div class="item-cropper-btn">
<el-button v-show="isCropper" circle @click="cropperFormItem('discuss')"><el-icon><Search /></el-icon></el-button> <!-- <el-button v-show="isCropper" circle icon="Search" @click="cropperFormItem('discuss')"></el-button> -->
<el-button v-show="isCropper" circle @click="cropperFormItem('discuss')">识别</el-button>
</div> </div>
</div> </div>
@ -405,7 +465,6 @@
</template> </template>
<script setup> <script setup>
import { ElMessage, ElNotification } from 'element-plus' import { ElMessage, ElNotification } from 'element-plus'
import { Search } from '@element-plus/icons-vue'
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue' import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue'
import { getBindlist } from '@/api/education/knowledgePoint' import { getBindlist } from '@/api/education/knowledgePoint'
@ -599,6 +658,10 @@ const loading = ref(false);
onMounted(() => { onMounted(() => {
lessionid.value = props.bookobj.levelSecondId? props.bookobj.levelSecondId : props.bookobj.levelFirstId; // id lessionid.value = props.bookobj.levelSecondId? props.bookobj.levelSecondId : props.bookobj.levelFirstId; // id
upFileParams.value = { upFileParams.value = {
deptId: userStore.deptId,
userId: userStore.userId,
edudegree: userStore.edudegree,
edusubject: userStore.edusubject,
lessionId: lessionid, lessionId: lessionid,
fileAlias: '单题上传', fileAlias: '单题上传',
}; };

View File

@ -52,7 +52,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="5"> <el-col :span="5">
<el-button @click="handleQueryParamFromEntpCourseWork(1)"><el-icon><Search /></el-icon></el-button> <el-button @click="handleQueryParamFromEntpCourseWork(1)"><el-icon><Search /></el-icon> </el-button>
</el-col> </el-col>
</el-row> </el-row>
<!-- 习题表格 --> <!-- 习题表格 -->
@ -102,8 +102,6 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { Search } from '@element-plus/icons-vue'
import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue' import { onMounted, ref,watch, reactive, getCurrentInstance,nextTick } from 'vue'
import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork' import {listEntpcoursework, listEntpcourseworkNew, getEntpcoursework} from '@/api/education/entpCourseWork'

View File

@ -2,13 +2,7 @@
<div> <div>
<div class="form-item-cover"> <div class="form-item-cover">
<el-form-item label="答案点评" prop="discuss"> <el-form-item label="答案点评" prop="discuss">
<tinymce <tinymce v-model="discuss"/>
v-model="discuss"
:upFileParams="{
lessionId: 123456,
fileAlias: '单题上传',
}"
/>
</el-form-item> </el-form-item>
</div> </div>
</div> </div>