|
@@ -270,7 +270,7 @@
|
|
@close="delDialog.show = false"
|
|
@close="delDialog.show = false"
|
|
@confirm="delComponent"
|
|
@confirm="delComponent"
|
|
>
|
|
>
|
|
- 确定删除该数据吗?删除后不可恢复!
|
|
|
|
|
|
+ {{current?'检测到该图纸正在被编辑,':''}}确定删除该数据吗?{{current?'画布将被清空,':''}}删除后不可恢复!
|
|
</t-dialog>
|
|
</t-dialog>
|
|
<!-- <t-dialog
|
|
<!-- <t-dialog
|
|
v-if="chargeDialog.show"
|
|
v-if="chargeDialog.show"
|
|
@@ -387,7 +387,7 @@
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
import { onMounted, onUnmounted, reactive, ref } from 'vue';
|
|
import { onMounted, onUnmounted, reactive, ref } from 'vue';
|
|
-import { useRouter } from 'vue-router';
|
|
|
|
|
|
+import { useRouter, useRoute } from 'vue-router';
|
|
import { MessagePlugin } from 'tdesign-vue-next';
|
|
import { MessagePlugin } from 'tdesign-vue-next';
|
|
import axios from 'axios';
|
|
import axios from 'axios';
|
|
import { deepClone } from '@meta2d/core';
|
|
import { deepClone } from '@meta2d/core';
|
|
@@ -446,6 +446,7 @@ import Structure from './Structure.vue';
|
|
const { user } = useUser();
|
|
const { user } = useUser();
|
|
const { setFolder, getFolder } = useFolder();
|
|
const { setFolder, getFolder } = useFolder();
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
|
+const route = useRoute();
|
|
const { select } = useSelection();
|
|
const { select } = useSelection();
|
|
const activedGroup = ref('');
|
|
const activedGroup = ref('');
|
|
const activeAssets = ref('system');
|
|
const activeAssets = ref('system');
|
|
@@ -1778,6 +1779,11 @@ const onMenu = async (val: string) => {
|
|
hideContextmenu();
|
|
hideContextmenu();
|
|
break;
|
|
break;
|
|
case 'del':
|
|
case 'del':
|
|
|
|
+ if(route.query.id===id){
|
|
|
|
+ current.value = true;
|
|
|
|
+ }else{
|
|
|
|
+ current.value = false;
|
|
|
|
+ }
|
|
delDialog.show = true;
|
|
delDialog.show = true;
|
|
Object.assign(delDialog.contextmenuObj, contextmenu);
|
|
Object.assign(delDialog.contextmenuObj, contextmenu);
|
|
break;
|
|
break;
|
|
@@ -1994,7 +2000,7 @@ const _delComponent = async () => {
|
|
|
|
|
|
MessagePlugin.success('删除成功');
|
|
MessagePlugin.success('删除成功');
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+const current = ref(false);
|
|
const delComponent = async () => {
|
|
const delComponent = async () => {
|
|
// const id = contextmenu.component._id || contextmenu.component.id;
|
|
// const id = contextmenu.component._id || contextmenu.component.id;
|
|
if (['组件', '方案', '模板'].includes(activedGroup.value)) {
|
|
if (['组件', '方案', '模板'].includes(activedGroup.value)) {
|
|
@@ -2026,6 +2032,14 @@ const delComponent = async () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
);
|
|
);
|
|
|
|
+ if(current.value){
|
|
|
|
+ router.push({
|
|
|
|
+ path: '/',
|
|
|
|
+ query: {
|
|
|
|
+ r: Date.now() + '',
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ };
|
|
} else {
|
|
} else {
|
|
const id =
|
|
const id =
|
|
delDialog.contextmenuObj.component._id ||
|
|
delDialog.contextmenuObj.component._id ||
|
|
@@ -2042,7 +2056,7 @@ const delComponent = async () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
);
|
|
);
|
|
- }
|
|
|
|
|
|
+ // }
|
|
let fullname: string =
|
|
let fullname: string =
|
|
delDialog.contextmenuObj.component.fullname ||
|
|
delDialog.contextmenuObj.component.fullname ||
|
|
delDialog.contextmenuObj.component.image;
|
|
delDialog.contextmenuObj.component.image;
|
|
@@ -2059,6 +2073,7 @@ const delComponent = async () => {
|
|
fullnames: [fullname],
|
|
fullnames: [fullname],
|
|
physically: true,
|
|
physically: true,
|
|
});
|
|
});
|
|
|
|
+ }
|
|
delDialog.show = false;
|
|
delDialog.show = false;
|
|
delDialog.contextmenuObj = {};
|
|
delDialog.contextmenuObj = {};
|
|
|
|
|