(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-50308aa7","chunk-2d0d6ef5"],{7556:function(e,t,s){"use strict";s.r(t);var i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("el-dialog",{attrs:{title:e.isUpdate?"修改系统消息":"添加系统消息",visible:e.visible,width:"600px","destroy-on-close":!0,"lock-scroll":!1},on:{"update:visible":e.updateVisible}},[s("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"82px"}},[s("el-form-item",{attrs:{label:"标题:",prop:"title"}},[s("el-input",{attrs:{placeholder:"请输入标题",clearable:""},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title",t)},expression:"form.title"}})],1),s("el-form-item",{attrs:{label:"发送给:"}},[s("el-select",{staticClass:"ele-fluid",attrs:{placeholder:"请选择接受人",clearable:"",filterable:"","reserve-keyword":"","filter-method":e.searchUserLists},model:{value:e.form.receve_id,callback:function(t){e.$set(e.form,"receve_id",t)},expression:"form.receve_id"}},e._l(e.users,(function(t){return s("el-option",{key:t.id,attrs:{label:t.name,value:t.id}},[s("span",{staticStyle:{"padding-left":"8px"}},[e._v(e._s(t.name))])])})),1)],1),s("el-form-item",{attrs:{label:"内容:"}},[s("el-input",{attrs:{placeholder:"请输入内容",rows:6,type:"textarea"},model:{value:e.form.content,callback:function(t){e.$set(e.form,"content",t)},expression:"form.content"}})],1)],1),s("div",{attrs:{slot:"footer"},slot:"footer"},[s("el-button",{on:{click:function(t){return e.updateVisible(!1)}}},[e._v("取消 ")]),s("el-button",{attrs:{type:"primary",loading:e.loading},on:{click:e.save}},[e._v("保存 ")])],1)],1)},a=[],r=(s("b0c0"),{name:"MessageEdit",props:{visible:Boolean,data:Object},data:function(){return{form:Object.assign({},this.data),rules:{title:[{required:!0,message:"请输入标题",trigger:"blur"}],content:[{required:!0,message:"请输入内容",trigger:"blur"}]},loading:!1,isUpdate:!1,users:[{id:-1,name:"所有人"}]}},watch:{data:function(){if(this.data){if(this.form=Object.assign({},this.data),this.data.receve_id>0){var e=[{id:-1,name:"所有人"}],t={};t.id=this.data.receve_id,t.name=this.data.receve_user_str,e.push(t),this.users=e}else this.users=[{id:-1,name:"所有人"}];this.isUpdate=!0}else this.form={},this.isUpdate=!1}},methods:{save:function(){var e=this;this.$refs["form"].validate((function(t){if(!t)return!1;e.loading=!0,e.$http[e.isUpdate?"put":"post"]("/message/"+(e.isUpdate?"edit":"add"),e.form).then((function(t){e.loading=!1,0===t.data.code?(e.$message({type:"success",message:t.data.msg}),e.isUpdate||(e.form={}),e.updateVisible(!1),e.$emit("done")):e.$message.error(t.data.msg)})).catch((function(t){e.loading=!1,e.$message.error(t.message)}))}))},searchUserLists:function(e){var t=this;if(e)this.$http.get("/manager/index?truename="+e).then((function(e){if(0===e.data.code){var s=[],i={id:-1,name:"所有人"};s.push(i);for(var a=e.data.data,r=0;r0&&(i={},i.id=this.form.receve_id,i.name=this.form.receve_user_str,s.push(i)),this.users=s}},updateVisible:function(e){this.$emit("update:visible",e)}}}),n=r,l=s("2877"),o=Object(l["a"])(n,i,a,!1,null,"03924f31",null);t["default"]=o.exports},b75a:function(e,t,s){"use strict";s.r(t);var i=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"ele-body"},[s("el-card",{attrs:{shadow:"never"}},[s("el-form",{staticClass:"ele-form-search",attrs:{model:e.where,"label-width":"77px"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.reload(t)},submit:function(e){e.preventDefault()}}}),s("ele-pro-table",{ref:"table",attrs:{datasource:e.url,columns:e.columns,where:e.where,selection:e.selection},on:{"update:selection":function(t){e.selection=t}},scopedSlots:e._u([{key:"status",fn:function(t){var i=t.row;return[s("el-switch",{attrs:{"active-value":1,"inactive-value":0},on:{change:function(t){return e.editStatus(i)}},model:{value:i.status,callback:function(t){e.$set(i,"status",t)},expression:"row.status"}})]}},{key:"action",fn:function(t){var i=t.row;return[s("el-link",{attrs:{icon:"el-icon-edit",type:"primary",underline:!1},on:{click:function(t){return e.openEdit(i)}}},[e._v("修改 ")])]}}])},[s("template",{slot:"toolbar"},[s("el-button",{staticClass:"ele-btn-icon",attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:function(t){return e.openEdit(null)}}},[e._v("添加 ")])],1)],2)],1),s("message-edit",{attrs:{visible:e.showEdit,data:e.current},on:{"update:visible":function(t){e.showEdit=t},done:e.reload}})],1)},a=[],r=s("7556"),n={name:"SystemMessage",components:{MessageEdit:r["default"]},data:function(){return{url:"/message/index",columns:[{columnKey:"selection",type:"selection",width:45,align:"center",fixed:"left"},{columnKey:"index",type:"index",width:45,align:"center",fixed:"left",showOverflowTooltip:!0},{prop:"title",label:"标题",sortable:!1,showOverflowTooltip:!0,minWidth:110},{prop:"content",label:"内容",sortable:!1,showOverflowTooltip:!0,minWidth:70},{prop:"receve_user_str",label:"收信人",sortable:!1,showOverflowTooltip:!0,minWidth:110},{prop:"create_time",label:"创建时间",sortable:!1,showOverflowTooltip:!0,minWidth:110},{prop:"read_status_str",label:"读取状态",align:"center",sortable:!1,width:80},{columnKey:"action",label:"操作",width:230,align:"center",resizable:!1,slot:"action"}],where:{},selection:[],current:null,showEdit:!1,showAuth:!1}},methods:{reload:function(){this.$refs.table.reload({page:1})},reset:function(){var e=this;this.where={},this.$nextTick((function(){e.reload()}))},openEdit:function(e){this.current=e,this.showEdit=!0}}},l=n,o=s("2877"),c=Object(o["a"])(l,i,a,!1,null,"e1bdf090",null);t["default"]=c.exports}}]);