Преглед изворни кода

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

Tony Kang пре 5 месеци
родитељ
комит
4455a9bd97

+ 1 - 1
app/base/base_controller.js

@@ -36,7 +36,7 @@ class BaseController extends Controller {
             }
         }
         if (ctx.controllerName === 'sp') {
-            if (ctx.url.indexOf('file') > 0) {
+            if (ctx.url.indexOf('file') > 0 || ctx.url.indexOf('fm')) {
                 ctx.menu = menuList.file;
             } else {
                 ctx.menu = menuList.budget;

+ 1 - 0
app/controller/change_controller.js

@@ -1799,6 +1799,7 @@ module.exports = app => {
                 stdChapters,
                 nodeType: stdConst.nodeType,
                 settleStatus: ctx.service.settle.settleStatus,
+                precision: ctx.tender.info.precision,
             };
         }
 

+ 10 - 2
app/controller/file_controller.js

@@ -62,7 +62,6 @@ module.exports = app => {
                 renderData.canFiling = ctx.subProject.permission.file_permission.indexOf(ctx.service.subProjPermission.PermissionConst.file.filing.value) >= 0;
                 renderData.canUpload = ctx.subProject.permission.file_permission.indexOf(ctx.service.subProjPermission.PermissionConst.file.upload.value) >= 0;
                 renderData.canDelete = ctx.subProject.permission.file_permission.indexOf(ctx.service.subProjPermission.PermissionConst.file.delete.value) >= 0;
-                renderData.filingTypes = ctx.service.filing.analysisFilingType(renderData.filing);
                 renderData.fileReferenceList = await ctx.service.subProject.getFileReference(ctx.subProject);
                 await this.layout('file/file.ejs', renderData, 'file/file_modal.ejs');
             } catch (err) {
@@ -81,7 +80,6 @@ module.exports = app => {
                 ctx.ajaxErrorBody(err, '获取授权用户数据错误');
             }
         }
-
         async saveFilingTypePermission(ctx) {
             try {
                 const data = JSON.parse(ctx.request.body.data);
@@ -508,6 +506,16 @@ module.exports = app => {
                     jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.file.manage),
                 };
                 renderData.filingData = await ctx.service.filing.getValidFiling(ctx.params.id, ctx.subProject.permission.filing_type);
+                const permissionData = await ctx.service.subProjPermission.getFilingType(ctx.subProject.id);
+                permissionData.forEach(x => { x.filing_type = x.filing_type.split(','); });
+                renderData.filingData.forEach(x => {
+                    if (!x.is_fixed) {
+                        x.permission_count = 0;
+                    } else {
+                        const rela = permissionData.filter(y => { return y.filing_type.indexOf(x.filing_type + '') >= 0; });
+                        x.permission_count = rela.length;
+                    }
+                });
                 await this.layout('file/manage.ejs', renderData, 'file/manage_modal.ejs');
             } catch (err) {
                 ctx.log(err);

Разлика између датотеке није приказан због своје велике величине
+ 917 - 64
app/public/js/change_revise.js


+ 148 - 16
app/public/js/file_detail.js

@@ -1218,16 +1218,76 @@ $(document).ready(function() {
         constructor (setting) {
             this.setting = setting;
             const self = this;
+            this.spread = SpreadJsObj.createNewSpread($(`${setting.spread}`)[0]);
+            this.sheet = this.spread.getActiveSheet();
+            this.spreadSetting = {
+                cols: [
+                    { title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 200, formatter: '@', cellType: 'tree'},
+                    { title: '选择', colSpan: '1', rowSpan: '1', field: 'check', hAlign: 1, width: 45, cellType: 'checkbox' },
+                ],
+                emptyRows: 0,
+                headRows: 1,
+                headRowHeight: [32],
+                defaultRowHeight: 21,
+                headColWidth: [25],
+                headerFont: '12px 微软雅黑',
+                font: '12px 微软雅黑',
+                readOnly: true,
+                selectedBackColor: '#fffacd',
+            };
+            SpreadJsObj.initSheet(this.sheet, this.spreadSetting);
+            this.permissionTree = createNewPathTree('base', {
+                id: 'tree_id',
+                pid: 'tree_pid',
+                order: 'order',
+                level: 'level',
+                isLeaf: 'is_leaf',
+                fullPath: 'full_path',
+                rootId: -1,
+            });
+            this.spread.bind(spreadNS.Events.ButtonClicked, function(e, info) {
+                if (!info.sheet.zh_setting) return;
+                const sheet = info.sheet, cellType = sheet.getCellType(info.row, info.col);
+                if (cellType instanceof  spreadNS.CellTypes.CheckBox) {
+                    if (sheet.isEditing()) sheet.endEdit(true);
+                }
+                const col = info.sheet.zh_setting.cols[info.col];
+                if (col.field !== 'check') return;
+                const tree = self.permissionTree;
+                const node = tree.nodes[info.row];
+
+                const row = [info.row];
+                node.check = !node.check;
+                if (node.children && node.children.length > 0) {
+                    const posterity = tree.getPosterity(node);
+                    for (const p of posterity) {
+                        p.check = node.check;
+                        row.push(tree.nodes.indexOf(p));
+                    }
+                }
+                if (!node.check) {
+                    const parent = tree.getAllParents(node);
+                    for (const p of parent) {
+                        p.check = node.check;
+                        row.push(tree.nodes.indexOf(p));
+                    }
+                }
+                SpreadJsObj.reLoadRowsData(info.sheet, row);
+            });
+            this.spread.bind(spreadNS.Events.SelectionChanged, function (e, info) {
+                const node = SpreadJsObj.getSelectObject(info.sheet);
+                self.setCurFiling(node.filing_type);
+            });
+
             $(setting.modal).on('show.bs.modal', () => {
                 self.loadPermission();
             });
+            $(setting.modal).on('shown.bs.modal', () => {
+                self.spread.refresh();
+            });
             $(`${setting.modal}-ok`).click(() => {
                 self.savePermission();
             });
-            $('[name=ftName]').click(function () {
-                const filingId = this.getAttribute('ftid');
-                self.setCurFiling(filingId);
-            });
 
             $('.book-list').on('click', 'dt', function () {
                 const idx = $(this).find('.acc-btn').attr('data-groupid');
@@ -1262,17 +1322,16 @@ $(document).ready(function() {
                 self.loadCurFiling();
             });
             $('#sync-filing').click(function() {
-                const selectFiling = $('[name=cbft]:checked');
-                if (selectFiling.length === 0) {
+                const selectFilingId = [];
+                self.permissionTree.nodes.forEach(x => { if (x.check && (!x.children || x.children.length === 0)) selectFilingId.push(x.filing_type); });
+                if (selectFilingId.length === 0) {
                     toastr.warning('请先选择文档类别');
                     return;
                 }
-
-                const selectFilingId = [];
-                selectFiling.each((i, x) => { selectFilingId.push(x.value); });
                 self.syncFiling(self.curFiling, selectFilingId);
                 toastr.success('同步成功');
-                $('[name=cbft]').removeAttr('checked');
+                self.permissionTree.nodes.forEach(x => { x.check = false; });
+                SpreadJsObj.reloadColData(self.sheet, 1);
                 $('#filing-select-all')[0].checked = false;
             });
             $('#batch-del-filing').click(() => {
@@ -1286,6 +1345,27 @@ $(document).ready(function() {
                 self.delFiling(self.curFiling, userId);
                 self.loadCurFiling();
             });
+            $('#batch-add-filing').click(() => {
+                const selectFilingId = [];
+                self.permissionTree.nodes.forEach(x => { if (x.check && (!x.children || x.children.length === 0)) selectFilingId.push(x.filing_type); });
+                if (selectFilingId.length === 0) {
+                    toastr.warning('请先选择文档类别');
+                    return;
+                }
+                const selectUser = $('[name=ftu-check]:checked');
+                if (selectUser.length === 0) {
+                    toastr.warning('请先选择用户');
+                    return;
+                }
+                const userId = [];
+                selectUser.each((i, x) => { userId.push(x.getAttribute('uid')); });
+                self.batchAddFiling(selectFilingId, userId);
+                self.loadCurFiling();
+                toastr.success('批量添加成功');
+                self.permissionTree.nodes.forEach(x => { x.check = false; });
+                SpreadJsObj.reloadColData(self.sheet, 1);
+                $('#filing-select-all')[0].checked = false;
+            });
             $('body').on('click', '[name=del-filing]', function() {
                 const id = this.getAttribute('uid');
                 self.delFiling(self.curFiling, id);
@@ -1295,7 +1375,10 @@ $(document).ready(function() {
                 $('input[uid]').attr('checked', this.checked);
             });
             $('#filing-select-all').click(function(){
-                $('input[name=cbft]').attr('checked', this.checked);
+                self.permissionTree.nodes.forEach(x => {
+                    x.check = this.checked;
+                });
+                SpreadJsObj.reloadColData(self.sheet, 1);
             });
         }
         analysisFiling(data) {
@@ -1327,11 +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;
-            $('[name=ftName]').removeClass('bg-warning-50');
-            $(`[ftid=${filingType}]`).addClass('bg-warning-50');
             this.loadCurFiling();
+            this.refreshBtn();
         }
         loadPermissionUser() {
             const html = [];
@@ -1349,12 +1446,38 @@ $(document).ready(function() {
             }
             $('#puList').html(html.join(''));
         }
+        _convertData(sourceTree) {
+            const data = [];
+            for (const node of sourceTree.nodes) {
+                if (!node.is_fixed) continue;
+                const parent = node.tree_pid === '-1' ? undefined : data.find(x => { return x.id === node.tree_pid; });
+                const child = sourceTree.nodes.find(x => { return x.tree_pid === node.id; });
+                data.push({
+                    id: node.id,
+                    tree_id: data.length + 1,
+                    tree_pid: parent ? parent.tree_id : -1,
+                    order: node.tree_order + 1,
+                    level: node.tree_level,
+                    is_leaf: !child || !child.is_fixed,
+                    full_path: '',
+                    name: node.name,
+                    is_fixed: node.is_fixed,
+                    filing_type: node.filing_type + '',
+                    tips: node.tips,
+                    file_count: node.file_count,
+                });
+            }
+            return data;
+        }
         loadPermission() {
+            this.permissionTree.loadDatas(this._convertData(filingObj.dragTree));
+            SpreadJsObj.loadSheetData(this.sheet, SpreadJsObj.DataType.Tree, this.permissionTree);
             const self = this;
             postData('permission', {}, function(result) {
                 self.analysisFiling(result);
                 if (!self.curFiling) {
-                    self.setCurFiling($('[name=ftName]').attr('ftid'));
+                    const node = SpreadJsObj.getSelectObject(self.sheet);
+                    self.setCurFiling(node.filing_type);
                 } else {
                     self.loadCurFiling();
                 }
@@ -1382,6 +1505,15 @@ $(document).ready(function() {
                 if (pu.filing_type.indexOf(filingId) >= 0) pu.filing_type.splice(pu.filing_type.indexOf(filingId), 1);
             }
         }
+        batchAddFiling(filingIds, userId) {
+            for (const pu of this.permissionUser) {
+                if (userId.indexOf(pu.id) < 0) continue;
+
+                filingIds.forEach(fid => {
+                    if (pu.filing_type.indexOf(fid) < 0) pu.filing_type.push(fid);
+                });
+            }
+        }
         savePermission() {
             const self = this;
             const data = this.permissionUser.map(x => {
@@ -1395,6 +1527,7 @@ $(document).ready(function() {
     const filingPermission = new FilingPermission({
         modal: '#filing-permission',
         list: '#filing-valid',
+        spread: '#permission-spread',
     });
 
     class FileSearch {
@@ -1576,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],

+ 15 - 4
app/public/js/filing_manage.js

@@ -181,9 +181,8 @@ $(document).ready(function() {
                 return true;
             },
             beforeRemove: function(key, node, isCancel) {
-                filingObj.delFiling(node, function() {
-                    $('#del-filing').modal('hide');
-                });
+                filingObj.deleteNode = node;
+                $('#del-filing').modal('show');
                 return false;
             },
             beforeDrop: function(key, nodes, target, moveType, isCopy) {
@@ -230,6 +229,13 @@ $(document).ready(function() {
         if (!filingObj.curFiling) return;
         filingObj.addChildFiling(filingObj.curFiling);
     });
+    $('#del-filing-ok').click(() => {
+        if (!filingObj.deleteNode) return;
+        filingObj.delFiling(filingObj.deleteNode, function() {
+            $('#del-filing').modal('hide');
+            delete filingObj.deleteNode;
+        });
+    });
 
     class MultiObj {
         constructor(setting) {
@@ -240,6 +246,7 @@ $(document).ready(function() {
                 cols: [
                     { title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 250, formatter: '@', readOnly: true, cellType: 'tree' },
                     { title: '文件数', colSpan: '1', rowSpan: '1', field: 'file_count', hAlign: 1, width: 50, readOnly: true },
+                    { title: '授权', colSpan: '1', rowSpan: '1', field: 'permission_count', hAlign: 1, width: 50, readOnly: true },
                     { title: '固定', colSpan: '1', rowSpan: '1', field: 'is_fixed', hAlign: 1, width: 50, cellType: 'checkbox' },
                     { title: '提示', colSpan: '1', rowSpan: '1', field: 'tips', hAlign: 0, width: 280, formatter: '@', wordWrap: 1 },
                 ],
@@ -331,6 +338,9 @@ $(document).ready(function() {
                 if (node.file_count > 0 && node.is_fixed !== node.org_is_fixed) {
                     throw `【${node.name}】下已存在文件,不可修改是否为固定节点`;
                 }
+                if (node.permission_count > 0 && node.is_fixed !== node.org_is_fixed) {
+                    throw `【${node.name}】下已授权给用户,不可修改是否为固定节点`;
+                }
             }
             const sftIndex = [];
             const getNewSft = function () {
@@ -341,7 +351,7 @@ $(document).ready(function() {
                 return i;
             };
             for (const node of this.checkTree.nodes) {
-                if (node.file_count) {
+                if (node.file_count || node.permission_count) {
                     node.new_filing_type = node.filing_type;
                 } else if (node.is_fixed) {
                     node.new_filing_type = getNewSft();
@@ -385,6 +395,7 @@ $(document).ready(function() {
                     filing_type: node.filing_type,
                     tips: node.tips,
                     file_count: node.file_count,
+                    permission_count: node.permission_count,
                 });
             }
             return data;

+ 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) {

+ 2 - 2
app/public/js/spreadjs_rela/spreadjs_zh.js

@@ -738,14 +738,14 @@ const SpreadJsObj = {
                 sheet.extendCellType.checkbox = new spreadNS.CellTypes.CheckBox();
             }
             sheet.getRange(-1, col, -1, 1).cellType(sheet.extendCellType.checkbox);
-            sheet.getRange(-1, col, -1, 1).hAlign(col ? col.hAlign : spreadNS.HorizontalAlign.center);// 空白行不居中问题,checkbox要默认居中
+            sheet.getRange(-1, col, -1, 1).hAlign(colSetting ? colSetting.hAlign : spreadNS.HorizontalAlign.center);// 空白行不居中问题,checkbox要默认居中
         }
         if (colSetting.cellType === 'signalCheckbox') {
             if (!sheet.extendCellType.signalCheckbox) {
                 sheet.extendCellType.signalCheckbox = this.CellType.getSignalCheckboxCellType();
             }
             sheet.getRange(-1, col, -1, 1).cellType(sheet.extendCellType.signalCheckbox);
-            sheet.getRange(-1, col, -1, 1).hAlign(col ? col.hAlign : spreadNS.HorizontalAlign.center);// 空白行不居中问题,checkbox要默认居中
+            sheet.getRange(-1, col, -1, 1).hAlign(colSetting ? colSetting.hAlign : spreadNS.HorizontalAlign.center);// 空白行不居中问题,checkbox要默认居中
         }
         if (colSetting.cellType === 'unit') {
             if (!sheet.extendCellType.unit) {

+ 9 - 9
app/service/change_audit_list.js

@@ -484,21 +484,21 @@ module.exports = app => {
             }
         }
 
-        async calcCamountSum(transaction, updateTpDecimal = false) {
+        async calcCamountSum(transaction, updateTpDecimal = false, change = this.ctx.change) {
             // const sql = 'SELECT SUM(ROUND(`camount`*`unit_price`, )) as total_price FROM ?? WHERE cid = ?';
             // const sqlParam = [this.tableName, this.change.cid];
             // const tp = await transaction.queryOne(sql, sqlParam);
             // 防止小数位不精确,采用取值计算
             const sql = 'SELECT unit_price, spamount, is_valuation, gcl_id, unit FROM ?? WHERE cid = ?';
-            const sqlParam = [this.tableName, this.ctx.change.cid];
+            const sqlParam = [this.tableName, change.cid];
             const changeList = await transaction.query(sql, sqlParam);
             let total_price = 0;
             let positive_tp = 0;
             let negative_tp = 0;
             let valuation_tp = 0;
             let unvaluation_tp = 0;
-            const tp_decimal = this.ctx.change.tp_decimal ? this.ctx.change.tp_decimal : this.ctx.tender.info.decimal.tp;
-            const up_decimal = this.ctx.change.up_decimal ? this.ctx.change.up_decimal : this.ctx.tender.info.decimal.up;
+            const tp_decimal = change.tp_decimal ? change.tp_decimal : this.ctx.tender.info.decimal.tp;
+            const up_decimal = change.up_decimal ? change.up_decimal : this.ctx.tender.info.decimal.up;
             const gclChangeList = this._.uniq(this._.map(changeList, 'gcl_id'));
             for (const g of gclChangeList) {
                 if (g) {
@@ -560,7 +560,7 @@ module.exports = app => {
             }
             const options = {
                 where: {
-                    cid: this.ctx.change.cid,
+                    cid: change.cid,
                 },
             };
             await transaction.update(this.ctx.service.change.tableName, updateData, options);
@@ -645,7 +645,7 @@ module.exports = app => {
                     await transaction.delete(this.tableName, delData);
                     for (const c of changes) {
                         // 重算选了此清单的变更令已变更金额
-                        await this.reCalcTp(transaction, c.cid);
+                        await this.calcCamountSum(transaction, false, c);
                     }
                 }
             }
@@ -718,7 +718,7 @@ module.exports = app => {
                     if (updateArr.length > 0) await transaction.updateRows(this.tableName, updateArr);
                     if (cidList.length > 0) {
                         for (const c of cidList) {
-                            await this.reCalcTp(transaction, c);
+                            await this.calcCamountSum(transaction, false, c);
                         }
                     }
                 }
@@ -941,9 +941,9 @@ module.exports = app => {
         async reCalcTp(transaction, cid) {
             const change = await transaction.get(this.ctx.service.change.tableName, { cid });
             let count = '';
-            if (change.status === audit.flow.status.uncheck || change.status === audit.flow.status.back || change.status === audit.flow.status.revise) {
+            if (change.status === audit.change.status.uncheck || change.status === audit.change.status.checkNo || change.status === audit.change.status.revise) {
                 count = '`camount`';
-            } else if (change.status === audit.flow.status.checking || change.status === audit.flow.status.backnew) {
+            } else if (change.status === audit.change.status.checking || change.status === audit.change.status.checkNoPre) {
                 count = '`spamount`';
             }
             if (count) {

+ 3 - 0
app/service/change_pos.js

@@ -380,6 +380,9 @@ module.exports = app => {
                     }
                     updateBills.ledger_id = bills.ledger_id;
                 }
+                if (newBills && updateBills.cid && updateBills.cid === 1) {
+                    await this.ctx.service.changeAuditList.deleteDataByRevise(transaction, tid, [bills.id], 'gcl_id', '');
+                }
                 await this.ctx.service.changeAuditList.updateDataByRevisePos(transaction, tid, data);
                 await transaction.commit();
             } catch (err) {

+ 1 - 0
app/view/change/revise.ejs

@@ -199,4 +199,5 @@
     const settleBills = JSON.parse(unescape('<%- escape(JSON.stringify(settleBills)) %>'));
     const settlePos = JSON.parse(unescape('<%- escape(JSON.stringify(settlePos)) %>'));
     const openRevise = <%- ctx.session.sessionProject.page_show.openChangeRevise %>;
+    const precision = JSON.parse('<%- JSON.stringify(precision) %>');
 </script>

+ 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>

+ 5 - 17
app/view/file/file_modal.ejs

@@ -7,29 +7,16 @@
             </div>
             <div class="modal-body">
                 <div class="row">
-                    <div class="col-4">
+                    <div class="col-5">
                         <div class="d-flex justify-content-center bg-graye">
                             <div class="p-2 vertical-middle"><input class="mr-1" type="checkbox" id="filing-select-all">文档类别</div>
                         </div>
-                        <div class="modal-height-400 scroll-y">
-                            <div class="category">
-                                <ul style="list-style: none">
-                                    <% for (const ft of filingTypes) { %>
-                                    <li>
-                                        <div class="form-check">
-                                            <input class="form-check-input" name="cbft" type="checkbox" value="<%- ft.value %>" id="ftCheck<%- ft.value %>">
-                                            <label class="form-check-label" for="ftCheck<%- ft.value %>"></label>
-                                            <span name="ftName" ftid="<%- ft.value %>" title="<%- ft.parentsName %>"><%- ft.name %></span>
-                                        </div>
-                                    </li>
-                                    <% } %>
-                                </ul>
-                            </div>
+                        <div class="modal-height-400" id="permission-spread">
                         </div>
                     </div>
-                    <div class="col-8">
+                    <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>
@@ -39,6 +26,7 @@
                                 </div>
                             </div>
                             <div class="p-2"><a href="javascript: void(0);" id="batch-del-filing" class="text-danger">批量删除</a></div>
+                            <div class="p-2"><a href="javascript: void(0);" id="batch-add-filing">批量添加至其他类别</a></div>
                             <div class="p-2"><a href="javascript: void(0);" id="sync-filing">同步授权至其他类别</a></div>
                         </div>
                         <div class="modal-height-400 scroll-y">

+ 17 - 0
app/view/file/manage_modal.ejs

@@ -17,4 +17,21 @@
             </div>
         </div>
     </div>
+</div>
+<div class="modal fade" id="del-filing" data-backdrop="static" style="display: none;" aria-hidden="true">
+    <div class="modal-dialog" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">删除确认</h5>
+            </div>
+            <div class="modal-body">
+                <p>如存在子类别,数据文件会一并删除,删除后,数据无法恢复,请谨慎操作。</p>
+                <h6>确认删除当前文件类别?</h6>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
+                <button type="button" class="btn btn-sm btn-danger" id="del-filing-ok">确定删除</button>
+            </div>
+        </div>
+    </div>
 </div>

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

@@ -12,6 +12,7 @@
                         <form class="ml-2 p-2" method="POST" action="/file/template/save">
                             <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>" />
                             <button class="btn btn-sm btn-light text-primary"><i class="fa fa-plus" aria-hidden="true" type="submit"></i> 新增模板库</button>
+                            <a href="javascript: void(0);" class="btn btn-sm btn-primary" id="import-share-template">拷贝分享模板库</a>
                         </form>
                     </div>
                     <div>
@@ -55,7 +56,6 @@
                         </form>
                         <div class="ml-auto p-2">
                             <a href="javascript: void(0);" class="btn btn-sm btn-primary" id="import-template">导入</a>
-                            <a href="javascript: void(0);" class="btn btn-sm btn-primary" id="import-share-template">拷贝分享模板库</a>
                             <a href="javascript: void(0);" class="btn btn-sm btn-primary" id="export-template">导出</a>
                             <a href="javascript: void(0);" class="btn btn-sm btn-primary" id="multi-setting">附加配置</a>
                         </div>

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

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