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
9be0fad9
Commit
9be0fad9
authored
Mar 23, 2021
by
yuananting
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:bug修复
parent
db501bd8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
53 additions
and
208 deletions
+53
-208
src/modules/teach-tool/QuestionBankIndex.jsx
+3
-5
src/modules/teach-tool/components/NewQuestionTab.jsx
+0
-0
src/modules/teach-tool/components/NewQuestionTab.less
+21
-14
src/modules/teach-tool/components/QuestionBankSider.jsx
+14
-8
src/modules/teach-tool/components/QuestionEditor.jsx
+4
-5
src/modules/teach-tool/components/QuestionManageContent.jsx
+11
-5
src/modules/teach-tool/components/UploadingProgress.jsx
+0
-85
src/modules/teach-tool/components/UploadingProgress.less
+0
-86
No files found.
src/modules/teach-tool/QuestionBankIndex.jsx
View file @
9be0fad9
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-21 17:51:01
* @LastEditors: yuananting
* @LastEditTime: 2021-03-2
2 14:28:00
* @LastEditTime: 2021-03-2
3 17:44:18
* @Description: 助学工具-题库-题库主页面
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -11,8 +11,6 @@ import React, { Component } from "react";
import
"./QuestionBankIndex.less"
;
import
QuestionBankSider
from
"./components/QuestionBankSider"
;
import
QuestionManageContent
from
"./components/QuestionManageContent"
;
import
User
from
"@/common/js/user"
;
import
QuestionBankService
from
"@/domains/question-bank-domain/QuestionBankService"
;
class
QuestionBankIndex
extends
Component
{
constructor
(
props
)
{
...
...
@@ -31,8 +29,8 @@ class QuestionBankIndex extends Component {
};
updatedSiderTreeFromList
=
(
currentTotal
,
updatedCategoryId
)
=>
{
this
.
setState
({
currentTotal
});
this
.
setState
({
updatedCategoryId
});
this
.
setState
({
currentTotal
});
this
.
setState
({
updatedCategoryId
});
};
render
()
{
...
...
src/modules/teach-tool/components/NewQuestionTab.jsx
View file @
9be0fad9
This diff is collapsed.
Click to expand it.
src/modules/teach-tool/components/NewQuestionTab.less
View file @
9be0fad9
...
...
@@ -41,7 +41,7 @@
.ant-form-item-explain,
.ant-form-item-extra {
font-size: 12px;
width: 7
0
px;
width: 7
8
px;
min-height: 0;
}
...
...
@@ -190,12 +190,16 @@
&::before {
content: attr(data-label);
position: absolute;
left: 1
1
px;
left: 1
5
px;
transform: translateY(-100%);
font-size: 12px;
color: #666666;
line-height: 17px;
}
.ant-radio-wrapper {
margin-right: 0;
}
}
.question-item_true-false {
...
...
@@ -263,8 +267,8 @@
line-height: 44px;
text-align: center;
cursor: pointer;
margin-right: 1
87
px;
margin-left:
22
px;
margin-right: 1
09
px;
margin-left:
106
px;
}
.question-item_other {
...
...
@@ -396,18 +400,21 @@
.gap-tag-input {
margin-right: 5px;
border: 1px solid rgb(165, 165, 165);
}
::-webkit-input-placeholder { /* WebKit browsers */
color: #FF4F4F;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: #FF4F4F;
::-webkit-input-placeholder {
/* WebKit browsers */
color: #ff4f4f;
}
::-moz-placeholder {
/* Mozilla Firefox 19+ */
color: #ff4f4f;
}
:-ms-input-placeholder {
/* Internet Explorer 10+ */
color: #ff4f4f;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
color: #FF4F4F;
}
.ant-input-affix-wrapper {
border: none;
background: #f7f8f9;
...
...
src/modules/teach-tool/components/QuestionBankSider.jsx
View file @
9be0fad9
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-22 10:59:43
* @LastEditors: yuananting
* @LastEditTime: 2021-03-23 1
4:10:18
* @LastEditTime: 2021-03-23 1
6:28:35
* @Description: 助学工具-题库-题库主页面侧边栏
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -34,7 +34,7 @@ class QuestionBankSider extends Component {
}
componentDidMount
()
{
this
.
queryCategoryTree
();
this
.
queryCategoryTree
(
"change"
);
this
.
props
.
getSelectedCategoryId
(
getParameterByName
(
"categoryId"
)
?
[
getParameterByName
(
"categoryId"
)]
...
...
@@ -48,7 +48,7 @@ class QuestionBankSider extends Component {
this
.
props
.
currentTotal
!==
currentTotal
&&
this
.
props
.
updatedCategoryId
===
updatedCategoryId
)
{
this
.
queryCategoryTree
();
this
.
queryCategoryTree
(
"remain"
);
}
return
true
;
}
...
...
@@ -76,7 +76,7 @@ class QuestionBankSider extends Component {
};
// 查询分类树
queryCategoryTree
=
(
categoryName
)
=>
{
queryCategoryTree
=
(
type
,
categoryName
)
=>
{
let
query
=
{
source
:
0
,
categoryName
,
...
...
@@ -96,7 +96,9 @@ class QuestionBankSider extends Component {
Object
.
keys
(
this
.
state
.
treeMap
).
forEach
((
item
)
=>
{
nodeId
.
push
(
item
);
});
this
.
setState
({
expandedKeys
:
nodeId
});
if
(
type
===
"change"
)
{
this
.
setState
({
expandedKeys
:
nodeId
});
}
}
else
{
const
defaultNode
=
{
id
:
"0"
,
...
...
@@ -113,7 +115,9 @@ class QuestionBankSider extends Component {
Object
.
keys
(
this
.
state
.
treeMap
).
forEach
((
item
)
=>
{
nodeId
.
push
(
item
);
});
this
.
setState
({
expandedKeys
:
nodeId
});
if
(
type
===
"change"
)
{
this
.
setState
({
expandedKeys
:
nodeId
});
}
}
}
else
{
this
.
setState
({
autoExpandParent
:
false
});
...
...
@@ -128,7 +132,9 @@ class QuestionBankSider extends Component {
this
.
setState
({
treeData
:
this
.
renderTreeNodes
(
categoryList
,
categoryName
),
});
this
.
setState
({
expandedKeys
:
[]
});
if
(
type
===
"change"
)
{
this
.
setState
({
expandedKeys
:
[]
});
}
}
});
};
...
...
@@ -192,7 +198,7 @@ class QuestionBankSider extends Component {
placeholder=
"搜索名称分类"
onSearch=
{
(
value
)
=>
{
// TODO 调用查询分类接口
this
.
queryCategoryTree
(
value
);
this
.
queryCategoryTree
(
"change"
,
value
);
}
}
/>
{
User
.
getUserRole
()
!==
"CloudLecturer"
&&
(
...
...
src/modules/teach-tool/components/QuestionEditor.jsx
View file @
9be0fad9
...
...
@@ -36,7 +36,6 @@ class QuestionEditor extends Component {
focusFlag
:
false
,
isShowSingleInput
:
true
,
contentLength
:
0
,
errorInput
:
false
,
isGapFilling
:
props
.
isGapFilling
,
contentType
:
props
.
contentType
,
detailInfo
:
props
.
detailInfo
||
{},
...
...
@@ -102,7 +101,7 @@ class QuestionEditor extends Component {
`#editor
${
editorId
}
_tabbar`
,
`#editor
${
editorId
}
_content`
);
editorRoot
.
config
.
menus
=
[
'image'
];
editorRoot
.
config
.
menus
=
[];
editorRoot
.
config
.
uploadImgMaxSize
=
1
*
1024
*
1024
;
editorRoot
.
config
.
customAlert
=
function
(
info
)
{
message
.
warning
(
/1M/
.
test
(
info
)
?
"图片大于1M,请使用图片上传"
:
info
);
...
...
@@ -119,6 +118,7 @@ class QuestionEditor extends Component {
editorRoot
.
config
.
zIndex
=
999
;
editorRoot
.
config
.
placeholder
=
""
;
editorRoot
.
config
.
pasteFilterStyle
=
false
;
editorRoot
.
config
.
pasteIgnoreImg
=
true
;
editorRoot
.
config
.
focus
=
false
;
// 自定义处理粘贴的文本内容
editorRoot
.
config
.
pasteTextHandle
=
function
(
content
)
{
...
...
@@ -287,7 +287,6 @@ class QuestionEditor extends Component {
focusFlag
,
contentLength
,
isShowSingleInput
,
errorInput
,
isGapFilling
,
contentType
,
}
=
this
.
state
;
...
...
@@ -329,7 +328,7 @@ class QuestionEditor extends Component {
}
style=
{
{
border
:
this
.
props
.
validateStatus
===
"error"
?
"1px solid red"
:
""
,
this
.
props
.
validateStatus
===
"error"
||
contentLength
>
limitLength
?
"1px solid red"
:
""
,
}
}
>
<
div
...
...
@@ -337,7 +336,7 @@ class QuestionEditor extends Component {
id=
{
`editor${editorId}_content`
}
></
div
>
<
div
className=
"editor-limit"
>
<
span
style=
{
{
color
:
errorInput
?
"red"
:
""
}
}
>
<
span
style=
{
{
color
:
contentLength
>
limitLength
?
"red"
:
""
}
}
>
{
contentLength
}
</
span
>
/
{
limitLength
}
...
...
src/modules/teach-tool/components/QuestionManageContent.jsx
View file @
9be0fad9
...
...
@@ -2,7 +2,7 @@
* @Author: yuananting
* @Date: 2021-02-25 11:23:47
* @LastEditors: yuananting
* @LastEditTime: 2021-03-23 1
4:13:11
* @LastEditTime: 2021-03-23 1
6:21:52
* @Description: 助学工具-题库-题目管理主页面列表数据
* @Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -102,7 +102,7 @@ class QuestionManageContent extends Component {
return
true
;
}
queryQuestionPageList
=
()
=>
{
queryQuestionPageList
=
(
remain
)
=>
{
const
_query
=
this
.
state
.
query
;
if
(
_query
.
categoryId
===
"0"
)
_query
.
categoryId
=
null
;
QuestionBankService
.
queryQuestionPageList
(
_query
).
then
((
res
)
=>
{
...
...
@@ -145,9 +145,15 @@ class QuestionManageContent extends Component {
QuestionBankService
.
deleteQuestion
(
params
).
then
((
res
)
=>
{
if
(
res
.
success
)
{
message
.
success
(
"删除成功"
);
const
_query
=
this
.
state
.
query
;
_query
.
current
=
1
;
this
.
setState
({
query
:
_query
},
()
=>
this
.
queryQuestionPageList
())
const
{
query
,
total
}
=
this
.
state
;
const
{
size
,
current
}
=
query
;
const
_query
=
query
;
if
(
total
/
size
<
current
)
{
if
(
total
%
size
===
1
)
{
_query
.
current
=
1
;
}
}
this
.
setState
({
query
:
_query
},
()
=>
this
.
queryQuestionPageList
());
}
});
};
...
...
src/modules/teach-tool/components/UploadingProgress.jsx
deleted
100644 → 0
View file @
db501bd8
/*
* @Author: 陈剑宇
* @Date: 2020-05-14 10:29:52
* @LastEditTime: 2021-03-02 10:11:25
* @LastEditors: yuananting
* @Description: 上传文件进度
* @FilePath: /xiaomai-web-b/app/modules/newAcademic_V5/punchClock/components/UploadingProgress.jsx
* @Copyright © 2020 杭州杰竞科技有限公司 版权所有
*/
import
React
,
{
Component
}
from
"react"
;
import
{
Tooltip
}
from
'antd'
;
import
{
FileVerifyMap
,
}
from
"@/common/constants/academic/lessonEnum"
;
import
'./UploadingProgress.less'
;
const
FILE_ICON
=
{
WORD
:
'https://image.xiaomaiketang.com/xm/5CCFBWrRMB.png'
,
PPT
:
'https://image.xiaomaiketang.com/xm/3ypFCHEj3c.png'
,
EXCEL
:
'https://image.xiaomaiketang.com/xm/AijpZjphPn.png'
,
PDF
:
'https://image.xiaomaiketang.com/xm/3kZapsD3Pc.png'
,
VIDEO
:
'https://image.xiaomaiketang.com/xm/rYCcpGaMW3.png'
,
VOICE
:
'https://image.xiaomaiketang.com/xm/XT8eGhNhpb.png'
,
PICTURE
:
'https://image.xiaomaiketang.com/xm/TXt5RHbFfF.png'
,
FAIL
:
'https://image.xiaomaiketang.com/xm/EzmdwZz6mH.png'
}
const
UPLOAD_FAIL
=
{
url
:
'https://image.xiaomaiketang.com/xm/k8bynH452k.png'
,
title
:
'上传失败'
,
}
const
UPLOAD_INIT
=
{
url
:
'https://image.xiaomaiketang.com/xm/JbRFwhAaQ8.png'
,
title
:
'正在上传'
}
class
UploadingProgress
extends
Component
{
// 获取文件类型
getFileType
(
item
)
{
let
fileEnum
=
'FAIL'
;
if
(
FILE_ICON
[
item
.
contentType
])
{
fileEnum
=
item
.
contentType
;
}
else
if
(
FileVerifyMap
[
item
.
fileType
]
&&
FileVerifyMap
[
item
.
fileType
].
type
)
{
fileEnum
=
FileVerifyMap
[
item
.
fileType
].
type
.
toUpperCase
()
}
return
fileEnum
;
}
render
()
{
const
{
fileDesc
,
fileDesc
:
{
contentName
,
progress
=
0
,
status
=
'init'
},
canCancelUpload
,
onAbort
,
onReupload
}
=
this
.
props
;
const
isFail
=
status
===
'fail'
;
const
statusTips
=
isFail
?
UPLOAD_FAIL
:
UPLOAD_INIT
;
let
imgUrl
=
(
isFail
&&
!
canCancelUpload
)
?
FILE_ICON
.
FAIL
:
FILE_ICON
[
this
.
getFileType
(
fileDesc
)];
return
(
<
div
className=
"uploading-progress-box"
>
<
div
className=
"icon-box mr8"
>
<
img
src=
{
imgUrl
}
alt=
""
/>
</
div
>
<
div
className=
"file-box"
>
<
div
className=
"file-info"
>
<
div
className=
"file-title"
>
{
contentName
}
</
div
>
<
div
className=
"file-status"
>
<
img
src=
{
statusTips
.
url
}
alt=
""
/>
<
span
>
{
statusTips
.
title
}
</
span
>
</
div
>
</
div
>
{
(
!
isFail
||
canCancelUpload
)
&&
<
div
className=
"file-progress-box"
>
<
div
className=
"file-progress"
style=
{
{
width
:
`${progress}%`
}
}
></
div
>
</
div
>
}
</
div
>
{
canCancelUpload
&&
[
'init'
,
'fail'
].
includes
(
status
)
&&
<
div
className=
"file-extra-box"
>
<
Tooltip
title=
"取消上传"
><
span
className=
"icon iconfont"
onClick=
{
()
=>
onAbort
&&
onAbort
()
}
style=
{
{
transform
:
"scale(.8)"
}
}
>

</
span
></
Tooltip
>
{
status
===
'fail'
&&
<
Tooltip
title=
'重新上传'
><
span
className=
"icon iconfont"
onClick=
{
()
=>
onReupload
&&
onReupload
()
}
>

</
span
></
Tooltip
>
}
</
div
>
}
</
div
>
)
}
}
export
default
UploadingProgress
;
\ No newline at end of file
src/modules/teach-tool/components/UploadingProgress.less
deleted
100644 → 0
View file @
db501bd8
.uploading-progress-box {
display: flex;
align-items: center;
.icon-box {
height: 44px;
width: 44px;
text-align: center;
img {
height: 100%;
}
}
.file-box {
width: 243px;
display: flex;
flex-direction: column;
justify-content: space-between;
line-height: unset;
.file- {
&info {
flex: 1;
display: flex;
align-items: center;
justify-content: space-between;
}
&title {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
font-size: 12px;
color: #666666;
line-height: 17px;
}
&status {
flex-shrink: 0;
img {
width: 14px;
height: 14px;
font-size: 0;
margin-right: 4px;
}
span {
font-size: 12px;
color: #999999;
line-height: 17px;
}
}
&progress-box {
position: relative;
height: 4px;
border-radius: 2px;
background-color: #F0F2F5;
margin-top: 10px;
}
&progress {
position: absolute;
top: 0;
bottom: 0;
left: 0;
background-image: linear-gradient(90deg, #FBD140 0%, #FFA201 100%);
border-radius: inherit;
}
}
}
.file-extra-box {
margin-left: 40px;
.icon {
color: #BFBFBF;
font-size: 14px;
margin-left: 12px;
cursor: pointer;
}
}
}
\ No newline at end of file
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