修改下划线分隔的字段
This commit is contained in:
parent
499951f9da
commit
a0e49ceda6
@ -4,6 +4,6 @@ export default interface HitokotoModel {
|
||||
type: string
|
||||
from: string
|
||||
creator: string
|
||||
created_at: Date
|
||||
createdAt: Date
|
||||
number: number
|
||||
}
|
||||
@ -7,8 +7,8 @@ export interface MusicModel {
|
||||
title?: string // 标题
|
||||
album?: string // 唱片集
|
||||
artist?: string // 艺术家
|
||||
lib_id: string // 歌单ID
|
||||
lyric_id: string // 歌词ID
|
||||
libId: string // 歌单ID
|
||||
lyricId: string // 歌词ID
|
||||
isEditing?: boolean // 是否正在编辑当前行
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@ export interface MusicLibModel {
|
||||
|
||||
export interface MusicLyricModel {
|
||||
_id?: string
|
||||
cloud_id?: number
|
||||
cloudId?: number
|
||||
name?: string
|
||||
lyric?: string
|
||||
}
|
||||
|
||||
@ -5,5 +5,5 @@ export interface SourceImageModel {
|
||||
size: number // 图片大小
|
||||
label: string[] // 图片标签
|
||||
img: ArrayBuffer // 图片二进制数据
|
||||
created_at: Date
|
||||
createdAt: Date
|
||||
}
|
||||
|
||||
@ -6,9 +6,9 @@ export interface ArticleModel {
|
||||
categories: string[] //分类
|
||||
tags: string[] // 标签
|
||||
title: string // 标题
|
||||
create_date: Date // 文章发布日期
|
||||
content_len: number // 正文长度
|
||||
is_splited: boolean // 是否分词
|
||||
createDate: Date // 文章发布日期
|
||||
contentLen: number // 正文长度
|
||||
isSplited: boolean // 是否分词
|
||||
}
|
||||
|
||||
export interface TreeNodeData {
|
||||
@ -22,5 +22,5 @@ export interface TreeNodeData {
|
||||
export interface TreeNodeSource {
|
||||
_id: string
|
||||
cnt: number
|
||||
article_id: string | null
|
||||
articleId: string | null
|
||||
}
|
||||
@ -3,7 +3,7 @@ export interface SystemConfigModel {
|
||||
name: string // 配置项名称
|
||||
value: object | string // 配置项内容
|
||||
description: string // 描述
|
||||
is_public: boolean // 是否公开
|
||||
created_at?: Date // 创建时间
|
||||
updated_at?: Date // 更新时间
|
||||
isPublic: boolean // 是否公开
|
||||
createdAt?: Date // 创建时间
|
||||
updatedAt?: Date // 更新时间
|
||||
}
|
||||
@ -3,8 +3,8 @@ export interface SystemRoleModel {
|
||||
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 // 更新时间
|
||||
includeUri: string[] // 包含的URI(优先级2)
|
||||
excludeUri: string[] // 排除的URI(优先级1)
|
||||
createdAt?: Date // 创建时间
|
||||
updatedAt?: Date // 更新时间
|
||||
}
|
||||
@ -3,7 +3,7 @@ export interface SystemUserModel {
|
||||
username: string | null
|
||||
password: string | null
|
||||
realname: string | null
|
||||
role_ids: string[]
|
||||
created_at?: Date
|
||||
updated_at?: Date
|
||||
roleIds: string[]
|
||||
createdAt?: Date
|
||||
updatedAt?: Date
|
||||
}
|
||||
@ -164,7 +164,7 @@ html, body, #app, .layout {
|
||||
}
|
||||
|
||||
/* ===== 表单弹窗 ===== */
|
||||
.el-dialog {
|
||||
body .el-dialog {
|
||||
// CSS 变量覆盖:圆角、清除 element-plus 2.x 新增的根元素 padding
|
||||
--el-dialog-border-radius: 12px;
|
||||
--el-dialog-padding-primary: 0;
|
||||
|
||||
@ -2,7 +2,7 @@ export interface UserInfo {
|
||||
_id: string
|
||||
username: string // 用户名
|
||||
realname: string // 昵称
|
||||
role_ids: string[] // 角色ID
|
||||
roleIds: string[] // 角色ID
|
||||
}
|
||||
|
||||
export interface TabItem {
|
||||
|
||||
@ -38,9 +38,9 @@
|
||||
<el-table-column prop="from" label="来自" width="180"/>
|
||||
<el-table-column prop="creator" label="作者" width="180"/>
|
||||
<el-table-column prop="number" label="编号" width="70"/>
|
||||
<el-table-column prop="created_at" label="创建时间" width="180">
|
||||
<el-table-column prop="createdAt" label="创建时间" width="180">
|
||||
<template #default="scope">
|
||||
{{ datetimeFormat(scope.row.created_at) }}
|
||||
{{ datetimeFormat(scope.row.createdAt) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<el-input v-model="search.name" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属歌单">
|
||||
<el-select v-model="search.lib_id" multiple collapse-tags>
|
||||
<el-select v-model="search.libId" multiple collapse-tags>
|
||||
<el-option v-for="musicLib in musicLibs" :key="musicLib._id" :value="musicLib._id" :label="musicLib.name" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -45,25 +45,25 @@
|
||||
<el-table-column prop="title" label="标题" show-overflow-tooltip />
|
||||
<el-table-column prop="album" label="唱片集" />
|
||||
<el-table-column prop="artist" label="艺术家" />
|
||||
<el-table-column prop="lib_id" label="所属歌单" >
|
||||
<el-table-column prop="libId" label="所属歌单" >
|
||||
<template #default="scope">
|
||||
<template v-if="scope.row.isEditing && currentRow">
|
||||
<el-select v-model="currentRow.lib_id">
|
||||
<el-select v-model="currentRow.libId">
|
||||
<el-option v-for="musicLib in musicLibs" :key="musicLib._id" :value="musicLib._id" :label="musicLib.name" />
|
||||
</el-select>
|
||||
<el-button link icon="Check" type="primary" @click="saveMusicLib(scope.row)"></el-button>
|
||||
<el-button link icon="Close" type="primary" @click="scope.row.isEditing = false"></el-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ findMusicLib(scope.row.lib_id) }}
|
||||
{{ findMusicLib(scope.row.libId) }}
|
||||
<el-button link icon="Edit" type="primary" @click="updateLib(scope.row)"></el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="lyric_id" label="歌词" width="120" >
|
||||
<el-table-column prop="lyricId" label="歌词" width="120" >
|
||||
<template #default="scope">
|
||||
<div style="width: 18px">
|
||||
<Check v-if="scope.row.lyric_id" />
|
||||
<Check v-if="scope.row.lyricId" />
|
||||
<Close v-else/>
|
||||
</div>
|
||||
</template>
|
||||
@ -89,8 +89,8 @@
|
||||
</div>
|
||||
<el-dialog v-model="modifyLyricModal" title="编辑歌词" :width="600" >
|
||||
<el-form ref="lyricForm" :model="lyricFormData" :rules="lyricRuleValidate" :label-width="120">
|
||||
<el-form-item label="网易云ID" prop="cloud_id">
|
||||
<el-input v-model="lyricFormData.cloud_id" />
|
||||
<el-form-item label="网易云ID" prop="cloudId">
|
||||
<el-input v-model="lyricFormData.cloudId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="lyricFormData.name" />
|
||||
@ -166,7 +166,7 @@ class MusicPage extends Page {
|
||||
title?: string
|
||||
album?: string
|
||||
artist?: string
|
||||
lib_id?: string[] = []
|
||||
libId?: string[] = []
|
||||
reset() {
|
||||
super.reset()
|
||||
this.name = undefined
|
||||
@ -174,7 +174,7 @@ class MusicPage extends Page {
|
||||
this.title = undefined
|
||||
this.album = undefined
|
||||
this.artist = undefined
|
||||
this.lib_id = []
|
||||
this.libId = []
|
||||
}
|
||||
}
|
||||
|
||||
@ -197,7 +197,7 @@ const musicUpload = ref<UploadInstance>()
|
||||
const player = ref<any>()
|
||||
|
||||
const lyricRuleValidate = {
|
||||
cloud_id: [
|
||||
cloudId: [
|
||||
{ required: true, message: '请输入网易云ID', trigger: 'blur' }
|
||||
],
|
||||
name: [
|
||||
@ -239,8 +239,8 @@ async function playMusic() {
|
||||
src: `/api/v2/common/music/load/${item._id}`,
|
||||
pic: `/api/v2/common/music/album/${item._id}`,
|
||||
}
|
||||
if (item.lyric_id) {
|
||||
musicItem.lrc = `${location.origin}/api/v2/common/music/lyric/${item.lyric_id}`
|
||||
if (item.lyricId) {
|
||||
musicItem.lrc = `${location.origin}/api/v2/common/music/lyric/${item.lyricId}`
|
||||
}
|
||||
return musicItem
|
||||
})
|
||||
@ -272,9 +272,9 @@ function remove(row: MusicModel) {
|
||||
async function updateLyric(row: MusicModel) {
|
||||
currentRow.value = { ...row }
|
||||
modifyLyricModal.value = true
|
||||
if (row.lyric_id) {
|
||||
const data = (await http.get<any, any>('/api/v2/music/lyric/get', {params: {lyricId: row.lyric_id}}))
|
||||
data.cloud_id = data.cloud_id ? data.cloud_id.toString() : null
|
||||
if (row.lyricId) {
|
||||
const data = (await http.get<any, any>('/api/v2/music/lyric/get', {params: {lyricId: row.lyricId}}))
|
||||
data.cloudId = data.cloudId ? data.cloudId.toString() : null
|
||||
lyricFormData.value = data
|
||||
} else {
|
||||
lyricFormData.value = {}
|
||||
@ -294,9 +294,9 @@ async function saveLyric() {
|
||||
}
|
||||
async function saveMusicLib(row: MusicModel) {
|
||||
if (!currentRow.value) return
|
||||
const data = await http.post<{id: string, libId: string}, any>('/api/v2/music/updateLib', {id: currentRow.value._id, libId: currentRow.value.lib_id})
|
||||
const data = await http.post<{id: string, libId: string}, any>('/api/v2/music/updateLib', {id: currentRow.value._id, libId: currentRow.value.libId})
|
||||
ElMessage.success(data.message)
|
||||
row.lib_id = currentRow.value.lib_id
|
||||
row.libId = currentRow.value.libId
|
||||
row.isEditing = false
|
||||
}
|
||||
function openUploadModal() {
|
||||
|
||||
@ -35,9 +35,9 @@
|
||||
<el-tag v-for="label in scope.row.label" :key="label" effect="plain">{{label}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="created_at" label="上传时间" >
|
||||
<el-table-column prop="createdAt" label="上传时间" >
|
||||
<template #default="scope">
|
||||
{{ datetimeFormat(scope.row.created_at) }}
|
||||
{{ datetimeFormat(scope.row.createdAt) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" >
|
||||
|
||||
@ -76,16 +76,16 @@
|
||||
{{ typeof scope.row.tags === 'string' ? scope.row.tags : scope.row.tags?.join(',') }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="content_len" label="正文长度" width="100" />
|
||||
<el-table-column prop="create_date" label="创建时间" width="180" >
|
||||
<el-table-column prop="contentLen" label="正文长度" width="100" />
|
||||
<el-table-column prop="createDate" label="创建时间" width="180" >
|
||||
<template #default="scope">
|
||||
{{ datetimeFormat(scope.row.create_date) }}
|
||||
{{ datetimeFormat(scope.row.createDate) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="tags" label="是否已分词" width="120" >
|
||||
<template #default="scope">
|
||||
<div style="width: 18px">
|
||||
<Check v-if="scope.row.is_splited" />
|
||||
<Check v-if="scope.row.isSplited" />
|
||||
<Close v-else/>
|
||||
</div>
|
||||
</template>
|
||||
@ -224,9 +224,9 @@ async function loadTreeData(node: Node, resolve: Function) {
|
||||
resolve(childItems.map((childItem): TreeNodeData => {
|
||||
const treeNode: TreeNodeData = {
|
||||
name: childItem._id,
|
||||
title: childItem.article_id ? childItem._id : `${childItem._id}(${childItem.cnt})`,
|
||||
id: childItem.article_id || childItem._id,
|
||||
isLeaf: !!childItem.article_id
|
||||
title: childItem.articleId ? childItem._id : `${childItem._id}(${childItem.cnt})`,
|
||||
id: childItem.articleId || childItem._id,
|
||||
isLeaf: !!childItem.articleId
|
||||
}
|
||||
return treeNode
|
||||
}))
|
||||
|
||||
@ -21,19 +21,19 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="配置项名称" />
|
||||
<el-table-column prop="description" label="配置项描述" />
|
||||
<el-table-column prop="is_public" label="是否公开" >
|
||||
<el-table-column prop="isPublic" label="是否公开" >
|
||||
<template #default="scope">
|
||||
{{ scope.row.is_public ? '是' : '否' }}
|
||||
{{ scope.row.isPublic ? '是' : '否' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="created_at" label="创建时间" >
|
||||
<el-table-column prop="createdAt" label="创建时间" >
|
||||
<template #default="scope">
|
||||
{{ datetimeFormat(scope.row.created_at) }}
|
||||
{{ datetimeFormat(scope.row.createdAt) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="updated_at" label="更新时间" >
|
||||
<el-table-column prop="updatedAt" label="更新时间" >
|
||||
<template #default="scope">
|
||||
{{ datetimeFormat(scope.row.updated_at) }}
|
||||
{{ datetimeFormat(scope.row.updatedAt) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" >
|
||||
@ -73,7 +73,7 @@ const formData = ref<SystemConfigModel>({
|
||||
name: '',
|
||||
value: '',
|
||||
description: '',
|
||||
is_public: false
|
||||
isPublic: false
|
||||
})
|
||||
|
||||
const addForm = ref<InstanceType<typeof SystemConfigAdd>>()
|
||||
@ -94,7 +94,7 @@ function add() {
|
||||
name: '',
|
||||
value: '',
|
||||
description: '',
|
||||
is_public: false
|
||||
isPublic: false
|
||||
}
|
||||
modalTitle.value = '新增配置项'
|
||||
addModal.value = true
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="公开">
|
||||
<el-switch
|
||||
v-model="formData.is_public"
|
||||
v-model="formData.isPublic"
|
||||
active-text="是"
|
||||
inactive-text="否" />
|
||||
</el-form-item>
|
||||
|
||||
@ -20,14 +20,14 @@
|
||||
<el-tag type="info" v-for="method in scope.row.methods" :key="method">{{method}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="created_at" label="创建时间" >
|
||||
<el-table-column prop="createdAt" label="创建时间" >
|
||||
<template #default="scope">
|
||||
{{ datetimeFormat(scope.row.created_at) }}
|
||||
{{ datetimeFormat(scope.row.createdAt) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="updated_at" label="更新时间" >
|
||||
<el-table-column prop="updatedAt" label="更新时间" >
|
||||
<template #default="scope">
|
||||
{{ datetimeFormat(scope.row.updated_at) }}
|
||||
{{ datetimeFormat(scope.row.updatedAt) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" >
|
||||
@ -67,18 +67,18 @@
|
||||
<el-form-item label="允许的URI">
|
||||
<el-input v-model="uri.include">
|
||||
<template #append>
|
||||
<el-button icon="Plus" @click="addUri('include_uri', uri.include)"></el-button>
|
||||
<el-button icon="Plus" @click="addUri('includeUri', uri.include)"></el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-tag v-for="uri in formData.include_uri" :key="uri" closable @close="removeUri('include_uri', uri)">{{uri}}</el-tag>
|
||||
<el-tag v-for="uri in formData.includeUri" :key="uri" closable @close="removeUri('includeUri', uri)">{{uri}}</el-tag>
|
||||
</el-form-item>
|
||||
<el-form-item label="禁止的URI">
|
||||
<el-input v-model="uri.exclude">
|
||||
<template #append>
|
||||
<el-button icon="Plus" @click="addUri('exclude_uri', uri.exclude)"></el-button>
|
||||
<el-button icon="Plus" @click="addUri('excludeUri', uri.exclude)"></el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-tag v-for="uri in formData.exclude_uri" :key="uri" closable @close="removeUri('exclude_uri', uri)">{{uri}}</el-tag>
|
||||
<el-tag v-for="uri in formData.excludeUri" :key="uri" closable @close="removeUri('excludeUri', uri)">{{uri}}</el-tag>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
@ -133,8 +133,8 @@ const formData = reactive<SystemRoleModel>({
|
||||
name: null,
|
||||
description: null,
|
||||
methods: [],
|
||||
include_uri: [],
|
||||
exclude_uri: []
|
||||
includeUri: [],
|
||||
excludeUri: []
|
||||
})
|
||||
const roleForm = ref<VForm>()
|
||||
|
||||
@ -155,22 +155,22 @@ function add() {
|
||||
name: null,
|
||||
description: null,
|
||||
methods: [],
|
||||
include_uri: [],
|
||||
exclude_uri: []
|
||||
includeUri: [],
|
||||
excludeUri: []
|
||||
})
|
||||
modalTitle.value = '新增角色'
|
||||
addModal.value = true
|
||||
clearValidate()
|
||||
}
|
||||
|
||||
function addUri(fieldName: 'include_uri' | 'exclude_uri', uriValue: string | null) {
|
||||
function addUri(fieldName: 'includeUri' | 'excludeUri', uriValue: string | null) {
|
||||
if(!uriValue) return
|
||||
if(formData[fieldName].indexOf(uriValue) === -1) {
|
||||
formData[fieldName].push(uriValue)
|
||||
}
|
||||
}
|
||||
|
||||
function removeUri(fieldName: 'include_uri' | 'exclude_uri', uriValue: string) {
|
||||
function removeUri(fieldName: 'includeUri' | 'excludeUri', uriValue: string) {
|
||||
let index = formData[fieldName].indexOf(uriValue)
|
||||
if(index !== -1) {
|
||||
formData[fieldName].splice(index, 1)
|
||||
@ -185,8 +185,8 @@ function update(row: SystemRoleModel) {
|
||||
name: row.name,
|
||||
description: row.description,
|
||||
methods: row.methods,
|
||||
include_uri: row.include_uri,
|
||||
exclude_uri: row.exclude_uri
|
||||
includeUri: row.includeUri,
|
||||
excludeUri: row.excludeUri
|
||||
})
|
||||
modalTitle.value = '修改角色'
|
||||
addModal.value = true
|
||||
|
||||
@ -16,14 +16,14 @@
|
||||
<el-table :data="systemUserData" v-loading="loading" stripe>
|
||||
<el-table-column prop="username" label="用户名" />
|
||||
<el-table-column prop="realname" label="昵称" />
|
||||
<el-table-column prop="created_at" label="创建时间" >
|
||||
<el-table-column prop="createdAt" label="创建时间" >
|
||||
<template #default="scope">
|
||||
{{ datetimeFormat(scope.row.created_at) }}
|
||||
{{ datetimeFormat(scope.row.createdAt) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="updated_at" label="更新时间" >
|
||||
<el-table-column prop="updatedAt" label="更新时间" >
|
||||
<template #default="scope">
|
||||
{{ datetimeFormat(scope.row.updated_at) }}
|
||||
{{ datetimeFormat(scope.row.updatedAt) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" >
|
||||
@ -56,7 +56,7 @@
|
||||
<el-input v-model="formData.realname" />
|
||||
</el-form-item>
|
||||
<el-form-item label="角色" prop="realname">
|
||||
<el-select v-model="formData.role_ids" multiple >
|
||||
<el-select v-model="formData.roleIds" multiple >
|
||||
<el-option v-for="role in roles" :key="role._id" :value="role._id" :label="role.name"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@ -102,7 +102,7 @@ const formData = reactive<SystemUserModel>({
|
||||
username: null,
|
||||
password: null,
|
||||
realname: null,
|
||||
role_ids: []
|
||||
roleIds: []
|
||||
})
|
||||
const userForm = ref<VForm>()
|
||||
|
||||
@ -141,7 +141,7 @@ function add() {
|
||||
username: null,
|
||||
password: null,
|
||||
realname: null,
|
||||
role_ids: []
|
||||
roleIds: []
|
||||
})
|
||||
modalTitle.value = '新增用户'
|
||||
addModal.value = true
|
||||
@ -153,7 +153,7 @@ function update(row: SystemUserModel) {
|
||||
_id: row._id,
|
||||
username: row.username,
|
||||
realname: row.realname,
|
||||
role_ids: row.role_ids
|
||||
roleIds: row.roleIds
|
||||
})
|
||||
modalTitle.value = '修改用户'
|
||||
addModal.value = true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user