调整了template中的内容
This commit is contained in:
parent
1d4c5af807
commit
7d465f87c3
|
|
@ -27,12 +27,6 @@ export async function renameProject(dir: string, name: string, title: string, pl
|
||||||
const newHtmlContent = htmlContent.replace(new RegExp(placeholderTitle, 'g'), title).replace(new RegExp(placeholderTitle.toLowerCase(), 'g'), title.toLowerCase());
|
const newHtmlContent = htmlContent.replace(new RegExp(placeholderTitle, 'g'), title).replace(new RegExp(placeholderTitle.toLowerCase(), 'g'), title.toLowerCase());
|
||||||
writeFileSync(htmlFilePath, newHtmlContent, 'utf-8');
|
writeFileSync(htmlFilePath, newHtmlContent, 'utf-8');
|
||||||
|
|
||||||
// index.tsx下的title
|
|
||||||
const indexTsxPath = join(dir, 'web', 'src/index.tsx');
|
|
||||||
const tsxContent = readFileSync(indexTsxPath, 'utf-8');
|
|
||||||
const newTsxlContent = tsxContent.replace(new RegExp(placeholderName, 'g'), name).replace(new RegExp(placeholderName.toLowerCase(), 'g'), name.toLowerCase());
|
|
||||||
writeFileSync(indexTsxPath, newTsxlContent, 'utf-8');
|
|
||||||
|
|
||||||
// replace wechatMp下project.config.json中的projectname
|
// replace wechatMp下project.config.json中的projectname
|
||||||
// todo,现在这个是在wechatMp/src目录下的,可能是搞错了,待修正
|
// todo,现在这个是在wechatMp/src目录下的,可能是搞错了,待修正
|
||||||
const pcjFilePath = join(dir, 'wechatMp', 'src', 'project.config.json');
|
const pcjFilePath = join(dir, 'wechatMp', 'src', 'project.config.json');
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
export default OakComponent({});
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
edit components/login/index.xml
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
.container {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
.container {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { WebComponentProps } from 'oak-frontend-base';
|
||||||
|
import { EntityDict } from '@project/oak-app-domain';
|
||||||
|
import Styles from './web.pc.module.less';
|
||||||
|
|
||||||
|
export default function render(props: WebComponentProps<EntityDict, 'user', false>) {
|
||||||
|
const { t, navigateTo } = props.methods;
|
||||||
|
return (
|
||||||
|
<div className={Styles.container}>
|
||||||
|
edit src/components/login/web.pc.tsx
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { ErrorBlock, Space } from 'antd-mobile';
|
||||||
|
import Styles from './web.module.less';
|
||||||
|
|
||||||
|
export default function render() {
|
||||||
|
return (
|
||||||
|
<div className={Styles.container}>
|
||||||
|
edit src/components/login/web.tsx
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
export default OakComponent({});
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"notFound": "页面不存在",
|
||||||
|
"desc": "本页面路由并不存在,请合法访问",
|
||||||
|
"back": "回首页"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
.container {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
.container {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { WebComponentProps } from 'oak-frontend-base';
|
||||||
|
import { EntityDict } from '@project/oak-app-domain';
|
||||||
|
import Styles from './web.pc.module.less';
|
||||||
|
|
||||||
|
export default function render(props: WebComponentProps<EntityDict, 'user', false>) {
|
||||||
|
const { t, navigateTo } = props.methods;
|
||||||
|
return (
|
||||||
|
<div className={Styles.container}>
|
||||||
|
edit src/pages/home/web.pc.tsx
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { ErrorBlock, Space } from 'antd-mobile';
|
||||||
|
import Styles from './web.module.less';
|
||||||
|
|
||||||
|
export default function render() {
|
||||||
|
return (
|
||||||
|
<div className={Styles.container}>
|
||||||
|
edit src/pages/home/web.tsx
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"enablePullDownRefresh": false,
|
||||||
|
"usingComponents": {
|
||||||
|
"login": "@project/components/login/index"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
export default OakComponent({
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
<login
|
||||||
|
oakPath="$$login"
|
||||||
|
/>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"pageTitle": "登录"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
.container {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
.container {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 22px;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
import React from 'react';
|
||||||
|
import Login from '@project/components/login';
|
||||||
|
import Styles from './pc.module.less';
|
||||||
|
|
||||||
|
export default function Render() {
|
||||||
|
return (
|
||||||
|
<div className={Styles.container}>
|
||||||
|
<Login />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
import React from 'react';
|
||||||
|
import Login from '@project/components/login';
|
||||||
|
import Styles from './pc.module.less';
|
||||||
|
|
||||||
|
export default function Render() {
|
||||||
|
return (
|
||||||
|
<div className={Styles.container}>
|
||||||
|
<Login />
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
export default OakComponent({});
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"notFound": "页面不存在",
|
||||||
|
"desc": "本页面路由并不存在,请合法访问",
|
||||||
|
"back": "回首页"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
.container {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
.container {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { Button, Result } from 'antd';
|
||||||
|
import { WebComponentProps } from 'oak-frontend-base';
|
||||||
|
import { EntityDict } from '@project/oak-app-domain';
|
||||||
|
import Styles from './web.pc.module.less';
|
||||||
|
|
||||||
|
export default function render(props: WebComponentProps<EntityDict, 'user', false>) {
|
||||||
|
const { t, navigateTo } = props.methods;
|
||||||
|
return (
|
||||||
|
<div className={Styles.container}>
|
||||||
|
<Result
|
||||||
|
status="404"
|
||||||
|
title={t('notFound')}
|
||||||
|
subTitle={t('desc')}
|
||||||
|
extra={
|
||||||
|
<Button
|
||||||
|
type="primary"
|
||||||
|
onClick={() => navigateTo({
|
||||||
|
url: '/',
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
{t('back')}
|
||||||
|
</Button>
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
import React from 'react';
|
||||||
|
import { ErrorBlock, Space } from 'antd-mobile';
|
||||||
|
import Styles from './web.module.less';
|
||||||
|
|
||||||
|
export default function render() {
|
||||||
|
return (
|
||||||
|
<div className={Styles.container}>
|
||||||
|
<ErrorBlock status='empty' />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -29,18 +29,15 @@ export default function render() {
|
||||||
className={Styles.logo}
|
className={Styles.logo}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
features.navigator.namespace = "";
|
features.navigator.namespace = "";
|
||||||
features.navigator.navigateTo({
|
features.navigator.navigateTo(
|
||||||
url: "/home",
|
{
|
||||||
});
|
url: "/",
|
||||||
|
},
|
||||||
|
undefined,
|
||||||
|
true
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{/* <img
|
|
||||||
src={
|
|
||||||
require("../../../../assets/logos/whistler.svg")
|
|
||||||
.default
|
|
||||||
}
|
|
||||||
className={Styles.img}
|
|
||||||
/> */}
|
|
||||||
<div className={Styles.name}>
|
<div className={Styles.name}>
|
||||||
{features.locales.t('common::name')}
|
{features.locales.t('common::name')}
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -72,27 +69,27 @@ export default function render() {
|
||||||
</Button>
|
</Button>
|
||||||
<ConsoleAvatar />
|
<ConsoleAvatar />
|
||||||
</div>
|
</div>
|
||||||
<Modal
|
<Modal
|
||||||
open={open}
|
open={open}
|
||||||
onCancel={() => setOpen(false)}
|
onCancel={() => setOpen(false)}
|
||||||
destroyOnClose={true}
|
destroyOnClose={true}
|
||||||
footer={
|
footer={
|
||||||
<Button
|
<Button
|
||||||
type='primary'
|
type='primary'
|
||||||
onClick={() => setOpen(false)}
|
onClick={() => setOpen(false)}
|
||||||
>
|
>
|
||||||
{features.locales.t('close')}
|
{features.locales.t('close')}
|
||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
closeIcon={null}
|
closeIcon={null}
|
||||||
>
|
>
|
||||||
<ConsoleSwitch
|
<ConsoleSwitch
|
||||||
oakPath="$consoleSwitch"
|
oakPath="$consoleSwitch"
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
setOpen(false)
|
setOpen(false)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.logo {
|
.logo {
|
||||||
width: 160px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,18 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Layout } from 'antd';
|
|
||||||
import Style from './index.module.less';
|
import Style from './index.module.less';
|
||||||
import useFeatures from '@project/hooks/useFeatures';
|
import useFeatures from '@project/hooks/useFeatures';
|
||||||
|
|
||||||
const { Footer } = Layout;
|
|
||||||
|
|
||||||
export default function Render() {
|
export default function Render() {
|
||||||
|
|
||||||
const features = useFeatures();
|
const features = useFeatures();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Footer className={Style.footer}>
|
<div className={Style.panel}>
|
||||||
<div className={Style.panel}>
|
<span>
|
||||||
<span>
|
Copyright © {new Date().getFullYear()}{' '}
|
||||||
Copyright © {new Date().getFullYear()}{' '}
|
{features.locales.t('copyright')}
|
||||||
{features.locales.t('copyright')}
|
</span>
|
||||||
</span>
|
</div>
|
||||||
</div>
|
|
||||||
</Footer>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,4 @@
|
||||||
export default OakComponent({
|
export default OakComponent({
|
||||||
isList: false,
|
isList: false,
|
||||||
formData({ features }) {
|
|
||||||
return {
|
|
||||||
loggedIn: '',
|
|
||||||
avatar: '',
|
|
||||||
modeTitle: '控制台',
|
|
||||||
};
|
|
||||||
},
|
|
||||||
features: ['console'],
|
features: ['console'],
|
||||||
})
|
})
|
||||||
|
|
@ -1 +1,3 @@
|
||||||
{"name":"Oak模板项目", "close": "关闭","modeUnset": "取消设置"}
|
{
|
||||||
|
"console": "控制台"
|
||||||
|
}
|
||||||
|
|
@ -9,7 +9,10 @@
|
||||||
|
|
||||||
.home {
|
.home {
|
||||||
font-size: 22px;
|
font-size: 22px;
|
||||||
font-weight: bold;
|
font-weight: bolder;
|
||||||
|
color: var(--oak-color-primary);
|
||||||
|
margin-left: 15px;
|
||||||
|
font-family: 中文黑体;
|
||||||
}
|
}
|
||||||
|
|
||||||
.right{
|
.right{
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,7 @@ export default function Render(props: WebComponentProps<
|
||||||
modeTitle?: string;
|
modeTitle?: string;
|
||||||
}
|
}
|
||||||
>) {
|
>) {
|
||||||
const { modeTitle, avatar } = props.data;
|
|
||||||
const { t, navigateTo } = props.methods;
|
const { t, navigateTo } = props.methods;
|
||||||
const location = useLocation();
|
|
||||||
const [open, setOpen] = useState(false);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row className={Styles.header}>
|
<Row className={Styles.header}>
|
||||||
|
|
@ -31,26 +28,27 @@ export default function Render(props: WebComponentProps<
|
||||||
{
|
{
|
||||||
url: '/',
|
url: '/',
|
||||||
},
|
},
|
||||||
undefined,
|
|
||||||
true
|
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div className={Styles.home}>
|
<div className={Styles.home}>
|
||||||
{t('name')}
|
{t('common::name')}
|
||||||
</div>
|
</div>
|
||||||
</Button>
|
</Button>
|
||||||
<div className={Styles.right}>
|
<div className={Styles.right}>
|
||||||
<Button
|
<Button
|
||||||
icon={<DownOutlined />}
|
type="text"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setOpen(true);
|
navigateTo(
|
||||||
}}
|
{
|
||||||
style={{
|
url: '/console',
|
||||||
marginRight: 8,
|
},
|
||||||
|
undefined,
|
||||||
|
true
|
||||||
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{modeTitle || t('modeUnset')}
|
{t('console')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
"path": "/",
|
"path": "/",
|
||||||
"first": "/"
|
"first": "/home",
|
||||||
|
"notFound": "/result/notFound"
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
export default OakComponent({});
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"console": "控制台"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
.container {
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
|
||||||
|
.content {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
padding: 22px;
|
||||||
|
background-color: var(--oak-bg-color-component);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
.container {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.header {
|
||||||
|
background-color: var(--oak-bg-color-container);
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
background-color: var(--oak-bg-color-page);
|
||||||
|
padding: 2px 140px;
|
||||||
|
|
||||||
|
.page {
|
||||||
|
background-color: var(--oak-bg-color-container);
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
background-color: var(--oak-bg-color-container);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { Flex, Layout } from 'antd';
|
||||||
|
import Styles from './web.pc.module.less';
|
||||||
|
|
||||||
|
const { Header, Footer, Content } = Layout;
|
||||||
|
import { Outlet, Route } from 'react-router-dom';
|
||||||
|
import FrontHeader from '../../components/header';
|
||||||
|
import FrontFooter from '../../components/footer';
|
||||||
|
|
||||||
|
export default function render() {
|
||||||
|
return (
|
||||||
|
<Layout className={Styles.container}>
|
||||||
|
<Header className={Styles.header}>
|
||||||
|
<FrontHeader />
|
||||||
|
</Header>
|
||||||
|
<Content className={Styles.content}>
|
||||||
|
<div className={Styles.page}>
|
||||||
|
<Outlet />
|
||||||
|
</div>
|
||||||
|
</Content>
|
||||||
|
<Footer className={Styles.footer}>
|
||||||
|
<FrontFooter />
|
||||||
|
</Footer>
|
||||||
|
</Layout>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
|
||||||
|
import React from 'react';
|
||||||
|
import { Outlet, Route } from 'react-router-dom';
|
||||||
|
import FrontHeader from '../../components/header';
|
||||||
|
import FrontFooter from '../../components/footer';
|
||||||
|
import Styles from './web.module.less';
|
||||||
|
|
||||||
|
export default function render() {
|
||||||
|
return (
|
||||||
|
<div className={Styles.container}>
|
||||||
|
<FrontHeader />
|
||||||
|
<div className={Styles.content}>
|
||||||
|
<Outlet />
|
||||||
|
</div>
|
||||||
|
<div className={Styles.footer}>
|
||||||
|
<FrontFooter />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -34,7 +34,7 @@ const init = async () => {
|
||||||
error = err;
|
error = err;
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize<EntityDict>(features, 'oak_template', routers, undefined, error);
|
initialize<EntityDict>(features, 'bm-smart', routers, undefined, error);
|
||||||
};
|
};
|
||||||
|
|
||||||
init();
|
init();
|
||||||
Loading…
Reference in New Issue