Browse Source

系统映射

dev
deartibers 2 years ago
parent
commit
2290ad7d3d
  1. BIN
      web/client/assets/images/install/icon_zhengque.png
  2. 5
      web/client/src/sections/install/actions/index.js
  3. 35
      web/client/src/sections/install/actions/roles.js
  4. 81
      web/client/src/sections/install/actions/system.js
  5. 182
      web/client/src/sections/install/components/systemModal.jsx
  6. 251
      web/client/src/sections/install/containers/system.jsx
  7. 4
      web/client/src/utils/webapi.js

BIN
web/client/assets/images/install/icon_zhengque.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

5
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
}

35
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 } },
});
}
}

81
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: {},
});
}

182
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 = (
<Tag closable={true}
onClose={onClose}
size='large'>
{JSON.parse(optionNode.value).name}
</Tag>
);
return {
isRenderInTag: false,
content
};
}
return (
<>
@ -83,8 +108,8 @@ function adminModal (props) {
onCancel={handleCancel}
>
<div style={{ margin: "0px 25px" }}>
<div style={{ width: '100%', lineHeight: 2, background: '#F4F8FF', borderRadius: 2, border: '1px solid #C7E1FF', display: 'flex', alignItems: 'center' }}>
<div style={{ display: 'flex', alignItems: 'center', marginLeft: 12 }}><IconAlertCircle style={{ color: '#0F7EFB' }} /></div>
<div style={{ width: '100%', lineHeight: 2, background: '#F4F8FF', borderRadius: 2, border: '1px solid #C7E1FF', display: 'flex'}}>
<div style={{ display: 'flex',marginLeft: 12,marginTop:5.5}}><IconAlertCircle style={{ color: '#0F7EFB' }} /></div>
<div style={{ color: '#0F7EFB', fontSize: 12, marginLeft: 8, marginRight: 12 }}>映射关系由项企立项项目与安心云项目关联产生若项目未在项企中有记载可选自定义项目待项企立项项后再进行修改</div>
</div>
<Form
@ -93,8 +118,6 @@ function adminModal (props) {
labelAlign="right"
labelWidth="110px"
onValueChange={(values, field) => {
console.log('values', values);
console.log('field', field);
for (var key in field) {
if (key == 'projectType') {
if (field.projectType == 'pep') {
@ -109,7 +132,7 @@ function adminModal (props) {
getFormApi={(formApi) => (form.current = formApi)}
>
<div>
<Form.RadioGroup field="projectType" initValue='pep' label='项目类型:' >
<Form.RadioGroup field="projectType" initValue={myprojectType} label='项目类型:' >
<Form.Radio value='pep'>项企项目</Form.Radio>
<Form.Radio value='axy'>自定义项目未在项企中立项的项目可选</Form.Radio>
</Form.RadioGroup>
@ -118,8 +141,10 @@ function adminModal (props) {
<div>
<Form.Input
field="name"
label='未立项项目:'
label='自定义项目:'
style={{ width: 425 }}
maxLength={18}
initValue={pepname || ""}
placeholder="请输入项目名称,且名称需与项企区分"
showClear
rules={[{ required: true, message: "请输入项目名称,且名称需与项企区分" }]} />
@ -128,12 +153,13 @@ function adminModal (props) {
<div>
<Form.Select
label="PEP项企项目:"
field="pepUserId"
field="pepProjectId"
filter
placeholder="请选择PEP项企项目"
style={{ width: 425 }}
rules={[{ required: true, message: "请选择PEP项企项目" }]}
initValue={pepProjectId || ""}
disabled={systemEdit&&!pepname}
showClear
>
{
@ -150,14 +176,14 @@ function adminModal (props) {
)}
<div>
<Form.Select
label="关联项目:"
field="anxinProject"
label="安心云项目:"
field="anxinProjectId"
multiple
filter
placeholder="请选择关联项目"
placeholder="请选择安心云项目"
style={{ width: 425 }}
rules={[{ required: true, message: "请选择关联项目" }]}
// initValue={departmentId || []}
rules={[{ required: true, message: "请选择安心云项目" }]}
initValue={anxincloudArr || []}
showClear
>
{
@ -171,48 +197,54 @@ function adminModal (props) {
}
</Form.Select>
</div>
</Form>
<div style={{ marginTop: 8 }}>
{
appList.map((item, index) => {
return (
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ width: 110, textAlign: 'end', paddingRight: 16, color: 'rgba(0, 0, 0, 0.65)', fontWeight: 600 }}>
增加应用:
</div>
<div>
<Input
style={{ width: 149 }}
value={item.name}
placeholder="请输入应用名称"
onChange={(value) => onChange(value, index)}
maxLength={18}
showClear></Input>
</div>
<div>
<Input
style={{ width: 268, marginLeft: 8 }}
value={item.url}
placeholder="请输入URL地址"
onChange={(value) => onChange(value, index)}
maxLength={50}
showClear></Input>
</div>
<div style={{ display: 'flex', alignItems: 'center', cursor: "pointer" }}>
<img src="/assets/images/install/appDelete.png" alt="" style={{ height: 24, width: 24, marginLeft: 8 }} />
</div>
anxinDelete.length > 0 ? (
<div style={{ display: 'flex' }}>
<div style={{marginTop:3}}>
<IconAlertTriangle size='small' style={{ color: '#FE9812' }} />
</div>
<div style={{
background: 'rgba(255, 51, 0, 0.28)', color: '#FF3300',
fontSize: 12, marginLeft: 8, lineHeight: 2, padding: '0px 5px',
border: '1px solid rgba(255,51,0,0.3)',width:515
}}>
确认关联后{anxinDelete.join('、')}将被系统移除映射关系原因是项目已在安心云中被删除
</div>
)
})
</div>
) : ('')
}
<div style={{ display: 'flex', alignItems: 'center',marginTop:12,marginLeft:110,justifyContent: 'space-between' }}>
<Button type='primary' theme='solid' style={{ width: 72, height: 25, borderRadius: '1px', border: '1px solid #005ABD',background:'#FFFFFF', color: '#005ABD', fontWeight: 400, }}>继续添加</Button>
<div style={{color:'#646566',fontSize:12,marginRight:32}}>
<span style={{color:'#F31C1C'}}>*</span>
最多可添加30条
</div>
<div>
<Form.Select
label="添加应用:"
field="appId"
multiple
filter
placeholder="请选择添加应用"
style={{ width: 425 }}
initValue={appArr || []}
showClear
renderSelectedItem={renderMultipleWithCustomTag}
>
{
appList.map((item, index) => {
return (
<Form.Select.Option key={'a' + index} value={JSON.stringify(item)} label={
<div>
<div style={{ fontSize: 14, fontWeight: 600 }}>
{item.name}
</div>
<div style={{ fontSize: 12, color: 'rgb(139, 139, 139)' }}>
URL:{item.url}
</div>
</div>
}>
</Form.Select.Option>
)
})
}
</Form.Select>
</div>
</div>
</Form>
</div>
</Modal>
</>

251
web/client/src/sections/install/containers/system.jsx

@ -1,10 +1,12 @@
import React, { useEffect, useRef, useState } from 'react';
import { connect } from 'react-redux';
import { Skeleton, Button, Pagination, Table, Popconfirm, Tooltip } from '@douyinfe/semi-ui';
import { IconAlertTriangle } from "@douyinfe/semi-icons";
import { SkeletonScreen, } from "$components";
import moment from "moment";
import SystemModal from '../components/systemModal'
import '../style.less'
import { set } from 'nprogress';
const Example = (props) => {
const { dispatch, actions, user, loading, socket } = props
@ -17,10 +19,34 @@ const Example = (props) => {
const [systemEdit, setSystemEdit] = useState(false) //
const [anxincloudList, setAnxincloudList] = useState([]) //
const [peplist, setPeplist] = useState([]) //PEP
const [pepProjectId,setPepProjectId]= useState() //id
const tableData = useRef([]); //
const [appList, setAppList] = useState([]) //
const [pepProjectId, setPepProjectId] = useState() //id
const [anxincloudArr, setAnxincloudArr] = useState([]) //
const [pepname, setPepname] = useState() //
const [anxinDelete, setAnxinDelete] = useState([]) //,
const [appArr, setAppArr] = useState([]) //
const [bindId, setBindId] = useState() //id
const [tableKey, setTableKey] = useState([]) //id
const page = useRef(query.page);//
function handleRow (record, index) {//
//
if (index % 2 === 0) {
return {
style: {
background: '#FAFCFF',
}
};
} else {
return {};
}
}
const [tableData, setTableData] = useState([]) //
useEffect(() => {
dispatch(install.getProjectAnxincloud(query)).then((res) => {//
setAnxincloudList(res.payload.data)
@ -28,18 +54,26 @@ const Example = (props) => {
dispatch(install.getProjectPmanage(query)).then((res) => {//PEP
setPeplist(res.payload.data)
})
dispatch(install.getProjectAppList(query)).then((res) => {//
setAppList(res.payload.data)
})
}, [])
useEffect(() => {
getProjectPomsList();
}, [query]);
function getProjectPomsList () {
dispatch(install.getProjectPoms(query)).then((res) => {//
if (res.success) {
let mytableData = res.payload.data.rows;
let mytableData = JSON.parse(JSON.stringify(res.payload.data.rows));
let mytableKey = []
for (let index = 0; index < mytableData.length; index++) {
mytableData[index].key = mytableData[index].id
mytableKey.push(mytableData[index].id)
}
tableData.current = mytableData;
setTableKey(mytableKey)
setTableData(mytableData)
setLimits(res.payload.data.count)
mylimits.current = res.payload.data.rows.length
}
@ -60,8 +94,24 @@ const Example = (props) => {
key: 'anxinProject',
width: 500,
render: (_, row) => {
let anxinerror = false
let anxinerrorArr = []
for (let i = 0; i < row.anxinProject.length; i++) {
if (row.anxinProject[i].projectState == -1) {
anxinerror = true
anxinerrorArr.push(row.anxinProject[i].name)
}
}
return (
<div style={{ display: 'flex', alignItems: 'center' }}>
{
anxinerror ? (
<Tooltip content={anxinerrorArr.join(',') + ',项目已在[安心云]中被删除'}>
<div style={{ marginRight: 5 }}>
<IconAlertTriangle size='small' style={{ color: '#FE9812' }} />
</div>
</Tooltip>) : ('')
}
{
row.anxinProject.map((item, index) => {
return (
@ -69,29 +119,50 @@ const Example = (props) => {
{
row.anxinProject.length >= 3 ? (
<Tooltip content={item.name}>
<div style={{ width: item.name.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
<div style={{ width: item.name.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: index > 2 ? 'none' : '', color: item.projectState == -1 ? '#F93920' : '' }}>
{item.name}
</div>
</Tooltip>
) : row.anxinProject.length == 2 ? (
<Tooltip content={item.name}>
<div style={{ width: item.name.length > 12 ? '173.5' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
<div style={{ width: item.name.length > 12 ? '173.5px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: item.projectState == -1 ? '#F93920' : '' }}>
{item.name}
</div>
</Tooltip>
) : (
<Tooltip content={item.name}>
<div style={{ width: item.name.length > 25 ? '358' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
<div style={{ width: item.name.length > 25 ? '358px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: item.projectState == -1 ? '#F93920' : '' }}>
{item.name}
</div>
</Tooltip>
)
}
<div className='separator' style={{ width: 1, height: 12, border: '1px solid #DCDEE0', margin: '0px 10px' }}></div>
<div className='separator' style={{ width: 1, height: 12, border: '1px solid #DCDEE0', margin: '0px 10px', display: index > 1 ? 'none' : '' }}></div>
</div>
)
})
}
{
row.anxinProject.length > 3 ? (
<Tooltip content={
<div style={{ display: 'flex', flexWrap: 'wrap' }}>
{
row.anxinProject.map((item, index) => {
return (
<div key={index} style={{ whiteSpace: 'nowrap', color: item.projectState == -1 ? '#F93920' : '' }}>
{item.name}<span style={{ color: '#FFFFFF' }}>,</span>
</div>
)
})
}
</div>
} trigger="click" style={{ lineHeight: 2 }}>
<div style={{ fontSize: 14, color: '#005ABD', marginLeft: 8, cursor: "pointer", }}>
+{row.anxinProject.length - 3}
</div>
</Tooltip>
) : ('')
}
</div>
)
}
@ -103,11 +174,37 @@ const Example = (props) => {
render: (_, row) => {
return (
<div style={{ display: 'flex', alignItems: 'center' }}>
<Tooltip content={row.pepProjectName}>
<div style={{ width: row.pepProjectName > 7 ? '112' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
{row.pepProjectName}
{
row.pepProjectIsDelete == 1 ? (
<Tooltip content={'失效,项目已在[项企PEP]中被删除!'}>
<div style={{ marginRight: 5 }}>
<IconAlertTriangle size='small' style={{ color: '#FE9812' }} />
</div>
</Tooltip>) : ('')
}
<Tooltip content={row.pepProjectName || row.name}>
<div style={{ width: row?.pepProjectName?.length > 7 || row?.name?.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
{row.pepProjectName || row.name}
</div>
</Tooltip>
{
row.pepProjectName ? (
<div style={{
height: 18, marginLeft: 4,
background: 'linear-gradient(180deg, #EBF5FF 0%, #EBF5FF 0%, #D3E8FF 100%)',
borderRadius: 2, display: 'flex', alignItems: 'center'
}}>
<div>
<img src="/assets/images/install/icon_zhengque.png" alt="" style={{ height: 10, width: 10, marginLeft: 4, marginRight: 9 }} />
</div>
<div style={{ color: '#0F7EFB', fontSize: 11, marginRight: 12 }}>
{row.constructionStatus}
</div>
</div>
) : (
''
)
}
</div>
)
}
@ -130,22 +227,48 @@ const Example = (props) => {
<div style={{ display: "flex" }}>
<Button
theme="borderless"
disabled={row.pepProjectIsDelete == 1}
onClick={() => {
setSystemModal(true);
setPepProjectId(row.pepProjectId)
// setEditObj(row)
setPepname(row.name)
if (!row.name) {
setPepProjectId(row.pepProjectId)
}
else {
setPepProjectId()
}
let myanxinArr = []
let anxinErrorList = []
for (let i = 0; i < row.anxinProject.length; i++) {
if (row.anxinProject[i].projectState !== -1) {
myanxinArr.push(row.anxinProject[i].id)
}
else {
anxinErrorList.push(row.anxinProject[i].name)
}
}
setAnxinDelete(anxinErrorList)
let myapparr = []
let myarrarrList = JSON.parse(JSON.stringify(row.apps))
for (let j = 0; j < row.apps.length; j++) {
delete myarrarrList[j].projectApp
myapparr.push(JSON.stringify(myarrarrList[j]))
}
setAppArr(myapparr)
setAnxincloudArr(myanxinArr)
setBindId(row.id)
setSystemEdit(true)
}}
>
修改
</Button>
<Popconfirm
title="删除后,成员将无法登录。"
title="删除后对应的项目全局将无法进入和显示,对应的信鸽服务也会被禁用"
arrowPointAtCenter={false}
showArrow={true}
position="topRight"
onConfirm={() => {
dispatch(install.putOrganizationUser({ pomsUserId: row?.id, deleted: true, msg: '删除成员' })).then(() => {
dispatch(install.deleteProjectBind({ bindId: row?.id, msg: '删除安心云、项目管理项目绑定关系' })).then(() => {
if (page.current > 0 && mylimits.current < 2) {
setQuery({ limit: 10, page: page.current - 1 })
} else {
@ -163,15 +286,14 @@ const Example = (props) => {
])
const rowSelection = {
selectedRowKeys: selected,
onSelect: (record, selected) => {
console.log(`select row: ${selected}`, record);
},
onSelectAll: (selected, selectedRows) => {
console.log(`select all rows: ${selected}`, selectedRows);
},
// onSelect: (record, selected) => {
// // console.log(`select row: ${selected}`, record);
// },
// onSelectAll: (selected, selectedRows) => {
// // console.log(`select all rows: ${selected}`, selectedRows);
// },
onChange: (selectedRowKeys, selectedRows) => {
setSelected(selectedRows.map(v => v.key))
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
},
}
return (
@ -197,9 +319,11 @@ const Example = (props) => {
setSystemModal(true);
setSystemEdit(false)
setPepProjectId()
// setEditObj({})
// setMemberEdit(false)
// setMemberModal(true);
setPepname()
setAnxinDelete([])
setAppArr([])
setAnxincloudArr()
setBindId()
}}
>
添加映射关系
@ -214,16 +338,12 @@ const Example = (props) => {
>
<Table
columns={columns}
dataSource={tableData.current}
dataSource={tableData}
bordered={false}
empty="暂无数据"
style={{ padding: "0px 20px", }}
pagination={false}
onRow={(record, index) => {
if (index % 1 === 0) {
return { style: { background: '#FAFCFF' } }
}
}}
onRow={handleRow}
rowSelection={rowSelection}
/>
</Skeleton>
@ -235,13 +355,38 @@ const Example = (props) => {
}}
>
<div>
<div style={{ display: 'inline-block', lineHeight: '30px' }}>勾选<span style={{ fontWeight: 400, color: '#0F7EFB', }}>{selected.length}</span>问题</div>
<Button onClick={() => setSelected([])} style={{ width: 93, height: 24, borderRadius: '1px', border: '1px solid #0F7EFB', color: '#0F7EFB', fontWeight: 400, margin: '0 10px' }}>全选</Button>
<Button type='primary' theme='solid' style={{ width: 93, height: 24, borderRadius: '1px', border: '1px solid #0F7EFB', color: '#FFFFFF', fontWeight: 400, }}>批量删除</Button>
<div style={{ display: 'inline-block', lineHeight: '30px', fontSize: 13, }}>勾选<span style={{ fontWeight: 400, color: '#0F7EFB', }}>{selected.length}</span>问题</div>
<Button onClick={() => {
if(selected.length==tableKey.length){
setSelected([])
}
else{
setSelected(tableKey)
}
}} style={{ width: 93, height: 24, borderRadius: '1px', border: '1px solid #0F7EFB', color: '#0F7EFB', fontWeight: 400, margin: '0 10px' }}>全选</Button>
<Popconfirm
title="删除后对应的项目全局将无法进入和显示,对应的信鸽服务也会被禁用"
arrowPointAtCenter={false}
showArrow={true}
position="topRight"
onConfirm={() => {
dispatch(install.deleteProjectBind({ bindId: selected.join(','), msg: '删除安心云、项目管理项目绑定关系' })).then(() => {
if (page.current > 0 && mylimits.current == selected.length) {
setQuery({ limit: 10, page: page.current - 1 })
} else {
setQuery({ limit: 10, page: page.current })
}
setSelected([])
})
}}
>
<Button type='primary' theme='solid' style={{ width: 93, height: 24, borderRadius: '1px', border: '1px solid #0F7EFB', color: '#FFFFFF', fontWeight: 400, }}>批量删除</Button>
</Popconfirm>
</div>
<div style={{ display: 'flex', }}>
<span style={{ lineHeight: "30px" }}>
{limits}个问题
<span style={{ lineHeight: "30px", fontSize: 13, color: 'rgba(0,90,189,0.8)' }}>
{limits}条信息
</span>
<Pagination
className="22"
@ -260,18 +405,24 @@ const Example = (props) => {
</div>
{//
systemModal ?
<SystemModal
visible={true}
anxincloudList={anxincloudList}
systemEdit={systemEdit}
peplist={peplist}
pepProjectId={pepProjectId}
close={() => {
setSystemModal(false);
// getUserList()
}} >
</SystemModal> : ''
}
<SystemModal
visible={true}
anxincloudList={anxincloudList}
systemEdit={systemEdit}
peplist={peplist}
appList={appList}
pepname={pepname}
anxincloudArr={anxincloudArr}
pepProjectId={pepProjectId}
anxinDelete={anxinDelete}
appArr={appArr}
bindId={bindId}
close={() => {
setSystemModal(false);
getProjectPomsList()
}} >
</SystemModal> : ''
}
</>
)
}

4
web/client/src/utils/webapi.js

@ -27,7 +27,9 @@ export const ApiTable = {
getProjectPoms:'project/poms',//获取已绑定项目列表
getProjectAnxincloud:'project/anxincloud',//获取安心云项目
getProjectPmanage:'project/pmanage',//获取PEP项目管理项目
postProjectBind:'project/bind',//绑定安心云、项目管理项目
getProjectAppList:'project/app_list',//获取应用列表
deleteProjectBind:'project/bind/{bindId}',//删除安心云、项目管理项目绑定关系
//告警

Loading…
Cancel
Save