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/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 }}
+