浏览代码

资料归集,授权相关

MaiXinRong 5 月之前
父节点
当前提交
f10506cc7f

+ 17 - 2
app/public/js/file_detail.js

@@ -1410,9 +1410,25 @@ $(document).ready(function() {
             $(this.setting.list).html(html.join(''));
             $('#user-select-all')[0].checked = false;
         }
+        refreshBtn() {
+            const self = this;
+            const filing = this.permissionTree.nodes.find(x => { return x.filing_type === self.curFiling; });
+            if (!filing || (filing.children && filing.children.length > 0)) {
+                $('#filing-add-user').hide();
+                $('#batch-del-filing').hide();
+                $('#batch-add-filing').hide();
+                $('#sync-filing').hide();
+            } else {
+                $('#filing-add-user').show();
+                $('#batch-del-filing').show();
+                $('#batch-add-filing').show();
+                $('#sync-filing').show();
+            }
+        }
         setCurFiling(filingType) {
             this.curFiling = filingType;
             this.loadCurFiling();
+            this.refreshBtn();
         }
         loadPermissionUser() {
             const html = [];
@@ -1693,9 +1709,8 @@ $(document).ready(function() {
                         spreadSetting: {
                             cols: [
                                 {title: '名称', field: 'name', hAlign: 0, width: 300, formatter: '@', cellType: 'tree', wordWrap: true},
-                                {title: '备注', field: 'remark', hAlign: 1, width: 150, formatter: '@', wordWrap: true}
+                                {title: '备注', field: 'remark', hAlign: 1, width: 150, formatter: '@'}
                             ],
-                            treeCol: 0,
                             emptyRows: 0,
                             headRows: 1,
                             headRowHeight: [32],

+ 1 - 0
app/public/js/shares/cs_tools.js

@@ -1533,6 +1533,7 @@ const showSelectTab = function(select, spread, afterShow) {
         sheet.bind(spreadNS.Events.SelectionChanged, function (e, info) {
             if (!info.oldSelections || !info.oldSelections[0] || info.newSelections[0].row !== info.oldSelections[0].row) {
                 SpreadJsObj.saveTopAndSelect(info.sheet, cacheKey.node);
+                console.log(SpreadJsObj.getSelectObject(info.sheet));
             }
         });
         sheet.bind(spreadNS.Events.TopRowChanged, function (e, info) {

+ 1 - 1
app/view/file/file.ejs

@@ -4,7 +4,7 @@
             <div>资料归集/<%- ctx.subProject.name %></div>
             <div class="ml-auto">
                 <% if (ctx.session.sessionUser.is_admin) { %>
-                <a class="btn btn-sm btn-outline-primary mr-1" href="#filing-permission" data-toggle="modal" data-target="#filing-permission">授权用户</a>
+                <a class="btn btn-sm btn-outline-primary mr-1" href="#filing-permission" data-toggle="modal" data-backdrop="static" data-target="#filing-permission">授权用户</a>
                 <% } %>
             </div>
         </div>

+ 1 - 1
app/view/file/file_modal.ejs

@@ -16,7 +16,7 @@
                     </div>
                     <div class="col-7">
                         <div class="d-flex flex-row bg-graye">
-                            <div class="p-2">
+                            <div class="p-2" id="filing-add-user">
                                 <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="dropdown-up" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                     添加用户
                                 </button>

+ 2 - 1
app/view/file/template_modal.ejs

@@ -40,4 +40,5 @@
             </div>
         </div>
     </div>
-</div>
+</div>
+<% include ../shares/select_file_modal.ejs %>