1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-25966d28","chunk-09411f28","chunk-2d0df437"],{4647:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:e.title,width:900,visible:e.visible,confirmLoading:e.confirmLoading,okButtonProps:{props:{disabled:e.disabled}},cancelText:"关闭"},on:{ok:e.handleOk,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-row",{staticStyle:{width:"100%"}},[t("a-col",{attrs:{span:12}},[t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"标题"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["titile",e.validatorRules.title],expression:"['titile', validatorRules.title]"}],attrs:{placeholder:"请输入标题",readOnly:e.disableSubmit}})],1)],1),t("a-col",{attrs:{span:12}},[t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"消息类型"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["msgCategory",e.validatorRules.msgCategory],expression:"[ 'msgCategory', validatorRules.msgCategory]"}],attrs:{placeholder:"请选择消息类型",disabled:e.disableSubmit,getPopupContainer:function(e){return e.parentNode}}},[t("a-select-option",{attrs:{value:"1"}},[e._v("通知公告")]),t("a-select-option",{attrs:{value:"2"}},[e._v("系统消息")])],1)],1)],1)],1),t("a-row",{staticStyle:{width:"100%"}},[t("a-col",{attrs:{span:12}},[t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"开始时间:"}},[t("j-date",{directives:[{name:"decorator",rawName:"v-decorator",value:["startTime",e.validatorRules.startTime],expression:"[ 'startTime', validatorRules.startTime]"}],staticStyle:{width:"100%"},attrs:{getCalendarContainer:function(e){return e.parentNode},placeholder:"请选择开始时间",showTime:"",dateFormat:"YYYY-MM-DD HH:mm:ss"}})],1)],1),t("a-col",{attrs:{span:12}},[t("a-form-item",{staticClass:"endTime",attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"结束时间"}},[t("j-date",{directives:[{name:"decorator",rawName:"v-decorator",value:["endTime",e.validatorRules.endTime],expression:"[ 'endTime', validatorRules.endTime]"}],staticStyle:{width:"100%"},attrs:{getCalendarContainer:function(e){return e.parentNode},placeholder:"请选择结束时间",showTime:"",dateFormat:"YYYY-MM-DD HH:mm:ss"}})],1)],1)],1),t("a-row",{staticStyle:{width:"100%"}},[t("a-col",{attrs:{span:12}},[t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"优先级"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["priority",{}],expression:"[ 'priority', {}]"}],attrs:{placeholder:"请选择优先级",disabled:e.disableSubmit,getPopupContainer:function(e){return e.parentNode}}},[t("a-select-option",{attrs:{value:"L"}},[e._v("低")]),t("a-select-option",{attrs:{value:"M"}},[e._v("中")]),t("a-select-option",{attrs:{value:"H"}},[e._v("高")])],1)],1)],1),t("a-col",{attrs:{span:12}},[t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"通告类型"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["msgType",e.validatorRules.msgType],expression:"[ 'msgType', validatorRules.msgType]"}],attrs:{placeholder:"请选择通告类型",disabled:e.disableSubmit,getPopupContainer:function(e){return e.parentNode}},on:{change:e.chooseMsgType}},[t("a-select-option",{attrs:{value:"USER"}},[e._v("指定用户")]),t("a-select-option",{attrs:{value:"ALL"}},[e._v("全体用户")])],1)],1)],1)],1),t("a-row",{staticStyle:{width:"100%"}},[t("a-col",{attrs:{span:12}},[t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"摘要"}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["msgAbstract",e.validatorRules.msgAbstract],expression:"['msgAbstract',validatorRules.msgAbstract]"}],attrs:{placeholder:"请输入摘要"}})],1)],1),t("a-col",{attrs:{span:12}},[e.userType?t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"指定用户"}},[t("a-select",{attrs:{mode:"multiple",placeholder:"请选择用户"},on:{dropdownVisibleChange:e.selectUserIds},model:{value:e.selectedUser,callback:function(t){e.selectedUser=t},expression:"selectedUser"}})],1):e._e()],1)],1),t("a-row",{staticStyle:{width:"100%"}},[t("a-col",{attrs:{span:24}},[t("a-form-item",{staticClass:"j-field-content",attrs:{labelCol:e.labelColX1,wrapperCol:e.wrapperColX1,label:"内容"}},[t("j-editor",{directives:[{name:"decorator",rawName:"v-decorator",value:["msgContent",{}],expression:"[ 'msgContent', {} ]"}],attrs:{triggerChange:""}})],1)],1)],1)],1)],1),t("select-user-list-modal",{ref:"UserListModal",on:{choseUser:e.choseUser}})],1)},r=[],l=a("0fea"),i=a("88bc"),n=a.n(i),o=a("2dab"),c=a("a061"),u=a("ed2a"),d=a("c1df"),m=a.n(d),p={components:{JEditor:c["default"],JDate:o["default"],SelectUserListModal:u["default"]},name:"SysAnnouncementModal",data:function(){return{title:"操作",visible:!1,disableSubmit:!1,model:{},labelCol:{xs:{span:24},sm:{span:6}},wrapperCol:{xs:{span:24},sm:{span:18}},labelColX1:{xs:{span:24},sm:{span:3}},wrapperColX1:{xs:{span:24},sm:{span:21}},confirmLoading:!1,form:this.$form.createForm(this),validatorRules:{title:{rules:[{required:!0,message:"请输入标题!"}]},msgCategory:{rules:[{required:!0,message:"请选择消息类型!"}]},msgType:{rules:[{required:!0,message:"请选择通告对象类型!"}]},endTime:{rules:[{required:!0,message:"请选择结束时间!"},{validator:this.endTimeValidate}]},startTime:{rules:[{required:!0,message:"请选择开始时间!"},{validator:this.startTimeValidate}]},msgAbstract:{rules:[{required:!0,message:"请输入摘要!"}]}},url:{queryByIds:"/sys/user/queryByIds",add:"/sys/annountCement/add",edit:"/sys/annountCement/edit"},userType:!1,userIds:[],selectedUser:[],disabled:!1,msgContent:""}},created:function(){},methods:{add:function(){this.edit({})},edit:function(e){this.form.resetFields(),this.model={},this.disable=!1,this.visible=!0,this.getUser(e)},getUser:function(e){var t=this;this.model=Object.assign({},e),e&&"USER"===e.msgType&&(this.userType=!0,this.userIds=e.userIds,Object(l["c"])(this.url.queryByIds,{userIds:this.userIds}).then((function(e){if(e.success){for(var a=0;a<e.result.length;a++)t.selectedUser.push(e.result[a].realname);t.$refs.UserListModal.edit(e.result,t.userIds)}}))),this.$nextTick((function(){t.form.setFieldsValue(n()(t.model,"endTime","startTime","titile","msgContent","sender","priority","msgCategory","msgType","sendStatus","delFlag","msgAbstract"))}))},close:function(){this.$emit("close"),this.selectedUser=[],this.visible=!1},handleOk:function(){var e=this,t=this;!this.userType||null!=this.userIds&&this.userIds.length>0?this.form.validateFields((function(a,s){if(!a){t.confirmLoading=!0;var r="",i="";e.model.id?(r+=e.url.edit,i="put"):(r+=e.url.add,i="post");var n=Object.assign(e.model,s);e.userType&&(n.userIds=e.userIds),Object(l["i"])(r,n,i).then((function(e){e.success?(t.$message.success(e.message),t.$emit("ok"),t.resetUser()):t.$message.warning(e.message)})).finally((function(){t.confirmLoading=!1,t.close()}))}})):this.$message.warning("指定用户不能为空!")},handleCancel:function(){this.visible=!1,this.$emit("close"),this.resetUser()},resetUser:function(){this.userType=!1,this.userIds=[],this.selectedUser=[],this.disabled=!1,this.$refs.UserListModal.edit(null,null)},selectUserIds:function(){this.$refs.UserListModal.add(this.selectedUser,this.userIds)},chooseMsgType:function(e){"USER"==e?this.userType=!0:(this.userType=!1,this.selectedUser=[],this.userIds=[])},choseUser:function(e){this.selectedUser=[],this.userIds=[];for(var t=0;t<e.length;t++)this.selectedUser.push(e[t].realname),this.userIds+=e[t].id+","},startTimeValidate:function(e,t,a){var s=this.form.getFieldValue("endTime");t&&s?m()(t).isBefore(s)?a():a("开始时间需小于结束时间"):a()},endTimeValidate:function(e,t,a){var s=this.form.getFieldValue("startTime");t&&s?m()(s).isBefore(t)?a():a("结束时间需大于开始时间"):a()}}},h=p,f=a("2877"),g=Object(f["a"])(h,s,r,!1,null,"1592acdf",null);t["default"]=g.exports},"88bc":function(e,t,a){(function(t){var a=1/0,s=9007199254740991,r="[object Arguments]",l="[object Function]",i="[object GeneratorFunction]",n="[object Symbol]",o="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,u=o||c||Function("return this")();function d(e,t,a){switch(a.length){case 0:return e.call(t);case 1:return e.call(t,a[0]);case 2:return e.call(t,a[0],a[1]);case 3:return e.call(t,a[0],a[1],a[2])}return e.apply(t,a)}function m(e,t){var a=-1,s=e?e.length:0,r=Array(s);while(++a<s)r[a]=t(e[a],a,e);return r}function p(e,t){var a=-1,s=t.length,r=e.length;while(++a<s)e[r+a]=t[a];return e}var h=Object.prototype,f=h.hasOwnProperty,g=h.toString,b=u.Symbol,v=h.propertyIsEnumerable,y=b?b.isConcatSpreadable:void 0,w=Math.max;function C(e,t,a,s,r){var l=-1,i=e.length;a||(a=R),r||(r=[]);while(++l<i){var n=e[l];t>0&&a(n)?t>1?C(n,t-1,a,s,r):p(r,n):s||(r[r.length]=n)}return r}function S(e,t){return e=Object(e),T(e,t,(function(t,a){return a in e}))}function T(e,t,a){var s=-1,r=t.length,l={};while(++s<r){var i=t[s],n=e[i];a(n,i)&&(l[i]=n)}return l}function x(e,t){return t=w(void 0===t?e.length-1:t,0),function(){var a=arguments,s=-1,r=w(a.length-t,0),l=Array(r);while(++s<r)l[s]=a[t+s];s=-1;var i=Array(t+1);while(++s<t)i[s]=a[s];return i[t]=l,d(e,this,i)}}function R(e){return j(e)||q(e)||!!(y&&e&&e[y])}function U(e){if("string"==typeof e||A(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function q(e){return I(e)&&f.call(e,"callee")&&(!v.call(e,"callee")||g.call(e)==r)}var j=Array.isArray;function k(e){return null!=e&&O(e.length)&&!P(e)}function I(e){return $(e)&&k(e)}function P(e){var t=_(e)?g.call(e):"";return t==l||t==i}function O(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=s}function _(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function $(e){return!!e&&"object"==typeof e}function A(e){return"symbol"==typeof e||$(e)&&g.call(e)==n}var L=x((function(e,t){return null==e?{}:S(e,m(C(t,1),U))}));e.exports=L}).call(this,a("c8ba"))},b9d0:function(e,t,a){"use strict";a("d477")},d477:function(e,t,a){},ed2a:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:e.title,width:1200,visible:e.visible,cancelText:"关闭"},on:{ok:e.handleOk,cancel:e.handleCancel}},[t("div",{staticClass:"table-page-search-wrapper"},[t("a-form",{attrs:{layout:"inline"}},[t("a-row",{attrs:{gutter:24}},[t("a-col",{attrs:{span:6}},[t("a-form-item",{attrs:{label:"账号"}},[t("a-input",{attrs:{placeholder:"请输入账号"},model:{value:e.queryParam.username,callback:function(t){e.$set(e.queryParam,"username",t)},expression:"queryParam.username"}})],1)],1),t("a-col",{attrs:{span:6}},[t("a-form-item",{attrs:{label:"性别"}},[t("a-select",{attrs:{placeholder:"请选择性别"},model:{value:e.queryParam.sex,callback:function(t){e.$set(e.queryParam,"sex",t)},expression:"queryParam.sex"}},[t("a-select-option",{attrs:{value:""}},[e._v("请选择性别查询")]),t("a-select-option",{attrs:{value:"1"}},[e._v("男性")]),t("a-select-option",{attrs:{value:"2"}},[e._v("女性")])],1)],1)],1),e.toggleSearchStatus?[t("a-col",{attrs:{span:6}},[t("a-form-item",{attrs:{label:"邮箱"}},[t("a-input",{attrs:{placeholder:"请输入邮箱"},model:{value:e.queryParam.email,callback:function(t){e.$set(e.queryParam,"email",t)},expression:"queryParam.email"}})],1)],1),t("a-col",{attrs:{span:6}},[t("a-form-item",{attrs:{label:"手机号码"}},[t("a-input",{attrs:{placeholder:"请输入手机号码"},model:{value:e.queryParam.phone,callback:function(t){e.$set(e.queryParam,"phone",t)},expression:"queryParam.phone"}})],1)],1),t("a-col",{attrs:{span:6}},[t("a-form-item",{attrs:{label:"状态"}},[t("a-select",{attrs:{placeholder:"请选择状态"},model:{value:e.queryParam.status,callback:function(t){e.$set(e.queryParam,"status",t)},expression:"queryParam.status"}},[t("a-select-option",{attrs:{value:""}},[e._v("请选择状态")]),t("a-select-option",{attrs:{value:"1"}},[e._v("正常")]),t("a-select-option",{attrs:{value:"2"}},[e._v("解冻")])],1)],1)],1)]:e._e(),t("a-col",{attrs:{span:6}},[t("span",{staticClass:"table-page-search-submitButtons",staticStyle:{float:"left",overflow:"hidden"}},[t("a-button",{attrs:{type:"primary",icon:"search"},on:{click:e.searchByquery}},[e._v("查询")]),t("a-button",{staticStyle:{"margin-left":"8px"},attrs:{type:"primary",icon:"reload"},on:{click:e.searchReset}},[e._v("重置")]),t("a",{staticStyle:{"margin-left":"8px"},on:{click:e.handleToggleSearch}},[e._v("\n "+e._s(e.toggleSearchStatus?"收起":"展开")+"\n "),t("a-icon",{attrs:{type:e.toggleSearchStatus?"up":"down"}})],1)],1)])],2)],1)],1),t("a-table",{ref:"table",attrs:{rowKey:"id",columns:e.columns,dataSource:e.dataSource,pagination:e.ipagination,rowSelection:{selectedRowKeys:e.selectedRowKeys,onChange:e.onSelectChange,onSelect:e.onSelect}},on:{change:e.handleTableChange}})],1)},r=[],l=a("ca00"),i=a("4ec3"),n={name:"SelectUserListModal",components:{},data:function(){return{title:"选择用户",queryParam:{},columns:[{title:"用户账号",align:"center",dataIndex:"name",fixed:"left",width:200},{title:"用户名称",align:"center",dataIndex:"realname"},{title:"手机号码",align:"center",dataIndex:"phone"},{title:"状态",align:"center",dataIndex:"status",customRender:function(e){return 1==e?"正常":2==e?"冻结":e}}],dataSource:[],ipagination:{current:1,pageSize:5,pageSizeOptions:["5","10","20"],showTotal:function(e,t){return t[0]+"-"+t[1]+" 共"+e+"条"},showQuickJumper:!0,showSizeChanger:!0,total:0},isorter:{column:"createTime",order:"desc"},selectedRowKeys:[],selectionRows:[],visible:!1,toggleSearchStatus:!1}},created:function(){this.loadData()},methods:{add:function(e,t){this.visible=!0,this.edit(e,t)},edit:function(e,t){if(t&&t.length>0?this.selectedRowKeys=t.split(","):this.selectedRowKeys=[],e){var a=this;a.selectionRows=[],e.forEach((function(e,t){a.selectionRows.push({id:a.selectedRowKeys[t],realname:e})}))}else this.selectionRows=[]},loadData:function(e){var t=this;1===e&&(this.ipagination.current=1);var a=this.getQueryParams();Object(i["A"])(a).then((function(e){e.success&&(t.dataSource=e.result.records,t.ipagination.total=e.result.total)}))},getQueryParams:function(){var e=Object.assign({},this.queryParam,this.isorter);return e.field=this.getQueryField(),e.pageNo=this.ipagination.current,e.pageSize=this.ipagination.pageSize,Object(l["d"])(e)},getQueryField:function(){for(var e="id,",t=0;t<this.columns.length;t++)e+=","+this.columns[t].dataIndex;return e},onSelectChange:function(e){this.selectedRowKeys=e},onSelect:function(e,t){1==t?this.selectionRows.push(e):this.selectionRows.forEach((function(t,a,s){t.id==e.id&&s.splice(a,1)}))},searchReset:function(){var e=this;Object.keys(e.queryParam).forEach((function(t){e.queryParam[t]=""})),e.loadData(1)},handleTableChange:function(e,t,a){Object.keys(a).length>0&&(this.isorter.column=a.field,this.isorter.order="ascend"==a.order?"asc":"desc"),this.ipagination=e,this.loadData()},handleCancel:function(){this.selectionRows=[],this.selectedRowKeys=[],this.visible=!1},handleOk:function(){this.$emit("choseUser",this.selectionRows),this.handleCancel()},searchByquery:function(){this.loadData(1)},handleToggleSearch:function(){this.toggleSearchStatus=!this.toggleSearchStatus}}},o=n,c=(a("b9d0"),a("2877")),u=Object(c["a"])(o,s,r,!1,null,"797da78b",null);t["default"]=u.exports}}]);
|