2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4bf5c744"],{"08a3":function(e,t,n){"use strict";n("7664")},"4c9b":function(e,t,n){"use strict";n.d(t,"i",(function(){return a})),n.d(t,"g",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return c})),n.d(t,"d",(function(){return u})),n.d(t,"b",(function(){return s})),n.d(t,"e",(function(){return p})),n.d(t,"h",(function(){return l})),n.d(t,"f",(function(){return d}));var r=n("2b0e"),a=new r["default"],i="event_shop_puzzles_update",o="event_activity_update",c="event_exam_update",u="event_game_update",s="event_coupon_update",p="event_puzzle_update",l="event_shop_update",d="event_role_update"},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:"选择"+e.$t("main.shop"),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"),o=n("1da1"),c=n("d4ec"),u=n("bee2"),s=n("262e"),p=n("2caf"),l=(n("b0c0"),n("96cf"),n("9ab4")),d=n("1b40"),h=n("b804"),f=n("db85"),b=n("63a2"),v=n("9dba"),m=n("4c9b"),y=n("6ebf"),g=function(e){Object(s["a"])(n,e);var t=Object(p["a"])(n);function n(){var e;return Object(c["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(u["a"])(n,[{key:"userLevel",get:function(){return v["a"].level}},{key:"created",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t=this;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=8;break}return e.next=5,this.getRemoteDeptList();case 5:m["i"].$on(m["h"],(function(){t.getRemoteDeptList()})),e.next=11;break;case 8:return this.shop=v["a"].department,e.next=11,this.fetchMyShop();case 11:this.loading=!1;case 12:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"beforeDestory",value:function(){1===v["a"].level&&m["i"].$off(m["h"])}},{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(o["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["k"])({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(o["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(o["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(o["a"])(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.shop){e.next=4;break}return t="选择需要保存的".concat(y["a"].tc("main.shop"),"信息"),this.$message({message:t,type:"warning"}),e.abrupt("return");case 4:return e.prev=4,n=this.$refs.tree.getCheckedKeys(),r={shopid:this.shop,qtypes:n},e.next=9,Object(f["q"])(r);case 9:this.$notify({title:"Success",message:"更新题库配置成功",type:"success",duration:2e3}),e.next=15;break;case 12:e.prev=12,e.t0=e["catch"](4),console.log("save shop gamesetting error",e.t0);case 15:case"end":return e.stop()}}),e,this,[[4,12]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"getRemoteCategory",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t,n,r,a,o,c,u,s,p;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(b["d"])();case 2:t=e.sent,n=t.data,r=Object(i["a"])(n);try{for(r.s();!(a=r.n()).done;){o=a.value,c=[],u=Object(i["a"])(o.children);try{for(u.s();!(s=u.n()).done;)p=s.value,c.push({id:p._id,label:p.name})}catch(l){u.e(l)}finally{u.f()}this.typeOptions.push({id:o._id,label:o.name,children:c})}}catch(l){r.e(l)}finally{r.f()}case 6:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()}]),n}(d["c"]);Object(l["a"])([Object(d["d"])("shop")],g.prototype,"onShopChange",null),g=Object(l["a"])([Object(d["a"])({name:"QuestionSetting",components:{Sticky:h["a"]},filters:{parseGameType:function(e){return 0===e?"微信小游戏":"网页版"}}})],g);var O=g,j=O,k=(n("08a3"),n("0c7c")),w=Object(k["a"])(j,r,a,!1,null,"93a7b8e6",null);t["default"]=w.exports},"63a2":function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"c",(function(){return i})),n.d(t,"g",(function(){return o})),n.d(t,"f",(function(){return c})),n.d(t,"h",(function(){return u})),n.d(t,"i",(function(){return s})),n.d(t,"b",(function(){return p})),n.d(t,"e",(function(){return l})),n.d(t,"j",(function(){return d})),n.d(t,"d",(function(){return h}));var r=n("b32d"),a={withNext:!1,quality:3,a1:"",question:""};function i(e){switch(e){case 1:return"普通";case 2:return"图片";case 3:return"问卷";default:return"未知"}}var o=function(e){return Object(r["a"])({url:"/api/puzzles",method:"post",params:e})},c=function(e,t){return Object(r["a"])({url:"/api/puzzle/".concat(e),method:"get",params:t})},u=function(e){return Object(r["a"])({url:"/api/nextpuzzle",method:"post",data:{id:e}})},s=function(e){return Object(r["a"])({url:"/api/puzzle/save",method:"post",data:e})},p=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"})},d=function(e){return Object(r["a"])({url:"/api/tag/save",method:"post",data:{name:e}})},h=function(){return Object(r["a"])({url:"/api/question/categorys",method:"get"})}},7664:function(e,t,n){},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"),o=n("bee2"),c=n("262e"),u=n("2caf"),s=(n("0d03"),n("d3b7"),n("25f0"),n("9ab4")),p=n("1b40"),l=function(e){Object(c["a"])(n,e);var t=Object(u["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(o["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}(p["c"]);Object(s["a"])([Object(p["b"])({default:0})],l.prototype,"stickyTop",void 0),Object(s["a"])([Object(p["b"])({default:1})],l.prototype,"zIndex",void 0),Object(s["a"])([Object(p["b"])({default:""})],l.prototype,"className",void 0),l=Object(s["a"])([Object(p["a"])({name:"Sticky"})],l);var d=l,h=d,f=n("0c7c"),b=Object(f["a"])(h,r,a,!1,null,null,null);t["a"]=b.exports},db85:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"k",(function(){return i})),n.d(t,"e",(function(){return o})),n.d(t,"d",(function(){return c})),n.d(t,"m",(function(){return u})),n.d(t,"b",(function(){return s})),n.d(t,"n",(function(){return p})),n.d(t,"f",(function(){return l})),n.d(t,"g",(function(){return d})),n.d(t,"q",(function(){return h})),n.d(t,"p",(function(){return f})),n.d(t,"c",(function(){return b})),n.d(t,"l",(function(){return v})),n.d(t,"h",(function(){return m})),n.d(t,"o",(function(){return y})),n.d(t,"i",(function(){return g})),n.d(t,"r",(function(){return O})),n.d(t,"j",(function(){return j}));var r=n("b32d"),a={name:"",address:"",logo:"",qtypes:[]},i=function(e){return Object(r["a"])({url:"/api/shops",method:"post",params:e})},o=function(e,t){return Object(r["a"])({url:"/api/shop/".concat(e),method:"get",params:t})},c=function(){return Object(r["a"])({url:"/api/myshop",method:"get"})},u=function(e){return Object(r["a"])({url:"/api/shop/save",method:"post",data:e})},s=function(e){return Object(r["a"])({url:"/api/shop/".concat(e,"/delete"),method:"post"})},p=function(e){return Object(r["a"])({url:"/api/shop/gameinfo/save",method:"post",data:e})},l=function(e){return Object(r["a"])({url:"/api/shop/gameinfo",method:"post",data:e})},d=function(e){return Object(r["a"])({url:"/api/shop/gameqr",method:"post",data:e})},h=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})},m=function(e){return Object(r["a"])({url:"/api/shop/lottery",method:"post",data:e})},y=function(e){return Object(r["a"])({url:"/api/shop/lottery_update",method:"post",data:e})},g=function(e){return Object(r["a"])({url:"/api/shop/share",method:"post",data:e})},O=function(e){return Object(r["a"])({url:"/api/shop/share_update",method:"post",data:e})},j=function(e){return Object(r["a"])({url:"/api/shop/game_users",method:"post",data:e})}}}]);
|
|
//# sourceMappingURL=chunk-4bf5c744.2cc73a2e.js.map
|