(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-4946f743"],{"0b0e":function(t,e,i){},8084:function(t,e,i){"use strict";i.r(e);var n=i("12e0"),r=i("d708"),a=i("c276");function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function c(t){for(var e=1;et.length)&&(e=t.length);for(var i=0,n=Array(e);i=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),D(i),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var r=n.arg;D(i)}return r}}throw Error("illegal catch attempt")},delegateYield:function(e,i,n){return this.delegate={iterator:j(e),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}function f(t,e,i,n,r,a,o){try{var s=t[a](o),c=s.value}catch(t){return void i(t)}s.done?e(c):Promise.resolve(c).then(n,r)}function p(t){return function(){var e=this,i=arguments;return new Promise((function(n,r){var a=t.apply(e,i);function o(t){f(a,n,r,o,s,"next",t)}function s(t){f(a,n,r,o,s,"throw",t)}o(void 0)}))}}var m={name:"uploadPictures",components:{uploadVideo:i("7774").default},props:{isChoice:{type:String,default:""},gridBtn:{type:Object,default:null},gridPic:{type:Object,default:null},isShow:{type:Number,default:1}},data:function(){return{searchClass:!1,spinShow:!1,fileUrl:r.a.apiBaseURL+"/file/upload",modalPic:!1,treeData:[],treeData2:[],pictrueList:[],uploadData:{},checkPicList:[],uploadName:{name:"",file_type:"1"},FromData:null,treeId:0,isJudge:!1,buttonProps:{type:"default",size:"small"},fileData:{pid:0,page:1,limit:24},total:0,pids:0,list:[],modalTitleSs:"",isShowPic:!1,header:{},ids:[],headTab:[{title:"图片",name:"1"},{title:"视频",name:"2"}],modalVideo:!1,layout:1,columns4:[{type:"selection",width:60,align:"center"},{title:"图片名称",slot:"poster"},{title:"大小",key:"att_size"},{title:"上传时间",key:"time"},{title:"操作",slot:"action",width:150}],cascaderData:[],cascaderValue:[]}},mounted:function(){var t=this,e=this.$refs.main,i=Math.floor((e.clientWidth-40)/165),n=Math.ceil(24/i);this.fileData.limit=i*n,this.getToken(),this.getList(),this.getFileList(),document.addEventListener("click",(function(e){e.target.classList.contains("nameStyle")||e.target.classList.contains("preview")||e.target.classList.contains("ivu-icon-ios-eye")||e.target.parentNode.classList.contains("nameStyle")||(t.player&&(t.player.dispose(),t.player=null),t.pictrueList.forEach((function(t){t.realName=!1})))}),!0)},methods:{visibleChange:function(t){var e=this;this.$nextTick((function(){t||e.cascaderValue.length&&(e.ids.length?(e.pids=e.cascaderValue[e.cascaderValue.length-1],e.getMove()):(e.$Message.warning("请先选择图片"),e.cascaderValue=[]))}))},createPoster:function(t){new Promise((function(e,i){var n=document.createElement("video");n.setAttribute("src",t.att_dir),n.setAttribute("crossOrigin","anonymous"),n.setAttribute("width",100),n.setAttribute("height",100),n.setAttribute("preload","auto"),n.addEventListener("canplay",(function(){var t=document.createElement("canvas"),i=t.getContext("2d"),r=n.width,a=n.height;t.width=r,t.height=a,i.drawImage(n,0,0,r,a),e(t.toDataURL("image/jpeg"))}))})).then((function(e){t.poster=e}))},preview:function(t){if(2==this.pictrueList[t].file_type&&this.createPlayer(this.pictrueList[t]),1===this.layout){if(!this.pictrueList[t].realName)for(var e=0;e1)return this.$Message.warning("最多只能选一张图片");this.$emit("getPic",this.checkPicList[0])}else{var t=this.$route.query.maxLength;if(void 0!=t&&this.checkPicList.length>Number(t))return this.$Message.warning("最多只能选"+t+"张图片");this.$emit("getPicD",this.checkPicList)}},editName:function(t){var e=t.real_name.split("."),i=void 0==e[1]?[]:e[1];e[0].length,i.length,t.editName=t.real_name},bindTxt:function(t){var e=this;""==t.real_name&&this.$Message.error("请填写内容"),Object(n.e)(t.att_id,{real_name:t.real_name}).then((function(i){e.editName(t),t.isEdit=!1,e.$Message.success(i.msg)})).catch((function(t){e.$Message.error(t.msg)}))},openUpload:function(){var t=this;this.$uploadImg({categories:this.treeData,categoryId:this.treeId,onClose:function(){t.fileData.page=1,t.getFileList()}})}}},g=(i("f37c"),i("2877")),v=Object(g.a)(m,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"Modal"},[e("Row",[e("Col",{attrs:{span:"24"}},[e("Tabs",{on:{"on-click":t.onhangeTab},model:{value:t.uploadName.file_type,callback:function(e){t.$set(t.uploadName,"file_type",e)},expression:"uploadName.file_type"}},t._l(t.headTab,(function(t,i){return e("TabPane",{key:i,attrs:{label:t.title,name:t.name}})})),1)],1)],1),e("Row",{staticStyle:{display:"none"}},[e("Col",{attrs:{span:"5"}},[e("div",{staticClass:"input"},[e("Input",{staticStyle:{width:"90%"},attrs:{search:"",placeholder:"请输入分类名称"},on:{"on-search":t.changePage},model:{value:t.uploadName.name,callback:function(e){t.$set(t.uploadName,"name",e)},expression:"uploadName.name"}})],1)]),e("Col",{attrs:{span:"20"}},[1==t.uploadName.file_type?e("Button",{staticClass:"mr10",on:{click:t.openUpload}},[t._v("上传图片")]):e("Button",{staticClass:"mr10",on:{click:t.uploadVideo}},[t._v("上传视频")]),e("Button",{staticClass:"mr10",attrs:{disabled:0===t.checkPicList.length},on:{click:function(e){return e.stopPropagation(),t.editPicList("图片")}}},[t._v(t._s(1==t.uploadName.file_type?"删除图片":"删除视频"))])],1)],1),e("Row",{attrs:{type:"flex",justify:"start"}},[e("Col",{attrs:{span:"4"}},[e("div",{staticClass:"trees"},[e("Tree",{ref:"tree",staticClass:"treeBox",attrs:{data:t.treeData,render:t.renderContent,"load-data":t.loadData}}),t.searchClass&&t.treeData.length<=1?e("div",{staticClass:"searchNo"},[t._v("\n 此分类暂无数据\n ")]):t._e()],1)]),e("Col",{attrs:{span:"20"}},[e("div",{staticClass:"right-container"},[e("div",{staticClass:"header"},[e("div",[1==t.uploadName.file_type?e("Button",{staticClass:"mr10 upload",on:{click:t.openUpload}},[t._v("上传图片")]):e("Button",{staticClass:"mr10 upload",on:{click:t.uploadVideo}},[t._v("上传视频")]),e("Button",{staticClass:"mr10",attrs:{disabled:0===t.checkPicList.length},on:{click:function(e){return e.stopPropagation(),t.editPicList("图片")}}},[t._v(t._s(1==t.uploadName.file_type?"删除图片":"删除视频"))]),e("div",{staticClass:"select-wrapper"},[e("Cascader",{attrs:{data:t.cascaderData,"load-data":t.loadData,"change-on-select":""},on:{"on-visible-change":t.visibleChange},model:{value:t.cascaderValue,callback:function(e){t.cascaderValue=e},expression:"cascaderValue"}})],1)],1),e("div",[e("div",{staticClass:"input-wrapper"},[e("Input",{attrs:{search:"",placeholder:"搜索图片名称"},on:{"on-search":t.changePage},model:{value:t.uploadName.name,callback:function(e){t.$set(t.uploadName,"name",e)},expression:"uploadName.name"}})],1),e("RadioGroup",{attrs:{type:"button","button-style":"solid"},model:{value:t.layout,callback:function(e){t.layout=e},expression:"layout"}},[e("Radio",{attrs:{label:1}},[e("Icon",{attrs:{custom:"iconfont icongongge",size:"14"}})],1),e("Radio",{attrs:{label:2}},[e("Icon",{attrs:{custom:"iconfont iconliebiao",size:"14"}})],1)],1)],1)]),e("div",{ref:"main",staticClass:"main"},[e("div",{directives:[{name:"show",rawName:"v-show",value:t.isShowPic&&1==t.layout,expression:"isShowPic && layout == 1"}],staticClass:"imagesNo"},[e("Icon",{attrs:{type:"ios-images",size:"60",color:"#dbdbdb"}}),e("span",{staticClass:"imagesNo_sp"},[t._v(t._s(1==t.uploadName.file_type?"图片库为空":"视频库为空"))])],1),e("transition",[1==t.layout?e("div",{key:"grid",staticClass:"acea-row conter"},t._l(t.pictrueList,(function(i,n){return e("div",{key:n,staticClass:"pictrueList_pic",on:{mouseenter:function(e){return t.enterLeave(i)},mouseleave:function(e){return t.enterLeave(i)}}},[i.num>0?e("p",{staticClass:"number"},[e("Badge",{attrs:{count:i.num,type:"error",offset:[11,12]}},[e("a",{staticClass:"demo-badge",attrs:{href:"#"}})])],1):t._e(),e("div",{staticClass:"picimage"},[e("img",{directives:[{name:"lazy",rawName:"v-lazy",value:i.poster||i.satt_dir,expression:"item.poster || item.satt_dir"}],class:i.isSelect?"on":"",on:{click:function(e){return e.stopPropagation(),t.changImage(i,n,t.pictrueList)}}})]),e("div",{staticClass:"picName"},[i.isEdit?e("Input",{attrs:{size:"small",type:"text"},on:{"on-blur":function(e){return t.bindTxt(i)}},model:{value:i.real_name,callback:function(e){t.$set(i,"real_name",e)},expression:"item.real_name"}}):e("p",{attrs:{title:i.editName}},[t._v("\n "+t._s(i.editName)+"\n ")]),e("div",{staticClass:"picMenu"},[e("Button",{on:{click:function(t){i.isEdit=!i.isEdit}}},[t._v("\n 重命名\n ")]),e("Button",{staticClass:"preview",on:{click:function(e){return t.preview(n)}}},[t._v("\n 查看\n ")]),e("Button",{on:{click:function(e){return t.editPicList(i.att_id)}}},[t._v("\n 删除\n ")])],1)],1),e("div",{directives:[{name:"show",rawName:"v-show",value:i.realName&&i.real_name,expression:"item.realName && item.real_name"}],staticClass:"nameStyle"},[1==i.file_type?e("img",{attrs:{src:i.satt_dir}}):2==i.file_type?e("div",{attrs:{id:"player".concat(i.att_id)}}):t._e()])])})),0):t._e(),2==t.layout?e("Table",{key:"list",ref:"selection",attrs:{columns:t.columns4,data:t.pictrueList},on:{"on-selection-change":t.selectionChange},scopedSlots:t._u([{key:"poster",fn:function(i){var n=i.row,r=i.index;return[e("img",{directives:[{name:"lazy",rawName:"v-lazy",value:n.satt_dir,expression:"row.satt_dir"},{name:"viewer",rawName:"v-viewer",value:{navbar:!1,toolbar:!1},expression:"{navbar:false,toolbar:false}"}],ref:"sattDir".concat(r)}),e("div",[t._v(t._s(n.editName))])]}},{key:"action",fn:function(i){var n=i.row,r=i.index;return[e("Button",{attrs:{type:"text"},on:{click:function(e){return t.editPicList(n.att_id)}}},[t._v("删除")]),e("Button",{attrs:{type:"text"},on:{click:function(e){return t.rename(r)}}},[t._v("重命名")]),e("Button",{attrs:{type:"text"},on:{click:function(e){return t.preview(r)}}},[t._v("查看")])]}}],null,!1,1106146729)}):t._e()],1)],1),e("div",{staticClass:"footer acea-row row-right"},[e("Page",{attrs:{total:t.total,"show-elevator":"","show-total":"",current:t.fileData.page,"page-size":t.fileData.limit},on:{"on-change":t.pageChange}})],1)])])],1),e("Modal",{attrs:{width:"1024px",scrollable:"","footer-hide":"",closable:"",title:"上传视频","mask-closable":!1,"z-index":9},model:{value:t.modalVideo,callback:function(e){t.modalVideo=e},expression:"modalVideo"}},[e("uploadVideo",{attrs:{pid:t.fileData.pid},on:{getVideo:t.getvideo}})],1)],1)}),[],!1,null,"28ff51c5",null);e.default=v.exports},f37c:function(t,e,i){"use strict";i("0b0e")}}]);