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