diff --git a/src/renderer/src/components/template-study/container/header.vue b/src/renderer/src/components/template-study/container/header.vue index 1b9baba..12f42ab 100644 --- a/src/renderer/src/components/template-study/container/header.vue +++ b/src/renderer/src/components/template-study/container/header.vue @@ -20,7 +20,7 @@
- + @@ -31,35 +31,7 @@
- - -
- - - - - - - - - - - -
- -
+ @@ -69,8 +41,9 @@ import { Plus } from '@element-plus/icons-vue' import { ElMessageBox } from 'element-plus' import { modelList } from '@/api/mode/index' import Dialog from './dialog.vue' +import keywordDialog from './keyword-dialog.vue' -const keywordDialog = ref(false) +const wordDialog = ref(false) const props = defineProps({ type: { type: Number, @@ -120,13 +93,6 @@ const changeTemplate = (val) => { }) } - -const form = reactive({ - name: '', - desc: '', -}) - - onMounted(() => { getTemplateList() }) @@ -143,8 +109,6 @@ onMounted(() => { width: 50%; align-items: center; padding-left: 20px; - - } .header-right { @@ -160,13 +124,4 @@ onMounted(() => { } } -.custom-header { - justify-content: space-between; - align-items: center; - - .icon-guanbi { - cursor: pointer; - font-weight: bold; - } -} \ No newline at end of file diff --git a/src/renderer/src/components/template-study/container/keyword-dialog.vue b/src/renderer/src/components/template-study/container/keyword-dialog.vue new file mode 100644 index 0000000..7ce82f2 --- /dev/null +++ b/src/renderer/src/components/template-study/container/keyword-dialog.vue @@ -0,0 +1,72 @@ + + + + + \ No newline at end of file diff --git a/src/renderer/src/components/template-study/container/result.vue b/src/renderer/src/components/template-study/container/result.vue index d853dd3..5805a87 100644 --- a/src/renderer/src/components/template-study/container/result.vue +++ b/src/renderer/src/components/template-study/container/result.vue @@ -3,10 +3,24 @@
- +
-
#{{ item.name }}
+
+
+ #{{ item.name }} +
+ + + + +
{{ item.prompt }}
@@ -37,9 +51,11 @@
- + - + + +
@@ -47,6 +63,7 @@ import { ref, reactive, onMounted, watch } from 'vue'; import EditDialog from './edit-dialog.vue' import AdjustDialog from './adjust-dialog.vue' +import keywordDialog from './keyword-dialog.vue'; import { sessionStore } from '@/utils/store' import useUserStore from '@/store/modules/user' import { conversation, completion, modelList } from '@/api/mode/index' @@ -102,10 +119,10 @@ const params = reactive( ) const curNode = reactive({}) const getConversation = async () => { - + const { user: { userId } } = userStore const result = await conversation({ user_id: String(userId) }) - console.log('result',result) + console.log('result', result) params.conversation_id = result.data.data.id getCompletion() } @@ -120,7 +137,7 @@ const getCompletion = async () => { let answer = res.data.data.answer item.oldAnswer = answer item.answer = getResult(answer); - + } finally { item.loading = false } @@ -129,15 +146,15 @@ const getCompletion = async () => { // 重新研读 -const againResult = async (index,item) =>{ - try{ +const againResult = async (index, item) => { + try { childTempList.value[index].loading = true params.messages[0].content = `根据${curNode.edustage}语文课标,提炼出${item.name}` const res = await completion(params) let answer = res.data.data.answer item.oldAnswer = answer item.answer = getResult(answer); - }finally { + } finally { childTempList.value[index].loading = false } } @@ -155,35 +172,44 @@ let getResult = (text) => { // 编辑 const curIndex = ref(-1) const editItem = reactive({}) -const onEdit = (index,item) =>{ +const onEdit = (index, item) => { curIndex.value = index Object.assign(editItem, item) isEdit.value = true } // 保存编辑 -const saveEdit = (data) =>{ +const saveEdit = (data) => { childTempList.value[curIndex.value].oldAnswer = data let answer = getResult(data); childTempList.value[curIndex.value].answer = answer } const isAdjust = ref(false) -const onAdjust = (index, item) =>{ +const onAdjust = (index, item) => { curIndex.value = index Object.assign(editItem, item) isAdjust.value = true } -const saveAdjust = (item) =>{ +const saveAdjust = (item) => { childTempList.value[curIndex.value].oldAnswer = item let answer = getResult(item); childTempList.value[curIndex.value].answer = answer } +// 编辑提示词 +const keywordItem = reactive({}) +const isEditKeyWord = ref(false) +const editKeyWord = (item) =>{ + isEditKeyWord.value = true + Object.assign(keywordItem, item) +} + + + onMounted(() => { let data = sessionStore.get('subject.curNode') Object.assign(curNode, data); - }) defineExpose({ @@ -249,6 +275,7 @@ defineExpose({ font-size: 16px; font-weight: bold; color: #000; + justify-content: space-between; .blue { font-size: 22px; @@ -290,20 +317,25 @@ defineExpose({ } } - .text-answer{ + + .text-answer { color: #409eff; } - .ai-btn{ + + .ai-btn { margin-top: 10px; display: flex; justify-content: flex-end; - .iconfont{ + + .iconfont { margin-right: 3px; } - :deep(.el-button){ + + :deep(.el-button) { font-size: 13px; } - .icon-ai1{ + + .icon-ai1 { font-size: 18px; } } @@ -382,8 +414,22 @@ defineExpose({ } } - +.icon-shenglvehao{ + font-weight: bold; + font-size: 22px; +} +:deep(.el-popover) { + min-width: 50px; + width: 50px !important; +} .pl-25 { padding-left: 25px; } - \ No newline at end of file + + + diff --git a/src/renderer/src/hooks/useHandleData.js b/src/renderer/src/hooks/useHandleData.js new file mode 100644 index 0000000..289117d --- /dev/null +++ b/src/renderer/src/hooks/useHandleData.js @@ -0,0 +1,34 @@ +import { ElMessageBox, ElMessage } from "element-plus"; + +/** + * @description 操作单条数据信息(二次确认【删除、禁用、启用、重置密码】) + * @param {Function} api 操作数据接口的api方法(必传) + * @param {Object} params 携带的操作数据参数 {id,params}(必传) + * @param {String} message 提示信息(必传) + * @param {String} confirmType icon类型(不必传,默认为 warning) | "success" | "warning" | "info" | "error" + * @return Promise + */ + +export const useHandleData = ( + api, + params, + message, + confirmType= "warning" +) => { + return new Promise((resolve, reject) => { + ElMessageBox.confirm(`是否${message}?`, "温馨提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: confirmType, + draggable: true + }).then(async () => { + const res = await api(params); + if (!res) return reject(false); + ElMessage({ + type: "success", + message: `${message}成功!` + }); + resolve(true); + }).catch(() => { }); + }); +}; diff --git a/src/renderer/src/router/index.js b/src/renderer/src/router/index.js index 97cb925..aed11bc 100644 --- a/src/renderer/src/router/index.js +++ b/src/renderer/src/router/index.js @@ -131,6 +131,12 @@ const dynamicRoutes = [ name: 'classTaskAssign', meta: { title: '作业布置', showBread: true } }, + { + path: 'newClassTaskAssign', + component: () => import('@/views/classTask/newClassTaskAssign/index.vue'), + name: 'newClassTaskAssign', + meta: { title: '新作业设计', showBread: true } + }, { path: 'classTask', component: () => import('@/views/classTask/classTask.vue'), diff --git a/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue b/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue index 04ff553..a512cc6 100644 --- a/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue +++ b/src/renderer/src/views/classTask/container/newTask/taskTypeView.vue @@ -465,10 +465,10 @@ function Apis(key) { }) }) } - } +} - const client = new Apis('/paht'); +const client = new Apis('/paht'); /** @@ -513,13 +513,6 @@ const handleQueryFromEntpCourseWork= async (queryType) => { pageParams.value.loading = true; - - // 初中政治特殊处理( warn: 需确认是否修改 ) - // if (this.courseObj.edusubject=='政治' && this.courseObj.edustage=='初中') { - // // [初中+政治]需改为[初中+道德与法治] - // queryForm.edusubject = '道德与法治'; - // } - client(t('任务1', 1500)).then(res => { //console.log("请求返回",res); // if(paginationParams.pageNum == 1){ @@ -533,31 +526,31 @@ const handleQueryFromEntpCourseWork= async (queryType) => { // } const data = res.data || []; if(data && data.length>0){ - // workResource.entpCourseWorkList = entpcourseworkres.data; - // workResource.entpCourseWorkTotal = entpcourseworkres.data.length; + // workResource.entpCourseWorkList = entpcourseworkres.data; + // workResource.entpCourseWorkTotal = entpcourseworkres.data.length; - data.forEach(item=> { - if (item.worktype == '选择题') { - item.worktype = '单选题' + data.forEach(item=> { + if (item.worktype == '选择题') { + item.worktype = '单选题' + } + }) + + // 格式化试题信息 + processList(data); + //workResource.entpCourseWorkList.push(...data); + workResource.entpCourseWorkList = data; + + // 初次加载时更新当前试题数量 + if (pageParams.value.isFirst) { + pageParams.value.isFirst = false; + pageParams.value.originCount = workResource.entpCourseWorkList.length; + pageParams.value.total = parseInt(res.msg); + paginationParams.pageNum = Math.ceil(parseInt(res.msg)/paginationParams.pageSize); + console.log('first->', pageParams.value, paginationParams); } - }) - - // 格式化试题信息 - processList(data); - //workResource.entpCourseWorkList.push(...data); - workResource.entpCourseWorkList = data; - - // 初次加载时更新当前试题数量 - if (pageParams.value.isFirst) { - pageParams.value.isFirst = false; - pageParams.value.originCount = workResource.entpCourseWorkList.length; - pageParams.value.total = parseInt(res.msg); - paginationParams.pageNum = Math.ceil(parseInt(res.msg)/paginationParams.pageSize); - console.log('first->', pageParams.value, paginationParams); } - } - pageParams.value.loading = false; -}); + pageParams.value.loading = false; + }); //const entpcourseworkres = await listEntpcourseworkNew(queryForm); @@ -741,10 +734,6 @@ const handleClassWorkSave = async () => { return; } - - - - if (classWorkForm.worktype === "课堂展示") { boardLoading.value = true let canvasJson = proxy.$refs.boardref.getCanvasJson() diff --git a/src/renderer/src/views/classTask/newClassTask.vue b/src/renderer/src/views/classTask/newClassTask.vue index 61a7b08..6f3d245 100644 --- a/src/renderer/src/views/classTask/newClassTask.vue +++ b/src/renderer/src/views/classTask/newClassTask.vue @@ -16,6 +16,7 @@ 作业设计 +
返回上页 @@ -26,8 +27,8 @@
- - + +
@@ -80,6 +81,9 @@ const courseObj = reactive({ }) // --------------------------------------------------- +const goToNewClassTaskAssign = () => { + router.push({ path: '/newClassTaskAssign', query: { courseObj: JSON.stringify(courseObj)} }); +} // 查询 const getData = (data) => { diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/Right/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/Right/index.vue new file mode 100644 index 0000000..124f39c --- /dev/null +++ b/src/renderer/src/views/classTask/newClassTaskAssign/Right/index.vue @@ -0,0 +1,94 @@ + + + + + \ No newline at end of file diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue new file mode 100644 index 0000000..910de4a --- /dev/null +++ b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue @@ -0,0 +1,813 @@ + + + diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue new file mode 100644 index 0000000..a270edb --- /dev/null +++ b/src/renderer/src/views/classTask/newClassTaskAssign/myQuestion/index.vue @@ -0,0 +1,420 @@ + + + + \ No newline at end of file diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/schoolQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/schoolQuestion/index.vue new file mode 100644 index 0000000..c3d2dec --- /dev/null +++ b/src/renderer/src/views/classTask/newClassTaskAssign/schoolQuestion/index.vue @@ -0,0 +1,34 @@ + + + diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue new file mode 100644 index 0000000..8b93d47 --- /dev/null +++ b/src/renderer/src/views/classTask/newClassTaskAssign/searchQuestion/index.vue @@ -0,0 +1,498 @@ + + + + \ No newline at end of file diff --git a/src/renderer/src/views/job-management/Details/index.vue b/src/renderer/src/views/job-management/Details/index.vue index 94704e2..696f090 100644 --- a/src/renderer/src/views/job-management/Details/index.vue +++ b/src/renderer/src/views/job-management/Details/index.vue @@ -92,6 +92,5 @@ onMounted(() => { background-color: #fff; padding:5px; border-radius: 4px; - overflow-y: auto; } \ No newline at end of file diff --git a/src/renderer/src/views/job-management/Right/index.vue b/src/renderer/src/views/job-management/Right/index.vue index 95e164f..be8ef4f 100644 --- a/src/renderer/src/views/job-management/Right/index.vue +++ b/src/renderer/src/views/job-management/Right/index.vue @@ -1,5 +1,6 @@ @@ -100,12 +102,16 @@ const handleClick = (item) => { \ No newline at end of file