feat:初始化 -融骅

This commit is contained in:
2023-10-17 09:15:30 +08:00
parent c9ff84e6a2
commit 405e152b38
1190 changed files with 138344 additions and 455 deletions

7
front/types/env.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
interface ImportMetaEnv {
readonly VITE_APP_BASE_URL: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}

2
front/types/index.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
import './prototype'
import './vue'

49
front/types/prototype.d.ts vendored Normal file
View File

@@ -0,0 +1,49 @@
interface String {
/**
* 通过字符串,获取对象的值
*/
fetchValue({ }): any
/**
* 将带点的字符串,转换成嵌套对象
*
* @param value
*/
resolveObject(value: any): {}
/**
* 转换为文件地址
*/
fileLinkTransfer(): string?
}
interface File {
/**
* 转换为文件地址
*/
fileLinkTransfer(): string?
}
interface Number {
/**
* 格式化为文件大小单位结尾的字符串
*
* @param fractionDigits
*/
formatFileSize(fractionDigits:number): string
}
interface Date {
/**
* 格式化日期
*
* @param fmt 日期格式: yyyy-MM-dd hh:mm:ss
*/
format(fmt: string): string
}
interface Array {
/**
* 数组转 tree
*/
toTree(): { map: {}, tree: [] }
}

145
front/types/vue.d.ts vendored Normal file
View File

@@ -0,0 +1,145 @@
declare module '*.vue' {
import Vue from vue
export default Vue
}
import VueRouter, { Route } from 'vue-router'
declare module 'vue/types/vue' {
interface Vue {
/**
* 全局 store
*/
$store: Store;
}
}
interface Task {
name: string;
type: string;
file: File;
size: number;
/**
* 上传状态
*
* 0 未上传;
* 1 上传中;
* 2 上传成功;
* 3 上传失败;
*/
status: 0 | 1 | 2 | 3;
progress: number;
}
interface Store {
user?: User;
/**
* 首页统计 tab active值
*/
statistic_tab_active: number;
/**
* 上传资源弹窗
*/
upload_dialog: {
visible: false;
tasks: Array<Task>
},
/**
* 资源预览弹窗
*/
resource_preview_dialog: {
visible: false;
resource: Object
},
/**
* 设置用户信息
*
* @param user
*/
setUser(user: User): void;
/**
* 设置token信息
*
* @param token
*/
setToken(token: string): void;
/**
* 上传文件
*/
upload(): Promise;
/**
* 显示上传弹窗
*/
showUploadDialog(): void;
/**
* 显示资源预览弹窗
*/
showResourcePreviewDialog(resource:Object): void;
}
interface User {
/**
* 用户 ID
*/
id: string;
/**
* 用户名
*/
username: string;
/**
* 密码
*/
password: string;
/**
* 姓名
*/
name: string;
/**
* 照片对应resource表的ID
*/
photo: number;
/**
* 性别0/女1/男
*/
sex: number;
/**
* 出生年月
*/
birthday: Date;
/**
* 身份证号
*/
idcard: string;
/**
* 职位
*/
identity: string;
/**
* 电话
*/
phone: string;
/**
* 邮箱
*/
email: string;
/**
* 角色 ID
*/
roleId: number;
/**
* 组织机构 ID
*/
orgId: number;
/**
* 多级组织机构 ID
*/
orgIds: string;
}