diff --git a/web/client/assets/images/install/icon_zhengque.png b/web/client/assets/images/install/icon_zhengque.png
new file mode 100644
index 0000000..178d27b
Binary files /dev/null and b/web/client/assets/images/install/icon_zhengque.png differ
diff --git a/web/client/src/sections/install/actions/index.js b/web/client/src/sections/install/actions/index.js
index 932eed2..93e6a8a 100644
--- a/web/client/src/sections/install/actions/index.js
+++ b/web/client/src/sections/install/actions/index.js
@@ -1,7 +1,8 @@
'use strict';
import * as roles from './roles'
-
+import * as system from './system'
export default {
- ...roles
+ ...roles,
+ ...system
}
\ No newline at end of file
diff --git a/web/client/src/sections/install/actions/roles.js b/web/client/src/sections/install/actions/roles.js
index ff4b638..8663fca 100644
--- a/web/client/src/sections/install/actions/roles.js
+++ b/web/client/src/sections/install/actions/roles.js
@@ -76,37 +76,4 @@ export function deteleOrganizationAdmin (data) {//删除管理员
msg: { option: msg }, //删除管理员
reducer: {},
});
-}
-export function getProjectPoms (query) {//获取已绑定项目
- return (dispatch) => basicAction({
- type: "get",
- dispatch: dispatch,
- actionType: "GET_PROJECT_POMS",
- query: query,
- url: `${ApiTable.getProjectPoms}`,
- msg: { option: "获取已绑定项目" },
- reducer: { name: "ProjectPoms", params: { noClear: true } },
- });
-}
-export function getProjectAnxincloud (query) {//获取安心云项目
- return (dispatch) => basicAction({
- type: "get",
- dispatch: dispatch,
- actionType: "GET_PROJECT_ANXINCLOUD",
- query: query,
- url: `${ApiTable.getProjectAnxincloud}`,
- msg: { option: "获取安心云项目" },
- reducer: { name: "ProjectPoms", params: { noClear: true } },
- });
-}
-export function getProjectPmanage (query) {//获取PEP项目管理项目
- return (dispatch) => basicAction({
- type: "get",
- dispatch: dispatch,
- actionType: "GET_PROJECT_PMANAGE",
- query: query,
- url: `${ApiTable.getProjectPmanage}`,
- msg: { option: "获取PEP项目管理项目" },
- reducer: { name: "ProjectPoms", params: { noClear: true } },
- });
-}
+}
\ No newline at end of file
diff --git a/web/client/src/sections/install/actions/system.js b/web/client/src/sections/install/actions/system.js
new file mode 100644
index 0000000..a72847b
--- /dev/null
+++ b/web/client/src/sections/install/actions/system.js
@@ -0,0 +1,81 @@
+'use strict';
+
+import { ApiTable, basicAction } from '$utils'
+
+export function getProjectPoms (query) {//获取已绑定项目
+ return (dispatch) => basicAction({
+ type: "get",
+ dispatch: dispatch,
+ actionType: "GET_PROJECT_POMS",
+ query: query,
+ url: `${ApiTable.getProjectPoms}`,
+ msg: { option: "获取已绑定项目" },
+ reducer: { name: "ProjectPoms", params: { noClear: true } },
+ });
+}
+export function getProjectAnxincloud (query) {//获取安心云项目
+ return (dispatch) => basicAction({
+ type: "get",
+ dispatch: dispatch,
+ actionType: "GET_PROJECT_ANXINCLOUD",
+ query: query,
+ url: `${ApiTable.getProjectAnxincloud}`,
+ msg: { option: "获取安心云项目" },
+ reducer: { name: "ProjectPoms", params: { noClear: true } },
+ });
+}
+export function getProjectPmanage (query) {//获取PEP项目管理项目
+ return (dispatch) => basicAction({
+ type: "get",
+ dispatch: dispatch,
+ actionType: "GET_PROJECT_PMANAGE",
+ query: query,
+ url: `${ApiTable.getProjectPmanage}`,
+ msg: { option: "获取PEP项目管理项目" },
+ reducer: { name: "ProjectPoms", params: { noClear: true } },
+ });
+}
+export function getProjectAppList (query) {//获取应用列表
+ return (dispatch) => basicAction({
+ type: "get",
+ dispatch: dispatch,
+ actionType: "GET_PROJECT_APPLIST",
+ query: query,
+ url: `${ApiTable.getProjectAppList}`,
+ msg: { option: "获取应用列表" },
+ reducer: { name: "ProjectPoms", params: { noClear: true } },
+ });
+}
+export function postProjectBind (data) {//绑定安心云、项目管理项目
+ let msg = ''
+ if (data) {
+ msg = data.msg
+ }
+ return (dispatch) =>
+ basicAction({
+ type: "post",
+ dispatch: dispatch,
+ data,
+ actionType: "POST_PROJECT_BIND",
+ url: `${ApiTable.postProjectBind}`,
+ msg: { option: msg },
+ reducer: { name: "" },
+ });
+}
+export function deleteProjectBind (data) {//删除安心云、项目管理项目绑定关系
+ let bindId = ''
+ let msg = ''
+ if (data) {
+ bindId = data.bindId
+ msg = data.msg
+ }
+ return (dispatch) =>
+ basicAction({
+ type: "del",
+ dispatch: dispatch,
+ actionType: "DEL_PROJECT_BIND",
+ url: `${ApiTable.deleteProjectBind.replace("{bindId}", bindId)}`,
+ msg: { option: msg }, //删除安心云、项目管理项目绑定关系
+ reducer: {},
+ });
+}
\ No newline at end of file
diff --git a/web/client/src/sections/install/components/systemModal.jsx b/web/client/src/sections/install/components/systemModal.jsx
index c5fdbe2..8a38063 100644
--- a/web/client/src/sections/install/components/systemModal.jsx
+++ b/web/client/src/sections/install/components/systemModal.jsx
@@ -1,7 +1,7 @@
import React, { useState, useRef, useEffect } from "react";
import { connect } from "react-redux";
-import { Modal, Form, Input, Button } from "@douyinfe/semi-ui";
-import { IconAlertCircle } from '@douyinfe/semi-icons';
+import { Modal, Form, ArrayField, Tag } from "@douyinfe/semi-ui";
+import { IconAlertCircle, IconAlertTriangle } from '@douyinfe/semi-icons';
function adminModal (props) {
@@ -13,19 +13,25 @@ function adminModal (props) {
systemEdit,//是否是编辑
peplist,//项企项目列表
anxincloudList,//安心云项目列表
- pepProjectId
+ appList,//应用列表
+ pepProjectId,//已选择项企id
+ pepname,//修改时自定义项目名称
+ anxincloudArr,//修改时已经选择的安心云列表
+ anxinDelete,//修改时安心云项目有删除,显示提示信息
+ appArr,//修改时添加应用
+ bindId
} = props;
const { install } = actions;
const form = useRef();//表单
const [custom, setCustom] = useState(false); //是否是自定义项目
- const [appList, setAppList] = useState([
- {
- name: '',
- url: ''
- }
- ]); //添加应用列表
+ const [myprojectType, setMyprojectType] = useState('pep'); //是否是自定义项目
//初始化
useEffect(() => {
+ if (pepname) {
+ setCustom(true)
+ setMyprojectType('axy')
+ }
+ console.log('appArr',appArr);
// if (editObj.id) {
// let departmentList = []
// for (let i = 0; i < pepList.length; i++) {
@@ -45,21 +51,31 @@ function adminModal (props) {
form.current
.validate()
.then((values) => {
- if (adminEdit) {
- // dispatch(install.deteleOrganizationAdmin({id:editObj.id,msg:''})).then(
- // dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId, msg: '修改管理员' })).then((res) => {//获取项企(PEP)全部部门及其下用户
- // if (res.success) {
- // close();
- // }
- // })
- // )
+ if (systemEdit) {
+ let appArr = []
+ for (let i = 0; i < values.appId.length; i++) {
+ appArr.push(JSON.parse(values.appId[i]).id)
+ }
+ let bindObj = JSON.parse(JSON.stringify(values))
+ bindObj.appId = appArr
+ dispatch(install.postProjectBind({ ...bindObj,bindId:bindId, msg: '修改映射关系' })).then((res) => {//获取项企(PEP)全部部门及其下用户
+ if (res.success) {
+ close();
+ }
+ })
}
else {
- // dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId, msg: '新增管理员' })).then((res) => {//获取项企(PEP)全部部门及其下用户
- // if (res.success) {
- // close();
- // }
- // })
+ let appArr = []
+ for (let i = 0; i < values.appId.length; i++) {
+ appArr.push(JSON.parse(values.appId[i]).id)
+ }
+ let bindObj = JSON.parse(JSON.stringify(values))
+ bindObj.appId = appArr
+ dispatch(install.postProjectBind({ ...bindObj, msg: '添加映射关系' })).then((res) => {//获取项企(PEP)全部部门及其下用户
+ if (res.success) {
+ close();
+ }
+ })
}
})
}
@@ -67,9 +83,18 @@ function adminModal (props) {
close();
//点击弹框取消 左边按钮
}
- function onChange (value, index) {
- console.log('value', value);
- console.log('index', index);
+ const renderMultipleWithCustomTag = (optionNode, { onClose }) => {
+ const content = (
+