From 8a37345ffc7ce39b756f6691f9245bb2d7c0fa77 Mon Sep 17 00:00:00 2001 From: Rain&Bus Date: Thu, 11 Jan 2024 23:28:38 +0800 Subject: [PATCH] temp --- src/components/charts/Echarts.tsx | 24 +- src/components/charts/EchartsForce.tsx | 2 +- src/components/index.tsx | 4 + src/components/management/SearchTable.tsx | 150 ------ src/components/management/UserManage.tsx | 127 +++++ src/components/visualize/Home.tsx | 26 ++ src/components/visualize/TrailwayRoute.tsx | 519 +++++++++++++++++++++ src/routes/config.ts | 69 ++- src/service/index.ts | 3 + 9 files changed, 726 insertions(+), 198 deletions(-) delete mode 100644 src/components/management/SearchTable.tsx create mode 100644 src/components/management/UserManage.tsx create mode 100644 src/components/visualize/Home.tsx create mode 100644 src/components/visualize/TrailwayRoute.tsx diff --git a/src/components/charts/Echarts.tsx b/src/components/charts/Echarts.tsx index 658f6ca..f32a8d0 100644 --- a/src/components/charts/Echarts.tsx +++ b/src/components/charts/Echarts.tsx @@ -3,16 +3,16 @@ */ import React from 'react'; import { Row, Col, Card } from 'antd'; -import EchartsArea from './EchartsArea'; -import EchartsPie from './EchartsPie'; -import EchartsEffectScatter from './EchartsEffectScatter'; -import EchartsForce from './EchartsForce'; +import EchartsArea from '../charts/EchartsArea'; +import EchartsPie from '../charts/EchartsPie'; +import EchartsEffectScatter from '../charts/EchartsEffectScatter'; +import EchartsForce from '../charts/EchartsForce'; class Echarts extends React.Component { render() { return (
- {/* +
@@ -20,25 +20,25 @@ class Echarts extends React.Component {
-
*/} +
- +
- {/**/} + {/* */}
- {/* +
- */} +
- {/* +
@@ -46,7 +46,7 @@ class Echarts extends React.Component {
-
*/} +
); } diff --git a/src/components/charts/EchartsForce.tsx b/src/components/charts/EchartsForce.tsx index de13947..3ef3489 100644 --- a/src/components/charts/EchartsForce.tsx +++ b/src/components/charts/EchartsForce.tsx @@ -443,7 +443,7 @@ var links = [ var lineNames = []; for (var index = 0; index < stations.length - 1; index++) { - if (lineNames.indexOf(stations[index].category) == -1) { + if (lineNames.indexOf(stations[index].category) === -1) { lineNames.push(stations[index].category); } } diff --git a/src/components/index.tsx b/src/components/index.tsx index 0c1ca56..5524ab0 100644 --- a/src/components/index.tsx +++ b/src/components/index.tsx @@ -31,6 +31,8 @@ import MultipleMenu from './extension/MultipleMenu'; import Sub1 from './smenu/Sub1'; import Sub2 from './smenu/Sub2'; import Env from './env'; +import Home from './visualize/Home'; +import UserManage from './management/UserManage'; const WysiwygBundle = Loadable({ // 按需加载富文本配置 @@ -67,4 +69,6 @@ export default { Sub1, Sub2, Env, + Home, + UserManage, } as any; diff --git a/src/components/management/SearchTable.tsx b/src/components/management/SearchTable.tsx deleted file mode 100644 index 491869e..0000000 --- a/src/components/management/SearchTable.tsx +++ /dev/null @@ -1,150 +0,0 @@ -/** - * Created by hao.cheng on 2017/4/16. - */ -import React from 'react'; -import { Table, Input, Button } from 'antd'; -import { SmileOutlined } from '@ant-design/icons'; - -const data = [ - { - key: '1', - name: 'John Brown', - age: 32, - address: 'New York No. 1 Lake Park', - }, - { - key: '2', - name: 'Joe Black', - age: 42, - address: 'London No. 1 Lake Park', - }, - { - key: '3', - name: 'Jim Green', - age: 32, - address: 'Sidney No. 1 Lake Park', - }, - { - key: '4', - name: 'Jim Red', - age: 32, - address: 'London No. 2 Lake Park', - }, -]; - -class SearchTable extends React.Component { - state = { - filterDropdownVisible: false, - data, - searchText: '', - filtered: false, - }; - searchInput: any; - onInputChange = (e: any) => { - this.setState({ searchText: e.target.value }); - }; - onSearch = () => { - const { searchText } = this.state; - const reg = new RegExp(searchText, 'gi'); - this.setState({ - filterDropdownVisible: false, - filtered: !!searchText, - data: data - .map((record) => { - const match = record.name.match(reg); - if (!match) { - return null; - } - return { - ...record, - name: ( - - {record.name - .split(reg) - .map((text, i) => - i > 0 - ? [{match[0]}, text] - : text - )} - - ), - }; - }) - .filter((record) => !!record), - }); - }; - render() { - const columns = [ - { - title: 'Name', - dataIndex: 'name', - key: 'name', - filterDropdown: ( -
- (this.searchInput = ele)} - placeholder="Search name" - value={this.state.searchText} - onChange={this.onInputChange} - onPressEnter={this.onSearch} - /> - -
- ), - filterIcon: ( - - ), - filterDropdownVisible: this.state.filterDropdownVisible, - onFilterDropdownVisibleChange: (visible: boolean) => - this.setState({ filterDropdownVisible: visible }, () => - this.searchInput.focus() - ), - }, - { - title: 'Age', - dataIndex: 'age', - key: 'age', - }, - { - title: 'Address', - dataIndex: 'address', - key: 'address', - filters: [ - { - text: 'London', - value: 'London', - }, - { - text: 'New York', - value: 'New York', - }, - ], - onFilter: (value: any, record: any) => record.address.indexOf(value) === 0, - }, - ]; - return ( -
- - - - ); - } -} - -export default SearchTable; diff --git a/src/components/management/UserManage.tsx b/src/components/management/UserManage.tsx new file mode 100644 index 0000000..f623fce --- /dev/null +++ b/src/components/management/UserManage.tsx @@ -0,0 +1,127 @@ +/** + * Created by hao.cheng on 2017/4/16. + */ +import React from 'react'; +import { Table, Input, Button } from 'antd'; +import { SmileOutlined } from '@ant-design/icons'; +import { trailwayDelUser, trailwayListUsers } from '../../service'; + +class UserManage extends React.Component { + state = { + filterDropdownVisible: false, + data: [], + searchText: '', + filtered: false, + }; + searchInput: any; + + componentDidMount() { + this.refreshUser(); + } + + onInputChange = (e: any) => { + this.setState({ searchText: e.target.value }); + }; + onSearch = () => { + // const { searchText } = this.state; + // const reg = new RegExp(searchText, 'gi'); + // this.setState({ + // filterDropdownVisible: false, + // filtered: !!searchText, + // data: data + // .map((record) => { + // const match = record.name.match(reg); + // if (!match) { + // return null; + // } + // return { + // ...record, + // name: ( + // + // {record.name + // .split(reg) + // .map((text, i) => + // i > 0 + // ? [{match[0]}, text] + // : text + // )} + // + // ), + // }; + // }) + // .filter((record) => !!record), + // }); + }; + refreshUser = () => { + trailwayListUsers().then((res) => { + this.setState({ + data: res.data, + }); + }); + }; + handleDel = (id: Number) => { + trailwayDelUser(id); + this.refreshUser(); + }; + render() { + const columns = [ + { + title: 'ID', + dataIndex: 'id', + key: 'id', + sorter: (a: any, b: any) => a.id - b.id, + }, + { + title: '用户名', + dataIndex: 'username', + key: 'username', + }, + { + title: '管理员', + dataIndex: 'role', + key: 'role', + render: (role: any) => (role === 1 ? '是' : '否'), + }, + { + title: '操作', + render: (record: any) => ( +
+ + +
+ ), + }, + ]; + return ( +
+ +
+ + + ); + } +} + +export default UserManage; diff --git a/src/components/visualize/Home.tsx b/src/components/visualize/Home.tsx new file mode 100644 index 0000000..86cecac --- /dev/null +++ b/src/components/visualize/Home.tsx @@ -0,0 +1,26 @@ +/** + * Created by hao.cheng on 2017/4/17. + */ +import React from 'react'; +import { Row, Col, Card } from 'antd'; +import TrailwayRoute from './TrailwayRoute'; + +class Echarts extends React.Component { + render() { + return ( +
+ +
+
+ + + +
+ + + + ); + } +} + +export default Echarts; diff --git a/src/components/visualize/TrailwayRoute.tsx b/src/components/visualize/TrailwayRoute.tsx new file mode 100644 index 0000000..e4ae711 --- /dev/null +++ b/src/components/visualize/TrailwayRoute.tsx @@ -0,0 +1,519 @@ +/** + * Created by SEELE on 2017/8/23. + */ +import React, { Component } from 'react'; +import ReactEcharts from 'echarts-for-react'; + +var stations = [ + { + name: 'F7', + x: -150, + y: -800, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + { + name: 'F6', + x: -300, + y: -800, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + { + name: 'F5', + x: -450, + y: -800, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + { + name: 'F4', + x: -600, + y: -800, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + { + name: 'F3', + x: -750, + y: -800, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + { + name: 'F2', + x: -850, + y: -700, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + { + name: 'F1', + x: -950, + y: -600, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + { + name: 'F9', + x: 150, + y: -800, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + + { + name: 'F11', + x: 450, + y: -800, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + { + name: 'F12', + x: 600, + y: -800, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + { + name: 'F13', + x: 750, + y: -800, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + { + name: 'F14', + x: 750, + y: -600, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + { + name: 'F15', + x: 900, + y: -600, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + { + name: 'F16', + x: 1050, + y: -600, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + { + name: 'F17', + x: 1300, + y: -600, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + { + name: 'F18', + x: 1450, + y: -600, + itemStyle: { borderColor: '#EE1822', color: 'white' }, + category: '1号线', + }, + + { + name: 'S1', + x: 0, + y: -1400, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S2', + x: 0, + y: -1300, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S3', + x: 0, + y: -1200, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S4', + x: 0, + y: -1100, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S5', + x: 0, + y: -1000, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S6', + x: 0, + y: -900, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'FS8', + x: 0, + y: -800, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S8', + x: 0, + y: -700, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S9', + x: 0, + y: -600, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S10', + x: 0, + y: -500, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S12', + x: 200, + y: -300, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S13', + x: 300, + y: -200, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S14', + x: 400, + y: -100, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S15', + x: 500, + y: 0, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S16', + x: 650, + y: 0, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S17', + x: 800, + y: 0, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S18', + x: 950, + y: 0, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S19', + x: 1100, + y: 0, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'S20', + x: 1300, + y: 0, + itemStyle: { borderColor: '#FDD303', color: 'white' }, + category: '2号线', + }, + { + name: 'T16', + x: 400, + y: -1000, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + label: { rotate: 120 }, + category: '3号线', + }, + { + name: 'T15', + x: 300, + y: -900, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, + { + name: 'FT10', + x: 300, + y: -800, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, + { + name: 'T13', + x: 300, + y: -600, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, + { + name: 'T12', + x: 200, + y: -500, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, + { + name: 'ST11', + x: 100, + y: -400, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, + { + name: 'T10', + x: 0, + y: -300, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, + { + name: 'T9', + x: 0, + y: -200, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, + { + name: 'T8', + x: 0, + y: -100, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, + { + name: 'T7', + x: 0, + y: 0, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, + { + name: 'T6', + x: 0, + y: 100, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, + { + name: 'T5', + x: 0, + y: 200, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, + { + name: 'T4', + x: 0, + y: 300, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, + { + name: 'T3', + x: 0, + y: 400, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, + { + name: 'T2', + x: 0, + y: 500, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, + { + name: 'T1', + x: 0, + y: 600, + itemStyle: { borderColor: '#00b2ff', color: 'white' }, + category: '3号线', + }, +]; + +var links = [ + { source: 'T16', target: 'T15', lineStyle: { color: '#00b2ff' } }, + { source: 'T15', target: 'FT10', lineStyle: { color: '#00b2ff' } }, + { source: 'FT10', target: 'T13', lineStyle: { color: '#00b2ff' } }, + { source: 'T13', target: 'T12', lineStyle: { color: '#00b2ff' } }, + { source: 'T12', target: 'ST11', lineStyle: { color: '#00b2ff' } }, + { source: 'ST11', target: 'T10', lineStyle: { color: '#00b2ff' } }, + { source: 'T10', target: 'T9', lineStyle: { color: '#00b2ff' } }, + { source: 'T9', target: 'T8', lineStyle: { color: '#00b2ff' } }, + { source: 'T8', target: 'T7', lineStyle: { color: '#00b2ff' } }, + { source: 'T7', target: 'T6', lineStyle: { color: '#00b2ff' } }, + { source: 'T6', target: 'T5', lineStyle: { color: '#00b2ff' } }, + { source: 'T5', target: 'T4', lineStyle: { color: '#00b2ff' } }, + { source: 'T4', target: 'T3', lineStyle: { color: '#00b2ff' } }, + { source: 'T3', target: 'T2', lineStyle: { color: '#00b2ff' } }, + { source: 'T2', target: 'T1', lineStyle: { color: '#00b2ff' } }, + + { source: 'T16', target: 'T15', lineStyle: { color: '#00b2ff' } }, + { source: 'T15', target: 'FT10', lineStyle: { color: '#00b2ff' } }, + { source: 'FT10', target: 'T13', lineStyle: { color: '#00b2ff' } }, + { source: 'T13', target: 'T12', lineStyle: { color: '#00b2ff' } }, + { source: 'T12', target: 'ST11', lineStyle: { color: '#00b2ff' } }, + { source: 'ST11', target: 'T10', lineStyle: { color: '#00b2ff' } }, + { source: 'T10', target: 'T9', lineStyle: { color: '#00b2ff' } }, + { source: 'T9', target: 'T8', lineStyle: { color: '#00b2ff' } }, + { source: 'T8', target: 'T7', lineStyle: { color: '#00b2ff' } }, + { source: 'T7', target: 'T6', lineStyle: { color: '#00b2ff' } }, + { source: 'T6', target: 'T5', lineStyle: { color: '#00b2ff' } }, + { source: 'T5', target: 'T4', lineStyle: { color: '#00b2ff' } }, + { source: 'T4', target: 'T3', lineStyle: { color: '#00b2ff' } }, + { source: 'T3', target: 'T2', lineStyle: { color: '#00b2ff' } }, + { source: 'T2', target: 'T1', lineStyle: { color: '#00b2ff' } }, + + { source: 'S1', target: 'S2', lineStyle: { color: '#FDD303' } }, + { source: 'S2', target: 'S3', lineStyle: { color: '#FDD303' } }, + { source: 'S3', target: 'S4', lineStyle: { color: '#FDD303' } }, + { source: 'S4', target: 'S5', lineStyle: { color: '#FDD303' } }, + { source: 'S5', target: 'S6', lineStyle: { color: '#FDD303' } }, + { source: 'S6', target: 'FS8', lineStyle: { color: '#FDD303' } }, + { source: 'FS8', target: 'S8', lineStyle: { color: '#FDD303' } }, + { source: 'S8', target: 'S9', lineStyle: { color: '#FDD303' } }, + { source: 'S9', target: 'S10', lineStyle: { color: '#FDD303' } }, + { source: 'S10', target: 'ST11', lineStyle: { color: '#FDD303' } }, + { source: 'ST11', target: 'S12', lineStyle: { color: '#FDD303' } }, + { source: 'S12', target: 'S13', lineStyle: { color: '#FDD303' } }, + { source: 'S13', target: 'S14', lineStyle: { color: '#FDD303' } }, + + { source: 'S14', target: 'S15', lineStyle: { color: '#FDD303' } }, + { source: 'S15', target: 'S16', lineStyle: { color: '#FDD303' } }, + { source: 'S16', target: 'S17', lineStyle: { color: '#FDD303' } }, + { source: 'S17', target: 'S18', lineStyle: { color: '#FDD303' } }, + { source: 'S18', target: 'S19', lineStyle: { color: '#FDD303' } }, + { source: 'S19', target: 'S20', lineStyle: { color: '#FDD303' } }, + + { source: 'FS8', target: 'F7', lineStyle: { color: '#EE1822' } }, + { source: 'F7', target: 'F6', lineStyle: { color: '#EE1822' } }, + { source: 'F6', target: 'F5', lineStyle: { color: '#EE1822' } }, + { source: 'F5', target: 'F4', lineStyle: { color: '#EE1822' } }, + { source: 'F4', target: 'F3', lineStyle: { color: '#EE1822' } }, + { source: 'F3', target: 'F2', lineStyle: { color: '#EE1822' } }, + { source: 'F2', target: 'F1', lineStyle: { color: '#EE1822' } }, + { source: 'FS8', target: 'F9', lineStyle: { color: '#EE1822' } }, + { source: 'F9', target: 'FT10', lineStyle: { color: '#EE1822' } }, + { source: 'FT10', target: 'F11', lineStyle: { color: '#EE1822' } }, + { source: 'F11', target: 'F12', lineStyle: { color: '#EE1822' } }, + { source: 'F12', target: 'F13', lineStyle: { color: '#EE1822' } }, + { source: 'F13', target: 'F14', lineStyle: { color: '#EE1822' } }, + { source: 'F14', target: 'F15', lineStyle: { color: '#EE1822' } }, + { source: 'F15', target: 'F16', lineStyle: { color: '#EE1822' } }, + { source: 'F16', target: 'F17', lineStyle: { color: '#EE1822' } }, + { source: 'F17', target: 'F18', lineStyle: { color: '#EE1822' } }, +]; + +var lineNames = []; + +for (var index = 0; index < stations.length - 1; index++) { + if (lineNames.indexOf(stations[index].category) === -1) { + lineNames.push(stations[index].category); + } +} + +var legend = [ + { + data: lineNames, + }, +]; + +var categories = lineNames.map((lineName) => { + return { + name: lineName, + }; +}); + +const option = { + title: { + text: '地铁示意图', + }, + color: ['#EE1822', '#FDD303', '#00b2ff'], + tooltip: {}, + legend: legend, + animationDurationUpdate: 1500, + animationEasingUpdate: 'quinticInOut', + series: [ + { + type: 'graph', + layout: 'none', + symbolSize: 6, + focusNodeAdjacency: true, + roam: false, + label: { + show: true, + rotate: '30', + color: 'black', + position: 'right', + }, + edgeSymbol: ['none', 'none'], + edgeSymbolSize: [4, 6], + edgeLabel: { + normal: { + textStyle: { + fontSize: 20, + }, + }, + }, + data: stations, + links: links, + categories: categories, + lineStyle: { + normal: { + opacity: 0.9, + width: 6, + curveness: 0, + }, + }, + }, + ], +}; +class TrailwayRoute extends Component { + render() { + return ( + + ); + } +} + +export default TrailwayRoute; diff --git a/src/routes/config.ts b/src/routes/config.ts index f5a6ad2..b3118c6 100644 --- a/src/routes/config.ts +++ b/src/routes/config.ts @@ -21,7 +21,7 @@ const menus: { } = { menus: [ // 菜单相关路由 - { key: '/app/dashboard/index', title: '首页', icon: 'mobile', component: 'Dashboard' }, + { key: '/app/home', title: '首页', icon: 'mobile', component: 'Home' }, // { // key: '/app/ui', // title: 'UI', @@ -151,44 +151,43 @@ const menus: { // ], // }, { - key: '/app/visualize', - title: 'Visualize', + key: '/app/manage', + title: '管理', icon: 'bars', subs: [ { - key: '/app/extension/queryParams', - title: '问号形式参数', - component: 'QueryParams', - query: '?param1=1¶m2=2', - }, - { - key: '/app/extension/visitor', - title: '访客模式', - component: 'Visitor', - login: true, - }, - { - key: '/app/extension/multiple', - title: '多级菜单', - subs: [ - { - key: '/app/extension/multiple/child', - title: '多级菜单子菜单', - subs: [ - { - key: '/app/extension/multiple/child/child', - title: '多级菜单子子菜单', - component: 'MultipleMenu', - }, - ], - }, - ], - }, - { - key: '/app/extension/env', - title: '环境配置', - component: 'Env', + key: '/app/manage/user', + title: '用户管理', + component: 'UserManage', }, + // { + // key: '/app/extension/visitor', + // title: '访客模式', + // component: 'Visitor', + // login: true, + // }, + // { + // key: '/app/extension/multiple', + // title: '多级菜单', + // subs: [ + // { + // key: '/app/extension/multiple/child', + // title: '多级菜单子菜单', + // subs: [ + // { + // key: '/app/extension/multiple/child/child', + // title: '多级菜单子子菜单', + // component: 'MultipleMenu', + // }, + // ], + // }, + // ], + // }, + // { + // key: '/app/extension/env', + // title: '环境配置', + // component: 'Env', + // }, ], }, ], diff --git a/src/service/index.ts b/src/service/index.ts index 3c90a84..eca0855 100644 --- a/src/service/index.ts +++ b/src/service/index.ts @@ -47,3 +47,6 @@ export const guest = () => get({ url: config.MOCK_AUTH_VISITOR }); export const fetchMenu = () => get({ url: config.MOCK_MENU }); export const trailwayLogin = (data: any) => post({ url: config.TRAILWAY_API + '/login', data }); +export const trailwayListUsers = () => get({ url: config.TRAILWAY_API + '/user/list' }); +export const trailwayDelUser = (id: Number) => + get({ url: config.TRAILWAY_API + '/user/delete/' + id });