93 lines
2.1 KiB
JavaScript
93 lines
2.1 KiB
JavaScript
module.exports = {
|
|
pageConfig: (name) => {
|
|
return `
|
|
import "@pageLess/${name}.less";
|
|
import { Component, Vue } from 'vue-property-decorator';
|
|
import { ${name}Logic } from "@logic/page/${name}.logic";
|
|
import { Route, RawLocation } from 'vue-router';
|
|
import { BaseLayout, RouterMeta } from "@layout/base.layout";
|
|
|
|
@Component
|
|
export default class ${name} extends BaseLayout {
|
|
private service: ${name}Logic = new ${name}Logic(this);
|
|
private RouterMeta: RouterMeta = {
|
|
title: '${name}',
|
|
showNav: true,
|
|
isLogin: true
|
|
};
|
|
|
|
created() {
|
|
this.service.StartUp();
|
|
};
|
|
|
|
// 路由拦截器
|
|
beforeRouteEnter(to: Route, from: Route, next: (to?: RawLocation | false | ((vm: Vue) => void)) => void) {
|
|
next();
|
|
}
|
|
|
|
protected render() {
|
|
return (
|
|
<div class="${name}">
|
|
${name}
|
|
</div>
|
|
)
|
|
}
|
|
}
|
|
`
|
|
},
|
|
logicConfig: (name) => {
|
|
return `
|
|
import { BaseLogic, VueType, Methods } from "@logic/Base.logic";
|
|
import { Inject } from "@ann/Ioc.annotation";
|
|
import { UserServiceImpl } from "@impl/User.service.impl";
|
|
import { Vue } from "vue-property-decorator";
|
|
import { MessageBox } from 'element-ui';
|
|
|
|
export class ${name}Logic extends BaseLogic implements Methods {
|
|
|
|
@Inject()
|
|
public readonly UserServiceImpl!: UserServiceImpl;
|
|
|
|
constructor(point: any) {
|
|
super();
|
|
this.VueApp = point;
|
|
}
|
|
|
|
public async StartUp(): Promise<void> {
|
|
|
|
}
|
|
}
|
|
`
|
|
},
|
|
serviceConfig: (name) => {
|
|
return `
|
|
export interface ${name}Service {
|
|
IndexClass(params: object): Promise<any>;
|
|
}
|
|
`
|
|
},
|
|
implPathConfig: (name) => {
|
|
return`
|
|
import { ${name}Service } from "@service/${name}.service";
|
|
import { Injectable } from "@ann/Ioc.annotation";
|
|
import { GET } from "@ann/Http.annotation";
|
|
|
|
@Injectable()
|
|
export class ${name}ServiceImpl implements ${name}Service {
|
|
|
|
@GET({ useHandle: false })
|
|
public async IndexClass(params: object): Promise<any> { }
|
|
|
|
}
|
|
`
|
|
},
|
|
lessConfig: (name) => {
|
|
return `
|
|
@import "../color/index";
|
|
@import "../mixin/index";
|
|
.${name} {
|
|
}
|
|
`
|
|
}
|
|
}
|