zhangjian
2023-08-07 6b009b0f6d3ef3aee97c362cebcd679d1b9088a3
1
{"code":"(window[\"webpackJsonp\"]=window[\"webpackJsonp\"]||[]).push([[\"chunk-2d0b1626\"],{\"202d\":function(e,t,n){\"use strict\";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n(\"div\",{staticClass:\"app-container\"},[n(\"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\"}},[n(\"el-form-item\",{attrs:{label:\"公告标题\",prop:\"noticeTitle\"}},[n(\"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),n(\"el-form-item\",{attrs:{label:\"操作人员\",prop:\"createBy\"}},[n(\"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),n(\"el-form-item\",{attrs:{label:\"类型\",prop:\"noticeType\"}},[n(\"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 n(\"el-option\",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),n(\"el-form-item\",[n(\"el-button\",{attrs:{type:\"primary\",icon:\"el-icon-search\",size:\"mini\"},on:{click:e.handleQuery}},[e._v(\"搜索\")]),n(\"el-button\",{attrs:{icon:\"el-icon-refresh\",size:\"mini\"},on:{click:e.resetQuery}},[e._v(\"重置\")])],1)],1),n(\"el-row\",{staticClass:\"mb8\",attrs:{gutter:10}},[n(\"el-col\",{attrs:{span:1.5}},[n(\"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),n(\"el-col\",{attrs:{span:1.5}},[n(\"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),n(\"el-col\",{attrs:{span:1.5}},[n(\"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),n(\"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),n(\"el-table\",{directives:[{name:\"loading\",rawName:\"v-loading\",value:e.loading,expression:\"loading\"}],attrs:{data:e.noticeList},on:{\"selection-change\":e.handleSelectionChange}},[n(\"el-table-column\",{attrs:{type:\"selection\",width:\"55\",align:\"center\"}}),n(\"el-table-column\",{attrs:{label:\"序号\",align:\"center\",prop:\"noticeId\",width:\"100\"}}),n(\"el-table-column\",{attrs:{label:\"公告标题\",align:\"center\",prop:\"noticeTitle\",\"show-overflow-tooltip\":!0}}),n(\"el-table-column\",{attrs:{label:\"公告类型\",align:\"center\",prop:\"noticeType\",width:\"100\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[n(\"dict-tag\",{attrs:{options:e.dict.type.sys_notice_type,value:t.row.noticeType}})]}}])}),n(\"el-table-column\",{attrs:{label:\"状态\",align:\"center\",prop:\"status\",width:\"100\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[n(\"dict-tag\",{attrs:{options:e.dict.type.sys_notice_status,value:t.row.status}})]}}])}),n(\"el-table-column\",{attrs:{label:\"创建者\",align:\"center\",prop:\"createBy\",width:\"100\"}}),n(\"el-table-column\",{attrs:{label:\"创建时间\",align:\"center\",prop:\"createTime\",width:\"100\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[n(\"span\",[e._v(e._s(e.parseTime(t.row.createTime,\"{y}-{m}-{d}\")))])]}}])}),n(\"el-table-column\",{attrs:{label:\"操作\",align:\"center\",\"class-name\":\"small-padding fixed-width\"},scopedSlots:e._u([{key:\"default\",fn:function(t){return[n(\"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(n){return e.handleUpdate(t.row)}}},[e._v(\"修改\")]),n(\"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(n){return e.handleDelete(t.row)}}},[e._v(\"删除\")])]}}])})],1),n(\"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}}),n(\"el-dialog\",{attrs:{title:e.title,visible:e.open,width:\"780px\",\"append-to-body\":\"\"},on:{\"update:visible\":function(t){e.open=t}}},[n(\"el-form\",{ref:\"form\",attrs:{model:e.form,rules:e.rules,\"label-width\":\"80px\"}},[n(\"el-row\",[n(\"el-col\",{attrs:{span:12}},[n(\"el-form-item\",{attrs:{label:\"公告标题\",prop:\"noticeTitle\"}},[n(\"el-input\",{attrs:{placeholder:\"请输入公告标题\"},model:{value:e.form.noticeTitle,callback:function(t){e.$set(e.form,\"noticeTitle\",t)},expression:\"form.noticeTitle\"}})],1)],1),n(\"el-col\",{attrs:{span:12}},[n(\"el-form-item\",{attrs:{label:\"公告类型\",prop:\"noticeType\"}},[n(\"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 n(\"el-option\",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)],1),n(\"el-col\",{attrs:{span:24}},[n(\"el-form-item\",{attrs:{label:\"状态\"}},[n(\"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 n(\"el-radio\",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.label))])})),1)],1)],1),n(\"el-col\",{attrs:{span:24}},[n(\"el-form-item\",{attrs:{label:\"内容\"}},[n(\"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),n(\"div\",{staticClass:\"dialog-footer\",attrs:{slot:\"footer\"},slot:\"footer\"},[n(\"el-button\",{attrs:{type:\"primary\"},on:{click:e.submitForm}},[e._v(\"确 定\")]),n(\"el-button\",{on:{click:e.cancel}},[e._v(\"取 消\")])],1)],1)],1)},a=[],o=(n(\"d81d\"),n(\"b775\"));function s(e){return Object(o[\"a\"])({url:\"/system/notice/list\",method:\"get\",params:e})}function r(e){return Object(o[\"a\"])({url:\"/system/notice/\"+e,method:\"get\"})}function l(e){return Object(o[\"a\"])({url:\"/system/notice\",method:\"post\",data:e})}function c(e){return Object(o[\"a\"])({url:\"/system/notice\",method:\"put\",data:e})}function u(e){return Object(o[\"a\"])({url:\"/system/notice/\"+e,method:\"delete\"})}var m={name:\"Notice\",dicts:[\"sys_notice_status\",\"sys_notice_type\"],data:function(){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:function(){this.getList()},methods:{getList:function(){var e=this;this.loading=!0,s(this.queryParams).then((function(t){e.noticeList=t.rows,e.total=t.total,e.loading=!1}))},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={noticeId:void 0,noticeTitle:void 0,noticeType:void 0,noticeContent:void 0,status:\"0\"},this.resetForm(\"form\")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.resetForm(\"queryForm\"),this.handleQuery()},handleSelectionChange:function(e){this.ids=e.map((function(e){return e.noticeId})),this.single=1!=e.length,this.multiple=!e.length},handleAdd:function(){this.reset(),this.open=!0,this.title=\"添加公告\"},handleUpdate:function(e){var t=this;this.reset();var n=e.noticeId||this.ids;r(n).then((function(e){t.form=e.data,t.open=!0,t.title=\"修改公告\"}))},submitForm:function(){var e=this;this.$refs[\"form\"].validate((function(t){t&&(void 0!=e.form.noticeId?c(e.form).then((function(t){e.$modal.msgSuccess(\"修改成功\"),e.open=!1,e.getList()})):l(e.form).then((function(t){e.$modal.msgSuccess(\"新增成功\"),e.open=!1,e.getList()})))}))},handleDelete:function(e){var t=this,n=e.noticeId||this.ids;this.$modal.confirm('是否确认删除公告编号为\"'+n+'\"的数据项?').then((function(){return u(n)})).then((function(){t.getList(),t.$modal.msgSuccess(\"删除成功\")})).catch((function(){}))}}},d=m,p=n(\"2877\"),h=Object(p[\"a\"])(d,i,a,!1,null,null,null);t[\"default\"]=h.exports}}]);","extractedComments":[]}