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
7.5 KiB
1 lines
7.5 KiB
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-9519a3ea"],{"5a1b":function(e,t,i){e.exports=i.p+"static/img/file.8bc3a8bc.png"},"94d2":function(e,t,i){},f454:function(e,t,i){"use strict";i.r(t);var o=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{directives:[{name:"loading",rawName:"v-loading",value:e.subloading,expression:"subloading"}],staticClass:"filemange_container",attrs:{"element-loading-text":"数据加载中..."}},[o("div",{staticClass:"use_button"},[o("el-button",{attrs:{type:"primary",icon:"el-icon-edit"},on:{click:function(t){e.dirbox=!0}}},[e._v("创建目录")])],1),o("div",{on:{click:e.fileTableMClick}},[o("el-table",{staticClass:"filesmd verleft",staticStyle:{width:"100%"},attrs:{data:e.dirdata,"empty-text":"暂无文件夹数据",border:""}},[o("el-table-column",{attrs:{align:"left",prop:"name",label:"名称"}}),o("el-table-column",{attrs:{align:"left",label:"类型",width:"auto"},scopedSlots:e._u([{key:"default",fn:function(e){return[o("div",{staticClass:"type_file_click"},[o("el-tooltip",{attrs:{content:"进入子目录",placement:"bottom-start",effect:"light"}},[o("a",{attrs:{href:"#/filemange/subfile?id="+e.row.id}},[o("img",{attrs:{src:i("5a1b"),alt:"图片"}})])])],1)]}}])}),o("el-table-column",{attrs:{align:"center",label:"操作",width:"auto"},scopedSlots:e._u([{key:"default",fn:function(t){return[o("div",{staticClass:"file_caozuo"},[o("el-button",{attrs:{size:"mini",filenames:t.row.name,mark:"rename"}},[e._v("重命名")])],1),o("div",{staticClass:"file_caozuo2"},[o("el-button",{attrs:{size:"mini",realpath:t.row.frealpath,mark:"movefiledir"}},[e._v("移动")]),o("el-button",{attrs:{size:"mini",mark:"dirdelete",filenames:t.row.name,type:"danger"}},[e._v("删除")])],1)]}}])})],1)],1),o("el-dialog",{attrs:{title:"创建目录",visible:e.dirbox},on:{"update:visible":function(t){e.dirbox=t}}},[o("el-form",{attrs:{model:e.dirform}},[o("el-form-item",{attrs:{label:"目录名称","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:e.dirform.dir,callback:function(t){e.$set(e.dirform,"dir",t)},expression:"dirform.dir"}})],1)],1),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(t){e.dirbox=!1}}},[e._v("取 消")]),o("el-button",{attrs:{type:"primary",loading:e.mkdirloadings},on:{click:e.mkdirs}},[e._v("确 定")])],1)],1),o("el-dialog",{attrs:{title:"重命名",visible:e.renamebox},on:{"update:visible":function(t){e.renamebox=t}}},[o("el-form",{attrs:{model:e.renamefileform}},[o("el-form-item",{attrs:{label:"新名称","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:e.renamefileform.to,callback:function(t){e.$set(e.renamefileform,"to",t)},expression:"renamefileform.to"}},[e.filesuffix?o("template",{slot:"append"},[e._v(e._s(e.filesuffix))]):e._e()],2)],1)],1),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(t){e.renamebox=!1}}},[e._v("取 消")]),o("el-button",{attrs:{type:"primary",loading:e.mkdirloadings},on:{click:e.renameFileDir}},[e._v("确 定")])],1)],1),o("el-dialog",{attrs:{title:"目录移动弹出框",visible:e.movebox},on:{"update:visible":function(t){e.movebox=t}}},[o("el-form",{attrs:{model:e.movefileform}},[o("el-form-item",{attrs:{label:"当前位置","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:e.movefileform.from,callback:function(t){e.$set(e.movefileform,"from",t)},expression:"movefileform.from"}})],1),o("el-form-item",{attrs:{label:"目标位置(请参考当前位置的格式填写目标位置,需要带上当前的文件名称)","label-width":e.formLabelWidth}},[o("el-input",{attrs:{autocomplete:"off"},model:{value:e.movefileform.to,callback:function(t){e.$set(e.movefileform,"to",t)},expression:"movefileform.to"}})],1)],1),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{on:{click:function(t){e.movebox=!1}}},[e._v("取 消")]),o("el-button",{attrs:{type:"primary",loading:e.mkdirloadings},on:{click:e.moveFileDir}},[e._v("确 定")])],1)],1)],1)},a=[],r=(i("d3b7"),i("159b"),i("b64b"),i("c24f")),s=i("4a9d"),l={created:function(){this.getFileData()},data:function(){return{dirdata:[],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.subloading=!0,Object(r["d"])().then((function(t){var i=t.data;if(e.dirdata=[],1==i.code){var o=i.data.menus;o&&(e.dirdata=e.forObjectData(o))}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(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.mkdirloadings=!0,Object(r["e"])(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["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 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"}),e.subloading=!1})).catch((function(t){Object(r["h"])(e,t),e.subloading=!1}))},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 o=i.data;1==o.code?(console.log(66666),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.subloading=!1,e.movebox=!1})).catch((function(t){e.subloading=!1,Object(r["h"])(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.subloading=!0,Object(r["g"])(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.subloading=!1,e.renamebox=!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(),o=(e.currentTarget,t),a=null;return"span"==i&&(o=t.parentNode),a=o.getAttribute("mark"),"dirdelete"==a?(this.rmdirform.dir=o.getAttribute("filenames"),void this.rmdirm()):"rename"==a?(this.renamefileform.from=o.getAttribute("filenames"),this.filesuffix=o.getAttribute("suffixs"),this.renamefileform.to="",void(this.renamebox=!0)):"movefiledir"==a?(this.movefileform.from=o.getAttribute("realpath"),this.movefileform.to="",void(this.movebox=!0)):void 0}}},n=l,m=(i("fd80"),i("2877")),f=Object(m["a"])(n,o,a,!1,null,null,null);t["default"]=f.exports},fd80:function(e,t,i){"use strict";i("94d2")}}]); |