(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0b1626"],{"202d":function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("el-form",{directives:[{name:"show",rawName:"v-show",value:e.showSearch,expression:"showSearch"}],ref:"queryForm",attrs:{model:e.queryParams,size:"small",inline:!0,"label-width":"68px"}},[i("el-form-item",{attrs:{label:"公告标题",prop:"noticeTitle"}},[i("el-input",{attrs:{placeholder:"请输入公告标题",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.noticeTitle,callback:function(t){e.$set(e.queryParams,"noticeTitle",t)},expression:"queryParams.noticeTitle"}})],1),i("el-form-item",{attrs:{label:"操作人员",prop:"createBy"}},[i("el-input",{attrs:{placeholder:"请输入操作人员",clearable:""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery(t)}},model:{value:e.queryParams.createBy,callback:function(t){e.$set(e.queryParams,"createBy",t)},expression:"queryParams.createBy"}})],1),i("el-form-item",{attrs:{label:"类型",prop:"noticeType"}},[i("el-select",{attrs:{placeholder:"公告类型",clearable:""},model:{value:e.queryParams.noticeType,callback:function(t){e.$set(e.queryParams,"noticeType",t)},expression:"queryParams.noticeType"}},e._l(e.dict.type.sys_notice_type,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),i("el-form-item",[i("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:e.handleQuery}},[e._v("搜索")]),i("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:e.resetQuery}},[e._v("重置")])],1)],1),i("el-row",{staticClass:"mb8",attrs:{gutter:10}},[i("el-col",{attrs:{span:1.5}},[i("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:notice:add"],expression:"['system:notice:add']"}],attrs:{type:"primary",plain:"",icon:"el-icon-plus",size:"mini"},on:{click:e.handleAdd}},[e._v("新增")])],1),i("el-col",{attrs:{span:1.5}},[i("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:notice:edit"],expression:"['system:notice:edit']"}],attrs:{type:"success",plain:"",icon:"el-icon-edit",size:"mini",disabled:e.single},on:{click:e.handleUpdate}},[e._v("修改")])],1),i("el-col",{attrs:{span:1.5}},[i("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:notice:remove"],expression:"['system:notice:remove']"}],attrs:{type:"danger",plain:"",icon:"el-icon-delete",size:"mini",disabled:e.multiple},on:{click:e.handleDelete}},[e._v("删除")])],1),i("right-toolbar",{attrs:{showSearch:e.showSearch},on:{"update:showSearch":function(t){e.showSearch=t},"update:show-search":function(t){e.showSearch=t},queryTable:e.getList}})],1),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],attrs:{data:e.noticeList},on:{"selection-change":e.handleSelectionChange}},[i("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),i("el-table-column",{attrs:{label:"序号",align:"center",prop:"noticeId",width:"100"}}),i("el-table-column",{attrs:{label:"公告标题",align:"center",prop:"noticeTitle","show-overflow-tooltip":!0}}),i("el-table-column",{attrs:{label:"公告类型",align:"center",prop:"noticeType",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("dict-tag",{attrs:{options:e.dict.type.sys_notice_type,value:t.row.noticeType}})]}}])}),i("el-table-column",{attrs:{label:"状态",align:"center",prop:"status",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("dict-tag",{attrs:{options:e.dict.type.sys_notice_status,value:t.row.status}})]}}])}),i("el-table-column",{attrs:{label:"创建者",align:"center",prop:"createBy",width:"100"}}),i("el-table-column",{attrs:{label:"创建时间",align:"center",prop:"createTime",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(e.parseTime(t.row.createTime,"{y}-{m}-{d}")))])]}}])}),i("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:notice:edit"],expression:"['system:notice:edit']"}],attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(i){return e.handleUpdate(t.row)}}},[e._v("修改")]),i("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:notice:remove"],expression:"['system:notice:remove']"}],attrs:{size:"mini",type:"text",icon:"el-icon-delete"},on:{click:function(i){return e.handleDelete(t.row)}}},[e._v("删除")])]}}])})],1),i("pagination",{directives:[{name:"show",rawName:"v-show",value:e.total>0,expression:"total>0"}],attrs:{total:e.total,page:e.queryParams.pageNum,limit:e.queryParams.pageSize},on:{"update:page":function(t){return e.$set(e.queryParams,"pageNum",t)},"update:limit":function(t){return e.$set(e.queryParams,"pageSize",t)},pagination:e.getList}}),i("el-dialog",{attrs:{title:e.title,visible:e.open,width:"780px","append-to-body":""},on:{"update:visible":function(t){e.open=t}}},[i("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"80px"}},[i("el-row",[i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"公告标题",prop:"noticeTitle"}},[i("el-input",{attrs:{placeholder:"请输入公告标题"},model:{value:e.form.noticeTitle,callback:function(t){e.$set(e.form,"noticeTitle",t)},expression:"form.noticeTitle"}})],1)],1),i("el-col",{attrs:{span:12}},[i("el-form-item",{attrs:{label:"公告类型",prop:"noticeType"}},[i("el-select",{attrs:{placeholder:"请选择公告类型"},model:{value:e.form.noticeType,callback:function(t){e.$set(e.form,"noticeType",t)},expression:"form.noticeType"}},e._l(e.dict.type.sys_notice_type,(function(e){return i("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1),i("el-col",{attrs:{span:24}},[i("el-form-item",{attrs:{label:"状态"}},[i("el-radio-group",{model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},e._l(e.dict.type.sys_notice_status,(function(t){return i("el-radio",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)],1)],1),i("el-col",{attrs:{span:24}},[i("el-form-item",{attrs:{label:"内容"}},[i("editor",{attrs:{"min-height":192},model:{value:e.form.noticeContent,callback:function(t){e.$set(e.form,"noticeContent",t)},expression:"form.noticeContent"}})],1)],1)],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("确 定")]),i("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1)],1)},s=[],n=(i("0643"),i("a573"),i("b775"));function o(e){return Object(n["a"])({url:"/system/notice/list",method:"get",params:e})}function l(e){return Object(n["a"])({url:"/system/notice/"+e,method:"get"})}function r(e){return Object(n["a"])({url:"/system/notice",method:"post",data:e})}function c(e){return Object(n["a"])({url:"/system/notice",method:"put",data:e})}function u(e){return Object(n["a"])({url:"/system/notice/"+e,method:"delete"})}var m={name:"Notice",dicts:["sys_notice_status","sys_notice_type"],data(){return{loading:!0,ids:[],single:!0,multiple:!0,showSearch:!0,total:0,noticeList:[],title:"",open:!1,queryParams:{pageNum:1,pageSize:10,noticeTitle:void 0,createBy:void 0,status:void 0},form:{},rules:{noticeTitle:[{required:!0,message:"公告标题不能为空",trigger:"blur"}],noticeType:[{required:!0,message:"公告类型不能为空",trigger:"change"}]}}},created(){this.getList()},methods:{getList(){this.loading=!0,o(this.queryParams).then(e=>{this.noticeList=e.rows,this.total=e.total,this.loading=!1})},cancel(){this.open=!1,this.reset()},reset(){this.form={noticeId:void 0,noticeTitle:void 0,noticeType:void 0,noticeContent:void 0,status:"0"},this.resetForm("form")},handleQuery(){this.queryParams.pageNum=1,this.getList()},resetQuery(){this.resetForm("queryForm"),this.handleQuery()},handleSelectionChange(e){this.ids=e.map(e=>e.noticeId),this.single=1!=e.length,this.multiple=!e.length},handleAdd(){this.reset(),this.open=!0,this.title="添加公告"},handleUpdate(e){this.reset();const t=e.noticeId||this.ids;l(t).then(e=>{this.form=e.data,this.open=!0,this.title="修改公告"})},submitForm:function(){this.$refs["form"].validate(e=>{e&&(void 0!=this.form.noticeId?c(this.form).then(e=>{this.$modal.msgSuccess("修改成功"),this.open=!1,this.getList()}):r(this.form).then(e=>{this.$modal.msgSuccess("新增成功"),this.open=!1,this.getList()}))})},handleDelete(e){const t=e.noticeId||this.ids;this.$modal.confirm('是否确认删除公告编号为"'+t+'"的数据项?').then((function(){return u(t)})).then(()=>{this.getList(),this.$modal.msgSuccess("删除成功")}).catch(()=>{})}}},d=m,p=i("2877"),h=Object(p["a"])(d,a,s,!1,null,null,null);t["default"]=h.exports}}]);