Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
兴科Sinco
开源百科
提交
d4703dc4
开
开源百科
项目概览
兴科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,发现更多精彩内容 >>
提交
d4703dc4
编写于
2月 17, 2021
作者:
X
xjh22222228
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(#76): add rate
上级
19119a4c
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
47 addition
and
15 deletion
+47
-15
src/app/app.module.ts
src/app/app.module.ts
+2
-0
src/components/card/index.component.html
src/components/card/index.component.html
+9
-0
src/components/card/index.component.scss
src/components/card/index.component.scss
+5
-0
src/components/card/index.component.ts
src/components/card/index.component.ts
+6
-0
src/components/create-web/index.component.html
src/components/create-web/index.component.html
+8
-1
src/components/create-web/index.component.ts
src/components/create-web/index.component.ts
+4
-0
src/components/logo/logo.component.scss
src/components/logo/logo.component.scss
+0
-3
src/components/logo/logo.component.ts
src/components/logo/logo.component.ts
+5
-0
src/components/search-engine/search-engine.component.html
src/components/search-engine/search-engine.component.html
+1
-1
src/components/search-engine/search-engine.component.scss
src/components/search-engine/search-engine.component.scss
+0
-5
src/components/toolbar-title/index.component.html
src/components/toolbar-title/index.component.html
+2
-2
src/components/toolbar-title/index.component.scss
src/components/toolbar-title/index.component.scss
+1
-0
src/types/index.d.ts
src/types/index.d.ts
+1
-0
src/utils/index.ts
src/utils/index.ts
+1
-0
src/view/admin/index.component.ts
src/view/admin/index.component.ts
+1
-2
src/view/index/light/index.component.html
src/view/index/light/index.component.html
+1
-1
未找到文件。
src/app/app.module.ts
浏览文件 @
d4703dc4
...
@@ -29,6 +29,7 @@ import { NzMenuModule } from 'ng-zorro-antd/menu'
...
@@ -29,6 +29,7 @@ import { NzMenuModule } from 'ng-zorro-antd/menu'
import
{
NzTableModule
}
from
'
ng-zorro-antd/table
'
import
{
NzTableModule
}
from
'
ng-zorro-antd/table
'
import
{
NzTabsModule
}
from
'
ng-zorro-antd/tabs
'
import
{
NzTabsModule
}
from
'
ng-zorro-antd/tabs
'
import
{
NzTagModule
}
from
'
ng-zorro-antd/tag
'
import
{
NzTagModule
}
from
'
ng-zorro-antd/tag
'
import
{
NzRateModule
}
from
'
ng-zorro-antd/rate
'
import
{
DragDropModule
}
from
'
@angular/cdk/drag-drop
'
import
{
DragDropModule
}
from
'
@angular/cdk/drag-drop
'
// components
// components
...
@@ -131,6 +132,7 @@ const appRoutes: Routes = [
...
@@ -131,6 +132,7 @@ const appRoutes: Routes = [
NzTableModule
,
NzTableModule
,
NzTabsModule
,
NzTabsModule
,
NzTagModule
,
NzTagModule
,
NzRateModule
,
DragDropModule
,
DragDropModule
,
BrowserModule
,
BrowserModule
,
FormsModule
,
FormsModule
,
...
...
src/components/card/index.component.html
浏览文件 @
d4703dc4
...
@@ -6,6 +6,15 @@
...
@@ -6,6 +6,15 @@
nzHoverable
nzHoverable
nzType=
"inner"
nzType=
"inner"
>
>
<div
class=
"rate"
>
<nz-rate
[ngModel]=
"dataSource.rate"
[nzDisabled]=
"!isLogin"
nzAllowHalf
(ngModelChange)=
"onRateChange($event)"
>
</nz-rate>
</div>
<a
[href]=
"dataSource.url"
target=
"_blank"
rel=
"noreferer noopener"
>
<a
[href]=
"dataSource.url"
target=
"_blank"
rel=
"noreferer noopener"
>
<nz-card-meta
<nz-card-meta
[nzTitle]=
"title"
[nzTitle]=
"title"
...
...
src/components/card/index.component.scss
浏览文件 @
d4703dc4
...
@@ -2,6 +2,11 @@
...
@@ -2,6 +2,11 @@
position
:
relative
;
position
:
relative
;
height
:
100%
;
height
:
100%
;
.rate
{
margin-bottom
:
10px
;
margin-top
:
-10px
;
}
.desc
{
.desc
{
color
:
rgba
(
0
,
0
,
0
,.
45
);
color
:
rgba
(
0
,
0
,
0
,.
45
);
}
}
...
...
src/components/card/index.component.ts
浏览文件 @
d4703dc4
...
@@ -55,12 +55,18 @@ export class CardComponent implements OnInit {
...
@@ -55,12 +55,18 @@ export class CardComponent implements OnInit {
this
.
showModal
=
!
this
.
showModal
this
.
showModal
=
!
this
.
showModal
}
}
onRateChange
(
n
:
number
)
{
this
.
dataSource
.
rate
=
n
setWebsiteList
(
this
.
websiteList
)
}
handleOk
(
payload
:
INavFourProp
)
{
handleOk
(
payload
:
INavFourProp
)
{
this
.
dataSource
.
name
=
payload
.
name
this
.
dataSource
.
name
=
payload
.
name
this
.
dataSource
.
createdAt
=
payload
.
createdAt
this
.
dataSource
.
createdAt
=
payload
.
createdAt
this
.
dataSource
.
desc
=
payload
.
desc
this
.
dataSource
.
desc
=
payload
.
desc
this
.
dataSource
.
icon
=
payload
.
icon
this
.
dataSource
.
icon
=
payload
.
icon
this
.
dataSource
.
url
=
payload
.
url
this
.
dataSource
.
url
=
payload
.
url
this
.
dataSource
.
rate
=
payload
.
rate
this
.
dataSource
.
urls
=
payload
.
urls
this
.
dataSource
.
urls
=
payload
.
urls
this
.
message
.
success
(
'
修改成功!
'
)
this
.
message
.
success
(
'
修改成功!
'
)
...
...
src/components/create-web/index.component.html
浏览文件 @
d4703dc4
...
@@ -21,6 +21,13 @@
...
@@ -21,6 +21,13 @@
</nz-form-control>
</nz-form-control>
</nz-form-item>
</nz-form-item>
<nz-form-item>
<nz-form-label
[nzSpan]=
"4"
>
推荐指数
</nz-form-label>
<nz-form-control
[nzSpan]=
"20"
>
<nz-rate
formControlName=
"rate"
nzAllowHalf
></nz-rate>
</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"
>
...
@@ -35,7 +42,7 @@
...
@@ -35,7 +42,7 @@
<i
nz-icon
nzType=
"loading"
nzTheme=
"outline"
*ngIf=
"uploading; else loading"
></i>
<i
nz-icon
nzType=
"loading"
nzTheme=
"outline"
*ngIf=
"uploading; else loading"
></i>
<ng-template
#loading
>
<ng-template
#loading
>
<label
id=
"file"
>
<label
id=
"file"
>
<i
nz-icon
nzType=
"upload"
nzTheme=
"outline"
class=
"cursor-pointer"
></i>
<i
nz-icon
nzType=
"upload"
nzTheme=
"outline"
class=
"cursor-pointer"
title=
"上传"
></i>
<input
<input
type=
"file"
type=
"file"
name=
"file"
name=
"file"
...
...
src/components/create-web/index.component.ts
浏览文件 @
d4703dc4
...
@@ -41,6 +41,7 @@ export class CreateWebComponent implements OnInit {
...
@@ -41,6 +41,7 @@ export class CreateWebComponent implements OnInit {
this
.
validateForm
=
this
.
fb
.
group
({
this
.
validateForm
=
this
.
fb
.
group
({
title
:
[
''
,
[
Validators
.
required
]],
title
:
[
''
,
[
Validators
.
required
]],
url
:
[
''
,
[
Validators
.
required
]],
url
:
[
''
,
[
Validators
.
required
]],
rate
:
[
0
],
url0
:
[
''
],
url0
:
[
''
],
url1
:
[
''
],
url1
:
[
''
],
url2
:
[
''
],
url2
:
[
''
],
...
@@ -63,6 +64,7 @@ export class CreateWebComponent implements OnInit {
...
@@ -63,6 +64,7 @@ export class CreateWebComponent implements OnInit {
this
.
validateForm
.
get
(
'
title
'
)
!
.
setValue
(
detail
.
name
)
this
.
validateForm
.
get
(
'
title
'
)
!
.
setValue
(
detail
.
name
)
this
.
validateForm
.
get
(
'
icon
'
)
!
.
setValue
(
detail
.
icon
||
''
)
this
.
validateForm
.
get
(
'
icon
'
)
!
.
setValue
(
detail
.
icon
||
''
)
this
.
validateForm
.
get
(
'
url
'
)
!
.
setValue
(
detail
.
url
||
''
)
this
.
validateForm
.
get
(
'
url
'
)
!
.
setValue
(
detail
.
url
||
''
)
this
.
validateForm
.
get
(
'
rate
'
)
!
.
setValue
(
detail
.
rate
)
this
.
validateForm
.
get
(
'
desc
'
)
!
.
setValue
(
detail
.
desc
||
''
)
this
.
validateForm
.
get
(
'
desc
'
)
!
.
setValue
(
detail
.
desc
||
''
)
if
(
typeof
detail
.
urls
===
'
object
'
)
{
if
(
typeof
detail
.
urls
===
'
object
'
)
{
...
@@ -151,6 +153,7 @@ export class CreateWebComponent implements OnInit {
...
@@ -151,6 +153,7 @@ export class CreateWebComponent implements OnInit {
title
,
title
,
icon
,
icon
,
url
,
url
,
rate
,
desc
,
desc
,
url0
,
url0
,
url1
,
url1
,
...
@@ -177,6 +180,7 @@ export class CreateWebComponent implements OnInit {
...
@@ -177,6 +180,7 @@ export class CreateWebComponent implements OnInit {
const
payload
=
{
const
payload
=
{
name
:
title
,
name
:
title
,
createdAt
:
(
this
.
detail
as
any
)?.
createdAt
??
createdAt
,
createdAt
:
(
this
.
detail
as
any
)?.
createdAt
??
createdAt
,
rate
:
rate
??
0
,
desc
:
desc
||
''
,
desc
:
desc
||
''
,
icon
,
icon
,
url
,
url
,
...
...
src/components/logo/logo.component.scss
浏览文件 @
d4703dc4
.icon
{
.icon
{
display
:
inline-block
;
display
:
inline-block
;
vertical-align
:
middle
;
vertical-align
:
middle
;
border-radius
:
50%
;
pointer-events
:
none
;
pointer-events
:
none
;
border
:
1px
solid
#eee
;
background-color
:
#fff
;
}
}
src/components/logo/logo.component.ts
浏览文件 @
d4703dc4
...
@@ -12,6 +12,7 @@ export class LogoComponent {
...
@@ -12,6 +12,7 @@ export class LogoComponent {
@
Input
()
name
:
string
@
Input
()
name
:
string
@
Input
()
colour
:
string
@
Input
()
colour
:
string
@
Input
()
size
:
number
@
Input
()
size
:
number
@
Input
()
check
:
boolean
=
true
hasError
=
true
hasError
=
true
color
=
'
#1890ff
'
color
=
'
#1890ff
'
...
@@ -28,6 +29,10 @@ export class LogoComponent {
...
@@ -28,6 +29,10 @@ export class LogoComponent {
}
}
ngAfterViewInit
()
{
ngAfterViewInit
()
{
if
(
!
this
.
check
)
{
this
.
hasError
=
false
return
}
setTimeout
(
async
()
=>
{
setTimeout
(
async
()
=>
{
const
isValid
=
await
isValidImg
(
this
.
url
)
const
isValid
=
await
isValidImg
(
this
.
url
)
if
(
isValid
)
{
if
(
isValid
)
{
...
...
src/components/search-engine/search-engine.component.html
浏览文件 @
d4703dc4
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
*ngFor=
"let item of searchEngineList; let i=index"
*ngFor=
"let item of searchEngineList; let i=index"
(click)=
"clickEngineItem(i)"
(click)=
"clickEngineItem(i)"
>
>
<
img
class=
"icon"
[src]=
"item.icon"
alt=
""
/
>
<
app-logo
[src]=
"item.icon"
[size]=
"20"
[check]=
"false"
></app-logo
>
<span
class=
"name dark-text"
>
{{ item.name }}
</span>
<span
class=
"name dark-text"
>
{{ item.name }}
</span>
</div>
</div>
</div>
</div>
...
...
src/components/search-engine/search-engine.component.scss
浏览文件 @
d4703dc4
...
@@ -73,11 +73,6 @@ $width: 500px;
...
@@ -73,11 +73,6 @@ $width: 500px;
margin-right
:
15px
;
margin-right
:
15px
;
}
}
.icon
{
width
:
20px
;
height
:
20px
;
}
.name
{
.name
{
margin-left
:
10px
;
margin-left
:
10px
;
font-size
:
16px
;
font-size
:
16px
;
...
...
src/components/toolbar-title/index.component.html
浏览文件 @
d4703dc4
...
@@ -3,12 +3,12 @@
...
@@ -3,12 +3,12 @@
*ngIf=
"dataSource && dataSource.title"
*ngIf=
"dataSource && dataSource.title"
>
>
<span
class=
"cursor-pointer"
(click)=
"onCollapse.emit()"
>
<span
class=
"cursor-pointer"
(click)=
"onCollapse.emit()"
>
<app-logo
<
!-- <
app-logo
[src]="dataSource.icon"
[src]="dataSource.icon"
[name]="dataSource.title"
[name]="dataSource.title"
colour="#ff4d4f"
colour="#ff4d4f"
>
>
</app-logo>
</app-logo>
-->
<span
style=
"margin-left: 10px;align-self: center;vertical-align: middle;"
>
<span
style=
"margin-left: 10px;align-self: center;vertical-align: middle;"
>
{{ dataSource.title }} x {{ dataSource.nav.length }}
{{ dataSource.title }} x {{ dataSource.nav.length }}
...
...
src/components/toolbar-title/index.component.scss
浏览文件 @
d4703dc4
...
@@ -3,6 +3,7 @@
...
@@ -3,6 +3,7 @@
font-size
:
18px
;
font-size
:
18px
;
border-bottom
:
1px
solid
#eee
;
border-bottom
:
1px
solid
#eee
;
padding
:
10px
0
;
padding
:
10px
0
;
padding-left
:
20px
;
color
:
#3f51b5
;
color
:
#3f51b5
;
font-weight
:
500
;
font-weight
:
500
;
display
:
flex
;
display
:
flex
;
...
...
src/types/index.d.ts
浏览文件 @
d4703dc4
...
@@ -18,6 +18,7 @@ export interface ITagProp {
...
@@ -18,6 +18,7 @@ export interface ITagProp {
export
interface
INavFourProp
{
export
interface
INavFourProp
{
icon
?:
string
|
null
icon
?:
string
|
null
createdAt
?:
string
createdAt
?:
string
rate
?:
number
name
:
string
name
:
string
desc
:
string
desc
:
string
url
:
string
url
:
string
...
...
src/utils/index.ts
浏览文件 @
d4703dc4
...
@@ -174,6 +174,7 @@ export function adapterWebsiteList(websiteList: any[], parentItem?: any) {
...
@@ -174,6 +174,7 @@ export function adapterWebsiteList(websiteList: any[], parentItem?: any) {
}
}
item
.
urls
||=
{}
item
.
urls
||=
{}
item
.
rate
??=
5
}
}
}
}
...
...
src/view/admin/index.component.ts
浏览文件 @
d4703dc4
...
@@ -318,8 +318,7 @@ export default class WebpComponent {
...
@@ -318,8 +318,7 @@ export default class WebpComponent {
}
}
handleOk
()
{
handleOk
()
{
const
now
=
new
Date
()
const
createdAt
=
new
Date
().
toISOString
()
const
createdAt
=
now
.
toISOString
()
for
(
const
i
in
this
.
validateForm
.
controls
)
{
for
(
const
i
in
this
.
validateForm
.
controls
)
{
this
.
validateForm
.
controls
[
i
].
markAsDirty
();
this
.
validateForm
.
controls
[
i
].
markAsDirty
();
...
...
src/view/index/light/index.component.html
浏览文件 @
d4703dc4
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
<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"
>
<app-toolbar-title
[dataSource]=
"item"
(onCollapse)=
"onCollapse(item, i)"
></app-toolbar-title>
<app-toolbar-title
[dataSource]=
"item"
(onCollapse)=
"onCollapse(item, i)"
[index]=
"i"
></app-toolbar-title>
<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"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录