Commit 3981038c authored by godkaikai's avatar godkaikai

前端上传

parent ef0bce03
......@@ -28,3 +28,6 @@ target/*
*/target/*
*/*/target/*
dlink-web/node_modules/*
datalink-web/node_modules/*
dlink-web/dist/*
datalink-web/dist/*
# 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
/lambda/
/scripts
/config
.history
public
dist
.umi
mock
\ No newline at end of file
module.exports = {
extends: [require.resolve('@umijs/fabric/dist/eslint')],
globals: {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
page: true,
REACT_APP_ENV: true,
},
};
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
**/node_modules
# roadhog-api-doc ignore
/src/utils/request-temp.js
_roadhog-api-doc
# production
/dist
/.vscode
# misc
.DS_Store
npm-debug.log*
yarn-error.log
/coverage
.idea
yarn.lock
package-lock.json
*bak
.vscode
# visual studio code
.history
*.log
functions/*
.temp/**
# umi
.umi
.umi-production
# screenshot
screenshot
.firebase
.eslintcache
build
**/*.svg
package.json
.umi
.umi-production
/dist
.dockerignore
.DS_Store
.eslintignore
*.png
*.toml
docker
.editorconfig
Dockerfile*
.gitignore
.prettierignore
LICENSE
.eslintcache
*.lock
yarn-error.log
.history
CNAME
/build
/public
\ No newline at end of file
const fabric = require('@umijs/fabric');
module.exports = {
...fabric.prettier,
};
const fabric = require('@umijs/fabric');
module.exports = {
...fabric.stylelint,
};
# Ant Design Pro
This project is initialized with [Ant Design Pro](https://pro.ant.design). Follow is the quick guide for how to use.
## Environment Prepare
Install `node_modules`:
```bash
npm install
```
or
```bash
yarn
```
## Provided Scripts
Ant Design Pro provides some useful script to help you quick start and build with web project, code style check and test.
Scripts provided in `package.json`. It's safe to modify or add additional script:
### Start project
```bash
npm start
```
### Build project
```bash
npm run build
```
### Check code style
```bash
npm run lint
```
You can also use script to auto fix some lint error:
```bash
npm run lint:fix
```
### Test code
```bash
npm test
```
## More
You can view full document on our [official website](https://pro.ant.design). And welcome any feedback in our [github](https://github.com/ant-design/ant-design-pro).
// https://umijs.org/config/
import { defineConfig } from 'umi';
export default defineConfig({
plugins: [
// https://github.com/zthxxx/react-dev-inspector
'react-dev-inspector/plugins/umi/react-inspector',
],
// https://github.com/zthxxx/react-dev-inspector#inspector-loader-props
inspectorConfig: {
exclude: [],
babelPlugins: [],
babelOptions: {},
},
webpack5: {
// lazyCompilation: {},
},
});
// https://umijs.org/config/
import { defineConfig } from 'umi';
import { join } from 'path';
import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';
const { REACT_APP_ENV } = process.env;
export default defineConfig({
hash: true,
antd: {},
dva: {
hmr: true,
},
layout: {
// https://umijs.org/zh-CN/plugins/plugin-layout
locale: true,
siderWidth: 208,
...defaultSettings,
},
// https://umijs.org/zh-CN/plugins/plugin-locale
locale: {
// default zh-CN
default: 'zh-CN',
antd: true,
// default true, when it is true, will use `navigator.language` overwrite default
baseNavigator: true,
},
dynamicImport: {
loading: '@ant-design/pro-layout/es/PageLoading',
},
targets: {
ie: 11,
},
// umi routes: https://umijs.org/docs/routing
routes,
// Theme for antd: https://ant.design/docs/react/customize-theme-cn
theme: {
'primary-color': defaultSettings.primaryColor,
},
// esbuild is father build tools
// https://umijs.org/plugins/plugin-esbuild
esbuild: {},
title: false,
ignoreMomentLocale: true,
// proxy: proxy[REACT_APP_ENV || 'dev'],
proxy: proxy['dev'],
manifest: {
basePath: '/',
},
// Fast Refresh 热更新
fastRefresh: {},
openAPI: [
{
requestLibPath: "import { request } from 'umi'",
// 或者使用在线的版本
// schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json"
schemaPath: join(__dirname, 'oneapi.json'),
mock: false,
},
{
requestLibPath: "import { request } from 'umi'",
schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json',
projectName: 'swagger',
},
],
});
import { Settings as LayoutSettings } from '@ant-design/pro-layout';
const Settings: LayoutSettings & {
pwa?: boolean;
logo?: string;
} = {
navTheme: 'light',
// 拂晓蓝
primaryColor: '#1890ff',
layout: 'mix',
contentWidth: 'Fluid',
fixedHeader: false,
fixSiderbar: true,
colorWeak: false,
title: 'Dlink 开发平台',
pwa: false,
logo: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg',
iconfontUrl: '',
menu: {
locale: true
},
headerHeight: 48,
//splitMenus: true
};
export default Settings;
This diff is collapsed.
/**
* 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
* The agent cannot take effect in the production environment
* so there is no configuration of the production environment
* For details, please see
* https://pro.ant.design/docs/deploy
*/
export default {
dev: {
'/api': {
target: 'http://127.0.0.1:8888',
changeOrigin: true,
pathRewrite: { '^': '' },
},
},
test: {
'/api/': {
target: 'https://preview.pro.ant.design',
changeOrigin: true,
pathRewrite: { '^': '' },
},
},
pre: {
'/api/': {
target: 'your pre url',
changeOrigin: true,
pathRewrite: { '^': '' },
},
},
};
export default [
{
path: '/user',
layout: false,
routes: [
{
path: '/user',
routes: [
{
name: 'login',
path: '/user/login',
component: './user/Login',
},
],
},
],
},
{
path: '/welcome',
name: 'home',
icon: 'home',
component: './Welcome',
},
{
path: '/dbase',
name: 'dbase',
access: 'canAdmin',
routes: [
{
path: '/dbase/user-center',
name: 'user-center',
icon: 'user',
routes: [
{
path: '/dbase/user-center/user',
name: 'user',
icon: 'user',
component: './Dbase/User',
},
{
path: '/dbase/user-center/role',
name: 'role',
icon: 'smile',
component: './Common/Build',
},
{
path: '/dbase/user-center/menu',
name: 'menu',
icon: 'smile',
component: './Common/Build',
},
{
path: '/dbase/user-center/client',
name: 'client',
icon: 'smile',
component: './Common/Build',
},
{
path: '/dbase/user-center/token',
name: 'token',
icon: 'smile',
component: './Common/Build',
},
],
},
{
path: '/dbase/springcloud',
name: 'springcloud',
icon: 'cloud',
routes: [
{
path: '/dbase/springcloud/nacos',
name: 'nacos',
component: './Common/Build',
},
],
},
{
path: '/dbase/database',
name: 'database',
icon: 'database',
routes: [
{
path: '/dbase/database/manager',
name: 'manager',
component: './Common/Build',
},
],
},
{
path: '/dbase/moitor',
name: 'moitor',
icon: 'desktop',
routes: [
{
path: '/dbase/moitor/log',
name: 'log',
component: './Common/Build',
},
],
},
{
path: '/dbase/cluster',
name: 'cluster',
icon: 'cluster',
routes: [
{
path: '/dbase/cluster/node',
name: 'node',
component: './Common/Build',
},
],
},
{
path: '/dbase/schedule',
name: 'schedule',
icon: 'fieldTime',
routes: [
{
path: '/dbase/schedule/job',
name: 'job',
component: './Common/Build',
},
],
},
],
},
{
path: '/dbus',
name: 'dbus',
component: './Common/Build',
},
{
path: '/dlink',
name: 'dlink',
access: 'canAdmin',
routes: [
{
path: '/dlink/flink',
name: 'flink',
icon: 'crown',
routes: [
{
path: '/dlink/flink/studio',
name: 'studio',
component: './Dlink/Studio',
},
],
},
{
path: '/dlink/task',
name: 'task',
icon: 'crown',
routes: [
{
path: '/dlink/task/list',
name: 'list',
component: './Dlink/Task',
},
{
path: '/dlink/task/create',
name: 'create',
component: './Common/Build',
},
{
path: '/dlink/task/flinksql',
name: 'flinksql',
component: './Dlink/FlinkSql',
},
],
},
{
path: '/dlink/warehouse',
name: 'warehouse',
icon: 'deploymentUnit',
routes: [
{
path: '/dlink/warehouse/metadata',
name: 'metadata',
component: './Common/Build',
},
],
},
],
},
{
path: '/dsink',
name: 'dsink',
component: './Common/Build',
},
{
path: '/dview',
name: 'dview',
component: './Common/Build',
},
{
path: '/dai',
name: 'dai',
component: './Common/Build',
},
{
path: '/dev',
name: 'dev',
routes: [
{
path: '/dev/flink',
name: 'flink',
icon: 'github',
routes: [
{
path: 'https://ci.apache.org/projects/flink/flink-docs-release-1.13/',
name: 'docs',
},
],
},
{
path: '/dev/ant',
name: 'ant-design',
icon: 'antDesign',
routes: [
{
path: 'https://ant.design/components/icon-cn/',
name: 'docs',
},
{
path:
'https://preview.pro.ant.design/dashboard/analysis?primaryColor=%231890ff&fixSiderbar=true&colorWeak=false&pwa=false',
name: 'preview',
},
],
},
],
},
/*{
path: '/admin',
name: 'admin',
icon: 'crown',
access: 'canAdmin',
component: './Admin',
routes: [
{
path: '/admin/sub-page',
name: 'sub-page',
icon: 'smile',
component: './Welcome',
},
],
},*/
{
path: '/demo',
name: 'demo',
//access: 'canAdmin',
routes: [
{
name: 'list',
icon: 'table',
path: '/demo/list',
routes: [
{
name: 'table-list',
icon: 'table',
path: '/demo/list/listtablelist',
component: './Demo/ListTableList',
},
{
name: 'basic-list',
icon: 'smile',
path: '/demo/list/listbasiclist',
component: './Demo/ListBasicList',
},
],
},
{
name: 'form',
icon: 'smile',
path: '/demo/form',
routes: [
{
name: 'advanced-form',
icon: 'smile',
path: '/demo/form/formadvancedform',
component: './FormAdvancedForm',
},
{
name: '分步表单',
icon: 'smile',
path: '/demo/form/formstepform',
component: './Demo/FormStepForm',
},
],
},
],
},
{
path: '/',
redirect: '/welcome',
},
{
component: './404',
},
];
module.exports = {
testURL: 'http://localhost:8000',
testEnvironment: './tests/PuppeteerEnvironment',
verbose: false,
extraSetupFiles: ['./tests/setupTests.js'],
globals: {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: false,
localStorage: null,
},
};
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}
// eslint-disable-next-line import/no-extraneous-dependencies
import { Request, Response } from 'express';
import moment from 'moment';
import { parse } from 'url';
// mock tableListDataSource
const genList = (current: number, pageSize: number) => {
const tableListDataSource: API.RuleListItem[] = [];
for (let i = 0; i < pageSize; i += 1) {
const index = (current - 1) * 10 + i;
tableListDataSource.push({
key: index,
disabled: i % 6 === 0,
href: 'https://ant.design',
avatar: [
'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
][i % 2],
name: `TradeCode ${index}`,
owner: '曲丽丽',
desc: '这是一段描述',
callNo: Math.floor(Math.random() * 1000),
status: Math.floor(Math.random() * 10) % 4,
updatedAt: moment().format('YYYY-MM-DD'),
createdAt: moment().format('YYYY-MM-DD'),
progress: Math.ceil(Math.random() * 100),
});
}
tableListDataSource.reverse();
return tableListDataSource;
};
let tableListDataSource = genList(1, 100);
function getRule(req: Request, res: Response, u: string) {
let realUrl = u;
if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
realUrl = req.url;
}
const { current = 1, pageSize = 10 } = req.query;
const params = (parse(realUrl, true).query as unknown) as API.PageParams &
API.RuleListItem & {
sorter: any;
filter: any;
};
let dataSource = [...tableListDataSource].slice(
((current as number) - 1) * (pageSize as number),
(current as number) * (pageSize as number),
);
const sorter = JSON.parse(params.sorter || ('{}' as any));
if (sorter) {
dataSource = dataSource.sort((prev, next) => {
let sortNumber = 0;
Object.keys(sorter).forEach((key) => {
if (sorter[key] === 'descend') {
if (prev[key] - next[key] > 0) {
sortNumber += -1;
} else {
sortNumber += 1;
}
return;
}
if (prev[key] - next[key] > 0) {
sortNumber += 1;
} else {
sortNumber += -1;
}
});
return sortNumber;
});
}
if (params.filter) {
const filter = JSON.parse(params.filter as any) as {
[key: string]: string[];
};
if (Object.keys(filter).length > 0) {
dataSource = dataSource.filter((item) => {
return Object.keys(filter).some((key) => {
if (!filter[key]) {
return true;
}
if (filter[key].includes(`${item[key]}`)) {
return true;
}
return false;
});
});
}
}
if (params.name) {
dataSource = dataSource.filter((data) => data?.name?.includes(params.name || ''));
}
const result = {
data: dataSource,
total: tableListDataSource.length,
success: true,
pageSize,
current: parseInt(`${params.current}`, 10) || 1,
};
return res.json(result);
}
function postRule(req: Request, res: Response, u: string, b: Request) {
let realUrl = u;
if (!realUrl || Object.prototype.toString.call(realUrl) !== '[object String]') {
realUrl = req.url;
}
const body = (b && b.body) || req.body;
const { method, name, desc, key } = body;
switch (method) {
/* eslint no-case-declarations:0 */
case 'delete':
tableListDataSource = tableListDataSource.filter((item) => key.indexOf(item.key) === -1);
break;
case 'post':
(() => {
const i = Math.ceil(Math.random() * 10000);
const newRule: API.RuleListItem = {
key: tableListDataSource.length,
href: 'https://ant.design',
avatar: [
'https://gw.alipayobjects.com/zos/rmsportal/eeHMaZBwmTvLdIwMfBpg.png',
'https://gw.alipayobjects.com/zos/rmsportal/udxAbMEhpwthVVcjLXik.png',
][i % 2],
name,
owner: '曲丽丽',
desc,
callNo: Math.floor(Math.random() * 1000),
status: Math.floor(Math.random() * 10) % 2,
updatedAt: moment().format('YYYY-MM-DD'),
createdAt: moment().format('YYYY-MM-DD'),
progress: Math.ceil(Math.random() * 100),
};
tableListDataSource.unshift(newRule);
return res.json(newRule);
})();
return;
case 'update':
(() => {
let newRule = {};
tableListDataSource = tableListDataSource.map((item) => {
if (item.key === key) {
newRule = { ...item, desc, name };
return { ...item, desc, name };
}
return item;
});
return res.json(newRule);
})();
return;
default:
break;
}
const result = {
list: tableListDataSource,
pagination: {
total: tableListDataSource.length,
},
};
res.json(result);
}
export default {
'GET /api/rule': getRule,
'POST /api/rule': postRule,
};
import { Request, Response } from 'express';
const getNotices = (req: Request, res: Response) => {
res.json({
data: [
{
id: '000000001',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
title: '你收到了 14 份新周报',
datetime: '2017-08-09',
type: 'notification',
},
{
id: '000000002',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png',
title: '你推荐的 曲妮妮 已通过第三轮面试',
datetime: '2017-08-08',
type: 'notification',
},
{
id: '000000003',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png',
title: '这种模板可以区分多种通知类型',
datetime: '2017-08-07',
read: true,
type: 'notification',
},
{
id: '000000004',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png',
title: '左侧图标用于区分不同的类型',
datetime: '2017-08-07',
type: 'notification',
},
{
id: '000000005',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
title: '内容不要超过两行字,超出时自动截断',
datetime: '2017-08-07',
type: 'notification',
},
{
id: '000000006',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
title: '曲丽丽 评论了你',
description: '描述信息描述信息描述信息',
datetime: '2017-08-07',
type: 'message',
clickClose: true,
},
{
id: '000000007',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
title: '朱偏右 回复了你',
description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像',
datetime: '2017-08-07',
type: 'message',
clickClose: true,
},
{
id: '000000008',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
title: '标题',
description: '这种模板用于提醒谁与你发生了互动,左侧放『谁』的头像',
datetime: '2017-08-07',
type: 'message',
clickClose: true,
},
{
id: '000000009',
title: '任务名称',
description: '任务需要在 2017-01-12 20:00 前启动',
extra: '未开始',
status: 'todo',
type: 'event',
},
{
id: '000000010',
title: '第三方紧急代码变更',
description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
extra: '马上到期',
status: 'urgent',
type: 'event',
},
{
id: '000000011',
title: '信息安全考试',
description: '指派竹尔于 2017-01-09 前完成更新并发布',
extra: '已耗时 8 天',
status: 'doing',
type: 'event',
},
{
id: '000000012',
title: 'ABCD 版本发布',
description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
extra: '进行中',
status: 'processing',
type: 'event',
},
],
});
};
export default {
'GET /api/notices': getNotices,
};
export default {
'/api/auth_routes': {
'/form/advanced-form': { authority: ['admin', 'user'] },
},
};
import { Request, Response } from 'express';
const waitTime = (time: number = 100) => {
return new Promise((resolve) => {
setTimeout(() => {
resolve(true);
}, time);
});
};
async function getFakeCaptcha(req: Request, res: Response) {
await waitTime(2000);
return res.json('captcha-xxx');
}
const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION } = process.env;
/**
* 当前用户的权限,如果为空代表没登录
* current user access, if is '', user need login
* 如果是 pro 的预览,默认是有权限的
*/
let access = ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site' ? 'admin' : '';
const getAccess = () => {
return access;
};
// 代码中会兼容本地 service mock 以及部署站点的静态数据
export default {
// 支持值为 Object 和 Array
'GET /api/currentUser': (req: Request, res: Response) => {
if (!getAccess()) {
res.status(401).send({
data: {
isLogin: false,
},
errorCode: '401',
errorMessage: '请先登录!',
success: true,
});
return;
}
res.send({
name: 'Wenmo',
avatar: 'https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png',
userid: '00000001',
email: 'antdesign@alipay.com',
signature: '海纳百川,有容乃大',
title: '交互专家',
group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED',
tags: [
{
key: '0',
label: '很有想法的',
},
{
key: '1',
label: '专注设计',
},
{
key: '2',
label: '辣~',
},
{
key: '3',
label: '大长腿',
},
{
key: '4',
label: '川妹子',
},
{
key: '5',
label: '海纳百川',
},
],
notifyCount: 12,
unreadCount: 11,
country: 'China',
access: getAccess(),
geographic: {
province: {
label: '浙江省',
key: '330000',
},
city: {
label: '杭州市',
key: '330100',
},
},
address: '西湖区工专路 77 号',
phone: '0752-268888888',
});
},
// GET POST 可省略
'GET /api/users': [
{
key: '1',
name: 'John Brown',
age: 32,
address: 'New York No. 1 Lake Park',
},
{
key: '2',
name: 'Jim Green',
age: 42,
address: 'London No. 1 Lake Park',
},
{
key: '3',
name: 'Joe Black',
age: 32,
address: 'Sidney No. 1 Lake Park',
},
],
'POST /api-uaas/oauth/token': async (req: Request, res: Response) => {
const { password, username, type } = req.body;
await waitTime(2000);
const record = {
"datas": {
"access_token": "22b36086-acde-4a23-bc53-bb51dc2be369",
"token_type": "bearer",
"refresh_token": "f51b89c2-a3ab-406d-beac-5d52fd5bcb98",
"expires_in": 3599,
"scope": "app"
},
"code": 0,
"msg": ""
};
if (password === 'admin' && username === 'admin') {
/*res.send({
status: 'ok',
type,
currentAuthority: 'admin',
});*/
res.send(record);
access = 'admin';
return;
}
if (password === 'password' && username === 'user') {
res.send(record);
access = 'user';
return;
}
if (type === 'mobile') {
res.send(record);
access = 'admin';
return;
}
res.send({
"error": "invalid_grant",
"error_description": "用户名或密码错误",
"code": "400",
"msg": "用户名或密码错误"
});
access = 'guest';
},
'DELETE /api-uaas/oauth/remove/token': (req: Request, res: Response) => {
access = '';
res.send({ msg: '登出成功', code: 0 });
},
'POST /api/register': (req: Request, res: Response) => {
res.send({ status: 'ok', currentAuthority: 'user', success: true });
},
'GET /api/500': (req: Request, res: Response) => {
res.status(500).send({
timestamp: 1513932555104,
status: 500,
error: 'error',
message: 'error',
path: '/base/category/list',
});
},
'GET /api/404': (req: Request, res: Response) => {
res.status(404).send({
timestamp: 1513932643431,
status: 404,
error: 'Not Found',
message: 'No message available',
path: '/base/category/list/2121212',
});
},
'GET /api/403': (req: Request, res: Response) => {
res.status(403).send({
timestamp: 1513932555104,
status: 403,
error: 'Unauthorized',
message: 'Unauthorized',
path: '/base/category/list',
});
},
'GET /api/401': (req: Request, res: Response) => {
res.status(401).send({
timestamp: 1513932555104,
status: 401,
error: 'Unauthorized',
message: 'Unauthorized',
path: '/base/category/list',
});
},
'GET /api/login/captcha': getFakeCaptcha,
};
{
"name": "ant-design-pro",
"version": "5.0.0-beta.2",
"private": true,
"description": "An out-of-box UI solution for enterprise applications",
"scripts": {
"analyze": "cross-env ANALYZE=1 umi build",
"build": "umi build",
"deploy": "npm run site && npm run gh-pages",
"dev": "npm run start:dev",
"gh-pages": "gh-pages -d dist",
"i18n-remove": "pro i18n-remove --locale=zh-CN --write",
"postinstall": "umi g tmp",
"lint": "umi g tmp && npm run lint:js && npm run lint:style && npm run lint:prettier",
"lint-staged": "lint-staged",
"lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ",
"lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src && npm run lint:style",
"lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
"lint:prettier": "prettier --check \"src/**/*\" --end-of-line auto",
"lint:style": "stylelint --fix \"src/**/*.less\" --syntax less",
"openapi": "umi openapi",
"precommit": "lint-staged",
"prettier": "prettier -c --write \"src/**/*\"",
"start": "cross-env UMI_ENV=dev umi dev",
"start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev umi dev",
"start:no-mock": "cross-env MOCK=none UMI_ENV=dev umi dev",
"start:no-ui": "cross-env UMI_UI=none UMI_ENV=dev umi dev",
"start:pre": "cross-env REACT_APP_ENV=pre UMI_ENV=dev umi dev",
"start:test": "cross-env REACT_APP_ENV=test MOCK=none UMI_ENV=dev umi dev",
"pretest": "node ./tests/beforeTest",
"test": "umi test",
"test:all": "node ./tests/run-tests.js",
"test:component": "umi test ./src/components",
"tsc": "tsc --noEmit"
},
"lint-staged": {
"**/*.less": "stylelint --syntax less",
"**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
"**/*.{js,jsx,tsx,ts,less,md,json}": [
"prettier --write"
]
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 10"
],
"dependencies": {
"@ant-design/icons": "^4.5.0",
"@ant-design/pro-descriptions": "^1.6.8",
"@ant-design/pro-form": "^1.18.3",
"@ant-design/pro-layout": "^6.18.0",
"@ant-design/pro-table": "^2.36.0",
"@types/lodash.isequal": "^4.5.5",
"@umijs/openapi": "^1.1.14",
"@umijs/plugin-openapi": "^1.2.0",
"@umijs/route-utils": "^1.0.36",
"antd": "^4.14.0",
"classnames": "^2.2.6",
"dva": "^2.4.0",
"lodash": "^4.17.11",
"lodash.isequal": "^4.5.0",
"moment": "^2.25.3",
"monaco-editor": "^0.24.0",
"monaco-editor-webpack-plugin": "^3.1.0",
"nzh": "^1.0.3",
"omit.js": "^2.0.2",
"react": "^17.0.0",
"react-dev-inspector": "^1.1.1",
"react-dom": "^17.0.0",
"react-helmet-async": "^1.0.4",
"react-monaco-editor": "^0.43.0",
"umi": "^3.4.0",
"umi-request": "^1.0.8"
},
"devDependencies": {
"@ant-design/pro-cli": "^2.0.2",
"@types/classnames": "^2.2.7",
"@types/express": "^4.17.0",
"@types/history": "^4.7.2",
"@types/jest": "^26.0.0",
"@types/lodash": "^4.14.144",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/react-helmet": "^6.1.0",
"@umijs/fabric": "^2.5.2",
"@umijs/plugin-blocks": "^2.0.5",
"@umijs/plugin-esbuild": "^1.0.1",
"@umijs/preset-ant-design-pro": "^1.2.0",
"@umijs/preset-dumi": "^1.1.7",
"@umijs/preset-react": "^1.7.4",
"@umijs/preset-ui": "^2.2.9",
"@umijs/yorkie": "^2.0.3",
"carlo": "^0.9.46",
"cross-env": "^7.0.0",
"cross-port-killer": "^1.1.1",
"detect-installer": "^1.0.1",
"enzyme": "^3.11.0",
"eslint": "^7.1.0",
"express": "^4.17.1",
"gh-pages": "^3.0.0",
"jsdom-global": "^3.0.2",
"lint-staged": "^10.0.0",
"mockjs": "^1.0.1-beta3",
"prettier": "^2.0.1",
"puppeteer-core": "^8.0.0",
"stylelint": "^13.0.0",
"typescript": "^4.2.2"
},
"engines": {
"node": ">=10.0.0"
},
"gitHooks": {
"commit-msg": "node ./node_modules/@umijs/fabric/dist/verifyCommit.js"
}
}
preview.pro.ant.design
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200" version="1.1" viewBox="0 0 200 200"><title>Group 28 Copy 5</title><desc>Created with Sketch.</desc><defs><linearGradient id="linearGradient-1" x1="62.102%" x2="108.197%" y1="0%" y2="37.864%"><stop offset="0%" stop-color="#4285EB"/><stop offset="100%" stop-color="#2EC7FF"/></linearGradient><linearGradient id="linearGradient-2" x1="69.644%" x2="54.043%" y1="0%" y2="108.457%"><stop offset="0%" stop-color="#29CDFF"/><stop offset="37.86%" stop-color="#148EFF"/><stop offset="100%" stop-color="#0A60FF"/></linearGradient><linearGradient id="linearGradient-3" x1="69.691%" x2="16.723%" y1="-12.974%" y2="117.391%"><stop offset="0%" stop-color="#FA816E"/><stop offset="41.473%" stop-color="#F74A5C"/><stop offset="100%" stop-color="#F51D2C"/></linearGradient><linearGradient id="linearGradient-4" x1="68.128%" x2="30.44%" y1="-35.691%" y2="114.943%"><stop offset="0%" stop-color="#FA8E7D"/><stop offset="51.264%" stop-color="#F74A5C"/><stop offset="100%" stop-color="#F51D2C"/></linearGradient></defs><g id="Page-1" fill="none" fill-rule="evenodd" stroke="none" stroke-width="1"><g id="logo" transform="translate(-20.000000, -20.000000)"><g id="Group-28-Copy-5" transform="translate(20.000000, 20.000000)"><g id="Group-27-Copy-3"><g id="Group-25" fill-rule="nonzero"><g id="2"><path id="Shape" fill="url(#linearGradient-1)" d="M91.5880863,4.17652823 L4.17996544,91.5127728 C-0.519240605,96.2081146 -0.519240605,103.791885 4.17996544,108.487227 L91.5880863,195.823472 C96.2872923,200.518814 103.877304,200.518814 108.57651,195.823472 L145.225487,159.204632 C149.433969,154.999611 149.433969,148.181924 145.225487,143.976903 C141.017005,139.771881 134.193707,139.771881 129.985225,143.976903 L102.20193,171.737352 C101.032305,172.906015 99.2571609,172.906015 98.0875359,171.737352 L28.285908,101.993122 C27.1162831,100.824459 27.1162831,99.050775 28.285908,97.8821118 L98.0875359,28.1378823 C99.2571609,26.9692191 101.032305,26.9692191 102.20193,28.1378823 L129.985225,55.8983314 C134.193707,60.1033528 141.017005,60.1033528 145.225487,55.8983314 C149.433969,51.69331 149.433969,44.8756232 145.225487,40.6706018 L108.58055,4.05574592 C103.862049,-0.537986846 96.2692618,-0.500797906 91.5880863,4.17652823 Z"/><path id="Shape" fill="url(#linearGradient-2)" d="M91.5880863,4.17652823 L4.17996544,91.5127728 C-0.519240605,96.2081146 -0.519240605,103.791885 4.17996544,108.487227 L91.5880863,195.823472 C96.2872923,200.518814 103.877304,200.518814 108.57651,195.823472 L145.225487,159.204632 C149.433969,154.999611 149.433969,148.181924 145.225487,143.976903 C141.017005,139.771881 134.193707,139.771881 129.985225,143.976903 L102.20193,171.737352 C101.032305,172.906015 99.2571609,172.906015 98.0875359,171.737352 L28.285908,101.993122 C27.1162831,100.824459 27.1162831,99.050775 28.285908,97.8821118 L98.0875359,28.1378823 C100.999864,25.6271836 105.751642,20.541824 112.729652,19.3524487 C117.915585,18.4685261 123.585219,20.4140239 129.738554,25.1889424 C125.624663,21.0784292 118.571995,14.0340304 108.58055,4.05574592 C103.862049,-0.537986846 96.2692618,-0.500797906 91.5880863,4.17652823 Z"/></g><path id="Shape" fill="url(#linearGradient-3)" d="M153.685633,135.854579 C157.894115,140.0596 164.717412,140.0596 168.925894,135.854579 L195.959977,108.842726 C200.659183,104.147384 200.659183,96.5636133 195.960527,91.8688194 L168.690777,64.7181159 C164.472332,60.5180858 157.646868,60.5241425 153.435895,64.7316526 C149.227413,68.936674 149.227413,75.7543607 153.435895,79.9593821 L171.854035,98.3623765 C173.02366,99.5310396 173.02366,101.304724 171.854035,102.473387 L153.685633,120.626849 C149.47715,124.83187 149.47715,131.649557 153.685633,135.854579 Z"/></g><ellipse id="Combined-Shape" cx="100.519" cy="100.437" fill="url(#linearGradient-4)" rx="23.6" ry="23.581"/></g></g></g></g></svg>
\ No newline at end of file
<svg width="42" height="42" xmlns="http://www.w3.org/2000/svg">
<g>
<path fill="#070707" d="m6.717392,13.773912l5.6,0c2.8,0 4.7,1.9 4.7,4.7c0,2.8 -2,4.7 -4.9,4.7l-2.5,0l0,4.3l-2.9,0l0,-13.7zm2.9,2.2l0,4.9l1.9,0c1.6,0 2.6,-0.9 2.6,-2.4c0,-1.6 -0.9,-2.4 -2.6,-2.4l-1.9,0l0,-0.1zm8.9,11.5l2.7,0l0,-5.7c0,-1.4 0.8,-2.3 2.2,-2.3c0.4,0 0.8,0.1 1,0.2l0,-2.4c-0.2,-0.1 -0.5,-0.1 -0.8,-0.1c-1.2,0 -2.1,0.7 -2.4,2l-0.1,0l0,-1.9l-2.7,0l0,10.2l0.1,0zm11.7,0.1c-3.1,0 -5,-2 -5,-5.3c0,-3.3 2,-5.3 5,-5.3s5,2 5,5.3c0,3.4 -1.9,5.3 -5,5.3zm0,-2.1c1.4,0 2.2,-1.1 2.2,-3.2c0,-2 -0.8,-3.2 -2.2,-3.2c-1.4,0 -2.2,1.2 -2.2,3.2c0,2.1 0.8,3.2 2.2,3.2z" class="st0" id="Ant-Design-Pro"/>
</g>
</svg>
\ No newline at end of file
/**
* @see https://umijs.org/zh-CN/plugins/plugin-access
* */
export default function access(initialState: { currentUser?: API.CurrentUser | undefined }) {
const { currentUser } = initialState || {};
return {
canAdmin: currentUser && currentUser.access === 'admin',
};
}
import type { Settings as LayoutSettings } from '@ant-design/pro-layout';
import { PageLoading } from '@ant-design/pro-layout';
import { notification } from 'antd';
import type { RequestConfig, RunTimeLayoutConfig } from 'umi';
import { getIntl, getLocale, history, Link } from 'umi';
import RightContent from '@/components/RightContent';
import Footer from '@/components/Footer';
import type { ResponseError } from 'umi-request';
import { currentUser as queryCurrentUser } from './services/ant-design-pro/api';
import { BookOutlined, LinkOutlined } from '@ant-design/icons';
import {RequestOptionsInit} from "umi-request";
const isDev = process.env.NODE_ENV === 'development';
const loginPath = '/user/login';
const authHeaderInterceptor = (url: string, options: RequestOptionsInit) => {
if(url === '/api-uaa/oauth/token'){
const authorization = Buffer.from('webApp:webApp').toString('base64');
const authHeader = { Authorization: `Basic ${authorization}` };
return {
url: `${url}`,
options: {...options, interceptors: true, headers: authHeader},
};
}else {
const authHeader = {Authorization: `Bearer ${localStorage.getItem('token')}`};
return {
url: `${url}`,
options: {...options, interceptors: true, headers: authHeader},
};
}
};
/** 获取用户信息比较慢的时候会展示一个 loading */
export const initialStateConfig = {
loading: <PageLoading />,
};
/**
* @see https://umijs.org/zh-CN/plugins/plugin-initial-state
* */
export async function getInitialState(): Promise<{
settings?: Partial<LayoutSettings>;
currentUser?: API.CurrentUser;
fetchUserInfo?: () => Promise<API.CurrentUser | undefined>;
}> {
const fetchUserInfo = async () => {
try {
const result = await queryCurrentUser();
const currentUser:API.CurrentUser = {
name: result.datas.nickname,
avatar: result.datas.avatar,
userid: result.datas.id,
email: 'antdesign@alipay.com',
signature: '海纳百川,有容乃大',
title: '交互专家啊',
group: '蚂蚁金服-某某某事业群-某某平台部-某某技术部-UED',
tags: [
{
key: '0',
label: '很有想法的',
},
{
key: '1',
label: '专注设计',
},
{
key: '2',
label: '辣~',
},
{
key: '3',
label: '大长腿',
},
{
key: '4',
label: '川妹子',
},
{
key: '5',
label: '海纳百川',
},
],
notifyCount: 12,
unreadCount: 11,
country: 'China',
access: 'admin',
geographic: {
province: {
label: '浙江省',
key: '330000',
},
city: {
label: '杭州市',
key: '330100',
},
},
address: '西湖区工专路 77 号',
phone: result.datas.mobile,
};
return currentUser;
} catch (error) {
history.push(loginPath);
}
return undefined;
};
// 如果是登录页面,不执行
if (history.location.pathname !== loginPath) {
const currentUser = await fetchUserInfo();
return {
fetchUserInfo,
currentUser,
settings: {},
};
}
return {
fetchUserInfo,
settings: {},
};
}
/**
* 异常处理程序
const codeMessage = {
200: '服务器成功返回请求的数据。',
201: '新建或修改数据成功。',
202: '一个请求已经进入后台排队(异步任务)。',
204: '删除数据成功。',
400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
401: '用户没有权限(令牌、用户名、密码错误)。',
403: '用户得到授权,但是访问是被禁止的。',
404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
405: '请求方法不被允许。',
406: '请求的格式不可得。',
410: '请求的资源被永久删除,且不会再得到的。',
422: '当创建一个对象时,发生一个验证错误。',
500: '服务器发生错误,请检查服务器。',
502: '网关错误。',
503: '服务不可用,服务器暂时过载或维护。',
504: '网关超时。',
};
* @see https://beta-pro.ant.design/docs/request-cn
*/
export const request: RequestConfig = {
errorHandler: (error: ResponseError) => {
const { messages } = getIntl(getLocale());
const { request,response } = error;
const writeUrl = ['/api-user/users/current','/api-uaa/oauth/token'];
if(writeUrl.indexOf(request.originUrl)>-1){
return;
}else {
if (response && response.status) {
const {status, statusText, url} = response;
const requestErrorMessage = messages['app.request.error'];
const errorMessage = `${requestErrorMessage} ${status}: ${url}`;
const errorDescription = messages[`app.request.${status}`] || statusText;
notification.error({
message: errorMessage,
description: errorDescription,
});
}
if (!response) {
notification.error({
description: '您的网络发生异常,无法连接服务器',
message: '网络异常',
});
}
throw error;
}
},
// 新增自动添加AccessToken的请求前拦截器
requestInterceptors: [authHeaderInterceptor],
};
// ProLayout 支持的api https://procomponents.ant.design/components/layout
export const layout: RunTimeLayoutConfig = ({ initialState }) => {
return {
rightContentRender: () => <RightContent />,
disableContentMargin: false,
/*waterMarkProps: {
content: initialState?.currentUser?.name,
},*/
footerRender: () => <Footer />,
onPageChange: () => {
const { location } = history;
// 如果没有登录,重定向到 login
if (!initialState?.currentUser && location.pathname !== loginPath) {
history.push(loginPath);
}
},
links: isDev
? [
<Link to="/umi/plugin/openapi" target="_blank">
<LinkOutlined />
<span>openAPI 文档</span>
</Link>,
<Link to="/~docs">
<BookOutlined />
<span>业务组件文档</span>
</Link>,
]
: [],
menuHeaderRender: undefined,
// 自定义 403 页面
// unAccessible: <div>unAccessible</div>,
...initialState?.settings,
};
};
import request from "umi-request";
import {TableListParams} from "@/components/Common/data";
import {message, Modal} from "antd";
import {submitTask} from "@/pages/Dlink/Task/service";
export async function queryData(url:string,params?: TableListParams) {
return request(url, {
method: 'POST',
data: {
...params,
},
});
}
export async function removeData(url:string,params: number[]) {
return request(url, {
method: 'DELETE',
data: {
...params,
},
});
}
export async function addOrUpdateData(url:string,params: any) {
return request(url, {
method: 'PUT',
data: {
...params,
},
});
}
export async function postDataArray(url:string,params: number[]) {
return request(url, {
method: 'POST',
data: {
...params,
},
});
}
export const handleAddOrUpdate = async (url:string,fields: any) => {
const tipsTitle = fields.id ? "修改" : "添加";
const hide = message.loading(`正在${tipsTitle}`);
try {
const {msg} = await addOrUpdateData(url,{...fields});
hide();
message.success(msg);
return true;
} catch (error) {
hide();
message.error(error);
return false;
}
};
export const handleRemove = async (url:string,selectedRows: []) => {
const hide = message.loading('正在删除');
if (!selectedRows) return true;
try {
const {msg} = await removeData(url,selectedRows.map((row) => row.id));
hide();
message.success(msg);
return true;
} catch (error) {
hide();
message.error('删除失败,请重试');
return false;
}
};
export const handleSubmit = async (url:string,title:string,selectedRows: []) => {
const hide = message.loading('正在'+title);
if (!selectedRows) return true;
try {
const {msg} = await postDataArray(url,selectedRows.map((row) => row.id));
hide();
message.success(msg);
return true;
} catch (error) {
hide();
message.error(title+'失败,请重试');
return false;
}
};
export const updateEnabled = (url:string,selectedRows: [], enabled: boolean) => {
selectedRows.forEach((item) => {
handleAddOrUpdate(url,{id: item.id, enabled: enabled})
})
};
export type TableListPagination = {
total: number;
pageSize: number;
current: number;
};
export type TableListData = {
list: TableListItem[];
pagination: Partial<TableListPagination>;
};
export type TableListParams = {
status?: string;
name?: string;
desc?: string;
key?: number;
pageSize?: number;
currentPage?: number;
filter?: Record<string, any[]>;
sorter?: Record<string, any>;
};
export const executeSql = (url:string, selectedRows: [], enabled: boolean) => {
};
import * as monaco from "monaco-editor";
const Completion =[
/** * 内置函数 */
{
label: 'SUM(number)',
kind: monaco.languages.CompletionItemKind.Function,
insertText: 'SUM(${1:})',
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
detail: '返回指定参数的求和'
}
];
export default Completion;
import { Tabs } from 'antd';
import React from 'react';
import FlinkSqlEditor from "@/components/FlinkSqlEditor";
const { TabPane } = Tabs;
const initialPanes = [
{ title: '未命名', key: '0' ,value:'select * from ',closable: false,},
];
class EditorTabs extends React.Component {
newTabIndex = 1;
state = {
activeKey: initialPanes[0].key,
panes: initialPanes,
};
onChange = (activeKey: any) => {
this.setState({ activeKey });
};
onEdit = (targetKey: any, action: any) => {
this[action](targetKey);
};
updateValue = (targetKey: any, val: string)=>{
const { panes, activeKey } = this.state;
panes.forEach((pane, i) => {
if (pane.key === targetKey) {
pane.value = val;
return;
}
});
/*debugger;
this.setState({
panes:panes,
activeKey: activeKey,
});*/
};
add = () => {
const { panes } = this.state;
const activeKey = this.newTabIndex++;
const newPanes = [...panes];
newPanes.push({ title: `未命名${activeKey}`,value:'', key: `${activeKey}` });
this.setState({
panes: newPanes,
activeKey: activeKey,
});
};
remove = (targetKey:any) => {
const { panes, activeKey } = this.state;
let newActiveKey = activeKey;
let lastIndex = 1;
panes.forEach((pane, i) => {
if (pane.key === targetKey) {
lastIndex = i - 1;
}
});
const newPanes = panes.filter(pane => pane.key !== targetKey);
if (newPanes.length && newActiveKey === targetKey) {
if (lastIndex >= 0) {
newActiveKey = newPanes[lastIndex].key;
} else {
newActiveKey = newPanes[0].key;
}
}
this.setState({
panes: newPanes,
activeKey: newActiveKey,
});
};
render() {
const { panes, activeKey } = this.state;
return (
<Tabs
type="editable-card"
onChange={this.onChange}
activeKey={activeKey}
onEdit={this.onEdit}
>
{panes.map(pane => (
<TabPane tab={pane.title} key={pane.key} closable={pane.closable}>
<FlinkSqlEditor value={{formulaContent:pane.value}} onChange={
(val: string)=>{
this.updateValue(pane.key,val);
}} />
</TabPane>
))}
</Tabs>
);
}
}
export default EditorTabs;
export type BaseDataSourceField ={
fields:[{
label?:string,
displayName?:string,
aliasName?:string,
kind?:any,
insertText?:string,
insertTextRules?:any,
detail?:string,
}]
}
export type BaseDataSourceHeader ={
fields:[{
label?:string,
displayName?:string,
aliasName?:string,
kind?:any,
insertText?:string,
insertTextRules?:any,
detail?:string,
}]
}
export type CompletionItem ={
label?:string,
kind?:any,
insertText?:string,
insertTextRules?:any,
detail?:string,
}
export type StudioParam = {
statement:string,
}
import React, {useEffect, useImperativeHandle, useRef} from 'react';
import * as _monaco from "monaco-editor";
import MonacoEditor from "react-monaco-editor/lib/editor";
import {BaseDataSourceField, BaseDataSourceHeader, CompletionItem} from "@/components/FlinkSqlEditor/data";
import Completion from "@/components/FlinkSqlEditor/completion";
import {connect} from "umi";
import {StateType} from "@/components/FlinkSqlEditor/model";
import {executeSql} from "@/components/FlinkSqlEditor/service";
let provider = {
dispose: () => {},
};
interface IRightContent {
value: any;
handleCheck: () => Promise<boolean>;
secondRightData: (BaseDataSourceField|BaseDataSourceHeader)[];
}
const FlinkSqlEditor = (props:any) => {
const {
height = '300px',
width = '100%',
language = 'sql',
onChange=(val: string, event: { changes: { text: any }[] })=>{},
options = {
selectOnLineNumbers: true,
renderSideBySide: false,
},
} = props
;
const { value, handleCheck, secondRightData = [] }: IRightContent = props;
const editorInstance:any = useRef<any>();
const monacoInstance: any = useRef();
const code: any = useRef(value ? value.formulaContent : '');
const cache: any = useRef(code.current);
const [refresh, setRefresh] = React.useState<boolean>(false);
useEffect(
() => () => {
provider.dispose();
},
[]
);
useImperativeHandle(editorInstance, () => ({
handleSetEditorVal,
getEditorData: () => cache.current,
}));
const submit = async () => {
await executeSql({statement:cache.current});
};
const handleSetEditorVal = (value: string): void => {
if (!value) return;
// 为所选取的值赋值到编辑器中
if (editorInstance.current && value) {
const selection = editorInstance?.current?.getSelection?.();
const range = new _monaco.Range(
selection.startLineNumber,
selection.startColumn,
selection.endLineNumber,
selection.endColumn
);
const id = { major: 1, minor: 1 };
const op = { identifier: id, range, text: value, forceMoveMarkers: true };
editorInstance.current.executeEdits('', [op]);
editorInstance.current.focus();
}
};
const onChangeHandle = (val: string, event: { changes: { text: any }[] }) => {
onChange(val,event);
/*const curWord = event.changes[0].text;
if (curWord === ';') {
cache.current = val +'\r\n';
setRefresh(!refresh); // 刷新页面
return;
}
cache.current = val;*/
};
interface ISuggestions {
label: string;
kind: string;
insertText: string;
detail?: string;
}
const editorDidMountHandle = (editor: any, monaco: any) => {
monacoInstance.current = monaco;
editorInstance.current = editor;
const newSecondRightFields: BaseDataSourceHeader[] = [];
(secondRightData as BaseDataSourceHeader[]).forEach((record) => {
if (record.fields && Array.isArray(record.fields)) {
record.fields.forEach((item: any) => {
newSecondRightFields.push(item);
});
}
});
code.current = newSecondRightFields; // 数组长度永远为1
// 提示项设值
provider = monaco.languages.registerCompletionItemProvider('sql', {
provideCompletionItems() {
const suggestions: ISuggestions[] = [];
if (code && code.current) {
code.current.forEach((record:any) => {
suggestions.push({
// label未写错 中间加空格为了隐藏大写字段名称 大写字段名称用于规避自定义提示不匹配小写的bug
label:
record.label ||
`${record.displayName} (${
record.aliasName
}) ${''}(${record.aliasName.toUpperCase()})`, // 显示名称
kind: record.kind || monaco.languages.CompletionItemKind.Field, // 这里Function也可以是别的值,主要用来显示不同的图标
insertText: record.insertText || record.aliasName, // 实际粘贴上的值
detail: record.detail || `(property) ${record.aliasName}: String`,
});
});
}
Completion.forEach((item:CompletionItem) => {
suggestions.push(item);
});
return {
suggestions,
};
},
quickSuggestions: true,
triggerCharacters: ['$', '.', '='],
});
editor.focus();
};
return (
<React.Fragment>
<MonacoEditor
width={width}
height={height}
language={language}
value={cache.current}
options={options}
onChange={onChangeHandle}
editorDidMount={editorDidMountHandle}
/>
</React.Fragment>
);
};
export default FlinkSqlEditor;
import type { Effect, Reducer } from 'umi';
export type StateType = {
value?: string;
};
export type ModelType = {
namespace: string;
state: StateType;
effects: {
updateSql: Effect;
};
reducers: {
saveValue: Reducer<StateType>;
};
};
const Model: ModelType = {
namespace: 'sqlEditorValue',
state: {
value: 'select ',
},
effects: {
*updateSql({ payload }, { call, put }) {
yield put({
type: 'saveValue',
payload,
});
},
},
reducers: {
saveValue(state, { payload }) {
return {
...state,
value: payload,
};
},
},
};
export default Model;
import request from 'umi-request';
import {StudioParam} from "@/components/FlinkSqlEditor/data";
export async function executeSql(params: StudioParam) {
return request('/api-dlink/studio/executeSql', {
method: 'POST',
data: {
...params,
},
});
}
import { useIntl } from 'umi';
import { GithubOutlined } from '@ant-design/icons';
import { DefaultFooter } from '@ant-design/pro-layout';
export default () => {
const intl = useIntl();
const defaultMessage = intl.formatMessage({
id: 'app.copyright.produced',
defaultMessage: 'DataLink 数据中台 开源',
});
return (
<DefaultFooter
copyright={`2021 ${defaultMessage}`}
links={[
{
key: 'DataLink',
title: 'DataLink',
href: '',
blankTarget: true,
},
{
key: 'github',
title: <GithubOutlined />,
href: 'https://github.com/aiwenmo/DataLink',
blankTarget: true,
},
]}
/>
);
};
@import '~antd/es/style/themes/default.less';
.container > * {
background-color: @popover-bg;
border-radius: 4px;
box-shadow: @shadow-1-down;
}
@media screen and (max-width: @screen-xs) {
.container {
width: 100% !important;
}
.container > * {
border-radius: 0 !important;
}
}
import type { DropDownProps } from 'antd/es/dropdown';
import { Dropdown } from 'antd';
import React from 'react';
import classNames from 'classnames';
import styles from './index.less';
export type HeaderDropdownProps = {
overlayClassName?: string;
overlay: React.ReactNode | (() => React.ReactNode) | any;
placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topCenter' | 'topRight' | 'bottomCenter';
} & Omit<DropDownProps, 'overlay'>;
const HeaderDropdown: React.FC<HeaderDropdownProps> = ({ overlayClassName: cls, ...restProps }) => (
<Dropdown overlayClassName={classNames(styles.container, cls)} {...restProps} />
);
export default HeaderDropdown;
@import '~antd/es/style/themes/default.less';
.headerSearch {
display: inline-flex;
align-items: center;
.input {
width: 0;
min-width: 0;
overflow: hidden;
background: transparent;
border-radius: 0;
transition: width 0.3s, margin-left 0.3s;
:global(.ant-select-selection) {
background: transparent;
}
input {
box-shadow: none !important;
}
&.show {
width: 210px;
margin-left: 8px;
}
}
}
import { SearchOutlined } from '@ant-design/icons';
import { AutoComplete, Input } from 'antd';
import useMergedState from 'rc-util/es/hooks/useMergedState';
import type { AutoCompleteProps } from 'antd/es/auto-complete';
import React, { useRef } from 'react';
import classNames from 'classnames';
import styles from './index.less';
export type HeaderSearchProps = {
onSearch?: (value?: string) => void;
onChange?: (value?: string) => void;
onVisibleChange?: (b: boolean) => void;
className?: string;
placeholder?: string;
options: AutoCompleteProps['options'];
defaultVisible?: boolean;
visible?: boolean;
defaultValue?: string;
value?: string;
};
const HeaderSearch: React.FC<HeaderSearchProps> = (props) => {
const {
className,
defaultValue,
onVisibleChange,
placeholder,
visible,
defaultVisible,
...restProps
} = props;
const inputRef = useRef<Input | null>(null);
const [value, setValue] = useMergedState<string | undefined>(defaultValue, {
value: props.value,
onChange: props.onChange,
});
const [searchMode, setSearchMode] = useMergedState(defaultVisible ?? false, {
value: props.visible,
onChange: onVisibleChange,
});
const inputClass = classNames(styles.input, {
[styles.show]: searchMode,
});
return (
<div
className={classNames(className, styles.headerSearch)}
onClick={() => {
setSearchMode(true);
if (searchMode && inputRef.current) {
inputRef.current.focus();
}
}}
onTransitionEnd={({ propertyName }) => {
if (propertyName === 'width' && !searchMode) {
if (onVisibleChange) {
onVisibleChange(searchMode);
}
}
}}
>
<SearchOutlined
key="Icon"
style={{
cursor: 'pointer',
}}
/>
<AutoComplete
key="AutoComplete"
className={inputClass}
value={value}
options={restProps.options}
onChange={setValue}
>
<Input
size="small"
ref={inputRef}
defaultValue={defaultValue}
aria-label={placeholder}
placeholder={placeholder}
onKeyDown={(e) => {
if (e.key === 'Enter') {
if (restProps.onSearch) {
restProps.onSearch(value);
}
}
}}
onBlur={() => {
setSearchMode(false);
}}
/>
</AutoComplete>
</div>
);
};
export default HeaderSearch;
import { BellOutlined } from '@ant-design/icons';
import { Badge, Spin, Tabs } from 'antd';
import useMergedState from 'rc-util/es/hooks/useMergedState';
import React from 'react';
import classNames from 'classnames';
import type { NoticeIconTabProps } from './NoticeList';
import NoticeList from './NoticeList';
import HeaderDropdown from '../HeaderDropdown';
import styles from './index.less';
const { TabPane } = Tabs;
export type NoticeIconProps = {
count?: number;
bell?: React.ReactNode;
className?: string;
loading?: boolean;
onClear?: (tabName: string, tabKey: string) => void;
onItemClick?: (item: API.NoticeIconItem, tabProps: NoticeIconTabProps) => void;
onViewMore?: (tabProps: NoticeIconTabProps, e: MouseEvent) => void;
onTabChange?: (tabTile: string) => void;
style?: React.CSSProperties;
onPopupVisibleChange?: (visible: boolean) => void;
popupVisible?: boolean;
clearText?: string;
viewMoreText?: string;
clearClose?: boolean;
emptyImage?: string;
children?: React.ReactElement<NoticeIconTabProps>[];
};
const NoticeIcon: React.FC<NoticeIconProps> & {
Tab: typeof NoticeList;
} = (props) => {
const getNotificationBox = (): React.ReactNode => {
const {
children,
loading,
onClear,
onTabChange,
onItemClick,
onViewMore,
clearText,
viewMoreText,
} = props;
if (!children) {
return null;
}
const panes: React.ReactNode[] = [];
React.Children.forEach(children, (child: React.ReactElement<NoticeIconTabProps>): void => {
if (!child) {
return;
}
const { list, title, count, tabKey, showClear, showViewMore } = child.props;
const len = list && list.length ? list.length : 0;
const msgCount = count || count === 0 ? count : len;
const tabTitle: string = msgCount > 0 ? `${title} (${msgCount})` : title;
panes.push(
<TabPane tab={tabTitle} key={tabKey}>
<NoticeList
clearText={clearText}
viewMoreText={viewMoreText}
list={list}
tabKey={tabKey}
onClear={(): void => onClear && onClear(title, tabKey)}
onClick={(item): void => onItemClick && onItemClick(item, child.props)}
onViewMore={(event): void => onViewMore && onViewMore(child.props, event)}
showClear={showClear}
showViewMore={showViewMore}
title={title}
/>
</TabPane>,
);
});
return (
<>
<Spin spinning={loading} delay={300}>
<Tabs className={styles.tabs} onChange={onTabChange}>
{panes}
</Tabs>
</Spin>
</>
);
};
const { className, count, bell } = props;
const [visible, setVisible] = useMergedState<boolean>(false, {
value: props.popupVisible,
onChange: props.onPopupVisibleChange,
});
const noticeButtonClass = classNames(className, styles.noticeButton);
const notificationBox = getNotificationBox();
const NoticeBellIcon = bell || <BellOutlined className={styles.icon} />;
const trigger = (
<span className={classNames(noticeButtonClass, { opened: visible })}>
<Badge count={count} style={{ boxShadow: 'none' }} className={styles.badge}>
{NoticeBellIcon}
</Badge>
</span>
);
if (!notificationBox) {
return trigger;
}
return (
<HeaderDropdown
placement="bottomRight"
overlay={notificationBox}
overlayClassName={styles.popover}
trigger={['click']}
visible={visible}
onVisibleChange={setVisible}
>
{trigger}
</HeaderDropdown>
);
};
NoticeIcon.defaultProps = {
emptyImage: 'https://gw.alipayobjects.com/zos/rmsportal/wAhyIChODzsoKIOBHcBk.svg',
};
NoticeIcon.Tab = NoticeList;
export default NoticeIcon;
@import '~antd/es/style/themes/default.less';
.list {
max-height: 400px;
overflow: auto;
&::-webkit-scrollbar {
display: none;
}
.item {
padding-right: 24px;
padding-left: 24px;
overflow: hidden;
cursor: pointer;
transition: all 0.3s;
.meta {
width: 100%;
}
.avatar {
margin-top: 4px;
background: @component-background;
}
.iconElement {
font-size: 32px;
}
&.read {
opacity: 0.4;
}
&:last-child {
border-bottom: 0;
}
&:hover {
background: @primary-1;
}
.title {
margin-bottom: 8px;
font-weight: normal;
}
.description {
font-size: 12px;
line-height: @line-height-base;
}
.datetime {
margin-top: 4px;
font-size: 12px;
line-height: @line-height-base;
}
.extra {
float: right;
margin-top: -1.5px;
margin-right: 0;
color: @text-color-secondary;
font-weight: normal;
}
}
.loadMore {
padding: 8px 0;
color: @primary-6;
text-align: center;
cursor: pointer;
&.loadedAll {
color: rgba(0, 0, 0, 0.25);
cursor: unset;
}
}
}
.notFound {
padding: 73px 0 88px;
color: @text-color-secondary;
text-align: center;
img {
display: inline-block;
height: 76px;
margin-bottom: 16px;
}
}
.bottomBar {
height: 46px;
color: @text-color;
line-height: 46px;
text-align: center;
border-top: 1px solid @border-color-split;
border-radius: 0 0 @border-radius-base @border-radius-base;
transition: all 0.3s;
div {
display: inline-block;
width: 50%;
cursor: pointer;
transition: all 0.3s;
user-select: none;
&:only-child {
width: 100%;
}
&:not(:only-child):last-child {
border-left: 1px solid @border-color-split;
}
}
}
import { Avatar, List } from 'antd';
import React from 'react';
import classNames from 'classnames';
import styles from './NoticeList.less';
export type NoticeIconTabProps = {
count?: number;
showClear?: boolean;
showViewMore?: boolean;
style?: React.CSSProperties;
title: string;
tabKey: API.NoticeIconItemType;
onClick?: (item: API.NoticeIconItem) => void;
onClear?: () => void;
emptyText?: string;
clearText?: string;
viewMoreText?: string;
list: API.NoticeIconItem[];
onViewMore?: (e: any) => void;
};
const NoticeList: React.FC<NoticeIconTabProps> = ({
list = [],
onClick,
onClear,
title,
onViewMore,
emptyText,
showClear = true,
clearText,
viewMoreText,
showViewMore = false,
}) => {
if (!list || list.length === 0) {
return (
<div className={styles.notFound}>
<img
src="https://gw.alipayobjects.com/zos/rmsportal/sAuJeJzSKbUmHfBQRzmZ.svg"
alt="not found"
/>
<div>{emptyText}</div>
</div>
);
}
return (
<div>
<List<API.NoticeIconItem>
className={styles.list}
dataSource={list}
renderItem={(item, i) => {
const itemCls = classNames(styles.item, {
[styles.read]: item.read,
});
// eslint-disable-next-line no-nested-ternary
const leftIcon = item.avatar ? (
typeof item.avatar === 'string' ? (
<Avatar className={styles.avatar} src={item.avatar} />
) : (
<span className={styles.iconElement}>{item.avatar}</span>
)
) : null;
return (
<List.Item
className={itemCls}
key={item.key || i}
onClick={() => {
onClick?.(item);
}}
>
<List.Item.Meta
className={styles.meta}
avatar={leftIcon}
title={
<div className={styles.title}>
{item.title}
<div className={styles.extra}>{item.extra}</div>
</div>
}
description={
<div>
<div className={styles.description}>{item.description}</div>
<div className={styles.datetime}>{item.datetime}</div>
</div>
}
/>
</List.Item>
);
}}
/>
<div className={styles.bottomBar}>
{showClear ? (
<div onClick={onClear}>
{clearText} {title}
</div>
) : null}
{showViewMore ? (
<div
onClick={(e) => {
if (onViewMore) {
onViewMore(e);
}
}}
>
{viewMoreText}
</div>
) : null}
</div>
</div>
);
};
export default NoticeList;
@import '~antd/es/style/themes/default.less';
.popover {
position: relative;
width: 336px;
}
.noticeButton {
display: inline-block;
cursor: pointer;
transition: all 0.3s;
}
.icon {
padding: 4px;
vertical-align: middle;
}
.badge {
font-size: 16px;
}
.tabs {
:global {
.ant-tabs-nav-list {
margin: auto;
}
.ant-tabs-nav-scroll {
text-align: center;
}
.ant-tabs-bar {
margin-bottom: 0;
}
}
}
import { useEffect, useState } from 'react';
import { Tag, message } from 'antd';
import { groupBy } from 'lodash';
import moment from 'moment';
import { useModel } from 'umi';
import { getNotices } from '@/services/ant-design-pro/api';
import NoticeIcon from './NoticeIcon';
import styles from './index.less';
export type GlobalHeaderRightProps = {
fetchingNotices?: boolean;
onNoticeVisibleChange?: (visible: boolean) => void;
onNoticeClear?: (tabName?: string) => void;
};
const getNoticeData = (notices: API.NoticeIconItem[]): Record<string, API.NoticeIconItem[]> => {
if (!notices || notices.length === 0 || !Array.isArray(notices)) {
return {};
}
const newNotices = notices.map((notice) => {
const newNotice = { ...notice };
if (newNotice.datetime) {
newNotice.datetime = moment(notice.datetime as string).fromNow();
}
if (newNotice.id) {
newNotice.key = newNotice.id;
}
if (newNotice.extra && newNotice.status) {
const color = {
todo: '',
processing: 'blue',
urgent: 'red',
doing: 'gold',
}[newNotice.status];
newNotice.extra = (
<Tag
color={color}
style={{
marginRight: 0,
}}
>
{newNotice.extra}
</Tag>
) as any;
}
return newNotice;
});
return groupBy(newNotices, 'type');
};
const getUnreadData = (noticeData: Record<string, API.NoticeIconItem[]>) => {
const unreadMsg: Record<string, number> = {};
Object.keys(noticeData).forEach((key) => {
const value = noticeData[key];
if (!unreadMsg[key]) {
unreadMsg[key] = 0;
}
if (Array.isArray(value)) {
unreadMsg[key] = value.filter((item) => !item.read).length;
}
});
return unreadMsg;
};
const NoticeIconView = () => {
const { initialState } = useModel('@@initialState');
const { currentUser } = initialState || {};
const [notices, setNotices] = useState<API.NoticeIconItem[]>([]);
useEffect(() => {
getNotices().then(({ data }) => setNotices(data || []));
}, []);
const noticeData = getNoticeData(notices);
const unreadMsg = getUnreadData(noticeData || {});
const changeReadState = (id: string) => {
setNotices(
notices.map((item) => {
const notice = { ...item };
if (notice.id === id) {
notice.read = true;
}
return notice;
}),
);
};
const clearReadState = (title: string, key: string) => {
setNotices(
notices.map((item) => {
const notice = { ...item };
if (notice.type === key) {
notice.read = true;
}
return notice;
}),
);
message.success(`${'清空了'} ${title}`);
};
return (
<NoticeIcon
className={styles.action}
count={currentUser && currentUser.unreadCount}
onItemClick={(item) => {
changeReadState(item.id!);
}}
onClear={(title: string, key: string) => clearReadState(title, key)}
loading={false}
clearText="清空"
viewMoreText="查看更多"
onViewMore={() => message.info('Click on view more')}
clearClose
>
<NoticeIcon.Tab
tabKey="notification"
count={unreadMsg.notification}
list={noticeData.notification}
title="通知"
emptyText="你已查看所有通知"
showViewMore
/>
<NoticeIcon.Tab
tabKey="message"
count={unreadMsg.message}
list={noticeData.message}
title="消息"
emptyText="您已读完所有消息"
showViewMore
/>
<NoticeIcon.Tab
tabKey="event"
title="待办"
emptyText="你已完成所有待办"
count={unreadMsg.event}
list={noticeData.event}
showViewMore
/>
</NoticeIcon>
);
};
export default NoticeIconView;
import React, { useCallback } from 'react';
import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
import { Avatar, Menu, Spin } from 'antd';
import { history, useModel } from 'umi';
import { stringify } from 'querystring';
import HeaderDropdown from '../HeaderDropdown';
import styles from './index.less';
import { outLogin } from '@/services/ant-design-pro/api';
export type GlobalHeaderRightProps = {
menu?: boolean;
};
/**
* 退出登录,并且将当前的 url 保存
*/
const loginOut = async () => {
await outLogin();
const { query = {}, pathname } = history.location;
const { redirect } = query;
// Note: There may be security issues, please note
if (window.location.pathname !== '/user/login' && !redirect) {
history.replace({
pathname: '/user/login',
search: stringify({
redirect: pathname,
}),
});
}
};
const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
const { initialState, setInitialState } = useModel('@@initialState');
const onMenuClick = useCallback(
(event: {
key: React.Key;
keyPath: React.Key[];
item: React.ReactInstance;
domEvent: React.MouseEvent<HTMLElement>;
}) => {
const { key } = event;
if (key === 'logout' && initialState) {
setInitialState({ ...initialState, currentUser: undefined });
loginOut();
return;
}
history.push(`/account/${key}`);
},
[initialState, setInitialState],
);
const loading = (
<span className={`${styles.action} ${styles.account}`}>
<Spin
size="small"
style={{
marginLeft: 8,
marginRight: 8,
}}
/>
</span>
);
if (!initialState) {
return loading;
}
const { currentUser } = initialState;
if (!currentUser || !currentUser.name) {
return loading;
}
const menuHeaderDropdown = (
<Menu className={styles.menu} selectedKeys={[]} onClick={onMenuClick}>
{menu && (
<Menu.Item key="center">
<UserOutlined />
个人中心
</Menu.Item>
)}
{menu && (
<Menu.Item key="settings">
<SettingOutlined />
个人设置
</Menu.Item>
)}
{menu && <Menu.Divider />}
<Menu.Item key="logout">
<LogoutOutlined />
退出登录
</Menu.Item>
</Menu>
);
return (
<HeaderDropdown overlay={menuHeaderDropdown}>
<span className={`${styles.action} ${styles.account}`}>
<Avatar size="small" className={styles.avatar} src={currentUser.avatar} alt="avatar" />
<span className={`${styles.name} anticon`}>{currentUser.name}</span>
</span>
</HeaderDropdown>
);
};
export default AvatarDropdown;
@import '~antd/es/style/themes/default.less';
@pro-header-hover-bg: rgba(0, 0, 0, 0.025);
.menu {
:global(.anticon) {
margin-right: 8px;
}
:global(.ant-dropdown-menu-item) {
min-width: 160px;
}
}
.right {
display: flex;
float: right;
height: 48px;
margin-left: auto;
overflow: hidden;
.action {
display: flex;
align-items: center;
height: 48px;
padding: 0 12px;
cursor: pointer;
transition: all 0.3s;
> span {
vertical-align: middle;
}
&:hover {
background: @pro-header-hover-bg;
}
&:global(.opened) {
background: @pro-header-hover-bg;
}
}
.search {
padding: 0 12px;
&:hover {
background: transparent;
}
}
.account {
.avatar {
margin-right: 8px;
color: @primary-color;
vertical-align: top;
background: rgba(255, 255, 255, 0.85);
}
}
}
.dark {
.action {
&:hover {
background: #252a3d;
}
&:global(.opened) {
background: #252a3d;
}
}
}
import { Tag, Space } from 'antd';
import { QuestionCircleOutlined } from '@ant-design/icons';
import React from 'react';
import { useModel, SelectLang } from 'umi';
import Avatar from './AvatarDropdown';
import HeaderSearch from '../HeaderSearch';
import styles from './index.less';
export type SiderTheme = 'light' | 'dark';
const ENVTagColor = {
dev: 'orange',
test: 'green',
pre: '#87d068',
};
const GlobalHeaderRight: React.FC = () => {
const { initialState } = useModel('@@initialState');
if (!initialState || !initialState.settings) {
return null;
}
const { navTheme, layout } = initialState.settings;
let className = styles.right;
if ((navTheme === 'dark' && layout === 'top') || layout === 'mix') {
className = `${styles.right} ${styles.dark}`;
}
return (
<Space className={className}>
<HeaderSearch
className={`${styles.action} ${styles.search}`}
placeholder="站内搜索"
defaultValue="umi ui"
options={[
{ label: <a href="https://umijs.org/zh/guide/umi-ui.html">umi ui</a>, value: 'umi ui' },
{
label: <a href="next.ant.design">Ant Design</a>,
value: 'Ant Design',
},
{
label: <a href="https://protable.ant.design/">Pro Table</a>,
value: 'Pro Table',
},
{
label: <a href="https://prolayout.ant.design/">Pro Layout</a>,
value: 'Pro Layout',
},
]}
// onSearch={value => {
// console.log('input', value);
// }}
/>
<span
className={styles.action}
onClick={() => {
window.open('https://pro.ant.design/docs/getting-started');
}}
>
<QuestionCircleOutlined />
</span>
<Avatar />
{REACT_APP_ENV && (
<span>
<Tag color={ENVTagColor[REACT_APP_ENV]}>{REACT_APP_ENV}</Tag>
</span>
)}
<SelectLang className={styles.action} />
</Space>
);
};
export default GlobalHeaderRight;
---
title: 业务组件
sidemenu: false
---
> 此功能由[dumi](https://d.umijs.org/zh-CN/guide/advanced#umi-%E9%A1%B9%E7%9B%AE%E9%9B%86%E6%88%90%E6%A8%A1%E5%BC%8F)提供,dumi 是一个 📖 为组件开发场景而生的文档工具,用过的都说好。
# 业务组件
这里列举了 Pro 中所有用到的组件,这些组件不适合作为组件库,但是在业务中却真实需要。所以我们准备了这个文档,来指导大家是否需要使用这个组件。
## Footer 页脚组件
这个组件自带了一些 Pro 的配置,你一般都需要改掉它的信息。
```tsx
/**
* background: '#f0f2f5'
*/
import React from 'react';
import Footer from '@/components/Footer';
export default () => <Footer />;
```
## HeaderDropdown 头部下拉列表
HeaderDropdown 是 antd Dropdown 的封装,但是增加了移动端的特殊处理,用法也是相同的。
```tsx
/**
* background: '#f0f2f5'
*/
import { Button, Menu } from 'antd';
import React from 'react';
import HeaderDropdown from '@/components/HeaderDropdown';
export default () => {
const menuHeaderDropdown = (
<Menu selectedKeys={[]}>
<Menu.Item key="center">个人中心</Menu.Item>
<Menu.Item key="settings">个人设置</Menu.Item>
<Menu.Divider />
<Menu.Item key="logout">退出登录</Menu.Item>
</Menu>
);
return (
<HeaderDropdown overlay={menuHeaderDropdown}>
<Button>hover 展示菜单</Button>
</HeaderDropdown>
);
};
```
## HeaderSearch 头部搜索框
一个带补全数据的输入框,支持收起和展开 Input
```tsx
/**
* background: '#f0f2f5'
*/
import { Button, Menu } from 'antd';
import React from 'react';
import HeaderSearch from '@/components/HeaderSearch';
export default () => {
return (
<HeaderSearch
placeholder="站内搜索"
defaultValue="umi ui"
options={[
{ label: 'Ant Design Pro', value: 'Ant Design Pro' },
{
label: 'Ant Design',
value: 'Ant Design',
},
{
label: 'Pro Table',
value: 'Pro Table',
},
{
label: 'Pro Layout',
value: 'Pro Layout',
},
]}
onSearch={(value) => {
console.log('input', value);
}}
/>
);
};
```
### API
| 参数 | 说明 | 类型 | 默认值 |
| --------------- | ---------------------------------- | ---------------------------- | ------ |
| value | 输入框的值 | `string` | - |
| onChange | 值修改后触发 | `(value?: string) => void` | - |
| onSearch | 查询后触发 | `(value?: string) => void` | - |
| options | 选项菜单的的列表 | `{label,value}[]` | - |
| defaultVisible | 输入框默认是否显示,只有第一次生效 | `boolean` | - |
| visible | 输入框是否显示 | `boolean` | - |
| onVisibleChange | 输入框显示隐藏的回调函数 | `(visible: boolean) => void` | - |
## NoticeIcon 通知工具
通知工具提供一个展示多种通知信息的界面。
```tsx
/**
* background: '#f0f2f5'
*/
import { message } from 'antd';
import React from 'react';
import NoticeIcon from '@/components/NoticeIcon/NoticeIcon';
export default () => {
const list = [
{
id: '000000001',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
title: '你收到了 14 份新周报',
datetime: '2017-08-09',
type: 'notification',
},
{
id: '000000002',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png',
title: '你推荐的 曲妮妮 已通过第三轮面试',
datetime: '2017-08-08',
type: 'notification',
},
];
return (
<NoticeIcon
count={10}
onItemClick={(item) => {
message.info(`${item.title} 被点击了`);
}}
onClear={(title: string, key: string) => message.info('点击了清空更多')}
loading={false}
clearText="清空"
viewMoreText="查看更多"
onViewMore={() => message.info('点击了查看更多')}
clearClose
>
<NoticeIcon.Tab
tabKey="notification"
count={2}
list={list}
title="通知"
emptyText="你已查看所有通知"
showViewMore
/>
<NoticeIcon.Tab
tabKey="message"
count={2}
list={list}
title="消息"
emptyText="您已读完所有消息"
showViewMore
/>
<NoticeIcon.Tab
tabKey="event"
title="待办"
emptyText="你已完成所有待办"
count={2}
list={list}
showViewMore
/>
</NoticeIcon>
);
};
```
### NoticeIcon API
| 参数 | 说明 | 类型 | 默认值 |
| --- | --- | --- | --- |
| count | 有多少未读通知 | `number` | - |
| bell | 铃铛的图表 | `ReactNode` | - |
| onClear | 点击清空数据按钮 | `(tabName: string, tabKey: string) => void` | - |
| onItemClick | 未读消息列被点击 | `(item: API.NoticeIconData, tabProps: NoticeIconTabProps) => void` | - |
| onViewMore | 查看更多的按钮点击 | `(tabProps: NoticeIconTabProps, e: MouseEvent) => void` | - |
| onTabChange | 通知 Tab 的切换 | `(tabTile: string) => void;` | - |
| popupVisible | 通知显示是否展示 | `boolean` | - |
| onPopupVisibleChange | 通知信息显示隐藏的回调函数 | `(visible: boolean) => void` | - |
| clearText | 清空按钮的文字 | `string` | - |
| viewMoreText | 查看更多的按钮文字 | `string` | - |
| clearClose | 展示清空按钮 | `boolean` | - |
| emptyImage | 列表为空时的兜底展示 | `ReactNode` | - |
### NoticeIcon.Tab API
| 参数 | 说明 | 类型 | 默认值 |
| ------------ | ------------------ | ------------------------------------ | ------ |
| count | 有多少未读通知 | `number` | - |
| title | 通知 Tab 的标题 | `ReactNode` | - |
| showClear | 展示清除按钮 | `boolean` | `true` |
| showViewMore | 展示加载更 | `boolean` | `true` |
| tabKey | Tab 的唯一 key | `string` | - |
| onClick | 子项的单击事件 | `(item: API.NoticeIconData) => void` | - |
| onClear | 清楚按钮的点击 | `()=>void` | - |
| emptyText | 为空的时候测试 | `()=>void` | - |
| viewMoreText | 查看更多的按钮文字 | `string` | - |
| onViewMore | 查看更多的按钮点击 | `( e: MouseEvent) => void` | - |
| list | 通知信息的列表 | `API.NoticeIconData` | - |
### NoticeIconData
```tsx | pure
export interface NoticeIconData {
id: string;
key: string;
avatar: string;
title: string;
datetime: string;
type: string;
read?: boolean;
description: string;
clickClose?: boolean;
extra: any;
status: string;
}
```
## RightContent
RightContent 是以上几个组件的组合,同时新增了 plugins 的 `SelectLang` 插件。
```tsx | pure
<Space>
<HeaderSearch
placeholder="站内搜索"
defaultValue="umi ui"
options={[
{ label: <a href="https://umijs.org/zh/guide/umi-ui.html">umi ui</a>, value: 'umi ui' },
{
label: <a href="next.ant.design">Ant Design</a>,
value: 'Ant Design',
},
{
label: <a href="https://protable.ant.design/">Pro Table</a>,
value: 'Pro Table',
},
{
label: <a href="https://prolayout.ant.design/">Pro Layout</a>,
value: 'Pro Layout',
},
]}
/>
<Tooltip title="使用文档">
<span
className={styles.action}
onClick={() => {
window.location.href = 'https://pro.ant.design/docs/getting-started';
}}
>
<QuestionCircleOutlined />
</span>
</Tooltip>
<Avatar />
{REACT_APP_ENV && (
<span>
<Tag color={ENVTagColor[REACT_APP_ENV]}>{REACT_APP_ENV}</Tag>
</span>
)}
<SelectLang className={styles.action} />
</Space>
```
const { uniq } = require('lodash');
const RouterConfig = require('../../config/config').default.routes;
const BASE_URL = `http://localhost:${process.env.PORT || 8000}`;
function formatter(routes, parentPath = '') {
const fixedParentPath = parentPath.replace(/\/{1,}/g, '/');
let result = [];
routes.forEach((item) => {
if (item.path) {
result.push(`${fixedParentPath}/${item.path}`.replace(/\/{1,}/g, '/'));
}
if (item.routes) {
result = result.concat(
formatter(item.routes, item.path ? `${fixedParentPath}/${item.path}` : parentPath),
);
}
});
return uniq(result.filter((item) => !!item));
}
beforeEach(async () => {
await page.goto(`${BASE_URL}`);
await page.evaluate(() => {
localStorage.setItem('antd-pro-authority', '["admin"]');
});
});
describe('Ant Design Pro E2E test', () => {
const testPage = (path) => async () => {
await page.goto(`${BASE_URL}${path}`);
await page.waitForSelector('footer', {
timeout: 2000,
});
const haveFooter = await page.evaluate(
() => document.getElementsByTagName('footer').length > 0,
);
expect(haveFooter).toBeTruthy();
};
const routers = formatter(RouterConfig);
routers.forEach((route) => {
it(`test pages ${route}`, testPage(route));
});
it('topmenu should have footer', async () => {
const params = '?navTheme=light&layout=topmenu';
await page.goto(`${BASE_URL}${params}`);
await page.waitForSelector('footer', {
timeout: 2000,
});
const haveFooter = await page.evaluate(
() => document.getElementsByTagName('footer').length > 0,
);
expect(haveFooter).toBeTruthy();
});
});
@import '~antd/es/style/themes/default.less';
html,
body,
#root {
height: 100%;
}
.colorWeak {
filter: invert(80%);
}
.ant-layout {
min-height: 100vh;
}
.ant-pro-sider.ant-layout-sider.ant-pro-sider-fixed {
left: unset;
}
canvas {
display: block;
}
body {
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
ul,
ol {
list-style: none;
}
@media (max-width: @screen-xs) {
.ant-table {
width: 100%;
overflow-x: auto;
&-thead > tr,
&-tbody > tr {
> th,
> td {
white-space: pre;
> span {
display: block;
}
}
}
}
}
// 兼容IE11
@media screen and(-ms-high-contrast: active), (-ms-high-contrast: none) {
body .ant-design-pro > .ant-layout {
min-height: 100vh;
}
}
import { Button, message, notification } from 'antd';
import { useIntl } from 'umi';
import defaultSettings from '../config/defaultSettings';
const { pwa } = defaultSettings;
const isHttps = document.location.protocol === 'https:';
// if pwa is true
if (pwa) {
// Notify user if offline now
window.addEventListener('sw.offline', () => {
message.warning(useIntl().formatMessage({ id: 'app.pwa.offline' }));
});
// Pop up a prompt on the page asking the user if they want to use the latest version
window.addEventListener('sw.updated', (event: Event) => {
const e = event as CustomEvent;
const reloadSW = async () => {
// Check if there is sw whose state is waiting in ServiceWorkerRegistration
// https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration
const worker = e.detail && e.detail.waiting;
if (!worker) {
return true;
}
// Send skip-waiting event to waiting SW with MessageChannel
await new Promise((resolve, reject) => {
const channel = new MessageChannel();
channel.port1.onmessage = (msgEvent) => {
if (msgEvent.data.error) {
reject(msgEvent.data.error);
} else {
resolve(msgEvent.data);
}
};
worker.postMessage({ type: 'skip-waiting' }, [channel.port2]);
});
// Refresh current page to use the updated HTML and other assets after SW has skiped waiting
window.location.reload(true);
return true;
};
const key = `open${Date.now()}`;
const btn = (
<Button
type="primary"
onClick={() => {
notification.close(key);
reloadSW();
}}
>
{useIntl().formatMessage({ id: 'app.pwa.serviceworker.updated.ok' })}
</Button>
);
notification.open({
message: useIntl().formatMessage({ id: 'app.pwa.serviceworker.updated' }),
description: useIntl().formatMessage({ id: 'app.pwa.serviceworker.updated.hint' }),
btn,
key,
onClose: async () => null,
});
});
} else if ('serviceWorker' in navigator && isHttps) {
// unregister service worker
const { serviceWorker } = navigator;
if (serviceWorker.getRegistrations) {
serviceWorker.getRegistrations().then((sws) => {
sws.forEach((sw) => {
sw.unregister();
});
});
}
serviceWorker.getRegistration().then((sw) => {
if (sw) sw.unregister();
});
// remove all caches
if (window.caches && window.caches.keys()) {
caches.keys().then((keys) => {
keys.forEach((key) => {
caches.delete(key);
});
});
}
}
import component from './en-US/component';
import globalHeader from './en-US/globalHeader';
import menu from './en-US/menu';
import pages from './en-US/pages';
import pwa from './en-US/pwa';
import request from './en-US/request';
import settingDrawer from './en-US/settingDrawer';
import settings from './en-US/settings';
export default {
'navBar.lang': 'Languages',
'layout.user.link.help': 'Help',
'layout.user.link.privacy': 'Privacy',
'layout.user.link.terms': 'Terms',
'app.copyright.produced': 'Produced by DataLink Community',
'app.preview.down.block': 'Download this page to your local project',
'app.welcome.link.fetch-blocks': 'Get all block',
'app.welcome.link.block-list': 'Quickly build standard, pages based on `block` development',
...globalHeader,
...menu,
...settingDrawer,
...settings,
...pwa,
...component,
...pages,
...request,
};
export default {
'component.tagSelect.expand': 'Expand',
'component.tagSelect.collapse': 'Collapse',
'component.tagSelect.all': 'All',
};
export default {
'component.globalHeader.search': 'Search',
'component.globalHeader.search.example1': 'Search example 1',
'component.globalHeader.search.example2': 'Search example 2',
'component.globalHeader.search.example3': 'Search example 3',
'component.globalHeader.help': 'Help',
'component.globalHeader.notification': 'Notification',
'component.globalHeader.notification.empty': 'You have viewed all notifications.',
'component.globalHeader.message': 'Message',
'component.globalHeader.message.empty': 'You have viewed all messsages.',
'component.globalHeader.event': 'Event',
'component.globalHeader.event.empty': 'You have viewed all events.',
'component.noticeIcon.clear': 'Clear',
'component.noticeIcon.cleared': 'Cleared',
'component.noticeIcon.empty': 'No notifications',
'component.noticeIcon.view-more': 'View more',
};
export default {
'menu.welcome': 'Welcome',
'menu.more-blocks': 'More Blocks',
'menu.home': 'Home',
'menu.admin': 'Admin',
'menu.admin.sub-page': 'Sub-Page',
'menu.login': 'Login',
'menu.register': 'Register',
'menu.register.result': 'Register Result',
'menu.dashboard': 'Dashboard',
'menu.dashboard.analysis': 'Analysis',
'menu.dashboard.monitor': 'Monitor',
'menu.dashboard.workplace': 'Workplace',
'menu.exception.403': '403',
'menu.exception.404': '404',
'menu.exception.500': '500',
'menu.form': 'Form',
'menu.form.basic-form': 'Basic Form',
'menu.form.step-form': 'Step Form',
'menu.form.step-form.info': 'Step Form(write transfer information)',
'menu.form.step-form.confirm': 'Step Form(confirm transfer information)',
'menu.form.step-form.result': 'Step Form(finished)',
'menu.form.advanced-form': 'Advanced Form',
'menu.list': 'List',
'menu.list.table-list': 'Search Table',
'menu.list.basic-list': 'Basic List',
'menu.list.card-list': 'Card List',
'menu.list.search-list': 'Search List',
'menu.list.search-list.articles': 'Search List(articles)',
'menu.list.search-list.projects': 'Search List(projects)',
'menu.list.search-list.applications': 'Search List(applications)',
'menu.profile': 'Profile',
'menu.profile.basic': 'Basic Profile',
'menu.profile.advanced': 'Advanced Profile',
'menu.result': 'Result',
'menu.result.success': 'Success',
'menu.result.fail': 'Fail',
'menu.exception': 'Exception',
'menu.exception.not-permission': '403',
'menu.exception.not-find': '404',
'menu.exception.server-error': '500',
'menu.exception.trigger': 'Trigger',
'menu.account': 'Account',
'menu.account.center': 'Account Center',
'menu.account.settings': 'Account Settings',
'menu.account.trigger': 'Trigger Error',
'menu.account.logout': 'Logout',
'menu.editor': 'Graphic Editor',
'menu.editor.flow': 'Flow Editor',
'menu.editor.mind': 'Mind Editor',
'menu.editor.koni': 'Koni Editor',
};
export default {
'pages.layouts.userLayout.title':
'Ant Design is the most influential web design specification in Xihu district',
'pages.login.accountLogin.tab': 'Account Login',
'pages.login.accountLogin.errorMessage': 'Incorrect username/password(admin/ant.design)',
'pages.login.failure': 'Login failed, please try again!',
'pages.login.success': 'Login successful!',
'pages.login.username.placeholder': 'Username: admin or user',
'pages.login.username.required': 'Please input your username!',
'pages.login.password.placeholder': 'Password: ant.design',
'pages.login.password.required': 'Please input your password!',
'pages.login.phoneLogin.tab': 'Phone Login',
'pages.login.phoneLogin.errorMessage': 'Verification Code Error',
'pages.login.phoneNumber.placeholder': 'Phone Number',
'pages.login.phoneNumber.required': 'Please input your phone number!',
'pages.login.phoneNumber.invalid': 'Phone number is invalid!',
'pages.login.captcha.placeholder': 'Verification Code',
'pages.login.captcha.required': 'Please input verification code!',
'pages.login.phoneLogin.getVerificationCode': 'Get Code',
'pages.getCaptchaSecondText': 'sec(s)',
'pages.login.rememberMe': 'Remember me',
'pages.login.forgotPassword': 'Forgot Password ?',
'pages.login.submit': 'Login',
'pages.login.loginWith': 'Login with :',
'pages.login.registerAccount': 'Register Account',
'pages.welcome.advancedComponent': 'Advanced Component',
'pages.welcome.link': 'Welcome',
'pages.welcome.advancedLayout': 'Advanced Layout',
'pages.welcome.alertMessage': 'Faster and stronger heavy-duty components have been released.',
'pages.admin.subPage.title': 'This page can only be viewed by Admin',
'pages.admin.subPage.alertMessage':
'Umi ui is now released, welcome to use npm run ui to start the experience.',
'pages.searchTable.createForm.newRule': 'New Rule',
'pages.searchTable.updateForm.ruleConfig': 'Rule configuration',
'pages.searchTable.updateForm.basicConfig': 'Basic Information',
'pages.searchTable.updateForm.ruleName.nameLabel': 'Rule Name',
'pages.searchTable.updateForm.ruleName.nameRules': 'Please enter the rule name!',
'pages.searchTable.updateForm.ruleDesc.descLabel': 'Rule Description',
'pages.searchTable.updateForm.ruleDesc.descPlaceholder': 'Please enter at least five characters',
'pages.searchTable.updateForm.ruleDesc.descRules':
'Please enter a rule description of at least five characters!',
'pages.searchTable.updateForm.ruleProps.title': 'Configure Properties',
'pages.searchTable.updateForm.object': 'Monitoring Object',
'pages.searchTable.updateForm.ruleProps.templateLabel': 'Rule Template',
'pages.searchTable.updateForm.ruleProps.typeLabel': 'Rule Type',
'pages.searchTable.updateForm.schedulingPeriod.title': 'Set Scheduling Period',
'pages.searchTable.updateForm.schedulingPeriod.timeLabel': 'Starting Time',
'pages.searchTable.updateForm.schedulingPeriod.timeRules': 'Please choose a start time!',
'pages.searchTable.titleDesc': 'Description',
'pages.searchTable.ruleName': 'Rule name is required',
'pages.searchTable.titleCallNo': 'Number of Service Calls',
'pages.searchTable.titleStatus': 'Status',
'pages.searchTable.nameStatus.default': 'default',
'pages.searchTable.nameStatus.running': 'running',
'pages.searchTable.nameStatus.online': 'online',
'pages.searchTable.nameStatus.abnormal': 'abnormal',
'pages.searchTable.titleUpdatedAt': 'Last Scheduled at',
'pages.searchTable.exception': 'Please enter the reason for the exception!',
'pages.searchTable.titleOption': 'Option',
'pages.searchTable.config': 'Configuration',
'pages.searchTable.subscribeAlert': 'Subscribe to alerts',
'pages.searchTable.title': 'Enquiry Form',
'pages.searchTable.new': 'New',
'pages.searchTable.chosen': 'chosen',
'pages.searchTable.item': 'item',
'pages.searchTable.totalServiceCalls': 'Total Number of Service Calls',
'pages.searchTable.tenThousand': '0000',
'pages.searchTable.batchDeletion': 'bacth deletion',
'pages.searchTable.batchApproval': 'batch approval',
};
export default {
'app.pwa.offline': 'You are offline now',
'app.pwa.serviceworker.updated': 'New content is available',
'app.pwa.serviceworker.updated.hint': 'Please press the "Refresh" button to reload current page',
'app.pwa.serviceworker.updated.ok': 'Refresh',
};
export default {
'app.request.error': 'Request error',
'app.request.200': 'The server successfully returned the requested data. ',
'app.request.201': 'New or modified data is successful. ',
'app.request.202': 'A request has entered the background queue (asynchronous task). ',
'app.request.204': 'Data deleted successfully. ',
'app.request.400':
'There was an error in the request sent, and the server did not create or modify data. ',
'app.request.401': 'The user does not have permission (token, username, password error). ',
'app.request.403': 'The user is authorized, but access is forbidden. ',
'app.request.404': 'The request sent was for a record that did not exist. ',
'app.request.405': 'The request method is not allowed. ',
'app.request.406': 'The requested format is not available. ',
'app.request.410':
'The requested resource is permanently deleted and will no longer be available. ',
'app.request.422': 'When creating an object, a validation error occurred. ',
'app.request.500': 'An error occurred on the server, please check the server. ',
'app.request.502': 'Gateway error. ',
'app.request.503': 'The service is unavailable. ',
'app.request.504': 'The gateway timed out. ',
};
export default {
'app.setting.pagestyle': 'Page style setting',
'app.setting.pagestyle.dark': 'Dark style',
'app.setting.pagestyle.light': 'Light style',
'app.setting.content-width': 'Content Width',
'app.setting.content-width.fixed': 'Fixed',
'app.setting.content-width.fluid': 'Fluid',
'app.setting.themecolor': 'Theme Color',
'app.setting.themecolor.dust': 'Dust Red',
'app.setting.themecolor.volcano': 'Volcano',
'app.setting.themecolor.sunset': 'Sunset Orange',
'app.setting.themecolor.cyan': 'Cyan',
'app.setting.themecolor.green': 'Polar Green',
'app.setting.themecolor.daybreak': 'Daybreak Blue (default)',
'app.setting.themecolor.geekblue': 'Geek Glue',
'app.setting.themecolor.purple': 'Golden Purple',
'app.setting.navigationmode': 'Navigation Mode',
'app.setting.sidemenu': 'Side Menu Layout',
'app.setting.topmenu': 'Top Menu Layout',
'app.setting.fixedheader': 'Fixed Header',
'app.setting.fixedsidebar': 'Fixed Sidebar',
'app.setting.fixedsidebar.hint': 'Works on Side Menu Layout',
'app.setting.hideheader': 'Hidden Header when scrolling',
'app.setting.hideheader.hint': 'Works when Hidden Header is enabled',
'app.setting.othersettings': 'Other Settings',
'app.setting.weakmode': 'Weak Mode',
'app.setting.copy': 'Copy Setting',
'app.setting.copyinfo': 'copy success,please replace defaultSettings in src/models/setting.js',
'app.setting.production.hint':
'Setting panel shows in development environment only, please manually modify',
};
export default {
'app.settings.menuMap.basic': 'Basic Settings',
'app.settings.menuMap.security': 'Security Settings',
'app.settings.menuMap.binding': 'Account Binding',
'app.settings.menuMap.notification': 'New Message Notification',
'app.settings.basic.avatar': 'Avatar',
'app.settings.basic.change-avatar': 'Change avatar',
'app.settings.basic.email': 'Email',
'app.settings.basic.email-message': 'Please input your email!',
'app.settings.basic.nickname': 'Nickname',
'app.settings.basic.nickname-message': 'Please input your Nickname!',
'app.settings.basic.profile': 'Personal profile',
'app.settings.basic.profile-message': 'Please input your personal profile!',
'app.settings.basic.profile-placeholder': 'Brief introduction to yourself',
'app.settings.basic.country': 'Country/Region',
'app.settings.basic.country-message': 'Please input your country!',
'app.settings.basic.geographic': 'Province or city',
'app.settings.basic.geographic-message': 'Please input your geographic info!',
'app.settings.basic.address': 'Street Address',
'app.settings.basic.address-message': 'Please input your address!',
'app.settings.basic.phone': 'Phone Number',
'app.settings.basic.phone-message': 'Please input your phone!',
'app.settings.basic.update': 'Update Information',
'app.settings.security.strong': 'Strong',
'app.settings.security.medium': 'Medium',
'app.settings.security.weak': 'Weak',
'app.settings.security.password': 'Account Password',
'app.settings.security.password-description': 'Current password strength',
'app.settings.security.phone': 'Security Phone',
'app.settings.security.phone-description': 'Bound phone',
'app.settings.security.question': 'Security Question',
'app.settings.security.question-description':
'The security question is not set, and the security policy can effectively protect the account security',
'app.settings.security.email': 'Backup Email',
'app.settings.security.email-description': 'Bound Email',
'app.settings.security.mfa': 'MFA Device',
'app.settings.security.mfa-description':
'Unbound MFA device, after binding, can be confirmed twice',
'app.settings.security.modify': 'Modify',
'app.settings.security.set': 'Set',
'app.settings.security.bind': 'Bind',
'app.settings.binding.taobao': 'Binding Taobao',
'app.settings.binding.taobao-description': 'Currently unbound Taobao account',
'app.settings.binding.alipay': 'Binding Alipay',
'app.settings.binding.alipay-description': 'Currently unbound Alipay account',
'app.settings.binding.dingding': 'Binding DingTalk',
'app.settings.binding.dingding-description': 'Currently unbound DingTalk account',
'app.settings.binding.bind': 'Bind',
'app.settings.notification.password': 'Account Password',
'app.settings.notification.password-description':
'Messages from other users will be notified in the form of a station letter',
'app.settings.notification.messages': 'System Messages',
'app.settings.notification.messages-description':
'System messages will be notified in the form of a station letter',
'app.settings.notification.todo': 'To-do Notification',
'app.settings.notification.todo-description':
'The to-do list will be notified in the form of a letter from the station',
'app.settings.open': 'Open',
'app.settings.close': 'Close',
};
import component from './fa-IR/component';
import globalHeader from './fa-IR/globalHeader';
import menu from './fa-IR/menu';
import pwa from './fa-IR/pwa';
import settingDrawer from './fa-IR/settingDrawer';
import settings from './fa-IR/settings';
import pages from './fa-IR/pages';
export default {
'navBar.lang': 'زبان ها ',
'layout.user.link.help': 'کمک',
'layout.user.link.privacy': 'حریم خصوصی',
'layout.user.link.terms': 'مقررات',
'app.preview.down.block': 'این صفحه را در پروژه محلی خود بارگیری کنید',
'app.welcome.link.fetch-blocks': 'دریافت تمام بلوک',
'app.welcome.link.block-list': 'به سرعت صفحات استاندارد مبتنی بر توسعه "بلوک" را بسازید',
...globalHeader,
...menu,
...settingDrawer,
...settings,
...pwa,
...component,
...pages,
};
export default {
'component.tagSelect.expand': 'باز',
'component.tagSelect.collapse': 'بسته ',
'component.tagSelect.all': 'همه',
};
export default {
'component.globalHeader.search': 'جستجو ',
'component.globalHeader.search.example1': 'مثال 1 را جستجو کنید',
'component.globalHeader.search.example2': 'مثال 2 را جستجو کنید',
'component.globalHeader.search.example3': 'مثال 3 را جستجو کنید',
'component.globalHeader.help': 'کمک',
'component.globalHeader.notification': 'اعلان',
'component.globalHeader.notification.empty': 'شما همه اعلان ها را مشاهده کرده اید.',
'component.globalHeader.message': 'پیام',
'component.globalHeader.message.empty': 'شما همه پیام ها را مشاهده کرده اید.',
'component.globalHeader.event': 'رویداد',
'component.globalHeader.event.empty': 'شما همه رویدادها را مشاهده کرده اید.',
'component.noticeIcon.clear': 'پاک کردن',
'component.noticeIcon.cleared': 'پاک شد',
'component.noticeIcon.empty': 'بدون اعلان',
'component.noticeIcon.view-more': 'نمایش بیشتر',
};
export default {
'menu.welcome': 'خوش آمدید',
'menu.more-blocks': 'بلوک های بیشتر',
'menu.home': 'خانه',
'menu.admin': 'مدیر',
'menu.admin.sub-page': 'زیر صفحه',
'menu.login': 'ورود',
'menu.register': 'ثبت نام',
'menu.register.result': 'ثبت نام نتیجه',
'menu.dashboard': 'داشبورد',
'menu.dashboard.analysis': 'تحلیل و بررسی',
'menu.dashboard.monitor': 'نظارت',
'menu.dashboard.workplace': 'محل کار',
'menu.exception.403': '403',
'menu.exception.404': '404',
'menu.exception.500': '500',
'menu.form': 'فرم',
'menu.form.basic-form': 'فرم اساسی',
'menu.form.step-form': 'فرم مرحله',
'menu.form.step-form.info': 'فرم مرحله (نوشتن اطلاعات انتقال)',
'menu.form.step-form.confirm': 'فرم مرحله (تأیید اطلاعات انتقال)',
'menu.form.step-form.result': 'فرم مرحله (تمام شده)',
'menu.form.advanced-form': 'فرم پیشرفته',
'menu.list': 'لیست',
'menu.list.table-list': 'جدول جستجو',
'menu.list.basic-list': 'لیست اصلی',
'menu.list.card-list': 'لیست کارت',
'menu.list.search-list': 'لیست جستجو',
'menu.list.search-list.articles': 'لیست جستجو (مقالات)',
'menu.list.search-list.projects': 'لیست جستجو (پروژه ها)',
'menu.list.search-list.applications': 'لیست جستجو (برنامه ها)',
'menu.profile': 'مشخصات',
'menu.profile.basic': 'مشخصات عمومی',
'menu.profile.advanced': 'مشخصات پیشرفته',
'menu.result': 'نتیجه',
'menu.result.success': 'موفق',
'menu.result.fail': 'ناموفق',
'menu.exception': 'استثنا',
'menu.exception.not-permission': '403',
'menu.exception.not-find': '404',
'menu.exception.server-error': '500',
'menu.exception.trigger': 'راه اندازی',
'menu.account': 'حساب',
'menu.account.center': 'مرکز حساب',
'menu.account.settings': 'تنظیمات حساب',
'menu.account.trigger': 'خطای راه اندازی',
'menu.account.logout': 'خروج',
'menu.editor': 'ویرایشگر گرافیک',
'menu.editor.flow': 'ویرایشگر جریان',
'menu.editor.mind': 'ویرایشگر ذهن',
'menu.editor.koni': 'ویرایشگر Koni',
};
export default {
'pages.layouts.userLayout.title': 'طراحی مورچه تأثیرگذارترین مشخصات طراحی وب در منطقه Xihu است',
'pages.login.accountLogin.tab': 'ورود به حساب کاربری',
'pages.login.accountLogin.errorMessage': 'نام کاربری / رمزعبور نادرست (مدیر / ant.design)',
'pages.login.username.placeholder': 'نام کاربری: مدیر یا کاربر',
'pages.login.username.required': 'لطفا نام کاربری خود را وارد کنید!',
'pages.login.password.placeholder': 'رمز عبور: ant.design',
'pages.login.password.required': 'لطفاً رمز ورود خود را وارد کنید!',
'pages.login.phoneLogin.tab': 'ورود به سیستم تلفن',
'pages.login.phoneLogin.errorMessage': 'خطای کد تأیید',
'pages.login.phoneNumber.placeholder': 'شماره تلفن',
'pages.login.phoneNumber.required': 'لطفاً شماره تلفن خود را وارد کنید!',
'pages.login.phoneNumber.invalid': 'شماره تلفن نامعتبر است!',
'pages.login.captcha.placeholder': 'کد تایید',
'pages.login.captcha.required': 'لطفا کد تأیید را وارد کنید!',
'pages.login.phoneLogin.getVerificationCode': 'دریافت کد',
'pages.getCaptchaSecondText': 'ثانیه',
'pages.login.rememberMe': 'مرا به خاطر بسپار',
'pages.login.forgotPassword': 'رمز عبور را فراموش کرده اید ?',
'pages.login.submit': 'ارسال',
'pages.login.loginWith': 'وارد شوید با :',
'pages.login.registerAccount': 'ثبت نام',
'pages.welcome.advancedComponent': 'مولفه پیشرفته',
'pages.welcome.link': 'خوش آمدید',
'pages.welcome.advancedLayout': 'چیدمان پیشرفته',
'pages.welcome.alertMessage': 'اجزای سنگین تر سریعتر و قوی تر آزاد شده اند.',
'pages.admin.subPage.title': 'این صفحه فقط توسط مدیر قابل مشاهده است',
'pages.admin.subPage.alertMessage':
'رابط کاربری Umi اکنون منتشر شده است ، برای شروع تجربه استفاده از npm run ui خوش آمدید.',
'pages.searchTable.createForm.newRule': 'قانون جدید',
'pages.searchTable.updateForm.ruleConfig': 'پیکربندی قانون',
'pages.searchTable.updateForm.basicConfig': 'اطلاعات اولیه',
'pages.searchTable.updateForm.ruleName.nameLabel': ' نام قانون',
'pages.searchTable.updateForm.ruleName.nameRules': 'لطفاً نام قانون را وارد کنید!',
'pages.searchTable.updateForm.ruleDesc.descLabel': 'شرح قانون',
'pages.searchTable.updateForm.ruleDesc.descPlaceholder': 'لطفاً حداقل پنج حرف وارد کنید',
'pages.searchTable.updateForm.ruleDesc.descRules':
'لطفاً حداقل یک قانون حاوی پنج کاراکتر شرح دهید!',
'pages.searchTable.updateForm.ruleProps.title': 'پیکربندی خصوصیات',
'pages.searchTable.updateForm.object': 'نظارت بر شی',
'pages.searchTable.updateForm.ruleProps.templateLabel': 'الگوی قانون',
'pages.searchTable.updateForm.ruleProps.typeLabel': 'نوع قانون',
'pages.searchTable.updateForm.schedulingPeriod.title': 'تنظیم دوره زمان بندی',
'pages.searchTable.updateForm.schedulingPeriod.timeLabel': 'زمان شروع',
'pages.searchTable.updateForm.schedulingPeriod.timeRules': 'لطفاً زمان شروع را انتخاب کنید!',
'pages.searchTable.titleDesc': 'شرح',
'pages.searchTable.ruleName': 'نام قانون لازم است',
'pages.searchTable.titleCallNo': 'تعداد تماس های خدماتی',
'pages.searchTable.titleStatus': 'وضعیت',
'pages.searchTable.nameStatus.default': 'پیش فرض',
'pages.searchTable.nameStatus.running': 'در حال دویدن',
'pages.searchTable.nameStatus.online': 'برخط',
'pages.searchTable.nameStatus.abnormal': 'غیرطبیعی',
'pages.searchTable.titleUpdatedAt': 'آخرین برنامه ریزی در',
'pages.searchTable.exception': 'لطفا دلیل استثنا را وارد کنید!',
'pages.searchTable.titleOption': 'گزینه',
'pages.searchTable.config': 'پیکربندی',
'pages.searchTable.subscribeAlert': 'مشترک شدن در هشدارها',
'pages.searchTable.title': 'فرم درخواست',
'pages.searchTable.new': 'جدید',
'pages.searchTable.chosen': 'انتخاب شده',
'pages.searchTable.item': 'مورد',
'pages.searchTable.totalServiceCalls': 'تعداد کل تماس های خدماتی',
'pages.searchTable.tenThousand': '0000',
'pages.searchTable.batchDeletion': 'حذف دسته ای',
'pages.searchTable.batchApproval': 'تصویب دسته ای',
};
export default {
'app.pwa.offline': 'شما اکنون آفلاین هستید',
'app.pwa.serviceworker.updated': 'مطالب جدید در دسترس است',
'app.pwa.serviceworker.updated.hint':
'لطفاً برای بارگیری مجدد صفحه فعلی ، دکمه "تازه سازی" را فشار دهید',
'app.pwa.serviceworker.updated.ok': 'تازه سازی',
};
export default {
'app.setting.pagestyle': 'تنظیم نوع صفحه',
'app.setting.pagestyle.dark': 'سبک تیره',
'app.setting.pagestyle.light': 'سبک سبک',
'app.setting.content-width': 'عرض محتوا',
'app.setting.content-width.fixed': 'ثابت',
'app.setting.content-width.fluid': 'شناور',
'app.setting.themecolor': 'رنگ تم',
'app.setting.themecolor.dust': 'گرد و غبار قرمز',
'app.setting.themecolor.volcano': 'آتشفشان',
'app.setting.themecolor.sunset': 'غروب نارنجی',
'app.setting.themecolor.cyan': 'فیروزه ای',
'app.setting.themecolor.green': 'سبز قطبی',
'app.setting.themecolor.daybreak': 'آبی روشن(پیشفرض)',
'app.setting.themecolor.geekblue': 'چسب گیک',
'app.setting.themecolor.purple': 'بنفش طلایی',
'app.setting.navigationmode': 'حالت پیمایش',
'app.setting.sidemenu': 'طرح منوی کناری',
'app.setting.topmenu': 'طرح منوی بالایی',
'app.setting.fixedheader': 'سرصفحه ثابت',
'app.setting.fixedsidebar': 'نوار کناری ثابت',
'app.setting.fixedsidebar.hint': 'کار بر روی منوی کناری',
'app.setting.hideheader': 'هدر پنهان هنگام پیمایش',
'app.setting.hideheader.hint': 'وقتی Hidden Header فعال باشد کار می کند',
'app.setting.othersettings': 'تنظیمات دیگر',
'app.setting.weakmode': 'حالت ضعیف',
'app.setting.copy': 'تنظیمات کپی',
'app.setting.copyinfo':
'موفقیت در کپی کردن , لطفا defaultSettings را در src / models / setting.js جایگزین کنید',
'app.setting.production.hint':
'صفحه تنظیم فقط در محیط توسعه نمایش داده می شود ، لطفاً دستی تغییر دهید',
};
export default {
'app.settings.menuMap.basic': 'تنظیمات پایه ',
'app.settings.menuMap.security': 'تنظیمات امنیتی',
'app.settings.menuMap.binding': 'صحافی حساب',
'app.settings.menuMap.notification': 'اعلان پیام جدید',
'app.settings.basic.avatar': 'آواتار',
'app.settings.basic.change-avatar': 'آواتار را تغییر دهید',
'app.settings.basic.email': 'ایمیل',
'app.settings.basic.email-message': 'لطفا ایمیل خود را وارد کنید!',
'app.settings.basic.nickname': 'نام مستعار',
'app.settings.basic.nickname-message': 'لطفاً نام مستعار خود را وارد کنید!',
'app.settings.basic.profile': 'پروفایل شخصی',
'app.settings.basic.profile-message': 'لطفاً مشخصات شخصی خود را وارد کنید!',
'app.settings.basic.profile-placeholder': 'معرفی مختصر خودتان',
'app.settings.basic.country': 'کشور / منطقه',
'app.settings.basic.country-message': 'لطفاً کشور خود را وارد کنید!',
'app.settings.basic.geographic': 'استان یا شهر',
'app.settings.basic.geographic-message': 'لطفاً اطلاعات جغرافیایی خود را وارد کنید!',
'app.settings.basic.address': 'آدرس خیابان',
'app.settings.basic.address-message': 'لطفا آدرس خود را وارد کنید!',
'app.settings.basic.phone': 'شماره تلفن',
'app.settings.basic.phone-message': 'لطفاً تلفن خود را وارد کنید!',
'app.settings.basic.update': 'به روز رسانی اطلاعات',
'app.settings.security.strong': 'قوی',
'app.settings.security.medium': 'متوسط',
'app.settings.security.weak': 'ضعیف',
'app.settings.security.password': 'رمز عبور حساب کاربری',
'app.settings.security.password-description': 'قدرت رمز عبور فعلی',
'app.settings.security.phone': 'تلفن امنیتی',
'app.settings.security.phone-description': 'تلفن مقید',
'app.settings.security.question': 'سوال امنیتی',
'app.settings.security.question-description':
'سوال امنیتی تنظیم نشده است و سیاست امنیتی می تواند به طور موثر از امنیت حساب محافظت کند',
'app.settings.security.email': 'ایمیل پشتیبان',
'app.settings.security.email-description': 'ایمیل مقید',
'app.settings.security.mfa': 'دستگاه MFA',
'app.settings.security.mfa-description':
'دستگاه MFA بسته نشده ، پس از اتصال ، می تواند دو بار تأیید شود',
'app.settings.security.modify': 'تغییر',
'app.settings.security.set': 'تنظیم',
'app.settings.security.bind': 'بستن',
'app.settings.binding.taobao': 'اتصال Taobao',
'app.settings.binding.taobao-description': 'حساب Taobao در حال حاضر بسته نشده است',
'app.settings.binding.alipay': 'اتصال Alipay',
'app.settings.binding.alipay-description': 'حساب Alipay در حال حاضر بسته نشده است',
'app.settings.binding.dingding': 'اتصال DingTalk',
'app.settings.binding.dingding-description': 'حساب DingTalk در حال حاضر محدود نشده است',
'app.settings.binding.bind': 'بستن',
'app.settings.notification.password': 'رمز عبور حساب کاربری',
'app.settings.notification.password-description':
'پیام های سایر کاربران در قالب یک نامه ایستگاهی اعلام خواهد شد',
'app.settings.notification.messages': 'پیام های سیستم',
'app.settings.notification.messages-description':
'پیام های سیستم به صورت نامه ایستگاه مطلع می شوند',
'app.settings.notification.todo': 'اعلان کارها',
'app.settings.notification.todo-description':
'لیست کارها به صورت نامه ای از ایستگاه اطلاع داده می شود',
'app.settings.open': 'باز کن',
'app.settings.close': 'بستن',
};
import component from './id-ID/component';
import globalHeader from './id-ID/globalHeader';
import menu from './id-ID/menu';
import pwa from './id-ID/pwa';
import settingDrawer from './id-ID/settingDrawer';
import settings from './id-ID/settings';
import pages from './id-ID/pages';
export default {
'navbar.lang': 'Bahasa',
'layout.user.link.help': 'Bantuan',
'layout.user.link.privacy': 'Privasi',
'layout.user.link.terms': 'Ketentuan',
'app.preview.down.block': 'Unduh halaman ini dalam projek lokal anda',
'app.welcome.link.fetch-blocks': 'Dapatkan semua blok',
'app.welcome.link.block-list':
'Buat standar dengan cepat, halaman-halaman berdasarkan pengembangan `block`',
...globalHeader,
...menu,
...settingDrawer,
...settings,
...pwa,
...component,
...pages,
};
export default {
'component.tagSelect.expand': 'Perluas',
'component.tagSelect.collapse': 'Lipat',
'component.tagSelect.all': 'Semua',
};
export default {
'component.globalHeader.search': 'Pencarian',
'component.globalHeader.search.example1': 'Contoh 1 Pencarian',
'component.globalHeader.search.example2': 'Contoh 2 Pencarian',
'component.globalHeader.search.example3': 'Contoh 3 Pencarian',
'component.globalHeader.help': 'Bantuan',
'component.globalHeader.notification': 'Notifikasi',
'component.globalHeader.notification.empty': 'Anda telah membaca semua notifikasi',
'component.globalHeader.message': 'Pesan',
'component.globalHeader.message.empty': 'Anda telah membaca semua pesan.',
'component.globalHeader.event': 'Acara',
'component.globalHeader.event.empty': 'Anda telah melihat semua acara.',
'component.noticeIcon.clear': 'Kosongkan',
'component.noticeIcon.cleared': 'Berhasil dikosongkan',
'component.noticeIcon.empty': 'Tidak ada pemberitahuan',
'component.noticeIcon.view-more': 'Melihat lebih',
};
export default {
'menu.welcome': 'Selamat Datang',
'menu.more-blocks': 'Blocks Lainnya',
'menu.home': 'Halaman Awal',
'menu.admin': 'Admin',
'menu.admin.sub-page': 'Sub-Halaman',
'menu.login': 'Masuk',
'menu.register': 'Pendaftaran',
'menu.register.result': 'Hasil Pendaftaran',
'menu.dashboard': 'Dasbor',
'menu.dashboard.analysis': 'Analisis',
'menu.dashboard.monitor': 'Monitor',
'menu.dashboard.workplace': 'Workplace',
'menu.exception.403': '403',
'menu.exception.404': '404',
'menu.exception.500': '500',
'menu.form': 'Form',
'menu.form.basic-form': 'Form Dasar',
'menu.form.step-form': 'Form Bertahap',
'menu.form.step-form.info': 'Form Bertahap(menulis informasi yang dibagikan)',
'menu.form.step-form.confirm': 'Form Bertahap(konfirmasi informasi yang dibagikan)',
'menu.form.step-form.result': 'Form Bertahap(selesai)',
'menu.form.advanced-form': 'Form Lanjutan',
'menu.list': 'Daftar',
'menu.list.table-list': 'Tabel Pencarian',
'menu.list.basic-list': 'Daftar Dasar',
'menu.list.card-list': 'Daftar Kartu',
'menu.list.search-list': 'Daftar Pencarian',
'menu.list.search-list.articles': 'Daftar Pencarian(artikel)',
'menu.list.search-list.projects': 'Daftar Pencarian(projek)',
'menu.list.search-list.applications': 'Daftar Pencarian(aplikasi)',
'menu.profile': 'Profil',
'menu.profile.basic': 'Profil Dasar',
'menu.profile.advanced': 'Profile Lanjutan',
'menu.result': 'Hasil',
'menu.result.success': 'Sukses',
'menu.result.fail': 'Gagal',
'menu.exception': 'Pengecualian',
'menu.exception.not-permission': '403',
'menu.exception.not-find': '404',
'menu.exception.server-error': '500',
'menu.exception.trigger': 'Jalankan',
'menu.account': 'Akun',
'menu.account.center': 'Detail Akun',
'menu.account.settings': 'Pengaturan Akun',
'menu.account.trigger': 'Mengaktivasi Error',
'menu.account.logout': 'Keluar',
'menu.editor': 'Penyusun Grafis',
'menu.editor.flow': 'Penyusun Alur',
'menu.editor.mind': 'Penyusun Mind',
'menu.editor.koni': 'Penyusun Koni',
};
export default {
'pages.layouts.userLayout.title':
'Ant Design adalah spesifikasi desain Web yang paling berpengaruh di Kabupaten Xihu',
'pages.login.accountLogin.tab': 'Login dengan akun',
'pages.login.accountLogin.errorMessage': 'Nama pengguna dan kata sandi salah(admin/ant.design)',
'pages.login.username.placeholder': 'nama pengguna: admin atau user',
'pages.login.username.required': 'Nama pengguna harus diisi!',
'pages.login.password.placeholder': 'kata sandi: ant.design',
'pages.login.password.required': 'Kata sandi harus diisi!',
'pages.login.phoneLogin.tab': 'Login dengan ponsel',
'pages.login.phoneLogin.errorMessage': 'Kesalahan kode verifikasi',
'pages.login.phoneNumber.placeholder': 'masukkan nomor telepon',
'pages.login.phoneNumber.required': 'Nomor ponsel harus diisi!',
'pages.login.phoneNumber.invalid': 'Nomor ponsel tidak valid!',
'pages.login.captcha.placeholder': 'kode verifikasi',
'pages.login.captcha.required': 'Kode verifikasi diperlukan!',
'pages.login.phoneLogin.getVerificationCode': 'Dapatkan kode',
'pages.getCaptchaSecondText': 'detik tersisa',
'pages.login.rememberMe': 'Ingat saya',
'pages.login.forgotPassword': 'Lupa Kata Sandi?',
'pages.login.submit': 'Masuk',
'pages.login.loginWith': 'Masuk dengan :',
'pages.login.registerAccount': 'Daftar Akun',
'pages.welcome.advancedComponent': 'Formulir Lanjutan',
'pages.welcome.link': 'Selamat datang',
'pages.welcome.advancedLayout': 'Tata letak Lanjutan',
'pages.welcome.alertMessage':
'Komponen heavy-duty yang lebih cepat dan lebih kuat telah dirilis.',
'pages.admin.subPage.title': 'Halaman ini hanya dapat dilihat oleh admin',
'pages.admin.subPage.alertMessage':
'umi ui telah dirilis, silahkan gunakan npm run ui untuk memulai pengalaman.',
'pages.searchTable.createForm.newRule': 'Aturan baru',
'pages.searchTable.updateForm.ruleConfig': 'Konfigurasi aturan',
'pages.searchTable.updateForm.basicConfig': 'Informasi dasar',
'pages.searchTable.updateForm.ruleName.nameLabel': 'Nama aturan',
'pages.searchTable.updateForm.ruleName.nameRules': 'Harap masukkan nama aturan!',
'pages.searchTable.updateForm.ruleDesc.descLabel': 'Deskripsi aturan',
'pages.searchTable.updateForm.ruleDesc.descPlaceholder':
'Harap masukkan setidaknya lima karakter',
'pages.searchTable.updateForm.ruleDesc.descRules':
'Harap masukkan deskripsi aturan setidaknya lima karakter!',
'pages.searchTable.updateForm.ruleProps.title': 'Properti aturan',
'pages.searchTable.updateForm.object': 'Objek pemantauan',
'pages.searchTable.updateForm.ruleProps.templateLabel': 'Template aturan',
'pages.searchTable.updateForm.ruleProps.typeLabel': 'Jenis aturan',
'pages.searchTable.updateForm.schedulingPeriod.title': 'Periode penjadwalan',
'pages.searchTable.updateForm.schedulingPeriod.timeLabel': 'Waktu mulai',
'pages.searchTable.updateForm.schedulingPeriod.timeRules': 'Pilih waktu mulai!',
'pages.searchTable.titleDesc': 'deskripsi',
'pages.searchTable.ruleName': 'Nama aturan wajib diisi',
'pages.searchTable.titleCallNo': 'Jumlah panggilan',
'pages.searchTable.titleStatus': 'Status',
'pages.searchTable.nameStatus.default': 'default',
'pages.searchTable.nameStatus.running': 'menyala',
'pages.searchTable.nameStatus.online': 'online',
'pages.searchTable.nameStatus.abnormal': 'abnormal',
'pages.searchTable.titleUpdatedAt': 'Waktu terjadwal',
'pages.searchTable.exception': 'Harap masukkan alasan pengecualian!',
'pages.searchTable.titleOption': 'Pengoperasian',
'pages.searchTable.config': 'Konfigurasi',
'pages.searchTable.subscribeAlert': 'Berlangganan notifikasi',
'pages.searchTable.title': 'Formulir pertanyaan',
'pages.searchTable.new': 'Baru',
'pages.searchTable.chosen': 'Terpilih',
'pages.searchTable.item': 'item',
'pages.searchTable.totalServiceCalls': 'Jumlah total panggilan layanan',
'pages.searchTable.tenThousand': '0000',
'pages.searchTable.batchDeletion': 'Penghapusan batch',
'pages.searchTable.batchApproval': 'Persetujuan batch',
};
export default {
'app.pwa.offline': 'Koneksi anda terputus',
'app.pwa.serviceworker.updated': 'Konten baru sudah tersedia',
'app.pwa.serviceworker.updated.hint':
'Silahkan klik tombol "Refresh" untuk memuat ulang halaman ini',
'app.pwa.serviceworker.updated.ok': 'Memuat ulang',
};
export default {
'app.setting.pagestyle': 'Pengaturan style Halaman',
'app.setting.pagestyle.dark': 'Style Gelap',
'app.setting.pagestyle.light': 'Style Cerah',
'app.setting.content-width': 'Lebar Konten',
'app.setting.content-width.fixed': 'Tetap',
'app.setting.content-width.fluid': 'Fluid',
'app.setting.themecolor': 'Theme Color',
'app.setting.themecolor.dust': 'Dust Red',
'app.setting.themecolor.volcano': 'Volcano',
'app.setting.themecolor.sunset': 'Sunset Orange',
'app.setting.themecolor.cyan': 'Cyan',
'app.setting.themecolor.green': 'Polar Green',
'app.setting.themecolor.daybreak': 'Daybreak Blue (bawaan)',
'app.setting.themecolor.geekblue': 'Geek Glue',
'app.setting.themecolor.purple': 'Golden Purple',
'app.setting.navigationmode': 'Mode Navigasi',
'app.setting.sidemenu': 'Susunan Menu Samping',
'app.setting.topmenu': 'Susunan Menu Atas',
'app.setting.fixedheader': 'Header Tetap',
'app.setting.fixedsidebar': 'Sidebar Tetap',
'app.setting.fixedsidebar.hint': 'Berjalan pada Susunan Menu Samping',
'app.setting.hideheader': 'Sembunyikan Header ketika gulir ke bawah',
'app.setting.hideheader.hint': 'Bekerja ketika Header tersembunyi dimunculkan',
'app.setting.othersettings': 'Pengaturan Lainnya',
'app.setting.weakmode': 'Mode Lemah',
'app.setting.copy': 'Salin Pengaturan',
'app.setting.copyinfo':
'Berhasil disalin,tolong ubah defaultSettings pada src/models/setting.js',
'app.setting.production.hint':
'Panel pengaturan hanya muncul pada lingkungan pengembangan, silahkan modifikasi secara menual',
};
export default {
'app.settings.menuMap.basic': 'Pengaturan Dasar',
'app.settings.menuMap.security': 'Pengaturan Keamanan',
'app.settings.menuMap.binding': 'Pengikatan Akun',
'app.settings.menuMap.notification': 'Notifikasi Pesan Baru',
'app.settings.basic.avatar': 'Avatar',
'app.settings.basic.change-avatar': 'Ubah avatar',
'app.settings.basic.email': 'Email',
'app.settings.basic.email-message': 'Tolong masukkan email!',
'app.settings.basic.nickname': 'Nickname',
'app.settings.basic.nickname-message': 'Tolong masukkan Nickname!',
'app.settings.basic.profile': 'Profil Personal',
'app.settings.basic.profile-message': 'Tolong masukkan profil personal!',
'app.settings.basic.profile-placeholder': 'Perkenalan Singkat tentang Diri Anda',
'app.settings.basic.country': 'Negara/Wilayah',
'app.settings.basic.country-message': 'Tolong masukkan negara anda!',
'app.settings.basic.geographic': 'Provinsi atau kota',
'app.settings.basic.geographic-message': 'Tolong masukkan info geografis anda!',
'app.settings.basic.address': 'Alamat Jalan',
'app.settings.basic.address-message': 'Tolong masukkan Alamat Jalan anda!',
'app.settings.basic.phone': 'Nomor Ponsel',
'app.settings.basic.phone-message': 'Tolong masukkan Nomor Ponsel anda!',
'app.settings.basic.update': 'Perbarui Informasi',
'app.settings.security.strong': 'Kuat',
'app.settings.security.medium': 'Sedang',
'app.settings.security.weak': 'Lemah',
'app.settings.security.password': 'Kata Sandi Akun',
'app.settings.security.password-description': 'Kekuatan Kata Sandi saat ini',
'app.settings.security.phone': 'Keamanan Ponsel',
'app.settings.security.phone-description': 'Mengikat Ponsel',
'app.settings.security.question': 'Pertanyaan Keamanan',
'app.settings.security.question-description':
'Pertanyaan Keamanan belum diatur, dan kebijakan keamanan dapat melindungi akun secara efektif',
'app.settings.security.email': 'Email Cadangan',
'app.settings.security.email-description': 'Mengikat Email',
'app.settings.security.mfa': 'Perangka MFA',
'app.settings.security.mfa-description':
'Tidak mengikat Perangkat MFA, setelah diikat, dapat dikonfirmasi dua kali',
'app.settings.security.modify': 'Modifikasi',
'app.settings.security.set': 'Setel',
'app.settings.security.bind': 'Ikat',
'app.settings.binding.taobao': 'Mengikat Taobao',
'app.settings.binding.taobao-description': 'Tidak mengikat akun Taobao saat ini',
'app.settings.binding.alipay': 'Mengikat Alipay',
'app.settings.binding.alipay-description': 'Tidak mengikat akun Alipay saat ini',
'app.settings.binding.dingding': 'Mengikat DingTalk',
'app.settings.binding.dingding-description': 'Tidak mengikat akun DingTalk',
'app.settings.binding.bind': 'Ikat',
'app.settings.notification.password': 'Kata Sandi Akun',
'app.settings.notification.password-description':
'Pesan dari pengguna lain akan diberitahu dalam bentuk surat',
'app.settings.notification.messages': 'Pesan Sistem',
'app.settings.notification.messages-description':
'Pesan sistem akan diberitahu dalam bentuk surat',
'app.settings.notification.todo': 'Notifikasi daftar To-do',
'app.settings.notification.todo-description':
'Daftar to-do akan diberitahukan dalam bentuk surat dari stasiun',
'app.settings.open': 'Buka',
'app.settings.close': 'Tutup',
};
import globalHeader from './ja-JP/globalHeader';
import menu from './ja-JP/menu';
import settingDrawer from './ja-JP/settingDrawer';
import settings from './ja-JP/settings';
import pwa from './ja-JP/pwa';
import component from './ja-JP/component';
import pages from './ja-JP/pages';
export default {
'navBar.lang': '言語',
'layout.user.link.help': 'ヘルプ',
'layout.user.link.privacy': 'プライバシー',
'layout.user.link.terms': '利用規約',
'app.preview.down.block': 'このページをローカルプロジェクトにダウンロードしてください',
'app.welcome.link.fetch-blocks': '',
'app.welcome.link.block-list': '',
...globalHeader,
...menu,
...settingDrawer,
...settings,
...pwa,
...component,
...pages,
};
export default {
'component.tagSelect.expand': '展開',
'component.tagSelect.collapse': '折りたたむ',
'component.tagSelect.all': 'すべて',
};
export default {
'component.globalHeader.search': '検索',
'component.globalHeader.search.example1': '検索例1',
'component.globalHeader.search.example2': '検索例2',
'component.globalHeader.search.example3': '検索例3',
'component.globalHeader.help': 'ヘルプ',
'component.globalHeader.notification': '通知',
'component.globalHeader.notification.empty': 'すべての通知を表示しました。',
'component.globalHeader.message': 'メッセージ',
'component.globalHeader.message.empty': 'すべてのメッセージを表示しました。',
'component.globalHeader.event': 'イベント',
'component.globalHeader.event.empty': 'すべてのイベントを表示しました。',
'component.noticeIcon.clear': 'クリア',
'component.noticeIcon.cleared': 'クリア済み',
'component.noticeIcon.empty': '通知なし',
'component.noticeIcon.view-more': 'もっと見る',
};
export default {
'menu.welcome': 'ようこそ',
'menu.more-blocks': 'その他のブロック',
'menu.home': 'ホーム',
'menu.admin': '管理者',
'menu.admin.sub-page': 'サブページ',
'menu.login': 'ログイン',
'menu.register': '登録',
'menu.register.result': '登録結果',
'menu.dashboard': 'ダッシュボード',
'menu.dashboard.analysis': '分析',
'menu.dashboard.monitor': 'モニター',
'menu.dashboard.workplace': '職場',
'menu.exception.403': '403',
'menu.exception.404': '404',
'menu.exception.500': '500',
'menu.form': 'フォーム',
'menu.form.basic-form': '基本フォーム',
'menu.form.step-form': 'ステップフォーム',
'menu.form.step-form.info': 'ステップフォーム(転送情報の書き込み)',
'menu.form.step-form.confirm': 'ステップフォーム(転送情報の確認)',
'menu.form.step-form.result': 'ステップフォーム(完成)',
'menu.form.advanced-form': '高度なフォーム',
'menu.list': 'リスト',
'menu.list.table-list': '検索テーブル',
'menu.list.basic-list': '基本リスト',
'menu.list.card-list': 'カードリスト',
'menu.list.search-list': '検索リスト',
'menu.list.search-list.articles': '検索リスト(記事)',
'menu.list.search-list.projects': '検索リスト(プロジェクト)',
'menu.list.search-list.applications': '検索リスト(アプリ)',
'menu.profile': 'プロフィール',
'menu.profile.basic': '基本プロフィール',
'menu.profile.advanced': '高度なプロフィール',
'menu.result': '結果',
'menu.result.success': '成功',
'menu.result.fail': '失敗',
'menu.exception': '例外',
'menu.exception.not-permission': '403',
'menu.exception.not-find': '404',
'menu.exception.server-error': '500',
'menu.exception.trigger': 'トリガー',
'menu.account': 'アカウント',
'menu.account.center': 'アカウントセンター',
'menu.account.settings': 'アカウント設定',
'menu.account.trigger': 'トリガーエラー',
'menu.account.logout': 'ログアウト',
'menu.editor': 'グラフィックエディタ',
'menu.editor.flow': 'フローエディタ',
'menu.editor.mind': 'マインドエディター',
'menu.editor.koni': 'コニエディター',
};
export default {
'pages.layouts.userLayout.title': 'Ant Designは、西湖区で最も影響力のあるWebデザイン仕様です。',
'pages.login.accountLogin.tab': 'アカウントログイン',
'pages.login.accountLogin.errorMessage':
'ユーザー名/パスワードが正しくありません(admin/ant.design)',
'pages.login.username.placeholder': 'ユーザー名:adminまたはuser',
'pages.login.username.required': 'ユーザー名を入力してください!',
'pages.login.password.placeholder': 'パスワード:ant.design',
'pages.login.password.required': 'パスワードを入力してください!',
'pages.login.phoneLogin.tab': '電話ログイン',
'pages.login.phoneLogin.errorMessage': '検証コードエラー',
'pages.login.phoneNumber.placeholder': '電話番号',
'pages.login.phoneNumber.required': '電話番号を入力してください!',
'pages.login.phoneNumber.invalid': '電話番号が無効です!',
'pages.login.captcha.placeholder': '確認コード',
'pages.login.captcha.required': '確認コードを入力してください!',
'pages.login.phoneLogin.getVerificationCode': '確認コードを取得',
'pages.getCaptchaSecondText': '秒',
'pages.login.rememberMe': 'Remember me',
'pages.login.forgotPassword': 'パスワードをお忘れですか?',
'pages.login.submit': 'ログイン',
'pages.login.loginWith': 'その他のログイン方法:',
'pages.login.registerAccount': 'アカウント登録',
'pages.welcome.advancedComponent': '高度なコンポーネント',
'pages.welcome.link': 'ようこそ',
'pages.welcome.advancedLayout': '高度なレイアウト',
'pages.welcome.alertMessage': 'より高速で強力な頑丈なコンポーネントがリリースされました。',
'pages.admin.subPage.title': 'このページは管理者のみが表示できます',
'pages.admin.subPage.alertMessage':
'Umi uiがリリースされました。npm run uiを使用して体験してください。',
'pages.searchTable.createForm.newRule': '新しいルール',
'pages.searchTable.updateForm.ruleConfig': 'ルール構成',
'pages.searchTable.updateForm.basicConfig': '基本情報',
'pages.searchTable.updateForm.ruleName.nameLabel': 'ルール名',
'pages.searchTable.updateForm.ruleName.nameRules': 'ルール名を入力してください!',
'pages.searchTable.updateForm.ruleDesc.descLabel': 'ルールの説明',
'pages.searchTable.updateForm.ruleDesc.descPlaceholder': '5文字以上入力してください',
'pages.searchTable.updateForm.ruleDesc.descRules': '5文字以上のルールの説明を入力してください!',
'pages.searchTable.updateForm.ruleProps.title': 'プロパティの構成',
'pages.searchTable.updateForm.object': '監視対象',
'pages.searchTable.updateForm.ruleProps.templateLabel': 'ルールテンプレート',
'pages.searchTable.updateForm.ruleProps.typeLabel': 'ルールタイプ',
'pages.searchTable.updateForm.schedulingPeriod.title': 'スケジュール期間の設定',
'pages.searchTable.updateForm.schedulingPeriod.timeLabel': '開始時間',
'pages.searchTable.updateForm.schedulingPeriod.timeRules': '開始時間を選択してください!',
'pages.searchTable.titleDesc': '説明',
'pages.searchTable.ruleName': 'ルール名が必要です',
'pages.searchTable.titleCallNo': 'サービスコール数',
'pages.searchTable.titleStatus': 'ステータス',
'pages.searchTable.nameStatus.default': 'デフォルト',
'pages.searchTable.nameStatus.running': '起動中',
'pages.searchTable.nameStatus.online': 'オンライン',
'pages.searchTable.nameStatus.abnormal': '異常',
'pages.searchTable.titleUpdatedAt': '最終スケジュール',
'pages.searchTable.exception': '例外の理由を入力してください!',
'pages.searchTable.titleOption': 'オプション',
'pages.searchTable.config': '構成',
'pages.searchTable.subscribeAlert': 'アラートを購読する',
'pages.searchTable.title': 'お問い合わせフォーム',
'pages.searchTable.new': '新しい',
'pages.searchTable.chosen': '選んだ項目',
'pages.searchTable.item': '項目',
'pages.searchTable.totalServiceCalls': 'サービスコールの総数',
'pages.searchTable.tenThousand': '万',
'pages.searchTable.batchDeletion': 'バッチ削除',
'pages.searchTable.batchApproval': 'バッチ承認',
};
export default {
'app.pwa.offline': 'あなたは今オフラインです',
'app.pwa.serviceworker.updated': '新しいコンテンツが利用可能です',
'app.pwa.serviceworker.updated.hint':
'現在のページをリロードするには、「更新」ボタンを押してください',
'app.pwa.serviceworker.updated.ok': 'リフレッシュ',
};
export default {
'app.setting.pagestyle': 'ページスタイル設定',
'app.setting.pagestyle.dark': 'ダークスタイル',
'app.setting.pagestyle.light': 'ライトスタイル',
'app.setting.content-width': 'コンテンツの幅',
'app.setting.content-width.fixed': '固定',
'app.setting.content-width.fluid': '流体',
'app.setting.themecolor': 'テーマカラー',
'app.setting.themecolor.dust': 'ダストレッド',
'app.setting.themecolor.volcano': 'ボルケ-ノ',
'app.setting.themecolor.sunset': 'サンセットオレンジ',
'app.setting.themecolor.cyan': 'シアン',
'app.setting.themecolor.green': 'ポーラーグリーン',
'app.setting.themecolor.daybreak': '夜明けの青(デフォルト)',
'app.setting.themecolor.geekblue': 'ギーク ブルー',
'app.setting.themecolor.purple': 'ゴールデンパープル',
'app.setting.navigationmode': 'ナビゲーションモード',
'app.setting.sidemenu': 'サイドメニューのレイアウト',
'app.setting.topmenu': 'トップメニューのレイアウト',
'app.setting.fixedheader': '固定ヘッダー',
'app.setting.fixedsidebar': '固定サイドバー',
'app.setting.fixedsidebar.hint': 'サイドメニューのレイアウトで動作します',
'app.setting.hideheader': 'スクロール時の非表示ヘッダー',
'app.setting.hideheader.hint': '非表示ヘッダーが有効になっている場合に機能します',
'app.setting.othersettings': 'その他の設定',
'app.setting.weakmode': 'ウィークモード',
'app.setting.copy': 'コピー設定',
'app.setting.copyinfo':
'コピーが成功しました。src/models/setting.jsのdefaultSettingsを置き換えてください',
'app.setting.production.hint': '設定パネルは開発環境でのみ表示されます。手動で変更してください',
};
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment