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

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

zhenghongfeng 3 лет назад
Родитель
Сommit
31dc60af8f

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

+ 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;
 }
 
 // 定额和清单共有的属性,造价书中很多地方需要

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

@@ -1,7 +1,7 @@
 import { IComponent } from './glj';
 import { FileType } from './project';
 import { IElfItem } from './billGuide';
-import { BRType, IBRBase, INumFileRef, ITreeScm } from './base';
+import { BRType, IBRBase, IFees, INumFileRef, ITreeScm } from './base';
 import { ICalcItem } from './calculation';
 
 // 清单固定类别
@@ -284,7 +284,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 {
@@ -307,9 +309,10 @@ 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; // 类别别名

+ 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; // 期数
 }
 
 // 新增补充人材机接口传输的数据接口