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
b6651d99
Commit
b6651d99
authored
Oct 24, 2022
by
wuyongsheng
Browse files
Options
Browse Files
Download
Plain Diff
feat: 解决冲突
parents
5daf5172
78fd7303
Hide 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 @
b6651d99
...
...
@@ -58,6 +58,7 @@ const RESTAPI = {
API_ACTOR_ENV_OPTIONS
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/actorenv/usableenv`
,
// 查询用户应用环境下拉
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_DELETE
:
`
${
BACKEND_API_URI_PREFIX
}
/cpp/workbench/workflowspec/delete`
,
// 删除模板
};
export
default
RESTAPI
;
src/api/resourceCenter.ts
View file @
b6651d99
...
...
@@ -122,6 +122,16 @@ const saveOperator = (params: any) => {
});
};
// 删除工作流模板
const
deleteWorkflowspec
=
(
params
:
{
id
:
string
})
=>
{
return
request
({
url
:
`
${
Api
.
API_WORKFLOWSPEC_DELETE
}
`
,
method
:
"delete"
,
params
});
};
export
{
...
...
@@ -134,5 +144,6 @@ export {
getActorenvDetail
,
getActorEnvOptions
,
getWorkflowspecList
,
saveOperator
saveOperator
,
deleteWorkflowspec
};
src/views/ResourceCenter/UserResources/UserResourcesTemplate/index.tsx
View file @
b6651d99
...
...
@@ -6,25 +6,27 @@ import MySelect from "@/components/mui/MySelect";
import
Add
from
"@mui/icons-material/Add"
;
import
CardTable
from
"@/components/CommonComponents/CardTable"
;
import
useMyRequest
from
"@/hooks/useMyRequest"
;
import
{
getWorkflowspecList
}
from
"@/api/resourceCenter"
;
// import AddTemplate from "./AddTemplate
";
import
{
getWorkflowspecList
,
deleteWorkflowspec
}
from
"@/api/resourceCenter"
;
import
MyDialog
from
"@/components/mui/MyDialog
"
;
import
templateIcon
from
"@/assets/resourceCenter/templateIcon.svg"
;
import
{
useStores
}
from
"@/store"
;
import
{
toJS
}
from
"mobx"
;
import
ProductSelect
from
"@/components/BusinessComponents/ProductSelect"
;
import
WorkFlowEdit
from
"@/views/WorkFlowEdit"
;
import
{
useMessage
}
from
"@/components/MySnackbar"
;
import
style
from
"./index.module.css"
;
const
UserResourcesTemplate
=
observer
(()
=>
{
const
[
title
,
setTitle
]
=
useState
(
""
);
const
Message
=
useMessage
();
const
[
showAddTemplate
,
setShowAddTemplate
]
=
useState
(
false
);
const
[
showProductSelect
,
setShowProductSelect
]
=
useState
(
false
);
const
[
showDeleteDialog
,
setShowDeleteDialog
]
=
useState
(
false
);
const
[
templateId
,
setTemplateId
]
=
useState
(
""
);
const
[
product
,
setProduct
]
=
useState
(
""
);
// 搜索列表用
const
[
productId
,
setProductId
]
=
useState
(
""
);
// 新增模板用
const
[
list
,
setList
]
=
useState
([]);
const
{
productListStore
}
=
useStores
();
console
.
log
(
toJS
(
productListStore
));
const
getProductName
=
(
productId
:
string
)
=>
{
let
res
=
"-"
;
toJS
(
productListStore
.
productList
).
forEach
((
item
)
=>
{
...
...
@@ -67,6 +69,10 @@ const UserResourcesTemplate = observer(() => {
color
:
"rgba(138, 144, 153, 1)"
,
marginRight
:
"12px"
,
}
}
onClick=
{
()
=>
{
setShowDeleteDialog
(
true
);
setTemplateId
(
item
.
id
);
}
}
></
MyButton
>
<
MyButton
text=
"查看"
variant=
"outlined"
></
MyButton
>
</
div
>
...
...
@@ -89,6 +95,21 @@ const UserResourcesTemplate = observer(() => {
});
},
[
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
(
<
div
className=
{
style
.
template
}
>
<
div
className=
{
style
.
top
}
>
...
...
@@ -147,6 +168,17 @@ const UserResourcesTemplate = observer(() => {
}
}
></
ProductSelect
>
)
}
{
showDeleteDialog
&&
(
<
MyDialog
onClose=
{
()
=>
setShowDeleteDialog
(
false
)
}
onConfirm=
{
()
=>
deleteConfirm
()
}
open=
{
showDeleteDialog
}
isText=
{
true
}
title=
"提示"
>
确定要删除这个模板吗?
</
MyDialog
>
)
}
</
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