(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-cf3bd4dc"],{"0f47":function(e,t,a){"use strict";a("c73e")},"38c6":function(e,t,a){"use strict";a.d(t,"b",(function(){return o})),a.d(t,"d",(function(){return s})),a.d(t,"c",(function(){return c})),a.d(t,"a",(function(){return r}));a("99af"),a("fb6a"),a("d3b7"),a("159b");var i=a("b775");function n(e){var t="",a=function(a){e.hasOwnProperty(a)&&(Array.isArray(e[a])?e[a].forEach((function(e,i){t+="".concat(a,"[").concat(i,"][key]=").concat(e.key,"&").concat(a,"[").concat(i,"][op]=").concat(e.op,"&").concat(a,"[").concat(i,"][value]=").concat(e.value,"&")})):t+="".concat(a,"=").concat(e[a],"&"))};for(var i in e)a(i);return t.slice(0,-1)}function o(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(i["a"])({method:"get",url:"/api/admin/base-form/index",params:e,paramsSerializer:n,isLoading:t})}function s(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return Object(i["a"])({method:"get",url:"/api/admin/base-form/show",params:e,isLoading:t})}function c(e){return Object(i["a"])({method:"post",url:"/api/admin/base-form/save",data:e})}function r(e){return Object(i["a"])({method:"get",url:"/api/admin/base-form/destroy",params:e})}},"4ab7":function(e,t,a){"use strict";a.d(t,"c",(function(){return o})),a.d(t,"d",(function(){return s})),a.d(t,"b",(function(){return c})),a.d(t,"a",(function(){return r}));a("99af"),a("fb6a"),a("d3b7"),a("159b");var i=a("b775");function n(e){var t="",a=function(a){e.hasOwnProperty(a)&&(Array.isArray(e[a])?e[a].forEach((function(e,i){e.key?t+="".concat(a,"[").concat(i,"][key]=").concat(e.key,"&").concat(a,"[").concat(i,"][op]=").concat(e.op,"&").concat(a,"[").concat(i,"][value]=").concat(e.value,"&"):t+="".concat(a,"[").concat(i,"]=").concat(e,"&")})):t+="".concat(a,"=").concat(e[a],"&"))};for(var i in e)a(i);return t.slice(0,-1)}function o(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(i["a"])({method:"get",url:"/api/admin/course-forms/index",params:e,paramsSerializer:n,isLoading:t})}function s(e){return Object(i["a"])({method:"post",url:"/api/admin/course-forms/save",data:e})}function c(e){return Object(i["a"])({method:"get",url:"/api/admin/course-forms/destroy",params:e})}function r(e){return Object(i["a"])({method:"get",url:"/api/admin/course-forms/clone",params:e})}},"7c2f":function(e,t,a){"use strict";a.d(t,"a",(function(){return p}));var i,n=a("c7eb"),o=a("1da1"),s=a("53ca"),c=(a("99af"),a("fb6a"),a("d3b7"),a("ac1f"),a("3ca3"),a("466d"),a("159b"),a("ddb0"),a("2b3d"),a("bf19"),a("9861"),a("bc3a")),r=a.n(c),u=a("5f87"),l=a("5c96");function d(e){var t,a="",i=function(i){if(e.hasOwnProperty(i))if(Array.isArray(e[i]))e[i].forEach((function(e,t){e.key?a+="".concat(i,"[").concat(t,"][key]=").concat(e.key,"&").concat(i,"[").concat(t,"][op]=").concat(e.op,"&").concat(i,"[").concat(t,"][value]=").concat(e.value,"&"):a+="".concat(i,"[").concat(t,"]=").concat(e,"&")}));else if("object"===Object(s["a"])(e[i]))for(t in e[i])a+="".concat(i,"[").concat(t,"]=").concat(e[i][t],"&");else a+="".concat(i,"=").concat(e[i],"&")};for(var n in e)i(n);return console.log("result",a,a.slice(0,-1)),a.slice(0,-1)}function p(e){return f.apply(this,arguments)}function f(){return f=Object(o["a"])(Object(n["a"])().mark((function e(t){var a,o,s,c,p,f,m,h,b,v=arguments;return Object(n["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return a=v.length>1&&void 0!==v[1]?v[1]:"get",o=v.length>2?v[2]:void 0,s=v.length>3?v[3]:void 0,i=l["Loading"].service({lock:!0,background:"rgba(0,0,0,0.4)",text:"文件正在生成中..."}),c={baseURL:"",url:t,method:a,responseType:"blob",timeout:1e4,headers:{Accept:"application/json","Content-Type":"application/json; charset=utf-8",withCredentials:!0,Authorization:"Bearer "+Object(u["a"])()}},"get"===a&&Object.defineProperty(c,"params",{value:o,enumerable:!0,writable:!1}),"post"===a&&Object.defineProperty(c,"data",{value:o,enumerable:!0,writable:!1}),e.prev=7,"get"===c.method&&(c.paramsSerializer=d),console.log("options",c),e.next=12,r.a.request(c);case 12:p=e.sent,i.close(),s||(s=(null===(f=p.headers["content-disposition"])||void 0===f?void 0:f.match(/filename=(.*)/)[1])||""),m=new Blob([p.data],{type:"application/octet-stream"}),"undefined"!==typeof window.navigator.msSaveBlob?window.navigator.msSaveBlob(m,decodeURI(s)):(h=window.URL.createObjectURL(m),b=document.createElement("a"),b.style.display="none",b.href=h,b.setAttribute("download",decodeURI(s)),"undefined"===typeof b.download&&b.setAttribute("target","_blank"),document.body.appendChild(b),b.click(),document.body.removeChild(b),window.URL.revokeObjectURL(h)),e.next=24;break;case 19:e.prev=19,e.t0=e["catch"](7),console.error(e.t0),i.close(),Object(l["Message"])({type:"error",message:e.t0});case 24:case"end":return e.stop()}}),e,null,[[7,19]])}))),f.apply(this,arguments)}},b0ed:function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-dialog",{attrs:{visible:e.dialogVisible,title:"数据导入",width:"740px",top:"1vh"},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("div",{staticClass:"title"},[e._v("模板下载")]),a("el-button",{staticStyle:{"margin-top":"10px"},attrs:{size:"small",type:"primary"},on:{click:function(t){e.exportExcel((new Date).getTime().toString())}}},[e._v("模板下载")]),a("div",{staticStyle:{color:"red","margin-top":"10px"}},[e._v(" 导入的时候请勿修改模版表单各列栏目名称 ")]),a("el-upload",{staticStyle:{"margin-top":"10px"},attrs:{drag:"",action:e.action,data:Object.assign({},{table_name:e.tableName,course_id:e.course_id?e.course_id:""},e.tableData),headers:{Authorization:"Bearer "+e.getToken()},"on-success":e.uploadSuccess,"on-error":e.uploadFail,"file-list":e.fileList,accept:".xls, .xlsx"}},[a("i",{staticClass:"el-icon-upload"}),a("div",{staticClass:"el-upload__text"},[e._v("将文件拖到此处,或"),a("em",[e._v("点击上传")])]),a("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[e._v("只能上传xls/xlsx文件")])]),a("div",{staticClass:"title",staticStyle:{"margin-top":"10px"}},[e._v("数据预览")]),a("Table",{staticStyle:{"margin-top":"10px"},attrs:{height:350,data:e.tableList,columns:e.table}}),a("div",{staticStyle:{"font-size":"12px",zoom:"0.8"}},[e._v("总共数据:"+e._s(e.tableList.length)+"条")]),a("el-button",{staticStyle:{"margin-top":"10px"},attrs:{type:"primary",size:"small"},on:{click:e.imports}},[e._v("确认导入")])],1)],1)},n=[],o=a("c7eb"),s=a("1da1"),c=(a("99af"),a("d81d"),a("b0c0"),a("ac1f"),a("5319"),a("25ca")),r=a("21a6"),u=a("5f87"),l=(a("38c6"),a("15e6")),d=a("b775"),p=a("4ab7"),f={props:{formInfo:{type:Array,default:function(){return[]}},tableName:String,course_id:String,status:String},data:function(){return{action:"".concat("","/api/admin/base-form/excel-show"),import_action:"",dialogVisible:!1,tableData:{},headers:[],tableList:[],table:[],fileList:[]}},methods:{getToken:u["a"],show:function(){this.dialogVisible=!0},hidden:function(){this.dialogVisible=!1},getHeaders:function(){var e=this;return Object(s["a"])(Object(o["a"])().mark((function t(){var a,i,n,s;return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return a=[],"users"===e.tableName&&(a=["honour","company_need_fund","company_other","remark","plate","is_import","is_vip","is_schoolmate","appointment_total","letter","score","code","pid"]),t.next=4,Object(l["e"])({table_name:e.tableName,except:a});case 4:for(s in i=t.sent,n=[],i)e.base.isNull(i[s])||n.push({key:s,title:i[s],width:120});"course_contents"===e.tableName&&(n.push({key:"teacher_introduce",title:"老师简介",width:120}),n.map((function(e){"teacher_id"===e.key&&(e.key="teacher_name")}))),"course_keeps"===e.tableName&&n.map((function(e){e.width="","user_id"===e.key&&(e.key="user_name"),"status"===e.key&&(e.key="status_name")})),"users"===e.tableName&&(n.unshift({key:"status_name",title:"审核状态",width:120}),n.unshift({key:"course_name",title:"课程名称",width:120})),e.table=e.headers=n;case 11:case"end":return t.stop()}}),t)})))()},getAutoForm:function(){var e=this;return Object(s["a"])(Object(o["a"])().mark((function t(){var a,i;return Object(o["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(p["c"])({page:1,page_size:999,sort_name:"sort",sort_type:"ASC",filter:[{key:"course_id",op:"eq",value:e.course_id}]});case 2:a=t.sent,i=[],a.data.map((function(e){"files"!=e.edit_input&&i.push({key:e.field,title:e.name,width:120})})),e.table=e.headers=i;case 6:case"end":return t.stop()}}),t)})))()},uploadFail:function(e){console.log(e),this.$message({message:"上传失败",type:"error"})},uploadSuccess:function(e,t,a){if(console.log(e,t,a),console.log("window.screen.height",window.screen.height),e&&e.hasOwnProperty("errcode"))return this.$message({message:e.errmsg||"上传失败",type:"error",duration:2e3,offset:window.screen.height/4}),this.fileList=[],void(this.tableList=[]);"course_keeps"===this.tableName&&e.map((function(e){e.status_name=1===e.status?"出勤":"缺勤"})),this.tableList=e,this.fileList=a,this.$message({message:"上传成功",type:"success",offset:window.screen.height/2})},exportExcel:function(e){var t=[this.headers.map((function(e){return e.title}))];console.log("data",t),"course_keeps"===this.tableName?(t.push(["(上传前请删除示例)","","",""]),t.push(["2024-09-03","xxx","出勤/缺勤"])):"course_contents"===this.tableName?(t.push(["(上传前请删除示例)","","",""]),t.push(["2024-09-03","上午09:00-10:00","王老师","《战略思维2》","苏州大学","老师简介"])):"course_signs"===this.tableName&&t.push(["(请确保学员联系方式不为空)","","",""]);var a=c["utils"].book_new(),i=c["utils"].aoa_to_sheet(t);c["utils"].book_append_sheet(a,i,e);var n=c["write"](a,{bookType:"xlsx",bookSST:!0,type:"array"});Object(r["saveAs"])(new Blob([n],{type:"application/octet-stream"}),"".concat(e,".xlsx"))},imports:function(){var e=this;Object(d["a"])({method:"post",url:this.import_action,data:{table_name:this.tableName,course_id:this.course_id?this.course_id:"",status:0===this.status?0:this.status,data:this.tableList}}).then((function(t){console.log(t),e.$message({type:"success",message:"成功导入".concat(t.total,"条")}),e.hidden(),e.$emit("refresh")}))}},computed:{},watch:{formInfo:function(e){console.log("formInfo",e),e&&e instanceof Array&&(this.table=this.headers=e.map((function(e){return{key:e.field,title:e.name}})))},dialogVisible:function(e){if(console.log("newval",e,this.tableName,this.formInfo),e){var t=this.tableName.replace("_","-");this.action="".concat("","/api/admin/").concat(t,"/excel-show"),this.import_action="/api/admin/".concat(t,"/import"),"users"===this.tableName&&(this.import_action="/api/admin/".concat(t,"/import-study")),"course_signs"===this.tableName?this.getAutoForm():this.getHeaders(),console.log("action",this.action,this.import_action)}else this.tableList=[],this.table=[],this.headers=[],this.tableData=[],this.fileList=[]}}},m=f,h=(a("0f47"),a("2877")),b=Object(h["a"])(m,i,n,!1,null,"735f7c32",null);t["default"]=b.exports},be84:function(e,t,a){"use strict";a.r(t),t["default"]={data:function(){return{types_status:[{id:0,value:"禁用",type:"info"},{id:1,value:"启用",type:""}],sortList:[{id:"ASC",value:"评分升序"},{id:"DESC",value:"评分降序"}],false_or_true:[{id:0,value:"否",type:"info"},{id:1,value:"是",type:""}],apply_status_list:[{id:0,value:"待审核",type:""},{id:1,value:"通过",type:"success"},{id:2,value:"审核不通过",type:"warning"},{id:3,value:"备选",type:"danger"},{id:4,value:"已取消",type:"info"},{id:5,value:"主动放弃",type:"danger"},{id:6,value:"黑名单",type:"warning"}],fee_status_list:[{id:0,value:"待缴费",type:""},{id:3,value:"待确认",type:"info"},{id:1,value:"缴费成功",type:"success"},{id:2,value:"缴费失败",type:"warning"}],course_type:[{id:1,value:"常规课程"},{id:2,value:"公司团建"}],course_status:[{id:0,value:"待发布",type:"info"},{id:1,value:"直接发布",type:""}],course_date:[{value:"课程待定",type:"info",id:30},{value:"课程未开始",type:"info",id:20},{value:"课程进行中",type:"",id:10},{value:"课程已结束",type:"success",id:40}],company_education:[{id:1,value:"小学"},{id:2,value:"初中"},{id:3,value:"高中"},{id:4,value:"专科"},{id:5,value:"本科"},{id:6,value:"硕士"},{id:7,value:"博士"}],is_vip_list:[{id:0,value:"公益",type:""},{id:1,value:"付费"}],is_schoolmate_list:[{id:0,value:"否",type:""},{id:1,value:"是"}],company_type_list:[{id:0,value:"上市公司"},{id:1,value:"上市公司子公司"}],book_status:[{id:0,value:"待审核",type:""},{id:1,value:"通过",type:"success"},{id:2,value:"审核不通过",type:"warning"},{id:3,value:"取消",type:"info"},{id:4,value:"失败",type:"info"}],keep_options:[{id:"",value:"全部"},{id:1,value:"出勤",type:"success"},{id:0,value:"缺勤",type:"warning"}]}},computed:{},created:function(){},mounted:function(){},methods:{}}},c73e:function(e,t,a){}}]);