(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-3fc807ba"],{"0944":function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("section",[e._m(0),l("div",{staticClass:"content"},[l("div",{staticClass:"filter"},[l("el-form",{attrs:{size:"small","label-width":"70px",inline:!0,"label-position":"left"}},[l("el-form-item",{attrs:{label:""}},[l("el-input",{attrs:{clearable:"",placeholder:"请输入标题"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),l("el-form-item",[l("el-button",{attrs:{type:"primary"},on:{click:e.search}},[e._v("搜索")])],1),l("el-form-item",{staticStyle:{float:"right"}},[l("el-button",{attrs:{type:"primary"},on:{click:e.openDiag}},[e._v("发送消息")])],1)],1)],1),l("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"table",staticStyle:{width:"100%"},attrs:{data:e.list,height:"50vh",border:"","default-expand-all":"","row-key":"id"}},[l("el-table-column",{attrs:{prop:"name",label:"标题"}}),l("el-table-column",{attrs:{prop:"name",label:"附件"},scopedSlots:e._u([{key:"default",fn:function(t){return[l("a",{attrs:{href:t.row.fileurl,target:"_blank"}},[l("span",[e._v(e._s(t.row.filename))])])]}}])}),l("el-table-column",{attrs:{prop:"cname",label:"是否问卷"},scopedSlots:e._u([{key:"default",fn:function(t){return[l("a",{attrs:{target:"_blank"},on:{click:function(a){return e.showSurvey(t.row)}}},[l("span",[e._v("查看问卷")])]),t.row.template_qrcode?l("a",{attrs:{href:t.row.template_qrcode,target:"_blank"}},[l("span",[e._v(" | 生成二维码")])]):e._e()]}}])}),l("el-table-column",{attrs:{prop:"cname",label:"问卷统计"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.receiver_ids?l("span",[e._v("共统计:\n "),l("a",{attrs:{target:"_blank"}},[l("span",[e._v(e._s(t.row.receiver_ids.length))])]),e._v("人"),l("br")]):e._e(),e._v("\n 已完成:"),l("a",{attrs:{href:t.row.fileurl,target:"_blank"}},[l("span",[e._v("生成二维码")])]),e._v("人"),l("br"),t.row.receiver_ids?l("span",[e._v("未完成:"),l("a",{attrs:{href:t.row.fileurl,target:"_blank"}},[l("span",[e._v("生成二维码")])]),e._v("人"),l("br")]):e._e()]}}])}),l("el-table-column",{attrs:{prop:"cname",label:"发送者"}}),l("el-table-column",{attrs:{prop:"receiver_names",label:"接收者"}}),l("el-table-column",{attrs:{prop:"ctime",label:"发送时间"}}),l("el-table-column",{attrs:{prop:"zip",width:"150",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[l("el-button",{staticClass:"edit",attrs:{type:"text"},on:{click:function(a){return e.edit(t.row)}}},[e._v("编辑")]),l("el-button",{staticClass:"del",attrs:{type:"text"},on:{click:function(a){return e.del(t.row.id)}}},[e._v("删除")])]}}])})],1),l("Page",{ref:"pageButton",attrs:{current:e.form.page,page_size:e.form.page_size,total:e.total},on:{pageChange:e.gopage}})],1),l("el-dialog",{attrs:{title:e.dialogTitle,"close-on-click-modal":!1,visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t}}},[l("el-form",{ref:"form1",staticClass:"preview",attrs:{size:"small",inline:!1,"label-width":"80px",model:e.form1,rules:e.rules}},[l("el-form-item",{attrs:{label:"标题",prop:"name"}},[l("el-input",{attrs:{placeholder:"请输入标题"},model:{value:e.form1.name,callback:function(t){e.$set(e.form1,"name",t)},expression:"form1.name"}})],1),l("el-form-item",{attrs:{label:"接收人"}},[l("el-cascader",{attrs:{options:e.options,props:e.props,clearable:""},on:{change:e.handleChange},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.node,i=t.data;return[l("span",[e._v(e._s(i.label))]),a.isLeaf?e._e():l("span",[e._v(" ("+e._s(i.children.length)+") ")])]}}]),model:{value:e.form1.receiver_id,callback:function(t){e.$set(e.form1,"receiver_id",t)},expression:"form1.receiver_id"}})],1),l("el-form-item",{attrs:{label:"问卷模板"}},[l("el-select",{attrs:{placeholder:"请选择问卷模板",clearable:""},model:{value:e.form1.template_id,callback:function(t){e.$set(e.form1,"template_id",t)},expression:"form1.template_id"}},e._l(e.templateList,(function(e,t){return l("el-option",{key:t,attrs:{label:e.name,value:e.id}})})),1)],1),l("el-form-item",{attrs:{label:"附件"}},[l("input",{attrs:{id:"fileurl",type:"file"},on:{change:function(t){return e.upload("fileurl")}}}),l("a",{attrs:{href:e.form1.fileurl,target:"_blank"}},[l("span",[e._v(e._s(e.form1.filename))])])])],1),l("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[l("el-button",{attrs:{size:"small",type:"primary"},on:{click:e.save}},[e._v("确 定")])],1)],1),l("el-dialog",{attrs:{title:e.dialogTitle,"close-on-click-modal":!1,visible:e.dialogVisible1},on:{"update:visible":function(t){e.dialogVisible1=t}}},[l("div",{staticClass:"item-main"},[l("img",{staticClass:"survey_logo",attrs:{src:a("8278"),alt:""}}),l("h5",{staticClass:"tpl_title",attrs:{align:"center"}},[e._v(e._s(e.title))]),l("el-form",{ref:"form",staticClass:"tpl_form over_y",attrs:{model:e.form2}},[e._l(e.widgetList,(function(t,a){return l("el-form-item",{key:a,attrs:{label:t.label}},["input"==t.type?l("el-input",{attrs:{placeholder:t.placeholder},model:{value:e.form2[t.label],callback:function(a){e.$set(e.form2,t.label,a)},expression:"form2[item.label]"}}):e._e(),"textarea"==t.type?l("el-input",{attrs:{type:"textarea",placeholder:t.placeholder},model:{value:e.form2[t.label],callback:function(a){e.$set(e.form2,t.label,a)},expression:"form2[item.label]"}}):e._e(),"radio"==t.type?l("el-radio-group",{model:{value:e.form2[t.label],callback:function(a){e.$set(e.form2,t.label,a)},expression:"form2[item.label]"}},e._l(t.items,(function(t,a){return l("el-radio",{key:a,attrs:{label:t.label}},[e._v(e._s(t.label))])})),1):e._e(),"checkbox"==t.type?l("el-radio-group",{model:{value:e.form2[t.label],callback:function(a){e.$set(e.form2,t.label,a)},expression:"form2[item.label]"}},e._l(t.items,(function(t,a){return l("el-checkbox",{key:a,attrs:{label:t.label}},[e._v(e._s(t.label))])})),1):e._e(),"image"==t.type?l("el-upload",{attrs:{action:"https://jsonplaceholder.typicode.com/posts/","list-type":"picture-card","on-preview":e.handlePictureCardPreview,"on-remove":e.handleRemove}},[l("i",{staticClass:"el-icon-plus"})]):e._e(),"file"==t.type?l("el-upload",{ref:"upload",refInFor:!0,staticClass:"upload-demo",attrs:{action:"https://jsonplaceholder.typicode.com/posts/","on-preview":e.handlePreview,"on-remove":e.handleRemove,"file-list":e.fileList,"auto-upload":!1}},[l("el-button",{staticStyle:{"margin-left":"10px"},attrs:{size:"small",type:"primary",plain:""},on:{click:e.submitUpload}},[e._v("添加文件")])],1):e._e()],1)})),this.widgetList.length?l("el-form-item",[l("el-button",{staticStyle:{width:"100%"},attrs:{size:"medium",type:"primary"},on:{click:e.saveResult}},[e._v("提交")])],1):e._e()],2)],1)])],1)},i=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("p",[a("span",[e._v("信息管理>")]),e._v("消息管理")])}],s=(a("a450"),a("9973")),r={components:{Page:s["a"]},data:function(){return{widgetList:[],form:{name:"",page:1,page_size:20},form1:{},form2:{},total:1,list:[{name:"2333"}],loading:!1,input:"",dialogVisible:!1,dialogVisible1:!1,dialogTitle:"",defaultProps:{},data:[],templateList:[],userList:[],rules:{name:[{required:!0,message:"请输入标题",trigger:"blur"}]},props:{multiple:!0},options:[{value:1,label:"东南",children:[{value:2,label:"上海",children:[{value:3,label:"普陀"},{value:4,label:"黄埔"},{value:5,label:"徐汇"}]},{value:7,label:"江苏",children:[{value:8,label:"南京"},{value:9,label:"苏州"},{value:10,label:"无锡"}]},{value:12,label:"浙江",children:[{value:13,label:"杭州"},{value:14,label:"宁波"},{value:15,label:"嘉兴"}]}]},{value:17,label:"西北",children:[{value:18,label:"陕西",children:[{value:19,label:"西安"},{value:20,label:"延安"}]},{value:21,label:"新疆维吾尔族自治区",children:[{value:22,label:"乌鲁木齐"},{value:23,label:"克拉玛依"}]}]}]}},methods:{showSurvey:function(e){var t=this;this.title=e.name,this.message_id=e.id,this.$api.getTemplate({id:e.template_id}).then((function(e){0==e.data.code&&(t.widgetList=e.data.data.widget,t.dialogVisible1=!0)}))},upload:function(e){var t=this,a=document.getElementById(e).files,l=new FormData;l.append("file",a[0]),this.$api.uploadFile(l).then((function(a){0==a.data.code?(t.$set(t.form1,e,a.data.data.url),t.$set(t.form1,"filename",a.data.data.name),t.$message({message:"上传成功!",type:"success"})):t.$message.error(a.data.message)}))},handleChange:function(e){console.log(e)},search:function(){this.form;this.getData()},openDiag:function(){this.form1={},this.dialogVisible=!0,this.dialogTitle="发送消息"},gopage:function(e){e&&(this.form.page_size=e),this.form.page=this.$refs.pageButton.page,this.getData()},getData:function(){var e=this,t=this.form;this.loading=!0,this.$api.getAllTemplateList().then((function(t){e.templateList=t.data.data})),this.$api.getAllSysUserList().then((function(t){e.userList=t.data.data})),this.$api.getMessageList(t).then((function(t){e.list=t.data.data.list,e.total=t.data.data.total,e.loading=!1})),this.$api.getMessageReceiverList().then((function(t){e.options=t.data.data}))},del:function(e){var t=this;this.$confirm("确定删除吗","提示",{type:"warning"}).then((function(){t.$api.delMessageInfo({id:e}).then((function(e){t.$message({message:"删除成功",type:"success"}),t.getData()}))}))},edit:function(e){this.form1=e;var t=this.form1.receiver_id;console.log(t,33333333333333),"string"==typeof t&&(t=JSON.parse(t)),this.form1.receiver_id=t,this.dialogVisible=!0},saveResult:function(){var e=this,t={message_id:this.message_id,result:this.form2};this.$api.saveSurveyResult(t).then((function(t){0==t.data.code?e.$message({type:"success",message:"保存成功!"}):e.$message.error("保存失败!")}))},save:function(){var e=this;this.$refs["form1"].validate((function(t){if(t){var a=e.form1,l=e.form1.id;a.receiver_id=JSON.stringify(a.receiver_id),l?e.$api.editMessage(a).then((function(t){0==t.data.code?e.$message({type:"success",message:"保存成功!"}):e.$message.error("保存失败!")})):e.$api.addMessage(a).then((function(t){0==t.data.code?e.$message({type:"success",message:"保存成功!"}):e.$message.error("保存失败!")})),e.getData(),e.dialogVisible=!1}}))}},created:function(){this.getData()}},o=r,n=(a("fd23"),a("5d22")),c=Object(n["a"])(o,l,i,!1,null,null,null);t["default"]=c.exports},"129d":function(e,t,a){"use strict";a("a210")},"1b01":function(e,t,a){},8278:function(e,t,a){e.exports=a.p+"img/survey_logo.387bf80d.png"},9973:function(e,t,a){"use strict";var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-pagination",{attrs:{background:"","page-size":e.page_size?e.page_size:20,"current-page":e.current,"page-sizes":[10,20,30,40,50,60,70,80,90,100],layout:"total,sizes,prev, pager, next",total:e.total},on:{"current-change":e.getData,"size-change":e.handleSizeChange}})},i=[],s={data:function(){return{page:1}},props:{total:"",page_size:"",current:""},methods:{getData:function(e){this.page=e,this.$emit("pageChange")},handleSizeChange:function(e){this.$emit("pageChange",e)}},created:function(){}},r=s,o=(a("129d"),a("5d22")),n=Object(o["a"])(r,l,i,!1,null,null,null);t["a"]=n.exports},a210:function(e,t,a){},a450:function(e,t,a){var l=a("bb8b").f,i=Function.prototype,s=/^\s*function ([^ (]*)/,r="name";r in i||a("26df")&&l(i,r,{configurable:!0,get:function(){try{return(""+this).match(s)[1]}catch(e){return""}}})},fd23:function(e,t,a){"use strict";a("1b01")}}]); //# sourceMappingURL=chunk-3fc807ba.b11d9132.js.map