first commit
This commit is contained in:
68
陈海波/投标平台/admin_v2/src/application/logic/Base.logic.ts
Normal file
68
陈海波/投标平台/admin_v2/src/application/logic/Base.logic.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
import {Vue} from "vue-property-decorator";
|
||||
import { Inject } from "@ann/Ioc.annotation";
|
||||
import { DepartmentServiceImpl } from "@impl/Department.service.impl";
|
||||
import { UserServiceImpl } from "@impl/User.service.impl";
|
||||
|
||||
export interface KeyParams {
|
||||
[ key: string ] : any
|
||||
}
|
||||
|
||||
// VueType 继承 Vue,实现对全局方法的类型定义
|
||||
export interface VueType extends Vue {
|
||||
$setToken: (token: string) => void
|
||||
$formatDate: (data: number) => string
|
||||
$isLogin: () => void
|
||||
$DateToString: (date: Date, fmt?: string) => string
|
||||
SetLeftMenu: (arg: any)=> any;
|
||||
}
|
||||
|
||||
export interface Methods {
|
||||
StartUp(): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 基础逻辑父类
|
||||
*/
|
||||
export class BaseLogic {
|
||||
|
||||
@Inject()
|
||||
public readonly DepartmentServiceImpl!: DepartmentServiceImpl;
|
||||
|
||||
@Inject()
|
||||
public readonly UserServiceImpl!: UserServiceImpl;
|
||||
|
||||
// 保存table点击后的那行对象
|
||||
public clickCurrent!: KeyParams;
|
||||
// 保存Vue对象
|
||||
protected VueApp!: VueType;
|
||||
// $refs 类型
|
||||
protected $refs!: any;
|
||||
protected $confirm!: any;
|
||||
protected $message!: any;
|
||||
// 请求的总页数
|
||||
public TotalCount!: string;
|
||||
// 请求参数
|
||||
protected PageParams: { limit: number, page: number } = {
|
||||
limit: 10, page: 1
|
||||
}
|
||||
|
||||
// 保存部门列表的数据
|
||||
public DepartmentList: KeyParams[] = [];
|
||||
public DepartRoleList: KeyParams[] = [];
|
||||
public SaveUserInfo: KeyParams = {};
|
||||
/**
|
||||
* 【公共多次被用到的接口】获取部门列表
|
||||
* @constructor
|
||||
*/
|
||||
public async DepartmentListRequest(): Promise<void> {
|
||||
this.DepartmentList = await this.DepartmentServiceImpl.DepartmentList({});
|
||||
}
|
||||
|
||||
public async GetDepartRole(params:Object = {}): Promise<void> {
|
||||
this.DepartRoleList = await this.DepartmentServiceImpl.GetDepartRole(params);
|
||||
}
|
||||
|
||||
public async GetUserInfo() {
|
||||
this.SaveUserInfo = await this.UserServiceImpl.GetUserInfo({});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user