فهرست منبع

new event view

lianghuang 4 سال پیش
والد
کامیت
f69ad3a684

+ 1 - 15
coms/jenga/block/BlockAction.jsx

@@ -4,7 +4,6 @@ import LazyLoad from 'react-lazyload'
 import cls from 'classnames'
 import newEventActions from 'actions/newEvent'
 import Block from './base/Block'
-// import BlockChildren from './base/BlockChildren'
 import BlockOrder from './base/BlockOrder'
 import BlockDel from './base/BlockDel'
 import BlockCite from './base/BlockCite'
@@ -132,7 +131,7 @@ export default class BlockAction extends Block {
                 draggable={true}
                 // onDragStart={this.onDragStart}
                 // onDragEnd={this.onDragEnd}
-                onClick={this.onToggleParamsVisible}
+                // onClick={this.onToggleParamsVisible}
               >
                 <div
                   id={'over-cover-' + this.props.bid}
@@ -166,19 +165,6 @@ export default class BlockAction extends Block {
                 eventNodeId={this.props.eventNodeId}
               />
             </div>
-            {/* {this.state.isExpand ? (
-              <BlockChildren
-                loops={this.getLoops()}
-                layer={this.props.layer + 1}
-                groupLayer={this.props.groupLayer}
-                nestGroupLayer={0}
-                offspringInNestGroupLayer={this.props.nestGroupLayer}
-                extraGapGroupLayer={this.extraGapGroupLayer()}
-                parentBid={this.props.bid}
-                eventNodeId={this.props.eventNodeId}
-                visibleBlockIds={this.props.visibleBlockIds}
-              />
-            ) : null} */}
           </div>
         </div>
       </LazyLoad>

+ 83 - 47
coms/jenga/block/base/Block.jsx

@@ -9,7 +9,7 @@ import {
   getBidList
 } from 'stores/funcs/newEvent'
 import { dragPosition, dragUtils } from 'stores/funcs/event/dragUtils'
-import { CONTEXT_MENU_TYPE, EVENT_BLOCK_TYPE } from 'const/const'
+import { CONTEXT_MENU_TYPE, EVENT_BLOCK_TYPE, BLOCK_OP_TYPE } from 'const/const'
 
 export default class Block extends React.Component {
   constructor(props) {
@@ -96,7 +96,7 @@ export default class Block extends React.Component {
     }
     if (status.types.includes('toggleBlockProp')) {
       if (this.props.bid === status.data.affectBlockId) {
-        if (status.data.prop === 'enable') {
+        if (status.data.prop === 'skip') {
           let isEnable = this.isEnable()
           if (this.state.isEnable !== isEnable) {
             obj.isEnable = isEnable
@@ -133,18 +133,20 @@ export default class Block extends React.Component {
 
   isEnable(bid) {
     let _bid = bid || this.props.bid
+    let nodeId = this.props.eventNodeId
     let result = true
-    let block = getEventBlockByBid(_bid)
+    let block = getEventBlockByBid(_bid, nodeId)
     if (block) {
-      result = block.enable !== false
+      result = !block.skip
     }
     return result
   }
 
   isExpand(bid) {
     let _bid = bid || this.props.bid
+    let nodeId = this.props.eventNodeId
     let result = true
-    let block = getEventBlockByBid(_bid)
+    let block = getEventBlockByBid(_bid, nodeId)
     if (block) {
       result = block.expand !== false
     }
@@ -153,10 +155,29 @@ export default class Block extends React.Component {
 
   hasChildren(bid) {
     let _bid = bid || this.props.bid
+    let nodeId = this.props.eventNodeId
     let result = false
-    let block = getEventBlockByBid(_bid)
+    let block = getEventBlockByBid(_bid, nodeId)
     if (block) {
-      result = block.children && block.children.length > 0
+      if (block.eventId) {
+        result = block.ast && block.ast.args && block.ast.args.length > 0
+      } else {
+        switch (block.op) {
+          case BLOCK_OP_TYPE.IF:
+          case BLOCK_OP_TYPE.ELSE:
+          case BLOCK_OP_TYPE.FOR:
+          case BLOCK_OP_TYPE.WHILE:
+            result =
+              block.args &&
+              block.args[1] &&
+              block.args[1].args &&
+              block.args[1].args.length > 0
+            break
+          case BLOCK_OP_TYPE.BLOCK:
+            result = block.args && block.args.length > 0
+            break
+        }
+      }
     }
     return result
   }
@@ -169,36 +190,33 @@ export default class Block extends React.Component {
       newEventActions.selectEvent({ eventNodeId: this.props.eventNodeId })
     } else {
       // 多选
-      let isCtrl = e && (isMac ? e.metaKey : e.ctrlKey)
-      if (isCtrl) {
-        newEventActions.selectMultiBlocks({ blockId: this.props.bid })
-        return
-      }
-      let isShift = e && e.shiftKey
-      if (isShift) {
-        newEventActions.shiftSelectBlocks({ blockId: this.props.bid })
-        return
-      }
+      // let isCtrl = e && (isMac ? e.metaKey : e.ctrlKey)
+      // if (isCtrl) {
+      //   newEventActions.selectMultiBlocks({ blockId: this.props.bid })
+      //   return
+      // }
+      // let isShift = e && e.shiftKey
+      // if (isShift) {
+      //   newEventActions.shiftSelectBlocks({ blockId: this.props.bid })
+      //   return
+      // }
     }
     if (
       !this.state.isActive ||
-      (
-        this.multiBlockIds.length > 0 &&
-        (
-          !allowMulti ||
-          (
-            allowMulti &&
-            !this.multiBlockIds?.includes(this.props.bid)
-          )
-        )
-      )
+      (this.multiBlockIds.length > 0 &&
+        (!allowMulti ||
+          (allowMulti && !this.multiBlockIds?.includes(this.props.bid))))
     ) {
       newEventActions.selectBlock({ blockId: this.props.bid })
     }
   }
 
   onToggleBlockExpand() {
-    newEventActions.toggleBlockProp({ blockId: this.props.bid, prop: 'expand' })
+    newEventActions.toggleBlockProp({
+      nodeId: this.props.eventNodeId,
+      blockId: this.props.bid,
+      prop: 'expand'
+    })
   }
 
   getLineColor() {
@@ -218,14 +236,14 @@ export default class Block extends React.Component {
   getGroupColor() {
     const group = ['color1', 'color2', 'color3', 'color4', 'color5']
     // const group = ['#7F438F', '#E5C88E', '#EEB2B2', '#B5D8F1', '#CBFF97']
-    return group[(this.props.groupLayer) % 5]
+    return group[this.props.groupLayer % 5]
   }
 
   blockMainStyle() {
     if (this.props.groupLayer >= 1) {
       return {
         paddingLeft: `${(this.props.nestGroupLayer - 1) * 2}px`,
-        marginRight: `${(this.props.groupLayer) * 2}px`
+        marginRight: `${this.props.groupLayer * 2}px`
       }
     }
     return null
@@ -233,14 +251,18 @@ export default class Block extends React.Component {
 
   getLoops(bid) {
     let _bid = bid || this.props.bid
-    let block = getEventBlockByBid(_bid)
-    if (block && block.type === EVENT_BLOCK_TYPE.LOOP) {
+    let nodeId = this.props.eventNodeId
+    let block = getEventBlockByBid(_bid, nodeId)
+    if (
+      block &&
+      (block.op === BLOCK_OP_TYPE.FOR || block.op === BLOCK_OP_TYPE.WHILE)
+    ) {
       if (this.props.loops) {
         return JSON.stringify(
-          [].concat(JSON.parse(this.props.loops), [block.bid])
+          [].concat(JSON.parse(this.props.loops), [block.ln])
         )
       } else {
-        return JSON.stringify([block.bid])
+        return JSON.stringify([block.ln])
       }
     } else {
       return this.props.loops
@@ -248,17 +270,22 @@ export default class Block extends React.Component {
   }
 
   indexLeftStyle() {
-    // let _bid = this.props.bid
-    // let block = getEventBlockByBid(_bid)
-    // console.log(block?.type, this.props.offspringInNestGroupLayer, this.props.nestGroupLayer)
-    if (this.props.offspringInNestGroupLayer >= 2 && this.props.nestGroupLayer === 0) {
-      return { marginLeft: 20 + (this.props.offspringInNestGroupLayer - 1) * 2 + 'px' }
+    if (
+      this.props.offspringInNestGroupLayer >= 2 &&
+      this.props.nestGroupLayer === 0
+    ) {
+      return {
+        marginLeft: 20 + (this.props.offspringInNestGroupLayer - 1) * 2 + 'px'
+      }
     }
     return undefined
   }
 
   extraGapGroupLayer() {
-    if (this.props.offspringInNestGroupLayer >= 2 && this.props.nestGroupLayer === 0) {
+    if (
+      this.props.offspringInNestGroupLayer >= 2 &&
+      this.props.nestGroupLayer === 0
+    ) {
       return this.props.offspringInNestGroupLayer
     } else {
       return this.props.extraGapGroupLayer || 0
@@ -282,7 +309,8 @@ export default class Block extends React.Component {
 
   allowDrop(bid, position, multiInfo) {
     let result = false
-    let dragBlock = getEventBlockByBid(bid)
+    let nodeId = this.props.eventNodeId
+    let dragBlock = getEventBlockByBid(bid, nodeId)
     let targetBlock = getEventBlockByBid(this.props.bid)
     let dropBlock = undefined
     switch (position) {
@@ -294,7 +322,10 @@ export default class Block extends React.Component {
       case dragPosition.top:
         // 实际是放在targetBlock的父级
         if (targetBlock.parentBid) {
-          let targetParentBlock = getEventBlockByBid(targetBlock.parentBid)
+          let targetParentBlock = getEventBlockByBid(
+            targetBlock.parentBid,
+            nodeId
+          )
           if (targetParentBlock) {
             dropBlock = targetParentBlock
           } else {
@@ -308,7 +339,7 @@ export default class Block extends React.Component {
       let blockTypes = []
       multiInfo = filterBlocks(multiInfo)
       multiInfo.forEach(bid => {
-        let block = getEventBlockByBid(bid)
+        let block = getEventBlockByBid(bid, nodeId)
         if (block && block.type) {
           let type = block.type
           if (blockTypes.indexOf(type) === -1) {
@@ -392,13 +423,14 @@ export default class Block extends React.Component {
     } else if (deltaTop >= mid2 && deltaTop <= maxHeight) {
       position = dragPosition.bot
     }
-    let dropBlock = getEventBlockByBid(this.props.bid)
+    let nodeId = this.props.eventNodeId
+    let dropBlock = getEventBlockByBid(this.props.bid, nodeId)
     if (multiInfo && multiInfo.length > 0) {
       // 多个移动
       let blockTypes = []
       multiInfo = filterBlocks(multiInfo)
       multiInfo.forEach(bid => {
-        let block = getEventBlockByBid(bid)
+        let block = getEventBlockByBid(bid, nodeId)
         if (block && block.type) {
           blockTypes.push(block.type)
         }
@@ -413,7 +445,7 @@ export default class Block extends React.Component {
       }
     } else {
       // 单个移动
-      let dragBlock = getEventBlockByBid(dragBlockId)
+      let dragBlock = getEventBlockByBid(dragBlockId, nodeId)
       if (
         dropBlock &&
         dropBlock.type === EVENT_BLOCK_TYPE.ROOT &&
@@ -441,6 +473,7 @@ export default class Block extends React.Component {
       if (this.state.isExpand && this.state.hasChildren) {
         // 关闭起来
         newEventActions.toggleBlockProp({
+          nodeId: this.props.eventNodeId,
           blockId: this.props.bid,
           prop: 'expand',
           value: false,
@@ -459,6 +492,7 @@ export default class Block extends React.Component {
       // 对block的处理
       if (dragInfo) {
         newEventActions.toggleBlockProp({
+          nodeId: this.props.eventNodeId,
           blockId: dragInfo.bid,
           prop: 'expand',
           value: dragInfo.expand,
@@ -498,8 +532,9 @@ export default class Block extends React.Component {
         // console.log('包含自己。。。')
       } else {
         let blockTypes = []
+        let nodeId = this.props.eventNodeId
         multiInfo.forEach(bid => {
-          let block = getEventBlockByBid(bid)
+          let block = getEventBlockByBid(bid, nodeId)
           if (block && block.type) {
             let type = block.type
             if (blockTypes.indexOf(type) === -1) {
@@ -549,6 +584,7 @@ export default class Block extends React.Component {
     if (multiInfo.length === 0) {
       if (dragInfo) {
         newEventActions.toggleBlockProp({
+          nodeId: this.props.eventNodeId,
           blockId: dragInfo.bid,
           prop: 'expand',
           value: dragInfo.expand,

+ 57 - 93
coms/jenga/block/base/action/BlockActionMethod.jsx

@@ -22,7 +22,8 @@ import {
   getEventBlockByBid,
   getActionBlockObjNode,
   getBlockObj,
-  getBlockAciton
+  getBlockAciton,
+  getActionParamsArgs
 } from 'stores/funcs/newEvent'
 import {
   isAsyncDbMethod,
@@ -59,7 +60,6 @@ export default class BlockActionMethod extends React.Component {
       methods: this.getMethods(), // 可选动作
       actionName: this.getActionName(),
       isMini: this.getActionIsMini(),
-      // hasParams: this.getHasParams(),
       methodParams: this.getMethodParams(),
       paramsVisible: this.getParamsVisible(),
       delay: this.getDelay()
@@ -68,7 +68,6 @@ export default class BlockActionMethod extends React.Component {
     this.onEventChange = this.onEventChange.bind(this)
 
     // reload相关
-    // this.hasDiffParams = this.hasDiffParams.bind(this)
     // this.autoReloadSpecialAction = this.autoReloadSpecialAction.bind(this)
     this.onReloadAction = this.onReloadAction.bind(this) // 刷新
 
@@ -77,7 +76,7 @@ export default class BlockActionMethod extends React.Component {
 
     // 处理选择的method相关
     this.decorateAction = this.decorateAction.bind(this)
-    // this.combineOldAction = this.combineOldAction.bind(this)
+    this.combineOldAction = this.combineOldAction.bind(this)
 
     this.onMethodSelect = this.onMethodSelect.bind(this) // action的选择
     this.onToggleParamsVisible = this.onToggleParamsVisible.bind(this)
@@ -85,7 +84,6 @@ export default class BlockActionMethod extends React.Component {
     this.getObject = this.getObject.bind(this)
     this.getActionName = this.getActionName.bind(this)
     this.getActionIsMini = this.getActionIsMini.bind(this)
-    // this.getHasParams = this.getHasParams.bind(this)
     this.getMethodParams = this.getMethodParams.bind(this)
     this.getParamsVisible = this.getParamsVisible.bind(this)
     this.getDelay = this.getDelay.bind(this)
@@ -122,7 +120,6 @@ export default class BlockActionMethod extends React.Component {
           methods: this.getMethods(), // 可选动作
           actionName: this.getActionName(),
           isMini: this.getActionIsMini(),
-          // hasParams: this.getHasParams(),
           methodParams: this.getMethodParams(),
           paramsVisible: this.getParamsVisible(),
           delay: this.getDelay()
@@ -150,7 +147,6 @@ export default class BlockActionMethod extends React.Component {
         obj.methods = this.getMethods() // 可选动作
         obj.actionName = this.getActionName()
         obj.isMini = this.getActionIsMini()
-        // obj.hasParams = this.getHasParams()
         obj.methodParams = this.getMethodParams()
         obj.paramsVisible = this.getParamsVisible()
         obj.delay = this.getDelay()
@@ -453,7 +449,7 @@ export default class BlockActionMethod extends React.Component {
         if (params) {
           nAction.params = params
         }
-        // this.combineOldAction(nAction, keepVisible)
+        this.combineOldAction(nAction, keepVisible)
         asyncCb && asyncCb()
       })
     } else {
@@ -461,82 +457,64 @@ export default class BlockActionMethod extends React.Component {
       if (params && params.length > 0) {
         nAction.params = params
       }
-      // this.combineOldAction(nAction, keepVisible)
+      this.combineOldAction(nAction, keepVisible)
     }
   }
 
-  // combineOldAction(newAction, keepVisible) {
-  //   let block = getEventBlockByBid(this.props.bid)
-  //   if (block && block.action && block.action.name === newAction.name) {
-  //     if (keepVisible) {
-  //       newAction.visible = block.action.visible
-  //     }
-  //     // action信息
-  //     if (block.action.info) {
-  //       newAction.info = cpJson(block.action.info)
-  //     }
-  //     if (block.action.params && newAction.params) {
-  //       newAction.params.forEach(newParam => {
-  //         block.action.params.forEach(oldParam => {
-  //           if (
-  //             newParam.name === oldParam.name &&
-  //             newParam.type === oldParam.type
-  //           ) {
-  //             if (oldParam.pGroup) {
-  //               if (newParam.pGroup === oldParam.pGroup) {
-  //                 newParam.value = oldParam.value
-  //               }
-  //             } else {
-  //               // 是否是克隆对象的子对象
-  //               if (oldParam.type === propType.CloneChild) {
-  //                 let cloneIDParam = block.action.params[0]
-  //                 if (
-  //                   cloneIDParam &&
-  //                   cloneIDParam.name === 'cloneId' &&
-  //                   cloneIDParam.value
-  //                 ) {
-  //                   // 并非子对象则还原
-  //                   if (oldParam.value && oldParam.value.length > 0) {
-  //                     oldParam.value.forEach(idProp => {
-  //                       if (!nodeIsChild(cloneIDParam.value, idProp.id)) {
-  //                         idProp.id = null
-  //                         idProp.props = []
-  //                       }
-  //                     })
-  //                   }
-  //                 }
-  //               }
-  //               newParam.value = oldParam.value
-  //             }
-  //           }
-  //         })
-  //       })
-  //     }
-  //   }
-  // }
+  combineOldAction(newAction, keepVisible) {
+    let nodeId = this.props.eventNodeId || newEventStores.curEventNodeId
+    let block = getEventBlockByBid(this.props.bid, nodeId)
+    let oldActionName = getBlockAciton(block)
+    if (block && oldActionName && oldActionName === newAction.name) {
+      if (keepVisible) {
+        newAction.paramsVisible = block.paramsVisible
+      }
+      let oldParams = getActionParamsArgs(block)
+      if (oldParams && newAction.params) {
+        newAction.params.forEach(newParam => {
+          if (oldActionName === 'setProps') {
+            let targetParam = oldParams.find(oldParam => {
+              return oldParam.val === newParam.name
+            })
+            if (targetParam) {
+              if (targetParam.args && targetParam.args[0]) {
+                newParam.value =
+                  targetParam.args[0].op === 'var'
+                    ? targetParam.args[0].expVal
+                    : targetParam.args[0].val
+              }
+            }
+          } else {
+            let targetParam = oldParams.find(oldParam => {
+              return oldParam.key === newParam.name
+            })
+            if (targetParam) {
+              newParam.value =
+                targetParam.op === 'var' ? targetParam.expVal : targetParam.val
+            }
+          }
+        })
+      }
+    }
+  }
 
   onTriggerAction(nAction, addRecord) {
+    let nodeId = this.props.eventNodeId || newEventStores.curEventNodeId
+    newEventActions.updateBlockProp({
+      nodeId,
+      blockId: this.props.bid,
+      prop: 'action',
+      value: nAction,
+      trigger: true,
+      addRecord: addRecord === undefined ? true : addRecord
+    })
     // 选择后触发相关的界面改变
-    this.setState(
-      {
-        actionName: nAction.name,
-        isMini: nAction.mini,
-        // hasParams: !!(nAction.params && nAction.params.length > 0),
-        methodParams: cpJson(nAction.params) || [],
-        paramsVisible: nAction.paramsVisible
-      },
-      () => {
-        let nodeId = this.props.eventNodeId || newEventStores.curEventNodeId
-        newEventActions.updateBlockProp({
-          nodeId,
-          blockId: this.props.bid,
-          prop: 'action',
-          value: nAction,
-          trigger: true,
-          addRecord: addRecord === undefined ? true : addRecord
-        })
-      }
-    )
+    this.setState({
+      actionName: nAction.name,
+      isMini: nAction.mini,
+      methodParams: cpJson(nAction.params) || [],
+      paramsVisible: nAction.paramsVisible
+    })
   }
 
   onMethodSelect(option, keepVisible, targetMethod, addRecord) {
@@ -622,20 +600,6 @@ export default class BlockActionMethod extends React.Component {
     return result
   }
 
-  // getHasParams() {
-  //   let result = false
-  //   let block = getEventBlockByBid(this.props.bid)
-  //   if (
-  //     block &&
-  //     block.type === EVENT_BLOCK_TYPE.ACTION &&
-  //     block.action &&
-  //     block.action.params
-  //   ) {
-  //     result = block.action.params.length > 0
-  //   }
-  //   return result
-  // }
-
   getMethodParams() {
     let result = []
     let actionName = this.getActionName()
@@ -651,7 +615,7 @@ export default class BlockActionMethod extends React.Component {
             obj: this.obj,
             nodeId
           })
-          result = genParams(targetMethod, objNode, this.props.bid, true)
+          result = genParams(targetMethod, objNode, this.props.bid, true) || []
         }
       }
     }

+ 1294 - 0
coms/jenga/block/base/action/BlockActionMethodParamItem.jsx

@@ -0,0 +1,1294 @@
+import React from 'react'
+import cls from 'classnames'
+import i18n from 'i18next'
+import { Tooltip } from 'antd'
+import { is } from 'immutable'
+import newEventActions from 'actions/newEvent'
+import newEventStores from 'stores/newEvent'
+import widgetStore from 'stores/widget'
+import userStore from 'stores/user'
+import treeStores from 'stores/tree'
+import uiStore from 'stores/ui'
+import {
+  getActionBlockObjNode,
+  getEventBlockByBid,
+  layerWidth,
+  getBlockObj
+} from 'stores/funcs/newEvent'
+import { getNodeFromMap } from 'stores/funcs/tree'
+import { getDbHeaderName } from 'stores/funcs/db'
+import {
+  getCloneNode,
+  getDynamicParamName,
+  getModuleInstanceNameLocale,
+  smsTemplate
+} from 'stores/funcs/event/methodUtils'
+import {
+  nodeIsDbNormal,
+  nodeIsDbRouter,
+  nodeIsDbVoteCandidate,
+  nodeIsDynamoDb
+} from 'src/stores/funcs/nodeType'
+import { shallowEqualImmutable, cpJson } from 'utils/utils'
+import { prop2id } from 'utils/convertModName'
+import { isHySa } from 'utils/commons/ctrlHide'
+import {
+  getSpecialParamFormulaParams,
+  getParamsAffectArea
+} from 'src/components/common/formulaEditor/utils'
+import propType from 'const/propType'
+import { EVENT_BLOCK_TYPE, BLOCK_OP_TYPE } from 'src/const/const'
+import { consFormulaShow } from 'src/utils/commons/ctrlHide'
+// import {
+//   getActionDbNodeType,
+//   getActionDbId,
+//   getNode
+// } from './dbComs/actionDbFuncs'
+// import BlockSelect from 'src/components/common/select/BlockSelect'
+import BlockActionBoolean from 'src/components/common/event/normalComs/BlockActionBoolean'
+// import DbSearchRange from 'src/components/common/event/dbComs/DbSearchRange'
+// import BlockActionKeyValue from './normalComs/BlockActionKeyValue'
+// import KeyValueJson from './normalComs/KeyValueJson'
+// import BlockActionColRowValue from './normalComs/BlockActionColRowValue'
+// import BlockActionNormalCons from './normalComs/BlockActionNormalCons'
+// import BlockActionNormalOrders from './normalComs/BlockActionNormalOrders'
+// import BlockActionObjSelect from './normalComs/BlockActionObjSelect'
+// import BlockActionJsonParam from './normalComs/BlockActionJsonParam'
+// import BlockActionJsonParamMult from './normalComs/BlockActionJsonParamMult'
+// import DbConditionalSelector from './dbComs/DbConditionalSelector'
+// import DbOrderSelector from './dbComs/DbOrderSelector'
+// import DbNumColSelector from './dbComs/DbNumColSelector'
+// import DbUpdateSelector from './dbComs/DbUpdateSelector'
+// import DbColsSelector from './dbComs/DbColsSelector'
+// import DbGroupByCols from './dbComs/DbGroupByCols'
+// import DbGroupCols from './dbComs/DbGroupCols'
+// import BlockActionDbRange from './dbComs/DbRangeSelector'
+// import DyQueryCons from './dyComs/DyQueryCons'
+// import DyUpdate from './dyComs/DyUpdate'
+// import DyCons from './dyComs/DyCons'
+// import SubChildren from './subChildren/SubChildren'
+import FormulaEditor from 'src/components/common/formulaEditor/EventFormulaEditor'
+import EventJsonEditor from 'src/components/common/formulaEditor/EventJsonEditor'
+import iconStrObj from 'src/assets/icons/iconsStr'
+
+export default class BlockActionMethodParamItem extends React.Component {
+  constructor(props) {
+    super(props)
+    this.state = {
+      param: this.getParamItem(props.param),
+      value: this.getParamValue(),
+      widthDelta: uiStore.jengaViewWidthDelta
+    }
+
+    this.onEventChange = this.onEventChange.bind(this)
+    this.onUiChange = this.onUiChange.bind(this)
+    this.onChangeValue = this.onChangeValue.bind(this)
+    // this.getObject = this.getObject.bind(this)
+    this.getParamValue = this.getParamValue.bind(this)
+    this.getName = this.getName.bind(this)
+    this.getParamName = this.getParamName.bind(this)
+    this.getParamPropsMap = this.getParamPropsMap.bind(this)
+    this.getCloneNodeId = this.getCloneNodeId.bind(this)
+    this.getParamItem = this.getParamItem.bind(this)
+    this.getParamNameStyle = this.getParamNameStyle.bind(this)
+    this.getParamValueStyle = this.getParamValueStyle.bind(this)
+    this.getWholeParamStyle = this.getWholeParamStyle.bind(this)
+    this.paramValueCom = this.paramValueCom.bind(this)
+    this.getItemValueCom = this.getItemValueCom.bind(this)
+
+    this.getItemTips = this.getItemTips.bind(this)
+    this.getItemPlaceholder = this.getItemPlaceholder.bind(this)
+    // this.paramIsInDbSearch = this.paramIsInDbSearch.bind(this)
+
+    this.getOptionFonts = this.getOptionFonts.bind(this)
+    this.getOptionIcons = this.getOptionIcons.bind(this)
+  }
+
+  shouldComponentUpdate(nextProps, nextState) {
+    return (
+      !shallowEqualImmutable(this.props, nextProps) ||
+      !shallowEqualImmutable(this.state, nextState)
+    )
+  }
+
+  componentDidMount() {
+    this.unsubscribe = newEventStores.listen(this.onEventChange)
+    this.unsubscribeUI = uiStore.listen(this.onUiChange)
+  }
+
+  componentWillUnmount() {
+    this.unsubscribe()
+    this.unsubscribeUI()
+  }
+
+  componentDidUpdate(preProps) {
+    let param = this.getParamItem()
+    if (!is(this.state.param, param)) {
+      this.setState({
+        param: param
+      })
+    }
+  }
+
+  onEventChange(status) {
+    let obj = {}
+    if (status) {
+      if (
+        status.types.includes('changeActionBlockParamsValue') &&
+        this.props.bid === status.data.affectBlockId &&
+        status.data.index === this.props.index
+      ) {
+        let value = this.getParamValue()
+        if (!is(this.state.value, value)) {
+          obj.value = value
+        } else {
+          obj.value = { ...value }
+        }
+      }
+    }
+    if (Object.keys(obj).length > 0) {
+      this.setState(obj)
+    }
+  }
+
+  onUiChange(status) {
+    if (status && status.types) {
+      if (status.types.includes('changeJengaViewWidthDelta')) {
+        if (status.data.jengaViewWidthDelta !== this.state.widthDelta) {
+          this.setState({
+            widthDelta: status.data.jengaViewWidthDelta
+          })
+        }
+      }
+    }
+  }
+
+  getParamValue() {
+    // 获取param的值
+    let value = null
+    let eventNodeId = this.props.eventNodeId || newEventStores.curEventNodeId
+    let block = getEventBlockByBid(this.props.bid, eventNodeId)
+    let paramName = this.props.param.name
+    switch (block.op) {
+      case BLOCK_OP_TYPE.SET:
+        let args_set = block.args
+        let targetParam_set = args_set.find(item => {
+          return item.op === 'prop' && item.val === paramName
+        })
+        if (
+          targetParam_set &&
+          targetParam_set.args &&
+          targetParam_set.args[0]
+        ) {
+          let op = targetParam_set.args[0].op
+          value =
+            op === 'var'
+              ? targetParam_set.args[0].expVal
+              : targetParam_set.args[0].val
+        }
+        break
+      case BLOCK_OP_TYPE.CALL:
+        let args_call = block.args
+        let targetParam_call = args_call.find(item => {
+          return item.key === paramName
+        })
+        if (targetParam_call) {
+          let op = targetParam_call.op
+          value = op === 'var' ? targetParam_call.expVal : targetParam_call.val
+        }
+        break
+      case BLOCK_OP_TYPE.LET:
+        if (
+          block.args &&
+          block.args[0] &&
+          block.args[0].op === 'call' &&
+          block.args[0].args
+        ) {
+          let args_let = block.args[0].args
+          let targetParam_let = args_let.find(item => {
+            return item.key === paramName
+          })
+          if (targetParam_let) {
+            let op = targetParam_let.op
+            value = op === 'var' ? targetParam_let.expVal : targetParam_let.val
+          }
+        }
+        break
+    }
+    return value
+  }
+
+  onChangeValue(index, value, addRecord) {
+    let paramName = this.state.param.name
+    let actionName = this.getName()
+    let reloadMethod = false
+    // 引起参数变化
+    if (
+      (actionName === 'clone' && paramName === 'cloneId' && index === 0) ||
+      (['sendSMS', 'sendSMS_stage'].indexOf(actionName) >= 0 &&
+        paramName === 'template' &&
+        index === 1) ||
+      (['sendTemplate'].indexOf(actionName) >= 0 && paramName === 'mode') ||
+      (['shareApp'].indexOf(actionName >= 0) && paramName === 'type') ||
+      (['toDataURL'].indexOf(actionName) >= 0 && paramName === 'imgType') ||
+      (['browsePic', 'browseMutiPic'].indexOf(actionName) >= 0 &&
+        paramName === 'outputBase64') ||
+      (['createPayInfo', 'refund', 'orderquery'].indexOf(actionName) >= 0 &&
+        paramName === 'mode')
+    ) {
+      reloadMethod = true
+    }
+    let obj = {
+      nodeId: this.props.eventNodeId || newEventStores.curEventNodeId,
+      blockId: this.props.bid,
+      index,
+      paramName,
+      value,
+      reloadMethod
+    }
+    this.setState({
+      value: value
+    })
+    this.forceUpdate()
+    newEventActions.changeActionParamValue(obj)
+  }
+
+  // getObject() {
+  //   let _obj = null
+  //   let block = getEventBlockByBid(this.props.bid)
+  //   if (block) {
+  //     _obj = block.object
+  //   }
+  //   return _obj
+  // }
+
+  getName() {
+    return this.props.actionName ? this.props.actionName || null : null
+  }
+
+  getParamName() {
+    let name = this.state.param.name
+    let locale = this.state.param.locale
+    let isDbHeader = this.state.param.isDbHeader
+    let isMini = this.state.param.mini
+    let isProp = this.state.param.isProp
+    let actionName = this.getName()
+    let nodeId = this.props.eventNodeId || newEventStores.curEventNodeId
+    let block = getEventBlockByBid(this.props.bid, nodeId)
+    let obj = getBlockObj({ block })
+    if (block && obj && actionName) {
+      let node = getActionBlockObjNode({
+        obj,
+        nodeId
+      })
+      if (node) {
+        if (isMini) {
+          name = getModuleInstanceNameLocale({
+            nodeId: node.id,
+            type: 'props',
+            name: prop2id(name)
+          })
+        // } else if (actionName === 'clone' && this.props.index >= 3) {
+        //   let cloneNode = getCloneNode(this.props.bid)
+        //   if (cloneNode) {
+        //     let propsMap =
+        //       widgetStore.widget[cloneNode.type] &&
+        //       widgetStore.widget[cloneNode.type].map &&
+        //       widgetStore.widget[cloneNode.type].map.propsMap
+        //     if (propsMap && propsMap[name] && propsMap[name].locale) {
+        //       name = propsMap[name].locale[i18n.language]
+        //     }
+        //   }
+        // } else if (
+        //   ['sendSMS', 'sendSMS_stage'].indexOf(actionName) >= 0 &&
+        //   this.props.index >= 2
+        // ) {
+        //   if (block.action && block.action.params && block.action.params[1]) {
+        //     let tempInfo = smsTemplate[block.action.params[1].value]
+        //     if (tempInfo && tempInfo.args) {
+        //       let param = tempInfo.args.find(arg => {
+        //         return arg.name === name
+        //       })
+        //       if (param && param.locale) {
+        //         name = param.locale[i18n.language]
+        //       }
+        //     }
+        //   }
+        } else if (actionName === 'setProps' || isProp) {
+          let propsMap =
+            widgetStore.widget[node.type] &&
+            widgetStore.widget[node.type].map &&
+            widgetStore.widget[node.type].map.propsMap
+          if (propsMap && propsMap[name] && propsMap[name].locale) {
+            name = propsMap[name].locale[i18n.language]
+          }
+        // } else if (isDbHeader) {
+        //   let actionDbNodeType = getActionDbNodeType({
+        //     node,
+        //     bid: this.props.bid
+        //   })
+        //   if (nodeIsDynamoDb(actionDbNodeType)) {
+        //     let dbInfo = this.props.dbInfo
+        //     let dbCols = dbInfo ? dbInfo.dbCols || [] : undefined
+        //     if (dbCols) {
+        //       let item = dbCols.find(col => {
+        //         return col.name === name
+        //       })
+        //       if (item) {
+        //         if (isDbHeader === 'internal') {
+        //           let header = { name: name, internal: true }
+        //           let transName =
+        //             'DbView.dyHeader.' +
+        //             getDbHeaderName(header, actionDbNodeType)
+        //           if (i18n.exists(transName)) {
+        //             name = item.alias
+        //               ? item.alias +
+        //                 i18n.t('DbParamPanel.left_bracket') +
+        //                 i18n.t(transName) +
+        //                 i18n.t('DbParamPanel.right_bracket')
+        //               : i18n.t(transName)
+        //           }
+        //         } else {
+        //           name = item.alias
+        //         }
+        //       }
+        //     }
+        //   } else {
+        //     if (isDbHeader === 'internal') {
+        //       let header = { name: name, internal: true }
+        //       let transName =
+        //         'DbView.header.' + getDbHeaderName(header, actionDbNodeType)
+        //       if (i18n.exists(transName)) {
+        //         name = i18n.t(transName)
+        //       }
+        //     } else if (locale) {
+        //       name = locale[i18n.language] || name
+        //     }
+        //   }
+        } else {
+          if (['setObjTransition', 'tweenTo'].indexOf(actionName) >= 0) {
+            let propsMap =
+              widgetStore.widget[node.type] &&
+              widgetStore.widget[node.type].map &&
+              widgetStore.widget[node.type].map.propsMap
+            if (propsMap && propsMap[name] && propsMap[name].locale) {
+              name = propsMap[name].locale[i18n.language]
+            }
+          }
+          let actionsMap =
+            widgetStore.widget[node.type] &&
+            widgetStore.widget[node.type].map &&
+            widgetStore.widget[node.type].map.methodsMap
+          if (
+            actionsMap &&
+            actionsMap[actionName] &&
+            actionsMap[actionName].params
+          ) {
+            let params = actionsMap[actionName].params
+            // 由于tweenTo在原方法修改,故在不修改方法的前提下处理,只取最后2个参数
+            if (actionName === 'tweenTo' && params.length >= 2) {
+              params = [params[params.length - 2], params[params.length - 1]]
+            }
+            let param = params.find(param => {
+              return param.name === name
+            })
+            if (param && param.locale) {
+              name = param.locale[i18n.language] || name
+            }
+            // if (nodeIsDynamoDb(node.type)) {
+            //   let dbInfo = this.props.dbInfo
+            //   let dbCols = dbInfo ? dbInfo.dbCols || [] : undefined
+            //   name = getDynamicParamName(
+            //     node.type,
+            //     dbCols,
+            //     actionName,
+            //     this.state.param.name,
+            //     name
+            //   )
+            // }
+          }
+        }
+      }
+    }
+    return name
+  }
+
+  getParamPropsMap() {
+    let paramName = this.state.param.name
+    let isProp = this.state.param.isProp
+    let actionName = this.getName()
+
+    let nodeId = this.props.eventNodeId || newEventStores.curEventNodeId
+    let block = getEventBlockByBid(this.props.bid, nodeId)
+    let obj = getBlockObj({ block })
+    if (block && obj && actionName) {
+      let node = getActionBlockObjNode({
+        obj,
+        nodeId
+      })
+      if (node) {
+        if (actionName === 'setProps' || isProp) {
+          let propsMap =
+            widgetStore.widget[node.type] &&
+            widgetStore.widget[node.type].map &&
+            widgetStore.widget[node.type].map.propsMap
+          return propsMap[paramName]
+        } else {
+          let actionsMap =
+            widgetStore.widget[node.type] &&
+            widgetStore.widget[node.type].map &&
+            widgetStore.widget[node.type].map.methodsMap
+          if (
+            actionsMap &&
+            actionsMap[actionName] &&
+            actionsMap[actionName].params
+          ) {
+            let params = actionsMap[actionName].params
+            return params.find(param => {
+              return param.name === paramName
+            })
+          }
+        }
+      }
+    }
+  }
+
+  getCloneNodeId() {
+    let node = getCloneNode(this.props.bid)
+    if (node) {
+      return node.id
+    }
+    return undefined
+  }
+
+  getParamItem(param) {
+    return param !== undefined ? param : this.props.param
+  }
+
+  getParamNameStyle() {
+    const groupLayer = this.props.groupLayer > 0 ? this.props.groupLayer : 0
+    const nestingLayer =
+      this.props.nestGroupLayer > 0 ? this.props.nestGroupLayer - 1 : 0
+    const extraGapGroupLayer =
+      this.props.extraGapGroupLayer > 0
+        ? (this.props.extraGapGroupLayer - 1) * 2
+        : 0
+    const originWidth =
+      324 - (groupLayer + nestingLayer) * 2 - extraGapGroupLayer
+    let width = layerWidth({
+      originWidth: originWidth,
+      decreaseFactor: 21,
+      layer: this.props.layer
+    })
+    return {
+      width: width + 'px',
+      minWidth: width + 'px'
+    }
+  }
+
+  getParamValueStyle() {
+    return {
+      width: 275 + this.state.widthDelta + 'px'
+    }
+  }
+
+  getWholeParamStyle() {
+    let width = layerWidth({
+      originWidth: 608 + this.state.widthDelta,
+      decreaseFactor: 21,
+      layer: this.props.layer
+    })
+    return {
+      width: width + 'px',
+      minWidth: width + 'px'
+    }
+  }
+
+  // paramIsInDbSearch() {
+  //   let result = false
+  //   let node = getNode({ bid: this.props.bid, actionName: this.getName() })
+  //   if (
+  //     node &&
+  //     (nodeIsDbNormal(node.type) ||
+  //       nodeIsDbRouter(node.type) ||
+  //       nodeIsDbVoteCandidate(node.type))
+  //   ) {
+  //     let block = getEventBlockByBid(this.props.bid)
+  //     if (
+  //       block &&
+  //       block.object &&
+  //       block.type === EVENT_BLOCK_TYPE.ACTION &&
+  //       block.action &&
+  //       [
+  //         'dbSmartSearch_stage',
+  //         'dbSmartSearch',
+  //         'dbCustomizeSearch_stage',
+  //         'dbCustomizeSearch'
+  //       ].indexOf(block.action.name) >= 0
+  //     ) {
+  //       result = true
+  //     }
+  //   }
+  //   return result
+  // }
+
+  paramIsPath() {
+    let result = false
+    let eventNodeId = this.props.eventNodeId || newEventStores.curEventNodeId
+    let block = getEventBlockByBid(this.props.bid, eventNodeId)
+    let obj = getBlockObj({ block })
+    let actionName = this.getName()
+    if (
+      block &&
+      obj &&
+      actionName &&
+      ['setCusPathValue'].indexOf(actionName) >= 0 &&
+      this.state.param &&
+      this.state.param.name === 'path'
+    ) {
+      result = true
+    }
+    return result
+  }
+
+  paramIsAsync() {
+    let result = false
+    let eventNodeId = this.props.eventNodeId || newEventStores.curEventNodeId
+    let block = getEventBlockByBid(this.props.bid, eventNodeId)
+    let obj = getBlockObj({ block })
+    let actionName = this.getName()
+    if (
+      block &&
+      obj &&
+      actionName &&
+      ['setLog'].indexOf(actionName) >= 0 &&
+      this.state.param &&
+      this.state.param.name === 'topic'
+    ) {
+      result = 'serviceTopic'
+    }
+    return result
+  }
+
+  paramIsBlock(widgetName, actionName, paramName) {
+    let result = false
+    if (widgetName && actionName && paramName) {
+      let widgets = widgetStore.widget
+      if (
+        widgets &&
+        widgets[widgetName] &&
+        widgets[widgetName].map &&
+        widgets[widgetName].map.methodsMap &&
+        widgets[widgetName].map.methodsMap[actionName] &&
+        widgets[widgetName].map.methodsMap[actionName].params
+      ) {
+        let params = widgets[widgetName].map.methodsMap[actionName].params
+        let param = params.find(param => param.name === paramName)
+        if (param) {
+          if (param.isBlock) {
+            result = true
+          }
+        }
+      }
+    }
+    return result
+  }
+
+  getOptionFonts(propsMap) {
+    let options = []
+    let optionLocales = {}
+    let addedOptions = {}
+    if (userStore.fontsList) {
+      userStore.fontsList.forEach(fontItem => {
+        let font = fontItem.font || fontItem.url
+        if (!addedOptions[font]) {
+          options.push(font)
+          optionLocales[font] = {
+            zh: fontItem.name,
+            en: fontItem.name
+          }
+        }
+        addedOptions[font] = true
+      })
+    }
+    if (propsMap && propsMap.hasDefaultOptions) {
+      // 添加默认
+      options = options.concat(propsMap.options)
+      optionLocales = Object.assign(optionLocales, propsMap.optionLocales)
+    }
+    return { options, optionLocales }
+  }
+
+  getOptionIcons(propsMap) {
+    let options = []
+    let optionLocales = {}
+    let addedOptions = {}
+    if (userStore.iconsList) {
+      userStore.iconsList.forEach(fontItem => {
+        if (!addedOptions[fontItem.url]) {
+          options.push(fontItem.url)
+          optionLocales[fontItem.url] = {
+            zh: fontItem.name,
+            en: fontItem.name
+          }
+        }
+        addedOptions[fontItem.url] = true
+      })
+    }
+    // 默认图标
+    if (userStore.defaultIcons) {
+      userStore.defaultIcons.forEach(fontItem => {
+        options.push(fontItem.url)
+        optionLocales[fontItem.url] = {
+          zh: fontItem.name,
+          en: fontItem.name
+        }
+      })
+    }
+    // 添加默认
+    // options = options.concat(propsMap.options)
+    // optionLocales = Object.assign(optionLocales, propsMap.optionLocales)
+    return { options, optionLocales }
+  }
+
+  paramValueCom(propsMap) {
+    let type = this.state.param.type
+    let index = this.props.index
+    let eventNodeId = this.props.eventNodeId || newEventStores.curEventNodeId
+    let block = getEventBlockByBid(this.props.bid, eventNodeId)
+    let obj = getBlockObj({ block })
+    let node = getActionBlockObjNode({ obj, eventNodeId })
+    let actionName = this.getName()
+    // let _dbId = node ? getActionDbId({ node, bid: this.props.bid }) : undefined
+    // let dbInfo = this.props.dbInfo
+    // let dbId = dbInfo
+    //   ? dbInfo.dbId
+    //   : getActionDbId({ node, bid: this.props.bid })
+    // let nodeType = dbInfo
+    //   ? dbInfo.dbNodeType
+    //   : getActionDbNodeType({ node, bid: this.props.bid })
+    // let dbCols = dbInfo ? dbInfo.dbCols || [] : undefined
+    // if (_dbId !== dbId) {
+    //   dbId = undefined // 与当前action不符合的dbid不传入组件(避免覆盖问题)
+    //   dbCols = undefined
+    // }
+    let com = undefined
+    let paramName = this.state.param.name
+    let value = this.state.value
+    switch (type) {
+      // 百分比也用formula处理
+      case propType.Formula:
+      case propType.FormulaColor:
+        // 部分特殊参数注入公式的params
+        let formulaParams = getSpecialParamFormulaParams({
+          paramName,
+          isNewEvent: true,
+          objNode: node,
+          actionName
+        })
+        let placeholder = this.getItemPlaceholder(propsMap)
+        if (
+          ['esInsert', 'esInsert_stage'].indexOf(actionName) >= 0 &&
+          paramName === '_id'
+        ) {
+          placeholder = i18n.t(
+            'EventView.jenga_action_block.insert_id_placeholder'
+          )
+        }
+        let hasColorPicker = type === propType.FormulaColor
+        let paramIsPath = this.paramIsPath()
+        let paramIsAsync = this.paramIsAsync()
+        let widgetName = node ? node.type : ''
+        let paramIsBlock = this.paramIsBlock(widgetName, actionName, paramName)
+        if (!paramIsBlock) {
+          com = (
+            <FormulaEditor
+              className="action-formula-editor"
+              bid={this.props.bid}
+              uid={this.props.bid}
+              paramName={paramName}
+              hasColorPicker={hasColorPicker}
+              value={value}
+              placeholder={placeholder}
+              params={formulaParams}
+              isPath={paramIsPath}
+              paramIsAsync={paramIsAsync}
+              onChangeCode={this.onChangeValue.bind(this, index)}
+              hasCons={consFormulaShow()}
+            />
+          )
+        } else {
+          com = (
+            <EventJsonEditor
+              height="200px"
+              className="action-formula-editor"
+              bid={this.props.bid}
+              uid={this.props.bid}
+              value={value}
+              placeholder={placeholder}
+              params={formulaParams}
+              onChangeCode={this.onChangeValue.bind(this, index)}
+              isBlock={paramIsBlock}
+            />
+          )
+        }
+        break
+      case propType.FormulaJson:
+        // 部分特殊参数注入公式的params
+        let fEditorParams = getSpecialParamFormulaParams({
+          paramName,
+          isNewEvent: true,
+          objNode: node,
+          actionName
+        })
+        let jsonPlaceholder = this.getItemPlaceholder(propsMap)
+        com = (
+          <EventJsonEditor
+            className="action-formula-editor"
+            bid={this.props.bid}
+            uid={this.props.bid}
+            value={value}
+            placeholder={jsonPlaceholder}
+            params={fEditorParams}
+            onChangeCode={this.onChangeValue.bind(this, index)}
+          />
+        )
+        break
+      case propType.Boolean:
+        com = (
+          <BlockActionBoolean
+            className="action-block-action"
+            type="boolean"
+            bid={this.props.bid}
+            uid={this.props.bid}
+            value={value}
+            noDefault={this.state.param.noDefault}
+            onChange={this.onChangeValue.bind(this, index)}
+          />
+        )
+        break
+      // case propType.Select:
+      // case propType.SelectUpload:
+      // case propType.FontSelect:
+      // case propType.IconSelect:
+      //   let groups = propsMap && propsMap.optionGroup
+      //   let options = propsMap && propsMap.options
+      //   let optionsLocales = propsMap && propsMap.optionLocales
+      //   if (propsMap && type === propType.FontSelect) {
+      //     let temp = this.getOptionFonts(propsMap)
+      //     options = temp.options
+      //     optionsLocales = temp.optionLocales
+      //   } else if (propsMap && type === propType.IconSelect) {
+      //     let temp = this.getOptionIcons(propsMap)
+      //     options = temp.options
+      //     optionsLocales = temp.optionLocales
+      //   }
+      //   com = propsMap && (
+      //     <BlockSelect
+      //       className="action-block-select"
+      //       type="select"
+      //       value={value}
+      //       isMultiple={!!propsMap.isMultiple}
+      //       placeholder={propsMap.placeholder}
+      //       optionsInfo={{
+      //         optionsGroup: groups,
+      //         options: options,
+      //         optionLocales: optionsLocales
+      //       }}
+      //       onChange={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.MultiKeyValue:
+      // case propType.MultiPureKeyValue:
+      // case propType.MultiValue:
+      //   com = (
+      //     <BlockActionKeyValue
+      //       className="action-key-value-group"
+      //       type={type}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       value={value}
+      //       onChangeValue={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.KeyValueJson:
+      //   let kvPlaceholder = this.getItemPlaceholder(propsMap)
+      //   com = (
+      //     <KeyValueJson
+      //       keyValueClassName="action-key-value-group"
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       placeholder={kvPlaceholder}
+      //       value={value}
+      //       onChange={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.ArrColValue:
+      // case propType.ArrMultiValue:
+      //   let arrParams = getSpecialParamFormulaParams({
+      //     paramName,
+      //     isNewEvent: true,
+      //     objNode: node,
+      //     actionName
+      //   })
+      //   let affectArea = getParamsAffectArea({
+      //     node,
+      //     actionName
+      //   })
+      //   com = (
+      //     <BlockActionColRowValue
+      //       className="action-col-row-value-group"
+      //       type={type}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       value={value}
+      //       params={arrParams}
+      //       paramsValid={affectArea}
+      //       visible={this.props.visible}
+      //       onChangeValue={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.NormalCons:
+      //   com = (
+      //     <BlockActionNormalCons
+      //       className="action-normal-cons-group"
+      //       type={type}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       value={value}
+      //       onChangeValue={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.NormalUpdates:
+      //   com = (
+      //     <DbUpdateSelector
+      //       value={value}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       type={'normal'}
+      //       onChange={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.NormalOrders:
+      //   com = (
+      //     <BlockActionNormalOrders
+      //       className="action-normal-orders-group"
+      //       type={type}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       value={value}
+      //       onChangeValue={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.DbRange:
+      //   com = (
+      //     <BlockActionDbRange
+      //       className="action-db-range-group"
+      //       type={type}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       value={value}
+      //       onChangeValue={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.DbCons:
+      //   com = (
+      //     <DbConditionalSelector
+      //       value={value}
+      //       dbId={dbId}
+      //       nodeType={nodeType}
+      //       dbCols={dbCols}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       isDbSearch={this.paramIsInDbSearch()}
+      //       onChange={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.DbOrders:
+      //   com = (
+      //     <DbOrderSelector
+      //       value={value}
+      //       dbId={dbId}
+      //       nodeType={nodeType}
+      //       dbCols={dbCols}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       isDbSearch={this.paramIsInDbSearch()}
+      //       onChange={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.DbNumCol:
+      //   com = (
+      //     <DbNumColSelector
+      //       value={value}
+      //       dbId={dbId}
+      //       dbCols={dbCols}
+      //       nodeType={nodeType}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       onChange={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.DbUpdate:
+      //   com = (
+      //     <DbUpdateSelector
+      //       value={value}
+      //       dbId={dbId}
+      //       dbCols={dbCols}
+      //       nodeType={nodeType}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       onChange={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.ObjSelect:
+      // case propType.ObjResult:
+      // case propType.ObjSelectCb:
+      //   let allowTypes = true
+      //   let childOnly = false
+      //   if (propsMap) {
+      //     allowTypes =
+      //       propsMap.allowTypes !== undefined ? propsMap.allowTypes : true
+      //     childOnly =
+      //       propsMap.childOnly !== undefined ? propsMap.childOnly : childOnly
+      //   }
+      //   com = (
+      //     <BlockActionObjSelect
+      //       className="action-obj-select-group"
+      //       type={type}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       value={value}
+      //       allowTypes={allowTypes}
+      //       childOnly={childOnly}
+      //       onChangeValue={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.ObjJsonParamsSelect:
+      //   com = (
+      //     <BlockActionJsonParam
+      //       bid={this.props.bid}
+      //       value={value}
+      //       onChangeValue={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.ObjJsonMultiPaths:
+      //   com = (
+      //     <BlockActionJsonParamMult
+      //       bid={this.props.bid}
+      //       value={value}
+      //       onChangeValue={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.JsonEditor:
+      //   // 部分特殊参数注入公式的params
+      //   let editorParams = getSpecialParamFormulaParams({
+      //     paramName,
+      //     isNewEvent: true,
+      //     objNode: node,
+      //     actionName
+      //   })
+      //   let jsonEditorPlaceholder = undefined
+      //   if (this.state.param.isApiHeader || this.state.param.isApiBody) {
+      //     let phOptions = {
+      //       zh: "例如:{'name0':'value1','name1':'value2'}",
+      //       en: "Ex: {'name0':'value1','name1':'value2'}"
+      //     }
+      //     jsonEditorPlaceholder = phOptions[i18n.language]
+      //   } else {
+      //     jsonEditorPlaceholder = this.getItemPlaceholder(propsMap)
+      //   }
+      //   com = (
+      //     <div className="item-value" style={this.getWholeParamStyle()}>
+      //       <EventJsonEditor
+      //         className="action-formula-editor"
+      //         bid={this.props.bid}
+      //         uid={this.props.bid}
+      //         value={value}
+      //         params={editorParams}
+      //         placeholder={jsonEditorPlaceholder}
+      //         onChangeCode={this.onChangeValue.bind(this, index)}
+      //       />
+      //     </div>
+      //   )
+      //   break
+      // case propType.CloneChild:
+      //   let styles = {
+      //     name: this.getParamNameStyle(),
+      //     value: this.getParamValueStyle()
+      //   }
+      //   com = (
+      //     <SubChildren
+      //       cloneId={this.getCloneNodeId()}
+      //       index={index}
+      //       value={value}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       propStyles={styles}
+      //     />
+      //   )
+      //   break
+      // case propType.DbCols:
+      //   let dbColsPlaceholder = this.getItemPlaceholder(propsMap)
+      //   let params = getSpecialParamFormulaParams({
+      //     paramName,
+      //     isNewEvent: true,
+      //     objNode: node,
+      //     actionName
+      //   })
+      //   com = (
+      //     <DbColsSelector
+      //       value={value}
+      //       dbId={dbId}
+      //       nodeType={nodeType}
+      //       dbCols={dbCols}
+      //       params={params}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       placeholder={dbColsPlaceholder}
+      //       onChange={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.DbSearchRange:
+      //   let searchRangePlaceholder = this.getItemPlaceholder(propsMap)
+      //   let rangeParams = getSpecialParamFormulaParams({
+      //     paramName,
+      //     isNewEvent: true,
+      //     objNode: node,
+      //     actionName
+      //   })
+      //   com = (
+      //     <DbSearchRange
+      //       value={value}
+      //       dbId={dbId}
+      //       nodeType={nodeType}
+      //       dbCols={dbCols}
+      //       params={rangeParams}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       placeholder={searchRangePlaceholder}
+      //       isDbSearch={this.paramIsInDbSearch()}
+      //       onChange={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.DbGroupByCols:
+      //   com = (
+      //     <DbGroupByCols
+      //       value={value}
+      //       dbId={dbId}
+      //       nodeType={nodeType}
+      //       dbCols={dbCols}
+      //       onChange={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.DbGroupCols:
+      // case propType.DbSelectCols:
+      //   com = (
+      //     <DbGroupCols
+      //       value={value}
+      //       dbId={dbId}
+      //       nodeType={nodeType}
+      //       dbCols={dbCols}
+      //       onChange={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.DyQueryCons:
+      //   let dyStyles = {
+      //     name: this.getParamNameStyle(),
+      //     value: this.getParamValueStyle()
+      //   }
+      //   let tips = propsMap && propsMap.desc && propsMap.desc[i18n.language]
+      //   com = (
+      //     <DyQueryCons
+      //       value={value}
+      //       dbId={dbId}
+      //       nodeType={nodeType}
+      //       dbCols={dbCols}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       paramStyle={this.props.paramStyle}
+      //       paramClass={this.props.paramClass}
+      //       tips={tips}
+      //       styles={dyStyles}
+      //       onChange={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.DyUpdate:
+      //   com = (
+      //     <DyUpdate
+      //       value={value}
+      //       dbId={dbId}
+      //       dbCols={dbCols}
+      //       nodeType={nodeType}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       onChange={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      // case propType.DyCons:
+      //   com = (
+      //     <DyCons
+      //       value={value}
+      //       dbId={dbId}
+      //       nodeType={nodeType}
+      //       dbCols={dbCols}
+      //       bid={this.props.bid}
+      //       uid={this.props.bid}
+      //       onChange={this.onChangeValue.bind(this, index)}
+      //     />
+      //   )
+      //   break
+      default:
+        // com = <div className="f--hlc">UNDEFINED-TODO</div>
+        // 暂时默认用FormulaEditor
+        let _formulaParams = getSpecialParamFormulaParams({
+          paramName,
+          isNewEvent: true,
+          objNode: node,
+          actionName
+        })
+        let _placeholder = this.getItemPlaceholder(propsMap)
+        let _widgetName = node ? node.type : ''
+        com = (
+          <FormulaEditor
+            className="action-formula-editor"
+            bid={this.props.bid}
+            uid={this.props.bid}
+            paramName={paramName}
+            value={value}
+            placeholder={_placeholder}
+            params={_formulaParams}
+            onChangeCode={this.onChangeValue.bind(this, index)}
+          />
+        )
+    }
+    return com
+  }
+
+  getItemValueCom(propsMap) {
+    return (
+      <div className="item-value" style={this.getParamValueStyle()}>
+        {this.paramValueCom(propsMap)}
+      </div>
+    )
+  }
+
+  getItemTips(propsMap) {
+    if (!isHySa() && propsMap && propsMap.desc) {
+      let tips = propsMap.desc[i18n.language]
+      let eventView = document.querySelector('.event-view')
+      return (
+        <Tooltip
+          title={tips}
+          arrowPointAtCenter={true}
+          placement="right"
+          overlayClassName="param-tips-tooltip"
+          getPopupContainer={() => eventView}
+        >
+          <span
+            className="param-tips"
+            dangerouslySetInnerHTML={{ __html: iconStrObj.help }}
+          />
+        </Tooltip>
+      )
+    }
+    return null
+  }
+
+  getItemPlaceholder(propsMap) {
+    let placeholder = undefined
+    if (propsMap && propsMap.placeholder) {
+      placeholder =
+        typeof propsMap.placeholder === 'string'
+          ? propsMap.placeholder
+          : propsMap.placeholder[i18n.language]
+    }
+    return placeholder
+  }
+
+  render() {
+    let propsMap = this.getParamPropsMap()
+    // 处理小模块中的文本变量公共数据,当类型为select时需另外获取propsMap
+    if (
+      this.state.param.type === 'Select' &&
+      this.state.param.mini &&
+      !propsMap
+    ) {
+      let nodeId = this.eventNodeId || newEventStores.curEventNodeId
+      let block = getEventBlockByBid(this.props.bid, nodeId)
+      let obj = getBlockObj({ block })
+      if (block && obj) {
+        let node = getActionBlockObjNode({
+          obj,
+          nodeId
+        })
+        if (node && node.props && node.props.classId) {
+          let classId = node.props.classId
+          const nodeInfo = getNodeFromMap({
+            nodeId: this.state.param.name.split('_')[1],
+            caseId: treeStores.curCaseId,
+            classId
+          })
+          if (nodeInfo) {
+            propsMap = {
+              options: nodeInfo.props.options.split(',')
+            }
+          }
+        }
+      }
+    }
+    // method的param的map的hideKeep控制参数显隐,运行时该参数仍会传入方法中
+    // 在需要改动方法参数的需求中,可在需要隐藏的param加上hideKeep:true,
+    // 则参数不会显示在编辑界面中,运行时候仍会传入方法中,保持新旧项目中同一方法参数和表现一致
+    if (propsMap && propsMap.hideKeep) {
+      return null
+    }
+    // 在group内隐藏
+    // if (this.state.param && this.state.param.pGroupHide) {
+    //   return null
+    // }
+    return this.state.param &&
+      [propType.CloneChild, propType.JsonEditor, propType.DyQueryCons].indexOf(
+        this.state.param.type
+      ) >= 0 ? (
+      this.paramValueCom()
+    ) : this.state.param.type !== propType.Hidden ? (
+      <div
+        className={cls('param-item f--h', this.props.paramClass)}
+        style={this.props.paramStyle}
+      >
+        <div
+          className="item-name f--hlc"
+          title={this.getParamName()}
+          style={this.getParamNameStyle()}
+        >
+          {this.getParamName()}
+          {this.getItemTips(propsMap)}
+        </div>
+        <div className="item-equal">=</div>
+        {this.getItemValueCom(propsMap)}
+      </div>
+    ) : null
+  }
+}