1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2f7c07da"],{"15ef":function(t,e,i){"use strict";i("5697")},2653:function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"m-container"},[i("h2",[i("el-page-header",{attrs:{content:t.detailName},on:{back:t.onCancel}})],1),t._v(" "),i("div",{staticClass:"m-core"},[i("div",{staticClass:"buttons"},[i("auth",{attrs:{auths:["photo/add"]}},[i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.openUpload()}}},[t._v(t._s("DEFAULT"===t.mergeType?"上传照片":"上传证书"))])],1),t._v(" "),i("auth",{attrs:{auths:["photo/batchUpdate"]}},[t.editing?t._e():i("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(" "),i("auth",{attrs:{auths:["photo/del"]}},[t.editing?i("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?i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.confirm()}}},[t._v("确定")]):t._e(),t._v(" "),t.editing?i("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.cancel()}}},[t._v("取消")]):t._e()],1),t._v(" "),t.editing?i("el-alert",{staticClass:"alert",attrs:{type:"info",closable:!1}},[i("div",{attrs:{slot:"title"},slot:"title"},[i("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(" "),i("el-button",{staticClass:"btn",attrs:{type:"text",disabled:!t.checked.length},on:{click:function(e){t.checked=[]}}},[t._v("取消选择")]),t._v(" "),i("span",[t._v("共"+t._s(t.list.length)+"条, 已选择"+t._s(t.checked.length)+"条")])],1)]):t._e(),t._v(" "),i("el-checkbox-group",{model:{value:t.checked,callback:function(e){t.checked=e},expression:"checked"}},[i("draggable",{staticStyle:{display:"flex","flex-wrap":"wrap"},attrs:{list:t.list,disabled:!t.editing,handle:".img"}},t._l(t.list,(function(e){return i("div",{key:e.url,staticClass:"img-container"},[i("auth",{attrs:{auths:["photo/del"]}},[t.editing?i("div",{staticClass:"ctrl-bar"},[i("el-checkbox",{staticClass:"check",attrs:{label:e.id}}),t._v(" "),i("i",{staticClass:"icon-view",class:{active:t.views.includes(e.id)},on:{click:function(i){return t.setView(e)}}})],1):i("div",{staticClass:"ctrl-bar-view"},["DEFAULT"===t.mergeType?i("span",{staticStyle:{color:"#fff","font-size":"12px",cursor:"pointer"},on:{click:function(i){return t.setCover(e)}}},[t._v("设为封面")]):i("i"),t._v(" "),i("el-tooltip",{attrs:{effect:"dark",content:t.views.includes(e.id)?"设为不可见":"设为可见",placement:"top","open-delay":.5}},[i("i",{staticClass:"icon-view",class:{active:t.views.includes(e.id)},on:{click:function(i){return t.setViewItem(e)}}})])],1)]),t._v(" "),i("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?i("el-input",{staticClass:"nameinput user-drag",attrs:{placeholder:"请输入"+("DEFAULT"===t.mergeType?"照片":"证书")+"名称",clearable:""},model:{value:e.name,callback:function(i){t.$set(e,"name",i)},expression:"item.name"}}):i("el-tooltip",{staticClass:"item",attrs:{effect:"dark",content:e.name,placement:"top","open-delay":.5}},[i("div",{staticClass:"name"},[t._v(t._s(e.name))])])],1)})),0)],1),t._v(" "),0==t.list.length?i("empty"):t._e()],1),t._v(" "),t.uploadVisible?i("el-dialog",{attrs:{title:"DEFAULT"===t.mergeType?"上传照片":"上传证书",visible:t.uploadVisible},on:{"update:visible":function(e){t.uploadVisible=e}}},[i("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)},a=[],r=(i("6762"),i("2fdb"),i("c80c")),s=i("db72"),c=(i("96cf"),i("3b8d")),o=(i("7f7f"),i("b76a")),u=i.n(o),l=i("be41"),p=i("bfd3"),d=i("a707"),h=null,f={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,i=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:+i.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}()}},b=f,m=(i("b1e5"),i("2877")),v=Object(m["a"])(b,n,a,!1,null,"fa8d5bac",null);e["default"]=v.exports},5697:function(t,e,i){},a707:function(t,e,i){"use strict";i.d(e,"d",(function(){return a})),i.d(e,"b",(function(){return r})),i.d(e,"c",(function(){return s})),i.d(e,"e",(function(){return c})),i.d(e,"g",(function(){return o})),i.d(e,"a",(function(){return u})),i.d(e,"f",(function(){return l})),i.d(e,"h",(function(){return p}));var n=i("829b"),a=function(t){return Object(n["a"])({url:"/api-web/photoAlbum/queryPage",data:t,method:"post",requestType:"form"})},r=function(t){return Object(n["a"])({url:"/api-web/photoAlbum/add",data:t,method:"post",requestType:"form"})},s=function(t){return Object(n["a"])({url:"/api-web/photoAlbum/del",data:{},params:t,method:"post"})},c=function(t){return Object(n["a"])({url:"/api-web/photoAlbum/batchUpdate",data:t,method:"post"})},o=function(t){return Object(n["a"])({url:"/api-web/photo/queryPage",data:t,method:"post",requestType:"form"})},u=function(t){return Object(n["a"])({url:"/api-web/photo/add",data:t,method:"post"})},l=function(t){return Object(n["a"])({url:"/api-web/photo/del",data:t,method:"post",requestType:"form"})},p=function(t){return Object(n["a"])({url:"/api-web/photo/batchUpdate",data:t,method:"post"})}},b1e5:function(t,e,i){"use strict";i("f2b8")},be41:function(t,e,i){"use strict";i("5df3"),i("1c4c");var n=i("7618"),a=(i("456d"),i("ac6a"),function t(e){if(null===e)return null;var i=Object.assign({},e);return Object.keys(i).forEach((function(a){return i[a]="object"===Object(n["a"])(e[a])?t(e[a]):e[a]})),Array.isArray(e)?(i.length=e.length,Array.from(i)):i});e["a"]=a},bfd3:function(t,e,i){"use strict";var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-form",{ref:"form",attrs:{model:t.form,"label-width":"80px"},nativeOn:{submit:function(e){return e.stopPropagation(),t.submit(e)}}},[t.name?i("el-form-item",{attrs:{label:"相册"}},[t._v("\n "+t._s(t.name)+"\n ")]):t._e(),t._v(" "),i("el-form-item",{attrs:{label:t.name?"上传相册":"上传证书"}},[i("el-upload",{attrs:{action:"/api-web/uploadFile","on-preview":t.handlePictureCardPreview,"show-file-list":!1,multiple:"",accept:".png, .jpg, .jpeg, .gif","before-upload":t.beforeUpload,"on-success":t.successed,"on-remove":t.handleRemove}},[i("el-button",{attrs:{loading:t.uploading,type:"primary"}},[t._v("上传图片")])],1),t._v(" "),i("div",{staticClass:"img-container"},[t.uploaded.length>0?i("div",{staticClass:"list"},t._l(t.uploaded,(function(e,n){return i("div",{key:e.url,staticClass:"item"},[i("div",{staticClass:"ctrl-bar"},[i("i",{staticClass:"el-icon-circle-close",on:{click:function(e){return t.remove(n)}}})]),t._v(" "),i("el-image",{staticClass:"img",attrs:{src:e.url,"preview-src-list":t.uploaded.map((function(t){return t.url}))}}),t._v(" "),i("el-input",{attrs:{placeholder:"请输入图片名称",clearable:""},model:{value:e.name,callback:function(i){t.$set(e,"name",i)},expression:"item.name"}})],1)})),0):i("empty")],1)],1),t._v(" "),i("div",{staticClass:"dialog-footer"},[i("el-button",{on:{click:function(e){return t.$emit("close")}}},[t._v("取 消")]),t._v(" "),i("el-button",{attrs:{type:"primary","native-type":"submit",disabled:t.uploading}},[t._v("确 定")])],1),t._v(" "),i("el-dialog",{attrs:{visible:t.dialogVisible},on:{"update:visible":function(e){t.dialogVisible=e}}},[i("img",{attrs:{width:"100%",src:t.dialogImageUrl,alt:""}})])],1)},a=[],r=i("c80c"),s=(i("96cf"),i("3b8d")),c=(i("7f7f"),i("28a5"),i("db72")),o=i("a707"),u={props:{name:String,query:{type:Object,default:function(){return{}}}},data:function(){return{fileList:[],dialogImageUrl:"",dialogVisible:!1,uploading:!1,form:{photoAlbumId:""},uploaded:[],photos:[]}},mounted:function(){console.log(Object(c["a"])({},this))},methods:{handleChange:function(t,e){this.fileList=e.slice(-3)},beforeUpload:function(){return this.uploading=!0,!0},successed:function(t,e,i){var n;(this.uploading=!1,200===t.code)?this.uploaded.push({url:t.data.url,name:e.name.split(".").shift(),clientShow:"YES"}):this.$message.error((null===(n=res.data)||void 0===n?void 0:n.message)||res.msg||"上传失败");console.log(t,e,i)},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 i=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 n;return Object(r["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!e){t.next=7;break}return n=i.uploaded.map((function(t){return Object(c["a"])(Object(c["a"])({},t),i.query)})),t.next=4,Object(o["a"])(n);case 4:i.$message.success("添加成功"),i.$emit("close"),i.$emit("submited");case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}catch(n){}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)}}},l=u,p=(i("15ef"),i("2877")),d=Object(p["a"])(l,n,a,!1,null,"67073934",null);e["a"]=d.exports},f2b8:function(t,e,i){}}]);
|