"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([[4348],{

/***/ "./src/web/component/apps/PopBill.less":
/*!*********************************************!*\
  !*** ./src/web/component/apps/PopBill.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\"] = ({\"pop_bill\":\"mrjeIgpz_pop_bill\",\"nav\":\"HWXWWyC8_nav\",\"title\":\"_34mQ3R0Y_title\",\"actions\":\"ZOf3XMTL_actions\",\"actions_item\":\"F6AdVGn9_actions_item\",\"main\":\"bcs4S9SC_main\",\"bill\":\"_3PCGZ4TB_bill\",\"flow\":\"Dv90iuBK_flow\",\"footer\":\"_4hA9JCjW_footer\",\"btns\":\"PkPDiNTc_btns\",\"footer_tips\":\"vVuF264G_footer_tips\",\"footer_pagination\":\"_9SKW9ac8_footer_pagination\",\"footer_pagination_btn\":\"avKRPJXg_footer_pagination_btn\",\"footer_pagination_btn_icon\":\"qUNKHdZU_footer_pagination_btn_icon\",\"mr12\":\"MEE0puNt_mr12\"});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvd2ViL2NvbXBvbmVudC9hcHBzL1BvcEJpbGwubGVzcyIsIm1hcHBpbmdzIjoiO0FBQUE7QUFDQSIsInNvdXJjZXMiOlsid2VicGFjazovL25vY29kZS1wbGF0Zm9ybS8uL3NyYy93ZWIvY29tcG9uZW50L2FwcHMvUG9wQmlsbC5sZXNzP2IyMzAiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gZXh0cmFjdGVkIGJ5IG1pbmktY3NzLWV4dHJhY3QtcGx1Z2luXG5leHBvcnQgZGVmYXVsdCB7XCJwb3BfYmlsbFwiOlwibXJqZUlncHpfcG9wX2JpbGxcIixcIm5hdlwiOlwiSFdYV1d5QzhfbmF2XCIsXCJ0aXRsZVwiOlwiXzM0bVEzUjBZX3RpdGxlXCIsXCJhY3Rpb25zXCI6XCJaT2YzWE1UTF9hY3Rpb25zXCIsXCJhY3Rpb25zX2l0ZW1cIjpcIkY2QWRWR245X2FjdGlvbnNfaXRlbVwiLFwibWFpblwiOlwiYmNzNFM5U0NfbWFpblwiLFwiYmlsbFwiOlwiXzNQQ0daNFRCX2JpbGxcIixcImZsb3dcIjpcIkR2OTBpdUJLX2Zsb3dcIixcImZvb3RlclwiOlwiXzRoQTlKQ2pXX2Zvb3RlclwiLFwiYnRuc1wiOlwiUGtQRGlOVGNfYnRuc1wiLFwiZm9vdGVyX3RpcHNcIjpcInZWdUYyNjRHX2Zvb3Rlcl90aXBzXCIsXCJmb290ZXJfcGFnaW5hdGlvblwiOlwiXzlTS1c5YWM4X2Zvb3Rlcl9wYWdpbmF0aW9uXCIsXCJmb290ZXJfcGFnaW5hdGlvbl9idG5cIjpcImF2S1JQSlhnX2Zvb3Rlcl9wYWdpbmF0aW9uX2J0blwiLFwiZm9vdGVyX3BhZ2luYXRpb25fYnRuX2ljb25cIjpcInFVTktIZFpVX2Zvb3Rlcl9wYWdpbmF0aW9uX2J0bl9pY29uXCIsXCJtcjEyXCI6XCJNRUUwcHVOdF9tcjEyXCJ9OyJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/web/component/apps/PopBill.less\n");

/***/ }),

/***/ "./src/web/component/apps/PopBillTurnPage.less":
/*!*****************************************************!*\
  !*** ./src/web/component/apps/PopBillTurnPage.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\"] = ({\"bill_turnpage\":\"UT7zcNAA_bill_turnpage\",\"bill_turnpage_btn\":\"NXUfFYtE_bill_turnpage_btn\",\"bill_turnpage_btn_icon\":\"uGhzCxyl_bill_turnpage_btn_icon\"});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiLi9zcmMvd2ViL2NvbXBvbmVudC9hcHBzL1BvcEJpbGxUdXJuUGFnZS5sZXNzIiwibWFwcGluZ3MiOiI7QUFBQTtBQUNBIiwic291cmNlcyI6WyJ3ZWJwYWNrOi8vbm9jb2RlLXBsYXRmb3JtLy4vc3JjL3dlYi9jb21wb25lbnQvYXBwcy9Qb3BCaWxsVHVyblBhZ2UubGVzcz80OWIzIl0sInNvdXJjZXNDb250ZW50IjpbIi8vIGV4dHJhY3RlZCBieSBtaW5pLWNzcy1leHRyYWN0LXBsdWdpblxuZXhwb3J0IGRlZmF1bHQge1wiYmlsbF90dXJucGFnZVwiOlwiVVQ3emNOQUFfYmlsbF90dXJucGFnZVwiLFwiYmlsbF90dXJucGFnZV9idG5cIjpcIk5YVWZGWXRFX2JpbGxfdHVybnBhZ2VfYnRuXCIsXCJiaWxsX3R1cm5wYWdlX2J0bl9pY29uXCI6XCJ1R2h6Q3h5bF9iaWxsX3R1cm5wYWdlX2J0bl9pY29uXCJ9OyJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./src/web/component/apps/PopBillTurnPage.less\n");

/***/ }),

/***/ "./src/web/component/apps/PopBill.tsx":
/*!********************************************!*\
  !*** ./src/web/component/apps/PopBill.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 _Object$keys = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/keys */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/keys.js\");\nvar _Object$getOwnPropertySymbols = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols.js\");\nvar _filterInstanceProperty = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/filter */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/filter.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 _Object$getOwnPropertyDescriptors = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors.js\");\nvar _Object$defineProperties = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/object/define-properties */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/object/define-properties.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 _WeakMap = __webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/weak-map */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/weak-map.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 _concat = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/concat */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/concat.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 _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/helpers/defineProperty */ \"../../node_modules/@babel/runtime-corejs3/helpers/defineProperty.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 _utils = __webpack_require__(/*! @/utils */ \"./src/utils/index.tsx\");\nvar _PopBill = _interopRequireDefault(__webpack_require__(/*! ./PopBill.less */ \"./src/web/component/apps/PopBill.less\"));\nvar _kdesign = __webpack_require__(/*! kd_libs/kdesign1 */ \"webpack/container/remote/kd_libs/kdesign1\");\nvar _ShareButton = _interopRequireDefault(__webpack_require__(/*! ../common/ShareButton */ \"./src/web/component/common/ShareButton.tsx\"));\nvar _WebUI = __webpack_require__(/*! nocode_component/WebUI */ \"webpack/container/remote/nocode_component/WebUI\");\nvar _PopBillTurnPage = _interopRequireDefault(__webpack_require__(/*! ./PopBillTurnPage */ \"./src/web/component/apps/PopBillTurnPage.tsx\"));\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 _apps = __webpack_require__(/*! @/actions/apps */ \"./src/actions/apps.ts\");\nvar _FormDetailFooterLayout = _interopRequireDefault(__webpack_require__(/*! @/web/layout/apps/FormDetailFooterLayout */ \"./src/web/layout/apps/FormDetailFooterLayout.tsx\"));\nvar _useFormMeta = _interopRequireDefault(__webpack_require__(/*! @/hooks/useFormMeta */ \"./src/hooks/useFormMeta.ts\"));\nvar _useAppContext2 = _interopRequireDefault(__webpack_require__(/*! @/hooks/useAppContext */ \"./src/hooks/useAppContext.js\"));\nvar _FormDataListAuthProvider = __webpack_require__(/*! ../common/FormDataListAuthProvider */ \"./src/web/component/common/FormDataListAuthProvider.tsx\");\nvar _NocodeEntry = _interopRequireDefault(__webpack_require__(/*! ../common/NocodeEntry */ \"./src/web/component/common/NocodeEntry.tsx\"));\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 = _filterInstanceProperty(o).call(o, 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) { (0, _defineProperty2.default)(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; } /*\n * @Description:\n * @Author: 陈晓峰\n * @Date: 2022-08-29 15:48:49\n * @LastEditTime: 2023-09-20 16:34:36\n * @Last Modified by: jianhang_he\n */ // import { useParams } from 'react-router-dom'\n// import { deleteFormDataListItem } from '@/actions/apps'\n// import { printContent, printWrapper } from '@/utils/print'\n// import ReactDOM from 'react-dom'\n// import QRCode from '../common/QRCode'\n// import { Context } from '@/app'\n// import { PopBillSkeleton } from '@/web/component/skeleton/PopBillSkeleton'\n\n// const NocodeEntry = lazy(() => import('bos_core/Main'))\n\n// const PAGE_STATUS = ['addNew', 'edit', 'view']\n\nvar PopNocodeEntry = (0, _react.memo)(function (_ref) {\n  var config = _ref.config,\n    onRefresh = _ref.onRefresh,\n    disabled = _ref.disabled,\n    disabledMsg = _ref.disabledMsg,\n    billList = _ref.billList,\n    visible = _ref.visible,\n    showDelete = _ref.showDelete,\n    showEdit = _ref.showEdit,\n    showCopy = _ref.showCopy,\n    viewAuth = _ref.viewAuth,\n    close = _ref.close,\n    editShare = _ref.editShare,\n    detailShareReqireLogin = _ref.detailShareReqireLogin,\n    detailShareNotReqireLogin = _ref.detailShareNotReqireLogin,\n    inputShareReqireLogin = _ref.inputShareReqireLogin,\n    inputShareNotReqireLogin = _ref.inputShareNotReqireLogin;\n  var bosRef = (0, _react.useRef)(null);\n  // const checkboxRef = useRef<any>(null)\n  var appId = config.appId,\n    targetFormId = config.targetFormId,\n    pkId = config.pkId,\n    Status = config.Status,\n    procInstId = config.procInstId,\n    userTaskActivityId = config.userTaskActivityId,\n    userTaskBusinessKey = config.userTaskBusinessKey,\n    userTaskCurrentUserId = config.userTaskCurrentUserId,\n    taskId = config.taskId;\n  var _useState = (0, _react.useState)(pkId),\n    _useState2 = (0, _slicedToArray2.default)(_useState, 2),\n    curPkId = _useState2[0],\n    setCurPkId = _useState2[1];\n  var _useState3 = (0, _react.useState)(Status),\n    _useState4 = (0, _slicedToArray2.default)(_useState3, 2),\n    status = _useState4[0],\n    setStatus = _useState4[1];\n  var _useState5 = (0, _react.useState)(false),\n    _useState6 = (0, _slicedToArray2.default)(_useState5, 2),\n    modalVisible = _useState6[0],\n    setModalVisible = _useState6[1]; // 弹窗\n  // const [isNew, setIsNew] = useState(Status === 'addNew') // 是否录入\n  // const [isEdit, setIsEdit] = useState(Status === 'addNew' || Status === 'edit') // 是否编辑态\n  var _useState7 = (0, _react.useState)([]),\n    _useState8 = (0, _slicedToArray2.default)(_useState7, 2),\n    approvalData = _useState8[0],\n    setApprovalData = _useState8[1]; // 审批列表\n  var _useState9 = (0, _react.useState)(false),\n    _useState10 = (0, _slicedToArray2.default)(_useState9, 2),\n    formLock = _useState10[0],\n    setFormLock = _useState10[1]; // 审批列表\n  var bosFocus = (0, _react.useRef)(false); // bos是否有获焦点\n  var _useState11 = (0, _react.useState)(null),\n    _useState12 = (0, _slicedToArray2.default)(_useState11, 2),\n    bosApi = _useState12[0],\n    setBosApi = _useState12[1];\n  var _useState13 = (0, _react.useState)(false),\n    _useState14 = (0, _slicedToArray2.default)(_useState13, 2),\n    loading = _useState14[0],\n    setLoading = _useState14[1];\n  var createUiActionDataStr = (0, _react.useCallback)(function (actionName) {\n    var _context, _context2;\n    return (0, _concat.default)(_context = (0, _concat.default)(_context2 = \"\".concat(appId, \"|\")).call(_context2, targetFormId, \"|\")).call(_context, actionName);\n  }, [appId, targetFormId]);\n\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 hasFlow = (0, _react.useMemo)(function () {\n    return approvalData.length > 0;\n  }, [approvalData]); // 判断是否显示流程列表\n  var _useAppContext = (0, _useAppContext2.default)(),\n    state = _useAppContext.state,\n    sendUiData = _useAppContext.sendUiData;\n  var meta = (0, _useFormMeta.default)(targetFormId);\n  var metaRef = (0, _react.useRef)();\n  var authContext = (0, _react.useContext)(_FormDataListAuthProvider.AuthorizeContext) || {};\n  var authList = authContext.authList;\n  var _ref2 = authList || {},\n    printAuth = _ref2.printAuth;\n  (0, _react.useEffect)(function () {\n    metaRef.current = meta;\n  }, [meta]);\n\n  // 兼容组件直接引入时，无法获取pkId\n  (0, _react.useEffect)(function () {\n    setCurPkId(pkId);\n  }, [pkId]);\n\n  // 翻阅下一条记录时，重新LOAD动态表单\n  (0, _react.useEffect)(function () {\n    var _bosApi$loadPage;\n    bosApi === null || bosApi === void 0 || (_bosApi$loadPage = bosApi.loadPage) === null || _bosApi$loadPage === void 0 || _bosApi$loadPage.call(bosApi, _objectSpread(_objectSpread({}, config), {}, {\n      pkId: curPkId\n    }));\n  }, [curPkId]);\n  (0, _react.useEffect)(function () {\n    // 状态更新\n    setStatus(config.Status);\n  }, [config.Status]);\n  var isEdit = (0, _react.useMemo)(function () {\n    return (0, _utils.isEditStatus)(status || '');\n  }, [_utils.isEditStatus, status]); // 是否录入\n  var isNew = (0, _react.useMemo)(function () {\n    return status === 'addNew';\n  }, [status]); // 是否编辑态\n  /**\n   * 请求审批列表\n   * @param entityNumber targetFormId\n   * @param businessKey pkId\n   */\n  var fetchFlowList = (0, _react.useCallback)(function () {\n    setLoading(true);\n    (0, _apps.getApprovalInfo)({\n      entityNumber: targetFormId,\n      businessKey: curPkId\n    }).then(function (res) {\n      setLoading(false);\n      setApprovalData((res === null || res === void 0 ? void 0 : res.rows) || []);\n    }).catch(function () {\n      setLoading(false);\n    });\n  }, [targetFormId, curPkId]);\n  (0, _react.useEffect)(function () {\n    if (targetFormId && curPkId) {\n      // 获取审核列表\n      fetchFlowList();\n    }\n  }, [targetFormId, curPkId, visible, fetchFlowList]);\n\n  // 用户审批意见提交\n  var refreshDatas = (0, _react.useCallback)(function () {\n    onRefresh === null || onRefresh === void 0 || onRefresh();\n    close === null || close === void 0 || close();\n  }, [onRefresh]);\n\n  // // 检查是否成功\n  // const checkSuccess = useCallback((res) => {\n  //   const reg = /\\{\"p\":\\[\\{\"duration\":(\\S+),\"type\":(\\S+),\"content\":\"(\\S+)\"\\}\\],\"a\":\"(\\S+)\"\\}/\n  //   const notice = JSON.stringify(res).match(reg)\n  //   return !!(notice && notice?.[2] === '0')\n  // }, [])\n\n  // 关闭面板前检查是否要保存内容\n  var closeHandle = (0, _react.useCallback)(function () {\n    var check = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n    document.body.removeAttribute('style');\n    if (bosFocus.current && check && (status === 'edit' || status === 'addNew')) {\n      // 若表单内控件曾经有聚焦则需要弹出提示\n      setModalVisible(true);\n    } else {\n      close === null || close === void 0 || close();\n    }\n  }, [status, close]);\n\n  // 返回跳转地址\n  var getUrl = (0, _react.useCallback)(function (appId, targetFormId, pkId, status, procInstId, taskId, type) {\n    if (type === 'print') {\n      var _context3, _context4;\n      return (0, _concat.default)(_context3 = (0, _concat.default)(_context4 = \"/\".concat(appId, \"/print/\")).call(_context4, targetFormId, \"/\")).call(_context3, pkId, \"/view\");\n    }\n    // 复制时，使用的地址应该是录入界面的\n    if (!pkId || isNew) {\n      var _context5;\n      return (0, _concat.default)(_context5 = \"/\".concat(appId, \"/detail/\")).call(_context5, targetFormId);\n    } else {\n      var _context14, _context15;\n      if (status) {\n        var _context11, _context12, _context13;\n        // 打表表单界面\n        if (procInstId) {\n          var _context6, _context7, _context8, _context9, _context10;\n          // 打开流程详情界面\n          var str = (0, _concat.default)(_context6 = (0, _concat.default)(_context7 = (0, _concat.default)(_context8 = (0, _concat.default)(_context9 = \"/\".concat(appId, \"/detail/\")).call(_context9, targetFormId, \"/\")).call(_context8, pkId, \"/\")).call(_context7, status, \"/flow/\")).call(_context6, procInstId);\n          return taskId ? (0, _concat.default)(_context10 = \"\".concat(str, \"/task/\")).call(_context10, taskId) : str;\n        }\n        return (0, _concat.default)(_context11 = (0, _concat.default)(_context12 = (0, _concat.default)(_context13 = \"/\".concat(appId, \"/detail/\")).call(_context13, targetFormId, \"/\")).call(_context12, pkId, \"/\")).call(_context11, status);\n      }\n      return (0, _concat.default)(_context14 = (0, _concat.default)(_context15 = \"/\".concat(appId, \"/detail/\")).call(_context15, targetFormId, \"/\")).call(_context14, pkId);\n    }\n  }, [isNew]);\n  var disabledCb = (0, _react.useCallback)(function () {\n    return (0, _utils.showNotice)('error', disabledMsg);\n  }, []);\n\n  // 分享\n  var handleClickShare = disabled ? disabledCb : undefined;\n  var openPath = getUrl(appId, targetFormId, curPkId, status, procInstId, taskId, '');\n  var openPrintPath = getUrl(appId, targetFormId, curPkId, status, procInstId, taskId, 'print');\n\n  // 分享弹窗的标题\n  var shareModalTitle = (0, _react.useMemo)(function () {\n    if (!curPkId) return '';\n    if (isEdit) return '编辑';\n    return '详情';\n  }, [curPkId, isEdit]);\n\n  // 是否显示分享按钮\n  var showShare = (0, _react.useMemo)(function () {\n    return isEdit ? isNew ? inputShareNotReqireLogin || inputShareReqireLogin : editShare : detailShareReqireLogin || detailShareNotReqireLogin;\n  }, [isNew, isEdit, editShare, detailShareReqireLogin, detailShareNotReqireLogin, inputShareNotReqireLogin, inputShareReqireLogin]);\n  var showPrint = (0, _react.useMemo)(function () {\n    return printAuth && status === 'view' && !procInstId;\n  }, [status, printAuth]);\n\n  // 是否免登陆（详情和录入的时候才需要）\n  var allowNoAuth = (0, _react.useMemo)(function () {\n    return status === 'view' || isNew;\n  }, [status, isNew]);\n  var handleOpenNewTab = (0, _react.useCallback)(function () {\n    (0, _utils.openner)(openPath);\n    closeHandle(false);\n  }, [openPath, disabledMsg, closeHandle]);\n\n  // 关闭弹窗事件\n  var onModalAction = (0, _react.useCallback)(function (key) {\n    switch (key) {\n      case 'ok':\n        setModalVisible(false);\n        break;\n      case 'cancel':\n        setModalVisible(false);\n        close === null || close === void 0 || close();\n        break;\n    }\n  }, [close]);\n  var handleClickPrint = function handleClickPrint() {\n    if (disabled) return (0, _utils.showNotice)('error', disabledMsg);\n    /* const formDoms = document.getElementsByClassName('kd-nc-grid-panel')\n    const dom = formDoms?.[0]\n    const fullLink = window.location.origin + getFullUrl(`nocode/h/${appId}/detail/${targetFormId}/${pkId}/view`)\n    const qrWrapper = <QRCode class='qrcode' value={fullLink} size={80} />\n    const div = document.createElement('div')\n    ReactDOM.render(qrWrapper, div)\n     setTimeout(() => {\n      const qrDom = div.getElementsByClassName('qrcode')\n      const qrCodeSrc = qrDom[0]?.toDataURL('image/png')\n      const wrapper = printWrapper({ title: metaRef?.current?.caption?.zh_CN, children: dom.innerHTML, qrCodeSrc, company: state?.userInfo?.orgs?.[0]?.orgName })\n      if (dom) {\n        printContent(wrapper)\n      }\n    }) */\n    (0, _utils.openner)(openPrintPath);\n    closeHandle(false);\n  };\n  // 抽屉头部标题\n  var billTitle = (0, _react.useMemo)(function () {\n    return isEdit ? isNew || userTaskActivityId && userTaskBusinessKey && userTaskCurrentUserId ? '录入' : '编辑' : '详情';\n  }, [isEdit, isNew]);\n\n  // 抽屉头部按钮\n  var BillHeader = (0, _react.useMemo)(function () {\n    var _context16, _context17, _context18;\n    return /*#__PURE__*/_react.default.createElement(\"div\", {\n      className: _PopBill.default.nav\n    }, /*#__PURE__*/_react.default.createElement(\"div\", {\n      className: _PopBill.default.title\n    }, billTitle), /*#__PURE__*/_react.default.createElement(\"div\", {\n      className: _PopBill.default.actions\n    }, showPrint && /*#__PURE__*/_react.default.createElement(_WebUI.BtnField, {\n      className: _PopBill.default.actions_item,\n      type: \"text\",\n      \"data-nc-action\": (0, _concat.default)(_context16 = \"\".concat(appId, \"|\")).call(_context16, targetFormId, \"|tb_enterprint\"),\n      onClick: handleClickPrint,\n      text: \"\\u6253\\u5370\",\n      icon: {\n        prefix: 'nocodeplatformicon',\n        type: 'dayin'\n      }\n    }), showShare && /*#__PURE__*/_react.default.createElement(_ShareButton.default, {\n      config: _objectSpread(_objectSpread({}, config), {}, {\n        pkId: curPkId,\n        Status: status\n      }),\n      allowNoAuth: allowNoAuth,\n      shareLink: ['/', \"nocode\", openPath, window.location.search].join(''),\n      modalTitle: shareModalTitle,\n      iconType: \"fenxiang-xian\",\n      className: _PopBill.default.actions_item,\n      onClick: handleClickShare,\n      shareReqireLogin: isEdit ? isNew ? inputShareReqireLogin : editShare : detailShareReqireLogin,\n      shareNotReqireLogin: isEdit ? isNew ? inputShareNotReqireLogin : editShare : detailShareNotReqireLogin,\n      isDetail: true\n    }), procInstId ? null : disabled ? /*#__PURE__*/_react.default.createElement(_WebUI.BtnField, {\n      onClick: function onClick() {\n        return (0, _utils.showNotice)('error', disabledMsg);\n      },\n      \"data-nc-action\": (0, _concat.default)(_context17 = \"\".concat(appId, \"|\")).call(_context17, targetFormId, \"|tb_np\"),\n      type: \"text\",\n      className: _PopBill.default.actions_item,\n      text: \"\\u5728\\u65B0\\u9875\\u9762\\u6253\\u5F00\",\n      icon: {\n        prefix: 'nocodeplatformicon',\n        type: 'zhankai2'\n      }\n    }) : /*#__PURE__*/_react.default.createElement(_WebUI.BtnField, {\n      onClick: handleOpenNewTab,\n      \"data-nc-action\": (0, _concat.default)(_context18 = \"\".concat(appId, \"|\")).call(_context18, targetFormId, \"|tb_np\"),\n      type: \"text\",\n      className: _PopBill.default.actions_item,\n      text: \"\\u5728\\u65B0\\u9875\\u9762\\u6253\\u5F00\",\n      icon: {\n        prefix: 'nocodeplatformicon',\n        type: 'zhankai2'\n      }\n    })));\n  }, [openPath, isEdit, billTitle, isNew, config, curPkId, hasFlow, closeHandle, showShare, allowNoAuth, Status]);\n\n  // BOS挂载上后, 获取表单状态\n  var onRef = (0, _react.useCallback)(function (e) {\n    if (e) {\n      // 这里不能用ref挂载，ref作为props传入子组件有可能不更新\n      setBosApi(e);\n      var _status = e === null || e === void 0 ? void 0 : e.getPageStatus();\n      _status && setStatus(_status);\n    }\n  }, []);\n\n  // 保存的回调函数\n  var saveCallback = (0, _react.useCallback)(function (actions, addAndNew) {\n    !addAndNew && closeHandle(false);\n    bosFocus.current = false;\n    onRefresh === null || onRefresh === void 0 || onRefresh();\n  }, [onRefresh, closeHandle]);\n\n  // 删除的回调函数\n  var delCallback = (0, _react.useCallback)(function () {\n    closeHandle(false);\n    // 处理选中行被删，更新已选条数\n    onRefresh === null || onRefresh === void 0 || onRefresh({\n      type: 'delete',\n      params: {\n        pkId: curPkId\n      }\n    });\n  }, [onRefresh, closeHandle, curPkId]);\n\n  // 复制的回调函数\n  var copyCallback = (0, _react.useCallback)(function () {\n    setApprovalData([]);\n    bosFocus.current = false;\n  }, [onRefresh, closeHandle, curPkId]);\n\n  // 表单状态变化的回调函数\n  var onStatusChange = (0, _react.useCallback)(function (info) {\n    setStatus(info);\n  }, []);\n\n  // 合并配置信息\n  var bosConfig = (0, _react.useMemo)(function () {\n    return _objectSpread(_objectSpread({}, config), {}, {\n      pkId: curPkId\n    });\n  }, [config, curPkId]);\n\n  // 返回关闭弹窗内容\n  var confirmText = (0, _react.useMemo)(function () {\n    if (status === 'addNew') {\n      return {\n        title: '您录入的内容未提交，是否返回提交？',\n        submitBtnTxt: '返回提交'\n      };\n    } else {\n      return {\n        title: '您编辑的内容未保存，是否返回保存？',\n        submitBtnTxt: '返回保存'\n      };\n    }\n  }, [status]);\n\n  // console.log('popbill', pkId, curPkId, config, status)\n\n  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_kdesign.Drawer, {\n    placement: \"right\",\n    visible: visible,\n    keyboard: false,\n    onClose: closeHandle,\n    title: BillHeader,\n    width: hasFlow ? 1180 : 860,\n    destroyOnClose: true,\n    className: _PopBill.default.pop_bill\n  }, /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: _PopBill.default.main,\n    style: {\n      background: bgc\n    }\n  }, /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: _PopBill.default.bill,\n    onFocusCapture: function onFocusCapture() {\n      bosFocus.current = true;\n    }\n  }, /*#__PURE__*/_react.default.createElement(_NocodeEntry.default, {\n    onRef: onRef,\n    config: bosConfig,\n    options: {\n      onStatusChange: onStatusChange,\n      sendUiData: sendUiData,\n      rootConfig: state.rootConfig\n    }\n  })), /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: _PopBill.default.flow\n  }, hasFlow ? /*#__PURE__*/_react.default.createElement(_FlowListLayout.default, {\n    data: approvalData,\n    taskId: taskId,\n    config: bosConfig,\n    setFormLock: setFormLock,\n    onSubmit: refreshDatas\n  }) : null)), /*#__PURE__*/_react.default.createElement(_FormDetailFooterLayout.default, {\n    status: status,\n    disabled: disabled,\n    disabledCb: disabledCb,\n    bosApi: bosApi,\n    authList: {\n      deleteAuth: showDelete,\n      inputAuth: showCopy,\n      editAuth: showEdit,\n      viewAuth: viewAuth\n    },\n    config: bosConfig,\n    isSharePage: false,\n    formLock: formLock,\n    newPkId: curPkId,\n    extraButton: function extraButton() {\n      return /*#__PURE__*/_react.default.createElement(_PopBillTurnPage.default, {\n        billList: billList,\n        curPkId: curPkId,\n        setCurPkId: setCurPkId,\n        createUiActionDataStr: createUiActionDataStr\n      });\n    },\n    setStatus: setStatus,\n    copyCallback: copyCallback,\n    delCallback: delCallback,\n    saveCallback: saveCallback\n  })), modalVisible && /*#__PURE__*/_react.default.createElement(_WebUI.ConfirmModal, {\n    type: \"warning\",\n    visible: modalVisible,\n    title: confirmText.title,\n    actions: [{\n      key: 'cancel',\n      text: '直接退出'\n    }, {\n      key: 'ok',\n      text: confirmText.submitBtnTxt\n    }],\n    onAction: onModalAction\n  }));\n});\nPopNocodeEntry.displayName = 'PopBill';\nvar _default = exports[\"default\"] = PopNocodeEntry;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///./src/web/component/apps/PopBill.tsx\n");

/***/ }),

/***/ "./src/web/component/apps/PopBillTurnPage.tsx":
/*!****************************************************!*\
  !*** ./src/web/component/apps/PopBillTurnPage.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 _map = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/map */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/map.js\"));\nvar _indexOf = _interopRequireDefault(__webpack_require__(/*! @babel/runtime-corejs3/core-js-stable/instance/index-of */ \"../../node_modules/@babel/runtime-corejs3/core-js-stable/instance/index-of.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 _kdesign = __webpack_require__(/*! kd_libs/kdesign1 */ \"webpack/container/remote/kd_libs/kdesign1\");\nvar _WebUI = __webpack_require__(/*! nocode_component/WebUI */ \"webpack/container/remote/nocode_component/WebUI\");\nvar _PopBillTurnPage = _interopRequireDefault(__webpack_require__(/*! ./PopBillTurnPage.less */ \"./src/web/component/apps/PopBillTurnPage.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; }\n/**\n * 表单翻页\n * @param param0\n * @returns\n */\nvar PopBillTurnPage = function PopBillTurnPage(_ref) {\n  var _ref$billList = _ref.billList,\n    billList = _ref$billList === void 0 ? [] : _ref$billList,\n    _ref$curPkId = _ref.curPkId,\n    curPkId = _ref$curPkId === void 0 ? '' : _ref$curPkId,\n    _ref$setCurPkId = _ref.setCurPkId,\n    setCurPkId = _ref$setCurPkId === void 0 ? function () {} : _ref$setCurPkId,\n    createUiActionDataStr = _ref.createUiActionDataStr;\n  var _useState = (0, _react.useState)((0, _map.default)(billList).call(billList, function (item) {\n      return item.id;\n    })),\n    _useState2 = (0, _slicedToArray2.default)(_useState, 2),\n    billPkIdList = _useState2[0],\n    setBillPkIdList = _useState2[1];\n  var billPkIdListLen = billPkIdList.length;\n  (0, _react.useEffect)(function () {\n    // 将[{id: xxx}]转为[xxx, ...]\n    if (billList.length > 0) {\n      setBillPkIdList((0, _map.default)(billList).call(billList, function (item) {\n        return item.id;\n      }));\n    }\n  }, [billList]);\n\n  // 跳到第一个表单\n  var toFirstBillForm = function toFirstBillForm() {\n    if (billPkIdListLen > 1) {\n      var curIndex = (0, _indexOf.default)(billPkIdList).call(billPkIdList, curPkId);\n      var firstIndex = 0;\n      if (curIndex !== firstIndex) {\n        setCurPkId(billPkIdList[firstIndex]);\n      }\n    }\n  };\n\n  // 跳到上一个表单\n  var toPreBillForm = function toPreBillForm() {\n    if (billPkIdListLen > 1) {\n      var curIndex = (0, _indexOf.default)(billPkIdList).call(billPkIdList, curPkId);\n      var preIndex = curIndex - 1; // 上一个index\n      if (preIndex !== -1) {\n        setCurPkId(billPkIdList[preIndex]);\n      }\n    }\n  };\n\n  // 跳到下一个表单\n  var toNextBillForm = function toNextBillForm() {\n    if (billPkIdListLen > 1) {\n      var curIndex = (0, _indexOf.default)(billPkIdList).call(billPkIdList, curPkId);\n      var nextIndex = curIndex + 1; // 下一个index\n      if (nextIndex !== billPkIdListLen) {\n        setCurPkId(billPkIdList[nextIndex]);\n      }\n    }\n  };\n\n  // 跳到最后一个表单\n  var toLastBillForm = function toLastBillForm() {\n    if (billPkIdListLen > 1) {\n      var curIndex = (0, _indexOf.default)(billPkIdList).call(billPkIdList, curPkId);\n      var lastIndex = billPkIdListLen - 1; // 最后一个index\n      if (curIndex !== lastIndex) {\n        setCurPkId(billPkIdList[lastIndex]);\n      }\n    }\n  };\n  var paginationBtnList = [{\n    icon: 'zuiqian',\n    desc: '第一条表单详情',\n    disabled: billPkIdListLen <= 1 || curPkId === billPkIdList[0],\n    userActionName: 'fu_fo_first',\n    onClick: toFirstBillForm\n  }, {\n    icon: 'fangxiangzuo',\n    desc: '上一条详情',\n    disabled: billPkIdListLen <= 1 || curPkId === billPkIdList[0],\n    userActionName: 'fu_fo_prev',\n    onClick: toPreBillForm\n  }, {\n    icon: 'fangxiangyou',\n    desc: '下一条详情',\n    disabled: billPkIdListLen <= 1 || curPkId === billPkIdList[billPkIdListLen - 1],\n    userActionName: 'fu_fo_next',\n    onClick: toNextBillForm\n  }, {\n    icon: 'zuihou',\n    desc: '最后一条详情',\n    disabled: billPkIdListLen <= 1 || curPkId === billPkIdList[billPkIdListLen - 1],\n    userActionName: 'fu_fo_last',\n    onClick: toLastBillForm\n  }];\n  return /*#__PURE__*/_react.default.createElement(\"div\", {\n    className: _PopBillTurnPage.default.bill_turnpage\n  }, (0, _map.default)(paginationBtnList).call(paginationBtnList, function (item) {\n    var disabled = item.disabled,\n      desc = item.desc,\n      icon = item.icon,\n      userActionName = item.userActionName,\n      onClick = item.onClick;\n    return /*#__PURE__*/_react.default.createElement(_WebUI.BtnField, {\n      key: icon,\n      disabled: disabled,\n      onClick: onClick,\n      className: _PopBillTurnPage.default.bill_turnpage_btn,\n      size: \"small\",\n      title: desc,\n      \"data-nc-action\": createUiActionDataStr(userActionName)\n    }, /*#__PURE__*/_react.default.createElement(_kdesign.Icon, {\n      prefix: \"nocodeplatformicon\",\n      className: _PopBillTurnPage.default.bill_turnpage_btn_icon,\n      type: icon\n    }));\n  }));\n};\nPopBillTurnPage.displayName = 'PopBillTurnPage';\nvar _default = exports[\"default\"] = PopBillTurnPage;//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64, \n//# sourceURL=webpack-internal:///./src/web/component/apps/PopBillTurnPage.tsx\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");

/***/ })

}]);