/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackJsonp_bos-platform"] = self["webpackJsonp_bos-platform"] || []).push([[4448],{

/***/ "./src/component/web/KDEntityDesigner/KDEntityDesigner.jsx":
/*!*****************************************************************!*\
  !*** ./src/component/web/KDEntityDesigner/KDEntityDesigner.jsx ***!
  \*****************************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";
eval("\n\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n__webpack_require__(/*! core-js/modules/es.symbol.js */ \"../../node_modules/core-js/modules/es.symbol.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.description.js */ \"../../node_modules/core-js/modules/es.symbol.description.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.iterator.js */ \"../../node_modules/core-js/modules/es.symbol.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.symbol.to-primitive.js */ \"../../node_modules/core-js/modules/es.symbol.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.array.from.js */ \"../../node_modules/core-js/modules/es.array.from.js\");\n__webpack_require__(/*! core-js/modules/es.array.index-of.js */ \"../../node_modules/core-js/modules/es.array.index-of.js\");\n__webpack_require__(/*! core-js/modules/es.array.slice.js */ \"../../node_modules/core-js/modules/es.array.slice.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-primitive.js */ \"../../node_modules/core-js/modules/es.date.to-primitive.js\");\n__webpack_require__(/*! core-js/modules/es.date.to-string.js */ \"../../node_modules/core-js/modules/es.date.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.function.name.js */ \"../../node_modules/core-js/modules/es.function.name.js\");\n__webpack_require__(/*! core-js/modules/es.number.constructor.js */ \"../../node_modules/core-js/modules/es.number.constructor.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-properties.js */ \"../../node_modules/core-js/modules/es.object.define-properties.js\");\n__webpack_require__(/*! core-js/modules/es.object.define-property.js */ \"../../node_modules/core-js/modules/es.object.define-property.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptor.js */ \"../../node_modules/core-js/modules/es.object.get-own-property-descriptor.js\");\n__webpack_require__(/*! core-js/modules/es.object.get-own-property-descriptors.js */ \"../../node_modules/core-js/modules/es.object.get-own-property-descriptors.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.exec.js */ \"../../node_modules/core-js/modules/es.regexp.exec.js\");\n__webpack_require__(/*! core-js/modules/es.regexp.to-string.js */ \"../../node_modules/core-js/modules/es.regexp.to-string.js\");\n__webpack_require__(/*! core-js/modules/es.string.iterator.js */ \"../../node_modules/core-js/modules/es.string.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.weak-map.js */ \"../../node_modules/core-js/modules/es.weak-map.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ \"../../node_modules/core-js/modules/web.dom-collections.iterator.js\");\nObject.defineProperty(exports, \"__esModule\", ({\n  value: true\n}));\nexports[\"default\"] = KDEntityDesigner;\n__webpack_require__(/*! core-js/modules/es.array.filter.js */ \"../../node_modules/core-js/modules/es.array.filter.js\");\n__webpack_require__(/*! core-js/modules/es.array.find-index.js */ \"../../node_modules/core-js/modules/es.array.find-index.js\");\n__webpack_require__(/*! core-js/modules/es.array.for-each.js */ \"../../node_modules/core-js/modules/es.array.for-each.js\");\n__webpack_require__(/*! core-js/modules/es.array.is-array.js */ \"../../node_modules/core-js/modules/es.array.is-array.js\");\n__webpack_require__(/*! core-js/modules/es.array.iterator.js */ \"../../node_modules/core-js/modules/es.array.iterator.js\");\n__webpack_require__(/*! core-js/modules/es.array.map.js */ \"../../node_modules/core-js/modules/es.array.map.js\");\n__webpack_require__(/*! core-js/modules/es.array.splice.js */ \"../../node_modules/core-js/modules/es.array.splice.js\");\n__webpack_require__(/*! core-js/modules/es.object.entries.js */ \"../../node_modules/core-js/modules/es.object.entries.js\");\n__webpack_require__(/*! core-js/modules/es.object.from-entries.js */ \"../../node_modules/core-js/modules/es.object.from-entries.js\");\n__webpack_require__(/*! core-js/modules/es.object.keys.js */ \"../../node_modules/core-js/modules/es.object.keys.js\");\n__webpack_require__(/*! core-js/modules/es.object.to-string.js */ \"../../node_modules/core-js/modules/es.object.to-string.js\");\n__webpack_require__(/*! core-js/modules/web.dom-collections.for-each.js */ \"../../node_modules/core-js/modules/web.dom-collections.for-each.js\");\n__webpack_require__(/*! core-js/modules/web.timers.js */ \"../../node_modules/core-js/modules/web.timers.js\");\nvar _react = _interopRequireWildcard(__webpack_require__(/*! react */ \"webpack/sharing/consume/default/react/react?dca2\"));\nvar _global = __webpack_require__(/*! @/global */ \"./src/global/index.js\");\nvar _api = __webpack_require__(/*! @/designer/utils/api.js */ \"./src/designer/utils/api.js\");\nvar _appModelFunction = __webpack_require__(/*! @/model/appModelFunction.js */ \"./src/model/appModelFunction.js\");\nvar _designeraction = __webpack_require__(/*! @/action/designeraction */ \"./src/action/designeraction.js\");\nvar _getInvokeActionContext2 = _interopRequireDefault(__webpack_require__(/*! ../designerCommonUtils/getInvokeActionContext */ \"./src/component/web/designerCommonUtils/getInvokeActionContext.js\"));\nvar _convertUpperCaseKeyToLowerCase = _interopRequireDefault(__webpack_require__(/*! ../designerCommonUtils/convertUpperCaseKeyToLowerCase */ \"./src/component/web/designerCommonUtils/convertUpperCaseKeyToLowerCase.js\"));\nvar _symbolConst = __webpack_require__(/*! @/constant/symbolConst */ \"./src/constant/symbolConst.js\");\nvar _GlobalDataCacher = __webpack_require__(/*! @/model/GlobalDataCacher */ \"./src/model/GlobalDataCacher.js\");\nvar _LoadingGIF = _interopRequireDefault(__webpack_require__(/*! @/component/common/LoadingGIF.js */ \"./src/component/common/LoadingGIF.js\"));\nvar _const = __webpack_require__(/*! @/constant/const */ \"./src/constant/const.js\");\nvar _KDEntityDesigner = _interopRequireDefault(__webpack_require__(/*! ./KDEntityDesigner.less */ \"./src/component/web/KDEntityDesigner/KDEntityDesigner.less\"));\nvar _useSetControlMount = _interopRequireDefault(__webpack_require__(/*! @/use/useSetControlMount */ \"./src/use/useSetControlMount.js\"));\nvar _memoryCacher = __webpack_require__(/*! @/model/memoryCacher */ \"./src/model/memoryCacher.js\");\nvar _ProFormDesignerBar = _interopRequireDefault(__webpack_require__(/*! @/component/web/KDProFormDesigner/ProFormDesignerBar.jsx */ \"./src/component/web/KDProFormDesigner/ProFormDesignerBar.jsx\"));\nvar _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ \"../../node_modules/classnames/index.js\"));\nvar _commonUtils = _interopRequireDefault(__webpack_require__(/*! @/component/common/commonUtils.js */ \"./src/component/common/commonUtils.js\"));\nvar _componentutil = __webpack_require__(/*! @/util/componentutil.js */ \"./src/util/componentutil.js\");\nvar _entityDesignerAction = __webpack_require__(/*! @/action/entityDesignerAction.js */ \"./src/action/entityDesignerAction.js\");\nvar _appModelFunction2 = __webpack_require__(/*! @/model/appModelFunction */ \"./src/model/appModelFunction.js\");\nvar _RuleDesigner = _interopRequireDefault(__webpack_require__(/*! ../RuleDesigner/RuleDesigner */ \"./src/component/web/RuleDesigner/RuleDesigner.jsx\"));\nvar _useFederationModule = __webpack_require__(/*! @/hooks/useFederationModule.js */ \"./src/hooks/useFederationModule.js\");\nvar _lodash = __webpack_require__(/*! lodash */ \"../../node_modules/lodash/lodash.js\");\nvar _mergeRuleData = _interopRequireDefault(__webpack_require__(/*! ../designerCommonUtils/mergeRuleData */ \"./src/component/web/designerCommonUtils/mergeRuleData.js\"));\nvar _index = __webpack_require__(/*! ../designerCommonUtils/index */ \"./src/component/web/designerCommonUtils/index.js\");\nvar _server = __webpack_require__(/*! @/action/actionname/control/field/server */ \"./src/action/actionname/control/field/server/index.js\");\nvar _intlApi = __webpack_require__(/*! @/i18n/intlApi */ \"./src/i18n/intlApi.js\");\nvar _server2 = __webpack_require__(/*! @/action/actionname/control/designer/server */ \"./src/action/actionname/control/designer/server/index.js\");\nvar _serverproperties = __webpack_require__(/*! @/constant/serverproperties */ \"./src/constant/serverproperties.js\");\nvar _toolUtils = __webpack_require__(/*! @/util/toolUtils */ \"./src/util/toolUtils.js\");\nvar _UnSupportIE = _interopRequireDefault(__webpack_require__(/*! @/component/common/UnSupportIE */ \"./src/component/common/UnSupportIE.jsx\"));\nvar _memoryCacher2 = __webpack_require__(/*! @/model/memoryCacher.js */ \"./src/model/memoryCacher.js\");\nvar _excluded = [\"modelver\", \"modeltype\"];\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { \"default\": obj }; }\nfunction _getRequireWildcardCache(e) { if (\"function\" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }\nfunction _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || \"object\" != _typeof(e) && \"function\" != typeof e) return { \"default\": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if (\"default\" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n[\"default\"] = e, t && t.set(e, n), n; }\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : String(i); }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n// import { fromJS } from 'immutable'\nvar ENTITYMETA = 'entitymeta';\nfunction KDEntityDesigner(_ref) {\n  var _userUIState$getIn;\n  var model = _ref.model,\n    dispatch = _ref.dispatch;\n  var _useState = (0, _react.useState)(),\n    _useState2 = _slicedToArray(_useState, 2),\n    meta = _useState2[0],\n    setMeta = _useState2[1];\n  var _useState3 = (0, _react.useState)(),\n    _useState4 = _slicedToArray(_useState3, 2),\n    data = _useState4[0],\n    setData = _useState4[1];\n  var _useState5 = (0, _react.useState)([]),\n    _useState6 = _slicedToArray(_useState5, 2),\n    encodeKeys = _useState6[0],\n    setEncodeKeys = _useState6[1];\n  var encodeDefaultKeysRef = (0, _react.useRef)([]);\n  var _useState7 = (0, _react.useState)(),\n    _useState8 = _slicedToArray(_useState7, 2),\n    uiModel = _useState8[0],\n    setUiModel = _useState8[1];\n  var _useState9 = (0, _react.useState)(),\n    _useState10 = _slicedToArray(_useState9, 2),\n    selectedTabId = _useState10[0],\n    setSelectedTabId = _useState10[1];\n  var _useState11 = (0, _react.useState)({}),\n    _useState12 = _slicedToArray(_useState11, 2),\n    ruleDesignerMetaInfo = _useState12[0],\n    setRuleDesignerMetaInfo = _useState12[1];\n  var _useState13 = (0, _react.useState)(false),\n    _useState14 = _slicedToArray(_useState13, 2),\n    openRuleDesigner = _useState14[0],\n    setOpenRuleDesigner = _useState14[1];\n  var _useState15 = (0, _react.useState)({}),\n    _useState16 = _slicedToArray(_useState15, 2),\n    lockPropsMap = _useState16[0],\n    setPropsMap = _useState16[1];\n  var _useState17 = (0, _react.useState)({}),\n    _useState18 = _slicedToArray(_useState17, 2),\n    designerConfig = _useState18[0],\n    setDesignerConfig = _useState18[1];\n\n  // const userUIState = getUserUIState(model)\n  // const userConfig = userUIState.get('userConfig')?.toJS() || { showLeftView: false, showKey: true, showType: true }\n  // const userConfigRef = useRef(userConfig)\n\n  (0, _useSetControlMount[\"default\"])(model);\n  var openArgs = (0, _appModelFunction.getDataProperty)(model.pageId, model.key, 'open_args')(model.state);\n  var addfieldArgs = (0, _appModelFunction.getDataProperty)(model.pageId, model.key, 'addfield_args')(model.state);\n  var deleteArgs = (0, _appModelFunction.getDataProperty)(model.pageId, model.key, 'delete_args')(model.state);\n  var menuOptions = (0, _appModelFunction.getDataProperty)(model.pageId, model.key, 'menuOptions')(model.state);\n  var barConfig = (0, _appModelFunction.getDataProperty)(model.pageId, model.key, 'config')(model.state);\n  var entitydesignerRef = (0, _react.useRef)();\n  var designerDataRef = (0, _react.useRef)();\n  var cacheSelectedTabIds = (0, _react.useRef)({});\n  var hasDirtyData = (0, _react.useRef)(false);\n  var cacheOpenTabList = (0, _react.useRef)([]);\n  var hasRuleDataChange = (0, _react.useRef)(false);\n  var ruleDataRef = (0, _react.useRef)(false);\n\n  // 模块联邦加载实体设计器\n  var _useFederatedModule = (0, _useFederationModule.useFederatedModule)('entity'),\n    module = _useFederatedModule.Component; // 请求组件\n  var _ref2 = module || {},\n    EntityDesigner = _ref2.EntityDesigner;\n  (0, _react.useEffect)(function () {\n    (0, _GlobalDataCacher.setData)(_symbolConst.KEY_TRAYMENU, false);\n    var removeGlobalListener = (0, _GlobalDataCacher.addDataChangeListener)(_symbolConst.KEY_VALIDATE_EVENT, function (_ref3) {\n      var _ref3$pageId = _ref3.pageId,\n        pageId = _ref3$pageId === void 0 ? '' : _ref3$pageId;\n      if (pageId !== model.pageId) {\n        return;\n      }\n      save();\n    });\n    var key = model.key,\n      pageId = model.pageId;\n    var removeActiveTabListener = (0, _memoryCacher.addDataChangeListener)(pageId, [key, 'activeTabId'], onActiveTab);\n    var removePageReleaseListener = (0, _GlobalDataCacher.addDataChangeListener)(_symbolConst.KEY_PAGE_RELEASE, onPageRelease);\n    var removeDirectivesListener = (0, _memoryCacher2.subscribeControlMethod)(pageId, key, 'directives', function (pageData) {\n      if (pageData === undefined) return;\n      invokeControlMethods(pageData);\n    });\n    (0, _memoryCacher.setControlMount)(pageId, key, true);\n    return function () {\n      (0, _memoryCacher.setControlMount)(pageId, key, false);\n      removeGlobalListener();\n      removeActiveTabListener && removeActiveTabListener();\n      removePageReleaseListener && removePageReleaseListener();\n      removeDirectivesListener && removeDirectivesListener();\n    };\n  }, []);\n  (0, _react.useEffect)(function () {\n    if (openArgs) {\n      // 请求页面的元元数据\n      var modelType = openArgs[0];\n      var _config = model.getFormConfig();\n      var clientParams = _config.clientParams || {};\n      var modelver = clientParams.modelver,\n        modeltype = clientParams.modeltype,\n        otherParams = _objectWithoutProperties(clientParams, _excluded);\n      (0, _api.getEntityMetadata)(modelType, {\n        onlyEntity: true,\n        otherParams: otherParams\n      }).then(function (meta) {\n        setMeta(meta);\n      });\n      // 设置页面元数据\n      var _data = openArgs[2];\n      setData(_data);\n      designerDataRef.current = _data;\n      hasRuleDataChange.current = false;\n      ruleDataRef.current = null;\n      setUiModel(uiModel);\n    }\n  }, [openArgs]);\n  (0, _react.useEffect)(function () {\n    if (menuOptions.length > 0) {\n      var menu = menuOptions[0];\n      var entityTabId = menu.id;\n      setSelectedTabId(entityTabId);\n      cacheOpenTabList.current.unshift(entityTabId);\n      cacheSelectedTabIds.current[entityTabId] = {};\n    }\n  }, [menuOptions]);\n  var invokeControlMethods = function invokeControlMethods(events) {\n    events.forEach(function (event) {\n      var methodName = event.methodname,\n        args = event.args;\n      switch (methodName) {\n        case 'setProperty':\n          setProperty(args);\n          break;\n        case 'setDesignMeta':\n          setDesignMeta(args);\n          break;\n        case 'transformModel':\n          getTransformModel(args);\n          break;\n        case _server.SET_ENCODING_KEYS:\n          setEncodingKeys(args);\n          break;\n        case _server2.LOCK_PROPERTY:\n          lockProperty(args);\n          break;\n        case _server2.SET_DESIGNER_CONFIG:\n          _setDesignerConfig(args);\n          break;\n        default:\n          break;\n      }\n    });\n  };\n  var onData = function onData(data) {\n    // 这里要有一步mergeData的操作\n    if (hasRuleDataChange.current) {\n      // 由于另一个设计器层的数据不会向上回流，导致总是不一致所以，只要有就得一直合\n      designerDataRef.current = (0, _mergeRuleData[\"default\"])(data, ruleDataRef.current, 'entitymeta');\n      // 只合一次 不能只合一次\n      // hasRuleDataChange.current = false\n      // ruleDataRef.current = null\n    } else {\n      designerDataRef.current = data;\n    }\n    hasDirtyData.current = true;\n    // hasRuleDataChange.current = false\n  };\n  var onApi = function onApi(kdesignerApi) {\n    entitydesignerRef.current = _objectSpread({}, kdesignerApi);\n  };\n  (0, _react.useEffect)(function () {\n    if (addfieldArgs) {\n      var fieldData = addfieldArgs[0];\n      var entityId = fieldData.entityId,\n        isStd = fieldData.isStd,\n        fields = fieldData.fields;\n      fields && fields.forEach(function (field) {\n        var _entitydesignerRef$cu;\n        var fieldName = field.fieldName,\n          fieldNumber = field.fieldNumber,\n          fieldType = field.fieldType;\n        (_entitydesignerRef$cu = entitydesignerRef.current) === null || _entitydesignerRef$cu === void 0 || _entitydesignerRef$cu.addField(fieldType, entityId, fieldName, fieldNumber);\n      });\n    }\n  }, [addfieldArgs]);\n  (0, _react.useEffect)(function () {\n    if (deleteArgs) {\n      var controlInfo = deleteArgs[0];\n      var designerApi = entitydesignerRef.current;\n      designerApi === null || designerApi === void 0 || designerApi.deleteControl(controlInfo.id);\n    }\n  }, [deleteArgs]);\n  var save = function save() {\n    // setTimeout为了防止属性修改后没有失焦，直接点击保存，发送数据不是最新的问题\n    setTimeout(function () {\n      saveDataToPostData();\n      dispatch((0, _entityDesignerAction.save)(model));\n    }, 200);\n  };\n  var saveRuleDesignerData = (0, _react.useCallback)(function (data) {\n    !hasRuleDataChange.current && (hasRuleDataChange.current = true);\n    ruleDataRef.current = data;\n    showMessage((0, _intlApi.getLangMsg)('ProFormDesignerBar.key0001'), 0);\n    // 业务规则也是脏数据\n    onData(designerDataRef.current);\n    // setOpenRuleDesigner(false)\n  }, []);\n  var saveDataToPostData = function saveDataToPostData() {\n    var _newData$entitymeta, _newData$formmeta;\n    var pageId = model.pageId,\n      key = model.key;\n    var newData = (0, _lodash.cloneDeep)(designerDataRef.current);\n    if ((_newData$entitymeta = newData.entitymeta) !== null && _newData$entitymeta !== void 0 && _newData$entitymeta.Items) {\n      var _newData$entitymeta2;\n      var newItems = updateDataIndex(newData === null || newData === void 0 || (_newData$entitymeta2 = newData.entitymeta) === null || _newData$entitymeta2 === void 0 ? void 0 : _newData$entitymeta2.Items);\n      if (encodeDefaultKeysRef.current.length > 0) {\n        (0, _index.encodeDesignerValue)(newItems, encodeDefaultKeysRef.current);\n      } else if (encodeKeys.length > 0) {\n        (0, _index.encodeDesignerRule)(newItems, encodeKeys);\n      }\n      newData.entitymeta.Items = newItems;\n    }\n    if (newData !== null && newData !== void 0 && (_newData$formmeta = newData.formmeta) !== null && _newData$formmeta !== void 0 && _newData$formmeta.Items) {\n      if (encodeDefaultKeysRef.current.length > 0) {\n        var _newData$formmeta2;\n        (0, _index.encodeDesignerValue)(newData === null || newData === void 0 || (_newData$formmeta2 = newData.formmeta) === null || _newData$formmeta2 === void 0 ? void 0 : _newData$formmeta2.Items, encodeDefaultKeysRef.current);\n      } else if (encodeKeys.length > 0) {\n        var _newData$formmeta3;\n        (0, _index.encodeDesignerRule)(newData === null || newData === void 0 || (_newData$formmeta3 = newData.formmeta) === null || _newData$formmeta3 === void 0 ? void 0 : _newData$formmeta3.Items, encodeKeys);\n      }\n    }\n    dispatch((0, _appModelFunction.convertAppModelFunctionAction)((0, _appModelFunction.setControlPostValue)(pageId, key, newData)));\n  };\n  var updateDataIndex = function updateDataIndex() {\n    var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n    var indexMap = {};\n    return data.map(function (item) {\n      var parentId = item.ParentId;\n      if (parentId) {\n        indexMap[parentId] = indexMap[parentId] === undefined ? 0 : indexMap[parentId] + 1;\n        return _objectSpread(_objectSpread({}, item), {}, {\n          Index: indexMap[parentId]\n        });\n      }\n      return item;\n    });\n  };\n  var setProperty = (0, _react.useCallback)(function (args) {\n    if (entitydesignerRef.current) {\n      var _entitydesignerRef$cu2;\n      (_entitydesignerRef$cu2 = entitydesignerRef.current) === null || _entitydesignerRef$cu2 === void 0 || _entitydesignerRef$cu2.setProperty(args);\n    }\n  }, []);\n  var setDesignMeta = (0, _react.useCallback)(function (args) {\n    setRuleDesignerMetaInfo(args);\n    setOpenRuleDesigner(true);\n  }, []);\n  var onClose = (0, _react.useCallback)(function (data) {\n    var isSave = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n    if (isSave) {\n      // update\n    }\n    setSelectedTabId('entityandfield');\n    cacheOpenTabList.current.unshift('entityandfield');\n    setOpenRuleDesigner(false);\n  }, []);\n  var showMessage = (0, _react.useCallback)(function (msg) {\n    var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n    var pageId = model.pageId;\n    var messageData = {\n      type: type,\n      // 类型\n      content: msg,\n      duration: 2000,\n      level: _const.MSG_LEVEL.warning,\n      pageId: pageId\n    };\n    (0, _appModelFunction.setDataMessages)(pageId, messageData);\n  }, [model]);\n  var invokeAction = (0, _react.useCallback)(function (actionName, params) {\n    dispatch((0, _designeraction.property_editor_click)(model, actionName, params));\n  }, []);\n  var getInvokeActionContext = (0, _react.useCallback)(function (field, extendData) {\n    var uiInfo = designerDataRef.current;\n    var currentDesignerRef = entitydesignerRef.current;\n    var kdesignerApi = currentDesignerRef;\n    var uiModel = kdesignerApi.uiModel;\n    return (0, _getInvokeActionContext2[\"default\"])({\n      field: field,\n      extendData: extendData,\n      uiInfo: uiInfo,\n      uiModel: uiModel,\n      kdesignerApi: kdesignerApi\n    });\n  }, []);\n  var getInvokeActionParams = (0, _react.useCallback)(function (propName, field, editor, metaType) {\n    var other = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};\n    var fieldInfo = field;\n    var itemId = fieldInfo.Id;\n    var form = editor.Form;\n    var extenddata = editor.Extenddata;\n\n    // 过滤掉属性值为空的属性\n    var entries = Object.entries(fieldInfo);\n    var filteredEntries = entries.filter(function (_ref4) {\n      var _ref5 = _slicedToArray(_ref4, 2),\n        key = _ref5[0],\n        value = _ref5[1];\n      return value !== '';\n    });\n    var _fieldInfo = Object.fromEntries(filteredEntries);\n    var context = [];\n    if (extenddata) {\n      if (Array.isArray(extenddata)) {\n        extenddata.forEach(function (item) {\n          context.push(getInvokeActionContext(_fieldInfo, item));\n        });\n      } else {\n        context = getInvokeActionContext(_fieldInfo, extenddata);\n      }\n    }\n    var value = _fieldInfo[propName] ? {\n      value: _fieldInfo[propName]\n    } : {};\n    var param = _objectSpread(_objectSpread({\n      form: (0, _convertUpperCaseKeyToLowerCase[\"default\"])(form)\n    }, value), {}, {\n      context: context,\n      item: {\n        Id: itemId,\n        _Type_: field._Type_\n      }\n    }, other);\n    return [itemId, metaType, propName, param];\n  }, []);\n  var getPropertyAliasValue = (0, _react.useCallback)(function (propName, field, editor) {\n    if (editor.Editable === false) {\n      return;\n    }\n    var params = getInvokeActionParams(propName, field, editor, ENTITYMETA);\n    if (encodeDefaultKeysRef.current.length > 0) {\n      (0, _index.encodePropertyValue)(params, encodeDefaultKeysRef.current);\n    }\n    invokeAction('getPropertyAlias', params);\n  }, []);\n  var handleCustomInputEditor = (0, _react.useCallback)(function (propName, field, editor, other) {\n    var params = getInvokeActionParams(propName, field, editor, ENTITYMETA, other);\n    if (encodeDefaultKeysRef.current.length > 0) {\n      (0, _index.encodePropertyValue)(params, encodeDefaultKeysRef.current);\n    }\n    invokeAction('click', params);\n  }, []);\n  var onUserConfigChange = function onUserConfigChange(data) {\n    var userConfig = entitydesignerRef.current.getUserConfig();\n    (0, _memoryCacher.setUserUIState)(model.pageId, ['entityDesigner', 'userConfig'], userConfig, true);\n  };\n  var onSelectMenu = function onSelectMenu(tabId) {\n    var _cacheSelectedTabIds$;\n    setSelectedTabId(tabId);\n    var index = cacheOpenTabList.current.findIndex(function (item) {\n      return item === tabId;\n    });\n    if (index > -1) {\n      cacheOpenTabList.current.splice(index, 1);\n    }\n    cacheOpenTabList.current.unshift(tabId);\n    if (tabId === 'entityandfield') return;\n    if (selectedTabId === 'entityandfield' && tabId !== 'entityandfield' && hasDirtyData.current) {\n      // 从实体页签切换到其他页签，并且前端存在脏数据，需要把entityMeta塞到postData\n      saveDataToPostData();\n      hasDirtyData.current = false;\n    }\n    var pageId = ((_cacheSelectedTabIds$ = cacheSelectedTabIds.current[tabId]) === null || _cacheSelectedTabIds$ === void 0 ? void 0 : _cacheSelectedTabIds$.pageId) || '';\n    dispatch((0, _entityDesignerAction.tabClick)(model, [tabId, pageId]));\n  };\n  var onActiveTab = function onActiveTab(tabId) {\n    setSelectedTabId(tabId);\n  };\n  var onClickMetaBtn = function onClickMetaBtn() {\n    var _cacheSelectedTabIds$2;\n    if (selectedTabId === 'entityandfield' && hasDirtyData.current) {\n      // 从实体页签切换到元数据，并且前端存在脏数据，需要把entityMeta塞到postData\n      saveDataToPostData();\n      hasDirtyData.current = false;\n    }\n    setSelectedTabId('meta');\n    var pageId = ((_cacheSelectedTabIds$2 = cacheSelectedTabIds.current.meta) === null || _cacheSelectedTabIds$2 === void 0 ? void 0 : _cacheSelectedTabIds$2.pageId) || '';\n    dispatch((0, _entityDesignerAction.tabClick)(model, ['meta', pageId]));\n  };\n  var onClickLockBtn = function onClickLockBtn() {\n    var _cacheSelectedTabIds$3;\n    if (selectedTabId === 'entityandfield' && hasDirtyData.current) {\n      // 从实体页签切换到元数据，并且前端存在脏数据，需要把entityMeta塞到postData\n      saveDataToPostData();\n      hasDirtyData.current = false;\n    }\n    setSelectedTabId('extensible');\n    var pageId = ((_cacheSelectedTabIds$3 = cacheSelectedTabIds.current.extensible) === null || _cacheSelectedTabIds$3 === void 0 ? void 0 : _cacheSelectedTabIds$3.pageId) || '';\n    dispatch((0, _entityDesignerAction.tabClick)(model, ['extensible', pageId]));\n  };\n  var onClickGotoLayoutBtn = function onClickGotoLayoutBtn() {\n    dispatch((0, _entityDesignerAction.tabClick)(model, ['gotolayout', '']));\n  };\n  var onClickGPTBtn = function onClickGPTBtn() {\n    dispatch((0, _entityDesignerAction.tabClick)(model, ['gpt', '']));\n  };\n\n  // 获取需要加密的Key值集合\n  var getTransformModel = function getTransformModel() {\n    var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n    var encodeMethod = (0, _appModelFunction.getRootEncodeMethod)();\n    // 是否编码\n    if (encodeMethod) {\n      (0, _GlobalDataCacher.setData)(_symbolConst.KEY_KDBASE64, 'kdbase64');\n      var _args = _slicedToArray(args, 2),\n        _encodeKeys = _args[1];\n      setEncodeKeys(_encodeKeys || []);\n    }\n  };\n\n  // 获取需要编码的Key值集合，新的编码方式\n  var setEncodingKeys = function setEncodingKeys() {\n    var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n    var encodeMethod = (0, _appModelFunction.getRootEncodeMethod)();\n    // 是否编码\n    if (encodeMethod) {\n      var _args$;\n      (0, _GlobalDataCacher.setData)(_symbolConst.KEY_ENCODE_METHOD, encodeMethod);\n      var encodeDefaultKeys = (_args$ = args[0]) === null || _args$ === void 0 ? void 0 : _args$[\"default\"];\n      encodeDefaultKeysRef.current = encodeDefaultKeys || [];\n    }\n  };\n  var lockProperty = function lockProperty() {\n    var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n    var lockPropsMap = args[0];\n    if (!lockPropsMap) return;\n    setPropsMap(lockPropsMap);\n  };\n  var _setDesignerConfig = function _setDesignerConfig() {\n    var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];\n    var config = args[0];\n    if (config) {\n      setDesignerConfig(config);\n    }\n  };\n  var onPageRelease = function onPageRelease(pageId) {\n    var tabIds = Object.keys(cacheSelectedTabIds.current || {});\n    tabIds.forEach(function (tabId) {\n      var _cacheSelectedTabIds$4;\n      if (((_cacheSelectedTabIds$4 = cacheSelectedTabIds.current[tabId]) === null || _cacheSelectedTabIds$4 === void 0 ? void 0 : _cacheSelectedTabIds$4.pageId) === pageId) {\n        var _cacheOpenTabList$cur;\n        delete cacheSelectedTabIds.current[tabId];\n        var _selectedTabId = ((_cacheOpenTabList$cur = cacheOpenTabList.current) === null || _cacheOpenTabList$cur === void 0 ? void 0 : _cacheOpenTabList$cur[0]) || 'entityandfield';\n        setSelectedTabId(_selectedTabId);\n      }\n    });\n  };\n  var getSubFormsMap = function getSubFormsMap(mode) {\n    return (0, _componentutil.getControlSubFormsMap)(model.pageId, model.meta.get('id'), model.state);\n  };\n  var renderSubPages = function renderSubPages() {\n    var formsMap = getSubFormsMap(model);\n    return Object.keys(formsMap).map(function (subPageId) {\n      var _config$openStyle;\n      var config = (0, _appModelFunction2.getFormConfig)(subPageId)(model.state);\n      var tabId = config === null || config === void 0 || (_config$openStyle = config.openStyle) === null || _config$openStyle === void 0 ? void 0 : _config$openStyle.tabId;\n      var pageId = config === null || config === void 0 ? void 0 : config.pageId;\n      cacheSelectedTabIds.current[tabId] = {\n        pageId: pageId\n      };\n      var tabPageClass = (0, _classnames[\"default\"])(_defineProperty(_defineProperty({}, _KDEntityDesigner[\"default\"]['tab-page'], true), _KDEntityDesigner[\"default\"].hidden, selectedTabId !== tabId));\n      return /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n        key: subPageId,\n        className: tabPageClass\n      }, formsMap[subPageId]);\n    });\n  };\n  var getConfig = function getConfig() {\n    var state = (0, _global.getGlobalState)();\n    var rootPageId = (0, _appModelFunction2.getRootPageId)()(state);\n    return (0, _appModelFunction2.getFormConfigWithoutMeta)(rootPageId)(state);\n  };\n  var userUIState = (0, _memoryCacher.getUserUIState)(model);\n  var userConfig = ((_userUIState$getIn = userUIState.getIn(['entityDesigner', 'userConfig'])) === null || _userUIState$getIn === void 0 ? void 0 : _userUIState$getIn.toJS()) || {\n    showLeftView: false,\n    showKey: false,\n    showType: false,\n    showFullRelationship: false\n  };\n  var config = getConfig();\n  var pageId = model.pageId,\n    key = model.key;\n  var _getCommonClass = (0, _componentutil.getCommonClass)(model),\n    Grow = _getCommonClass.Grow,\n    Shrink = _getCommonClass.Shrink,\n    AlignSelf = _getCommonClass.AlignSelf;\n  var designerWrapperClass = (0, _classnames[\"default\"])(_defineProperty({}, _KDEntityDesigner[\"default\"]['entity-designer-wrapper'], true), (0, _commonUtils[\"default\"])({\n    Grow: Grow,\n    Shrink: Shrink,\n    AlignSelf: AlignSelf\n  }));\n  var entityTabClass = (0, _classnames[\"default\"])(_defineProperty(_defineProperty({}, _KDEntityDesigner[\"default\"]['entity-tab'], true), _KDEntityDesigner[\"default\"].hidden, selectedTabId !== 'entityandfield'));\n  var configItems = model.getMetaProperty(_serverproperties.CONFIG_ITEMS);\n  var logo = configItems === null || configItems === void 0 ? void 0 : configItems.get(_serverproperties.LOGO);\n  var lang = model.getUserLocale();\n  var currentLang = (0, _intlApi.getCurrentLang)() || 'zh_CN';\n  if ((0, _toolUtils.getBrowserData)() === 'ie') {\n    return /*#__PURE__*/_react[\"default\"].createElement(_UnSupportIE[\"default\"], null);\n  }\n  if (meta && data) {\n    return /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n      className: designerWrapperClass\n    }, /*#__PURE__*/_react[\"default\"].createElement(_ProFormDesignerBar[\"default\"], {\n      menuOptions: menuOptions,\n      onSelectMenu: onSelectMenu,\n      showPreviewBtn: false,\n      onSave: save,\n      showMetaBtn: currentLang === 'zh_CN' // 按领域要求语言为中文才显示\n      ,\n      onClickMetaBtn: onClickMetaBtn,\n      showLockBtn: barConfig.showExtensibleBtn,\n      onClickLockBtn: onClickLockBtn,\n      showGotoLayoutBtn: true,\n      onClickGotoLayoutBtn: onClickGotoLayoutBtn,\n      onClickGPTBtn: onClickGPTBtn,\n      activeTabId: selectedTabId,\n      pageId: pageId,\n      controlKey: key,\n      userLocale: lang,\n      logo: logo\n    }), /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n      className: _KDEntityDesigner[\"default\"]['tab-container']\n    }, /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n      className: entityTabClass\n    }, /*#__PURE__*/_react[\"default\"].createElement(_react[\"default\"].Suspense, {\n      fallback: \"loading\"\n    }, EntityDesigner && /*#__PURE__*/_react[\"default\"].createElement(EntityDesigner, {\n      name: \"EntityDesigner\",\n      meta: meta,\n      data: data,\n      onData: onData,\n      getPropertyAliasValue: getPropertyAliasValue,\n      invokeAction: invokeAction,\n      showMessage: showMessage,\n      handleCustomInputEditor: handleCustomInputEditor,\n      onApi: onApi,\n      userConfig: userConfig,\n      onUserConfigChange: onUserConfigChange,\n      showLockBtn: barConfig.showExtensibleBtn,\n      config: config,\n      getLangMsg: _intlApi.getLangMsg,\n      lockPropsMap: lockPropsMap,\n      designerConfig: designerConfig\n    }))), renderSubPages()), openRuleDesigner && /*#__PURE__*/_react[\"default\"].createElement(_RuleDesigner[\"default\"], {\n      designerNodeMetaInfo: ruleDesignerMetaInfo,\n      designerData: designerDataRef.current,\n      designerMeta: meta,\n      open: openRuleDesigner,\n      onClose: onClose,\n      save: saveRuleDesignerData,\n      onCloseDesigner: onClose,\n      model: model,\n      invokeAction: invokeAction,\n      metaType: \"entitymeta\",\n      showMessage: showMessage\n    }));\n  } else {\n    return /*#__PURE__*/_react[\"default\"].createElement(\"div\", {\n      className: _KDEntityDesigner[\"default\"]['loading-wrapper']\n    }, /*#__PURE__*/_react[\"default\"].createElement(_LoadingGIF[\"default\"], null));\n  }\n}\n\n//# sourceURL=webpack://bos-platform/./src/component/web/KDEntityDesigner/KDEntityDesigner.jsx?");

/***/ }),

/***/ "../../node_modules/core-js/modules/es.object.from-entries.js":
/*!********************************************************************!*\
  !*** ../../node_modules/core-js/modules/es.object.from-entries.js ***!
  \********************************************************************/
/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {

eval("var $ = __webpack_require__(/*! ../internals/export */ \"../../node_modules/core-js/internals/export.js\");\nvar iterate = __webpack_require__(/*! ../internals/iterate */ \"../../node_modules/core-js/internals/iterate.js\");\nvar createProperty = __webpack_require__(/*! ../internals/create-property */ \"../../node_modules/core-js/internals/create-property.js\");\n\n// `Object.fromEntries` method\n// https://github.com/tc39/proposal-object-from-entries\n$({ target: 'Object', stat: true }, {\n  fromEntries: function fromEntries(iterable) {\n    var obj = {};\n    iterate(iterable, function (k, v) {\n      createProperty(obj, k, v);\n    }, undefined, true);\n    return obj;\n  }\n});\n\n\n//# sourceURL=webpack://bos-platform/../../node_modules/core-js/modules/es.object.from-entries.js?");

/***/ }),

/***/ "./src/component/web/KDEntityDesigner/KDEntityDesigner.less":
/*!******************************************************************!*\
  !*** ./src/component/web/KDEntityDesigner/KDEntityDesigner.less ***!
  \******************************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"loading-wrapper\":\"KDEntityDesigner_loading-wrapper_103s\",\"entity-designer-wrapper\":\"KDEntityDesigner_entity-designer-wrapper_1E__\",\"tab-container\":\"KDEntityDesigner_tab-container_1NXA\",\"entity-tab\":\"KDEntityDesigner_entity-tab_2Z4h\",\"tab-page\":\"KDEntityDesigner_tab-page_28lq\",\"hidden\":\"KDEntityDesigner_hidden_XYs3\"});\n\n//# sourceURL=webpack://bos-platform/./src/component/web/KDEntityDesigner/KDEntityDesigner.less?");

/***/ })

}]);