企微助手 ,仓库名 短剧

28.7e03f902b765f19511c3.js 35KB

1
  1. webpackJsonp([28],{"+D0u":function(t,e){},"2AOa":function(t,e){},"Y7+5":function(t,e){},iTi3:function(t,e){},kWF3:function(t,e){},rFjy:function(t,e){},wNNy:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=i("Xxa5"),n=i.n(a),s=i("exGp"),l=i.n(s),o=i("erru"),r=i("McOJ"),c=i("woOf"),u=i.n(c),d=i("ucpI"),p={name:"uploadMaterials",components:{imgCutter:d.a},props:{uploadVisible:{type:Boolean,default:function(){return!1}},platformList:{type:Array},groupList:{type:Array}},data:function(){return{imgCutterVisible:!1,oss_url:"",loading:!1,fileData:{admin_id:this.$cookie.getCookie("admin_id"),ttl:this.$cookie.getCookie("ttl"),sign:this.$cookie.getCookie("sign"),corpid:this.$localSelfStore.getLocal("defaultCorp")&&"undefined"!=this.$localSelfStore.getLocal("defaultCorp")?JSON.parse(this.$localSelfStore.getLocal("defaultCorp")).corpid:"",type:1},fileList:[],successFile:[],operate_index:-1}},created:function(){},methods:{handleCancel:function(){this.successFile=[],this.$emit("cancel")},handleConfirm:function(){var t=this;return l()(n.a.mark(function e(){var i,a,s,l,o,r;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=!1,t.successFile.forEach(function(t){""==t.title&&(i=!0)}),!i){e.next=5;break}return t.$message({message:"请填写图片名称!",type:"fail"}),e.abrupt("return");case 5:return e.prev=5,t.$loading(t.$loadingConfig),a=""+t.URL.BASEURL+t.URL.media_editMedia,s={media_data:t.successFile},e.next=11,t.$axios.post(a,s);case 11:l=e.sent,o=l.data,(r=void 0===o?{}:o)&&0==r.errno&&r.rst?(t.$message.success("上传成功!"),t.successFile=[],t.$emit("cancel","success")):4002!=r.errno&&t.$message.warning(r.err),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(5),console.log(e.t0);case 20:return e.prev=20,t.$loading(t.$loadingConfig).close(),e.finish(20);case 23:case"end":return e.stop()}},e,t,[[5,17,20,23]])}))()},openImgCutter:function(t,e){t.url?(this.operate_index=e,this.oss_url=t.url.replace("http://playlet.oss-cn-beijing.aliyuncs.com/","http://dj.wenxingshuju.com/oss_image/"),this.imgCutterVisible=!0):this.$message.warning("图片不存在,无法进行图片裁剪!")},imgCutterCallback:function(t){this.imgCutterVisible=!1,t.flag&&(this.successFile[this.operate_index]=u()(this.successFile[this.operate_index],t.data))},removeImg:function(t){this.successFile.splice(t,1)},uploadSuccess:function(t,e){if(this.$loading(this.$loadingConfig).close(),0==t.errno){var i=u()({group_id:"",platform_id:"",type:1,title:e.name.split(".")[0]},t.rst);this.successFile.push(i)}else this.$message({message:t.err,type:"warning"})},beforeUploadUpload:function(t){this.$loading(this.$loadingConfig)},uploadFail:function(t){this.$loading(this.$loadingConfig).close(),this.$message({message:"上传失败",type:"fail"});var e=this.$refs.upload.uploadFiles.findIndex(function(e){return e.uid===t.uid});this.$refs.upload.uploadFiles.splice(e,1)}}},g={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dialog",{staticClass:"group-dialog",attrs:{visible:t.uploadVisible,"before-close":t.handleCancel,"close-on-click-modal":!1,"close-on-press-escape":!1,width:"600px"},on:{"update:visible":function(e){t.uploadVisible=e}}},[i("div",{attrs:{slot:"title"},slot:"title"},[i("span",[t._v("上传素材")])]),t._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"form-wrap"},[i("el-upload",{ref:"upload",staticClass:"upload-demo",attrs:{action:t.URL.BASEURL+t.URL.media_upload,"on-success":t.uploadSuccess,"on-progress":t.beforeUploadUpload,"on-error":t.uploadFail,"file-list":t.fileList,accept:".jpg,.jpeg,.png",name:"file",data:t.fileData,"show-file-list":!1,multiple:"",drag:""}},[i("i",{staticClass:"el-icon-upload"}),t._v(" "),i("div",{staticClass:"el-upload__text"},[t._v("将图片拖到此处,或"),i("em",[t._v("点击上传")])]),t._v(" "),i("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("*图片仅支持png或jpg格式,且文件大小不得超过10M。")])]),t._v(" "),i("div",{staticClass:"uploadSuccessContatainer"},t._l(t.successFile,function(e,a){return i("div",{key:a+"uploadImg",staticClass:"successItem"},[i("div",{staticClass:"imgBox"},[i("el-image",{staticClass:"img",attrs:{src:e.url,lazy:"","preview-src-list":[e.url]}})],1),t._v(" "),i("div",{staticClass:"imgItemInfo"},[i("div",{staticClass:"form-item"},[i("span",{staticClass:"lable"},[i("em",[t._v("*")]),t._v("图片名称")]),t._v(" "),i("el-input",{attrs:{size:"small",placeholder:"请输入名称",clearable:""},model:{value:e.title,callback:function(i){t.$set(e,"title",i)},expression:"item.title"}})],1),t._v(" "),i("div",{staticClass:"form-item"},[i("span",{staticClass:"lable"},[t._v("所属平台")]),t._v(" "),i("el-select",{attrs:{size:"small",clearable:"",placeholder:"请选择"},model:{value:e.platform_id,callback:function(i){t.$set(e,"platform_id",i)},expression:"item.platform_id"}},t._l(t.platformList,function(t){return i("el-option",{key:t.platform_id,attrs:{label:t.platform_name,value:t.platform_id}})}),1)],1),t._v(" "),i("div",{staticClass:"form-item"},[i("span",{staticClass:"lable"},[t._v("分组")]),t._v(" "),i("el-select",{attrs:{size:"small",clearable:"",placeholder:"请选择"},model:{value:e.group_id,callback:function(i){t.$set(e,"group_id",i)},expression:"item.group_id"}},t._l(t.groupList,function(t){return i("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}),1)],1)]),t._v(" "),i("div",{staticClass:"imgBtn"},[i("el-button",{attrs:{type:"primary",size:"mini",plain:""},on:{click:function(i){return t.openImgCutter(e,a)}}},[t._v("图片裁剪")]),t._v(" "),i("el-button",{attrs:{type:"danger",size:"mini",plain:""},on:{click:function(e){return t.removeImg(a)}}},[t._v("移除图片")])],1)])}),0)],1),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"mini"},on:{click:t.handleCancel}},[t._v("取 消")]),t._v(" "),i("el-button",{attrs:{size:"mini",type:"primary",disabled:t.loading},on:{click:t.handleConfirm}},[t._v("确 定")])],1),t._v(" "),i("el-dialog",{attrs:{width:"840px",title:"图片裁剪",visible:t.imgCutterVisible,"append-to-body":""},on:{"update:visible":function(e){t.imgCutterVisible=e}}},[t.imgCutterVisible?i("imgCutter",{attrs:{target:t.oss_url,source:"uploadMaterials"},on:{imgCutterCallback:t.imgCutterCallback}}):t._e()],1)],1)},staticRenderFns:[]};var m=i("VU/8")(p,g,!1,function(t){i("+D0u")},"data-v-56002315",null).exports,f=i("mvHQ"),h=i.n(f),v={props:{dialogVisible:{type:Boolean,default:function(){return!1}}},data:function(){return{loading:!1,fileList:[],fileData:{admin_id:this.$cookie.getCookie("admin_id"),ttl:this.$cookie.getCookie("ttl"),sign:this.$cookie.getCookie("sign"),corpid:this.$localSelfStore.getLocal("defaultCorp")&&"undefined"!=this.$localSelfStore.getLocal("defaultCorp")?JSON.parse(this.$localSelfStore.getLocal("defaultCorp")).corpid:"",type:1}}},computed:{title:function(){return"更换图片"}},watch:{dialogVisible:function(t){t||this.$refs.upload.clearFiles()}},methods:{handleExceed:function(t,e){this.$message.error("最多只能上传一张图片")},beforeAvatarUpload:function(t){var e=t.size/1024/1024<10;return e||this.$message.error("上传头像图片大小不能超过 10MB!"),e},uploadSuccess:function(t,e){this.$loading(this.$loadingConfig).close(),0==t.errno?this.$message({message:"上传成功",type:"success"}):this.$message({message:t.err,type:"warning"})},beforeUploadUpload:function(t){this.$loading(this.$loadingConfig)},uploadFail:function(t){this.$loading(this.$loadingConfig).close(),this.$message({message:"上传失败",type:"fail"});var e=this.$refs.upload.uploadFiles.findIndex(function(e){return e.uid===t.uid});this.$refs.upload.uploadFiles.splice(e,1)},handleCancel:function(){this.$emit("cancel")},handleConfirm:function(){var t=this.$refs.upload.uploadFiles;if(!t||!t.length)return this.$message.warning("请上传更换图片");this.$emit("confirm",t[0].response.rst.url)}}},_={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dialog",{staticClass:"selectImg-dialog",attrs:{visible:t.dialogVisible,"before-close":t.handleCancel,title:t.title,width:"550px","close-on-click-modal":!1,"append-to-body":""},on:{"update:visible":function(e){t.dialogVisible=e}}},[i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"content-wrap"},[i("el-upload",{ref:"upload",staticClass:"upload-demo",attrs:{action:t.URL.BASEURL+t.URL.media_upload,"before-upload":t.beforeAvatarUpload,"on-success":t.uploadSuccess,"on-progress":t.beforeUploadUpload,"on-error":t.uploadFail,"on-exceed":t.handleExceed,"file-list":t.fileList,accept:".jpg,.jpeg,.png",name:"file",data:t.fileData,"show-file-list":!0,"list-type":"picture",multiple:!1,limit:1,drag:""}},[i("div",[i("i",{staticClass:"el-icon-upload"}),t._v(" "),i("div",{staticClass:"el-upload__text"},[t._v("将图片拖到此处,或"),i("em",[t._v("点击上传")])]),t._v(" "),i("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("*图片仅支持png或jpg格式,且文件大小不得超过10M。")])])])],1),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"mini"},on:{click:t.handleCancel}},[t._v("关 闭")]),t._v(" "),i("el-button",{attrs:{size:"mini",type:"primary"},on:{click:t.handleConfirm}},[t._v("确 定")])],1)])},staticRenderFns:[]};var C=i("VU/8")(v,_,!1,function(t){i("Y7+5")},"data-v-4044eb4a",null).exports,b={name:"uploadMaterials",components:{imgCutter:d.a,selectImgDialog:C},props:{editVisible:{type:Boolean,default:function(){return!1}},platformList:{type:Array},groupList:{type:Array},editData:{type:Object}},data:function(){return{imgCutterVisible:!1,oss_url:"",loading:!1,successFile:[],material:{},selectImgVisible:!1}},watch:{editData:function(){this.material=JSON.parse(h()(this.editData))}},created:function(){},methods:{handleCancel:function(){this.material={},this.$emit("cancel")},handleConfirm:function(){var t=this;return l()(n.a.mark(function e(){var i,a,s,l,o;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(""!=t.material.title){e.next=3;break}return t.$message({message:"请填写图片名称!",type:"fail"}),e.abrupt("return");case 3:return t.material=u()({type:1},t.material),e.prev=4,t.$loading(t.$loadingConfig),i=""+t.URL.BASEURL+t.URL.media_editMedia,a={media_data:[t.material]},e.next=10,t.$axios.post(i,a);case 10:s=e.sent,l=s.data,(o=void 0===l?{}:l)&&0==o.errno&&o.rst?(t.$message.success("编辑成功!"),t.material={},t.$emit("cancel","success")):4002!=o.errno&&t.$message.warning(o.err),e.next=19;break;case 16:e.prev=16,e.t0=e.catch(4),console.log(e.t0);case 19:return e.prev=19,t.$loading(t.$loadingConfig).close(),e.finish(19);case 22:case"end":return e.stop()}},e,t,[[4,16,19,22]])}))()},openImgCutter:function(){this.material.url?(this.oss_url=this.material.url.replace("http://playlet.oss-cn-beijing.aliyuncs.com/","http://dj.wenxingshuju.com/oss_image/"),this.imgCutterVisible=!0):this.$message.warning("图片不存在,无法进行图片裁剪!")},imgCutterCallback:function(t){this.imgCutterVisible=!1,t.flag&&(this.material=u()(this.material,t.data))},onClickSelectImg:function(){this.selectImgVisible=!0},onConfirmSelectImg:function(t){this.material.url=t,this.selectImgVisible=!1},onCancelSelectImg:function(){this.selectImgVisible=!1}}},k={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dialog",{staticClass:"group-dialog",attrs:{visible:t.editVisible,"before-close":t.handleCancel,"close-on-click-modal":!1,"close-on-press-escape":!1,width:"500px"},on:{"update:visible":function(e){t.editVisible=e}}},[i("div",{attrs:{slot:"title"},slot:"title"},[i("span",[t._v("素材编辑")])]),t._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"form-wrap"},[i("div",{staticClass:"imgItemInfo"},[i("div",{staticClass:"form-item"},[i("span",{staticClass:"lable"},[i("em",[t._v("*")]),t._v("图片名称")]),t._v(" "),i("el-input",{attrs:{size:"small",placeholder:"请输入名称",clearable:""},model:{value:t.material.title,callback:function(e){t.$set(t.material,"title",e)},expression:"material.title"}})],1),t._v(" "),i("div",{staticClass:"form-item"},[i("span",{staticClass:"lable"},[t._v("所属平台")]),t._v(" "),i("el-select",{attrs:{size:"small",clearable:"",placeholder:"请选择"},model:{value:t.material.platform_id,callback:function(e){t.$set(t.material,"platform_id",e)},expression:"material.platform_id"}},t._l(t.platformList,function(t){return i("el-option",{key:t.platform_id,attrs:{label:t.platform_name,value:t.platform_id}})}),1)],1),t._v(" "),i("div",{staticClass:"form-item"},[i("span",{staticClass:"lable"},[t._v("分组")]),t._v(" "),i("el-select",{attrs:{size:"small",clearable:"",placeholder:"请选择"},model:{value:t.material.group_id,callback:function(e){t.$set(t.material,"group_id",e)},expression:"material.group_id"}},t._l(t.groupList,function(t){return i("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}),1)],1)]),t._v(" "),i("div",{staticClass:"successItem"},[i("div",{staticClass:"imgBox"},[i("el-image",{staticClass:"img",attrs:{src:t.material.url,lazy:"","preview-src-list":[t.material.url]}})],1),t._v(" "),i("div",{staticClass:"imgBtn"},[i("el-button",{attrs:{type:"primary",size:"mini",plain:""},on:{click:function(e){return t.openImgCutter()}}},[t._v("图片裁剪")]),t._v(" "),i("el-button",{attrs:{type:"primary",size:"mini",plain:""},on:{click:t.onClickSelectImg}},[t._v("更换图片")])],1)])]),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"mini"},on:{click:t.handleCancel}},[t._v("取 消")]),t._v(" "),i("el-button",{attrs:{size:"mini",type:"primary",disabled:t.loading},on:{click:t.handleConfirm}},[t._v("保 存")])],1),t._v(" "),i("el-dialog",{attrs:{width:"840px",title:"图片裁剪",visible:t.imgCutterVisible,"append-to-body":""},on:{"update:visible":function(e){t.imgCutterVisible=e}}},[t.imgCutterVisible?i("imgCutter",{attrs:{target:t.oss_url,source:"uploadMaterials"},on:{imgCutterCallback:t.imgCutterCallback}}):t._e()],1),t._v(" "),i("selectImgDialog",{attrs:{dialogVisible:t.selectImgVisible},on:{confirm:t.onConfirmSelectImg,cancel:t.onCancelSelectImg}})],1)},staticRenderFns:[]};var y=i("VU/8")(b,k,!1,function(t){i("rFjy")},"data-v-25b3e384",null).exports,$={name:"batchGrouping",props:{groupingVisible:{type:Boolean,default:function(){return!1}},groupList:{type:Array},media_ids:{type:Array}},data:function(){return{loading:!1,group_id:"",radioGroup:1,groupName:""}},created:function(){},methods:{handleCancel:function(){this.$emit("cancel"),this.group_id="",this.groupName="",this.radioGroup=1},handleConfirm:function(){var t=this;2==this.radioGroup?this.createdGroup():""==this.group_id?this.$confirm("您选择的分组为空,默认对 "+this.media_ids.length+" 个素材移除原有分组, 是否继续?","提示",{confirmButtonText:"继续",cancelButtonText:"取消",type:"warning"}).then(function(){t.changeGroup()}).catch(function(){}):this.changeGroup()},createdGroup:function(){var t=this;""!=this.groupName?(this.$loading(this.$loadingConfig),this.$axios.post(this.URL.BASEURL+this.URL.media_editGroup,{name:this.groupName}).then(function(e){t.$loading(t.$loadingConfig).close();var i=e.data;i&&0==i.errno?t.changeGroup(i.rst.group_id):4002!=i.errno&&t.$message.warning(i.err)}).catch(function(e){t.$loading(t.$loadingConfig).close()})):this.$message({message:"请填写分组名称!",type:"fail"})},changeGroup:function(t){var e=this;return l()(n.a.mark(function i(){var a,s,l,o,r;return n.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,e.$loading(e.$loadingConfig),a=""+e.URL.BASEURL+e.URL.media_changeGroup,s={media_ids:e.media_ids.join(),group_id:t||e.group_id},i.next=6,e.$axios.post(a,s);case 6:l=i.sent,o=l.data,(r=void 0===o?{}:o)&&0==r.errno&&r.rst?(e.$message.success("成功!"),e.group_id="",e.groupName="",e.radioGroup=1,e.$emit("cancel","success"),t&&e.$emit("renewGroupList")):4002!=r.errno&&e.$message.warning(r.err),i.next=15;break;case 12:i.prev=12,i.t0=i.catch(0),console.log(i.t0);case 15:return i.prev=15,e.$loading(e.$loadingConfig).close(),i.finish(15);case 18:case"end":return i.stop()}},i,e,[[0,12,15,18]])}))()}}},x={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-dialog",{staticClass:"group-dialog",attrs:{visible:t.groupingVisible,"before-close":t.handleCancel,"close-on-click-modal":!1,"close-on-press-escape":!1,width:"400px"},on:{"update:visible":function(e){t.groupingVisible=e}}},[i("div",{attrs:{slot:"title"},slot:"title"},[i("span",[t._v("批量分组")])]),t._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"form-wrap"},[i("div",{staticClass:"batchHint",staticStyle:{"margin-bottom":"30px"}},[t._v("已选中 "),i("span",[t._v(t._s(t.media_ids.length))]),t._v(" 张图片,请 选择分组 或 自定义分组")]),t._v(" "),i("el-radio",{attrs:{label:1},model:{value:t.radioGroup,callback:function(e){t.radioGroup=e},expression:"radioGroup"}},[t._v("选择分组")]),t._v(" "),i("el-radio",{attrs:{label:2},model:{value:t.radioGroup,callback:function(e){t.radioGroup=e},expression:"radioGroup"}},[t._v("自定义分组")]),t._v(" "),i("div",{staticClass:"imgItemInfo",staticStyle:{"margin-top":"20px"}},[1==t.radioGroup?i("div",{staticClass:"form-item"},[i("span",{staticClass:"lable"},[t._v("分 组")]),t._v(" "),i("el-select",{attrs:{size:"small",clearable:"",placeholder:"请选择"},model:{value:t.group_id,callback:function(e){t.group_id=e},expression:"group_id"}},t._l(t.groupList,function(t){return i("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}),1)],1):t._e(),t._v(" "),2==t.radioGroup?i("div",{staticClass:"form-item"},[i("span",{staticClass:"lable",staticStyle:{width:"65px"}},[i("em",[t._v("*")]),t._v("分组名称")]),t._v(" "),i("el-input",{attrs:{size:"small",placeholder:"请输入名称",clearable:""},model:{value:t.groupName,callback:function(e){t.groupName=e},expression:"groupName"}})],1):t._e()])],1),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"mini"},on:{click:t.handleCancel}},[t._v("取 消")]),t._v(" "),i("el-button",{attrs:{size:"mini",type:"primary",disabled:t.loading},on:{click:t.handleConfirm}},[t._v("提 交")])],1)])},staticRenderFns:[]};var L=i("VU/8")($,x,!1,function(t){i("2AOa")},"data-v-6575a26a",null).exports,w={components:{noData:i("YLOf").a,selfChannel:o.a,selfInput:r.a,uploadMaterials:m,editMaterials:y,batchGrouping:L},data:function(){return{loading:!1,uploadVisible:!1,groupList:[],allChecked:!1,pagination:{page:1,page_size:21,pages:0,total:0},platformList:[],filter:{keyword:"",platform_id:"",group_id:""},materialList:[],selectMaterial:[],height:"",editVisible:!1,editData:{},groupingVisible:!1,media_ids:[]}},watch:{selectMaterial:function(){var t=this;this.materialList.forEach(function(e){t.selectMaterial.filter(function(t){return t.id==e.id}).length>0?e.checked=!0:e.checked=!1})}},created:function(){this.height=document.documentElement.clientHeight-257>400?document.documentElement.clientHeight-257:400,this.init()},methods:{onClickEditMaterials:function(t){this.editData={id:t.id,type:t.type,group_id:t.group_id,platform_id:t.platform_id,title:t.title,local_path:t.local_path,url:t.oss_url},this.editVisible=!0},onClickChecked:function(t,e){t.checked?this.selectMaterial=this.selectMaterial.filter(function(e){return e.id!=t.id}):this.selectMaterial.push(t)},init:function(){var t=this;return l()(n.a.mark(function e(){var i,a,s,l,o;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.loading=!0,i=""+t.URL.BASEURL+t.URL.media_mediaList,a={keyword:t.filter.keyword,platform_id:t.filter.platform_id,group_id:t.filter.group_id,page:t.pagination.page,page_size:t.pagination.page_size},e.next=6,t.$axios.get(i,{params:a});case 6:s=e.sent,l=s.data,(o=void 0===l?{}:l)&&0==o.errno&&Array.isArray(o.rst.data)?(t.materialList=o.rst.data,t.materialList.forEach(function(e){t.selectMaterial.filter(function(t){return t.id==e.id}).length>0?e.checked=!0:e.checked=!1}),t.pagination.total=o.rst.pageInfo.total,t.pagination.pages=o.rst.pageInfo.pages):4002!=o.errno&&(t.$message.warning(o.err),t.materialList=[],t.pagination.total=0,t.pagination.pages=0),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(0),t.materialList=[],t.pagination.total=0,t.pagination.pages=0;case 17:return e.prev=17,t.loading=!1,e.finish(17);case 20:case"end":return e.stop()}},e,t,[[0,12,17,20]])}))()},allCheckedChange:function(){this.allChecked?this.selectMaterial=this.materialList:this.selectMaterial=[]},uploadMaterialsCancel:function(t){this.uploadVisible=!1,this.editVisible=!1,this.groupingVisible=!1,"success"==t&&(this.selectMaterial=[],this.init())},getPlatformList:function(t){this.platformList=t},getGroupList:function(t){this.groupList=t},onChangePlatform:function(t){this.filter.platform_id=t||"",this.pagination.page=1,this.init()},onChangeGroup:function(t){this.filter.group_id=t||"",this.pagination.page=1,this.init()},onInputKeyword:function(t){this.filter.keyword=t||"",this.pagination.page=1,this.init()},handleCurrentChange:function(t){this.pagination.page=t,this.init()},onClickMultipleLink:function(t){var e=this,i=t.buttonPath;"SCSC"==i&&(this.uploadVisible=!0),"PLFZ"==i&&(this.selectMaterial.length<=0?this.$message.warning("请选择素材,再进行操作!"):(this.media_ids=this.selectMaterial.map(function(t){return t.id}),this.groupingVisible=!0)),"PLYCFZ"==i&&(this.selectMaterial.length<=0?this.$message.warning("请选择素材,再进行操作!"):this.$confirm("将对 "+this.selectMaterial.length+" 个素材移除分组, 是否继续?","提示",{confirmButtonText:"继续",cancelButtonText:"取消",type:"warning"}).then(l()(n.a.mark(function t(){var i,a,s,l,o,r;return n.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.selectMaterial.map(function(t){return t.id}),t.prev=1,e.$loading(e.$loadingConfig),a=""+e.URL.BASEURL+e.URL.media_changeGroup,s={media_ids:i.join(),group_id:""},t.next=7,e.$axios.post(a,s);case 7:l=t.sent,o=l.data,(r=void 0===o?{}:o)&&0==r.errno&&r.rst?(e.$message.success("移除分组成功!"),e.init()):4002!=r.errno&&e.$message.warning(r.err),t.next=16;break;case 13:t.prev=13,t.t0=t.catch(1),console.log(t.t0);case 16:return t.prev=16,e.$loading(e.$loadingConfig).close(),t.finish(16);case 19:case"end":return t.stop()}},t,e,[[1,13,16,19]])}))).catch(function(){})),"PLSCSC"==i&&(this.selectMaterial.length<=0?this.$message.warning("请选择素材,再进行操作!"):this.$confirm("将删除 "+this.selectMaterial.length+" 个素材, 是否继续?","提示",{confirmButtonText:"继续",cancelButtonText:"取消",type:"warning"}).then(function(){var t=e.selectMaterial.map(function(t){return t.id}).join();e.delMedia(t)}).catch(function(){}))},onCilckDelete:function(t){var e=this;this.$confirm("将删除素材( "+t.title+" ), 是否继续?","提示",{confirmButtonText:"继续",cancelButtonText:"取消",type:"warning"}).then(function(){e.delMedia(t.id)}).catch(function(){})},delMedia:function(t){var e=this;return l()(n.a.mark(function i(){var a,s,l,o,r;return n.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,e.$loading(e.$loadingConfig),a=""+e.URL.BASEURL+e.URL.media_delMedia,s={media_ids:t},i.next=6,e.$axios.post(a,s);case 6:l=i.sent,o=l.data,(r=void 0===o?{}:o)&&0==r.errno&&r.rst?(e.$message.success("删除素材成功!"),e.init()):4002!=r.errno&&e.$message.warning(r.err),i.next=15;break;case 12:i.prev=12,i.t0=i.catch(0),console.log(i.t0);case 15:return i.prev=15,e.$loading(e.$loadingConfig).close(),i.finish(15);case 18:case"end":return i.stop()}},i,e,[[0,12,15,18]])}))()},getPicturesGroup:function(){var t=this;this.$axios.get(this.URL.BASEURL+this.URL.media_groupList,{params:{page:1,page_size:500,operator_id:""}}).then(function(e){(e=e.data)&&0==e.errno&&Array.isArray(e.rst.data)?t.groupList=e.rst.data:e.errno}).catch(function(t){})}}},I={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[i("div",{staticClass:"topTagBox flex"},[t._t("default"),t._v(" "),i("div",{staticClass:"right"},[i("el-checkbox",{staticClass:"checkbox1",on:{change:t.allCheckedChange},model:{value:t.allChecked,callback:function(e){t.allChecked=e},expression:"allChecked"}},[t._v("全选"),i("span",[t._v("(已选中"),i("em",{staticStyle:{color:"#00B38A","font-weight":"bold","font-size":"16px"}},[t._v(t._s(t.selectMaterial.length))]),t._v("个图片)")])]),t._v(" "),i("el-button",{attrs:{type:"primary",plain:"",size:"mini"},on:{click:function(e){return t.onClickMultipleLink({buttonPath:"PLFZ"})}}},[t._v("批量分组")]),t._v(" "),i("el-button",{attrs:{type:"danger",plain:"",size:"mini"},on:{click:function(e){return t.onClickMultipleLink({buttonPath:"PLYCFZ"})}}},[t._v("批量移除分组")]),t._v(" "),i("el-button",{attrs:{type:"danger",plain:"",size:"mini"},on:{click:function(e){return t.onClickMultipleLink({buttonPath:"PLSCSC"})}}},[t._v("批量删除素材")]),t._v(" "),i("el-button",{attrs:{type:"primary",plain:"",size:"mini"},on:{click:function(e){return t.onClickMultipleLink({buttonPath:"SCSC"})}}},[t._v("上传素材")])],1)],2),t._v(" "),i("div",{staticClass:"screenBox flex"},[i("selfChannel",{attrs:{title:"平台",type:"platform",labelWidth:""},on:{platformList:t.getPlatformList,channelDefine:t.onChangePlatform}}),t._v(" "),i("selfChannel",{attrs:{title:"图片组",type:"materialLibrary",labelWidth:""},on:{channelDefine:t.onChangeGroup,groupList:t.getGroupList}}),t._v(" "),i("selfInput",{attrs:{label_name:"搜索图片"},on:{inputChange:t.onInputKeyword}})],1),t._v(" "),i("div",{staticClass:"materialContainer",style:"height:"+t.height+"px"},[t._l(t.materialList,function(e,a){return i("div",{staticClass:"materialItem"},[i("div",{staticClass:"materialImg"},[i("el-image",{staticClass:"img",attrs:{src:e.oss_url,lazy:"","preview-src-list":[e.oss_url]}})],1),t._v(" "),i("div",{staticClass:"materialInfo"},[i("div",{staticClass:"materialTitle"},[t._v(t._s(e.title?e.title:"-"))]),t._v(" "),i("div",{staticClass:"flex"},[i("el-tooltip",{attrs:{content:e.platform_name,disabled:!e.platform_name,placement:"top"}},[i("div",{staticClass:"label",staticStyle:{"max-width":"50%"}},[i("span",[t._v("平台:")]),t._v(t._s(e.platform_name?e.platform_name:"-"))])]),t._v(" "),i("el-tooltip",{attrs:{content:e.group_name,disabled:!e.group_name,placement:"top"}},[i("div",{staticClass:"label",staticStyle:{"text-align":"right",flex:"1"}},[i("span",[t._v("分组:")]),t._v(t._s(e.group_name?e.group_name:"-"))])])],1),t._v(" "),i("div",{staticClass:"meterialCZ"},[i("div",{staticClass:"flex"},[i("el-button",{attrs:{type:"info",size:"mini",icon:"el-icon-delete",plain:"",circle:""},on:{click:function(i){return t.onCilckDelete(e)}}}),t._v(" "),i("el-button",{attrs:{type:"info",size:"mini",icon:"el-icon-edit",plain:"",circle:""},on:{click:function(i){return t.onClickEditMaterials(e)}}})],1),t._v(" "),i("div",{class:["itemCheckbox",e.checked?"itemCheckboxActive":""],on:{click:function(i){return t.onClickChecked(e,a)}}})])])])}),t._v(" "),t.materialList&&t.materialList.length<=0&&!t.loading?i("noData",{staticClass:"noData",staticStyle:{margin:"auto"},attrs:{hint:"暂无素材"}}):t._e()],2),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.pagination.total>0,expression:"pagination.total > 0"}],staticClass:"pagination",staticStyle:{"border-top":"5px solid #f5f6f8",padding:"10px"}},[i("el-pagination",{attrs:{background:"","current-page":t.pagination.page,layout:"prev, pager, next","page-count":Number(t.pagination.pages)},on:{"current-change":t.handleCurrentChange}})],1),t._v(" "),i("uploadMaterials",{attrs:{uploadVisible:t.uploadVisible,platformList:t.platformList,groupList:t.groupList},on:{cancel:t.uploadMaterialsCancel}}),t._v(" "),i("editMaterials",{attrs:{editVisible:t.editVisible,editData:t.editData,platformList:t.platformList,groupList:t.groupList},on:{cancel:t.uploadMaterialsCancel}}),t._v(" "),i("batchGrouping",{attrs:{groupingVisible:t.groupingVisible,media_ids:t.media_ids,groupList:t.groupList},on:{cancel:t.uploadMaterialsCancel,renewGroupList:t.getPicturesGroup}})],1)},staticRenderFns:[]};var S=i("VU/8")(w,I,!1,function(t){i("kWF3")},"data-v-dbaea2e2",null).exports,V={name:"playletGroup",components:{selfInput:r.a},data:function(){return{height:"",loading:!1,pagination:{page:1,page_size:20,pages:0,total:0},filter:{keyword:""},groupList:[],currentGroupId:"",dialogVisible:!1,form:{name:"",loading:!1}}},created:function(){this.height=document.documentElement.clientHeight-200>400?document.documentElement.clientHeight-200:400,this.init()},methods:{init:function(){var t=this;return l()(n.a.mark(function e(){var i,a,s,l,o;return n.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,t.loading=!0,i=""+t.URL.BASEURL+t.URL.media_groupList,a={keyword:t.filter.keyword,page:t.pagination.page,page_size:t.pagination.page_size},e.next=6,t.$axios.get(i,{params:a});case 6:s=e.sent,l=s.data,(o=void 0===l?{}:l)&&0==o.errno&&Array.isArray(o.rst.data)?(t.groupList=o.rst.data,t.pagination.total=o.rst.pageInfo.total,t.pagination.pages=o.rst.pageInfo.pages,t.$refs.tableDom.bodyWrapper.scrollTop=0):4002!=o.errno&&(t.$message.warning(o.err),t.groupList=[],t.pagination.total=0,t.pagination.pages=0),e.next=17;break;case 12:e.prev=12,e.t0=e.catch(0),t.groupList=[],t.pagination.total=0,t.pagination.pages=0;case 17:return e.prev=17,t.loading=!1,e.finish(17);case 20:case"end":return e.stop()}},e,t,[[0,12,17,20]])}))()},handleCurrentChange:function(t){this.pagination.page=t,this.init()},onClickCreateGroup:function(){this.currentGroupId="",this.dialogVisible=!0},handleCancel:function(){this.dialogVisible=!1},handleConfirm:function(){var t=this;""!=this.form.name?(this.form.loading=!0,this.$axios.post(this.URL.BASEURL+this.URL.media_editGroup,{name:this.form.name,group_id:this.currentGroupId}).then(function(e){t.form.loading=!1;var i=e.data;i&&0==i.errno?(t.$message.success((""==t.currentGroupId?"新建":"编辑")+"成功"),t.init(),t.dialogVisible=!1):4002!=i.errno&&t.$message.warning(i.err)}).catch(function(e){t.form.loading=!1})):this.$message({message:"请填写分组名称!",type:"fail"})},onClickEditGroup:function(t){this.currentGroupId=t.id,this.dialogVisible=!0,this.form.name=t.name},onConfirmGroupDialog:function(t){t.isEdit||(this.pagination.page=1),this.init()},onCancelGroupDialog:function(){},onInputKeyword:function(t){this.filter.keyword=t||"",this.pagination.page=1,this.init()},onClickDetaleSend:function(t){var e=this;return l()(n.a.mark(function i(){var a,s,l,o,r;return n.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,e.loading=!0,a=""+e.URL.BASEURL+e.URL.media_delGroup,s={group_id:t.id},i.next=6,e.$axios.get(a,{params:s});case 6:l=i.sent,o=l.data,(r=void 0===o?{}:o)&&0==r.errno&&r.rst?(e.$message.success("删除成功"),e.init()):4002!=r.errno&&e.$message.warning(r.err),i.next=15;break;case 12:i.prev=12,i.t0=i.catch(0),console.log(i.t0);case 15:return i.prev=15,e.loading=!1,i.finish(15);case 18:case"end":return i.stop()}},i,e,[[0,12,15,18]])}))()}}},U={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"playletManage-wrap"},[i("div",{staticClass:"topTagBox flex"},[t._t("default"),t._v(" "),i("div",{staticClass:"flex"},[i("selfInput",{attrs:{label_name:"组名称"},on:{inputChange:t.onInputKeyword}}),t._v(" "),i("el-button",{staticStyle:{"margin-left":"10px"},attrs:{type:"primary",size:"mini"},on:{click:t.onClickCreateGroup}},[t._v("创建组")])],1)],2),t._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}]},[i("el-table",{ref:"tableDom",staticStyle:{width:"100%","margin-top":"10px"},attrs:{height:t.height,data:t.groupList,"tooltip-effect":"dark"}},[i("el-table-column",{attrs:{label:"分组名称",prop:"name",align:"center",fixed:"left"}}),t._v(" "),i("el-table-column",{attrs:{label:"操作","min-width":"210",align:"center",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){var a=e.row;return[i("span",{staticClass:"btn",on:{click:function(e){return t.onClickEditGroup(a)}}},[t._v("编辑")]),t._v(" "),i("el-popconfirm",{attrs:{title:"确定删除【"+a.name+"】?"},on:{confirm:function(e){return t.onClickDetaleSend(a)}}},[i("span",{staticClass:"btn",attrs:{slot:"reference"},slot:"reference"},[t._v("删除组")])])]}}])})],1),t._v(" "),i("div",{directives:[{name:"show",rawName:"v-show",value:t.pagination.total>0,expression:"pagination.total > 0"}],staticClass:"pagination"},[i("el-pagination",{attrs:{background:"","current-page":t.pagination.page,layout:"prev, pager, next","page-count":Number(t.pagination.pages)},on:{"current-change":t.handleCurrentChange}})],1),t._v(" "),i("el-dialog",{staticClass:"group-dialog",attrs:{visible:t.dialogVisible,"before-close":t.handleCancel,"close-on-click-modal":!1,"close-on-press-escape":!1,width:"400px"},on:{"update:visible":function(e){t.dialogVisible=e}}},[i("div",{attrs:{slot:"title"},slot:"title"},[i("span",[t._v(t._s(""==t.currentGroupId?"新建分组":"编辑分组"))])]),t._v(" "),i("div",{directives:[{name:"loading",rawName:"v-loading",value:t.form.loading,expression:"form.loading"}],staticClass:"form-wrap"},[i("div",{staticClass:"form-item"},[i("span",{staticClass:"lable"},[i("em",[t._v("*")]),t._v("分组名称")]),t._v(" "),i("el-input",{attrs:{size:"small",placeholder:"请输入名称",clearable:""},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1)]),t._v(" "),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"mini"},on:{click:t.handleCancel}},[t._v("取 消")]),t._v(" "),i("el-button",{attrs:{size:"mini",type:"primary",disabled:t.form.loading},on:{click:t.handleConfirm}},[t._v("确 定")])],1)])],1)])},staticRenderFns:[]};var M={name:"materialLibrary",components:{pictureLibrary:S,groupPictures:i("VU/8")(V,U,!1,function(t){i("iTi3")},"data-v-0e2239e5",null).exports},data:function(){return{tagType:1}},methods:{changeType:function(t){this.tagType=t}}},G={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[1==t.tagType?i("pictureLibrary",[i("div",{staticClass:"left flex-align-center"},[i("div",{class:["tagItem",1==t.tagType?"tagItem_active":""],on:{click:function(e){return t.changeType(1)}}},[t._v("图片库")]),t._v(" "),i("div",{class:["tagItem",2==t.tagType?"tagItem_active":""],on:{click:function(e){return t.changeType(2)}}},[t._v("图片组")])])]):t._e(),t._v(" "),2==t.tagType?i("groupPictures",[i("div",{staticClass:"left flex-align-center"},[i("div",{class:["tagItem",1==t.tagType?"tagItem_active":""],on:{click:function(e){return t.changeType(1)}}},[t._v("图片库")]),t._v(" "),i("div",{class:["tagItem",2==t.tagType?"tagItem_active":""],on:{click:function(e){return t.changeType(2)}}},[t._v("图片组")])])]):t._e()],1)},staticRenderFns:[]},R=i("VU/8")(M,G,!1,null,null,null);e.default=R.exports}});