Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
confucius
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
罗超
confucius
Commits
705feebd
Commit
705feebd
authored
Oct 23, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
03e6fd44
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
159 additions
and
10 deletions
+159
-10
common.js
src/api/common/common.js
+23
-4
teachplan-form.vue
src/components/course/teachplan-form.vue
+7
-3
teachupload-form.vue
src/components/course/teachupload-form.vue
+117
-0
course.vue
src/pages/course/course.vue
+1
-1
teachplan.vue
src/pages/course/teachplan.vue
+11
-2
No files found.
src/api/common/common.js
View file @
705feebd
...
...
@@ -29,20 +29,30 @@ var uploadMsg = {
/**
* 自定义上传文件
*/
export
function
UploadSelfFile
(
path
,
file
,
callback
)
{
export
function
UploadSelfFile
(
path
,
file
,
isTrans
,
callback
)
{
var
newPath
=
'/Upload/'
+
path
+
"/"
;
let
url
=
uploadMsg
.
uploadUrl
+
"/Upload?filePath="
+
newPath
let
url
=
uploadMsg
.
uploadUrl
+
"/Upload?filePath="
+
newPath
;
if
(
isTrans
&&
isTrans
==
1
)
{
url
+=
"&isTrans=1"
}
let
formData
=
new
FormData
()
formData
.
append
(
'myfile'
,
file
)
let
xhr
=
new
XMLHttpRequest
()
xhr
.
onload
=
function
()
{
var
jsonObj
=
JSON
.
parse
(
xhr
.
responseText
);
if
(
jsonObj
.
StatusCode
==
1
&&
callback
)
{
var
tempArray
=
[];
if
(
jsonObj
.
OtherFile
&&
jsonObj
.
OtherFile
.
length
>
0
)
{
jsonObj
.
OtherFile
.
forEach
(
item
=>
{
tempArray
.
push
(
uploadMsg
.
imgDomain
+
item
);
})
}
var
uploadResult
=
{
resultCode
:
1
,
FileName
:
file
.
name
,
FileUrl
:
uploadMsg
.
imgDomain
+
jsonObj
.
FilePath
,
VideoCoverImg
:
uploadMsg
.
imgDomain
+
jsonObj
.
VideoCoverImg
VideoCoverImg
:
uploadMsg
.
imgDomain
+
jsonObj
.
VideoCoverImg
,
ExtFile
:
tempArray
}
callback
(
uploadResult
);
}
...
...
@@ -64,7 +74,7 @@ export function queryAreaTree(data) {
/**
* 获取省市区列表
*/
*/
export
function
queryAreaList
(
data
)
{
return
request
({
url
:
'/Public/GetAreaList'
,
...
...
@@ -72,3 +82,12 @@ export function queryAreaList(data) {
data
})
}
/**
* 获取文件扩展名
*/
export
function
getFileExt
(
filename
)
{
var
index
=
filename
.
lastIndexOf
(
"."
);
var
suffix
=
filename
.
substr
(
index
+
1
);
return
suffix
}
src/components/course/teachplan-form.vue
View file @
705feebd
...
...
@@ -2,7 +2,7 @@
<q-dialog
v-model=
"persistent"
persistent
transition-show=
"scale"
transition-hide=
"scale"
>
<q-card
style=
"width: 800px;max-width:900px;"
>
<q-card-section>
<div
class=
"text-h6"
>
{{
objOption
.
Menu
Id
==
0
?
'新增教案信息'
:
'修改教案信息'
}}
</div>
<div
class=
"text-h6"
>
{{
objOption
.
Plan
Id
==
0
?
'新增教案信息'
:
'修改教案信息'
}}
</div>
</q-card-section>
<q-card-section
class=
"q-pt-none scroll"
style=
"max-height: 70vh"
>
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
>
教案信息
</div>
...
...
@@ -45,6 +45,10 @@
extEditor
},
props
:
{
CourseId
:
{
type
:
String
,
default
:
"0"
},
saveObj
:
{
type
:
Object
,
default
:
null
...
...
@@ -69,7 +73,6 @@
},
optionTitle
:
""
,
saveCourseLoading
:
false
,
TreeCategoryList
:
[],
//课程分类树形列表
}
},
mounted
()
{
...
...
@@ -123,7 +126,8 @@
},
//保存菜单
saveCourse
()
{
this
.
saveCourseLoading
=
true
this
.
objOption
.
CourseId
=
this
.
CourseId
;
this
.
saveCourseLoading
=
true
;
saveTeachPlanInfo
(
this
.
objOption
).
then
(
res
=>
{
this
.
saveCourseLoading
=
false
this
.
$q
.
notify
({
...
...
src/components/course/teachupload-form.vue
0 → 100644
View file @
705feebd
<
template
>
<q-dialog
v-model=
"persistent"
persistent
transition-show=
"scale"
transition-hide=
"scale"
>
<q-card
style=
"width: 800px;max-width:900px;"
>
<q-card-section>
<div
class=
"text-h6"
>
上传教案信息
</div>
</q-card-section>
<q-card-section
class=
"q-pt-none scroll"
style=
"max-height: 70vh"
>
<div
class=
"text-caption q-mb-lg q-px-md text-grey-6"
>
教案信息
</div>
<div
class=
"row wrap"
>
<q-uploader
style=
"display: inline-block;max-height: 320px;max-width: 100%; background-repeat:no-repeat"
max-files=
"1"
hide-upload-btn
label=
"教案"
:max-file-size=
"10*1024*1024"
accept=
".doc,.docx,.ppt,.pptx,.xls,.xlsx,.pdf"
auto-upload
:factory=
"uploadFile"
no-thumbnails
>
</q-uploader>
</div>
</q-card-section>
<q-separator
/>
<q-card-actions
align=
"right"
class=
"bg-white"
>
<q-btn
label=
"取消"
color=
"dark"
style=
"font-weight:400 !important"
@
click=
"closeCourseForm"
/>
<q-btn
label=
"立即提交"
color=
"accent q-px-md"
style=
"font-weight:400 !important"
:loading=
"saveCourseLoading"
@
click=
"saveCourse"
/>
</q-card-actions>
</q-card>
</q-dialog>
</
template
>
<
script
>
import
{
saveTeachPlanInfo
}
from
'../../api/course/index'
import
{
UploadSelfFile
,
getFileExt
}
from
'../../api/common/common'
export
default
{
components
:
{
},
props
:
{
CourseId
:
{
type
:
String
,
default
:
"0"
},
saveObj
:
{
type
:
Object
,
default
:
null
}
},
data
()
{
return
{
persistent
:
true
,
objOption
:
{
PlanId
:
0
,
//教案编号
CourseId
:
0
,
//课程编辑
PlanName
:
""
,
//教案名称
ClassBefore
:
""
,
//课前
ClassIn
:
""
,
//课中
ClassAfter
:
""
,
//课后
ParentPlanId
:
0
,
//父级节点编号
SourceUrl
:
""
,
//源文件路径
PlanFileExtension
:
""
,
//文件后缀名
PlanNodeType
:
0
,
//节点类型(0-文件,1-文件夹)
ExtUrl
:
""
,
//上传生成文件路径
Remark
:
""
,
//备注
},
optionTitle
:
""
,
saveCourseLoading
:
false
,
}
},
mounted
()
{
this
.
initObj
()
},
methods
:
{
uploadFile
(
files
)
{
UploadSelfFile
(
'assistIcon'
,
files
[
0
],
1
,
res
=>
{
if
(
res
.
resultCode
==
1
)
{
this
.
objOption
.
PlanName
=
res
.
FileName
;
this
.
objOption
.
PlanFileExtension
=
getFileExt
(
res
.
FileName
);
this
.
objOption
.
SourceUrl
=
res
.
FileUrl
;
if
(
res
.
ExtFile
&&
res
.
ExtFile
.
length
>
0
)
{
this
.
objOption
.
ExtUrl
=
res
.
ExtFile
.
toString
();
}
}
})
},
//初始化表单
initObj
()
{
this
.
optionTitle
=
"上传教案"
},
//关闭弹窗
closeCourseForm
()
{
this
.
$emit
(
'close'
)
this
.
persistent
=
false
},
//保存菜单
saveCourse
()
{
this
.
objOption
.
CourseId
=
this
.
CourseId
;
this
.
saveCourseLoading
=
true
;
saveTeachPlanInfo
(
this
.
objOption
).
then
(
res
=>
{
this
.
saveCourseLoading
=
false
this
.
$q
.
notify
({
icon
:
'iconfont icon-chenggong'
,
color
:
'accent'
,
timeout
:
2000
,
message
:
'数据保存成功!'
,
position
:
'top'
})
this
.
$emit
(
"success"
)
this
.
closeSaveForm
()
}).
catch
(()
=>
{
this
.
saveCourseLoading
=
false
})
}
},
}
</
script
>
src/pages/course/course.vue
View file @
705feebd
...
...
@@ -54,7 +54,7 @@
</q-td>
</
template
>
</q-table>
<course-form
v-if=
"isShowCourseForm"
:save-obj=
"courseObjOption"
@
close=
"closeMenuSaveForm"
<course-form
v-if=
"isShowCourseForm"
:save-obj=
"courseObjOption"
@
close=
"closeMenuSaveForm"
@
success=
"refreshPage"
>
</course-form>
</div>
...
...
src/pages/course/teachplan.vue
View file @
705feebd
...
...
@@ -13,7 +13,7 @@
</q-item>
<q-item
clickable
v-close-popup
>
<q-item-section>
<q-item-label>
上传教案
</q-item-label>
<q-item-label
@
click=
"IsShowTeachUploadForm=true"
>
上传教案
</q-item-label>
</q-item-section>
</q-item>
</q-list>
...
...
@@ -53,9 +53,12 @@
</q-td>
</
template
>
</q-table>
<teachplan-form
v-if=
"IsShowTeachForm"
:save-obj=
"teachPlanObj"
@
close=
"closeTeachSaveForm"
<teachplan-form
v-if=
"IsShowTeachForm"
:
CourseId=
"CourseId"
:
save-obj=
"teachPlanObj"
@
close=
"closeTeachSaveForm"
@
success=
"refreshPage"
>
</teachplan-form>
<teachupload-form
v-if=
"IsShowTeachUploadForm"
:CourseId=
"CourseId"
@
close=
"closeTeachUploadForm"
@
success=
"refreshPage"
>
</teachupload-form>
</div>
</div>
</template>
...
...
@@ -66,6 +69,7 @@
removeTeachPlanInfo
}
from
'../../api/course/index'
import
teachplanForm
from
'../../components/course/teachplan-form'
import
teachuploadForm
from
'../../components/course/teachupload-form'
export
default
{
meta
:
{
...
...
@@ -73,6 +77,7 @@
},
components
:
{
teachplanForm
,
teachuploadForm
},
data
()
{
return
{
...
...
@@ -125,6 +130,7 @@
CourseId
:
0
,
pageCount
:
0
,
IsShowTeachForm
:
false
,
IsShowTeachUploadForm
:
false
,
teachPlanObj
:
null
,
}
},
...
...
@@ -178,6 +184,9 @@
closeTeachSaveForm
()
{
this
.
IsShowTeachForm
=
false
},
closeTeachUploadForm
()
{
this
.
IsShowTeachUploadForm
=
false
;
},
//删除教案
deleteTeach
(
obj
)
{
var
that
=
this
;
...
...
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