使用return-property来明确地指定字段/别名

本文介绍如何使用 Hibernate 的 <return-property> 和 <return-discriminator> 标签来定制 SQL 查询结果映射,实现字段别名的灵活配置及多个字段的细粒度控制。

使用<return-property>你可以明确的告诉Hibernate使用哪些字段别名,这取代了使用{}-语法 来让Hibernate注入它自己的别名.

<sql-query name="mySqlQuery">
    <return alias="person" class="eg.Person">
      <return-property name="name" column="myName"/>
      <return-property name="age" column="myAge"/>
      <return-property name="sex" column="mySex"/>
    </return>
    SELECT person.NAME AS myName,
           person.AGE AS myAge,
           person.SEX AS mySex,
    FROM PERSON person WHERE person.NAME LIKE :name
</sql-query>
<return-property>也可用于多个字段,它解决了使用{}-语法不能细粒度控制多个字段的限制
<sql-query name="organizationCurrentEmployments">
            <return alias="emp" class="Employment">            
             <return-property name="salary"> 
               <return-column name="VALUE"/>
               <return-column name="CURRENCY"/>            
             </return-property>
             <return-property name="endDate" column="myEndDate"/>
            </return>
            SELECT EMPLOYEE AS {emp.employee}, EMPLOYER AS {emp.employer}, 
            STARTDATE AS {emp.startDate}, ENDDATE AS {emp.endDate},
            REGIONCODE as {emp.regionCode}, EID AS {emp.id}, VALUE, CURRENCY
            FROM EMPLOYMENT
            WHERE EMPLOYER = :id AND ENDDATE IS NULL
            ORDER BY STARTDATE ASC
</sql-query>

注意在这个例子中,我们使用了<return-property>结合{}的注入语法. 允许用户来选择如何引用字段以及属性.

如果你映射一个识别器(discriminator),你必须使用<return-discriminator> 来指定识别器字段 

 

//============================================================================== // WARNING!! This file is overwritten by the Block UI Styler while generating // the automation code. Any modifications to this file will be lost after // generating the code again. // // Filename: D:\001 NX Model\000 NX Custom Development\ART_NX_C\ArkTech\Modeling_Custom.cs // // This file was generated by the NX Block UI Styler // Created by: jzk24 // Version: NX 2406 // Date: 08-30-2025 (Format: mm-dd-yyyy) // Time: 12:07 (Format: hh-mm) // //============================================================================== //============================================================================== // Purpose: This TEMPLATE file contains C# source to guide you in the // construction of your Block application dialog. The generation of your // dialog file (.dlx extension) is the first step towards dialog construction // within NX. You must now create a NX Open application that // utilizes this file (.dlx). // // The information in this file provides you with the following: // // 1. Help on how to load and display your Block UI Styler dialog in NX // using APIs provided in NXOpen.BlockStyler namespace // 2. The empty callback methods (stubs) associated with your dialog items // have also been placed in this file. These empty methods have been // created simply to start you along with your coding requirements. // The method name, argument list and possible return values have already // been provided for you. //============================================================================== //------------------------------------------------------------------------------ //These imports are needed for the following template code //------------------------------------------------------------------------------ using NXOpen; using NXOpen.BlockStyler; using NXOpen.UF; using NXOpen.Utilities; using System; using static NXOpen.BodyDes.OnestepUnformBuilder; using OnestepPart = NXOpen.BodyDes.OnestepUnformBuilder.Part; // 为另一个 Part 定义别名 using Part = NXOpen.Part; //------------------------------------------------------------------------------ //Represents Block Styler application class //------------------------------------------------------------------------------ public class Modeling_Custom { //class members private static Session theSession = null; private static UI theUI = null; private string theDlxFileName; private NXOpen.BlockStyler.BlockDialog theDialog; private NXOpen.BlockStyler.Group group1;// Block type: Group private NXOpen.BlockStyler.Enumeration enum0;// Block type: Enumeration private NXOpen.BlockStyler.StringBlock string0;// Block type: String private NXOpen.BlockStyler.StringBlock string01;// Block type: String private NXOpen.BlockStyler.Group group;// Block type: Group private NXOpen.BlockStyler.StringBlock string02;// Block type: String private Part workPart; //------------------------------------------------------------------------------ //Constructor for NX Styler class //------------------------------------------------------------------------------ public Modeling_Custom() { try { theSession = Session.GetSession(); theUI = UI.GetUI(); theDlxFileName = "Modeling_Custom.dlx"; theDialog = theUI.CreateDialog(theDlxFileName); theDialog.AddApplyHandler(new NXOpen.BlockStyler.BlockDialog.Apply(apply_cb)); theDialog.AddOkHandler(new NXOpen.BlockStyler.BlockDialog.Ok(ok_cb)); theDialog.AddUpdateHandler(new NXOpen.BlockStyler.BlockDialog.Update(update_cb)); theDialog.AddInitializeHandler(new NXOpen.BlockStyler.BlockDialog.Initialize(initialize_cb)); theDialog.AddDialogShownHandler(new NXOpen.BlockStyler.BlockDialog.DialogShown(dialogShown_cb)); } catch (Exception ex) { //---- Enter your exception handling code here ----- throw ex; } } //------------------------------- DIALOG LAUNCHING --------------------------------- // // Before invoking this application one needs to open any part/empty part in NX // because of the behavior of the blocks. // // Make sure the dlx file is in one of the following locations: // 1.) From where NX session is launched // 2.) $UGII_USER_DIR/application // 3.) For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly // recommended. This variable is set to a full directory path to a file // containing a list of root directories for all custom applications. // e.g., UGII_CUSTOM_DIRECTORY_FILE=$UGII_BASE_DIR\ugii\menus\custom_dirs.dat // // You can create the dialog using one of the following way: // // 1. Journal Replay // // 1) Replay this file through Tool->Journal->Play Menu. // // 2. USER EXIT // // 1) Create the Shared Library -- Refer "Block UI Styler programmer's guide" // 2) Invoke the Shared Library through File->Execute->NX Open menu. // //------------------------------------------------------------------------------ public static void Main() { Modeling_Custom theModeling_Custom = null; try { theModeling_Custom = new Modeling_Custom(); // The following method shows the dialog immediately theModeling_Custom.Launch(); } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } finally { if (theModeling_Custom != null) theModeling_Custom.Dispose(); theModeling_Custom = null; } } //------------------------------------------------------------------------------ // This method specifies how a shared image is unloaded from memory // within NX. This method gives you the capability to unload an // internal NX Open application or user exit from NX. Specify any // one of the three constants as a return Value to determine the type // of unload to perform: // // // Immediately : unload the library as soon as the automation program has completed // Explicitly : unload the library from the "Unload Shared Image" dialog // AtTermination : unload the library when the NX session terminates // // // NOTE: A program which associates NX Open applications with the menubar // MUST NOT use this option since it will UNLOAD your NX Open application image // from the menubar. //------------------------------------------------------------------------------ public static int GetUnloadOption(string arg) { //return System.Convert.ToInt32(Session.LibraryUnloadOption.Explicitly); return System.Convert.ToInt32(Session.LibraryUnloadOption.Immediately); // return System.Convert.ToInt32(Session.LibraryUnloadOption.AtTermination); } //------------------------------------------------------------------------------ // Following method cleanup any housekeeping chores that may be needed. // This method is automatically called by NX. //------------------------------------------------------------------------------ public static void UnloadLibrary(string arg) { try { //---- Enter your code here ----- } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } } //------------------------------------------------------------------------------ //This method launches the dialog to screen //------------------------------------------------------------------------------ public NXOpen.BlockStyler.BlockDialog.DialogResponse Launch() { NXOpen.BlockStyler.BlockDialog.DialogResponse dialogResponse = NXOpen.BlockStyler.BlockDialog.DialogResponse.Invalid; try { dialogResponse = theDialog.Launch(); } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } return dialogResponse; } //------------------------------------------------------------------------------ //Method Name: Dispose //------------------------------------------------------------------------------ public void Dispose() { if (theDialog != null) { theDialog.Dispose(); theDialog = null; } } //------------------------------------------------------------------------------ //---------------------Block UI Styler Callback Functions-------------------------- //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //Callback Name: initialize_cb //------------------------------------------------------------------------------ public void initialize_cb() { try { group1 = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group1"); enum0 = (NXOpen.BlockStyler.Enumeration)theDialog.TopBlock.FindBlock("enum0"); string0 = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("string0"); string01 = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("string01"); group = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group"); string02 = (NXOpen.BlockStyler.StringBlock)theDialog.TopBlock.FindBlock("string02"); //------------------------------------------------------------------------------ //Registration of StringBlock specific callbacks //------------------------------------------------------------------------------ //string0.SetKeystrokeCallback(new NXOpen.BlockStyler.StringBlock.KeystrokeCallback(KeystrokeCallback)); //string01.SetKeystrokeCallback(new NXOpen.BlockStyler.StringBlock.KeystrokeCallback(KeystrokeCallback)); //string02.SetKeystrokeCallback(new NXOpen.BlockStyler.StringBlock.KeystrokeCallback(KeystrokeCallback)); //------------------------------------------------------------------------------ } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } } //------------------------------------------------------------------------------ //Callback Name: dialogShown_cb //This callback is executed just before the dialog launch. Thus any Value set //here will take precedence and dialog will be launched showing that Value. //------------------------------------------------------------------------------ public void dialogShown_cb() { try { //---- Enter your callback code here ----- } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } } //------------------------------------------------------------------------------ //Callback Name: apply_cb //------------------------------------------------------------------------------ public int apply_cb() { int errorCode = 0; try { workPart = theSession.Parts.Work; if (workPart == null) { theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "没有打开的零件文件"); return errorCode; } // 1. 将enum0的值赋予"型号"属性 string modelType = enum0.ValueAsString; SetPartProperty(workPart, "型号", modelType); // 2. 将string0的值赋予"DB_PART_NO"属性 string partNo = string0.Value; if (!string.IsNullOrEmpty(partNo)) { SetPartProperty(workPart, "DB_PART_NO", partNo); } else { theUI.NXMessageBox.Show("警告", NXMessageBox.DialogType.Warning, "零件编号不能为空"); } // 3. 将string01的值赋予"DB_PART_NAME"属性 string partName = string01.Value; SetPartProperty(workPart, "DB_PART_NAME", partName); // 4. 将string02的值设置为与string0相同 string02.Value = string0.Value; theUI.NXMessageBox.Show("成功", NXMessageBox.DialogType.Information, "属性已成功更新"); } catch (Exception ex) { //---- Enter your exception handling code here ----- errorCode = 1; theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } return errorCode; } private void SetPartProperty(Part workPart, string propertyName, string propertyValue) { try { // 检查部件是否为空 if (workPart == null) { theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "部件为空"); return; } // 使用 UFUN 检查部件是否可写 if (!IsPartWriteable(workPart)) { theUI.NXMessageBox.Show("错误", NXMessageBox.DialogType.Error, "部件不可写"); return; } // 使用 UFUN 设置属性 UFSession ufSession = UFSession.GetUFSession(); int result= ufSession.Attr.SetStringUserAttribute( workPart.Tag, propertyName, 0, propertyValue, UFAttr.Equals); if (result !=0) { // 处理错误 theUI.NXMessageBox.Show("属性设置警告", NXMessageBox.DialogType.Warning, $"属性操作返回代码: {result}"); } } catch (Exception ex) { // 异常处理 theUI.NXMessageBox.Show("设置属性错误", NXMessageBox.DialogType.Error, $"无法设置属性 '{propertyName}':{ex.Message}"); // 注意:这里不应该抛出 NotImplementedException } } // 添加检查部件可写状态的方法 private bool IsPartWriteable(Part part) { try { UFSession ufSession = UFSession.GetUFSession(); int writeStatus; object value = ufSession.Part.AskWriteStatus(part.Tag, out IsPartWriteable); // writeStatus 值为 0 表示部件可写 return IsPartWriteable; } catch { return false; } } //------------------------------------------------------------------------------ //Callback Name: update_cb //------------------------------------------------------------------------------ public int update_cb(NXOpen.BlockStyler.UIBlock block) { try { if (block == enum0) { string02.Value = string0.Value; } else if (block == string0) { //---------Enter your code here----------- } else if (block == string01) { //---------Enter your code here----------- } else if (block == string02) { //---------Enter your code here----------- } } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } return 0; } //------------------------------------------------------------------------------ //Callback Name: ok_cb //------------------------------------------------------------------------------ public int ok_cb() { int errorCode = 0; try { errorCode = apply_cb(); if (errorCode == 0) { theDialog.Dispose(); } } catch (Exception ex) { //---- Enter your exception handling code here ----- errorCode = 1; theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } return errorCode; } //------------------------------------------------------------------------------ //StringBlock specific callbacks //------------------------------------------------------------------------------ //public int KeystrokeCallback(NXOpen.BlockStyler.StringBlock string_block, string uncommitted_value) //{ //} //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ //Function Name: GetBlockProperties //Returns the propertylist of the specified BlockID //------------------------------------------------------------------------------ public PropertyList GetBlockProperties(string blockID) { PropertyList plist = null; try { plist = theDialog.GetBlockProperties(blockID); } catch (Exception ex) { //---- Enter your exception handling code here ----- theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString()); } return plist; } } 发现以下错误:CS1503参数5:无法从"方法组"转换为"bool" CS1061"UFPart"未包含"AskWriteStatus"的定义,并且找不到可接受第一个"UFPart"类型参数的可访问扩展方法"AskWriteStatus"(是否缺少using指令或程序集引用?) CS1657"IsPartWriteable"是一个"方法组",无法用作 ref或cput值 CS0428无法将方法组"IsPartWriteable"转换为非委托类型"bcol"。是否希望调用此方法? CS0168 声明了变量"writeStatus",但从未使用过 CS0168 声明了变量"ex",但从未使用过 CS0168 声明了变量"ex",但从未使用过 CS0168 声明了变量"ex",但从未使用过,请更改
09-02
gapinyc@DESKTOP-9QS7RL5:~/superset-prod/superset-5.0.0/superset-frontend$ npm run build > superset@5.0.0 build > cross-env NODE_OPTIONS=--max_old_space_size=8192 NODE_ENV=production BABEL_ENV="${BABEL_ENV:=production}" webpack --color --mode production [Superset Plugin] Use symlink source for @superset-ui/chart-controls @ ./packages/superset-ui-chart-controls [Superset Plugin] Use symlink source for @superset-ui/core @ ./packages/superset-ui-core [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-calendar @ ./plugins/legacy-plugin-chart-calendar [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-chord @ ./plugins/legacy-plugin-chart-chord [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-country-map @ ./plugins/legacy-plugin-chart-country-map [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-horizon @ ./plugins/legacy-plugin-chart-horizon [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-map-box @ ./plugins/legacy-plugin-chart-map-box [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-paired-t-test @ ./plugins/legacy-plugin-chart-paired-t-test [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-parallel-coordinates @ ./plugins/legacy-plugin-chart-parallel-coordinates [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-partition @ ./plugins/legacy-plugin-chart-partition [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-rose @ ./plugins/legacy-plugin-chart-rose [Superset Plugin] Use symlink source for @superset-ui/legacy-plugin-chart-world-map @ ./plugins/legacy-plugin-chart-world-map [Superset Plugin] Use symlink source for @superset-ui/legacy-preset-chart-deckgl @ ./plugins/legacy-preset-chart-deckgl [Superset Plugin] Use symlink source for @superset-ui/legacy-preset-chart-nvd3 @ ./plugins/legacy-preset-chart-nvd3 [Superset Plugin] Use symlink source for @superset-ui/plugin-chart-cartodiagram @ ./plugins/plugin-chart-cartodiagram [Superset Plugin] Use symlink source for @superset-ui/plugin-chart-echarts @ ./plugins/plugin-chart-echarts [Superset Plugin] Use symlink source for @superset-ui/plugin-chart-handlebars @ ./plugins/plugin-chart-handlebars [Superset Plugin] Use symlink source for @superset-ui/plugin-chart-pivot-table @ ./plugins/plugin-chart-pivot-table [Superset Plugin] Use symlink source for @superset-ui/plugin-chart-table @ ./plugins/plugin-chart-table [Superset Plugin] Use symlink source for @superset-ui/plugin-chart-word-cloud @ ./plugins/plugin-chart-word-cloud [Superset Plugin] Use symlink source for @superset-ui/switchboard @ ./packages/superset-ui-switchboard 20% building 1/8 entries 7485/7517 dependencies 696/3486 modules`isModuleDeclaration` has been deprecated, please migrate to `isImportOrExportDeclaration` at isModuleDeclaration (/home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/node_modules/@babel/types/lib/validators/generated/index.js:2793:35) at PluginPass.Program (/home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/node_modules/babel-plugin-lodash/lib/index.js:102:44) 1146 assets 12873 modules WARNING in ./src/components/Tooltip/index.tsx 22:0-42 export 'TooltipPlacement' (reexported as 'TooltipPlacement') was not found in 'antd-v5/lib/tooltip' (possible exports: __esModule, default) WARNING in ./src/components/Tooltip/index.tsx 22:0-42 export 'TooltipProps' (reexported as 'TooltipProps') was not found in 'antd-v5/lib/tooltip' (possible exports: __esModule, default) ERROR in ./plugins/plugin-chart-handlebars/node_modules/just-handlebars-helpers/lib/helpers/formatters.js 27:24-55 Module not found: Error: Can't resolve 'currencyformatter.js' in '/home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/plugins/plugin-chart-handlebars/node_modules/just-handlebars-helpers/lib/helpers' ERROR in ./node_modules/@luma.gl/webgl/dist/adapter/webgl-adapter.js 65:38-62 Module not found: Error: Can't resolve './webgl-device' in '/home/gapinyc/superset-prod/superset-5.0.0/superset-frontend/node_modules/@luma.gl/webgl/dist/adapter' Did you mean 'webgl-device.js'? BREAKING CHANGE: The request './webgl-device' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request. ERROR in ./node_modules/@deck.gl/core/src/controllers/controller.ts:21:24 TS7006: Parameter 't' implicitly has an 'any' type. 19 | 20 | const DEFAULT_INERTIA = 300; > 21 | const INERTIA_EASING = t => 1 - (1 - t) * (1 - t); | ^ 22 | 23 | const EVENT_TYPES = { 24 | WHEEL: ['wheel'], ERROR in ./node_modules/@deck.gl/core/src/controllers/controller.ts:114:3 TS2578: Unused '@ts-expect-error' directive. 112 | abstract get transition(): TransitionProps; 113 | > 114 | // @ts-expect-error (2564) - not assigned in the constructor | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 115 | protected props: ControllerProps; 116 | protected state: Record<string, any> = {}; 117 | ERROR in ./node_modules/@deck.gl/core/src/controllers/controller.ts:173:7 TS7032: Property 'events' implicitly has type 'any', because its set accessor lacks a parameter type annotation. 171 | } 172 | > 173 | set events(customEvents) { | ^^^^^^ 174 | this.toggleEvents(this._customEvents, false); 175 | this.toggleEvents(customEvents, true); 176 | this._customEvents = customEvents; ERROR in ./node_modules/@deck.gl/core/src/controllers/controller.ts:173:14 TS7006: Parameter 'customEvents' implicitly has an 'any' type. 171 | } 172 | > 173 | set events(customEvents) { | ^^^^^^^^^^^^ 174 | this.toggleEvents(this._customEvents, false); 175 | this.toggleEvents(customEvents, true); 176 | this._customEvents = customEvents; ERROR in ./node_modules/@deck.gl/core/src/controllers/controller.ts:338:16 TS7006: Parameter 'eventNames' implicitly has an 'any' type. 336 | } 337 | > 338 | toggleEvents(eventNames, enabled) { | ^^^^^^^^^^ 339 | if (this.eventManager) { 340 | eventNames.forEach(eventName => { 341 | if (this._events[eventName] !== enabled) { ERROR in ./node_modules/@deck.gl/core/src/controllers/controller.ts:338:28 TS7006: Parameter 'enabled' implicitly has an 'any' type. 336 | } 337 | > 338 | toggleEvents(eventNames, enabled) { | ^^^^^^^ 339 | if (this.eventManager) { 340 | eventNames.forEach(eventName => { 341 | if (this._events[eventName] !== enabled) { ERROR in ./node_modules/@deck.gl/core/src/controllers/controller.ts:340:26 TS7006: Parameter 'eventName' implicitly has an 'any' type. 338 | toggleEvents(eventNames, enabled) { 339 | if (this.eventManager) { > 340 | eventNames.forEach(eventName => { | ^^^^^^^^^ 341 | if (this._events[eventName] !== enabled) { 342 | this._events[eventName] = enabled; 343 | if (enabled) { ERROR in ./node_modules/@deck.gl/core/src/controllers/controller.ts:484:29 TS7006: Parameter 'event' implicitly has an 'any' type. 482 | } 483 | > 484 | protected _onPanRotateEnd(event): boolean { | ^^^^^ 485 | const {inertia} = this; 486 | if (this.dragRotate && inertia && event.velocity) { 487 | const pos = this.getCenter(event); ERROR in ./node_modules/@deck.gl/core/src/controllers/map-controller.ts:406:19 TS7006: Parameter 'scale' implicitly has an 'any' type. 404 | /* Private methods */ 405 | > 406 | _zoomFromCenter(scale) { | ^^^^^ 407 | const {width, height} = this.getViewportProps(); 408 | return this.zoom({ 409 | pos: [width / 2, height / 2], ERROR in ./node_modules/@deck.gl/core/src/controllers/map-controller.ts:414:18 TS7006: Parameter 'offset' implicitly has an 'any' type. 412 | } 413 | > 414 | _panFromCenter(offset) { | ^^^^^^ 415 | const {width, height} = this.getViewportProps(); 416 | return this.pan({ 417 | startPos: [width / 2, height / 2], ERROR in ./node_modules/@deck.gl/core/src/controllers/map-controller.ts:422:20 TS7006: Parameter 'newProps' implicitly has an 'any' type. 420 | } 421 | > 422 | _getUpdatedState(newProps): MapState { | ^^^^^^^^ 423 | // @ts-ignore 424 | return new this.constructor({ 425 | makeViewport: this.makeViewport, ERROR in ./node_modules/@deck.gl/core/src/controllers/transition-manager.ts:40:24 TS7006: Parameter 't' implicitly has an 'any' type. 38 | }; 39 | > 40 | const DEFAULT_EASING = t => t; | ^ 41 | const DEFAULT_INTERRUPTION = TRANSITION_EVENTS.BREAK; 42 | 43 | type TransitionSettings = BaseTransitionSettings & { ERROR in ./node_modules/@deck.gl/core/src/controllers/transition-manager.ts:209:12 TS7006: Parameter 'transition' implicitly has an 'any' type. 207 | 208 | _onTransitionEnd(callback?: (transition: Transition) => void) { > 209 | return transition => { | ^^^^^^^^^^ 210 | this.propsInTransition = null; 211 | 212 | this.onStateChange({ ERROR in ./node_modules/@deck.gl/core/src/controllers/transition-manager.ts:223:25 TS7006: Parameter 'transition' implicitly has an 'any' type. 221 | } 222 | > 223 | _onTransitionUpdate = transition => { | ^^^^^^^^^^ 224 | // NOTE: Be cautious re-ordering statements in this function. 225 | const { 226 | time, ERROR in ./node_modules/@deck.gl/core/src/lib/view-manager.ts:161:7 TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'. No index signature with a parameter of type 'string' was found on type '{}'. 159 | const viewMap = {}; 160 | this.views.forEach(view => { > 161 | viewMap[view.id] = view; | ^^^^^^^^^^^^^^^^ 162 | }); 163 | return viewMap; 164 | } ERROR in ./node_modules/@deck.gl/core/src/lib/view-manager.ts:180:32 TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'ViewStateObject<ViewsT>'. No index signature with a parameter of type 'string' was found on type 'ViewStateObject<ViewsT>'. 178 | typeof viewOrViewId === 'string' ? this.getView(viewOrViewId) : viewOrViewId; 179 | // Backward compatibility: view state for single view > 180 | const viewState = (view && this.viewState[view.getViewStateId()]) || this.viewState; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 181 | return view ? view.filterViewState(viewState) : viewState; 182 | } 183 | ERROR in ./node_modules/@deck.gl/core/src/lib/view-manager.ts:269:5 TS2322: Type 'unknown[]' is not assignable to type 'View<TransitionProps, CommonViewProps<TransitionProps>>[]'. Type 'unknown' is not assignable to type 'View<TransitionProps, CommonViewProps<TransitionProps>>'. 267 | // Does not actually rebuild the `Viewport`s until `getViewports` is called 268 | private _setViews(views: View[]): void { > 269 | views = flatten(views, Boolean); | ^^^^^ 270 | 271 | const viewsChanged = this._diffViews(views, this.views); 272 | if (viewsChanged) { ERROR in ./node_modules/@deck.gl/core/src/lib/view-manager.ts:306:21 TS7006: Parameter 'viewState' implicitly has an 'any' type. 304 | onViewStateChange: this._eventCallbacks.onViewStateChange, 305 | onStateChange: this._eventCallbacks.onInteractionStateChange, > 306 | makeViewport: viewState => | ^^^^^^^^^ 307 | this.getView(view.id)?.makeViewport({ 308 | viewState, 309 | width: this.width, ERROR in ./node_modules/@deck.gl/core/src/transitions/linear-interpolator.ts:100:7 TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'. No index signature with a parameter of type 'string' was found on type '{}'. 98 | const propsInTransition = {}; 99 | for (const key of this._propsToExtract) { > 100 | propsInTransition[key] = lerp(startProps[key] || 0, endProps[key] || 0, t); | ^^^^^^^^^^^^^^^^^^^^^^ 101 | } 102 | 103 | if (endProps.aroundPosition && this.opts.makeViewport) { ERROR in ./node_modules/@deck.gl/core/src/transitions/transition-interpolator.ts:66:9 TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'. No index signature with a parameter of type 'string' was found on type '{}'. 64 | for (const key of this._propsToExtract) { 65 | if (key in startProps || key in endProps) { > 66 | startViewStateProps[key] = startProps[key]; | ^^^^^^^^^^^^^^^^^^^^^^^^ 67 | endViewStateProps[key] = endProps[key]; 68 | } 69 | } ERROR in ./node_modules/@deck.gl/core/src/transitions/transition-interpolator.ts:67:9 TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'. No index signature with a parameter of type 'string' was found on type '{}'. 65 | if (key in startProps || key in endProps) { 66 | startViewStateProps[key] = startProps[key]; > 67 | endViewStateProps[key] = endProps[key]; | ^^^^^^^^^^^^^^^^^^^^^^ 68 | } 69 | } 70 | ERROR in ./node_modules/@deck.gl/core/src/transitions/transition-interpolator.ts:100:23 TS7006: Parameter 'props' implicitly has an 'any' type. 98 | } 99 | > 100 | _checkRequiredProps(props) { | ^^^^^ 101 | if (!this._requiredProps) { 102 | return; 103 | } ERROR in ./node_modules/@deck.gl/core/src/types/types.ts:10:8 TS7019: Rest parameter 'args' implicitly has an 'any[]' type. 8 | 9 | export interface ConstructorOf<T> { > 10 | new (...args): T; | ^^^^^^^ 11 | } 12 | ERROR in ./node_modules/@deck.gl/core/src/utils/flatten.ts:44:28 TS7031: Binding element 'target' implicitly has an 'any' type. 42 | 43 | /** Uses copyWithin to significantly speed up typed array value filling */ > 44 | export function fillArray({target, source, start = 0, count = 1}) { | ^^^^^^ 45 | const length = source.length; 46 | const total = count * length; 47 | let copied = 0; ERROR in ./node_modules/@deck.gl/core/src/utils/flatten.ts:44:36 TS7031: Binding element 'source' implicitly has an 'any' type. 42 | 43 | /** Uses copyWithin to significantly speed up typed array value filling */ > 44 | export function fillArray({target, source, start = 0, count = 1}) { | ^^^^^^ 45 | const length = source.length; 46 | const total = count * length; 47 | let copied = 0; ERROR in ./node_modules/@deck.gl/core/src/utils/math-utils.ts:100:5 TS7034: Variable 'scratchArray' implicitly has type 'any' in some locations where its type cannot be determined. 98 | } 99 | > 100 | let scratchArray; | ^^^^^^^^^^^^ 101 | 102 | /** 103 | * Split a Float64Array into a double-length Float32Array ERROR in ./node_modules/@deck.gl/core/src/utils/math-utils.ts:121:45 TS7005: Variable 'scratchArray' implicitly has an 'any' type. 119 | 120 | const count = (endIndex - startIndex) / size; > 121 | scratchArray = typedArrayManager.allocate(scratchArray, count, { | ^^^^^^^^^^^^ 122 | type: Float32Array, 123 | size: size * 2 124 | }); ERROR in ./node_modules/@deck.gl/core/src/views/view.ts:155:11 TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type 'TransitionProps'. No index signature with a parameter of type 'string' was found on type 'TransitionProps'. 153 | for (const key in this.props.viewState) { 154 | if (key !== 'id') { > 155 | newViewState[key] = this.props.viewState[key]; | ^^^^^^^^^^^^^^^^^ 156 | } 157 | } 158 | return newViewState; ERROR in ./node_modules/@deck.gl/core/src/views/view.ts:155:31 TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ id?: string | undefined; } & Partial<ViewState>'. No index signature with a parameter of type 'string' was found on type '{ id?: string | undefined; } & Partial<ViewState>'. 153 | for (const key in this.props.viewState) { 154 | if (key !== 'id') { > 155 | newViewState[key] = this.props.viewState[key]; | ^^^^^^^^^^^^^^^^^^^^^^^^^ 156 | } 157 | } 158 | return newViewState; webpack 5.102.1 compiled with 31 errors and 2 warnings in 40499 ms gapinyc@DESKTOP-9QS7RL5:~/superset-prod/superset-5.0.0/superset-frontend$ npm fund superset@5.0.0 ├── https://github.com/sponsors/ayuhito │ └── @fontsource/fira-code@5.2.7, @fontsource/inter@5.2.8 ├── https://opencollective.com/ant-design │ └── antd@5.27.6 ├── https://opencollective.com/core-js │ └── core-js@3.46.0, core-js-compat@3.46.0, core-js-pure@3.46.0 ├── https://opencollective.com/geostyler │ └── geostyler-openlayers-parser@4.3.0, geostyler-style@7.5.0, geostyler-wfs-parser@2.0.3, geostyler-sld-parser@5.4.0, geostyler-style@8.1.0 ├── https://opencollective.com/immer │ └── immer@9.0.21 ├── https://ko-fi.com/milesjohnson │ └── interweave@13.1.1 ├── https://github.com/sponsors/ai │ └── nanoid@5.1.6, nanoid@3.3.11 ├─┬ https://opencollective.com/openlayers │ │ └── ol@7.5.2 │ └── https://github.com/sponsors/sindresorhus │ └── quick-lru@6.1.2, query-string@6.14.1, tempy@3.1.0, unique-string@3.0.0, crypto-random-string@4.0.0, type-fest@1.4.0, is-absolute-url@4.0.1, merge-descriptors@1.0.3, binary-extensions@2.3.0, import-fresh@3.3.1, parse-json@5.2.0, find-up@5.0.0, locate-path@6.0.0, p-locate@5.0.0, p-limit@3.1.0, yocto-queue@0.1.0, strip-indent@4.1.1, html-tags@3.3.1, type-fest@2.19.0, camelcase@6.3.0, strip-json-comments@3.1.1, globals@13.24.0, type-fest@0.20.2, open-cli@8.0.0, get-stdin@9.0.0, open@10.2.0, default-browser@5.2.1, bundle-name@4.1.0, run-applescript@7.1.0, default-browser-id@5.0.0, define-lazy-prop@3.0.0, is-inside-container@1.0.0, is-docker@3.0.0, wsl-utils@0.1.0, is-wsl@3.1.0, default-browser-id@3.0.0, is-plain-obj@3.0.0, github-username@9.0.0, latest-version@9.0.0, package-json@10.0.1, registry-url@6.0.1, read-package-up@11.0.0, find-up-simple@1.0.1, read-pkg@9.0.1, parse-json@8.3.0, index-to-position@1.2.0, unicorn-magic@0.1.0, type-fest@4.41.0, sort-keys@5.1.0, is-plain-obj@4.1.0, log-symbols@7.0.1, is-unicode-supported@2.1.0, yoctocolors@2.1.2, ora@5.3.0, p-queue@6.6.2, ansi-escapes@4.3.2, type-fest@0.21.3, yoctocolors-cjs@2.1.3, vinyl-file@5.0.0, strip-bom-buf@3.0.1, strip-bom-stream@5.0.0, first-chunk-stream@5.0.0, globby@11.1.0, multimatch@5.0.0, cli-boxes@3.0.0, meow@8.1.2, camelcase-keys@6.2.2, map-obj@4.3.0, decamelize-keys@1.1.1, read-pkg-up@7.0.1, type-fest@0.18.1, string-width@6.1.0, string-width@5.1.2, pretty-ms@9.3.0, parse-ms@4.0.0, escape-string-regexp@5.0.0, filenamify@4.3.0, find-cache-dir@4.0.0, pkg-dir@7.0.0, find-up@6.3.0, locate-path@7.2.0, p-locate@6.0.0, p-limit@4.0.0, yocto-queue@1.2.1, is-stream@2.0.1, get-stream@6.0.0, boxen@4.2.0, cli-boxes@2.2.1, term-size@2.2.1, decompress-response@6.0.0, mimic-response@3.1.0, responselike@2.0.1, clone-response@1.0.3, get-stream@5.2.0, normalize-url@6.1.0, quick-lru@5.1.1, cli-spinners@2.6.1, figures@3.2.0, hasha@5.2.2, is-installed-globally@0.4.0, global-dirs@3.0.1, pretty-bytes@5.6.0, cli-truncate@2.1.0, log-update@4.0.0, p-map@4.0.0, throttleit@1.0.1, escape-string-regexp@4.0.0, default-require-extensions@3.0.1, make-dir@4.0.0, import-local@3.1.0, component-emitter@1.3.1, array-equal@1.0.2, get-port@5.1.1, p-pipe@3.1.0, p-waterfall@2.1.1, pify@5.0.0, open@8.4.2, is-docker@2.2.1, detect-indent@7.0.2, detect-newline@4.0.1, gzip-size@6.0.0 ├── https://github.com/sponsors/tannerlinsley │ └── react-table@7.8.0 ├── https://github.com/sponsors/isaacs │ └── rimraf@4.4.1, glob@9.3.5, minimatch@8.0.4, glob@10.4.5, jackspeak@3.4.3, path-scurry@1.11.1, rimraf@3.0.2, glob@7.2.3, minimatch@9.0.3, glob@8.1.0, json-stringify-nice@1.1.4, promise-all-reject-late@1.0.1, promise-call-limit@3.0.2 ├─┬ https://opencollective.com/babel │ │ └── @babel/core@7.28.4 │ └── https://opencollective.com/browserslist │ └── browserslist@4.27.0, caniuse-lite@1.0.30001751, update-browserslist-db@1.1.4 ├── https://opencollective.com/storybook │ └── @storybook/addon-actions@8.1.11, @storybook/core-events@8.1.11, @storybook/addon-controls@8.1.11, @storybook/blocks@8.1.11, @storybook/channels@8.1.11, @storybook/client-logger@8.1.11, @storybook/docs-tools@8.1.11, @storybook/core-common@8.1.11, @storybook/csf-tools@8.1.11, @storybook/node-logger@8.1.11, @storybook/manager-api@8.1.11, @storybook/router@8.1.11, @storybook/theming@8.1.11, @storybook/types@8.1.11, @storybook/addon-essentials@8.1.11, @storybook/addon-backgrounds@8.1.11, @storybook/addon-docs@8.1.11, @storybook/csf-plugin@8.1.11, @storybook/react-dom-shim@8.1.11, @storybook/addon-highlight@8.1.11, @storybook/addon-measure@8.1.11, @storybook/addon-outline@8.1.11, @storybook/addon-toolbars@8.1.11, @storybook/addon-viewport@8.1.11, @storybook/addon-links@8.1.11, @storybook/addon-mdx-gfm@8.1.11, @storybook/components@8.1.11, @storybook/preview-api@8.1.11, @storybook/react@8.1.11, @storybook/react-webpack5@8.2.9, @storybook/builder-webpack5@8.2.9, @storybook/core-webpack@8.2.9, @storybook/preset-react-webpack@8.2.9, @storybook/react@8.2.9, @storybook/components@8.6.14, @storybook/manager-api@8.6.14, @storybook/preview-api@8.6.14, @storybook/react-dom-shim@8.2.9, @storybook/theming@8.6.14, storybook@8.1.11, @storybook/cli@8.1.11, @storybook/codemod@8.1.11, @storybook/core-server@8.1.11, @storybook/builder-manager@8.1.11, @storybook/manager@8.1.11, @storybook/telemetry@8.1.11, @storybook/types@8.4.7, storybook@8.6.14 ├── https://github.com/sponsors/gregberge │ └── @svgr/webpack@8.1.0, @svgr/core@8.1.0, @svgr/babel-preset@8.1.0, @svgr/babel-plugin-add-jsx-attribute@8.0.0, @svgr/babel-plugin-remove-jsx-attribute@8.0.0, @svgr/babel-plugin-remove-jsx-empty-expression@8.0.0, @svgr/babel-plugin-replace-jsx-attribute-value@8.0.0, @svgr/babel-plugin-svg-dynamic-title@8.0.0, @svgr/babel-plugin-svg-em-dimensions@8.0.0, @svgr/babel-plugin-transform-react-native-svg@8.1.0, @svgr/babel-plugin-transform-svg-component@8.0.0, @svgr/plugin-jsx@8.1.0, @svgr/hast-util-to-babel-ast@8.0.0, @svgr/plugin-svgo@8.1.0 ├── https://opencollective.com/typescript-eslint │ └── @typescript-eslint/eslint-plugin@5.62.0, @typescript-eslint/scope-manager@5.62.0, @typescript-eslint/types@5.62.0, @typescript-eslint/visitor-keys@5.62.0, @typescript-eslint/type-utils@5.62.0, @typescript-eslint/typescript-estree@5.62.0, @typescript-eslint/utils@5.62.0, @typescript-eslint/parser@5.62.0 ├─┬ https://github.com/wojtekmaj/enzyme-adapter-react-17?sponsor=1 │ │ └── @wojtekmaj/enzyme-adapter-react-17@0.8.0 │ └── https://github.com/wojtekmaj/enzyme-adapter-utils?sponsor=1 │ └── @wojtekmaj/enzyme-adapter-utils@0.2.0 ├─┬ https://github.com/cheeriojs/cheerio?sponsor=1 │ │ └── cheerio@1.0.0-rc.10 │ └── https://github.com/fb55/htmlparser2?sponsor=1 │ └── htmlparser2@6.1.0 ├─┬ https://github.com/privatenumber/esbuild-loader?sponsor=1 │ │ └── esbuild-loader@4.4.0 │ └─┬ https://github.com/privatenumber/get-tsconfig?sponsor=1 │ │ └── get-tsconfig@4.13.0 │ └── https://github.com/privatenumber/resolve-pkg-maps?sponsor=1 │ └── resolve-pkg-maps@1.0.0 ├─┬ https://opencollective.com/eslint-import-resolver-typescript │ │ └── eslint-import-resolver-typescript@3.10.1 │ ├── https://github.com/sponsors/SuperchupuDev │ │ └── tinyglobby@0.2.15, tinyglobby@0.2.12 │ └─┬ https://opencollective.com/unrs-resolver │ │ └── unrs-resolver@1.11.1 │ └── https://opencollective.com/napi-postinstall │ └── napi-postinstall@0.3.4 ├─┬ https://opencollective.com/eslint-plugin-prettier │ │ └── eslint-plugin-prettier@5.5.4 │ └─┬ https://opencollective.com/synckit │ │ └── synckit@0.11.11 │ └── https://opencollective.com/pkgr │ └── @pkgr/core@0.2.9 ├── https://opencollective.com/html-webpack-plugin │ └── html-webpack-plugin@5.6.4 ├── https://opencollective.com/sinon │ └── sinon@16.1.3 ├── https://github.com/chalk/chalk?sponsor=1 │ └── chalk@4.1.0 ├── https://github.com/steveukx/git-js?sponsor=1 │ └── simple-git@3.28.0 ├── https://bevry.me/fund │ └── binaryextensions@4.19.0, textextensions@5.16.0 ├── https://github.com/sponsors/gjtorikian/ │ └── isbinaryfile@5.0.3 ├── https://github.com/chalk/ansi-styles?sponsor=1 │ └── ansi-styles@5.2.0 ├── https://github.com/chalk/wrap-ansi?sponsor=1 │ └── wrap-ansi@8.1.0 ├── https://opencollective.com/preact │ └── preact@10.27.2 ├── https://opencollective.com/react-spring/donate │ └── @react-spring/core@9.7.5 ├── https://github.com/sponsors/broofa │ └── uuid@10.0.0 ├── https://www.paypal.com/donate/?hosted_button_id=GB656ZSAEQEXN │ └── process-streams@1.0.3 ├── https://dotenvx.com │ └── dotenv@16.4.7, dotenv-expand@11.0.7 ├── https://tidelift.com/funding/github/npm/loglevel │ └── loglevel@1.9.2 ├─┬ https://opencollective.com/node-fetch │ │ └── node-fetch@3.3.1 │ └── https://github.com/sponsors/jimmywarting │ └── fetch-blob@3.2.0, node-domexception@1.0.0 ├─┬ https://github.com/sindresorhus/got?sponsor=1 │ │ └── got@11.8.6 │ └── https://github.com/sindresorhus/is?sponsor=1 │ └── @sindresorhus/is@4.6.0 ├── https://github.com/sponsors/colinhacks │ └── zod@3.23.8 ├── https://github.com/sponsors/sibiraj-s │ └── ci-info@3.9.0 ├── https://www.buymeacoffee.com/systeminfo │ └── systeminformation@5.27.7 ├── https://github.com/sponsors/dubzzz │ └── pure-rand@6.1.0 ├── https://github.com/sindresorhus/emittery?sponsor=1 │ └── emittery@0.13.1 ├── https://github.com/sponsors/lupomontero │ └── psl@1.15.0 ├── https://github.com/sponsors/csstools │ └── @csstools/css-calc@2.1.4, @csstools/css-color-parser@3.1.0, @csstools/color-helpers@5.1.0, @csstools/css-parser-algorithms@3.0.5, @csstools/css-tokenizer@3.0.4 ├── https://github.com/sponsors/RubenVerborgh │ └── follow-redirects@1.15.11 ├── https://github.com/sponsors/mesqueeb │ └── copy-anything@2.0.6 └── https://github.com/fisker/git-hooks-list?sponsor=1 └── git-hooks-list@4.1.1 gapinyc@DESKTOP-9QS7RL5:~/superset-prod/superset-5.0.0/superset-frontend$
10-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值