(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d0bcf9d2"],{4630:function(t,e,a){"use strict";a("afeb")},"92fb":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{ref:"container",staticClass:"info-table"},[a("div",{staticClass:"fx align-items justify-between mt-15 mb-15 ml-10 mr-10"},[a("page-title",{attrs:{name:"通知管理"}}),a("div",{staticClass:"fx align-items"},[a("div",{staticClass:"ml-10 add-bg",on:{click:t.add}})])],1),a("el-table",{staticStyle:{width:"100%"},attrs:{data:t.tableData,"header-cell-class-name":"bg-f5","max-height":t.tableHeight}},[a("el-table-column",{attrs:{fixed:"",type:"index",label:"序号",align:"center",width:"200"}}),a("el-table-column",{attrs:{prop:"content",label:"文案"}}),a("el-table-column",{attrs:{label:"更新时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t.fromDate(e.row.createTime)))])]}}])}),a("el-table-column",{attrs:{fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"fx cursor"},[a("div",{staticClass:"update w-32 bg-f2 edit-bg",on:{click:function(a){return t.update(e.row)}}}),a("div",{staticClass:"ml-10 delete-bg",on:{click:function(a){return t.deleteSumbit(e.row)}}})])]}}])})],1),a("el-pagination",{staticClass:"pagination",attrs:{background:"","hide-on-single-page":!0,"current-page":t.currents.currentPage,"page-sizes":[10,20,30],"page-size":10,layout:"total, prev, pager, next, jumper",total:t.currents.currentTotal},on:{"current-change":t.handleCurrentChange}}),a("el-dialog",{attrs:{title:"公告管理",visible:t.dialogFormVisible,width:"490px"},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[a("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules}},[a("el-form-item",{attrs:{label:"公告文案","label-width":t.formLabelWidth,prop:"content"}},[a("el-input",{attrs:{clearable:"",type:"textarea",rows:10,placeholder:"请输入内容"},model:{value:t.form.content,callback:function(e){t.$set(t.form,"content",e)},expression:"form.content"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:t.clear}},[t._v("取 消")]),t.isAdd?a("el-button",{attrs:{type:"primary"},on:{click:t.addSumbit}},[t._v("确 定")]):a("el-button",{attrs:{type:"primary"},on:{click:t.updateSumbit}},[t._v("确 定")])],1)],1)],1)},i=[],s=(a("0d03"),{name:"index",data:function(){return{tableHeight:0,currents:{currentPage:1,currentTotal:0},ps:{pageNo:1,pageSize:10},search:"",tableData:[],form:{deleted:0,content:"",id:0,createTime:"",title:"",jumpType:"",jumpUrl:""},formLabelWidth:"160px",dialogFormVisible:!1,isAdd:!1,rules:{fakeMsg:[{required:!0,message:"请输入公告文案",trigger:"blur"}]}}},mounted:function(){this.getInfo(),this.calHeight()},methods:{calHeight:function(){var t=this;this.$nextTick((function(){var e=t.$refs.container.getBoundingClientRect();t.tableHeight=e.height-250}))},clear:function(){var t={deleted:0,content:"",id:0,createTime:"",title:"",jumpType:"",jumpUrl:""};this.form=Object.assign(this.form,t),this.dialogFormVisible=!1},add:function(){this.clear(),this.isAdd=!0,this.dialogFormVisible=!0},update:function(t){this.form=Object.assign(this.form,t),this.dialogFormVisible=!0,this.isAdd=!1},deleteSumbit:function(t){var e=this;this.form=Object.assign({},t),this.$confirm("此操作将永久删除该文件, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.$set(e.form,"deleted",1),e.updateInfo()}))["catch"]((function(){e.$message({type:"info",message:"已取消删除"})}))},getInfo:function(){var t=this,e={pageNum:this.ps.pageNo,pageSize:this.ps.pageSize};this.$axios("post","/backAnnouncement/getList",e).then((function(e){200===e.code&&(t.tableData=e.data.dataList,t.currents.currentTotal=e.data.countSize)}))},handleCurrentChange:function(t){this.ps.pageNo=t,this.getInfo()},addSumbit:function(){var t=this;this.$refs["form"].validate((function(e){if(!e)return!1;t.$delete(t.form,"id");var a=t.form;t.$axios("post","/backAnnouncement/editAnnouncement",a).then((function(e){200===e.code?(t.$message({type:"success",message:"新增成功!"}),t.getInfo(),t.clear()):t.$message({type:"warning",message:e.msg})}))}))},updateInfo:function(){var t=this,e=this.form;this.$axios("post","/backAnnouncement/editAnnouncement",e).then((function(e){200===e.code?(t.$message({type:"success",message:"操作成功!"}),t.getInfo(),t.clear()):t.$message({type:"warning",message:e.msg})}))},updateSumbit:function(){var t=this;this.$refs["form"].validate((function(e){if(!e)return!1;t.updateInfo()}))},fromDate:function(t){var e=new Date(t),a=e.getFullYear()+"-"+(e.getMonth()+1)+"-"+e.getDate()+" "+e.getHours()+":"+e.getMinutes()+":"+e.getSeconds();return a}}}),o=s,r=(a("4630"),a("2877")),l=Object(r["a"])(o,n,i,!1,null,"48f11ad2",null);e["default"]=l.exports},afeb:function(t,e,a){}}]);
//# sourceMappingURL=chunk-d0bcf9d2.91c5ff46.js.map