|
@@ -7,12 +7,12 @@ import { sceneTitleColumn, sceneTimeColumn, getSceneActions } from 'views/scene'
|
|
|
import { getSceneIdent, getScenesIdents } from 'store'
|
|
|
import { SelectScenes } from './select'
|
|
|
import style from '../style.module.scss'
|
|
|
+import { confirm } from 'utils'
|
|
|
|
|
|
import type { Example, Scene } from "api";
|
|
|
import type { SceneColumn } from 'views/scene'
|
|
|
import type { SelectScenesProps } from './select'
|
|
|
|
|
|
-
|
|
|
export type ExampleScenesProps = Pick<Example, 'caseId'> & {
|
|
|
onClose: () => void,
|
|
|
onChangeScenes: (newSceneIds: SelectScenesProps['sceneIdents'], oldSceneIds: SelectScenesProps['sceneIdents']) => void
|
|
@@ -38,19 +38,21 @@ export const ExampleScenes = (props: ExampleScenesProps) => {
|
|
|
...getSceneActions(record, true),
|
|
|
{
|
|
|
text: '删除',
|
|
|
- action: () => {
|
|
|
- const newIdents = idents.map(ident => {
|
|
|
- if (ident.type === record.type) {
|
|
|
- const sceneIdent = getSceneIdent(record)
|
|
|
- return {
|
|
|
- ...ident,
|
|
|
- numList: ident.numList.filter(num => num !== sceneIdent)
|
|
|
+ action: async () => {
|
|
|
+ if (await confirm('删除该场景,将同时从案件和融合模型中移除,确定要删除吗?')) {
|
|
|
+ const newIdents = idents.map(ident => {
|
|
|
+ if (ident.type === record.type) {
|
|
|
+ const sceneIdent = getSceneIdent(record)
|
|
|
+ return {
|
|
|
+ ...ident,
|
|
|
+ numList: ident.numList.filter(num => num !== sceneIdent)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return ident
|
|
|
}
|
|
|
- } else {
|
|
|
- return ident
|
|
|
- }
|
|
|
- })
|
|
|
- selectChange(newIdents)
|
|
|
+ })
|
|
|
+ selectChange(newIdents)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
]
|