Просмотр исходного кода

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/SCCommon

# Conflicts:
#	types/src/interface/bill.ts
zhangweicheng 3 лет назад
Родитель
Сommit
e9122ece1e

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

+ 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]
+    );
+  }
 }

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

@@ -1,7 +1,7 @@
 import { IComponent } from './glj';
 import { FileType } from './project';
 import { IElfItem } from './billGuide';
-import { IBRBase, IFees, INumFileRef, ITreeScm } from './base';
+import { BRType, IBRBase, IFees, INumFileRef, ITreeScm } from './base';
 import { ICalcItem } from './calculation';
 
 // 清单固定类别
@@ -108,6 +108,7 @@ export interface IBookmark {
   creatorID: string;
   createTime: number;
   telNo: string;
+  kind: BRType;
 }
 // 修改书签
 export interface ISetBookmark {
@@ -284,6 +285,7 @@ export interface IBillIndexRation {
   rationGljList: IBillIndexGlj[];
   dynamicIndex?: Record<string, string>; // 动态指标,年-月为key 综合指标的映射
   fees?: IFees; // 费用字段
+  calcItems?: ICalcItem[];
 }
 
 export interface IFBIndex {

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

@@ -375,6 +375,8 @@ export interface ICptGlj extends IBaseRationGlj {
   creatorName?: string; // 创建者姓名
   createTime?: number; // 创建时间
   displayLibName?: string; // 工料机所在库在前端UI上的显示,如:[企业库]。
+  alias?: string; // 别名(名称 规格)
+  period?: string; // 期数
 }
 
 // 新增补充人材机接口传输的数据接口