webpackJsonp([2],{HcUk:function(t,e){},jRE0:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={data:function(){return{tableData:[],tableHeight:500,isLoading:!1,page:1,total:0,dialogVisible1:!1,itemCount:1,askTitle:"",askJson:[{askstitle:"",askItem:1,checkList:[]}],radio:[],userid:this.$route.query.userid}},methods:{handleClose:function(t){t()},goTo:function(t){this.$router.push(t)},deleteAsk:function(t){var e=this,a=[{id:t}];this.$confirm("确定删除此学生的问卷吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.ajax.post(e.$store.state.api+"deleteAskList",a).then(function(t){e.$message({message:"删除成功",type:"success"}),1!=e.page&&1==e.tableData.length&&e.page--,e.getAsk()}).catch(function(t){e.$message.error("删除失败"),console.error(t)})}).catch(function(){})},handleCurrentChange:function(t){this.page=t,this.getAsk()},getAsk:function(){var t=this;this.isLoading=!0;var e={uid:this.userid,page:this.page};this.ajax.get(this.$store.state.api+"getAskList",e).then(function(e){t.isLoading=!1,t.total=e.data[0].length>0?e.data[0][0].num:0,t.tableData=e.data[0]}).catch(function(e){t.dialogVisible=!1,console.error(e)})},getAskList:function(t){this.askTitle=t.title,this.askJson=JSON.parse(t.askContent),this.radio=t.content.split(","),this.itemCount=this.askJson.length,this.dialogVisible1=!0},changeHeight:function(){this.tableHeight=window.innerHeight-this.$refs.table.$el.offsetTop-200,this.tableHeight<=530&&(this.tableHeight=530);var t=this;window.onresize=function(){t.tableHeight=window.innerHeight-t.$refs.table.$el.offsetTop-200,t.tableHeight<=530&&(t.tableHeight=530)}}},created:function(){this.$nextTick(function(){this.page=1,this.changeHeight(),this.getAsk()})}},s={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"pb_content"},[t._m(0),t._v(" "),a("div",{staticClass:"pb_content_body"},[a("div",{staticClass:"cd_bread"},[a("el-breadcrumb",{attrs:{"separator-class":"el-icon-arrow-right"}},[a("el-breadcrumb-item",{attrs:{to:{path:"/ask?userid="+t.userid}}},[t._v("问卷调查")]),t._v(" "),a("el-breadcrumb-item",[t._v("查看已经提交的问卷")])],1)],1),t._v(" "),a("div",{staticClass:"student_table"},[a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.isLoading,expression:"isLoading"}],ref:"table",staticStyle:{width:"100%",height:"60%"},attrs:{data:t.tableData,border:"",stripe:"",height:t.tableHeight,fit:!0,"header-cell-style":{background:"#f1f1f1"}}},[a("el-table-column",{attrs:{prop:"title",label:"问卷调查标题","min-width":"25",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"name",label:"提交者","min-width":"25",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{prop:"time",label:"提交时间","min-width":"25",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"25"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.getAskList(e.row)}}},[t._v("查看")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.deleteAsk(e.row.id)}}},[t._v("删除")])]}}])})],1)],1),t._v(" "),a("div",{staticClass:"student_page"},[a("el-pagination",{attrs:{background:"",layout:"prev, pager, next","page-size":10,total:t.total},on:{"current-change":t.handleCurrentChange}})],1)]),t._v(" "),a("el-dialog",{staticClass:"dialog_diy",attrs:{title:"查看",visible:t.dialogVisible1,"append-to-body":!0,width:"750px","before-close":t.handleClose},on:{"update:visible":function(e){t.dialogVisible1=e}}},[a("div",[a("div",{staticClass:"a_add_title"},[a("h1",[t._v(t._s(t.askTitle))])]),t._v(" "),a("div",{staticClass:"a_addBox"},t._l(t.itemCount,function(e,i){return a("div",{key:i,staticClass:"a_add_box"},[a("div",{staticClass:"a_add_head"},[a("div",[a("span",[t._v(t._s(i+1+"、"+t.askJson[i].askstitle))])])]),t._v(" "),a("div",{staticClass:"a_add_body"},[a("div",{staticClass:"a_add_input"},[a("el-radio-group",{model:{value:t.radio[i],callback:function(e){t.$set(t.radio,i,e)},expression:"radio[index]"}},t._l(t.askJson[i].askItem,function(e,s){return a("el-radio",{key:s,staticStyle:{width:"150px",margin:"10px 10px 0 0"},attrs:{label:s+1+"",disabled:""}},[t._v(t._s(t.askJson[i].checkList[s]))])}),1)],1)])])}),0)]),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.dialogVisible1=!1}}},[t._v("关 闭")])],1)])],1)},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"pb_head"},[e("span",[this._v("问卷调查")])])}]};var n=a("VU/8")(i,s,!1,function(t){a("HcUk")},"data-v-fa430b90",null);e.default=n.exports}}); //# sourceMappingURL=2.94e1427bfc7ef0b4c685.js.map