From 34e74c5ec6260f70aa22e19350452db1d4e45709 Mon Sep 17 00:00:00 2001 From: lyc Date: Mon, 25 Nov 2024 10:59:56 +0800 Subject: [PATCH] edit --- .../template-study/container/dialog.vue | 8 ++--- .../template-study/container/header.vue | 13 +++++--- .../template-study/container/pdf.vue | 2 ++ .../container/adjust-dialog.vue | 7 +++- .../examination-analysis/container/dialog.vue | 33 ++++++++++++------- 5 files changed, 42 insertions(+), 21 deletions(-) diff --git a/src/renderer/src/components/template-study/container/dialog.vue b/src/renderer/src/components/template-study/container/dialog.vue index 801158f..d8765cd 100644 --- a/src/renderer/src/components/template-study/container/dialog.vue +++ b/src/renderer/src/components/template-study/container/dialog.vue @@ -56,10 +56,10 @@ const title = computed(() => { const radio = ref(1) const radioList = ref([ { label: '浏览研读', value: 1 }, - { label: '跨学科研读', value: 2 }, - { label: '跨学段研读', value: 3 }, - { label: '课标修订研读', value: 4 }, - { label: '自由研读', value: 5 }, + // { label: '跨学科研读', value: 2 }, + // { label: '跨学段研读', value: 3 }, + // { label: '课标修订研读', value: 4 }, + // { label: '自由研读', value: 5 }, ]) const list = ref([ { diff --git a/src/renderer/src/components/template-study/container/header.vue b/src/renderer/src/components/template-study/container/header.vue index 0846bb1..b6b368b 100644 --- a/src/renderer/src/components/template-study/container/header.vue +++ b/src/renderer/src/components/template-study/container/header.vue @@ -1,7 +1,7 @@
+ 添加提示词 + 一键研读
@@ -53,9 +55,7 @@ const props = defineProps({ default: 1 } }) -watch(() => props.type, (newValue) => { - console.log(newValue, 'newValue2'); -}, { immediate: true }); + const emit = defineEmits(['changeTemp', 'onRead']) @@ -104,6 +104,11 @@ const onAdd = () => { wordDialog.value = true } +const onClick = () =>{ + if(props.type == 1) return + showDialog.value = true +} + onUnmounted(() => { emitter.off('onGetMain') }) diff --git a/src/renderer/src/components/template-study/container/pdf.vue b/src/renderer/src/components/template-study/container/pdf.vue index c83dfd0..dad00fb 100644 --- a/src/renderer/src/components/template-study/container/pdf.vue +++ b/src/renderer/src/components/template-study/container/pdf.vue @@ -15,6 +15,8 @@ const pdfUrl = ref('') onMounted(async () =>{ await nextTick() const { fileurl } = sessionStore.get('subject.curBook') + console.log(fileurl,'fileurl'); + pdfUrl.value = import.meta.env.VITE_APP_RES_FILE_PATH + fileurl.replace('.txt','.pdf') }) diff --git a/src/renderer/src/views/examination-analysis/container/adjust-dialog.vue b/src/renderer/src/views/examination-analysis/container/adjust-dialog.vue index 3b23962..7f98bc1 100644 --- a/src/renderer/src/views/examination-analysis/container/adjust-dialog.vue +++ b/src/renderer/src/views/examination-analysis/container/adjust-dialog.vue @@ -60,6 +60,7 @@ import { sessionStore } from '@/utils/store' import { ElMessage } from 'element-plus' import { dataSetJson } from '@/utils/comm.js' import useUserStore from '@/store/modules/user' +import emitter from '@/utils/mitt'; const userInfo = useUserStore().user const textarea = ref('') @@ -132,6 +133,8 @@ const saveAdjust = (item) =>{ } + + const curFile = reactive({}) const dataset_id = ref('') const fileList = ref([]) @@ -144,7 +147,9 @@ const getList = () =>{ Object.assign(curFile, fileList.value[0]) }) } - +emitter.on('curFile', (item) =>{ + changeFile(item) +}) const changeFile = (val) =>{ Object.assign(curFile, val); diff --git a/src/renderer/src/views/examination-analysis/container/dialog.vue b/src/renderer/src/views/examination-analysis/container/dialog.vue index 5e81e27..8a01069 100644 --- a/src/renderer/src/views/examination-analysis/container/dialog.vue +++ b/src/renderer/src/views/examination-analysis/container/dialog.vue @@ -8,16 +8,16 @@
- +
    -
  • - - {{ item.name }} +
  • + + {{ item.fileName }}
@@ -47,6 +47,7 @@ import { sessionStore } from '@/utils/store' import { dataSetJson } from '@/utils/comm.js' import { ElMessage } from 'element-plus' import useUserStore from '@/store/modules/user' +import emitter from '@/utils/mitt'; const userInfo = useUserStore().user const uploadFileUrl = ref(import.meta.env.VITE_APP_BASE_API + "/common/upload"); @@ -93,11 +94,7 @@ const changeRadio = () => { }) } } -const activeIndex = ref(-1) - -const clickItem = (index) => { - activeIndex.value = index -} +const activeIndex = ref(0) const dataset_id = ref('') @@ -109,7 +106,7 @@ const onSuccess = async (response) =>{ dataset_id: dataset_id.value } const res = await completion(data) - console.log(res) + if(res.data.code != 200) return let docData = { fileUrl: response.url, @@ -123,19 +120,30 @@ const onSuccess = async (response) =>{ } const { msg } = await addDoc(docData) ElMessage.success(msg) + getList() } const curNode = reactive({}) +const fileList = ref([]) +const curFile = reactive({}) const getList = () =>{ docList({ userId: userInfo.userId, dataset_id: dataset_id.value }).then( res =>{ - console.log(res) + fileList.value = [...res.rows] + Object.assign(curFile, fileList.value[0]) }) } +const clickItem = (index, item) => { + activeIndex.value = index + Object.assign(curFile, item) + emitter.emit('curFile',item) +} + + onMounted(() =>{ let data = sessionStore.get('subject.curNode') @@ -174,6 +182,7 @@ onMounted(() =>{ flex-wrap: wrap; li { + width: 130px; display: flex; flex-direction: column; font-size: 13px; -- 2.44.0.windows.1