Browse Source

1. 资料归集,文件总数
2. 账号设置,模块权限,排序调整

MaiXinRong 2 months ago
parent
commit
f5c69d1591
3 changed files with 11 additions and 2 deletions
  1. 9 0
      app/public/js/file_detail.js
  2. 1 1
      app/service/project_account.js
  3. 1 1
      app/view/file/file.ejs

+ 9 - 0
app/public/js/file_detail.js

@@ -37,6 +37,10 @@ $(document).ready(function() {
                 }
             }
         }
+        refreshFileCountHint() {
+            const sum = _.sum(this.dragTree.children.map(x => { return x.file_count}));
+            $('#file-count').html(`文件总数:${sum}`);
+        }
         calcTotalFileCount() {
             this.dragTree.recursiveFun(this.dragTree.children, x => {
                 if (x.children && x.children.length > 0) {
@@ -89,6 +93,7 @@ $(document).ready(function() {
             this.dragTree.loadDatas(data);
             this.calcTotalFileCount();
             this.loadFiling();
+            this.refreshFileCountHint();
         }
         _getFileNameHtml(file) {
             const moveHtml = file.canEdit ? `<a href="javascript: void(0);" class="mr-1" name="move-file" fid="${file.id}"><i class="fa fa-exchange fa-fw"></i></a>` : '';
@@ -265,6 +270,7 @@ $(document).ready(function() {
                 filingObj.curFiling.source_node.files.unshift(...data.files);
                 filingObj.refreshPages();
                 filingObj.refreshFilesTable();
+                filingObj.refreshFileCountHint();
                 if (callback) callback();
             });
         }
@@ -285,6 +291,7 @@ $(document).ready(function() {
                     filingObj.updateFilingFileCount(filingObj.curFiling, result.filing.file_count);
                     filingObj.refreshPages();
                     filingObj.refreshFilesTable();
+                    filingObj.refreshFileCountHint();
                     if (callback) callback();
             });
 
@@ -303,6 +310,7 @@ $(document).ready(function() {
                 if (data.filing.id === filingObj.curFiling.source_node.id) {
                     filingObj.refreshPages();
                     filingObj.refreshFilesTable();
+                    filingObj.refreshFileCountHint();
                 }
                 if (callback) callback();
             });
@@ -327,6 +335,7 @@ $(document).ready(function() {
                 filingObj.curFiling.source_node.files.unshift(...data.files);
                 filingObj.updateFilingFileCount(filingObj.curFiling, data.filing.file_count);
                 filingObj.refreshFilesTable();
+                filingObj.refreshFileCountHint();
                 filingObj.refreshPages();
                 if (callback) callback();
             });

+ 1 - 1
app/service/project_account.js

@@ -1081,7 +1081,7 @@ module.exports = app => {
             const filterSql = this._getFilterSql(filterInfo);
             const sql = `SELECT pa.*, spp.id AS permission_id, 
                     spp.file_permission, spp.budget_permission, spp.info_permission, spp.datacollect_permission, spp.fund_trans_permission, spp.fund_pay_permission, spp.contract_permission, spp.payment_permission
-                FROM ${this.ctx.service.subProjPermission.tableName} spp LEFT JOIN ${this.tableName} pa ON spp.uid = pa.id WHERE ` + filterSql + ' ORDER BY spp.create_time DESC';
+                FROM ${this.ctx.service.subProjPermission.tableName} spp LEFT JOIN ${this.tableName} pa ON spp.uid = pa.id WHERE ` + filterSql + ' ORDER BY pa.company ASC, spp.create_time DESC';
             const result = await this.db.query(sql);
             return result;
         }

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

@@ -1,7 +1,7 @@
 <div class="panel-content">
     <div class="panel-title fluid">
         <div class="title-main  d-flex justify-content-between">
-            <div>资料归集/<%- ctx.subProject.name %></div>
+            <div>资料归集/<%- ctx.subProject.name %><span class="ml-4" id="file-count"></span></div>
             <div class="ml-auto">
                 <% if (ctx.session.sessionUser.is_admin) { %>
                 <a href="/sp/<%- ctx.subProject.id %>/fm" class="btn btn-outline-primary btn-sm ml-1">管理分类</a>