123456 |
- /*!
- * build: Hopaheal
- * copyright: Mead
- * time: 2023-3-13 15:21:04
- */
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5aae555b"],{"25c0c":function(e,t,s){},"3cae":function(e,t,s){"use strict";s.r(t),s.d(t,"getLists",(function(){return n})),s.d(t,"getNotice",(function(){return o})),s.d(t,"doAdd",(function(){return r})),s.d(t,"doEdit",(function(){return i})),s.d(t,"getDetail",(function(){return l})),s.d(t,"doDelete",(function(){return u})),s.d(t,"doDeletes",(function(){return c})),s.d(t,"getRead",(function(){return d})),s.d(t,"getMessage",(function(){return m})),s.d(t,"clearRead",(function(){return h})),s.d(t,"doPause",(function(){return f}));var a=s("b775");function n(e){return Object(a["default"])({url:"/news/notice",method:"get",params:e})}function o(e){return Object(a["default"])({url:"/inform/information-user-messages",method:"get",params:e})}function r(e){return Object(a["default"])({url:"/news/notice",method:"post",data:e})}function i(e){return Object(a["default"])({url:"/news/notice/info/"+e.id,method:"put",data:e})}function l(e){return Object(a["default"])({url:"/news/notice/info/"+e,method:"get"})}function u(e){return Object(a["default"])({url:"/inform/information/"+e.ids,method:"delete"})}function c(e){return Object(a["default"])({url:"/inform/information/delete",method:"post",data:e})}function d(e){return Object(a["default"])({url:"/inform/information-user-messages",method:"get",params:e})}function m(e){return Object(a["default"])({url:"/inform/information-read-messages",method:"post",data:e})}function h(e){return Object(a["default"])({url:"/inform/information-read-messages",method:"post",data:e})}function f(e){return Object(a["default"])({url:"/news/notice/pause",method:"get",params:e})}},a75b:function(e,t,s){"use strict";s("25c0c")},e12a:function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"role-management-container"},[a("vab-query-form",[a("vab-query-form-left-panel",{attrs:{span:12}},[a("el-button",{attrs:{icon:"el-icon-plus",type:"primary"},on:{click:e.handleEdit}},[e._v(" 添加 ")]),1==e.role_id?a("el-button",{attrs:{icon:"el-icon-delete",type:"danger"},on:{click:e.handleDelete}},[e._v(" 批量删除 ")]):e._e()],1),a("vab-query-form-right-panel",{attrs:{span:12}},[a("el-form",{attrs:{inline:!0,model:e.queryForm},nativeOn:{submit:function(e){e.preventDefault()}}},[a("el-form-item",[a("el-input",{attrs:{clearable:"",placeholder:"请输入标题"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.queryData(t)}},model:{value:e.queryForm.name,callback:function(t){e.$set(e.queryForm,"name","string"===typeof t?t.trim():t)},expression:"queryForm.name"}})],1),a("el-form-item",[a("el-select",{ref:"selectblur",attrs:{clearable:"",placeholder:"状态"},model:{value:e.queryForm.status,callback:function(t){e.$set(e.queryForm,"status",t)},expression:"queryForm.status"}},e._l(e.status_list,(function(e,t){return a("el-option",{key:t,attrs:{label:e.name,value:e.id}})})),1)],1),a("el-form-item",[a("el-button",{attrs:{icon:"el-icon-search",type:"primary"},on:{click:e.queryData}},[e._v(" 查询 ")])],1)],1)],1)],1),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{border:"",data:e.list,"default-expand-all":""},on:{"selection-change":e.setSelectRows,"sort-change":e.onSortChange},scopedSlots:e._u([{key:"empty",fn:function(){return[a("el-image",{staticClass:"vab-data-empty",attrs:{src:s("f1f0")}})]},proxy:!0}])},[a("el-table-column",{attrs:{"show-overflow-tooltip":"",type:"selection"}}),a("el-table-column",{attrs:{align:"center",label:"公告名称","min-width":"120",prop:"name","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{align:"center",label:"标签","min-width":"120",prop:"tags","show-overflow-tooltip":"","sort-orders":["ascending","descending"],sortable:"custom"},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return e._l(s.tags,(function(t,s){return a("el-tag",{key:s,attrs:{type:"success"}},[e._v(" "+e._s(t)+" ")])}))}}])}),a("el-table-column",{attrs:{align:"center",label:"创建人员","min-width":"120",prop:"admin_name","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[e._v(" "+e._s(s.admin?s.admin.name:"--")+" ")]}}])}),a("el-table-column",{attrs:{align:"center",label:"创建时间","min-width":"120",prop:"updated_at","show-overflow-tooltip":"","sort-orders":["ascending","descending"],sortable:"custom"}}),a("el-table-column",{attrs:{align:"center",label:"状态",prop:"status","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[1==s.status?a("el-tag",[e._v("正常")]):e._e(),0==s.status?a("el-tag",{attrs:{type:"danger"}},[e._v("禁用")]):e._e()]}}])}),a("el-table-column",{attrs:{align:"center",fixed:"right",label:"操作","min-width":"160","show-overflow-tooltip":""},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[a("el-button",{staticStyle:{color:"#0ba526"},attrs:{type:"text"},on:{click:function(t){return e.handleEdit(s)}}},[e._v(" 编辑 ")]),a("el-button",{attrs:{type:"text"},on:{click:function(t){return e.handleShow(s)}}},[e._v("详情")]),a("el-button",{staticStyle:{color:"red"},attrs:{type:"text"},on:{click:function(t){return e.handleDelete(s)}}},[e._v(" 删除 ")]),1==s.status?a("el-button",{staticStyle:{color:"#ff6e27"},attrs:{type:"text"},on:{click:function(t){return e.handlePause(s,0)}}},[e._v(" 禁用 ")]):e._e(),0==s.status?a("el-button",{staticStyle:{color:"#0ba526"},attrs:{type:"text"},on:{click:function(t){return e.handlePause(s,1)}}},[e._v(" 启用 ")]):e._e()]}}])})],1),a("el-pagination",{attrs:{background:"","current-page":e.queryForm.page,layout:e.layout,"page-size":e.queryForm.per_page,"page-sizes":[15,20,30,40,50,100],total:e.meta.total},on:{"current-change":e.handleCurrentChange,"size-change":e.handleSizeChange}})],1)},n=[],o=s("3cae"),r=s("4360"),i=s("7736"),l={name:"Notice",data(){return{editForm:{},oldSort:0,editStatus:0,flag:!1,language:r["default"].getters["settings/language"],selectRows:[],defaultProps:{children:"children",label:"name",leaf:!0},translate:"",list:[],meta:{},childrenId:[],treeData:[],readData:[],messageData:[],listLoading:!0,layout:"total, sizes, prev, pager, next, jumper",queryForm:{page:1,per_page:15,title:"",sortedBy:"desc",orderBy:""},dialogVisible:!1,shenhe:{check_status:1},status_list:[{id:1,name:"正常"},{id:0,name:"禁用"}]}},computed:{...Object(i["c"])({role_id:"user/role_id",id:"user/user_id"})},async created(){this.getList()},methods:{handleSizeChange(e){this.queryForm.per_page=e,this.getList()},handleCurrentChange(e){this.queryForm.page=e,this.getList()},queryData(){this.queryForm.page=1,this.getList()},handleEdit(e){console.log("9999999"),e.id?this.$router.push({path:"/notice/noticeEdit",query:{id:e.id}}):this.$router.push({path:"/notice/noticeEdit"})},handleShow(e){this.$router.push({path:"/notice/details",query:{id:e.id}})},setSelectRows(e){this.selectRows=e},handleDelete(e){if(e.id)this.$baseConfirm("你确定要删除当前项吗",null,async()=>{const{message:t}=await Object(o["doDelete"])({ids:e.id});this.$baseMessage(t,"success",!1,"vab-hey-message-success"),await this.getList()});else if(console.log(e.id,"000000000000"),this.selectRows.length>0){let e=this.selectRows.map(e=>e.id);this.$baseConfirm("你确定要删除选中项吗",null,async()=>{const{message:t}=await Object(o["doDeletes"])({ids:e});this.$baseMessage(t,"success",!1,"vab-hey-message-success"),await this.getList()})}else this.$baseMessage("未选中任何行","error",!1,"vab-hey-message-error")},onSortChange(e){console.log(e,"prop"),"ascending"==e.order&&(this.queryForm.sortedBy="asc"),"descending"==e.order&&(this.queryForm.sortedBy="desc"),this.queryForm.orderBy=e.prop,this.getList()},async getList(){this.listLoading=!0;const{data:e}=await Object(o["getLists"])(this.queryForm);console.log(e,"所有的数据"),this.list=e.list,this.meta=e.meta.pagination,console.log(this.list,this.meta,"table表中的数据和翻页数据"),this.listLoading=!1},cancelSort(e){this.editStatus=0,e.sort=this.oldSort},inputSort(e){console.log(e,"input排序编辑框"),this.editForm.sort=e},async changeSort(e){console.log("1111111111"),this.editStatus=1,this.editForm=e,this.oldSort=e.sort,this.$nextTick(()=>{this.$refs["getFocus"].focus()})},async sureChange(e){if(console.log(e,"22222222222"),this.editStatus=0,this.oldSort!==this.editForm.sort){const{message:e}=await Object(o["doEdit"])(this.editForm);console.log(e,"message"),this.$baseMessage(e,"success",!1,"vab-hey-message-success"),this.getList()}},handlePause(e,t){this.$baseConfirm("您确定要"+(1==t?"启用":"禁用")+"当前通知公告吗?",null,async()=>{const{message:s}=await Object(o["doPause"])({id:e.id,type:t});this.$baseMessage(s,"success",!1,"vab-hey-message-success"),await this.getList()})}}},u=l,c=(s("a75b"),s("0b56")),d=Object(c["a"])(u,a,n,!1,null,"4651c643",null);t["default"]=d.exports},f1f0:function(e,t,s){e.exports=s.p+"static/img/data_empty.f2997617.png"}}]);
|