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
13 KiB
1 lines
13 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-321d01f1"],{2628:function(e,t,i){},"5a1b":function(e,t,i){e.exports=i.p+"static/img/file.8bc3a8bc.png"},a434:function(e,t,i){"use strict";var a=i("23e7"),o=i("23cb"),l=i("a691"),r=i("50c4"),s=i("7b0b"),n=i("65f0"),d=i("8418"),f=i("1dde"),m=i("ae40"),c=f("splice"),u=m("splice",{ACCESSORS:!0,0:0,1:2}),g=Math.max,h=Math.min,b=9007199254740991,p="Maximum allowed length exceeded";a({target:"Array",proto:!0,forced:!c||!u},{splice:function(e,t){var i,a,f,m,c,u,v=s(this),w=r(v.length),x=o(e,w),k=arguments.length;if(0===k?i=a=0:1===k?(i=0,a=w-x):(i=k-2,a=h(g(l(t),0),w-x)),w+i-a>b)throw TypeError(p);for(f=n(v,a),m=0;m<a;m++)c=x+m,c in v&&d(f,m,v[c]);if(f.length=a,i<a){for(m=x;m<w-a;m++)c=m+a,u=m+i,c in v?v[u]=v[c]:delete v[u];for(m=w;m>w-a+i;m--)delete v[m-1]}else if(i>a)for(m=w-a;m>x;m--)c=m+a-1,u=m+i-1,c in v?v[u]=v[c]:delete v[u];for(m=0;m<i;m++)v[m+x]=arguments[m+2];return v.length=w-a+i,f}})},bfac:function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.subloading,expression:"subloading"}],staticClass:"subfile_main",attrs:{"element-loading-text":"数据加载中..."}},[a("div",[a("div",{staticClass:"use_button textright"},[a("el-button",{attrs:{type:"primary",icon:"el-icon-edit"},on:{click:function(t){e.dirbox=!0}}},[e._v("创建目录")]),a("el-button",{attrs:{type:"primary"},on:{click:function(t){e.uploadDrawer=!0}}},[e._v("上传"),a("i",{staticClass:"el-icon-upload el-icon--right"})])],1),a("div",{on:{click:e.fileTableMClick}},[a("el-table",{staticClass:"filesmd",staticStyle:{width:"100%"},attrs:{data:e.dirdata,"empty-text":"暂无文件夹数据",border:""}},[a("el-table-column",{attrs:{align:"left",prop:"name",label:"名称"}}),a("el-table-column",{attrs:{align:"left",label:"类型",width:"auto"},scopedSlots:e._u([{key:"default",fn:function(e){return[a("div",{staticClass:"type_file_click"},[a("a",{attrs:{title:"点击进入子目录",href:"#/filemange/subfile?id="+e.row.id}},[a("img",{attrs:{src:i("5a1b"),alt:"图片"}})])])]}}])}),a("el-table-column",{attrs:{align:"center",label:"操作",width:"auto"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"file_caozuo"},[a("el-button",{attrs:{size:"mini",filenames:t.row.name,mark:"rename"}},[e._v("重命名")])],1),a("div",{staticClass:"file_caozuo2"},[a("el-button",{attrs:{size:"mini",realpath:t.row.frealpath,mark:"movefiledir"}},[e._v("移动")]),a("el-button",{attrs:{size:"mini",mark:"dirdelete",filenames:t.row.name,type:"danger"}},[e._v("删除")])],1)]}}])})],1),a("el-table",{staticStyle:{width:"100%"},attrs:{"show-header":!1,"empty-text":"暂无文件数据",data:e.tableData,border:""}},[a("el-table-column",{attrs:{align:"left",prop:"name",label:"名称"}}),a("el-table-column",{attrs:{align:"left",label:"图片",width:"auto"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("img",{attrs:{src:e.imgurl+t.row.image,alt:"图片"}})]}}])}),a("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{staticClass:"file_caozuo"},[a("el-button",{attrs:{size:"mini",filenames:t.row.name,suffixs:"."+t.row.suffix,mark:"rename"}},[e._v("重命名")])],1),a("div",{staticClass:"file_caozuo2"},[a("el-button",{attrs:{size:"mini",realpath:t.row.frealpath,mark:"movefiledir"}},[e._v("移动")]),a("el-button",{attrs:{size:"mini",mark:"filedelete",filenames:t.row.name,type:"danger"}},[e._v("删除")])],1)]}}])})],1)],1)]),a("el-dialog",{attrs:{title:"创建目录",visible:e.dirbox},on:{"update:visible":function(t){e.dirbox=t}}},[a("el-form",{attrs:{model:e.dirform}},[a("el-form-item",{attrs:{label:"目录名称","label-width":e.formLabelWidth}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.dirform.dir,callback:function(t){e.$set(e.dirform,"dir",t)},expression:"dirform.dir"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.dirbox=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary",loading:e.mkdirloadings},on:{click:e.mkdirs}},[e._v("确 定")])],1)],1),a("el-dialog",{attrs:{title:"重命名",visible:e.renamebox},on:{"update:visible":function(t){e.renamebox=t}}},[a("el-form",{attrs:{model:e.renamefileform}},[a("el-form-item",{attrs:{label:"新名称","label-width":e.formLabelWidth}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.renamefileform.to,callback:function(t){e.$set(e.renamefileform,"to",t)},expression:"renamefileform.to"}},[e.filesuffix?a("template",{slot:"append"},[e._v(e._s(e.filesuffix))]):e._e()],2)],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.renamebox=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary",loading:e.mkdirloadings},on:{click:e.renameFileDir}},[e._v("确 定")])],1)],1),a("el-dialog",{attrs:{title:"目录移动弹出框",visible:e.movebox},on:{"update:visible":function(t){e.movebox=t}}},[a("el-form",{attrs:{model:e.movefileform}},[a("el-form-item",{attrs:{label:"当前位置","label-width":e.formLabelWidth}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.movefileform.from,callback:function(t){e.$set(e.movefileform,"from",t)},expression:"movefileform.from"}})],1),a("el-form-item",{attrs:{label:"目标位置(请参考当前位置的格式填写目标位置,需要带上当前的文件名称)","label-width":e.formLabelWidth}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.movefileform.to,callback:function(t){e.$set(e.movefileform,"to",t)},expression:"movefileform.to"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.movebox=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary",loading:e.mkdirloadings},on:{click:e.moveFileDir}},[e._v("确 定")])],1)],1),a("el-drawer",{attrs:{title:"上传图片",visible:e.uploadDrawer,direction:e.direction,size:"100%"},on:{"update:visible":function(t){e.uploadDrawer=t}}},[a("el-upload",{attrs:{action:"",limit:1,"list-type":"picture-card","on-remove":e.handleRemove,"on-exceed":e.fileexceed,multiple:!0,"on-change":e.filechange,"on-preview":e.handlePictureCardPreview,disabled:!1,"file-list":e.uploadFilelist,accept:".jpg, .jpeg, .png, .gif, webp","auto-upload":!1}},[a("i",{staticClass:"el-icon-plus",attrs:{slot:"default"},slot:"default"}),a("span",{staticClass:"addimgtext"},[e._v("添加照片")])]),a("div",{staticClass:"request_main"},[a("el-button",{attrs:{type:"success",loading:e.uploadLoad},on:{click:function(t){return e.UploadRequest()}}},[e._v("开始上传"),a("i",{staticClass:"el-icon-upload el-icon--right"})])],1),a("div",{staticClass:"el-upload__tip"},[e._v("只能上传.jpg, .jpeg, .png, .gif,webp文件,且不超过5MB")]),a("el-dialog",{attrs:{modal:!1,visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("img",{attrs:{width:"100%",src:e.dialogImageUrl,alt:"图片"}})])],1)],1)},o=[],l=(i("b0c0"),i("a434"),i("d3b7"),i("159b"),i("b64b"),i("4a9d")),r=i("c24f"),s={watch:{$route:function(e,t){this.getFileData()}},created:function(){this.getFileData()},data:function(){return{imgurl:"",tableData:[],dirdata:[],dirbox:!1,dirform:{dir:"",parent:""},formLabelWidth:"",rmdirform:{dir:"",parent:""},rmfileform:{file:"",parent:""},renamebox:!1,filesuffix:!1,renamefileform:{from:"",to:"",parent:""},movebox:!1,movefileform:{from:"",to:""},subloading:!1,mkdirloadings:!1,uploadDrawer:!1,direction:"ttb",uploadFilelist:[],dialogImageUrl:"",dialogVisible:!1,disabled:!1,imgUploadData:{name:"",file:"",parent:""},uploadLoad:!1}},methods:{handleRemove:function(e,t){console.log(t)},handlePictureCardPreview:function(e){this.dialogImageUrl=e.url,this.dialogVisible=!0},handleDownload:function(e){this.$message({showClose:!0,message:"右键点击或者长按图片自行下载"})},fileexceed:function(e,t){this.$message({showClose:!0,message:"当前版本限制上传一个文件",type:"warning"})},filechange:function(e,t){var i=this,a=e.size/1024/1024<5;if(!a)return this.$message.error("文件大小不能超过 5MB!"+e.name+"已超过,重新选择"),void t.splice(-1,1);this.uploadFilelist=t,this.imgUploadData.name=e.name,this.getBase64(e.raw).then((function(e){i.imgUploadData.file=e}))},getBase64:function(e){var t=this;return new Promise((function(i,a){if(window.FileReader&&e){var o=new FileReader,l="";o.readAsDataURL(e),o.onload=function(){l=o.result},o.onerror=function(e){a(e)},o.onloadend=function(){i(l)}}else t.$message({showClose:!0,message:"获取base64出错",type:"error"})}))},UploadRequest:function(){var e=this;this.uploadLoad=!0,Object(r["k"])(this.imgUploadData).then((function(t){var i=t.data;1==i.code&&(e.$message({showClose:!0,message:i.msg,type:"success"}),e.uploadDrawer=!1,e.uploadFilelist=[],e.getFileData()),e.uploadLoad=!1})).catch((function(t){Object(r["h"])(e,t),e.uploadLoad=!1}))},getFileData:function(){var e=this,t={},i=window.location.href;-1!=i.indexOf("?id")&&(t.id=i.split("?id=")[1]);this.subloading=!0,Object(r["d"])(t).then((function(t){var i=t.data,a=i.data.dirTree;1==i.code&&(e.dirdata=[],e.tableData=[],a.directories&&(e.dirdata=e.forObjectData(a.directories)),a.files&&(e.tableData=e.forObjectData(a.files)),e.dirform.parent=a.realpath,e.rmdirform.parent=a.realpath,e.rmfileform.parent=a.realpath,e.renamefileform.parent=a.realpath,e.imgUploadData.parent=a.realpath,e.movefileform.from=a.realpath,e.subloading=!1)})).catch((function(t){Object(r["h"])(e,t),e.subloading=!1}))},forObjectData:function(e){var t=null,i=[];return Object.keys(e).forEach((function(a){var o=null;e[a].filename&&(o=e[a].filename+"."+e[a].extension),t={suffix:e[a].extension||"",image:e[a].path,name:o||e[a].directory,id:e[a].id,frealpath:e[a].realpath},i.push(t)})),i},mkdirs:function(){var e=this,t=this;this.dirform.dir?(this.mkdirloadings=!0,Object(r["e"])(this.dirform).then((function(i){var a=i.data;1==a.code?(l["a"].$emit("mkdirSuccess"),e.getFileData(),e.dirform.dir="",t.$message({showClose:!0,message:a.msg,type:"success"})):t.$message({showClose:!0,message:a.err,type:"error"}),e.mkdirloadings=!1,e.dirbox=!1})).catch((function(t){e.mkdirloadings=!1,Object(r["h"])(e,t)}))):t.$message({showClose:!0,message:"目录名不能为空",type:"error"})},rmdirm:function(){var e=this,t=this;this.subloading=!0,Object(r["i"])(this.rmdirform).then((function(i){var a=i.data;a.data.dirTree;1==a.code?(l["a"].$emit("mkdirSuccess"),e.getFileData(),t.$message({showClose:!0,message:a.msg,type:"success"})):t.$message({showClose:!0,message:a.err,type:"error"}),e.subloading=!1})).catch((function(t){Object(r["h"])(e,t),e.subloading=!1}))},rmfile:function(){var e=this,t=this;this.subloading=!0,Object(r["b"])(this.rmfileform).then((function(i){var a=i.data;1==a.code?(e.getFileData(),t.$message({showClose:!0,message:a.msg,type:"success"})):t.$message({showClose:!0,message:a.err,type:"error"}),e.subloading=!1})).catch((function(t){e.subloading=!1,Object(r["h"])(e,t)}))},renameFileDir:function(){var e=this;if(this.renamefileform.to){this.filesuffix&&(this.renamefileform.to+=this.filesuffix);var t=this;this.subloading=!0,Object(r["g"])(this.renamefileform).then((function(i){var a=i.data;1==a.code?(l["a"].$emit("mkdirSuccess"),e.getFileData(),t.$message({showClose:!0,message:a.msg,type:"success"})):t.$message({showClose:!0,message:a.err,type:"error"}),e.subloading=!1,e.renamebox=!1})).catch((function(t){e.subloading=!1,Object(r["h"])(e,t)}))}else this.$message({showClose:!0,message:"新名称不能为空",type:"error"})},moveFileDir:function(){var e=this;if(this.movefileform.to&&this.movefileform.from){var t=this;this.subloading=!0,Object(r["f"])(this.movefileform).then((function(i){var a=i.data;1==a.code?(l["a"].$emit("mkdirSuccess"),e.getFileData(),t.$message({showClose:!0,message:a.msg,type:"success"})):t.$message({showClose:!0,message:a.err,type:"error"}),e.subloading=!1,e.movebox=!1})).catch((function(t){e.subloading=!1,Object(r["h"])(e,t)}))}else this.$message({showClose:!0,message:"不能为空",type:"error"})},fileTableMClick:function(e){var t=e.target,i=t.tagName.toLowerCase(),a=(e.currentTarget,t),o=null;return"span"==i&&(a=t.parentNode),o=a.getAttribute("mark"),"dirdelete"==o?(this.rmdirform.dir=a.getAttribute("filenames"),void this.rmdirm()):"filedelete"==o?(this.rmfileform.file=a.getAttribute("filenames"),void this.rmfile()):"rename"==o?(this.renamefileform.from=a.getAttribute("filenames"),this.filesuffix=a.getAttribute("suffixs"),this.renamefileform.to="",void(this.renamebox=!0)):"movefiledir"==o?(this.movefileform.from=a.getAttribute("realpath"),this.movefileform.to="",void(this.movebox=!0)):void 0}}},n=s,d=(i("d29d"),i("2877")),f=Object(d["a"])(n,a,o,!1,null,null,null);t["default"]=f.exports},d29d:function(e,t,i){"use strict";i("2628")}}]); |