Merge remote-tracking branch 'origin/main'

This commit is contained in:
朱浩 2024-12-11 17:03:04 +08:00
commit a9faeea3fd
4 changed files with 25 additions and 9 deletions

View File

@ -12,6 +12,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import 'animate.css'
import { ref, onMounted, watch, onBeforeMount } from 'vue' import { ref, onMounted, watch, onBeforeMount } from 'vue'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { useScreenStore, useMainStore, useSnapshotStore, useSlidesStore } from './store' import { useScreenStore, useMainStore, useSnapshotStore, useSlidesStore } from './store'

View File

@ -15,10 +15,10 @@
</template> </template>
</el-dropdown> </el-dropdown>
<div> <div>
<el-button type="danger" link @click="removeItem(curTemplate, false)"> <el-button type="danger" link :disabled="!(templateList.length)" @click="removeItem(curTemplate, false)">
删除 删除
</el-button> </el-button>
<el-button type="primary" link @click="onAdd"> <el-button type="primary" link :disabled="!(templateList.length)" @click="onAdd">
<i class="iconfont icon-jiahao"></i> <i class="iconfont icon-jiahao"></i>
添加提示词 添加提示词
</el-button> </el-button>
@ -137,15 +137,17 @@ const curTemplate = reactive({ name: '', id: '' })
const templateList = ref([]) const templateList = ref([])
const childTempList = ref([]) const childTempList = ref([])
const getTemplateList = () => { const getTemplateList = () => {
modelList({ model: props.type, type: 1, pageNum: 1, pageSize: 10000 }).then(res => { modelList({ model: props.type, type: 1, pageNum: 1, pageSize: 10000, ex1: curNode.edustage, ex2: curNode.edusubject }).then(res => {
templateList.value = res.rows templateList.value = res.rows
if(res.rows.length > 0){
Object.assign(curTemplate, res.rows[0]); Object.assign(curTemplate, res.rows[0]);
getChildTemplate() getChildTemplate()
}
}) })
} }
const getChildTemplate = () => { const getChildTemplate = () => {
tempLoading.value = true tempLoading.value = true
modelList({ model: props.type, type: 2, parentId: curTemplate.id }).then(res => { modelList({ model: props.type, type: 2, parentId: curTemplate.id, ex1: curNode.edustage, ex2: curNode.edusubject }).then(res => {
childTempList.value = res.rows childTempList.value = res.rows
if(childTempList.value.length){ if(childTempList.value.length){
childTempList.value.forEach(item => item.answer = '') childTempList.value.forEach(item => item.answer = '')
@ -398,9 +400,9 @@ emitter.on('onGetMain', () => {
const curNode = reactive({}) const curNode = reactive({})
onMounted(() => { onMounted(() => {
getTemplateList()
let data = sessionStore.get('subject.curNode') let data = sessionStore.get('subject.curNode')
Object.assign(curNode, data); Object.assign(curNode, data);
getTemplateList()
let jsonKey = `${modeType.value}-${data.edustage}-${data.edusubject}` let jsonKey = `${modeType.value}-${data.edustage}-${data.edusubject}`
params.dataset_id = dataSetJson[jsonKey] params.dataset_id = dataSetJson[jsonKey]
}) })

View File

@ -703,6 +703,7 @@ const handleClassWorkSave = async () => {
entpcourseworklist: '', // list entpcourseworklist: '', // list
}; };
if(cform.uniquekey.trim() == '') return ElMessage({ type: 'warning', message: '作业名称不能为空!'});
// [] newWorkSpaceEdit true // [] newWorkSpaceEdit true
if(classWorkForm.id != '' ) {// id if(classWorkForm.id != '' ) {// id
@ -741,6 +742,7 @@ const handleClassWorkSave = async () => {
} }
} }
else if(classWorkForm.worktype === "常规作业"){ else if(classWorkForm.worktype === "常规作业"){
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!'});
fileLoading.value = true fileLoading.value = true
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]); cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
@ -832,7 +834,12 @@ const editWork = async (cform) =>{
} }
}else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') { }else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') {
// //
//
if(classWorkForm.worktype == '课堂展示'){
//
}else{
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!'});
}
}else { }else {
if (classWorkForm.chooseWorkLists.length == 0) { if (classWorkForm.chooseWorkLists.length == 0) {
// //

View File

@ -489,6 +489,7 @@ const handleClassWorkFormQuizRemove = (index) =>{
entpcourseworklist: '', // list entpcourseworklist: '', // list
}; };
if(cform.uniquekey.trim() == '') return ElMessage({ type: 'warning', message: '作业名称不能为空!'});
// [] newWorkSpaceEdit true // [] newWorkSpaceEdit true
if(isShow.value === false){ if(isShow.value === false){
@ -530,6 +531,7 @@ const handleClassWorkFormQuizRemove = (index) =>{
} }
} }
else if(classWorkForm.worktype === "常规作业"){ else if(classWorkForm.worktype === "常规作业"){
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!'});
fileLoading.value = true fileLoading.value = true
cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList); cform.workcodes = JSON.stringify(classWorkForm.fileHomeworkList);
cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]); cform.entpcourseworklist = JSON.stringify([{'id':-2, 'score': '10'}]);
@ -634,7 +636,11 @@ const editWork = async (cform) =>{
} }
}else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') { }else if (classWorkForm.worktype == '课堂展示' || classWorkForm.worktype == '常规作业') {
// //
if(classWorkForm.worktype == '课堂展示'){
//
}else{
if (classWorkForm.fileHomeworkList.length == 0) return ElMessage({ type: 'warning', message: '请上传常规作业附件!'});
}
}else { }else {
if (classWorkForm.chooseWorkLists.length == 0) { if (classWorkForm.chooseWorkLists.length == 0) {
// //