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