fastlion-amis
Version:
一种MIS页面生成工具
75 lines (74 loc) • 5.76 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var react_1 = tslib_1.__importStar(require("react"));
require("./index.scss");
var utils_1 = require("../utils");
var FlowInformation_1 = (0, tslib_1.__importDefault)(require("../FlowInformation"));
var helper_1 = require("../../../utils/helper");
var tools_1 = require("../../../utils/shell/tools");
var antdCompoentsProxy_1 = require("../../antdCompoentsProxy");
var ScrollMB_1 = (0, tslib_1.__importDefault)(require("../../ScrollMB"));
var FlowProcess = function (props) {
var _a, _b, _c;
var render = props.render, flowDetail = props.flowDetail, language = props.language, env = props.env, onImageEnlarge = props.onImageEnlarge, visibleOpen = props.visibleOpen, handleVisible = props.handleVisible, getFilterForm = props.getFilterForm;
var Mobile = (0, helper_1.isMobile)();
var form = (0, react_1.useRef)();
var _d = (0, react_1.useState)(), formState = _d[0], setFormState = _d[1];
var replacedString = (_a = flowDetail === null || flowDetail === void 0 ? void 0 : flowDetail.flowDesc) === null || _a === void 0 ? void 0 : _a.replace(/\r\n/g, '<br>');
(0, react_1.useEffect)(function () {
getFilterForm(form.current);
}, [form.current]);
var warpNode = (0, react_1.useMemo)(function () {
if (flowDetail) {
return react_1.default.createElement(react_1.default.Fragment, null,
Mobile && react_1.default.createElement(react_1.default.Fragment, null, env && (0, utils_1.handleTltle)(flowDetail, env, function () { handleVisible(true); })),
tools_1.tools.isPc && react_1.default.createElement("div", { className: 'flow-title' }, "\u7533\u8BF7\u8BE6\u60C5"),
flowDetail.formUI &&
react_1.default.createElement("div", { id: "body" + flowDetail.flowProcess.approvalNo + flowDetail.flowProcess.processInstanceId, className: "renderform " + (!Mobile ? "detailed_border" : "") }, render("" + flowDetail.processInstanceId, flowDetail.formUI, {
className: 'renderform_form',
flowProcess: true,
notPrintFieldList: flowDetail.notPrintFieldList,
getFilterForm: function (data) { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () {
var body;
var _a;
return (0, tslib_1.__generator)(this, function (_b) {
switch (_b.label) {
case 0: return [4 /*yield*/, data];
case 1:
body = _b.sent();
if (((_a = flowDetail.formUI) === null || _a === void 0 ? void 0 : _a.name) == body._formName) {
form.current = body;
setFormState(body);
}
return [2 /*return*/];
}
});
}); }
})),
tools_1.tools.isPc && react_1.default.createElement("div", { className: 'flow-title' }, "\u5BA1\u6279\u8BE6\u60C5"),
react_1.default.createElement(FlowInformation_1.default, { flowDetail: flowDetail, processNode: flowDetail.processNodeList, env: env, render: render, onImageEnlarge: onImageEnlarge, language: language }));
}
return null;
}, [flowDetail]);
return (react_1.default.createElement(react_1.default.Fragment, null,
react_1.default.createElement("div", { className: 'detailed_information' },
(0, helper_1.isMobile)() && ((_b = formState === null || formState === void 0 ? void 0 : formState.props) === null || _b === void 0 ? void 0 : _b.initApi) && ((_c = formState === null || formState === void 0 ? void 0 : formState.props) === null || _c === void 0 ? void 0 : _c.isDetail) ?
react_1.default.createElement(ScrollMB_1.default, { scrollConfig: { pullDownRefresh: true, }, onPullingDown: function () { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () {
var _a, _b;
return (0, tslib_1.__generator)(this, function (_c) {
(_b = (_a = form.current) === null || _a === void 0 ? void 0 : _a.pullDown) === null || _b === void 0 ? void 0 : _b.call(_a);
return [2 /*return*/];
});
}); } }, warpNode)
:
warpNode,
react_1.default.createElement(antdCompoentsProxy_1.Drawer, { className: 'process_drawer', width: "100%", visible: visibleOpen, getContainer: env === null || env === void 0 ? void 0 : env.getModalContainer, mask: false, zIndex: 1010, destroyOnClose: false, style: { transform: 'translateX(0px)' }, closable: false, bodyStyle: { backgroundColor: '#fff', lineHeight: '28px' } },
(0, utils_1.handleHeader)(function () { return handleVisible(false); }, tools_1.tools.isComWx ? '' : language('Flow.formdata')),
react_1.default.createElement("div", { style: { overflow: 'auto', flex: '1', padding: '10px' } },
react_1.default.createElement("div", { dangerouslySetInnerHTML: {
__html: replacedString || ''
} }))))));
};
exports.default = FlowProcess;
//# sourceMappingURL=./components/Mobileprocess/FlowProcess/index.js.map