猎户系统

29.2125de6a3199e1eb575d.js 35KB

1
  1. webpackJsonp([29],{KWP3:function(t,e){},NYuq:function(t,e){},ZS3G:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("Gu7T"),s=a.n(i),n=a("mvHQ"),o=a.n(n),l=a("Xxa5"),c=a.n(l),r=a("exGp"),_=a.n(r),d=a("//Fk"),h=a.n(d),m=a("fGUm"),u=a("UOPL"),g=a("Dd8w"),p=a.n(g),f=a("M4fF"),v=a.n(f),b={name:"chatGroupOptions",components:{selfInput:a("McOJ").a},props:{width:{type:String,default:function(){return""}},isHasRoomId:{type:Boolean,default:function(){return!1}},isDataIdx:{type:Boolean,default:function(){return!1}},dataIdx:{type:Number,default:function(){return 0}},chatListResult:{type:Array,default:function(){return[]}}},data:function(){return{reset:!1,loading:!1,dialogVisible:!1,ownerOptions:[],owner:"",keyword:"",chatList:[],chatListSelected:[]}},computed:{chatListResultName:function(){return this.chatListResult.map(function(t){return t.name}).join(",")}},watch:{dialogVisible:function(t){t?(this.handleGetOwnerOptions(),this.handleGetChatList()):(this.owner="",this.keyword="",this.reset=!this.reset)}},methods:{handleGetChatList:function(){var t=this;return _()(c.a.mark(function e(){var a,i,s;return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.loading=!0,t.chatList=[],e.next=5,t.$axios.get(t.URL.BASEURL+t.URL.groupCode_chatGroupList,{params:{keyword:t.keyword,owner:t.owner,has_room_id:!!t.isHasRoomId}});case 5:a=e.sent,i=a.data,(s=void 0===i?{}:i)&&0==s.errno?(t.chatList=s.rst.map(function(t){return p()({},t,{name:t.name||"未设置群名",isSelected:!1})}),t.chatListResult.length&&t.handleGetChatListSelected(),t.handleGetIsSelectedChatStatus()):4002!=s.errno&&t.$message.warning(s.err),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),console.log("error => ",e.t0);case 14:return e.prev=14,t.loading=!1,e.finish(14);case 17:case"end":return e.stop()}},e,t,[[0,11,14,17]])}))()},handleGetOwnerOptions:function(){var t=this;return _()(c.a.mark(function e(){var a,i,s,n,o;return c.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.ownerOptions=[],a=""+t.URL.BASEURL+t.URL.chatGroup_chatGroupOwnerIndex,i={},e.next=6,t.$axios.get(a,{params:i});case 6:s=e.sent,n=s.data,(o=void 0===n?{}:n)&&0==o.errno?t.ownerOptions=Array.isArray(o.rst)?o.rst:[]:4002!=o.errno&&t.$message.warning(o.err),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),console.log("error => ",e.t0);case 15:case"end":return e.stop()}},e,t,[[0,12]])}))()},onChangeOwner:function(t){this.owner=t,this.handleGetChatList()},onChangeKeyword:function(t){this.keyword=t,this.handleGetChatList()},handleCloseAllChatList:function(){this.chatList.forEach(function(t){t.isSelected=!1})},handleGetChatListSelected:function(){var t=this;this.chatListResult.forEach(function(e){var a=t.chatList.find(function(t){return t.chat_id===e.chat_id});a&&(!t.chatListSelected.find(function(t){return t.chat_id===a.chat_id})&&t.chatListSelected.push(a))})},handleGetIsSelectedChatStatus:function(){var t=this;this.handleCloseAllChatList(),this.chatListSelected.forEach(function(e){var a=t.chatList.findIndex(function(t){return t.chat_id===e.chat_id});-1!==a&&(t.chatList[a].isSelected=!0)})},handleSwitchChatItem:function(t,e){if(t.isSelected){this.chatList[e].isSelected=!1;var a=this.chatListSelected.findIndex(function(e){return e.chat_id===t.chat_id});-1!==a&&this.chatListSelected.splice(a,1)}else this.chatList[e].isSelected=!0,this.chatListSelected=[].concat(s()(this.chatListSelected),[t])},handleDelSelectedChat:function(t){this.chatListSelected.splice(t,1),this.handleGetIsSelectedChatStatus()},handleDelAllSelectedChat:function(){this.chatListSelected=[],this.handleGetIsSelectedChatStatus()},onClickConfirm:function(){this.chatListSelected.length?(this.isDataIdx?this.$emit("change",{idx:this.dataIdx,res:v.a.cloneDeep(this.chatListSelected)}):this.$emit("change",v.a.cloneDeep(this.chatListSelected)),this.dialogVisible=!1):this.$message.warning("请选择群聊")}}},w={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"common-screen-item"},[a("el-popover",{attrs:{"append-to-body":"",placement:"bottom",trigger:"click"},model:{value:t.dialogVisible,callback:function(e){t.dialogVisible=e},expression:"dialogVisible"}},[a("div",{class:["common-screen-self-box","common-input-select",t.chatListResult.length?"common-input-select-hover":""],style:t.width?"width:"+t.width:"",attrs:{slot:"reference"},slot:"reference"},[a("div",{class:["common-screen-self-con",t.chatListResult.length?"":"common-screen-self-placeholder"]},[a("div",{staticClass:"common-screen-self-con-div"},[t.chatListResult.length?a("span",[t._v(t._s(t.chatListResultName))]):a("span",[t._v("请选择群聊")])])]),t._v(" "),a("div",{staticClass:"common-screen-self-icon"},[a("i",{staticClass:"el-icon-arrow-down"})])]),t._v(" "),a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"flex",staticStyle:{padding:"10px"}},[a("div",{staticClass:"propoverItem"},[a("div",{staticClass:"filter-wrap"},[a("el-select",{staticClass:"select-wrap",attrs:{size:"small",placeholder:"全部群主",clearable:""},on:{change:t.onChangeOwner},model:{value:t.owner,callback:function(e){t.owner=e},expression:"owner"}},t._l(t.ownerOptions,function(t){return a("el-option",{key:t.user_id,attrs:{label:t.name,value:t.user_id}})}),1),t._v(" "),a("self-input",{staticStyle:{"margin-top":"0","margin-bottom":"0"},attrs:{reset:t.reset,hasLabel:!1,label_name:"群名称",width:"180px"},on:{inputChange:t.onChangeKeyword}})],1),t._v(" "),a("div",{staticClass:"allMember"},[t._v("全部群聊("+t._s(t.chatList&&t.chatList.length)+"):")]),t._v(" "),a("div",{staticClass:"memberBoxBig self-scrollbar-3"},t._l(t.chatList,function(e,i){return a("div",{key:e.chat_id,staticClass:"memberBox"},[a("div",{staticClass:"meberList"},[a("div",{staticClass:"memberItem",on:{click:function(a){return t.handleSwitchChatItem(e,i)}}},[a("div",{staticClass:"flex",staticStyle:{flex:"1"}},[a("i",{staticClass:"el-icon-chat-dot-round chat-icon"}),t._v(" "),a("div",{staticClass:"memberInfo"},[a("div",{staticClass:"name"},[t._v(t._s(e.name))]),t._v(" "),a("div",{staticClass:"other"},[t._v("群主:"+t._s(e.owner_name))])])]),t._v(" "),a("div",{class:["checkbox",e.isSelected?"checkbox_active":""]},[a("i",{staticClass:"el-icon-check"})])])])])}),0)]),t._v(" "),a("div",{staticClass:"line"}),t._v(" "),a("div",{staticClass:"propoverItem",staticStyle:{"padding-left":"20px"}},[a("div",{staticClass:"title"},[t._v("已选择的群聊")]),t._v(" "),a("div",{staticClass:"choice_result_top"},[a("div",{staticClass:"clear",on:{click:t.handleDelAllSelectedChat}},[t._v("全部清空")]),t._v(" "),a("div",{staticClass:"result_num"},[t._v("已选择"),a("span",[t._v(t._s(t.chatListSelected.length))]),t._v("个群")])]),t._v(" "),a("div",{staticClass:"member_result self-scrollbar-3"},t._l(t.chatListSelected,function(e,i){return a("div",{key:e.chat_id,staticClass:"memberItem"},[a("div",{staticClass:"flex",staticStyle:{flex:"1"}},[a("i",{staticClass:"el-icon-chat-dot-round chat-icon"}),t._v(" "),a("div",{staticClass:"memberInfo"},[a("div",{staticClass:"name"},[t._v(t._s(e.name))]),t._v(" "),a("div",{staticClass:"other"},[t._v("群主:"+t._s(e.owner_name))])])]),t._v(" "),a("i",{staticClass:"el-icon-close",staticStyle:{"margin-left":"10px"},on:{click:function(e){return t.handleDelSelectedChat(i)}}})])}),0),t._v(" "),a("div",{staticClass:"buttons"},[a("el-button",{attrs:{type:"primary",plain:"",size:"mini"},on:{click:function(e){t.dialogVisible=!1}}},[t._v("取消")]),t._v(" "),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.onClickConfirm}},[t._v("确定")])],1)])])])],1)},staticRenderFns:[]};var C=a("VU/8")(b,w,!1,function(t){a("egeS")},"data-v-04ce815f",null).exports,y=a("2Uyi"),x=a("/dO2"),k={components:{editCon:u.a,chatGroupOptions:C},props:{deleteFlag:{type:Boolean,default:!0},editInfo:{type:Object},idx:{type:Number}},data:function(){return{editFlag:!0,tags:[{name:"周一",type:"",value:1},{name:"周二",type:"",value:2},{name:"周三",type:"",value:3},{name:"周四",type:"",value:4},{name:"周五",type:"",value:5},{name:"周六",type:"",value:6},{name:"周日",type:"",value:0}],msg_data_obj:{is_day_parting:1,weeks:[1,2,3,4,5,6,0],start_time:"",end_time:"",content:"",attachments:[],is_invite_group:0,join_type:1,is_limit:0,chat_group_config:[]}}},created:function(){if(this.editInfo){var t=JSON.parse(o()(this.editInfo));t.weeks=t.weeks.map(function(t){return Number(t)}),t.start_time=t.start_time.slice(0,5),t.end_time=t.end_time.slice(0,5),this.msg_data_obj=t}},methods:{getAttachment:function(t){this.msg_data_obj.attachments=t,this.$emit("welcomEditCon",this.msg_data_obj)},dataChange:function(){this.$emit("welcomEditCon",this.msg_data_obj)},deleteEvent:function(){this.$emit("deleteWelcomCon")},onChangeIsInviteGroup:function(t){var e=this;console.log("val => ",t),1==t&&this.$nextTick(function(){e.handleRowDrop()}),this.$emit("welcomEditCon",this.msg_data_obj)},onChangeChatGroup:function(t){var e=this.msg_data_obj.chat_group_config,a=t.map(function(t){return{chat_id:t.chat_id,name:t.name,user_limit:0,enable:1,status:1}});a.forEach(function(t,i){var s=e.find(function(e){return t.chat_id===e.chat_id});s&&a.splice(i,1,s)}),this.msg_data_obj.chat_group_config=[].concat(s()(a)),this.$emit("welcomEditCon",this.msg_data_obj)},onChangeJoinType:function(t){console.log("val => ",t),this.$emit("welcomEditCon",this.msg_data_obj)},handleShowLimitTips:function(){this.msg_data_obj.chat_group_config.length||this.$message.error("请先选择群聊")},onChangeSwitchLimit:function(){this.msg_data_obj.chat_group_config.length?this.$emit("welcomEditCon",this.msg_data_obj):this.$message.error("请先选择群聊")},onInputUserLimit:function(t,e){this.msg_data_obj.chat_group_config[e].user_limit=Object(y.i)(t),this.$emit("welcomEditCon",this.msg_data_obj)},onClickDelChat:function(t,e){if(console.log("msg_data_obj => ",this.msg_data_obj),t.config_id){var a=JSON.parse(o()(t));a.enable=0,this.$emit("deleteChartGroup",{msg_id:this.msg_data_obj.msg_id,chartItem:a})}this.msg_data_obj.chat_group_config.splice(e,1),this.$refs.chatGroupOptions.chatListSelected=[],this.msg_data_obj.chat_group_config.length||(this.msg_data_obj.is_limit=0),this.$emit("welcomEditCon",this.msg_data_obj)},handleRowDrop:function(){var t=this.$refs.tableEl.$refs.bodyWrapper.childNodes[0].childNodes[1],e=this;x.default.create(t,{handle:".drag-handler",onEnd:function(t){var a=t.newIndex,i=t.oldIndex;if(a!=i){e.msg_data_obj.chat_group_config.splice(a,0,e.msg_data_obj.chat_group_config.splice(i,1)[0]);var s=e.msg_data_obj.chat_group_config.slice(0);e.msg_data_obj.chat_group_config=[],e.$nextTick(function(){e.msg_data_obj.chat_group_config=s,e.$refs.chatGroupOptions.chatListSelected=[],e.$emit("welcomEditCon",e.msg_data_obj)})}}})}}},S={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"container"},[a("div",{staticClass:"welcom_edit"},[a("div",{staticClass:"sendData"},[a("div",{staticClass:"dataBox"},[a("label",[t._v("发送日期:")]),t._v(" "),a("el-select",{staticStyle:{flex:"1"},attrs:{multiple:"",placeholder:"请选择发送日期",size:"small"},on:{change:t.dataChange},model:{value:t.msg_data_obj.weeks,callback:function(e){t.$set(t.msg_data_obj,"weeks",e)},expression:"msg_data_obj.weeks"}},t._l(t.tags,function(t){return a("el-option",{key:t.value,attrs:{label:t.name,value:t.value}})}),1)],1),t._v(" "),a("el-time-select",{staticStyle:{width:"100px"},attrs:{size:"small","picker-options":{start:"00:00",step:"00:01",end:"23:59"},placeholder:"开始时间"},on:{change:t.dataChange},model:{value:t.msg_data_obj.start_time,callback:function(e){t.$set(t.msg_data_obj,"start_time",e)},expression:"msg_data_obj.start_time"}}),t._v(" "),a("span",[t._v("~")]),t._v(" "),a("el-time-select",{staticStyle:{width:"100px"},attrs:{size:"small","picker-options":{start:"00:00",step:"00:01",end:"23:59"},placeholder:"结束时间"},on:{change:t.dataChange},model:{value:t.msg_data_obj.end_time,callback:function(e){t.$set(t.msg_data_obj,"end_time",e)},expression:"msg_data_obj.end_time"}})],1),t._v(" "),a("edit-con",{attrs:{source:"welcom",phone_width:"230px",afferent_content:t.msg_data_obj.content,afferent_attachments:t.msg_data_obj.attachments,disabled:!t.editFlag},on:{editContent:function(e){t.msg_data_obj.content=e,t.dataChange()},changeAttachment:t.getAttachment}}),t._v(" "),a("div",[a("span",{staticStyle:{"font-size":"14px",color:"#333"}},[t._v("入群链接:")]),t._v(" "),a("el-switch",{staticStyle:{"margin-left":"10px"},attrs:{"active-value":1,"inactive-value":0,"active-color":"#ff4040","inactive-color":"#ddd"},on:{change:t.onChangeIsInviteGroup},model:{value:t.msg_data_obj.is_invite_group,callback:function(e){t.$set(t.msg_data_obj,"is_invite_group",e)},expression:"msg_data_obj.is_invite_group"}})],1),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:1==t.msg_data_obj.is_invite_group,expression:"msg_data_obj.is_invite_group == 1"}]},[a("div",{staticStyle:{margin:"20px 0 0 75px"}},[a("chatGroupOptions",{ref:"chatGroupOptions",attrs:{width:"300px",isHasRoomId:!0,chatListResult:t.msg_data_obj.chat_group_config},on:{change:t.onChangeChatGroup}})],1),t._v(" "),a("div",{staticStyle:{margin:"20px 0 0 75px"}},[a("el-radio-group",{on:{change:t.onChangeJoinType},model:{value:t.msg_data_obj.join_type,callback:function(e){t.$set(t.msg_data_obj,"join_type",e)},expression:"msg_data_obj.join_type"}},[a("el-radio",{attrs:{label:1}},[t._v("顺序进群")]),t._v(" "),a("el-radio",{attrs:{label:2}},[t._v("随机进群")])],1)],1),t._v(" "),a("div",{staticStyle:{margin:"20px 0 0 75px"}},[a("div",{staticClass:"limitBox",on:{click:t.handleShowLimitTips}},[a("span",{staticStyle:{"font-size":"14px","margin-right":"10px"}},[t._v("群管理")]),t._v(" "),a("el-switch",{attrs:{disabled:!t.msg_data_obj.chat_group_config.length,"active-color":"#ff4040","inactive-color":"#ddd","active-value":1,"inactive-value":0},on:{change:t.onChangeSwitchLimit},model:{value:t.msg_data_obj.is_limit,callback:function(e){t.$set(t.msg_data_obj,"is_limit",e)},expression:"msg_data_obj.is_limit"}})],1)]),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:t.msg_data_obj.is_limit,expression:"msg_data_obj.is_limit"}],staticClass:"listBox"},[a("el-table",{ref:"tableEl",class:["table_"+t.idx],staticStyle:{width:"100%"},attrs:{border:"",data:t.msg_data_obj.chat_group_config,"tooltip-effect":"dark","header-cell-style":function(){return{backgroundColor:"#f9f9f9 !important"}}}},[a("el-table-column",{attrs:{label:"拖拽排序",width:"80",align:"center"},scopedSlots:t._u([{key:"default",fn:function(t){return t.row,[a("div",{staticClass:"drag-handler"},[a("i",{staticClass:"el-icon-rank"})])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"群名称",align:"center",prop:"name"}}),t._v(" "),a("el-table-column",{attrs:{label:"人数上限",align:"center"},scopedSlots:t._u([{key:"header",fn:function(e){return[a("em",{staticStyle:{color:"#ff0000"}},[t._v("*")]),t._v("人数上限\n ")]}},{key:"default",fn:function(e){var i=e.row,s=e.$index;return[a("el-input",{attrs:{size:"mini"},on:{input:function(e){return t.onInputUserLimit(e,s)}},model:{value:i.user_limit,callback:function(e){t.$set(i,"user_limit",e)},expression:"row.user_limit"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"状态",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-color":"#ff4040","inactive-color":"#ddd"},model:{value:i.status,callback:function(e){t.$set(i,"status",e)},expression:"row.status"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作",align:"center",width:"80px"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row,s=e.$index;return[a("div",{staticClass:"c-00B38A pointer lMar8",on:{click:function(e){return t.onClickDelChat(i,s)}}},[t._v("删除")])]}}])})],1)],1)])],1),t._v(" "),t.deleteFlag?a("div",{staticClass:"deleteBox",on:{click:function(e){return e.stopPropagation(),t.deleteEvent.apply(null,arguments)}}},[a("i",{staticClass:"el-icon-delete-solid"})]):t._e()])},staticRenderFns:[]};var L=a("VU/8")(k,S,!1,function(t){a("NYuq")},"data-v-07f7a9d0",null).exports,$={components:{selfCustomerservice:m.a,editCon:u.a,welcomEdit:L,chatGroupOptions:C},data:function(){return{loading:!1,user_id_list:[],is_for_all:0,editFlag:!0,is_day_parting:!1,name:"",deleteTimeIntervalList:[],timeIntervalList:[],init_welcom_con:{is_day_parting:1,weeks:[1,2,3,4,5,6,0],start_time:"",end_time:"",content:"",attachments:[],is_invite_group:0,join_type:1,is_limit:0,chat_group_config:[]},main_msg_data:{is_day_parting:0,weeks:[],start_time:"",end_time:"",content:"",attachments:[],is_invite_group:0,join_type:1,is_limit:0,chat_group_config:[]},dataInfo:{},key_we_index:1,deleteChart:{}}},created:function(){this.$route.params.rule_id?this.detail():this.loading=!1},methods:{handleGoBack:function(){this.$router.replace({path:"/welcomeMsg"})},handleGetAllChatList:function(){var t,e=this;return new h.a((t=_()(c.a.mark(function t(a,i){var s,n,o;return c.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$axios.get(e.URL.BASEURL+e.URL.groupCode_chatGroupList,{params:{keyword:""}});case 2:s=t.sent,n=s.data,(o=void 0===n?{}:n)&&0==o.errno&&Array.isArray(o.rst)?a(o.rst):i([]);case 6:case"end":return t.stop()}},t,e)})),function(e,a){return t.apply(this,arguments)}))},detail:function(){var t,e=this;this.loading=!0,this.$axios.get(this.URL.BASEURL+this.URL.welcomeMsg_detail,{params:{rule_id:this.$route.params.rule_id}}).then((t=_()(c.a.mark(function t(a){var i,s;return c.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:a=a.data,e.loading=!1,a&&0==a.errno?(e.dataInfo=a.rst,e.is_for_all=a.rst.is_for_all,e.user_id_list=a.rst.users?a.rst.users.split(","):[],e.name=a.rst.name,(i=a.rst.msg_list).forEach(function(t){t.content=t.content?t.content.replaceAll("%NICKNAME%","「客户昵称」"):"",t.attachments=t.attachments&&""!=t.attachments?JSON.parse(t.attachments):[],t.weeks?t.weeks=t.weeks.split(","):t.weeks=[],t.chat_group_config=t.chat_group_config?JSON.parse(t.chat_group_config):[],console.log("item.chat_group_config => ",t.chat_group_config),t.chat_group_config.forEach(function(t){t.name=t.chat_group_name||"未设置群名"})}),s=i.filter(function(t){return 0==t.is_day_parting}),e.main_msg_data=s&&s.length>0?s[0]:{},e.timeIntervalList=i.filter(function(t){return 1==t.is_day_parting}),i.length>1&&(e.is_day_parting=!0),e.$nextTick(function(){1==e.main_msg_data.is_invite_group&&e.handleRowDrop(),e.timeIntervalList&&e.timeIntervalList.length&&e.$refs.welcomEditEls.forEach(function(t){t&&t.handleRowDrop()})})):4002!=a.errno&&e.$message({message:a.err,type:"warning"});case 3:case"end":return t.stop()}},t,e)})),function(e){return t.apply(this,arguments)})).catch(function(t){e.loading=!1})},getAttachment:function(t){this.main_msg_data.attachments=t},getWelcomEdit:function(t,e){this.$set(this.timeIntervalList,e,t)},deleteWelcomCon:function(t){var e=this;if(this.$route.params.rule_id&&this.timeIntervalList[t].msg_id){var a=JSON.parse(o()(this.timeIntervalList[t]));a.operate="del",this.deleteTimeIntervalList.push(a)}this.timeIntervalList.splice(t,1),this.key_we_index++,this.$nextTick(function(){e.$refs.welcomEditEls.forEach(function(t){t&&t.handleRowDrop()})})},addWelcom:function(){var t=this;this.timeIntervalList.push(this.init_welcom_con),this.key_we_index++,this.$nextTick(function(){t.$refs.welcomEditEls.forEach(function(t){t&&t.handleRowDrop()})})},switchChange:function(t){var e=this;this.is_day_parting&&0==this.timeIntervalList.length&&this.timeIntervalList.push(this.init_welcom_con),t&&this.timeIntervalList&&this.timeIntervalList.length&&this.$nextTick(function(){e.$refs.welcomEditEls.forEach(function(t){t&&t.handleRowDrop()})})},welcomeMsg_set:function(){var t=this;if(console.log("main_msg_data => ",JSON.parse(o()(this.main_msg_data))),console.log("timeIntervalList => ",JSON.parse(o()(this.timeIntervalList))),0!=this.is_for_all||this.user_id_list&&0!=this.user_id_list.length)if(""!=this.name)if(""!=this.main_msg_data.content||this.main_msg_data.attachments&&""!=this.main_msg_data.attachments&&0!=this.main_msg_data.attachments.length)if(""!=this.main_msg_data.content&&this.$getStrBytes(this.main_msg_data.content)>4e3)this.$message({message:"请检查【主】欢迎语内容,最多4000个字节,已超出!",type:"error"});else{var e=this.main_msg_data,a=e.is_invite_group,i=e.chat_group_config,n=e.join_type,l=e.is_limit;if(1==a){if(!i||!i.length)return void this.$message.warning("请选择【主】欢迎语群聊");if(!n)return void this.$message.warning("请选择【主】欢迎语进群方式");if(1==l)if(i.some(function(t){return 0===Number(t.user_limit)}))return void this.$message.warning("请设置【主】欢迎语群聊人数上限")}if(this.is_day_parting&&this.timeIntervalList&&this.timeIntervalList.length)for(var c=0;c<this.timeIntervalList.length;c++){var r=this.timeIntervalList[c];if(1==r.is_invite_group){if(!r.chat_group_config||!r.chat_group_config.length)return void this.$message.warning("请选择【时段"+(c+1)+"】欢迎语群聊");if(!r.join_type)return void this.$message.warning("请选择【时段"+(c+1)+"】欢迎语进群方式");if(1==r.is_limit)if(r.chat_group_config.some(function(t){return 0===Number(t.user_limit)}))return void this.$message.warning("请设置【时段"+(c+1)+"】欢迎语群聊人数上限")}}var _=[];if(this.is_day_parting){for(var d=0;d<this.timeIntervalList.length;d++){var h=this.timeIntervalList[d];if(""==h.content&&(!h.attachments||""==h.attachments||0==h.attachments.length))return void this.$message({message:"请输入【时段"+(d+1)+"】欢迎语内容!",type:"warning"});if(""!=h.content&&this.$getStrBytes(h.content)>4e3)return void this.$message({message:"请检查【时段"+(d+1)+"】欢迎语内容,最多4000个字节,已超出!",type:"error"});if(!h.weeks||0==h.weeks.length)return void this.$message({message:"请选择【时段"+(d+1)+"】发送日期!",type:"warning"});if(!h.start_time||""==h.start_time)return void this.$message({message:"请输入【时段"+(d+1)+"】发送开始时间!",type:"warning"});if(!h.end_time||""==h.end_time)return void this.$message({message:"请输入【时段"+(d+1)+"】发送结束时间!",type:"warning"});if(this.$date_compatible("2020-04-01 "+h.start_time).getTime()>this.$date_compatible("2020-04-01 "+h.end_time).getTime())return void this.$message({message:"请正确输入【时段"+(d+1)+"】发送时间!",type:"warning"})}_=_.concat(this.timeIntervalList)}else{var m=JSON.parse(o()(this.timeIntervalList));(m=m.filter(function(t){return t.msg_id})).forEach(function(t){t.operate="del"}),this.deleteTimeIntervalList=this.deleteTimeIntervalList.concat(m)}(_=_.concat(this.deleteTimeIntervalList)).push(this.main_msg_data),(_=v.a.cloneDeep(_)).forEach(function(t){if(t.weeks&&t.weeks.length>0){"string"==typeof t.weeks&&(t.weeks=t.weeks.split(","));var e="";t.weeks.forEach(function(t){e+=t+","}),t.weeks=e.slice(0,e.length-1)}else t.weeks="";t.content=t.content.replaceAll("「客户昵称」","%NICKNAME%"),t.attachments=""==t.attachments||t.attachments&&0==t.attachments.length?"":o()(t.attachments),console.log("item => ",t),t.chat_group_config&&t.chat_group_config.length&&t.chat_group_config.forEach(function(t){delete t.sort,delete t.chat_group_name})}),this.$route.params.rule_id&&_.forEach(function(e){e.msg_id&&t.deleteChart[e.msg_id]&&(e.chat_group_config=[].concat(s()(e.chat_group_config),s()(t.deleteChart[e.msg_id])))});var u={rule_id:this.$route.params.rule_id?this.$route.params.rule_id:"",name:this.name,is_for_all:this.is_for_all,users:0==this.is_for_all?this.user_id_list.join(","):"",msg_data:_};console.log("deleteChart => ",this.deleteChart),console.log("params => ",JSON.parse(o()(u))),this.$loading(this.$loadingConfig),this.$axios.post(this.URL.BASEURL+this.URL.welcomeMsg_set,u).then(function(e){e=e.data;t.$loading(t.$loadingConfig).close(),e&&0==e.errno?(t.$message.success("保存成功"),t.handleGoBack()):4002!=e.errno&&t.$message({message:e.err,type:"warning"})}).catch(function(e){t.$loading(t.$loadingConfig).close()})}else this.$message({message:"请输入【主】欢迎语内容!",type:"warning"});else this.$message({message:"请输入欢迎语标题!",type:"warning"});else this.$message({message:"请选择使用成员!",type:"warning"})},onChangeGlobalChatGroup:function(t){var e=this.main_msg_data.chat_group_config,a=t.map(function(t){return{chat_id:t.chat_id,name:t.name,user_limit:0,enable:1,status:1}});a.forEach(function(t,i){var s=e.find(function(e){return t.chat_id===e.chat_id});s&&a.splice(i,1,s)}),this.main_msg_data.chat_group_config=[].concat(s()(a))},handleShowGlobalLimitTips:function(){this.main_msg_data.chat_group_config.length||this.$message.error("请先选择群聊")},onChangeSwitchGlobalLimit:function(){this.main_msg_data.chat_group_config.length||this.$message.error("请先选择群聊")},onInputUserLimit:function(t,e){this.main_msg_data.chat_group_config[e].user_limit=Object(y.i)(t)},onClickDelChat:function(t,e){if(t.config_id){var a=JSON.parse(o()(t));a.enable=0,this.handleSaveDelChartGroup({msg_id:this.main_msg_data.msg_id,chartItem:a})}this.main_msg_data.chat_group_config.splice(e,1),this.$refs.chatGroupOptionsMain.chatListSelected=[],this.main_msg_data.chat_group_config.length||(this.main_msg_data.is_limit=0)},handleRowDrop:function(){var t=document.querySelector(".mainTable .el-table__body-wrapper tbody"),e=this;x.default.create(t,{handle:".drag-handler",onEnd:function(t){var a=t.newIndex,i=t.oldIndex;if(a!=i){e.main_msg_data.chat_group_config.splice(a,0,e.main_msg_data.chat_group_config.splice(i,1)[0]);var s=e.main_msg_data.chat_group_config.slice(0);e.main_msg_data.chat_group_config=[],e.$nextTick(function(){e.main_msg_data.chat_group_config=s,e.$refs.chatGroupOptionsMain.chatListSelected=[]})}}})},onChangeMainIsInviteGroup:function(t){var e=this;console.log("val => ",t),1==t&&this.$nextTick(function(){e.handleRowDrop()})},handleSaveDelChartGroup:function(t){var e=t.msg_id,a=t.chartItem;this.deleteChart[e]?this.deleteChart[e].push(a):(this.deleteChart[e]=[],this.deleteChart[e].push(a))}}},I={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"createMassMsg"},[a("div",{staticClass:"backBox",on:{click:t.handleGoBack}},[t._m(0)]),t._v(" "),t.loading?t._e():a("div",{staticClass:"bg-ffffff",staticStyle:{padding:"15px"}},[a("h3",{staticClass:"bigTitle"},[t._v("\n 基础信息\n "),t.$route.params.rule_id?[1==t.dataInfo.enable?a("span",{staticClass:"detail_status status_ing"},[t._v("可用")]):t._e(),t._v(" "),0==t.dataInfo.enable?a("span",{staticClass:"detail_status status_del"},[t._v("禁用")]):t._e()]:t._e()],2),t._v(" "),t._m(1),t._v(" "),a("div",{staticClass:"regulations"},[t._m(2),t._v(" "),a("div",[a("div",{staticStyle:{display:"flex"}},[a("el-radio",{attrs:{label:1},model:{value:t.is_for_all,callback:function(e){t.is_for_all=e},expression:"is_for_all"}},[t._v("全部员工")]),t._v(" "),a("el-radio",{attrs:{label:0},model:{value:t.is_for_all,callback:function(e){t.is_for_all=e},expression:"is_for_all"}},[t._v("部分员工")])],1),t._v(" "),0==t.is_for_all?a("self-customerservice",{attrs:{title:"",width:"300px",afferent_users:t.user_id_list},on:{customerDefine:function(e){t.user_id_list=e}}}):t._e()],1)]),t._v(" "),a("div",{staticClass:"line",staticStyle:{"margin-top":"20px"}}),t._v(" "),a("h3",{staticClass:"bigTitle"},[t._v("发送欢迎语")]),t._v(" "),a("div",{staticClass:"regulations"},[t._m(3),t._v(" "),a("el-input",{staticStyle:{width:"300px"},attrs:{placeholder:"例:活动推送/拉新等",clearable:"",size:"small"},model:{value:t.name,callback:function(e){t.name="string"==typeof e?e.trim():e},expression:"name"}})],1),t._v(" "),a("div",{staticClass:"regulations"},[t._m(4),t._v(" "),a("edit-con",{attrs:{source:"welcom",afferent_content:t.main_msg_data.content,afferent_attachments:t.main_msg_data.attachments},on:{editContent:function(e){t.main_msg_data.content=e},changeAttachment:t.getAttachment}})],1),t._v(" "),a("h3",{staticClass:"bigTitle",staticStyle:{"margin-top":"20px"}},[t._v("\n 入群链接: "),a("el-switch",{staticStyle:{"margin-left":"30px"},attrs:{"active-value":1,"inactive-value":0,"active-color":"#ff4040","inactive-color":"#ddd"},on:{change:t.onChangeMainIsInviteGroup},model:{value:t.main_msg_data.is_invite_group,callback:function(e){t.$set(t.main_msg_data,"is_invite_group",e)},expression:"main_msg_data.is_invite_group"}})],1),t._v(" "),1==t.main_msg_data.is_invite_group?[a("div",{staticClass:"regulations",staticStyle:{"margin-top":"20px"}},[a("label"),t._v(" "),a("chatGroupOptions",{ref:"chatGroupOptionsMain",attrs:{width:"300px",isHasRoomId:!0,chatListResult:t.main_msg_data.chat_group_config},on:{change:t.onChangeGlobalChatGroup}})],1),t._v(" "),a("div",{staticClass:"regulations",staticStyle:{"margin-top":"20px"}},[a("label"),t._v(" "),a("el-radio-group",{model:{value:t.main_msg_data.join_type,callback:function(e){t.$set(t.main_msg_data,"join_type",e)},expression:"main_msg_data.join_type"}},[a("el-radio",{attrs:{label:1}},[t._v("顺序进群")]),t._v(" "),a("el-radio",{attrs:{label:2}},[t._v("随机进群")])],1)],1),t._v(" "),a("div",{staticClass:"regulations",staticStyle:{"align-items":"center"}},[a("label"),t._v(" "),a("div",{staticClass:"limitBox",on:{click:t.handleShowGlobalLimitTips}},[a("span",{staticStyle:{"font-size":"14px","margin-right":"10px"}},[t._v("群管理")]),t._v(" "),a("el-switch",{attrs:{disabled:!t.main_msg_data.chat_group_config.length,"active-color":"#ff4040","inactive-color":"#ddd","active-value":1,"inactive-value":0},on:{change:t.onChangeSwitchGlobalLimit},model:{value:t.main_msg_data.is_limit,callback:function(e){t.$set(t.main_msg_data,"is_limit",e)},expression:"main_msg_data.is_limit"}})],1)]),t._v(" "),a("div",{directives:[{name:"show",rawName:"v-show",value:t.main_msg_data.is_limit,expression:"main_msg_data.is_limit"}],staticClass:"listBox"},[a("el-table",{staticClass:"mainTable",staticStyle:{width:"100%"},attrs:{border:"",data:t.main_msg_data.chat_group_config,"tooltip-effect":"dark","header-cell-style":function(){return{backgroundColor:"#f9f9f9 !important"}}}},[a("el-table-column",{attrs:{label:"拖拽排序",width:"80",align:"center"},scopedSlots:t._u([{key:"default",fn:function(t){return t.row,[a("div",{staticClass:"drag-handler"},[a("i",{staticClass:"el-icon-rank"})])]}}],null,!1,3189946007)}),t._v(" "),a("el-table-column",{attrs:{label:"群名称",align:"center",prop:"name"}}),t._v(" "),a("el-table-column",{attrs:{label:"人数上限",align:"center"},scopedSlots:t._u([{key:"header",fn:function(e){return[a("em",{staticStyle:{color:"#ff0000"}},[t._v("*")]),t._v("人数上限\n ")]}},{key:"default",fn:function(e){var i=e.row,s=e.$index;return[a("el-input",{attrs:{size:"mini"},on:{input:function(e){return t.onInputUserLimit(e,s)}},model:{value:i.user_limit,callback:function(e){t.$set(i,"user_limit",e)},expression:"row.user_limit"}})]}}],null,!1,1544076383)}),t._v(" "),a("el-table-column",{attrs:{label:"状态",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row;return[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-color":"#ff4040","inactive-color":"#ddd"},model:{value:i.status,callback:function(e){t.$set(i,"status",e)},expression:"row.status"}})]}}],null,!1,4022526434)}),t._v(" "),a("el-table-column",{attrs:{label:"操作",align:"center",width:"80px"},scopedSlots:t._u([{key:"default",fn:function(e){var i=e.row,s=e.$index;return[a("div",{staticClass:"c-00B38A pointer lMar8",on:{click:function(e){return t.onClickDelChat(i,s)}}},[t._v("删除")])]}}],null,!1,938270682)})],1)],1)]:t._e(),t._v(" "),a("h3",{staticClass:"bigTitle",staticStyle:{"margin-top":"20px"}},[t._v("\n 分时段欢迎语:\n "),a("el-switch",{attrs:{"active-color":"#ff4040","inactive-color":"#ddd"},on:{change:t.switchChange},model:{value:t.is_day_parting,callback:function(e){t.is_day_parting=e},expression:"is_day_parting"}})],1),t._v(" "),t.is_day_parting?[t._m(5),t._v(" "),t._l(t.timeIntervalList,function(e,i){return a("div",{key:i+"shiduan"+t.key_we_index,staticClass:"regulations regulations2"},[a("label",{staticStyle:{"margin-top":"30px","text-align":"right"}},[t._v("时段"+t._s(i+1)+":")]),t._v(" "),a("welcom-edit",{ref:"welcomEditEls",refInFor:!0,attrs:{deleteFlag:1!=t.timeIntervalList.length,editInfo:e,idx:i},on:{welcomEditCon:function(e){t.getWelcomEdit(e,i)},deleteWelcomCon:function(e){return t.deleteWelcomCon(i)},deleteChartGroup:t.handleSaveDelChartGroup}})],1)}),t._v(" "),a("div",{staticClass:"add_welcom_hint",on:{click:t.addWelcom}},[a("i",{staticClass:"el-icon-circle-plus-outline"}),t._v(" "),a("span",[t._v("添加分时段欢迎语")])])]:t._e(),t._v(" "),t._m(6),t._v(" "),a("button",{staticClass:"button",on:{click:t.welcomeMsg_set}},[t._v("保存")])],2)])},staticRenderFns:[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"back"},[e("i",{staticClass:"el-icon-back"}),this._v(" "),e("span",[this._v("返回")])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"self-hint",staticStyle:{"margin-top":"10px",width:"730px"}},[e("i",{staticClass:"el-icon-message-solid"}),this._v(" "),e("div",[e("p",[this._v("\n 1、在渠道码处设置的欢迎语会被优先推送,如果成员在渠道码处设置了欢迎语,在此设置的欢迎语不会生效\n ")]),this._v(" "),e("p",[this._v("\n 2、一个成员如果被设置了多个欢迎语,将会使用最新设置或修改的欢迎语。\n ")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("label",[e("em",[this._v("*")]),this._v("使用成员:")])},function(){var t=this.$createElement,e=this._self._c||t;return e("label",[e("em",[this._v("*")]),this._v("欢迎语标题")])},function(){var t=this.$createElement,e=this._self._c||t;return e("label",{staticStyle:{"margin-top":"4px"}},[e("em",[this._v("*")]),this._v("欢迎语")])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"self-hint",staticStyle:{"margin-top":"20px",width:"750px","margin-left":"70px"}},[e("p",[this._v("分时段欢迎语 :")]),this._v(" "),e("div",[e("p",[this._v("1、员工上下班不同时间段可设置不同欢迎语;")]),this._v(" "),e("p",[this._v("2、分时段之外的时间将发送欢迎语。")])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"self-hint",staticStyle:{"margin-top":"20px",width:"750px","margin-left":"70px"}},[e("i",{staticClass:"el-icon-message-solid"}),this._v(" "),e("div",[e("p",[this._v("1、新建欢迎语最多可发送1条文字消息和9个附件")]),this._v(" "),e("p",[this._v("2、文字消息和附件不能同时为空,当两者均填写时用户会收到多条消息")]),this._v(" "),e("p",[this._v("\n 3、欢迎语将在客户加为好友后20秒内下发,因网络延迟可能造成发送不成功\n ")])])])}]};var j=a("VU/8")($,I,!1,function(t){a("KWP3")},"data-v-0d30e80c",null);e.default=j.exports},egeS:function(t,e){}});