1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-fc1dd95a","chunk-3ce68407","chunk-189c6a21","chunk-f6657b32","chunk-2d0bb266","chunk-2d216ba7","chunk-2d0a4474"],{"0680":function(t,e,n){"use strict";n.r(e),n.d(e,"getDict",(function(){return s}));var a=n("1da1"),r=(n("96cf"),n("4360")),s=function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,r["store"].dispatch("dictionary/getDictionary",e);case 2:return t.abrupt("return",r["store"].getters["dictionary/getDictionary"][e]);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},"1e10":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[t._m(0),n("div",{staticClass:"search-term"},[n("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:t.searchInfo}},[n("el-form-item",{attrs:{label:"标题",prop:"phone"}},[n("el-input",{staticClass:"user-form-item",attrs:{placeholder:"请输入标题",type:"text",clearable:""},model:{value:t.searchInfo.title,callback:function(e){t.$set(t.searchInfo,"title",e)},expression:"searchInfo.title"}})],1)],1)],1),t.isReloadData?n("el-table",{attrs:{data:t.tableData,border:"",stripe:""}},[n("el-table-column",{attrs:{label:"ID",width:"70",prop:"answerId"}}),n("el-table-column",{attrs:{label:"题型",width:"70",prop:"type"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("span",[t._v(t._s(t.typeOption[a.type]))])]}}],null,!1,490918081)}),n("el-table-column",{attrs:{label:"题目",prop:"name"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("span",[t._v(t._s(a.title))])]}}],null,!1,1669095044)}),n("el-table-column",{attrs:{align:"center",width:"160px",label:"操作","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row,r=e.$index;return[t.answers[a.answerId]||a.isAdd?n("el-button",[t._v(" 已经加入 ")]):n("el-button",{attrs:{type:"success",size:"small",icon:"el-icon-circle-check"},on:{click:function(e){return t.select(a,r)}}},[t._v("加入题库 "+t._s(a.isAdd))])]}}],null,!1,249349339)})],1):t._e(),n("el-pagination",{style:{float:"right",padding:"20px"},attrs:{"current-page":t.page,"page-size":t.size,"page-sizes":[10,30,50,100],total:t.total,layout:"total, sizes, prev, pager, next, jumper"},on:{"current-change":t.handleCurrentChange,"size-change":t.handleSizeChange}})],1)},r=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"button-box clearflex"},[n("h1",[t._v(" 所有题库")])])}],s=n("a4a2"),i=n("39f0"),o={name:"Api",data:function(){return{isReloadData:!0,listApi:i["getWxAnswerList"],typeOption:{1:"单选",2:"多选",3:"判断"}}},props:{answers:{type:Object,default:function(){}}},watch:{"searchInfo.title":function(t){var e=t[t.length-1];1!=t.length&&(e<="z"&&e>="A"||this.getTableData())},answers:{handler:function(t,e){},immediate:!0}},mixins:[s["default"]],methods:{reload:function(){var t=this;console.log("reload"),this.isReloadData=!1,this.$nextTick((function(){t.isReloadData=!0}))},select:function(t,e){this.$emit("selectAnswer",t,this.reload)}},created:function(){this.getTableData()}},l=o,c=(n("53c7"),n("2877")),u=Object(c["a"])(l,a,r,!1,null,"2a61e520",null);e["default"]=u.exports},2435:function(t,e,n){},"39f0":function(t,e,n){"use strict";n.r(e),n.d(e,"findExam",(function(){return r})),n.d(e,"addExam",(function(){return s})),n.d(e,"getWxGroupList",(function(){return i})),n.d(e,"getWxUserGroupList",(function(){return o})),n.d(e,"getWxAnswerList",(function(){return l})),n.d(e,"postData",(function(){return c}));var a=n("b775"),r=function(t){return Object(a["default"])({url:"/admin/findExam",method:"post",data:t})},s=function(t){return Object(a["default"])({url:"/admin/addExam",method:"post",data:t})},i=function(t){return Object(a["default"])({url:"/admin/getWxGroupList",method:"post",data:t})},o=function(t){return Object(a["default"])({url:"/admin/getWxUserGroupList",method:"post",data:t})},l=function(t){return Object(a["default"])({url:"/admin/getWxAnswerList",method:"post",data:t})},c=function(t,e){return Object(a["default"])({url:"/admin/".concat(t),method:"post",data:e})}},"53c7":function(t,e,n){"use strict";n("2435")},"67d8":function(t,e,n){"use strict";n("aca9")},"7e32":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("el-table",{attrs:{data:t.datalist,border:"",stripe:""}},[n("el-table-column",{attrs:{label:"ID",width:"70",prop:"answerId"}}),n("el-table-column",{attrs:{label:"题型",width:"70",prop:"type"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("span",[t._v(t._s(t.typeOption[a.type]))])]}}])}),n("el-table-column",{attrs:{label:"题目",prop:"name"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[n("span",[t._v(t._s(a.title))])]}}])}),n("el-table-column",{attrs:{align:"center",width:"160px",label:"操作","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row,r=e.$index;return[n("el-button",{attrs:{type:"success",size:"small",icon:"el-icon-circle-check"},on:{click:function(e){return t.deleteRow(a,r)}}},[t._v("移除题库")])]}}])})],1)],1)},r=[],s={name:"Api",data:function(){return{list:[],typeOption:{1:"单选",2:"多选",3:"判断"}}},props:{datalist:{type:Array,default:function(){return[]}}},methods:{deleteRow:function(t,e){t.index=e,this.$emit("deleteRow",t)}}},i=s,o=(n("67d8"),n("2877")),l=Object(o["a"])(i,a,r,!1,null,"4891810a",null);e["default"]=l.exports},a434:function(t,e,n){"use strict";var a=n("23e7"),r=n("da84"),s=n("23cb"),i=n("5926"),o=n("07fa"),l=n("7b0b"),c=n("65f0"),u=n("8418"),d=n("1dde"),f=d("splice"),p=r.TypeError,h=Math.max,g=Math.min,m=9007199254740991,w="Maximum allowed length exceeded";a({target:"Array",proto:!0,forced:!f},{splice:function(t,e){var n,a,r,d,f,b,v=l(this),x=o(v),y=s(t,x),D=arguments.length;if(0===D?n=a=0:1===D?(n=0,a=x-y):(n=D-2,a=g(h(i(e),0),x-y)),x+n-a>m)throw p(w);for(r=c(v,a),d=0;d<a;d++)f=y+d,f in v&&u(r,d,v[f]);if(r.length=a,n<a){for(d=y;d<x-a;d++)f=d+a,b=d+n,f in v?v[b]=v[f]:delete v[b];for(d=x;d>x-a+n;d--)delete v[d-1]}else if(n>a)for(d=x-a;d>y;d--)f=d+a-1,b=d+n-1,f in v?v[b]=v[f]:delete v[b];for(d=0;d<n;d++)v[d+y]=arguments[d+2];return v.length=x-a+n,r}})},a4a2:function(t,e,n){"use strict";n.r(e);var a=n("5530"),r=n("1da1"),s=(n("96cf"),n("4de4"),n("d3b7"),n("159b"),n("d81d"),n("0680"));n("c466"),n("ed08");e["default"]={data:function(){return{page:1,total:10,size:10,tableData:[],searchInfo:{isFinish:0}}},watch:{},methods:{filterDict:function(t,e){var n=this[e+"Options"]&&this[e+"Options"].filter((function(e){return e.value==t}));return n&&n[0]&&n[0].label},getDict:function(t){var e=this;return Object(r["a"])(regeneratorRuntime.mark((function n(){var a;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.next=2,Object(s["getDict"])(t);case 2:return a=n.sent,e[t+"Options"]=a,n.abrupt("return",a);case 5:case"end":return n.stop()}}),n)})))()},handleSizeChange:function(t){this.size=t,this.getTableData()},handleCurrentChange:function(t){this.page=t,this.getTableData()},handleSelectAll:function(t){console.log("handleSelectAll",t),this[t].forEach((function(t){t._selected=!0}))},handleSelectNull:function(t){console.log("handleSelectNull",t),this[t].forEach((function(t){t._selected=!1}))},handleChangeItem:function(t,e,n){this[t][e]=n(this[t][e])},getAllTableData:function(t){var e=Object(a["a"])({size:1e4,from:0},this.searchInfo);this.listApi(e).then((function(e){t(e)}))},getTableData:function(){var t=arguments,e=this;return Object(r["a"])(regeneratorRuntime.mark((function n(){var r,s,i,o,l;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=t.length>0&&void 0!==t[0]?t[0]:e.page,s=t.length>1&&void 0!==t[1]?t[1]:e.size,i=(r-1)*s,o=Object(a["a"])({size:s,from:i},e.searchInfo),n.next=6,e.listApi(o);case 6:l=n.sent,200==l.code&&(e.tableData=l.data.list.map((function(t){return t.edit=!1,t._selected=!1,t})),e.total=l.data.total);case 8:case"end":return n.stop()}}),n)})))()}}}},aca9:function(t,e,n){},c466:function(t,e,n){"use strict";n.r(e),n.d(e,"curDate",(function(){return a})),n.d(e,"formatTimeToStr",(function(){return r})),n.d(e,"toDatetime",(function(){return s})),n.d(e,"toDate",(function(){return i})),n.d(e,"toDateShow",(function(){return o})),n.d(e,"getDate",(function(){return l}));n("ac1f"),n("00b4"),n("5319"),n("4d63"),n("c607"),n("2c3e"),n("25f0");function a(){var t=(new Date).Format("yyyy-MM-dd");return t.toLocaleString()}function r(t,e){var n=new Date(t).Format("yyyy-MM-dd hh:mm:ss");return e&&(n=new Date(t).Format(e)),n.toLocaleString()}function s(t){if(!t)return"2020-01-01 00:00:00";var e=new Date(t).Format("yyyy-MM-dd hh:mm:ss");return e.toLocaleString()}function i(t){if(!t)return"2020-01-01";var e=new Date(t).Format("yyyy-MM-dd");return e.toLocaleString()}function o(t){if(!t)return"---";var e=new Date(t).Format("yyyy-MM-dd");return e.toLocaleString()}function l(t){var e=new Date;return e.setDate(e.getDate()+t),i(e)}Date.prototype.Format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds()};for(var n in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+n+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[n]:("00"+e[n]).substr((""+e[n]).length)));return t}},eeea:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",[n("el-row",[n("el-col",{staticClass:"p20",attrs:{span:12}},[n("i-answer",{attrs:{answers:t.answers},on:{selectAnswer:t.selectAnswer}})],1),n("el-col",{staticClass:"p20",attrs:{span:12}},[n("div",{staticClass:"button-box clearflex"},[n("h1",[t._v(" 已经选择题库")])]),n("div",{staticClass:"search-term"},[n("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0}},[n("el-form-item",{attrs:{label:"标题",prop:"phone"}},[n("el-input",{staticClass:"user-form-item",attrs:{placeholder:"请输入标题",type:"text",clearable:""},model:{value:t.title,callback:function(e){t.title=e},expression:"title"}})],1)],1)],1),n("i-group-answer",{attrs:{datalist:t.filterList()},on:{deleteRow:t.deleteRow}}),n("el-pagination",{style:{float:"right",padding:"20px"},attrs:{"current-page":t.page,"page-size":t.size,"page-sizes":[10,30,50,100],total:t.answerList.length,layout:"total, sizes, prev, pager, next, jumper"},on:{"current-change":t.handleCurrentChange,"size-change":t.handleSizeChange}})],1)],1)],1)},r=[],s=(n("d3b7"),n("159b"),n("a434"),n("4de4"),n("fb6a"),n("39f0")),i=n("1e10"),o=n("7e32"),l={name:"Api",data:function(){return{size:10,page:1,title:"",groupId:0,answers:{},answerList:[]}},components:{IAnswer:i["default"],IGroupAnswer:o["default"]},methods:{getWxGroupAnswerList:function(t){var e=this;Object(s["postData"])("getWxGroupAnswerList",{groupId:t}).then((function(t){if(200==t.code){var n=t.data||[],a={};n.forEach((function(t){a[t.answerId]=!0})),e.answers=a,e.answerList=n}}))},selectAnswer:function(t,e){var n=this,a={groupId:this.groupId,answerId:t.answerId};Object(s["postData"])("AddWxGroupAnswer",a).then((function(a){if(200==a.code){n.answers[t.answerId]=!0;Object.assign(a.data,t);n.answerList.push(a.data),n.$message.successMsg("加入成功",1),e&&e()}}))},deleteRow:function(t){var e=this,n={groupId:this.groupId,answerId:t.answerId};Object(s["postData"])("DelWxGroupAnswer",n).then((function(n){200==n.code&&(e.answers[t.answerId]=!1,e.answerList.splice(t.index,1),e.$message.successMsg("加入成功",1))}))},handleCurrentChange:function(t){this.page=t},handleSizeChange:function(t){this.size=t},filterList:function(){var t=this.title,e=this.answerList.filter((function(e){return e.title.indexOf(t)>-1}));return e.slice((this.page-1)*this.size,this.page*this.size)}},beforeMount:function(){var t=+this.$route.query.groupId||0;this.groupId=t,this.getWxGroupAnswerList(t)}},c=l,u=n("2877"),d=Object(u["a"])(c,a,r,!1,null,null,null);e["default"]=d.exports}}]);
|