Commit 8aaedb3b authored by MrShi's avatar MrShi

新建dev分支,服务器工程web代码,合并到dev分支

parent d62b9539
This diff is collapsed.
/*
import { Settings as ProSettings } from '@ant-design/pro-layout';
type DefaultSettings = ProSettings & {
......@@ -21,6 +22,96 @@ const proSettings: DefaultSettings = {
iconfontUrl: '',
};
export type { DefaultSettings };
export { DefaultSettings };
export default proSettings;
*/
// import { Settings as ProSettings } from '@ant-design/pro-layout';
//
// type DefaultSettings = ProSettings & {
// pwa: boolean;
// };
//
// const proSettings: DefaultSettings = {
// navTheme: 'dark',
// // 拂晓蓝
// primaryColor: '#1890ff',
// layout: 'side',
// contentWidth: 'Fluid',
// fixedHeader: false,
// fixSiderbar: true,
// colorWeak: false,
// menu: {
// locale: true,
// },
// title: 'TosManagement',
// pwa: false,
// iconfontUrl: '',
// };
//
// export { DefaultSettings };
//
// export default proSettings;
import { MenuTheme } from 'antd/es/menu/MenuContext';
export type ContentWidth = 'Fluid' | 'Fixed';
export interface DefaultSettings {
/**
* theme for nav menu
*/
navTheme: MenuTheme;
/**
* primary color of ant design
*/
primaryColor: string;
/**
* nav menu position: `sidemenu` or `topmenu`
*/
layout: 'sidemenu' | 'topmenu';
/**
* layout of content: `Fluid` or `Fixed`, only works when layout is topmenu
*/
contentWidth: ContentWidth;
/**
* sticky header
*/
fixedHeader: boolean;
/**
* auto hide header
*/
autoHideHeader: boolean;
/**
* sticky siderbar
*/
fixSiderbar: boolean;
menu: { locale: boolean };
title: string;
pwa: boolean;
// Your custom iconfont Symbol script Url
// eg://at.alicdn.com/t/font_1039637_btcrd5co4w.js
// 注意:如果需要图标多色,Iconfont 图标项目里要进行批量去色处理
// Usage: https://github.com/ant-design/ant-design-pro/pull/3517
iconfontUrl: string;
colorWeak: boolean;
}
export default {
navTheme: 'dark',
// 拂晓蓝
primaryColor: '#1890ff',
layout: 'sidemenu',
contentWidth: 'Fluid',
fixedHeader: false,
autoHideHeader: false,
fixSiderbar: false,
colorWeak: false,
menu: {
locale: true,
},
title: 'TosManagement',
pwa: false,
iconfontUrl: '',
} as DefaultSettings;
import path from 'path';
import * as IWebpackChainConfig from 'webpack-chain';
function getModulePackageName(module: { context: string }) {
if (!module.context) return null;
const nodeModulesPath = path.join(__dirname, '../node_modules/');
if (module.context.substring(0, nodeModulesPath.length) !== nodeModulesPath) {
return null;
}
const moduleRelativePath = module.context.substring(nodeModulesPath.length);
const [moduleDirName] = moduleRelativePath.split(path.sep);
let packageName: string | null = moduleDirName;
// handle tree shaking
if (packageName && packageName.match('^_')) {
// eslint-disable-next-line prefer-destructuring
packageName = packageName.match(/^_(@?[^@]+)/)![1];
}
return packageName;
}
export const webpackPlugin = (config: IWebpackChainConfig) => {
// optimize chunks
config.optimization
// share the same chunks across different modules
.runtimeChunk(false)
.splitChunks({
chunks: 'async',
name: 'vendors',
maxInitialRequests: Infinity,
minSize: 0,
cacheGroups: {
vendors: {
test: (module: { context: string }) => {
const packageName = getModulePackageName(module) || '';
if (packageName) {
return [
'bizcharts',
'gg-editor',
'g6',
'@antv',
'gg-editor-core',
'bizcharts-plugin-slider',
].includes(packageName);
}
return false;
},
name(module: { context: string }) {
const packageName = getModulePackageName(module);
if (packageName) {
if (['bizcharts', '@antv_data-set'].indexOf(packageName) >= 0) {
return 'viz'; // visualization package
}
}
return 'misc';
},
},
},
});
};
// /*
// /!**
// * 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
// * 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://localhost:8651',
// // target: 'https://preview.pro.ant.design',
// changeOrigin: true,
// pathRewrite: { '^/api': '' },
// // pathRewrite: { '^': '' },
// },
// },
// test: {
// '/api/': {
// // target: 'https://preview.pro.ant.design',
// target: 'http://localhost:8651',
// changeOrigin: true,
// pathRewrite: { '^/api': '' },
// // pathRewrite: { '^': '' },
// },
// },
// pre: {
// '/api/': {
// target: 'http://localhost:8651',
// // target: 'your pre url',
// changeOrigin: true,
// pathRewrite: { '^/api': '' },
// // pathRewrite: { '^': '' },
// },
// },
// };
// */
/**
* 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
* The agent cannot take effect in the production environment
......@@ -5,6 +43,122 @@
* For details, please see
* https://pro.ant.design/docs/deploy
*/
export default {
dev: {
'/api/': {
// target: 'http://www.srthinker.com:5605',
// target: 'http://192.168.1.101:5605/',
target: 'http://localhost:8651',
changeOrigin: true,
pathRewrite: { '^/api': '' },
},
},
test: {
'/api/': {
// target: 'http://www.srthinker.com:5605',
// target: 'http://192.168.1.101:5605/',
target: 'http://localhost:8651',
changeOrigin: true,
pathRewrite: { '^/api': '' },
},
},
pre: {
'/api/': {
// target: 'http://www.srthinker.com:5605',
// target: 'http://192.168.1.101:5605/',
target: 'http://localhost:8651',
changeOrigin: true,
pathRewrite: { '^/api': '' },
},
},
};
/*
// /!*
// /!**
// * 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
// * 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://localhost:8651',
// // target: 'https://preview.pro.ant.design',
// changeOrigin: true,
// pathRewrite: { '^/api': '' },
// // pathRewrite: { '^': '' },
// },
// },
// test: {
// '/api/': {
// // target: 'https://preview.pro.ant.design',
// target: 'http://localhost:8651',
// changeOrigin: true,
// pathRewrite: { '^/api': '' },
// // pathRewrite: { '^': '' },
// },
// },
// pre: {
// '/api/': {
// target: 'http://localhost:8651',
// // target: 'your pre url',
// changeOrigin: true,
// pathRewrite: { '^/api': '' },
// // pathRewrite: { '^': '' },
// },
// },
// };
// *!/
/!**
* 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
* 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://www.srthinker.com:5605',
// target: 'http://192.168.1.101:5605/',
target: 'http://localhost:8651',
changeOrigin: true,
pathRewrite: { '^/api': '' },
},
},
test: {
'/api/': {
// target: 'http://www.srthinker.com:5605',
// target: 'http://192.168.1.101:5605/',
target: 'http://localhost:8651',
changeOrigin: true,
pathRewrite: { '^/api': '' },
},
},
pre: {
'/api/': {
// target: 'http://www.srthinker.com:5605',
// target: 'http://192.168.1.101:5605/',
target: 'http://localhost:8651',
changeOrigin: true,
pathRewrite: { '^/api': '' },
},
},
};
/!*
/!**
* 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
* 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/': {
......@@ -28,3 +182,5 @@ export default {
},
},
};
*!/
*/
export default {
theme: [
{
key: 'dark',
fileName: 'dark.css',
theme: 'dark',
},
{
key: 'dust',
fileName: 'dust.css',
modifyVars: {
'@primary-color': '#F5222D',
},
},
{
key: 'volcano',
fileName: 'volcano.css',
modifyVars: {
'@primary-color': '#FA541C',
},
},
{
key: 'sunset',
fileName: 'sunset.css',
modifyVars: {
'@primary-color': '#FAAD14',
},
},
{
key: 'cyan',
fileName: 'cyan.css',
modifyVars: {
'@primary-color': '#13C2C2',
},
},
{
key: 'green',
fileName: 'green.css',
modifyVars: {
'@primary-color': '#52C41A',
},
},
{
key: 'geekblue',
fileName: 'geekblue.css',
modifyVars: {
'@primary-color': '#2F54EB',
},
},
{
key: 'purple',
fileName: 'purple.css',
modifyVars: {
'@primary-color': '#722ED1',
},
},
{
key: 'dust',
theme: 'dark',
fileName: 'dark-dust.css',
modifyVars: {
'@primary-color': '#F5222D',
},
},
{
key: 'volcano',
theme: 'dark',
fileName: 'dark-volcano.css',
modifyVars: {
'@primary-color': '#FA541C',
},
},
{
key: 'sunset',
theme: 'dark',
fileName: 'dark-sunset.css',
modifyVars: {
'@primary-color': '#FAAD14',
},
},
{
key: 'cyan',
theme: 'dark',
fileName: 'dark-cyan.css',
modifyVars: {
'@primary-color': '#13C2C2',
},
},
{
key: 'green',
theme: 'dark',
fileName: 'dark-green.css',
modifyVars: {
'@primary-color': '#52C41A',
},
},
{
key: 'geekblue',
theme: 'dark',
fileName: 'dark-geekblue.css',
modifyVars: {
'@primary-color': '#2F54EB',
},
},
{
key: 'purple',
theme: 'dark',
fileName: 'dark-purple.css',
modifyVars: {
'@primary-color': '#722ED1',
},
},
],
};
import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
import { Avatar, Menu, Spin,Icon } from 'antd';
import React from 'react';
import { history, ConnectProps, connect } from 'umi';
import { ConnectState } from '@/models/connect';
import { CurrentUser } from '@/models/user';
import HeaderDropdown from '../HeaderDropdown';
import styles from './index.less';
export interface GlobalHeaderRightProps extends Partial<ConnectProps> {
currentUser?: CurrentUser;
menu?: boolean;
}
class AvatarDropdown extends React.Component<GlobalHeaderRightProps> {
onMenuClick = (event: {
key: React.Key;
keyPath: React.Key[];
item: React.ReactInstance;
domEvent: React.MouseEvent<HTMLElement>;
}) => {
const { key } = event;
if (key === 'logout') {
const { dispatch } = this.props;
if (dispatch) {
dispatch({
type: 'login/logout',
});
}
return;
}
history.push(`/account/${key}`);
};
render(): React.ReactNode {
const {
currentUser = {
avatar: '',
name: '',
},
menu,
} = this.props;
const menuHeaderDropdown = (
<Menu className={styles.menu} selectedKeys={[]} onClick={this.onMenuClick}
style={{width:168,textAlign:"center"}}>
{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.Item key="reset">
<UserOutlined />
修改密码
</Menu.Item>
</Menu>
);
return currentUser && currentUser.name ? (
<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>
) : (
<span className={`${styles.action} ${styles.account}`}>
<Spin
size="small"
style={{
marginLeft: 8,
marginRight: 8,
}}
/>
</span>
);
}
}
export default connect(({ user }: ConnectState) => ({
currentUser: user.currentUser,
}))(AvatarDropdown);
/*
import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
import { Avatar, Menu, Spin } from 'antd';
import { ClickParam } from 'antd/es/menu';
import React from 'react';
......@@ -86,3 +187,4 @@ class AvatarDropdown extends React.Component<GlobalHeaderRightProps> {
export default connect(({ user }: ConnectState) => ({
currentUser: user.currentUser,
}))(AvatarDropdown);
*/
......@@ -68,7 +68,7 @@ const GlobalHeaderRight: React.SFC<GlobalHeaderRightProps> = (props) => {
<Tag color={ENVTagColor[REACT_APP_ENV]}>{REACT_APP_ENV}</Tag>
</span>
)}
{/* <SelectLang className={styles.action} /> */}
<SelectLang className={styles.action} />
</div>
);
};
......
......@@ -20,15 +20,15 @@ const SelectLang: React.FC<SelectLangProps> = (props) => {
const locales = ['zh-CN', 'zh-TW', 'en-US', 'pt-BR'];
const languageLabels = {
'zh-CN': '简体中文',
'zh-TW': '繁体中文',
// 'zh-TW': '繁体中文',
'en-US': 'English',
'pt-BR': 'Português',
// 'pt-BR': 'Português',
};
const languageIcons = {
'zh-CN': '🇨🇳',
'zh-TW': '🇭🇰',
// 'zh-TW': '🇭🇰',
'en-US': '🇺🇸',
'pt-BR': '🇧🇷',
// 'pt-BR': '🇧🇷',
};
const langMenu = (
<Menu className={styles.menu} selectedKeys={[selectedLang]} onClick={changeLang}>
......
......@@ -9,17 +9,15 @@ import ProLayout, {
Settings,
DefaultFooter,
} from '@ant-design/pro-layout';
import React, { useEffect } from 'react';
import { Link, useIntl, connect, Dispatch } from 'umi';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { GithubOutlined } from '@ant-design/icons';
import { Result, Button } from 'antd';
import Authorized from '@/utils/Authorized';
import RightContent from '@/components/GlobalHeader/RightContent';
import { ConnectState } from '@/models/connect';
import { getAuthorityFromRouter } from '@/utils/utils';
import logo from '../assets/logo.svg';
import tsIcon from '../assets/logo.png';
import logo from '../assets/tosImage.png';
const noMatch = (
<Result
......@@ -63,7 +61,7 @@ const menuDataRender = (menuList: MenuDataItem[]): MenuDataItem[] =>
const defaultFooterDom = (
<DefaultFooter
copyright={`${new Date().getFullYear()} 蚂蚁金服体验技术部出品`}
/*copyright={`${new Date().getFullYear()} 蚂蚁金服体验技术部出品`}
links={[
{
key: 'Ant Design Pro',
......@@ -83,7 +81,7 @@ const defaultFooterDom = (
href: 'https://ant.design',
blankTarget: true,
},
]}
]}*/
/>
);
......@@ -129,16 +127,8 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
<ProLayout
logo={logo}
formatMessage={formatMessage}
menuHeaderRender={(logoDom, titleDom) => (
<div style={{ marginLeft: -25, width: 260, height: 64, backgroundColor: "#ffffff",paddingLeft:16,paddingTop:10}}>
<img src={tsIcon} style={{width:50,height:50}}/><span style={{fontSize:18,fontFamily:"Source Han Sans CN",fontWeight:"bold",color:"rgba(51,51,51,1)"}}> TOS Management</span>
</div>
// <Link to="/">
// {/* {logoDom} */}
// {titleDom}
// </Link>
)}
onCollapse={handleMenuCollapse}
onMenuHeaderClick={() => history.push('/')}
menuItemRender={(menuItemProps, defaultDom) => {
if (menuItemProps.isUrl || !menuItemProps.path) {
return defaultDom;
......@@ -160,7 +150,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
<span>{route.breadcrumbName}</span>
);
}}
//footerRender={() => defaultFooterDom}
footerRender={() => defaultFooterDom}
menuDataRender={menuDataRender}
rightContentRender={() => <RightContent />}
{...props}
......@@ -177,3 +167,184 @@ export default connect(({ global, settings }: ConnectState) => ({
collapsed: global.collapsed,
settings,
}))(BasicLayout);
// /**
// * Ant Design Pro v4 use `@ant-design/pro-layout` to handle Layout.
// * You can view component api by:
// * https://github.com/ant-design/ant-design-pro-layout
// */
// import ProLayout, {
// MenuDataItem,
// BasicLayoutProps as ProLayoutProps,
// Settings,
// DefaultFooter,
// } from '@ant-design/pro-layout';
//
// import React, { useEffect } from 'react';
// import { Link, useIntl, connect, Dispatch } from 'umi';
// import { GithubOutlined } from '@ant-design/icons';
// import { Result, Button } from 'antd';
// import Authorized from '@/utils/Authorized';
// import RightContent from '@/components/GlobalHeader/RightContent';
// import { ConnectState } from '@/models/connect';
// import { getAuthorityFromRouter } from '@/utils/utils';
// import logo from '../assets/logo.svg';
// import tsIcon from '../assets/logo.png';
//
// const noMatch = (
// <Result
// status={403}
// title="403"
// subTitle="Sorry, you are not authorized to access this page."
// extra={
// <Button type="primary">
// <Link to="/user/login">Go Login</Link>
// </Button>
// }
// />
// );
// export interface BasicLayoutProps extends ProLayoutProps {
// breadcrumbNameMap: {
// [path: string]: MenuDataItem;
// };
// route: ProLayoutProps['route'] & {
// authority: string[];
// };
// settings: Settings;
// dispatch: Dispatch;
// }
// export type BasicLayoutContext = { [K in 'location']: BasicLayoutProps[K] } & {
// breadcrumbNameMap: {
// [path: string]: MenuDataItem;
// };
// };
// /**
// * use Authorized check all menu item
// */
//
// const menuDataRender = (menuList: MenuDataItem[]): MenuDataItem[] =>
// menuList.map((item) => {
// const localItem = {
// ...item,
// children: item.children ? menuDataRender(item.children) : undefined,
// };
// return Authorized.check(item.authority, localItem, null) as MenuDataItem;
// });
//
// const defaultFooterDom = (
// <DefaultFooter
// copyright={`${new Date().getFullYear()} 蚂蚁金服体验技术部出品`}
// links={[
// {
// key: 'Ant Design Pro',
// title: 'Ant Design Pro',
// href: 'https://pro.ant.design',
// blankTarget: true,
// },
// {
// key: 'github',
// title: <GithubOutlined />,
// href: 'https://github.com/ant-design/ant-design-pro',
// blankTarget: true,
// },
// {
// key: 'Ant Design',
// title: 'Ant Design',
// href: 'https://ant.design',
// blankTarget: true,
// },
// ]}
// />
// );
//
// const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
// const {
// dispatch,
// children,
// settings,
// location = {
// pathname: '/',
// },
// } = props;
// /**
// * constructor
// */
//
// useEffect(() => {
// if (dispatch) {
// dispatch({
// type: 'user/fetchCurrent',
// });
// }
// }, []);
// /**
// * init variables
// */
//
// const handleMenuCollapse = (payload: boolean): void => {
// if (dispatch) {
// dispatch({
// type: 'global/changeLayoutCollapsed',
// payload,
// });
// }
// }; // get children authority
//
// const authorized = getAuthorityFromRouter(props.route.routes, location.pathname || '/') || {
// authority: undefined,
// };
// const { formatMessage } = useIntl();
//
// return (
// <ProLayout
// logo={logo}
// formatMessage={formatMessage}
// menuHeaderRender={(logoDom, titleDom) => (
// <div style={{ marginLeft: -25, width: 260, height: 64, backgroundColor: "#ffffff",paddingLeft:16,paddingTop:10}}>
// <img src={tsIcon} style={{width:50,height:50}}/><span style={{fontSize:18,fontFamily:"Source Han Sans CN",fontWeight:"bold",color:"rgba(51,51,51,1)"}}> TOS Management</span>
// </div>
// // <Link to="/">
// // {/* {logoDom} */}
// // {titleDom}
// // </Link>
// )}
// onCollapse={handleMenuCollapse}
// menuItemRender={(menuItemProps, defaultDom) => {
// if (menuItemProps.isUrl || !menuItemProps.path) {
// return defaultDom;
// }
// return <Link to={menuItemProps.path}>{defaultDom}</Link>;
// }}
// breadcrumbRender={(routers = []) => [
// {
// path: '/',
// breadcrumbName: formatMessage({ id: 'menu.home' }),
// },
// ...routers,
// ]}
// itemRender={(route, params, routes, paths) => {
// const first = routes.indexOf(route) === 0;
// return first ? (
// <Link to={paths.join('/')}>{route.breadcrumbName}</Link>
// ) : (
// <span>{route.breadcrumbName}</span>
// );
// }}
// //footerRender={() => defaultFooterDom}
// menuDataRender={menuDataRender}
// rightContentRender={() => <RightContent />}
// {...props}
// {...settings}
// >
// <Authorized authority={authorized!.authority} noMatch={noMatch}>
// {children}
// </Authorized>
// </ProLayout>
// );
// };
//
// export default connect(({ global, settings }: ConnectState) => ({
// collapsed: global.collapsed,
// settings,
// }))(BasicLayout);
......@@ -14,6 +14,67 @@ interface SecurityLayoutState {
isReady: boolean;
}
class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayoutState> {
state: SecurityLayoutState = {
isReady: false,
};
componentDidMount() {
this.setState({
isReady: true,
});
const { dispatch } = this.props;
if (dispatch) {
dispatch({
type: 'user/fetchCurrent',
});
}
}
render() {
const { isReady } = this.state;
const { children, loading, currentUser } = this.props;
// You can replace it to your authentication rule (such as check token exists)
// 你可以把它替换成你自己的登录认证规则(比如判断 token 是否存在)
const isLogin = currentUser && currentUser.userid;
const queryString = stringify({
redirect: window.location.href,
});
if ((!isLogin && loading) || !isReady) {
return <PageLoading />;
}
if (!isLogin && window.location.pathname !== '/user/login') {
return <Redirect to={`/user/login?${queryString}`} />;
}
return children;
}
}
export default connect(({ user, loading }: ConnectState) => ({
currentUser: user.currentUser,
loading: loading.models.user,
}))(SecurityLayout);
/*
import React from 'react';
import { PageLoading } from '@ant-design/pro-layout';
import { Redirect, connect, ConnectProps } from 'umi';
import { stringify } from 'querystring';
import { ConnectState } from '@/models/connect';
import { CurrentUser } from '@/models/user';
interface SecurityLayoutProps extends ConnectProps {
loading?: boolean;
currentUser?: CurrentUser;
}
interface SecurityLayoutState {
isReady: boolean;
}
class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayoutState> {
state: SecurityLayoutState = {
isReady: false,
......@@ -59,3 +120,4 @@ export default connect(({ user, loading }: ConnectState) => ({
currentUser: user.currentUser,
loading: loading.models.user,
}))(SecurityLayout);
*/
@import '~antd/es/style/themes/default.less';
.container {
display: flex;
flex-direction: column;
height: 100vh;
overflow: auto;
background: @layout-body-background;
}
.lang {
width: 100%;
height: 40px;
line-height: 44px;
text-align: right;
:global(.ant-dropdown-trigger) {
margin-right: 24px;
}
}
.content {
flex: 1;
padding: 32px 0;
}
@media (min-width: @screen-md-min) {
.container {
background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg');
background-repeat: no-repeat;
background-position: center 110px;
background-size: 100%;
}
.content {
padding: 32px 0 24px;
}
}
.top {
text-align: center;
}
.header {
height: 44px;
line-height: 44px;
a {
text-decoration: none;
}
}
.logo {
height: 44px;
margin-right: 16px;
vertical-align: top;
}
.title {
position: relative;
top: 2px;
color: @heading-color;
font-weight: 600;
font-size: 33px;
font-family: Avenir, 'Helvetica Neue', Arial, Helvetica, sans-serif;
}
.desc {
margin-top: 12px;
margin-bottom: 40px;
color: @text-color-secondary;
font-size: @font-size-base;
}
/*
@import '~antd/es/style/themes/default.less';
.container {
display: flex;
flex-direction: column;
......@@ -103,4 +177,4 @@
color:rgba(0,43,96,1);
line-height:48px;
margin-bottom: 89px;
}
\ No newline at end of file
}*/
import { DefaultFooter, MenuDataItem, getMenuData, getPageTitle } from '@ant-design/pro-layout';
import { Helmet, HelmetProvider } from 'react-helmet-async';
import { Link, SelectLang, useIntl, ConnectProps, connect } from 'umi';
import React from 'react';
import { ConnectState } from '@/models/connect';
import logo from '../assets/tosImage.png';
import styles from './UserLayout.less';
export interface UserLayoutProps extends Partial<ConnectProps> {
breadcrumbNameMap: {
[path: string]: MenuDataItem;
};
}
const UserLayout: React.FC<UserLayoutProps> = (props) => {
const {
route = {
routes: [],
},
} = props;
const { routes = [] } = route;
const {
children,
location = {
pathname: '',
},
} = props;
const { formatMessage } = useIntl();
const { breadcrumb } = getMenuData(routes);
const title = getPageTitle({
pathname: location.pathname,
formatMessage,
breadcrumb,
...props,
});
return (
<HelmetProvider>
{/* <Helmet>
<title>{title}</title>
<meta name="description" content={title} />
</Helmet>*/}
<div className={styles.container}>
{/* <div className={styles.lang}>
<SelectLang />
</div>*/}
<div className={styles.content}>
{/* <div className={styles.top}>
<div className={styles.header}>
<Link to="/">
<img alt="logo" className={styles.logo} src={logo} />
<span className={styles.title}>Ant Design</span>
</Link>
</div>
<div className={styles.desc}>Ant Design 是西湖区最具影响力的 Web 设计规范</div>
</div>*/}
{children}
</div>
{/* <DefaultFooter />*/}
</div>
</HelmetProvider>
);
};
export default connect(({ settings }: ConnectState) => ({ ...settings }))(UserLayout);
/*
import { DefaultFooter, MenuDataItem, getMenuData, getPageTitle } from '@ant-design/pro-layout';
import { Helmet, HelmetProvider } from 'react-helmet-async';
import { Link, useIntl, ConnectProps, connect } from 'umi';
import React from 'react';
import SelectLang from '@/components/SelectLang';
......@@ -49,3 +117,4 @@ const UserLayout: React.FC<UserLayoutProps> = (props) => {
};
export default connect(({ settings }: ConnectState) => ({ ...settings }))(UserLayout);
*/
......@@ -6,7 +6,7 @@ import settingDrawer from './zh-CN/settingDrawer';
import settings from './zh-CN/settings';
import R from './zh-CN/R';
import G from './zh-CN/G';
export default {
'navBar.lang': '语言',
'layout.user.link.help': '帮助',
......@@ -22,4 +22,5 @@ export default {
...pwa,
...component,
...R,
...G,
};
export default {
'R.charge.input.project': '所在小区',
'R.charge.input.nameofowner':'业主名称',
'R.charge.username': '业主名称',
'R.charge.project': '所在小区',
'R.charge.unit': '所在单元',
'R.charge.status': '状态',
'R.charge.submissionTime': '提交时间',
'R.charge.actions': '操作',
'R.charge.search': '搜索',
'R.charge.addaccount': '添加会计',
'R.charge.paymentsetting': '缴费设置',
'R.selectoptions.open': '展开',
'R.selectoptions.PutItAway':'收起',
'R.selectoptions.Selected':'已选',
'R.selectoptions.SelectNone': '全不选',
'R.selectoptions.all':'所有',
'R.selectoptions.SearchCell':'搜索小区',
};
......@@ -50,4 +50,26 @@ export default {
'menu.editor.mind': '脑图编辑器',
'menu.editor.koni': '拓扑编辑器',
'menu.monitorcenter':'监控中心',
'menu.Property Management':'物业费管理',
'menu.account.changePassword': '修改密碼',
'menu.accountReset':'账号管理',
'menu.User Management':'用户管理',
'menu.LIFE User Management':'LIFE用户管理',
'menu.Service Provider Management':'服务商管理',
'menu.Commercial Service':'物业服务',
"menu.Order Management":"订单管理",
"menu.Contract Management":"合同管理",
"menu.Community Management":"小区管理",
"menu.Account Management":"后台管理",
"menu.Commercial Service.Community Maintenance":"小区保养",
"menu.Commercial Service.Owners Complaints":"业主投诉",
"menu.Commercial Service.Problem Feedback":"问题反馈",
"menu.Commercial Service.Renovation Application":"装修申请",
"menu.Commercial Service.Access Card Application":"住户卡申请",
"menu.Commercial Service.Report Online":"在线报事",
"menu.Commercial Service.Shelf life Service":"保质期服务",
};
import { getAccount,delAccount,saveAccount,getAllLeader,checkAccountByName,quitAndUser } from '@/services/account';
export default{
namespace: 'accountModel',
state: {
data: [],
},
effects: {
*getAccount({callback,payload},{ call, put }) {
const response = yield call(getAccount,payload);
yield put({
type: "getUsers",
});
if(callback) callback(response);
},
*saveAccount({callback,payload},{ call, put }) {
const response = yield call(saveAccount,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*delAdccount({callback,payload},{ call, put }) {
const response = yield call(delAccount,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*getAllLeader({callback,payload},{ call, put }) {
const response = yield call(getAllLeader,payload);
yield put({
type: "allLeader",
});
if(callback) callback(response);
},
*checkAccountByName({callback,payload},{ call, put }) {
const response = yield call(checkAccountByName,payload);
yield put({
type: "checkUser",
});
if(callback) callback(response);
},
*quitAndUser({callback,payload},{ call, put }) {
const response = yield call(quitAndUser,payload);
yield put({
type: "quitUser",
});
if(callback) callback(response);
},
},
reducers: {
allLeader(state, action) {
return {
...state,
data:action.payload || {},
};
},
getUsers(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
checkUser(state, action) {
return {
...state,
data:action.payload || {},
};
},
quitUser(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAdvertisement,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/advertisement';
// @ts-ignore
export default{
namespace: 'adModel',
// namespace: 'advertisement',
state: {
data: [],
},
effects: {
*getAdvertisement({callback,payload},{ call, put }) {
const response = yield call(getAdvertisement,payload);
yield put({
type: "getAd",
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*saveAdvertisement({callback,payload},{ call, put }) {
const response = yield call(saveAdvertisement,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*quitAndUserAd({callback,payload},{ call, put }) {
const response = yield call(quitAndUserAd,payload);
yield put({
type: "quit",
});
if(callback) callback(response);
},
*uploadApk({callback,payload},{ call, put }) {
const response = yield call(uploadApk,payload);
yield put({
type: "apk",
});
if(callback) callback(response);
},
*checkVideo({callback,payload},{ call, put }) {
const response = yield call(checkVideo,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
getAd(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
quit(state, action) {
return {
...state,
data:action.payload || {},
};
},
apk(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import {
getAccount,
delAccount,
saveAccount,
getAllLeader,
checkAccountByName,
quitAndUser,
authorityList
} from '@/services/authorty';
import * as queryString from "querystring";
export default{
namespace: 'character',
state: {
data: [],
},
effects: {
*getAuthorityList({ payload }, { call, put, select }){
const { data } = yield call(authorityList, queryString.stringify(payload));
// if (data.result === 0)
if (1===1)
{
// window.toast(data.message);
// } else {
// let menuList=data.menu_list;
let menuList=[
{
"children": [
{
"children": [],
"hasChildren": false,
"is_admin": 1,
"menuid": 5,
"name": "组织架构",
"parentid": 1,
"sort": 10,
"state": "",
"is_checked": true
},
{
"children": [],
"hasChildren": false,
"is_admin": 1,
"menuid": 6,
"name": "员工管理",
"parentid": 1,
"sort": 20,
"state": "",
"is_checked": true
},
{
"children": [],
"hasChildren": false,
"is_admin": 1,
"menuid": 11,
"name": "角色管理",
"parentid": 1,
"sort": 30,
"state": "",
"is_checked": false
},
{
"children": [],
"hasChildren": false,
"is_admin": 1,
"menuid": 17,
"name": "企业设置",
"parentid": 1,
"sort": 2,
"state": "",
"is_checked": true
},
{
"children": [],
"hasChildren": false,
"is_admin": 1,
"menuid": 26,
"name": "员工管理",
"parentid": 1,
"sort": 1,
"state": "",
"is_checked": false
}
],
"hasChildren": true,
"is_admin": 1,
"menuid": 1,
"name": "企业",
"parentid": 0,
"sort": 20,
"state": "closed",
"is_checked": true
},
{
"children": [
{
"children": [],
"hasChildren": false,
"is_admin": 1,
"menuid": 12,
"name": "供应商订单",
"parentid": 4,
"sort": 10,
"state": "",
"is_checked": true
},
{
"children": [],
"hasChildren": false,
"is_admin": 1,
"menuid": 15,
"name": "供应商管理",
"parentid": 4,
"sort": 20,
"state": "",
"is_checked": false
},
{
"children": [],
"hasChildren": false,
"is_admin": 1,
"menuid": 16,
"name": "成为供应商",
"parentid": 4,
"sort": 30,
"state": "",
"is_checked": true
}
],
"hasChildren": true,
"is_admin": 1,
"menuid": 4,
"name": "供应商",
"parentid": 0,
"sort": 11,
"state": "closed",
"is_checked": true
}
];
let newList=[];
menuList.map((item,key)=> {
let checkAll=item.is_checked;
let checkAllId=item.menuid;
// let indeterminate=item.is_checked;
let checkedList=[];
let allListId=[];
if(item.hasChildren){
item.children.map((subItem,subKey)=> {
allListId.push(subItem.menuid)
if(subItem.is_checked){
checkedList.push(subItem.menuid)
}
})
}
let obj={
['checkAll'+key]:checkAll,
['checkAllId'+key]:checkAllId,
// ['indeterminate'+key]:!!checkedList.length && (checkedList.length < checkAll.length),
// ['plainOptions'+key]:plainOptions,
['checkedList'+key]:checkedList,
['allListId'+key]:allListId
};
newList.push(obj)
});
yield put({
type: 'updateState',
payload: {
authorityList: menuList,
newList: newList
}
});
}
} ,
*getAccount({callback,payload},{ call, put }) {
const response = yield call(getAccount,payload);
yield put({
type: "getUsers",
});
if(callback) callback(response);
},
*saveAccount({callback,payload},{ call, put }) {
const response = yield call(saveAccount,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*delAdccount({callback,payload},{ call, put }) {
const response = yield call(delAccount,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*getAllLeader({callback,payload},{ call, put }) {
const response = yield call(getAllLeader,payload);
yield put({
type: "allLeader",
});
if(callback) callback(response);
},
*checkAccountByName({callback,payload},{ call, put }) {
const response = yield call(checkAccountByName,payload);
yield put({
type: "checkUser",
});
if(callback) callback(response);
},
*quitAndUser({callback,payload},{ call, put }) {
const response = yield call(quitAndUser,payload);
yield put({
type: "quitUser",
});
if(callback) callback(response);
},
},
reducers: {
allLeader(state, action) {
return {
...state,
data:action.payload || {},
};
},
getUsers(state, action) {
return {
...state,
data:action.payload || {},
};
},
updateState(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
checkUser(state, action) {
return {
...state,
data:action.payload || {},
};
},
quitUser(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAdvertisement,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/banner';
export default{
namespace: 'bannerModel',
state: {
data: [],
},
effects: {
*getAdvertisement({callback,payload},{ call, put }) {
const response = yield call(getAdvertisement,payload);
yield put({
type: "getAd",
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*saveAdvertisement({callback,payload},{ call, put }) {
const response = yield call(saveAdvertisement,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*quitAndUserAd({callback,payload},{ call, put }) {
const response = yield call(quitAndUserAd,payload);
yield put({
type: "quit",
});
if(callback) callback(response);
},
*uploadApk({callback,payload},{ call, put }) {
const response = yield call(uploadApk,payload);
yield put({
type: "apk",
});
if(callback) callback(response);
},
*checkVideo({callback,payload},{ call, put }) {
const response = yield call(checkVideo,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
getAd(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
quit(state, action) {
return {
...state,
data:action.payload || {},
};
},
apk(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAllDevice,saveDevice,delDevice,getDeviceNum,importUserDeviceListExcel,
getUserDevice,saveUserDevice,getTargetKeys,getNewAdd,importUserListExcel,getDeviceDetails } from '@/services/communityNotice';
import { getRegion,getRegionList } from '@/services/region';
export default{
namespace: 'communityNoticeModel',
state: {
data: [],
},
effects: {
*getAllDevice({callback,payload},{ call, put }) {
const response = yield call(getAllDevice,payload);
yield put({
type: "getAll",
});
if(callback) callback(response);
},
*getRegion({callback,payload},{ call, put }) {
const response = yield call(getRegion,payload);
yield put({
type: "getRegions",
});
if(callback) callback(response);
},
*saveDevice({callback,payload},{ call, put }) {
const response = yield call(saveDevice,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*delDevice({callback,payload},{ call, put }) {
const response = yield call(delDevice,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*getRegionList({callback,payload},{ call, put }) {
const response = yield call(getRegionList,payload);
yield put({
type: "regionList",
});
if(callback) callback(response);
},
*getDeviceNum({callback,payload},{ call, put }) {
const response = yield call(getDeviceNum,payload);
yield put({
type: "num",
});
if(callback) callback(response);
},
*getUserDevice({callback,payload},{ call, put }) {
const response = yield call(getUserDevice,payload);
yield put({
type: "userDevice",
});
if(callback) callback(response);
},
*saveUserDevice({callback,payload},{ call, put }) {
const response = yield call(saveUserDevice,payload);
yield put({
type: "userDeviceSave",
});
if(callback) callback(response);
},
*getTargetKeys({callback,payload},{ call, put }) {
const response = yield call(getTargetKeys,payload);
yield put({
type: "targetKeys",
});
if(callback) callback(response);
},
*getNewAdd({callback,payload},{ call, put }) {
const response = yield call(getNewAdd,payload);
yield put({
type: "newAdd",
});
if(callback) callback(response);
},
*getNewAddBug({callback,payload},{ call, put }) {
const response = yield call(getNewAddBug,payload);
yield put({
type: "newAddBug",
});
if(callback) callback(response);
},
*importUserListExcel({callback,payload},{ call, put }) {
const response = yield call(importUserListExcel,payload);
yield put({
type: "importListExcel",
});
if(callback) callback(response);
},
*importUserDeviceListExcel({callback,payload},{ call, put }) {
const response = yield call(importUserDeviceListExcel,payload);
yield put({
type: "importDeviceListExcel",
});
if(callback) callback(response);
},
*getDeviceDetails({callback,payload},{ call, put }) {
const response = yield call(getDeviceDetails,payload);
yield put({
type: "deviceDetails",
});
if(callback) callback(response);
},
},
reducers: {
getAll(state, action) {
return {
...state,
data:action.payload || {},
};
},
getRegions(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
regionList(state, action) {
return {
...state,
data:action.payload || {},
};
},
num(state, action) {
return {
...state,
data:action.payload || {},
};
},
userDevice(state, action) {
return {
...state,
data:action.payload || {},
};
},
userDeviceSave(state, action) {
return {
...state,
data:action.payload || {},
};
},
targetKeys(state, action) {
return {
...state,
data:action.payload || {},
};
},
newAdd(state, action) {
return {
...state,
data:action.payload || {},
};
},
newAddBug(state, action) {
return {
...state,
data:action.payload || {},
};
},
importListExcel(state, action) {
return {
...state,
data:action.payload || {},
};
},
importDeviceListExcel(state, action) {
return {
...state,
data:action.payload || {},
};
},
deviceDetails(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAllDevice,saveDevice,delDevice,getDeviceNum,getNewAddBug,importUserDeviceListExcel,
getUserDevice,saveUserDevice,getNewAdd,importUserListExcel,getDeviceDetails } from '@/services/companyInformation';
import { getRegion,getRegionList } from '@/services/region';
export default{
namespace: 'companyInformationModel',
state: {
data: [],
},
effects: {
*getAllDevice({callback,payload},{ call, put }) {
const response = yield call(getAllDevice,payload);
yield put({
type: "getAll",
});
if(callback) callback(response);
},
*getRegion({callback,payload},{ call, put }) {
const response = yield call(getRegion,payload);
yield put({
type: "getRegions",
});
if(callback) callback(response);
},
*saveDevice({callback,payload},{ call, put }) {
const response = yield call(saveDevice,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*delDevice({callback,payload},{ call, put }) {
const response = yield call(delDevice,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*getRegionList({callback,payload},{ call, put }) {
const response = yield call(getRegionList,payload);
yield put({
type: "regionList",
});
if(callback) callback(response);
},
*getDeviceNum({callback,payload},{ call, put }) {
const response = yield call(getDeviceNum,payload);
yield put({
type: "num",
});
if(callback) callback(response);
},
*getUserDevice({callback,payload},{ call, put }) {
const response = yield call(getUserDevice,payload);
yield put({
type: "userDevice",
});
if(callback) callback(response);
},
*saveUserDevice({callback,payload},{ call, put }) {
const response = yield call(saveUserDevice,payload);
yield put({
type: "userDeviceSave",
});
if(callback) callback(response);
},
*getTargetKeys({callback,payload},{ call, put }) {
const response = yield call(getTargetKeys,payload);
yield put({
type: "targetKeys",
});
if(callback) callback(response);
},
*getNewAdd({callback,payload},{ call, put }) {
const response = yield call(getNewAdd,payload);
yield put({
type: "newAdd",
});
if(callback) callback(response);
},
*getNewAddBug({callback,payload},{ call, put }) {
const response = yield call(getNewAddBug,payload);
yield put({
type: "newAddBug",
});
if(callback) callback(response);
},
*importUserListExcel({callback,payload},{ call, put }) {
const response = yield call(importUserListExcel,payload);
yield put({
type: "importListExcel",
});
if(callback) callback(response);
},
*importUserDeviceListExcel({callback,payload},{ call, put }) {
const response = yield call(importUserDeviceListExcel,payload);
yield put({
type: "importDeviceListExcel",
});
if(callback) callback(response);
},
*getDeviceDetails({callback,payload},{ call, put }) {
const response = yield call(getDeviceDetails,payload);
yield put({
type: "deviceDetails",
});
if(callback) callback(response);
},
},
reducers: {
getAll(state, action) {
return {
...state,
data:action.payload || {},
};
},
getRegions(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
regionList(state, action) {
return {
...state,
data:action.payload || {},
};
},
num(state, action) {
return {
...state,
data:action.payload || {},
};
},
userDevice(state, action) {
return {
...state,
data:action.payload || {},
};
},
userDeviceSave(state, action) {
return {
...state,
data:action.payload || {},
};
},
targetKeys(state, action) {
return {
...state,
data:action.payload || {},
};
},
newAdd(state, action) {
return {
...state,
data:action.payload || {},
};
},
newAddBug(state, action) {
return {
...state,
data:action.payload || {},
};
},
importListExcel(state, action) {
return {
...state,
data:action.payload || {},
};
},
importDeviceListExcel(state, action) {
return {
...state,
data:action.payload || {},
};
},
deviceDetails(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAllDevice,saveDevice,delDevice,getDeviceNum,getNewAddBug,importUserDeviceListExcel,
getUserDevice,saveUserDevice,getTargetKeys,getNewAdd,importUserListExcel,getDeviceDetails } from '@/services/device';
import { getRegion,getRegionList } from '@/services/region';
export default{
namespace: 'deviceModel',
state: {
data: [],
},
effects: {
*getAllDevice({callback,payload},{ call, put }) {
const response = yield call(getAllDevice,payload);
yield put({
type: "getAll",
});
if(callback) callback(response);
},
*getRegion({callback,payload},{ call, put }) {
const response = yield call(getRegion,payload);
yield put({
type: "getRegions",
});
if(callback) callback(response);
},
*saveDevice({callback,payload},{ call, put }) {
const response = yield call(saveDevice,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*delDevice({callback,payload},{ call, put }) {
const response = yield call(delDevice,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*getRegionList({callback,payload},{ call, put }) {
const response = yield call(getRegionList,payload);
yield put({
type: "regionList",
});
if(callback) callback(response);
},
*getDeviceNum({callback,payload},{ call, put }) {
const response = yield call(getDeviceNum,payload);
yield put({
type: "num",
});
if(callback) callback(response);
},
*getUserDevice({callback,payload},{ call, put }) {
const response = yield call(getUserDevice,payload);
yield put({
type: "userDevice",
});
if(callback) callback(response);
},
*saveUserDevice({callback,payload},{ call, put }) {
const response = yield call(saveUserDevice,payload);
yield put({
type: "userDeviceSave",
});
if(callback) callback(response);
},
*getTargetKeys({callback,payload},{ call, put }) {
const response = yield call(getTargetKeys,payload);
yield put({
type: "targetKeys",
});
if(callback) callback(response);
},
*getNewAdd({callback,payload},{ call, put }) {
const response = yield call(getNewAdd,payload);
yield put({
type: "newAdd",
});
if(callback) callback(response);
},
*getNewAddBug({callback,payload},{ call, put }) {
const response = yield call(getNewAddBug,payload);
yield put({
type: "newAddBug",
});
if(callback) callback(response);
},
*importUserListExcel({callback,payload},{ call, put }) {
const response = yield call(importUserListExcel,payload);
yield put({
type: "importListExcel",
});
if(callback) callback(response);
},
*importUserDeviceListExcel({callback,payload},{ call, put }) {
const response = yield call(importUserDeviceListExcel,payload);
yield put({
type: "importDeviceListExcel",
});
if(callback) callback(response);
},
*getDeviceDetails({callback,payload},{ call, put }) {
const response = yield call(getDeviceDetails,payload);
yield put({
type: "deviceDetails",
});
if(callback) callback(response);
},
},
reducers: {
getAll(state, action) {
return {
...state,
data:action.payload || {},
};
},
getRegions(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
regionList(state, action) {
return {
...state,
data:action.payload || {},
};
},
num(state, action) {
return {
...state,
data:action.payload || {},
};
},
userDevice(state, action) {
return {
...state,
data:action.payload || {},
};
},
userDeviceSave(state, action) {
return {
...state,
data:action.payload || {},
};
},
targetKeys(state, action) {
return {
...state,
data:action.payload || {},
};
},
newAdd(state, action) {
return {
...state,
data:action.payload || {},
};
},
newAddBug(state, action) {
return {
...state,
data:action.payload || {},
};
},
importListExcel(state, action) {
return {
...state,
data:action.payload || {},
};
},
importDeviceListExcel(state, action) {
return {
...state,
data:action.payload || {},
};
},
deviceDetails(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAdvertisement,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/feedback';
export default{
namespace: 'feedbackModel',
state: {
data: [],
},
effects: {
*getAdvertisement({callback,payload},{ call, put }) {
const response = yield call(getAdvertisement,payload);
yield put({
type: "getAd",
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*saveAdvertisement({callback,payload},{ call, put }) {
const response = yield call(saveAdvertisement,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*quitAndUserAd({callback,payload},{ call, put }) {
const response = yield call(quitAndUserAd,payload);
yield put({
type: "quit",
});
if(callback) callback(response);
},
*uploadApk({callback,payload},{ call, put }) {
const response = yield call(uploadApk,payload);
yield put({
type: "apk",
});
if(callback) callback(response);
},
*checkVideo({callback,payload},{ call, put }) {
const response = yield call(checkVideo,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
getAd(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
quit(state, action) {
return {
...state,
data:action.payload || {},
};
},
apk(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAllDevice,saveDevice,delDevice,getDeviceNum,getNewAddBug,importUserDeviceListExcel,
getUserDevice,getTargetKeys,getNewAdd,importUserListExcel,getDeviceDetails } from '@/services/housingList';
import { getRegion,getRegionList } from '@/services/region';
export default{
namespace: 'housingListModel',
state: {
data: [],
},
effects: {
*getAllDevice({callback,payload},{ call, put }) {
const response = yield call(getAllDevice,payload);
yield put({
type: "getAll",
});
if(callback) callback(response);
},
*getRegion({callback,payload},{ call, put }) {
const response = yield call(getRegion,payload);
yield put({
type: "getRegions",
});
if(callback) callback(response);
},
*saveDevice({callback,payload},{ call, put }) {
const response = yield call(saveDevice,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*delDevice({callback,payload},{ call, put }) {
const response = yield call(delDevice,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*getRegionList({callback,payload},{ call, put }) {
const response = yield call(getRegionList,payload);
yield put({
type: "regionList",
});
if(callback) callback(response);
},
*getDeviceNum({callback,payload},{ call, put }) {
const response = yield call(getDeviceNum,payload);
yield put({
type: "num",
});
if(callback) callback(response);
},
*getUserDevice({callback,payload},{ call, put }) {
const response = yield call(getUserDevice,payload);
yield put({
type: "userDevice",
});
if(callback) callback(response);
},
*saveUserDevice({callback,payload},{ call, put }) {
const response = yield call(saveUserDevice,payload);
yield put({
type: "userDeviceSave",
});
if(callback) callback(response);
},
*getTargetKeys({callback,payload},{ call, put }) {
const response = yield call(getTargetKeys,payload);
yield put({
type: "targetKeys",
});
if(callback) callback(response);
},
*getNewAdd({callback,payload},{ call, put }) {
const response = yield call(getNewAdd,payload);
yield put({
type: "newAdd",
});
if(callback) callback(response);
},
*getNewAddBug({callback,payload},{ call, put }) {
const response = yield call(getNewAddBug,payload);
yield put({
type: "newAddBug",
});
if(callback) callback(response);
},
*importUserListExcel({callback,payload},{ call, put }) {
const response = yield call(importUserListExcel,payload);
yield put({
type: "importListExcel",
});
if(callback) callback(response);
},
*importUserDeviceListExcel({callback,payload},{ call, put }) {
const response = yield call(importUserDeviceListExcel,payload);
yield put({
type: "importDeviceListExcel",
});
if(callback) callback(response);
},
*getDeviceDetails({callback,payload},{ call, put }) {
const response = yield call(getDeviceDetails,payload);
yield put({
type: "deviceDetails",
});
if(callback) callback(response);
},
},
reducers: {
getAll(state, action) {
return {
...state,
data:action.payload || {},
};
},
getRegions(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
regionList(state, action) {
return {
...state,
data:action.payload || {},
};
},
num(state, action) {
return {
...state,
data:action.payload || {},
};
},
userDevice(state, action) {
return {
...state,
data:action.payload || {},
};
},
userDeviceSave(state, action) {
return {
...state,
data:action.payload || {},
};
},
targetKeys(state, action) {
return {
...state,
data:action.payload || {},
};
},
newAdd(state, action) {
return {
...state,
data:action.payload || {},
};
},
newAddBug(state, action) {
return {
...state,
data:action.payload || {},
};
},
importListExcel(state, action) {
return {
...state,
data:action.payload || {},
};
},
importDeviceListExcel(state, action) {
return {
...state,
data:action.payload || {},
};
},
deviceDetails(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAdvertisement,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/onlineNews';
export default{
namespace: 'onlineNewsModel',
state: {
data: [],
},
effects: {
*getAdvertisement({callback,payload},{ call, put }) {
const response = yield call(getAdvertisement,payload);
yield put({
type: "getAd",
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*saveAdvertisement({callback,payload},{ call, put }) {
const response = yield call(saveAdvertisement,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*quitAndUserAd({callback,payload},{ call, put }) {
const response = yield call(quitAndUserAd,payload);
yield put({
type: "quit",
});
if(callback) callback(response);
},
*uploadApk({callback,payload},{ call, put }) {
const response = yield call(uploadApk,payload);
yield put({
type: "apk",
});
if(callback) callback(response);
},
*checkVideo({callback,payload},{ call, put }) {
const response = yield call(checkVideo,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
getAd(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
quit(state, action) {
return {
...state,
data:action.payload || {},
};
},
apk(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAdvertisement,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/orderManagement';
export default{
namespace: 'orderManagementModel',
state: {
data: [],
},
effects: {
*getAdvertisement({callback,payload},{ call, put }) {
const response = yield call(getAdvertisement,payload);
yield put({
type: "getAd",
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*saveAdvertisement({callback,payload},{ call, put }) {
const response = yield call(saveAdvertisement,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*quitAndUserAd({callback,payload},{ call, put }) {
const response = yield call(quitAndUserAd,payload);
yield put({
type: "quit",
});
if(callback) callback(response);
},
*uploadApk({callback,payload},{ call, put }) {
const response = yield call(uploadApk,payload);
yield put({
type: "apk",
});
if(callback) callback(response);
},
*checkVideo({callback,payload},{ call, put }) {
const response = yield call(checkVideo,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
getAd(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
quit(state, action) {
return {
...state,
data:action.payload || {},
};
},
apk(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAdvertisement,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/owerCard';
export default{
namespace: 'owerCardModel',
state: {
data: [],
},
effects: {
*getAdvertisement({callback,payload},{ call, put }) {
const response = yield call(getAdvertisement,payload);
yield put({
type: "getAd",
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*saveAdvertisement({callback,payload},{ call, put }) {
const response = yield call(saveAdvertisement,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*quitAndUserAd({callback,payload},{ call, put }) {
const response = yield call(quitAndUserAd,payload);
yield put({
type: "quit",
});
if(callback) callback(response);
},
*uploadApk({callback,payload},{ call, put }) {
const response = yield call(uploadApk,payload);
yield put({
type: "apk",
});
if(callback) callback(response);
},
*checkVideo({callback,payload},{ call, put }) {
const response = yield call(checkVideo,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
getAd(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
quit(state, action) {
return {
...state,
data:action.payload || {},
};
},
apk(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAdvertisement,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/owerComplaint';
export default{
namespace: 'owerComplaintModel',
state: {
data: [],
},
effects: {
*getAdvertisement({callback,payload},{ call, put }) {
const response = yield call(getAdvertisement,payload);
yield put({
type: "getAd",
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*saveAdvertisement({callback,payload},{ call, put }) {
const response = yield call(saveAdvertisement,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*quitAndUserAd({callback,payload},{ call, put }) {
const response = yield call(quitAndUserAd,payload);
yield put({
type: "quit",
});
if(callback) callback(response);
},
*uploadApk({callback,payload},{ call, put }) {
const response = yield call(uploadApk,payload);
yield put({
type: "apk",
});
if(callback) callback(response);
},
*checkVideo({callback,payload},{ call, put }) {
const response = yield call(checkVideo,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
getAd(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
quit(state, action) {
return {
...state,
data:action.payload || {},
};
},
apk(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getPermission,savePermission,checkPermission } from '@/services/permission';
export default{
namespace: 'permissionModel',
state: {
data: [],
},
effects: {
*getAccountPermission({callback,payload},{ call, put }) {
const response = yield call(getPermission,payload);
yield put({
type: "get",
});
if(callback) callback(response);
},
*saveAccountPermission({callback,payload},{ call, put }) {
const response = yield call(savePermission,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*checkAccountPermission({callback,payload},{ call, put }) {
const response = yield call(checkPermission,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
get(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAdvertisement,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/tosBusiness';
export default{
namespace: 'propertyFeeModel',
state: {
data: [],
},
effects: {
*getAdvertisement({callback,payload},{ call, put }) {
const response = yield call(getAdvertisement,payload);
yield put({
type: "getAd",
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*saveAdvertisement({callback,payload},{ call, put }) {
const response = yield call(saveAdvertisement,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*quitAndUserAd({callback,payload},{ call, put }) {
const response = yield call(quitAndUserAd,payload);
yield put({
type: "quit",
});
if(callback) callback(response);
},
*uploadApk({callback,payload},{ call, put }) {
const response = yield call(uploadApk,payload);
yield put({
type: "apk",
});
if(callback) callback(response);
},
*checkVideo({callback,payload},{ call, put }) {
const response = yield call(checkVideo,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
getAd(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
quit(state, action) {
return {
...state,
data:action.payload || {},
};
},
apk(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAdvertisement,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/shelfLife';
export default{
namespace: 'shelfLifeModel',
state: {
data: [],
},
effects: {
*getAdvertisement({callback,payload},{ call, put }) {
const response = yield call(getAdvertisement,payload);
yield put({
type: "getAd",
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*saveAdvertisement({callback,payload},{ call, put }) {
const response = yield call(saveAdvertisement,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*quitAndUserAd({callback,payload},{ call, put }) {
const response = yield call(quitAndUserAd,payload);
yield put({
type: "quit",
});
if(callback) callback(response);
},
*uploadApk({callback,payload},{ call, put }) {
const response = yield call(uploadApk,payload);
yield put({
type: "apk",
});
if(callback) callback(response);
},
*checkVideo({callback,payload},{ call, put }) {
const response = yield call(checkVideo,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
getAd(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
quit(state, action) {
return {
...state,
data:action.payload || {},
};
},
apk(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAdvertisement,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/tosBusiness';
export default{
namespace: 'tosBusinessModel',
state: {
data: [],
},
effects: {
*getAdvertisement({callback,payload},{ call, put }) {
const response = yield call(getAdvertisement,payload);
yield put({
type: "getAd",
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*saveAdvertisement({callback,payload},{ call, put }) {
const response = yield call(saveAdvertisement,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*quitAndUserAd({callback,payload},{ call, put }) {
const response = yield call(quitAndUserAd,payload);
yield put({
type: "quit",
});
if(callback) callback(response);
},
*uploadApk({callback,payload},{ call, put }) {
const response = yield call(uploadApk,payload);
yield put({
type: "apk",
});
if(callback) callback(response);
},
*checkVideo({callback,payload},{ call, put }) {
const response = yield call(checkVideo,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
getAd(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
quit(state, action) {
return {
...state,
data:action.payload || {},
};
},
apk(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAdvertisement,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/tosDecoration';
export default{
namespace: 'tosDecorationModel',
state: {
data: [],
},
effects: {
*getAdvertisement({callback,payload},{ call, put }) {
const response = yield call(getAdvertisement,payload);
yield put({
type: "getAd",
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*saveAdvertisement({callback,payload},{ call, put }) {
const response = yield call(saveAdvertisement,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*quitAndUserAd({callback,payload},{ call, put }) {
const response = yield call(quitAndUserAd,payload);
yield put({
type: "quit",
});
if(callback) callback(response);
},
*uploadApk({callback,payload},{ call, put }) {
const response = yield call(uploadApk,payload);
yield put({
type: "apk",
});
if(callback) callback(response);
},
*checkVideo({callback,payload},{ call, put }) {
const response = yield call(checkVideo,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
getAd(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
quit(state, action) {
return {
...state,
data:action.payload || {},
};
},
apk(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getAdvertisement,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/tosMaintain';
export default{
namespace: 'tosMaintainModel',
state: {
data: [],
},
effects: {
*getAdvertisement({callback,payload},{ call, put }) {
const response = yield call(getAdvertisement,payload);
yield put({
type: "getAd",
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*saveAdvertisement({callback,payload},{ call, put }) {
const response = yield call(saveAdvertisement,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*quitAndUserAd({callback,payload},{ call, put }) {
const response = yield call(quitAndUserAd,payload);
yield put({
type: "quit",
});
if(callback) callback(response);
},
*uploadApk({callback,payload},{ call, put }) {
const response = yield call(uploadApk,payload);
yield put({
type: "apk",
});
if(callback) callback(response);
},
*checkVideo({callback,payload},{ call, put }) {
const response = yield call(checkVideo,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
getAd(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
quit(state, action) {
return {
...state,
data:action.payload || {},
};
},
apk(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { getTosUser,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/tosUser';
import { Effect, Reducer } from 'umi';
export default{
namespace: 'tUModel',
state: {
data: [],
},
effects: {
*getTosUser({callback,payload},{ call, put }) {
const response = yield call(getTosUser,payload);
yield put({
type: "get",
payload: response,
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*saveAdvertisement({callback,payload},{ call, put }) {
const response = yield call(saveAdvertisement,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*quitAndUserAd({callback,payload},{ call, put }) {
const response = yield call(quitAndUserAd,payload);
yield put({
type: "quit",
});
if(callback) callback(response);
},
*uploadApk({callback,payload},{ call, put }) {
const response = yield call(uploadApk,payload);
yield put({
type: "apk",
});
if(callback) callback(response);
},
*checkVideo({callback,payload},{ call, put }) {
const response = yield call(checkVideo,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
queryList(state, action) {
return {
...state,
list: action.payload, //更新state中的数据
}
},
get(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
quit(state, action) {
return {
...state,
data:action.payload || {},
};
},
apk(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import { Effect, Reducer } from 'umi';
import { queryCurrent, query as queryUsers,checkUserPw,checkUserName } from '@/services/user';
export interface CurrentUser {
avatar?: string;
name?: string;
title?: string;
group?: string;
signature?: string;
tags?: {
key: string;
label: string;
}[];
userid?: string;
unreadCount?: number;
}
export interface UserModelState {
currentUser?: CurrentUser;
}
export interface UserModelType {
namespace: 'user';
state: UserModelState;
effects: {
fetch: Effect;
fetchCurrent: Effect;
};
reducers: {
saveCurrentUser: Reducer<UserModelState>;
changeNotifyCount: Reducer<UserModelState>;
};
}
const UserModel: UserModelType = {
namespace: 'user',
state: {
currentUser: {},
},
effects: {
*fetch(_, { call, put }) {
const response = yield call(queryUsers);
yield put({
type: 'save',
payload: response,
});
},
*fetchCurrent(_, { call, put }) {
const response = yield call(queryCurrent);
yield put({
type: 'saveCurrentUser',
payload: response,
});
},
*checkUserName({callback,payload},{ call, put }) {
const response = yield call(checkUserName,payload);
yield put({
type: "userName",
});
if(callback) callback(response);
},
*checkUserPw({callback,payload},{ call, put }) {
const response = yield call(checkUserPw,payload);
yield put({
type: "userPw",
});
if(callback) callback(response);
},
},
reducers: {
userName(state, action) {
return {
...state,
data:action.payload || {},
};
},
userPw(state, action) {
return {
...state,
data:action.payload || {},
};
},
saveCurrentUser(state, action) {
return {
...state,
currentUser: action.payload || {},
};
},
changeNotifyCount(
state = {
currentUser: {},
},
action,
) {
return {
...state,
currentUser: {
...state.currentUser,
notifyCount: action.payload.totalCount,
unreadCount: action.payload.unreadCount,
},
};
},
},
};
export default UserModel;
/*
import { Effect, Reducer } from 'umi';
import { queryCurrent, query as queryUsers } from '@/services/user';
export interface CurrentUser {
......@@ -83,3 +197,4 @@ const UserModel: UserModelType = {
};
export default UserModel;
*/
import { getVersion,delVersion,saveVersion } from '@/services/version';
export default{
namespace: 'versionModel',
state: {
data: [],
},
effects: {
*getVersion({callback,payload},{ call, put }) {
const response = yield call(getVersion,payload);
yield put({
type: "getVersions",
});
if(callback) callback(response);
},
*saveVersion({callback,payload},{ call, put }) {
const response = yield call(saveVersion,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*delVersion({callback,payload},{ call, put }) {
const response = yield call(delVersion,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
},
reducers: {
getVersions(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
};
import { getAdvertisement,delAdvertisement,saveAdvertisement,quitAndUserAd,uploadApk,checkVideo } from '@/services/visitorRecord';
export default{
namespace: 'visitorRecordModel',
state: {
data: [],
},
effects: {
*getAdvertisement({callback,payload},{ call, put }) {
const response = yield call(getAdvertisement,payload);
yield put({
type: "getAd",
});
if(callback) callback(response);
},
*delAdvertisement({callback,payload},{ call, put }) {
const response = yield call(delAdvertisement,payload);
yield put({
type: "del",
});
if(callback) callback(response);
},
*saveAdvertisement({callback,payload},{ call, put }) {
const response = yield call(saveAdvertisement,payload);
yield put({
type: "save",
});
if(callback) callback(response);
},
*quitAndUserAd({callback,payload},{ call, put }) {
const response = yield call(quitAndUserAd,payload);
yield put({
type: "quit",
});
if(callback) callback(response);
},
*uploadApk({callback,payload},{ call, put }) {
const response = yield call(uploadApk,payload);
yield put({
type: "apk",
});
if(callback) callback(response);
},
*checkVideo({callback,payload},{ call, put }) {
const response = yield call(checkVideo,payload);
yield put({
type: "check",
});
if(callback) callback(response);
},
},
reducers: {
getAd(state, action) {
return {
...state,
data:action.payload || {},
};
},
del(state, action) {
return {
...state,
data:action.payload || {},
};
},
save(state, action) {
return {
...state,
data:action.payload || {},
};
},
quit(state, action) {
return {
...state,
data:action.payload || {},
};
},
apk(state, action) {
return {
...state,
data:action.payload || {},
};
},
check(state, action) {
return {
...state,
data:action.payload || {},
};
},
},
};
import {getWarn, getWarnRecord, delWarn, delWarnRecord, saveWarn,quitAndUserWarn,checkWarnByUserID} from '@/services/warn';
export default {
namespace: 'warnModel',
state: {
data: [],
},
effects: {
* getWarn({callback, payload}, {call, put}) {
const response = yield call(getWarn, payload);
yield put({
type: "getWarns",
});
if (callback) callback(response);
},
* getWarnRecord({callback, payload}, {call, put}) {
const response = yield call(getWarnRecord, payload);
yield put({
type: "getWarnRecords",
});
if (callback) callback(response);
},
* delWarn({callback, payload}, {call, put}) {
const response = yield call(delWarn, payload);
yield put({
type: "del",
});
if (callback) callback(response);
},
* delWarnRecord({callback, payload}, {call, put}) {
const response = yield call(delWarnRecord, payload);
yield put({
type: "delRecord",
});
if (callback) callback(response);
},
* saveWarn({callback, payload}, {call, put}) {
const response = yield call(saveWarn, payload);
yield put({
type: "save",
});
if (callback) callback(response);
},
*quitAndUserWarn({callback, payload}, {call, put}) {
const response = yield call(quitAndUserWarn, payload);
yield put({
type: "quit",
});
if (callback) callback(response);
},
*checkWarnByUserID({callback, payload}, {call, put}) {
const response = yield call(checkWarnByUserID, payload);
yield put({
type: "checkWarn",
});
if (callback) callback(response);
},
},
reducers: {
getWarns(state, action) {
return {
...state,
data: action.payload || {},
};
},
getWarnRecords(state, action) {
return {
...state,
data: action.payload || {},
};
},
del(state, action) {
return {
...state,
data: action.payload || {},
};
},
delRecord(state, action) {
return {
...state,
data: action.payload || {},
};
},
save(state, action) {
return {
...state,
data: action.payload || {},
};
},
quit(state, action) {
return {
...state,
data: action.payload || {},
};
},
checkWarn(state, action) {
return {
...state,
data: action.payload || {},
};
},
},
};
import React from 'react';
import { HeartTwoTone, SmileTwoTone } from '@ant-design/icons';
import { Card, Typography, Alert } from 'antd';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
export default (): React.ReactNode => (
<PageHeaderWrapper content=" 这个页面只有 admin 权限才能查看">
<Card>
<Alert
message="umi ui 现已发布,欢迎使用 npm run ui 启动体验。"
type="success"
showIcon
banner
style={{
margin: -12,
marginBottom: 48,
}}
/>
<Typography.Title level={2} style={{ textAlign: 'center' }}>
<SmileTwoTone /> Ant Design Pro <HeartTwoTone twoToneColor="#eb2f96" /> You
</Typography.Title>
</Card>
<p style={{ textAlign: 'center', marginTop: 24 }}>
Want to add more pages? Please refer to{' '}
<a href="https://pro.ant.design/docs/block-cn" target="_blank" rel="noopener noreferrer">
use block
</a>
</p>
</PageHeaderWrapper>
);
This diff is collapsed.
@import '~antd/lib/style/themes/default.less';
.pre {
margin: 12px 0;
padding: 12px 20px;
background: @input-bg;
box-shadow: @card-shadow;
}
.input {
width:200px;
height:34px;
border:1px solid rgba(229, 229, 229, 1);
border-radius:5px;
margin: 0px 10px;
}
.input1 {
width:200px;
height:34px;
border:1px solid rgba(229, 229, 229, 1);
border-radius:5px;
margin: 0px 120px 10px;
}
.body {
background:rgba(255,255,255,1);
border:1px solid rgba(229, 229, 229, 1);
}
.inputBox {
width:1250px;
height:50px;
padding-top: 10px;
}
.downIcon {
position: relative;
left: 80px;
}
.downButton {
width:120px;
height:34px;
border:1px solid rgba(229, 229, 229, 1);
border-radius:5px;
margin: 0px 10px;
text-align: left;
}
.button11 {
width:82px;
height:34px;
background:rgba(234,244,255,1);
border:1px solid rgba(178, 215, 255, 1);
font-size:14px;
font-family:PingFang SC;
font-weight:400;
color:rgba(66,159,255,1);
line-height:34px;
margin:20px 20px 7px 10px;
float: left;
}
.button1 {
width:150px;
height:34px;
background:rgba(234,244,255,1);
border:1px solid rgba(178, 215, 255, 1);
font-size:14px;
font-family:PingFang SC;
font-weight:400;
color:rgba(66,159,255,1);
line-height:34px;
margin: 7px 10px;
float: right;
}
.button2 {
width:150px;
height:34px;
background:rgba(24,144,255,1);
border-radius:4px;
font-size:14px;
font-family:PingFang SC;
font-weight:400;
color:rgba(255,255,255,1);
line-height:34px;
margin: 7px 10px;
float: left;
}
.button3 {
position: relative;
bottom: 52px;
width:72px;
height:32px;
background:rgba(255,255,255,1);
border:1px solid rgba(229, 229, 229, 1);
border-radius:4px;
margin: 10px 10px;
}
.table {
margin-right: 10px;
}
.detailsTitle {
display: inline-block;
font-size:18px;
font-family:PingFang SC;
font-weight:400;
color:rgba(73,73,73,1);
margin: 0px 30px;
}
.detailsContent {
display: inline-block;
font-size:15px;
width: 100px;
font-family:PingFang SC;
font-weight:400;
color:rgba(153,153,153,1);
margin: 10px 10px;
}
.detailsContent2 {
display: inline-block;
font-size:18px;
width: 200px;
font-family:PingFang SC;
font-weight:400;
color:rgba(51,51,51,1);
}
.detailsBox {
border-top: 1px solid rgba(229, 229, 229, 1);
margin: 10px 30px;
}
.font1 {
.detailsContent {
font-family:PingFang SC;
font-weight:400;
color:rgba(153,153,153,1);
margin: 5px 10px;
}
.backBox{
border: 1px solid rgb(0, 12, 23);
font-size: 2em;
margin: 50px ;
background: #1153ff;
}
.allCheckbox{
}
.subCheckbox{
}
}
This diff is collapsed.
@import '~antd/lib/style/themes/default.less';
.pre {
margin: 12px 0;
padding: 12px 20px;
background: @input-bg;
box-shadow: @card-shadow;
}
.input {
width:200px;
height:34px;
border:1px solid rgba(229, 229, 229, 1);
border-radius:5px;
margin: 0px 10px;
}
.input1 {
width:200px;
height:34px;
border:1px solid rgba(229, 229, 229, 1);
border-radius:5px;
margin: 0px 120px 10px;
}
.body {
background:rgba(255,255,255,1);
border:1px solid rgba(229, 229, 229, 1);
}
.inputBox {
width:1250px;
height:50px;
padding-top: 10px;
}
.downIcon {
position: relative;
left: 80px;
}
.downButton {
width:120px;
height:34px;
border:1px solid rgba(229, 229, 229, 1);
border-radius:5px;
margin: 0px 10px;
text-align: left;
}
.button11 {
width:82px;
height:34px;
background:rgba(234,244,255,1);
border:1px solid rgba(178, 215, 255, 1);
font-size:14px;
font-family:PingFang SC;
font-weight:400;
color:rgba(66,159,255,1);
line-height:34px;
margin:20px 20px 7px 10px;
float: left;
}
.button1 {
width:150px;
height:34px;
background:rgba(234,244,255,1);
border:1px solid rgba(178, 215, 255, 1);
font-size:14px;
font-family:PingFang SC;
font-weight:400;
color:rgba(66,159,255,1);
line-height:34px;
margin: 7px 10px;
float: right;
}
.button2 {
width:150px;
height:34px;
background:rgba(24,144,255,1);
border-radius:4px;
font-size:14px;
font-family:PingFang SC;
font-weight:400;
color:rgba(255,255,255,1);
line-height:34px;
margin: 7px 10px;
float: left;
}
.button3 {
position: relative;
bottom: 52px;
width:72px;
height:32px;
background:rgba(255,255,255,1);
border:1px solid rgba(229, 229, 229, 1);
border-radius:4px;
margin: 10px 10px;
}
.table {
margin-right: 10px;
}
.detailsTitle {
display: inline-block;
font-size:18px;
font-family:PingFang SC;
font-weight:400;
color:rgba(73,73,73,1);
margin: 0px 30px;
}
.detailsContent {
display: inline-block;
font-size:15px;
width: 100px;
font-family:PingFang SC;
font-weight:400;
color:rgba(153,153,153,1);
margin: 10px 10px;
}
.detailsContent2 {
display: inline-block;
font-size:18px;
width: 200px;
font-family:PingFang SC;
font-weight:400;
color:rgba(51,51,51,1);
}
.detailsBox {
border-top: 1px solid rgba(229, 229, 229, 1);
margin: 10px 30px;
}
.font1 {
.detailsContent {
font-family:PingFang SC;
font-weight:400;
color:rgba(153,153,153,1);
margin: 5px 10px;
}
.backBox{
border: 1px solid rgb(0, 12, 23);
font-size: 2em;
margin: 50px ;
background: #1153ff;
}
.allCheckbox{
}
.subCheckbox{
}
}
@import '~antd/lib/style/themes/default.less';
.pre {
margin: 12px 0;
padding: 12px 20px;
background: @input-bg;
box-shadow: @card-shadow;
}
import React from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import { Card, Alert, Typography } from 'antd';
import styles from './Welcome.less';
const CodePreview: React.FC<{}> = ({ children }) => (
<pre className={styles.pre}>
<code>
<Typography.Text copyable>{children}</Typography.Text>
</code>
</pre>
);
export default (): React.ReactNode => (
<PageContainer>
<Card>
<Alert
message="更快更强的重型组件,已经发布。"
type="success"
showIcon
banner
style={{
margin: -12,
marginBottom: 24,
}}
/>
<Typography.Text strong>
高级表格{' '}
<a href="https://protable.ant.design/" rel="noopener noreferrer" target="__blank">
欢迎使用
</a>
</Typography.Text>
<CodePreview>yarn add @ant-design/pro-table</CodePreview>
<Typography.Text
strong
style={{
marginBottom: 12,
}}
>
高级布局{' '}
<a href="https://prolayout.ant.design/" rel="noopener noreferrer" target="__blank">
欢迎使用
</a>
</Typography.Text>
<CodePreview>yarn add @ant-design/pro-layout</CodePreview>
</Card>
</PageContainer>
);
This diff is collapsed.
This diff is collapsed.
import React from 'react';
import {connect,routerRedux} from 'dva';
import {Button, Input} from "antd";
import styles from './style.less';
import {ConnectState} from "@/models/connect";
// import {router} from "umi";
class AccountReset extends React.Component {
//构造
constructor(props) {
super(props);
this.state = {
pw: '',
pw2: '',
newPw: '',
}
}
/*----------------- 方法集 ------------------*/
//跳转到账户页面
back = () => {
this.props.dispatch(routerRedux.push({
pathname: '/account',
}))
};
//两次密码校对
checkPw = () => {
if (this.state.pw == '') {
alert("未输入原密码!");
return;
}
if (this.state.pw2 == '') {
alert("未再次输入密码!");
return;
}
if (this.state.pw != this.state.pw2) {
alert("两次输入的原始密码不同!");
return;
} else if (this.state.newPw != ''){
this.checkUserPw();
}else{
alert("未输入新密码!");
return;
}
};
//检测密码
checkUserPw = () => {
const params = {
username: this.props.currentUser.name,
password: this.state.pw,
};
this.props.dispatch({
type: 'user/checkUserPw',
payload: params,
callback: (res) => {
if (res) {
if(res.error_code=="0000"){
this.handleOk();
}else if(res.error_code == "0001"){
alert(res.error_msg);
}else{
alert("密码校验失败!未知错误!")
}
}
}
});
};
handleOk = () => {
const params = {
userStatus: 1,//暂时写死
userID: this.props.currentUser.userid,
userPassword: this.state.newPw,
oneself: 1,
// userAccount: this.props.currentUser.name,
};
this.props.dispatch({
type: 'accountModel/saveAccount',
payload: params,
callback: (res) => {
console.log(res);
if (res.error_code == "0000") {
alert(res.error_msg);
this.back();
} else if (res.error_code == "0001") {
alert(res.error_msg);
this.back();
} else if (res.error_code == "0002"){
alert(res.error_msg);
} else if(res.error_code == "0008"){
alert(res.error_msg);
window.location.href = '/';
router.replace('/');
} else {
alert("提交失败!未知错误!");
}
}
});
};
//密码变更
pwChange = (e) => {
this.setState({pw: e.target.value});
};
//确认密码变更
pwChange2 = (e) => {
this.setState({pw2: e.target.value});
};
//新密码变更
newPwChange = (e) => {
this.setState({newPw: e.target.value});
};
//提交
onSubmit = () => {
this.checkPw();
};
//初始化
componentDidMount() {}
/*--------------------------------------*/
//渲染
render() {
const {} = this.state;
return (
<div className={styles.body}>
<div style={{marginTop: 48}}>
<div className={styles.detailsBox}>
<div>
<span className={styles.detailsContent}>原始密码</span>
<Input.Password className={styles.input}
onChange={(e) => this.pwChange(e)}/>
</div>
<div>
<span className={styles.detailsContent}>新密码</span>
<Input.Password className={styles.input}
onChange={(e) => this.newPwChange(e)}/>
</div>
<div>
<span className={styles.detailsContent}>重复密码</span>
<Input.Password className={styles.input}
onChange={(e) => this.pwChange2(e)}/>
</div>
<div>
<Button className={styles.button1} onClick={() => this.onSubmit()}>提交</Button>
<Button className={styles.button1} onClick={() => this.back()}>返回</Button>
</div>
</div>
</div>
</div>
);
}
}
export default connect(({user}: ConnectState) => ({
currentUser: user.currentUser,
}))(AccountReset);
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.
@import '~antd/lib/style/themes/default.less';
//基石
.base {
width: 100%;
background-color: #ffffff;
padding: 34px;
min-width: 1020px;
}
.box{
margin-bottom: 28px;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import React from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
export default () => (
<PageHeaderWrapper>
<h1>hello world</h1>
</PageHeaderWrapper>
);
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