角色管理

This commit is contained in:
zjl
2021-10-03 21:14:13 +08:00
parent 94d899dfc4
commit 58892dea40
28 changed files with 514 additions and 210 deletions
+9
View File
@@ -0,0 +1,9 @@
export default interface HitokotoModel {
_id: string
hitokoto: string
type: string
from: string
creator: string
created_at: Date
number: number
}
+35
View File
@@ -0,0 +1,35 @@
export interface MusicModel {
_id: string
name: string // 文件名
ext: string // 扩展名
md5?: string // md5哈希值
size: number // 文件大小
title?: string // 标题
album?: string // 唱片集
artist?: string // 艺术家
lib_id: string // 歌单ID
lyric_id: string // 歌词ID
}
export interface MusicLibModel {
_id: string
name: string // 歌单名称
path: string // 歌单文件路径
}
export interface MusicLyricModel {
_id?: string
cloud_id?: number
name?: string
lyric?: string
}
export interface MusicPlayerItem {
id: number
name: string
artist: string
album: string
url: string
cover: string
lrc: string | undefined
}
+9
View File
@@ -0,0 +1,9 @@
export default interface PhotoWallModel {
_id: string
name: string // 图片文件名
md5: string // 文件md5哈希值
thumbnail: string // 缩略图名称
width: number // 宽度
height: number // 高度
index: number // 序号
}
+17
View File
@@ -0,0 +1,17 @@
export interface SourceImageModel {
_id: string
mime: string // MIME类型
hash: string // 图片md5值
size: number // 图片大小
label: string[] // 图片标签
img: ArrayBuffer // 图片二进制数据
created_at: Date
}
/**
* 图片标签
*/
export interface ImageLabel {
name: string // 标签名称
color: string // 标签颜色
}
+65
View File
@@ -0,0 +1,65 @@
import { Vue } from 'vue-class-component'
import { Page } from './common.dto'
import moment from 'moment'
export default abstract class BaseList<T extends Page> extends Vue {
/**
* 表格数据加载中
*/
protected loading: boolean = false
/**
* 表单提交中
*/
protected modalLoading: boolean = true
/**
* 数据总数
*/
protected total: number = 0
protected abstract search: T
/**
* 加载数据的实现
*/
abstract loadData(): Promise<void>
/**
* 加载数据
* @param resetPage 是否重置页码
*/
loadDataBase(resetPage: boolean = false): void {
if(resetPage) {
this.search.pageNum = 1
}
this.loadData()
}
/**
* 重置搜索项
*/
reset() {
this.search.reset()
this.loadData()
}
/**
* 页码变更
* @param pageNum 页码
*/
pageChange(pageNum: number) {
this.search.pageNum = pageNum
this.loadData()
}
/**
* 每页数据条数变更
* @param pageSize 每页数据条数
*/
pageSizeChange(pageSize: number) {
this.search.limit = pageSize
this.loadData()
}
/**
* 日期时间格式化
* @param dateStr 日期时间
*/
datetimeFormat(dateStr: string) {
return moment(dateStr).format('YYYY-MM-DD HH:mm:ss')
}
}
+21
View File
@@ -0,0 +1,21 @@
export interface MsgResult {
status: boolean
message: string
}
/**
* 分页查询基础类
*/
export class Page {
// 页码
pageNum: number = 1
// 每页数据条数
limit: number = 10
/**
* 重置分页
*/
public reset() {
this.pageNum = 1
this.limit = 10
}
}
+34
View File
@@ -0,0 +1,34 @@
// import { CreateElement, VNode } from 'vue'
export interface ArticleModel {
_id: string
path: string[] // 访问路径
categories: string[] //分类
tags: string[] // 标签
title: string // 标题
create_date: Date // 文章发布日期
content_len: number // 正文长度
is_splited: boolean // 是否分词
}
export interface TreeNodeBase {
name: string | null // 节点名称(ID)
deep: number // 节点深度(根节点为0)
}
export interface TreeNode extends TreeNodeBase {
expand: boolean // 是否展开
id?: string // 文章ID
title: string //显示的文字
children?: TreeNode[] // 子节点
loading?: boolean // 是否显示加载中
nodeKey?: number // 树节点唯一标识
isDirectory: boolean // 该节点是否为目录
// render?: (h: CreateElement, {data}: {data: TreeNode}) => Array<VNode | string>
}
export interface TreeNodeSource {
_id: string
cnt: number
article_id: string | null
}
+9
View File
@@ -0,0 +1,9 @@
export interface SystemConfigModel {
_id?: string
name: string // 配置项名称
value: object | string // 配置项内容
description: string // 描述
is_public: boolean // 是否公开
created_at?: Date // 创建时间
updated_at?: Date // 更新时间
}
+10
View File
@@ -0,0 +1,10 @@
export interface SystemRoleModel {
_id: string | null
name: string | null // 角色名称
description: string | null // 描述
methods: string[] // 允许的请求类型(优先级3)
include_uri: string[] // 包含的URI(优先级2)
exclude_uri: string[] // 排除的URI(优先级1)
created_at?: Date // 创建时间
updated_at?: Date // 更新时间
}
+9
View File
@@ -0,0 +1,9 @@
export interface SystemUserModel {
_id: string | null
username: string | null
password: string | null
realname: string | null
role_ids: string[]
created_at?: Date
updated_at?: Date
}