2 lines
10 KiB
JavaScript
2 lines
10 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-646f364d"],{5244:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("el-row",{staticStyle:{"margin-bottom":"24px"}},[1===e.userLevel?n("el-select",{staticClass:"w100",attrs:{placeholder:"选择店铺",name:"shop",required:""},model:{value:e.shop,callback:function(t){e.shop=t},expression:"shop"}},e._l(e.allDepts,(function(e){return n("el-option",{key:e._id,attrs:{label:e.name,value:e._id}})})),1):e._e()],1),n("el-row",{staticStyle:{"margin-bottom":"24px"}},[n("el-col",{attrs:{span:12,offset:2}},[n("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"},{name:"permission",rawName:"v-permission",value:["shop:tiku_setting"],expression:"['shop:tiku_setting']"}],attrs:{type:"primary"},on:{click:e.saveVal}},[e._v(" 保存 ")]),n("el-button",{on:{click:e.onCancel}},[e._v(" 取消 ")])],1)],1),n("el-row",[n("el-col",{attrs:{span:12,offset:2}},[n("el-tree",{ref:"tree",attrs:{data:e.typeOptions,"show-checkbox":"",accordion:"","node-key":"id","highlight-current":"","default-checked-keys":e.typeSelected,props:e.defaultProps}})],1)],1)],1)},a=[],i=n("b85c"),s=n("1da1"),o=n("d4ec"),c=n("bee2"),u=n("262e"),l=n("2caf"),h=(n("b0c0"),n("96cf"),n("9ab4")),p=n("1b40"),d=n("b804"),f=n("db85"),b=n("63a2"),v=n("9dba"),m=function(e){Object(u["a"])(n,e);var t=Object(l["a"])(n);function n(){var e;return Object(o["a"])(this,n),e=t.apply(this,arguments),e.loading=!0,e.shop="",e.allDepts=[],e.typeSelected=[],e.typeOptions=[],e.defaultProps={children:"children",label:"label"},e}return Object(c["a"])(n,[{key:"userLevel",get:function(){return v["a"].level}},{key:"created",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.getRemoteCategory();case 2:if(1!==v["a"].level){e.next=7;break}return e.next=5,this.getRemoteDeptList("");case 5:e.next=10;break;case 7:return this.shop=v["a"].department,e.next=10,this.fetchMyShop();case 10:this.loading=!1;case 11:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"onShopChange",value:function(){if(this.shop&&1===v["a"].level){var e,t,n=Object(i["a"])(this.allDepts);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(r._id===this.shop){e=r;break}}}catch(a){n.e(a)}finally{n.f()}this.typeSelected=e?e.qtypes:[],console.log(this.typeSelected),this.$refs.tree.setCheckedKeys(this.typeSelected)}}},{key:"getRemoteDeptList",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(f["h"])({key:t});case 2:if(n=e.sent,r=n.data,r.records){e.next=6;break}return e.abrupt("return");case 6:this.allDepts=r.records;case 7:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"fetchMyShop",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(f["d"])();case 2:t=e.sent,n=t.data,this.typeSelected=n.qtypes,console.log(this.typeSelected),this.$refs.tree.setCheckedKeys(this.typeSelected);case 7:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"onCancel",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.$confirm("确认不保存当前信息?","Warning",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 3:this.$store.dispatch("delView",this.$route),this.$router.go(-1),e.next=9;break;case 7:e.prev=7,e.t0=e["catch"](0);case 9:case"end":return e.stop()}}),e,this,[[0,7]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"saveVal",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.shop){e.next=3;break}return this.$message({message:"选择需要保存的店铺信息",type:"warning"}),e.abrupt("return");case 3:return e.prev=3,t=this.$refs.tree.getCheckedKeys(),n={shopid:this.shop,qtypes:t},e.next=8,Object(f["m"])(n);case 8:this.$notify({title:"Success",message:"更新店铺题库配置成功",type:"success",duration:2e3}),e.next=14;break;case 11:e.prev=11,e.t0=e["catch"](3),console.log("save shop gamesetting error",e.t0);case 14:case"end":return e.stop()}}),e,this,[[3,11]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"getRemoteCategory",value:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t,n,r,a,s,o,c,u,l;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(b["c"])();case 2:t=e.sent,n=t.data,r=Object(i["a"])(n);try{for(r.s();!(a=r.n()).done;){s=a.value,o=[],c=Object(i["a"])(s.children);try{for(c.s();!(u=c.n()).done;)l=u.value,o.push({id:l._id,label:l.name})}catch(h){c.e(h)}finally{c.f()}this.typeOptions.push({id:s._id,label:s.name,children:o})}}catch(h){r.e(h)}finally{r.f()}case 6:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()}]),n}(p["c"]);Object(h["a"])([Object(p["d"])("shop")],m.prototype,"onShopChange",null),m=Object(h["a"])([Object(p["a"])({name:"QuestionSetting",components:{Sticky:d["a"]},filters:{parseGameType:function(e){return 0===e?"微信小游戏":"网页版"}}})],m);var y=m,g=y,k=(n("c5327"),n("0c7c")),O=Object(k["a"])(g,r,a,!1,null,"e5723d76",null);t["default"]=O.exports},5428:function(e,t,n){},"63a2":function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"f",(function(){return i})),n.d(t,"e",(function(){return s})),n.d(t,"g",(function(){return o})),n.d(t,"h",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"d",(function(){return l})),n.d(t,"i",(function(){return h})),n.d(t,"c",(function(){return p}));var r=n("b32d"),a={withNext:!1,quality:3,a1:"",question:""},i=function(e){return Object(r["a"])({url:"/api/puzzles",method:"post",params:e})},s=function(e,t){return Object(r["a"])({url:"/api/puzzle/".concat(e),method:"get",params:t})},o=function(e){return Object(r["a"])({url:"/api/nextpuzzle",method:"post",data:{id:e}})},c=function(e){return Object(r["a"])({url:"/api/puzzle/save",method:"post",data:e})},u=function(e){return Object(r["a"])({url:"/api/puzzle/".concat(e,"/delete"),method:"post"})},l=function(){return Object(r["a"])({url:"/api/tags",method:"get"})},h=function(e){return Object(r["a"])({url:"/api/tag/save",method:"post",data:{name:e}})},p=function(){return Object(r["a"])({url:"/api/question/categorys",method:"get"})}},b804:function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{style:{height:e.height,zIndex:e.zIndex}},[n("div",{class:e.className,style:{top:e.isSticky?e.stickyTop+"px":"",zIndex:e.zIndex,position:e.position,width:e.width,height:e.height}},[e._t("default",[n("div",[e._v("sticky")])])],2)])},a=[],i=n("d4ec"),s=n("bee2"),o=n("262e"),c=n("2caf"),u=(n("0d03"),n("d3b7"),n("25f0"),n("9ab4")),l=n("1b40"),h=function(e){Object(o["a"])(n,e);var t=Object(c["a"])(n);function n(){var e;return Object(i["a"])(this,n),e=t.apply(this,arguments),e.active=!1,e.position="",e.isSticky=!1,e.width="auto",e.height="auto",e}return Object(s["a"])(n,[{key:"mounted",value:function(){this.height=this.$el.getBoundingClientRect().height.toString()+"px",window.addEventListener("scroll",this.handleScroll),window.addEventListener("resize",this.handleResize)}},{key:"activated",value:function(){this.handleScroll()}},{key:"destroyed",value:function(){window.removeEventListener("scroll",this.handleScroll),window.removeEventListener("resize",this.handleResize)}},{key:"sticky",value:function(){this.active||(this.position="fixed",this.active=!0,this.width=this.width+"px",this.isSticky=!0)}},{key:"handleReset",value:function(){this.active&&(this.position="",this.width="auto",this.active=!1,this.isSticky=!1)}},{key:"handleScroll",value:function(){var e=this.$el.getBoundingClientRect().width;this.width=e.toString()+"px"||!1;var t=this.$el.getBoundingClientRect().top;t<this.stickyTop?this.sticky():this.handleReset()}},{key:"handleResize",value:function(){this.isSticky&&(this.width=this.$el.getBoundingClientRect().width.toString()+"px")}}]),n}(l["c"]);Object(u["a"])([Object(l["b"])({default:0})],h.prototype,"stickyTop",void 0),Object(u["a"])([Object(l["b"])({default:1})],h.prototype,"zIndex",void 0),Object(u["a"])([Object(l["b"])({default:""})],h.prototype,"className",void 0),h=Object(u["a"])([Object(l["a"])({name:"Sticky"})],h);var p=h,d=p,f=n("0c7c"),b=Object(f["a"])(d,r,a,!1,null,null,null);t["a"]=b.exports},c5327:function(e,t,n){"use strict";n("5428")},db85:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"h",(function(){return i})),n.d(t,"e",(function(){return s})),n.d(t,"d",(function(){return o})),n.d(t,"j",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"k",(function(){return l})),n.d(t,"f",(function(){return h})),n.d(t,"g",(function(){return p})),n.d(t,"m",(function(){return d})),n.d(t,"l",(function(){return f})),n.d(t,"c",(function(){return b})),n.d(t,"i",(function(){return v}));var r=n("b32d"),a={name:"",address:"",logo:"",qtypes:[]},i=function(e){return Object(r["a"])({url:"/api/shops",method:"post",params:e})},s=function(e,t){return Object(r["a"])({url:"/api/shop/".concat(e),method:"get",params:t})},o=function(){return Object(r["a"])({url:"/api/myshop",method:"get"})},c=function(e){return Object(r["a"])({url:"/api/shop/save",method:"post",data:e})},u=function(e){return Object(r["a"])({url:"/api/shop/".concat(e,"/delete"),method:"post"})},l=function(e){return Object(r["a"])({url:"/api/shop/gameinfo/save",method:"post",data:e})},h=function(e){return Object(r["a"])({url:"/api/shop/gameinfo",method:"post",data:e})},p=function(e){return Object(r["a"])({url:"/api/shop/gameqr",method:"post",data:e})},d=function(e){return Object(r["a"])({url:"/api/shop/save_qtype",method:"post",data:e})},f=function(e){return Object(r["a"])({url:"/api/shop/publish",method:"post",data:e})},b=function(e){return Object(r["a"])({url:"/api/shop/gametheme",method:"post",data:e})},v=function(e){return Object(r["a"])({url:"/api/shop/gametheme/save",method:"post",data:e})}}}]);
|
|
//# sourceMappingURL=chunk-646f364d.68a80b9c.js.map
|