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

Merge branch 'master' of http://smartcost.in.8866.org:26903/SmartCost/SCCommon

wupeixin пре 3 година
родитељ
комит
baf1faad2b

+ 16 - 0
handsontable/handsontable.d.ts

@@ -317,6 +317,12 @@ declare namespace Handsontable {
       saveValue(val?: any, ctrlDown?: boolean): void;
 
       setValue(newValue?: any): void;
+
+      lock(): void;
+
+      unlock(): void;
+
+      getLockState(): boolean;
     }
 
     class Checkbox extends Base {
@@ -774,6 +780,16 @@ declare namespace Handsontable {
       extendEvent(context: object, event: Event): any;
     }
 
+    interface EditorManagerInstance {
+      lockEditor(): void;
+      unlockEditor(): void;
+      getLockState(): boolean;
+    }
+
+    interface EditorManager {
+      getInstance(hotInstance: _Handsontable.Core, hotSettings?: Handsontable.DefaultSettings, selection?: any, datamap?: any): EditorManagerInstance
+    }
+
     interface GhostTable {
       columns: number[];
       container: HTMLElement | null;

+ 1 - 1
handsontable/package.json

@@ -10,7 +10,7 @@
     "url": "https://github.com/handsontable/handsontable/issues"
   },
   "author": "Handsoncode <hello@handsontable.com>",
-  "version": "6.3.15",
+  "version": "6.3.16",
   "browser": "dist/handsontable.js",
   "main": "commonjs/index.js",
   "module": "es/index.js",

+ 5 - 1
handsontable/src/editorManager.js

@@ -280,7 +280,7 @@ function EditorManager(instance, priv, selection) {
   };
 
   /**
-  * Unlock the editor from being prepared and closed. This method restores the original behavior of
+  * Unlock the editor from being prepare  d and closed. This method restores the original behavior of
   * the editors where for every new selection its instances are closed.
   *
   * @function unlockEditor
@@ -290,6 +290,10 @@ function EditorManager(instance, priv, selection) {
     lock = false;
   };
 
+  this.getLockState = function() {
+    return lock;
+  };
+
   /**
    * Destroy current editor, if exists.
    *

+ 19 - 0
handsontable/src/editors/_baseEditor.js

@@ -1,5 +1,6 @@
 import { CellCoords } from './../3rdparty/walkontable/src';
 import { stringify } from './../helpers/mixed';
+import EditorManager from './../editorManager';
 
 export const EditorState = {
   VIRGIN: 'STATE_VIRGIN', // before editing
@@ -266,4 +267,22 @@ BaseEditor.prototype.checkEditorSection = function() {
   return section;
 };
 
+// 锁定editor,锁定后,点击事件不会关闭editor
+BaseEditor.prototype.lock = function() {
+  const editorManagerInstance = EditorManager.getInstance(this.instance);
+  editorManagerInstance.lockEditor();
+};
+
+// 解锁editor
+BaseEditor.prototype.unlock = function() {
+  const editorManagerInstance = EditorManager.getInstance(this.instance);
+  editorManagerInstance.unlockEditor();
+};
+
+// 获取editor是否锁定
+BaseEditor.prototype.getLockState = function() {
+  const editorManagerInstance = EditorManager.getInstance(this.instance);
+  return editorManagerInstance.getLockState();
+};
+
 export default BaseEditor;

+ 2 - 0
handsontable/src/index.js

@@ -12,6 +12,7 @@ import { getRegisteredCellTypeNames, getCellType, registerCellType } from './cel
 import Core from './core';
 import jQueryWrapper from './helpers/wrappers/jquery';
 import EventManager, { getListenersCounter } from './eventManager';
+import EditorManager from './editorManager';
 import Hooks from './pluginHooks';
 import GhostTable from './utils/ghostTable';
 import * as arrayHelpers from './helpers/array';
@@ -49,6 +50,7 @@ jQueryWrapper(Handsontable);
 Handsontable.Core = Core;
 Handsontable.DefaultSettings = DefaultSettings;
 Handsontable.EventManager = EventManager;
+Handsontable.EditorManager = EditorManager;
 Handsontable._getListenersCounter = getListenersCounter; // For MemoryLeak tests
 
 Handsontable.buildDate = process.env.HOT_BUILD_DATE;

+ 2 - 1
report/src/interface/basic.ts

@@ -640,7 +640,8 @@ export interface RptTreeNode {
         auditType?: string | null;
         rptTplType?:string | null;
     };
-    UID?:number
+    UID?:number;
+    refId?:string;
   }
 //   方案列表
 export interface IRptSchemeList{

+ 1 - 1
tree/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@sc/tree",
-  "version": "1.0.18",
+  "version": "1.0.20",
   "description": "通用树",
   "main": "./dist/index.cjs.js",
   "module": "./dist/index.esm.js",

+ 14 - 0
tree/src/tree.ts

@@ -659,4 +659,18 @@ export class Tree<T extends TreeRaw = TreeRaw> {
     Object.keys(this.IDMap).forEach(key => delete this.IDMap[key]);
     Object.keys(this.ctxMap).forEach(key => delete this.ctxMap[key]);
   }
+
+  // 检测树结构
+  check(): TreeNode<T>[] {
+    const errNodes: TreeNode<T>[] = [];
+    errNodes.push(...this.checkParent());
+    return errNodes;
+  }
+
+  // 检查找不到父项的(parentID对应的节点不存在),返回有问题的节点
+  private checkParent(): TreeNode<T>[] {
+    return this.rawData.filter(
+      node => node.parentID !== this.rootID && !this.IDMap[node.parentID]
+    );
+  }
 }

+ 7 - 6
types/src/interface/base.ts

@@ -278,14 +278,15 @@ export interface IGetData {
   approval?: IProjectApproval;
 }
 
+export interface IFee {
+  tenderTotalFee: number;
+  tenderUnitPrice: number;
+  totalFee: number;
+  unitPrice: number;
+}
 // 费用字段
 export interface IFees {
-  [key: string]: {
-    tenderTotalFee: number;
-    tenderUnitPrice: number;
-    totalFee: number;
-    unitPrice: number;
-  };
+  [key: string]: IFee;
 }
 
 // 定额和清单共有的属性,造价书中很多地方需要

+ 16 - 3
types/src/interface/bill.ts

@@ -1,7 +1,7 @@
 import { IComponent } from './glj';
 import { FileType } from './project';
 import { IElfItem } from './billGuide';
-import { IBRBase, INumFileRef, ITreeScm } from './base';
+import { BRType, IBRBase, IFees, INumFileRef, ITreeScm } from './base';
 import { ICalcItem } from './calculation';
 
 // 清单固定类别
@@ -108,6 +108,9 @@ export interface IBookmark {
   creatorID: string;
   createTime: number;
   telNo: string;
+  kind: BRType;
+  institution?: string;
+  procunit?: string;
 }
 // 修改书签
 export interface ISetBookmark {
@@ -121,6 +124,11 @@ export interface IPriceScope {
   maxUnitPrice: number;
 }
 
+export enum IndexCalcType {
+  STDEV = 1, // 均方差
+  AVG = 2, // 平均值
+}
+
 export interface ICheckOptions {
   fileType: string;
   year: string;
@@ -130,6 +138,7 @@ export interface ICheckOptions {
   classCode?: string;
   indexType?: string;
   unit?: string;
+  calcType?: IndexCalcType;
 }
 
 export interface IBill extends IBRBase {
@@ -282,7 +291,9 @@ export interface IBillIndexRation {
   quantity: string;
   unitPrice: string;
   rationGljList: IBillIndexGlj[];
-  dynamicIndex?: Record<string, string>; // 动态指标,年-月为key 综合指标的映射
+  dynamicIndex?: Record<string, IFees>; // 动态指标,年-月为key 综合指标的映射
+  fees?: IFees; // 费用字段
+  calcItems?: ICalcItem[];
 }
 
 export interface IFBIndex {
@@ -305,15 +316,17 @@ export interface IFBIndex {
   month?: string; // 信息价月
   fileType?: FileType; // 文件类型
   indexTypes?: string[]; // 项目分类或者说功能分类--
-  dynamicIndex?: Record<string, string>; // 动态指标,年-月为key 综合指标的映射
+  dynamicIndex?: Record<string, IFees>; // 动态指标,年-月为key 综合指标的映射
   minUnitPrice?: string;
   maxUnitPrice?: string;
+  fees?: IFees; // 费用字段
 }
 export interface IBillIndex extends IFBIndex {
   classCode: string; // 类别别名
   groupCode?: string;
   itemCharacter: string;
   rations?: IBillIndexRation[];
+  dynamicGljMap?: Record<string, Record<string, string>>; // 动态工料机价格指标,年-月为key 工料机工五大项为子key  value为市场价
 }
 
 export enum LibType {

+ 2 - 1
types/src/interface/compilation.ts

@@ -1,4 +1,4 @@
-import { TaxType, IGLJCol } from './project';
+import { TaxType, IGLJCol, FileType } from './project';
 import { IFileRef, INumFileRef } from './base';
 import { IBillOption } from './bill';
 
@@ -58,6 +58,7 @@ export interface IValuation {
   enable: boolean;
   ID: string;
   name: string;
+  fileTypes?: FileType[];
 }
 
 export enum versionType {

+ 2 - 0
types/src/interface/editLog.ts

@@ -17,6 +17,8 @@ export interface ILogDetail<T = any> {
   oldValue?: string; // 旧值
   field?: string; // 修改的field
   processID?: string; // 流程ID
+  institution?: string; // 单位名称
+  procunit?: string; // 流程环节
 }
 
 export interface IEditLog {

+ 6 - 0
types/src/interface/financialProject.ts

@@ -17,6 +17,11 @@ export interface IFinancialProjectReporter {
   name: string;
 }
 
+export interface IFinancialProjectSecrecy {
+  protected: boolean,
+  institutions: string[]
+}
+
 // 财审项目,字段来自后台,无法修改
 export interface IFinancialProject {
   ID: string;
@@ -28,6 +33,7 @@ export interface IFinancialProject {
   reportAccount?: IFinancialProjectReporter[]; // 上报人(即前端列表的编辑者列)
   constructionID?: string; // 关联的建设项目
   createdTime: number;
+  secrecy?: IFinancialProjectSecrecy // 项目设置保密
   [props: string]: any;
 }
 

+ 8 - 0
types/src/interface/glj.ts

@@ -375,6 +375,9 @@ export interface ICptGlj extends IBaseRationGlj {
   creatorName?: string; // 创建者姓名
   createTime?: number; // 创建时间
   displayLibName?: string; // 工料机所在库在前端UI上的显示,如:[企业库]。
+  alias?: string; // 别名(名称 规格)
+  period?: string; // 期数
+  operationID?: string; // 操作ID 防止未来需要撤销批量入库
 }
 
 // 新增补充人材机接口传输的数据接口
@@ -508,3 +511,8 @@ export interface ICptGljLib {
   isEnterpriseInternal: boolean;
   createDate: number;
 }
+
+// 以工料机五大项为key,映射表
+export interface IGljKeyMap {
+  [key: string]: IBaseGlj;
+}

+ 8 - 0
types/src/interface/process.ts

@@ -27,6 +27,7 @@ export enum ApprovalWay {
 // 角色权限
 export enum RolePermission {
   MY_REPORT = 'report', // 我的项目-项目上报
+  MY_FREE_REPORT = "freeReport", // 我的项目-指定审批人
   MY_ADD_PROJECT = 'addProject', // 我的项目-新建项目
   MY_EDIT_PROJECT = 'editProject', // 我的项目-编辑项目
   MY_EXPORT_PROJECT = 'exportProject', // 我的项目-导出项目
@@ -35,6 +36,7 @@ export enum RolePermission {
   JOIN_VIEW_PARTICIPATING_PROJECT = 'viewParticipatingProject', // 我参与的项目-查看项目
   JOIN_SAVE_INDEX = 'saveIndex', // 我参与的项目-指标入库
   JOIN_EXPORT_PARTICIPATING_PROJECT = 'exportParticipatingProject', // 我参与的项目-导出项目
+  ALL_SET_PROJECT = "setProjects", // 全部项目-项目设置
   ALL_VIEW_ALL_PROJECTS = 'viewAllProjects', // 全部项目-查看项目
   ALL_SAVE_INDEX = 'saveIndexAll', // 全部项目-指标入库
   // TODO 指标库 区间对数
@@ -231,3 +233,9 @@ export interface ITodo {
 export interface IApprovalTodo extends ITodo {
   data: IApprovalTodoData;
 }
+
+export enum ChangeRecord{
+  CURRENT = 'current', // 当前清单
+  ALLBILLS = 'all-bills', // 全部清单
+  ALLGLJS = 'all-gljs', // 全部材价
+}

+ 7 - 1
types/src/interface/project.ts

@@ -84,9 +84,12 @@ export enum FileType {
   CONTROL = 3, // 控制价
 
   // 预算类型  --- end
+
   ESTIMATE = 5, // 概算
 
   SETTLEMENT = 10, // 结算
+
+  GUSUAN = 15, // 估算
 }
 
 // 结算流程类型
@@ -103,6 +106,7 @@ export enum FileTypeName {
   INVITATION = '预算',
   ESTIMATE = '概算',
   SETTLEMENT = '结算',
+  GUSUAN = '估算',
 }
 
 export const FileTypeMap = {
@@ -249,6 +253,7 @@ export interface IProperty {
   saveToIndex?: boolean; // 是否已经入库
   checkOptions?: ICheckOptions; // 指标检测的选项
   priceScope?: IPriceScope; // 价格区间
+  gusuanSetting?: ICheckOptions; // 估算项目自动填写指标时的设置
 }
 
 // 原来的列设置太复杂了,没什么必要
@@ -456,5 +461,6 @@ export interface ICommonIndex {
   unit?: string;
   quantity?: string;
   composite: string; // 综合指标
-  dynamicIndex: Record<string, string>; // 动态指标,年-月为key 综合指标的映射
+  engineeringCost: number;
+  dynamicIndex: Record<string, string>; // 动态指标,年-月为key  这里的值 保存的是动态总造价,动态的综合指标实时算,前端动态计算时不方便拿quantity
 }