module-menu 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,15 +1,70 @@
1
- # umi project
1
+ # Getting Started with Create React App
2
2
 
3
- ## Getting Started
3
+ This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4
4
 
5
- Install dependencies,
5
+ ## Available Scripts
6
6
 
7
- ```bash
8
- $ yarn
9
- ```
7
+ In the project directory, you can run:
10
8
 
11
- Start the dev server,
9
+ ### `npm start`
12
10
 
13
- ```bash
14
- $ yarn start
15
- ```
11
+ Runs the app in the development mode.\
12
+ Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
13
+
14
+ The page will reload when you make changes.\
15
+ You may also see any lint errors in the console.
16
+
17
+ ### `npm test`
18
+
19
+ Launches the test runner in the interactive watch mode.\
20
+ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21
+
22
+ ### `npm run build`
23
+
24
+ Builds the app for production to the `build` folder.\
25
+ It correctly bundles React in production mode and optimizes the build for the best performance.
26
+
27
+ The build is minified and the filenames include the hashes.\
28
+ Your app is ready to be deployed!
29
+
30
+ See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31
+
32
+ ### `npm run eject`
33
+
34
+ **Note: this is a one-way operation. Once you `eject`, you can't go back!**
35
+
36
+ If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37
+
38
+ Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
39
+
40
+ You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
41
+
42
+ ## Learn More
43
+
44
+ You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45
+
46
+ To learn React, check out the [React documentation](https://reactjs.org/).
47
+
48
+ ### Code Splitting
49
+
50
+ This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51
+
52
+ ### Analyzing the Bundle Size
53
+
54
+ This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55
+
56
+ ### Making a Progressive Web App
57
+
58
+ This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59
+
60
+ ### Advanced Configuration
61
+
62
+ This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63
+
64
+ ### Deployment
65
+
66
+ This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67
+
68
+ ### `npm run build` fails to minify
69
+
70
+ This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
package/package.json CHANGED
@@ -1,42 +1,43 @@
1
1
  {
2
2
  "name": "module-menu",
3
- "version": "0.0.3",
3
+ "author": "quanchaoyang",
4
+ "version": "0.0.5",
4
5
  "description": "城市大数据平台菜单",
5
- "type": "module",
6
+ "dependencies": {
7
+ "@testing-library/jest-dom": "^5.16.5",
8
+ "@testing-library/react": "^13.4.0",
9
+ "@testing-library/user-event": "^13.5.0",
10
+ "antd": "^5.6.1",
11
+ "react": "^18.2.0",
12
+ "react-dom": "^18.2.0",
13
+ "react-scripts": "5.0.1",
14
+ "web-vitals": "^2.1.4"
15
+ },
6
16
  "scripts": {
7
- "start": "umi dev",
8
- "build": "umi build",
9
- "postinstall": "umi generate tmp",
10
- "prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
11
- "test": "umi-test",
12
- "test:coverage": "umi-test --coverage"
17
+ "start": "react-scripts start",
18
+ "build": "react-scripts build",
19
+ "test": "react-scripts test",
20
+ "eject": "react-scripts eject"
13
21
  },
14
- "gitHooks": {
15
- "pre-commit": "lint-staged"
22
+ "eslintConfig": {
23
+ "extends": [
24
+ "react-app",
25
+ "react-app/jest"
26
+ ]
16
27
  },
17
- "lint-staged": {
18
- "*.{js,jsx,less,md,json}": [
19
- "prettier --write"
28
+ "browserslist": {
29
+ "production": [
30
+ ">0.2%",
31
+ "not dead",
32
+ "not op_mini all"
20
33
  ],
21
- "*.ts?(x)": [
22
- "prettier --parser=typescript --write"
34
+ "development": [
35
+ "last 1 chrome version",
36
+ "last 1 firefox version",
37
+ "last 1 safari version"
23
38
  ]
24
39
  },
25
- "dependencies": {
26
- "@ant-design/pro-layout": "^6.5.0",
27
- "antd": "^5.6.1",
28
- "react": "17.x",
29
- "react-dom": "17.x",
30
- "umi": "^3.5.41"
31
- },
32
40
  "devDependencies": {
33
- "@types/react": "^17.0.0",
34
- "@types/react-dom": "^17.0.0",
35
- "@umijs/preset-react": "1.x",
36
- "@umijs/test": "^3.5.41",
37
- "lint-staged": "^10.0.7",
38
- "prettier": "^2.2.0",
39
- "typescript": "^4.1.2",
40
- "yorkie": "^2.0.0"
41
+ "url-loader": "^4.1.1"
41
42
  }
42
43
  }
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <meta
7
+ name="description"
8
+ content="Web site created using create-react-app"
9
+ />
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ # https://www.robotstxt.org/robotstxt.html
2
+ User-agent: *
3
+ Disallow:
@@ -1,69 +1,69 @@
1
- .ant-popconfirm .ant-popconfirm-buttons {
2
- display: none !important;
3
- }
4
- .ant-popover-placement-rightTop .ant-popover-arrow {
5
- display: none !important;
6
- }
7
- .ant-popconfirm .ant-popconfirm-message {
8
- margin-bottom: 0px;
9
- }
10
- .ant-popconfirm .ant-popconfirm-message {
11
- width: 650px;
12
- }
13
- .cardLine{
14
- height: 60px;
15
- padding: 5px 0px;
16
- }
17
- .textPad{
18
- padding-left: 10px;
19
- }
20
- .iconPad{
21
- padding-top: 15px;
22
- }
23
- .leftMenu{
24
- width: 100px;
25
- height: 60px;
26
- padding: 0px 35px;
27
- line-height: 60px;
28
- float: left;
29
- color: rgba(0, 0, 0, 0.85);
30
- font-size: 16px;
31
- cursor: pointer;
32
- text-align: left;
33
- }
34
- .rightMenu{
35
- width: 460px;
36
- height: 60px;
37
- float: left;
38
- vertical-align: middle;
39
- padding: 5px 10px 0px 10px;
40
- font-size: 14px;
41
- color: rgba(0,0,0,0.65);
42
- }
43
- .childMenu:hover{
44
- cursor: pointer;
45
- color: #4091F7;
46
- }
47
- .childMenu{
48
- width: 27%;
49
- display: inline-block;
50
- padding-top: 15px;
51
- }
52
- .middle{
53
- vertical-align: middle;
54
- }
55
- .menuIcon{
56
- width: 60px;
57
- height: 50px;
58
- text-align: center;
59
- display: inline-block;
60
- line-height: 67px;
61
- cursor: pointer;
62
- background-color: #4091F7;
63
- }
64
- .ant-popover .ant-popover-inner {
65
- border-radius: 0px;
66
- }
67
- .ant-popover {
68
- left: 69px !important;
1
+ .ant-popconfirm .ant-popconfirm-buttons {
2
+ display: none !important;
3
+ }
4
+ .ant-popover-placement-rightTop .ant-popover-arrow {
5
+ display: none !important;
6
+ }
7
+ .ant-popconfirm .ant-popconfirm-message {
8
+ margin-bottom: 0px;
9
+ }
10
+ .ant-popconfirm .ant-popconfirm-message {
11
+ width: 650px;
12
+ }
13
+ .cardLine{
14
+ height: 60px;
15
+ padding: 5px 0px;
16
+ }
17
+ .textPad{
18
+ padding-left: 10px;
19
+ }
20
+ .iconPad{
21
+ padding-top: 15px;
22
+ }
23
+ .leftMenu{
24
+ width: 100px;
25
+ height: 60px;
26
+ padding: 0px 35px;
27
+ line-height: 60px;
28
+ float: left;
29
+ color: rgba(0, 0, 0, 0.85);
30
+ font-size: 16px;
31
+ cursor: pointer;
32
+ text-align: left;
33
+ }
34
+ .rightMenu{
35
+ width: 460px;
36
+ height: 60px;
37
+ float: left;
38
+ vertical-align: middle;
39
+ padding: 5px 10px 0px 10px;
40
+ font-size: 14px;
41
+ color: rgba(0,0,0,0.65);
42
+ }
43
+ .childMenu:hover{
44
+ cursor: pointer;
45
+ color: #4091F7;
46
+ }
47
+ .childMenu{
48
+ width: 27%;
49
+ display: inline-block;
50
+ padding-top: 15px;
51
+ }
52
+ .middle{
53
+ vertical-align: middle;
54
+ }
55
+ .menuIcon{
56
+ width: 60px;
57
+ height: 50px;
58
+ text-align: center;
59
+ display: inline-block;
60
+ line-height: 67px;
61
+ cursor: pointer;
62
+ background-color: #4091F7;
63
+ }
64
+ .ant-popover .ant-popover-inner {
65
+ border-radius: 0px;
66
+ }
67
+ .ant-popover {
68
+ left: 69px !important;
69
69
  }
@@ -1,6 +1,10 @@
1
1
  import React, { Component } from 'react';
2
2
  import { Popconfirm, message } from 'antd';
3
- import './index.less'
3
+ import homeIcon from './assets/home.svg'
4
+ import moduleIcon from './assets/module.svg'
5
+ import menuIcon from './assets/menuIcon.svg'
6
+ import childIcon from './assets/childIcon.svg'
7
+ import './App.css'
4
8
  class ModuleMenu extends Component {
5
9
  constructor(props) {
6
10
  super(props);
@@ -8,19 +12,19 @@ class ModuleMenu extends Component {
8
12
  showMenu: false,
9
13
  menuList: [{
10
14
  name: '首页',
11
- url: require('../assets/home.svg'),
15
+ url: homeIcon,
12
16
  children: []
13
17
  },
14
18
  {
15
19
  name: '数据汇聚',
16
- url: require('../assets/module.svg'),
20
+ url: moduleIcon,
17
21
  children: [{
18
22
  childName: '数据集成平台'
19
23
  }]
20
24
  },
21
25
  {
22
26
  name: '数据治理',
23
- url: require('../assets/module.svg'),
27
+ url: moduleIcon,
24
28
  children: [{
25
29
  childName: '数据治理平台'
26
30
  },
@@ -36,7 +40,7 @@ class ModuleMenu extends Component {
36
40
  },
37
41
  {
38
42
  name: '数据开发',
39
- url: require('../assets/module.svg'),
43
+ url: moduleIcon,
40
44
  children: [{
41
45
  childName: '离线开发平台'
42
46
  },
@@ -46,7 +50,7 @@ class ModuleMenu extends Component {
46
50
  },
47
51
  {
48
52
  name: '数据开放',
49
- url: require('../assets/module.svg'),
53
+ url: moduleIcon,
50
54
  children: [{
51
55
  childName: '数据服务'
52
56
  },
@@ -56,7 +60,7 @@ class ModuleMenu extends Component {
56
60
  },
57
61
  {
58
62
  name: '数据应用',
59
- url: require('../assets/module.svg'),
63
+ url: moduleIcon,
60
64
  children: [{
61
65
  childName: '标签管理系统'
62
66
  },
@@ -195,17 +199,17 @@ class ModuleMenu extends Component {
195
199
  return (
196
200
  <div key={item.name} className="cardLine" style={{height: index === 2 ? '90px' : ''}}>
197
201
  <div className='leftMenu'>
198
- <img src={item.url} className="middle"/>
202
+ <img src={item.url} className="middle" alt=""/>
199
203
  <span className="middle textPad" onClick={() => {this.toHomePage(index)}}>{item.name}</span>
200
204
  </div>
201
205
  <div className='rightMenu' style={{height: index === 2 ? '90px' : '', borderBottom: index === 5 ? '0px' : '1px solid #E9E9E9'}}>
202
206
  {
203
207
  item.children.map((child, idx) => {
204
208
  return (
205
- <>
206
- <img src={require('../assets/childIcon.svg')} className="middle iconPad"/>
207
- <span className='childMenu textPad middle' key={child.childName} onClick={() => {this.toModulePage(child.childName)}}>{child.childName}</span>
208
- </>
209
+ <span key={idx}>
210
+ <img src={childIcon} className="middle iconPad" alt=""/>
211
+ <span className='childMenu textPad middle' onClick={() => {this.toModulePage(child.childName)}}>{child.childName}</span>
212
+ </span>
209
213
  )
210
214
  })
211
215
  }
@@ -225,7 +229,7 @@ class ModuleMenu extends Component {
225
229
  showCancel = {false}
226
230
  >
227
231
  <span className='menuIcon'>
228
- <img src={require('../assets/menuIcon.svg')}/>
232
+ <img src={menuIcon} alt=""/>
229
233
  </span>
230
234
  </Popconfirm>
231
235
  </>
package/src/index.js ADDED
@@ -0,0 +1,11 @@
1
+ // import React from 'react';
2
+ // import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+
5
+ // const root = ReactDOM.createRoot(document.getElementById('root'));
6
+ // root.render(
7
+ // <React.StrictMode>
8
+ // <App />
9
+ // </React.StrictMode>
10
+ // );
11
+ export default App
package/.editorconfig DELETED
@@ -1,16 +0,0 @@
1
- # http://editorconfig.org
2
- root = true
3
-
4
- [*]
5
- indent_style = space
6
- indent_size = 2
7
- end_of_line = lf
8
- charset = utf-8
9
- trim_trailing_whitespace = true
10
- insert_final_newline = true
11
-
12
- [*.md]
13
- trim_trailing_whitespace = false
14
-
15
- [Makefile]
16
- indent_style = tab
package/.prettierignore DELETED
@@ -1,8 +0,0 @@
1
- **/*.md
2
- **/*.svg
3
- **/*.ejs
4
- **/*.html
5
- package.json
6
- .umi
7
- .umi-production
8
- .umi-test
package/.prettierrc DELETED
@@ -1,11 +0,0 @@
1
- {
2
- "singleQuote": true,
3
- "trailingComma": "all",
4
- "printWidth": 80,
5
- "overrides": [
6
- {
7
- "files": ".prettierrc",
8
- "options": { "parser": "json" }
9
- }
10
- ]
11
- }
package/.umirc.ts DELETED
@@ -1,11 +0,0 @@
1
- // import { defineConfig } from 'umi';
2
- const {defineConfig} = require('umi');
3
- export default defineConfig({
4
- nodeModulesTransform: {
5
- type: 'none',
6
- },
7
- routes: [
8
- { path: '/', component: '@/pages/index' },
9
- ],
10
- fastRefresh: {},
11
- });
package/mock/.gitkeep DELETED
File without changes
package/tsconfig.json DELETED
@@ -1,37 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "esnext",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "resolveJsonModule": true,
7
- "importHelpers": true,
8
- "jsx": "preserve",
9
- "esModuleInterop": true,
10
- "sourceMap": true,
11
- "baseUrl": "./",
12
- "strict": true,
13
- "paths": {
14
- "@/*": ["src/*"],
15
- "@@/*": ["src/.umi/*"]
16
- },
17
- "allowSyntheticDefaultImports": true
18
- },
19
- "include": [
20
- "mock/**/*",
21
- "src/**/*",
22
- "config/**/*",
23
- ".umirc.ts",
24
- "typings.d.ts"
25
- ],
26
- "exclude": [
27
- "node_modules",
28
- "lib",
29
- "es",
30
- "dist",
31
- "typings",
32
- "**/__test__",
33
- "test",
34
- "docs",
35
- "tests"
36
- ]
37
- }
package/typings.d.ts DELETED
@@ -1,10 +0,0 @@
1
- declare module '*.css';
2
- declare module '*.less';
3
- declare module '*.png';
4
- declare module '*.svg' {
5
- export function ReactComponent(
6
- props: React.SVGProps<SVGSVGElement>,
7
- ): React.ReactElement;
8
- const url: string;
9
- export default url;
10
- }