From 6629496569777a756f452dacd37c619140cca1e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Czouyf=E2=80=9D?= <80906036@qq.com> Date: Wed, 8 Jan 2025 16:35:03 +0800 Subject: [PATCH 1/7] test --- src/main/index.js | 7 +++++++ .../classTask/newClassTaskAssign/index.vue | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/main/index.js b/src/main/index.js index f43c571..a430510 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -244,6 +244,13 @@ app.on('ready', () => { loginWindow.show() loginWindow.focus() }) + // 打印窗口 + ipcMain.on('printPage', (event, printOptions) => { + //console.log("ipcMain-print-page") + mainWindow.webContents.print(printOptions, (success, failureReason) => { + if (!success) console.error(failureReason); + }); + }); //打开作业窗口 ipcMain.on('openWindow', (e, data) => { diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue index 03bb2e6..fac6342 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue @@ -161,6 +161,7 @@ const route = useRoute(); const router = useRouter() const { proxy } = getCurrentInstance() const useClassTaskStores = useClassTaskStore(); +const { ipcRenderer } = require('electron') const props = defineProps({ currentCourse: Object, @@ -841,6 +842,22 @@ const editWork = async (cform) =>{ } } + +// 测试, 未实装 +const handlePrint = () => { + const printOptions = { + silent: false, // 是否静默打印 + printBackground: true, // 是否打印背景颜色和图像 + color: false, // 是否打印为黑白 + marginsType: 0, // 边距类型,0: 默认边距,1: 无边距,2: 最小边距 + pageSize: 'A4', // 纸张大小 + // 其他选项可以根据需要配置 + }; + + console.log("print-page-click"); + ipcRenderer.send('printPage', printOptions); +}; + //---- From 5708850be9dc6563a4910f68f9608fb30a904800 Mon Sep 17 00:00:00 2001 From: lyc Date: Mon, 13 Jan 2025 13:51:16 +0800 Subject: [PATCH 2/7] edit --- src/renderer/src/views/teachingDesign/container/center.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index b8db88f..b6472fe 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -114,14 +114,17 @@ const createAi = async () => { data = res.data } - markeDownAnswer.value = data.answer + + const res = await createOutlineV2({ query: data.answer }) + markeDownAnswer.value = data.answer let outline = JSON.stringify({ json: res.outline, markdown: data.answer }) + Object.assign(curItem, {...curItem, outline}) emitter.emit('onResult', curItem) From 8185cc458d09d6aa3f7cc5fa9e12888e4579f169 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Czouyf=E2=80=9D?= <80906036@qq.com> Date: Mon, 13 Jan 2025 14:49:56 +0800 Subject: [PATCH 3/7] =?UTF-8?q?[=E4=BD=9C=E4=B8=9A=E8=AE=BE=E8=AE=A1]=20-?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E5=9B=BE=E7=89=87=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/classTask/newClassTaskAssign/index.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue index fac6342..a8ab3c4 100644 --- a/src/renderer/src/views/classTask/newClassTaskAssign/index.vue +++ b/src/renderer/src/views/classTask/newClassTaskAssign/index.vue @@ -78,7 +78,7 @@
- +
@@ -994,5 +994,8 @@ const handlePrint = () => { } } } +::v-deep img { + display: inline-block !important; +} From 04000e72796c22d05629c9ffb631adeb4214deac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=A8?= <666> Date: Tue, 14 Jan 2025 09:58:52 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix=EF=BC=9A=E4=BF=AE=E6=94=B9=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E6=8C=89=E9=92=AE;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/profile/cropperImage.vue | 32 +++++++++++++++---- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/src/renderer/src/views/profile/cropperImage.vue b/src/renderer/src/views/profile/cropperImage.vue index f75630d..3c86df0 100644 --- a/src/renderer/src/views/profile/cropperImage.vue +++ b/src/renderer/src/views/profile/cropperImage.vue @@ -22,13 +22,11 @@
- 选择 - + + + 取消 提交 @@ -216,6 +214,7 @@ export default { position: relative; display: flex; margin-top: 30px; + cursor: pointer; > .upload { display: block; width: 60px; @@ -224,6 +223,7 @@ export default { top: 0; left: 0; opacity: 0; + cursor: pointer; } } } @@ -265,4 +265,22 @@ export default { background-color: rgba(43, 43, 43, 0.7215686275); } } +.lBut{ + width: 87px; + height: 32px; + font-size: 14px; + line-height: 1.15; + display: flex; + justify-content: center; + align-items: center; + border-radius: 4px; + padding: 8px 10px; + margin-right: 10px; + transition: all 0.5s; + white-space: nowrap; + background-color: #409eff; + color: white; + border: 1px solid #409eff; + cursor: pointer; +} From 4ab07d247f48069b133adb65e2d84490cde212b7 Mon Sep 17 00:00:00 2001 From: lyc Date: Tue, 14 Jan 2025 11:25:57 +0800 Subject: [PATCH 5/7] =?UTF-8?q?edit=20=E8=80=83=E8=AF=95=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/api/mode/index.js | 8 + .../template-study/container/left-dialog.vue | 203 ++++++++---------- .../template-study/container/left.vue | 22 +- .../template-study/container/right.vue | 29 ++- .../views/teachingDesign/container/center.vue | 60 ++---- 5 files changed, 144 insertions(+), 178 deletions(-) diff --git a/src/renderer/src/api/mode/index.js b/src/renderer/src/api/mode/index.js index efbdcdb..40c4ce5 100644 --- a/src/renderer/src/api/mode/index.js +++ b/src/renderer/src/api/mode/index.js @@ -118,6 +118,14 @@ export function docList(params) { }) } +// 删除 doc ai文档 +export function removeDoc(id) { + return request({ + url: '/education/doc/' + id, + method: 'delete', + }) +} + // 保存教学大纲 export function addSyllabus(data) { return request({ diff --git a/src/renderer/src/components/template-study/container/left-dialog.vue b/src/renderer/src/components/template-study/container/left-dialog.vue index 3c34298..e251cc2 100644 --- a/src/renderer/src/components/template-study/container/left-dialog.vue +++ b/src/renderer/src/components/template-study/container/left-dialog.vue @@ -2,34 +2,44 @@ -
- +
-
    -
  • - - 预览 - {{ item.fileName }} -
  • -
+ + + + + {{ item.fileName }} +
+ 预览 + 删除 +
+
+
+
+
@@ -41,21 +51,18 @@
-
+
@@ -63,20 +70,19 @@ \ No newline at end of file + diff --git a/src/renderer/src/components/template-study/container/left.vue b/src/renderer/src/components/template-study/container/left.vue index d2b9285..4cd2bdc 100644 --- a/src/renderer/src/components/template-study/container/left.vue +++ b/src/renderer/src/components/template-study/container/left.vue @@ -2,8 +2,9 @@
- {{ curNode.edustage }}{{ curNode.edusubject }}{{ type == 1 ? '课标研读' : type == 2 ? '教材分析' : '考试分析' }} + {{ curNode.edustage }}{{ curNode.edusubject + }}{{ type == 1 ? '课标研读' : type == 2 ? '教材分析' : '考试分析' + }}
@@ -20,6 +21,7 @@ import { ref, onMounted, nextTick, reactive } from 'vue' import { sessionStore } from '@/utils/store' import PDF from '@/components/PdfJs/index.vue' import LeftDialog from './left-dialog.vue' +import emitter from '@/utils/mitt' const props = defineProps(['type']) @@ -29,6 +31,12 @@ const onClick = () => { showDialog.value = true } +emitter.on('changePdfUrl', async (data) => { + pdfUrl.value = '' + await nextTick() + pdfUrl.value = data.fileUrl +}) + // 加载PDF const pdfUrl = ref('') const curNode = reactive({}) @@ -36,16 +44,15 @@ onMounted(async () => { await nextTick() // 当前节点 let nodeData = sessionStore.get('subject.curNode') - Object.assign(curNode, nodeData); + Object.assign(curNode, nodeData) let data = sessionStore.get('subject.curBook') let fileurl = data.fileurl - if(props.type == 1){ + if (props.type == 1) { fileurl = `${data.edustage}-${data.edusubject}-课标.txt` } - if(fileurl == '') return + if (fileurl == '') return pdfUrl.value = import.meta.env.VITE_APP_RES_FILE_PATH + fileurl.replace('.txt', '.pdf') - }) @@ -53,6 +60,7 @@ onMounted(async () => { .container-left-page { height: 100%; flex-direction: column; + .container-left-header { height: 45px; background: #fff; @@ -70,4 +78,4 @@ onMounted(async () => { flex: 1; } } - \ No newline at end of file + diff --git a/src/renderer/src/components/template-study/container/right.vue b/src/renderer/src/components/template-study/container/right.vue index 543c928..e2cba23 100644 --- a/src/renderer/src/components/template-study/container/right.vue +++ b/src/renderer/src/components/template-study/container/right.vue @@ -16,7 +16,7 @@
- + 删除 @@ -104,6 +104,12 @@ import { cloneDeep } from 'lodash' const props = defineProps(['type']) const { user } = useUserStore() +const params = reactive( + { + prompt: '', + dataset_id: '' + } +) const curMode = ref(2) const modeOptions = ref([ { @@ -112,7 +118,8 @@ const modeOptions = ref([ }, { label: '知识库模型', - value: 2 + value: 2, + disabled: false } ]) @@ -288,12 +295,7 @@ const onEdit = (index, item) => { } // 重新研读 -const params = reactive( - { - prompt: '', - dataset_id: '' - } -) + const prompt = ref('') // 重新研读 @@ -483,7 +485,18 @@ onMounted(() => { getTemplateList() let jsonKey = `${modeType.value}-${data.edustage}-${data.edusubject}` + + params.dataset_id = dataSetJson[jsonKey] + if(!params.dataset_id){ + curMode.value = 1 + modeOptions.value.forEach(item => { + if(item.value == 2){ + item.disabled = true + } + }) + } + // 获取百度千帆会话ID conversation_id.value = localStorage.getItem('conversation_id') if (!conversation_id.value) { diff --git a/src/renderer/src/views/teachingDesign/container/center.vue b/src/renderer/src/views/teachingDesign/container/center.vue index b6472fe..f3efd8b 100644 --- a/src/renderer/src/views/teachingDesign/container/center.vue +++ b/src/renderer/src/views/teachingDesign/container/center.vue @@ -22,24 +22,22 @@
- + From 5ff9a5387a2a4ee30783b4db54138ab8e23108c6 Mon Sep 17 00:00:00 2001 From: lyc Date: Wed, 15 Jan 2025 16:07:47 +0800 Subject: [PATCH 7/7] edit --- .../template-study/container/left-dialog.vue | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/components/template-study/container/left-dialog.vue b/src/renderer/src/components/template-study/container/left-dialog.vue index e251cc2..678b0ca 100644 --- a/src/renderer/src/components/template-study/container/left-dialog.vue +++ b/src/renderer/src/components/template-study/container/left-dialog.vue @@ -8,6 +8,7 @@
+ @@ -51,7 +52,7 @@
-
+
@@ -97,7 +98,7 @@ const props = defineProps({ const isPrev = (item) => { return computed(() => { - return ['pdf', 'png', 'jpg', 'jpeg', 'gif'].includes(getFileSuffix(item.fileUrl)) + return ['pdf', 'png', 'jpg', 'jpeg', 'gif', 'webp'].includes(getFileSuffix(item.fileUrl)) }) } @@ -135,12 +136,14 @@ const fileList = ref([]) const curFile = reactive({}) const getList = () => { docList({ - userId: userInfo.userId, - dataset_id: dataset_id.value + createUser: userInfo.userId, + datasetId: dataset_id.value }).then((res) => { fileList.value = [...res.rows] - Object.assign(curFile, fileList.value[0]) - curFileId.value = fileList.value[0].id + if(res.rows.length){ + Object.assign(curFile, fileList.value[0]) + curFileId.value = fileList.value[0].id + } }) }