chunk-5d4b1141.28b47dd3.js 13 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5d4b1141","chunk-b7b74f52","chunk-4aaf9a2f","chunk-b7b74f52","chunk-f6657b32","chunk-2d0bb266","chunk-2d0ac361","chunk-2d216ba7","chunk-2d0a4474"],{"0680":function(t,e,r){"use strict";r.r(e),r.d(e,"getDict",(function(){return i}));var n=r("1da1"),a=(r("96cf"),r("4360")),i=function(){var t=Object(n["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,a["store"].dispatch("dictionary/getDictionary",e);case 2:return t.abrupt("return",a["store"].getters["dictionary/getDictionary"][e]);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},1925:function(t,e,r){"use strict";r.r(e),r.d(e,"searchApi",(function(){return a}));var n=r("b775"),a=function(t){return Object(n["default"])({url:"/admin/search",method:"post",data:t})}},"39f0":function(t,e,r){"use strict";r.r(e),r.d(e,"findExam",(function(){return a})),r.d(e,"addExam",(function(){return i})),r.d(e,"getWxGroupList",(function(){return o})),r.d(e,"getWxUserGroupList",(function(){return s})),r.d(e,"getWxAnswerList",(function(){return u})),r.d(e,"postData",(function(){return c}));var n=r("b775"),a=function(t){return Object(n["default"])({url:"/admin/findExam",method:"post",data:t})},i=function(t){return Object(n["default"])({url:"/admin/addExam",method:"post",data:t})},o=function(t){return Object(n["default"])({url:"/admin/getWxGroupList",method:"post",data:t})},s=function(t){return Object(n["default"])({url:"/admin/getWxUserGroupList",method:"post",data:t})},u=function(t){return Object(n["default"])({url:"/admin/getWxAnswerList",method:"post",data:t})},c=function(t,e){return Object(n["default"])({url:"/admin/".concat(t),method:"post",data:e})}},"408a":function(t,e,r){var n=r("e330");t.exports=n(1..valueOf)},4179:function(t,e,r){},5899:function(t,e){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},"58a8":function(t,e,r){var n=r("e330"),a=r("1d80"),i=r("577e"),o=r("5899"),s=n("".replace),u="["+o+"]",c=RegExp("^"+u+u+"*"),l=RegExp(u+u+"*$"),d=function(t){return function(e){var r=i(a(e));return 1&t&&(r=s(r,c,"")),2&t&&(r=s(r,l,"")),r}};t.exports={start:d(1),end:d(2),trim:d(3)}},"5c82":function(t,e,r){"use strict";r("4179")},a4a2:function(t,e,r){"use strict";r.r(e);var n=r("5530"),a=r("1da1"),i=(r("96cf"),r("4de4"),r("d3b7"),r("159b"),r("d81d"),r("0680"));r("c466"),r("ed08");e["default"]={data:function(){return{page:1,total:10,size:10,tableData:[],searchInfo:{isFinish:0}}},watch:{},methods:{filterDict:function(t,e){var r=this[e+"Options"]&&this[e+"Options"].filter((function(e){return e.value==t}));return r&&r[0]&&r[0].label},getDict:function(t){var e=this;return Object(a["a"])(regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return r.next=2,Object(i["getDict"])(t);case 2:return n=r.sent,e[t+"Options"]=n,r.abrupt("return",n);case 5:case"end":return r.stop()}}),r)})))()},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,r){this[t][e]=r(this[t][e])},getAllTableData:function(t){var e=Object(n["a"])({size:1e4,from:0},this.searchInfo);this.listApi(e).then((function(e){t(e)}))},getTableData:function(){var t=arguments,e=this;return Object(a["a"])(regeneratorRuntime.mark((function r(){var a,i,o,s,u;return regeneratorRuntime.wrap((function(r){while(1)switch(r.prev=r.next){case 0:return a=t.length>0&&void 0!==t[0]?t[0]:e.page,i=t.length>1&&void 0!==t[1]?t[1]:e.size,o=(a-1)*i,s=Object(n["a"])({size:i,from:o},e.searchInfo),r.next=6,e.listApi(s);case 6:u=r.sent,200==u.code&&(e.tableData=u.data.list.map((function(t){return t.edit=!1,t._selected=!1,t})),e.total=u.data.total);case 8:case"end":return r.stop()}}),r)})))()}}}},a9e3:function(t,e,r){"use strict";var n=r("83ab"),a=r("da84"),i=r("e330"),o=r("94ca"),s=r("6eeb"),u=r("1a2d"),c=r("7156"),l=r("3a9b"),d=r("d9b5"),f=r("c04e"),m=r("d039"),p=r("241c").f,g=r("06cf").f,h=r("9bf2").f,b=r("408a"),v=r("58a8").trim,y="Number",x=a[y],w=x.prototype,k=a.TypeError,D=i("".slice),E=i("".charCodeAt),_=function(t){var e=f(t,"number");return"bigint"==typeof e?e:S(e)},S=function(t){var e,r,n,a,i,o,s,u,c=f(t,"number");if(d(c))throw k("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=v(c),e=E(c,0),43===e||45===e){if(r=E(c,2),88===r||120===r)return NaN}else if(48===e){switch(E(c,1)){case 66:case 98:n=2,a=49;break;case 79:case 111:n=8,a=55;break;default:return+c}for(i=D(c,2),o=i.length,s=0;s<o;s++)if(u=E(i,s),u<48||u>a)return NaN;return parseInt(i,n)}return+c};if(o(y,!x(" 0o1")||!x("0b1")||x("+0x1"))){for(var O,T=function(t){var e=arguments.length<1?0:x(_(t)),r=this;return l(w,r)&&m((function(){b(r)}))?c(Object(e),r,T):e},A=n?p(x):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),M=0;A.length>M;M++)u(x,O=A[M])&&!u(T,O)&&h(T,O,g(x,O));T.prototype=w,w.constructor=T,s(a,y,T)}},c466:function(t,e,r){"use strict";r.r(e),r.d(e,"curDate",(function(){return n})),r.d(e,"formatTimeToStr",(function(){return a})),r.d(e,"toDatetime",(function(){return i})),r.d(e,"toDate",(function(){return o})),r.d(e,"toDateShow",(function(){return s})),r.d(e,"getDate",(function(){return u}));r("ac1f"),r("00b4"),r("5319"),r("4d63"),r("c607"),r("2c3e"),r("25f0");function n(){var t=(new Date).Format("yyyy-MM-dd");return t.toLocaleString()}function a(t,e){var r=new Date(t).Format("yyyy-MM-dd hh:mm:ss");return e&&(r=new Date(t).Format(e)),r.toLocaleString()}function i(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 o(t){if(!t)return"2020-01-01";var e=new Date(t).Format("yyyy-MM-dd");return e.toLocaleString()}function s(t){if(!t)return"---";var e=new Date(t).Format("yyyy-MM-dd");return e.toLocaleString()}function u(t){var e=new Date;return e.setDate(e.getDate()+t),o(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 r in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+r+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[r]:("00"+e[r]).substr((""+e[r]).length)));return t}},e9bf:function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("div",{staticClass:"button-box clearflex"},[r("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dialogFormVisible=!0}}},[t._v("新增考试")])],1),r("div",{staticClass:"search-term"},[r("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:t.searchInfo}})],1),r("el-table",{attrs:{data:t.tableData,border:"",stripe:""}},[r("el-table-column",{attrs:{label:"序号",width:"70",prop:"examId"}}),r("el-table-column",{attrs:{label:"考试名字",prop:"name"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[n.edit?r("el-input",{staticClass:"edit-input",attrs:{size:"small"},model:{value:n.name,callback:function(e){t.$set(n,"name",e)},expression:"row.name"}}):r("span",[t._v(t._s(n.name))])]}}])}),r("el-table-column",{attrs:{label:"考题组",prop:"marks"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[n.edit?r("el-input",{attrs:{type:"textarea",size:"small"},model:{value:n.groupName,callback:function(e){t.$set(n,"groupName",e)},expression:"row.groupName"}}):r("span",[t._v(t._s(n.groupName))])]}}])}),r("el-table-column",{attrs:{label:"开始时间",prop:"startAt"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[n.edit?r("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd HH:mm",type:"datetime",align:"left"},model:{value:n.startAt,callback:function(e){t.$set(n,"startAt",e)},expression:"row.startAt"}}):r("span",[t._v(t._s(n.startAt))])]}}])}),r("el-table-column",{attrs:{label:"结束时间",prop:"endAt"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[n.edit?r("el-date-picker",{attrs:{"value-format":"yyyy-MM-dd HH:mm",type:"datetime",align:"left"},model:{value:n.endAt,callback:function(e){t.$set(n,"endAt",e)},expression:"row.endAt"}}):r("span",[t._v(t._s(n.endAt))])]}}])}),r("el-table-column",{attrs:{align:"center",width:"160px",label:"操作","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row,a=e.$index;return[n.edit?r("el-button",{attrs:{type:"success",size:"small",icon:"el-icon-circle-check"},on:{click:function(e){return t.confirmEdit(n,a)}}},[t._v("提交")]):t._e(),n.edit?r("el-button",{staticClass:"cancel-btn",attrs:{size:"small",icon:"el-icon-refresh",type:"warning"},on:{click:function(e){return t.cancelEdit(n,a)}}},[t._v("取消")]):t._e(),n.edit?t._e():r("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"},on:{click:function(e){return t.initEdit(n,a)}}},[t._v("编辑")])]}}])})],1),r("el-pagination",{style:{float:"right",padding:"20px"},attrs:{"current-page":t.page,"page-size":t.pageSize,"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}}),r("el-dialog",{attrs:{title:"新增分类",center:"",visible:t.dialogFormVisible},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[r("el-form",{ref:"elForm",attrs:{model:t.form,rules:t.rules,"label-width":"120px"}},[r("el-form-item",{attrs:{label:"考试的名字",prop:"name"}},[r("el-input",{staticClass:"user-form-item",attrs:{type:"text",clearable:""},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),r("el-form-item",{attrs:{label:"考题组",prop:"name"}},[r("drop-search",{staticClass:"user-form-item",attrs:{info:t.form.groupName,type:"group"},on:{select:t.okGroup}})],1),r("el-form-item",{attrs:{label:"开始时间",prop:"startTime"}},[r("el-date-picker",{attrs:{placeholder:"开始时间","value-format":"yyyy-MM-dd HH:mm",format:"yyyy-MM-dd HH:mm",type:"datetime",clearable:""},model:{value:t.form.startTime,callback:function(e){t.$set(t.form,"startTime",e)},expression:"form.startTime"}})],1),r("el-form-item",{attrs:{label:"时长[分钟]",prop:"name"}},[r("el-input",{staticClass:"user-form-item",attrs:{type:"number",clearable:""},model:{value:t.form.duration,callback:function(e){t.$set(t.form,"duration",e)},expression:"form.duration"}})],1)],1),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取 消")]),r("el-button",{attrs:{type:"primary"},on:{click:t.addExam}},[t._v("确 定")])],1)],1)],1)},a=[],i=r("1da1"),o=(r("b0c0"),r("96cf"),r("39f0")),s=r("c466"),u=r("a4a2"),c=r("ed08"),l=r("5f17"),d={name:"Api",data:function(){return{listApi:o["findExam"],dialogFormVisible:!1,dialogTitle:"新增广告",boolVal:[0,1],form:{name:"",startTime:"",groupId:0,groupName:"",duration:30},searchInfo:{},page:1,total:10,pageSize:10,tableData:[],rules:{name:[{required:!0,message:"请输入标题",trigger:"blur"}],groupName:[{required:!0,message:"请输入考题组",trigger:"blur"}],startTime:[{required:!0,message:"请输入开始时间",trigger:"blur"}],duration:[{required:!0,message:"请输入时长",trigger:"blur"}]}}},components:{DropSearch:l["default"]},mixins:[u["default"]],methods:{onSubmit:function(){this.page=1,this.pageSize=10,this.getTableData()},cancelEdit:function(t,e){t=Object.assign(t,t.temp),t.edit=!1,delete t["temp"]},initEdit:function(t,e){var r=Object.assign({},t);t.edit=!0,t.temp=r},doCreateCategory:function(){var t=this;this.$refs.addAd.validate(function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(r){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return");case 2:n=Object.assign({},t.form),n.starime=Object(s["toDatetime"])(n.end_time),n.counter=+n.counter,n.end_time=n.startTime+60*n.duration,createCategory(n).then((function(e){t.$message.successMsg("新增成功",1),t.dialogFormVisible=!1,t.getTableData()}));case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},confirmEdit:function(t){var e=this,r=Object.assign({},t);r.startTime=Object(c["str2time"])(r.startAt),r.counter=+r.counter,r.endTime=Object(c["str2time"])(r.endAt),delete r["temp"],Object(o["addExam"])(r).then((function(r){200==r.code&&(t.edit=!1,delete t["temp"],e.$message.successMsg("编辑成功",1))}))},handleSizeChange:function(t){this.pageSize=t,this.getTableData()},handleCurrentChange:function(t){this.page=t,this.getTableData()},okGroup:function(t){console.log("groupName",t),this.form.groupId=t.id,this.form.groupName=t.name},addExam:function(){var t=this;this.$refs["elForm"].validate((function(e){if(e){var r=Object.assign({},t.form);r.startTime=Object(c["str2time"])(r.startTime),r.counter=+r.counter,r.endTime=r.startTime+60*r.duration,Object(o["addExam"])(r).then((function(e){200==e.code&&t.$message.successMsg("新增成功",1)}))}}))}},filters:{toDatetime:s["toDatetime"]},created:function(){this.getTableData()}},f=d,m=(r("5c82"),r("2877")),p=Object(m["a"])(f,n,a,!1,null,"54f2a4c8",null);e["default"]=p.exports}}]);