UNPKG

fastlion-amis

Version:

一种MIS页面生成工具

100 lines (99 loc) 6.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var tslib_1 = require("tslib"); var react_1 = (0, tslib_1.__importDefault)(require("react")); var modal_1 = (0, tslib_1.__importDefault)(require("antd/lib/modal")); var button_1 = (0, tslib_1.__importDefault)(require("antd/lib/button")); require("./index.scss"); var antd_1 = require("antd"); var helper_1 = require("../../../utils/helper"); var icons_1 = require("../../../components/icons"); var Submission = function (props) { var visible = props.visible, submission = props.submission, ctx = props.ctx, env = props.env, render = props.render, onClose = props.onClose; var hasFooter = (submission === null || submission === void 0 ? void 0 : submission.sendApi) ? true : false; var handleOk = function () { return (0, tslib_1.__awaiter)(void 0, void 0, void 0, function () { var res; return (0, tslib_1.__generator)(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, env.fetcher(submission.sendApi, (0, tslib_1.__assign)({}, ctx)).finally()]; case 1: res = _a.sent(); if (res.status === 0) { onClose(false); } else { antd_1.message.error(res.msg); } return [2 /*return*/]; } }); }); }; var column = submission === null || submission === void 0 ? void 0 : submission.tableUI.column.map(function (item, index) { return { title: item.label, width: item.name === "taskSeq" ? 30 : 150, dataIndex: item.name, key: index }; }); var data = submission === null || submission === void 0 ? void 0 : submission.tableUI.data.map(function (item, index) { return { key: index, name: item.taskName, userName: item.userName + "(" + item.userId + ")", taskSeq: item.taskSeq }; }); return ((0, helper_1.isMobile)() ? react_1.default.createElement(antd_1.Drawer, { title: "123", headerStyle: { backgroundImage: '-webkit-gradient(linear, left top, right top, from(#2A87EB))', height: '38px', lineHeight: '38px', minHeight: '38px', padding: 0, }, placement: "right", // 点击关闭 onClose: function () { onClose(false); }, width: "100%", // 开关 visible: visible, // destroyOnClose getContainer: env.getModalContainer, mask: false, className: 'tree-drawer search', closeIcon: react_1.default.createElement(icons_1.Icon, { icon: 'left-arrow', className: "icon", style: { fontSize: "18px", color: '#fff' } }), style: { position: 'fixed', height: "100%" }, footer: hasFooter ? react_1.default.createElement(react_1.default.Fragment, null, react_1.default.createElement(button_1.default, { key: 1, style: { marginRight: 10, backgroundColor: "#15bc83", borderColor: "#15bc83", color: 'white' }, onClick: function () { handleOk(); } }, "\u786E\u8BA4"), react_1.default.createElement(button_1.default, { key: 2, style: { marginRight: 10, color: 'white', backgroundColor: "#15bc83", borderColor: "#15bc83" }, onClick: function () { onClose(false); } }, "\u5173\u95ED")) : null }, react_1.default.createElement(antd_1.Table, { columns: column, dataSource: data, pagination: false, size: 'small' })) : react_1.default.createElement(modal_1.default, { className: 'ant-workflow-modal', bodyStyle: { padding: '0', height: "calc(100vh - 165px)", maxHeight: 'unset' }, title: submission === null || submission === void 0 ? void 0 : submission.title, visible: visible, onCancel: function () { return onClose(false); }, getContainer: env.getModalContainer, width: '92%', centered: true, destroyOnClose: true, maskClosable: false, style: { position: 'fixed', top: '54px', right: 0, left: 0, bottom: 0 }, maskStyle: { position: 'fixed', top: '54px', right: 0, left: 0, bottom: 0 }, footer: hasFooter ? react_1.default.createElement(react_1.default.Fragment, null, react_1.default.createElement(button_1.default, { key: 1, style: { marginRight: 10, backgroundColor: "#15bc83", borderColor: "#15bc83", color: 'white' }, onClick: function () { handleOk(); } }, "\u786E\u8BA4"), react_1.default.createElement(button_1.default, { key: 2, style: { marginRight: 10, color: 'white', backgroundColor: "#15bc83", borderColor: "#15bc83" }, onClick: function () { onClose(false); } }, "\u5173\u95ED")) : null }, react_1.default.createElement("div", null, react_1.default.createElement("p", null, "\u63D0\u793A\u4FE1\u606F")), react_1.default.createElement("div", { style: { padding: "20px" } }, react_1.default.createElement(antd_1.Table, { columns: column, dataSource: data, pagination: false, size: 'small' })))); }; exports.default = Submission; //# sourceMappingURL=./renderers/Lion/Submission/index.js.map