2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-035792c2"],{"04a9":function(e,t,n){},"333d":function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"pagination-container",class:{hidden:e.hidden}},[n("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)},r=[],i=n("d4ec"),o=n("bee2"),u=n("262e"),c=n("2caf"),s=n("9ab4"),l=n("1b40"),p=(n("4795"),function(e,t,n,a){return e/=a/2,e<1?n/2*e*e+t:(e--,-n/2*(e*(e-2)-1)+t)}),d=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}(),f=function(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e},m=function(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop},b=function(e,t,n){var a=m(),r=e-a,i=20,o=0;t="undefined"===typeof t?500:t;var u=function e(){o+=i;var u=p(o,a,r,t);f(u),o<t?d(e):n&&"function"===typeof n&&n()};u()},g=function(e){Object(u["a"])(n,e);var t=Object(c["a"])(n);function n(){return Object(i["a"])(this,n),t.apply(this,arguments)}return Object(o["a"])(n,[{key:"currentPage",get:function(){return this.page},set:function(e){this.$emit("update:page",e)}},{key:"pageSize",get:function(){return this.limit},set:function(e){this.$emit("update:limit",e)}},{key:"handleSizeChange",value:function(e){this.$emit("pagination",{page:this.currentPage,limit:e}),this.autoScroll&&b(0,800)}},{key:"handleCurrentChange",value:function(e){this.$emit("pagination",{page:e,limit:this.pageSize}),this.autoScroll&&b(0,800)}}]),n}(l["c"]);Object(s["a"])([Object(l["b"])({required:!0})],g.prototype,"total",void 0),Object(s["a"])([Object(l["b"])({default:1})],g.prototype,"page",void 0),Object(s["a"])([Object(l["b"])({default:20})],g.prototype,"limit",void 0),Object(s["a"])([Object(l["b"])({default:function(){return[10,20,30,50]}})],g.prototype,"pageSizes",void 0),Object(s["a"])([Object(l["b"])({default:"total, sizes, prev, pager, next, jumper"})],g.prototype,"layout",void 0),Object(s["a"])([Object(l["b"])({default:!0})],g.prototype,"background",void 0),Object(s["a"])([Object(l["b"])({default:!0})],g.prototype,"autoScroll",void 0),Object(s["a"])([Object(l["b"])({default:!1})],g.prototype,"hidden",void 0),g=Object(s["a"])([Object(l["a"])({name:"Pagination"})],g);var h=g,v=h,y=(n("34cc"),n("0c7c")),_=Object(y["a"])(v,a,r,!1,null,"2f4afb68",null);t["a"]=_.exports},"34cc":function(e,t,n){"use strict";n("04a9")},"4aa7":function(e,t,n){},"4c9b":function(e,t,n){"use strict";n.d(t,"i",(function(){return r})),n.d(t,"g",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"c",(function(){return u})),n.d(t,"d",(function(){return c})),n.d(t,"b",(function(){return s})),n.d(t,"e",(function(){return l})),n.d(t,"h",(function(){return p})),n.d(t,"f",(function(){return d}));var a=n("2b0e"),r=new a["default"],i="event_shop_puzzles_update",o="event_activity_update",u="event_exam_update",c="event_game_update",s="event_coupon_update",l="event_puzzle_update",p="event_shop_update",d="event_role_update"},"4f10":function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-container"},[n("el-form",{ref:"filterForm",staticClass:"filter",attrs:{inline:!0,model:e.filterForm}},[n("el-form-item",{attrs:{label:"关键字",prop:"key"}},[n("el-input",{attrs:{placeholder:"关键字"},model:{value:e.filterForm.key,callback:function(t){e.$set(e.filterForm,"key",t)},expression:"filterForm.key"}})],1),n("el-form-item",{attrs:{label:"分类",prop:"key"}},[n("el-cascader",{attrs:{options:e.typeOptions,filterable:"",clearable:"",size:"medium"},model:{value:e.filterForm.typeSelect,callback:function(t){e.$set(e.filterForm,"typeSelect",t)},expression:"filterForm.typeSelect"}})],1),n("el-form-item",[n("el-button",{attrs:{type:"primary"},on:{click:e.search}},[e._v("查询")]),n("el-button",{on:{click:e.resetFilterForm}},[e._v("重置")])],1)],1),n("router-link",{attrs:{to:"/question/create"}},[n("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["question:edit"],expression:"['question:edit']"}],attrs:{type:"primary",icon:"el-icon-edit"}},[e._v(" 添加 ")])],1),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],staticStyle:{width:"100%","margin-top":"30px"},attrs:{data:e.list,border:"",fit:"","highlight-current-row":""}},[n("el-table-column",{attrs:{width:"180px",align:"center",label:"添加时间"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("span",[e._v(e._s(e._f("parseTime")(a.createtime)))])]}}])}),n("el-table-column",{attrs:{label:"分类"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("span",[e._v(e._s(a.category))])]}}])}),n("el-table-column",{attrs:{"min-width":"200px",label:"名称"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("router-link",{staticClass:"link-type",attrs:{to:"/question/edit/"+a._id}},[n("span",[e._v(e._s(a.question))])])]}}])}),n("el-table-column",{attrs:{label:"答案"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[n("span",[e._v(e._s(a.a1))])]}}])}),n("el-table-column",{attrs:{label:"混淆答案"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[a.a2?n("el-tag",{attrs:{type:"info"}},[e._v(e._s(a.a2))]):e._e(),a.a3?n("el-tag",{attrs:{type:"info"}},[e._v(e._s(a.a3))]):e._e(),a.a4?n("el-tag",{attrs:{type:"info"}},[e._v(e._s(a.a4))]):e._e()]}}])}),n("el-table-column",{attrs:{label:"Tags"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return e._l(a.groups,(function(t){return n("el-tag",{key:t},[e._v(e._s(t))])}))}}])}),n("el-table-column",{attrs:{align:"center",width:"180",label:"操作",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("router-link",{attrs:{to:"/question/edit/"+t.row._id}},[n("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["question:edit"],expression:"['question:edit']"}],attrs:{type:"primary",size:"small",icon:"el-icon-edit"}},[e._v(" 编辑 ")])],1),n("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["question:delete"],expression:"['question:delete']"}],staticStyle:{"margin-left":"10px"},attrs:{type:"danger",size:"small"},on:{click:function(n){return e.handleDelete(t)}}},[e._v(" "+e._s(e.$t("permission.delete"))+" ")])]}}])})],1),n("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.listQuery.page,limit:e.listQuery.limit},on:{"update:page":function(t){return e.$set(e.listQuery,"page",t)},"update:limit":function(t){return e.$set(e.listQuery,"limit",t)},pagination:e.getList}})],1)},r=[],i=n("b85c"),o=n("1da1"),u=n("d4ec"),c=n("bee2"),s=n("262e"),l=n("2caf"),p=(n("96cf"),n("d3b7"),n("6062b"),n("3ca3"),n("ddb0"),n("a434"),n("b0c0"),n("9ab4")),d=n("1b40"),f=n("333d"),m=n("d257"),b=n("63a2"),g=n("4c9b"),h=function(e){Object(s["a"])(n,e);var t=Object(l["a"])(n);function n(){var e;return Object(u["a"])(this,n),e=t.apply(this,arguments),e.total=0,e.list=[],e.listLoading=!0,e.allDepts=[],e.listQuery={page:1,limit:20,key:"",tag:"",sub_tag:"",groups:""},e.typeOptions=[],e.tagSet=new Set,e.tagOptions=[],e.filterForm={key:"",typeSelect:[]},e}return Object(c["a"])(n,[{key:"created",value:function(){var e=this;this.getList(),this.getRemoteTags(),this.getRemoteCategory(),g["i"].$on(g["e"],(function(){e.getList()}))}},{key:"beforeDestory",value:function(){g["i"].$off(g["e"])}},{key:"getList",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 this.listLoading=!0,e.next=3,Object(b["g"])(this.listQuery);case 3:t=e.sent,n=t.data,this.listLoading=!1,this.list=n.records,this.total=n.total;case 8:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"handleDelete",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){var n,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return n=t.$index,a=t.row,e.next=3,this.$confirm("确认删除该记录?","Warning",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"});case 3:return e.next=5,Object(b["b"])(a._id);case 5:this.list.splice(n,1),this.$message({type:"success",message:"删除成功!"});case 7:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"search",value:function(){this.filterData()}},{key:"filterData",value:function(){this.listQuery.key=this.filterForm.key,this.filterForm.typeSelect.length>0&&(this.listQuery.tag=this.filterForm.typeSelect[0]),this.filterForm.typeSelect.length>1&&(this.listQuery.sub_tag=this.filterForm.typeSelect[1]),this.listQuery.page=1,this.getList()}},{key:"resetFilterForm",value:function(){this.$refs.filterForm.resetFields()}},{key:"getRemoteTags",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(b["e"])();case 2:t=e.sent,n=t.data,console.log(n),this.tagSet=new Set(n),this.tagOptions=n;case 7:case"end":return e.stop()}}),e,this)})));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,a,r,o,u,c,s,l;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,a=Object(i["a"])(n);try{for(a.s();!(r=a.n()).done;){o=r.value,u=[],c=Object(i["a"])(o.children);try{for(c.s();!(s=c.n()).done;)l=s.value,u.push({value:l._id,label:l.name})}catch(p){c.e(p)}finally{c.f()}this.typeOptions.push({value:o._id,label:o.name,children:u})}}catch(p){a.e(p)}finally{a.f()}case 6:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()}]),n}(d["c"]);h=Object(p["a"])([Object(d["a"])({name:"QuestionList",components:{Pagination:f["a"]},filters:{parseTime:function(e){return Object(m["d"])(e)},parseDate:function(e){return e?Object(m["d"])(e,"{y}-{m}-{d}"):"-"},formatCount:function(e){return e||0}}})],h);var v=h,y=v,_=(n("ca8c"),n("0c7c")),O=Object(_["a"])(y,a,r,!1,null,"750ae450",null);t["default"]=O.exports},"63a2":function(e,t,n){"use strict";n.d(t,"a",(function(){return r})),n.d(t,"c",(function(){return i})),n.d(t,"g",(function(){return o})),n.d(t,"f",(function(){return u})),n.d(t,"h",(function(){return c})),n.d(t,"i",(function(){return s})),n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return p})),n.d(t,"j",(function(){return d})),n.d(t,"d",(function(){return f}));var a=n("b32d"),r={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(a["a"])({url:"/api/puzzles",method:"post",params:e})},u=function(e,t){return Object(a["a"])({url:"/api/puzzle/".concat(e),method:"get",params:t})},c=function(e){return Object(a["a"])({url:"/api/nextpuzzle",method:"post",data:{id:e}})},s=function(e){return Object(a["a"])({url:"/api/puzzle/save",method:"post",data:e})},l=function(e){return Object(a["a"])({url:"/api/puzzle/".concat(e,"/delete"),method:"post"})},p=function(){return Object(a["a"])({url:"/api/tags",method:"get"})},d=function(e){return Object(a["a"])({url:"/api/tag/save",method:"post",data:{name:e}})},f=function(){return Object(a["a"])({url:"/api/question/categorys",method:"get"})}},ca8c:function(e,t,n){"use strict";n("4aa7")}}]);
|
|
//# sourceMappingURL=chunk-035792c2.132b6673.js.map
|