Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
兴科Sinco
开源百科
提交
ce7e6543
开
开源百科
项目概览
兴科Sinco
/
开源百科
与 Fork 源项目一致
Fork自
GitCode官方 / 开源百科
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
开
开源百科
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
ce7e6543
编写于
2月 18, 2021
作者:
X
xjh22222228
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(#79): side add pin to top
上级
0b5619b4
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
127 addition
and
3 deletion
+127
-3
src/app/app.module.ts
src/app/app.module.ts
+4
-0
src/components/card/index.component.ts
src/components/card/index.component.ts
+1
-0
src/components/create-web/index.component.html
src/components/create-web/index.component.html
+7
-0
src/components/create-web/index.component.ts
src/components/create-web/index.component.ts
+4
-0
src/components/toolbar-title/index.component.html
src/components/toolbar-title/index.component.html
+14
-2
src/components/toolbar-title/index.component.ts
src/components/toolbar-title/index.component.ts
+1
-0
src/components/web-list/index.component.html
src/components/web-list/index.component.html
+10
-0
src/components/web-list/index.component.scss
src/components/web-list/index.component.scss
+33
-0
src/components/web-list/index.component.ts
src/components/web-list/index.component.ts
+44
-0
src/view/index/side/index.component.html
src/view/index/side/index.component.html
+9
-1
未找到文件。
src/app/app.module.ts
浏览文件 @
ce7e6543
...
...
@@ -30,6 +30,7 @@ import { NzTableModule } from 'ng-zorro-antd/table'
import
{
NzTabsModule
}
from
'
ng-zorro-antd/tabs
'
import
{
NzTagModule
}
from
'
ng-zorro-antd/tag
'
import
{
NzRateModule
}
from
'
ng-zorro-antd/rate
'
import
{
NzSwitchModule
}
from
'
ng-zorro-antd/switch
'
import
{
DragDropModule
}
from
'
@angular/cdk/drag-drop
'
// components
...
...
@@ -49,6 +50,7 @@ import { SearchEngineComponent } from '../components/search-engine/search-engine
import
{
LoginComponent
}
from
'
../components/login/login.component
'
;
import
{
CreateWebComponent
}
from
'
../components/create-web/index.component
'
;
import
{
ToolbarTitleWebComponent
}
from
'
../components/toolbar-title/index.component
'
;
import
{
WebListComponent
}
from
'
../components/web-list/index.component
'
;
import
{
NZ_I18N
}
from
'
ng-zorro-antd/i18n
'
;
import
{
zh_CN
}
from
'
ng-zorro-antd/i18n
'
;
import
{
registerLocaleData
}
from
'
@angular/common
'
;
...
...
@@ -106,6 +108,7 @@ const appRoutes: Routes = [
LoginComponent
,
CreateWebComponent
,
ToolbarTitleWebComponent
,
WebListComponent
,
LogoComponent
,
CardComponent
],
...
...
@@ -133,6 +136,7 @@ const appRoutes: Routes = [
NzTabsModule
,
NzTagModule
,
NzRateModule
,
NzSwitchModule
,
DragDropModule
,
BrowserModule
,
FormsModule
,
...
...
src/components/card/index.component.ts
浏览文件 @
ce7e6543
...
...
@@ -68,6 +68,7 @@ export class CardComponent implements OnInit {
this
.
dataSource
.
url
=
payload
.
url
this
.
dataSource
.
rate
=
payload
.
rate
this
.
dataSource
.
urls
=
payload
.
urls
this
.
dataSource
.
top
=
payload
.
top
this
.
message
.
success
(
'
修改成功!
'
)
setWebsiteList
(
this
.
websiteList
)
...
...
src/components/create-web/index.component.html
浏览文件 @
ce7e6543
...
...
@@ -21,6 +21,13 @@
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[nzSpan]=
"4"
nzRequired
>
是否置顶
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
>
<nz-switch
formControlName=
"top"
></nz-switch>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[nzSpan]=
"4"
>
推荐指数
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
>
...
...
src/components/create-web/index.component.ts
浏览文件 @
ce7e6543
...
...
@@ -41,6 +41,7 @@ export class CreateWebComponent implements OnInit {
this
.
validateForm
=
this
.
fb
.
group
({
title
:
[
''
,
[
Validators
.
required
]],
url
:
[
''
,
[
Validators
.
required
]],
top
:
[
false
],
rate
:
[
0
],
url0
:
[
''
],
url1
:
[
''
],
...
...
@@ -64,6 +65,7 @@ export class CreateWebComponent implements OnInit {
this
.
validateForm
.
get
(
'
title
'
)
!
.
setValue
(
detail
.
name
)
this
.
validateForm
.
get
(
'
icon
'
)
!
.
setValue
(
detail
.
icon
||
''
)
this
.
validateForm
.
get
(
'
url
'
)
!
.
setValue
(
detail
.
url
||
''
)
this
.
validateForm
.
get
(
'
top
'
)
!
.
setValue
(
detail
.
top
??
false
)
this
.
validateForm
.
get
(
'
rate
'
)
!
.
setValue
(
detail
.
rate
)
this
.
validateForm
.
get
(
'
desc
'
)
!
.
setValue
(
detail
.
desc
||
''
)
...
...
@@ -153,6 +155,7 @@ export class CreateWebComponent implements OnInit {
title
,
icon
,
url
,
top
,
rate
,
desc
,
url0
,
...
...
@@ -182,6 +185,7 @@ export class CreateWebComponent implements OnInit {
createdAt
:
(
this
.
detail
as
any
)?.
createdAt
??
createdAt
,
rate
:
rate
??
0
,
desc
:
desc
||
''
,
top
:
top
??
false
,
icon
,
url
,
urls
...
...
src/components/toolbar-title/index.component.html
浏览文件 @
ce7e6543
...
...
@@ -10,11 +10,23 @@
>
</app-logo> -->
<i
class=
"iconfont iconjiantouarrow483 down-arrow"
[class.active]=
"dataSource.collapsed"
*ngIf=
"arrowType === '1'; else type"
>
</i>
<ng-template
#type
>
<i
class=
"iconfont iconjiantouarrow483 down-arrow"
[class.active]=
"dataSource.collapsed"
>
</i>
</ng-template>
<span
style=
"margin-left: 10px;align-self: center;vertical-align: middle;"
>
{{ dataSource.title }} x {{ dataSource.nav.length }}
</span>
<i
class=
"iconfont iconjiantouarrow483 down-arrow"
[class.active]=
"dataSource.collapsed"
></i>
</span>
<i
...
...
src/components/toolbar-title/index.component.ts
浏览文件 @
ce7e6543
...
...
@@ -17,6 +17,7 @@ import { websiteList } from '../../store'
export
class
ToolbarTitleWebComponent
implements
OnInit
{
@
Input
()
index
:
number
@
Input
()
dataSource
:
INavThreeProp
@
Input
()
arrowType
:
'
1
'
|
'
2
'
=
'
1
'
@
Output
()
onCollapse
=
new
EventEmitter
()
isLogin
=
!!
getToken
()
...
...
src/components/web-list/index.component.html
0 → 100644
浏览文件 @
ce7e6543
<div
class=
"container"
>
<a
[href]=
"item.url"
target=
"_blank"
*ngFor=
"let item of dataList"
>
<div
class=
"wrapper"
>
<div
class=
"logo"
>
<app-logo
[src]=
"item.icon"
[name]=
"item.name"
[size]=
"35"
></app-logo>
</div>
<div
class=
"name dark-text"
>
{{ item.name }}
</div>
</div>
</a>
</div>
src/components/web-list/index.component.scss
0 → 100644
浏览文件 @
ce7e6543
.container
{
margin-top
:
50px
;
margin-bottom
:
15px
;
display
:
flex
;
padding
:
0
15px
;
.wrapper
{
display
:
flex
;
margin-right
:
15px
;
margin-bottom
:
15px
;
text-align
:
center
;
cursor
:
pointer
;
align-items
:
center
;
flex-direction
:
column
;
transition
:
transform
.1s
ease-in
;
&
:hover
{
transform
:
translateY
(
-5px
);
}
}
.logo
{
border-radius
:
50%
;
margin-bottom
:
3px
;
}
.name
{
color
:
#666
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
}
\ No newline at end of file
src/components/web-list/index.component.ts
0 → 100644
浏览文件 @
ce7e6543
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav
import
{
Component
,
OnInit
}
from
'
@angular/core
'
import
{
getToken
}
from
'
../../utils/user
'
import
{
websiteList
}
from
'
../../store
'
import
{
INavFourProp
}
from
'
src/types
'
@
Component
({
selector
:
'
app-web-list
'
,
templateUrl
:
'
./index.component.html
'
,
styleUrls
:
[
'
./index.component.scss
'
]
})
export
class
WebListComponent
implements
OnInit
{
isLogin
=
!!
getToken
()
dataList
:
INavFourProp
[]
=
[]
constructor
()
{}
ngOnInit
()
{
this
.
getTopWeb
()
}
getTopWeb
()
{
const
dataList
:
INavFourProp
[]
=
[]
function
r
(
nav
)
{
if
(
!
Array
.
isArray
(
nav
))
return
for
(
let
i
=
0
;
i
<
nav
.
length
;
i
++
)
{
const
item
=
nav
[
i
]
if
(
item
.
url
)
{
if
(
item
.
top
)
{
dataList
.
push
(
item
)
}
}
else
{
r
(
item
.
nav
)
}
}
}
r
(
websiteList
)
this
.
dataList
=
dataList
}
}
src/view/index/side/index.component.html
浏览文件 @
ce7e6543
...
...
@@ -32,10 +32,18 @@
</div>
<div
class=
"box"
[style.marginTop]=
"searchEngineList.length > 0 ? '80px' : '0'"
>
<app-web-list></app-web-list>
<div
*ngIf=
"currentList.length > 0; else noData"
>
<div
*ngFor=
"let item of currentList; let i=index"
>
<div
class=
"nav-wrapper"
>
<app-toolbar-title
[dataSource]=
"item"
(onCollapse)=
"onCollapse(item, i)"
[index]=
"i"
></app-toolbar-title>
<app-toolbar-title
[dataSource]=
"item"
(onCollapse)=
"onCollapse(item, i)"
[index]=
"i"
arrowType=
"2"
>
</app-toolbar-title>
<div
nz-row
[nzGutter]=
"[16, 16]"
[style.display]=
"item.collapsed ? 'none' : ''"
>
<div
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录