Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
zhangjing
class-resource-admin
Commits
b263c6e0
Commit
b263c6e0
authored
4 years ago
by
zhangjing
Browse files
Options
Download
Email Patches
Plain Diff
关于课时的选择
parent
89fe9670
master
classroom2022
dev
thtf-logo
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/api/sync.js
+8
-0
src/api/sync.js
src/views/resource/handle-sync/asset/rules.js
+3
-1
src/views/resource/handle-sync/asset/rules.js
src/views/resource/handle-sync/index.js
+53
-25
src/views/resource/handle-sync/index.js
src/views/resource/handle-sync/index.scss
+8
-1
src/views/resource/handle-sync/index.scss
src/views/resource/handle-sync/index.vue
+17
-0
src/views/resource/handle-sync/index.vue
with
89 additions
and
27 deletions
+89
-27
src/api/sync.js
View file @
b263c6e0
...
...
@@ -123,3 +123,11 @@ export function getKnowledgePointsInfoList(data) {
}
// 根据课程id获取课时数据
export
function
getCourseLessonData
(
params
)
{
return
request
({
url
:
'
/auth/studentCourseTable/showTimeList
'
,
method
:
'
get
'
,
params
})
}
This diff is collapsed.
Click to expand it.
src/views/resource/handle-sync/asset/rules.js
View file @
b263c6e0
...
...
@@ -59,7 +59,9 @@ export function rules() {
}],
fileDir
:
[{
validator
:
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
||
!
value
.
length
)
{
if
(
!
this
.
form
.
courseLessonNum
)
{
callback
(
new
Error
(
'
请选择课时
'
));
}
else
if
(
!
value
)
{
callback
(
new
Error
(
'
请选择目录
'
));
}
else
{
callback
();
...
...
This diff is collapsed.
Click to expand it.
src/views/resource/handle-sync/index.js
View file @
b263c6e0
import
{
getGradeBySchoolSection
,
getTextbookByTextbookVersion
,
getTextbookChaptersByTextbookId
,
getKnowledgePointsInfoList
,
addSync
,
getSyncById
,
editSync
,
updateAuditedStatus
,
getFolderData
getFolderData
,
getCourseLessonData
}
from
'
@/api/sync
'
;
import
{
getSubjectByParams
,
getTextbookVersionByParams
,
getCourseList
}
from
'
@/api/common
'
;
import
{
getCourseList
}
from
'
@/api/common
'
;
import
{
parseTime
,
fileFormat
,
byteChange
,
showLabel
}
from
'
@/utils/index
'
;
import
{
mapActions
,
mapGetters
}
from
'
vuex
'
;
import
{
rules
}
from
'
./asset/rules.js
'
;
...
...
@@ -29,11 +26,12 @@ export default {
id
:
''
,
name
:
''
,
semester
:
''
,
academic
:
[]
,
academic
:
''
,
course
:
''
,
courseSn
:
''
,
fileDir
:
[],
fileDir
:
''
,
courseLessonNum
:
''
,
// ifOpen: 1,
type
:
0
,
enabled
:
1
,
...
...
@@ -49,7 +47,8 @@ export default {
clickTotal
:
''
,
},
fileList
:
[],
courseLessonData
:
[],
// 课时数据
course
:
[],
schemaCourse
:
{},
...
...
@@ -67,9 +66,11 @@ export default {
if
(
this
.
$route
.
query
.
id
)
{
await
this
.
fetchData
();
// 编辑
if
(
this
.
form
.
semester
&&
this
.
form
.
academic
)
{
var
academic
=
Array
.
isArray
(
this
.
form
.
academic
)
?
this
.
form
.
academic
[
this
.
form
.
academic
.
length
-
1
]
:
this
.
form
.
academic
;
if
(
this
.
form
.
semester
&&
academic
)
{
getCourseList
({
unitId
:
this
.
form
.
academic
,
unitId
:
academic
,
semesterId
:
this
.
form
.
semester
,
}).
then
(
res
=>
{
this
.
course
=
res
.
result
;
...
...
@@ -126,11 +127,15 @@ export default {
this
.
form
.
course
=
''
;
this
.
form
.
courseSn
=
''
;
this
.
form
.
courseLessonNum
=
''
;
this
.
courseLessonNum
=
[];
// 目录数据
this
.
dirData
=
[];
this
.
form
.
parentId
=
''
;
if
(
this
.
form
.
semester
&&
this
.
form
.
academic
&&
this
.
form
.
academic
.
length
)
{
var
academic
=
Array
.
isArray
(
this
.
form
.
academic
)
?
this
.
form
.
academic
[
this
.
form
.
academic
.
length
-
1
]
:
this
.
form
.
academic
;
if
(
this
.
form
.
semester
&&
academic
)
{
this
.
getCourseList
();
}
...
...
@@ -145,7 +150,13 @@ export default {
this
.
dirData
=
[];
this
.
form
.
parentId
=
''
;
if
(
this
.
form
.
semester
&&
this
.
form
.
academic
&&
this
.
form
.
academic
.
length
)
{
this
.
form
.
fileDir
=
[];
this
.
form
.
courseLessonNum
=
''
;
this
.
courseLessonNum
=
[];
var
academic
=
Array
.
isArray
(
this
.
form
.
academic
)
?
this
.
form
.
academic
[
this
.
form
.
academic
.
length
-
1
]
:
this
.
form
.
academic
;
if
(
this
.
form
.
semester
&&
academic
)
{
this
.
getCourseList
();
}
},
...
...
@@ -154,16 +165,32 @@ export default {
// 目录数据
this
.
dirData
=
[];
this
.
form
.
parentId
=
''
;
// 课时数据
this
.
courseLessonData
=
[];
this
.
form
.
courseLessonNum
=
''
;
this
.
form
.
fileDir
=
[];
if
(
value
)
{
this
.
form
.
courseSn
=
this
.
schemaCourse
[
value
].
courseRoomSn
;
this
.
getFolderData
();
this
.
getCourseLessonData
();
}
},
getCourseLessonData
()
{
getCourseLessonData
({
openCourseNum
:
this
.
form
.
courseSn
,
tremId
:
this
.
form
.
semester
,
showFlag
:
false
}).
then
(
res
=>
{
this
.
courseLessonData
=
res
.
result
;
});
},
// 获取课程
getCourseList
()
{
var
academic
=
Array
.
isArray
(
this
.
form
.
academic
)
?
this
.
form
.
academic
[
this
.
form
.
academic
.
length
-
1
]
:
this
.
form
.
academic
;
getCourseList
({
unitId
:
this
.
form
.
academic
[
this
.
form
.
academic
.
length
-
1
]
,
unitId
:
academic
,
semesterId
:
this
.
form
.
semester
,
}).
then
(
res
=>
{
this
.
course
=
res
.
result
;
...
...
@@ -282,15 +309,8 @@ export default {
}
}
var
academic
=
''
;
if
(
this
.
form
.
academic
&&
this
.
form
.
academic
.
length
&&
typeof
this
.
form
.
academic
===
'
object
'
)
{
academic
=
this
.
form
.
academic
[
this
.
form
.
academic
.
length
-
1
]
}
else
if
(
typeof
this
.
form
.
academic
===
'
string
'
)
{
academic
=
this
.
form
.
academic
;
}
else
{
academic
=
''
;
}
var
academic
=
Array
.
isArray
(
this
.
form
.
academic
)
?
this
.
form
.
academic
[
this
.
form
.
academic
.
length
-
1
]
:
this
.
form
.
academic
;
var
fileDir
=
Array
.
isArray
(
this
.
form
.
fileDir
)
?
this
.
form
.
fileDir
[
this
.
form
.
fileDir
.
length
-
1
]
:
this
.
form
.
fileDir
;
var
params
=
{
id
:
this
.
form
.
id
,
...
...
@@ -302,7 +322,7 @@ export default {
semesterId
:
this
.
form
.
semester
,
resourceTypeId
:
this
.
form
.
type
,
parentId
:
this
.
form
.
fileDir
[
this
.
form
.
fileDir
.
length
-
1
]
,
parentId
:
fileDir
,
enabled
:
this
.
form
.
enabled
,
// ifOpen: this.form.ifOpen,
...
...
@@ -312,6 +332,7 @@ export default {
sourceFileName
:
this
.
form
.
sourceFileName
,
resourceFormat
:
formatCode
,
ifFolder
:
0
,
courseLessonNum
:
this
.
form
.
courseLessonNum
,
ifAdmin
:
true
// 为了分辨是否是管理员上传
};
...
...
@@ -355,10 +376,17 @@ export default {
enshrineTotal
:
res
.
result
.
enshrineTotal
,
clickTotal
:
res
.
result
.
clickTotal
,
fileDir
:
res
.
result
.
parentId
,
courseLessonNum
:
res
.
result
.
courseLessonNum
,
verifiedUserRealName
:
res
.
result
.
verifiedUserRealName
,
verifiedDate
:
res
.
result
.
verifiedDate
,
};
};
if
(
this
.
form
.
courseSn
&&
this
.
form
.
semester
)
{
this
.
getCourseLessonData
();
}
if
(
this
.
form
.
file
)
{
// 视频、音频
// var typeFormat = ['mp4', 'wmv', 'flv', 'f4v', 'avi', 'mp3', 'wma'];
...
...
This diff is collapsed.
Click to expand it.
src/views/resource/handle-sync/index.scss
View file @
b263c6e0
...
...
@@ -33,7 +33,7 @@
}
.el-form
{
width
:
68
0px
;
width
:
72
0px
;
margin
:
50px
auto
0
;
}
...
...
@@ -95,4 +95,11 @@
.save
{
margin-left
:
140px
;
}
.class-lesson
{
.el-input
{
width
:
200px
;
margin-right
:
10px
;
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/views/resource/handle-sync/index.vue
View file @
b263c6e0
...
...
@@ -82,8 +82,25 @@
</section>
</el-form-item>
<el-form-item
label=
"所属目录:"
prop=
"fileDir"
>
<el-select
v-model=
"form.courseLessonNum"
placeholder=
"选择课时"
style=
"float: left"
class=
"class-lesson"
:disabled=
"!form.course"
@
change=
"form.catalog=[]"
clearable
>
<el-option
:label=
"item.name"
:value=
"item.id"
:key=
"key"
v-for=
"(item, key) in courseLessonData"
></el-option>
</el-select>
<el-cascader
clearable
class=
"class-lesson"
:disabled=
"!form.courseLessonNum"
placeholder=
"选择课程下的文件目录"
:options=
"dirData"
v-model=
"form.fileDir"
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help