Merge branch 'main' of http://18.167.251.121:10003/aidlab/FiDA_Front
This commit is contained in:
@@ -35,13 +35,10 @@
|
|||||||
import ColorPalette from './color-palette.vue'
|
import ColorPalette from './color-palette.vue'
|
||||||
import To3View from './to-3view.vue'
|
import To3View from './to-3view.vue'
|
||||||
import To3DModel from './to-3d-model.vue'
|
import To3DModel from './to-3d-model.vue'
|
||||||
import { ElMessageBox } from 'element-plus'
|
|
||||||
import { useI18n } from 'vue-i18n'
|
|
||||||
|
|
||||||
// import ToVideo from './to-video.vue'
|
// import ToVideo from './to-video.vue'
|
||||||
// import AddPrint from './add-print.vue'
|
// import AddPrint from './add-print.vue'
|
||||||
// import ToCAD from './to-cad.vue'
|
// import ToCAD from './to-cad.vue'
|
||||||
const { t: $t } = useI18n()
|
|
||||||
const components = [
|
const components = [
|
||||||
{
|
{
|
||||||
tier: NODE_DATATIER.CARDS_SELECT,
|
tier: NODE_DATATIER.CARDS_SELECT,
|
||||||
@@ -134,15 +131,8 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//删除功能卡片
|
//删除功能卡片
|
||||||
const onDeleteClick = () => {
|
const onDeleteClick = ()=>{
|
||||||
ElMessageBox.confirm($t('flowCanvas.deleteCardConfirm'), '', {
|
stateManager.deleteNode(attrs.node.id,{isElMessageBox:true})
|
||||||
confirmButtonText: $t('flowCanvas.confirm'),
|
|
||||||
cancelButtonText: $t('flowCanvas.cancel')
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
stateManager.deleteNode(attrs.node.id)
|
|
||||||
})
|
|
||||||
.catch(() => {})
|
|
||||||
}
|
}
|
||||||
const setDate = () => {
|
const setDate = () => {
|
||||||
for (const key in props.data) {
|
for (const key in props.data) {
|
||||||
|
|||||||
@@ -96,13 +96,13 @@
|
|||||||
.result-image {
|
.result-image {
|
||||||
width: 244px;
|
width: 244px;
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
border: 3px solid #d9d9d9;
|
border: 1px solid #d9d9d9;
|
||||||
box-shadow: 0px 15px 21px 0px #0000000d;
|
box-shadow: 0px 15px 21px 0px #0000000d;
|
||||||
padding: 25px 6px;
|
padding: 25px 6px;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
&.active{
|
&.active{
|
||||||
border-color: #ff7a51;
|
border: 3px solid #d9d9d9;
|
||||||
}
|
}
|
||||||
> .header {
|
> .header {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { ref, computed } from "vue";
|
import { ref, computed } from "vue";
|
||||||
import { NODE_TYPE } from '../tools/index.d'
|
import { NODE_TYPE } from '../tools/index.d'
|
||||||
|
import { ElMessageBox } from 'element-plus'
|
||||||
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
export interface NodesItem {
|
export interface NodesItem {
|
||||||
id: string
|
id: string
|
||||||
@@ -32,6 +34,7 @@ export class StateManager {
|
|||||||
flowManager: any
|
flowManager: any
|
||||||
nodeManager: any
|
nodeManager: any
|
||||||
toolManager: any
|
toolManager: any
|
||||||
|
t: any
|
||||||
// 设置管理器
|
// 设置管理器
|
||||||
setManager(options) {
|
setManager(options) {
|
||||||
options.eventManager && (this.eventManager = options.eventManager)
|
options.eventManager && (this.eventManager = options.eventManager)
|
||||||
@@ -91,6 +94,8 @@ export class StateManager {
|
|||||||
return arr
|
return arr
|
||||||
})
|
})
|
||||||
|
|
||||||
|
this.t = useI18n().t
|
||||||
|
|
||||||
}
|
}
|
||||||
/** 设置激活节点 */
|
/** 设置激活节点 */
|
||||||
setActiveNodeID(id: string) { this.activeNodeID.value = id }
|
setActiveNodeID(id: string) { this.activeNodeID.value = id }
|
||||||
@@ -100,7 +105,25 @@ export class StateManager {
|
|||||||
this.recordState()
|
this.recordState()
|
||||||
}
|
}
|
||||||
/** 删除节点 */
|
/** 删除节点 */
|
||||||
deleteNode(id: string) {
|
async deleteNode(id: string,{ isElMessageBox } = { isElMessageBox: false }) {
|
||||||
|
let deletePromise:any = true
|
||||||
|
if (isElMessageBox){
|
||||||
|
deletePromise = await new Promise<void>((resolve, reject) => {
|
||||||
|
ElMessageBox.confirm(
|
||||||
|
this.t('flowCanvas.deleteCardConfirm'),
|
||||||
|
'',
|
||||||
|
{
|
||||||
|
confirmButtonText: this.t('flowCanvas.confirm'),
|
||||||
|
cancelButtonText: this.t('flowCanvas.cancel'),
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
resolve(true)
|
||||||
|
}).catch(() => {
|
||||||
|
resolve(false)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
if (!deletePromise) return console.log('删除操作被取消')
|
||||||
const node = this.getNodeById(id)
|
const node = this.getNodeById(id)
|
||||||
if (!node) return console.warn(`没有找到指定id:${id}`)
|
if (!node) return console.warn(`没有找到指定id:${id}`)
|
||||||
if (node.data.disableDelete) return console.warn('该节点禁用删除')
|
if (node.data.disableDelete) return console.warn('该节点禁用删除')
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export const useProjectStore = defineStore('project', () => {
|
|||||||
const state = ref({// 项目参数
|
const state = ref({// 项目参数
|
||||||
id: '',
|
id: '',
|
||||||
nodeId: '',
|
nodeId: '',
|
||||||
|
nodeCreateTime: '',
|
||||||
})
|
})
|
||||||
|
|
||||||
const setProject = (obj: any) => {
|
const setProject = (obj: any) => {
|
||||||
@@ -20,6 +21,7 @@ export const useProjectStore = defineStore('project', () => {
|
|||||||
state.value = {
|
state.value = {
|
||||||
id: '',
|
id: '',
|
||||||
nodeId: '',
|
nodeId: '',
|
||||||
|
nodeCreateTime: '',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -221,7 +221,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
buffer += decoder.decode(value, { stream: true })
|
buffer += decoder.decode(value, { stream: true })
|
||||||
console.log('收到chunk',new Date().getTime());
|
|
||||||
|
|
||||||
// 优先按空行拆分事件块(SSE标准)
|
// 优先按空行拆分事件块(SSE标准)
|
||||||
let events = buffer.split(/\n\n/)
|
let events = buffer.split(/\n\n/)
|
||||||
@@ -470,9 +469,11 @@
|
|||||||
|
|
||||||
// 延迟设置新数据,确保 UI 有时间响应清空操作
|
// 延迟设置新数据,确保 UI 有时间响应清空操作
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
|
|
||||||
messageList.value = [...ancestorsList, ...currentList]
|
messageList.value = [...ancestorsList, ...currentList]
|
||||||
params.versionID = current?.id
|
params.versionID = current?.id
|
||||||
sketchList.value = imgList
|
sketchList.value = imgList
|
||||||
|
console.log('11111111111111',params.versionID);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="message-context loading" v-show="content.loading">
|
<div class="message-context loading" v-show="content.loading">
|
||||||
<!-- <img src="@/assets/images/generate-loading.gif" alt="loading" class="loading-gif" /> -->
|
|
||||||
<video
|
<video
|
||||||
src="@/assets/images/generate-loading.mp4"
|
src="@/assets/images/generate-loading.mp4"
|
||||||
autoplay
|
autoplay
|
||||||
@@ -195,9 +194,7 @@
|
|||||||
font-size: 1.4rem;
|
font-size: 1.4rem;
|
||||||
.message-wrapper {
|
.message-wrapper {
|
||||||
column-gap: 0.9rem;
|
column-gap: 0.9rem;
|
||||||
// align-items: flex-start;
|
|
||||||
&.is-user {
|
&.is-user {
|
||||||
// text-align: right;
|
|
||||||
flex-direction: row-reverse;
|
flex-direction: row-reverse;
|
||||||
column-gap: 1.3rem;
|
column-gap: 1.3rem;
|
||||||
}
|
}
|
||||||
@@ -228,9 +225,6 @@
|
|||||||
.operate {
|
.operate {
|
||||||
margin-top: 1.3rem;
|
margin-top: 1.3rem;
|
||||||
column-gap: 1.2rem;
|
column-gap: 1.2rem;
|
||||||
// &.is-user {
|
|
||||||
// justify-content: flex-end;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.img-list {
|
.img-list {
|
||||||
@@ -246,7 +240,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.loading-gif {
|
.loading-gif {
|
||||||
// width: 18.7rem;
|
|
||||||
height: 10rem;
|
height: 10rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin-left: -2.4rem;
|
margin-left: -2.4rem;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, onUnmounted, reactive, toRefs, watch } from 'vue'
|
import { ref, onMounted, onUnmounted, reactive, toRefs, watch } from 'vue'
|
||||||
import Tree from './tree/index.vue'
|
import Tree from './tree/index.vue'
|
||||||
import Detail from './detail/index.vue'
|
|
||||||
// import { versionsList } from './tools/versionsData'
|
// import { versionsList } from './tools/versionsData'
|
||||||
import { findAndAddChild, findAndRemoveChild } from '../../../../../utils/treeDiagram'
|
import { findAndAddChild, findAndRemoveChild } from '../../../../../utils/treeDiagram'
|
||||||
import { useProjectStore } from '@/stores'
|
import { useProjectStore } from '@/stores'
|
||||||
@@ -128,7 +127,7 @@ const {} = toRefs(data)
|
|||||||
v-model="versionTreeData.drawer"
|
v-model="versionTreeData.drawer"
|
||||||
:close-on-press-escape="false"
|
:close-on-press-escape="false"
|
||||||
:close-on-click-modal="false"
|
:close-on-click-modal="false"
|
||||||
:size="treeState ? '109rem' : '49rem'"
|
:size="treeState ? '73.5rem' : '73.5rem'"
|
||||||
body-class="versionTreeBody"
|
body-class="versionTreeBody"
|
||||||
:with-header="false"
|
:with-header="false"
|
||||||
>
|
>
|
||||||
@@ -172,11 +171,6 @@ const {} = toRefs(data)
|
|||||||
:key="treeKey"
|
:key="treeKey"
|
||||||
></Tree>
|
></Tree>
|
||||||
</div>
|
</div>
|
||||||
<div class="detail">
|
|
||||||
<Detail
|
|
||||||
v-model:selectItem="selectItem"
|
|
||||||
></Detail>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</div>
|
</div>
|
||||||
@@ -246,13 +240,7 @@ const {} = toRefs(data)
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
padding: 2.5rem 0 5.4rem 2.2rem;
|
padding: 2.5rem 4rem 5.4rem 4rem;
|
||||||
}
|
|
||||||
> .detail {
|
|
||||||
width: 35rem;
|
|
||||||
margin: 2.5rem 3rem 5.4rem 3.4rem;
|
|
||||||
height: calc(100% - 2.1rem - 5.4rem);
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,6 +118,10 @@ const {} = toRefs(data);
|
|||||||
@versionRestore="()=>emit('versionRestore')"
|
@versionRestore="()=>emit('versionRestore')"
|
||||||
@versionDelete="emit('versionDelete')"
|
@versionDelete="emit('versionDelete')"
|
||||||
></view2>
|
></view2>
|
||||||
|
<div class="nodeInfo">
|
||||||
|
<!-- <span class="versionsName">111</span> -->
|
||||||
|
<span class="versionsTime">{{ new Date(treeList.find(item=>item.id == props.selectItem.id)?.createdTime * 1000)?.toLocaleString?.() || 0 }}</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -130,6 +134,7 @@ const {} = toRefs(data);
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
&.view1{
|
&.view1{
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
&::-webkit-scrollbar {
|
&::-webkit-scrollbar {
|
||||||
@@ -141,6 +146,23 @@ const {} = toRefs(data);
|
|||||||
background-color: #f7f7f7;
|
background-color: #f7f7f7;
|
||||||
border-radius: var(--border-radius, 1rem);
|
border-radius: var(--border-radius, 1rem);
|
||||||
}
|
}
|
||||||
|
> .nodeInfo{
|
||||||
|
position: absolute;
|
||||||
|
right: 1.6rem;
|
||||||
|
top: 1.6rem;
|
||||||
|
padding: 0 1.6rem;
|
||||||
|
border: 2px solid #E6E6E7;
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: .4rem;
|
||||||
|
line-height: 3.6rem;
|
||||||
|
> span{
|
||||||
|
font-size: 1.2rem;
|
||||||
|
&.versionsName{
|
||||||
|
margin-right: .5rem;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -108,7 +108,7 @@ defineExpose({push})
|
|||||||
<template>
|
<template>
|
||||||
<div class="view2">
|
<div class="view2">
|
||||||
<div class="vueFlowBox">
|
<div class="vueFlowBox">
|
||||||
<div @click="toggleNodesDraggable">拖拽节点</div>
|
<!-- <div @click="toggleNodesDraggable">拖拽节点</div> -->
|
||||||
<VueFlow :nodes="nodes" @nodes-initialized="initialized" :edges="edges" @node-click="handleVueFlowNodeClick" :nodes-draggable="nodesDraggable">
|
<VueFlow :nodes="nodes" @nodes-initialized="initialized" :edges="edges" @node-click="handleVueFlowNodeClick" :nodes-draggable="nodesDraggable">
|
||||||
<template #node-InputNode="nodeProps">
|
<template #node-InputNode="nodeProps">
|
||||||
<InputNode v-bind="nodeProps" />
|
<InputNode v-bind="nodeProps" />
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
// agentRef.value?.inputRef?.addReportTag('Restore')
|
// agentRef.value?.inputRef?.addReportTag('Restore')
|
||||||
clearNodeChat({ projectId: projectStore.state.id, id: projectStore.state.nodeId }).then(
|
clearNodeChat({ projectId: projectStore.state.id, id: projectStore.state.nodeId }).then(
|
||||||
(res) => {
|
(res) => {
|
||||||
agentRef.value.setChatInfo(res)
|
agentRef.value.setChatInfo({ conversation: res, project: {} })
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user