(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-77fc9526"],{2653:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"m-container"},[n("h2",[n("el-page-header",{attrs:{content:e.detailName},on:{back:e.onCancel}})],1),e._v(" "),n("div",{staticClass:"m-core"},[n("div",{staticClass:"buttons"},[n("auth",{attrs:{auths:["photo/add"]}},[n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.openUpload()}}},[e._v(e._s("DEFAULT"===e.mergeType?"上传照片":"上传证书"))])],1),e._v(" "),n("auth",{attrs:{auths:["photo/batchUpdate"]}},[e.editing?e._e():n("el-button",{attrs:{type:"primary",disabled:0==e.list.length},on:{click:function(t){return e.changeMode()}}},[e._v(e._s("DEFAULT"===e.mergeType?"编辑照片":"编辑证书"))])],1),e._v(" "),n("auth",{attrs:{auths:["photo/del"]}},[e.editing?n("el-button",{attrs:{type:"danger"},on:{click:function(t){return e.remove()}}},[e._v(e._s("DEFAULT"===e.mergeType?"删除照片":"删除证书"))]):e._e()],1),e._v(" "),e.editing?n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.confirm()}}},[e._v("确定")]):e._e(),e._v(" "),e.editing?n("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.cancel()}}},[e._v("取消")]):e._e()],1),e._v(" "),e.editing?n("el-alert",{staticClass:"alert",attrs:{type:"info",closable:!1}},[n("div",{attrs:{slot:"title"},slot:"title"},[n("el-button",{staticClass:"btn",attrs:{type:"text",disabled:e.list.length===e.checked.length},on:{click:function(t){return e.checkAll()}}},[e._v("全选")]),e._v(" "),n("el-button",{staticClass:"btn",attrs:{type:"text",disabled:!e.checked.length},on:{click:function(t){e.checked=[]}}},[e._v("取消选择")]),e._v(" "),n("span",[e._v("共"+e._s(e.list.length)+"条, 已选择"+e._s(e.checked.length)+"条")])],1)]):e._e(),e._v(" "),n("el-checkbox-group",{model:{value:e.checked,callback:function(t){e.checked=t},expression:"checked"}},[n("draggable",{staticStyle:{display:"flex","flex-wrap":"wrap"},attrs:{list:e.list,disabled:!e.editing,handle:".img"}},e._l(e.list,(function(t){return n("div",{key:t.url,staticClass:"img-container"},[n("auth",{attrs:{auths:["photo/del"]}},[e.editing?n("div",{staticClass:"ctrl-bar"},[n("el-checkbox",{staticClass:"check",attrs:{label:t.id}}),e._v(" "),n("i",{staticClass:"icon-view",class:{active:e.views.includes(t.id)},on:{click:function(n){return e.setView(t)}}})],1):n("div",{staticClass:"ctrl-bar-view"},["DEFAULT"===e.mergeType?n("span",{staticStyle:{color:"#fff","font-size":"12px",cursor:"pointer"},on:{click:function(n){return e.setCover(t)}}},[e._v("设为封面")]):n("i"),e._v(" "),n("el-tooltip",{attrs:{effect:"dark",content:e.views.includes(t.id)?"设为不可见":"设为可见",placement:"top","open-delay":.5}},[n("i",{staticClass:"icon-view",class:{active:e.views.includes(t.id)},on:{click:function(n){return e.setViewItem(t)}}})])],1)]),e._v(" "),n("el-image",{staticClass:"img",attrs:{src:t.url,fit:"cover","preview-src-list":e.list.map((function(e){return e.url}))}}),e._v(" "),e.editing?n("el-input",{staticClass:"nameinput user-drag",attrs:{placeholder:"请输入"+("DEFAULT"===e.mergeType?"照片":"证书")+"名称",clearable:""},model:{value:t.name,callback:function(n){e.$set(t,"name",n)},expression:"item.name"}}):n("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:t.name,placement:"top","open-delay":.5}},[n("div",{staticClass:"name"},[e._v(e._s(t.name))])])],1)})),0)],1),e._v(" "),0==e.list.length?n("empty"):e._e()],1),e._v(" "),e.uploadVisible?n("el-dialog",{attrs:{title:"DEFAULT"===e.mergeType?"上传照片":"上传证书",visible:e.uploadVisible},on:{"update:visible":function(t){e.uploadVisible=t}}},[n("upload-popup",{attrs:{name:e.$route.query.name,query:e.queryIdOrType},on:{close:function(t){e.uploadVisible=!1},submited:e.submited}})],1):e._e()],1)},r=[],a=(n("6762"),n("2fdb"),n("5530")),s=(n("96cf"),n("1da1")),c=(n("7f7f"),n("b76a")),o=n.n(c),u=n("be41"),l=n("bfd3"),p=n("a707"),d=null,h={props:{type:{type:String,default:"DEFAULT"}},components:{"upload-popup":l["a"],draggable:o.a},computed:{mergeType:function(){return this.$route.query.phototype||this.type},detailName:function(){return this.$route.query.name||"DEFAULT"===this.mergeType?"相册详情":"全部证书"},queryIdOrType:function(){var e=this.$route.query.pid;return"DEFAULT"===this.mergeType?{id:e,type:this.mergeType,photoAlbumId:e}:{type:this.mergeType,musicGroupId:this.$route.query.id}}},data:function(){return{views:[],checked:[],uploadVisible:!1,list:[],editing:!1}},mounted:function(){this.FetchList()},methods:{onCancel:function(){this.$store.dispatch("delVisitedViews",this.$route),this.$route.query.returnUrl&&this.$router.push(this.$route.query.returnUrl)},openUpload:function(){this.uploadVisible=!0},setInitViwes:function(){this.views=this.list.filter((function(e){return e.clientShow})).map((function(e){return e.id}))},setCover:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.$confirm("是否确认设置为封面?","提示");case 3:return e.next=5,Object(p["e"])([Object(a["a"])(Object(a["a"])({},this.queryIdOrType),{},{coverUrl:t.url})]);case 5:this.$message.success("设置成功"),this.FetchList(),e.next=11;break;case 9:e.prev=9,e.t0=e["catch"](0);case 11:case"end":return e.stop()}}),e,this,[[0,9]])})));function t(t){return e.apply(this,arguments)}return t}(),setViewItem:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.$confirm("是否确认修改可见状态?","提示");case 3:return e.next=5,Object(p["h"])([Object(a["a"])(Object(a["a"])({},t),{},{clientShow:+!t.clientShow})]);case 5:this.$message.success("设置成功"),this.FetchList(),e.next=11;break;case 9:e.prev=9,e.t0=e["catch"](0);case 11:case"end":return e.stop()}}),e,this,[[0,9]])})));function t(t){return e.apply(this,arguments)}return t}(),changeMode:function(){this.checked=[],this.setInitViwes(),this.editing=!0},cancel:function(){this.editing=!1,this.list=Object(u["a"])(d),this.setInitViwes()},submited:function(){this.FetchList()},setView:function(e){var t=this.views.indexOf(e.id);t>-1?this.views.splice(t,1):this.views.push(e.id)},checkAll:function(){this.checked=this.list.map((function(e){return e.id}))},FetchList:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(p["g"])(Object(a["a"])(Object(a["a"])({},this.queryIdOrType),{},{photoAlbumId:this.queryIdOrType.id}));case 3:t=e.sent,this.list=Object(u["a"])(t.data.rows),d=Object(u["a"])(t.data.rows),this.setInitViwes(),e.next=11;break;case 9:e.prev=9,e.t0=e["catch"](0);case 11:case"end":return e.stop()}}),e,this,[[0,9]])})));function t(){return e.apply(this,arguments)}return t}(),confirm:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){var t,n=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.$confirm("是否确认修改照片信息?","提示");case 3:return t=this.list.map((function(e,t){return Object(a["a"])(Object(a["a"])({},e),{},{order:t,clientShow:+n.views.includes(e.id)})})),e.next=6,Object(p["h"])(t);case 6:this.editing=!1,this.$message.success("修改成功"),this.FetchList(),e.next=14;break;case 11:e.prev=11,e.t0=e["catch"](0),console.log(e.t0);case 14:case"end":return e.stop()}}),e,this,[[0,11]])})));function t(){return e.apply(this,arguments)}return t}(),remove:function(){var e=Object(s["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.$confirm("是否确认删除已选照片?","提示");case 3:return e.next=5,Object(p["f"])({ids:this.checked.join(",")});case 5:this.$message.success("删除成功"),this.editing=!1,this.FetchList(),e.next=12;break;case 10:e.prev=10,e.t0=e["catch"](0);case 12:case"end":return e.stop()}}),e,this,[[0,10]])})));function t(){return e.apply(this,arguments)}return t}()}},f=h,m=(n("b1e5"),n("2877")),b=Object(m["a"])(f,i,r,!1,null,"fa8d5bac",null);t["default"]=b.exports},"42b2":function(e,t,n){},a707:function(e,t,n){"use strict";n.d(t,"d",(function(){return r})),n.d(t,"b",(function(){return a})),n.d(t,"c",(function(){return s})),n.d(t,"e",(function(){return c})),n.d(t,"g",(function(){return o})),n.d(t,"a",(function(){return u})),n.d(t,"f",(function(){return l})),n.d(t,"h",(function(){return p}));var i=n("829b"),r=function(e){return Object(i["a"])({url:"/api-web/photoAlbum/queryPage",data:e,method:"post",requestType:"form"})},a=function(e){return Object(i["a"])({url:"/api-web/photoAlbum/add",data:e,method:"post",requestType:"form"})},s=function(e){return Object(i["a"])({url:"/api-web/photoAlbum/del",data:{},params:e,method:"post"})},c=function(e){return Object(i["a"])({url:"/api-web/photoAlbum/batchUpdate",data:e,method:"post"})},o=function(e){return Object(i["a"])({url:"/api-web/photo/queryPage",data:e,method:"post",requestType:"form"})},u=function(e){return Object(i["a"])({url:"/api-web/photo/add",data:e,method:"post"})},l=function(e){return Object(i["a"])({url:"/api-web/photo/del",data:e,method:"post",requestType:"form"})},p=function(e){return Object(i["a"])({url:"/api-web/photo/batchUpdate",data:e,method:"post"})}},b1e5:function(e,t,n){"use strict";n("f2b8")},be41:function(e,t,n){"use strict";n("5df3"),n("1c4c");var i=n("53ca"),r=(n("456d"),n("ac6a"),function e(t){if(null===t)return null;var n=Object.assign({},t);return Object.keys(n).forEach((function(r){return n[r]="object"===Object(i["a"])(t[r])?e(t[r]):t[r]})),Array.isArray(t)?(n.length=t.length,Array.from(n)):n});t["a"]=r},bfd3:function(e,t,n){"use strict";var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-form",{ref:"form",attrs:{model:e.form,"label-width":"80px"},nativeOn:{submit:function(t){return t.stopPropagation(),e.submit(t)}}},[e.name?n("el-form-item",{attrs:{label:"相册"}},[e._v("\n "+e._s(e.name)+"\n ")]):e._e(),e._v(" "),n("el-form-item",{attrs:{label:e.name?"上传相册":"上传证书"}},[n("el-upload",{attrs:{action:e.ossUploadUrl,data:e.dataObj,"on-preview":e.handlePictureCardPreview,"show-file-list":!1,multiple:"",accept:".png, .jpg, .jpeg, .gif","before-upload":e.beforeUpload,"on-success":e.successed,"on-remove":e.handleRemove}},[n("el-button",{attrs:{loading:e.uploading,type:"primary"}},[e._v("上传图片")])],1),e._v(" "),n("div",{staticClass:"img-container"},[e.uploaded.length>0?n("div",{staticClass:"list"},e._l(e.uploaded,(function(t,i){return n("div",{key:t.url,staticClass:"item"},[n("div",{staticClass:"ctrl-bar"},[n("i",{staticClass:"el-icon-circle-close",on:{click:function(t){return e.remove(i)}}})]),e._v(" "),n("el-image",{staticClass:"img",attrs:{src:t.url,"preview-src-list":e.uploaded.map((function(e){return e.url}))}}),e._v(" "),n("el-input",{attrs:{placeholder:"请输入图片名称",clearable:""},model:{value:t.name,callback:function(n){e.$set(t,"name",n)},expression:"item.name"}})],1)})),0):n("empty")],1)],1),e._v(" "),n("div",{staticClass:"dialog-footer"},[n("el-button",{on:{click:function(t){return e.$emit("close")}}},[e._v("取 消")]),e._v(" "),n("el-button",{attrs:{type:"primary","native-type":"submit",disabled:e.uploading}},[e._v("确 定")])],1),e._v(" "),n("el-dialog",{attrs:{visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("img",{attrs:{width:"100%",src:e.dialogImageUrl,alt:""}})])],1)},r=[],a=(n("28a5"),n("7f7f"),n("96cf"),n("1da1")),s=n("5530"),c=n("a707"),o=n("3607"),u={props:{name:String,query:{type:Object,default:function(){return{}}},bucket_name:{type:String,default:"daya"}},data:function(){return{fileList:[],dialogImageUrl:"",dialogVisible:!1,uploading:!1,form:{photoAlbumId:""},uploaded:[],photos:[],ossUploadUrl:"https://ks3-cn-beijing.ksyuncs.com/"+this.bucket_name,dataObj:{policy:"",signature:"",key:"",KSSAccessKeyId:"",acl:"public-read",name:""}}},mounted:function(){console.log(Object(s["a"])({},this))},methods:{handleChange:function(e,t){this.fileList=t.slice(-3)},beforeUpload:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(t){var n,i,r,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.uploading=!0,e.prev=1,n=t.name.replaceAll(" ","_"),i=(new Date).getTime()+n,t.key=i,r={filename:n,bucketName:this.bucket_name,postData:{filename:n,acl:"public-read",key:i,unknowValueField:[]}},e.next=8,Object(o["p"])(r);case 8:a=e.sent,this.dataObj={policy:a.data.policy,signature:a.data.signature,key:i,KSSAccessKeyId:a.data.kssAccessKeyId,acl:"public-read",name:n},e.next=15;break;case 12:e.prev=12,e.t0=e["catch"](1),console.log(e.t0);case 15:return e.abrupt("return",!0);case 16:case"end":return e.stop()}}),e,this,[[1,12]])})));function t(t){return e.apply(this,arguments)}return t}(),successed:function(e,t,n){this.uploading=!1;var i,r=this.ossUploadUrl+"/"+t.raw.key;r?this.uploaded.push({url:r,name:t.name.split(".").shift(),clientShow:"YES"}):this.$message.error((null===(i=res.data)||void 0===i?void 0:i.message)||res.msg||"上传失败");console.log(e,t,n)},handleRemove:function(e,t){console.log(e,t)},handlePictureCardPreview:function(e){this.dialogImageUrl=e.url,this.dialogVisible=!0},FetchList:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(c["d"])(Object(s["a"])(Object(s["a"])({},this.query),{},{rows:9999}));case 3:t=e.sent,this.photos=t.data.rows,e.next=9;break;case 7:e.prev=7,e.t0=e["catch"](0);case 9:case"end":return e.stop()}}),e,this,[[0,7]])})));function t(){return e.apply(this,arguments)}return t}(),submit:function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(t){var n=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:t.stopPropagation(),t.stopImmediatePropagation(),t.preventDefault();try{this.$refs.form.validate(function(){var e=Object(a["a"])(regeneratorRuntime.mark((function e(t){var i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!t){e.next=7;break}return i=n.uploaded.map((function(e){return Object(s["a"])(Object(s["a"])({},e),n.query)})),e.next=4,Object(c["a"])(i);case 4:n.$message.success("添加成功"),n.$emit("close"),n.$emit("submited");case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}catch(i){}case 4:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),remove:function(e){this.uploaded.splice(e,1)}}},l=u,p=(n("dcf0"),n("2877")),d=Object(p["a"])(l,i,r,!1,null,"51a77d61",null);t["a"]=d.exports},dcf0:function(e,t,n){"use strict";n("42b2")},f2b8:function(e,t,n){}}]);