init: UserBaseFront (frontend)

This commit is contained in:
chenxing
2026-08-10 14:41:13 +08:00
commit eea881b616
174 changed files with 32833 additions and 0 deletions
+141
View File
@@ -0,0 +1,141 @@
/**
* 公共类型
*/
export declare interface IObj {
[key: string]: any;
}
export declare interface PageParams {
page: !number;
count: !number;
[keys: string]: any; //任意属性
}
export declare interface PageData {
list: T;
total: number;
[keys: string]: any; //任意属性
}
interface RelayConf {
ziyuankuHost: string; //资源库
zhuanxiangHost: string; //专项
}
/* 系统配置 */
export interface BaseConf {
baseHost: string;
ssoHost: string;
serviceHost: string;
relayConf: RelayConf;
isMock: Boolean;
isDebug?: Boolean;
[keys: string]: any; //任意属性
}
/* PC端角色 */
export interface PcDebugUser {
DebugUser: string;
AppType: string;
// yschapirequest: number;
}
/* webapp端角色 */
export declare interface WappDebugUser {
ticket: string;
schoolId: Number;
userId: Number;
roleId: Number;
}
export declare interface CurrentRole {
childId: number | null;
roleId: number;
schId: number;
userId: number;
}
export interface layoutData {
appName: String;
appList: string[];
modList: Array<string>;
userInfo: Object;
ssoHost: String;
baseHost: String;
isAlone: Boolean; //是否只有一个选项卡
}
export interface BaseDict {
k: any;
v: string | null;
[keys: string]: any; //任意属性
}
/* 计算表格高度的参数类型 */
export interface UseTableSetting {
/** 是否有查询面板 */
isSearch: boolean = true;
/** 是否有分页 */
isPage: boolean = true;
/** 是否是tabs布局 */
isTabs: boolean = false;
/** 是否有按钮操作 */
isOperat: boolean = true;
/** 额外的高度 */
otherH: number = 0;
}
/* 布局组件类型 */
export interface LayoutData {
appName: string | null;
appList: Array<any>;
modList: Array<any>;
userInfo: any;
ssoHost: string | null;
baseHost: string | null;
isAlone: boolean;
}
/* 自定义弹出对话框 */
export interface MyConfirm {
title?: string;
msg: string;
info?: string;
isLoading?: boolean;
confirmText?: string;
closeText?: string;
onOk?: Function;
onCancel?: Function;
}
export declare enum NODE_ENV {
/**
*开发环境
*/
development = "development",
/**
*生产环境
*/
production = "production",
}
export const _: any;
export const $: any;
declare global {
const $: any;
const _: any;
}
import Utils from "@/utils/index";
import mittBus from '@/utils/mitt'
import MyConfirm from "@/components/MyConfirm";
export interface VueGlobal {
$conf: BaseConf;
$bus: typeof mittBus;
$utils: typeof Utils;
$echarts: echarts;
[key:string]:any;
}
+6
View File
@@ -0,0 +1,6 @@
/** 节点类型 */
export enum NodeEnum {
Root = 1,
Group,
Item,
}
+134
View File
@@ -0,0 +1,134 @@
import { BaseDict } from "./Basics";
export enum OperatorEnum {
add,
del,
edit,
sel,
}
export enum UserRoleEnum {
SuperAdmin = 1,
School,
}
//学段
export enum SchoolStage {
PRIMARY = 2,
MIDDLE,
HIGH,
}
export const SchoolStageDict: BaseDict[] = [
{
k: SchoolStage.PRIMARY,
v: "小学",
},
{
k: SchoolStage.MIDDLE,
v: "初中",
},
{
k: SchoolStage.HIGH,
v: "高中",
},
];
export enum RootNode {
/** 资源 */
ZIYUANKU = 1,
/** 辅导 */
TUTORING = 2,
/** 题库 */
QUESTION = 3,
/** 试卷 */
SHIJUAN = 4,
/** 专项 */
ZHUANXIANG = 5,
}
export const RootNodeDict: BaseDict[] = [
{
k: RootNode.ZIYUANKU,
v: "资源",
path: "ziyuan",
},
{
k: RootNode.TUTORING,
v: "辅导",
path: "fudao",
},
{
k: RootNode.QUESTION,
v: "题库",
path: "tiku",
},
{
k: RootNode.SHIJUAN,
v: "试卷",
path: "shijuan",
},
{
k: RootNode.ZHUANXIANG,
v: "专项",
path: "zhuanxiang",
},
];
export enum BooxType {
/** 教材 */
TextBook = 1,
/** 教辅 */
TeachingTutoring,
}
export const BooxTypeDict: BaseDict[] = [
{
k: BooxType.TextBook,
v: "教材",
},
{
k: BooxType.TeachingTutoring,
v: "教辅",
},
];
//学校学段学制
export interface SchLenLevel {
stage: SchoolStage;
name: string;
grades: LenGrade[];
}
export interface LenGrade {
gradeId: number;
gradeName: string;
stage: number;
}
export interface AcademicYear {
year: number;
semester: number | null;
name: string;
}
export interface Subject {
id: number;
tenantId: number;
baseId: null;
creatorId: number;
createDate: string;
name: string;
code: string;
orderNum: number;
alias: string;
stage: number;
enable: boolean;
disabled: boolean;
}
/**
* 1 积分详情
* 2 分数详情
*/
export type ScoreModalType = 1 | 2;
+10
View File
@@ -0,0 +1,10 @@
declare global {
interface Apis {
OperationLog: {
list(config: any): any;
download(config: any): any;
};
}
}
export {};
+13
View File
@@ -0,0 +1,13 @@
/**
* @description 扩展ruoter-meta的类型 此处必须要export {} 不然找不到类型
*/
declare module "vue-router" {
interface RouteMeta {
title?: string;
icon?: string;
modId?: number;
parentId?: number;
}
}
export {};
+13
View File
@@ -0,0 +1,13 @@
import Vue, { VNode } from "vue";
declare global {
namespace JSX {
// tslint:disable no-empty-interface
interface Element extends VNode {}
// tslint:disable no-empty-interface
interface ElementClass extends Vue {}
interface IntrinsicElements {
[elem: string]: any;
}
}
}
+5
View File
@@ -0,0 +1,5 @@
declare module "*.vue" {
import { DefineComponent } from "vue";
const component: DefineComponent<{}, {}, any>;
export default component;
}