From 789862853f843058aa1bd627d2dffd3ed80cdbe3 Mon Sep 17 00:00:00 2001 From: wenlele Date: Sat, 15 Oct 2022 18:02:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=8F=B0=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E4=B8=8E=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/layout/components/header/index.jsx | 4 +- .../src/sections/console/actions/console.js | 42 +++- .../sections/console/containers/console.jsx | 185 ++++++++++-------- .../sections/problem/containers/dataAlarm.jsx | 2 +- web/client/src/utils/webapi.js | 4 + 5 files changed, 142 insertions(+), 95 deletions(-) diff --git a/web/client/src/layout/components/header/index.jsx b/web/client/src/layout/components/header/index.jsx index f75408c..b76c43d 100644 --- a/web/client/src/layout/components/header/index.jsx +++ b/web/client/src/layout/components/header/index.jsx @@ -101,9 +101,9 @@ const Header = (props) => { -
+
} onChange={(v) => setKeyword(v)} showClear> -
+
{pomsList?.length > 0 ? pomsList.filter(u => u.pepProjectName?.includes(keyword))?.map(v => { return basicAction({ -// type: 'get', -// dispatch: dispatch, -// actionType: 'GET_MEMBERS', -// url: `${ApiTable.getEnterprisesMembers.replace('{enterpriseId}', orgId)}`, -// msg: { error: '获取用户列表失败' }, -// reducer: { name: 'members' } -// }); -// } +export function ConsoleToollink () { //获取常用工具 + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_CONSLE_TOOLLINK', + url: `${ApiTable.consoleToollink}`, + msg: { option: '获取常用工具' }, + reducer: { name: '' } + }); +} + +export function putConsoleToollink (data) { //编辑常用工具 + return dispatch => basicAction({ + type: 'put', + dispatch: dispatch, + data, + actionType: 'PUT_CONSLE_TOOLLINK', + url: `${ApiTable.consoleToollink}`, + msg: { option: '编辑常用工具' }, + reducer: { name: '' } + }); +} +export function deleteConsoleToollink (orgId) { //删除常用工具 + return dispatch => basicAction({ + type: 'delete', + dispatch: dispatch, + actionType: 'DELETE_CONSLE_TOOLLINK', + url: `${ApiTable.consoleToollink.replace('{linkId}', orgId)}`, + msg: { option: '删除常用工具' }, + reducer: { name: '' } + }); +} \ No newline at end of file diff --git a/web/client/src/sections/console/containers/console.jsx b/web/client/src/sections/console/containers/console.jsx index a104ed0..f2a65e1 100644 --- a/web/client/src/sections/console/containers/console.jsx +++ b/web/client/src/sections/console/containers/console.jsx @@ -4,6 +4,8 @@ import { Timeline, Card, Button } from '@douyinfe/semi-ui'; import { push } from 'react-router-redux'; import '../style.less' import PerfectScrollbar from "perfect-scrollbar"; +import repairFQA from '../../means/containers/repairFQA'; +import { Setup, OutHidden } from "$components"; const { Meta } = Card; let newScrollbar; @@ -21,7 +23,7 @@ const Console = (props) => { 'url(/assets/images/console/lan_1.png)', 'url(/assets/images/console/lv_1.png)', 'url(/assets/images/console/huang_1.png)', - 'url(/assets/images/console/hong_1.png)' + 'url(/assets/images/console/hong_1.png)', ] const [timelineList, setTimelineList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//最新动态列表 @@ -32,9 +34,14 @@ const Console = (props) => { const [webList, setWebList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//关联web应用列表 const [problemsList, setProblemsList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//异常&问题列表 + const [setup, setSetup] = useState(false); //设置是否显现 + const [tableType, setTableType] = useState(''); //localStorage存储名 + + useEffect(() => { }, []) + useEffect(() => { newScrollbar = new PerfectScrollbar("#news", { suppressScrollX: true, @@ -90,6 +97,51 @@ const Console = (props) => { // dispatch(actions.example.getMembers(user.orgId)) }) + let Select = { + workbench: ['project', 'data', 'app', 'device'], + statistical: [], + analyse: [], + dynamic: [], + } + let show = { + workbench: ['project', 'data', 'app', 'device'], + statistical: [], + analyse: [], + dynamic: [], + } + + let listAll = [ + { name: '关注的项目', sort: 1, key: 'project', data: [], img: 'url(/assets/images/console/lan_1.png)' }, + { name: '数据告警', sort: 2, key: 'data', data: [], img: 'url(/assets/images/console/lv_1.png)' }, + { name: '应用告警', sort: 2, key: 'app', data: [], img: 'url(/assets/images/console/hong_1.png)' }, + { name: '设备告警', sort: 2, key: 'device', data: [], img: 'url(/assets/images/console/hong_1.png)' }, + ] + + + + // const attribute = (name, route) => { + // let arr = localStorage.getItem(name) + // ? JSON.parse(localStorage.getItem(name)) + // : []; + // // console.log(arr); + // if (route) { + // let setup = tableList[route].map(v => columnAll.find(vv => v == vv.value)) + + // let data = [] + // data.splice(1, 0, ...arr, 'text') + + // let TableDisplay = data?.map(v => { + // let datas = columnAll?.find(vv => v == vv.value) + // if (datas) { + // return { title: datas.name, sort: datas.sort, dataIndex: datas.value, rowKey: datas.value, render: datas.render } + // } + + // }) + // TableDisplay.sort((a, b) => a.sort - b.sort) + // setExhibition(TableDisplay) + // setTableSetup([{ list: setup }]) + // } + // } return ( @@ -123,7 +175,10 @@ const Console = (props) => {
MY WORK STATION
- setSetup(true)} /> + { + setSetup(true) + setTableType('workbench') + }} />
@@ -414,100 +469,66 @@ const Console = (props) => {
MY USUAL TOOLS
-
+
{ + console.log(111111); + document.getElementById('aa').style.display = 'none' + }} + style={{ marginTop: 24, position: 'relative', display: "inline-block" }}> - - - -
-
- + position: 'absolute', top: 12, right: -10, background: 'rgb(208 208 223 / 100%)', fontSize: 13, + width: 50, textAlign: "center", borderRadius: 4, padding: '0 10px', display: "none" + }}> +
{ + + }} + >编辑
+
{ + + }} + >删除
+
+ - + 75 + {setup ? ( + { + setSetup(false); + attribute(tableType[route], route); + setTableType('') + }} + /> + ) : ( + "" + )} ) } diff --git a/web/client/src/sections/problem/containers/dataAlarm.jsx b/web/client/src/sections/problem/containers/dataAlarm.jsx index 69e4e74..e0599dc 100644 --- a/web/client/src/sections/problem/containers/dataAlarm.jsx +++ b/web/client/src/sections/problem/containers/dataAlarm.jsx @@ -414,7 +414,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb /> {setup ? ( { setSetup(false); diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 7ed808c..0b3595c 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -51,6 +51,10 @@ export const ApiTable = { //服务-信鸽服务 getPush: "push", //获取推送配置列表 + //控制台 + consoleToollink: 'console/toollink', //常用工具 + + }; export const RouteTable = { apiRoot: "/api/root",