1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-40717ac2","chunk-f6657b32","chunk-2d0bb266","chunk-2d0ac361","chunk-2d216ba7","chunk-2d0a4474","chunk-2d0a4856"],{"0680":function(t,e,n){"use strict";n.r(e),n.d(e,"getDict",(function(){return l}));var a=n("1da1"),r=(n("96cf"),n("4360")),l=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)}}()},"0792":function(t,e,n){"use strict";n.r(e);var a=/^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W_]+$)(?![a-z0-9]+$)(?![a-z\W_]+$)(?![0-9\W_]+$)[a-zA-Z0-9\W_]{8,30}$/,r=/^[1][3-9][0-9]{9}$/,l=/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/,i=/(^[1-9]([0-9] )?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/,o=/^([1-9]{1})(\d{14}|\d{18})$/,s=function(t,e){return function(n,a,r){""===a||a!==t?r(new Error(e)):r()}};e["default"]={cardPat:l,phonePat:r,passwordPat:a,feePat:i,bandPat:o,passwordItem:[{required:!0,message:"请输入密码",trigger:"blur"},{pattern:a,message:"密码为数字,小写字母,大写字母,特殊符号 至少包含三种,长度为 8 - 30位"}],defaultFun:function(t){return[{required:!0,message:t,trigger:"blur"}]},defaultNum:function(t){return[{required:!0,message:t,trigger:"blur"}]},eqItem:function(t,e){return[{required:!0,validator:s(e),trigger:"blur"}]},bandItem:[{required:!0,message:"请输入银行卡号",trigger:"blur"},{pattern:l,message:"请输入正确的银行卡号"}],cardItem:[{required:!0,message:"请输入身份证号码",trigger:"blur"},{pattern:l,message:"请输入正确的身份证号码"}],phoneItem:[{required:!0,message:"请输入手机",trigger:"blur"},{pattern:r,message:"请输入正确的手机号码"}]}},1925:function(t,e,n){"use strict";n.r(e),n.d(e,"searchApi",(function(){return r}));var a=n("b775"),r=function(t){return Object(a["default"])({url:"/admin/search",method:"post",data:t})}},"2ebb":function(t,e,n){"use strict";n("5e60")},"39f0":function(t,e,n){"use strict";n.r(e),n.d(e,"findExam",(function(){return r})),n.d(e,"addExam",(function(){return l})),n.d(e,"getWxGroupList",(function(){return i})),n.d(e,"getWxUserGroupList",(function(){return o})),n.d(e,"getWxAnswerList",(function(){return s})),n.d(e,"postData",(function(){return u}));var a=n("b775"),r=function(t){return Object(a["default"])({url:"/admin/findExam",method:"post",data:t})},l=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})},s=function(t){return Object(a["default"])({url:"/admin/getWxAnswerList",method:"post",data:t})},u=function(t,e){return Object(a["default"])({url:"/admin/".concat(t),method:"post",data:e})}},5070: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("div",{staticClass:"button-box clearflex"},[n("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dialogFormVisible=!0}}},[t._v("新增")])],1),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),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]))])]}}])}),n("el-table-column",{attrs:{label:"题目",prop:"name","min-width":"200"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[a.edit?n("el-input",{staticClass:"edit-input",attrs:{size:"small"},model:{value:a.title,callback:function(e){t.$set(a,"title",e)},expression:"row.title"}}):n("span",[t._v(t._s(a.title))])]}}])}),n("el-table-column",{attrs:{label:"1选项",prop:"marks"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[a.edit?n("el-input",{attrs:{type:"textarea",size:"small"},model:{value:a.answer1,callback:function(e){t.$set(a,"answer1",e)},expression:"row.answer1"}}):n("span",[t._v(t._s(a.answer1))])]}}])}),n("el-table-column",{attrs:{label:"2选项",prop:"marks"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[a.edit?n("el-input",{attrs:{type:"textarea",size:"small"},model:{value:a.answer2,callback:function(e){t.$set(a,"answer2",e)},expression:"row.answer2"}}):n("span",[t._v(t._s(a.answer2))])]}}])}),n("el-table-column",{attrs:{label:"3选项",prop:"marks"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[a.edit?n("el-input",{attrs:{type:"textarea",size:"small"},model:{value:a.answer3,callback:function(e){t.$set(a,"answer3",e)},expression:"row.answer3"}}):n("span",[t._v(t._s(a.answer3))])]}}])}),n("el-table-column",{attrs:{label:"4选项",prop:"marks"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[a.edit?n("el-input",{attrs:{type:"textarea",size:"small"},model:{value:a.answer4,callback:function(e){t.$set(a,"answer4",e)},expression:"row.answer4"}}):n("span",[t._v(t._s(a.answer4))])]}}])}),n("el-table-column",{attrs:{label:"5选项",prop:"marks"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[a.edit?n("el-input",{attrs:{type:"textarea",size:"small"},model:{value:a.answer4,callback:function(e){t.$set(a,"answer4",e)},expression:"row.answer4"}}):n("span",[t._v(t._s(a.answer5))])]}}])}),n("el-table-column",{attrs:{label:"答案",prop:"marks",width:"60"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[a.edit?n("el-input",{attrs:{type:"textarea",size:"small"},model:{value:a.result,callback:function(e){t.$set(a,"result",e)},expression:"row.result"}}):n("span",[t._v(t._s(a.result))])]}}])}),n("el-table-column",{attrs:{label:"解答",prop:"content",width:"90",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[a.edit?n("el-input",{attrs:{type:"textarea",size:"small"},model:{value:a.content,callback:function(e){t.$set(a,"content",e)},expression:"row.content"}}):n("el-button",{attrs:{type:"text",size:"small"},on:{click:function(e){return t.showDetail(a)}}},[t._v("题目解答")])]}}])}),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[a.edit?n("el-button",{attrs:{type:"success",size:"small",icon:"el-icon-circle-check"},on:{click:function(e){return t.confirmEdit(a,r)}}},[t._v("提交")]):t._e(),a.edit?n("el-button",{staticClass:"cancel-btn",attrs:{size:"small",icon:"el-icon-refresh",type:"warning"},on:{click:function(e){return t.cancelEdit(a,r)}}},[t._v("取消")]):t._e(),a.edit?t._e():n("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit"},on:{click:function(e){return t.initEdit(a,r)}}},[t._v("编辑")])]}}])})],1),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}}),n("el-dialog",{attrs:{title:"新增题库",center:"",visible:t.dialogFormVisible},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[n("el-form",{ref:"elForm",attrs:{model:t.form,rules:t.rules,"label-width":"120px"}},[n("el-form-item",{attrs:{label:"选择题型",prop:"type"}},[n("el-select",{staticClass:"input_select",attrs:{clearable:""},model:{value:t.form.type,callback:function(e){t.$set(t.form,"type",e)},expression:"form.type"}},t._l(t.typeOption,(function(t,e){return n("el-option",{key:e,attrs:{label:t,value:e}})})),1)],1),n("el-form-item",{attrs:{label:"题目",prop:"title"}},[n("el-input",{attrs:{type:"textarea",clearable:""},model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1),n("el-form-item",{attrs:{label:"答案1",prop:"answer1"}},[n("el-input",{attrs:{type:"textarea",clearable:""},model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1),n("el-form-item",{attrs:{label:"答案2",prop:"answer2"}},[n("el-input",{attrs:{type:"textarea",clearable:""},model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1),t.form.type<3?n("el-form-item",{attrs:{label:"答案3",prop:"answer3"}},[n("el-input",{attrs:{type:"textarea",clearable:""},model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1):t._e(),t.form.type<3?n("el-form-item",{attrs:{label:"答案4",prop:"answer4"}},[n("el-input",{attrs:{type:"textarea",clearable:""},model:{value:t.form.title,callback:function(e){t.$set(t.form,"title",e)},expression:"form.title"}})],1):t._e(),n("el-form-item",{attrs:{label:"结果",prop:"result"}},[n("el-input",{attrs:{type:"number",clearable:""},model:{value:t.form.result,callback:function(e){t.$set(t.form,"result",e)},expression:"form.result"}})],1),n("el-form-item",{attrs:{label:"解答",prop:"content"}},[n("el-input",{attrs:{type:"textarea",clearable:""},model:{value:t.form.content,callback:function(e){t.$set(t.form,"content",e)},expression:"form.content"}})],1)],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取 消")]),n("el-button",{attrs:{type:"primary"},on:{click:t.doAddAction}},[t._v("确 定")])],1)],1),n("el-dialog",{staticStyle:{padding:"0px"},attrs:{align:"center",title:"题目解答","close-on-click-modal":!1,visible:t.msgDialog,"show-close":!1,width:"80%"},on:{"update:visible":function(e){t.msgDialog=e},close:function(e){t.msgDialog=!1}}},[n("div",{staticClass:"tl"},[n("codemirror",{attrs:{value:t.form.content,options:t.options}})],1),n("div",{staticClass:"dialog-footer tc",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.msgDialog=!1}}},[t._v("取消编辑")]),n("el-button",{attrs:{type:"primary"},on:{click:t.updateContent}},[t._v("提交详解 ")])],1)])],1)},r=[],l=(n("a434"),n("39f0")),i=n("c466"),o=n("a4a2"),s=(n("ed08"),n("0792")),u=n("5f17"),c=n("8f94"),d=(n("a7be"),n("acdf"),n("db91"),{name:"Api",data:function(){return{listApi:l["getWxAnswerList"],dialogFormVisible:!1,msgDialog:!1,dialogTitle:"新增广告",form:{type:"",result:1,title:"",answer1:"",answer2:"",answer3:"",answer4:"",content:"",temp:{}},options:{tabSize:2,theme:"monokai",lineNumbers:!0,line:!0,lineWrapping:!0,styleActiveLine:!0,hintOptions:{completeSingle:!0}},typeOption:{1:"单选",2:"多选",3:"判断"},rules:{title:s["default"].defaultFun("请输入标题"),type:s["default"].defaultFun("请选择题型"),result:s["default"].defaultFun("请输入答案"),answer1:s["default"].defaultFun("请输入选项1"),answer2:s["default"].defaultFun("请输入选项2"),answer3:s["default"].defaultFun("请输入选项3"),answer4:s["default"].defaultFun("请输入选项4"),content:s["default"].defaultFun("请输入解答")}}},watch:{"searchInfo.title":function(t){this.page=1,this.getTableData()}},components:{DropSearch:u["default"],codemirror:c["codemirror"]},mixins:[o["default"]],methods:{doAddAction:function(){var t=this,e=Object.assign({},this.form);e.result=+e.result,e.type=+e.type,Object(l["postData"])("addWxAnswer",e).then((function(e){200==e.code&&(t.$message.successMsg("编辑成功",1),t.getTableData())}))},showDetail:function(t){this.form=Object.assign({},t),this.form.temp=t,this.msgDialog=!0},cancelEdit:function(t,e){t=Object.assign(t,t.temp),t.edit=!1,delete t["temp"]},initEdit:function(t,e){var n=Object.assign({},t);t.edit=!0,t.temp=n},confirmEdit:function(t){var e=this,n=Object.assign({},t);n.result=+n.result,n.type=+n.type,delete n["temp"],Object(l["postData"])("addWxAnswer",n).then((function(n){200==n.code&&(t.edit=!1,delete t["temp"],e.$message.successMsg("编辑成功",1))}))},updateContent:function(){this.confirmEdit(this.form)},okPhone:function(t){this.form.groupId=+t.group_id},deleteRow:function(t,e){var n=this,a={id:t.id};Object(l["postData"])("delWxUserGroup",a).then((function(t){200==t.code&&(n.$message.successMsg("删除成功",1),n.tableData.splice(e,1))}))}},filters:{toDatetime:i["toDatetime"]},created:function(){this.getTableData()}}),f=d,p=(n("2ebb"),n("2877")),m=Object(p["a"])(f,a,r,!1,null,"19e6759b",null);e["default"]=m.exports},"5e60":function(t,e,n){},a4a2:function(t,e,n){"use strict";n.r(e);var a=n("5530"),r=n("1da1"),l=(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(l["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,l,i,o,s;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,l=t.length>1&&void 0!==t[1]?t[1]:e.size,i=(r-1)*l,o=Object(a["a"])({size:l,from:i},e.searchInfo),n.next=6,e.listApi(o);case 6:s=n.sent,200==s.code&&(e.tableData=s.data.list.map((function(t){return t.edit=!1,t._selected=!1,t})),e.total=s.data.total);case 8:case"end":return n.stop()}}),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 l})),n.d(e,"toDate",(function(){return i})),n.d(e,"toDateShow",(function(){return o})),n.d(e,"getDate",(function(){return s}));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 l(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 s(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}}}]);
|