观察细致入微。
pull/286/head
midoks 2 years ago
parent 8915b672e5
commit c7a3481b95
  1. 6
      class/core/files_api.py
  2. 8
      route/static/app/files.js
  3. 13
      route/static/app/public.js

@ -97,11 +97,11 @@ class files_api:
import shutil
try:
shutil.move(sfile, dfile)
msg = mw.getInfo('移动文件或目录[{1}]到[{2}]成功!', (sfile, dfile,))
msg = mw.getInfo('移动或重名命文件[{1}]到[{2}]成功!', (sfile, dfile,))
mw.writeLog('文件管理', msg)
return mw.returnJson(True, '移动文件或目录成功!')
return mw.returnJson(True, '移动或重名命文件成功!')
except:
return mw.returnJson(False, '移动文件或目录失败!')
return mw.returnJson(False, '移动或重名命文件失败!')
def deleteApi(self):
path = request.form.get('path', '')

@ -1103,7 +1103,7 @@ function reName(type, fileName) {
closeBtn: 1,
area: '320px',
title: '重命名',
btn:["确定","保存"],
btn:["确定","取消"],
content: '<div class="bt-form pd20">\
<div class="line">\
<input type="text" class="bt-input-text" name="Name" id="newFileName" value="' + fileName + '" placeholder="文件名" style="width:100%" />\
@ -1615,10 +1615,13 @@ function getPathSize(){
$("body").not(".def-log").click(function(){
$("#rmenu").hide()
});
//指定路径
$("#DirPathPlace input").keyup(function(e){
if(e.keyCode == 13) {
getFiles($(this).val());
var fpath = $(this).val();
fpath = filterPath(fpath);
getFiles(fpath);
}
});
@ -1662,6 +1665,7 @@ function pathLeft(){
$("#PathPlaceBtn ul").css("left",0);
}
}
//路径快捷点击
$("#PathPlaceBtn").on("click", function(e){
if($("#DirPathPlace").is(":hidden")){

@ -100,6 +100,19 @@ function isContains(str, substr) {
return str.indexOf(substr) >= 0;
}
function filterPath(path){
var path_arr = path.split('/');
var path_new = [];
for (var i = 0; i < path_arr.length; i++) {
if (path_arr[i]!=''){
path_new.push(path_arr[i]);
}
}
var rdata = "/"+path_new.join('/');
return rdata;
}
function msgTpl(msg, args){
if (typeof args == 'string'){
return msg.replace('{1}', args);

Loading…
Cancel
Save