diff --git a/electron.vite.config.mjs b/electron.vite.config.mjs
index af97384..dd0b3a1 100644
--- a/electron.vite.config.mjs
+++ b/electron.vite.config.mjs
@@ -49,14 +49,21 @@ export default defineConfig({
changeOrigin: true, // 改变请求的起源
rewrite: (path) => path.replace(/^\/parth/, '') // 重写路径
},
- '/v1': {
+ '/api': {
target: 'https://ai.ysaix.com:7864',
changeOrigin: true,
- pathRewrite: { '^/v1': '' }
+ pathRewrite: { '^/api': '' }
}
},
},
plugins: [vue(), WindiCSS(),vitePpt()],
assetsInclude:('**/*.woff', '**/*.woff2', '**/*.ttf'),
+ css: {
+ preprocessorOptions: {
+ scss: {
+ silenceDeprecations: ['legacy-js-api']
+ }
+ }
+ }
}
})
diff --git a/package.json b/package.json
index 1e81b04..249f906 100644
--- a/package.json
+++ b/package.json
@@ -33,14 +33,18 @@
"@electron-toolkit/utils": "^3.0.0",
"@electron/remote": "^2.1.2",
"@element-plus/icons-vue": "^2.3.1",
+ "@icon-park/vue-next": "^1.4.2",
"@vitejs/plugin-vue-jsx": "^4.0.0",
"@vue-office/docx": "^1.6.2",
"@vue-office/excel": "^1.7.11",
"@vue-office/pdf": "^2.0.2",
"@vueuse/core": "^10.11.0",
+ "animate.css": "^4.1.1",
"circular-json": "^0.5.9",
+ "clipboard": "^2.0.11",
"cropperjs": "^1.6.2",
"crypto-js": "^4.2.0",
+ "dexie": "3.0.3",
"echarts": "^5.5.1",
"electron-dl-manager": "^3.0.0",
"electron-log": "^5.1.7",
@@ -49,6 +53,9 @@
"element-china-area-data": "^6.1.0",
"element-plus": "^2.8.0",
"fabric": "^5.3.0",
+ "file-saver": "^2.0.5",
+ "hfmath": "^0.0.2",
+ "html-to-image": "^1.11.11",
"im_electron_sdk": "^8.0.5904",
"js-cookie": "^3.0.5",
"jsencrypt": "^3.3.2",
@@ -56,28 +63,13 @@
"less": "^4.2.0",
"less-loader": "^7.3.0",
"lodash": "^4.17.21",
+ "mitt": "^3.0.1",
+ "nanoid": "^5.0.7",
"node-addon-api": "^8.1.0",
+ "number-precision": "^1.6.0",
"pdfjs-dist": "4.4.168",
"pinia": "^2.1.7",
"pinia-plugin-persistedstate": "^3.2.1",
- "spark-md5": "^3.0.2",
- "vite-plugin-electron": "^0.28.8",
- "vue-qr": "^4.0.9",
- "vue-router": "^4.4.0",
- "whiteboard_lyc": "^0.1.3",
- "xgplayer": "^3.0.19",
- "xlsx": "^0.18.5",
-
- "@icon-park/vue-next": "^1.4.2",
- "animate.css": "^4.1.1",
- "clipboard": "^2.0.11",
- "dexie": "3.0.3",
- "file-saver": "^2.0.5",
- "hfmath": "^0.0.2",
- "html-to-image": "^1.11.11",
- "mitt": "^3.0.1",
- "nanoid": "^5.0.7",
- "number-precision": "^1.6.0",
"pptxgenjs": "^3.12.0",
"pptxtojson": "^1.0.3",
"prosemirror-commands": "^1.6.0",
@@ -91,32 +83,25 @@
"prosemirror-schema-list": "^1.4.1",
"prosemirror-state": "^1.4.3",
"prosemirror-view": "^1.33.9",
+ "spark-md5": "^3.0.2",
"svg-arc-to-cubic-bezier": "^3.2.0",
"svg-pathdata": "^7.1.0",
"tinycolor2": "^1.6.0",
"tippy.js": "^6.3.7",
- "vuedraggable": "^4.1.0"
+ "vite-plugin-electron": "^0.28.8",
+ "vue": "^3.4.34",
+ "vue-qr": "^4.0.9",
+ "vue-router": "^4.4.0",
+ "vuedraggable": "^4.1.0",
+ "whiteboard_lyc": "^0.1.3",
+ "xgplayer": "^3.0.19",
+ "xlsx": "^0.18.5"
},
"devDependencies": {
- "@electron-toolkit/eslint-config": "^1.0.2",
- "@rushstack/eslint-patch": "^1.10.3",
- "@vitejs/plugin-vue": "^5.0.5",
- "@vue/eslint-config-prettier": "^9.0.0",
- "axios": "^1.7.2",
- "electron": "^31.0.2",
- "electron-builder": "^24.13.3",
- "electron-vite": "^2.3.0",
- "eslint": "^8.57.0",
- "eslint-plugin-vue": "^9.26.0",
- "prettier": "^3.3.2",
- "sass": "^1.77.6",
- "vite": "^5.3.1",
- "vite-plugin-windicss": "^1.9.3",
- "vue": "^3.4.30",
- "windicss": "^3.5.6",
-
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
+ "@electron-toolkit/eslint-config": "^1.0.2",
+ "@rushstack/eslint-patch": "^1.10.3",
"@tsconfig/node18": "^18.2.2",
"@types/crypto-js": "^4.2.1",
"@types/file-saver": "^2.0.7",
@@ -124,11 +109,25 @@
"@types/node": "^18.19.3",
"@types/svg-arc-to-cubic-bezier": "^3.2.2",
"@types/tinycolor2": "^1.4.6",
+ "@vitejs/plugin-vue": "^5.0.5",
+ "@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^12.0.0",
"@vue/tsconfig": "^0.5.0",
+ "axios": "^1.7.2",
+ "electron": "^31.0.2",
+ "electron-builder": "^24.13.3",
+ "electron-vite": "^2.3.0",
+ "eslint": "^8.57.0",
+ "eslint-plugin-vue": "^9.26.0",
"husky": "^8.0.3",
"npm-run-all2": "^6.1.1",
+ "prettier": "^3.3.2",
+ "sass": "^1.77.6",
"typescript": "~5.3.0",
- "vue-tsc": "^1.8.25"
+ "vite": "^5.3.1",
+ "vite-plugin-windicss": "^1.9.3",
+ "vue": "^3.4.30",
+ "vue-tsc": "^1.8.25",
+ "windicss": "^3.5.6"
}
}
diff --git a/src/renderer/src/api/mode/index.js b/src/renderer/src/api/mode/index.js
index 1ec7f76..3f2288a 100644
--- a/src/renderer/src/api/mode/index.js
+++ b/src/renderer/src/api/mode/index.js
@@ -1,7 +1,69 @@
import request from '@/utils/request'
import axios from 'axios'
-let rootPath = import.meta.env.VITE_APP_ENV === 'production' ? "https://ai.ysaix.com:7864" : '';
+let rootPath = import.meta.env.VITE_APP_ENV === 'production' ? 'https://ai.ysaix.com:7864' : ''
+
+export function conversation(data) {
+ return axios({
+ url: rootPath + '/v1/api/new_conversation',
+ method: 'get',
+ headers: {
+ Authorization: 'Bearer ragflow-IwNzMxMTIyOGY0ZTExZWZiOGE2MDI0Mm',
+ 'Content-Type': 'application/json'
+ },
+ data: data
+ })
+}
+
+// 进行课标研读对话
+export function completion(data) {
+ return axios({
+ url: rootPath + '/api/v1/parse/docs',
+ method: 'post',
+ headers: {
+ Authorization: 'Bearer ragflow-IwMDI1MGU2YTU3NjExZWZiNWEzMDI0Mm',
+ 'Content-Type': 'application/json',
+ Accept: '*/*'
+ },
+ data: data
+ })
+}
+
+// 添加提示词 (系统预设)
+export function addKeyWords(data) {
+ return request({
+ url: '/education/llmModel/copy',
+ method: 'post',
+ data
+ })
+}
+
+// 添加子模板
+export function addChildTemp(data) {
+ return request({
+ url: '/education/llmModel',
+ method: 'post',
+ data
+ })
+}
+
+// 编辑子模板
+export function editChildTemp(data) {
+ return request({
+ url: '/education/llmModel',
+ method: 'put',
+ data
+ })
+}
+
+// 删除子模板
+export function removeChildTemp(id) {
+ return request({
+ url: '/education/llmModel/' + id,
+ method: 'delete'
+ })
+}
+
// 查询模板列表
export function modelList(params) {
return request({
@@ -11,28 +73,37 @@ export function modelList(params) {
})
}
-export function conversation(data) {
- return axios({
- url: rootPath + '/v1/api/new_conversation',
- method: 'get',
- headers: {
- 'Authorization':'Bearer ragflow-IwNzMxMTIyOGY0ZTExZWZiOGE2MDI0Mm',
- 'Content-Type': 'application/json',
- },
- data: data
+// 保存模板 结果
+export function tempSave(data) {
+ return request({
+ url: '/education/result',
+ method: 'post',
+ data
})
}
-// 进行课标研读对话
-export function completion(data) {
- return axios({
- url: rootPath + '/v1/api/completion',
- method: 'post',
- headers: {
- 'Authorization':'Bearer ragflow-IwNzMxMTIyOGY0ZTExZWZiOGE2MDI0Mm',
- 'Content-Type': 'application/json',
- 'Accept': '*/*'
- },
- data: data
+// 修改模板结果
+export function editTempResult(data) {
+ return request({
+ url: '/education/result',
+ method: 'put',
+ data
})
}
+
+// 查询模板结果
+export function tempResult(params) {
+ return request({
+ url: '/education/result/list',
+ method: 'get',
+ params
+ })
+}
+
+// 删除模板结果
+export function tempResultRemove(id) {
+ return request({
+ url: `/education/result/${id}`,
+ method: 'get',
+ })
+}
\ No newline at end of file
diff --git a/src/renderer/src/assets/iconfont/iconfont.css b/src/renderer/src/assets/iconfont/iconfont.css
index 3bf7ac3..bb304c2 100644
--- a/src/renderer/src/assets/iconfont/iconfont.css
+++ b/src/renderer/src/assets/iconfont/iconfont.css
@@ -1,8 +1,8 @@
@font-face {
font-family: "iconfont"; /* Project id 4723712 */
- src: url('iconfont.woff2?t=1731393731097') format('woff2'),
- url('iconfont.woff?t=1731393731097') format('woff'),
- url('iconfont.ttf?t=1731393731097') format('truetype');
+ src: url('iconfont.woff2?t=1731913617367') format('woff2'),
+ url('iconfont.woff?t=1731913617367') format('woff'),
+ url('iconfont.ttf?t=1731913617367') format('truetype');
}
.iconfont {
@@ -13,6 +13,10 @@
-moz-osx-font-smoothing: grayscale;
}
+.icon-baocun:before {
+ content: "\e60e";
+}
+
.icon-tihuan:before {
content: "\e7ab";
}
diff --git a/src/renderer/src/assets/iconfont/iconfont.js b/src/renderer/src/assets/iconfont/iconfont.js
index 8cf9c4d..7893178 100644
--- a/src/renderer/src/assets/iconfont/iconfont.js
+++ b/src/renderer/src/assets/iconfont/iconfont.js
@@ -1 +1 @@
-window._iconfont_svg_string_4723712='',(l=>{var h=(c=(c=document.getElementsByTagName("script"))[c.length-1]).getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var a,v,t,i,z,p=function(h,c){c.parentNode.insertBefore(h,c)};if(h&&!l.__iconfont__svg__cssinject__){l.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(h){console&&console.log(h)}}a=function(){var h,c=document.createElement("div");c.innerHTML=l._iconfont_svg_string_4723712,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(h=document.body).firstChild?p(c,h.firstChild):h.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(v=function(){document.removeEventListener("DOMContentLoaded",v,!1),a()},document.addEventListener("DOMContentLoaded",v,!1)):document.attachEvent&&(t=a,i=l.document,z=!1,o(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,M())})}function M(){z||(z=!0,t())}function o(){try{i.documentElement.doScroll("left")}catch(h){return void setTimeout(o,50)}M()}})(window);
\ No newline at end of file
+window._iconfont_svg_string_4723712='',(l=>{var h=(c=(c=document.getElementsByTagName("script"))[c.length-1]).getAttribute("data-injectcss"),c=c.getAttribute("data-disable-injectsvg");if(!c){var a,v,t,i,z,p=function(h,c){c.parentNode.insertBefore(h,c)};if(h&&!l.__iconfont__svg__cssinject__){l.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(h){console&&console.log(h)}}a=function(){var h,c=document.createElement("div");c.innerHTML=l._iconfont_svg_string_4723712,(c=c.getElementsByTagName("svg")[0])&&(c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.width=0,c.style.height=0,c.style.overflow="hidden",c=c,(h=document.body).firstChild?p(c,h.firstChild):h.appendChild(c))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(a,0):(v=function(){document.removeEventListener("DOMContentLoaded",v,!1),a()},document.addEventListener("DOMContentLoaded",v,!1)):document.attachEvent&&(t=a,i=l.document,z=!1,o(),i.onreadystatechange=function(){"complete"==i.readyState&&(i.onreadystatechange=null,M())})}function M(){z||(z=!0,t())}function o(){try{i.documentElement.doScroll("left")}catch(h){return void setTimeout(o,50)}M()}})(window);
\ No newline at end of file
diff --git a/src/renderer/src/assets/iconfont/iconfont.json b/src/renderer/src/assets/iconfont/iconfont.json
index dc37f21..0db8c88 100644
--- a/src/renderer/src/assets/iconfont/iconfont.json
+++ b/src/renderer/src/assets/iconfont/iconfont.json
@@ -5,6 +5,13 @@
"css_prefix_text": "icon-",
"description": "",
"glyphs": [
+ {
+ "icon_id": "11467388",
+ "name": "保存",
+ "font_class": "baocun",
+ "unicode": "e60e",
+ "unicode_decimal": 58894
+ },
{
"icon_id": "12730938",
"name": "替换",
diff --git a/src/renderer/src/assets/iconfont/iconfont.ttf b/src/renderer/src/assets/iconfont/iconfont.ttf
index 9d086c8..e7e25fc 100644
Binary files a/src/renderer/src/assets/iconfont/iconfont.ttf and b/src/renderer/src/assets/iconfont/iconfont.ttf differ
diff --git a/src/renderer/src/assets/iconfont/iconfont.woff b/src/renderer/src/assets/iconfont/iconfont.woff
index 91fa738..96e1662 100644
Binary files a/src/renderer/src/assets/iconfont/iconfont.woff and b/src/renderer/src/assets/iconfont/iconfont.woff differ
diff --git a/src/renderer/src/assets/iconfont/iconfont.woff2 b/src/renderer/src/assets/iconfont/iconfont.woff2
index 3e6e9e3..51f82f7 100644
Binary files a/src/renderer/src/assets/iconfont/iconfont.woff2 and b/src/renderer/src/assets/iconfont/iconfont.woff2 differ
diff --git a/src/renderer/src/components/template-study/container/adjust-dialog.vue b/src/renderer/src/components/template-study/container/adjust-dialog.vue
index 77e2e6c..0258471 100644
--- a/src/renderer/src/components/template-study/container/adjust-dialog.vue
+++ b/src/renderer/src/components/template-study/container/adjust-dialog.vue
@@ -44,6 +44,7 @@ import { ref, reactive, onMounted } from 'vue'
import { conversation, completion } from '@/api/mode/index'
import { sessionStore } from '@/utils/store'
import { ElMessage } from 'element-plus'
+import { dataSetJson } from '@/utils/comm.js'
const textarea = ref('')
@@ -55,6 +56,10 @@ const props = defineProps({
default: () => {
return { name: '11' }
}
+ },
+ modeType: {
+ type: Number,
+ default: 1
}
})
@@ -77,31 +82,22 @@ const send = () =>{
const curNode = reactive({})
const params = reactive(
{
- "conversation_id": "",
- "messages": [
- {
- "role": "user",
- "content": ""
- }
- ],
- "quote": false,
- "stream": false
+ prompt: '',
+ dataset_id: ''
}
)
// 获取会话ID
-const getConversation = async (val) => {
- const result = await conversation()
- params.conversation_id = result.data.data.id
+const getConversation = (val) => {
+
getCompletion(val)
}
// 大模型对话
const getCompletion = async (val) => {
try {
- params.messages[0].content = `根据${curNode.edustage}语文课标${props.item.name},${val}`
- const res = await completion(params)
- console.log('对话结果===》', res)
- let answer = res.data.data.answer
+ params.prompt = `根据${curNode.edustage}${curNode.edusubject}课标${props.item.name},${val}`
+ const { data } = await completion(params)
+ let answer = data.answer
msgList.value.push({
type: 'robot',
msg: answer,
@@ -121,7 +117,11 @@ const saveAdjust = (item) =>{
onMounted(() => {
let data = sessionStore.get('subject.curNode')
Object.assign(curNode, data);
-
+ let text = props.modeType == 1 ? '课标': props.modeType == 2 ? '教材' : '考试'
+
+ let jsonKey = `${text}-${data.edustage}-${data.edusubject}`
+ params.dataset_id = dataSetJson[jsonKey]
+
})
diff --git a/src/renderer/src/components/template-study/container/edit-dialog.vue b/src/renderer/src/components/template-study/container/edit-dialog.vue
index 852c78b..fa7ff5d 100644
--- a/src/renderer/src/components/template-study/container/edit-dialog.vue
+++ b/src/renderer/src/components/template-study/container/edit-dialog.vue
@@ -28,6 +28,7 @@
diff --git a/src/renderer/src/components/template-study/container/header.vue b/src/renderer/src/components/template-study/container/header.vue
index 12f42ab..94af579 100644
--- a/src/renderer/src/components/template-study/container/header.vue
+++ b/src/renderer/src/components/template-study/container/header.vue
@@ -10,7 +10,7 @@
*当前模板为系统预设,不支持直接操作。会复制一份为自己的然后再操作
{{ el.name }}
+