思维导图插件,酉阳版本升级
This commit is contained in:
parent
35d8bdf13f
commit
66bc555445
|
@ -6,11 +6,11 @@ directories:
|
||||||
win:
|
win:
|
||||||
executableName: 育人酉数平台
|
executableName: 育人酉数平台
|
||||||
icon: resources/yy-logo.png
|
icon: resources/yy-logo.png
|
||||||
target:
|
# target:
|
||||||
- target: nsis
|
# - target: nsis
|
||||||
arch:
|
# arch:
|
||||||
- x64
|
# - x64
|
||||||
- ia32
|
# - ia32
|
||||||
files:
|
files:
|
||||||
- '!**/.vscode/*'
|
- '!**/.vscode/*'
|
||||||
- '!src/*'
|
- '!src/*'
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "aix-win-ws",
|
"name": "aix-win-ws",
|
||||||
"version": "2.5.16",
|
"version": "2.5.17",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./out/main/index.js",
|
"main": "./out/main/index.js",
|
||||||
"author": "上海交大重庆人工智能研究院",
|
"author": "上海交大重庆人工智能研究院",
|
||||||
|
@ -44,7 +44,7 @@
|
||||||
"@vue-office/excel": "^1.7.11",
|
"@vue-office/excel": "^1.7.11",
|
||||||
"@vue-office/pdf": "^2.0.2",
|
"@vue-office/pdf": "^2.0.2",
|
||||||
"@vueuse/core": "^10.11.0",
|
"@vueuse/core": "^10.11.0",
|
||||||
"aix-plugins-aitools": "^1.1.9",
|
"aix-plugins-aitools": "^1.1.10",
|
||||||
"animate.css": "^4.1.1",
|
"animate.css": "^4.1.1",
|
||||||
"circular-json": "^0.5.9",
|
"circular-json": "^0.5.9",
|
||||||
"clipboard": "^2.0.11",
|
"clipboard": "^2.0.11",
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 79 KiB |
Binary file not shown.
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 21 KiB |
|
@ -25,8 +25,7 @@ import log from 'electron-log/renderer' // 渲染进程日志-文件记录
|
||||||
import customComponent from '@/components/common' // 自定义组件
|
import customComponent from '@/components/common' // 自定义组件
|
||||||
import plugins from './plugins' // plugins插件
|
import plugins from './plugins' // plugins插件
|
||||||
import useUserStore from '@/store/modules/user'
|
import useUserStore from '@/store/modules/user'
|
||||||
import aiAudio from 'aix-plugins-aitools' // 文字转语音插件
|
import aiTools from 'aix-plugins-aitools' // 文字转语音插件
|
||||||
import aiMindMap from 'aix-plugins-aitools' // 思维导图插件
|
|
||||||
import '../../../node_modules/aix-plugins-aitools/aitools.css'
|
import '../../../node_modules/aix-plugins-aitools/aitools.css'
|
||||||
|
|
||||||
|
|
||||||
|
@ -92,8 +91,7 @@ app.use(router)
|
||||||
.use(plugins)
|
.use(plugins)
|
||||||
.use(Icon)
|
.use(Icon)
|
||||||
.use(Directive)
|
.use(Directive)
|
||||||
.use(aiAudio)
|
.use(aiTools)
|
||||||
.use(aiMindMap)
|
|
||||||
.use(VMdEditor)
|
.use(VMdEditor)
|
||||||
.mount('#app')
|
.mount('#app')
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<aiMindMap v-if="showMap" :reloadData="reloadData"
|
<aiMindMap
|
||||||
:title="title" :prompt="prompt" :url="url"
|
|
||||||
@exportImg="exportImg"
|
@exportImg="exportImg"
|
||||||
@createMindMap="createMindMap"
|
@createMindMap="createMindMap"
|
||||||
@reloadMindMap="reloadMindMap"
|
@reloadMindMap="reloadMindMap"
|
||||||
|
ref="mindMapRef"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {onMounted, reactive, ref} from "vue";
|
import {onMounted, ref} from "vue";
|
||||||
// import aiMindMap from './mindMapAITools.vue'
|
// import aiMindMap from './mindMapAITools.vue'
|
||||||
import {sessionStore} from "@/utils/store";
|
import {sessionStore} from "@/utils/store";
|
||||||
import {editTempResult, modelList, tempResult, tempSave} from "@/api/mode";
|
import {editTempResult, modelList, tempResult, tempSave} from "@/api/mode";
|
||||||
|
@ -70,13 +70,20 @@
|
||||||
|
|
||||||
const reloadData = ref('')
|
const reloadData = ref('')
|
||||||
const tempData = ref(null)
|
const tempData = ref(null)
|
||||||
|
const mindMapRef = ref(null)
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const { rows } = await modelList({ model: 5 })
|
const { rows } = await modelList({ model: 5 })
|
||||||
curModel.value = rows.find((item) => item.name.indexOf('思维导图') != -1)
|
curModel.value = rows.find((item) => item.name.indexOf('思维导图') != -1)
|
||||||
await getTempData()
|
await getTempData()
|
||||||
reloadData.value = tempData.value?tempData.value.content:'';
|
reloadData.value = tempData.value?tempData.value.content:'';
|
||||||
await getPrompt()
|
await getPrompt()
|
||||||
showMap.value = true
|
mindMapRef.value.initData({
|
||||||
|
reloadData: reloadData.value,
|
||||||
|
title: title.value,
|
||||||
|
prompt: prompt.value,
|
||||||
|
url: url.value
|
||||||
|
})
|
||||||
|
// showMap.value = true
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
<!--
|
<!--
|
||||||
props: {
|
initData参数:
|
||||||
|
{
|
||||||
prompt: 思维导图prompt数据,
|
prompt: 思维导图prompt数据,
|
||||||
title: 标题
|
title: 标题
|
||||||
url: 请求地址
|
url: 请求地址
|
||||||
reloadData: 初始化数据,如果为空则默认去获取
|
reloadData: 初始化数据,如果为空则默认去获取
|
||||||
}
|
}
|
||||||
|
|
||||||
|
回调函数
|
||||||
emits: {
|
emits: {
|
||||||
exportImg: 导出图片按钮回调
|
exportImg: 导出图片按钮回调
|
||||||
createMindMap: 创建思维导图回调,初始化生成
|
createMindMap: 创建思维导图回调,初始化生成
|
||||||
|
@ -44,7 +47,7 @@ emits: {
|
||||||
class="input-with-select"
|
class="input-with-select"
|
||||||
>
|
>
|
||||||
<template #append>
|
<template #append>
|
||||||
<el-icon size="20" style="cursor: pointer;" @click="sendMessage"><Position /></el-icon>
|
<el-icon size="20" style="cursor: pointer;" @click="reConversation"><Position /></el-icon>
|
||||||
</template>
|
</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<!-- <el-input style="float: left;" v-model="textVal" size="large" placeholder="请输入信息对内容进一步调整" /><el-button>发送</el-button>-->
|
<!-- <el-input style="float: left;" v-model="textVal" size="large" placeholder="请输入信息对内容进一步调整" /><el-button>发送</el-button>-->
|
||||||
|
@ -65,7 +68,7 @@ export default {
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, reactive, onMounted, watch } from 'vue'
|
import { ref, reactive, onMounted, watch, defineExpose } from 'vue'
|
||||||
import { Position } from "@element-plus/icons-vue"
|
import { Position } from "@element-plus/icons-vue"
|
||||||
import { Transformer } from 'markmap-lib'
|
import { Transformer } from 'markmap-lib'
|
||||||
import mindmap from 'vue3-mindmap'
|
import mindmap from 'vue3-mindmap'
|
||||||
|
@ -75,23 +78,11 @@ import axios from 'axios'
|
||||||
|
|
||||||
const transformer = new Transformer()
|
const transformer = new Transformer()
|
||||||
const emits = defineEmits(['exportImg', 'createMindMap', 'reloadMindMap'])
|
const emits = defineEmits(['exportImg', 'createMindMap', 'reloadMindMap'])
|
||||||
const props = defineProps({
|
const props = reactive({
|
||||||
prompt: {
|
prompt: '',
|
||||||
type: String,
|
url: '',
|
||||||
default: ''
|
title: '',
|
||||||
},
|
reloadData: ''
|
||||||
url: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
},
|
|
||||||
reloadData: {
|
|
||||||
type: String,
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
const textVal = ref(``)
|
const textVal = ref(``)
|
||||||
|
@ -120,12 +111,14 @@ const params = reactive({
|
||||||
dataset_id: '',
|
dataset_id: '',
|
||||||
template: ''
|
template: ''
|
||||||
})
|
})
|
||||||
|
|
||||||
const messages = ref([
|
const messages = ref([
|
||||||
{
|
{
|
||||||
role: 'user',
|
role: 'user',
|
||||||
content: ''
|
content: ''
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
const aiConversation = async () => {
|
const aiConversation = async () => {
|
||||||
params.prompt = props.prompt
|
params.prompt = props.prompt
|
||||||
loadingAnswer.value = true
|
loadingAnswer.value = true
|
||||||
|
@ -144,7 +137,7 @@ const aiConversation = async () => {
|
||||||
emits('createMindMap', resMarkdown.value, res)
|
emits('createMindMap', resMarkdown.value, res)
|
||||||
}
|
}
|
||||||
|
|
||||||
const sendMessage = async () => {
|
const reConversation = async () => {
|
||||||
loadingAnswer.value = true
|
loadingAnswer.value = true
|
||||||
rootData.value = null
|
rootData.value = null
|
||||||
let data = {
|
let data = {
|
||||||
|
@ -198,15 +191,29 @@ const outputImg = () => {
|
||||||
emits('exportImg', dataUrl)
|
emits('exportImg', dataUrl)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 初始化
|
|
||||||
onMounted(() => {
|
const initData = (datas) => {
|
||||||
|
Object.assign(props, datas)
|
||||||
// 获取提示词
|
// 获取提示词
|
||||||
if (props.reloadData) {
|
if (props.reloadData) {
|
||||||
resMarkdown.value = props.reloadData
|
resMarkdown.value = props.reloadData
|
||||||
}else {
|
}else {
|
||||||
aiConversation()
|
aiConversation()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
initData,
|
||||||
|
outputImg,
|
||||||
|
aiConversation,
|
||||||
|
reConversation
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// 初始化
|
||||||
|
onMounted(() => {
|
||||||
|
// initData()
|
||||||
|
})
|
||||||
|
|
||||||
// 监听 initValue 的变化
|
// 监听 initValue 的变化
|
||||||
watch(() => resMarkdown.value, () => {
|
watch(() => resMarkdown.value, () => {
|
||||||
const { root } = transformer.transform(resMarkdown.value)
|
const { root } = transformer.transform(resMarkdown.value)
|
||||||
|
|
Loading…
Reference in New Issue