Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
兴科Sinco
开源百科
提交
bc0ecc00
开
开源百科
项目概览
兴科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,发现更多精彩内容 >>
提交
bc0ecc00
编写于
2月 16, 2021
作者:
X
xjh22222228
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(#63): Create a website quickly
上级
37252571
变更
23
隐藏空白更改
内联
并排
Showing
23 changed file
with
454 addition
and
400 deletion
+454
-400
README.md
README.md
+1
-0
src/app/app.module.ts
src/app/app.module.ts
+6
-2
src/components/card/index.component.html
src/components/card/index.component.html
+8
-50
src/components/card/index.component.scss
src/components/card/index.component.scss
+12
-0
src/components/card/index.component.ts
src/components/card/index.component.ts
+13
-47
src/components/create-web/index.component.html
src/components/create-web/index.component.html
+91
-0
src/components/create-web/index.component.scss
src/components/create-web/index.component.scss
+0
-0
src/components/create-web/index.component.ts
src/components/create-web/index.component.ts
+145
-0
src/components/fixbar/index.component.html
src/components/fixbar/index.component.html
+1
-1
src/components/login/login.component.html
src/components/login/login.component.html
+0
-0
src/components/login/login.component.scss
src/components/login/login.component.scss
+0
-0
src/components/login/login.component.ts
src/components/login/login.component.ts
+4
-4
src/components/toolbar-title/index.component.html
src/components/toolbar-title/index.component.html
+29
-0
src/components/toolbar-title/index.component.scss
src/components/toolbar-title/index.component.scss
+18
-0
src/components/toolbar-title/index.component.ts
src/components/toolbar-title/index.component.ts
+46
-0
src/view/admin/index.component.html
src/view/admin/index.component.html
+12
-65
src/view/admin/index.component.ts
src/view/admin/index.component.ts
+36
-109
src/view/index/light/index.component.html
src/view/index/light/index.component.html
+3
-29
src/view/index/light/index.component.scss
src/view/index/light/index.component.scss
+0
-16
src/view/index/side/index.component.html
src/view/index/side/index.component.html
+13
-28
src/view/index/side/index.component.scss
src/view/index/side/index.component.scss
+0
-12
src/view/index/sim/index.component.html
src/view/index/sim/index.component.html
+16
-27
src/view/index/sim/index.component.scss
src/view/index/sim/index.component.scss
+0
-10
未找到文件。
README.md
浏览文件 @
bc0ecc00
...
@@ -186,4 +186,5 @@ Thank you for your [contribution](https://github.com/xjh22222228/nav/issues), me
...
@@ -186,4 +186,5 @@ Thank you for your [contribution](https://github.com/xjh22222228/nav/issues), me
| 姓名 | 支持金额 |
| 姓名 | 支持金额 |
| --------------------------------------- |----------- |
| --------------------------------------- |----------- |
|
[
aiyou9
](
https://github.com/aiyou9
)
| ¥20.00 |
|
[
aiyou9
](
https://github.com/aiyou9
)
| ¥20.00 |
| 路人甲 | ¥50.00 |
src/app/app.module.ts
浏览文件 @
bc0ecc00
...
@@ -45,7 +45,9 @@ import { FooterComponent } from '../components/footer/footer.component'
...
@@ -45,7 +45,9 @@ import { FooterComponent } from '../components/footer/footer.component'
import
{
IconGitComponent
}
from
'
../components/icon-git/icon-git.component
'
import
{
IconGitComponent
}
from
'
../components/icon-git/icon-git.component
'
import
{
NoDataComponent
}
from
'
../components/no-data/no-data.component
'
import
{
NoDataComponent
}
from
'
../components/no-data/no-data.component
'
import
{
SearchEngineComponent
}
from
'
../components/search-engine/search-engine.component
'
;
import
{
SearchEngineComponent
}
from
'
../components/search-engine/search-engine.component
'
;
import
{
CreateComponent
}
from
'
../components/create/create.component
'
;
import
{
LoginComponent
}
from
'
../components/login/login.component
'
;
import
{
CreateWebComponent
}
from
'
../components/create-web/index.component
'
;
import
{
ToolbarTitleWebComponent
}
from
'
../components/toolbar-title/index.component
'
;
import
{
NZ_I18N
}
from
'
ng-zorro-antd/i18n
'
;
import
{
NZ_I18N
}
from
'
ng-zorro-antd/i18n
'
;
import
{
zh_CN
}
from
'
ng-zorro-antd/i18n
'
;
import
{
zh_CN
}
from
'
ng-zorro-antd/i18n
'
;
import
{
registerLocaleData
}
from
'
@angular/common
'
;
import
{
registerLocaleData
}
from
'
@angular/common
'
;
...
@@ -100,7 +102,9 @@ const appRoutes: Routes = [
...
@@ -100,7 +102,9 @@ const appRoutes: Routes = [
IconGitComponent
,
IconGitComponent
,
NoDataComponent
,
NoDataComponent
,
SearchEngineComponent
,
SearchEngineComponent
,
CreateComponent
,
LoginComponent
,
CreateWebComponent
,
ToolbarTitleWebComponent
,
LogoComponent
,
LogoComponent
,
CardComponent
CardComponent
],
],
...
...
src/components/card/index.component.html
浏览文件 @
bc0ecc00
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
<nz-dropdown-menu
#menu
="
nzDropdownMenu
"
>
<nz-dropdown-menu
#menu
="
nzDropdownMenu
"
>
<ul
nz-menu
nzSelectable
>
<ul
nz-menu
nzSelectable
>
<li
nz-menu-item
(click)=
"toggleModal()"
>
编辑
</li>
<li
nz-menu-item
(click)=
"toggleModal()
; detail = dataSource
"
>
编辑
</li>
<!-- <a
<!-- <a
nz-popconfirm
nz-popconfirm
nzPopconfirmPlacement="rightTop"
nzPopconfirmPlacement="rightTop"
...
@@ -75,53 +75,11 @@
...
@@ -75,53 +75,11 @@
</ng-template>
</ng-template>
</div>
</div>
<nz-modal
<app-create-web
[(nzVisible)]=
"showModal"
*ngIf=
"showModal"
nzTitle=
"修改"
[visible]=
"showModal"
(nzOnCancel)=
"toggleModal()"
(onCancel)=
"toggleModal()"
(nzOnOk)=
"handleOk()"
(onOk)=
"handleOk($event)"
[detail]=
"dataSource"
>
>
<ng-container
*nzModalContent
>
</app-create-web>
<form
nz-form
[formGroup]=
"validateForm"
(ngSubmit)=
"handleOk()"
>
<nz-form-item>
<nz-form-label
[nzSpan]=
"4"
nzRequired
>
网站名称
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
nzErrorTip=
"请输入名称"
>
<input
formControlName=
"title"
nz-input
placeholder=
"发现导航"
/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[nzSpan]=
"4"
nzRequired
>
网站链接
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
>
<input
formControlName=
"url"
nz-input
placeholder=
"https://nav3.cn"
(blur)=
"onUrlBlur($event)"
/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[nzSpan]=
"4"
>
图标地址
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
>
<nz-input-group
[nzPrefix]=
"prefixIcon"
>
<input
formControlName=
"icon"
nz-input
placeholder=
"https://example.com/favicon.png"
(blur)=
"onIconBlur($event)"
/>
</nz-input-group>
<ng-template
#prefixIcon
>
<app-logo
[src]=
"iconUrl"
[size]=
"25"
*ngIf=
"iconUrl"
></app-logo>
</ng-template>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[nzSpan]=
"4"
>
网站描述
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
>
<textarea
formControlName=
"desc"
placeholder=
"发现导航, 精选实用导航网站"
nz-input
[nzAutosize]=
"{ minRows: 3, maxRows: 5 }"
>
</textarea>
</nz-form-control>
</nz-form-item>
</form>
</ng-container>
</nz-modal>
src/components/card/index.component.scss
浏览文件 @
bc0ecc00
...
@@ -7,6 +7,18 @@
...
@@ -7,6 +7,18 @@
}
}
}
}
.add-wrapper
{
cursor
:
pointer
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
.add-icon
{
font-size
:
50px
;
color
:
#ccc
}
}
::ng-deep
{
::ng-deep
{
.gutter-row
.ant-card
{
.gutter-row
.ant-card
{
height
:
100%
;
height
:
100%
;
...
...
src/components/card/index.component.ts
浏览文件 @
bc0ecc00
...
@@ -2,11 +2,9 @@
...
@@ -2,11 +2,9 @@
// See https://github.com/xjh22222228/nav
// See https://github.com/xjh22222228/nav
import
{
Component
,
OnInit
,
Input
}
from
'
@angular/core
'
import
{
Component
,
OnInit
,
Input
}
from
'
@angular/core
'
import
{
FormBuilder
,
FormGroup
,
Validators
}
from
'
@angular/forms
'
import
{
NzMessageService
}
from
'
ng-zorro-antd/message
'
import
{
NzMessageService
}
from
'
ng-zorro-antd/message
'
import
{
NzNotificationService
}
from
'
ng-zorro-antd/notification
'
import
{
getToken
}
from
'
../../utils/user
'
import
{
getToken
}
from
'
../../utils/user
'
import
{
setWebsiteList
,
getLogoUrl
,
copyText
}
from
'
../../utils
'
import
{
setWebsiteList
,
copyText
}
from
'
../../utils
'
import
{
websiteList
}
from
'
../../store
'
import
{
websiteList
}
from
'
../../store
'
import
{
INavProps
,
ITagProp
,
INavFourProp
}
from
'
../../types
'
import
{
INavProps
,
ITagProp
,
INavFourProp
}
from
'
../../types
'
import
*
as
__tag
from
'
../../../data/tag.json
'
import
*
as
__tag
from
'
../../../data/tag.json
'
...
@@ -21,36 +19,19 @@ const tagMap: ITagProp = (__tag as any).default
...
@@ -21,36 +19,19 @@ const tagMap: ITagProp = (__tag as any).default
export
class
CardComponent
implements
OnInit
{
export
class
CardComponent
implements
OnInit
{
@
Input
()
dataSource
:
INavFourProp
@
Input
()
dataSource
:
INavFourProp
validateForm
!
:
FormGroup
;
objectKeys
=
Object
.
keys
objectKeys
=
Object
.
keys
websiteList
:
INavProps
[]
=
websiteList
websiteList
:
INavProps
[]
=
websiteList
isLogin
:
boolean
=
!!
getToken
()
isLogin
:
boolean
=
!!
getToken
()
showModal
=
false
showModal
=
false
iconUrl
=
''
copyUrlDone
=
false
copyUrlDone
=
false
copyPathDone
=
false
copyPathDone
=
false
tagMap
=
tagMap
tagMap
=
tagMap
constructor
(
constructor
(
private
fb
:
FormBuilder
,
private
message
:
NzMessageService
,
private
message
:
NzMessageService
,
private
notification
:
NzNotificationService
,
)
{}
)
{}
ngOnInit
():
void
{
ngOnInit
():
void
{}
this
.
validateForm
=
this
.
fb
.
group
({
title
:
[
this
.
dataSource
.
name
,
[
Validators
.
required
]],
url
:
[
this
.
dataSource
.
url
,
[
Validators
.
required
]],
icon
:
[
this
.
dataSource
.
icon
||
null
],
desc
:
[
this
.
dataSource
.
desc
||
''
],
});
}
async
onUrlBlur
(
e
)
{
const
res
=
await
getLogoUrl
(
e
.
target
?.
value
)
this
.
iconUrl
=
(
res
||
''
)
as
string
this
.
validateForm
.
get
(
'
icon
'
)
!
.
setValue
(
res
||
''
)
}
async
copyUrl
(
e
,
type
:
number
)
{
async
copyUrl
(
e
,
type
:
number
)
{
const
w
=
this
.
dataSource
const
w
=
this
.
dataSource
...
@@ -70,36 +51,21 @@ export class CardComponent implements OnInit {
...
@@ -70,36 +51,21 @@ export class CardComponent implements OnInit {
this
.
copyPathDone
=
false
this
.
copyPathDone
=
false
}
}
onIconBlur
(
e
)
{
this
.
iconUrl
=
e
.
target
.
value
}
toggleModal
()
{
toggleModal
()
{
this
.
showModal
=
!
this
.
showModal
this
.
showModal
=
!
this
.
showModal
}
}
handleOk
()
{
handleOk
(
payload
:
INavFourProp
)
{
for
(
const
i
in
this
.
validateForm
.
controls
)
{
this
.
dataSource
.
name
=
payload
.
name
this
.
validateForm
.
controls
[
i
].
markAsDirty
();
this
.
dataSource
.
createdAt
=
payload
.
createdAt
this
.
validateForm
.
controls
[
i
].
updateValueAndValidity
();
this
.
dataSource
.
desc
=
payload
.
desc
}
this
.
dataSource
.
icon
=
payload
.
icon
try
{
this
.
dataSource
.
url
=
payload
.
url
let
{
title
,
icon
,
url
,
desc
}
=
this
.
validateForm
.
value
this
.
dataSource
.
urls
=
payload
.
urls
this
.
message
.
success
(
'
修改成功!
'
)
if
(
!
title
)
return
title
=
title
.
trim
()
setWebsiteList
(
this
.
websiteList
)
this
.
toggleModal
()
this
.
dataSource
.
name
=
title
this
.
dataSource
.
icon
=
icon
this
.
dataSource
.
url
=
url
this
.
dataSource
.
desc
=
desc
setWebsiteList
(
this
.
websiteList
)
this
.
message
.
success
(
'
修改成功
'
)
this
.
toggleModal
()
}
catch
(
err
)
{
this
.
notification
.
error
(
'
内部异常
'
,
err
.
message
)
}
}
}
confirmDel
()
{}
confirmDel
()
{}
...
...
src/components/create-web/index.component.html
0 → 100644
浏览文件 @
bc0ecc00
<nz-modal
[(nzVisible)]=
"visible"
[nzTitle]=
"detail ? '编辑' : '新增'"
(nzOnCancel)=
"handleCancel()"
(nzOnOk)=
"handleOk()"
>
<ng-container
*nzModalContent
>
<form
nz-form
[formGroup]=
"validateForm"
>
<nz-form-item>
<nz-form-label
[nzSpan]=
"4"
nzRequired
>
网站名称
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
nzErrorTip=
"请输入名称"
>
<input
formControlName=
"title"
nz-input
placeholder=
"发现导航"
/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[nzSpan]=
"4"
nzRequired
>
网站链接
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
nzErrorTip=
"请输入网站链接"
>
<input
formControlName=
"url"
nz-input
placeholder=
"https://nav3.cn"
(blur)=
"onUrlBlur($event)"
/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[nzSpan]=
"4"
>
图标地址
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
>
<nz-input-group
[nzPrefix]=
"prefixIcon"
>
<input
formControlName=
"icon"
nz-input
placeholder=
"https://example.com/favicon.png"
(blur)=
"onIconBlur($event)"
/>
</nz-input-group>
<ng-template
#prefixIcon
>
<app-logo
[src]=
"iconUrl"
[size]=
"25"
*ngIf=
"iconUrl"
></app-logo>
</ng-template>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-label
[nzSpan]=
"4"
>
网站描述
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
>
<textarea
formControlName=
"desc"
placeholder=
"发现导航, 精选实用导航网站"
nz-input
[nzAutosize]=
"{ minRows: 3, maxRows: 5 }"
>
</textarea>
</nz-form-control>
</nz-form-item>
<!-- more url -->
<div>
<nz-form-item
*ngFor=
"let n of urlArr; let idx = index"
>
<nz-form-label
[nzSpan]=
"4"
[nzNoColon]=
"true"
></nz-form-label>
<nz-form-control
[nzSpan]=
"20"
>
<nz-input-group
[nzAddOnBefore]=
"addOnBeforeTemplate"
[nzAddOnAfter]=
"addOnAfterTemplate"
>
<input
[formControlName]=
"'url' + idx"
type=
"text"
nz-input
/>
</nz-input-group>
<ng-template
#addOnBeforeTemplate
>
<nz-select
style=
"width: 100px;"
[formControlName]=
"'tagVal' + idx"
>
<nz-option
*ngFor=
"let tag of tags"
[nzLabel]=
"tag"
[nzValue]=
"tag"
>
</nz-option>
</nz-select>
</ng-template>
<ng-template
#addOnAfterTemplate
>
<i
class=
"cursor-pointer"
nz-icon
nzType=
"minus"
nzTheme=
"outline"
(click)=
"lessMoreUrl()"
>
</i>
</ng-template>
</nz-form-control>
</nz-form-item>
</div>
<nz-form-item
*ngIf=
"tags.length > 0 && urlArr.length < 3"
>
<nz-form-label
[nzSpan]=
"4"
[nzNoColon]=
"true"
></nz-form-label>
<nz-form-control
[nzSpan]=
"20"
>
<button
nz-button
nzType=
"default"
nzBlock
(click)=
"addMoreUrl()"
>
<i
nz-icon
nzType=
"plus"
></i>
继续添加链接
</button>
</nz-form-control>
</nz-form-item>
</form>
</ng-container>
</nz-modal>
src/components/create-web/index.component.scss
0 → 100644
浏览文件 @
bc0ecc00
src/components/create-web/index.component.ts
0 → 100644
浏览文件 @
bc0ecc00
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav
import
{
Component
,
OnInit
,
Input
,
Output
,
EventEmitter
}
from
'
@angular/core
'
import
{
getLogoUrl
}
from
'
../../utils
'
import
{
FormBuilder
,
FormGroup
,
Validators
}
from
'
@angular/forms
'
import
{
ITagProp
,
INavFourProp
}
from
'
../../types
'
import
*
as
__tag
from
'
../../../data/tag.json
'
const
tagMap
:
ITagProp
=
(
__tag
as
any
).
default
const
tagKeys
=
Object
.
keys
(
tagMap
)
@
Component
({
selector
:
'
app-create-web
'
,
templateUrl
:
'
./index.component.html
'
,
styleUrls
:
[
'
./index.component.scss
'
]
})
export
class
CreateWebComponent
implements
OnInit
{
@
Input
()
detail
:
object
@
Input
()
visible
:
boolean
@
Output
()
onCancel
=
new
EventEmitter
()
@
Output
()
onOk
=
new
EventEmitter
()
validateForm
!
:
FormGroup
;
iconUrl
=
''
urlArr
=
[]
tags
=
tagKeys
tagMap
=
tagMap
constructor
(
private
fb
:
FormBuilder
,
)
{}
ngOnInit
()
{
this
.
validateForm
=
this
.
fb
.
group
({
title
:
[
''
,
[
Validators
.
required
]],
url
:
[
''
,
[
Validators
.
required
]],
url0
:
[
''
],
url1
:
[
''
],
url2
:
[
''
],
tagVal0
:
[
tagKeys
[
0
]],
tagVal1
:
[
tagKeys
[
0
]],
tagVal2
:
[
tagKeys
[
0
]],
icon
:
[
''
],
desc
:
[
''
],
})
}
ngOnChanges
()
{
setTimeout
(()
=>
{
if
(
this
.
visible
)
{
this
.
validateForm
.
reset
()
}
const
detail
=
this
.
detail
as
INavFourProp
if
(
this
.
detail
&&
this
.
visible
)
{
this
.
validateForm
.
get
(
'
title
'
)
!
.
setValue
(
detail
.
name
)
this
.
validateForm
.
get
(
'
icon
'
)
!
.
setValue
(
detail
.
icon
||
''
)
this
.
validateForm
.
get
(
'
url
'
)
!
.
setValue
(
detail
.
url
||
''
)
this
.
validateForm
.
get
(
'
desc
'
)
!
.
setValue
(
detail
.
desc
||
''
)
if
(
typeof
detail
.
urls
===
'
object
'
)
{
let
i
=
0
for
(
let
k
in
detail
.
urls
)
{
this
.
urlArr
.
push
(
null
)
this
.
validateForm
.
get
(
`url
${
i
}
`
)
!
.
setValue
(
detail
.
urls
[
k
])
this
.
validateForm
.
get
(
`tagVal
${
i
}
`
)
!
.
setValue
(
k
)
i
++
}
}
}
},
100
)
}
async
onUrlBlur
(
e
)
{
const
res
=
await
getLogoUrl
(
e
.
target
?.
value
)
this
.
iconUrl
=
(
res
||
''
)
as
string
this
.
validateForm
.
get
(
'
icon
'
)
!
.
setValue
(
res
||
''
)
}
onIconBlur
(
e
)
{
this
.
iconUrl
=
e
.
target
.
value
}
addMoreUrl
()
{
this
.
urlArr
.
push
(
null
)
}
lessMoreUrl
()
{
this
.
urlArr
.
pop
()
}
handleCancel
()
{
this
.
onCancel
.
emit
()
}
handleOk
()
{
for
(
const
i
in
this
.
validateForm
.
controls
)
{
this
.
validateForm
.
controls
[
i
].
markAsDirty
();
this
.
validateForm
.
controls
[
i
].
updateValueAndValidity
();
}
const
createdAt
=
new
Date
().
toISOString
()
let
urls
=
{}
let
{
title
,
icon
,
url
,
desc
,
url0
,
url1
,
url2
,
tagVal0
,
tagVal1
,
tagVal2
}
=
this
.
validateForm
.
value
if
(
!
title
||
!
url
)
return
title
=
title
.
trim
()
if
(
tagVal0
&&
url0
)
{
urls
[
tagVal0
]
=
url0
}
if
(
tagVal1
&&
url1
)
{
urls
[
tagVal1
]
=
url1
}
if
(
tagVal2
&&
url2
)
{
urls
[
tagVal2
]
=
url2
}
const
payload
=
{
name
:
title
,
createdAt
:
(
this
.
detail
as
any
)?.
createdAt
??
createdAt
,
desc
:
desc
||
''
,
icon
,
url
,
urls
}
this
.
iconUrl
=
''
this
.
urlArr
=
[]
this
.
onOk
.
emit
(
payload
)
}
}
src/components/fixbar/index.component.html
浏览文件 @
bc0ecc00
...
@@ -62,4 +62,4 @@
...
@@ -62,4 +62,4 @@
</div>
</div>
</div>
</div>
<app-
create
[visible]=
"showCreateModal"
(onCancel)=
"toggleModal()"
></app-create
>
<app-
login
[visible]=
"showCreateModal"
(onCancel)=
"toggleModal()"
></app-login
>
src/components/
create/create
.component.html
→
src/components/
login/login
.component.html
浏览文件 @
bc0ecc00
文件已移动
src/components/
create/create
.component.scss
→
src/components/
login/login
.component.scss
浏览文件 @
bc0ecc00
文件已移动
src/components/
create/create
.component.ts
→
src/components/
login/login
.component.ts
浏览文件 @
bc0ecc00
...
@@ -8,11 +8,11 @@ import { verifyToken } from '../../services'
...
@@ -8,11 +8,11 @@ import { verifyToken } from '../../services'
import
{
getToken
,
setToken
}
from
'
../../utils/user
'
import
{
getToken
,
setToken
}
from
'
../../utils/user
'
@
Component
({
@
Component
({
selector
:
'
app-
create
'
,
selector
:
'
app-
login
'
,
templateUrl
:
'
./
create
.component.html
'
,
templateUrl
:
'
./
login
.component.html
'
,
styleUrls
:
[
'
./
create
.component.scss
'
]
styleUrls
:
[
'
./
login
.component.scss
'
]
})
})
export
class
Create
Component
implements
OnInit
{
export
class
Login
Component
implements
OnInit
{
@
Input
()
visible
:
boolean
@
Input
()
visible
:
boolean
@
Output
()
onCancel
=
new
EventEmitter
()
@
Output
()
onCancel
=
new
EventEmitter
()
...
...
src/components/toolbar-title/index.component.html
0 → 100644
浏览文件 @
bc0ecc00
<div
class=
"title dark-primary dark-border-color"
*ngIf=
"dataSource && dataSource.title"
>
<span
class=
"cursor-pointer"
(click)=
"onCollapse.emit()"
>
<app-logo
[src]=
"dataSource.icon"
[name]=
"dataSource.title"
colour=
"#ff4d4f"
>
</app-logo>
<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
nz-icon
nzType=
"plus"
nzTheme=
"outline"
class=
"add-icon"
(click)=
"toggleCreateModal()"
></i>
</div>
<app-create-web
*ngIf=
"showCreateModal"
[visible]=
"showCreateModal"
(onCancel)=
"toggleCreateModal()"
(onOk)=
"handleAdd($event)"
>
</app-create-web>
src/components/toolbar-title/index.component.scss
0 → 100644
浏览文件 @
bc0ecc00
.title
{
position
:
relative
;
font-size
:
18px
;
border-bottom
:
1px
solid
#eee
;
padding
:
10px
0
;
color
:
#3f51b5
;
font-weight
:
500
;
display
:
flex
;
margin-bottom
:
15px
;
.add-icon
{
position
:
absolute
;
top
:
50%
;
right
:
20px
;
transform
:
translateY
(
-50%
);
cursor
:
pointer
;
}
}
src/components/toolbar-title/index.component.ts
0 → 100644
浏览文件 @
bc0ecc00
// Copyright @ 2018-2021 xiejiahe. All rights reserved. MIT license.
// See https://github.com/xjh22222228/nav
import
{
Component
,
OnInit
,
Input
,
Output
,
EventEmitter
}
from
'
@angular/core
'
import
{
INavThreeProp
,
INavProps
,
INavFourProp
}
from
'
../../types
'
import
{
NzMessageService
}
from
'
ng-zorro-antd/message
'
import
*
as
__tag
from
'
../../../data/tag.json
'
import
{
queryString
,
setWebsiteList
}
from
'
../../utils
'
import
{
websiteList
}
from
'
../../store
'
@
Component
({
selector
:
'
app-toolbar-title
'
,
templateUrl
:
'
./index.component.html
'
,
styleUrls
:
[
'
./index.component.scss
'
]
})
export
class
ToolbarTitleWebComponent
implements
OnInit
{
@
Input
()
index
:
number
@
Input
()
dataSource
:
INavThreeProp
@
Output
()
onCollapse
=
new
EventEmitter
()
showCreateModal
=
false
websiteList
:
INavProps
[]
=
websiteList
constructor
(
private
message
:
NzMessageService
,
)
{}
ngOnInit
()
{}
toggleCreateModal
()
{
this
.
showCreateModal
=
!
this
.
showCreateModal
}
handleAdd
(
payload
:
INavFourProp
)
{
const
{
page
,
id
}
=
queryString
()
const
w
=
this
.
websiteList
[
page
].
nav
[
id
].
nav
[
this
.
index
].
nav
const
exists
=
w
.
some
(
item
=>
item
.
name
===
payload
.
name
)
if
(
exists
)
{
return
this
.
message
.
error
(
'
请不要重复添加
'
)
}
w
.
unshift
(
payload
)
this
.
message
.
success
(
'
新增成功!
'
)
setWebsiteList
(
this
.
websiteList
)
this
.
toggleCreateModal
()
}
}
src/view/admin/index.component.html
浏览文件 @
bc0ecc00
...
@@ -261,7 +261,7 @@
...
@@ -261,7 +261,7 @@
<button
<button
nz-button
nz-button
nzType=
"primary"
nzType=
"primary"
(click)=
"toggleCreateModal()"
(click)=
"toggleCreate
Web
Modal()"
style=
"margin-left: 20px;"
style=
"margin-left: 20px;"
>
>
添加网站
添加网站
...
@@ -298,7 +298,7 @@
...
@@ -298,7 +298,7 @@
<td>
{{ data.desc }}
</td>
<td>
{{ data.desc }}
</td>
<td>
{{ data.createdAt }}
</td>
<td>
{{ data.createdAt }}
</td>
<td>
<td>
<a
(click)=
"
handleEditBtn(data, idx)
"
>
编辑
</a>
<a
(click)=
"
toggleCreateWebModal(); websiteDetail = data; editIdx = idx
"
>
编辑
</a>
<a
<a
nz-popconfirm
nz-popconfirm
nzPopconfirmTitle=
"您确定要删除吗?"
nzPopconfirmTitle=
"您确定要删除吗?"
...
@@ -315,6 +315,14 @@
...
@@ -315,6 +315,14 @@
</nz-tabset>
</nz-tabset>
</div>
</div>
<app-create-web
[visible]=
"showCreateWebModal"
(onCancel)=
"toggleCreateWebModal()"
(onOk)=
"onOkCreateWeb($event)"
[detail]=
"websiteDetail"
>
</app-create-web>
<nz-modal
<nz-modal
[(nzVisible)]=
"showCreateModal"
[(nzVisible)]=
"showCreateModal"
[nzTitle]=
"isEdit ? '编辑' : '新增'"
[nzTitle]=
"isEdit ? '编辑' : '新增'"
...
@@ -324,24 +332,17 @@
...
@@ -324,24 +332,17 @@
<ng-container
*nzModalContent
>
<ng-container
*nzModalContent
>
<form
nz-form
[formGroup]=
"validateForm"
>
<form
nz-form
[formGroup]=
"validateForm"
>
<nz-form-item>
<nz-form-item>
<nz-form-label
[nzSpan]=
"4"
nzRequired
>
{{ tabActive === 3 ? '网站名称' : '分类名称'}}
</nz-form-label>
<nz-form-label
[nzSpan]=
"4"
nzRequired
>
分类名称
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
nzErrorTip=
"请输入名称"
>
<nz-form-control
[nzSpan]=
"20"
nzErrorTip=
"请输入名称"
>
<input
formControlName=
"title"
nz-input
placeholder=
"发现导航"
/>
<input
formControlName=
"title"
nz-input
placeholder=
"发现导航"
/>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item
*ngIf=
"tabActive === 3"
>
<nz-form-label
[nzSpan]=
"4"
nzRequired
>
网站链接
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
nzErrorTip=
"请输入网站链接"
>
<input
formControlName=
"url"
nz-input
placeholder=
"https://nav3.cn"
(blur)=
"onUrlBlur($event)"
/>
</nz-form-control>
</nz-form-item>
<nz-form-item>
<nz-form-item>
<nz-form-label
[nzSpan]=
"4"
>
图标地址
</nz-form-label>
<nz-form-label
[nzSpan]=
"4"
>
图标地址
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
>
<nz-form-control
[nzSpan]=
"20"
>
<nz-input-group
[nzPrefix]=
"prefixIcon"
>
<nz-input-group
[nzPrefix]=
"prefixIcon"
>
<input
formControlName=
"icon"
nz-input
placeholder=
"https://example.com/favicon.png"
(blur)=
"onIconBlur($event)"
/>
<input
formControlName=
"icon"
nz-input
placeholder=
"https://example.com/favicon.png"
/>
</nz-input-group>
</nz-input-group>
<ng-template
#prefixIcon
>
<ng-template
#prefixIcon
>
...
@@ -349,60 +350,6 @@
...
@@ -349,60 +350,6 @@
</ng-template>
</ng-template>
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item
*ngIf=
"tabActive === 3"
>
<nz-form-label
[nzSpan]=
"4"
>
网站描述
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
>
<textarea
formControlName=
"desc"
placeholder=
"发现导航, 精选实用导航网站"
nz-input
[nzAutosize]=
"{ minRows: 3, maxRows: 5 }"
>
</textarea>
</nz-form-control>
</nz-form-item>
<!-- more url -->
<div
*ngIf=
"tabActive === 3"
>
<nz-form-item
*ngFor=
"let n of urlArr; let idx = index"
>
<nz-form-label
[nzSpan]=
"4"
[nzNoColon]=
"true"
></nz-form-label>
<nz-form-control
[nzSpan]=
"20"
>
<nz-input-group
[nzAddOnBefore]=
"addOnBeforeTemplate"
[nzAddOnAfter]=
"addOnAfterTemplate"
>
<input
[formControlName]=
"'url' + idx"
type=
"text"
nz-input
/>
</nz-input-group>
<ng-template
#addOnBeforeTemplate
>
<nz-select
style=
"width: 100px;"
[formControlName]=
"'tagVal' + idx"
>
<nz-option
*ngFor=
"let tag of tags"
[nzLabel]=
"tag"
[nzValue]=
"tag"
>
</nz-option>
</nz-select>
</ng-template>
<ng-template
#addOnAfterTemplate
>
<i
class=
"cursor-pointer"
nz-icon
nzType=
"minus"
nzTheme=
"outline"
(click)=
"lessMoreUrl()"
>
</i>
</ng-template>
</nz-form-control>
</nz-form-item>
</div>
<nz-form-item
*ngIf=
"tabActive === 3 && tags.length > 0 && urlArr.length < 3"
>
<nz-form-label
[nzSpan]=
"4"
[nzNoColon]=
"true"
></nz-form-label>
<nz-form-control
[nzSpan]=
"20"
>
<button
nz-button
nzType=
"default"
nzBlock
(click)=
"addMoreUrl()"
>
<i
nz-icon
nzType=
"plus"
></i>
继续添加链接
</button>
</nz-form-control>
</nz-form-item>
</form>
</form>
</ng-container>
</ng-container>
</nz-modal>
</nz-modal>
src/view/admin/index.component.ts
浏览文件 @
bc0ecc00
...
@@ -10,15 +10,14 @@ import { NzMessageService } from 'ng-zorro-antd/message'
...
@@ -10,15 +10,14 @@ import { NzMessageService } from 'ng-zorro-antd/message'
import
{
NzModalService
}
from
'
ng-zorro-antd/modal
'
import
{
NzModalService
}
from
'
ng-zorro-antd/modal
'
import
{
NzNotificationService
}
from
'
ng-zorro-antd/notification
'
import
{
NzNotificationService
}
from
'
ng-zorro-antd/notification
'
import
{
FormBuilder
,
FormGroup
,
Validators
}
from
'
@angular/forms
'
import
{
FormBuilder
,
FormGroup
,
Validators
}
from
'
@angular/forms
'
import
{
setWebsiteList
,
getLogoUrl
}
from
'
../../utils
'
import
{
setWebsiteList
}
from
'
../../utils
'
import
{
updateFileContent
}
from
'
../../services
'
import
{
updateFileContent
}
from
'
../../services
'
import
{
DB_PATH
,
LOGO_PATH
}
from
'
../../constants
'
import
{
DB_PATH
,
LOGO_PATH
}
from
'
../../constants
'
import
{
parseBookmark
}
from
'
../../utils/bookmark
'
import
*
as
__tag
from
'
../../../data/tag.json
'
import
*
as
__tag
from
'
../../../data/tag.json
'
import
config
from
'
../../../nav.config
'
import
config
from
'
../../../nav.config
'
import
{
parseBookmark
}
from
'
../../utils/bookmark
'
const
tagMap
:
ITagProp
=
(
__tag
as
any
).
default
const
tagMap
:
ITagProp
=
(
__tag
as
any
).
default
const
tagKeys
=
Object
.
keys
(
tagMap
)
@
Component
({
@
Component
({
selector
:
'
app-admin
'
,
selector
:
'
app-admin
'
,
...
@@ -31,6 +30,7 @@ export default class WebpComponent {
...
@@ -31,6 +30,7 @@ export default class WebpComponent {
gitRepoUrl
=
config
.
gitRepoUrl
gitRepoUrl
=
config
.
gitRepoUrl
isLogin
=
!!
getToken
()
isLogin
=
!!
getToken
()
showCreateModal
=
false
showCreateModal
=
false
showCreateWebModal
=
false
syncLoading
=
false
syncLoading
=
false
uploading
=
false
uploading
=
false
tabActive
=
0
tabActive
=
0
...
@@ -39,11 +39,9 @@ export default class WebpComponent {
...
@@ -39,11 +39,9 @@ export default class WebpComponent {
oneSelect
=
''
oneSelect
=
''
twoSelect
=
''
twoSelect
=
''
threeSelect
=
''
threeSelect
=
''
iconUrl
=
''
urlArr
=
[]
tags
=
tagKeys
tagMap
=
tagMap
tagMap
=
tagMap
objectKeys
=
Object
.
keys
objectKeys
=
Object
.
keys
websiteDetail
:
INavFourProp
|
null
twoTableData
:
INavTwoProp
[]
=
[]
twoTableData
:
INavTwoProp
[]
=
[]
threeTableData
:
INavThreeProp
[]
=
[]
threeTableData
:
INavThreeProp
[]
=
[]
...
@@ -59,16 +57,8 @@ export default class WebpComponent {
...
@@ -59,16 +57,8 @@ export default class WebpComponent {
ngOnInit
()
{
ngOnInit
()
{
this
.
validateForm
=
this
.
fb
.
group
({
this
.
validateForm
=
this
.
fb
.
group
({
title
:
[
''
,
[
Validators
.
required
]],
title
:
[
''
,
[
Validators
.
required
]],
url
:
[
''
,
[
Validators
.
required
]],
url0
:
[
''
],
url1
:
[
''
],
url2
:
[
''
],
tagVal0
:
[
tagKeys
[
0
]],
tagVal1
:
[
tagKeys
[
0
]],
tagVal2
:
[
tagKeys
[
0
]],
icon
:
[
''
],
icon
:
[
''
],
desc
:
[
''
],
})
});
}
}
onBookChange
(
e
)
{
onBookChange
(
e
)
{
...
@@ -133,14 +123,6 @@ export default class WebpComponent {
...
@@ -133,14 +123,6 @@ export default class WebpComponent {
}
}
}
}
addMoreUrl
()
{
this
.
urlArr
.
push
(
null
)
}
lessMoreUrl
()
{
this
.
urlArr
.
pop
()
}
handleReset
()
{
handleReset
()
{
this
.
modal
.
info
({
this
.
modal
.
info
({
nzTitle
:
'
重置初始数据
'
,
nzTitle
:
'
重置初始数据
'
,
...
@@ -160,6 +142,15 @@ export default class WebpComponent {
...
@@ -160,6 +142,15 @@ export default class WebpComponent {
history
.
go
(
-
1
)
history
.
go
(
-
1
)
}
}
toggleCreateWebModal
()
{
if
(
this
.
tabActive
===
3
&&
!
this
.
threeSelect
)
{
return
this
.
message
.
error
(
'
请选择三级分类
'
)
}
this
.
websiteDetail
=
null
this
.
showCreateWebModal
=
!
this
.
showCreateWebModal
}
toggleCreateModal
()
{
toggleCreateModal
()
{
// 检测是否有选择
// 检测是否有选择
if
(
!
this
.
showCreateModal
)
{
if
(
!
this
.
showCreateModal
)
{
...
@@ -169,15 +160,30 @@ export default class WebpComponent {
...
@@ -169,15 +160,30 @@ export default class WebpComponent {
if
(
this
.
tabActive
===
2
&&
!
this
.
twoSelect
)
{
if
(
this
.
tabActive
===
2
&&
!
this
.
twoSelect
)
{
return
this
.
message
.
error
(
'
请选择二级分类
'
)
return
this
.
message
.
error
(
'
请选择二级分类
'
)
}
}
if
(
this
.
tabActive
===
3
&&
!
this
.
threeSelect
)
{
return
this
.
message
.
error
(
'
请选择三级分类
'
)
}
}
}
this
.
isEdit
=
false
this
.
isEdit
=
false
this
.
showCreateModal
=
!
this
.
showCreateModal
this
.
showCreateModal
=
!
this
.
showCreateModal
this
.
validateForm
.
reset
()
this
.
validateForm
.
reset
()
this
.
urlArr
=
[]
}
onOkCreateWeb
(
payload
:
INavFourProp
)
{
// 编辑
if
(
this
.
websiteDetail
)
{
this
.
websiteTableData
[
this
.
editIdx
]
=
payload
}
else
{
// 创建
const
exists
=
this
.
websiteTableData
.
some
(
item
=>
item
.
name
===
payload
.
name
)
if
(
exists
)
{
return
this
.
message
.
error
(
'
请不要重复添加
'
)
}
this
.
websiteTableData
.
unshift
(
payload
)
this
.
message
.
success
(
'
新增成功!
'
)
}
setWebsiteList
(
this
.
websiteList
)
this
.
toggleCreateWebModal
()
}
}
onTabChange
(
index
:
number
)
{
onTabChange
(
index
:
number
)
{
...
@@ -273,36 +279,13 @@ export default class WebpComponent {
...
@@ -273,36 +279,13 @@ export default class WebpComponent {
this
.
websiteTableData
=
findItem
.
nav
this
.
websiteTableData
=
findItem
.
nav
}
}
async
onUrlBlur
(
e
)
{
const
res
=
await
getLogoUrl
(
e
.
target
?.
value
)
this
.
iconUrl
=
(
res
||
''
)
as
string
this
.
validateForm
.
get
(
'
icon
'
)
!
.
setValue
(
res
||
''
)
}
onIconBlur
(
e
)
{
this
.
iconUrl
=
e
.
target
.
value
}
handleEditBtn
(
data
,
editIdx
)
{
handleEditBtn
(
data
,
editIdx
)
{
let
{
title
,
icon
,
url
,
desc
,
name
,
urls
}
=
data
let
{
title
,
icon
,
name
}
=
data
this
.
toggleCreateModal
()
this
.
toggleCreateModal
()
this
.
isEdit
=
true
this
.
isEdit
=
true
this
.
editIdx
=
editIdx
this
.
editIdx
=
editIdx
this
.
urlArr
=
[]
this
.
validateForm
.
get
(
'
title
'
)
!
.
setValue
(
title
||
name
||
''
)
this
.
validateForm
.
get
(
'
title
'
)
!
.
setValue
(
title
||
name
||
''
)
this
.
validateForm
.
get
(
'
icon
'
)
!
.
setValue
(
icon
||
''
)
this
.
validateForm
.
get
(
'
icon
'
)
!
.
setValue
(
icon
||
''
)
this
.
validateForm
.
get
(
'
url
'
)
!
.
setValue
(
url
||
''
)
this
.
validateForm
.
get
(
'
desc
'
)
!
.
setValue
(
desc
||
''
)
if
(
typeof
urls
===
'
object
'
)
{
let
i
=
0
for
(
let
k
in
urls
)
{
this
.
urlArr
.
push
(
null
)
this
.
validateForm
.
get
(
`url
${
i
}
`
)
!
.
setValue
(
urls
[
k
])
this
.
validateForm
.
get
(
`tagVal
${
i
}
`
)
!
.
setValue
(
k
)
i
++
}
}
}
}
handleSync
()
{
handleSync
()
{
...
@@ -343,33 +326,9 @@ export default class WebpComponent {
...
@@ -343,33 +326,9 @@ export default class WebpComponent {
this
.
validateForm
.
controls
[
i
].
updateValueAndValidity
();
this
.
validateForm
.
controls
[
i
].
updateValueAndValidity
();
}
}
const
urls
=
{}
let
{
title
,
icon
}
=
this
.
validateForm
.
value
let
{
title
,
icon
,
url
,
desc
,
tagVal0
,
tagVal1
,
tagVal2
,
url0
,
url1
,
url2
}
=
this
.
validateForm
.
value
if
(
tagVal0
&&
url0
)
{
urls
[
tagVal0
]
=
url0
}
if
(
tagVal1
&&
url1
)
{
urls
[
tagVal1
]
=
url1
}
if
(
tagVal2
&&
url2
)
{
urls
[
tagVal2
]
=
url2
}
if
(
!
title
)
{
if
(
!
title
)
return
return
}
if
(
this
.
isEdit
)
{
if
(
this
.
isEdit
)
{
switch
(
this
.
tabActive
)
{
switch
(
this
.
tabActive
)
{
...
@@ -393,17 +352,6 @@ export default class WebpComponent {
...
@@ -393,17 +352,6 @@ export default class WebpComponent {
this
.
threeTableData
[
this
.
editIdx
].
icon
=
icon
this
.
threeTableData
[
this
.
editIdx
].
icon
=
icon
}
}
break
break
// 编辑网站
case
3
:
{
if
(
!
url
)
return
this
.
websiteTableData
[
this
.
editIdx
].
name
=
title
this
.
websiteTableData
[
this
.
editIdx
].
desc
=
desc
this
.
websiteTableData
[
this
.
editIdx
].
url
=
url
this
.
websiteTableData
[
this
.
editIdx
].
icon
=
icon
this
.
websiteTableData
[
this
.
editIdx
].
urls
=
urls
}
break
}
}
this
.
message
.
success
(
'
保存成功!
'
)
this
.
message
.
success
(
'
保存成功!
'
)
...
@@ -456,33 +404,12 @@ export default class WebpComponent {
...
@@ -456,33 +404,12 @@ export default class WebpComponent {
})
})
}
}
break
break
// 新增网站
case
3
:
{
if
(
!
url
)
return
const
exists
=
this
.
websiteTableData
.
some
(
item
=>
item
.
name
===
title
)
if
(
exists
)
{
return
this
.
message
.
error
(
'
请不要重复添加
'
)
}
this
.
websiteTableData
.
unshift
({
createdAt
,
name
:
title
,
icon
,
url
,
desc
,
urls
})
}
break
}
}
this
.
message
.
success
(
'
新增成功!
'
)
this
.
message
.
success
(
'
新增成功!
'
)
}
}
this
.
iconUrl
=
''
this
.
validateForm
.
reset
()
this
.
validateForm
.
reset
()
this
.
toggleCreateModal
()
this
.
toggleCreateModal
()
this
.
urlArr
=
[]
setWebsiteList
(
this
.
websiteList
)
setWebsiteList
(
this
.
websiteList
)
}
}
}
}
src/view/index/light/index.component.html
浏览文件 @
bc0ecc00
...
@@ -39,37 +39,11 @@
...
@@ -39,37 +39,11 @@
<div
*ngIf=
"currentList.length > 0; else noData"
>
<div
*ngIf=
"currentList.length > 0; else noData"
>
<div
*ngFor=
"let item of currentList; let i=index"
>
<div
*ngFor=
"let item of currentList; let i=index"
>
<div
class=
"title-wrapper dark-border-color"
*ngIf=
"item.title"
>
<app-toolbar-title
[dataSource]=
"item"
(onCollapse)=
"onCollapse(item, i)"
></app-toolbar-title>
<h2
class=
"block-title"
>
<app-logo
[src]=
"item.icon"
[name]=
"item.title"
colour=
"#ff4d4f"
>
</app-logo>
<span
(click)=
"onCollapse(item, i)"
class=
"cursor-pointer dark-primary"
style=
"align-self: center; margin-left: 10px;"
>
{{ item.title }} x {{ item.nav.length }}
</span>
<i
class=
"iconfont iconjiantouarrow483 down-arrow"
[class.active]=
"item.collapsed"
(click)=
"onCollapse(item, i)"
>
</i>
</h2>
</div>
<div
style=
"padding: 0 10px;"
nz-row
[nzGutter]=
"[16, 16]"
*ngIf=
"!item.collapsed"
>
<div
style=
"padding: 0 10px;"
nz-row
[nzGutter]=
"[16, 16]"
*ngIf=
"!item.collapsed"
>
<div
class=
"gutter-row"
nz-col
[nzSpan]=
"8"
*ngFor=
"let el of item.nav;"
>
<div
class=
"gutter-row"
nz-col
[nzSpan]=
"8"
*ngFor=
"let el of item.nav"
>
<app-card
<app-card
[dataSource]=
"el"
></app-card>
[dataSource]=
"el"
>
</app-card>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
src/view/index/light/index.component.scss
浏览文件 @
bc0ecc00
...
@@ -103,21 +103,5 @@
...
@@ -103,21 +103,5 @@
padding-bottom
:
50px
;
padding-bottom
:
50px
;
overflow
:
hidden
;
overflow
:
hidden
;
overflow-y
:
auto
;
overflow-y
:
auto
;
.title-wrapper
{
border-bottom
:
1px
solid
#eee
;
padding
:
10px
30px
10px
15px
;
display
:
flex
;
justify-content
:
space-between
;
margin-bottom
:
15px
;
}
.block-title
{
display
:
inline-block
;
position
:
relative
;
color
:
#3F51B5
;
align-self
:
center
;
display
:
flex
;
}
}
}
}
}
src/view/index/side/index.component.html
浏览文件 @
bc0ecc00
...
@@ -32,38 +32,23 @@
...
@@ -32,38 +32,23 @@
</div>
</div>
<div
class=
"box"
[style.marginTop]=
"searchEngineList.length > 0 ? '80px' : '0'"
>
<div
class=
"box"
[style.marginTop]=
"searchEngineList.length > 0 ? '80px' : '0'"
>
<app-no-data
*ngIf=
"currentList.length === 0 || currentList[0].nav.length === 0"
></app-no-data>
<div
*ngIf=
"currentList.length > 0; else noData"
>
<div
*ngFor=
"let item of currentList; let i=index"
>
<div
*ngFor=
"let item of currentList; let i=index"
>
<div
class=
"nav-wrapper"
>
<div
class=
"nav-wrapper"
>
<app-toolbar-title
[dataSource]=
"item"
(onCollapse)=
"onCollapse(item, i)"
[index]=
"i"
></app-toolbar-title>
<div
class=
"title dark-primary dark-border-color"
<div
nz-row
[nzGutter]=
"[16, 16]"
*ngIf=
"!item.collapsed"
>
*ngIf=
"item.title"
<div
class=
"gutter-row"
nz-col
[nzSpan]=
"6"
*ngFor=
"let el of item.nav"
>
>
<app-card
[dataSource]=
"el"
></app-card>
<span
class=
"cursor-pointer"
(click)=
"onCollapse(item, i)"
>
</div>
<app-logo
[src]=
"item.icon"
[name]=
"item.title"
colour=
"#ff4d4f"
>
</app-logo>
<span
style=
"margin-left: 10px;align-self: center;vertical-align: middle;"
>
{{ item.title }} x {{ item.nav.length }}
</span>
<i
class=
"iconfont iconjiantouarrow483 down-arrow"
[class.active]=
"item.collapsed"
></i>
</span>
</div>
<div
nz-row
[nzGutter]=
"[16, 16]"
*ngIf=
"!item.collapsed"
>
<div
class=
"gutter-row"
nz-col
[nzSpan]=
"6"
*ngFor=
"let el of item.nav; let idx=index"
>
<app-card
[dataSource]=
"el"
>
</app-card>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<ng-template
#noData
>
<app-no-data></app-no-data>
</ng-template>
</div>
</div>
<app-footer
className=
"side-footer"
></app-footer>
<app-footer
className=
"side-footer"
></app-footer>
...
...
src/view/index/side/index.component.scss
浏览文件 @
bc0ecc00
$sideWidth
:
200px
;
$sideWidth
:
200px
;
.layout
{
.layout
{
...
@@ -36,17 +35,6 @@ $sideWidth: 200px;
...
@@ -36,17 +35,6 @@ $sideWidth: 200px;
}
}
}
}
.title
{
font-size
:
18px
;
border-bottom
:
1px
solid
rgba
(
0
,
0
,
0
,
0
.08
);
padding
:
10px
0
;
margin-top
:
15px
;
margin-bottom
:
10px
;
color
:
#3f51b5
;
font-weight
:
500
;
display
:
flex
;
}
.logo
{
.logo
{
z-index
:
11
;
z-index
:
11
;
position
:
fixed
;
position
:
fixed
;
...
...
src/view/index/sim/index.component.html
浏览文件 @
bc0ecc00
...
@@ -33,38 +33,27 @@
...
@@ -33,38 +33,27 @@
</nav>
</nav>
<aside
class=
"site-box dark-bg"
>
<aside
class=
"site-box dark-bg"
>
<div
*ngFor=
"let item of currentList; let i=index"
>
<div
*ngIf=
"currentList.length > 0; else noData"
>
<div
class=
"nav-wrapper"
>
<div
*ngFor=
"let item of currentList; let i=index"
>
<div
<div
class=
"nav-wrapper"
>
class=
"title dark-primary dark-border-color"
<app-toolbar-title
[dataSource]=
"item"
(onCollapse)=
"onCollapse(item, i)"
></app-toolbar-title>
*ngIf=
"item.title"
>
<div
nz-row
[nzGutter]=
"[16, 16]"
*ngIf=
"!item.collapsed"
>
<span
class=
"cursor-pointer"
(click)=
"onCollapse(item, i)"
>
<div
class=
"gutter-row"
nz-col
[nzSpan]=
"8"
*ngFor=
"let el of item.nav; let idx=index"
>
<app-logo
<app-card
[src]=
"item.icon"
[dataSource]=
"el"
[name]=
"item.title"
[index]=
"idx"
colour=
"#ff4d4f"
>
>
</app-card>
</app-logo>
</div>
<span
style=
"margin-left: 10px;align-self: center;vertical-align: middle;"
>
{{ item.title }} x {{ item.nav.length }}
</span>
<i
class=
"iconfont iconjiantouarrow483 down-arrow"
[class.active]=
"item.collapsed"
></i>
</span>
</div>
<div
nz-row
[nzGutter]=
"[16, 16]"
*ngIf=
"!item.collapsed"
>
<div
class=
"gutter-row"
nz-col
[nzSpan]=
"8"
*ngFor=
"let el of item.nav; let idx=index"
>
<app-card
[dataSource]=
"el"
>
</app-card>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<app-no-data
*ngIf=
"currentList.length === 0 || currentList[0].nav.length === 0"
></app-no-data>
<ng-template
#noData
>
<app-no-data></app-no-data>
</ng-template>
</aside>
</aside>
</div>
</div>
</div>
</div>
...
...
src/view/index/sim/index.component.scss
浏览文件 @
bc0ecc00
...
@@ -105,16 +105,6 @@ $width: 1200px;
...
@@ -105,16 +105,6 @@ $width: 1200px;
margin-left
:
30px
;
margin-left
:
30px
;
padding
:
15px
;
padding
:
15px
;
float
:
right
;
float
:
right
;
.title
{
font-size
:
18px
;
border-bottom
:
1px
solid
#eee
;
padding
:
10px
0
;
color
:
#3f51b5
;
font-weight
:
500
;
display
:
flex
;
margin-bottom
:
15px
;
}
}
}
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录