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('该节点禁用删除')
|
||||
|
||||
Reference in New Issue
Block a user