chunk-8674ca8c.137941c7.js 8.7 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8674ca8c"],{"165d":function(e,t,i){"use strict";var a=i("c03a"),n=i.n(a);n.a},bff8:function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"filter-container"},[i("el-button",{staticClass:"filter-item",staticStyle:{"margin-left":"10px"},attrs:{type:"primary",icon:"el-icon-edit"},on:{click:e.handleCreate}},[e._v("\n 新增\n ")])],1),e._v(" "),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:e.list.slice((e.currentPage-1)*e.pagesize,e.currentPage*e.pagesize),border:"",fit:"","highlight-current-row":""}},[i("el-table-column",{attrs:{align:"center",label:"Id",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[i("span",[e._v(e._s(a.id))])]}}])}),e._v(" "),i("el-table-column",{attrs:{"min-width":"150px",label:"名字"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[a.edit?[i("el-input",{staticClass:"edit-input",model:{value:a.name,callback:function(t){e.$set(a,"name",t)},expression:"row.name"}})]:i("span",[e._v(e._s(a.name))])]}}])}),e._v(" "),i("el-table-column",{attrs:{"min-width":"150px",label:"培训类型"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[a.edit?[i("el-select",{staticClass:"filter-item",attrs:{placeholder:"请选择"},model:{value:a.type,callback:function(t){e.$set(a,"type",t)},expression:"row.type"}},e._l(e.groupOptions,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)]:i("span",[e._v(e._s(e.groupOptions[a.groupId-1].display_name))])]}}])}),e._v(" "),i("el-table-column",{attrs:{"min-width":"150px",label:"培训内容"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[a.edit?[i("el-select",{staticClass:"filter-item",attrs:{placeholder:"请选择"},model:{value:a.type,callback:function(t){e.$set(a,"type",t)},expression:"row.type"}},e._l(e.typeOptions,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)]:i("span",[e._v(e._s(a.tname))])]}}])}),e._v(" "),i("el-table-column",{attrs:{"min-width":"150px",label:"学时"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[a.edit?[i("el-input",{staticClass:"edit-input",attrs:{size:"small"},model:{value:a.xs,callback:function(t){e.$set(a,"xs",t)},expression:"row.xs"}})]:i("span",[e._v(e._s(a.xs))])]}}])}),e._v(" "),i("el-table-column",{attrs:{"min-width":"150px",label:"视频文件"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[a.edit?[i("el-input",{staticClass:"edit-input",attrs:{size:"small"},model:{value:a.filename,callback:function(t){e.$set(a,"filename",t)},expression:"row.filename"}})]:i("span",[e._v(e._s(a.filename))])]}}])}),e._v(" "),i("el-table-column",{attrs:{align:"center","min-width":"150px",label:"操作","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row,n=t.$index;return[a.edit?i("el-button",{attrs:{type:"success",size:"small",icon:"el-icon-circle-check"},on:{click:function(t){return e.confirmEdit(a)}}},[e._v("\n 提交\n ")]):e._e(),e._v(" "),a.edit?i("el-button",{staticClass:"cancel-btn",attrs:{size:"small",icon:"el-icon-refresh",type:"warning"},on:{click:function(t){return e.cancelEdit(a)}}},[e._v("\n 取消\n ")]):e._e(),e._v(" "),a.edit?e._e():i("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"},on:{click:function(t){return e.initEdit(a,n)}}},[e._v("\n 编辑\n ")])]}}])})],1),e._v(" "),i("el-pagination",{attrs:{"current-page":e.currentPage,"page-sizes":[5,10,20,40],"page-size":e.pagesize,layout:"total, sizes, prev, pager, next, jumper",total:e.list.length},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}}),e._v(" "),i("el-dialog",{attrs:{title:"新增",visible:e.dialogFormVisible},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[i("el-form",{ref:"dataForm",staticStyle:{width:"400px","margin-left":"50px"},attrs:{rules:e.rules,model:e.temp,"label-position":"left","label-width":"70px"}},[i("el-form-item",{attrs:{label:"课程",prop:"title"}},[i("el-input",{model:{value:e.temp.name,callback:function(t){e.$set(e.temp,"name",t)},expression:"temp.name"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"培训类型",prop:"title"}},[i("el-select",{staticClass:"filter-item",attrs:{placeholder:"请选择"},model:{value:e.temp.groupId,callback:function(t){e.$set(e.temp,"groupId",t)},expression:"temp.groupId"}},e._l(e.groupOptions,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1),e._v(" "),i("el-form-item",{attrs:{label:"培训内容",prop:"title"}},[i("el-select",{staticClass:"filter-item",attrs:{placeholder:"请选择"},model:{value:e.temp.type,callback:function(t){e.$set(e.temp,"type",t)},expression:"temp.type"}},e._l(e.typeOptions,(function(e){return i("el-option",{key:e.key,attrs:{label:e.display_name,value:e.key}})})),1)],1),e._v(" "),i("el-form-item",{attrs:{label:"学时",prop:"title"}},[i("el-input",{model:{value:e.temp.xs,callback:function(t){e.$set(e.temp,"xs",t)},expression:"temp.xs"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"视频文件",prop:"title"}},[i("el-input",{model:{value:e.temp.filename,callback:function(t){e.$set(e.temp,"filename",t)},expression:"temp.filename"}})],1)],1),e._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{on:{click:function(t){e.dialogFormVisible=!1}}},[e._v("\n 取消\n ")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.createData()}}},[e._v("\n 确认\n ")])],1)],1)],1)},n=[],l=(i("7f7f"),i("28a5"),i("96cf"),i("3b8d")),s=(i("8237"),i("b775"));function r(e){return Object(s["a"])({url:"/SDataApi/admin/course_list",method:"post",params:JSON.stringify(e)})}function o(e){return Object(s["a"])({url:"/SDataApi/admin/course_add",method:"post",data:JSON.stringify(e)})}i("ed08");var c=[{key:"1",display_name:"安全知识"},{key:"2",display_name:"基础知识"},{key:"3",display_name:"操作实践"}],p=[{key:"1",display_name:"中级绿化工培训"},{key:"2",display_name:"高级绿化工培训"},{key:"3",display_name:"中级植保工培训"},{key:"4",display_name:"高级植保工培训"},{key:"5",display_name:"中级花卉工培训"},{key:"6",display_name:"高级花卉工培训"}],u={name:"InlineEditTable",data:function(){return{currentPage:1,pagesize:10,list:[],listLoading:!0,dialogFormVisible:!1,dialogStatus:"",typeOptions:c,groupOptions:p,rules:{username:[{required:!0,message:"必填",trigger:"blur"}],nickname:[{required:!0,message:"必填",trigger:"blur"}],cardId:[{required:!0,message:"必填",trigger:"blur"}]},temp:{},brow:{}}},created:function(){this.getList()},methods:{getList:function(){var e=Object(l["a"])(regeneratorRuntime.mark((function e(){var t,i,a=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.listLoading=!0,e.next=3,r();case 3:t=e.sent,i=t.list,t.total,i||(this.listLoading=!1),this.list=i.map((function(e){return a.$set(e,"edit",!1),e.filename=e.url.split("#")[1],e})),this.listLoading=!1;case 9:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),cancelEdit:function(e){e=Object.assign(e,this.brow),console.log("rbrow",e),e.edit=!1},handleCreate:function(){var e=this;this.resetTemp(),this.dialogStatus="create",this.dialogFormVisible=!0,this.$nextTick((function(){e.$refs["dataForm"].clearValidate()}))},resetTemp:function(){this.temp={id:0,name:"",groupId:"1",type:"1",xs:"",filename:"123456"}},confirmEdit:function(e){var t=this,i=e.id,a=e.groupId,n=e.name,l=e.xs,s=e.filename,r=e.type,c="//sm.ndjsxh.com/media.html#"+s,p=this.typeOptions[r-1].display_name,u="//sm.ndjsxh.com/uploads/icon/"+i+".jpg",d={id:parseInt(i),groupId:a,name:n,xs:l,url:c,type:r,tname:p,tb:u};o(d).then((function(i){e.edit=!1,t.$message({message:"数据更新成功",type:"success"})}))},createData:function(){var e=this,t=this.temp,i=t.id,a=t.groupId,n=t.name,l=t.xs,s=t.filename,r=t.type,c="//sm.ndjsxh.com/media.html#"+s,p=this.typeOptions[r-1].display_name,u="//sm.ndjsxh.com/uploads/icon/"+i+".jpg",d={id:0,groupId:a,name:n,xs:l,url:c,type:r,tname:p,tb:u};o(d).then((function(t){row.edit=!1,e.dialogStatus="",e.dialogFormVisible=!1,e.list.push(row)}))},initEdit:function(e,t){this.brow=Object.assign({},e),e.edit=!e.edit},handleSizeChange:function(e){this.pagesize=e,console.log(this.pagesize)},handleCurrentChange:function(e){this.currentPage=e,console.log(this.currentPage)}}},d=u,m=(i("165d"),i("2877")),f=Object(m["a"])(d,a,n,!1,null,"4404acd4",null);t["default"]=f.exports},c03a:function(e,t,i){}}]);