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

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-058fa60c"],{"7d2f":function(e,t,i){},a475:function(e,t,i){"use strict";i("7d2f")},f454:function(e,t,i){"use strict";i.r(t);var o=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:"filemange_container",attrs:{"element-loading-text":e.loadingText}},[e._m(0),i("div",{staticClass:"use_button"},[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",icon:"el-icon-refresh-right"},on:{click:e.getFileData}},[e._v("刷新")])],1),i("div",{on:{click:e.fileTableMClick}},[i("el-table",{staticClass:"filesmd verleft",staticStyle:{width:"100%"},attrs:{data:e.dirdata,"empty-text":"暂无文件夹数据","row-style":{"background-color":"#fffdfa"}}},[i("el-table-column",{attrs:{align:"left",prop:"name",label:"名称","min-width":"25%"}}),i("el-table-column",{attrs:{align:"left",label:"类型","min-width":"30%"},scopedSlots:e._u([{key:"default",fn:function(e){return[i("div",{staticClass:"type_file_click"},[i("el-tooltip",{attrs:{content:"点击进入子文件夹",placement:"bottom-start",effect:"light"}},[i("a",{attrs:{href:"#/filemange/subfile?id="+e.row.id}},[i("svg",{staticClass:"fileicon",staticStyle:{width:"5.15234375em",height:"5em","vertical-align":"middle",fill:"currentColor",overflow:"hidden"},attrs:{viewBox:"0 0 1180 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4701"}},[i("path",{attrs:{d:"M1099.433546 289.842983h-1.08787v-99.462424a128.679511 128.679511 0 0 0-93.246023-126.65918v-3.263611A60.454505 60.454505 0 0 0 944.023508 0.003264H729.246837A60.454505 60.454505 0 0 0 668.326102 59.836128H122.526051A126.65918 126.65918 0 0 0 0.062941 190.380559V890.502778a12.277393 12.277393 0 0 0 2.331151 6.216401v1.243281c0 72.110257 46.623011 126.03754 113.760147 126.03754H969.821575c67.603366 0 105.212595-68.225006 122.463109-130.544431L1174.652004 419.610365c18.182974-75.063048-7.459682-129.767381-75.218458-129.767382z m-897.337556 0a160.072339 160.072339 0 0 0-132.253942 78.637479v-124.32803a73.198128 73.198128 0 0 1 46.623011-54.859743H668.326102a60.609915 60.609915 0 0 1 60.454505-59.988274h215.242901a60.609915 60.609915 0 0 1 60.454505 60.609914v3.108201a126.50377 126.50377 0 0 1 90.604052 97.908324z",fill:"#FFE680","p-id":"4702"}})])])])],1)]}}])}),i("el-table-column",{attrs:{align:"left",label:"操作","min-width":"45%"},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)],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)],1)},a=[function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("span",{staticStyle:{color:"red"}},[e._v("古村,扫街,美女")]),e._v("这几个目录以及目录下的文件为演示用,不能做相关操作,比如删除,重命名创建目录的一些列操作。 如需做相关操作可在"),i("span",{staticStyle:{color:"red"}},[e._v("文件管理")]),e._v("目录下创建新目录进行相关操作。")])}],r=(i("d3b7"),i("159b"),i("b64b"),i("c24f")),s=i("4a9d"),l={created:function(){this.getFileData()},data:function(){return{dirdata:[],loadingText:"文件夹获取中...",subloading:!1,mkdirloadings:!1,dirbox:!1,dirform:{dir:"",parent:""},formLabelWidth:"",rmdirform:{dir:"",parent:""},renamebox:!1,filesuffix:!1,renamefileform:{from:"",to:"",parent:""},movebox:!1,movefileform:{from:"",to:""}}},methods:{getFileData:function(){var e=this;this.dirdata=[],this.loadingText="获取文件夹中...",this.subloading=!0,Object(r["e"])().then((function(t){var i=t.data;if(1==i.code){var o=i.data.menus;o&&(e.dirdata=e.forObjectData(o))}e.$nextTick((function(){this.subloading=!1}))})).catch((function(t){Object(r["i"])(e,t),e.subloading=!1}))},forObjectData:function(e){var t=null,i=[];return Object.keys(e).forEach((function(o){var a=null;e[o].filename&&(a=e[o].filename+"."+e[o].extension),t={suffix:e[o].extension||"",image:e[o].path,name:a||e[o].directory,id:e[o].id,frealpath:e[o].realpath||e[o].directory},i.push(t)})),i},mkdirs:function(){var e=this,t=this;this.dirform.dir?(this.loadingText="创建文件夹中...",this.mkdirloadings=!0,Object(r["f"])(this.dirform).then((function(i){var o=i.data;1==o.code?(s["a"].$emit("mkdirSuccess"),e.getFileData(),e.dirform.dir="",t.$message({showClose:!0,message:o.msg,type:"success"})):t.$message({showClose:!0,message:o.err,type:"error"}),e.mkdirloadings=!1,e.dirbox=!1})).catch((function(t){e.mkdirloadings=!1,Object(r["i"])(e,t)}))):t.$message({showClose:!0,message:"目录名不能为空",type:"error"})},rmdirm:function(){var e=this,t=this;this.loadingText="删除文件夹中...",this.subloading=!0,Object(r["j"])(this.rmdirform).then((function(i){var o=i.data;o.data.dirTree;1==o.code?(s["a"].$emit("mkdirSuccess"),e.getFileData(),t.$message({showClose:!0,message:o.msg,type:"success"})):t.$message({showClose:!0,message:o.err,type:"error"})})).catch((function(t){Object(r["i"])(e,t),e.subloading=!1}))},moveFileDir:function(){var e=this;if(this.movefileform.to&&this.movefileform.from){var t=this;this.loadingText="移动文件夹中...",this.subloading=!0,Object(r["g"])(this.movefileform).then((function(i){var o=i.data;1==o.code?(s["a"].$emit("mkdirSuccess"),e.getFileData(),t.$message({showClose:!0,message:o.msg,type:"success"})):t.$message({showClose:!0,message:o.err,type:"error"}),e.movebox=!1})).catch((function(t){e.subloading=!1,Object(r["i"])(e,t)}))}else this.$message({showClose:!0,message:"不能为空",type:"error"})},renameFileDir:function(){var e=this;if(this.renamefileform.to){this.filesuffix&&(this.renamefileform.to+=this.filesuffix);var t=this;this.loadingText="文件夹重命名中...",this.subloading=!0,Object(r["h"])(this.renamefileform).then((function(i){var o=i.data;1==o.code?(s["a"].$emit("mkdirSuccess"),e.getFileData(),t.$message({showClose:!0,message:o.msg,type:"success"})):t.$message({showClose:!0,message:o.err,type:"error"}),e.renamebox=!1})).catch((function(t){e.subloading=!1,Object(r["i"])(e,t)}))}else this.$message({showClose:!0,message:"新名称不能为空",type:"error"})},fileTableMClick:function(e){var t=this,i=e.target,o=i.tagName.toLowerCase(),a=(e.currentTarget,i),r=null;return"span"==o&&(a=i.parentNode),r=a.getAttribute("mark"),"dirdelete"==r?(this.rmdirform.dir=a.getAttribute("filenames"),void this.$confirm("此操作将删除该文件夹, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.rmdirm()})).catch((function(){t.$message({type:"info",message:"已取消删除"})}))):"rename"==r?(this.renamefileform.from=a.getAttribute("filenames"),this.filesuffix=a.getAttribute("suffixs"),this.renamefileform.to="",void(this.renamebox=!0)):"movefiledir"==r?(this.movefileform.from=a.getAttribute("realpath"),this.movefileform.to="",void(this.movebox=!0)):void 0}}},n=l,m=(i("a475"),i("2877")),f=Object(m["a"])(n,o,a,!1,null,null,null);t["default"]=f.exports}}]);