1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-e771f9c6"],{"0f0e":function(t,e,a){"use strict";var i=a("c4c8"),n={name:"userLabel",props:{},data:function(){return{labelList:[],dataLabel:[],isUser:!1}},mounted:function(){},methods:{inArray:function(t,e){for(var a in e)if(e[a].id===t)return!0;return!1},userLabel:function(t){var e=this;this.dataLabel=t,Object(i.hb)().then((function(t){t.data.map((function(t){t.children&&t.children.length&&(e.isUser=!0,t.children.map((function(t){e.inArray(t.id,e.dataLabel)?t.disabled=!0:t.disabled=!1})))})),e.labelList=t.data})).catch((function(t){e.$Message.error(t.msg)}))},selectLabel:function(t){if(t.disabled){var e=this.dataLabel.indexOf(this.dataLabel.filter((function(e){return e.id===t.id}))[0]);this.dataLabel.splice(e,1),t.disabled=!1}else this.dataLabel.push({label_name:t.label_name,id:t.id,tag_id:t.tag_id}),t.disabled=!0},subBtn:function(){this.$emit("activeData",JSON.parse(JSON.stringify(this.dataLabel)))},cancel:function(){this.$emit("close")}}},r=(a("47fb"),a("2877")),o=Object(r.a)(n,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"label-wrapper"},[a("div",{staticClass:"list-box"},[t._l(t.labelList,(function(e,i){return t.isUser?a("div",{key:i,staticClass:"label-box"},[e.children&&e.children.length?a("div",{staticClass:"title"},[t._v("\n "+t._s(e.label_name)+"\n ")]):t._e(),e.children&&e.children.length?a("div",{staticClass:"list"},t._l(e.children,(function(e,i){return a("div",{key:i,staticClass:"label-item",class:{on:e.disabled},on:{click:function(a){return t.selectLabel(e)}}},[t._v("\n "+t._s(e.label_name)+"\n ")])})),0):t._e()]):t._e()})),t.isUser?t._e():a("div",[t._v("暂无标签")])],2),a("div",{staticClass:"footer"},[a("Button",{staticClass:"btns",attrs:{type:"primary"},on:{click:t.subBtn}},[t._v("确定")]),a("Button",{staticClass:"btns",attrs:{type:"primary",ghost:""},on:{click:t.cancel}},[t._v("取消")])],1)])}),[],!1,null,"ea2c8f16",null);e.a=o.exports},"1ef0":function(t,e,a){},"47fb":function(t,e,a){"use strict";var i=a("702e");a.n(i).a},"676d":function(t,e,a){"use strict";var i=a("1ef0");a.n(i).a},"6ed2":function(t,e,a){"use strict";a.r(e);var i=a("2f62"),n=a("b0e7"),r=a("c297"),o=a("0f0e"),s=a("9b41"),l=a("d708");function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function u(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,i)}return a}function m(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var d={data:function(){return{roterPre:l.a.roterPre,formItem:{name:"",chat_id:[],group_name:"",group_num:0,label:[],auth_group_chat:0},labelList:[],gridBtn:{xl:4,lg:8,md:8,sm:8,xs:8},gridPic:{xl:6,lg:8,md:12,sm:12,xs:12},groupColumn:[{type:"selection",width:60,align:"center"},{title:"群名称",key:"name",minWidth:80,align:"center"},{title:"群主",slot:"ownerInfo",minWidth:100,align:"center"},{title:"群公告",slot:"notice",minWidth:100,align:"center"},{title:"管理员",slot:"admin_user_list",minWidth:80,align:"center"},{title:"创建时间",key:"group_create_time",minWidth:110,align:"center"},{title:"群人数",key:"member_num",minWidth:80,align:"center"},{title:"退群人数",key:"retreat_group_num",minWidth:80,align:"center"}],groupData:[],groupForm:{page:1,limit:15},rontineObj:{msgtype:"miniprogram",miniprogram:{pic_url:"",pic_media_id:"",title:"",appid:"",page:""}},imageObj:{msgtype:"image",image:{media_id:"",pic_url:""}},groupStatus:!1,userLoading:!1,picTit:"",modalPic:!1,modalRoutine:!1,isChoice:"单选",activeDepartment:{},isSite:!0,onlyDepartment:!1,openType:"",userList:[],selectGroup:[],ruleValidate:{name:[{required:!0,message:"二维码名称不能为空",trigger:"blur"}]},labelShow:!1,dataLabel:[]}},components:{uploadPictures:n.a,department:r.a,userLabel:o.a},computed:function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?u(a,!0).forEach((function(e){m(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):u(a).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}({},Object(i.e)("admin/layout",["isMobile","menuCollapse"]),{labelWidth:function(){return this.isMobile?void 0:80},labelPosition:function(){return this.isMobile?"top":"left"}}),watch:{dataLabel:function(t){this.formItem.label=t.map((function(t){return t.tag_id}))}},mounted:function(){"0"!==this.$route.params.id&&this.$route.params.id&&this.getInfo(),this.getWorkGroupChat()},methods:{getWorkGroupChat:function(){var t=this;this.userLoading=!0,Object(s.G)(this.groupForm).then((function(e){t.groupData=e.data,t.userLoading=!1})).catch((function(e){t.$Message.error(e.msg),t.userLoading=!1}))},addGroup:function(){this.groupStatus=!0},selectAll:function(t){t.length&&(this.selectGroup=t)},handleSelectRow:function(t){this.selectGroup=t},groupConfirm:function(){this.formItem.chat_id=this.selectGroup.map((function(t){return{chat_id:t.chat_id,name:t.name}}))},groupChange:function(t){this.groupForm.page=t,this.getWorkGroupChat()},modalPicTap:function(t){this.modalPic=!0,this.picTit=t},addRoutine:function(){this.rontineObj.miniprogram.pic_url="",this.rontineObj.miniprogram.title="",this.rontineObj.miniprogram.appid="",this.rontineObj.miniprogram.page="",this.modalRoutine=!0},addUser:function(t,e){switch(this.$refs.department.memberStatus=!0,t){case"one":this.$refs.department.openType="one";break;case"two":this.$refs.department.openType="two"}},changeMastart:function(t,e){if("one"==e)if(t.length&&t.length>1){this.$Message.warning("群主只能选择一个");var a=t.slice(0,1);this.formItem.owner=a.map((function(t){return{userid:t.userid,name:t.name}}))}else this.formItem.owner=t.map((function(t){return{userid:t.userid,name:t.name}}));else"two"==e&&(this.formItem.admin_user=t.map((function(t){return{userid:t.userid,name:t.name}})))},handleDel:function(t,e){var a=this.formItem.chat_id.findIndex((function(t){return t.name==e}));this.formItem.chat_id.splice(a,1)},wordsDel:function(t){var e=this.formItem.welcome_words.attachments.indexOf(t);this.formItem.welcome_words.attachments.splice(e,1)},getPic:function(t){switch(this.picTit){case"image":this.imageObj.image.pic_url=t.att_dir,this.formItem.welcome_words.attachments.push(this.imageObj);break;case"routine":this.rontineObj.miniprogram.pic_url=t.att_dir}this.modalPic=!1},insertName:function(){this.formItem.welcome_words.text.content="##客户名称##"},routineConfirm:function(){var t=this.deepClone(this.rontineObj);this.formItem.welcome_words.attachments.push(t)},routineCancel:function(){},getWorkLabel:function(){var t=this;Object(s.P)().then((function(e){t.mapTree(e.data)}))},mapTree:function(t){for(var e=0;e<t.length;e++){for(var a=0;a<this.formItem.label.length;a++)this.formItem.label[a]===t[e].value&&this.dataLabel.push({label_name:t[e].label,id:t[e].id,tag_id:t[e].value});Array.isArray(t[e].children)&&this.mapTree(t[e].children)}},getInfo:function(){var t=this;Object(s.b)(this.$route.params.id).then((function(e){t.formItem=e.data,t.formItem.chat_id=t.formItem.chatList,t.getWorkLabel()}))},submit:function(){var t=this;if(!this.formItem.chat_id.length)return this.$Message.error("请添加群聊");var e=this.deepClone(this.formItem);e.chat_id=e.chat_id.map((function(t){return t.chat_id})),this.$route.params.id?(delete e.chatList,delete e.labelList,Object(s.a)(this.$route.params.id,e).then((function(e){t.$Message.success("修改自动拉群成功"),t.$router.push(t.roterPre+"/work/auth_group")}))):Object(s.m)(e).then((function(e){t.$Message.success("保存成功"),t.$router.push(t.roterPre+"/work/auth_group")})).catch((function(e){t.$Message.error(e.msg)}))},deepClone:function(t){var e=Array.isArray(t)?[]:{};if(t&&"object"===c(t))for(var a in t)t.hasOwnProperty(a)&&(e[a]=t&&"object"===c(t[a])?this.deepClone(t[a]):t[a]);return e},openLabel:function(){this.labelShow=!0,this.$refs.userLabel.userLabel(JSON.parse(JSON.stringify(this.dataLabel)))},activeData:function(t){this.labelShow=!1,this.dataLabel=t},labelClose:function(){this.labelShow=!1},closeLabel:function(t){var e=this.dataLabel.indexOf(this.dataLabel.filter((function(e){return e.id==t.id}))[0]);this.dataLabel.splice(e,1)}}},p=(a("676d"),a("2877")),f=Object(p.a)(d,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"i-layout-page-header"},[a("PageHeader",{staticClass:"product_tabs",attrs:{"hidden-breadcrumb":""}},[a("div",{attrs:{slot:"title"},slot:"title"},[a("div",{staticClass:"float-l"},[a("router-link",{attrs:{to:{path:t.roterPre+"/work/auth_group"}}},[a("div",{staticClass:"font-sm after-line"},[a("span",{staticClass:"iconfont iconfanhui"}),a("span",{staticClass:"pl10"},[t._v("返回")])])])],1),a("span",{staticClass:"mr20 ml16"},[t._v("新建自动拉群")])])])],1),a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[a("Form",{attrs:{model:t.formItem,"label-width":110,"label-colon":!0,rules:t.ruleValidate}},[a("FormItem",{attrs:{label:"二维码名称",prop:"name"}},[a("Input",{staticClass:"input-add",attrs:{placeholder:"请输入二维码名称"},model:{value:t.formItem.name,callback:function(e){t.$set(t.formItem,"name",e)},expression:"formItem.name"}})],1),a("FormItem",{attrs:{label:"选择群聊",required:""}},[a("Button",{on:{click:function(e){return t.addGroup()}}},[t._v("添加群聊")]),a("div",{staticClass:"mt10"},t._l(t.formItem.chat_id,(function(e,i){return a("Tag",{key:i,attrs:{closable:"",name:e.name,size:"medium"},on:{"on-close":t.handleDel}},[t._v(t._s(e.name))])})),1)],1),a("FormItem",{attrs:{label:"自动建群"}},[a("i-switch",{attrs:{size:"large","true-value":1,"false-value":0},model:{value:t.formItem.auth_group_chat,callback:function(e){t.$set(t.formItem,"auth_group_chat",e)},expression:"formItem.auth_group_chat"}},[a("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),a("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])]),a("div",{staticClass:"desc"},[t._v("\n 开启时,选择群聊群人数达到上限后,将以原群主身份自动创建新群聊\n ")])],1),t.formItem.auth_group_chat?a("FormItem",{attrs:{label:"设置群名称"}},[a("Input",{staticClass:"input-add",attrs:{placeholder:"请输入群名称"},model:{value:t.formItem.group_name,callback:function(e){t.$set(t.formItem,"group_name",e)},expression:"formItem.group_name"}})],1):t._e(),t.formItem.auth_group_chat?a("FormItem",{attrs:{label:"群序号"}},[a("InputNumber",{attrs:{"controls-outside":"",min:0,max:999},model:{value:t.formItem.group_num,callback:function(e){t.$set(t.formItem,"group_num",e)},expression:"formItem.group_num"}}),a("div",{staticClass:"desc"},[t._v("\n 群序列号将在自动创建群时自动增加,比如设置的群名为:西安客户群,设置的序列表为:5,那么自动建群的名称为:西安客户群5,西安客户群6,西安客户群7,西安客户群8。\n ")])],1):t._e(),a("FormItem",{attrs:{label:"客户标签"}},[a("div",{staticClass:"acea-row row-between-wrapper label-content",on:{click:t.openLabel}},[a("div",{staticClass:"label-inner"},[t.dataLabel.length?a("div",t._l(t.dataLabel,(function(e){return a("Tag",{key:e.tag_id,attrs:{closable:""},on:{"on-close":function(a){return t.closeLabel(e)}}},[t._v(t._s(e.label_name))])})),1):a("span",{staticClass:"placeholder"},[t._v("请选择")])]),a("div",{staticClass:"iconfont iconxiayi"})])])],1)],1),a("Card",{staticClass:"fixed-card",style:{left:t.menuCollapse?t.isMobile?"0":"80px":"200px"},attrs:{bordered:!1,"dis-hover":""}},[a("div",{staticClass:"acea-row row-center-wrapper"},[a("Button",{staticClass:"step_btn",attrs:{type:"primary"},on:{click:function(e){return t.submit()}}},[t._v("保存")])],1)]),a("Modal",{attrs:{width:"960px",scrollable:"","footer-hide":"",closable:"",title:"logo","mask-closable":!1,"z-index":9},model:{value:t.modalPic,callback:function(e){t.modalPic=e},expression:"modalPic"}},[t.modalPic?a("uploadPictures",{attrs:{isChoice:t.isChoice,gridBtn:t.gridBtn,gridPic:t.gridPic},on:{getPic:t.getPic}}):t._e()],1),a("Modal",{attrs:{title:"添加小程序消息","z-index":1},on:{"on-ok":t.routineConfirm},model:{value:t.modalRoutine,callback:function(e){t.modalRoutine=e},expression:"modalRoutine"}},[a("Form",{attrs:{model:t.formItem,"label-width":110,"label-colon":!0}},[a("FormItem",{attrs:{label:"小程序功能页"}},[a("div",{staticClass:"picBox",on:{click:function(e){return t.modalPicTap("routine")}}},[t.rontineObj.miniprogram.pic_url?a("div",{staticClass:"pictrue"},[a("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.rontineObj.miniprogram.pic_url,expression:"rontineObj.miniprogram.pic_url"}]})]):a("div",{staticClass:"upLoad"},[a("div",{staticClass:"iconfont"},[t._v("+")])])])]),a("FormItem",{attrs:{label:"小程序消息标题"}},[a("Input",{model:{value:t.rontineObj.miniprogram.title,callback:function(e){t.$set(t.rontineObj.miniprogram,"title",e)},expression:"rontineObj.miniprogram.title"}})],1),a("FormItem",{attrs:{label:"小程序Appid"}},[a("Input",{model:{value:t.rontineObj.miniprogram.appid,callback:function(e){t.$set(t.rontineObj.miniprogram,"appid",e)},expression:"rontineObj.miniprogram.appid"}})],1),a("FormItem",{attrs:{label:"小程序功能页"}},[a("Input",{model:{value:t.rontineObj.miniprogram.page,callback:function(e){t.$set(t.rontineObj.miniprogram,"page",e)},expression:"rontineObj.miniprogram.page"}})],1)],1)],1),a("Modal",{attrs:{title:"客户群列表",width:"900"},on:{"on-ok":t.groupConfirm},model:{value:t.groupStatus,callback:function(e){t.groupStatus=e},expression:"groupStatus"}},[a("Table",{attrs:{columns:t.groupColumn,data:t.groupData.list,loading:t.userLoading},on:{"on-select-all":t.selectAll,"on-select-all-cancel":t.selectAll,"on-selection-change":t.handleSelectRow},scopedSlots:t._u([{key:"avatar",fn:function(t){var e=t.row;return[a("viewer",{staticClass:"acea-row row-center"},[a("div",{staticClass:"tabBox_img"},[a("img",{directives:[{name:"lazy",rawName:"v-lazy",value:e.client.avatar,expression:"row.client.avatar"}]})])])]}},{key:"ownerInfo",fn:function(e){var i=e.row;return[a("span",[t._v(t._s(i.ownerInfo.name))])]}},{key:"admin_user_list",fn:function(e){var i=e.row;return t._l(i.admin_user_list,(function(e,i){return a("span",{key:i},[t._v(t._s(e.name))])}))}},{key:"notice",fn:function(e){var i=e.row;return[a("Tooltip",{attrs:{"max-width":"200",placement:"bottom"}},[a("span",{staticClass:"line2"},[t._v(t._s(i.notice))]),a("p",{attrs:{slot:"content"},slot:"content"},[t._v(t._s(i.notice))])])]}},{key:"name",fn:function(e){var i=e.row;return[a("span",[t._v(t._s(i.client.name))])]}}])}),a("div",{staticClass:"acea-row row-right page"},[a("Page",{attrs:{total:t.groupData.count,current:t.groupForm.page,"show-elevator":"","show-total":"","page-size":t.groupForm.limit},on:{"on-change":t.groupChange}})],1)],1),a("department",{ref:"department",attrs:{"active-department":t.activeDepartment,"is-site":t.isSite,userList:t.userList,"only-department":t.onlyDepartment},on:{changeMastart:t.changeMastart}}),a("Modal",{attrs:{scrollable:"",title:"选择用户标签",closable:!0,width:"540","footer-hide":!0,"mask-closable":!1},model:{value:t.labelShow,callback:function(e){t.labelShow=e},expression:"labelShow"}},[a("userLabel",{ref:"userLabel",on:{activeData:t.activeData,close:t.labelClose}})],1)],1)}),[],!1,null,"239b078a",null);e.default=f.exports},"702e":function(t,e,a){}}]);
|