|
@@ -117,11 +117,12 @@ $(document).ready(function() {
|
|
|
self.filingTree.addNodes(node, -1, [{ id: newNode.id, tree_pid: newNode.tree_pid, name: newNode.name, spid: newNode.spid, source_node: newNode}]);
|
|
|
});
|
|
|
}
|
|
|
- delFiling(node) {
|
|
|
+ delFiling(node, callback) {
|
|
|
const self = this;
|
|
|
postData('filing/del', { id: node.id }, function(result) {
|
|
|
self.dragTree.loadPostData(result);
|
|
|
self.filingTree.removeNode(node);
|
|
|
+ if (callback) callback();
|
|
|
});
|
|
|
}
|
|
|
async renameFiling(node, newName) {
|
|
@@ -247,7 +248,10 @@ $(document).ready(function() {
|
|
|
},
|
|
|
edit: {
|
|
|
enable: true,
|
|
|
- showRemoveBtn: false,
|
|
|
+ showRemoveBtn: function(treeId, treeNode) {
|
|
|
+ if (!canFiling) return false;
|
|
|
+ return !treeNode.source_node.is_fixed;
|
|
|
+ },
|
|
|
showRenameBtn: function(treeId, treeNode) {
|
|
|
if (!canFiling) return false;
|
|
|
return !treeNode.source_node.is_fixed;
|
|
@@ -256,7 +260,8 @@ $(document).ready(function() {
|
|
|
drag: {
|
|
|
isCopy: false,
|
|
|
isMove: false,
|
|
|
- }
|
|
|
+ },
|
|
|
+ editNameSelectAll: true,
|
|
|
},
|
|
|
callback: {
|
|
|
onClick: async function (e, key, node) {
|
|
@@ -274,6 +279,10 @@ $(document).ready(function() {
|
|
|
onRename: function(e, key, node, isCancel) {
|
|
|
node.name = node.name + (node.source_node.total_file_count > 0 ? `(${node.source_node.total_file_count})` : '');
|
|
|
filingObj.filingTree.updateNode(node);
|
|
|
+ },
|
|
|
+ beforeRemove: function(e, key, node, isCancel) {
|
|
|
+ $('#del-filing').modal('show');
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -297,17 +306,19 @@ $(document).ready(function() {
|
|
|
|
|
|
filingObj.addChildFiling(filingObj.curFiling);
|
|
|
});
|
|
|
- $('#del-filing-btn').click(() => {
|
|
|
- if (!filingObj.curFiling) return;
|
|
|
- if (filingObj.curFiling.source_node.is_fixed) {
|
|
|
- toastr.error('固定分类不可删除');
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- $('#del-filing').modal('show');
|
|
|
- });
|
|
|
+ // $('#del-filing-btn').click(() => {
|
|
|
+ // if (!filingObj.curFiling) return;
|
|
|
+ // if (filingObj.curFiling.source_node.is_fixed) {
|
|
|
+ // toastr.error('固定分类不可删除');
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // $('#del-filing').modal('show');
|
|
|
+ // });
|
|
|
$('#del-filing-ok').click(() => {
|
|
|
- filingObj.delFiling(filingObj.curFiling);
|
|
|
+ filingObj.delFiling(filingObj.curFiling, function() {
|
|
|
+ $('#del-filing').modal('hide');
|
|
|
+ });
|
|
|
});
|
|
|
$('#add-file-ok').click(() => {
|
|
|
const input = $('#upload-file');
|