init local code

This commit is contained in:
chenxing
2026-09-07 09:11:37 +08:00
commit a3a75c3680
112 changed files with 24837 additions and 0 deletions
+140
View File
@@ -0,0 +1,140 @@
/**
* 公共类型
*/
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;
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;
}
+261
View File
@@ -0,0 +1,261 @@
/**
* CMS 后端契约类型(与 com.yunhai.cms.model 一一对应,方案 §9.2 API 清单)。
* 统一响应由 alova 封装解包:{code, msg, data} → code==0 返回 data。
*/
/* ===== 登录态 ===== */
/** 当前角色(平台 BoaRoleInfo) */
export interface CurrentRole {
roleId?: number;
roleName?: string;
schId?: number;
schName?: string;
}
/** GET /api/auth/user 返回 */
export interface AuthUserInfo {
account: string;
name: string;
currentRole?: CurrentRole;
superAdmin: boolean;
roleIds?: number[];
}
/** 站点(SiteVo) */
export interface SiteVo {
id: number;
code: string;
/** 上级站点ID(0=顶层校站点;院系子站挂主站 id) */
parentSiteId?: number;
/** 上级站点名称(列表展示用,服务端装配) */
parentName?: string;
schId?: number;
schName?: string;
name: string;
theme?: string;
/** 站点配置 JSON 原文(logo/联系方式/页脚/domain/public_base_url) */
configJson?: string;
status: number;
createTime?: string;
}
/** layout 使用的当前站点精简态 */
export interface CurrentSite {
id: number;
code: string;
name: string;
}
/** 学校上下文精简态(docs/09 §3.3:学校卡片 = 顶层站点,URL 段用主站编码) */
export interface CurrentSchool {
schId?: number;
schName?: string;
mainSiteId: number;
mainSiteCode: string;
mainSiteName: string;
}
/** 学校工作台卡片(SchoolVo) */
export interface SchoolCard {
schId?: number;
schName?: string;
mainSiteId: number;
mainSiteCode: string;
mainSiteName: string;
theme?: string;
siteCount: number;
articleCount: number;
status: number;
}
/** UserBase 学校选项(添加学校选择器) */
export interface SchoolOption {
id: number;
name: string;
}
/* ===== 栏目 ===== */
/** 栏目树节点(CategoryTreeNode) */
export interface CategoryTreeNode {
id?: number;
parentId: number;
siteId?: number;
name: string;
/** 1=文章列表 2=单页 3=外链 */
type: number;
linkUrl?: string;
template?: string;
/** 单页内容(type=2) */
content?: string;
sortNo: number;
seoTitle?: string;
seoDescription?: string;
status: number;
children: CategoryTreeNode[];
}
/* ===== 文章 ===== */
/** 文章分页行(ArticlePageItem) */
export interface ArticlePageItem {
id: number;
siteId: number;
categoryId: number;
categoryName?: string;
title: string;
summary?: string;
coverImage?: string;
/** 0=草稿 1=已发布 2=已下架 */
status: number;
topmost: number;
publishTime?: string;
offlineTime?: string;
viewCount: number;
createTime?: string;
createBy?: string;
}
/** 文章编辑回显(ArticleEditVo) */
export interface ArticleEditVo {
id: number;
siteId: number;
categoryId: number;
title: string;
summary?: string;
content?: string;
coverImage?: string;
authorName?: string;
source?: string;
status: number;
topmost: number;
publishTime?: string;
offlineTime?: string;
extJson?: string;
}
/** 文章保存入参(ArticleSaveRequest) */
export interface ArticleSaveRequest {
id?: number;
siteId: number;
categoryId: number;
title: string;
summary?: string;
content?: string;
coverImage?: string;
authorName?: string;
source?: string;
topmost?: number;
/** 定时发布时间(空=不指定) */
publishTime?: string;
offlineTime?: string;
/** 微信预留开关(本期后端不消费) */
syncWechat?: boolean;
/** 本次编辑上传的附件 id */
attachmentIds?: number[];
}
/** 文章分页查询(ArticlePageQuery) */
export interface ArticlePageQuery {
siteId: number;
categoryId?: number;
status?: number;
keyword?: string;
page?: number;
pageSize?: number;
}
/* ===== 附件 ===== */
/** 附件(AttachmentVo) */
export interface AttachmentVo {
id: number;
siteId: number;
articleId?: number;
fileName: string;
url: string;
fileSize?: number;
mimeType?: string;
createTime?: string;
orphan: boolean;
}
/* ===== 轮播 ===== */
/** 轮播(BannerVo) */
export interface BannerVo {
id?: number;
siteId: number;
position: string;
title: string;
imageUrl: string;
/** 1=文章 2=栏目 3=外链 */
linkType: number;
linkValue?: string;
sortNo: number;
startTime?: string;
endTime?: string;
status: number;
}
/* ===== 友链 ===== */
/** 友链(LinkVo) */
export interface LinkVo {
id?: number;
siteId: number;
groupName: string;
name: string;
logoUrl?: string;
linkUrl: string;
sortNo: number;
status: number;
}
/* ===== 通用 ===== */
/** 删除入参(DeleteRequest) */
export interface DeleteRequest {
id: number;
siteId: number;
}
/** 后端分页包装 {total, list} */
export interface PageResult<T> {
total: number;
list: T[];
}
/* ===== 主题 ===== */
/** theme.json 可调参数选项(select 类型) */
export interface ThemeParamOption {
value: string;
label: string;
}
/** 主题包参数 schema(ThemeParam) */
export interface ThemeParamVo {
key: string;
/** 聚合进 :root{} 的 CSS 变量名(仅 color 类型有) */
cssVar?: string;
label: string;
/** color / image / select / text */
type: string;
defaultValue?: string;
options?: ThemeParamOption[];
}
/** 主题包(ThemeVo,GET /api/theme/list) */
export interface ThemeVo {
name: string;
title: string;
description?: string;
version?: string;
author?: string;
bannerSize?: string;
/** 预览图(管理端资产代理 /api/theme/{name}/asset/screenshot.png) */
screenshotUrl: string;
params: ThemeParamVo[];
}
+5
View File
@@ -0,0 +1,5 @@
declare module "*.vue" {
import { DefineComponent } from "vue";
const component: DefineComponent<{}, {}, any>;
export default component;
}