chunk-03266682.7d5069f2.js 14 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-03266682"],{"210f":function(t,e,n){},2653:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:{"m-container":"DEFAULT"===t.type}},["DEFAULT"===t.type?n("h2",[n("el-page-header",{attrs:{content:t.detailName},on:{back:t.onCancel}})],1):t._e(),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.type?"上传照片":"上传证书"))])],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.type?"编辑照片":"编辑证书"))])],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.type?"删除照片":"删除证书"))]):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"},attrs:{list:t.list,disabled:!t.editing}},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:"el-icon-view",class:{active:t.views.includes(e.id)},on:{click:function(n){return t.setView(e)}}})],1):n("div",{staticClass:"ctrl-bar-view"},[n("el-tooltip",{attrs:{effect:"dark",content:"设为封面",placement:"top","open-delay":.5}},["DEFAULT"===t.type?n("i",{staticClass:"el-icon-picture-outline-round",on:{click:function(n){return t.setCover(e)}}}):n("i")]),t._v(" "),n("el-tooltip",{attrs:{effect:"dark",content:t.views.includes(e.id)?"设为不可见":"设为可见",placement:"top","open-delay":.5}},[n("i",{staticClass:"el-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,"preview-src-list":t.list.map((function(t){return t.url}))}}),t._v(" "),t.editing?n("el-input",{staticClass:"nameinput",attrs:{size:"mini",placeholder:"请输入"+("DEFAULT"===t.type?"照片":"证书")+"名称",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.type?"上传照片":"上传证书",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)},r=[],a=(n("6762"),n("2fdb"),n("55dd"),n("5530")),s=(n("96cf"),n("1da1")),c=(n("7f7f"),n("b76a")),o=n.n(c),u=n("bfd3"),l=n("a707"),p={props:{type:{type:String,default:"DEFAULT"}},components:{"upload-popup":u["a"],draggable:o.a},computed:{detailName:function(){return this.$route.query.name||"相册详情"},queryIdOrType:function(){var t=this.$route.query.pid;return"DEFAULT"===this.type?{id:t,type:this.type}:{type:this.type,musicGroupId:this.$route.query.id}}},data:function(){return{views:[],checked:[],uploadVisible:!1,list:[],editing:!1}},mounted:function(){console.log(this.$route),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(s["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.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(l["e"])(Object(a["a"])(Object(a["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(s["a"])(regeneratorRuntime.mark((function t(e){return regeneratorRuntime.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(l["h"])([Object(a["a"])(Object(a["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=this.list.sort((function(t,e){return t.order-e.order}))},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(s["a"])(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(l["g"])(Object(a["a"])(Object(a["a"])({},this.queryIdOrType),{},{photoAlbumId:this.queryIdOrType.id}));case 3:e=t.sent,this.list=e.data.rows,this.setInitViwes(),t.next=10;break;case 8:t.prev=8,t.t0=t["catch"](0);case 10:case"end":return t.stop()}}),t,this,[[0,8]])})));function e(){return t.apply(this,arguments)}return e}(),confirm:function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(){var e,n=this;return regeneratorRuntime.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(a["a"])(Object(a["a"])({},t),{},{order:e,clientShow:+n.views.includes(t.id)})]})),t.next=6,Object(l["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(s["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.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(l["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}()}},d=p,h=(n("5a4c"),n("2877")),f=Object(h["a"])(d,i,r,!1,null,"17b8f402",null);e["default"]=f.exports},"5a4c":function(t,e,n){"use strict";n("a3fd")},a3fd:function(t,e,n){},a707:function(t,e,n){"use strict";n.d(e,"d",(function(){return r})),n.d(e,"b",(function(){return a})),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 i=n("829b"),r=function(t){return Object(i["a"])({url:"/api-web/photoAlbum/queryPage",data:t,method:"post",requestType:"form"})},a=function(t){return Object(i["a"])({url:"/api-web/photoAlbum/add",data:t,method:"post",requestType:"form"})},s=function(t){return Object(i["a"])({url:"/api-web/photoAlbum/del",data:{},params:t,method:"post"})},c=function(t){return Object(i["a"])({url:"/api-web/photoAlbum/batchUpdate",data:t,method:"post"})},o=function(t){return Object(i["a"])({url:"/api-web/photo/queryPage",data:t,method:"post",requestType:"form"})},u=function(t){return Object(i["a"])({url:"/api-web/photo/add",data:t,method:"post"})},l=function(t){return Object(i["a"])({url:"/api-web/photo/del",data:t,method:"post",requestType:"form"})},p=function(t){return Object(i["a"])({url:"/api-web/photo/batchUpdate",data:t,method:"post"})}},bfd3:function(t,e,n){"use strict";var i=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 ")]):n("el-form-item",{attrs:{label:"相册",prop:"photoAlbumId",rules:[{required:!0,message:"请选择相册"}]}},[n("el-select",{attrs:{placeholder:"请选择相册"},model:{value:t.form.photoAlbumId,callback:function(e){t.$set(t.form,"photoAlbumId",e)},expression:"form.photoAlbumId"}},t._l(t.photos,(function(t){return n("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1)],1),t._v(" "),n("el-form-item",{attrs:{label:"上传相册"}},[n("el-upload",{attrs:{action:"/api-web/uploadFile","on-preview":t.handlePictureCardPreview,"show-file-list":!1,multiple:"",accept:".png, .jpg, .jpeg, .gif","on-success":t.successed,"on-remove":t.handleRemove}},[n("el-button",{attrs:{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,i){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(i)}}})]),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:"",size:"mini"},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"}},[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)},r=[],a=(n("96cf"),n("1da1")),s=(n("7f7f"),n("28a5"),n("5530")),c=n("a707"),o={props:{name:String,query:{type:Object,default:function(){return{}}}},data:function(){return{fileList:[],dialogImageUrl:"",dialogVisible:!1,form:{photoAlbumId:""},uploaded:[],photos:[]}},mounted:function(){console.log(Object(s["a"])({},this))},methods:{handleChange:function(t,e){this.fileList=e.slice(-3)},successed:function(t,e,n){var i;200===t.code?this.uploaded.push({url:t.data.url,name:e.name.split(".").shift(),clientShow:"YES"}):this.$message.error((null===(i=res.data)||void 0===i?void 0:i.message)||res.msg||"上传失败");console.log(t,e,n)},handleRemove:function(t,e){console.log(t,e)},handlePictureCardPreview:function(t){this.dialogImageUrl=t.url,this.dialogVisible=!0},FetchList:function(){var t=Object(a["a"])(regeneratorRuntime.mark((function t(){var e;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(c["d"])(Object(s["a"])(Object(s["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(a["a"])(regeneratorRuntime.mark((function t(e){var n=this;return regeneratorRuntime.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(a["a"])(regeneratorRuntime.mark((function t(e){var i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e){t.next=7;break}return i=n.uploaded.map((function(t){return Object(s["a"])(Object(s["a"])({},t),n.query)})),t.next=4,Object(c["a"])(i);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(i){}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)}}},u=o,l=(n("f4af"),n("2877")),p=Object(l["a"])(u,i,r,!1,null,"ece33c9e",null);e["a"]=p.exports},f4af:function(t,e,n){"use strict";n("210f")}}]);