后台管理系统
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

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