Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
inscode
NodeJS_639770
提交
5c8e8b81
N
NodeJS_639770
项目概览
inscode
/
NodeJS_639770
与 Fork 源项目一致
Fork自
inscode / NodeJS
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
NodeJS_639770
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5c8e8b81
编写于
6月 03, 2024
作者:
View Design
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新合集
上级
106195e1
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
111 addition
and
10 deletion
+111
-10
components/i/action/Collect.vue
components/i/action/Collect.vue
+37
-0
components/i/library/Create.vue
components/i/library/Create.vue
+39
-3
components/i/library/Edit.vue
components/i/library/Edit.vue
+18
-0
components/i/library/Header.vue
components/i/library/Header.vue
+16
-7
pages/library/[id].vue
pages/library/[id].vue
+1
-0
未找到文件。
components/i/action/Collect.vue
0 → 100644
浏览文件 @
5c8e8b81
<
template
>
<UDropdown
class=
"flex flex-grow"
:items=
"actionItems"
>
<UButton
color=
"gray"
variant=
"ghost"
icon=
"i-heroicons-ellipsis-horizontal"
/>
</UDropdown>
<ILibraryEdit
:id=
"id"
ref=
"refEdit"
/>
</
template
>
<
script
setup
>
const
props
=
defineProps
({
id
:
{
type
:
[
String
,
Number
],
default
:
''
}
})
const
actionItems
=
[
[
{
label
:
'
编辑合集
'
,
icon
:
'
i-heroicons-pencil-square
'
,
click
:
()
=>
{
handleOpen
()
}
},
{
label
:
'
删除合集
'
,
icon
:
'
i-heroicons-trash
'
}
]
]
const
refEdit
=
ref
(
null
)
function
handleOpen
()
{
refEdit
.
value
.
open
()
}
</
script
>
components/i/library/Create.vue
浏览文件 @
5c8e8b81
<
template
>
<
template
>
<UModal
v-model=
"$isLibraryCreateOpen"
:ui=
"
{ width: 'w-96 sm:max-w-screen-md' }">
<UModal
:model-value=
"!id ? $isLibraryCreateOpen : updateVisible"
@
update:modelValue=
"handleCloseModal"
:ui=
"
{ width: 'w-96 sm:max-w-screen-md' }"
>
<UCard
:ui=
"
{ ring: '', divide: 'divide-y divide-gray-100 dark:divide-gray-800' }">
<UCard
:ui=
"
{ ring: '', divide: 'divide-y divide-gray-100 dark:divide-gray-800' }">
<template
#header
>
<template
#header
>
<div
class=
"flex items-center justify-between"
>
<div
class=
"flex items-center justify-between"
>
<div
class=
"text-xl"
>
创建合集
</div>
<div
class=
"text-xl"
v-if=
"!id"
>
创建合集
</div>
<div
class=
"text-xl"
v-else
>
更新合集
</div>
<UButton
<UButton
leading-icon=
"i-heroicons-x-mark-20-solid"
leading-icon=
"i-heroicons-x-mark-20-solid"
color=
"gray"
color=
"gray"
...
@@ -39,12 +44,21 @@
...
@@ -39,12 +44,21 @@
<
template
#footer
>
<
template
#footer
>
<div
class=
"flex justify-end"
>
<div
class=
"flex justify-end"
>
<UButton
<UButton
v-if=
"!id"
size=
"md"
size=
"md"
label=
"创建"
label=
"创建"
:loading=
"loading"
:loading=
"loading"
:disabled=
"!title"
:disabled=
"!title"
@
click=
"handleCreate"
@
click=
"handleCreate"
/>
/>
<UButton
v-else
size=
"md"
label=
"更新"
:loading=
"loading"
:disabled=
"!title"
@
click=
"handleUpdate"
/>
</div>
</div>
</
template
>
</
template
>
</UCard>
</UCard>
...
@@ -54,11 +68,19 @@
...
@@ -54,11 +68,19 @@
const
{
$isLibraryCreateOpen
}
=
storeToRefs
(
useLibraryStore
())
const
{
$isLibraryCreateOpen
}
=
storeToRefs
(
useLibraryStore
())
const
{
$closeLibraryCreate
,
$getCollection
}
=
useLibraryStore
()
const
{
$closeLibraryCreate
,
$getCollection
}
=
useLibraryStore
()
const
{
setOrUpdateCollection
}
=
useCollectionRequest
()
const
{
setOrUpdateCollection
}
=
useCollectionRequest
()
const
props
=
defineProps
({
id
:
{
type
:
[
String
,
Number
],
default
:
''
}
})
const
updateVisible
=
ref
(
false
)
const
title
=
ref
(
''
)
const
title
=
ref
(
''
)
const
description
=
ref
(
''
)
const
description
=
ref
(
''
)
const
loading
=
ref
(
false
)
const
loading
=
ref
(
false
)
function
handleClose
()
{
function
handleClose
()
{
$closeLibraryCreate
()
if
(
!
props
.
id
)
$closeLibraryCreate
()
else
updateVisible
.
value
=
false
}
}
async
function
handleCreate
()
{
async
function
handleCreate
()
{
if
(
loading
.
value
)
return
if
(
loading
.
value
)
return
...
@@ -72,4 +94,18 @@ async function handleCreate () {
...
@@ -72,4 +94,18 @@ async function handleCreate () {
$closeLibraryCreate
()
$closeLibraryCreate
()
$getCollection
()
$getCollection
()
}
}
function
handleCloseModal
()
{
if
(
!
props
.
id
)
$isLibraryCreateOpen
.
value
=
false
else
updateVisible
.
value
=
false
}
function
handleUpdate
()
{
}
function
openUpdate
()
{
updateVisible
.
value
=
true
// todo 获取合集数据
}
defineExpose
({
openUpdate
})
</
script
>
</
script
>
components/i/library/Edit.vue
0 → 100644
浏览文件 @
5c8e8b81
<
template
>
<ILibraryCreate
:id=
"id"
ref=
"refCreate"
/>
</
template
>
<
script
setup
>
defineProps
({
id
:
{
type
:
[
String
,
Number
],
default
:
''
}
})
const
refCreate
=
ref
(
null
)
function
open
()
{
refCreate
.
value
.
openUpdate
()
}
defineExpose
({
open
})
</
script
>
\ No newline at end of file
components/i/library/Header.vue
浏览文件 @
5c8e8b81
...
@@ -21,13 +21,18 @@
...
@@ -21,13 +21,18 @@
</div>
</div>
</
template
>
</
template
>
</div>
</div>
<div
class=
"flex"
>
<div
class=
"flex flex-grow justify-end items-center gap-4"
>
<UInput
<div
class=
"flex"
>
v-model=
"searchQuery"
<IActionCollect
:id=
"collectId"
/>
icon=
"i-heroicons-magnifying-glass-20-solid"
</div>
placeholder=
"搜索你的主题..."
<div
class=
"flex"
>
size=
"md"
<UInput
/>
v-model=
"searchQuery"
icon=
"i-heroicons-magnifying-glass-20-solid"
placeholder=
"搜索你的主题..."
size=
"md"
/>
</div>
</div>
</div>
</div>
</div>
<div
v-if=
"description"
class=
"text-gray-500 ml-12 mt-2"
>
{{ description }}
</div>
<div
v-if=
"description"
class=
"text-gray-500 ml-12 mt-2"
>
{{ description }}
</div>
...
@@ -48,6 +53,10 @@ defineProps({
...
@@ -48,6 +53,10 @@ defineProps({
count
:
{
count
:
{
type
:
Number
,
type
:
Number
,
default
:
0
default
:
0
},
collectId
:
{
type
:
[
String
,
Number
],
default
:
''
}
}
})
})
const
searchQuery
=
ref
(
''
)
const
searchQuery
=
ref
(
''
)
...
...
pages/library/[id].vue
浏览文件 @
5c8e8b81
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
:collect=
"currentCollect.name"
:collect=
"currentCollect.name"
:description=
"currentCollect.description"
:description=
"currentCollect.description"
:count=
"currentCollect.record_count"
:count=
"currentCollect.record_count"
:collect-id=
"currentCollect.id"
/>
/>
<div
class=
"container max-w-screen-lg flex flex-col p-6"
>
<div
class=
"container max-w-screen-lg flex flex-col p-6"
>
<div
class=
"flex gap-10"
>
<div
class=
"flex gap-10"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录