first commit
This commit is contained in:
1
moehu/moehu_admin/bin/config/.pydio
Normal file
1
moehu/moehu_admin/bin/config/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
540faacb-8c40-430c-858c-b9cd6218e349
|
||||
94
moehu/moehu_admin/bin/config/index.js
Normal file
94
moehu/moehu_admin/bin/config/index.js
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Copyright (c) 2020. bmy
|
||||
*/
|
||||
|
||||
module.exports = {
|
||||
pageConfig: (name) => {
|
||||
return `
|
||||
import "@pageLess/${ name }.less";
|
||||
import { Component } from 'vue-property-decorator';
|
||||
import { ${ name }Logic } from "@logic/page/${ name }.logic";
|
||||
import { RouterMeta, VueCustomize } from "@logic/Base.type";
|
||||
import { Route, RawLocation } from 'vue-router';
|
||||
|
||||
@Component
|
||||
export default class ${ name } extends VueCustomize {
|
||||
private logic: ${ name }Logic<${ name }> = new ${ name }Logic(this);
|
||||
private RouterMeta: RouterMeta = {
|
||||
title: '${ name }',
|
||||
isLogin: true
|
||||
};
|
||||
|
||||
public async created() {
|
||||
await this.logic.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 } from "@logic/Base.logic";
|
||||
import { Autowired } from "@ann/Ioc.annotation";
|
||||
import { Methods, VueCustomize } from "@logic/Base.type";
|
||||
import { UserServiceImpl } from "@impl/User.service.impl";
|
||||
|
||||
export class ${ name }Logic<T extends VueCustomize> extends BaseLogic implements Methods {
|
||||
|
||||
@Autowired
|
||||
public readonly UserServiceImpl!: UserServiceImpl;
|
||||
|
||||
constructor(_: T) {
|
||||
super();
|
||||
this._ = _;
|
||||
}
|
||||
|
||||
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 "../mixin/index";
|
||||
|
||||
.${ name } {
|
||||
}
|
||||
`
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user