Match-id-85543f979d38b31dac7e02e05bbff7ff8037b46a
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Copyright (c) 2020 Huawei Technologies Co.,Ltd.
|
||||
*
|
||||
* InulaJS is licensed under Mulan PSL v2.
|
||||
* You can use this software according to the terms and conditions of the Mulan PSL v2.
|
||||
* You may obtain a copy of Mulan PSL v2 at:
|
||||
*
|
||||
* http://license.coscl.org.cn/MulanPSL2
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
|
||||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
|
||||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
|
||||
* See the Mulan PSL v2 for more details.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
printWidth: 120, // 一行120字符数,如果超过会进行换行
|
||||
tabWidth: 2, // tab等2个空格
|
||||
useTabs: false, // 用空格缩进行
|
||||
semi: true, // 行尾使用分号
|
||||
singleQuote: true, // 字符串使用单引号
|
||||
quoteProps: 'as-needed', // 仅在需要时在对象属性添加引号
|
||||
jsxSingleQuote: false, // 在JSX中使用双引号
|
||||
trailingComma: 'es5', // 使用尾逗号(对象、数组等)
|
||||
bracketSpacing: true, // 对象的括号间增加空格
|
||||
bracketSameLine: false, // 将多行JSX元素的>放在最后一行的末尾
|
||||
arrowParens: 'avoid', // 在唯一的arrow函数参数周围省略括号
|
||||
vueIndentScriptAndStyle: false, // 不缩进Vue文件中的<script>和<style>标记内的代码
|
||||
endOfLine: 'lf', // 仅限换行(\n)
|
||||
};
|
|
@ -1,11 +1,30 @@
|
|||
#! /usr/bin/env node
|
||||
|
||||
const yParser = require('yargs-parser');
|
||||
const chalk = require('chalk');
|
||||
const run = require('./lib/run');
|
||||
const lodash = require('lodash');
|
||||
const version = require('./package.json').version;
|
||||
|
||||
const commands = [{ name: '-v', description: 'show version' }];
|
||||
|
||||
// args 为文件名后所有输入
|
||||
const args = yParser(process.argv.slice(2));
|
||||
|
||||
if (args.v || args._[0] === 'version') {
|
||||
console.log(version);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (args.h || args._[0] === 'help') {
|
||||
console.log(`
|
||||
Usage: create-inula <command> [options]
|
||||
|
||||
${getDescriptions(commands).join('\n')}
|
||||
`);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const name = args._[0] || '';
|
||||
|
||||
const { type } = args;
|
||||
|
@ -19,3 +38,15 @@ delete args.type;
|
|||
});
|
||||
process.exit(0);
|
||||
})();
|
||||
|
||||
function getDescription(command) {
|
||||
return ` ${chalk.green(lodash.padEnd(command.name, 10))}${command.description || ''}`;
|
||||
}
|
||||
|
||||
function getDescriptions(commands) {
|
||||
return Object.keys(commands)
|
||||
.filter(name => typeof commands[name] !== 'string')
|
||||
.map(name => {
|
||||
return getDescription(commands[name]);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
const BasicGenerator = require('../../BasicGenerator');
|
||||
const fs = require('fs');
|
||||
|
||||
class Generator extends BasicGenerator {
|
||||
prompting() {
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"description": "Inula-antd template."
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite + Inula</title>
|
||||
<title>Horizon Antd</title>
|
||||
<script type="module" src="/src/admin/main.jsx"></script>
|
||||
</head>
|
||||
<body></body>
|
|
@ -12,31 +12,6 @@ export function queryArray(array, key, value) {
|
|||
return array.filter(_ => _[key] === value);
|
||||
}
|
||||
|
||||
export function randomNumber(min, max) {
|
||||
return Math.floor(Math.random() * (max - min) + min);
|
||||
}
|
||||
|
||||
export function randomAvatar() {
|
||||
const avatarList = [
|
||||
'photo-1549492864-2ec7d66ffb04.jpeg',
|
||||
'photo-1480535339474-e083439a320d.jpeg',
|
||||
'photo-1523419409543-a5e549c1faa8.jpeg',
|
||||
'photo-1519648023493-d82b5f8d7b8a.jpeg',
|
||||
'photo-1523307730650-594bc63f9d67.jpeg',
|
||||
'photo-1522962506050-a2f0267e4895.jpeg',
|
||||
'photo-1489779162738-f81aed9b0a25.jpeg',
|
||||
'photo-1534308143481-c55f00be8bd7.jpeg',
|
||||
'photo-1519336555923-59661f41bb45.jpeg',
|
||||
'photo-1551438632-e8c7d9a5d1b7.jpeg',
|
||||
'photo-1525879000488-bff3b1c387cf.jpeg',
|
||||
'photo-1487412720507-e7ab37603c6f.jpeg',
|
||||
'photo-1510227272981-87123e259b17.jpeg',
|
||||
];
|
||||
return `//image.zuiidea.com/${
|
||||
avatarList[randomNumber(0, avatarList.length - 1)]
|
||||
}?imageView2/1/w/200/h/200/format/webp/q/75|imageslim`;
|
||||
}
|
||||
|
||||
export const Constant = {
|
||||
ApiPrefix: '/api/v1',
|
||||
NotFound: {
|
|
@ -0,0 +1,58 @@
|
|||
import { Constant } from './_utils';
|
||||
import Mock from 'mockjs';
|
||||
|
||||
const { ApiPrefix, Color } = Constant;
|
||||
|
||||
const Dashboard = Mock.mock({
|
||||
'sales|8': [
|
||||
{
|
||||
'name|+1': 2008,
|
||||
'Clothes|200-500': 1,
|
||||
'Food|180-400': 1,
|
||||
'Electronics|300-550': 1,
|
||||
},
|
||||
],
|
||||
quote: {
|
||||
name: 'Joho Doe',
|
||||
title: 'Graphic Designer',
|
||||
content:
|
||||
"I'm selfish, impatient and a little insecure. I make mistakes, I am out of control and at times hard to handle. But if you can't handle me at my worst, then you sure as hell don't deserve me at my best.",
|
||||
avatar: '//cdn.antd-admin.zuiidea.com/bc442cf0cc6f7940dcc567e465048d1a8d634493198c4-sPx5BR_fw236',
|
||||
},
|
||||
numbers: [
|
||||
{
|
||||
icon: 'pay-circle-o',
|
||||
color: Color.green,
|
||||
title: 'Online Review',
|
||||
number: 2781,
|
||||
},
|
||||
{
|
||||
icon: 'team',
|
||||
color: Color.blue,
|
||||
title: 'New Customers',
|
||||
number: 3241,
|
||||
},
|
||||
{
|
||||
icon: 'message',
|
||||
color: Color.purple,
|
||||
title: 'Active Projects',
|
||||
number: 253,
|
||||
},
|
||||
{
|
||||
icon: 'shopping-cart',
|
||||
color: Color.red,
|
||||
title: 'Referrals',
|
||||
number: 4324,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
export default [
|
||||
{
|
||||
url: `${ApiPrefix}/dashboard`,
|
||||
method: 'get',
|
||||
response: () => {
|
||||
return Dashboard;
|
||||
},
|
||||
},
|
||||
];
|
|
@ -1,22 +1,21 @@
|
|||
import { Constant } from './_utils';
|
||||
import Mock from 'mockjs';
|
||||
import { randomAvatar } from './_utils';
|
||||
import url from 'url';
|
||||
import { Constant } from "./_utils";
|
||||
import Mock from "mockjs";
|
||||
import url from "url";
|
||||
|
||||
const { ApiPrefix } = Constant;
|
||||
|
||||
let usersListData = Mock.mock({
|
||||
'data|80-100': [
|
||||
"data|80-100": [
|
||||
{
|
||||
id: '@id',
|
||||
name: '@name',
|
||||
nickName: '@last',
|
||||
id: "@id",
|
||||
name: "@name",
|
||||
nickName: "@last",
|
||||
phone: /^1[34578]\d{9}$/,
|
||||
'age|11-99': 1,
|
||||
address: '@county(true)',
|
||||
isMale: '@boolean',
|
||||
email: '@email',
|
||||
createTime: '@datetime',
|
||||
"age|11-99": 1,
|
||||
address: "@county(true)",
|
||||
isMale: "@boolean",
|
||||
email: "@email",
|
||||
createTime: "@datetime",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
@ -24,14 +23,14 @@ let usersListData = Mock.mock({
|
|||
let database = usersListData.data;
|
||||
|
||||
const EnumRoleType = {
|
||||
ADMIN: 'admin',
|
||||
DEFAULT: 'guest',
|
||||
DEVELOPER: 'developer',
|
||||
ADMIN: "admin",
|
||||
DEFAULT: "guest",
|
||||
DEVELOPER: "developer",
|
||||
};
|
||||
|
||||
const userPermission = {
|
||||
DEFAULT: {
|
||||
visit: ['1', '2', '21', '7', '5', '51', '52', '53'],
|
||||
visit: ["1", "2", "21", "7", "5", "51", "52", "53"],
|
||||
role: EnumRoleType.DEFAULT,
|
||||
},
|
||||
ADMIN: {
|
||||
|
@ -45,28 +44,13 @@ const userPermission = {
|
|||
const adminUsers = [
|
||||
{
|
||||
id: 0,
|
||||
username: 'admin',
|
||||
password: 'admin',
|
||||
username: "admin",
|
||||
password: "admin",
|
||||
permissions: userPermission.ADMIN,
|
||||
avatar: randomAvatar(),
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
username: 'guest',
|
||||
password: 'guest',
|
||||
permissions: userPermission.DEFAULT,
|
||||
avatar: randomAvatar(),
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
username: '吴彦祖',
|
||||
password: '123456',
|
||||
permissions: userPermission.DEVELOPER,
|
||||
avatar: randomAvatar(),
|
||||
},
|
||||
];
|
||||
|
||||
const queryArray = (array, key, keyAlias = 'key') => {
|
||||
const queryArray = (array, key, keyAlias = "key") => {
|
||||
if (!(array instanceof Array)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -86,14 +70,14 @@ const queryArray = (array, key, keyAlias = 'key') => {
|
|||
};
|
||||
|
||||
const NOTFOUND = {
|
||||
message: 'Not Found',
|
||||
documentation_url: 'http://localhost:8000/request',
|
||||
message: "Not Found",
|
||||
documentation_url: "http://localhost:8000/request",
|
||||
};
|
||||
|
||||
export default [
|
||||
{
|
||||
url: `${ApiPrefix}/user`,
|
||||
method: 'get',
|
||||
method: "get",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
|
@ -103,29 +87,29 @@ export default [
|
|||
},
|
||||
{
|
||||
url: `${ApiPrefix}/users`,
|
||||
method: 'get',
|
||||
response: req => {
|
||||
method: "get",
|
||||
response: (req) => {
|
||||
const { query } = url.parse(req.url, true);
|
||||
let { pageSize, page, ...other } = query;
|
||||
if (other['address[]']) {
|
||||
other['address'] = other['address[]'];
|
||||
delete other['address[]'];
|
||||
if (other["address[]"]) {
|
||||
other["address"] = other["address[]"];
|
||||
delete(other["address[]"]);
|
||||
}
|
||||
pageSize = pageSize || 10;
|
||||
page = page || 1;
|
||||
|
||||
let newData = database;
|
||||
for (let key in other) {
|
||||
newData = newData.filter(item => {
|
||||
newData = newData.filter((item) => {
|
||||
if ({}.hasOwnProperty.call(item, key)) {
|
||||
if (key === 'address') {
|
||||
if (key === "address") {
|
||||
for (const addr of other[key]) {
|
||||
if (item[key].indexOf(addr) === -1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else if (key === 'createTime') {
|
||||
} else if (key === "createTime") {
|
||||
const start = new Date(other[key][0]).getTime();
|
||||
const end = new Date(other[key][1]).getTime();
|
||||
const now = new Date(item[key]).getTime();
|
||||
|
@ -135,7 +119,10 @@ export default [
|
|||
}
|
||||
return true;
|
||||
}
|
||||
return String(item[key]).trim().indexOf(decodeURI(other[key]).trim()) > -1;
|
||||
return (
|
||||
String(item[key]).trim().indexOf(decodeURI(other[key]).trim()) >
|
||||
-1
|
||||
);
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
@ -148,10 +135,10 @@ export default [
|
|||
},
|
||||
{
|
||||
url: `${ApiPrefix}/users/delete`,
|
||||
method: 'post',
|
||||
response: req => {
|
||||
method: "post",
|
||||
response: (req) => {
|
||||
const { ids = [] } = req.body;
|
||||
database = database.filter(item => !ids.some(_ => _ === item.id));
|
||||
database = database.filter((item) => !ids.some((_) => _ === item.id));
|
||||
},
|
||||
},
|
||||
{},
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "my-react-app",
|
||||
"name": "inula-vite-app",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
|
@ -12,22 +12,20 @@
|
|||
"@babel/plugin-proposal-export-default-from": "^7.18.6",
|
||||
"@babel/plugin-transform-react-jsx": "^7.21.0",
|
||||
"@babel/runtime": "7.6.2",
|
||||
"inulajs": "^0.0.8",
|
||||
"antd": "^4.0.0",
|
||||
"axios": "^0.21.0",
|
||||
"classnames": "^2.2.6",
|
||||
"echarts": "^5.0.0",
|
||||
"history": "^5.3.0",
|
||||
"@cloudsop/horizon": "^0.0.58",
|
||||
"lodash": "^4.17.11",
|
||||
"moment": "2.24.0",
|
||||
"nprogress": "^0.2.0",
|
||||
"path-to-regexp": "^6.1.0",
|
||||
"prop-types": "^15.7.0",
|
||||
"qs": "^6.10.0",
|
||||
"react-countup": "^4.2.0",
|
||||
"react-dom": "17.0.2",
|
||||
"react-draft-wysiwyg": "^1.13.0",
|
||||
"react-helmet": "^6.0.0",
|
||||
"react-intl": "^6.3.2",
|
||||
"react-perfect-scrollbar": "^1.5.0",
|
||||
"react-router": "^6.10.0",
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 9.7 KiB After Width: | Height: | Size: 9.7 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
@ -1,4 +1,4 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
import PropTypes from 'prop-types';
|
||||
import { BarsOutlined, DownOutlined } from '@ant-design/icons';
|
||||
import { Dropdown, Button, Menu } from 'antd';
|
|
@ -1,4 +1,4 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
import { TooltipProps } from 'antd/lib/tooltip';
|
||||
|
||||
export interface EllipsisTooltipProps extends TooltipProps {
|
|
@ -1,4 +1,4 @@
|
|||
import Inula, { Component } from 'inulajs';
|
||||
import Inula, { Component } from '@cloudsop/horizon';
|
||||
import { Tooltip } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
import styles from './index.module.less';
|
|
@ -1,4 +1,4 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
import PropTypes from 'prop-types';
|
||||
import styles from './FilterItem.module.less';
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
export interface GlobalFooterProps {
|
||||
links?: Array<{
|
||||
key?: string;
|
|
@ -1,4 +1,4 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
import classNames from 'classnames';
|
||||
import styles from './index.module.less';
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import Inula, { Fragment } from 'inulajs';
|
||||
import Inula, { Fragment } from '@cloudsop/horizon';
|
||||
import { Breadcrumb } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { t } from 'utils/intl';
|
|
@ -0,0 +1,63 @@
|
|||
import Inula from '@cloudsop/horizon';
|
||||
import { Menu, Layout } from 'antd';
|
||||
import { MenuFoldOutlined, MenuUnfoldOutlined } from '@ant-design/icons';
|
||||
import { Trans } from 'utils/intl';
|
||||
import { getLocale, setLocale } from 'utils';
|
||||
import classnames from 'classnames';
|
||||
import config from 'config';
|
||||
import styles from './Header.module.less';
|
||||
|
||||
const { SubMenu } = Menu;
|
||||
|
||||
function Header({ fixed, username, collapsed, notifications, onCollapseChange, onAllNotificationsRead }) {
|
||||
const rightContent = [
|
||||
<div style={{ position: 'fixed', right: '100px' }}>
|
||||
<span style={{ color: '#999', marginRight: 4 }}>
|
||||
<Trans>Hi,</Trans>
|
||||
</span>
|
||||
<span>{username}</span>
|
||||
</div>
|
||||
];
|
||||
|
||||
if (config.i18n) {
|
||||
const { languages } = config.i18n;
|
||||
const language = getLocale();
|
||||
const currentLanguage = languages.find(item => item.key === language);
|
||||
|
||||
rightContent.unshift(
|
||||
<Menu
|
||||
key="language"
|
||||
selectedKeys={[currentLanguage.key]}
|
||||
onClick={data => {
|
||||
setLocale(data.key);
|
||||
}}
|
||||
mode="horizontal"
|
||||
>
|
||||
<SubMenu title={currentLanguage.title}>
|
||||
{languages.map(item => (
|
||||
<Menu.Item key={item.key}>
|
||||
{item.title}
|
||||
</Menu.Item>
|
||||
))}
|
||||
</SubMenu>
|
||||
</Menu>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout.Header
|
||||
className={classnames(styles.header, {
|
||||
[styles.fixed]: fixed,
|
||||
[styles.collapsed]: collapsed,
|
||||
})}
|
||||
id="layoutHeader"
|
||||
>
|
||||
<div className={styles.button} onClick={onCollapseChange.bind(this, !collapsed)}>
|
||||
{collapsed ? <MenuUnfoldOutlined /> : <MenuFoldOutlined />}
|
||||
</div>
|
||||
<div className={styles.rightContainer}>{rightContent}</div>
|
||||
</Layout.Header>
|
||||
);
|
||||
}
|
||||
|
||||
export default Header;
|
|
@ -1,4 +1,4 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
import { Switch, Layout } from 'antd';
|
||||
import { t } from 'utils/intl';
|
||||
import { Trans } from 'utils/intl';
|
|
@ -1,4 +1,4 @@
|
|||
import Inula, { useState, Fragment } from 'inulajs';
|
||||
import Inula, { useState, Fragment } from '@cloudsop/horizon';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Menu } from 'antd';
|
||||
import { NavLink } from 'react-router-dom';
|
|
@ -1,4 +1,4 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
import PropTypes from 'prop-types';
|
||||
import classNames from 'classnames';
|
||||
import styles from './Loader.module.less';
|
|
@ -1,4 +1,4 @@
|
|||
import Inula, { Component } from 'inulajs';
|
||||
import Inula, { Component } from '@cloudsop/horizon';
|
||||
import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
import Loader from '../Loader';
|
|
@ -1,4 +1,3 @@
|
|||
import Editor from './Editor';
|
||||
import FilterItem from './FilterItem';
|
||||
import DropOption from './DropOption';
|
||||
import Loader from './Loader';
|
||||
|
@ -8,4 +7,4 @@ import Ellipsis from './Ellipsis';
|
|||
import * as MyLayout from './Layout';
|
||||
import Page from './Page';
|
||||
|
||||
export { MyLayout, Editor, GlobalFooter, Ellipsis, FilterItem, DropOption, Loader, Page, ScrollBar };
|
||||
export { MyLayout, GlobalFooter, Ellipsis, FilterItem, DropOption, Loader, Page, ScrollBar };
|
|
@ -1,5 +1,4 @@
|
|||
import Inula, { Fragment } from 'inulajs';
|
||||
import { Helmet } from 'react-helmet';
|
||||
import Inula, { Fragment } from '@cloudsop/horizon';
|
||||
import { queryLayout } from 'utils';
|
||||
import config from 'utils/config';
|
||||
|
||||
|
@ -18,9 +17,6 @@ function BaseLayout({ children, location }) {
|
|||
|
||||
return (
|
||||
<Fragment>
|
||||
<Helmet>
|
||||
<title>{config.siteName}</title>
|
||||
</Helmet>
|
||||
<Container>{children}</Container>
|
||||
</Fragment>
|
||||
);
|
|
@ -1,4 +1,4 @@
|
|||
import Inula, { useEffect, Fragment } from 'inulajs';
|
||||
import Inula, { useEffect, Fragment } from '@cloudsop/horizon';
|
||||
import PropTypes from 'prop-types';
|
||||
import { MyLayout, GlobalFooter } from '../components';
|
||||
import { BackTop, Layout, Drawer } from 'antd';
|
|
@ -1,4 +1,4 @@
|
|||
import Inula, { Suspense } from 'inulajs';
|
||||
import Inula, { Suspense } from '@cloudsop/horizon';
|
||||
import { ConfigProvider } from 'antd';
|
||||
import { IntlProvider } from 'react-intl';
|
||||
import { getLocale } from '../utils';
|
|
@ -1,10 +1,12 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
import { BrowserRouter } from 'react-router-dom';
|
||||
|
||||
import config from './utils/config';
|
||||
import 'antd/dist/antd.css';
|
||||
|
||||
import Layout from './layouts';
|
||||
|
||||
document.title = config.siteName;
|
||||
|
||||
Inula.render(
|
||||
<BrowserRouter>
|
||||
<Layout></Layout>
|
|
@ -1,14 +1,11 @@
|
|||
import { stringify } from 'qs';
|
||||
import store from 'store';
|
||||
import { pathToRegexp } from 'path-to-regexp';
|
||||
import { ROLE_TYPE } from '../utils/constant';
|
||||
import { queryLayout } from '../utils';
|
||||
import api from '../services';
|
||||
import config from '../utils/config';
|
||||
// @ts-ignore
|
||||
const { queryRouteList, queryUserInfo } = api;
|
||||
|
||||
import { createStore } from 'inulajs';
|
||||
import { createStore } from '@cloudsop/horizon';
|
||||
|
||||
const goDashboard = history => {
|
||||
if (pathToRegexp(['/', '/login']).exec(window.location.pathname)) {
|
|
@ -1,4 +1,4 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
import { FrownOutlined } from '@ant-design/icons';
|
||||
import { Page } from 'components';
|
||||
import styles from './404.module.less';
|
|
@ -0,0 +1,6 @@
|
|||
import NumberCard from './numberCard';
|
||||
import Quote from './quote';
|
||||
import Sales from './sales';
|
||||
import Weather from './weather';
|
||||
|
||||
export { NumberCard, Quote, Sales, Weather };
|
|
@ -1,11 +1,10 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Card } from 'antd';
|
||||
import CountUp from 'react-countup';
|
||||
import iconMap from 'utils/iconMap';
|
||||
import styles from './numberCard.module.less';
|
||||
|
||||
function NumberCard({ icon, color, title, number, countUp }) {
|
||||
function NumberCard({ icon, color, title, number }) {
|
||||
return (
|
||||
<Card className={styles.numberCard} bordered={false} bodyStyle={{ padding: 10 }}>
|
||||
<span className={styles.iconWarp} style={{ color }}>
|
||||
|
@ -14,7 +13,7 @@ function NumberCard({ icon, color, title, number, countUp }) {
|
|||
<div className={styles.content}>
|
||||
<p className={styles.title}>{title || 'No Title'}</p>
|
||||
<p className={styles.number}>
|
||||
<CountUp start={0} end={number} duration={2.75} useEasing useGrouping separator="," {...(countUp || {})} />
|
||||
{number}
|
||||
</p>
|
||||
</div>
|
||||
</Card>
|
|
@ -1,4 +1,4 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
import PropTypes from 'prop-types';
|
||||
import styles from './quote.module.less';
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
import PropTypes from 'prop-types';
|
||||
import classnames from 'classnames';
|
||||
import Color from '../../../utils/theme';
|
|
@ -1,4 +1,4 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Spin } from 'antd';
|
||||
import styles from './weather.module.less';
|
|
@ -1,10 +1,9 @@
|
|||
import Inula, { useEffect } from 'inulajs';
|
||||
import Inula, { useEffect } from '@cloudsop/horizon';
|
||||
import { Row, Col, Card } from 'antd';
|
||||
import Color from '../../utils/theme';
|
||||
import { Page, ScrollBar } from '../../components';
|
||||
import { NumberCard, Quote, Sales, Weather } from './components';
|
||||
import styles from './index.module.less';
|
||||
import store from 'store';
|
||||
import { getStore } from './model';
|
||||
|
||||
const bodyStyle = {
|
||||
|
@ -21,9 +20,6 @@ function Dashboard() {
|
|||
st.query();
|
||||
}, []);
|
||||
|
||||
const userDetail = store.get('user');
|
||||
const { avatar, username } = userDetail;
|
||||
|
||||
const weather = st.weather;
|
||||
const sales = st.sales;
|
||||
const quote = st.quote;
|
|
@ -1,6 +1,6 @@
|
|||
import { parse } from 'qs';
|
||||
import api from '../../services';
|
||||
import { createStore } from 'inulajs';
|
||||
import { createStore } from '@cloudsop/horizon';
|
||||
|
||||
const { queryDashboard, queryWeather } = api;
|
||||
const avatar = '//cdn.antd-admin.zuiidea.com/bc442cf0cc6f7940dcc567e465048d1a8d634493198c4-sPx5BR_fw236.jpeg';
|
|
@ -1,4 +1,4 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
|
||||
function Index() {
|
|
@ -1,4 +1,4 @@
|
|||
import Inula, { lazy } from 'inulajs';
|
||||
import Inula, { lazy } from '@cloudsop/horizon';
|
||||
|
||||
export function getRoutes() {
|
||||
const routes = [
|
|
@ -1,4 +1,4 @@
|
|||
import Inula, { useRef } from 'inulajs';
|
||||
import Inula, { useRef } from '@cloudsop/horizon';
|
||||
import moment from 'moment';
|
||||
import { FilterItem } from 'components';
|
||||
import { Button, Row, Col, DatePicker, Form, Input, Cascader } from 'antd';
|
|
@ -1,4 +1,4 @@
|
|||
import Inula from 'inulajs';
|
||||
import Inula from '@cloudsop/horizon';
|
||||
import { Table, Modal } from 'antd';
|
||||
import { DropOption } from 'components';
|
||||
import { t } from 'utils/intl';
|
|
@ -1,4 +1,4 @@
|
|||
import Inula, { useRef } from 'inulajs';
|
||||
import Inula, { useRef } from '@cloudsop/horizon';
|
||||
import { Form, Input, InputNumber, Radio, Modal, Cascader } from 'antd';
|
||||
import { t, Trans } from 'utils/intl';
|
||||
import city from 'utils/city';
|
|
@ -1,4 +1,4 @@
|
|||
import Inula, { PureComponent } from 'inulajs';
|
||||
import Inula, { PureComponent } from '@cloudsop/horizon';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Page } from 'components';
|
||||
import styles from './index.module.less';
|
|
@ -1,4 +1,4 @@
|
|||
import Inula, { useEffect } from 'inulajs';
|
||||
import Inula, { useEffect } from '@cloudsop/horizon';
|
||||
import { Row, Col, Button, Popconfirm } from 'antd';
|
||||
import { Page } from '../../components';
|
||||
import { stringify } from 'qs';
|
|
@ -1,5 +1,5 @@
|
|||
import api from '../../services';
|
||||
import { createStore } from 'inulajs';
|
||||
import { createStore } from '@cloudsop/horizon';
|
||||
|
||||
const { queryUserList, createUser, removeUser, updateUser, removeUserList } = api;
|
||||
|