(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-edeb7ee0"],{"129d":function(t,e,a){"use strict";a("a210")},5155:function(t,e,a){"use strict";a("ae08")},7685:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("section",[t._m(0),a("div",{staticClass:"content"},[a("div",{staticClass:"filter"},[a("el-form",{attrs:{size:"small","label-width":"70px",inline:!0,"label-position":"left"}},[a("el-form-item",{attrs:{label:""}},[a("el-input",{attrs:{clearable:"",placeholder:"请输入您要搜索的内容"},on:{clear:t.search},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.search(e)}},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.search}},[t._v("搜索")])],1),a("el-form-item",{staticStyle:{float:"right"}},[a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.dialogVisible=!0,t.dialogTitle="新增模板",t.form1={name:""}}}},[t._v("新增模板")])],1)],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"table",staticStyle:{width:"100%"},attrs:{data:t.list,height:"50vh",border:"","default-expand-all":"","row-key":"id"}},[a("el-table-column",{attrs:{prop:"name",label:"模板名称"}}),a("el-table-column",{attrs:{prop:"cname",label:"创建人"}}),a("el-table-column",{attrs:{prop:"ctime",label:"创建时间"}}),a("el-table-column",{attrs:{prop:"zip",width:"250",label:"操作"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.edit?a("el-button",{staticClass:"edit",attrs:{type:"text"},on:{click:function(a){return t.edit(e.row)}}},[t._v("编辑")]):a("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:"该模版使用的问卷正在被填报,无法修改,可新增模版-选择复用历史模版使用该模版或删除正在使用该模版的问卷!",placement:"top-start"}},[a("el-button",{staticClass:"edit",staticStyle:{color:"#ccc",cursor:"not-allowed"},attrs:{type:"text"}},[t._v("编辑")])],1),a("el-button",{staticClass:"del",attrs:{type:"text"},on:{click:function(a){return t.del(e.row.id)}}},[t._v("删除")])]}}])})],1),a("Page",{ref:"pageButton",attrs:{current:t.form.page,page_size:t.form.page_size,total:t.total},on:{pageChange:t.gopage}})],1),a("el-dialog",{attrs:{title:t.dialogTitle,"close-on-click-modal":!1,visible:t.dialogVisible},on:{"update:visible":function(e){t.dialogVisible=e}}},[a("el-form",{ref:"form1",staticClass:"preview",attrs:{size:"small",inline:!1,"label-width":"100px",rules:t.rules,model:t.form1}},[t.form1.id?t._e():a("el-form-item",{attrs:{label:"复用历史模板"}},[a("el-select",{attrs:{filterable:"",placeholder:"请选择历史模板"},on:{change:t.changeTemplate},model:{value:t.form1.copyid,callback:function(e){t.$set(t.form1,"copyid",e)},expression:"form1.copyid"}},t._l(t.allTemplate,(function(t,e){return a("el-option",{key:e,attrs:{label:t.name,value:t.id}})})),1)],1),a("el-form-item",{attrs:{label:"模板名称",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入模板名称",maxlength:"50","show-word-limit":""},model:{value:t.form1.name,callback:function(e){t.$set(t.form1,"name",e)},expression:"form1.name"}})],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small",type:"primary"},on:{click:t.addTtitle}},[t._v("确 定")])],1)],1)],1)},l=[function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("p",[a("span",[t._v("信息管理>")]),t._v("问卷模板")])}],n=(a("a450"),a("9973")),o={components:{Page:n["a"]},data:function(){return{allTemplate:[],form:{name:"",page:1,page_size:20},form1:{copyid:null,name:""},total:1,list:[],loading:!1,input:"",dialogVisible:!1,dialogTitle:"",defaultProps:{},data:[],rules:{name:[{required:!0,message:"请输入标题",trigger:"blur"}]}}},methods:{switchStatus:function(t){this.$api.editTemplateStatus({id:t.id}).then((function(e){t.status=e.data.data}))},changeTemplate:function(t){var e=this.allTemplate.filter((function(e){return e.id==t}));this.form1.name=e[0].name},addTtitle:function(){var t=this;this.$refs["form1"].validate((function(e){if(e){var a={title:t.form1.name,id:t.form1.id};t.form1.copyid&&(a.id=t.form1.copyid,a.copyid=t.form1.copyid),t.$router.push({path:"/message/template/add",query:a})}}))},search:function(){this.form;this.getData()},getData:function(){var t=this,e=this.form;this.loading=!0,this.$api.getTemplateList(e).then((function(e){t.list=e.data.data.list,t.total=e.data.data.total,t.loading=!1})),this.$api.getAllTemplateList().then((function(e){t.allTemplate=e.data.data}))},edit:function(t){var e=this;this.$api.getTemplate({id:t.id}).then((function(t){e.form1=t.data.data,e.dialogVisible=!0}))},del:function(t){var e=this;this.$confirm("删除模板与模板相关联的消息会被一起删除,确定删除吗?","提示",{type:"warning"}).then((function(){e.$api.delTemplate({id:t}).then((function(t){e.$message({message:"删除成功",type:"success"}),e.getData()}))}))},gopage:function(t){t&&(this.form.page_size=t),this.form.page=this.$refs.pageButton.page,this.getData()}},created:function(){this.getData()}},r=o,s=(a("5155"),a("5d22")),c=Object(s["a"])(r,i,l,!1,null,null,null);e["default"]=c.exports},9973:function(t,e,a){"use strict";var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-pagination",{attrs:{background:"","page-size":t.page_size?t.page_size:20,"current-page":t.current,"page-sizes":[10,20,30,40,50,60,70,80,90,100],layout:"total,sizes,prev, pager, next",total:t.total},on:{"current-change":t.getData,"size-change":t.handleSizeChange}})},l=[],n={data:function(){return{page:1}},props:{total:"",page_size:"",current:""},methods:{getData:function(t){this.page=t,this.$emit("pageChange")},handleSizeChange:function(t){this.$emit("pageChange",t)}},created:function(){}},o=n,r=(a("129d"),a("5d22")),s=Object(r["a"])(o,i,l,!1,null,null,null);e["a"]=s.exports},a210:function(t,e,a){},a450:function(t,e,a){var i=a("bb8b").f,l=Function.prototype,n=/^\s*function ([^ (]*)/,o="name";o in l||a("26df")&&i(l,o,{configurable:!0,get:function(){try{return(""+this).match(n)[1]}catch(t){return""}}})},ae08:function(t,e,a){}}]); //# sourceMappingURL=chunk-edeb7ee0.d8a95c03.js.map