(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-8d8468b2"],{"8bb6":function(e,t,n){},e831:function(e,t,n){"use strict";n("8bb6")},eaa4:function(e,t,n){"use strict";n.r(t);var s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"home-container"},[t("head-bar",{on:{back:e.back},scopedSlots:e._u([{key:"title",fn:function(){return[t("div",{staticClass:"navTitle"},[e._v("填写问卷")])]},proxy:!0}])}),t("div",{staticClass:"step_box"},[t("topicVue",{ref:"topicVue",attrs:{cJson:e.cJson,title:e.title,brief:e.brief,tid:e.tid},on:{"update:cJson":function(t){e.cJson=t},"update:c-json":function(t){e.cJson=t},getTestWorkByCid:e.getTestWorkByCid,publish2:e.publish2}})],1),t("div",{staticClass:"edit_top"},[t("div",{staticClass:"op_btn"},[t("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.publish}},[e._v("提交")])],1)])],1)},r=[],o=n("5530"),i=(n("14d9"),n("b64b"),n("e9c4"),n("4de4"),n("d3b7"),n("98e5")),a=n("71ed"),c=n("2f62"),u=n("bf3a"),f={components:{headBar:a["a"],topicVue:u["a"]},data:function(){return{courseid:"",cid:this.$route.query.courseid,userid:this.$route.query.userid,see:!1,tid:"",title:"",brief:"",look:"",cJson:[],cJson2:[]}},computed:Object(o["a"])({},Object(c["c"])(["userinfo"])),methods:{back:function(){this.$router.push({path:"/test"})},getData:function(){var e=this,t={cid:this.cid};Object(i["e"])(t).then((function(t){e.cJson=JSON.parse(t[0][0].chapters),e.cJson2=JSON.parse(t[0][0].chapters),e.title=t[0][0].title,e.brief=t[0][0].brief,e.see=1==t[0][0].open,e.testType=[];for(var n=0;n0||1==e.ttype}))),1==e.ttype&&e.json&&!e.json.answer2&&(e.json.answer2=[]),1!=e.ttype&&e.array.length>0||1==e.ttype}));return n},setCourseid:function(e){var t=this,n=e,s=n.filter((function(e){return e.array&&(e.array=e.array.filter((function(e){return 1==e.ttype&&e.json&&!e.json.answer2&&6!=e.type&&7!=e.type&&14!=e.type?e.json.answer2=[]:6==e.type?e.json.answer2=t.courseid?t.courseid:"":7==e.type&&(e.json.answer2=""),e.array&&(e.array=e.array.filter((function(n){return 1==n.ttype&&n.json&&!n.json.answer2&&6!=n.type&&7!=n.type&&14!=e.type?n.json.answer2=[]:6==n.type?n.json.answer2=t.courseid?t.courseid:"":7==n.type&&(n.json.answer2=""),n}))),1!=e.ttype&&e.array.length>0||1==e.ttype}))),1==e.ttype&&e.json&&!e.json.answer2&&6!=e.type&&6!=e.type&&7!=e.type&&14!=item2.type?e.json.answer2=[]:6==e.type?e.json.answer2=t.courseid?t.courseid:"":7==e.type&&(e.json.answer2=""),1!=e.ttype&&e.array.length>0||1==e.ttype}));return console.log("checkArray",s),s},JSONSetting:function(e){var t=e,n=[];return t.filter((function(e){return e.array&&(e.array=e.array.filter((function(e){return 1==e.ttype&&e.json&&n.push(e),e.array&&(e.array=e.array.filter((function(e){return 1==e.ttype&&e.json&&n.push(e),e}))),e}))),1==e.ttype&&e.json&&n.push(e),e})),n},setJSON:function(e){return e.filter((function(e){return e.array?e.array=e.array.filter((function(e){return 1==e.ttype&&e.json&&(delete e.json.answer2,delete e.json.score2,delete e.json.file),e.array&&(e.array=e.array.filter((function(e){return 1==e.ttype&&e.json&&(delete e.json.answer2,delete e.json.score2,delete e.json.file),e}))),e})):1==e.ttype&&e.json&&(delete e.json.answer2,delete e.json.score2,delete e.json.file),e}))},panJSON:function(e){for(var t=0,n=0;n0||s.answer2.length||"number"===typeof s.answer2)&&t++}return t>0},publish2:function(){var e=this;console.log("publish2");for(var t=this.$refs["topicVue"].checkArray,n=0;n60*a*1e3&&this.$toast.fail(n+1+"、"+s.json.title+"二维码已过期,请重新扫码打卡。")}}var c=this.JSONSetting(JSON.parse(JSON.stringify(t))),u=this.panJSON(c);if(u){var f=[{uid:this.tid?this.tid:this.userinfo.userid,cid:this.cid,cjson:encodeURIComponent(JSON.stringify(t)),type:"2"}];this.tid?Object(i["b"])(f).then((function(t){e.$message.success("保存成功")})).catch((function(e){console.error(e)})):Object(i["a"])(f).then((function(t){e.$message.success("保存成功")})).catch((function(e){console.error(e)}))}else setTimeout((function(){e.isloading=!1}),500)},publish:function(){var e=this;console.log("publish");for(var t=this.$refs["topicVue"].checkArray,n=0;n60*a*1e3&&this.$toast.fail(n+1+"、"+s.json.title+"二维码已过期,请重新扫码打卡。")}}var c=[{uid:this.tid?this.tid:this.userinfo.userid,cid:this.cid,cjson:encodeURIComponent(JSON.stringify(t)),type:2}];this.tid?Object(i["b"])(c).then((function(t){e.$message.success("提交成功"),e.back()})).catch((function(e){console.error(e)})):(console.log("shangchuan"),Object(i["a"])(c).then((function(t){e.$message.success("提交成功"),e.back()})).catch((function(e){console.error(e)})))}},mounted:function(){this.getData()}},l=f,p=(n("e831"),n("2877")),d=Object(p["a"])(l,s,r,!1,null,"0fb3e726",null);t["default"]=d.exports}}]);