Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bkunyun
Commits
78fd7303
Commit
78fd7303
authored
Oct 24, 2022
by
chenshouchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 删除模板完成
parent
7d03e5ab
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
4 deletions
+48
-4
api_manager.ts
src/api/api_manager.ts
+1
-0
resourceCenter.ts
src/api/resourceCenter.ts
+12
-1
index.tsx
...ourceCenter/UserResources/UserResourcesTemplate/index.tsx
+35
-3
No files found.
src/api/api_manager.ts
View file @
78fd7303
...
@@ -58,6 +58,7 @@ const RESTAPI = {
...
@@ -58,6 +58,7 @@ const RESTAPI = {
API_ACTOR_ENV_OPTIONS
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/actorenv/usableenv`
,
// 查询用户应用环境下拉
API_ACTOR_ENV_OPTIONS
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/actorenv/usableenv`
,
// 查询用户应用环境下拉
API_SAVE_OPERATOR
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/workflow/custom/actor`
,
// 保存自定义批流算子
API_SAVE_OPERATOR
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/workflow/custom/actor`
,
// 保存自定义批流算子
API_WORKFLOWSPEC_LIST
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/workbench/product/workflowspec/list`
,
// 模板列表 所有的
API_WORKFLOWSPEC_LIST
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/workbench/product/workflowspec/list`
,
// 模板列表 所有的
API_WORKFLOWSPEC_DELETE
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/workbench/workflowspec/delete`
,
// 删除模板
};
};
export
default
RESTAPI
;
export
default
RESTAPI
;
src/api/resourceCenter.ts
View file @
78fd7303
...
@@ -122,6 +122,16 @@ const saveOperator = (params: any) => {
...
@@ -122,6 +122,16 @@ const saveOperator = (params: any) => {
});
});
};
};
// 删除工作流模板
const
deleteWorkflowspec
=
(
params
:
{
id
:
string
})
=>
{
return
request
({
url
:
`
${
Api
.
API_WORKFLOWSPEC_DELETE
}
`
,
method
:
"delete"
,
params
});
};
export
{
export
{
...
@@ -134,5 +144,6 @@ export {
...
@@ -134,5 +144,6 @@ export {
getActorenvDetail
,
getActorenvDetail
,
getActorEnvOptions
,
getActorEnvOptions
,
getWorkflowspecList
,
getWorkflowspecList
,
saveOperator
saveOperator
,
deleteWorkflowspec
};
};
src/views/ResourceCenter/UserResources/UserResourcesTemplate/index.tsx
View file @
78fd7303
...
@@ -6,25 +6,27 @@ import MySelect from "@/components/mui/MySelect";
...
@@ -6,25 +6,27 @@ import MySelect from "@/components/mui/MySelect";
import
Add
from
"@mui/icons-material/Add"
;
import
Add
from
"@mui/icons-material/Add"
;
import
CardTable
from
"@/components/CommonComponents/CardTable"
;
import
CardTable
from
"@/components/CommonComponents/CardTable"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
{
getWorkflowspecList
}
from
"@/api/resourceCenter"
;
import
{
getWorkflowspecList
,
deleteWorkflowspec
}
from
"@/api/resourceCenter"
;
// import AddTemplate from "./AddTemplate
";
import
MyDialog
from
"@/components/mui/MyDialog
"
;
import
templateIcon
from
"@/assets/resourceCenter/templateIcon.svg"
;
import
templateIcon
from
"@/assets/resourceCenter/templateIcon.svg"
;
import
{
useStores
}
from
"@/store"
;
import
{
useStores
}
from
"@/store"
;
import
{
toJS
}
from
"mobx"
;
import
{
toJS
}
from
"mobx"
;
import
ProductSelect
from
"@/components/BusinessComponents/ProductSelect"
;
import
ProductSelect
from
"@/components/BusinessComponents/ProductSelect"
;
import
WorkFlowEdit
from
"@/views/WorkFlowEdit"
;
import
WorkFlowEdit
from
"@/views/WorkFlowEdit"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
style
from
"./index.module.css"
;
import
style
from
"./index.module.css"
;
const
UserResourcesTemplate
=
observer
(()
=>
{
const
UserResourcesTemplate
=
observer
(()
=>
{
const
[
title
,
setTitle
]
=
useState
(
""
);
const
[
title
,
setTitle
]
=
useState
(
""
);
const
Message
=
useMessage
();
const
[
showAddTemplate
,
setShowAddTemplate
]
=
useState
(
false
);
const
[
showAddTemplate
,
setShowAddTemplate
]
=
useState
(
false
);
const
[
showProductSelect
,
setShowProductSelect
]
=
useState
(
false
);
const
[
showProductSelect
,
setShowProductSelect
]
=
useState
(
false
);
const
[
showDeleteDialog
,
setShowDeleteDialog
]
=
useState
(
false
);
const
[
templateId
,
setTemplateId
]
=
useState
(
""
);
const
[
templateId
,
setTemplateId
]
=
useState
(
""
);
const
[
product
,
setProduct
]
=
useState
(
""
);
// 搜索列表用
const
[
product
,
setProduct
]
=
useState
(
""
);
// 搜索列表用
const
[
productId
,
setProductId
]
=
useState
(
""
);
// 新增模板用
const
[
productId
,
setProductId
]
=
useState
(
""
);
// 新增模板用
const
[
list
,
setList
]
=
useState
([]);
const
[
list
,
setList
]
=
useState
([]);
const
{
productListStore
}
=
useStores
();
const
{
productListStore
}
=
useStores
();
console
.
log
(
toJS
(
productListStore
));
const
getProductName
=
(
productId
:
string
)
=>
{
const
getProductName
=
(
productId
:
string
)
=>
{
let
res
=
"-"
;
let
res
=
"-"
;
toJS
(
productListStore
.
productList
).
forEach
((
item
)
=>
{
toJS
(
productListStore
.
productList
).
forEach
((
item
)
=>
{
...
@@ -67,6 +69,10 @@ const UserResourcesTemplate = observer(() => {
...
@@ -67,6 +69,10 @@ const UserResourcesTemplate = observer(() => {
color
:
"rgba(138, 144, 153, 1)"
,
color
:
"rgba(138, 144, 153, 1)"
,
marginRight
:
"12px"
,
marginRight
:
"12px"
,
}
}
}
}
onClick=
{
()
=>
{
setShowDeleteDialog
(
true
);
setTemplateId
(
item
.
id
);
}
}
></
MyButton
>
></
MyButton
>
<
MyButton
text=
"查看"
variant=
"outlined"
></
MyButton
>
<
MyButton
text=
"查看"
variant=
"outlined"
></
MyButton
>
</
div
>
</
div
>
...
@@ -89,6 +95,21 @@ const UserResourcesTemplate = observer(() => {
...
@@ -89,6 +95,21 @@ const UserResourcesTemplate = observer(() => {
});
});
},
[
run
,
title
,
product
]);
},
[
run
,
title
,
product
]);
const
{
run
:
deleteWorkflowspecFn
}
=
useMyRequest
(
deleteWorkflowspec
,
{
onSuccess
:
()
=>
{
Message
.
success
(
"删除成功"
);
setShowDeleteDialog
(
false
);
run
({
productId
:
product
===
"all"
?
""
:
product
,
title
,
});
},
});
const
deleteConfirm
=
()
=>
{
deleteWorkflowspecFn
({
id
:
templateId
});
};
return
(
return
(
<
div
className=
{
style
.
template
}
>
<
div
className=
{
style
.
template
}
>
<
div
className=
{
style
.
top
}
>
<
div
className=
{
style
.
top
}
>
...
@@ -147,6 +168,17 @@ const UserResourcesTemplate = observer(() => {
...
@@ -147,6 +168,17 @@ const UserResourcesTemplate = observer(() => {
}
}
}
}
></
ProductSelect
>
></
ProductSelect
>
)
}
)
}
{
showDeleteDialog
&&
(
<
MyDialog
onClose=
{
()
=>
setShowDeleteDialog
(
false
)
}
onConfirm=
{
()
=>
deleteConfirm
()
}
open=
{
showDeleteDialog
}
isText=
{
true
}
title=
"提示"
>
确定要删除这个模板吗?
</
MyDialog
>
)
}
</
div
>
</
div
>
);
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment