You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
27 KiB
1 lines
27 KiB
(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;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?s(Object(i),!0).forEach((function(e){l(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function l(t,e,i){return(e=function(t){var e=function(t,e){if("object"!=o(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var n=i.call(t,e||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function u(t){return function(t){if(Array.isArray(t))return d(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return d(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?d(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=Array(e);i<e;i++)n[i]=t[i];return n}function h(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */h=function(){return e};var t,e={},i=Object.prototype,n=i.hasOwnProperty,r=Object.defineProperty||function(t,e,i){t[e]=i.value},a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,i){return t[e]=i}}function d(t,e,i,n){var a=e&&e.prototype instanceof b?e:b,o=Object.create(a.prototype),s=new E(n||[]);return r(o,"_invoke",{value:C(t,i,s)}),o}function f(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}e.wrap=d;var p="suspendedStart",m="suspendedYield",g="executing",v="completed",y={};function b(){}function w(){}function L(){}var _={};u(_,s,(function(){return this}));var k=Object.getPrototypeOf,N=k&&k(k(j([])));N&&N!==i&&n.call(N,s)&&(_=N);var P=L.prototype=b.prototype=Object.create(_);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function i(r,a,s,c){var l=f(t[r],t,a);if("throw"!==l.type){var u=l.arg,d=u.value;return d&&"object"==o(d)&&n.call(d,"__await")?e.resolve(d.__await).then((function(t){i("next",t,s,c)}),(function(t){i("throw",t,s,c)})):e.resolve(d).then((function(t){u.value=t,s(u)}),(function(t){return i("throw",t,s,c)}))}c(l.arg)}var a;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return a=a?a.then(r,r):r()}})}function C(e,i,n){var r=p;return function(a,o){if(r===g)throw Error("Generator is already running");if(r===v){if("throw"===a)throw o;return{value:t,done:!0}}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var c=O(s,n);if(c){if(c===y)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===p)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=g;var l=f(e,i,n);if("normal"===l.type){if(r=n.done?v:m,l.arg===y)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=v,n.method="throw",n.arg=l.arg)}}}function O(e,i){var n=i.method,r=e.iterator[n];if(r===t)return i.delegate=null,"throw"===n&&e.iterator.return&&(i.method="return",i.arg=t,O(e,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=f(r,e.iterator,i.arg);if("throw"===a.type)return i.method="throw",i.arg=a.arg,i.delegate=null,y;var o=a.arg;return o?o.done?(i[e.resultName]=o.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,y):o:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,y)}function $(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function D(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach($,this),this.reset(!0)}function j(e){if(e||""===e){var i=e[s];if(i)return i.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function i(){for(;++r<e.length;)if(n.call(e,r))return i.value=e[r],i.done=!1,i;return i.value=t,i.done=!0,i};return a.next=a}}throw new TypeError(o(e)+" is not iterable")}return w.prototype=L,r(P,"constructor",{value:L,configurable:!0}),r(L,"constructor",{value:w,configurable:!0}),w.displayName=u(L,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,L):(t.__proto__=L,u(t,l,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},x(S.prototype),u(S.prototype,c,(function(){return this})),e.AsyncIterator=S,e.async=function(t,i,n,r,a){void 0===a&&(a=Promise);var o=new S(d(t,i,n,r),a);return e.isGeneratorFunction(i)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},x(P),u(P,l,"Generator"),u(P,s,(function(){return this})),u(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),i=[];for(var n in e)i.push(n);return i.reverse(),function t(){for(;i.length;){var n=i.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=j,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(D),!e)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function r(n,r){return s.type="throw",s.arg=e,i.next=n,r&&(i.method="next",i.arg=t),!!r}for(var a=this.tryEntries.length-1;a>=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<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var r=this.tryEntries[i];if(r.tryLoc<=this.prev&&n.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),y},finish:function(t){for(var e=this.tryEntries.length-1;e>=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;e<this.pictrueList.length;e++)this.pictrueList[e].realName=!1;this.pictrueList[t].realName=!this.pictrueList[t].realName}2===this.layout&&this.$refs["sattDir".concat(t)].$viewer.show()},rename:function(t){var e=this;this.$Modal.confirm({render:function(i){return i("Input",{props:{value:e.pictrueList[t].editName,autofocus:!0,placeholder:"请输入文件名"},on:{input:function(i){e.pictrueList[t].real_name=i}}})},onOk:function(){e.bindTxt(e.pictrueList[t])}})},createPlayer:function(t){this.player&&(this.player.dispose(),this.player=null),this.player=new Aliplayer({id:"player".concat(t.att_id),width:"100%",height:"100%",autoplay:!0,source:t.att_dir})},uploadVideo:function(){this.modalVideo=!0},getvideo:function(){this.modalVideo=!1,this.fileData.page=1,this.getFileList()},onhangeTab:function(){this.getList(),this.getFileList(),this.checkPicList=[]},enterMouse:function(t){t.realName=!t.realName},enterLeave:function(t){t.isShowEdit=!t.isShowEdit},getToken:function(){this.header["Authori-zation"]="Bearer "+a.a.cookies.get("token")},renderContent:function(t,e){var i=this,n=e.root,r=e.node,a=e.data,o=[];return 0==a.pid&&o.push(t("DropdownItem",{props:{name:"1"}},"添加")),a.id&&o.push(t("DropdownItem",{props:{name:"2"}},"编辑"),t("DropdownItem",{props:{name:"3"}},"删除")),t("span",{style:{position:"relative",display:"inline-block",width:"100%"},attrs:{id:"tree"+a.id},on:{mouseover:function(){a.flag=!0,i.$refs.tree.$el.querySelector("#tree".concat(a.id)).parentNode.parentNode.classList.add("hovering")},mouseout:function(){a.flag=!1,i.$refs.tree.$el.querySelector("#tree".concat(a.id)).parentNode.parentNode.classList.remove("hovering")},click:function(){i.appendBtn(n,r,a)}}},[t("span",{on:{}},[t("Icon",{props:{type:"ios-folder-outline"},style:{marginRight:"8px",visibility:a.pid?"hidden":"visible"}}),t("span",a.title)]),t("Dropdown",{style:{position:"absolute",top:0,right:0},on:{"on-click":function(t){switch(t){case"1":i.append(n,r,a);break;case"2":i.editPic(n,r,a);break;case"3":i.remove(n,r,a,"分类")}}}},[t("Icon",{props:{type:"ios-more"},style:{display:a.flag?"inline-block":"none",marginRight:"8px",fontSize:"20px"}}),t("DropdownMenu",{slot:"list"},o)])])},renderContentSel:function(t,e){var i=this,n=e.root,r=e.node,a=e.data;return t("div",{style:{display:"inline-block",width:"90%"}},[t("span",[t("span",{style:{cursor:"pointer"},class:["ivu-tree-title"],on:{click:function(t){i.handleCheckChange(n,r,a,t)}}},a.title)])])},handleCheckChange:function(t,e,i,n){this.list=[];var r=i.id,a=i.title;this.list.push({value:r,title:a}),this.ids.length?(this.pids=r,this.getMove()):this.$Message.warning("请先选择图片");for(var o=this.$refs.reference.$el.querySelectorAll(".ivu-tree-title-selected"),s=0;s<o.length;s++)o[s].className="ivu-tree-title";n.path[0].className="ivu-tree-title ivu-tree-title-selected"},getMove:function(){var t=this,e={pid:this.pids,images:this.ids.toString()};Object(n.g)(e).then(function(){var e=p(h().mark((function e(i){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.$Message.success(i.msg),t.getFileList(),t.pids=0,t.checkPicList=[],t.ids=[],t.cascaderValue=[];case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$Message.error(e.msg),t.cascaderValue=[]}))},editPicList:function(t){var e=this,i={ids:this.ids.toString()};"number"==typeof t&&(i={ids:t.toString()});var n={title:1==this.uploadName.file_type?"删除选中图片":"删除选中视频",url:"file/file/delete",method:"POST",ids:i};this.$modalSure(n).then((function(t){e.$Message.success(t.msg),e.getFileList(),e.checkPicList=[]})).catch((function(t){e.$Message.error(t.msg)}))},onMouseOver:function(t,e,i){event.preventDefault(),i.flag=!i.flag},onClick:function(t,e,i){i.flag2=!i.flag2},appendBtn:function(t,e,i){var n=this.$refs.tree.$el,r=i.id||0;if(this.treeId===r)return!1;n.querySelector(".selected").classList.remove("selected"),n.querySelector("#tree".concat(i.id)).parentNode.parentNode.classList.add("selected"),this.treeId=r,this.fileData.page=1,this.getFileList()},append:function(t,e,i){this.treeId=i.id,this.getFrom()},remove:function(t,e,i,n){var r=this;this.tits=n;var a={title:"删除 [ "+i.title+" ] 分类",url:"file/category/".concat(i.id),method:"DELETE",ids:""};this.$modalSure(a).then((function(t){r.$Message.success(t.msg),r.getList(),r.checkPicList=[]})).catch((function(t){r.$Message.error(t.msg)}))},editPic:function(t,e,i){var r=this;this.$modalForm(Object(n.a)(i.id,{file_type:this.uploadName.file_type})).then((function(){return r.getList()}))},changePage:function(){this.fileData.page=1,this.getFileList(),this.checkPicList=[]},getList:function(t){var e=this,i={title:1==this.uploadName.file_type?"全部图片":"全部视频",id:"",pid:0};Object(n.f)(this.uploadName).then(function(){var n=p(h().mark((function n(r){var a,o;return h().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:a=r.data.list,(o=[i].concat(u(a))).forEach((function(t,e){t.flag=!1,t.selected=!e,t.label=t.title,t.value=t.id})),e.treeData=o,e.$nextTick((function(){e.$refs.tree.$el.querySelector("#tree".concat(o[0].id)).parentNode.parentNode.classList.add("selected")})),e.cascaderData=JSON.parse(JSON.stringify(o)),e.cascaderData.shift(),"search"!==t?e.treeData2=u(e.treeData):e.searchClass=!0,e.addFlag(e.treeData);case 9:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))},loadData:function(t,e){t.loading=!0,Object(n.f)({pid:t.id,file_type:this.uploadName.file_type}).then(function(){var i=p(h().mark((function i(n){var r,a;return h().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:r=n.data.list,a=r.map((function(t){return c(c({},t),{},{label:t.title,value:t.id,flag:!1})})),t.loading=!1,Object.hasOwnProperty.call(t,"nodeKey")?e(a):(t.children=a,e());case 4:case"end":return i.stop()}}),i)})));return function(t){return i.apply(this,arguments)}}()).catch((function(t){}))},addFlag:function(t){var e=this;t.map((function(t){e.$set(t,"flag",!1),e.$set(t,"flag2",!1),t.children&&e.addFlag(t.children)}))},add:function(){this.treeId=0,this.getFrom()},getFileList:function(){var t=this;this.fileData.pid=this.treeId,this.fileData.file_type=this.uploadName.file_type,this.fileData.name=this.uploadName.name,Object(n.d)(this.fileData).then(function(){var e=p(h().mark((function e(i){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i.data.list.forEach((function(e){e._checked=!1,e.isSelect=!1,e.isEdit=!1,e.isShowEdit=!1,e.realName=!1,e.num=0,t.editName(e),2==e.file_type&&(e.poster="",e.satt_dir.includes("uploads")&&t.createPoster(e))})),t.pictrueList=i.data.list,t.pictrueList.length?t.isShowPic=!1:t.isShowPic=!0,t.total=i.data.count;case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$Message.error(e.msg)}))},pageChange:function(t){this.fileData.page=t,this.getFileList(),this.checkPicList=[]},getFrom:function(){var t=this;this.$modalForm(Object(n.b)({id:this.treeId,file_type:this.uploadName.file_type})).then((function(e){t.getList()}))},beforeUpload:function(t){var e=this;if(-1===["image/png","image/jpg","image/jpeg","image/gif"].indexOf(t.type))return this.$Message.warning({content:"文件 "+t.name+" 格式不正确, 请选择格式正确的图片",duration:5}),!1;var i=this.$cache.local.getJSON("file_size_max"),n=i/1024/1024;return t.size<i?(this.uploadData={pid:this.treeId},new Promise((function(t){e.$nextTick((function(){t(!0)}))}))):(this.$Message.warning({content:"文件体积过大,图片大小不能超过"+n+"M",duration:5}),!1)},handleSuccess:function(t,e,i){200===t.status?(this.fileData.page=1,this.$Message.success(t.msg),this.getFileList()):this.$Message.error(t.msg)},cancel:function(){this.$emit("changeCancel")},selectionChange:function(t){for(var e=0;e<this.pictrueList.length;e++){this.pictrueList[e].isSelect=this.pictrueList[e]._checked=!1,this.pictrueList[e].num=0;for(var i=0;i<t.length;i++)if(this.pictrueList[e].att_id===t[i].att_id){this.pictrueList[e].isSelect=this.pictrueList[e]._checked=!0,this.pictrueList[e].num=i+1;break}}this.checkPicList=t,this.ids=this.checkPicList.map((function(t){return t.att_id}))},changImage:function(t,e,i){var n=this;t.isSelect=!t.isSelect,t._checked=t.isSelect,this.checkPicList=this.pictrueList.filter((function(t){return t.isSelect})),this.ids=[],this.checkPicList.map((function(t,e){n.ids.push(t.att_id)})),this.pictrueList.map((function(t,e){t.isSelect?n.checkPicList.filter((function(e,i){t.att_id==e.att_id&&(t.num=i+1)})):t.num=0}))},checkPics:function(){if("单选"===this.isChoice){if(this.checkPicList.length>1)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")}}]); |