From 2290ad7d3d8bbce76ac23f20ea11eb9db4fc13c6 Mon Sep 17 00:00:00 2001 From: deartibers <947466799@qq.com> Date: Tue, 20 Sep 2022 20:59:30 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/images/install/icon_zhengque.png | Bin 0 -> 4007 bytes .../src/sections/install/actions/index.js | 5 +- .../src/sections/install/actions/roles.js | 35 +-- .../src/sections/install/actions/system.js | 81 ++++++ .../install/components/systemModal.jsx | 182 +++++++------ .../sections/install/containers/system.jsx | 251 ++++++++++++++---- web/client/src/utils/webapi.js | 4 +- 7 files changed, 396 insertions(+), 162 deletions(-) create mode 100644 web/client/assets/images/install/icon_zhengque.png create mode 100644 web/client/src/sections/install/actions/system.js 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 0000000000000000000000000000000000000000..178d27b419cda8e86310b011eef87bfd2ae8f5fe GIT binary patch literal 4007 zcmV;Y4_NStP)Px^VM#ELBVze}v@I8Xs;)1zY-+{>$KuiOXkN7ET;8M1(yNfCS0KOzh){*dK^PYyf_N`(7%`Cl zM`3jEpZFUBlp=(U7{Q8~VsY6U({RVpdd{O_aM!tfI70d72rvdAEkq2ZLB<$kG!sSx z2gVQ>aAmOgoIU_14ul+z_4-yWSR$f)s8?fF@y_@t8D9 zdd?Z>{#Mzu!gzHJW4MY0cOckOV0iQDX~orF*YK}p@NswW-f>)B1Sy{+4V4C>elY!B z9)K~N7;g?nds=y!9FYBvN&y)GD&I-e;PN6CXT8#lpB}E^hi!1fZOK?(hUFZ17iFw@ z7~g1-vj7}acq@ZcxatEEVNKp=qe5NVZaWfRI?M0laByzHlp$Ztp)V>i8UZE?||8huCxpYi~&-nFN^ zn5TTQxUlt<4QCy)G#st*6&}_iwF`R_E%q=8f*Y{2kzjyNMgcB8p;uM&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ovPDHLkV1j73s?Pub literal 0 HcmV?d00001 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 = ( + + {JSON.parse(optionNode.value).name} + + ); + return { + isRenderInTag: false, + content + }; } return ( <> @@ -83,8 +108,8 @@ function adminModal (props) { onCancel={handleCancel} >
-
-
+
+
映射关系由项企立项项目与安心云项目关联产生,若项目未在项企中有记载,可选自定义项目,待项企立项项后再进行修改!
{ - 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)} >
- + 项企项目 自定义项目(未在项企中立项的项目可选) @@ -118,8 +141,10 @@ function adminModal (props) {
@@ -128,12 +153,13 @@ function adminModal (props) {
{ @@ -150,14 +176,14 @@ function adminModal (props) { )}
{ @@ -171,48 +197,54 @@ function adminModal (props) { }
- -
{ - appList.map((item, index) => { - return ( -
-
- 增加应用: -
-
- onChange(value, index)} - maxLength={18} - showClear> -
-
- onChange(value, index)} - maxLength={50} - showClear> -
-
- -
+ anxinDelete.length > 0 ? ( +
+
+ +
+
+ 确认关联后“{anxinDelete.join('、')}”将被系统移除映射关系,原因是项目已在【安心云】中被删除!
- ) - }) +
+ ) : ('') } -
- -
- * - 最多可添加30条 -
+
+ + { + appList.map((item, index) => { + return ( + +
+ {item.name} +
+
+ URL:{item.url} +
+
+ }> + + ) + }) + } +
-
+
diff --git a/web/client/src/sections/install/containers/system.jsx b/web/client/src/sections/install/containers/system.jsx index 5641c5c..e6ab499 100644 --- a/web/client/src/sections/install/containers/system.jsx +++ b/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 (
+ { + anxinerror ? ( + +
+ +
+
) : ('') + } { row.anxinProject.map((item, index) => { return ( @@ -69,29 +119,50 @@ const Example = (props) => { { row.anxinProject.length >= 3 ? ( -
7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}> +
7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', display: index > 2 ? 'none' : '', color: item.projectState == -1 ? '#F93920' : '' }}> {item.name}
) : row.anxinProject.length == 2 ? ( -
12 ? '173.5' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}> +
12 ? '173.5px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: item.projectState == -1 ? '#F93920' : '' }}> {item.name}
) : ( -
25 ? '358' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}> +
25 ? '358px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis', color: item.projectState == -1 ? '#F93920' : '' }}> {item.name}
) } -
+
1 ? 'none' : '' }}>
) }) } + { + row.anxinProject.length > 3 ? ( + + { + row.anxinProject.map((item, index) => { + return ( +
+ {item.name}, +
+ ) + }) + } +
+ } trigger="click" style={{ lineHeight: 2 }}> +
+ +{row.anxinProject.length - 3} +
+
+ ) : ('') + }
) } @@ -103,11 +174,37 @@ const Example = (props) => { render: (_, row) => { return (
- -
7 ? '112' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}> - {row.pepProjectName} + { + row.pepProjectIsDelete == 1 ? ( + +
+ +
+
) : ('') + } + +
7 || row?.name?.length > 7 ? '112px' : '', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}> + {row.pepProjectName || row.name}
+ { + row.pepProjectName ? ( +
+
+ +
+
+ {row.constructionStatus} +
+
+ ) : ( + '' + ) + }
) } @@ -130,22 +227,48 @@ const Example = (props) => {
{ - 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) => { > { - if (index % 1 === 0) { - return { style: { background: '#FAFCFF' } } - } - }} + onRow={handleRow} rowSelection={rowSelection} /> @@ -235,13 +355,38 @@ const Example = (props) => { }} >
-
勾选{selected.length}条问题
- - +
勾选{selected.length}条问题
+ + { + 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([]) + }) + }} + > + + +
- - 共{limits}个问题 + + 共{limits}条信息 {
{//映射关系弹框 systemModal ? - { - setSystemModal(false); - // getUserList() - }} > - : '' - } + { + setSystemModal(false); + getProjectPomsList() + }} > + : '' + } ) } diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 8c5b9d2..9df7406 100644 --- a/web/client/src/utils/webapi.js +++ b/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}',//删除安心云、项目管理项目绑定关系 //告警