suanmei
5 years ago
committed by
拾邑
18 changed files with 247 additions and 22 deletions
@ -0,0 +1,16 @@ |
|||
# http://editorconfig.org |
|||
root = true |
|||
|
|||
[*] |
|||
indent_style = space |
|||
indent_size = 2 |
|||
end_of_line = lf |
|||
charset = utf-8 |
|||
trim_trailing_whitespace = true |
|||
insert_final_newline = true |
|||
|
|||
[*.md] |
|||
trim_trailing_whitespace = false |
|||
|
|||
[Makefile] |
|||
indent_style = tab |
@ -0,0 +1,20 @@ |
|||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. |
|||
|
|||
# dependencies |
|||
/node_modules |
|||
/npm-debug.log* |
|||
/yarn-error.log |
|||
/yarn.lock |
|||
/package-lock.json |
|||
|
|||
# production |
|||
/dist |
|||
|
|||
# misc |
|||
.DS_Store |
|||
|
|||
# umi |
|||
/src/.umi |
|||
/src/.umi-production |
|||
/src/.umi-test |
|||
/.env.local |
@ -0,0 +1,8 @@ |
|||
**/*.md |
|||
**/*.svg |
|||
**/*.ejs |
|||
**/*.html |
|||
package.json |
|||
.umi |
|||
.umi-production |
|||
.umi-test |
@ -0,0 +1,11 @@ |
|||
{ |
|||
"singleQuote": true, |
|||
"trailingComma": "all", |
|||
"printWidth": 80, |
|||
"overrides": [ |
|||
{ |
|||
"files": ".prettierrc", |
|||
"options": { "parser": "json" } |
|||
} |
|||
] |
|||
} |
@ -0,0 +1,10 @@ |
|||
import { defineConfig } from 'umi'; |
|||
|
|||
export default defineConfig({ |
|||
nodeModulesTransform: { |
|||
type: 'none', |
|||
}, |
|||
routes: [ |
|||
{ path: '/', component: '@/pages/index' }, |
|||
], |
|||
}); |
@ -0,0 +1,15 @@ |
|||
# umi project |
|||
|
|||
## Getting Started |
|||
|
|||
Install dependencies, |
|||
|
|||
```bash |
|||
$ yarn |
|||
``` |
|||
|
|||
Start the dev server, |
|||
|
|||
```bash |
|||
$ yarn start |
|||
``` |
@ -0,0 +1,39 @@ |
|||
{ |
|||
"private": true, |
|||
"scripts": { |
|||
"start": "umi dev", |
|||
"build": "umi build", |
|||
"postinstall": "umi generate tmp", |
|||
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'", |
|||
"test": "umi-test", |
|||
"test:coverage": "umi-test --coverage" |
|||
}, |
|||
"gitHooks": { |
|||
"pre-commit": "lint-staged" |
|||
}, |
|||
"lint-staged": { |
|||
"*.{js,jsx,less,md,json}": [ |
|||
"prettier --write" |
|||
], |
|||
"*.ts?(x)": [ |
|||
"prettier --parser=typescript --write" |
|||
] |
|||
}, |
|||
"dependencies": { |
|||
"@antv/x6": "^0.4.7", |
|||
"@antv/x6-react-shape": "^0.2.2", |
|||
"@emotion/core": "^10.0.28", |
|||
"@emotion/styled": "^10.0.27", |
|||
"@imove/core": "^0.3.0", |
|||
"@imove/json-schema-editor": "^0.3.2", |
|||
"@umijs/preset-react": "1.x", |
|||
"@umijs/test": "^3.2.2", |
|||
"antd": "^4.2.4", |
|||
"lint-staged": "^10.0.7", |
|||
"prettier": "^1.19.1", |
|||
"react": "^16.12.0", |
|||
"react-dom": "^16.12.0", |
|||
"umi": "^3.2.2", |
|||
"yorkie": "^2.0.0" |
|||
} |
|||
} |
@ -0,0 +1,7 @@ |
|||
|
|||
.normal { |
|||
} |
|||
|
|||
.title { |
|||
background: rgb(121, 242, 157); |
|||
} |
@ -0,0 +1,48 @@ |
|||
import * as React from 'react'; |
|||
import IMove from '@imove/core'; |
|||
import styled from '@emotion/styled'; |
|||
import { DataItem } from '@imove/core/dist/types/data/cells'; |
|||
|
|||
const cells: DataItem[] = [ |
|||
{ |
|||
label: '查询是否登录', |
|||
type: 'decision', |
|||
style: { |
|||
width: 48, |
|||
height: 30, |
|||
scale: 2, |
|||
}, |
|||
data: { |
|||
code: |
|||
'import Base from "@ali/rax-base";\n\nconst queryLogin = (params) => {\n return new Promise((resolve, reject) => {\n Base.getUser((data) => {\n if (data && data.userNumberId) {\n resolve(true);\n } else {\n reject(false);\n }\n });\n });\n};\n\nexport default queryLogin;\n', |
|||
dependencies: [ |
|||
{ |
|||
'@ali/rax-base': '^2.1.9', |
|||
}, |
|||
], |
|||
}, |
|||
schema: { |
|||
type: 'object', |
|||
required: [], |
|||
properties: {}, |
|||
}, |
|||
}, |
|||
]; |
|||
|
|||
const onSave = (data: { nodes: any; edges: any }): void => { |
|||
console.log(data); |
|||
}; |
|||
|
|||
const Wrapper = styled.div` |
|||
height: 100vh; |
|||
`;
|
|||
|
|||
function Arrange(): JSX.Element { |
|||
return ( |
|||
<Wrapper> |
|||
<IMove cells={cells} onSave={onSave} /> |
|||
</Wrapper> |
|||
); |
|||
} |
|||
|
|||
export default Arrange; |
@ -0,0 +1,25 @@ |
|||
{ |
|||
"compilerOptions": { |
|||
"target": "esnext", |
|||
"module": "esnext", |
|||
"moduleResolution": "node", |
|||
"importHelpers": true, |
|||
"jsx": "react", |
|||
"esModuleInterop": true, |
|||
"sourceMap": true, |
|||
"baseUrl": "./", |
|||
"strict": true, |
|||
"paths": { |
|||
"@/*": ["src/*"], |
|||
"@@/*": ["src/.umi/*"] |
|||
}, |
|||
"allowSyntheticDefaultImports": true |
|||
}, |
|||
"include": [ |
|||
"mock/**/*", |
|||
"src/**/*", |
|||
"config/**/*", |
|||
".umirc.ts", |
|||
"typings.d.ts" |
|||
] |
|||
} |
@ -0,0 +1,8 @@ |
|||
declare module '*.css'; |
|||
declare module '*.less'; |
|||
declare module "*.png"; |
|||
declare module '*.svg' { |
|||
export function ReactComponent(props: React.SVGProps<SVGSVGElement>): React.ReactElement |
|||
const url: string |
|||
export default url |
|||
} |
Loading…
Reference in new issue