text: (function(e){function t(t){for(var i,n,s=t[0],l=t[1],c=t[2],m=0,d=[];m<s.length;m++)n=s[m],Object.prototype.hasOwnProperty.call(r,n)&&r[n]&&d.push(r[n][0]),r[n]=0;for(i in l)Object.prototype.hasOwnProperty.call(l,i)&&(e[i]=l[i]);u&&u(t);while(d.length)d.shift()();return o.push.apply(o,c||[]),a()}function a(){for(var e,t=0;t<o.length;t++){for(var a=o[t],i=!0,s=1;s<a.length;s++){var l=a[s];0!==r[l]&&(i=!1)}i&&(o.splice(t--,1),e=n(n.s=a[0]))}return e}var i={},r={app:0},o=[];function n(t){if(i[t])return i[t].exports;var a=i[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=i,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/admin/";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],l=s.push.bind(s);s.push=t,s=s.slice();for(var c=0;c<s.length;c++)t(s[c]);var u=l;o.push([0,"chunk-vendors"]),a()})({0:function(e,t,a){e.exports=a("56d7")},"034f":function(e,t,a){"use strict";a("db62")},"0a8f":function(e,t,a){},"11bb":function(e,t,a){"use strict";a("22b6")},1698:function(e,t,a){},"18a7":function(e,t,a){},"22b6":function(e,t,a){},"2a74":function(e,t,a){"use strict";a.r(t);a("d3b7"),a("159b"),a("ddb0"),a("ac1f"),a("5319");var i=a("d307"),r={};i.keys().forEach((function(e){"./index.js"!==e&&(r[e.replace(/(\.\/|\.js)/g,"")]=i(e).default)})),t["default"]=r},3945:function(e,t,a){"use strict";a("18a7")},"39d5":function(e,t,a){"use strict";a("4b75")},"422d":function(e,t,a){"use strict";a("73a4")},4439:function(e,t,a){},"4b75":function(e,t,a){},"56d7":function(e,t,a){"use strict";a.r(t);a("e260"),a("e6cf"),a("cca6"),a("a79d"),a("b0c0");var i=a("a026"),r=a("bc3a"),o=a.n(r),n=a("130e"),s=a("5c96"),l=a.n(s),c=(a("0fae"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{attrs:{id:"app"}},[a("router-view")],1)}),u=[],m={name:"nideshop-admin"},d=m,f=(a("034f"),a("2877")),p=Object(f["a"])(d,c,u,!1,null,null,null),b=p.exports,h=a("8c4f"),g=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"container"},[a("sidebar"),a("navbar"),a("div",{staticClass:"content"},[a("transition",{attrs:{name:"router-fade",mode:"out-in"}},[a("router-view")],1)],1)],1)},v=[],_=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"left-box"},[e._m(0),a("el-menu",{staticClass:"sidebar",attrs:{"unique-opened":!0,"default-active":e.currentPagePath,router:!0,theme:"dark"},on:{open:e.handleOpen,close:e.handleClose}},[a("el-submenu",{attrs:{index:"operate"}},[a("template",{slot:"title"},[a("i",{staticClass:"fa fa-large fa-truck"}),a("span",[e._v("运营管理")])]),a("el-menu-item",{attrs:{index:"/dashboard/operate/promotion"}},[a("i",{staticClass:"fa fa-circle"}),a("span",[e._v("活动管理")])]),a("el-menu-item",{attrs:{index:"/dashboard/operate/assessment"}},[a("i",{staticClass:"fa fa-circle"}),a("span",[e._v("测评管理")])]),a("el-menu-item",{attrs:{index:"/dashboard/operate/subscribe"}},[a("i",{staticClass:"fa fa-circle"}),a("span",[e._v("预约管理")])]),a("el-menu-item",{attrs:{index:"/dashboard/operate/classes"}},[a("i",{staticClass:"fa fa-circle"}),a("span",[e._v("公开课管理")])])],2),a("el-submenu",{attrs:{index:"assessment"}},[a("template",{slot:"title"},[a("i",{staticClass:"fa fa-large fa-truck"}),a("span",[e._v("测评管理")])]),a("el-menu-item",{attrs:{index:"/dashboard/paper/list"}},[a("i",{staticClass:"fa fa-circle"}),a("span",[e._v("试卷列表")])]),a("el-menu-item",{attrs:{index:"/dashboard/question/list"}},[a("i",{staticClass:"fa fa-circle"}),a("span",[e._v("题目列表")])])],2),a("el-submenu",{attrs:{index:"subscribe"}},[a("template",{slot:"title"},[a("i",{staticClass:"fa fa-large fa-truck"}),a("span",[e._v("预约管理")])]),a("el-menu-item",{attrs:{index:"/dashboard/subscribe/video"}},[a("i",{staticClass:"fa fa-circle"}),a("span",[e._v("咨询师管理")])])],2),a("el-submenu",{attrs:{index:"classes"}},[a("template",{slot:"title"},[a("i",{staticClass:"fa fa-large fa-truck"}),a("span",[e._v("公开课管理")])]),a("el-menu-item",{attrs:{index:"/dashboard/classes/video"}},[a("i",{staticClass:"fa fa-circle"}),a("span",[e._v("视频管理")])]),a("el-menu-item",{attrs:{index:"/dashboard/classes/audio"}},[a("i",{staticClass:"fa fa-circle"}),a("span",[e._v("音频管理")])])],2),a("el-submenu",{attrs:{index:"goods"}},[a("template",{slot:"title"},[a("i",{staticClass:"fa fa-product-hunt"}),a("span",[e._v("商品管理")])]),a("el-menu-item",{attrs:{index:"/dashboard/goods"}},[a("i",{staticClass:"fa fa-circle"}),a("span",[e._v("商品列表")])]),a("el-menu-item",{attrs:{index:"/dashboard/category"}},[a("i",{staticClass:"fa fa-circle"}),a("span",[e._v("商品分类")])]),a("el-menu-item",{attrs:{index:"/dashboard/brand"}},[a("i",{staticClass:"fa fa-circle"}),a("span",[e._v("品牌管理")])])],2),a("el-submenu",{attrs:{index:"order"}},[a("template",{slot:"title"},[a("i",{staticClass:"fa fa-large fa-truck"}),e._v("订单中心 ")]),a("el-menu-item",{attrs:{index:"/dashboard/order"}},[a("i",{staticClass:"fa fa-circle"}),a("span",[e._v("订单列表")])])],2),a("el-submenu",{attrs:{index:"user"}},[a("template",{slot:"title"},[a("i",{staticClass:"fa fa-large fa-users"}),a("span",[e._v("会员管理")])]),a("el-menu-item",{attrs:{index:"/dashboard/user"}},[a("i",{staticClass:"fa fa-circle"}),a("span",[e._v("会员列表")])])],2)],1)],1)},y=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"logo"},[a("img",{attrs:{src:"/logo.png"}})])}],x={data:function(){return{currentPagePath:"/dashboard"}},methods:{handleOpen:function(e,t){console.log(e,t)},handleClose:function(e,t){console.log(e,t)},hasOwn:function(){}},mounted:function(){console.log(this.$route.path)}},w=x,q=(a("7cfb"),Object(f["a"])(w,_,y,!1,null,null,null)),F=q.exports,k=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"right-box"},[a("div",{staticClass:"navbar"},[a("div",{staticClass:"menu"},[e._m(0),a("div",{staticClass:"menu-item"},[a("i",{staticClass:"fa fa-sign-out",on:{click:e.logout}})])])])])},C=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"menu-item"},[a("i",{staticClass:"fa fa-user"})])}],$=(a("ac1f"),a("5319"),{data:function(){return{}},methods:{logout:function(){var e=this;this.$confirm("是否要退出?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){localStorage.clear(),e.$router.replace({name:"login"})}))}}}),j=$,S=(a("c567"),Object(f["a"])(j,k,C,!1,null,"9ea6e046",null)),E=S.exports,I={data:function(){return{dialogVisible:!1}},components:{Sidebar:F,Navbar:E},methods:{handleOpen:function(e,t){console.log(e,t)},handleClose:function(e,t){console.log(e,t)}}},P=I,L=(a("11bb"),Object(f["a"])(P,g,v,!1,null,"d935ccfa",null)),O=L.exports,T=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{path:"/dashboard"}}},[e._v("后台主页")])],1)],1),a("div",{staticClass:"content-main"})])},z=[],D={data:function(){return{dialogVisible:!1}},components:{}},N=D,R=Object(f["a"])(N,T,z,!1,null,"24f6ee72",null),B=R.exports,U=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{path:"/dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("商品管理")]),a("el-breadcrumb-item",[e._v("商品列表")])],1),a("div",{staticClass:"operation-nav"},[a("router-link",{attrs:{to:"/dashboard/goods/add"}},[a("el-button",{attrs:{type:"primary",icon:"plus"}},[e._v("添加商品")])],1)],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"filter-box"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.filterForm}},[a("el-form-item",{attrs:{label:"商品名称"}},[a("el-input",{attrs:{placeholder:"商品名称"},model:{value:e.filterForm.name,callback:function(t){e.$set(e.filterForm,"name",t)},expression:"filterForm.name"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitFilter}},[e._v("查询")])],1)],1)],1),a("div",{staticClass:"form-table-box"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData,border:"",stripe:""}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"100"}}),a("el-table-column",{attrs:{prop:"name",label:"商品名称"}}),a("el-table-column",{attrs:{prop:"retail_price",label:"售价",width:"120"}}),a("el-table-column",{attrs:{prop:"goods_number",label:"库存",width:"120"}}),a("el-table-column",{attrs:{prop:"is_new",label:"新品",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(1==t.row.is_new?"是":"否")+" ")]}}])}),a("el-table-column",{attrs:{prop:"is_new",label:"人气",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(1==t.row.is_hot?"是":"否")+" ")]}}])}),a("el-table-column",{attrs:{prop:"is_show",label:"上架",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(1==t.row.is_on_sale?"是":"否")+" ")]}}])}),a("el-table-column",{attrs:{prop:"sort_order",label:"排序",width:"80"}}),a("el-table-column",{attrs:{label:"操作",width:"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"small"},on:{click:function(a){return e.handleRowEdit(t.$index,t.row)}}},[e._v("编辑")]),a("el-button",{attrs:{size:"small",type:"danger"},on:{click:function(a){return e.handleRowDelete(t.$index,t.row)}}},[e._v("删除")])]}}])})],1)],1),a("div",{staticClass:"page-box"},[a("el-pagination",{attrs:{"current-page":e.page,"page-size":10,layout:"total, prev, pager, next, jumper",total:e.total},on:{"current-change":e.handlePageChange}})],1)])])},V=[],Q=(a("e9c4"),{data:function(){return{page:1,total:0,filterForm:{name:""},tableData:[]}},methods:{handlePageChange:function(e){this.page=e,localStorage.setItem("goodsPage",this.page),localStorage.setItem("goodsFilterForm",JSON.stringify(this.filterForm)),this.getList()},handleRowEdit:function(e,t){this.$router.push({name:"goods_add",query:{id:t.id}})},handleRowDelete:function(e,t){var a=this;this.$confirm("确定要删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){a.axios.post("商品/destory",{id:t.id}).then((function(e){console.log(e.data),0===e.data.errno&&(a.$message({type:"success",message:"删除成功!"}),a.getList())}))}))},onSubmitFilter:function(){this.page=1,this.getList()},getList:function(){var e=this;this.axios.get("goods",{params:{page:this.page,name:this.filterForm.name}}).then((function(t){e.tableData=t.data.data.data,e.page=t.data.data.currentPage,e.total=t.data.data.count}))}},components:{},mounted:function(){this.getList()}}),A=Q,H=Object(f["a"])(A,U,V,!1,null,"4d4bd6be",null),M=H.exports,J=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{name:"dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("商品管理")]),a("el-breadcrumb-item",[e._v(e._s(e.infoForm.id?"编辑商品":"添加商品"))])],1),a("div",{staticClass:"operation-nav"},[a("el-button",{attrs:{type:"primary",icon:"arrow-left"},on:{click:e.goBackPage}},[e._v("返回列表")])],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"form-table-box"},[a("el-form",{ref:"infoForm",attrs:{rules:e.infoRules,model:e.infoForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"所属分类"}},[a("el-cascader",{attrs:{options:e.options,placeholder:"请选择分类"},on:{change:e.handleChange},model:{value:e.selectedOptions,callback:function(t){e.selectedOptions=t},expression:"selectedOptions"}})],1),a("el-form-item",{attrs:{label:"商品名称",prop:"name"}},[a("el-input",{model:{value:e.infoForm.name,callback:function(t){e.$set(e.infoForm,"name",t)},expression:"infoForm.name"}})],1),a("el-form-item",{attrs:{label:"所属品牌"}},[a("el-select",{attrs:{placeholder:"请选择商品"},model:{value:e.infoForm.region,callback:function(t){e.$set(e.infoForm,"region",t)},expression:"infoForm.region"}},[a("el-option",{attrs:{label:"长城",value:"shanghai"}}),a("el-option",{attrs:{label:"宝马",value:"beijing"}})],1)],1),a("el-form-item",{attrs:{label:"商品简介",prop:"simple_desc"}},[a("el-input",{attrs:{type:"textarea",rows:3},model:{value:e.infoForm.simple_desc,callback:function(t){e.$set(e.infoForm,"simple_desc",t)},expression:"infoForm.simple_desc"}}),a("div",{staticClass:"form-tip"})],1),a("el-form-item",{attrs:{label:"商品图片",prop:"list_pic_url"}},[a("el-upload",{staticClass:"image-uploader",attrs:{name:"brand_pic",action:"/admin/upload/brandPic","show-file-list":!0,"on-success":e.handleUploadImageSuccess,headers:e.uploaderHeader}},[e.infoForm.list_pic_url?a("img",{staticClass:"image-show",attrs:{src:e.infoForm.list_pic_url}}):a("i",{staticClass:"el-icon-plus image-uploader-icon"})]),a("div",{staticClass:"form-tip"},[e._v("图片尺寸：750*420")])],1),a("el-form-item",{attrs:{label:"规格/库存",prop:"simple_desc"}}),a("el-form-item",{attrs:{label:"推荐类型"}},[a("el-checkbox-group",{model:{value:e.infoForm.type,callback:function(t){e.$set(e.infoForm,"type",t)},expression:"infoForm.type"}},[a("el-checkbox",{attrs:{label:"新品",name:"type"}}),a("el-checkbox",{attrs:{label:"人气",name:"type"}})],1)],1),a("el-form-item",{attrs:{label:"上架"}},[a("el-switch",{attrs:{"on-text":"","off-text":""},model:{value:e.infoForm.status,callback:function(t){e.$set(e.infoForm,"status",t)},expression:"infoForm.status"}})],1),a("el-form-item",{attrs:{label:"排序"}},[a("el-input-number",{attrs:{min:1,max:1e3},model:{value:e.infoForm.sort_order,callback:function(t){e.$set(e.infoForm,"sort_order",t)},expression:"infoForm.sort_order"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitInfo}},[e._v("确定保存")]),a("el-button",{on:{click:e.goBackPage}},[e._v("取消")])],1)],1)],1)])])},X=[],G={},W=G,K={data:function(){return{uploaderHeader:{"X-Nideshop-Token":localStorage.getItem("token")||""},infoForm:{id:0,name:"",list_pic_url:"",simple_desc:"",pic_url:"",sort_order:100,is_show:!0,floor_price:0,app_list_pic_url:"",is_new:!1,new_pic_url:"",new_sort_order:10},infoRules:{name:[{required:!0,message:"请输入名称",trigger:"blur"}],simple_desc:[{required:!0,message:"请输入简介",trigger:"blur"}],list_pic_url:[{required:!0,message:"请选择商品图片",trigger:"blur"}]}}},methods:{goBackPage:function(){this.$router.go(-1)},onSubmitInfo:function(){var e=this;this.$refs["infoForm"].validate((function(t){if(!t)return!1;e.axios.post("brand/store",e.infoForm).then((function(t){0===t.data.errno?(e.$message({type:"success",message:"保存成功"}),e.$router.go(-1)):e.$message({type:"error",message:"保存失败"})}))}))},handleUploadImageSuccess:function(e,t){if(0===e.errno)switch(e.data.name){case"brand_pic":this.$set("infoForm.list_pic_url",e.data.fileUrl);break;case"brand_new_pic":this.$set("infoForm.new_pic_url",e.data.fileUrl);break}},getInfo:function(){if(this.infoForm.id<=0)return!1;var e=this;this.axios.get("brand/info",{params:{id:e.infoForm.id}}).then((function(t){var a=t.data.data;a.is_new=!!a.is_new,a.is_show=!!a.is_show,e.infoForm=a}))}},components:{},mounted:function(){this.infoForm.id=this.$route.query.id||0,this.getInfo(),console.log(W)}},Y=K,Z=(a("cf79"),Object(f["a"])(Y,J,X,!1,null,null,null)),ee=Z.exports,te=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{path:"/dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("商品管理")]),a("el-breadcrumb-item",[e._v("商品分类")])],1),a("div",{staticClass:"operation-nav"},[a("router-link",{attrs:{to:"/dashboard/category/add"}},[a("el-button",{attrs:{type:"primary",icon:"plus"}},[e._v("添加分类")])],1)],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"form-table-box"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData,border:"",stripe:""}},[a("el-table-column",{attrs:{prop:"name",label:"分类名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(2==t.row.level?"　":"")+" "+e._s(t.row.name)+" ")]}}])}),a("el-table-column",{attrs:{prop:"is_show",label:"是否显示",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(1==t.row.is_show?"是":"否")+" ")]}}])}),a("el-table-column",{attrs:{prop:"sort_order",label:"排序",width:"80"}}),a("el-table-column",{attrs:{label:"操作",width:"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"small"},on:{click:function(a){return e.handleRowEdit(t.$index,t.row)}}},[e._v("编辑")]),a("el-button",{attrs:{size:"small",type:"danger"},on:{click:function(a){return e.handleRowDelete(t.$index,t.row)}}},[e._v("删除")])]}}])})],1)],1)])])},ae=[],ie={data:function(){return{page:1,total:0,filterForm:{name:""},tableData:[]}},methods:{handlePageChange:function(e){this.page=e,localStorage.setItem("brandPage",this.page),localStorage.setItem("brandFilterForm",JSON.stringify(this.filterForm)),this.getList()},handleRowEdit:function(e,t){this.$router.push({name:"category_add",query:{id:t.id}})},handleRowDelete:function(e,t){var a=this;this.$confirm("确定要删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){a.axios.post("category/destory",{id:t.id}).then((function(e){console.log(e.data),0===e.data.errno&&(a.$message({type:"success",message:"删除成功!"}),a.getList())}))}))},onSubmitFilter:function(){this.page=1,this.getList()},getList:function(){var e=this;this.axios.get("category",{params:{page:this.page,name:this.filterForm.name}}).then((function(t){e.tableData=t.data.data}))}},components:{},mounted:function(){this.getList()}},re=ie,oe=(a("8b09"),Object(f["a"])(re,te,ae,!1,null,"75519eea",null)),ne=oe.exports,se=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{name:"dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("商品管理")]),a("el-breadcrumb-item",[e._v(e._s(e.infoForm.id?"编辑分类":"添加分类"))])],1),a("div",{staticClass:"operation-nav"},[a("el-button",{attrs:{type:"primary",icon:"arrow-left"},on:{click:e.goBackPage}},[e._v("返回列表")])],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"form-table-box"},[a("el-form",{ref:"infoForm",attrs:{rules:e.infoRules,model:e.infoForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"上级分类",prop:"name"}},[a("el-select",{attrs:{placeholder:"请选择上级分类"},model:{value:e.infoForm.parent_id,callback:function(t){e.$set(e.infoForm,"parent_id",t)},expression:"infoForm.parent_id"}},e._l(e.parentCategory,(function(e){return a("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",{attrs:{label:"分类名称",prop:"name"}},[a("el-input",{model:{value:e.infoForm.name,callback:function(t){e.$set(e.infoForm,"name",t)},expression:"infoForm.name"}})],1),a("el-form-item",{attrs:{label:"简短介绍",prop:"front_name"}},[a("el-input",{attrs:{type:"textarea",rows:1},model:{value:e.infoForm.front_name,callback:function(t){e.$set(e.infoForm,"front_name",t)},expression:"infoForm.front_name"}}),a("div",{staticClass:"form-tip"})],1),a("el-form-item",{attrs:{label:"图标",prop:"wap_banner_url"}},[a("el-upload",{staticClass:"image-uploader",attrs:{name:"wap_banner_pic",action:"/admin/upload/categoryWapBannerPic","show-file-list":!1,"on-success":e.handleUploadImageSuccess,headers:e.uploaderHeader}},[e.infoForm.wap_banner_url?a("img",{staticClass:"image-show",attrs:{src:e.infoForm.wap_banner_url}}):a("i",{staticClass:"el-icon-plus image-uploader-icon"})]),a("div",{staticClass:"form-tip"},[e._v("图片尺寸：顶级分类为750*246，二级分类为250*250")])],1),a("el-form-item",{attrs:{label:"排序"}},[a("el-input-number",{attrs:{min:1,max:1e3},model:{value:e.infoForm.sort_order,callback:function(t){e.$set(e.infoForm,"sort_order",t)},expression:"infoForm.sort_order"}})],1),a("el-form-item",{attrs:{label:"启用"}},[a("el-switch",{model:{value:e.infoForm.is_show,callback:function(t){e.$set(e.infoForm,"is_show",t)},expression:"infoForm.is_show"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitInfo}},[e._v("确定保存")]),a("el-button",{on:{click:e.goBackPage}},[e._v("取消")])],1)],1)],1)])])},le=[],ce=(a("99af"),{data:function(){return{uploaderHeader:{"X-Nideshop-Token":localStorage.getItem("token")||""},parentCategory:[{id:0,name:"顶级分类"}],infoForm:{id:0,name:"",parent_id:0,front_name:"",wap_banner_url:"",sort_order:100,is_show:!0},infoRules:{name:[{required:!0,message:"请输入名称",trigger:"blur"}],front_name:[{required:!0,message:"请输入简介",trigger:"blur"}],wap_banner_url:[{required:!0,message:"请选择分类图片",trigger:"blur"}]}}},methods:{goBackPage:function(){this.$router.go(-1)},onSubmitInfo:function(){var e=this;this.$refs["infoForm"].validate((function(t){if(!t)return!1;e.axios.post("category/store",e.infoForm).then((function(t){0===t.data.errno?(e.$message({type:"success",message:"保存成功"}),e.$router.go(-1)):e.$message({type:"error",message:"保存失败"})}))}))},handleUploadImageSuccess:function(e,t){if(0===e.errno)switch(e.data.name){case"wap_banner_url":this.infoForm.wap_banner_url=e.data.fileUrl;break}},getTopCategory:function(){var e=this;this.axios.get("category/topCategory").then((function(t){e.parentCategory=e.parentCategory.concat(t.data.data)}))},getInfo:function(){if(this.infoForm.id<=0)return!1;var e=this;this.axios.get("category/info",{params:{id:e.infoForm.id}}).then((function(t){var a=t.data.data;a.is_show=!!a.is_show,e.infoForm=a}))}},components:{},mounted:function(){this.getTopCategory(),this.infoForm.id=this.$route.query.id||0,this.getInfo()}}),ue=ce,me=(a("fe52"),Object(f["a"])(ue,se,le,!1,null,null,null)),de=me.exports,fe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{path:"/dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("商品管理")]),a("el-breadcrumb-item",[e._v("品牌列表")])],1),a("div",{staticClass:"operation-nav"},[a("router-link",{attrs:{to:"/dashboard/brand/add"}},[a("el-button",{attrs:{type:"primary",icon:"plus"}},[e._v("添加品牌")])],1)],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"filter-box"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.filterForm}},[a("el-form-item",{attrs:{label:"品牌名称"}},[a("el-input",{attrs:{placeholder:"品牌名称"},model:{value:e.filterForm.name,callback:function(t){e.$set(e.filterForm,"name",t)},expression:"filterForm.name"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitFilter}},[e._v("查询")])],1)],1)],1),a("div",{staticClass:"form-table-box"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData,border:"",stripe:""}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"100"}}),a("el-table-column",{attrs:{prop:"name",label:"品牌名称"}}),a("el-table-column",{attrs:{prop:"is_new",label:"推荐到首页",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(1==t.row.is_new?"是":"否")+" ")]}}])}),a("el-table-column",{attrs:{prop:"is_show",label:"是否显示",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(1==t.row.is_show?"是":"否")+" ")]}}])}),a("el-table-column",{attrs:{prop:"sort_order",label:"排序",width:"80"}}),a("el-table-column",{attrs:{label:"操作",width:"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"small"},on:{click:function(a){return e.handleRowEdit(t.$index,t.row)}}},[e._v("编辑")]),a("el-button",{attrs:{size:"small",type:"danger"},on:{click:function(a){return e.handleRowDelete(t.$index,t.row)}}},[e._v("删除")])]}}])})],1)],1),a("div",{staticClass:"page-box"},[a("el-pagination",{attrs:{"current-page":e.page,"page-size":10,layout:"total, prev, pager, next, jumper",total:e.total},on:{"current-change":e.handlePageChange}})],1)])])},pe=[],be={data:function(){return{page:1,total:0,filterForm:{name:""},tableData:[]}},methods:{handlePageChange:function(e){this.page=e,localStorage.setItem("brandPage",this.page),localStorage.setItem("brandFilterForm",JSON.stringify(this.filterForm)),this.getList()},handleRowEdit:function(e,t){this.$router.push({name:"brand_add",query:{id:t.id}})},handleRowDelete:function(e,t){var a=this;this.$confirm("确定要删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){a.axios.post("brand/destory",{id:t.id}).then((function(e){console.log(e.data),0===e.data.errno&&(a.$message({type:"success",message:"删除成功!"}),a.getList())}))}))},onSubmitFilter:function(){this.page=1,this.getList()},getList:function(){var e=this;this.axios.get("brand",{params:{page:this.page,name:this.filterForm.name}}).then((function(t){e.tableData=t.data.data.data,e.page=t.data.data.currentPage,e.total=t.data.data.count}))}},components:{},mounted:function(){this.getList()}},he=be,ge=Object(f["a"])(he,fe,pe,!1,null,"15875b85",null),ve=ge.exports,_e=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{name:"dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("商品管理")]),a("el-breadcrumb-item",[e._v(e._s(e.infoForm.id?"编辑品牌":"添加品牌"))])],1),a("div",{staticClass:"operation-nav"},[a("el-button",{attrs:{type:"primary",icon:"arrow-left"},on:{click:e.goBackPage}},[e._v("返回列表")])],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"form-table-box"},[a("el-form",{ref:"infoForm",attrs:{rules:e.infoRules,model:e.infoForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"品牌名称",prop:"name"}},[a("el-input",{model:{value:e.infoForm.name,callback:function(t){e.$set(e.infoForm,"name",t)},expression:"infoForm.name"}})],1),a("el-form-item",{attrs:{label:"品牌简介",prop:"simple_desc"}},[a("el-input",{attrs:{type:"textarea",rows:3},model:{value:e.infoForm.simple_desc,callback:function(t){e.$set(e.infoForm,"simple_desc",t)},expression:"infoForm.simple_desc"}}),a("div",{staticClass:"form-tip"})],1),a("el-form-item",{attrs:{label:"品牌图片",prop:"list_pic_url"}},[a("el-upload",{staticClass:"image-uploader",attrs:{name:"brand_pic",action:"/admin/upload/brandPic","show-file-list":!1,"on-success":e.handleUploadImageSuccess,headers:e.uploaderHeader}},[e.infoForm.list_pic_url?a("img",{staticClass:"image-show",attrs:{src:e.infoForm.list_pic_url}}):a("i",{staticClass:"el-icon-plus image-uploader-icon"})]),a("div",{staticClass:"form-tip"},[e._v("图片尺寸：750*420")])],1),a("el-form-item",{attrs:{label:"推荐"}},[a("el-checkbox",{attrs:{label:""},model:{value:e.infoForm.is_new,callback:function(t){e.$set(e.infoForm,"is_new",t)},expression:"infoForm.is_new"}})],1),e.infoForm.is_new?a("el-form-item",{attrs:{label:"推荐展示图片"}},[a("el-upload",{staticClass:"image-uploader new-image-uploader",attrs:{name:"brand_new_pic",action:"/admin/upload/brandNewPic","show-file-list":!1,"on-success":e.handleUploadImageSuccess,headers:e.uploaderHeader}},[e.infoForm.new_pic_url?a("img",{staticClass:"image-show",attrs:{src:e.infoForm.new_pic_url}}):a("i",{staticClass:"el-icon-plus image-uploader-icon"})]),a("div",{staticClass:"form-tip"},[e._v("图片尺寸：375*252")])],1):e._e(),a("el-form-item",{attrs:{label:"排序"}},[a("el-input-number",{attrs:{min:1,max:1e3},model:{value:e.infoForm.sort_order,callback:function(t){e.$set(e.infoForm,"sort_order",t)},expression:"infoForm.sort_order"}})],1),a("el-form-item",{attrs:{label:"启用"}},[a("el-switch",{model:{value:e.infoForm.is_show,callback:function(t){e.$set(e.infoForm,"is_show",t)},expression:"infoForm.is_show"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitInfo}},[e._v("确定保存")]),a("el-button",{on:{click:e.goBackPage}},[e._v("取消")])],1)],1)],1)])])},ye=[],xe={data:function(){return{uploaderHeader:{"X-Nideshop-Token":localStorage.getItem("token")||""},infoForm:{id:0,name:"",list_pic_url:"",simple_desc:"",pic_url:"",sort_order:100,is_show:!0,floor_price:0,app_list_pic_url:"",is_new:!1,new_pic_url:"",new_sort_order:10},infoRules:{name:[{required:!0,message:"请输入名称",trigger:"blur"}],simple_desc:[{required:!0,message:"请输入简介",trigger:"blur"}],list_pic_url:[{required:!0,message:"请选择品牌图片",trigger:"blur"}]}}},methods:{goBackPage:function(){this.$router.go(-1)},onSubmitInfo:function(){var e=this;this.$refs["infoForm"].validate((function(t){if(!t)return!1;e.axios.post("brand/store",e.infoForm).then((function(t){0===t.data.errno?(e.$message({type:"success",message:"保存成功"}),e.$router.go(-1)):e.$message({type:"error",message:"保存失败"})}))}))},handleUploadImageSuccess:function(e,t){if(0===e.errno)switch(e.data.name){case"brand_pic":this.$set("infoForm.list_pic_url",e.data.fileUrl);break;case"brand_new_pic":this.$set("infoForm.new_pic_url",e.data.fileUrl);break}},getInfo:function(){if(this.infoForm.id<=0)return!1;var e=this;this.axios.get("brand/info",{params:{id:e.infoForm.id}}).then((function(t){var a=t.data.data;a.is_new=!!a.is_new,a.is_show=!!a.is_show,e.infoForm=a}))}},components:{},mounted:function(){this.infoForm.id=this.$route.query.id||0,this.getInfo(),console.log(W)}},we=xe,qe=(a("3945"),Object(f["a"])(we,_e,ye,!1,null,null,null)),Fe=qe.exports,ke=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{path:"/dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("订单中心")]),a("el-breadcrumb-item",[e._v("订单列表")])],1),a("div",{staticClass:"operation-nav"},[a("router-link",{attrs:{to:"/dashboard/order/add"}},[a("el-button",{attrs:{type:"primary",icon:"plus"}},[e._v("添加订单")])],1)],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"filter-box"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.filterForm}},[a("el-form-item",{attrs:{label:"订单号"}},[a("el-input",{attrs:{placeholder:"请输入订单号"},model:{value:e.filterForm.order_sn,callback:function(t){e.$set(e.filterForm,"order_sn",t)},expression:"filterForm.order_sn"}})],1),a("el-form-item",{attrs:{label:"收货人"}},[a("el-input",{attrs:{placeholder:"请输入收货人"},model:{value:e.filterForm.consignee,callback:function(t){e.$set(e.filterForm,"consignee",t)},expression:"filterForm.consignee"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitFilter}},[e._v("查询")])],1)],1)],1),a("div",{staticClass:"form-table-box"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData,border:"",stripe:""}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"100"}}),a("el-table-column",{attrs:{prop:"order_sn",label:"订单号"}}),a("el-table-column",{attrs:{prop:"add_time",label:"下单时间"}}),a("el-table-column",{attrs:{prop:"consignee",label:"收货人"}}),a("el-table-column",{attrs:{prop:"actual_price",label:"订单金额"}}),a("el-table-column",{attrs:{prop:"order_status_text",label:"订单状态"}}),a("el-table-column",{attrs:{label:"操作",width:"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"small"},on:{click:function(a){return e.handleRowEdit(t.$index,t.row)}}},[e._v("查看")]),a("el-button",{attrs:{size:"small",type:"danger"},on:{click:function(a){return e.handleRowDelete(t.$index,t.row)}}},[e._v("删除")])]}}])})],1)],1),a("div",{staticClass:"page-box"},[a("el-pagination",{attrs:{"current-page":e.page,"page-size":10,layout:"total, prev, pager, next, jumper",total:e.total},on:{"current-change":e.handlePageChange}})],1)])])},Ce=[],$e={data:function(){return{page:1,total:0,filterForm:{name:""},tableData:[]}},methods:{handlePageChange:function(e){this.page=e,localStorage.setItem("orderPage",this.page),localStorage.setItem("orderFilterForm",JSON.stringify(this.filterForm)),this.getList()},handleRowEdit:function(e,t){this.$router.push({name:"order_add",query:{id:t.id}})},handleRowDelete:function(e,t){var a=this;this.$confirm("确定要删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){a.axios.post("order/destory",{id:t.id}).then((function(e){console.log(e.data),0===e.data.errno&&(a.$message({type:"success",message:"删除成功!"}),a.getList())}))}))},onSubmitFilter:function(){this.page=1,this.getList()},getList:function(){var e=this;this.axios.get("order",{params:{page:this.page,orderSn:this.filterForm.order_sn,consignee:this.filterForm.consignee}}).then((function(t){e.tableData=t.data.data.data,e.page=t.data.data.currentPage,e.total=t.data.data.count}))}},components:{},mounted:function(){this.getList()}},je=$e,Se=Object(f["a"])(je,ke,Ce,!1,null,"71241e06",null),Ee=Se.exports,Ie=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("div",{staticClass:"breadcrumb"},[e._v(" 订单详情 ")]),a("div",{staticClass:"operation-nav"},[a("el-button",{attrs:{type:"primary",size:"small",icon:"arrow-left"},on:{click:e.goBackPage}},[e._v("返回列表")])],1)]),a("div",{staticClass:"content-main"},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.pageLoading,expression:"pageLoading"}],staticClass:"form-table-box",attrs:{"element-loading-text":"拼命加载中"}})])])},Pe=[],Le={data:function(){return{pageLoading:!1,infoForm:{id:0}}},methods:{goBackPage:function(){this.$router.go(-1)},getInfo:function(){var e=this;if(this.infoForm.id<=0)return!1;var t=this;this.axios.get("/admin/brand/info",{params:{id:t.infoForm.id}}).then((function(a){console.log(a.data);var i=a.data.data;t.infoForm=i,e.pageLoading=!1}))}},components:{},mounted:function(){console.log(this.$route.query),this.infoForm.id=this.$route.query.id||0,this.getInfo()}},Oe=Le,Te=Object(f["a"])(Oe,Ie,Pe,!1,null,null,null),ze=Te.exports,De=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{path:"/dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("活动运营")]),a("el-breadcrumb-item",[e._v("活动管理")])],1),a("div",{staticClass:"operation-nav"},[a("router-link",{attrs:{to:"/dashboard/operate/promotion/add"}},[a("el-button",{attrs:{type:"primary",icon:"plus",size:"mini"}},[e._v("添加活动")])],1)],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"filter-box"},[a("el-form",{attrs:{inline:!0,model:e.filterForm,size:"mini"},nativeOn:{submit:function(e){e.preventDefault()},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.onSubmitFilter.apply(null,arguments)}}},[a("el-form-item",{attrs:{label:"活动名称"}},[a("el-input",{attrs:{placeholder:"活动名称"},model:{value:e.filterForm.name,callback:function(t){e.$set(e.filterForm,"name",t)},expression:"filterForm.name"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitFilter}},[e._v("查询")])],1)],1)],1),a("div",{staticClass:"form-table-box"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData,border:"",stripe:"",size:"mini"}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"60"}}),a("el-table-column",{attrs:{prop:"name",label:"活动名称"}}),a("el-table-column",{attrs:{prop:"content",label:"活动描述","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"link",label:"活动连接","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"media_type",label:"海报"},scopedSlots:e._u([{key:"default",fn:function(e){var t=e.row;return[a("el-popover",{attrs:{placement:"left-start",trigger:"hover"}},[a("img",{staticStyle:{"max-height":"200px"},attrs:{src:t.image_url,alt:""}}),a("img",{staticStyle:{height:"40px"},attrs:{slot:"reference",src:t.image_url,alt:""},slot:"reference"})])]}}])}),a("el-table-column",{attrs:{prop:"sort_order",label:"排序",width:"80"}}),a("el-table-column",{attrs:{prop:"enabled",label:"是否显示",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(1==t.row.enabled?"是":"否")+" ")]}}])}),a("el-table-column",{attrs:{label:"操作",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleRowEdit(t.$index,t.row)}}},[e._v("编辑")]),a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleRowDelete(t.$index,t.row)}}},[e._v("删除")])]}}])})],1)],1),a("div",{staticClass:"page-box"},[a("el-pagination",{attrs:{"current-page":e.page,"page-size":10,layout:"total, prev, pager, next, jumper",total:e.total},on:{"current-change":e.handlePageChange}})],1)])])},Ne=[],Re={data:function(){return{page:1,total:0,filterForm:{name:""},tableData:[]}},methods:{handlePageChange:function(e){this.page=e,localStorage.setItem("promotionPage",this.page),localStorage.setItem("promotionFilterForm",JSON.stringify(this.filterForm)),this.getList()},handleRowEdit:function(e,t){this.$router.push({name:"promotion_add",query:{id:t.id}})},handleRowDelete:function(e,t){var a=this;this.$confirm("确定要删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){a.axios.post("promotion/destory",{id:t.id}).then((function(e){console.log(e.data),0===e.data.errno&&(a.$message({type:"success",message:"删除成功!"}),a.getList())}))}))},onSubmitFilter:function(){this.page=1,this.getList()},getList:function(){var e=this;this.axios.get("ad",{params:{page:this.page,name:this.filterForm.name}}).then((function(t){e.tableData=t.data.data.data,e.page=t.data.data.currentPage,e.total=t.data.data.count}))}},components:{},mounted:function(){this.getList()}},Be=Re,Ue=Object(f["a"])(Be,De,Ne,!1,null,"9185bef0",null),Ve=Ue.exports,Qe=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{name:"dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("活动运营")]),a("el-breadcrumb-item",[e._v(e._s(e.infoForm.id?"编辑活动":"添加活动"))])],1),a("div",{staticClass:"operation-nav"},[a("el-button",{attrs:{type:"primary",icon:"arrow-left"},on:{click:e.goBackPage}},[e._v("返回列表")])],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"form-table-box"},[a("el-form",{ref:"infoForm",attrs:{rules:e.infoRules,model:e.infoForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"活动标题",prop:"name"}},[a("el-input",{model:{value:e.infoForm.name,callback:function(t){e.$set(e.infoForm,"name",t)},expression:"infoForm.name"}})],1),a("el-form-item",{attrs:{label:"活动描述",prop:"content"}},[a("el-input",{attrs:{type:"textarea",rows:3},model:{value:e.infoForm.content,callback:function(t){e.$set(e.infoForm,"content",t)},expression:"infoForm.content"}}),a("div",{staticClass:"form-tip"})],1),a("el-form-item",{attrs:{label:"活动连接",prop:"link"}},[a("el-input",{model:{value:e.infoForm.link,callback:function(t){e.$set(e.infoForm,"link",t)},expression:"infoForm.link"}})],1),a("el-form-item",{attrs:{label:"缩略图",prop:"image_url"}},[a("el-upload",{staticClass:"image-uploader",attrs:{name:"image_url",action:"/admin/upload/adThumb","show-file-list":!1,"on-success":e.handleUploadImageSuccess,headers:e.uploaderHeader}},[e.infoForm.image_url?a("img",{staticClass:"image-show",attrs:{src:e.infoForm.image_url}}):a("i",{staticClass:"el-icon-plus image-uploader-icon"})]),a("div",{staticClass:"form-tip"},[e._v("图片尺寸： 187*105")])],1),a("el-form-item",{attrs:{label:"缩略图URL",prop:"image_url"}},[a("el-input",{model:{value:e.infoForm.image_url,callback:function(t){e.$set(e.infoForm,"image_url",t)},expression:"infoForm.image_url"}})],1),a("el-form-item",{attrs:{label:"排序"}},[a("el-input-number",{attrs:{min:1,max:1e3},model:{value:e.infoForm.sort_order,callback:function(t){e.$set(e.infoForm,"sort_order",t)},expression:"infoForm.sort_order"}})],1),a("el-form-item",{attrs:{label:"启用"}},[a("el-switch",{model:{value:e.infoForm.enabled,callback:function(t){e.$set(e.infoForm,"enabled",t)},expression:"infoForm.enabled"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitInfo}},[e._v("确定保存")]),a("el-button",{on:{click:e.goBackPage}},[e._v("取消")])],1)],1)],1)])])},Ae=[],He={data:function(){return{uploaderHeader:{"X-Nideshop-Token":localStorage.getItem("token")||""},infoForm:{id:0,title:"",subtitle:"",sort_order:100,enabled:!0,image_url:""},infoRules:{title:[{required:!0,message:"请输入标题",trigger:"blur"}],subtitle:[{required:!0,message:"请输入子标题",trigger:"blur"}],image_url:[{required:!0,message:"请选择缩略图",trigger:"blur"}]}}},methods:{goBackPage:function(){this.$router.go(-1)},onSubmitInfo:function(){var e=this;this.$refs["infoForm"].validate((function(t){if(!t)return!1;e.axios.post("ad/store",e.infoForm).then((function(t){0===t.data.errno?(e.$message({type:"success",message:"保存成功"}),e.$router.go(-1)):e.$message({type:"error",message:"保存失败"})}))}))},handleUploadImageSuccess:function(e,t){if(0===e.errno)switch(e.data.name){case"ad_pic_url":this.infoForm.image_url=e.data.fileUrl;break}},getInfo:function(){if(this.infoForm.id<=0)return!1;var e=this;this.axios.get("ad/info",{params:{id:e.infoForm.id}}).then((function(t){var a=t.data.data;a.enabled=!!a.enabled,e.infoForm=a}))}},components:{},mounted:function(){this.infoForm.id=this.$route.query.id||0,this.getInfo(),console.log(W)}},Me=He,Je=(a("67bd"),Object(f["a"])(Me,Qe,Ae,!1,null,null,null)),Xe=Je.exports,Ge=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{path:"/dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("活动运营")]),a("el-breadcrumb-item",[e._v("测评管理")])],1),a("div",{staticClass:"operation-nav"},[a("router-link",{attrs:{to:"/dashboard/operate/assessment/add"}},[a("el-button",{attrs:{type:"primary",icon:"plus",size:"mini"}},[e._v("添加测评")])],1)],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"filter-box"},[a("el-form",{attrs:{inline:!0,model:e.filterForm,size:"mini"},nativeOn:{submit:function(e){e.preventDefault()},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.onSubmitFilter.apply(null,arguments)}}},[a("el-form-item",{attrs:{label:"测评名称"}},[a("el-input",{attrs:{placeholder:"测评名称"},model:{value:e.filterForm.name,callback:function(t){e.$set(e.filterForm,"name",t)},expression:"filterForm.name"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitFilter}},[e._v("查询")])],1)],1)],1),a("div",{staticClass:"form-table-box"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData,border:"",stripe:"",size:"mini"}},[a("el-table-column",{attrs:{prop:"name",label:"测评名称"}}),a("el-table-column",{attrs:{prop:"content",label:"测评描述","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"link",label:"测评连接","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"media_type",label:"海报"},scopedSlots:e._u([{key:"default",fn:function(e){var t=e.row;return[a("el-popover",{attrs:{placement:"left-start",trigger:"hover"}},[a("img",{staticStyle:{"max-height":"200px"},attrs:{src:t.image_url,alt:""}}),a("img",{staticStyle:{height:"40px"},attrs:{slot:"reference",src:t.image_url,alt:""},slot:"reference"})])]}}])}),a("el-table-column",{attrs:{prop:"sort_order",label:"排序",width:"80"}}),a("el-table-column",{attrs:{prop:"enabled",label:"是否显示",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(1==t.row.enabled?"是":"否")+" ")]}}])}),a("el-table-column",{attrs:{label:"操作",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleRowEdit(t.$index,t.row)}}},[e._v("编辑")]),a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleRowDelete(t.$index,t.row)}}},[e._v("删除")])]}}])})],1)],1),a("div",{staticClass:"page-box"},[a("el-pagination",{attrs:{"current-page":e.page,"page-size":10,layout:"total, prev, pager, next, jumper",total:e.total},on:{"current-change":e.handlePageChange}})],1)])])},We=[],Ke={data:function(){return{page:1,total:0,filterForm:{name:""},tableData:[]}},methods:{handlePageChange:function(e){this.page=e,localStorage.setItem("assessmentPage",this.page),localStorage.setItem("assessmentFilterForm",JSON.stringify(this.filterForm)),this.getList()},handleRowEdit:function(e,t){this.$router.push({name:"assessment_add",query:{id:t.id}})},handleRowDelete:function(e,t){var a=this;this.$confirm("确定要删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){a.axios.post("assessment/destory",{id:t.id}).then((function(e){console.log(e.data),0===e.data.errno&&(a.$message({type:"success",message:"删除成功!"}),a.getList())}))}))},onSubmitFilter:function(){this.page=1,this.getList()},getList:function(){var e=this;this.axios.get("assessment",{params:{page:this.page,name:this.filterForm.name}}).then((function(t){e.tableData=t.data.data.data,e.page=t.data.data.currentPage,e.total=t.data.data.count}))}},components:{},mounted:function(){this.getList()}},Ye=Ke,Ze=Object(f["a"])(Ye,Ge,We,!1,null,"6120191e",null),et=Ze.exports,tt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{name:"dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("测评运营")]),a("el-breadcrumb-item",[e._v(e._s(e.infoForm.id?"编辑测评":"添加测评"))])],1),a("div",{staticClass:"operation-nav"},[a("el-button",{attrs:{type:"primary",icon:"arrow-left"},on:{click:e.goBackPage}},[e._v("返回列表")])],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"form-table-box"},[a("el-form",{ref:"infoForm",attrs:{rules:e.infoRules,model:e.infoForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"测评标题",prop:"name"}},[a("el-input",{model:{value:e.infoForm.name,callback:function(t){e.$set(e.infoForm,"name",t)},expression:"infoForm.name"}})],1),a("el-form-item",{attrs:{label:"测评描述",prop:"content"}},[a("el-input",{attrs:{type:"textarea",rows:3},model:{value:e.infoForm.content,callback:function(t){e.$set(e.infoForm,"content",t)},expression:"infoForm.content"}}),a("div",{staticClass:"form-tip"})],1),a("el-form-item",{attrs:{label:"测评连接",prop:"link"}},[a("el-input",{model:{value:e.infoForm.link,callback:function(t){e.$set(e.infoForm,"link",t)},expression:"infoForm.link"}})],1),a("el-form-item",{attrs:{label:"缩略图",prop:"image_url"}},[a("el-upload",{staticClass:"image-uploader",attrs:{name:"image_url",action:"/admin/upload/assessmentThumb","show-file-list":!1,"on-success":e.handleUploadImageSuccess,headers:e.uploaderHeader}},[e.infoForm.image_url?a("img",{staticClass:"image-show",attrs:{src:e.infoForm.image_url}}):a("i",{staticClass:"el-icon-plus image-uploader-icon"})]),a("div",{staticClass:"form-tip"},[e._v("图片尺寸： 187*105")])],1),a("el-form-item",{attrs:{label:"缩略图URL",prop:"image_url"}},[a("el-input",{model:{value:e.infoForm.image_url,callback:function(t){e.$set(e.infoForm,"image_url",t)},expression:"infoForm.image_url"}})],1),a("el-form-item",{attrs:{label:"排序"}},[a("el-input-number",{attrs:{min:1,max:1e3},model:{value:e.infoForm.sort_order,callback:function(t){e.$set(e.infoForm,"sort_order",t)},expression:"infoForm.sort_order"}})],1),a("el-form-item",{attrs:{label:"启用"}},[a("el-switch",{model:{value:e.infoForm.enabled,callback:function(t){e.$set(e.infoForm,"enabled",t)},expression:"infoForm.enabled"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitInfo}},[e._v("确定保存")]),a("el-button",{on:{click:e.goBackPage}},[e._v("取消")])],1)],1)],1)])])},at=[],it={data:function(){return{uploaderHeader:{"X-Nideshop-Token":localStorage.getItem("token")||""},infoForm:{id:0,title:"",subtitle:"",sort_order:100,enabled:!0,image_url:""},infoRules:{title:[{required:!0,message:"请输入标题",trigger:"blur"}],subtitle:[{required:!0,message:"请输入子标题",trigger:"blur"}],image_url:[{required:!0,message:"请选择缩略图",trigger:"blur"}]}}},methods:{goBackPage:function(){this.$router.go(-1)},onSubmitInfo:function(){var e=this;this.$refs["infoForm"].validate((function(t){if(!t)return!1;e.axios.post("assessment/store",e.infoForm).then((function(t){0===t.data.errno?(e.$message({type:"success",message:"保存成功"}),e.$router.go(-1)):e.$message({type:"error",message:"保存失败"})}))}))},handleUploadImageSuccess:function(e,t){if(0===e.errno)switch(e.data.name){case"assessment_pic_url":this.infoForm.image_url=e.data.fileUrl;break}},getInfo:function(){if(this.infoForm.id<=0)return!1;var e=this;this.axios.get("assessment/info",{params:{id:e.infoForm.id}}).then((function(t){var a=t.data.data;a.enabled=!!a.enabled,e.infoForm=a}))}},components:{},mounted:function(){this.infoForm.id=this.$route.query.id||0,this.getInfo(),console.log(W)}},rt=it,ot=(a("d026"),Object(f["a"])(rt,tt,at,!1,null,null,null)),nt=ot.exports,st=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{path:"/dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("活动运营")]),a("el-breadcrumb-item",[e._v("公开课管理")])],1),a("div",{staticClass:"operation-nav"},[a("router-link",{attrs:{to:"/dashboard/operate/classes/add"}},[a("el-button",{attrs:{type:"primary",icon:"plus",size:"mini"}},[e._v("添加公开课")])],1)],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"filter-box"},[a("el-form",{attrs:{inline:!0,model:e.filterForm,size:"mini"},nativeOn:{submit:function(e){e.preventDefault()},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.onSubmitFilter.apply(null,arguments)}}},[a("el-form-item",{attrs:{label:"公开课名称"}},[a("el-input",{attrs:{placeholder:"公开课名称"},model:{value:e.filterForm.name,callback:function(t){e.$set(e.filterForm,"name",t)},expression:"filterForm.name"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitFilter}},[e._v("查询")])],1)],1)],1),a("div",{staticClass:"form-table-box"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData,border:"",stripe:"",size:"mini"}},[a("el-table-column",{attrs:{prop:"name",label:"公开课名称"}}),a("el-table-column",{attrs:{prop:"content",label:"公开课描述","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"link",label:"公开课连接","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"media_type",label:"海报"},scopedSlots:e._u([{key:"default",fn:function(e){var t=e.row;return[a("el-popover",{attrs:{placement:"left-start",trigger:"hover"}},[a("img",{staticStyle:{"max-height":"200px"},attrs:{src:t.image_url,alt:""}}),a("img",{staticStyle:{height:"40px"},attrs:{slot:"reference",src:t.image_url,alt:""},slot:"reference"})])]}}])}),a("el-table-column",{attrs:{prop:"sort_order",label:"排序",width:"80"}}),a("el-table-column",{attrs:{prop:"enabled",label:"是否显示",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(1==t.row.enabled?"是":"否")+" ")]}}])}),a("el-table-column",{attrs:{label:"操作",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleRowEdit(t.$index,t.row)}}},[e._v("编辑")]),a("el-button",{attrs:{type:"text"},on:{click:function(a){return e.handleRowDelete(t.$index,t.row)}}},[e._v("删除")])]}}])})],1)],1),a("div",{staticClass:"page-box"},[a("el-pagination",{attrs:{"current-page":e.page,"page-size":10,layout:"total, prev, pager, next, jumper",total:e.total},on:{"current-change":e.handlePageChange}})],1)])])},lt=[],ct={data:function(){return{page:1,total:0,filterForm:{name:""},tableData:[]}},methods:{handlePageChange:function(e){this.page=e,localStorage.setItem("classesPage",this.page),localStorage.setItem("classesFilterForm",JSON.stringify(this.filterForm)),this.getList()},handleRowEdit:function(e,t){this.$router.push({name:"classes_add",query:{id:t.id}})},handleRowDelete:function(e,t){var a=this;this.$confirm("确定要删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){a.axios.post("classes/destory",{id:t.id}).then((function(e){console.log(e.data),0===e.data.errno&&(a.$message({type:"success",message:"删除成功!"}),a.getList())}))}))},onSubmitFilter:function(){this.page=1,this.getList()},getList:function(){var e=this;this.axios.get("classes",{params:{page:this.page,name:this.filterForm.name}}).then((function(t){e.tableData=t.data.data.data,e.page=t.data.data.currentPage,e.total=t.data.data.count}))}},components:{},mounted:function(){this.getList()}},ut=ct,mt=Object(f["a"])(ut,st,lt,!1,null,"ef18bf7c",null),dt=mt.exports,ft=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{name:"dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("公开课运营")]),a("el-breadcrumb-item",[e._v(e._s(e.infoForm.id?"编辑公开课":"添加公开课"))])],1),a("div",{staticClass:"operation-nav"},[a("el-button",{attrs:{type:"primary",icon:"arrow-left"},on:{click:e.goBackPage}},[e._v("返回列表")])],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"form-table-box"},[a("el-form",{ref:"infoForm",attrs:{rules:e.infoRules,model:e.infoForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"公开课标题",prop:"name"}},[a("el-input",{model:{value:e.infoForm.name,callback:function(t){e.$set(e.infoForm,"name",t)},expression:"infoForm.name"}})],1),a("el-form-item",{attrs:{label:"公开课描述",prop:"content"}},[a("el-input",{attrs:{type:"textarea",rows:3},model:{value:e.infoForm.content,callback:function(t){e.$set(e.infoForm,"content",t)},expression:"infoForm.content"}}),a("div",{staticClass:"form-tip"})],1),a("el-form-item",{attrs:{label:"公开课类型",prop:"classes_type"}},[a("el-select",{model:{value:e.infoForm.classes_type,callback:function(t){e.$set(e.infoForm,"classes_type",t)},expression:"infoForm.classes_type"}},[a("el-option",{attrs:{label:"视频",value:1}}),a("el-option",{attrs:{label:"音频",value:2}}),a("el-option",{attrs:{label:"其它",value:0}})],1)],1),a("el-form-item",{attrs:{label:"公开课连接",prop:"link"}},[a("el-input",{model:{value:e.infoForm.link,callback:function(t){e.$set(e.infoForm,"link",t)},expression:"infoForm.link"}})],1),a("el-form-item",{attrs:{label:"缩略图",prop:"image_url"}},[a("el-upload",{staticClass:"image-uploader",attrs:{name:"image_url",action:"/admin/upload/classesThumb","show-file-list":!1,"on-success":e.handleUploadImageSuccess,headers:e.uploaderHeader}},[e.infoForm.image_url?a("img",{staticClass:"image-show",attrs:{src:e.infoForm.image_url}}):a("i",{staticClass:"el-icon-plus image-uploader-icon"})]),a("div",{staticClass:"form-tip"},[e._v("图片尺寸： 187*105")])],1),a("el-form-item",{attrs:{label:"缩略图URL",prop:"image_url"}},[a("el-input",{model:{value:e.infoForm.image_url,callback:function(t){e.$set(e.infoForm,"image_url",t)},expression:"infoForm.image_url"}})],1),a("el-form-item",{attrs:{label:"关联商品",prop:"goods_id"}},[a("SearchGood",{model:{value:e.infoForm.goods_id,callback:function(t){e.$set(e.infoForm,"goods_id",t)},expression:"infoForm.goods_id"}})],1),a("el-form-item",{attrs:{label:"排序"}},[a("el-input-number",{attrs:{min:1,max:1e3},model:{value:e.infoForm.sort_order,callback:function(t){e.$set(e.infoForm,"sort_order",t)},expression:"infoForm.sort_order"}})],1),a("el-form-item",{attrs:{label:"启用"}},[a("el-switch",{model:{value:e.infoForm.enabled,callback:function(t){e.$set(e.infoForm,"enabled",t)},expression:"infoForm.enabled"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitInfo}},[e._v("确定保存")]),a("el-button",{on:{click:e.goBackPage}},[e._v("取消")])],1)],1)],1)])])},pt=[],bt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-select",{attrs:{value:e.value,multiple:e.multiple,filterable:"",remote:"","reserve-keyword":"",placeholder:"请输入商品名称","remote-method":e.remoteMethod,loading:e.loading},on:{change:e.onChange}},[e.options?e._l(e.options,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})):e._e()],2)},ht=[],gt=a("ade3"),vt=(a("d3b7"),a("d81d"),{name:"SearchGood",props:{multiple:{type:Boolean,default:!1},value:{}},model:{prop:"value",event:"change"},watch:{value:{handler:function(e){e&&!this.options&&this.remoteMethod(void 0,this.value)},immediate:!0}},data:function(){var e;return e={options:[]},Object(gt["a"])(e,"options",void 0),Object(gt["a"])(e,"loading",!1),e},methods:{onChange:function(e){this.$emit("change",e)},remoteMethod:function(e,t){var a=this;console.log(e,t),e||t?(this.loading=!0,this.axios.get("goods",{params:{name:e,id:t}}).then((function(e){try{a.options=e.data.data.data.map((function(e){return{label:e.name,value:e.id}}))}catch(t){console.error(t),a.options=[]}})).finally((function(){a.loading=!1}))):this.options=[]}}}),_t=vt,yt=Object(f["a"])(_t,bt,ht,!1,null,null,null),xt=yt.exports,wt={data:function(){return{uploaderHeader:{"X-Nideshop-Token":localStorage.getItem("token")||""},infoForm:{id:0,title:"",subtitle:"",sort_order:100,enabled:!0,image_url:""},infoRules:{title:[{required:!0,message:"请输入标题",trigger:"blur"}],subtitle:[{required:!0,message:"请输入子标题",trigger:"blur"}],image_url:[{required:!0,message:"请选择缩略图",trigger:"blur"}]}}},methods:{goBackPage:function(){this.$router.go(-1)},onSubmitInfo:function(){var e=this;this.$refs["infoForm"].validate((function(t){if(!t)return!1;e.axios.post("classes/store",e.infoForm).then((function(t){0===t.data.errno?(e.$message({type:"success",message:"保存成功"}),e.$router.go(-1)):e.$message({type:"error",message:"保存失败"})}))}))},handleUploadImageSuccess:function(e,t){if(0===e.errno)switch(e.data.name){case"classes_pic_url":this.infoForm.image_url=e.data.fileUrl;break}},getInfo:function(){if(this.infoForm.id<=0)return!1;var e=this;this.axios.get("classes/info",{params:{id:e.infoForm.id}}).then((function(t){var a=t.data.data;a.enabled=!!a.enabled,e.infoForm=a}))}},components:{SearchGood:xt},mounted:function(){this.infoForm.id=this.$route.query.id||0,this.getInfo(),console.log(W)}},qt=wt,Ft=(a("5cf6"),Object(f["a"])(qt,ft,pt,!1,null,null,null)),kt=Ft.exports,Ct=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{path:"/dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("活动运营")]),a("el-breadcrumb-item",[e._v("专题管理")])],1),a("div",{staticClass:"operation-nav"},[a("router-link",{attrs:{to:"/dashboard/operate/topic/add"}},[a("el-button",{attrs:{type:"primary",icon:"plus"}},[e._v("添加专题")])],1)],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"filter-box"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.filterForm}},[a("el-form-item",{attrs:{label:"专题名称"}},[a("el-input",{attrs:{placeholder:"专题名称"},model:{value:e.filterForm.name,callback:function(t){e.$set(e.filterForm,"name",t)},expression:"filterForm.name"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitFilter}},[e._v("查询")])],1)],1)],1),a("div",{staticClass:"form-table-box"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData,border:"",stripe:""}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"100"}}),a("el-table-column",{attrs:{prop:"title",label:"专题名称"}}),a("el-table-column",{attrs:{prop:"is_show",label:"是否显示",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(1==t.row.is_show?"是":"否")+" ")]}}])}),a("el-table-column",{attrs:{prop:"sort_order",label:"排序",width:"80"}}),a("el-table-column",{attrs:{label:"操作",width:"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"small"},on:{click:function(a){return e.handleRowEdit(t.$index,t.row)}}},[e._v("编辑")]),a("el-button",{attrs:{size:"small",type:"danger"},on:{click:function(a){return e.handleRowDelete(t.$index,t.row)}}},[e._v("删除")])]}}])})],1)],1),a("div",{staticClass:"page-box"},[a("el-pagination",{attrs:{"current-page":e.page,"page-size":10,layout:"total, prev, pager, next, jumper",total:e.total},on:{"current-change":e.handlePageChange}})],1)])])},$t=[],jt={data:function(){return{page:1,total:0,filterForm:{name:""},tableData:[]}},methods:{handlePageChange:function(e){this.page=e,localStorage.setItem("topicPage",this.page),localStorage.setItem("topicFilterForm",JSON.stringify(this.filterForm)),this.getList()},handleRowEdit:function(e,t){this.$router.push({name:"topic_add",query:{id:t.id}})},handleRowDelete:function(e,t){var a=this;this.$confirm("确定要删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){a.axios.post("topic/destory",{id:t.id}).then((function(e){console.log(e.data),0===e.data.errno&&(a.$message({type:"success",message:"删除成功!"}),a.getList())}))}))},onSubmitFilter:function(){this.page=1,this.getList()},getList:function(){var e=this;this.axios.get("topic",{params:{page:this.page,name:this.filterForm.name}}).then((function(t){e.tableData=t.data.data.data,e.page=t.data.data.currentPage,e.total=t.data.data.count}))}},components:{},mounted:function(){this.getList()}},St=jt,Et=Object(f["a"])(St,Ct,$t,!1,null,"3b6fb184",null),It=Et.exports,Pt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{name:"dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("活动运营")]),a("el-breadcrumb-item",[e._v(e._s(e.infoForm.id?"编辑专题":"添加专题"))])],1),a("div",{staticClass:"operation-nav"},[a("el-button",{attrs:{type:"primary",icon:"arrow-left"},on:{click:e.goBackPage}},[e._v("返回列表")])],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"form-table-box"},[a("el-form",{ref:"infoForm",attrs:{rules:e.infoRules,model:e.infoForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"标题",prop:"title"}},[a("el-input",{model:{value:e.infoForm.title,callback:function(t){e.$set(e.infoForm,"title",t)},expression:"infoForm.title"}})],1),a("el-form-item",{attrs:{label:"子标题",prop:"subtitle"}},[a("el-input",{attrs:{type:"textarea",rows:3},model:{value:e.infoForm.subtitle,callback:function(t){e.$set(e.infoForm,"subtitle",t)},expression:"infoForm.subtitle"}}),a("div",{staticClass:"form-tip"})],1),a("el-form-item",{attrs:{label:"缩略图",prop:"scene_pic_url"}},[a("el-upload",{staticClass:"image-uploader",attrs:{name:"scene_pic_url",action:"/admin/upload/topicThumb","show-file-list":!1,"on-success":e.handleUploadImageSuccess,headers:e.uploaderHeader}},[e.infoForm.scene_pic_url?a("img",{staticClass:"image-show",attrs:{src:e.infoForm.scene_pic_url}}):a("i",{staticClass:"el-icon-plus image-uploader-icon"})]),a("div",{staticClass:"form-tip"},[e._v("图片尺寸：750*415")])],1),a("el-form-item",{attrs:{label:"排序"}},[a("el-input-number",{attrs:{min:1,max:1e3},model:{value:e.infoForm.sort_order,callback:function(t){e.$set(e.infoForm,"sort_order",t)},expression:"infoForm.sort_order"}})],1),a("el-form-item",{attrs:{label:"启用"}},[a("el-switch",{model:{value:e.infoForm.is_show,callback:function(t){e.$set(e.infoForm,"is_show",t)},expression:"infoForm.is_show"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitInfo}},[e._v("确定保存")]),a("el-button",{on:{click:e.goBackPage}},[e._v("取消")])],1)],1)],1)])])},Lt=[],Ot={data:function(){return{uploaderHeader:{"X-Nideshop-Token":localStorage.getItem("token")||""},infoForm:{id:0,title:"",subtitle:"",sort_order:100,is_show:!0,scene_pic_url:""},infoRules:{title:[{required:!0,message:"请输入标题",trigger:"blur"}],subtitle:[{required:!0,message:"请输入子标题",trigger:"blur"}],scene_pic_url:[{required:!0,message:"请选择缩略图",trigger:"blur"}]}}},methods:{goBackPage:function(){this.$router.go(-1)},onSubmitInfo:function(){var e=this;this.$refs["infoForm"].validate((function(t){if(!t)return!1;e.axios.post("topic/store",e.infoForm).then((function(t){0===t.data.errno?(e.$message({type:"success",message:"保存成功"}),e.$router.go(-1)):e.$message({type:"error",message:"保存失败"})}))}))},handleUploadImageSuccess:function(e,t){if(0===e.errno)switch(e.data.name){case"scene_pic_url":this.infoForm.scene_pic_url=e.data.fileUrl;break}},getInfo:function(){if(this.infoForm.id<=0)return!1;var e=this;this.axios.get("topic/info",{params:{id:e.infoForm.id}}).then((function(t){var a=t.data.data;a.is_show=!!a.is_show,e.infoForm=a}))}},components:{},mounted:function(){this.infoForm.id=this.$route.query.id||0,this.getInfo(),console.log(W)}},Tt=Ot,zt=(a("422d"),Object(f["a"])(Tt,Pt,Lt,!1,null,null,null)),Dt=zt.exports,Nt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{path:"/dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("测评管理")]),a("el-breadcrumb-item",[e._v("试卷管理")])],1),a("div",{staticClass:"operation-nav"},[a("router-link",{attrs:{to:"/dashboard/paper/edit"}},[a("el-button",{attrs:{type:"primary",icon:"plus",size:"mini"}},[e._v("添加试卷")])],1)],1)],1),a("el-form",{ref:"queryForm",attrs:{model:e.queryParam,inline:!0,size:"mini"},nativeOn:{submit:function(e){e.preventDefault()},keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.submitForm.apply(null,arguments)}}},[a("el-form-item",{attrs:{label:"名称："}},[a("el-input",{attrs:{clearable:""},model:{value:e.queryParam.name,callback:function(t){e.$set(e.queryParam,"name",t)},expression:"queryParam.name"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("查询")])],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{prop:"id",label:"Id",width:"90px"}}),a("el-table-column",{attrs:{prop:"name",label:"名称"}}),a("el-table-column",{attrs:{prop:"createTime",label:"创建时间",width:"160px"}}),a("el-table-column",{attrs:{label:"操作",align:"center",width:"160px"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.$router.push({path:"/dashboard/paper/edit",query:{id:i.id}})}}},[e._v("编辑")]),a("el-button",{staticClass:"link-left",attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.deletePaper(i)}}},[e._v("删除")])]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total > 0"}],attrs:{total:e.total,page:e.queryParam.pageIndex,limit:e.queryParam.pageSize},on:{"update:page":function(t){return e.$set(e.queryParam,"pageIndex",t)},"update:limit":function(t){return e.$set(e.queryParam,"pageSize",t)},pagination:e.search}})],1)},Rt=[],Bt=a("5530"),Ut=(a("841c"),a("4de4"),a("2f62")),Vt=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"pagination-container",class:{hidden:e.hidden}},[a("el-pagination",e._b({attrs:{background:e.background,"current-page":e.currentPage,"page-size":e.pageSize,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},Qt=[];a("a9e3");Math.easeInOutQuad=function(e,t,a,i){return e/=i/2,e<1?a/2*e*e+t:(e--,-a/2*(e*(e-2)-1)+t)};var At=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function Ht(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function Mt(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function Jt(e,t,a){var i=Mt(),r=e-i,o=20,n=0;t="undefined"===typeof t?500:t;var s=function e(){n+=o;var s=Math.easeInOutQuad(n,i,r,t);Ht(s),n<t?At(e):a&&"function"===typeof a&&a()};s()}var Xt={name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:10},pageSizes:{type:Array,default:function(){return[5,10,20,30,50]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(e){this.$emit("update:page",e)}},pageSize:{get:function(){return this.limit},set:function(e){this.$emit("update:limit",e)}}},methods:{handleSizeChange:function(e){this.$emit("pagination",{page:this.currentPage,limit:e}),this.autoScroll&&Jt(0,800)},handleCurrentChange:function(e){this.$emit("pagination",{page:e,limit:this.pageSize}),this.autoScroll&&Jt(0,800)}}},Gt=Xt,Wt=(a("39d5"),Object(f["a"])(Gt,Vt,Qt,!1,null,"90fd946a",null)),Kt=Wt.exports,Yt={components:{Pagination:Kt},data:function(){return{queryParam:{name:"",pageIndex:1,pageSize:10},subjectFilter:null,listLoading:!0,tableData:[],total:0}},created:function(){this.search()},methods:{submitForm:function(){this.queryParam.pageIndex=1,this.search()},search:function(){var e=this;this.listLoading=!0,this.axios.get("exam_paper",{params:{page:this.queryParam.pageIndex,size:this.queryParam.pageSize,name:this.queryParam.name}}).then((function(t){e.tableData=t.data.data.data,e.queryParam.pageIndex=t.data.data.currentPage,e.total=t.data.data.count})).finally((function(){e.listLoading=!1}))},deletePaper:function(e){var t=this;this.$confirm("确定要删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.axios.post("exam_paper/destory",{id:e.id}).then((function(e){console.log(e.data),0===e.data.errno&&(t.$message({type:"success",message:"删除成功!"}),t.getList())}))}))},levelChange:function(){var e=this;this.queryParam.subjectId=null,this.subjectFilter=this.subjects.filter((function(t){return t.level===e.queryParam.level}))},subjectFormatter:function(e,t,a,i){return this.subjectEnumFormat(a)}},computed:Object(Bt["a"])(Object(Bt["a"])(Object(Bt["a"])(Object(Bt["a"])({},Object(Ut["c"])("enumItem",["enumFormat"])),Object(Ut["d"])("enumItem",{levelEnum:function(e){return e.user.levelEnum}})),Object(Ut["c"])("exam",["subjectEnumFormat"])),Object(Ut["d"])("exam",{subjects:function(e){return e.subjects}}))},Zt=Yt,ea=Object(f["a"])(Zt,Nt,Rt,!1,null,null,null),ta=ea.exports,aa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.formLoading,expression:"formLoading"}],ref:"form",attrs:{model:e.form,"label-width":"100px",rules:e.rules}},[a("el-form-item",{attrs:{label:"试卷类型：",prop:"paperType",required:""}},[a("el-select",{attrs:{placeholder:"试卷类型"},model:{value:e.form.paperType,callback:function(t){e.$set(e.form,"paperType",t)},expression:"form.paperType"}},e._l(e.paperTypeEnum,(function(e){return a("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:4===e.form.paperType,expression:"form.paperType === 4"}],attrs:{label:"时间限制：",required:""}},[a("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd HH:mm:ss",type:"datetimerange","range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:e.form.limitDateTime,callback:function(t){e.$set(e.form,"limitDateTime",t)},expression:"form.limitDateTime"}})],1),a("el-form-item",{attrs:{label:"试卷名称：",prop:"name",required:""}},[a("el-input",{model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),e._l(e.form.titleItems,(function(t,i){return a("el-form-item",{key:i,attrs:{label:"标题"+(i+1)+"：",required:""}},[a("el-input",{staticStyle:{width:"80%"},model:{value:t.name,callback:function(a){e.$set(t,"name",a)},expression:"titleItem.name"}}),a("el-button",{staticClass:"link-left",staticStyle:{"margin-left":"20px"},attrs:{type:"text",size:"mini"},on:{click:function(a){return e.addQuestion(t)}}},[e._v(" 添加题目 ")]),a("el-button",{staticClass:"link-left",attrs:{type:"text",size:"mini"},on:{click:function(t){return e.form.titleItems.splice(i,1)}}},[e._v("删除")]),0!==t.questionItems.length?a("el-card",{staticClass:"exampaper-item-box"},e._l(t.questionItems,(function(i,r){return a("el-form-item",{key:r,staticStyle:{"margin-bottom":"15px"},attrs:{label:"题目"+(r+1)+"："}},[a("el-row",[a("el-col",{attrs:{span:23}},[a("QuestionShow",{attrs:{qType:i.questionType,question:i}})],1),a("el-col",{attrs:{span:1}},[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(e){return t.questionItems.splice(r,1)}}},[e._v("删除 ")])],1)],1)],1)})),1):e._e()],1)})),a("el-form-item",{attrs:{label:"建议时长：",prop:"suggestTime",required:""}},[a("el-input",{attrs:{placeholder:"分钟"},model:{value:e.form.suggestTime,callback:function(t){e.$set(e.form,"suggestTime",t)},expression:"form.suggestTime"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("提交")]),a("el-button",{on:{click:e.resetForm}},[e._v("重置")]),a("el-button",{attrs:{type:"success"},on:{click:e.addTitle}},[e._v("添加标题")])],1)],2),a("el-dialog",{attrs:{visible:e.questionPage.showDialog,width:"70%"},on:{"update:visible":function(t){return e.$set(e.questionPage,"showDialog",t)}}},[a("el-form",{ref:"queryForm",attrs:{model:e.questionPage.queryParam,inline:!0}},[a("el-form-item",{attrs:{label:"ID："}},[a("el-input",{attrs:{clearable:""},model:{value:e.questionPage.queryParam.id,callback:function(t){e.$set(e.questionPage.queryParam,"id",t)},expression:"questionPage.queryParam.id"}})],1),a("el-form-item",{attrs:{label:"题型："}},[a("el-select",{attrs:{clearable:""},model:{value:e.questionPage.queryParam.questionType,callback:function(t){e.$set(e.questionPage.queryParam,"questionType",t)},expression:"questionPage.queryParam.questionType"}},e._l(e.questionTypeEnum,(function(e){return a("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.queryForm}},[e._v("查询")])],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.questionPage.listLoading,expression:"questionPage.listLoading"}],staticStyle:{width:"100%"},attrs:{data:e.questionPage.tableData,border:"",fit:"","highlight-current-row":""},on:{"selection-change":e.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"35"}}),a("el-table-column",{attrs:{prop:"id",label:"Id",width:"60px"}}),a("el-table-column",{attrs:{prop:"questionType",label:"题型",formatter:e.questionTypeFormatter,width:"70px"}}),a("el-table-column",{attrs:{prop:"shortTitle",label:"题干","show-overflow-tooltip":""}})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.questionPage.total>0,expression:"questionPage.total > 0"}],attrs:{total:e.questionPage.total,page:e.questionPage.queryParam.pageIndex,limit:e.questionPage.queryParam.pageSize},on:{"update:page":function(t){return e.$set(e.questionPage.queryParam,"pageIndex",t)},"update:limit":function(t){return e.$set(e.questionPage.queryParam,"pageSize",t)},pagination:e.search}}),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.questionPage.showDialog=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.confirmQuestionSelect}},[e._v("确定")])],1)],1)],1)},ia=[],ra=(a("159b"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticStyle:{"line-height":"1.8"}},[1==e.qType||2==e.qType?a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.qLoading,expression:"qLoading"}]},[a("div",{staticClass:"q-title",domProps:{innerHTML:e._s(e.question.title)}}),a("div",{staticClass:"q-content"},e._l(e.question.items,(function(t){return a("span",{key:t.id,staticClass:"q-item-contain"},[a("span",{staticClass:"q-item-prefix"},[e._v(e._s(t.prefix))]),a("span",{staticClass:"q-item-content",domProps:{innerHTML:e._s(t.content)}})])})),0)]):3==e.qType?a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.qLoading,expression:"qLoading"}]},[a("div",{staticClass:"q-title",staticStyle:{display:"inline","margin-right":"10px"},domProps:{innerHTML:e._s(e.question.title)}}),a("span",[e._v("（")]),e._l(e.question.items,(function(t){return a("span",{key:t.id},[a("span",{staticClass:"q-item-content",domProps:{innerHTML:e._s(t.content)}})])})),a("span",[e._v("）")])],2):4==e.qType||5==e.qType?a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.qLoading,expression:"qLoading"}]},[a("div",{staticClass:"q-title",domProps:{innerHTML:e._s(e.question.title)}})]):a("div")])}),oa=[],na={name:"QuestionShow",props:{question:{type:Object,default:function(){return{}}},qLoading:{type:Boolean,default:!1},qType:{type:Number,default:0}},methods:{}},sa=na,la=Object(f["a"])(sa,ra,oa,!1,null,null,null),ca=la.exports,ua=a("b775"),ma={pageList:function(e){return Object(ua["a"])("/api/admin/question/page",e)},edit:function(e){return Object(ua["a"])("/api/admin/question/edit",e)},select:function(e){return Object(ua["a"])("/api/admin/question/select/"+e)},deleteQuestion:function(e){return Object(ua["a"])("/api/admin/question/delete/"+e)}},da={components:{Pagination:Kt,QuestionShow:ca},data:function(){return{form:{id:null,level:null,subjectId:null,paperType:1,limitDateTime:[],name:"",suggestTime:null,titleItems:[]},subjectFilter:null,formLoading:!1,rules:{paperType:[{required:!0,message:"请选择试卷类型",trigger:"change"}],name:[{required:!0,message:"请输入试卷名称",trigger:"blur"}],suggestTime:[{required:!0,message:"请输入建议时长",trigger:"blur"}]},questionPage:{multipleSelection:[],showDialog:!1,queryParam:{id:null,questionType:null,subjectId:1,pageIndex:1,pageSize:5},listLoading:!0,tableData:[],total:0},currentTitleItem:null}},created:function(){var e=this,t=this.$route.query.id;t&&0!==parseInt(t)&&(this.formLoading=!0,this.axios.get("exam_paper/info",{params:{id:t}}).then((function(t){var a=t.data.data;a.deleted=!!a.deleted,e.form=a})).finally((function(){e.formLoading=!1})))},methods:Object(Bt["a"])({submitForm:function(){var e=this;this.$refs.form.validate((function(t){if(!t)return!1;e.formLoading=!0,e.axios.post("exam_paper/store",e.form).then((function(t){0===t.data.errno?(e.$message({type:"success",message:"保存成功"}),e.$router.go(-1)):e.$message({type:"error",message:"保存失败"})})).finally((function(){e.formLoading=!1}))}))},addTitle:function(){this.form.titleItems.push({name:"",questionItems:[]})},addQuestion:function(e){this.currentTitleItem=e,this.questionPage.showDialog=!0,this.search()},removeTitleItem:function(e){this.form.titleItems.remove(e)},removeQuestion:function(e,t){e.questionItems.remove(t)},queryForm:function(){this.questionPage.queryParam.pageIndex=1,this.search()},confirmQuestionSelect:function(){var e=this;this.questionPage.multipleSelection.forEach((function(t){ma.select(t.id).then((function(t){e.currentTitleItem.questionItems.push(t.response)}))})),this.questionPage.showDialog=!1},levelChange:function(){var e=this;this.form.subjectId=null,this.subjectFilter=this.subjects.filter((function(t){return t.level===e.form.level}))},search:function(){var e=this;this.questionPage.queryParam.subjectId=this.form.subjectId,this.questionPage.listLoading=!0,ma.pageList(this.questionPage.queryParam).then((function(t){var a=t.response;e.questionPage.tableData=a.list,e.questionPage.total=a.total,e.questionPage.queryParam.pageIndex=a.pageNum,e.questionPage.listLoading=!1}))},handleSelectionChange:function(e){this.questionPage.multipleSelection=e},questionTypeFormatter:function(e,t,a,i){return this.enumFormat(this.questionTypeEnum,a)},subjectFormatter:function(e,t,a,i){return this.subjectEnumFormat(a)},resetForm:function(){var e=this.form.id;this.$refs["form"].resetFields(),this.form={id:null,level:null,subjectId:null,paperType:1,limitDateTime:[],name:"",suggestTime:null,titleItems:[]},this.form.id=e}},Object(Ut["b"])("tagsView",{delCurrentView:"delCurrentView"})),computed:Object(Bt["a"])(Object(Bt["a"])(Object(Bt["a"])({},Object(Ut["c"])("enumItem",["enumFormat"])),Object(Ut["d"])("enumItem",{questionTypeEnum:function(e){return e.exam.question.typeEnum},paperTypeEnum:function(e){return e.exam.examPaper.paperTypeEnum},levelEnum:function(e){return e.user.levelEnum}})),Object(Ut["d"])("exam",{subjects:function(e){return e.subjects}}))},fa=da,pa=(a("7560"),Object(f["a"])(fa,aa,ia,!1,null,null,null)),ba=pa.exports,ha=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{ref:"queryForm",attrs:{model:e.queryParam,inline:!0}},[a("el-form-item",{attrs:{label:"题目ID："}},[a("el-input",{attrs:{clearable:""},model:{value:e.queryParam.id,callback:function(t){e.$set(e.queryParam,"id",t)},expression:"queryParam.id"}})],1),a("el-form-item",{attrs:{label:"年级："}},[a("el-select",{attrs:{placeholder:"年级",clearable:""},on:{change:e.levelChange},model:{value:e.queryParam.level,callback:function(t){e.$set(e.queryParam,"level",t)},expression:"queryParam.level"}},e._l(e.levelEnum,(function(e){return a("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"学科："}},[a("el-select",{attrs:{clearable:""},model:{value:e.queryParam.subjectId,callback:function(t){e.$set(e.queryParam,"subjectId",t)},expression:"queryParam.subjectId"}},e._l(e.subjectFilter,(function(e){return a("el-option",{key:e.id,attrs:{value:e.id,label:e.name+" ( "+e.levelName+" )"}})})),1)],1),a("el-form-item",{attrs:{label:"题型："}},[a("el-select",{attrs:{clearable:""},model:{value:e.queryParam.questionType,callback:function(t){e.$set(e.queryParam,"questionType",t)},expression:"queryParam.questionType"}},e._l(e.questionType,(function(e){return a("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("查询")]),a("el-popover",{attrs:{placement:"bottom",trigger:"click"}},[e._l(e.editUrlEnum,(function(t){return a("el-button",{key:t.key,attrs:{type:"warning",size:"mini"},on:{click:function(a){return e.$router.push({path:t.value})}}},[e._v(e._s(t.name)+" ")])})),a("el-button",{staticClass:"link-left",attrs:{slot:"reference",type:"primary"},slot:"reference"},[e._v("添加")])],2)],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:e.tableData,border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{prop:"id",label:"Id",width:"90px"}}),a("el-table-column",{attrs:{prop:"subjectId",label:"学科",formatter:e.subjectFormatter,width:"120px"}}),a("el-table-column",{attrs:{prop:"questionType",label:"题型",formatter:e.questionTypeFormatter,width:"70px"}}),a("el-table-column",{attrs:{prop:"shortTitle",label:"题干","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{prop:"score",label:"分数",width:"60px"}}),a("el-table-column",{attrs:{prop:"difficult",label:"难度",width:"60px"}}),a("el-table-column",{attrs:{prop:"createTime",label:"创建时间",width:"160px"}}),a("el-table-column",{attrs:{label:"操作",align:"center",width:"220px"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[a("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.showQuestion(i)}}},[e._v("预览")]),a("el-button",{attrs:{size:"mini"},on:{click:function(t){return e.editQuestion(i)}}},[e._v("编辑")]),a("el-button",{staticClass:"link-left",attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.deleteQuestion(i)}}},[e._v("删除")])]}}])})],1),a("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.queryParam.pageIndex,limit:e.queryParam.pageSize},on:{"update:page":function(t){return e.$set(e.queryParam,"pageIndex",t)},"update:limit":function(t){return e.$set(e.queryParam,"pageSize",t)},pagination:e.search}}),a("el-dialog",{staticStyle:{width:"100%",height:"100%"},attrs:{visible:e.questionShow.dialog},on:{"update:visible":function(t){return e.$set(e.questionShow,"dialog",t)}}},[a("QuestionShow",{attrs:{qType:e.questionShow.qType,question:e.questionShow.question,qLoading:e.questionShow.loading}})],1)],1)},ga=[],va={components:{Pagination:Kt,QuestionShow:ca},data:function(){return{queryParam:{id:null,questionType:null,level:null,subjectId:null,pageIndex:1,pageSize:10},subjectFilter:null,listLoading:!0,tableData:[],total:0,questionShow:{qType:0,dialog:!1,question:null,loading:!1}}},created:function(){this.initSubject(),this.search()},methods:Object(Bt["a"])({submitForm:function(){this.queryParam.pageIndex=1,this.search()},search:function(){var e=this;this.listLoading=!0,ma.pageList(this.queryParam).then((function(t){var a=t.response;e.tableData=a.list,e.total=a.total,e.queryParam.pageIndex=a.pageNum,e.listLoading=!1}))},levelChange:function(){var e=this;this.queryParam.subjectId=null,this.subjectFilter=this.subjects.filter((function(t){return t.level===e.queryParam.level}))},addQuestion:function(){this.$router.push("/exam/question/edit/singleChoice")},showQuestion:function(e){var t=this;this.questionShow.dialog=!0,this.questionShow.loading=!0,ma.select(e.id).then((function(e){t.questionShow.qType=e.response.questionType,t.questionShow.question=e.response,t.questionShow.loading=!1}))},editQuestion:function(e){var t=this.enumFormat(this.editUrlEnum,e.questionType);this.$router.push({path:t,query:{id:e.id}})},deleteQuestion:function(e){var t=this;ma.deleteQuestion(e.id).then((function(e){1===e.code?(t.search(),t.$message.success(e.message)):t.$message.error(e.message)}))},questionTypeFormatter:function(e,t,a,i){return this.enumFormat(this.questionType,a)},subjectFormatter:function(e,t,a,i){return this.subjectEnumFormat(a)}},Object(Ut["b"])("exam",{initSubject:"initSubject"})),computed:Object(Bt["a"])(Object(Bt["a"])(Object(Bt["a"])(Object(Bt["a"])({},Object(Ut["c"])("enumItem",["enumFormat"])),Object(Ut["d"])("enumItem",{questionType:function(e){return e.exam.question.typeEnum},editUrlEnum:function(e){return e.exam.question.editUrlEnum},levelEnum:function(e){return e.user.levelEnum}})),Object(Ut["c"])("exam",["subjectEnumFormat"])),Object(Ut["d"])("exam",{subjects:function(e){return e.subjects}}))},_a=va,ya=Object(f["a"])(_a,ha,ga,!1,null,null,null),xa=ya.exports,wa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.formLoading,expression:"formLoading"}],ref:"form",attrs:{model:e.form,"label-width":"100px",rules:e.rules}},[a("el-form-item",{attrs:{label:"年级：",prop:"gradeLevel",required:""}},[a("el-select",{attrs:{placeholder:"年级",clearable:""},on:{change:e.levelChange},model:{value:e.form.gradeLevel,callback:function(t){e.$set(e.form,"gradeLevel",t)},expression:"form.gradeLevel"}},e._l(e.levelEnum,(function(e){return a("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"学科：",prop:"subjectId",required:""}},[a("el-select",{attrs:{placeholder:"学科"},model:{value:e.form.subjectId,callback:function(t){e.$set(e.form,"subjectId",t)},expression:"form.subjectId"}},e._l(e.subjectFilter,(function(e){return a("el-option",{key:e.id,attrs:{value:e.id,label:e.name+" ( "+e.levelName+" )"}})})),1)],1),a("el-form-item",{attrs:{label:"题干：",prop:"title",required:""}},[a("el-input",{on:{focus:function(t){return e.inputClick(e.form,"title")}},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title",t)},expression:"form.title"}})],1),a("el-form-item",{attrs:{label:"选项：",required:""}},e._l(e.form.items,(function(t,i){return a("el-form-item",{key:t.prefix,staticClass:"question-item-label",attrs:{label:t.prefix,"label-width":"50px"}},[a("el-input",{staticStyle:{width:"50px"},model:{value:t.prefix,callback:function(a){e.$set(t,"prefix",a)},expression:"item.prefix"}}),a("el-input",{staticClass:"question-item-content-input",on:{focus:function(a){return e.inputClick(t,"content")}},model:{value:t.content,callback:function(a){e.$set(t,"content",a)},expression:"item.content"}}),a("el-button",{staticClass:"question-item-remove",attrs:{type:"danger",size:"mini",icon:"el-icon-delete"},on:{click:function(t){return e.questionItemRemove(i)}}})],1)})),1),a("el-form-item",{attrs:{label:"解析：",prop:"analyze",required:""}},[a("el-input",{on:{focus:function(t){return e.inputClick(e.form,"analyze")}},model:{value:e.form.analyze,callback:function(t){e.$set(e.form,"analyze",t)},expression:"form.analyze"}})],1),a("el-form-item",{attrs:{label:"分数：",prop:"score",required:""}},[a("el-input-number",{attrs:{precision:1,step:1,max:100},model:{value:e.form.score,callback:function(t){e.$set(e.form,"score",t)},expression:"form.score"}})],1),a("el-form-item",{attrs:{label:"难度：",required:""}},[a("el-rate",{staticClass:"question-item-rate",model:{value:e.form.difficult,callback:function(t){e.$set(e.form,"difficult",t)},expression:"form.difficult"}})],1),a("el-form-item",{attrs:{label:"正确答案：",prop:"correct",required:""}},[a("el-radio-group",{model:{value:e.form.correct,callback:function(t){e.$set(e.form,"correct",t)},expression:"form.correct"}},e._l(e.form.items,(function(t){return a("el-radio",{key:t.prefix,attrs:{label:t.prefix}},[e._v(e._s(t.prefix))])})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("提交")]),a("el-button",{on:{click:e.resetForm}},[e._v("重置")]),a("el-button",{attrs:{type:"success"},on:{click:e.questionItemAdd}},[e._v("添加选项")]),a("el-button",{attrs:{type:"success"},on:{click:e.showQuestion}},[e._v("预览")])],1)],1),a("el-dialog",{staticStyle:{width:"100%",height:"100%"},attrs:{visible:e.richEditor.dialogVisible,"append-to-body":"","close-on-click-modal":!1,"show-close":!1,center:""},on:{"update:visible":function(t){return e.$set(e.richEditor,"dialogVisible",t)}}},[a("Ueditor",{on:{ready:e.editorReady}}),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.editorConfirm}},[e._v("确 定")]),a("el-button",{on:{click:function(t){e.richEditor.dialogVisible=!1}}},[e._v("取 消")])],1)],1),a("el-dialog",{staticStyle:{width:"100%",height:"100%"},attrs:{visible:e.questionShow.dialog},on:{"update:visible":function(t){return e.$set(e.questionShow,"dialog",t)}}},[a("QuestionShow",{attrs:{qType:e.questionShow.qType,question:e.questionShow.question,qLoading:e.questionShow.loading}})],1)],1)},qa=[],Fa=(a("a434"),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("script",{staticStyle:{height:"300px"},attrs:{id:e.randomId,type:"text/plain"}})])}),ka=[],Ca={name:"UE",props:{value:{default:function(){return""}}},data:function(){return{randomId:"editor_"+1e17*Math.random(),instance:null,ready:!1}},watch:{value:function(e,t){null!=e&&this.ready&&(this.instance=UE.getEditor(this.randomId),this.instance.setContent(e))}},mounted:function(){this.initEditor()},beforeDestroy:function(){null!==this.instance&&this.instance.destroy&&this.instance.destroy()},methods:{initEditor:function(){var e=this;this.$nextTick((function(){e.instance=UE.getEditor(e.randomId),e.instance.addListener("ready",(function(){e.ready=!0,e.$emit("ready",e.instance)}))}))},getUEContent:function(){return this.instance.getContent()},setText:function(e){this.instance=UE.getEditor(this.randomId),this.instance.setContent(e)}}},$a=Ca,ja=Object(f["a"])($a,Fa,ka,!1,null,null,null),Sa=ja.exports,Ea={components:{Ueditor:Sa,QuestionShow:ca},data:function(){return{form:{id:null,questionType:1,gradeLevel:null,subjectId:null,title:"",items:[{prefix:"A",content:""},{prefix:"B",content:""},{prefix:"C",content:""},{prefix:"D",content:""}],analyze:"",correct:"",score:"",difficult:0},subjectFilter:null,formLoading:!1,rules:{gradeLevel:[{required:!0,message:"请选择年级",trigger:"change"}],subjectId:[{required:!0,message:"请选择学科",trigger:"change"}],title:[{required:!0,message:"请输入题干",trigger:"blur"}],analyze:[{required:!0,message:"请输入解析",trigger:"blur"}],score:[{required:!0,message:"请输入分数",trigger:"blur"}],correct:[{required:!0,message:"请选择正确答案",trigger:"change"}]},richEditor:{dialogVisible:!1,object:null,parameterName:"",instance:null},questionShow:{qType:0,dialog:!1,question:null,loading:!1}}},created:function(){var e=this.$route.query.id,t=this;this.initSubject((function(){t.subjectFilter=t.subjects})),e&&0!==parseInt(e)&&(t.formLoading=!0,ma.select(e).then((function(e){t.form=e.response,t.formLoading=!1})))},methods:Object(Bt["a"])(Object(Bt["a"])({editorReady:function(e){this.richEditor.instance=e;var t=this.richEditor.object[this.richEditor.parameterName];this.richEditor.instance.setContent(t),this.richEditor.instance.focus(!0)},inputClick:function(e,t){this.richEditor.object=e,this.richEditor.parameterName=t,this.richEditor.dialogVisible=!0},editorConfirm:function(){var e=this.richEditor.instance.getContent();this.richEditor.object[this.richEditor.parameterName]=e,this.richEditor.dialogVisible=!1},questionItemRemove:function(e){this.form.items.splice(e,1)},questionItemAdd:function(){var e,t=this.form.items;if(t.length>0){var a=t[t.length-1];e=String.fromCharCode(a.prefix.charCodeAt()+1)}else e="A";t.push({id:null,prefix:e,content:""})},submitForm:function(){var e=this,t=this;this.$refs.form.validate((function(a){if(!a)return!1;e.formLoading=!0,ma.edit(e.form).then((function(a){1===a.code?(t.$message.success(a.message),t.delCurrentView(t).then((function(){t.$router.push("/exam/question/list")}))):(t.$message.error(a.message),e.formLoading=!1)})).catch((function(){e.formLoading=!1}))}))},resetForm:function(){var e=this.form.id;this.$refs["form"].resetFields(),this.form={id:null,questionType:1,gradeLevel:null,subjectId:null,title:"",items:[{prefix:"A",content:""},{prefix:"B",content:""},{prefix:"C",content:""},{prefix:"D",content:""}],analyze:"",correct:"",score:"",difficult:0},this.form.id=e},levelChange:function(){var e=this;this.form.subjectId=null,this.subjectFilter=this.subjects.filter((function(t){return t.level===e.form.gradeLevel}))},showQuestion:function(){this.questionShow.dialog=!0,this.questionShow.qType=this.form.questionType,this.questionShow.question=this.form}},Object(Ut["b"])("exam",{initSubject:"initSubject"})),Object(Ut["b"])("tagsView",{delCurrentView:"delCurrentView"})),computed:Object(Bt["a"])(Object(Bt["a"])(Object(Bt["a"])({},Object(Ut["c"])("enumItem",["enumFormat"])),Object(Ut["d"])("enumItem",{questionTypeEnum:function(e){return e.exam.question.typeEnum},levelEnum:function(e){return e.user.levelEnum}})),Object(Ut["d"])("exam",{subjects:function(e){return e.subjects}}))},Ia=Ea,Pa=Object(f["a"])(Ia,wa,qa,!1,null,null,null),La=Pa.exports,Oa=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.formLoading,expression:"formLoading"}],ref:"form",attrs:{model:e.form,"label-width":"100px",rules:e.rules}},[a("el-form-item",{attrs:{label:"年级：",prop:"gradeLevel",required:""}},[a("el-select",{attrs:{placeholder:"年级"},on:{change:e.levelChange},model:{value:e.form.gradeLevel,callback:function(t){e.$set(e.form,"gradeLevel",t)},expression:"form.gradeLevel"}},e._l(e.levelEnum,(function(e){return a("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"学科：",prop:"subjectId",required:""}},[a("el-select",{attrs:{placeholder:"学科"},model:{value:e.form.subjectId,callback:function(t){e.$set(e.form,"subjectId",t)},expression:"form.subjectId"}},e._l(e.subjectFilter,(function(e){return a("el-option",{key:e.id,attrs:{value:e.id,label:e.name+" ( "+e.levelName+" )"}})})),1)],1),a("el-form-item",{attrs:{label:"题干：",prop:"title",required:""}},[a("el-input",{on:{focus:function(t){return e.inputClick(e.form,"title")}},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title",t)},expression:"form.title"}})],1),a("el-form-item",{attrs:{label:"选项：",required:""}},e._l(e.form.items,(function(t,i){return a("el-form-item",{key:t.prefix,staticClass:"question-item-label",attrs:{label:t.prefix,"label-width":"50px"}},[a("el-input",{staticStyle:{width:"50px"},model:{value:t.prefix,callback:function(a){e.$set(t,"prefix",a)},expression:"item.prefix"}}),a("el-input",{staticClass:"question-item-content-input",on:{focus:function(a){return e.inputClick(t,"content")}},model:{value:t.content,callback:function(a){e.$set(t,"content",a)},expression:"item.content"}}),a("el-button",{staticClass:"question-item-remove",attrs:{type:"danger",size:"mini",icon:"el-icon-delete"},on:{click:function(t){return e.questionItemRemove(i)}}})],1)})),1),a("el-form-item",{attrs:{label:"解析：",prop:"analyze",required:""}},[a("el-input",{on:{focus:function(t){return e.inputClick(e.form,"analyze")}},model:{value:e.form.analyze,callback:function(t){e.$set(e.form,"analyze",t)},expression:"form.analyze"}})],1),a("el-form-item",{attrs:{label:"分数：",prop:"score",required:""}},[a("el-input-number",{attrs:{precision:1,step:1,max:100},model:{value:e.form.score,callback:function(t){e.$set(e.form,"score",t)},expression:"form.score"}})],1),a("el-form-item",{attrs:{label:"难度：",required:""}},[a("el-rate",{staticClass:"question-item-rate",model:{value:e.form.difficult,callback:function(t){e.$set(e.form,"difficult",t)},expression:"form.difficult"}})],1),a("el-form-item",{attrs:{label:"正确答案：",prop:"correctArray",required:""}},[a("el-checkbox-group",{model:{value:e.form.correctArray,callback:function(t){e.$set(e.form,"correctArray",t)},expression:"form.correctArray"}},e._l(e.form.items,(function(t){return a("el-checkbox",{key:t.prefix,attrs:{label:t.prefix}},[e._v(e._s(t.prefix))])})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("提交")]),a("el-button",{on:{click:e.resetForm}},[e._v("重置")]),a("el-button",{attrs:{type:"success"},on:{click:e.questionItemAdd}},[e._v("添加选项")]),a("el-button",{attrs:{type:"success"},on:{click:e.showQuestion}},[e._v("预览")])],1)],1),a("el-dialog",{staticStyle:{width:"100%",height:"100%"},attrs:{visible:e.richEditor.dialogVisible,"append-to-body":"","close-on-click-modal":!1,"show-close":!1,center:""},on:{"update:visible":function(t){return e.$set(e.richEditor,"dialogVisible",t)}}},[a("Ueditor",{on:{ready:e.editorReady}}),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.editorConfirm}},[e._v("确 定")]),a("el-button",{on:{click:function(t){e.richEditor.dialogVisible=!1}}},[e._v("取 消")])],1)],1),a("el-dialog",{staticStyle:{width:"100%",height:"100%"},attrs:{visible:e.questionShow.dialog},on:{"update:visible":function(t){return e.$set(e.questionShow,"dialog",t)}}},[a("QuestionShow",{attrs:{qType:e.questionShow.qType,question:e.questionShow.question,qLoading:e.questionShow.loading}})],1)],1)},Ta=[],za={components:{Ueditor:Sa,QuestionShow:ca},data:function(){return{form:{id:null,questionType:2,gradeLevel:null,subjectId:null,title:"",items:[{id:null,prefix:"A",content:""},{id:null,prefix:"B",content:""},{id:null,prefix:"C",content:""},{id:null,prefix:"D",content:""}],analyze:"",correct:"",correctArray:[],score:"",difficult:0},subjectFilter:null,formLoading:!1,rules:{gradeLevel:[{required:!0,message:"请选择年级",trigger:"change"}],subjectId:[{required:!0,message:"请选择学科",trigger:"change"}],title:[{required:!0,message:"请输入题干",trigger:"blur"}],analyze:[{required:!0,message:"请输入解析",trigger:"blur"}],score:[{required:!0,message:"请输入分数",trigger:"blur"}],correctArray:[{required:!0,message:"请选择正确答案",trigger:"change"}]},richEditor:{dialogVisible:!1,object:null,parameterName:"",instance:null},questionShow:{qType:0,dialog:!1,question:null,loading:!1}}},created:function(){var e=this.$route.query.id,t=this;this.initSubject((function(){t.subjectFilter=t.subjects})),e&&0!==parseInt(e)&&(t.formLoading=!0,ma.select(e).then((function(e){t.form=e.response,t.formLoading=!1})))},methods:Object(Bt["a"])(Object(Bt["a"])({editorReady:function(e){this.richEditor.instance=e;var t=this.richEditor.object[this.richEditor.parameterName];this.richEditor.instance.setContent(t),this.richEditor.instance.focus(!0)},inputClick:function(e,t){this.richEditor.object=e,this.richEditor.parameterName=t,this.richEditor.dialogVisible=!0},editorConfirm:function(){var e=this.richEditor.instance.getContent();this.richEditor.object[this.richEditor.parameterName]=e,this.richEditor.dialogVisible=!1},questionItemRemove:function(e){this.form.items.splice(e,1)},questionItemAdd:function(){var e,t=this.form.items;if(t.length>0){var a=t[t.length-1];e=String.fromCharCode(a.prefix.charCodeAt()+1)}else e="A";t.push({id:null,prefix:e,content:""})},submitForm:function(){var e=this,t=this;this.$refs.form.validate((function(a){if(!a)return!1;e.formLoading=!0,ma.edit(e.form).then((function(a){1===a.code?(t.$message.success(a.message),t.delCurrentView(t).then((function(){t.$router.push("/exam/question/list")}))):(t.$message.error(a.message),e.formLoading=!1)})).catch((function(){e.formLoading=!1}))}))},levelChange:function(){var e=this;this.form.subjectId=null,this.subjectFilter=this.subjects.filter((function(t){return t.level===e.form.gradeLevel}))},showQuestion:function(){this.questionShow.dialog=!0,this.questionShow.qType=this.form.questionType,this.questionShow.question=this.form},resetForm:function(){var e=this.form.id;this.$refs["form"].resetFields(),this.form={id:null,questionType:2,gradeLevel:null,subjectId:null,title:"",items:[{id:null,prefix:"A",content:""},{id:null,prefix:"B",content:""},{id:null,prefix:"C",content:""},{id:null,prefix:"D",content:""}],analyze:"",correct:"",correctArray:[],score:"",difficult:0},this.form.id=e}},Object(Ut["b"])("exam",{initSubject:"initSubject"})),Object(Ut["b"])("tagsView",{delCurrentView:"delCurrentView"})),computed:Object(Bt["a"])(Object(Bt["a"])(Object(Bt["a"])({},Object(Ut["c"])("enumItem",["enumFormat"])),Object(Ut["d"])("enumItem",{questionTypeEnum:function(e){return e.exam.question.typeEnum},levelEnum:function(e){return e.user.levelEnum}})),Object(Ut["d"])("exam",{subjects:function(e){return e.subjects}}))},Da=za,Na=Object(f["a"])(Da,Oa,Ta,!1,null,null,null),Ra=Na.exports,Ba=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.formLoading,expression:"formLoading"}],ref:"form",attrs:{model:e.form,"label-width":"100px",rules:e.rules}},[a("el-form-item",{attrs:{label:"年级：",prop:"gradeLevel",required:""}},[a("el-select",{attrs:{placeholder:"年级"},on:{change:e.levelChange},model:{value:e.form.gradeLevel,callback:function(t){e.$set(e.form,"gradeLevel",t)},expression:"form.gradeLevel"}},e._l(e.levelEnum,(function(e){return a("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"学科：",prop:"subjectId",required:""}},[a("el-select",{attrs:{placeholder:"学科"},model:{value:e.form.subjectId,callback:function(t){e.$set(e.form,"subjectId",t)},expression:"form.subjectId"}},e._l(e.subjectFilter,(function(e){return a("el-option",{key:e.id,attrs:{value:e.id,label:e.name+" ( "+e.levelName+" )"}})})),1)],1),a("el-form-item",{attrs:{label:"题干：",prop:"title",required:""}},[a("el-input",{on:{focus:function(t){return e.inputClick(e.form,"title")}},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title",t)},expression:"form.title"}})],1),a("el-form-item",{attrs:{label:"选项：",required:""}},e._l(e.form.items,(function(t){return a("el-form-item",{key:t.prefix,staticClass:"question-item-label",attrs:{label:t.prefix,"label-width":"50px"}},[a("el-input",{staticStyle:{width:"50px"},model:{value:t.prefix,callback:function(a){e.$set(t,"prefix",a)},expression:"item.prefix"}}),a("el-input",{staticClass:"question-item-content-input",on:{focus:function(a){return e.inputClick(t,"content")}},model:{value:t.content,callback:function(a){e.$set(t,"content",a)},expression:"item.content"}})],1)})),1),a("el-form-item",{attrs:{label:"解析：",prop:"analyze",required:""}},[a("el-input",{on:{focus:function(t){return e.inputClick(e.form,"analyze")}},model:{value:e.form.analyze,callback:function(t){e.$set(e.form,"analyze",t)},expression:"form.analyze"}})],1),a("el-form-item",{attrs:{label:"分数：",prop:"score",required:""}},[a("el-input-number",{attrs:{precision:1,step:1,max:100},model:{value:e.form.score,callback:function(t){e.$set(e.form,"score",t)},expression:"form.score"}})],1),a("el-form-item",{attrs:{label:"难度：",required:""}},[a("el-rate",{staticClass:"question-item-rate",model:{value:e.form.difficult,callback:function(t){e.$set(e.form,"difficult",t)},expression:"form.difficult"}})],1),a("el-form-item",{attrs:{label:"正确答案：",prop:"correct",required:""}},[a("el-radio-group",{model:{value:e.form.correct,callback:function(t){e.$set(e.form,"correct",t)},expression:"form.correct"}},e._l(e.form.items,(function(t){return a("el-radio",{key:t.prefix,attrs:{label:t.prefix}},[e._v(e._s(t.prefix))])})),1)],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("提交")]),a("el-button",{on:{click:e.resetForm}},[e._v("重置")]),a("el-button",{attrs:{type:"success"},on:{click:e.showQuestion}},[e._v("预览")])],1)],1),a("el-dialog",{staticStyle:{width:"100%",height:"100%"},attrs:{visible:e.richEditor.dialogVisible,"append-to-body":"","close-on-click-modal":!1,"show-close":!1,center:""},on:{"update:visible":function(t){return e.$set(e.richEditor,"dialogVisible",t)}}},[a("Ueditor",{on:{ready:e.editorReady}}),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.editorConfirm}},[e._v("确 定")]),a("el-button",{on:{click:function(t){e.richEditor.dialogVisible=!1}}},[e._v("取 消")])],1)],1),a("el-dialog",{staticStyle:{width:"100%",height:"100%"},attrs:{visible:e.questionShow.dialog},on:{"update:visible":function(t){return e.$set(e.questionShow,"dialog",t)}}},[a("QuestionShow",{attrs:{qType:e.questionShow.qType,question:e.questionShow.question,qLoading:e.questionShow.loading}})],1)],1)},Ua=[],Va={components:{Ueditor:Sa,QuestionShow:ca},data:function(){return{form:{id:null,questionType:3,gradeLevel:null,subjectId:null,title:"",items:[{id:null,prefix:"A",content:"是"},{id:null,prefix:"B",content:"否"}],analyze:"",correct:"",score:"",difficult:0},subjectFilter:null,formLoading:!1,rules:{gradeLevel:[{required:!0,message:"请选择年级",trigger:"change"}],subjectId:[{required:!0,message:"请选择学科",trigger:"change"}],title:[{required:!0,message:"请输入题干",trigger:"blur"}],analyze:[{required:!0,message:"请输入解析",trigger:"blur"}],score:[{required:!0,message:"请输入分数",trigger:"blur"}],correct:[{required:!0,message:"请选择正确答案",trigger:"change"}]},richEditor:{dialogVisible:!1,object:null,parameterName:"",instance:null},questionShow:{qType:0,dialog:!1,question:null,loading:!1}}},created:function(){var e=this.$route.query.id,t=this;this.initSubject((function(){t.subjectFilter=t.subjects})),e&&0!==parseInt(e)&&(t.formLoading=!0,ma.select(e).then((function(e){t.form=e.response,t.formLoading=!1})))},methods:Object(Bt["a"])(Object(Bt["a"])({editorReady:function(e){this.richEditor.instance=e;var t=this.richEditor.object[this.richEditor.parameterName];this.richEditor.instance.setContent(t),this.richEditor.instance.focus(!0)},inputClick:function(e,t){this.richEditor.object=e,this.richEditor.parameterName=t,this.richEditor.dialogVisible=!0},editorConfirm:function(){var e=this.richEditor.instance.getContent();this.richEditor.object[this.richEditor.parameterName]=e,this.richEditor.dialogVisible=!1},submitForm:function(){var e=this,t=this;this.$refs.form.validate((function(a){if(!a)return!1;e.formLoading=!0,ma.edit(e.form).then((function(a){1===a.code?(t.$message.success(a.message),t.delCurrentView(t).then((function(){t.$router.push("/exam/question/list")}))):(t.$message.error(a.message),e.formLoading=!1)})).catch((function(){e.formLoading=!1}))}))},resetForm:function(){var e=this.form.id;this.$refs["form"].resetFields(),this.form={id:null,questionType:3,gradeLevel:null,subjectId:null,title:"",items:[{id:null,prefix:"A",content:"是"},{id:null,prefix:"B",content:"否"}],analyze:"",correct:"",score:"",difficult:0},this.form.id=e},levelChange:function(){var e=this;this.form.subjectId=null,this.subjectFilter=this.subjects.filter((function(t){return t.level===e.form.gradeLevel}))},showQuestion:function(){this.questionShow.dialog=!0,this.questionShow.qType=this.form.questionType,this.questionShow.question=this.form}},Object(Ut["b"])("exam",{initSubject:"initSubject"})),Object(Ut["b"])("tagsView",{delCurrentView:"delCurrentView"})),computed:Object(Bt["a"])(Object(Bt["a"])(Object(Bt["a"])({},Object(Ut["c"])("enumItem",["enumFormat"])),Object(Ut["d"])("enumItem",{questionTypeEnum:function(e){return e.exam.question.typeEnum},levelEnum:function(e){return e.user.levelEnum}})),Object(Ut["d"])("exam",{subjects:function(e){return e.subjects}}))},Qa=Va,Aa=Object(f["a"])(Qa,Ba,Ua,!1,null,null,null),Ha=Aa.exports,Ma=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.formLoading,expression:"formLoading"}],ref:"form",attrs:{model:e.form,"label-width":"100px",rules:e.rules}},[a("el-form-item",{attrs:{label:"年级：",prop:"gradeLevel",required:""}},[a("el-select",{attrs:{placeholder:"年级"},on:{change:e.levelChange},model:{value:e.form.gradeLevel,callback:function(t){e.$set(e.form,"gradeLevel",t)},expression:"form.gradeLevel"}},e._l(e.levelEnum,(function(e){return a("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"学科：",prop:"subjectId",required:""}},[a("el-select",{attrs:{placeholder:"学科"},model:{value:e.form.subjectId,callback:function(t){e.$set(e.form,"subjectId",t)},expression:"form.subjectId"}},e._l(e.subjectFilter,(function(e){return a("el-option",{key:e.id,attrs:{value:e.id,label:e.name+" ( "+e.levelName+" )"}})})),1)],1),a("el-form-item",{attrs:{label:"题干：",prop:"title",required:""}},[a("el-input",{on:{focus:function(t){return e.inputClick(e.form,"title")}},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title",t)},expression:"form.title"}})],1),a("el-form-item",{attrs:{label:"填空答案：",required:""}},e._l(e.form.items,(function(t){return a("el-form-item",{key:t.prefix,staticClass:"question-item-label",attrs:{label:t.prefix,"label-width":"50px"}},[a("el-input",{staticClass:"question-item-content-input",staticStyle:{width:"80%"},on:{focus:function(a){return e.inputClick(t,"content")}},model:{value:t.content,callback:function(a){e.$set(t,"content",a)},expression:"item.content"}}),a("span",{staticClass:"question-item-span"},[e._v("分数：")]),a("el-input-number",{attrs:{precision:1,step:1,max:100},model:{value:t.score,callback:function(a){e.$set(t,"score",a)},expression:"item.score"}})],1)})),1),a("el-form-item",{attrs:{label:"解析：",prop:"analyze",required:""}},[a("el-input",{on:{focus:function(t){return e.inputClick(e.form,"analyze")}},model:{value:e.form.analyze,callback:function(t){e.$set(e.form,"analyze",t)},expression:"form.analyze"}})],1),a("el-form-item",{attrs:{label:"分数：",prop:"score",required:""}},[a("el-input-number",{attrs:{precision:1,step:1,max:100},model:{value:e.form.score,callback:function(t){e.$set(e.form,"score",t)},expression:"form.score"}})],1),a("el-form-item",{attrs:{label:"难度：",required:""}},[a("el-rate",{staticClass:"question-item-rate",model:{value:e.form.difficult,callback:function(t){e.$set(e.form,"difficult",t)},expression:"form.difficult"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("提交")]),a("el-button",{on:{click:e.resetForm}},[e._v("重置")]),a("el-button",{attrs:{type:"success"},on:{click:e.showQuestion}},[e._v("预览")])],1)],1),a("el-dialog",{staticStyle:{width:"100%",height:"100%"},attrs:{visible:e.richEditor.dialogVisible,"append-to-body":"","close-on-click-modal":!1,"show-close":!1,center:""},on:{"update:visible":function(t){return e.$set(e.richEditor,"dialogVisible",t)}}},[a("Ueditor",{on:{ready:e.editorReady}}),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.editorConfirm}},[e._v("确 定")]),a("el-button",{on:{click:function(t){e.richEditor.dialogVisible=!1}}},[e._v("取 消")])],1)],1),a("el-dialog",{staticStyle:{width:"100%",height:"100%"},attrs:{visible:e.questionShow.dialog},on:{"update:visible":function(t){return e.$set(e.questionShow,"dialog",t)}}},[a("QuestionShow",{attrs:{qType:e.questionShow.qType,question:e.questionShow.question,qLoading:e.questionShow.loading}})],1)],1)},Ja=[],Xa=(a("4d63"),a("c607"),a("2c3e"),a("25f0"),a("466d"),a("00b4"),{components:{Ueditor:Sa,QuestionShow:ca},data:function(){return{form:{id:null,questionType:4,gradeLevel:null,subjectId:null,title:"",items:[],analyze:"",correct:"",score:"",difficult:0},subjectFilter:null,formLoading:!1,rules:{gradeLevel:[{required:!0,message:"请选择年级",trigger:"change"}],subjectId:[{required:!0,message:"请选择学科",trigger:"change"}],title:[{required:!0,message:"请输入题干",trigger:"blur"}],analyze:[{required:!0,message:"请输入解析",trigger:"blur"}],score:[{required:!0,message:"请输入分数",trigger:"blur"}]},richEditor:{dialogVisible:!1,object:null,parameterName:"",instance:null},questionShow:{qType:0,dialog:!1,question:null,loading:!1}}},created:function(){var e=this.$route.query.id,t=this;this.initSubject((function(){t.subjectFilter=t.subjects})),e&&0!==parseInt(e)&&(t.formLoading=!0,ma.select(e).then((function(e){t.form=e.response,t.formLoading=!1})))},methods:Object(Bt["a"])(Object(Bt["a"])({editorReady:function(e){this.richEditor.instance=e;var t=this.richEditor.object[this.richEditor.parameterName];this.richEditor.instance.setContent(t),this.richEditor.instance.focus(!0)},inputClick:function(e,t){this.richEditor.object=e,this.richEditor.parameterName=t,this.richEditor.dialogVisible=!0},editorConfirm:function(){var e=this.richEditor.instance.getContent();"title"===this.richEditor.parameterName?this.questionItemReset(e)&&(this.richEditor.object[this.richEditor.parameterName]=e,this.richEditor.dialogVisible=!1):(this.richEditor.object[this.richEditor.parameterName]=e,this.richEditor.dialogVisible=!1)},questionItemReset:function(e){var t=new RegExp('<span class="gapfilling-span (.*?)">(.*?)<\\/span>',"g"),a=this,i=[],r=e.match(t);return null===r?(this.$message.error("请插入填空"),!1):(r.forEach((function(e){var t=/<span class="gapfilling-span (.*?)">(.*?)<\/span>/;t.test(e),i.push({id:null,prefix:RegExp.$2,content:"",score:"0"})})),i.forEach((function(e){a.form.items.some((function(t){if(t.itemUuid===e.itemUuid)return e.content=t.content,e.id=t.id,e.score=t.score,!0}))})),a.form.items=i,!0)},submitForm:function(){var e=this,t=this;this.$refs.form.validate((function(a){if(!a)return!1;e.formLoading=!0,ma.edit(e.form).then((function(a){1===a.code?(t.$message.success(a.message),t.delCurrentView(t).then((function(){t.$router.push("/exam/question/list")}))):(t.$message.error(a.message),e.formLoading=!1)})).catch((function(){e.formLoading=!1}))}))},levelChange:function(){var e=this;this.form.subjectId=null,this.subjectFilter=this.subjects.filter((function(t){return t.level===e.form.gradeLevel}))},showQuestion:function(){this.questionShow.dialog=!0,this.questionShow.qType=this.form.questionType,this.questionShow.question=this.form},resetForm:function(){var e=this.form.id;this.$refs["form"].resetFields(),this.form={id:null,questionType:4,gradeLevel:null,subjectId:null,title:"",items:[],analyze:"",correct:"",score:"",difficult:0},this.form.id=e}},Object(Ut["b"])("exam",{initSubject:"initSubject"})),Object(Ut["b"])("tagsView",{delCurrentView:"delCurrentView"})),computed:Object(Bt["a"])(Object(Bt["a"])(Object(Bt["a"])({},Object(Ut["c"])("enumItem",["enumFormat"])),Object(Ut["d"])("enumItem",{questionTypeEnum:function(e){return e.exam.question.typeEnum},levelEnum:function(e){return e.user.levelEnum}})),Object(Ut["d"])("exam",{subjects:function(e){return e.subjects}}))}),Ga=Xa,Wa=Object(f["a"])(Ga,Ma,Ja,!1,null,null,null),Ka=Wa.exports,Ya=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{directives:[{name:"loading",rawName:"v-loading",value:e.formLoading,expression:"formLoading"}],ref:"form",attrs:{model:e.form,"label-width":"100px",rules:e.rules}},[a("el-form-item",{attrs:{label:"年级：",prop:"gradeLevel",required:""}},[a("el-select",{attrs:{placeholder:"年级"},on:{change:e.levelChange},model:{value:e.form.gradeLevel,callback:function(t){e.$set(e.form,"gradeLevel",t)},expression:"form.gradeLevel"}},e._l(e.levelEnum,(function(e){return a("el-option",{key:e.key,attrs:{value:e.key,label:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"学科：",prop:"subjectId",required:""}},[a("el-select",{attrs:{placeholder:"学科"},model:{value:e.form.subjectId,callback:function(t){e.$set(e.form,"subjectId",t)},expression:"form.subjectId"}},e._l(e.subjectFilter,(function(e){return a("el-option",{key:e.id,attrs:{value:e.id,label:e.name+" ( "+e.levelName+" )"}})})),1)],1),a("el-form-item",{attrs:{label:"题干：",prop:"title",required:""}},[a("el-input",{on:{focus:function(t){return e.inputClick(e.form,"title")}},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title",t)},expression:"form.title"}})],1),a("el-form-item",{attrs:{label:"答案：",prop:"correct",required:""}},[a("el-input",{on:{focus:function(t){return e.inputClick(e.form,"correct")}},model:{value:e.form.correct,callback:function(t){e.$set(e.form,"correct",t)},expression:"form.correct"}})],1),a("el-form-item",{attrs:{label:"解析：",prop:"analyze",required:""}},[a("el-input",{on:{focus:function(t){return e.inputClick(e.form,"analyze")}},model:{value:e.form.analyze,callback:function(t){e.$set(e.form,"analyze",t)},expression:"form.analyze"}})],1),a("el-form-item",{attrs:{label:"分数：",prop:"score",required:""}},[a("el-input-number",{attrs:{precision:1,step:1,max:100},model:{value:e.form.score,callback:function(t){e.$set(e.form,"score",t)},expression:"form.score"}})],1),a("el-form-item",{attrs:{label:"难度：",required:""}},[a("el-rate",{staticClass:"question-item-rate",model:{value:e.form.difficult,callback:function(t){e.$set(e.form,"difficult",t)},expression:"form.difficult"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("提交")]),a("el-button",{on:{click:e.resetForm}},[e._v("重置")]),a("el-button",{attrs:{type:"success"},on:{click:e.showQuestion}},[e._v("预览")])],1)],1),a("el-dialog",{staticStyle:{width:"100%",height:"100%"},attrs:{visible:e.richEditor.dialogVisible,"append-to-body":"","close-on-click-modal":!1,"show-close":!1,center:""},on:{"update:visible":function(t){return e.$set(e.richEditor,"dialogVisible",t)}}},[a("Ueditor",{on:{ready:e.editorReady}}),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:e.editorConfirm}},[e._v("确 定")]),a("el-button",{on:{click:function(t){e.richEditor.dialogVisible=!1}}},[e._v("取 消")])],1)],1),a("el-dialog",{staticStyle:{width:"100%",height:"100%"},attrs:{visible:e.questionShow.dialog},on:{"update:visible":function(t){return e.$set(e.questionShow,"dialog",t)}}},[a("QuestionShow",{attrs:{qType:e.questionShow.qType,question:e.questionShow.question,qLoading:e.questionShow.loading}})],1)],1)},Za=[],ei={components:{Ueditor:Sa,QuestionShow:ca},data:function(){return{form:{id:null,questionType:5,gradeLevel:null,subjectId:null,title:"",items:[],analyze:"",correct:"",score:"",difficult:0},subjectFilter:null,formLoading:!1,rules:{gradeLevel:[{required:!0,message:"请选择年级",trigger:"change"}],subjectId:[{required:!0,message:"请选择学科",trigger:"change"}],title:[{required:!0,message:"请输入题干",trigger:"blur"}],correct:[{required:!0,message:"请输入答案",trigger:"blur"}],analyze:[{required:!0,message:"请输入解析",trigger:"blur"}],score:[{required:!0,message:"请输入分数",trigger:"blur"}]},richEditor:{dialogVisible:!1,object:null,parameterName:"",instance:null},questionShow:{qType:0,dialog:!1,question:null,loading:!1}}},created:function(){var e=this.$route.query.id,t=this;this.initSubject((function(){t.subjectFilter=t.subjects})),e&&0!==parseInt(e)&&(t.formLoading=!0,ma.select(e).then((function(e){t.form=e.response,t.formLoading=!1})))},methods:Object(Bt["a"])(Object(Bt["a"])({editorReady:function(e){this.richEditor.instance=e;var t=this.richEditor.object[this.richEditor.parameterName];this.richEditor.instance.setContent(t),this.richEditor.instance.focus(!0)},inputClick:function(e,t){this.richEditor.object=e,this.richEditor.parameterName=t,this.richEditor.dialogVisible=!0},editorConfirm:function(){var e=this.richEditor.instance.getContent();this.richEditor.object[this.richEditor.parameterName]=e,this.richEditor.dialogVisible=!1},submitForm:function(){var e=this,t=this;this.$refs.form.validate((function(a){if(!a)return!1;e.formLoading=!0,ma.edit(e.form).then((function(a){1===a.code?(t.$message.success(a.message),t.delCurrentView(t).then((function(){t.$router.push("/exam/question/list")}))):(t.$message.error(a.message),e.formLoading=!1)})).catch((function(){e.formLoading=!1}))}))},resetForm:function(){var e=this.form.id;this.$refs["form"].resetFields(),this.form={id:null,questionType:5,gradeLevel:null,subjectId:null,title:"",items:[],analyze:"",correct:"",score:"",difficult:0},this.form.id=e},levelChange:function(){var e=this;this.form.subjectId=null,this.subjectFilter=this.subjects.filter((function(t){return t.level===e.form.gradeLevel}))},showQuestion:function(){this.questionShow.dialog=!0,this.questionShow.qType=this.form.questionType,this.questionShow.question=this.form}},Object(Ut["b"])("exam",{initSubject:"initSubject"})),Object(Ut["b"])("tagsView",{delCurrentView:"delCurrentView"})),computed:Object(Bt["a"])(Object(Bt["a"])(Object(Bt["a"])({},Object(Ut["c"])("enumItem",["enumFormat"])),Object(Ut["d"])("enumItem",{questionTypeEnum:function(e){return e.exam.question.typeEnum},levelEnum:function(e){return e.user.levelEnum}})),Object(Ut["d"])("exam",{subjects:function(e){return e.subjects}}))},ti=ei,ai=Object(f["a"])(ti,Ya,Za,!1,null,null,null),ii=ai.exports,ri=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{path:"/dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("商品管理")]),a("el-breadcrumb-item",[e._v("会员列表")])],1),a("div",{staticClass:"operation-nav"},[a("router-link",{attrs:{to:"/dashboard/user/add"}})],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"filter-box"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.filterForm}},[a("el-form-item",{attrs:{label:"会员名称"}},[a("el-input",{attrs:{placeholder:"会员名称"},model:{value:e.filterForm.name,callback:function(t){e.$set(e.filterForm,"name",t)},expression:"filterForm.name"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitFilter}},[e._v("查询")])],1)],1)],1),a("div",{staticClass:"form-table-box"},[a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.tableData,border:"",stripe:""}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"100"}}),a("el-table-column",{attrs:{prop:"username",label:"会员名称"}}),a("el-table-column",{attrs:{prop:"nickname",label:"呢称"}}),a("el-table-column",{attrs:{prop:"gender",label:"性别",width:"120"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(1==t.row.gender?"女":"男")+" ")]}}])}),a("el-table-column",{attrs:{prop:"mobile",label:"手机号"}}),a("el-table-column",{attrs:{prop:"register_time",label:"注册时间"}}),a("el-table-column",{attrs:{label:"操作",width:"140"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{size:"small",type:"danger"},on:{click:function(a){return e.handleRowDelete(t.$index,t.row)}}},[e._v("删除")])]}}])})],1)],1),a("div",{staticClass:"page-box"},[a("el-pagination",{attrs:{"current-page":e.page,"page-size":10,layout:"total, prev, pager, next, jumper",total:e.total},on:{"current-change":e.handlePageChange}})],1)])])},oi=[],ni={data:function(){return{page:1,total:0,filterForm:{name:""},tableData:[]}},methods:{handlePageChange:function(e){this.page=e,localStorage.setItem("userPage",this.page),localStorage.setItem("userFilterForm",JSON.stringify(this.filterForm)),this.getList()},handleRowEdit:function(e,t){this.$router.push({name:"user_add",query:{id:t.id}})},handleRowDelete:function(e,t){var a=this;this.$confirm("确定要删除?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){a.axios.post("user/destory",{id:t.id}).then((function(e){console.log(e.data),0===e.data.errno&&(a.$message({type:"success",message:"删除成功!"}),a.getList())}))}))},onSubmitFilter:function(){this.page=1,this.getList()},getList:function(){var e=this;this.axios.get("user",{params:{page:this.page,name:this.filterForm.name}}).then((function(t){e.tableData=t.data.data.data,e.page=t.data.data.currentPage,e.total=t.data.data.count}))}},components:{},mounted:function(){this.getList()}},si=ni,li=Object(f["a"])(si,ri,oi,!1,null,"6c779596",null),ci=li.exports,ui=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"content-page"},[a("div",{staticClass:"content-nav"},[a("el-breadcrumb",{staticClass:"breadcrumb",attrs:{separator:"/"}},[a("el-breadcrumb-item",{attrs:{to:{name:"dashboard"}}},[e._v("首页")]),a("el-breadcrumb-item",[e._v("商品管理")]),a("el-breadcrumb-item",[e._v(e._s(e.infoForm.id?"编辑品牌":"添加品牌"))])],1),a("div",{staticClass:"operation-nav"},[a("el-button",{attrs:{type:"primary",icon:"arrow-left"},on:{click:e.goBackPage}},[e._v("返回列表")])],1)],1),a("div",{staticClass:"content-main"},[a("div",{staticClass:"form-table-box"},[a("el-form",{ref:"infoForm",attrs:{rules:e.infoRules,model:e.infoForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"品牌名称",prop:"name"}},[a("el-input",{model:{value:e.infoForm.name,callback:function(t){e.$set(e.infoForm,"name",t)},expression:"infoForm.name"}})],1),a("el-form-item",{attrs:{label:"品牌简介",prop:"simple_desc"}},[a("el-input",{attrs:{type:"textarea",rows:3},model:{value:e.infoForm.simple_desc,callback:function(t){e.$set(e.infoForm,"simple_desc",t)},expression:"infoForm.simple_desc"}}),a("div",{staticClass:"form-tip"})],1),a("el-form-item",{attrs:{label:"品牌图片",prop:"list_pic_url"}},[a("el-upload",{staticClass:"image-uploader",attrs:{name:"brand_pic",action:"/admin/upload/brandPic","show-file-list":!1,"on-success":e.handleUploadImageSuccess,headers:e.uploaderHeader}},[e.infoForm.list_pic_url?a("img",{staticClass:"image-show",attrs:{src:e.infoForm.list_pic_url}}):a("i",{staticClass:"el-icon-plus image-uploader-icon"})]),a("div",{staticClass:"form-tip"},[e._v("图片尺寸：750*420")])],1),a("el-form-item",{attrs:{label:"推荐"}},[a("el-checkbox",{attrs:{label:""},model:{value:e.infoForm.is_new,callback:function(t){e.$set(e.infoForm,"is_new",t)},expression:"infoForm.is_new"}})],1),e.infoForm.is_new?a("el-form-item",{attrs:{label:"推荐展示图片"}},[a("el-upload",{staticClass:"image-uploader new-image-uploader",attrs:{name:"brand_new_pic",action:"/admin/upload/brandNewPic","show-file-list":!1,"on-success":e.handleUploadImageSuccess,headers:e.uploaderHeader}},[e.infoForm.new_pic_url?a("img",{staticClass:"image-show",attrs:{src:e.infoForm.new_pic_url}}):a("i",{staticClass:"el-icon-plus image-uploader-icon"})]),a("div",{staticClass:"form-tip"},[e._v("图片尺寸：375*252")])],1):e._e(),a("el-form-item",{attrs:{label:"排序"}},[a("el-input-number",{attrs:{min:1,max:1e3},model:{value:e.infoForm.sort_order,callback:function(t){e.$set(e.infoForm,"sort_order",t)},expression:"infoForm.sort_order"}})],1),a("el-form-item",{attrs:{label:"启用"}},[a("el-switch",{model:{value:e.infoForm.is_show,callback:function(t){e.$set(e.infoForm,"is_show",t)},expression:"infoForm.is_show"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:e.onSubmitInfo}},[e._v("确定保存")]),a("el-button",{on:{click:e.goBackPage}},[e._v("取消")])],1)],1)],1)])])},mi=[],di={data:function(){return{uploaderHeader:{"X-Nideshop-Token":localStorage.getItem("token")||""},infoForm:{id:0,name:"",list_pic_url:"",simple_desc:"",pic_url:"",sort_order:100,is_show:!0,floor_price:0,app_list_pic_url:"",is_new:!1,new_pic_url:"",new_sort_order:10},infoRules:{name:[{required:!0,message:"请输入名称",trigger:"blur"}],simple_desc:[{required:!0,message:"请输入简介",trigger:"blur"}],list_pic_url:[{required:!0,message:"请选择品牌图片",trigger:"blur"}]}}},methods:{goBackPage:function(){this.$router.go(-1)},onSubmitInfo:function(){var e=this;this.$refs["infoForm"].validate((function(t){if(!t)return!1;e.axios.post("brand/store",e.infoForm).then((function(t){0===t.data.errno?(e.$message({type:"success",message:"保存成功"}),e.$router.go(-1)):e.$message({type:"error",message:"保存失败"})}))}))},handleUploadImageSuccess:function(e,t){if(0===e.errno)switch(e.data.name){case"brand_pic":this.$set("infoForm.list_pic_url",e.data.fileUrl);break;case"brand_new_pic":this.$set("infoForm.new_pic_url",e.data.fileUrl);break}},getInfo:function(){if(this.infoForm.id<=0)return!1;var e=this;this.axios.get("brand/info",{params:{id:e.infoForm.id}}).then((function(t){var a=t.data.data;a.is_new=!!a.is_new,a.is_show=!!a.is_show,e.infoForm=a}))}},components:{},mounted:function(){this.infoForm.id=this.$route.query.id||0,this.getInfo(),console.log(W)}},fi=di,pi=(a("ff88"),Object(f["a"])(fi,ui,mi,!1,null,null,null)),bi=pi.exports,hi=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"login"},[a("div",{staticClass:"login-box"},[e._m(0),a("div",{staticClass:"body"},[a("p",{staticClass:"tips"},[e._v("欢迎使用泛海咨询后台管理")]),a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-position":"top"}},[a("el-form-item",{attrs:{label:"",prop:"username"}},[a("el-input",{attrs:{placeholder:"用户名"},model:{value:e.form.username,callback:function(t){e.$set(e.form,"username",t)},expression:"form.username"}})],1),a("el-form-item",{attrs:{label:"",prop:"password"}},[a("el-input",{attrs:{type:"password",placeholder:"密码"},model:{value:e.form.password,callback:function(t){e.$set(e.form,"password",t)},expression:"form.password"}})],1),a("el-form-item",[a("el-button",{staticStyle:{width:"100%"},attrs:{type:"primary",loading:e.loading},on:{click:e.startLogin}},[e._v(" "+e._s(e.loading?"登录中...":"登录")+" ")])],1)],1),e._m(1)],1)])])},gi=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"logo"},[a("img",{attrs:{src:"/assets/logo.png"}})])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("p",{staticClass:"author"},[e._v("Created by "),a("a",{attrs:{href:"https://github.com/tumobi",target:"_blank"}},[e._v("tumobi")])])}],vi={data:function(){return{form:{username:"",password:""},rules:{username:[{required:!0,message:"请输入用户名",trigger:"blur"}],password:[{required:!0,message:"请输入密码",trigger:"blur"},{min:6,message:"密码不得低于6个字符",trigger:"blur"}]},loading:!1}},components:{},methods:{startLogin:function(){var e=this;this.$refs["form"].validate((function(t){if(!t)return!1;e.loading=!0,e.axios.post("/auth/login",{username:e.form.username,password:e.form.password}).then((function(t){console.log(t.data),e.loading=!1,0===t.data.errno?(localStorage.setItem("token",t.data.data.token),localStorage.setItem("userInfo",JSON.stringify(t.data.data.userInfo)),e.$router.push({name:"dashboard"})):e.$message({type:"error",title:t.data.errmsg})})).catch((function(t){console.log(t),e.loading=!1}))}))}}},_i=vi,yi=(a("cd83"),Object(f["a"])(_i,hi,gi,!1,null,null,null)),xi=yi.exports;i["default"].use(h["a"]);var wi=new h["a"]({scrollBehavior:function(){return{y:0}},routes:[{path:"/",name:"dashboard",redirect:"/dashboard"},{path:"/dashboard",name:"dashboard",component:O,children:[{path:"/",name:"welcome",component:B},{path:"goods",name:"goods",component:M},{path:"goods/add",name:"goods_add",component:ee},{path:"category",name:"category",component:ne},{path:"category/add",name:"category_add",component:de},{path:"brand",name:"brand",component:ve},{path:"brand/add",name:"brand_add",component:Fe},{path:"order",name:"order",component:Ee},{path:"order/detail",name:"order_detail",component:ze},{path:"operate/promotion",name:"promotion",component:Ve},{path:"operate/promotion/add",name:"promotion_add",component:Xe},{path:"operate/assessment",name:"assessment",component:et},{path:"operate/assessment/add",name:"assessment_add",component:nt},{path:"operate/classes",name:"classes",component:dt},{path:"operate/classes/add",name:"classes_add",component:kt},{path:"operate/topic",name:"topic",component:It},{path:"operate/topic/add",name:"topic_add",component:Dt},{path:"paper/list",component:ta,name:"ExamPaperPageList",meta:{title:"试卷列表",noCache:!0}},{path:"paper/edit",component:ba,name:"ExamPaperEdit",meta:{title:"试卷编辑",noCache:!0,activeMenu:"/exam/paper/list"},hidden:!0},{path:"question/list",component:xa,name:"ExamQuestionPageList",meta:{title:"题目列表",noCache:!0}},{path:"question/edit/singleChoice",component:La,name:"singleChoicePage",meta:{title:"单选题编辑",noCache:!0,activeMenu:"/exam/question/list"},hidden:!0},{path:"question/edit/multipleChoice",component:Ra,name:"multipleChoicePage",meta:{title:"多选题编辑",noCache:!0,activeMenu:"/exam/question/list"},hidden:!0},{path:"question/edit/trueFalse",component:Ha,name:"trueFalsePage",meta:{title:"判断题编辑",noCache:!0,activeMenu:"/exam/question/list"},hidden:!0},{path:"question/edit/gapFilling",component:Ka,name:"gapFillingPage",meta:{title:"填空题编辑",noCache:!0,activeMenu:"/exam/question/list"},hidden:!0},{path:"question/edit/shortAnswer",component:ii,name:"shortAnswerPage",meta:{title:"简答题编辑",noCache:!0,activeMenu:"/exam/question/list"},hidden:!0},{path:"user",name:"user",component:ci},{path:"user/add",name:"user_add",component:bi}]},{path:"/login",name:"login",component:xi},{path:"*",redirect:"/dashboard"}]}),qi=a("2a74");i["default"].use(Ut["a"]);var Fi=new Ut["a"].Store({modules:qi["default"],strict:!1});i["default"].use(n["a"],o.a),i["default"].use(l.a),wi.beforeEach((function(e,t,a){var i=localStorage.getItem("token")||"";o.a.defaults.baseURL="/admin/",o.a.defaults.headers.common["X-Nideshop-Token"]=i,i||"login"===e.name?a():a({path:"/login",query:{redirect:e.fullPath}})})),new i["default"]({router:wi,store:Fi,render:function(e){return e(b)}}).$mount("#app")},"5cf6":function(e,t,a){"use strict";a("aee1")},"61cf":function(e,t,a){},"67bd":function(e,t,a){"use strict";a("8196")},"73a4":function(e,t,a){},7560:function(e,t,a){"use strict";a("963a")},"7cfb":function(e,t,a){"use strict";a("d57f")},8196:function(e,t,a){},"88bb":function(e,t,a){},"8b09":function(e,t,a){"use strict";a("61cf")},"963a":function(e,t,a){},a615:function(e,t,a){"use strict";a.r(t);var i=a("b85c"),r=(a("b0c0"),a("b775")),o={list:function(e){return Object(r["a"])("/education/subject/list")},pageList:function(e){return Object(r["a"])("/education/subject/page",e)},edit:function(e){return Object(r["a"])("/education/subject/edit",e)},select:function(e){return Object(r["a"])("/education/subject/select/"+e)},deleteSubject:function(e){return Object(r["a"])("/education/subject/delete/"+e)}},n={subjects:[]},s={subjectEnumFormat:function(e){return function(t){var a,r=Object(i["a"])(e.subjects);try{for(r.s();!(a=r.n()).done;){var o=a.value;if(o.id===t)return o.name+" ( "+o.levelName+" )"}}catch(n){r.e(n)}finally{r.f()}return null}}},l={initSubject:function(e,t){var a=e.commit;o.list().then((function(e){a("setSubjects",e.response),void 0!==t&&t()}))}},c={setSubjects:function(e,t){e.subjects=t}};t["default"]={namespaced:!0,state:n,getters:s,actions:l,mutations:c}},ae31:function(e,t,a){},aee1:function(e,t,a){},b775:function(e,t,a){"use strict";a.d(t,"a",(function(){return s}));a("d3b7");var i=a("bc3a"),r=a.n(i),o=a("a026"),n=function(e,t){var a;return e&&(a=o["default"].prototype.$loading({lock:!1,text:"正在加载中…",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.5)"})),r.a.request(t).then((function(t){return e&&a.close(),401===t.data.code?(o["default"].prototype.$$router.push({path:"/login"}),Promise.reject(t.data)):500===t.data.code||501===t.data.code?Promise.reject(t.data):502===t.data.code?(o["default"].prototype.$$router.push({path:"/login"}),Promise.reject(t.data)):Promise.resolve(t.data)})).catch((function(t){return e&&a.close(),o["default"].prototype.$message.error(t.message),Promise.reject(t.message)}))},s=function(e,t){var a={baseURL:Object({NODE_ENV:"production",BASE_URL:"/admin/"}).VUE_APP_URL,url:e,method:"post",withCredentials:!0,timeout:3e4,data:t,headers:{"Content-Type":"application/json","request-ajax":!0}};return n(!1,a)}},c567:function(e,t,a){"use strict";a("d2b7")},cd83:function(e,t,a){"use strict";a("ae31")},cf79:function(e,t,a){"use strict";a("88bb")},d026:function(e,t,a){"use strict";a("0a8f")},d2b7:function(e,t,a){},d307:function(e,t,a){var i={"./exam.js":"a615","./index.js":"2a74"};function r(e){var t=o(e);return a(t)}function o(e){if(!a.o(i,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return i[e]}r.keys=function(){return Object.keys(i)},r.resolve=o,e.exports=r,r.id="d307"},d57f:function(e,t,a){},db62:function(e,t,a){},fe52:function(e,t,a){"use strict";a("4439")},ff88:function(e,t,a){"use strict";a("1698")}});