浏览代码

项目列表,删除相关

MaiXinRong 3 月之前
父节点
当前提交
387b4f182f
共有 1 个文件被更改,包括 7 次插入4 次删除
  1. 7 4
      app/public/js/sub_project.js

+ 7 - 4
app/public/js/sub_project.js

@@ -198,13 +198,16 @@ $(document).ready(function() {
             const treeId = $(this).parent().parent().attr('tree_id');
             const node = ProjectTree.getItems(treeId);
             if (node.is_folder) {
+                if (node.children && node.children.length > 0) return;
                 $('.modal-title', '#del').html('确认删除文件夹');
-                $('#del-hint').attr('tree_id', treeId).html(`确定删除「<strong style="word-break: break-word;">${node.name}</strong>」及其下所有内容?`)
+                $('#del-hint').attr('tree_id', treeId).html(`确定删除「<strong style="word-break: break-word;">${node.name}</strong>」及其下所有内容?`);
+                $('#del').modal('show');
             } else {
-                $('.modal-title', '#del').html('确认删除标段');
-                $('#del-hint').attr('tree_id', treeId).html(`确定删除「<strong style="word-break: break-word;">${node.name}</strong>」?`)
+                if (node.tender_count || node.file_count || node.contract_count) return;
+                $('.modal-title', '#del').html('确认删除项目');
+                $('#del-hint').attr('tree_id', treeId).html(`确定删除「<strong style="word-break: break-word;">${node.name}</strong>」?`);
+                $('#del').modal('show');
             }
-            $('#del').modal('show');
         });
         $('body').on('click', 'button[name=up]', function (e) {
             const treeId = $(this).parent().parent().attr('tree_id');