chunk-d15b4fd4.4b987757.js 15 KB

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