Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
66117db6
Commit
66117db6
authored
Apr 09, 2021
by
zangsuyun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
style:全局按钮样式修改
parent
6714a322
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
7 deletions
+72
-7
src/core/antd.less
+1
-1
src/modules/knowledge-base/components/KnowledgeBaseList.jsx
+71
-6
No files found.
src/core/antd.less
View file @
66117db6
...
@@ -659,7 +659,7 @@ td.ant-table-column-sort{
...
@@ -659,7 +659,7 @@ td.ant-table-column-sort{
}
}
&:focus,
&:focus,
&:active{
&:active{
color:#
C6C6C
6 !important;
color:#
66
6 !important;
border:1px solid #C6C6C6 !important;
border:1px solid #C6C6C6 !important;
}
}
}
}
...
...
src/modules/knowledge-base/components/KnowledgeBaseList.jsx
View file @
66117db6
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: zangsuyun
* @Author: zangsuyun
* @Date: 2021-03-12 14:49:40
* @Date: 2021-03-12 14:49:40
* @LastEditors: zangsuyun
* @LastEditors: zangsuyun
* @LastEditTime: 2021-04-0
7 13:49:59
* @LastEditTime: 2021-04-0
9 10:18:44
* @Copyright: © 2020 杭州杰竞科技有限公司 版权所有
* @Copyright: © 2020 杭州杰竞科技有限公司 版权所有
*/
*/
...
@@ -13,11 +13,13 @@ import { Route, withRouter } from "react-router-dom";
...
@@ -13,11 +13,13 @@ import { Route, withRouter } from "react-router-dom";
import
{
PageControl
}
from
"@/components"
;
import
{
PageControl
}
from
"@/components"
;
import
{
LIVE_SHARE_MAP
}
from
"@/common/constants/academic/cloudClass"
;
import
{
LIVE_SHARE_MAP
}
from
"@/common/constants/academic/cloudClass"
;
import
{
appId
,
shareUrl
,
LIVE_SHARE
}
from
"@/domains/course-domain/constants"
;
import
{
appId
,
shareUrl
,
LIVE_SHARE
}
from
"@/domains/course-domain/constants"
;
import
ScanFileModal
from
"../../resource-disk/modal/ScanFileModal"
;
import
WatchData
from
"./WatchData"
;
import
WatchData
from
"./WatchData"
;
import
KnowledgeAPI
from
"@/data-source/knowledge/request-api"
;
import
KnowledgeAPI
from
"@/data-source/knowledge/request-api"
;
import
ENUM
from
"../ENUM.js"
;
import
ENUM
from
"../ENUM.js"
;
import
"./KnowledgeBaseList.less"
;
import
"./KnowledgeBaseList.less"
;
const
DEFAULT_SIZE_UNIT
=
1000
*
1000
;
// 将B转换成M
const
{
confirm
}
=
Modal
;
const
{
confirm
}
=
Modal
;
const
ENV
=
process
.
env
.
DEPLOY_ENV
||
"dev"
;
const
ENV
=
process
.
env
.
DEPLOY_ENV
||
"dev"
;
...
@@ -25,8 +27,8 @@ class KnowledgeBaseList extends React.Component {
...
@@ -25,8 +27,8 @@ class KnowledgeBaseList extends React.Component {
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
this
.
state
=
{
id
:
""
,
// 视频课ID
id
:
""
,
s
tudentIds
:
[],
s
canFileModal
:
null
};
};
}
}
...
@@ -81,6 +83,62 @@ class KnowledgeBaseList extends React.Component {
...
@@ -81,6 +83,62 @@ class KnowledgeBaseList extends React.Component {
});
});
};
};
// 预览文件
handleScanFile
=
(
folder
)
=>
{
console
.
log
(
folder
);
const
{
folderFormat
,
folderSize
,
ossUrl
}
=
folder
;
switch
(
folderFormat
)
{
case
"PDF"
:
window
.
open
(
ossUrl
,
"_blank"
);
break
;
case
"WORD"
:
case
"DOCX"
:
case
"DOC"
:
case
"EXCEL"
:
case
"PPT"
:
case
"PPTX"
:
case
"PDF"
:
if
(
((
folderFormat
===
"PPT"
||
folderFormat
===
"PPTX"
||
folderFormat
===
"DOCX"
||
folderFormat
===
"WORD"
||
folderFormat
===
"DOC"
)
&&
folderSize
>
10
*
DEFAULT_SIZE_UNIT
)
||
(
folderFormat
===
"EXCEL"
&&
folderSize
>
5
*
DEFAULT_SIZE_UNIT
)
)
{
Modal
.
confirm
({
title
:
"抱歉,不能在线预览"
,
content
:
"由于文件较大,不支持在线预览,请下载后再查看"
,
// icon: <Icon type="question-circle" theme="filled" style={{ color: '#FF8534' }}></Icon>,
okText
:
"下载"
,
onOk
:
()
=>
{
const
a
=
document
.
createElement
(
"a"
);
a
.
href
=
ossUrl
;
a
.
click
();
},
});
break
;
}
const
prefixUrl
=
"https://view.officeapps.live.com/op/view.aspx?src="
;
const
scanUrl
=
`
${
prefixUrl
}${
encodeURIComponent
(
ossUrl
)}
`
;
window
.
open
(
scanUrl
,
"_blank"
);
break
;
default
:
const
scanFileModal
=
(
<
ScanFileModal
fileType=
{
folderFormat
}
item=
{
folder
}
close=
{
()
=>
{
this
.
setState
({
scanFileModal
:
null
});
}
}
/>
);
this
.
setState
({
scanFileModal
});
break
;
}
};
// 请求表头
// 请求表头
parseColumns
=
()
=>
{
parseColumns
=
()
=>
{
const
{
query
,
totalCount
}
=
this
.
props
;
const
{
query
,
totalCount
}
=
this
.
props
;
...
@@ -268,7 +326,12 @@ class KnowledgeBaseList extends React.Component {
...
@@ -268,7 +326,12 @@ class KnowledgeBaseList extends React.Component {
)
}
)
}
{
type
===
"FOLDER"
&&
(
{
type
===
"FOLDER"
&&
(
<
div
className=
"record__item"
>
<
div
className=
"record__item"
onClick=
{
()
=>
{
this
.
handleScanFile
(
record
.
source
);
}
}
>
<
div
<
div
className=
{
`folder-type ${
className=
{
`folder-type ${
record.source && record.source.folderFormat
record.source && record.source.folderFormat
...
@@ -341,7 +404,7 @@ class KnowledgeBaseList extends React.Component {
...
@@ -341,7 +404,7 @@ class KnowledgeBaseList extends React.Component {
// fixed: "right",
// fixed: "right",
render
:
(
val
,
record
,
index
)
=>
{
render
:
(
val
,
record
,
index
)
=>
{
console
.
log
(
this
.
props
.
categoryId
);
console
.
log
(
this
.
props
.
categoryId
);
return
this
.
props
.
categoryId
===
'0'
?
(
return
this
.
props
.
categoryId
===
"0"
?
(
<
div
className=
"operate"
>
<
div
className=
"operate"
>
<
div
<
div
className=
"operate__item"
className=
"operate__item"
...
@@ -442,7 +505,6 @@ class KnowledgeBaseList extends React.Component {
...
@@ -442,7 +505,6 @@ class KnowledgeBaseList extends React.Component {
render
()
{
render
()
{
const
{
dataSource
=
[],
totalCount
,
query
,
match
}
=
this
.
props
;
const
{
dataSource
=
[],
totalCount
,
query
,
match
}
=
this
.
props
;
const
{
current
,
size
}
=
query
;
const
{
current
,
size
}
=
query
;
return
(
return
(
<
div
className=
"knowledge-base-list"
>
<
div
className=
"knowledge-base-list"
>
...
@@ -473,6 +535,9 @@ class KnowledgeBaseList extends React.Component {
...
@@ -473,6 +535,9 @@ class KnowledgeBaseList extends React.Component {
</
div
>
</
div
>
<
Route
path=
{
`${match.url}/course-data`
}
component=
{
WatchData
}
/>
<
Route
path=
{
`${match.url}/course-data`
}
component=
{
WatchData
}
/>
{
this
.
state
.
scanFileModal
}
</
div
>
</
div
>
);
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment