"use strict";(self["webpackChunkvoghion_vue_admin"]=self["webpackChunkvoghion_vue_admin"]||[]).push([[82845],{82845:function(e,t,a){a.r(t),a.d(t,{default:function(){return c}});var r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"g-pa-md"},[t("el-form",{ref:"form",staticClass:"g-pa-md g-bg-white",attrs:{inline:!0,model:e.form},nativeOn:{submit:function(e){e.preventDefault()}}},[t("el-form-item",{attrs:{label:"Device code"}},[t("el-input",{staticStyle:{width:"256px"},attrs:{clearable:""},model:{value:e.form.value,callback:function(t){e.$set(e.form,"value",t)},expression:"form.value"}})],1),t("el-form-item",{attrs:{label:"添加人"}},[t("el-input",{attrs:{clearable:""},model:{value:e.form.operator,callback:function(t){e.$set(e.form,"operator",t)},expression:"form.operator"}})],1),t("el-form-item",{attrs:{label:"添加时间",prop:"time"}},[t("el-date-picker",{attrs:{type:"datetimerange","start-placeholder":"开始日期","end-placeholder":"结束日期","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.form.time,callback:function(t){e.$set(e.form,"time",t)},expression:"form.time"}})],1),t("el-form-item",[t("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.fetchDataSource(1)}}},[e._v("搜索")]),t("el-button",{attrs:{type:"primary"},on:{click:e.addWhiteList}},[e._v("新增")]),t("el-button",{attrs:{type:"primary"},on:{click:function(t){e.form={}}}},[e._v("重置")])],1)],1),t("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"g-mt-md",staticStyle:{width:"100%"},attrs:{data:e.dataSource.records}},[t("el-table-column",{attrs:{"header-align":"center",align:"center",prop:"id",label:"ID"}}),t("el-table-column",{attrs:{"header-align":"center",align:"center",prop:"value",label:"Device code"}}),t("el-table-column",{attrs:{"header-align":"center",align:"center",prop:"updateBy",label:"添加人"}}),t("el-table-column",{attrs:{"header-align":"center",align:"center",prop:"updateTime",label:"添加时间"}}),t("el-table-column",{attrs:{"header-align":"center",align:"center",prop:"actions",width:"150",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{type:"text"},on:{click:function(t){return e.deleteHandle(a.row)}}},[e._v("删除")])]}}])})],1),t("div",{staticClass:"g-pagination-container"},[t("el-pagination",{attrs:{"current-page":e.dataSource.pageNow,"page-sizes":[20,50,100],"page-size":e.dataSource.pageSize,layout:"sizes, prev, pager, next, jumper",background:"",total:e.dataSource.rowCount},on:{"size-change":function(t){return e.fetchDataSource(null,t)},"current-change":function(t){return e.fetchDataSource(t)}}})],1)],1)},i=[],o={components:{},data(){return{form:{},dataSource:{records:[],pageNow:1,pageSize:20},loading:!1,currentRow:null,isEdit:!1,dialogVisible:!1,editForm:{}}},computed:{userInfo(){return this.$store.state.user.userInfo}},mounted(){this.fetchDataSource()},methods:{addWhiteList(e){this.$prompt("请输入Device code","新增push白名单",{}).then((async({value:e})=>{this.$store.dispatch({type:"pushNotification/addOrUpdateMarketingWhiteList",payload:{deleted:!1,value:e,operator:this.userInfo.username,marketingType:"push"}}).then((e=>{e&&this.fetchDataSource()}))}))},deleteHandle(e){this.$confirm("删除此账号将无法收到push，确认删除此账号？","提示").then((async()=>{this.$store.dispatch({type:"pushNotification/addOrUpdateMarketingWhiteList",payload:{id:e.id,deleted:!0,operator:this.userInfo.username,marketingType:"push"}}).then((e=>{e&&this.fetchDataSource()}))}))},handleParams(){const e={...this.form};return this.form.time&&this.form.time.length>0&&(e.startTime=this.form.time[0],e.endTime=this.form.time[1],delete e.time),e},async fetchDataSource(e,t){this.loading=!0;const a={pageNow:e||this.dataSource.pageNow,pageSize:t||this.dataSource.pageSize,...this.handleParams()},r=await this.$store.dispatch({type:"pushNotification/queryMarketingWhiteList",payload:a});r&&(this.dataSource=r),this.loading=!1}}},n=o,l=a(81656),s=(0,l.A)(n,r,i,!1,null,null,null),c=s.exports}}]);