@tddc/assign-modal 2.0.3 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/AssignModal/index.js +67 -0
- package/es/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import _Modal from "tntd/es/modal";
|
|
2
|
+
var _excluded = ["visible", "orgList", "dataItem", "close", "disabled", "title", "onSubmit", "appList", "userList", "showUser"];
|
|
3
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
9
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
11
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
12
|
+
import React from "react";
|
|
13
|
+
import { useState } from 'react';
|
|
14
|
+
import AssignApp from './AssignApp';
|
|
15
|
+
import './index.less';
|
|
16
|
+
import Cookies from 'universal-cookie';
|
|
17
|
+
var cookies = new Cookies();
|
|
18
|
+
var AssignModal = function AssignModal(props) {
|
|
19
|
+
var visible = props.visible,
|
|
20
|
+
orgList = props.orgList,
|
|
21
|
+
_props$dataItem = props.dataItem,
|
|
22
|
+
dataItem = _props$dataItem === void 0 ? {} : _props$dataItem,
|
|
23
|
+
close = props.close,
|
|
24
|
+
disabled = props.disabled,
|
|
25
|
+
_props$title = props.title,
|
|
26
|
+
title = _props$title === void 0 ? '' : _props$title,
|
|
27
|
+
onSubmit = props.onSubmit,
|
|
28
|
+
appList = props.appList,
|
|
29
|
+
userList = props.userList,
|
|
30
|
+
showUser = props.showUser,
|
|
31
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
32
|
+
var _useState = useState({}),
|
|
33
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
+
assignData = _useState2[0],
|
|
35
|
+
setAssignData = _useState2[1];
|
|
36
|
+
var submit = function submit() {
|
|
37
|
+
console.log({
|
|
38
|
+
assignData: assignData
|
|
39
|
+
});
|
|
40
|
+
onSubmit(assignData);
|
|
41
|
+
};
|
|
42
|
+
return /*#__PURE__*/React.createElement(_Modal, {
|
|
43
|
+
className: "modelTool-assign",
|
|
44
|
+
title: title,
|
|
45
|
+
visible: visible,
|
|
46
|
+
width: showUser ? '80%' : '65%',
|
|
47
|
+
onCancel: close,
|
|
48
|
+
onOk: submit,
|
|
49
|
+
maskClosable: false,
|
|
50
|
+
destroyOnClose: true,
|
|
51
|
+
okButtonProps: {
|
|
52
|
+
disabled: disabled
|
|
53
|
+
}
|
|
54
|
+
}, /*#__PURE__*/React.createElement(AssignApp, _extends({
|
|
55
|
+
dataItem: dataItem,
|
|
56
|
+
orgList: orgList,
|
|
57
|
+
appList: appList,
|
|
58
|
+
userList: userList,
|
|
59
|
+
onChange: function onChange(data) {
|
|
60
|
+
setAssignData(data);
|
|
61
|
+
},
|
|
62
|
+
disabled: disabled,
|
|
63
|
+
lang: (props === null || props === void 0 ? void 0 : props.lang) || cookies.get('lang') || 'cn',
|
|
64
|
+
showUser: showUser
|
|
65
|
+
}, restProps)));
|
|
66
|
+
};
|
|
67
|
+
export default AssignModal;
|
package/es/index.js
CHANGED