Commit e52d9962 authored by chenshouchao's avatar chenshouchao

自定义、公共模板列表接口替换

parent 059b4969
...@@ -27,7 +27,7 @@ const RESTAPI = { ...@@ -27,7 +27,7 @@ const RESTAPI = {
API_USER_PERMISSION_LIST: `${BACKEND_API_URI_PREFIX}/uaa/routes/privilege/list`, //获取用户包含的权限列表 API_USER_PERMISSION_LIST: `${BACKEND_API_URI_PREFIX}/uaa/routes/privilege/list`, //获取用户包含的权限列表
API_WORKBENCH_TEMPLATE_LIST: `${BACKEND_API_URI_PREFIX}/cpp/workbench/project/workflowspec`, //查询项目下工作流模板列表 API_WORKBENCH_TEMPLATE_LIST: `${BACKEND_API_URI_PREFIX}/cpp/workbench/project/workflowspec`, //查询项目下工作流模板列表
API_WORKBENCH_DELETE_TEMPLATE: `${BACKEND_API_URI_PREFIX}/cpp/workbench/project/workflowspec`, //项目管理员-删除工作流模板 API_WORKBENCH_DELETE_TEMPLATE: `${BACKEND_API_URI_PREFIX}/cpp/workbench/project/workflowspec`, //项目管理员-删除工作流模板
API_WORKBENCH_ADD_TEMPLATE_LIST: `${BACKEND_API_URI_PREFIX}/cpp/workbench/product/workflowspec`, //项目管理员-添加工作流模板-模板列表 API_WORKBENCH_ADD_TEMPLATE_LIST: `${BACKEND_API_URI_PREFIX}/cpp/workbench/project/notfavoritedworkflowspec`, //项目管理员-添加工作流模板-模板列表
API_WORKBENCH_ADD_TEMPLATE: `${BACKEND_API_URI_PREFIX}/cpp/workbench/project/workflowspec`, //项目管理员-添加工作流模板-提交 API_WORKBENCH_ADD_TEMPLATE: `${BACKEND_API_URI_PREFIX}/cpp/workbench/project/workflowspec`, //项目管理员-添加工作流模板-提交
API_FETCH_TEMPLATE_INFO: `${BACKEND_API_URI_PREFIX}/cpp/workbench/workflowspec`, //点击使用模版查看模版详情 API_FETCH_TEMPLATE_INFO: `${BACKEND_API_URI_PREFIX}/cpp/workbench/workflowspec`, //点击使用模版查看模版详情
API_WORK_FLOW_JOB: `${BACKEND_API_URI_PREFIX}/cpp/workbench/workflowjob`, //点击任务列表查看任务详情 API_WORK_FLOW_JOB: `${BACKEND_API_URI_PREFIX}/cpp/workbench/workflowjob`, //点击任务列表查看任务详情
......
...@@ -55,7 +55,7 @@ const deleteWorkbenchTemplate = (params: workflowspecDeleteTemplateParams) => { ...@@ -55,7 +55,7 @@ const deleteWorkbenchTemplate = (params: workflowspecDeleteTemplateParams) => {
type workflowspecGetAddTemplateParams = { type workflowspecGetAddTemplateParams = {
projectId?: string; projectId?: string;
productId: string; productId: string;
title?: string; keyword?: string;
creator?: string; creator?: string;
}; };
......
const FileSelect = () => {
return <div>FileSelect</div>;
};
export default FileSelect;
...@@ -16,6 +16,7 @@ import _ from "lodash"; ...@@ -16,6 +16,7 @@ import _ from "lodash";
import { observer } from "mobx-react-lite"; import { observer } from "mobx-react-lite";
import noData from "../../../../../../assets/project/noTemplate.svg"; import noData from "../../../../../../assets/project/noTemplate.svg";
import { ICustomTemplate } from "../../interface"; import { ICustomTemplate } from "../../interface";
import { useMessage } from "@/components/MySnackbar";
import { import {
getAddWorkbenchTemplate, getAddWorkbenchTemplate,
addWorkbenchTemplate, addWorkbenchTemplate,
...@@ -40,13 +41,12 @@ const radioOptions = [ ...@@ -40,13 +41,12 @@ const radioOptions = [
const AddTemplate = observer((props: IAddTemplateProps) => { const AddTemplate = observer((props: IAddTemplateProps) => {
const { currentProjectStore } = useStores(); const { currentProjectStore } = useStores();
const Message = useMessage();
const projectId = toJS(currentProjectStore.currentProjectInfo.id); const projectId = toJS(currentProjectStore.currentProjectInfo.id);
const productId = toJS(currentProjectStore.currentProductInfo.id); const productId = toJS(currentProjectStore.currentProductInfo.id);
const { setShowAddTemplate, getTemplateInfo } = props; const { setShowAddTemplate, getTemplateInfo } = props;
const [title, setTitle] = useState(""); const [title, setTitle] = useState("");
const handleSearch = (value: string) => {};
/** 可增加模板列表 */ /** 可增加模板列表 */
const [addTemplateList, setAddTemplateList] = useState([]); const [addTemplateList, setAddTemplateList] = useState([]);
...@@ -73,6 +73,7 @@ const AddTemplate = observer((props: IAddTemplateProps) => { ...@@ -73,6 +73,7 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
// 项目管理员-添加工作流模板-提交 // 项目管理员-添加工作流模板-提交
const { run: addTemplate } = useMyRequest(addWorkbenchTemplate, { const { run: addTemplate } = useMyRequest(addWorkbenchTemplate, {
onSuccess: (result: any) => { onSuccess: (result: any) => {
Message.success("添加成功");
setSelectTemplateData([]); setSelectTemplateData([]);
setShowAddTemplate(false); setShowAddTemplate(false);
getTemplateInfo({ getTemplateInfo({
...@@ -125,26 +126,27 @@ const AddTemplate = observer((props: IAddTemplateProps) => { ...@@ -125,26 +126,27 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
setAddTemplateList([]); setAddTemplateList([]);
if (templateType === "public") { if (templateType === "public") {
getAddTemplateList({ getAddTemplateList({
// projectId: projectId as string, projectId: projectId as string,
productId: productId as string, productId: productId as string,
title, creator: "root",
keyword: title,
}); });
} else { } else {
getAddTemplateList({ getAddTemplateList({
// projectId: projectId as string, projectId: projectId as string,
productId: productId as string, productId: productId as string,
creator: userName, creator: userName,
title, keyword: title,
}); });
} }
}, [ }, [
setSelectTemplateData, setSelectTemplateData,
getAddTemplateList, getAddTemplateList,
productId, productId,
projectId,
templateType, templateType,
title, title,
]); ]);
// projectId,
// title, // title,
useEffect(() => { useEffect(() => {
...@@ -189,10 +191,6 @@ const AddTemplate = observer((props: IAddTemplateProps) => { ...@@ -189,10 +191,6 @@ const AddTemplate = observer((props: IAddTemplateProps) => {
value={title} value={title}
onChange={(e: any) => { onChange={(e: any) => {
setTitle(e.target.value); setTitle(e.target.value);
// _.debounce(() => {
// // searchTemplateNameCallback(e.target.value);
// handleSearch(e.target.value);
// }, 200)();
}} }}
placeholder="输入关键词搜索" placeholder="输入关键词搜索"
size="small" size="small"
......
...@@ -412,6 +412,7 @@ const WorkFlowEdit = observer((props: IProps) => { ...@@ -412,6 +412,7 @@ const WorkFlowEdit = observer((props: IProps) => {
error={titleHelper.error} error={titleHelper.error}
helperText={titleHelper.helperText} helperText={titleHelper.helperText}
style={{ margin: "20px 0" }} style={{ margin: "20px 0" }}
disabled={id ? true : false}
></MyInput> ></MyInput>
<MyInput <MyInput
value={version} value={version}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment