You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
17 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2360cdba"],{b23a:function(e,t,a){"use strict";a.d(t,"d",(function(){return r})),a.d(t,"c",(function(){return l})),a.d(t,"a",(function(){return i})),a.d(t,"h",(function(){return s})),a.d(t,"b",(function(){return n})),a.d(t,"f",(function(){return c})),a.d(t,"e",(function(){return u})),a.d(t,"g",(function(){return d}));var o=a("b775");function r(e){return Object(o["a"])({url:"/tcm/catalog/list",method:"get",params:e})}function l(e){return Object(o["a"])({url:"/tcm/catalog/"+e,method:"get"})}function i(e){return Object(o["a"])({url:"/tcm/catalog",method:"post",data:e})}function s(e){return Object(o["a"])({url:"/tcm/catalog",method:"put",data:e})}function n(e){return Object(o["a"])({url:"/tcm/catalog/"+e,method:"delete"})}function c(e){return Object(o["a"])({url:"/tcm/catalog/coursesSelectOptions",method:"get",params:e})}function u(e){return Object(o["a"])({url:"/tcm/catalog/catalogChapterOptions",method:"get",params:e})}function d(e){return Object(o["a"])({url:"/tcm/catalog/catalogSectionOptions",method:"get",params:e})}},c96d:function(e,t,a){"use strict";a.r(t);var o=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryForm",attrs:{model:e.queryParams,size:"small",inline:!0,"label-width":"68px"}},[a("el-form-item",{attrs:{label:"所属课程",prop:"courseId"}},[a("el-select",{attrs:{placeholder:"请选择所属课程",clearable:""},on:{change:function(t){return e.handleCourseChange("query")}},model:{value:e.queryParams.courseId,callback:function(t){e.$set(e.queryParams,"courseId",t)},expression:"queryParams.courseId"}},e._l(e.coursesOptions,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value,disabled:e.disabled}})})),1)],1),a("el-form-item",{attrs:{label:"所属章",prop:"catalogId"}},[a("el-select",{attrs:{placeholder:"请选择章",clearable:""},on:{change:function(t){return e.handleChapterChange("query")}},model:{value:e.queryParams.catalogId,callback:function(t){e.$set(e.queryParams,"catalogId",t)},expression:"queryParams.catalogId"}},e._l(e.chapterOptions,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value,disabled:e.disabled}})})),1)],1),a("el-form-item",{attrs:{label:"所属节",prop:"sectionId"}},[a("el-select",{attrs:{placeholder:"请选择节",clearable:""},model:{value:e.queryParams.sectionId,callback:function(t){e.$set(e.queryParams,"sectionId",t)},expression:"queryParams.sectionId"}},e._l(e.sectionOptions,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value,disabled:e.disabled}})})),1)],1),a("el-form-item",{attrs:{label:"视频名称",prop:"videoName"}},[a("el-input",{attrs:{placeholder:"请输入视频名称",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.videoName,callback:function(t){e.$set(e.queryParams,"videoName",t)},expression:"queryParams.videoName"}})],1),a("el-form-item",{attrs:{label:"发布状态",prop:"videoStatus"}},[a("el-select",{attrs:{placeholder:"请选择发布状态",clearable:""},model:{value:e.queryParams.videoStatus,callback:function(t){e.$set(e.queryParams,"videoStatus",t)},expression:"queryParams.videoStatus"}},e._l(e.dict.type.tcm_pub_status,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"视频标签",prop:"videoTags"}},[a("el-select",{attrs:{placeholder:"请选择视频标签",clearable:""},model:{value:e.queryParams.videoTags,callback:function(t){e.$set(e.queryParams,"videoTags",t)},expression:"queryParams.videoTags"}},e._l(e.dict.type.tcm_cours_tag,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),a("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),a("el-row",{staticClass:"mb8",attrs:{gutter:10}},[a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["tcm:video:add"],expression:"['tcm:video:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["tcm:video:edit"],expression:"['tcm:video:edit']"}],attrs:{type:"success",plain:"",icon:"el-icon-edit",size:"mini",disabled:e.single},on:{click:e.handleUpdate}},[e._v("修改")])],1),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["tcm:video:remove"],expression:"['tcm:video:remove']"}],attrs:{type:"danger",plain:"",icon:"el-icon-delete",size:"mini",disabled:e.multiple},on:{click:e.handleDelete}},[e._v("删除")])],1),a("right-toolbar",{attrs:{showSearch:e.showSearch},on:{"update:showSearch":function(t){e.showSearch=t},"update:show-search":function(t){e.showSearch=t},queryTable:e.getList}})],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.videoList},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),a("el-table-column",{attrs:{label:"所属课程",align:"center",prop:"courseName",width:"180"}}),a("el-table-column",{attrs:{label:"所属章",align:"center",prop:"catalogName",width:"200"}}),a("el-table-column",{attrs:{label:"所属节",align:"center",prop:"sectionName",width:"200"}}),a("el-table-column",{attrs:{label:"视频名称",align:"center",prop:"videoName",width:"200"}}),a("el-table-column",{attrs:{label:"视频来源",align:"center",prop:"videoSource"}}),a("el-table-column",{attrs:{label:"发布状态",align:"center",prop:"videoStatus"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("dict-tag",{attrs:{options:e.dict.type.tcm_pub_status,value:t.row.videoStatus}})]}}])}),a("el-table-column",{attrs:{label:"顺序",align:"center",prop:"videoSort"}}),a("el-table-column",{attrs:{label:"视频标签",align:"center",prop:"videoTags"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("dict-tag",{attrs:{options:e.dict.type.tcm_cours_tag,value:t.row.videoTags}})]}}])}),a("el-table-column",{attrs:{label:"观看次数",align:"center",prop:"videoHit"}}),a("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width",fixed:"right",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["tcm:video:edit"],expression:"['tcm:video:edit']"}],attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(a){return e.handleUpdate(t.row)}}},[e._v("修改")]),a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["tcm:video:remove"],expression:"['tcm:video:remove']"}],attrs:{size:"mini",type:"text",icon:"el-icon-delete"},on:{click:function(a){return e.handleDelete(t.row)}}},[e._v("删除")])]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}}),a("el-dialog",{attrs:{title:e.title,visible:e.open,width:"80%","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"90px"}},[a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:8,xs:24}},[a("el-form-item",{attrs:{label:"所属课程",prop:"courseId"}},[a("el-select",{style:{width:"100%"},attrs:{placeholder:"请选择所属课程",clearable:""},on:{change:e.handleCourseChange},model:{value:e.form.courseId,callback:function(t){e.$set(e.form,"courseId",t)},expression:"form.courseId"}},e._l(e.coursesOptions,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value,disabled:e.disabled}})})),1)],1)],1),a("el-col",{attrs:{span:8,xs:24}},[a("el-form-item",{attrs:{label:"所属章",prop:"catalogId"}},[a("el-select",{style:{width:"100%"},attrs:{placeholder:"请选择章",clearable:""},on:{change:e.handleChapterChange},model:{value:e.form.catalogId,callback:function(t){e.$set(e.form,"catalogId",t)},expression:"form.catalogId"}},e._l(e.chapterOptions,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value,disabled:e.disabled}})})),1)],1)],1),a("el-col",{attrs:{span:8,xs:24}},[a("el-form-item",{attrs:{label:"所属节",prop:"sectionId"}},[a("el-select",{style:{width:"100%"},attrs:{placeholder:"请选择节",clearable:""},model:{value:e.form.sectionId,callback:function(t){e.$set(e.form,"sectionId",t)},expression:"form.sectionId"}},e._l(e.sectionOptions,(function(e,t){return a("el-option",{key:t,attrs:{label:e.label,value:e.value,disabled:e.disabled}})})),1)],1)],1)],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12,xs:24}},[a("el-form-item",{attrs:{label:"视频名称",prop:"videoName"}},[a("el-input",{attrs:{placeholder:"请输入视频名称"},model:{value:e.form.videoName,callback:function(t){e.$set(e.form,"videoName",t)},expression:"form.videoName"}})],1)],1),a("el-col",{attrs:{span:12,xs:24}},[a("el-form-item",{attrs:{label:"关键字",prop:"videoKeyword"}},[a("el-input",{attrs:{placeholder:"请输入关键字"},model:{value:e.form.videoKeyword,callback:function(t){e.$set(e.form,"videoKeyword",t)},expression:"form.videoKeyword"}})],1)],1)],1),a("el-form-item",{attrs:{label:"视频简介",prop:"videoDescp"}},[a("el-input",{attrs:{type:"textarea",placeholder:"请输入视频简介"},model:{value:e.form.videoDescp,callback:function(t){e.$set(e.form,"videoDescp",t)},expression:"form.videoDescp"}})],1),a("el-form-item",{attrs:{label:"视频详情",prop:"videoDetail"}},[a("editor",{attrs:{"min-height":192},model:{value:e.form.videoDetail,callback:function(t){e.$set(e.form,"videoDetail",t)},expression:"form.videoDetail"}})],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:8,xs:24}},[a("el-form-item",{attrs:{label:"视频标签",prop:"videoTags"}},[a("el-select",{attrs:{placeholder:"请选择视频标签"},model:{value:e.form.videoTags,callback:function(t){e.$set(e.form,"videoTags",t)},expression:"form.videoTags"}},e._l(e.dict.type.tcm_cours_tag,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1),a("el-col",{attrs:{span:8,xs:24}},[a("el-form-item",{attrs:{label:"视频来源",prop:"videoSource"}},[a("el-input",{attrs:{placeholder:"请输入视频来源"},model:{value:e.form.videoSource,callback:function(t){e.$set(e.form,"videoSource",t)},expression:"form.videoSource"}})],1)],1),a("el-col",{attrs:{span:8,xs:24}},[a("el-form-item",{attrs:{label:"视频作者",prop:"videoAuthor"}},[a("el-input",{attrs:{placeholder:"请输入视频作者"},model:{value:e.form.videoAuthor,callback:function(t){e.$set(e.form,"videoAuthor",t)},expression:"form.videoAuthor"}})],1)],1)],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:8,xs:24}},[a("el-form-item",{attrs:{label:"发布状态",prop:"videoStatus"}},[a("el-select",{attrs:{placeholder:"请选择发布状态"},model:{value:e.form.videoStatus,callback:function(t){e.$set(e.form,"videoStatus",t)},expression:"form.videoStatus"}},e._l(e.dict.type.tcm_pub_status,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1),a("el-col",{attrs:{span:8,xs:24}},[a("el-form-item",{attrs:{label:"自定义顺序",prop:"videoSort"}},[a("el-input",{attrs:{placeholder:"请输入自定义顺序"},model:{value:e.form.videoSort,callback:function(t){e.$set(e.form,"videoSort",t)},expression:"form.videoSort"}})],1)],1),a("el-col",{attrs:{span:8,xs:24}},[a("el-form-item",{attrs:{label:"观看次数",prop:"videoHit"}},[a("el-input",{attrs:{placeholder:"请输入观看次数"},model:{value:e.form.videoHit,callback:function(t){e.$set(e.form,"videoHit",t)},expression:"form.videoHit"}})],1)],1)],1),a("el-row",{attrs:{gutter:20}},[a("el-col",{attrs:{span:12,xs:24}},[a("el-form-item",{attrs:{label:"视频缩图",prop:"videoImg"}},[a("image-upload",{model:{value:e.form.videoImg,callback:function(t){e.$set(e.form,"videoImg",t)},expression:"form.videoImg"}})],1)],1),a("el-col",{attrs:{span:12,xs:24}},[a("el-col",{attrs:{span:12,xs:24}},[a("el-form-item",{attrs:{label:"视频文件",prop:"videoLink"}},[a("file-upload",{model:{value:e.form.videoLink,callback:function(t){e.$set(e.form,"videoLink",t)},expression:"form.videoLink"}})],1)],1)],1)],1),a("el-form-item",{attrs:{label:"备注",prop:"remark"}},[a("el-input",{attrs:{type:"textarea",placeholder:"请输入备注"},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),a("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)},r=[],l=a("5530"),i=(a("d81d"),a("b775"));function s(e){return Object(i["a"])({url:"/tcm/video/list",method:"get",params:e})}function n(e){return Object(i["a"])({url:"/tcm/video/"+e,method:"get"})}function c(e){return Object(i["a"])({url:"/tcm/video",method:"post",data:e})}function u(e){return Object(i["a"])({url:"/tcm/video",method:"put",data:e})}function d(e){return Object(i["a"])({url:"/tcm/video/"+e,method:"delete"})}var m=a("b23a"),p={name:"Video",dicts:["tcm_cours_tag","tcm_pub_status"],data:function(){return{loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,videoList:[],coursesOptions:[],chapterOptions:[],sectionOptions:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,courseId:null,catalogId:null,sectionId:null,videoName:null,videoStatus:null,videoTags:null},queryChapterParams:{courseId:null,catalogParentId:null},form:{},rules:{courseId:[{required:!0,message:"所属课程不能为空",trigger:"change"}],catalogId:[{required:!0,message:"所属章不能为空",trigger:"change"}],videoName:[{required:!0,message:"视频名称不能为空",trigger:"blur"}],videoStatus:[{required:!0,message:"发布状态不能为空",trigger:"change"}]}}},created:function(){this.getList(),this.getCoursesOptions()},methods:{getList:function(){var e=this;this.loading=!0,s(this.queryParams).then((function(t){e.videoList=t.rows,e.total=t.total,e.loading=!1}))},getCoursesOptions:function(){var e=this;Object(m["f"])().then((function(t){e.coursesOptions=t.data}))},getChapterOptions:function(){var e=this;Object(m["e"])(this.queryChapterParams).then((function(t){e.chapterOptions=t.data}))},getSectionOptions:function(){var e=this;Object(m["g"])(this.queryChapterParams).then((function(t){e.sectionOptions=t.data}))},handleCourseChange:function(e){"query"==e?this.queryChapterParams.courseId=this.queryParams.courseId:(this.queryChapterParams.courseId=this.form.courseId,this.form.catalogId=null,this.form.sectionId=null),this.getChapterOptions()},handleChapterChange:function(e){"query"==e?(this.queryChapterParams.courseId=this.queryParams.courseId,this.queryChapterParams.catalogParentId=this.queryParams.catalogId):(this.form.courseId=this.form.courseId,this.form.catalogParentId=this.form.catalogId),this.getSectionOptions()},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={videoId:null,courseId:null,catalogId:null,sectionId:null,videoName:null,videoKeyword:null,videoDescp:null,videoDetail:null,videoSource:null,videoAuthor:null,videoStatus:"0",videoSort:0,videoTags:null,videoHit:null,videoImg:null,videoLink:null,remark:null},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange:function(e){this.ids=e.map((function(e){return e.videoId})),this.single=1!==e.length,this.multiple=!e.length},handleAdd:function(){this.reset(),this.open=!0,this.title="添加课程视频信息"},handleUpdate:function(e){var t=this;this.reset();var a=e.videoId||this.ids;n(a).then((function(e){t.form=e.data,t.open=!0,t.title="修改课程视频信息"}))},submitForm:function(){var e=this;this.$refs["form"].validate((function(t){t&&(null!=e.form.videoId?u(e.form).then((function(t){e.$modal.msgSuccess("修改成功"),e.open=!1,e.getList()})):c(e.form).then((function(t){e.$modal.msgSuccess("新增成功"),e.open=!1,e.getList()})))}))},handleDelete:function(e){var t=this,a=e.videoId||this.ids;this.$modal.confirm('是否确认删除课程视频信息编号为"'+a+'"的数据项?').then((function(){return d(a)})).then((function(){t.getList(),t.$modal.msgSuccess("删除成功")})).catch((function(){}))},handleExport:function(){this.download("tcm/video/export",Object(l["a"])({},this.queryParams),"video_".concat((new Date).getTime(),".xlsx"))}}},v=p,f=a("2877"),h=Object(f["a"])(v,o,r,!1,null,null,null);t["default"]=h.exports}}]);