Browse Source

fix: all in one

master
lishican 2 years ago
parent
commit
ebecea5d89
69 changed files with 41046 additions and 40048 deletions
  1. BIN
      .DS_Store
  2. 8
      lerna.json
  3. 27899
      package-lock.json
  4. 4
      package.json
  5. BIN
      packages/.DS_Store
  6. 5
      packages/bank-hooks/package.json
  7. 2
      packages/bank-hooks/src/use-test.ts
  8. 1
      packages/bizComponent/.fatherrc.ts
  9. 11
      packages/bizComponent/package.json
  10. 5
      packages/bizComponent/src/index.tsx
  11. 3
      project/.eslintrc.js
  12. 17
      project/.lintstagedrc
  13. 3
      project/.prettierignore
  14. 8
      project/.prettierrc
  15. 3
      project/.stylelintrc.js
  16. 35
      project/.umirc.ts
  17. 3
      project/README.md
  18. 20
      project/mock/userAPI.ts
  19. 29
      project/package.json
  20. 10
      project/src/access.ts
  21. 16
      project/src/app.ts
  22. 0
      project/src/assets/.gitkeep
  23. 4
      project/src/components/Guide/Guide.less
  24. 23
      project/src/components/Guide/Guide.tsx
  25. 2
      project/src/components/Guide/index.ts
  26. 1
      project/src/constants/index.ts
  27. 13
      project/src/models/global.ts
  28. 21
      project/src/pages/Access/index.tsx
  29. 3
      project/src/pages/Home/index.less
  30. 18
      project/src/pages/Home/index.tsx
  31. 26
      project/src/pages/Table/components/CreateForm.tsx
  32. 138
      project/src/pages/Table/components/UpdateForm.tsx
  33. 270
      project/src/pages/Table/index.tsx
  34. 96
      project/src/services/demo/UserController.ts
  35. 7
      project/src/services/demo/index.ts
  36. 68
      project/src/services/demo/typings.d.ts
  37. 4
      project/src/utils/format.ts
  38. 1
      project/typings.d.ts
  39. 9473
      project/yarn.lock
  40. BIN
      projects/.DS_Store
  41. BIN
      projects/bkloan-global/.DS_Store
  42. 4
      projects/bkloan-global/.gitignore
  43. 18
      projects/bkloan-global/.umirc.ts
  44. 14546
      projects/bkloan-global/package-lock.json
  45. 42
      projects/bkloan-global/package.json
  46. 14
      projects/bkloan-global/src/app.ts
  47. BIN
      projects/bkloan-global/src/assets/yay.jpg
  48. 10
      projects/bkloan-global/src/layouts/index.less
  49. 10
      projects/bkloan-global/src/layouts/index.tsx
  50. 9
      projects/bkloan-global/src/pages/docs.tsx
  51. 6
      projects/bkloan-global/src/pages/index.less
  52. 12
      projects/bkloan-global/src/pages/index.tsx
  53. 0
      projects/bkloan-global/tsconfig.json
  54. 1
      projects/bkloan-global/typings.d.ts
  55. BIN
      projects/bkloan-sg/.DS_Store
  56. 9
      projects/bkloan-sg/.gitignore
  57. 18
      projects/bkloan-sg/.umirc.ts
  58. 14546
      projects/bkloan-sg/package-lock.json
  59. 42
      projects/bkloan-sg/package.json
  60. 9
      projects/bkloan-sg/src/app.ts
  61. BIN
      projects/bkloan-sg/src/assets/yay.jpg
  62. 10
      projects/bkloan-sg/src/layouts/index.less
  63. 10
      projects/bkloan-sg/src/layouts/index.tsx
  64. 9
      projects/bkloan-sg/src/pages/docs.tsx
  65. 6
      projects/bkloan-sg/src/pages/index.less
  66. 13
      projects/bkloan-sg/src/pages/index.tsx
  67. 3
      projects/bkloan-sg/tsconfig.json
  68. 1
      projects/bkloan-sg/typings.d.ts
  69. 13496
      yarn.lock

BIN
.DS_Store

8
lerna.json

@ -1,5 +1,7 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"version": "0.0.3",
"useWorkspaces": true
"version": "0.0.0",
"useWorkspaces": true,
"packages": ["packages/*"],
"workspace": ["packages/*", "projects/*"]
}

27899
package-lock.json
File diff suppressed because it is too large
View File

4
package.json

@ -16,5 +16,7 @@
"build": "lerna exec npm run build",
"clean": "lerna exec -- rm -rf ./dist"
},
"dependencies": {}
"dependencies": {
"cnpm": "^9.1.0"
}
}

BIN
packages/.DS_Store

5
packages/bank-hooks/package.json

@ -1,6 +1,6 @@
{
"name": "@lishican/antbank-platform-hooks",
"version": "0.0.4",
"version": "0.0.5",
"description": "",
"module": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
@ -28,5 +28,6 @@
"antd": "^5.4.2",
"react": ">=16.9.0",
"react-dom": ">=16.9.0"
}
},
"gitHead": "b2627a6b62138d5dff798892c30f464370146f13"
}

2
packages/bank-hooks/src/use-test.ts

@ -2,7 +2,7 @@ import { useEffect } from 'react';
const useTask = () => {
useEffect(() => {
console.log('useTask');
console.log('useTask31231');
}, []);
};
export default useTask;

1
packages/bizComponent/.fatherrc.ts

@ -7,7 +7,6 @@ export default defineConfig({
input: "src",
platform: "browser",
transformer:"esbuild"
},
extraBabelPlugins: [

11
packages/bizComponent/package.json

@ -1,6 +1,6 @@
{
"name": "@lishican/antbank-platform-ui",
"version": "0.0.4",
"version": "0.0.5",
"description": "",
"module": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
@ -22,7 +22,8 @@
},
"devDependencies": {
"@babel/runtime": "^7.12.5",
"father": "^4.1.8"
"father": "^4.1.8",
"less": "^4.1.3"
},
"peerDependencies": {
"antd": "^5.4.2",
@ -30,7 +31,9 @@
"react-dom": ">=16.9.0"
},
"dependencies": {
"@lishican/antbank-platform-hooks": "^0.0.4",
"@lishican/antbank-platform-hooks": "^0.0.5",
"@lishican/antbank-platform-ui": "^0.0.5",
"styled-components": "^5.3.9"
}
},
"gitHead": "b2627a6b62138d5dff798892c30f464370146f13"
}

5
packages/bizComponent/src/index.tsx

@ -1,4 +1,5 @@
import { useTask } from '@lishican/antbank-platform-hooks';
import { Button } from 'antd';
import React from 'react';
import './index.less';
@ -11,8 +12,8 @@ const HelloWorld: React.FC<any> = () => {
useTask();
return (
<div>
<Button type="primary">3332</Button>
<h3 className='red'>2131</h3>
<Button type="primary">ok</Button>
{/* <h3 className='red'>red</h3> */}
</div>
);
};

3
project/.eslintrc.js

@ -1,3 +0,0 @@
module.exports = {
extends: require.resolve('@umijs/max/eslint'),
};

17
project/.lintstagedrc

@ -1,17 +0,0 @@
{
"*.{md,json}": [
"prettier --cache --write"
],
"*.{js,jsx}": [
"max lint --fix --eslint-only",
"prettier --cache --write"
],
"*.{css,less}": [
"max lint --fix --stylelint-only",
"prettier --cache --write"
],
"*.ts?(x)": [
"max lint --fix --eslint-only",
"prettier --cache --parser=typescript --write"
]
}

3
project/.prettierignore

@ -1,3 +0,0 @@
node_modules
.umi
.umi-production

8
project/.prettierrc

@ -1,8 +0,0 @@
{
"printWidth": 80,
"singleQuote": true,
"trailingComma": "all",
"proseWrap": "never",
"overrides": [{ "files": ".prettierrc", "options": { "parser": "json" } }],
"plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson"]
}

3
project/.stylelintrc.js

@ -1,3 +0,0 @@
module.exports = {
extends: require.resolve('@umijs/max/stylelint'),
};

35
project/.umirc.ts

@ -1,35 +0,0 @@
import { defineConfig } from '@umijs/max';
export default defineConfig({
antd: {},
access: {},
model: {},
initialState: {},
request: {},
layout: {
title: '@umijs/max',
},
routes: [
{
path: '/',
redirect: '/home',
},
{
name: '首页',
path: '/home',
component: './Home',
},
{
name: '权限演示',
path: '/access',
component: './Access',
},
{
name: ' CRUD 示例',
path: '/table',
component: './Table',
},
],
npmClient: 'yarn',
});

3
project/README.md

@ -1,3 +0,0 @@
# README
`@umijs/max` 模板项目,更多功能参考 [Umi Max 简介](https://umijs.org/docs/max/introduce)

20
project/mock/userAPI.ts

@ -1,20 +0,0 @@
const users = [
{ id: 0, name: 'Umi', nickName: 'U', gender: 'MALE' },
{ id: 1, name: 'Fish', nickName: 'B', gender: 'FEMALE' },
];
export default {
'GET /api/v1/queryUserList': (req: any, res: any) => {
res.json({
success: true,
data: { list: users },
errorCode: 0,
});
},
'PUT /api/v1/user/': (req: any, res: any) => {
res.json({
success: true,
errorCode: 0,
});
},
};

29
project/package.json

@ -1,29 +0,0 @@
{
"private": true,
"name": "sgapp",
"author": "lishican <1213782659@qq.com>",
"scripts": {
"build": "max build",
"dev": "max dev",
"format": "prettier --cache --write .",
"postinstall": "max setup",
"setup": "max setup",
"start": "npm run dev"
},
"dependencies": {
"@ant-design/icons": "^5.0.1",
"@ant-design/pro-components": "2.4.4",
"@lishican/antbank-platform-ui": "*",
"@umijs/max": "^4.0.65",
"antd": "^5.4.0"
},
"devDependencies": {
"@types/react": "^18.0.33",
"@types/react-dom": "^18.0.11",
"lint-staged": "^13.2.0",
"prettier": "^2.8.7",
"prettier-plugin-organize-imports": "^3.2.2",
"prettier-plugin-packagejson": "^2.4.3",
"typescript": "^5.0.3"
}
}

10
project/src/access.ts

@ -1,10 +0,0 @@
export default (initialState: API.UserInfo) => {
// 在这里按照初始化数据定义项目中的权限,统一管理
// 参考文档 https://umijs.org/docs/max/access
const canSeeAdmin = !!(
initialState && initialState.name !== 'dontHaveAccess'
);
return {
canSeeAdmin,
};
};

16
project/src/app.ts

@ -1,16 +0,0 @@
// 运行时配置
// 全局初始化数据配置,用于 Layout 用户信息和权限初始化
// 更多信息见文档:https://umijs.org/docs/api/runtime-config#getinitialstate
export async function getInitialState(): Promise<{ name: string }> {
return { name: '@umijs/max' };
}
export const layout = () => {
return {
logo: 'https://img.alicdn.com/tfs/TB1YHEpwUT1gK0jSZFhXXaAtVXa-28-27.svg',
menu: {
locale: false,
},
};
};

0
project/src/assets/.gitkeep

4
project/src/components/Guide/Guide.less

@ -1,4 +0,0 @@
.title {
margin: 0 auto;
font-weight: 200;
}

23
project/src/components/Guide/Guide.tsx

@ -1,23 +0,0 @@
import { Layout, Row, Typography } from 'antd';
import React from 'react';
import styles from './Guide.less';
interface Props {
name: string;
}
// 脚手架示例组件
const Guide: React.FC<Props> = (props) => {
const { name } = props;
return (
<Layout>
<Row>
<Typography.Title level={3} className={styles.title}>
使 <strong>{name}</strong>
</Typography.Title>
</Row>
</Layout>
);
};
export default Guide;

2
project/src/components/Guide/index.ts

@ -1,2 +0,0 @@
import Guide from './Guide';
export default Guide;

1
project/src/constants/index.ts

@ -1 +0,0 @@
export const DEFAULT_NAME = 'Umi Max';

13
project/src/models/global.ts

@ -1,13 +0,0 @@
// 全局共享数据示例
import { DEFAULT_NAME } from '@/constants';
import { useState } from 'react';
const useUser = () => {
const [name, setName] = useState<string>(DEFAULT_NAME);
return {
name,
setName,
};
};
export default useUser;

21
project/src/pages/Access/index.tsx

@ -1,21 +0,0 @@
import { PageContainer } from '@ant-design/pro-components';
import { Access, useAccess } from '@umijs/max';
import { Button } from 'antd';
const AccessPage: React.FC = () => {
const access = useAccess();
return (
<PageContainer
ghost
header={{
title: '权限示例',
}}
>
<Access accessible={access.canSeeAdmin}>
<Button> Admin </Button>
</Access>
</PageContainer>
);
};
export default AccessPage;

3
project/src/pages/Home/index.less

@ -1,3 +0,0 @@
.container {
padding-top: 80px;
}

18
project/src/pages/Home/index.tsx

@ -1,18 +0,0 @@
import Guide from '@/components/Guide';
import { trim } from '@/utils/format';
import { PageContainer } from '@ant-design/pro-components';
import { useModel } from '@umijs/max';
import styles from './index.less';
import Test from '@lishican/antbank-platform-ui'
const HomePage: React.FC = () => {
return (
<PageContainer ghost>
<div className={styles.container}>
<Test/>
</div>
</PageContainer>
);
};
export default HomePage;

26
project/src/pages/Table/components/CreateForm.tsx

@ -1,26 +0,0 @@
import { Modal } from 'antd';
import React, { PropsWithChildren } from 'react';
interface CreateFormProps {
modalVisible: boolean;
onCancel: () => void;
}
const CreateForm: React.FC<PropsWithChildren<CreateFormProps>> = (props) => {
const { modalVisible, onCancel } = props;
return (
<Modal
destroyOnClose
title="新建"
width={420}
open={modalVisible}
onCancel={() => onCancel()}
footer={null}
>
{props.children}
</Modal>
);
};
export default CreateForm;

138
project/src/pages/Table/components/UpdateForm.tsx

@ -1,138 +0,0 @@
import {
ProFormDateTimePicker,
ProFormRadio,
ProFormSelect,
ProFormText,
ProFormTextArea,
StepsForm,
} from '@ant-design/pro-components';
import { Modal } from 'antd';
import React from 'react';
export interface FormValueType extends Partial<API.UserInfo> {
target?: string;
template?: string;
type?: string;
time?: string;
frequency?: string;
}
export interface UpdateFormProps {
onCancel: (flag?: boolean, formVals?: FormValueType) => void;
onSubmit: (values: FormValueType) => Promise<void>;
updateModalVisible: boolean;
values: Partial<API.UserInfo>;
}
const UpdateForm: React.FC<UpdateFormProps> = (props) => (
<StepsForm
stepsProps={{
size: 'small',
}}
stepsFormRender={(dom, submitter) => {
return (
<Modal
width={640}
bodyStyle={{ padding: '32px 40px 48px' }}
destroyOnClose
title="规则配置"
open={props.updateModalVisible}
footer={submitter}
onCancel={() => props.onCancel()}
>
{dom}
</Modal>
);
}}
onFinish={props.onSubmit}
>
<StepsForm.StepForm
initialValues={{
name: props.values.name,
nickName: props.values.nickName,
}}
title="基本信息"
>
<ProFormText
width="md"
name="name"
label="规则名称"
rules={[{ required: true, message: '请输入规则名称!' }]}
/>
<ProFormTextArea
name="desc"
width="md"
label="规则描述"
placeholder="请输入至少五个字符"
rules={[
{ required: true, message: '请输入至少五个字符的规则描述!', min: 5 },
]}
/>
</StepsForm.StepForm>
<StepsForm.StepForm
initialValues={{
target: '0',
template: '0',
}}
title="配置规则属性"
>
<ProFormSelect
width="md"
name="target"
label="监控对象"
valueEnum={{
0: '表一',
1: '表二',
}}
/>
<ProFormSelect
width="md"
name="template"
label="规则模板"
valueEnum={{
0: '规则模板一',
1: '规则模板二',
}}
/>
<ProFormRadio.Group
name="type"
width="md"
label="规则类型"
options={[
{
value: '0',
label: '强',
},
{
value: '1',
label: '弱',
},
]}
/>
</StepsForm.StepForm>
<StepsForm.StepForm
initialValues={{
type: '1',
frequency: 'month',
}}
title="设定调度周期"
>
<ProFormDateTimePicker
name="time"
label="开始时间"
rules={[{ required: true, message: '请选择开始时间!' }]}
/>
<ProFormSelect
name="frequency"
label="监控对象"
width="xs"
valueEnum={{
month: '月',
week: '周',
}}
/>
</StepsForm.StepForm>
</StepsForm>
);
export default UpdateForm;

270
project/src/pages/Table/index.tsx

@ -1,270 +0,0 @@
import services from '@/services/demo';
import {
ActionType,
FooterToolbar,
PageContainer,
ProDescriptions,
ProDescriptionsItemProps,
ProTable,
} from '@ant-design/pro-components';
import { Button, Divider, Drawer, message } from 'antd';
import React, { useRef, useState } from 'react';
import CreateForm from './components/CreateForm';
import UpdateForm, { FormValueType } from './components/UpdateForm';
const { addUser, queryUserList, deleteUser, modifyUser } =
services.UserController;
/**
*
* @param fields
*/
const handleAdd = async (fields: API.UserInfo) => {
const hide = message.loading('正在添加');
try {
await addUser({ ...fields });
hide();
message.success('添加成功');
return true;
} catch (error) {
hide();
message.error('添加失败请重试!');
return false;
}
};
/**
*
* @param fields
*/
const handleUpdate = async (fields: FormValueType) => {
const hide = message.loading('正在配置');
try {
await modifyUser(
{
userId: fields.id || '',
},
{
name: fields.name || '',
nickName: fields.nickName || '',
email: fields.email || '',
},
);
hide();
message.success('配置成功');
return true;
} catch (error) {
hide();
message.error('配置失败请重试!');
return false;
}
};
/**
*
* @param selectedRows
*/
const handleRemove = async (selectedRows: API.UserInfo[]) => {
const hide = message.loading('正在删除');
if (!selectedRows) return true;
try {
await deleteUser({
userId: selectedRows.find((row) => row.id)?.id || '',
});
hide();
message.success('删除成功,即将刷新');
return true;
} catch (error) {
hide();
message.error('删除失败,请重试');
return false;
}
};
const TableList: React.FC<unknown> = () => {
const [createModalVisible, handleModalVisible] = useState<boolean>(false);
const [updateModalVisible, handleUpdateModalVisible] =
useState<boolean>(false);
const [stepFormValues, setStepFormValues] = useState({});
const actionRef = useRef<ActionType>();
const [row, setRow] = useState<API.UserInfo>();
const [selectedRowsState, setSelectedRows] = useState<API.UserInfo[]>([]);
const columns: ProDescriptionsItemProps<API.UserInfo>[] = [
{
title: '名称',
dataIndex: 'name',
tip: '名称是唯一的 key',
formItemProps: {
rules: [
{
required: true,
message: '名称为必填项',
},
],
},
},
{
title: '昵称',
dataIndex: 'nickName',
valueType: 'text',
},
{
title: '性别',
dataIndex: 'gender',
hideInForm: true,
valueEnum: {
0: { text: '男', status: 'MALE' },
1: { text: '女', status: 'FEMALE' },
},
},
{
title: '操作',
dataIndex: 'option',
valueType: 'option',
render: (_, record) => (
<>
<a
onClick={() => {
handleUpdateModalVisible(true);
setStepFormValues(record);
}}
>
</a>
<Divider type="vertical" />
<a href=""></a>
</>
),
},
];
return (
<PageContainer
header={{
title: 'CRUD 示例',
}}
>
<ProTable<API.UserInfo>
headerTitle="查询表格"
actionRef={actionRef}
rowKey="id"
search={{
labelWidth: 120,
}}
toolBarRender={() => [
<Button
key="1"
type="primary"
onClick={() => handleModalVisible(true)}
>
</Button>,
]}
request={async (params, sorter, filter) => {
const { data, success } = await queryUserList({
...params,
// FIXME: remove @ts-ignore
// @ts-ignore
sorter,
filter,
});
return {
data: data?.list || [],
success,
};
}}
columns={columns}
rowSelection={{
onChange: (_, selectedRows) => setSelectedRows(selectedRows),
}}
/>
{selectedRowsState?.length > 0 && (
<FooterToolbar
extra={
<div>
{' '}
<a style={{ fontWeight: 600 }}>{selectedRowsState.length}</a>{' '}
&nbsp;&nbsp;
</div>
}
>
<Button
onClick={async () => {
await handleRemove(selectedRowsState);
setSelectedRows([]);
actionRef.current?.reloadAndRest?.();
}}
>
</Button>
<Button type="primary"></Button>
</FooterToolbar>
)}
<CreateForm
onCancel={() => handleModalVisible(false)}
modalVisible={createModalVisible}
>
<ProTable<API.UserInfo, API.UserInfo>
onSubmit={async (value) => {
const success = await handleAdd(value);
if (success) {
handleModalVisible(false);
if (actionRef.current) {
actionRef.current.reload();
}
}
}}
rowKey="id"
type="form"
columns={columns}
/>
</CreateForm>
{stepFormValues && Object.keys(stepFormValues).length ? (
<UpdateForm
onSubmit={async (value) => {
const success = await handleUpdate(value);
if (success) {
handleUpdateModalVisible(false);
setStepFormValues({});
if (actionRef.current) {
actionRef.current.reload();
}
}
}}
onCancel={() => {
handleUpdateModalVisible(false);
setStepFormValues({});
}}
updateModalVisible={updateModalVisible}
values={stepFormValues}
/>
) : null}
<Drawer
width={600}
open={!!row}
onClose={() => {
setRow(undefined);
}}
closable={false}
>
{row?.name && (
<ProDescriptions<API.UserInfo>
column={2}
title={row?.name}
request={async () => ({
data: row || {},
})}
params={{
id: row?.name,
}}
columns={columns}
/>
)}
</Drawer>
</PageContainer>
);
};
export default TableList;

96
project/src/services/demo/UserController.ts

@ -1,96 +0,0 @@
/* eslint-disable */
// 该文件由 OneAPI 自动生成,请勿手动修改!
import { request } from '@umijs/max';
/** 此处后端没有提供注释 GET /api/v1/queryUserList */
export async function queryUserList(
params: {
// query
/** keyword */
keyword?: string;
/** current */
current?: number;
/** pageSize */
pageSize?: number;
},
options?: { [key: string]: any },
) {
return request<API.Result_PageInfo_UserInfo__>('/api/v1/queryUserList', {
method: 'GET',
params: {
...params,
},
...(options || {}),
});
}
/** 此处后端没有提供注释 POST /api/v1/user */
export async function addUser(
body?: API.UserInfoVO,
options?: { [key: string]: any },
) {
return request<API.Result_UserInfo_>('/api/v1/user', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 GET /api/v1/user/${param0} */
export async function getUserDetail(
params: {
// path
/** userId */
userId?: string;
},
options?: { [key: string]: any },
) {
const { userId: param0 } = params;
return request<API.Result_UserInfo_>(`/api/v1/user/${param0}`, {
method: 'GET',
params: { ...params },
...(options || {}),
});
}
/** 此处后端没有提供注释 PUT /api/v1/user/${param0} */
export async function modifyUser(
params: {
// path
/** userId */
userId?: string;
},
body?: API.UserInfoVO,
options?: { [key: string]: any },
) {
const { userId: param0 } = params;
return request<API.Result_UserInfo_>(`/api/v1/user/${param0}`, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
params: { ...params },
data: body,
...(options || {}),
});
}
/** 此处后端没有提供注释 DELETE /api/v1/user/${param0} */
export async function deleteUser(
params: {
// path
/** userId */
userId?: string;
},
options?: { [key: string]: any },
) {
const { userId: param0 } = params;
return request<API.Result_string_>(`/api/v1/user/${param0}`, {
method: 'DELETE',
params: { ...params },
...(options || {}),
});
}

7
project/src/services/demo/index.ts

@ -1,7 +0,0 @@
/* eslint-disable */
// 该文件由 OneAPI 自动生成,请勿手动修改!
import * as UserController from './UserController';
export default {
UserController,
};

68
project/src/services/demo/typings.d.ts

@ -1,68 +0,0 @@
/* eslint-disable */
// 该文件由 OneAPI 自动生成,请勿手动修改!
declare namespace API {
interface PageInfo {
/**
1 */
current?: number;
pageSize?: number;
total?: number;
list?: Array<Record<string, any>>;
}
interface PageInfo_UserInfo_ {
/**
1 */
current?: number;
pageSize?: number;
total?: number;
list?: Array<UserInfo>;
}
interface Result {
success?: boolean;
errorMessage?: string;
data?: Record<string, any>;
}
interface Result_PageInfo_UserInfo__ {
success?: boolean;
errorMessage?: string;
data?: PageInfo_UserInfo_;
}
interface Result_UserInfo_ {
success?: boolean;
errorMessage?: string;
data?: UserInfo;
}
interface Result_string_ {
success?: boolean;
errorMessage?: string;
data?: string;
}
type UserGenderEnum = 'MALE' | 'FEMALE';
interface UserInfo {
id?: string;
name?: string;
/** nick */
nickName?: string;
/** email */
email?: string;
gender?: UserGenderEnum;
}
interface UserInfoVO {
name?: string;
/** nick */
nickName?: string;
/** email */
email?: string;
}
type definitions_0 = null;
}

4
project/src/utils/format.ts

@ -1,4 +0,0 @@
// 示例方法,没有实际意义
export function trim(str: string) {
return str.trim();
}

1
project/typings.d.ts

@ -1 +0,0 @@
import '@umijs/max/typings';

9473
project/yarn.lock
File diff suppressed because it is too large
View File

BIN
projects/.DS_Store

BIN
projects/bkloan-global/.DS_Store

project/.gitignore → projects/bkloan-global/.gitignore

@ -5,9 +5,5 @@
/src/.umi
/src/.umi-production
/src/.umi-test
/.umi
/.umi-production
/.umi-test
/dist
/.mfsu
.swc

18
projects/bkloan-global/.umirc.ts

@ -0,0 +1,18 @@
import { defineConfig } from 'umi';
export default defineConfig({
routes: [
{ path: '/', component: 'index' },
{ path: '/docs', component: 'docs' },
],
npmClient: 'npm',
monorepoRedirect: {
peerDeps: true,
},
mfsu: false,
plugins: ['@umijs/plugins/dist/qiankun'],
qiankun: {
slave: {},
},
// extraBabelIncludes: [/@lishican/],
});

14546
projects/bkloan-global/package-lock.json
File diff suppressed because it is too large
View File

42
projects/bkloan-global/package.json

@ -0,0 +1,42 @@
{
"name": "bkloan-sg",
"author": "lishican <1213782659@qq.com>",
"scripts": {
"build": "umi build",
"dev": "umi dev",
"postinstall": "umi setup",
"setup": "umi setup",
"start": "npm run dev"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version",
"last 1 ie version"
]
},
"resolutions": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"dependencies": {
"antd": "^5.4.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"umi": "^4.0.65"
},
"devDependencies": {
"@lishican/antbank-platform-hooks": "*",
"@lishican/antbank-platform-ui": "*",
"@types/react": "^18.0.33",
"@types/react-dom": "^18.0.11",
"@umijs/plugins": "^4.0.65",
"typescript": "^5.0.3"
}
}

14
projects/bkloan-global/src/app.ts

@ -0,0 +1,14 @@
export const qiankun = {
// 应用加载之前
async bootstrap(props) {
console.log('app1 bootstrap', props);
},
// 应用 render 之前触发
async mount(props) {
console.log('app1 mount', props);
},
// 应用卸载之后触发
async unmount(props) {
console.log('app1 unmount', props);
},
};

BIN
projects/bkloan-global/src/assets/yay.jpg

Before After
Width: 776  |  Height: 655  |  Size: 177 KiB

10
projects/bkloan-global/src/layouts/index.less

@ -0,0 +1,10 @@
.navs {
ul {
padding: 0;
list-style: none;
display: flex;
}
li {
margin-right: 1em;
}
}

10
projects/bkloan-global/src/layouts/index.tsx

@ -0,0 +1,10 @@
import { Link, Outlet } from 'umi';
import styles from './index.less';
export default function Layout() {
return (
<div className={styles.navs}>
<Outlet />
</div>
);
}

9
projects/bkloan-global/src/pages/docs.tsx

@ -0,0 +1,9 @@
const DocsPage = () => {
return (
<div>
<p>This is umi docs.</p>
</div>
);
};
export default DocsPage;

6
projects/bkloan-global/src/pages/index.less

@ -0,0 +1,6 @@
.red2{
display: flex;
justify-content: center;
align-items: center;
font-size: 100px;
}

12
projects/bkloan-global/src/pages/index.tsx

@ -0,0 +1,12 @@
import { useTask } from '@lishican/antbank-platform-hooks';
import Test from '@lishican/antbank-platform-ui';
import styles from './index.less';
export default function HomePage() {
useTask()
return (
<div>
<h2 className={styles.red2}>app23</h2>
<Test />
</div>
);ß
}

project/tsconfig.json → projects/bkloan-global/tsconfig.json

1
projects/bkloan-global/typings.d.ts

@ -0,0 +1 @@
import 'umi/typings';

BIN
projects/bkloan-sg/.DS_Store

9
projects/bkloan-sg/.gitignore

@ -0,0 +1,9 @@
/node_modules
/.env.local
/.umirc.local.ts
/config/config.local.ts
/src/.umi
/src/.umi-production
/src/.umi-test
/dist
.swc

18
projects/bkloan-sg/.umirc.ts

@ -0,0 +1,18 @@
import { defineConfig } from 'umi';
export default defineConfig({
routes: [
{ path: '/', component: 'index' },
],
npmClient: 'npm',
monorepoRedirect: {
peerDeps: true,
},
plugins: ['@umijs/plugins/dist/qiankun'],
qiankun: {
master: {},
},
mfsu: false,
// extraBabelIncludes: [/@lishican/],
});

14546
projects/bkloan-sg/package-lock.json
File diff suppressed because it is too large
View File

42
projects/bkloan-sg/package.json

@ -0,0 +1,42 @@
{
"name": "bkloan-sg",
"author": "lishican <1213782659@qq.com>",
"scripts": {
"build": "umi build",
"dev": "umi dev",
"postinstall": "umi setup",
"setup": "umi setup",
"start": "npm run dev"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version",
"last 1 ie version"
]
},
"resolutions": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"dependencies": {
"antd": "^5.4.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"umi": "^4.0.65"
},
"devDependencies": {
"@lishican/antbank-platform-hooks": "*",
"@lishican/antbank-platform-ui": "*",
"@types/react": "^18.0.33",
"@types/react-dom": "^18.0.11",
"@umijs/plugins": "^4.0.65",
"typescript": "^5.0.3"
}
}

9
projects/bkloan-sg/src/app.ts

@ -0,0 +1,9 @@
export const qiankun = {
apps: [
{
name: 'app1',
entry: '//localhost:8001',
},
],
};

BIN
projects/bkloan-sg/src/assets/yay.jpg

Before After
Width: 776  |  Height: 655  |  Size: 177 KiB

10
projects/bkloan-sg/src/layouts/index.less

@ -0,0 +1,10 @@
.navs {
ul {
padding: 0;
list-style: none;
display: flex;
}
li {
margin-right: 1em;
}
}

10
projects/bkloan-sg/src/layouts/index.tsx

@ -0,0 +1,10 @@
import { Link, Outlet } from 'umi';
import styles from './index.less';
export default function Layout() {
return (
<div className={styles.navs}>
<Outlet />
</div>
);
}

9
projects/bkloan-sg/src/pages/docs.tsx

@ -0,0 +1,9 @@
const DocsPage = () => {
return (
<div>
<p>This is umi docs.</p>
</div>
);
};
export default DocsPage;

6
projects/bkloan-sg/src/pages/index.less

@ -0,0 +1,6 @@
.red2{
display: flex;
justify-content: center;
align-items: center;
font-size: 100px;
}

13
projects/bkloan-sg/src/pages/index.tsx

@ -0,0 +1,13 @@
import { useTask } from '@lishican/antbank-platform-hooks';
import Test from '@lishican/antbank-platform-ui';
import { MicroApp } from 'umi';
import styles from './index.less';
export default function HomePage() {
useTask()
return (
<div>
<h2 className={styles.red2}>Yay! Welcome to2 umi!</h2>
<Test />
</div>
);
}

3
projects/bkloan-sg/tsconfig.json

@ -0,0 +1,3 @@
{
"extends": "./src/.umi/tsconfig.json"
}

1
projects/bkloan-sg/typings.d.ts

@ -0,0 +1 @@
import 'umi/typings';

13496
yarn.lock
File diff suppressed because it is too large
View File

Loading…
Cancel
Save