"use strict";
/*
 * ATTENTION: An "eval-source-map" devtool has been used.
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file with attached SourceMaps 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["webpackChunknocode_platform"] = self["webpackChunknocode_platform"] || []).push([[8684],{

/***/ "./src/web/layout/apps/DetailHeaderLayout.less":
/*!*****************************************************!*\
  !*** ./src/web/layout/apps/DetailHeaderLayout.less ***!
  \*****************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"app_container\":\"ApS+IMsm_app_container\"});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvd2ViL2xheW91dC9hcHBzL0RldGFpbEhlYWRlckxheW91dC5sZXNzIiwibWFwcGluZ3MiOiI7QUFBQTtBQUNBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vbm9jb2RlLXBsYXRmb3JtLy4vc3JjL3dlYi9sYXlvdXQvYXBwcy9EZXRhaWxIZWFkZXJMYXlvdXQubGVzcz8zNDFiIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpblxuZXhwb3J0IGRlZmF1bHQge1wiYXBwX2NvbnRhaW5lclwiOlwiQXBTK0lNc21fYXBwX2NvbnRhaW5lclwifTsiXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/web/layout/apps/DetailHeaderLayout.less\n");

/***/ }),

/***/ "./src/web/pages/apps/detail/AppDetailPage.less":
/*!******************************************************!*\
  !*** ./src/web/pages/apps/detail/AppDetailPage.less ***!
  \******************************************************/
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\"app_form_detail\":\"_5zTCZcku_app_form_detail\",\"box\":\"ohFcZq8L_box\",\"main\":\"fCZWr7mq_main\",\"bill\":\"nLrZBefF_bill\",\"has_flow\":\"qXOFJu1Z_has_flow\",\"scroll\":\"XBM8fxc7_scroll\",\"flow\":\"YLHj8Mpb_flow\",\"footer\":\"SgJ9CUFc_footer\",\"footer_main\":\"KzNQOdtU_footer_main\",\"footer_main_tips\":\"wMiZVY4H_footer_main_tips\",\"btns\":\"UGMiso5u_btns\",\"mr12\":\"_3Z7QuvqL_mr12\"});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvd2ViL3BhZ2VzL2FwcHMvZGV0YWlsL0FwcERldGFpbFBhZ2UubGVzcyIsIm1hcHBpbmdzIjoiO0FBQUE7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL25vY29kZS1wbGF0Zm9ybS8uL3NyYy93ZWIvcGFnZXMvYXBwcy9kZXRhaWwvQXBwRGV0YWlsUGFnZS5sZXNzPzcwYTQiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZXh0cmFjdGVkIGJ5IG1pbmktY3NzLWV4dHJhY3QtcGx1Z2luXG5leHBvcnQgZGVmYXVsdCB7XCJhcHBfZm9ybV9kZXRhaWxcIjpcIl81elRDWmNrdV9hcHBfZm9ybV9kZXRhaWxcIixcImJveFwiOlwib2hGY1pxOExfYm94XCIsXCJtYWluXCI6XCJmQ1pXcjdtcV9tYWluXCIsXCJiaWxsXCI6XCJuTHJaQmVmRl9iaWxsXCIsXCJoYXNfZmxvd1wiOlwicVhPRkp1MVpfaGFzX2Zsb3dcIixcInNjcm9sbFwiOlwiWEJNOGZ4Yzdfc2Nyb2xsXCIsXCJmbG93XCI6XCJZTEhqOE1wYl9mbG93XCIsXCJmb290ZXJcIjpcIlNnSjlDVUZjX2Zvb3RlclwiLFwiZm9vdGVyX21haW5cIjpcIkt6TlFPZHRVX2Zvb3Rlcl9tYWluXCIsXCJmb290ZXJfbWFpbl90aXBzXCI6XCJ3TWlaVlk0SF9mb290ZXJfbWFpbl90aXBzXCIsXCJidG5zXCI6XCJVR01pc281dV9idG5zXCIsXCJtcjEyXCI6XCJfM1o3UXV2cUxfbXIxMlwifTsiXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/web/pages/apps/detail/AppDetailPage.less\n");

/***/ }),

/***/ "./src/web/component/common/ShareButton.tsx":
/*!**************************************************!*\
  !*** ./src/web/component/common/ShareButton.tsx ***!
  \**************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

eval("\n\nvar _typeof = __webpack_require__(/*! @babel/runtime-corejs3/helpers/typeof */ \"../../node_modules/@babel/runtime-corejs3/helpers/typeof.js\");\nvar _WeakMap = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/weak-map */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/weak-map.js\");\nvar _Object$defineProperty = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-property */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js\");\nvar _Object$getOwnPropertyDescriptor = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor.js\");\nvar _interopRequireDefault = __webpack_require__(/*! @babel/runtime-corejs3/helpers/interopRequireDefault */ \"../../node_modules/@babel/runtime-corejs3/helpers/interopRequireDefault.js\");\n_Object$defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports[\"default\"] = void 0;\nvar _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/regenerator */ \"../../node_modules/@babel/runtime-corejs3/regenerator/index.js\"));\nvar _concat = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/concat */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.js\"));\nvar _slice = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/slice */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/slice.js\"));\nvar _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/asyncToGenerator */ \"../../node_modules/@babel/runtime-corejs3/helpers/asyncToGenerator.js\"));\nvar _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/slicedToArray */ \"../../node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js\"));\nvar _react = _interopRequireWildcard(__webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\"));\nvar _reactI18next = __webpack_require__(/*! react-i18next */ \"../../node_modules/react-i18next/dist/es/index.js\");\nvar _ShareModal = _interopRequireDefault(__webpack_require__(/*! ./ShareModal */ \"./src/web/component/common/ShareModal.tsx\"));\nvar _designer = __webpack_require__(/*! @/actions/designer */ \"./src/actions/designer.js\");\nvar _WebUI = __webpack_require__(/*! nocode_component/WebUI */ \"webpack/container/remote/nocode_component/WebUI\");\nvar _home = __webpack_require__(/*! @/actions/home */ \"./src/actions/home.js\");\nvar _useFetchHook = __webpack_require__(/*! @/hooks/useFetchHook */ \"./src/hooks/useFetchHook.ts\");\nvar _actionNames = __webpack_require__(/*! @/reducer/actionNames */ \"./src/reducer/actionNames.js\");\nvar _storageTools = __webpack_require__(/*! @/utils/storageTools */ \"./src/utils/storageTools.ts\");\nvar _useAppContext2 = _interopRequireDefault(__webpack_require__(/*! @/hooks/useAppContext */ \"./src/hooks/useAppContext.js\"));\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; }\n/*\n * @Description: 分享按钮（包括分享弹窗）\n * @Author: jianhang_he\n * @Date: 2022-09-21 16:18:02\n * @LastEditTime: 2024-09-18 11:06:16\n * @Last Modified by: jianhang_he\n */\n\nvar VIEW_STATUS_TEXT = {\n  view: '详情',\n  edit: '编辑'\n};\nvar ShareButton = (0, _react.memo)(function (_ref) {\n  var _context3;\n  var config = _ref.config,\n    className = _ref.className,\n    _ref$size = _ref.size,\n    size = _ref$size === void 0 ? 'middle' : _ref$size,\n    shareLink = _ref.shareLink,\n    _ref$modalTitle = _ref.modalTitle,\n    modalTitle = _ref$modalTitle === void 0 ? '列表页' : _ref$modalTitle,\n    _ref$iconType = _ref.iconType,\n    iconType = _ref$iconType === void 0 ? 'fenxiang' : _ref$iconType,\n    onClick = _ref.onClick,\n    allowNoAuth = _ref.allowNoAuth,\n    shareReqireLogin = _ref.shareReqireLogin,\n    shareNotReqireLogin = _ref.shareNotReqireLogin;\n  var _useAppContext = (0, _useAppContext2.default)(),\n    state = _useAppContext.state,\n    dispatch = _useAppContext.dispatch;\n  var appId = config.appId,\n    targetFormId = config.targetFormId,\n    Status = config.Status,\n    pkId = config.pkId;\n  var userInfo = state.userInfo;\n  var appData = state.appsList[appId];\n  var fileServer = state.fileServer;\n  // 表单名称\n  var selectedFormData = state.selectedFormData;\n  var _useTranslation = (0, _reactI18next.useTranslation)(),\n    translate = _useTranslation.t;\n  var _useState = (0, _react.useState)(selectedFormData || {}),\n    _useState2 = (0, _slicedToArray2.default)(_useState, 2),\n    formData = _useState2[0],\n    setFormData = _useState2[1];\n  var _useState3 = (0, _react.useState)(false),\n    _useState4 = (0, _slicedToArray2.default)(_useState3, 2),\n    shareModelVisible = _useState4[0],\n    setShareModelVisible = _useState4[1];\n  (0, _react.useEffect)(function () {\n    if (!appData) {\n      var url = \"nocode/v2/nocode_sys/app/\".concat(appId);\n      (0, _storageTools.getWithPriority)((0, _useFetchHook.getStoreData)(url, ''), (0, _home.getAppInfoById)(appId).then(function (info) {\n        (0, _useFetchHook.setStoreData)(url, '', info);\n        return info;\n      }), function (res) {\n        var _res$rows;\n        var info = res === null || res === void 0 || (_res$rows = res.rows) === null || _res$rows === void 0 ? void 0 : _res$rows[0];\n        info && dispatch({\n          type: _actionNames.UPDATE_APP_INFO_BY_ID,\n          payload: {\n            id: appId,\n            value: info\n          }\n        });\n      });\n    }\n  }, [appData, appId]);\n  var shareTitle = (0, _react.useMemo)(function () {\n    var _context, _formData$name;\n    // 后端限制长度50，前端也统一\n    return (0, _concat.default)(_context = \"\".concat((_formData$name = formData.name) === null || _formData$name === void 0 ? void 0 : (0, _slice.default)(_formData$name).call(_formData$name, 0, 50 - modalTitle.length))).call(_context, modalTitle);\n  }, [formData, modalTitle, Status]);\n\n  /**\n   * 点击分享\n   */\n  var handleClickShare = /*#__PURE__*/function () {\n    var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {\n      return _regenerator.default.wrap(function _callee$(_context2) {\n        while (1) switch (_context2.prev = _context2.next) {\n          case 0:\n            if (!onClick) {\n              _context2.next = 2;\n              break;\n            }\n            return _context2.abrupt(\"return\", onClick());\n          case 2:\n            // 获取表单信息\n            (0, _designer.getFormData)({\n              appId: appId,\n              targetFormId: targetFormId\n            }).then(function (res) {\n              var _res$rows2;\n              var data = (res === null || res === void 0 || (_res$rows2 = res.rows) === null || _res$rows2 === void 0 ? void 0 : _res$rows2[0]) || {};\n              setFormData(data);\n              setShareModelVisible(true);\n            }).catch(function (err) {\n              console.error('getFormData 出错了', err);\n            });\n          case 3:\n          case \"end\":\n            return _context2.stop();\n        }\n      }, _callee);\n    }));\n    return function handleClickShare() {\n      return _ref2.apply(this, arguments);\n    };\n  }();\n\n  /**\n   * 取消分享弹窗\n   */\n  var cancelShareModel = (0, _react.useCallback)(function () {\n    setShareModelVisible(false);\n  }, []);\n  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_WebUI.BtnField, {\n    size: size,\n    type: \"text\",\n    \"data-nc-action\": (0, _concat.default)(_context3 = \"\".concat(appId, \"|\")).call(_context3, targetFormId, \"|tb_share\"),\n    onClick: handleClickShare,\n    className: className,\n    text: translate('apps.share'),\n    icon: {\n      prefix: 'nocodeplatformicon',\n      type: iconType\n    }\n  }), shareModelVisible && /*#__PURE__*/_react.default.createElement(_ShareModal.default, {\n    visible: shareModelVisible,\n    title: \"\\u5206\\u4EAB\",\n    onCancel: cancelShareModel,\n    onOk: cancelShareModel,\n    shareTitle: shareTitle,\n    needLoginLink: shareLink,\n    shareByPeople: userInfo === null || userInfo === void 0 ? void 0 : userInfo.name,\n    shareAppImage: appData === null || appData === void 0 ? void 0 : appData.image,\n    formid: pkId || formData.formId,\n    fileServer: fileServer,\n    allowNoAuth: allowNoAuth,\n    formData: formData,\n    config: config,\n    shareReqireLogin: shareReqireLogin,\n    shareNotReqireLogin: shareNotReqireLogin\n  }));\n});\nShareButton.displayName = 'ShareButton';\nvar _default = exports[\"default\"] = ShareButton;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///./src/web/component/common/ShareButton.tsx\n");

/***/ }),

/***/ "./src/web/layout/apps/DetailHeaderLayout.tsx":
/*!****************************************************!*\
  !*** ./src/web/layout/apps/DetailHeaderLayout.tsx ***!
  \****************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

eval("\n\nvar _typeof = __webpack_require__(/*! @babel/runtime-corejs3/helpers/typeof */ \"../../node_modules/@babel/runtime-corejs3/helpers/typeof.js\");\nvar _WeakMap = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/weak-map */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/weak-map.js\");\nvar _Object$defineProperty = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-property */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js\");\nvar _Object$getOwnPropertyDescriptor = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor.js\");\nvar _interopRequireDefault = __webpack_require__(/*! @babel/runtime-corejs3/helpers/interopRequireDefault */ \"../../node_modules/@babel/runtime-corejs3/helpers/interopRequireDefault.js\");\n_Object$defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports[\"default\"] = void 0;\nvar _react = _interopRequireWildcard(__webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\"));\nvar _reactRouterDom = __webpack_require__(/*! react-router-dom */ \"../../node_modules/react-router-dom/index.js\");\nvar _HeaderLayout = __webpack_require__(/*! ./HeaderLayout */ \"./src/web/layout/apps/HeaderLayout.tsx\");\nvar _DetailHeaderLayout = _interopRequireDefault(__webpack_require__(/*! ./DetailHeaderLayout.less */ \"./src/web/layout/apps/DetailHeaderLayout.less\"));\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; }\nvar DetailHeader = (0, _react.memo)(function () {\n  var _useParams = (0, _reactRouterDom.useParams)(),\n    origin = _useParams.origin;\n  // 从苍穹打开，不显示标题\n  return origin === 'cosmic' ? /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: _DetailHeaderLayout.default.app_container\n  }, /*#__PURE__*/_react.default.createElement(_reactRouterDom.Outlet, null)) : /*#__PURE__*/_react.default.createElement(_HeaderLayout.DetailHeaderLayout, null);\n});\nvar _default = exports[\"default\"] = DetailHeader;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvd2ViL2xheW91dC9hcHBzL0RldGFpbEhlYWRlckxheW91dC50c3giLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7QUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUFBO0FBQUE7QUFFQTtBQUNBO0FBQUE7QUFDQTtBQUNBO0FBQUE7QUFBQTtBQUNBO0FBQUEiLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9ub2NvZGUtcGxhdGZvcm0vLi9zcmMvd2ViL2xheW91dC9hcHBzL0RldGFpbEhlYWRlckxheW91dC50c3g/MGM2YiJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgUmVhY3QsIHsgbWVtbyB9IGZyb20gJ3JlYWN0J1xuaW1wb3J0IHsgdXNlUGFyYW1zLCBPdXRsZXQgfSBmcm9tICdyZWFjdC1yb3V0ZXItZG9tJ1xuaW1wb3J0IHsgRGV0YWlsSGVhZGVyTGF5b3V0IH0gZnJvbSAnLi9IZWFkZXJMYXlvdXQnXG5pbXBvcnQgc3R5bGVzIGZyb20gJy4vRGV0YWlsSGVhZGVyTGF5b3V0Lmxlc3MnXG5cbmNvbnN0IERldGFpbEhlYWRlciA9IG1lbW8oKCkgPT4ge1xuICBjb25zdCB7IG9yaWdpbiB9ID0gdXNlUGFyYW1zKClcbiAgLy8g5LuO6IuN56m55omT5byA77yM5LiN5pi+56S65qCH6aKYXG4gIHJldHVybiBvcmlnaW4gPT09ICdjb3NtaWMnID8gPGRpdiBjbGFzc05hbWU9e3N0eWxlcy5hcHBfY29udGFpbmVyfT48T3V0bGV0IC8+PC9kaXY+IDogPERldGFpbEhlYWRlckxheW91dCAvPlxufSlcblxuZXhwb3J0IGRlZmF1bHQgRGV0YWlsSGVhZGVyXG4iXSwibmFtZXMiOltdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./src/web/layout/apps/DetailHeaderLayout.tsx\n");

/***/ }),

/***/ "./src/web/pages/apps/detail/AppDetailPage.tsx":
/*!*****************************************************!*\
  !*** ./src/web/pages/apps/detail/AppDetailPage.tsx ***!
  \*****************************************************/
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

eval("\n\nvar _typeof = __webpack_require__(/*! @babel/runtime-corejs3/helpers/typeof */ \"../../node_modules/@babel/runtime-corejs3/helpers/typeof.js\");\nvar _WeakMap = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/weak-map */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/weak-map.js\");\nvar _Object$defineProperty = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-property */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-property.js\");\nvar _Object$getOwnPropertyDescriptor = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor.js\");\nvar _interopRequireDefault = __webpack_require__(/*! @babel/runtime-corejs3/helpers/interopRequireDefault */ \"../../node_modules/@babel/runtime-corejs3/helpers/interopRequireDefault.js\");\n_Object$defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports[\"default\"] = void 0;\nvar _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/regenerator */ \"../../node_modules/@babel/runtime-corejs3/regenerator/index.js\"));\nvar _find = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/find */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/find.js\"));\nvar _setTimeout2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/set-timeout */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/set-timeout.js\"));\nvar _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/defineProperty */ \"../../node_modules/@babel/runtime-corejs3/helpers/defineProperty.js\"));\nvar _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/asyncToGenerator */ \"../../node_modules/@babel/runtime-corejs3/helpers/asyncToGenerator.js\"));\nvar _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/slicedToArray */ \"../../node_modules/@babel/runtime-corejs3/helpers/slicedToArray.js\"));\nvar _react = _interopRequireWildcard(__webpack_require__(/*! kd_libs/react */ \"webpack/container/remote/kd_libs/react\"));\nvar _reactRouterDom = __webpack_require__(/*! react-router-dom */ \"../../node_modules/react-router-dom/index.js\");\nvar _utils = __webpack_require__(/*! @/utils */ \"./src/utils/index.tsx\");\nvar _AppDetailPage = _interopRequireDefault(__webpack_require__(/*! ./AppDetailPage.less */ \"./src/web/pages/apps/detail/AppDetailPage.less\"));\nvar _apps = __webpack_require__(/*! @/actions/apps */ \"./src/actions/apps.ts\");\nvar _useAppContext2 = _interopRequireDefault(__webpack_require__(/*! @/hooks/useAppContext */ \"./src/hooks/useAppContext.js\"));\nvar _FlowListLayout = _interopRequireDefault(__webpack_require__(/*! @/web/layout/apps/FlowListLayout */ \"./src/web/layout/apps/FlowListLayout.tsx\"));\nvar _useFormBackground = _interopRequireDefault(__webpack_require__(/*! @/hooks/useFormBackground */ \"./src/hooks/useFormBackground.ts\"));\nvar _NocodeEntry = _interopRequireDefault(__webpack_require__(/*! @/web/component/common/NocodeEntry */ \"./src/web/component/common/NocodeEntry.tsx\"));\nvar _FormDetailFooterLayout = _interopRequireDefault(__webpack_require__(/*! @/web/layout/apps/FormDetailFooterLayout */ \"./src/web/layout/apps/FormDetailFooterLayout.tsx\"));\nvar _classnames = _interopRequireDefault(__webpack_require__(/*! classnames */ \"../../node_modules/classnames/index.js\"));\nvar _eventEmit = _interopRequireDefault(__webpack_require__(/*! @/utils/eventEmit */ \"./src/utils/eventEmit.js\"));\nvar _constants = __webpack_require__(/*! @/constants */ \"./src/constants/index.ts\");\nvar _auth = __webpack_require__(/*! @/actions/auth */ \"./src/actions/auth.js\");\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; }\n/*\n * @Description:\n * @Author: jianhang_he\n * @Date: 2022-08-29 15:48:49\n * @LastEditTime: 2023-06-25 17:02:58\n * @Last Modified by: jianhang_he\n */\n\n// import { BtnField as Button, Checkbox } from 'nocode_component/WebUI'\n// import FormWrapper from '@/web/component/common/FormWrapper'\n\n// import classNames from 'classnames'\n\n// import { AuthorizeContext } from '@/web/component/common/FormDataListAuthProvider'\n// import { closeWindow } from '@/utils/closeWindow'\n\n// import { closeWindow } from '@/utils/closeWindow'\n// import { Skeleton } from 'nocode_component/WebUI'\n// import { PopBillSkeleton } from '@/web/component/skeleton/PopBillSkeleton'\n\n/**\n * 表单详情\n * config status = 'edit'|'view'\n */\n// const NocodeEntry = lazy(() => import('bos_platform/NocodeEntry'))\n// const NocodeEntry = lazy(() => import('bos_core/Main'))\n// const PAGE_STATUS = ['addNew', 'edit', 'view']\n\nvar isAddStatus = function isAddStatus(status) {\n  return status === 'addNew';\n};\nvar isEditStatus = function isEditStatus(status) {\n  return status === 'edit';\n};\nvar isViewStatus = function isViewStatus(status) {\n  return status === 'view';\n};\nvar AppDetailPage = function AppDetailPage(props) {\n  var _state$rootConfig;\n  // Status去掉默认值addNew，以后端发回的状态为准\n  var _useParams = (0, _reactRouterDom.useParams)(),\n    appId = _useParams.appId,\n    targetFormId = _useParams.targetFormId,\n    pkId = _useParams.pkId,\n    Status = _useParams.Status,\n    shareId = _useParams.shareId,\n    taskId = _useParams.taskId,\n    procInstId = _useParams.procInstId,\n    origin = _useParams.origin,\n    userTaskActivityId = _useParams.userTaskActivityId,\n    userTaskBusinessKey = _useParams.userTaskBusinessKey,\n    userTaskCurrentUserId = _useParams.userTaskCurrentUserId;\n  var _useAppContext = (0, _useAppContext2.default)(),\n    state = _useAppContext.state,\n    sendUiData = _useAppContext.sendUiData;\n  var userInfo = state.userInfo,\n    rootConfig = state.rootConfig;\n  var _useState = (0, _react.useState)(Status),\n    _useState2 = (0, _slicedToArray2.default)(_useState, 2),\n    status = _useState2[0],\n    setStatus = _useState2[1];\n  var _useState3 = (0, _react.useState)(pkId || ''),\n    _useState4 = (0, _slicedToArray2.default)(_useState3, 2),\n    curPkId = _useState4[0],\n    setCurPkId = _useState4[1];\n  var _useState5 = (0, _react.useState)([]),\n    _useState6 = (0, _slicedToArray2.default)(_useState5, 2),\n    approvalData = _useState6[0],\n    setApprovalData = _useState6[1]; // 审批列表\n  // const [isNew, setIsNew] = useState(!pkId)\n  // const [isEdit, setIsEdit] = useState(isEditStatus(status))\n  // 当前节点，录入节点时录入表单与触发表单不一样，致使背景出现断层问题\n  var formId = (0, _react.useMemo)(function () {\n    if (userTaskActivityId && userTaskBusinessKey && userTaskCurrentUserId) {\n      var _proc$approvalInfo;\n      // 如果是录入节点\n      var proc = (0, _find.default)(approvalData).call(approvalData, function (item) {\n        return item.procInstId === procInstId;\n      });\n      var node = proc === null || proc === void 0 || (_proc$approvalInfo = proc.approvalInfo) === null || _proc$approvalInfo === void 0 ? void 0 : (0, _find.default)(_proc$approvalInfo).call(_proc$approvalInfo, function (item) {\n        return item.taskId === taskId;\n      });\n      return node === null || node === void 0 ? void 0 : node.nodeEntityNumber;\n    } else {\n      return targetFormId;\n    }\n  }, [approvalData, procInstId, taskId, targetFormId, userTaskActivityId, userTaskBusinessKey, userTaskCurrentUserId]);\n  var bgc = (0, _useFormBackground.default)(formId);\n  var _useState7 = (0, _react.useState)(null),\n    _useState8 = (0, _slicedToArray2.default)(_useState7, 2),\n    bosApi = _useState8[0],\n    setBosApi = _useState8[1];\n  // const checkboxRef = useRef<any>(null)\n  var _useState9 = (0, _react.useState)(false),\n    _useState10 = (0, _slicedToArray2.default)(_useState9, 2),\n    authPending = _useState10[0],\n    setAuthPending = _useState10[1];\n  var _useState11 = (0, _react.useState)(false),\n    _useState12 = (0, _slicedToArray2.default)(_useState11, 2),\n    loadApprova = _useState12[0],\n    setLoadApprova = _useState12[1];\n  var pageId = (0, _utils.getQueryString)('pageId') || '';\n  var _useState13 = (0, _react.useState)(false),\n    _useState14 = (0, _slicedToArray2.default)(_useState13, 2),\n    formLock = _useState14[0],\n    setFormLock = _useState14[1];\n  var _useState15 = (0, _react.useState)({}),\n    _useState16 = (0, _slicedToArray2.default)(_useState15, 2),\n    formAuth = _useState16[0],\n    setFormAuth = _useState16[1];\n  var _formAuth$add = formAuth.add,\n    inputAuth = _formAuth$add === void 0 ? true : _formAuth$add,\n    _formAuth$edit = formAuth.edit,\n    editAuth = _formAuth$edit === void 0 ? true : _formAuth$edit,\n    _formAuth$view = formAuth.view,\n    viewAuth = _formAuth$view === void 0 ? true : _formAuth$view,\n    _formAuth$delete = formAuth.delete,\n    deleteAuth = _formAuth$delete === void 0 ? true : _formAuth$delete,\n    _formAuth$add_fixed = formAuth.add_fixed,\n    inputAuthFixed = _formAuth$add_fixed === void 0 ? false : _formAuth$add_fixed;\n  // 是否显示流程列表\n  var showFlowList = approvalData.length > 0;\n  console.log('AppDetailPage', formLock);\n  (0, _react.useEffect)(function () {\n    _eventEmit.default.emit(_constants.UPDATE_STATUS, status);\n  }, [status]);\n  (0, _react.useEffect)(function () {\n    _eventEmit.default.emit(_constants.UPDATE_PKID, curPkId);\n  }, [curPkId]);\n\n  // 获取表单记录的权限\n  var getFormAuthFn = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {\n    var _yield$getFormAuth, _yield$getFormAuth$ro, rows, message;\n    return _regenerator.default.wrap(function _callee$(_context) {\n      while (1) switch (_context.prev = _context.next) {\n        case 0:\n          _context.prev = 0;\n          _context.next = 3;\n          return (0, _auth.getFormAuth)(appId, targetFormId, curPkId, procInstId, userTaskActivityId, userTaskBusinessKey, userTaskCurrentUserId);\n        case 3:\n          _yield$getFormAuth = _context.sent;\n          _yield$getFormAuth$ro = _yield$getFormAuth.rows;\n          rows = _yield$getFormAuth$ro === void 0 ? [] : _yield$getFormAuth$ro;\n          setFormAuth(rows[0] || []);\n          setAuthPending(true);\n          _context.next = 15;\n          break;\n        case 10:\n          _context.prev = 10;\n          _context.t0 = _context[\"catch\"](0);\n          console.log(_context.t0);\n          message = _context.t0.message;\n          (0, _utils.showNotice)('error', message);\n        case 15:\n        case \"end\":\n          return _context.stop();\n      }\n    }, _callee, null, [[0, 10]]);\n  })), [appId, targetFormId, curPkId, procInstId, userTaskActivityId, userTaskBusinessKey, userTaskCurrentUserId]);\n  (0, _react.useEffect)(function () {\n    getFormAuthFn();\n  }, [getFormAuthFn]);\n  var noPermission = (0, _react.useMemo)(function () {\n    if (authPending && bosApi && userInfo) {\n      if (!inputAuth && isAddStatus(status)) return true;\n      // 查看和编辑的，如果有流程记录，直接绕过权限体系，认为是有权限的\n      if (!viewAuth && isViewStatus(status) && !showFlowList && loadApprova) return true;\n      if (!editAuth && isEditStatus(status) && !showFlowList && loadApprova) return true;\n      return false;\n    }\n    return false;\n  }, [authPending, bosApi, userInfo, formAuth, showFlowList, loadApprova]);\n\n  /**\n   * 请求审批列表\n   * @param pkId\n   */\n  var fetchFlowList = (0, _react.useCallback)(function () {\n    var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n    setLoadApprova(false);\n    (0, _apps.getApprovalInfo)({\n      entityNumber: targetFormId,\n      businessKey: id || pkId\n    }).then(function (res) {\n      setApprovalData((res === null || res === void 0 ? void 0 : res.rows) || []);\n      setLoadApprova(true);\n    });\n  }, [targetFormId, pkId]);\n  (0, _react.useEffect)(function () {\n    if (targetFormId && pkId && !shareId) {\n      fetchFlowList();\n    }\n  }, [targetFormId, pkId, shareId, fetchFlowList]);\n\n  // BOS 动态表单配置信息，仅更新一次，之后通过函数控制表单\n  var bosConfig = (0, _react.useMemo)(function () {\n    var initStatus = Status || 'addNew';\n    var options = {\n      formId: 'bos_nocode_bill',\n      targetFormId: targetFormId,\n      Status: initStatus,\n      pkId: pkId,\n      procInstId: procInstId,\n      appId: appId\n    };\n    if (userTaskActivityId && userTaskBusinessKey && userTaskCurrentUserId) {\n      options.userTaskActivityId = userTaskActivityId;\n      options.userTaskBusinessKey = userTaskBusinessKey;\n      options.userTaskCurrentUserId = userTaskCurrentUserId;\n    }\n    return options;\n  }, []);\n\n  // 提交审批意见之后，如果可以关闭窗口则关闭，否则刷新审批记录列表\n  var handleSubmit = (0, _react.useCallback)(function () {\n    var _window$top;\n    if (origin === 'cosmic') {\n      (0, _setTimeout2.default)(function () {\n        window.parent.postMessage({\n          pageId: pageId,\n          type: 'invokeCustomEvent',\n          content: {\n            CloseWindow: 'true'\n          }\n        }, '*');\n      }, 2000);\n      return false;\n    } else if (!((_window$top = window.top) !== null && _window$top !== void 0 && _window$top.close())) {\n      fetchFlowList();\n    }\n  }, []);\n\n  // BOS挂载上后, 获取表单状态\n  var onRef = (0, _react.useCallback)(function (handle) {\n    if (handle) {\n      setBosApi(handle);\n      var _status = handle === null || handle === void 0 ? void 0 : handle.getPageStatus();\n      console.log('onRef', _status);\n      _status && setStatus(_status);\n    }\n  }, []);\n\n  // 保存的回调函数\n  // actions: 低代码平台返回的指令\n  // addAndNew：是否为新增\n  var saveCallback = (0, _react.useCallback)(function (actions, addAndNew, pageId) {\n    var _actions$setPkId;\n    var id = actions === null || actions === void 0 || (_actions$setPkId = actions.setPkId) === null || _actions$setPkId === void 0 ? void 0 : _actions$setPkId[0];\n    // 流程的录入节点\n    if (userTaskActivityId && userTaskBusinessKey) {\n      handleSubmit();\n      return false;\n    }\n    if (id && !addAndNew) {\n      // 提交/保存时,后端用setPkId指令返回pkId\n      setCurPkId(id);\n      fetchFlowList(id);\n      // bosApi?.setPageStatus('view')\n      bosApi === null || bosApi === void 0 || bosApi.setFormStatus('view', pageId);\n      setStatus('view');\n    }\n    if (id && curPkId && id !== curPkId) {\n      var _status2 = addAndNew ? 'edit' : 'view';\n      var path = [appId, 'detail', targetFormId, id, _status2].join('/');\n      window.location.href = (0, _utils.getFullPathName)(path);\n    }\n  }, [setCurPkId, fetchFlowList, setStatus, bosApi, curPkId]);\n\n  // 表单状态变化的回调函数\n  var onStatusChange = (0, _react.useCallback)(function (info) {\n    setStatus(info);\n  }, []);\n\n  // 加载成功BOS，添加unload监听指令，释放表单\n  (0, _react.useEffect)(function () {\n    if (bosApi) (0, _utils.addUnloadListener)(bosApi);\n  }, [bosApi]);\n  if (!(state !== null && state !== void 0 && (_state$rootConfig = state.rootConfig) !== null && _state$rootConfig !== void 0 && _state$rootConfig.pageId)) return null;\n  if (noPermission) return /*#__PURE__*/_react.default.createElement(_reactRouterDom.Navigate, {\n    to: \"/noPermission\",\n    replace: true\n  });\n  return /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: _AppDetailPage.default.app_form_detail,\n    style: {\n      background: bgc\n    }\n  }, /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: (0, _classnames.default)(_AppDetailPage.default.box, (0, _defineProperty2.default)({}, _AppDetailPage.default.has_flow, showFlowList))\n  }, /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: _AppDetailPage.default.main\n  }, /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: _AppDetailPage.default.bill\n  }, /*#__PURE__*/_react.default.createElement(_NocodeEntry.default, {\n    onRef: onRef,\n    config: bosConfig,\n    options: {\n      onStatusChange: onStatusChange,\n      sendUiData: sendUiData,\n      rootConfig: rootConfig\n    }\n  })), /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: _AppDetailPage.default.flow\n  }, showFlowList && /*#__PURE__*/_react.default.createElement(_FlowListLayout.default, {\n    taskId: taskId,\n    data: approvalData,\n    setFormLock: setFormLock,\n    config: bosConfig,\n    onSubmit: handleSubmit\n  })))), /*#__PURE__*/_react.default.createElement(_FormDetailFooterLayout.default, {\n    status: status,\n    bosApi: bosApi,\n    authList: {\n      deleteAuth: deleteAuth,\n      inputAuth: inputAuth,\n      editAuth: editAuth,\n      viewAuth: viewAuth\n    },\n    config: bosConfig,\n    isSharePage: !userInfo,\n    inputAuthFixed: inputAuthFixed,\n    formLock: formLock,\n    origin: origin,\n    newPkId: curPkId,\n    setStatus: setStatus,\n    copyCallback: function copyCallback() {\n      return setApprovalData([]);\n    },\n    delCallback: handleSubmit,\n    saveCallback: saveCallback\n  }));\n};\nvar _default = exports[\"default\"] = AppDetailPage;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///./src/web/pages/apps/detail/AppDetailPage.tsx\n");

/***/ })

}]);