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
11 KiB

2 years ago
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8afbc068"],{"20f9":function(t,e,n){"use strict";n("f7ba")},"333d":function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{"margin-top":"20px",display:"flex","flex-direction":"row-reverse"}},[n("el-pagination",{attrs:{background:"","hide-on-single-page":"",layout:"total, prev, pager, next, jumper","current-page":t.currentPage,"page-size":t.size,total:t.total},on:{"current-change":t.handleCurrentChange}})],1)},a=[],i=(n("a9e3"),{props:{currentPage:{type:Number,default:1},size:{type:Number,default:10},total:{type:Number,default:0}},data:function(){return{}},methods:{handleCurrentChange:function(t){this.$emit("currentChange",t)}}}),r=i,s=n("2877"),c=Object(s["a"])(r,o,a,!1,null,null,null);e["a"]=c.exports},"39bd":function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"tree-container"},[n("div",{ref:"typeList",staticClass:"type-list"},[n("el-tree",{ref:"tree",attrs:{data:t.typeList,props:t.defaultProps,accordion:"","filter-node-method":t.filterNode,"node-key":"id","default-expanded-keys":[-1]},scopedSlots:t._u([{key:"default",fn:function(e){var o=e.node,a=e.data;return n("span",{ref:"nodeId",staticClass:"custom-tree-node",on:{mousedown:function(e){return e.stopPropagation(),t.mouseFun(e,a,o)}}},[n("span",[t._v(t._s(o.label))])])}}])}),n("ul",{directives:[{name:"show",rawName:"v-show",value:t.show,expression:"show"}],staticClass:"context-menu",style:t.styleObj,on:{mousedown:function(e){return e.stopPropagation(),t.operation(e)}}},[n("li",[t._v("新建")]),n("li",[t._v("删除")])])],1),n("el-dialog",{attrs:{title:"新增分类",visible:t.dialogFormVisible,width:"500px","append-to-body":""},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[n("el-form",{ref:"form",attrs:{model:t.form}},[n("el-form-item",{attrs:{prop:"courseType",label:"名称","label-width":t.formLabelWidth,rules:{required:!0,message:"名称不能为空",trigger:"blur"}}},[n("el-input",{staticStyle:{width:"280px"},attrs:{size:"small"},model:{value:t.form.courseType,callback:function(e){t.$set(t.form,"courseType",e)},expression:"form.courseType"}})],1)],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{size:"small"},on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取 消")]),n("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return t.onSubmit("form")}}},[t._v("确 定")])],1)],1)],1)},a=[],i=n("aa2a"),r=(n("4de4"),{props:{list:Array,status:""},data:function(){return{filterText:"",selectData:"",node:"",styleObj:{left:"",top:""},formLabelWidth:"100px",dialogFormVisible:!1,show:!1}},watch:{filterText:function(t){this.$refs.tree.filter(t)}},mounted:function(){this.$refs.typeList.oncontextmenu=function(t){t.preventDefault()}},activated:function(){var t=this;document.onmousedown=function(e){t.show&&(t.show=!1)}},deactivated:function(){document.onmousedown=null},methods:{mouseFun:function(t,e,n){console.log(n.id),this.selectData=e,this.node=n,2===t.button?!1!==this.status&&(this.show=!0,this.styleObj={left:t.clientX+10+"px",top:t.clientY+"px"}):0===t.button&&(this.show=!1,this.$emit("change",e))}}}),s={mixins:[r],data:function(){return{typeList:[{id:-1,levelId:0,sectionName:"全部分类",childSection:[]}],form:{courseType:""},defaultProps:{label:"sectionName",children:"childSection"},lastSectionId:0}},created:function(){this.getData()},methods:{filterNode:function(t,e){return!t||-1!==e.courseType.indexOf(t)},operation:function(t){var e=this;0===t.button&&("新建"===t.srcElement.textContent?this.dialogFormVisible=!0:this.$confirm("此操作将删除该分类, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning",center:!0}).then((function(){if(-1===e.selectData.id)return e.$message.error("无法删除一级分类!"),!1;e.selectData.childSection&&0!==e.selectData.childSection.length?e.$message.warning("请先删除子类"):Object(i["b"])(e.selectData