Commit 011f22db authored by 黄奎's avatar 黄奎

页面修改

parent cf6de52e
import request from '../../utils/request' import request from '../../utils/request'
import {
Loading
} from 'quasar'
/** /**
* 获取富文本编辑器Font * 获取富文本编辑器Font
*/ */
...@@ -30,6 +32,9 @@ var uploadMsg = { ...@@ -30,6 +32,9 @@ var uploadMsg = {
* 自定义上传文件 * 自定义上传文件
*/ */
export function UploadSelfFile(path, file, isTrans, callback) { export function UploadSelfFile(path, file, isTrans, callback) {
Loading.show({
message: '正在上传文件,请稍后...'
})
var newPath = '/Upload/' + path + "/"; var newPath = '/Upload/' + path + "/";
let url = uploadMsg.uploadUrl + "/Upload?filePath=" + newPath; let url = uploadMsg.uploadUrl + "/Upload?filePath=" + newPath;
if (isTrans && isTrans == 1) { if (isTrans && isTrans == 1) {
...@@ -47,6 +52,7 @@ export function UploadSelfFile(path, file, isTrans, callback) { ...@@ -47,6 +52,7 @@ export function UploadSelfFile(path, file, isTrans, callback) {
tempArray.push(uploadMsg.imgDomain + item); tempArray.push(uploadMsg.imgDomain + item);
}) })
} }
Loading.hide();
var uploadResult = { var uploadResult = {
resultCode: 1, resultCode: 1,
FileName: file.name, FileName: file.name,
......
...@@ -12,6 +12,16 @@ ...@@ -12,6 +12,16 @@
accept=".doc,.docx,.ppt,.pptx,.xls,.xlsx,.pdf" auto-upload :factory="uploadFile" no-thumbnails> accept=".doc,.docx,.ppt,.pptx,.xls,.xlsx,.pdf" auto-upload :factory="uploadFile" no-thumbnails>
</q-uploader> </q-uploader>
</div> </div>
<div class="text-caption q-my-md q-px-xs text-grey-6">附件
</div>
<div class="text-caption q-my-md q-px-xs text-grey-6" v-if="objOption.SourceUrl!=''">
<a :href="objOption.SourceUrl" :download="objOption.PlanName">{{objOption.PlanName}}</a>
<div class="col-6">
<template v-for="item in tempFileList">
<q-img :src="item" style="height: 140px; max-width: 150px"> </q-img>
</template>
</div>
</div>
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-actions align="right" class="bg-white"> <q-card-actions align="right" class="bg-white">
...@@ -25,7 +35,8 @@ ...@@ -25,7 +35,8 @@
<script> <script>
import { import {
saveTeachPlanInfo saveTeachPlanInfo,
queryTeachPlanInfo,
} from '../../api/course/index' } from '../../api/course/index'
import { import {
UploadSelfFile, UploadSelfFile,
...@@ -65,6 +76,7 @@ ...@@ -65,6 +76,7 @@
}, },
optionTitle: "", optionTitle: "",
saveCourseLoading: false, saveCourseLoading: false,
tempFileList: [], //生成文件图片路径
} }
}, },
mounted() { mounted() {
...@@ -85,7 +97,30 @@ ...@@ -85,7 +97,30 @@
}, },
//初始化表单 //初始化表单
initObj() { initObj() {
this.optionTitle = "上传教案" this.optionTitle = "";
if (this.saveObj && this.saveObj.PlanId > 0) {
queryTeachPlanInfo({
PlanId: this.saveObj.PlanId
}).then(res => {
console.log("res", res.Data)
this.objOption.PlanName = res.Data.PlanName;
this.objOption.PlanId = res.Data.PlanId;
this.objOption.CourseId = res.Data.CourseId;
this.objOption.ClassBefore = res.Data.ClassBefore;
this.objOption.ClassIn = res.Data.ClassIn;
this.objOption.ClassAfter = res.Data.ClassAfter;
this.objOption.ParentPlanId = res.Data.ParentPlanId;
this.objOption.SourceUrl = res.Data.SourceUrl;
this.objOption.PlanFileExtension = res.Data.PlanFileExtension;
this.objOption.PlanNodeType = res.Data.PlanNodeType;
this.objOption.ExtUrl = res.Data.ExtUrl;
this.objOption.Remark = res.Data.Remark;
this.tempFileList = res.Data.FileList;
})
this.optionTitle = "重新上传教案信息"
} else {
this.optionTitle = "上传教案"
}
}, },
//关闭弹窗 //关闭弹窗
closeCourseForm() { closeCourseForm() {
......
...@@ -56,8 +56,8 @@ ...@@ -56,8 +56,8 @@
<teachplan-form v-if="IsShowTeachForm" :CourseId="CourseId" :save-obj="teachPlanObj" @close="closeTeachSaveForm" <teachplan-form v-if="IsShowTeachForm" :CourseId="CourseId" :save-obj="teachPlanObj" @close="closeTeachSaveForm"
@success="refreshPage"> @success="refreshPage">
</teachplan-form> </teachplan-form>
<teachupload-form v-if="IsShowTeachUploadForm" :CourseId="CourseId" :save-obj="teachPlanObj" @close="closeTeachUploadForm" <teachupload-form v-if="IsShowTeachUploadForm" :CourseId="CourseId" :save-obj="teachPlanObj"
@success="refreshPage"> @close="closeTeachUploadForm" @success="refreshPage">
</teachupload-form> </teachupload-form>
</div> </div>
</div> </div>
...@@ -169,6 +169,7 @@ ...@@ -169,6 +169,7 @@
//刷新页面 //刷新页面
refreshPage() { refreshPage() {
this.IsShowTeachForm = false; this.IsShowTeachForm = false;
this.IsShowTeachUploadForm = false;
this.getteachplanList(); this.getteachplanList();
}, },
//新增修改菜单 //新增修改菜单
...@@ -178,7 +179,13 @@ ...@@ -178,7 +179,13 @@
} else { } else {
this.teachPlanObj = null this.teachPlanObj = null
} }
this.IsShowTeachForm = true if (obj.PlanNodeType == 0) {
this.IsShowTeachForm = true;
this.IsShowTeachUploadForm = false;
} else if (obj.PlanNodeType == 1) {
this.IsShowTeachForm = false;
this.IsShowTeachUploadForm = true;
}
}, },
//关闭弹窗 //关闭弹窗
closeTeachSaveForm() { closeTeachSaveForm() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment