(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-72626882"],{"12f6":function(t,e,n){},1768:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticStyle:{height:"100%"}},[n("el-row",[n("el-button",{attrs:{size:"mini",type:"success"},on:{click:function(e){t.dialogVisible=!0}}},[t._v("上传文件")]),n("el-button",{attrs:{size:"mini",type:"primary"},on:{click:t.createFolder}},[t._v("新建文件夹")]),n("el-button",{attrs:{size:"mini",type:"danger"},on:{click:t.removeFiles}},[t._v("删除文件")])],1),n("div",{staticStyle:{margin:"20px 0px"}},[n("el-breadcrumb",{attrs:{separator:"/"}},[n("el-breadcrumb-item",[n("a",{on:{click:function(e){return e.preventDefault(),t.getAllFiles(e)}}},[t._v("全部文件")])]),t._l(t.currentDirList,(function(e,i){return n("el-breadcrumb-item",{key:i},[n("a",{attrs:{href:"javascript:void(0)"},on:{click:function(n){return n.preventDefault(),t.viewFiles(e,i)}}},[t._v(t._s(e))])])}))],2)],1),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"},{name:"el-table-infinite-scroll",rawName:"v-el-table-infinite-scroll",value:t.onScrollEnd,expression:"onScrollEnd"}],staticStyle:{width:"100%"},attrs:{data:t.tableData,size:"medium",stripe:"",height:"700px","tooltip-effect":"dark"},on:{"selection-change":t.onSelectionChange}},[n("el-table-column",{attrs:{type:"selection",width:"30",selectable:t.onSelectable}}),n("el-table-column",{attrs:{label:"文件"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.is_dir?n("i",{staticClass:"matter-icon el-icon-folder",staticStyle:{color:"#ffc402"}}):n("i",{class:"iconfont matter-icon "+e.row.icon}),n("el-link",{staticClass:"matter-title",attrs:{underline:!1,href:"Javascript: void(0);"}},[n("span",{on:{click:function(n){return t.onNameClick(e.row)}}},[t._v(t._s(e.row.name))])])]}}])}),n("el-table-column",{attrs:{prop:"size",label:"文件大小",width:"120"}}),n("el-table-column",{attrs:{prop:"create_at",label:"创建日期",width:"180"}}),n("el-table-column",{attrs:{prop:"create_by.username",label:"创建者",width:"150"}}),n("el-table-column",{attrs:{label:"操作",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{attrs:{icon:"el-icon-edit",type:"text"},on:{click:function(n){return t.onRename(e.row)}}},[t._v("重命名")])]}}])})],1),n("el-dialog",{attrs:{title:"上传文件",visible:t.dialogVisible,width:"30%"},on:{"update:visible":function(e){t.dialogVisible=e}}},[n("el-upload",{attrs:{drag:"",name:"binfile",headers:t.uploadHeaders,data:t.uploadData,"before-upload":t.onBeforeUpload,"on-success":t.onUploadSuccess,action:t.window.location.protocol+"//"+t.window.location.host+"/api/v1/kxpms/netdisc/add",multiple:""}},[n("i",{staticClass:"el-icon-upload"}),n("div",{staticClass:"el-upload__text"},[t._v("将文件拖到此处,或"),n("em",[t._v("点击上传")])]),n("div",{staticClass:"el-upload__tip",attrs:{slot:"tip"},slot:"tip"},[t._v("文件不超过100mb")])])],1)],1)},r=[],o=(n("60a8"),n("180d"),n("992c"),n("95e8"),n("c30f"),n("82a8"),n("6ddf"),n("2a39"),n("a5bc"),n("cfa8"),n("0482"),n("31d6"),n("f845"),n("a1be")),a=n("ed08"),c=n("c21d"),u=n("365c"),s={name:"Files",directives:{"el-table-infinite-scroll":c["a"]},data:function(){return{loading:!1,tableData:[],dialogVisible:!1,selectList:[],currentDirList:[],currentDir:"/",uploadData:{parent_dir:"/",file_type:""},uploadHeaders:{Authorization:this.$store.getters.token},urlRoot:""}},watch:{$route:"onRouteChange"},computed:{window:function(t){function e(){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(){return window}))},methods:{getAllFiles:function(){this.currentDir="/",this.currentDirList=[],this.getFileList()},onSelectionChange:function(t){this.selectList=t},onScrollEnd:function(){console.log("to do nothing")},onSelectable:function(t){if(1!==t.is_dir)return!0},onRename:function(t){var e=this;console.log(t),this.$prompt("请输入名称","提示",{confirmButtonText:"确定",cancelButtonText:"取消",inputPattern:!1,inputErrorMessage:"文件夹格式不正确"}).then((function(n){var i=n.value;e.updateFile(t.uuid,{name:i})})).catch((function(){e.$message({type:"info",message:"取消动作"})}))},removeFiles:function(){var t=this;this.$confirm("此操作将永久删除该文件, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){t.deleteFile()})).catch((function(){t.$message({type:"info",message:"已取消删除"})}))},onRouteChange:function(t){this.currentDir!=t.query.dir&&(this.currentDir=t.query.dir),this.getFileList()},isOfficeFile:function(t){var e=["application/msword","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.presentation"];return e.includes(t)},officeIcon:function(t){var e=["application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],n=["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],i=["application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation"];return e.includes(t)?"icon-doc":n.includes(t)?"icon-excel":i.includes(t)?"icon-ppt":void 0},type2icon:function(t){var e=t.split("/"),n=Object(o["a"])(e,2),i=n[0],r=n[1],a=["pdf","html","xml","psd","rtf"];if(a.includes(r))return"icon-".concat(r);var c=["json","yaml","x-yaml"];if(c.includes(r))return"icon-html";var u=["zip","x-gzip","tar","gz","rar"];if(u.includes(r))return"icon-compressed-file";if(this.isOfficeFile(t))return this.officeIcon(t);var s=["audio","video","image","text"];return s.includes(i)?"icon-".concat(i):"icon-file"},buildQuery:function(t){t.startsWith(this.rootDir)&&(t=t.replace(this.rootDir,""));var e=t?{dir:t}:{};return{query:e}},onNameClick:function(t){if(1==t.is_dir)return this.currentDirList.push(t.name),this.currentDir="/"+this.currentDirList.join("/"),void this.getFileList();Object(a["c"])(t.name,this.urlRoot+t.real_path)},convert:function(t){var e="";e=t<102.4?t.toFixed(2)+"B":t<104857.6?(t/1024).toFixed(2)+"KB":t<107374182.4?(t/1048576).toFixed(2)+"MB":(t/1073741824).toFixed(2)+"GB";var n=e+"",i=n.indexOf("."),r=n.substr(i+1,2);return"00"==r?n.substring(0,i)+n.substr(i+3,2):n},createFolder:function(){var t=this;this.$prompt("请输入文件夹名称","提示",{confirmButtonText:"确定",cancelButtonText:"取消",inputPattern:!1,inputErrorMessage:"文件夹格式不正确"}).then((function(e){var n=e.value;t.addFile(n)})).catch((function(){t.$message({type:"info",message:"取消动作"})}))},onBeforeUpload:function(t){this.uploadData.file_type=t.type},onUploadSuccess:function(){this.getFileList()},viewFiles:function(t,e){var n=this.currentDirList.slice(0,e).join("/");this.currentDirList=this.currentDirList.slice(0,e+1),n.startsWith("/")?this.currentDir=n+"/"+t:n.length?this.currentDir="/"+n+"/"+t:this.currentDir="/"+t,this.getFileList()},getFileList:function(){var t=this;this.loading=!0,Object(u["F"])({parent_dir:this.currentDir}).then((function(e){t.tableData=e.data.map((function(e){return e.size=t.convert(e.size),e.icon=t.type2icon(e.file_type),e})),t.urlRoot=e.url})).catch((function(e){t.tableData=[],console.log(e)})).finally((function(){t.loading=!1}))},addFile:function(t){var e=this;Object(u["e"])({name:t,parent_dir:this.currentDir}).then((function(t){e.$message.success(t.message),e.getFileList()})).catch((function(t){e.$message.error(t.message)}))},updateFile:function(t,e){var n=this;Object(u["V"])(t,e).then((function(t){n.$message.success(t.message),n.getFileList()})).catch((function(t){n.$message.error(t.message)}))},deleteFile:function(){var t=this;Object(u["q"])({uuids:this.selectList.map((function(t){return t.uuid}))}).then((function(e){t.$message.success(e.message),t.getFileList()})).catch((function(e){t.$message.error(e.message)}))}},mounted:function(){},created:function(){this.getFileList()}},d=s,l=(n("2575"),n("5d22")),p=Object(l["a"])(d,i,r,!1,null,"5a60069c",null);e["default"]=p.exports},2575:function(t,e,n){"use strict";n("12f6")},"365c":function(t,e,n){"use strict";n.d(e,"Q",(function(){return r})),n.d(e,"z",(function(){return o})),n.d(e,"l",(function(){return a})),n.d(e,"y",(function(){return c})),n.d(e,"O",(function(){return u})),n.d(e,"P",(function(){return s})),n.d(e,"eb",(function(){return d})),n.d(e,"fb",(function(){return l})),n.d(e,"c",(function(){return p})),n.d(e,"o",(function(){return f})),n.d(e,"D",(function(){return m})),n.d(e,"T",(function(){return h})),n.d(e,"E",(function(){return v})),n.d(e,"d",(function(){return b})),n.d(e,"U",(function(){return x})),n.d(e,"p",(function(){return k})),n.d(e,"J",(function(){return j})),n.d(e,"K",(function(){return g})),n.d(e,"bb",(function(){return O})),n.d(e,"u",(function(){return y})),n.d(e,"L",(function(){return w})),n.d(e,"j",(function(){return F})),n.d(e,"cb",(function(){return _})),n.d(e,"w",(function(){return D})),n.d(e,"I",(function(){return L})),n.d(e,"i",(function(){return S})),n.d(e,"Z",(function(){return $})),n.d(e,"t",(function(){return B})),n.d(e,"g",(function(){return z})),n.d(e,"A",(function(){return C})),n.d(e,"f",(function(){return P})),n.d(e,"W",(function(){return R})),n.d(e,"r",(function(){return U})),n.d(e,"G",(function(){return E})),n.d(e,"h",(function(){return T})),n.d(e,"s",(function(){return q})),n.d(e,"H",(function(){return V})),n.d(e,"a",(function(){return N})),n.d(e,"m",(function(){return A})),n.d(e,"B",(function(){return J})),n.d(e,"v",(function(){return M})),n.d(e,"R",(function(){return H})),n.d(e,"X",(function(){return I})),n.d(e,"Y",(function(){return W})),n.d(e,"ab",(function(){return G})),n.d(e,"C",(function(){return K})),n.d(e,"b",(function(){return Q})),n.d(e,"S",(function(){return X})),n.d(e,"n",(function(){return Y})),n.d(e,"M",(function(){return Z})),n.d(e,"N",(function(){return tt})),n.d(e,"k",(function(){return et})),n.d(e,"db",(function(){return nt})),n.d(e,"x",(function(){return it})),n.d(e,"F",(function(){return rt})),n.d(e,"e",(function(){return ot})),n.d(e,"V",(function(){return at})),n.d(e,"q",(function(){return ct}));var i=n("b775");function r(t){return Object(i["a"])({url:"/api/v1/kxpms/workbench/query",method:"post",data:t})}function o(t){return Object(i["a"])({url:"/api/v1/kxpms/login/login",method:"post",data:t})}function a(t){return Object(i["a"])({url:"/api/v1/kxpms/user/add",method:"post",data:t})}function c(t){return Object(i["a"])({url:"/api/v1/kxpms/user/delete/".concat(t),method:"post"})}function u(t){return Object(i["a"])({url:"/api/v1/kxpms/user/get",method:"post",data:t})}function s(t){return Object(i["a"])({url:"/api/v1/kxpms/user/list",method:"post",data:t})}function d(t,e){return Object(i["a"])({url:"/api/v1/kxpms/user/update/".concat(t),method:"post",data:e})}function l(t){return Object(i["a"])({url:"/api/v1/kxpms/updatePassword",method:"post",data:t})}function p(t){return Object(i["a"])({url:"/api/v1/kxpms/depot/add",method:"post",data:t})}function f(t){return Object(i["a"])({url:"/api/v1/kxpms/depot/delete/".concat(t),method:"post"})}function m(t){return Object(i["a"])({url:"/api/v1/kxpms/depot/list",method:"post",data:t})}function h(t,e){return Object(i["a"])({url:"/api/v1/kxpms/depot/update/".concat(t),method:"post",data:e})}function v(t){return Object(i["a"])({url:"/api/v1/kxpms/dict/list",method:"post",data:t})}function b(t){return Object(i["a"])({url:"/api/v1/kxpms/dict/add",method:"post",data:t})}function x(t,e){return Object(i["a"])({url:"/api/v1/kxpms/dict/update/".concat(t),method:"post",data:e})}function k(t){return Object(i["a"])({url:"/api/v1/kxpms/dict/delete/".concat(t),method:"post"})}function j(t){return Object(i["a"])({url:"/api/v1/kxpms/project/get",method:"post",data:t})}function g(t){return Object(i["a"])({url:"/api/v1/kxpms/project/list",method:"post",data:t})}function O(t,e){return Object(i["a"])({url:"/api/v1/kxpms/project/update/".concat(t),method:"post",data:e})}function y(t){return Object(i["a"])({url:"/api/v1/kxpms/project/delete/".concat(t),method:"post"})}function w(t){return Object(i["a"])({url:"/api/v1/kxpms/role/list",method:"post",data:t})}function F(t){return Object(i["a"])({url:"/api/v1/kxpms/role/add",method:"post",data:t})}function _(t,e){return Object(i["a"])({url:"/api/v1/kxpms/role/update/".concat(t),method:"post",data:e})}function D(t){return Object(i["a"])({url:"/api/v1/kxpms/role/delete/".concat(t),method:"delete"})}function L(t){return Object(i["a"])({url:"/api/v1/kxpms/permission/list",method:"post",data:t})}function S(t){return Object(i["a"])({url:"/api/v1/kxpms/permission/add",method:"post",data:t})}function $(t,e){return Object(i["a"])({url:"/api/v1/kxpms/permission/update/".concat(t),method:"post",data:e})}function B(t){return Object(i["a"])({url:"/api/v1/kxpms/permission/delete/".concat(t),method:"post"})}function z(t){return Object(i["a"])({url:"/api/v1/kxpms/system/addProject",method:"post",data:t})}function C(t){return Object(i["a"])({url:"/api/v1/kxpms/system/exportProject",method:"post",data:t})}function P(t){return Object(i["a"])({url:"/api/v1/kxpms/flow/add",method:"post",data:t})}function R(t,e){return Object(i["a"])({url:"/api/v1/kxpms/flow/update/".concat(t),method:"post",data:e})}function U(t){return Object(i["a"])({url:"/api/v1/kxpms/flow/delete/".concat(t),method:"delete"})}function E(t){return Object(i["a"])({url:"/api/v1/kxpms/system/getFlowList",method:"post",data:t})}function T(t){return Object(i["a"])({url:"/api/v1/kxpms/payback/add",method:"post",data:t})}function q(t){return Object(i["a"])({url:"/api/v1/kxpms/payback/delete/".concat(t),method:"post"})}function V(t){return Object(i["a"])({url:"/api/v1/kxpms/system/getPaybackList",method:"post",data:t})}function N(t){return Object(i["a"])({url:"/api/v1/kxpms/annex/add",method:"post",data:t})}function A(t){return Object(i["a"])({url:"/api/v1/kxpms/annex/delete/".concat(t),method:"post"})}function J(t){return Object(i["a"])({url:"/api/v1/kxpms/annex/list",method:"post",data:t})}function M(t){return Object(i["a"])({url:"/api/v1/kxpms/system/deleteProjectUser",method:"post",data:t})}function H(t){return Object(i["a"])({url:"/api/v1/kxpms/system/modifyProjectUser",method:"post",data:t})}function I(t){return Object(i["a"])({url:"/api/v1/kxpms/system/updateFlow",method:"post",data:t})}function W(t){return Object(i["a"])({url:"/api/v1/kxpms/system/updatePayback",method:"post",data:t})}function G(t){return Object(i["a"])({url:"/api/v1/kxpms/system/updateProductionPlan",method:"post",data:t})}function K(t){return Object(i["a"])({url:"/api/v1/kxpms/calendar/list",method:"post",data:t})}function Q(t){return Object(i["a"])({url:"/api/v1/kxpms/calendar/add",method:"post",data:t})}function X(t,e){return Object(i["a"])({url:"/api/v1/kxpms/calendar/update/".concat(t),method:"post",data:e})}function Y(t){return Object(i["a"])({url:"/api/v1/kxpms/calendar/delete/".concat(t),method:"post"})}function Z(t){return Object(i["a"])({url:"/api/v1/kxpms/system/getRoleUsers",method:"post",data:t})}function tt(t){return Object(i["a"])({url:"/api/v1/kxpms/summary/list",method:"post",data:t})}function et(t){return Object(i["a"])({url:"/api/v1/kxpms/summary/add",method:"post",data:t})}function nt(t,e){return Object(i["a"])({url:"/api/v1/kxpms/summary/update/".concat(t),method:"post",data:e})}function it(t){return Object(i["a"])({url:"/api/v1/kxpms/summary/delete/".concat(t),method:"post"})}function rt(t){return Object(i["a"])({url:"/api/v1/kxpms/netdisc/list",method:"post",data:t})}function ot(t){return Object(i["a"])({url:"/api/v1/kxpms/netdisc/add",method:"post",data:t})}function at(t,e){return Object(i["a"])({url:"/api/v1/kxpms/netdisc/update/".concat(t),method:"post",data:e})}function ct(t){return Object(i["a"])({url:"/api/v1/kxpms/netdisc/delete",method:"post",data:t})}}}]);