@bit-sun/business-component 2.0.1 → 2.0.2
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/dist/components/Functional/AddSelect/index.d.ts +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +926 -2
- package/dist/index.js +925 -0
- package/package.json +1 -1
- package/src/components/Functional/AddSelect/index.less +275 -0
- package/src/components/Functional/AddSelect/index.md +118 -0
- package/src/components/Functional/AddSelect/index.tsx +795 -0
- package/src/index.ts +1 -0
package/dist/index.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import React, { createContext, useContext, useEffect, forwardRef, createElement, useState, useMemo, useRef } from 'react';
|
|
3
|
-
import { message, Menu, Space, Dropdown, Tooltip, Button, Checkbox, Input, Modal, Select, Form, Divider, Spin, Table, TreeSelect, Tag } from 'antd';
|
|
3
|
+
import { message, Menu, Space, Dropdown, Tooltip, Button, Checkbox, Input, Modal, Select, Form, Divider, Spin, Table, TreeSelect, Tag, InputNumber } from 'antd';
|
|
4
4
|
import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import _ from 'loadsh';
|
|
@@ -1921,6 +1921,19 @@ var CaretLeftOutlined$1 = function CaretLeftOutlined$1(props, ref) {
|
|
|
1921
1921
|
CaretLeftOutlined$1.displayName = 'CaretLeftOutlined';
|
|
1922
1922
|
var CaretLeftOutlined$2 = /*#__PURE__*/forwardRef(CaretLeftOutlined$1);
|
|
1923
1923
|
|
|
1924
|
+
// This icon file is generated automatically.
|
|
1925
|
+
var CloseCircleOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z" } }, { "tag": "path", "attrs": { "d": "M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" } }] }, "name": "close-circle", "theme": "outlined" };
|
|
1926
|
+
|
|
1927
|
+
var CloseCircleOutlined$1 = function CloseCircleOutlined$1(props, ref) {
|
|
1928
|
+
return /*#__PURE__*/createElement(Icon, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
|
|
1929
|
+
ref: ref,
|
|
1930
|
+
icon: CloseCircleOutlined
|
|
1931
|
+
}));
|
|
1932
|
+
};
|
|
1933
|
+
|
|
1934
|
+
CloseCircleOutlined$1.displayName = 'CloseCircleOutlined';
|
|
1935
|
+
var CloseCircleOutlined$2 = /*#__PURE__*/forwardRef(CloseCircleOutlined$1);
|
|
1936
|
+
|
|
1924
1937
|
// This icon file is generated automatically.
|
|
1925
1938
|
var CopyOutlined = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z" } }] }, "name": "copy", "theme": "outlined" };
|
|
1926
1939
|
|
|
@@ -4373,6 +4386,917 @@ var SearchSelect = function SearchSelect(props) {
|
|
|
4373
4386
|
}), " \u5168\u9009\u6240\u6709\u9875\u9762") : '')))));
|
|
4374
4387
|
};
|
|
4375
4388
|
|
|
4389
|
+
var css_248z$4 = ".add_select_show {\n display: flex;\n}\n.add_select_expand_button {\n position: relative;\n width: 30px;\n color: #ffffff;\n cursor: pointer;\n}\n.add_select_expand_button span {\n position: absolute;\n height: 20px;\n line-height: 14px;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n.add_select_header {\n border-bottom: 1px solid #D9D9D9;\n height: 24px;\n height: 40px;\n font-family: PingFangSC-Medium;\n font-weight: 500;\n font-size: 18px;\n color: #000000;\n letter-spacing: 0;\n line-height: 40px;\n margin-bottom: 10px;\n padding-left: 10px;\n}\n.add_select_header > span {\n margin-left: 20px;\n font-weight: 400;\n font-size: 12px;\n color: #666666;\n letter-spacing: 0;\n line-height: 40px;\n}\n.add_select_header > span > span {\n color: #ff0000;\n}\n.add_select_header_close span {\n position: absolute;\n color: black !important;\n right: 10px;\n top: 10px;\n}\n.add_select_wrapper {\n position: relative;\n display: flex;\n max-height: 60vh;\n overflow: hidden;\n font-size: 14px;\n margin: 5px 10px;\n}\n.add_select_wrapper .ant-table-pagination.ant-pagination {\n margin: 5px;\n padding-right: 5px;\n}\n.add_select_wrapper .ant-checkbox-wrapper {\n justify-content: center;\n}\n.add_select_wrapper .ant-table-thead th {\n height: 20px !important;\n padding: 0px 8px !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n line-height: 20px !important;\n}\n.add_select_wrapper .ant-modal-body {\n padding: 10px;\n}\n.add_select_wrapper .ant-table-wrapper {\n padding: 0px !important;\n}\n.add_select_wrapper .row-class {\n height: 24px;\n}\n.add_select_wrapper .row-class td {\n font-size: 12px !important;\n height: 24px !important;\n padding: 0px 8px !important;\n line-height: 20px !important;\n}\n.add_select_wrapper .ant-table-body {\n height: 240px;\n overflow-y: auto !important;\n}\n.add_select_wrapper .ant-row.ant-form-item {\n margin-bottom: 10px;\n}\n.add_select_wrapper_click_flag {\n position: absolute;\n z-index: 10;\n}\n.add_select_wrapper_click_flag_arrow {\n transform: rotate(0deg);\n transition: transform 0.5s;\n}\n.add_select_wrapper_click_flag_arrow_1 {\n transform: rotate(-180deg);\n transition: transform 0.5s;\n}\n.add_select_wrapper_left {\n flex-basis: 298px;\n width: 298px;\n overflow-y: hidden;\n transition: all 0.3s;\n margin-right: 10px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n}\n.add_select_wrapper_left1 {\n width: 0;\n height: 0;\n transition: all 0.3s;\n display: none;\n}\n.add_select_wrapper_right {\n width: 872px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n}\n.add_select_wrapper_right1 {\n width: 100%;\n margin-left: 10px;\n}\n.add_select_wrapper_right,\n.add_select_wrapper_right1 {\n overflow-x: auto;\n}\n.add_select_wrapper .select_list_columns {\n height: 272px;\n overflow-y: auto;\n border-bottom: 1px solid #D9D9D9;\n}\n.add_select_wrapper .select_list_columns_tips {\n background: #eee;\n padding: 6px 20px;\n margin-bottom: 10px;\n}\n.add_select_wrapper .select_list_columns_formItems {\n padding: 10px;\n}\n.add_select_wrapper .select_list_searchButton {\n display: flex;\n margin: 10px;\n justify-content: flex-end;\n}\n.add_select_wrapper .select_list_button_space {\n margin-right: 10px;\n}\n.add_select_wrapper .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 24px;\n font-size: 12px;\n line-height: 24px;\n background: #F7F8FB;\n padding: 0 5px;\n border-bottom: 1px solid #D9D9D9;\n}\n.add_select_wrapper .select_list_selectAll {\n position: relative;\n top: -40px;\n left: 20px;\n width: 160px;\n}\n.add_select_wrapper_select {\n margin-top: 4px;\n border: 1px solid #D9D9D9;\n border-radius: 5px;\n margin: 5px 10px;\n}\n.add_select_wrapper_select .ant-table-pagination.ant-pagination {\n margin: 9px;\n padding-right: 5px;\n}\n.add_select_wrapper_select .ant-modal-body {\n padding: 10px;\n}\n.add_select_wrapper_select .ant-table-wrapper {\n padding: 0px !important;\n}\n.add_select_wrapper_select .ant-table-thead th {\n height: 23px !important;\n padding: 0px 8px !important;\n font-size: 12px !important;\n font-weight: 600 !important;\n line-height: 23px !important;\n}\n.add_select_wrapper_select .ant-modal-close-x {\n height: 30px;\n}\n.add_select_wrapper_select .row-class {\n height: 30px;\n}\n.add_select_wrapper_select .row-class td {\n font-size: 12px !important;\n height: 30px !important;\n padding: 4px 8px !important;\n}\n.add_select_wrapper_select .ant-table-body {\n height: 200px;\n overflow-y: auto !important;\n}\n.add_select_wrapper_select .ant-row.ant-form-item {\n margin-bottom: 10px;\n}\n.add_select_wrapper_select .ant-input-number-input {\n height: auto;\n}\n.add_select_wrapper_select .select_list_selectTips {\n display: flex;\n justify-content: space-between;\n height: 24px;\n font-size: 12px;\n line-height: 24px;\n background: #F7F8FB;\n padding: 0 3px;\n border-bottom: 1px solid #D9D9D9;\n}\n";
|
|
4390
|
+
styleInject(css_248z$4);
|
|
4391
|
+
|
|
4392
|
+
var Option$1 = Select.Option;
|
|
4393
|
+
|
|
4394
|
+
var AddSelect = function AddSelect(props) {
|
|
4395
|
+
var value = props.value,
|
|
4396
|
+
onChange = props.onChange,
|
|
4397
|
+
_props$selectProps = props.selectProps,
|
|
4398
|
+
selectProps = _props$selectProps === void 0 ? {} : _props$selectProps,
|
|
4399
|
+
_props$modalTableProp = props.modalTableProps,
|
|
4400
|
+
modalTableProps = _props$modalTableProp === void 0 ? {} : _props$modalTableProp,
|
|
4401
|
+
_props$labelInValue = props.labelInValue,
|
|
4402
|
+
labelInValue = _props$labelInValue === void 0 ? false : _props$labelInValue,
|
|
4403
|
+
requestConfig = props.requestConfig,
|
|
4404
|
+
ctx = props.ctx,
|
|
4405
|
+
sourceName = props.sourceName,
|
|
4406
|
+
_props$needModalTable = props.needModalTable,
|
|
4407
|
+
needModalTable = _props$needModalTable === void 0 ? true : _props$needModalTable,
|
|
4408
|
+
_props$getPopupContai = props.getPopupContainer,
|
|
4409
|
+
onSaveCallback = props.onSaveCallback;
|
|
4410
|
+
|
|
4411
|
+
var _ref = requestConfig || {},
|
|
4412
|
+
url = _ref.url,
|
|
4413
|
+
otherParams = _ref.otherParams,
|
|
4414
|
+
isMap = _ref.isMap,
|
|
4415
|
+
fixedparameter = _ref.fixedparameter,
|
|
4416
|
+
fieldValToParam = _ref.fieldValToParam,
|
|
4417
|
+
_ref$mappingTextField = _ref.mappingTextField,
|
|
4418
|
+
mappingTextField = _ref$mappingTextField === void 0 ? 'name' : _ref$mappingTextField,
|
|
4419
|
+
mappingTextShowKeyField = _ref.mappingTextShowKeyField,
|
|
4420
|
+
_ref$mappingValueFiel = _ref.mappingValueField,
|
|
4421
|
+
mappingValueField = _ref$mappingValueFiel === void 0 ? 'code' : _ref$mappingValueFiel,
|
|
4422
|
+
mappingTextShowTextField = _ref.mappingTextShowTextField;
|
|
4423
|
+
|
|
4424
|
+
var resultSourceKey = sourceName || (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.sourceName) || 'supplierCode';
|
|
4425
|
+
var selectMode = selectProps === null || selectProps === void 0 ? void 0 : selectProps.mode; // 设定当前选择器 为单选或者多选模式 无设定为单选模式(默认)
|
|
4426
|
+
|
|
4427
|
+
var initVal = value || (selectMode ? [] : null);
|
|
4428
|
+
var pageSize = 100; // 下拉框默认分页 条数
|
|
4429
|
+
|
|
4430
|
+
var tableInitPageSize = 10; // 弹框默认分页 条数
|
|
4431
|
+
|
|
4432
|
+
var currentPage = 1;
|
|
4433
|
+
var selectParamsKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filter) || 'qp-codeAndName-like';
|
|
4434
|
+
var selectParamsInitKey = (requestConfig === null || requestConfig === void 0 ? void 0 : requestConfig.filterInit) || selectParamsKey;
|
|
4435
|
+
|
|
4436
|
+
var currentSelectProps = _objectSpread2(_objectSpread2({}, selectProps), {}, {
|
|
4437
|
+
// 以下属性不可更改----设计配置项
|
|
4438
|
+
showSearch: false,
|
|
4439
|
+
filterOption: false,
|
|
4440
|
+
allowClear: true,
|
|
4441
|
+
listHeight: 160,
|
|
4442
|
+
optionLabelProp: "label",
|
|
4443
|
+
autoClearSearchValue: false
|
|
4444
|
+
});
|
|
4445
|
+
|
|
4446
|
+
var _useState = useState([]),
|
|
4447
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
4448
|
+
items = _useState2[0],
|
|
4449
|
+
setItems = _useState2[1];
|
|
4450
|
+
|
|
4451
|
+
var _useState3 = useState(1),
|
|
4452
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
4453
|
+
scrollPage = _useState4[0],
|
|
4454
|
+
setScrollPage = _useState4[1];
|
|
4455
|
+
|
|
4456
|
+
var _useState5 = useState(0),
|
|
4457
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
4458
|
+
itemsTotal = _useState6[0],
|
|
4459
|
+
setItemsTotal = _useState6[1];
|
|
4460
|
+
|
|
4461
|
+
var _useState7 = useState(false),
|
|
4462
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
4463
|
+
fetching = _useState8[0],
|
|
4464
|
+
setFetching = _useState8[1];
|
|
4465
|
+
|
|
4466
|
+
var _useState9 = useState(''),
|
|
4467
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
4468
|
+
searchValue = _useState10[0],
|
|
4469
|
+
setSearchValue = _useState10[1];
|
|
4470
|
+
|
|
4471
|
+
var _useState11 = useState(false),
|
|
4472
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
4473
|
+
isModalVisible = _useState12[0],
|
|
4474
|
+
setIsModalVisible = _useState12[1];
|
|
4475
|
+
|
|
4476
|
+
var _useState13 = useState(initVal),
|
|
4477
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
4478
|
+
popvalue = _useState14[0],
|
|
4479
|
+
setPopValue = _useState14[1];
|
|
4480
|
+
|
|
4481
|
+
var _useState15 = useState(sourceName),
|
|
4482
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
4483
|
+
uniqueValue = _useState16[0],
|
|
4484
|
+
setUniqueValue = _useState16[1];
|
|
4485
|
+
|
|
4486
|
+
var _useDebounceFn = useDebounceFn(function (v) {
|
|
4487
|
+
// 优化搜索参数 支持传多个
|
|
4488
|
+
var searchParams = {};
|
|
4489
|
+
|
|
4490
|
+
if (typeof selectParamsKey === 'string') {
|
|
4491
|
+
searchParams = v ? _defineProperty({}, selectParamsInitKey, initVal) : _defineProperty({}, selectParamsKey, searchValue);
|
|
4492
|
+
}
|
|
4493
|
+
|
|
4494
|
+
if (Array.isArray(selectParamsKey)) {
|
|
4495
|
+
selectParamsKey.forEach(function (i) {
|
|
4496
|
+
searchParams = _objectSpread2(_objectSpread2({}, searchParams), {}, _defineProperty({}, i, searchValue));
|
|
4497
|
+
});
|
|
4498
|
+
} // 防抖函数 待定
|
|
4499
|
+
|
|
4500
|
+
|
|
4501
|
+
getData(searchParams);
|
|
4502
|
+
}, {
|
|
4503
|
+
wait: 1000
|
|
4504
|
+
}),
|
|
4505
|
+
run = _useDebounceFn.run;
|
|
4506
|
+
|
|
4507
|
+
var _Form$useForm = Form.useForm(),
|
|
4508
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
4509
|
+
form = _Form$useForm2[0];
|
|
4510
|
+
|
|
4511
|
+
var _useState17 = useState(true),
|
|
4512
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
4513
|
+
caretLeftFlag = _useState18[0],
|
|
4514
|
+
setCaretLeftFlag = _useState18[1];
|
|
4515
|
+
|
|
4516
|
+
var _useState19 = useState([]),
|
|
4517
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
4518
|
+
tableData = _useState20[0],
|
|
4519
|
+
setTableData = _useState20[1];
|
|
4520
|
+
|
|
4521
|
+
var _useState21 = useState({
|
|
4522
|
+
total: 0,
|
|
4523
|
+
size: "small",
|
|
4524
|
+
current: 1,
|
|
4525
|
+
pageSize: tableInitPageSize
|
|
4526
|
+
}),
|
|
4527
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
4528
|
+
tablePagination = _useState22[0],
|
|
4529
|
+
setTablePagination = _useState22[1];
|
|
4530
|
+
|
|
4531
|
+
var _useState23 = useState([]),
|
|
4532
|
+
_useState24 = _slicedToArray(_useState23, 2),
|
|
4533
|
+
selectedRowKeys = _useState24[0],
|
|
4534
|
+
setSelectedRowKeys = _useState24[1];
|
|
4535
|
+
|
|
4536
|
+
var _useState25 = useState([]),
|
|
4537
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
4538
|
+
doubleArr = _useState26[0],
|
|
4539
|
+
setDoubleArr = _useState26[1]; // 存放双数组的数组
|
|
4540
|
+
|
|
4541
|
+
|
|
4542
|
+
var _useState27 = useState(false),
|
|
4543
|
+
_useState28 = _slicedToArray(_useState27, 2),
|
|
4544
|
+
checkedAll = _useState28[0],
|
|
4545
|
+
setCheckedAll = _useState28[1];
|
|
4546
|
+
|
|
4547
|
+
var _useState29 = useState(false),
|
|
4548
|
+
_useState30 = _slicedToArray(_useState29, 2),
|
|
4549
|
+
indeterminate = _useState30[0],
|
|
4550
|
+
setIndeterminate = _useState30[1];
|
|
4551
|
+
|
|
4552
|
+
var _useState31 = useState({}),
|
|
4553
|
+
_useState32 = _slicedToArray(_useState31, 2),
|
|
4554
|
+
tableFormParams = _useState32[0],
|
|
4555
|
+
setTableFormParams = _useState32[1]; // 获取数据源 (type: 1下拉框 2弹框 不传值默认为下拉框)
|
|
4556
|
+
|
|
4557
|
+
|
|
4558
|
+
var getData = function getData() {
|
|
4559
|
+
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
4560
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
4561
|
+
if (!requestConfig) return;
|
|
4562
|
+
setFetching(true); // 处理dependence参数
|
|
4563
|
+
|
|
4564
|
+
var fixedParam = {};
|
|
4565
|
+
|
|
4566
|
+
if (fixedparameter && fieldValToParam && ctx) {
|
|
4567
|
+
fixedparameter.forEach(function (item, index) {
|
|
4568
|
+
var fixedParamVal = ctx.form.getFieldValue(fieldValToParam[index]);
|
|
4569
|
+
|
|
4570
|
+
if (fixedParamVal) {
|
|
4571
|
+
fixedParam[item] = fixedParamVal;
|
|
4572
|
+
form.setFieldsValue(_objectSpread2(_objectSpread2({}, form === null || form === void 0 ? void 0 : form.getFieldsValue()), {}, _defineProperty({}, item, fixedParamVal)));
|
|
4573
|
+
}
|
|
4574
|
+
});
|
|
4575
|
+
} // 数组对象处理,对带有特殊标记的name进行处理
|
|
4576
|
+
|
|
4577
|
+
|
|
4578
|
+
for (var key in params) {
|
|
4579
|
+
if (Object.prototype.hasOwnProperty.call(params, key)) {
|
|
4580
|
+
(function () {
|
|
4581
|
+
var element = params[key];
|
|
4582
|
+
|
|
4583
|
+
if (element && key.indexOf('*number*') >= 0) {
|
|
4584
|
+
var dataParams = key.split('*number*');
|
|
4585
|
+
dataParams.forEach(function (value, index) {
|
|
4586
|
+
params[value] = element[index];
|
|
4587
|
+
});
|
|
4588
|
+
delete params[key];
|
|
4589
|
+
} else if (element && key.indexOf('*address*') >= 0) {
|
|
4590
|
+
var _dataParams = key.split('*address*');
|
|
4591
|
+
|
|
4592
|
+
_dataParams.forEach(function (value, index) {
|
|
4593
|
+
params[value] = element.PCDCode[index];
|
|
4594
|
+
});
|
|
4595
|
+
|
|
4596
|
+
delete params[key];
|
|
4597
|
+
} else if (element && key.indexOf('*costType*') >= 0) {
|
|
4598
|
+
var _dataParams2 = key.split('*costType*'); // eslint-disable-next-line prefer-destructuring
|
|
4599
|
+
|
|
4600
|
+
|
|
4601
|
+
params[_dataParams2[0]] = element[1];
|
|
4602
|
+
delete params[key];
|
|
4603
|
+
} else if (element && key.indexOf('*fullDate*') >= 0) {
|
|
4604
|
+
var _dataParams3 = key.split('*fullDate*');
|
|
4605
|
+
|
|
4606
|
+
_dataParams3.forEach(function (value, index) {
|
|
4607
|
+
if (index === 0) {
|
|
4608
|
+
params[value] = moment(element[index]).millisecond(0).second(0).minute(0).hour(0).format('YYYY-MM-DD HH:mm:ss');
|
|
4609
|
+
} else {
|
|
4610
|
+
params[value] = moment(element[index]).millisecond(59).second(59).minute(59).hour(23).format('YYYY-MM-DD HH:mm:ss');
|
|
4611
|
+
}
|
|
4612
|
+
});
|
|
4613
|
+
|
|
4614
|
+
delete params[key];
|
|
4615
|
+
} else if (typeof element === 'boolean' && key.indexOf('*checkBox*') >= 0) {
|
|
4616
|
+
var _dataParams4 = key.split('*checkBox*');
|
|
4617
|
+
|
|
4618
|
+
if (element) {
|
|
4619
|
+
params[_dataParams4[0]] = 0;
|
|
4620
|
+
}
|
|
4621
|
+
|
|
4622
|
+
delete params[key];
|
|
4623
|
+
} else if (element && key.indexOf('*cascader*') >= 0) {
|
|
4624
|
+
var _dataParams5 = key.split('*cascader*');
|
|
4625
|
+
|
|
4626
|
+
params[_dataParams5[0]] = element[element.length - 1];
|
|
4627
|
+
delete params[key];
|
|
4628
|
+
} else if (element && key.indexOf('*date*') >= 0) {
|
|
4629
|
+
var _dataParams6 = key.split('*date*');
|
|
4630
|
+
|
|
4631
|
+
_dataParams6.forEach(function (value, index) {
|
|
4632
|
+
if (index === 0) {
|
|
4633
|
+
params[value] = moment(element[index]).format('YYYY-MM-DD');
|
|
4634
|
+
} else {
|
|
4635
|
+
params[value] = moment(element[index]).format('YYYY-MM-DD');
|
|
4636
|
+
}
|
|
4637
|
+
});
|
|
4638
|
+
|
|
4639
|
+
delete params[key];
|
|
4640
|
+
} else if (element && key.indexOf('*') >= 0) {
|
|
4641
|
+
var _dataParams7 = key.split('*');
|
|
4642
|
+
|
|
4643
|
+
_dataParams7.forEach(function (value, index) {
|
|
4644
|
+
params[value] = element[index].format('YYYY-MM-DD HH:mm:ss');
|
|
4645
|
+
});
|
|
4646
|
+
|
|
4647
|
+
delete params[key];
|
|
4648
|
+
} else if (element && key.indexOf('_selectNumberRange') >= 0) {
|
|
4649
|
+
// key = xxxxx_selectNumberRange qp-xxxxx-gt
|
|
4650
|
+
var _dataParams8 = key.split('_selectNumberRange')[0];
|
|
4651
|
+
|
|
4652
|
+
if (params[key][0] === 'range') {
|
|
4653
|
+
if (params[key][1][0]) {
|
|
4654
|
+
params["qp-".concat(_dataParams8, "-ge")] = params[key][1][0];
|
|
4655
|
+
}
|
|
4656
|
+
|
|
4657
|
+
if (params[key][1][1]) {
|
|
4658
|
+
params["qp-".concat(_dataParams8, "-le")] = params[key][1][1];
|
|
4659
|
+
}
|
|
4660
|
+
} else {
|
|
4661
|
+
params["qp-".concat(_dataParams8, "-").concat(params[key][0])] = params[key][1];
|
|
4662
|
+
}
|
|
4663
|
+
|
|
4664
|
+
delete params[key];
|
|
4665
|
+
} else if (Array.isArray(element)) {
|
|
4666
|
+
params[key] = element.join(',');
|
|
4667
|
+
} else if (element == null || element === undefined || String(element).trim() === '') {
|
|
4668
|
+
delete params[key];
|
|
4669
|
+
}
|
|
4670
|
+
})();
|
|
4671
|
+
}
|
|
4672
|
+
}
|
|
4673
|
+
|
|
4674
|
+
var queryParams = _objectSpread2(_objectSpread2(_objectSpread2({
|
|
4675
|
+
pageSize: pageSize,
|
|
4676
|
+
currentPage: currentPage
|
|
4677
|
+
}, otherParams), fixedParam), params);
|
|
4678
|
+
|
|
4679
|
+
axios.get("".concat(url, "?").concat(stringify(queryParams))).then(function (result) {
|
|
4680
|
+
var _result, _result2;
|
|
4681
|
+
|
|
4682
|
+
setFetching(false);
|
|
4683
|
+
result = result.data;
|
|
4684
|
+
|
|
4685
|
+
if (((_result = result) === null || _result === void 0 ? void 0 : _result.status) && result.status !== '0' || ((_result2 = result) === null || _result2 === void 0 ? void 0 : _result2.code) && result.code !== '000000') {
|
|
4686
|
+
message.error(result.msg);
|
|
4687
|
+
return;
|
|
4688
|
+
}
|
|
4689
|
+
|
|
4690
|
+
var res = result.data;
|
|
4691
|
+
var source = [];
|
|
4692
|
+
|
|
4693
|
+
if (isMap) {
|
|
4694
|
+
source = Object.keys(res).map(function (d, i) {
|
|
4695
|
+
return {
|
|
4696
|
+
text: Object.values(res)[i],
|
|
4697
|
+
value: d
|
|
4698
|
+
};
|
|
4699
|
+
});
|
|
4700
|
+
} else {
|
|
4701
|
+
var keys = res.list ? 'list' : 'items';
|
|
4702
|
+
source = res ? res[keys] ? res[keys].map(function (item) {
|
|
4703
|
+
var textShowText = item[mappingTextField];
|
|
4704
|
+
|
|
4705
|
+
if (mappingTextShowTextField) {
|
|
4706
|
+
textShowText = [];
|
|
4707
|
+
|
|
4708
|
+
if (Array.isArray(mappingTextShowTextField)) {
|
|
4709
|
+
mappingTextShowTextField.forEach(function (r) {
|
|
4710
|
+
textShowText.push(item[r]);
|
|
4711
|
+
});
|
|
4712
|
+
} else {
|
|
4713
|
+
textShowText = item[mappingTextShowTextField];
|
|
4714
|
+
}
|
|
4715
|
+
}
|
|
4716
|
+
|
|
4717
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
4718
|
+
text: item[mappingTextField],
|
|
4719
|
+
textShowText: textShowText,
|
|
4720
|
+
textShowKey: item[mappingTextShowKeyField || mappingValueField],
|
|
4721
|
+
value: item[mappingValueField]
|
|
4722
|
+
});
|
|
4723
|
+
}) : Array.isArray(res) && (res === null || res === void 0 ? void 0 : res.map(function (item) {
|
|
4724
|
+
var textShowText = item[mappingTextField];
|
|
4725
|
+
|
|
4726
|
+
if (mappingTextShowTextField) {
|
|
4727
|
+
textShowText = [];
|
|
4728
|
+
|
|
4729
|
+
if (Array.isArray(mappingTextShowTextField)) {
|
|
4730
|
+
mappingTextShowTextField.forEach(function (r) {
|
|
4731
|
+
textShowText.push(item[r]);
|
|
4732
|
+
});
|
|
4733
|
+
} else {
|
|
4734
|
+
textShowText = item[mappingTextShowTextField];
|
|
4735
|
+
}
|
|
4736
|
+
}
|
|
4737
|
+
|
|
4738
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
4739
|
+
text: item[mappingTextField],
|
|
4740
|
+
textShowText: textShowText,
|
|
4741
|
+
textShowKey: item[mappingTextShowKeyField || mappingValueField],
|
|
4742
|
+
value: item[mappingValueField]
|
|
4743
|
+
});
|
|
4744
|
+
})) : [];
|
|
4745
|
+
}
|
|
4746
|
+
|
|
4747
|
+
source = Array.isArray(source) ? source : [];
|
|
4748
|
+
|
|
4749
|
+
if (type === 1) {
|
|
4750
|
+
var _ctx$form;
|
|
4751
|
+
|
|
4752
|
+
ctx === null || ctx === void 0 ? void 0 : (_ctx$form = ctx.form) === null || _ctx$form === void 0 ? void 0 : _ctx$form.setFieldSource(resultSourceKey, source);
|
|
4753
|
+
setItems(source);
|
|
4754
|
+
setItemsTotal(Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length));
|
|
4755
|
+
} else {
|
|
4756
|
+
setTableData(source);
|
|
4757
|
+
setTablePagination(_objectSpread2(_objectSpread2({}, tablePagination), {}, {
|
|
4758
|
+
total: Number((res === null || res === void 0 ? void 0 : res.total) || (res === null || res === void 0 ? void 0 : res.totalCount) || source.length),
|
|
4759
|
+
pageSize: Number((res === null || res === void 0 ? void 0 : res.size) || (res === null || res === void 0 ? void 0 : res.pageSize) || (params === null || params === void 0 ? void 0 : params.pageSize) || pageSize),
|
|
4760
|
+
current: Number((res === null || res === void 0 ? void 0 : res.page) || (res === null || res === void 0 ? void 0 : res.currentPage) || (params === null || params === void 0 ? void 0 : params.currentPage) || currentPage)
|
|
4761
|
+
}));
|
|
4762
|
+
}
|
|
4763
|
+
}).catch(function (err) {
|
|
4764
|
+
setFetching(false);
|
|
4765
|
+
});
|
|
4766
|
+
};
|
|
4767
|
+
|
|
4768
|
+
useEffect(function () {
|
|
4769
|
+
run('init');
|
|
4770
|
+
}, []);
|
|
4771
|
+
useEffect(function () {
|
|
4772
|
+
if (value) {
|
|
4773
|
+
setPopValue(value);
|
|
4774
|
+
}
|
|
4775
|
+
}, [value]);
|
|
4776
|
+
useEffect(function () {
|
|
4777
|
+
makeUniqueValue();
|
|
4778
|
+
}, [sourceName]);
|
|
4779
|
+
|
|
4780
|
+
var showModal = function showModal() {
|
|
4781
|
+
getData({
|
|
4782
|
+
pageSize: tableInitPageSize,
|
|
4783
|
+
currentPage: 1
|
|
4784
|
+
}, 2);
|
|
4785
|
+
setIsModalVisible(true); // 回显
|
|
4786
|
+
|
|
4787
|
+
if (value) {
|
|
4788
|
+
if (selectMode) {
|
|
4789
|
+
setSelectedRowKeys(labelInValue ? value.map(function (i) {
|
|
4790
|
+
return i.key;
|
|
4791
|
+
}) : value);
|
|
4792
|
+
setPopValue(labelInValue ? value.map(function (i) {
|
|
4793
|
+
return {
|
|
4794
|
+
value: i.key,
|
|
4795
|
+
text: i.label
|
|
4796
|
+
};
|
|
4797
|
+
}) : value.map(function (i) {
|
|
4798
|
+
return {
|
|
4799
|
+
value: i
|
|
4800
|
+
};
|
|
4801
|
+
}));
|
|
4802
|
+
setIndeterminate(!!value.length && value.length < itemsTotal);
|
|
4803
|
+
setCheckedAll(itemsTotal && value.length === itemsTotal); // 需清空数据
|
|
4804
|
+
|
|
4805
|
+
if (!value.length) {
|
|
4806
|
+
setDoubleArr([]);
|
|
4807
|
+
}
|
|
4808
|
+
} else {
|
|
4809
|
+
setSelectedRowKeys(labelInValue ? [value.key] : [value]);
|
|
4810
|
+
setPopValue(labelInValue ? [{
|
|
4811
|
+
value: value.key,
|
|
4812
|
+
text: value.label
|
|
4813
|
+
}] : [{
|
|
4814
|
+
value: value
|
|
4815
|
+
}]);
|
|
4816
|
+
}
|
|
4817
|
+
}
|
|
4818
|
+
};
|
|
4819
|
+
|
|
4820
|
+
var handleOk = function handleOk(isContinue) {
|
|
4821
|
+
if (!popvalue.length) {
|
|
4822
|
+
message.warning('至少选中一条数据');
|
|
4823
|
+
return;
|
|
4824
|
+
} // handleSelectOver(popvalue)
|
|
4825
|
+
|
|
4826
|
+
|
|
4827
|
+
if (onSaveCallback) {
|
|
4828
|
+
onSaveCallback(popvalue).then(function (res) {
|
|
4829
|
+
{
|
|
4830
|
+
message.success('保存成功');
|
|
4831
|
+
deleteSelectRows();
|
|
4832
|
+
!isContinue && handleCancel();
|
|
4833
|
+
}
|
|
4834
|
+
}).catch(function (Error) {
|
|
4835
|
+
message.error(Error);
|
|
4836
|
+
});
|
|
4837
|
+
} else {
|
|
4838
|
+
!isContinue && handleCancel();
|
|
4839
|
+
}
|
|
4840
|
+
};
|
|
4841
|
+
|
|
4842
|
+
var handleCancel = function handleCancel() {
|
|
4843
|
+
form.resetFields();
|
|
4844
|
+
setTableFormParams({});
|
|
4845
|
+
setIsModalVisible(false);
|
|
4846
|
+
|
|
4847
|
+
if (selectMode) {
|
|
4848
|
+
run();
|
|
4849
|
+
}
|
|
4850
|
+
};
|
|
4851
|
+
|
|
4852
|
+
var onSearchTable = function onSearchTable() {
|
|
4853
|
+
var params = form.getFieldsValue();
|
|
4854
|
+
setTableFormParams(params);
|
|
4855
|
+
getData(_objectSpread2(_objectSpread2({}, params), {}, {
|
|
4856
|
+
pageSize: tableInitPageSize
|
|
4857
|
+
}), 2);
|
|
4858
|
+
|
|
4859
|
+
if (selectMode) {
|
|
4860
|
+
getData(params);
|
|
4861
|
+
}
|
|
4862
|
+
};
|
|
4863
|
+
|
|
4864
|
+
var onResetTable = function onResetTable() {
|
|
4865
|
+
form.resetFields();
|
|
4866
|
+
setTableFormParams({});
|
|
4867
|
+
getData({
|
|
4868
|
+
pageSize: tableInitPageSize,
|
|
4869
|
+
currentPage: 1
|
|
4870
|
+
}, 2);
|
|
4871
|
+
};
|
|
4872
|
+
|
|
4873
|
+
var handleTableChange = function handleTableChange(pagination) {
|
|
4874
|
+
getData(_objectSpread2(_objectSpread2({}, tableFormParams), {}, {
|
|
4875
|
+
pageSize: pagination.pageSize,
|
|
4876
|
+
currentPage: pagination.current
|
|
4877
|
+
}), 2);
|
|
4878
|
+
}; // 扁平化二维数组的方法
|
|
4879
|
+
|
|
4880
|
+
var onChangeSelectedKeys = function onChangeSelectedKeys(selectKeys, selectRows) {
|
|
4881
|
+
setPopValue(selectRows);
|
|
4882
|
+
setSelectedRowKeys(selectKeys); // setIndeterminate(!!filterRows.length && filterRows.length < tablePagination?.total);
|
|
4883
|
+
// setCheckedAll(filterRows.length === tablePagination?.total);
|
|
4884
|
+
}; // 生成唯一值
|
|
4885
|
+
|
|
4886
|
+
|
|
4887
|
+
var makeUniqueValue = function makeUniqueValue() {
|
|
4888
|
+
var generateUnitKey = ((1 + Math.random()) * 0x10000 | 0).toString(16);
|
|
4889
|
+
setUniqueValue(generateUnitKey);
|
|
4890
|
+
return generateUnitKey;
|
|
4891
|
+
};
|
|
4892
|
+
|
|
4893
|
+
var rowSelection = {
|
|
4894
|
+
type: 'checkbox',
|
|
4895
|
+
selectedRowKeys: selectedRowKeys,
|
|
4896
|
+
preserveSelectedRowKeys: true,
|
|
4897
|
+
onChange: function onChange(sks, srs) {
|
|
4898
|
+
onChangeSelectedKeys(sks, srs);
|
|
4899
|
+
},
|
|
4900
|
+
getCheckboxProps: function getCheckboxProps() {
|
|
4901
|
+
return {
|
|
4902
|
+
disabled: (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
4903
|
+
};
|
|
4904
|
+
}
|
|
4905
|
+
};
|
|
4906
|
+
|
|
4907
|
+
var onDoubleClickSelect = function onDoubleClickSelect(e, record) {
|
|
4908
|
+
if (!selectMode) {
|
|
4909
|
+
var srs = [JSON.parse(JSON.stringify(record))];
|
|
4910
|
+
var sks = srs.map(function (i) {
|
|
4911
|
+
return i.value;
|
|
4912
|
+
});
|
|
4913
|
+
onChangeSelectedKeys(sks, srs);
|
|
4914
|
+
}
|
|
4915
|
+
};
|
|
4916
|
+
|
|
4917
|
+
var themeColor = {
|
|
4918
|
+
color: '#005CFF'
|
|
4919
|
+
};
|
|
4920
|
+
|
|
4921
|
+
var formItem = function formItem(list) {
|
|
4922
|
+
if (isModalVisible && (list === null || list === void 0 ? void 0 : list.length)) {
|
|
4923
|
+
return list.map(function (i, index) {
|
|
4924
|
+
var _i$field, _i$field3, _i$field5, _i$field6, _i$field7;
|
|
4925
|
+
|
|
4926
|
+
if ((i === null || i === void 0 ? void 0 : i.type) === 'select' || (i === null || i === void 0 ? void 0 : (_i$field = i.field) === null || _i$field === void 0 ? void 0 : _i$field.type) === 'select') {
|
|
4927
|
+
var _i$field2, _i$initialSource;
|
|
4928
|
+
|
|
4929
|
+
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
4930
|
+
name: i.name,
|
|
4931
|
+
label: i.label,
|
|
4932
|
+
key: i.name
|
|
4933
|
+
}, /*#__PURE__*/React.createElement(Select, _objectSpread2({
|
|
4934
|
+
style: {
|
|
4935
|
+
width: '100%'
|
|
4936
|
+
},
|
|
4937
|
+
placeholder: "\u8BF7\u9009\u62E9"
|
|
4938
|
+
}, i === null || i === void 0 ? void 0 : (_i$field2 = i.field) === null || _i$field2 === void 0 ? void 0 : _i$field2.props), (i === null || i === void 0 ? void 0 : (_i$initialSource = i.initialSource) === null || _i$initialSource === void 0 ? void 0 : _i$initialSource.length) && (i === null || i === void 0 ? void 0 : i.initialSource.map(function (m) {
|
|
4939
|
+
return /*#__PURE__*/React.createElement(Option$1, {
|
|
4940
|
+
value: m.value,
|
|
4941
|
+
key: m.value
|
|
4942
|
+
}, m.text);
|
|
4943
|
+
}))));
|
|
4944
|
+
}
|
|
4945
|
+
|
|
4946
|
+
if ((i === null || i === void 0 ? void 0 : i.type) === 'treeSelect' || (i === null || i === void 0 ? void 0 : (_i$field3 = i.field) === null || _i$field3 === void 0 ? void 0 : _i$field3.type) === 'treeSelect') {
|
|
4947
|
+
var _i$field4;
|
|
4948
|
+
|
|
4949
|
+
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
4950
|
+
name: i.name,
|
|
4951
|
+
label: i.label,
|
|
4952
|
+
key: i.name
|
|
4953
|
+
}, /*#__PURE__*/React.createElement(TreeSelect, _objectSpread2({
|
|
4954
|
+
style: {
|
|
4955
|
+
width: '100%'
|
|
4956
|
+
},
|
|
4957
|
+
placeholder: "\u8BF7\u9009\u62E9"
|
|
4958
|
+
}, i === null || i === void 0 ? void 0 : (_i$field4 = i.field) === null || _i$field4 === void 0 ? void 0 : _i$field4.props)));
|
|
4959
|
+
}
|
|
4960
|
+
|
|
4961
|
+
if ((i === null || i === void 0 ? void 0 : i.type) === 'BusinessSearchSelect' || (i === null || i === void 0 ? void 0 : (_i$field5 = i.field) === null || _i$field5 === void 0 ? void 0 : _i$field5.type) === 'BusinessSearchSelect') {
|
|
4962
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Item, {
|
|
4963
|
+
name: i.name,
|
|
4964
|
+
label: i.label,
|
|
4965
|
+
key: i.name
|
|
4966
|
+
}, /*#__PURE__*/React.createElement(BusinessSearchSelect$1, _objectSpread2({}, i.field.props))));
|
|
4967
|
+
}
|
|
4968
|
+
|
|
4969
|
+
if ((i === null || i === void 0 ? void 0 : i.type) === 'multipleQueryInput' || (i === null || i === void 0 ? void 0 : (_i$field6 = i.field) === null || _i$field6 === void 0 ? void 0 : _i$field6.type) === 'multipleQueryInput') {
|
|
4970
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Form.Item, {
|
|
4971
|
+
name: i.name,
|
|
4972
|
+
label: i.label,
|
|
4973
|
+
key: i.name
|
|
4974
|
+
}, /*#__PURE__*/React.createElement(QueryMutipleInput, {
|
|
4975
|
+
onValueChange: function onValueChange(value) {
|
|
4976
|
+
form.setFieldsValue(_defineProperty({}, i.name, value));
|
|
4977
|
+
}
|
|
4978
|
+
})));
|
|
4979
|
+
} // 默认type是input
|
|
4980
|
+
|
|
4981
|
+
|
|
4982
|
+
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
4983
|
+
name: i.name,
|
|
4984
|
+
label: i.label,
|
|
4985
|
+
key: i.name
|
|
4986
|
+
}, /*#__PURE__*/React.createElement(Input, _objectSpread2({
|
|
4987
|
+
id: index === 0 ? "2345234242342" : 'index',
|
|
4988
|
+
style: {
|
|
4989
|
+
width: '100%'
|
|
4990
|
+
},
|
|
4991
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
|
4992
|
+
allowClear: true,
|
|
4993
|
+
maxLength: 100
|
|
4994
|
+
}, i === null || i === void 0 ? void 0 : (_i$field7 = i.field) === null || _i$field7 === void 0 ? void 0 : _i$field7.props)));
|
|
4995
|
+
});
|
|
4996
|
+
} else {
|
|
4997
|
+
return null;
|
|
4998
|
+
}
|
|
4999
|
+
};
|
|
5000
|
+
|
|
5001
|
+
var deleteSelectRows = function deleteSelectRows() {
|
|
5002
|
+
setPopValue([]);
|
|
5003
|
+
setSelectedRowKeys([]);
|
|
5004
|
+
};
|
|
5005
|
+
|
|
5006
|
+
var deleteRecord = function deleteRecord(record) {
|
|
5007
|
+
setPopValue(popvalue.filter(function (item) {
|
|
5008
|
+
return item.skuCode !== record.skuCode;
|
|
5009
|
+
}));
|
|
5010
|
+
setSelectedRowKeys(_toConsumableArray(selectedRowKeys.filter(function (item) {
|
|
5011
|
+
return item !== record.skuCode;
|
|
5012
|
+
})));
|
|
5013
|
+
};
|
|
5014
|
+
|
|
5015
|
+
var inputIndex = 0;
|
|
5016
|
+
var selectColumns = [].concat(_toConsumableArray(modalTableProps.selectColumn.map(function (item) {
|
|
5017
|
+
var inputLength = modalTableProps.selectColumn.filter(function (item) {
|
|
5018
|
+
return item.isInputItem;
|
|
5019
|
+
}).length;
|
|
5020
|
+
var currentIndex = inputIndex;
|
|
5021
|
+
|
|
5022
|
+
if (item.isInputItem) {
|
|
5023
|
+
inputIndex++;
|
|
5024
|
+
return _objectSpread2(_objectSpread2({}, item), {}, {
|
|
5025
|
+
render: function render(text, record, index) {
|
|
5026
|
+
return /*#__PURE__*/React.createElement(InputNumber, {
|
|
5027
|
+
defaultValue: text || 0,
|
|
5028
|
+
min: 0,
|
|
5029
|
+
keyboard: false,
|
|
5030
|
+
onChange: function onChange(value) {
|
|
5031
|
+
record['count'] = value;
|
|
5032
|
+
},
|
|
5033
|
+
// onFocus={(e)=> {
|
|
5034
|
+
// let dom1 = e.currentTarget;
|
|
5035
|
+
// dom1.setSelectionRange(100, 0);
|
|
5036
|
+
// dom1.select(text);
|
|
5037
|
+
// }}
|
|
5038
|
+
onKeyDown: function onKeyDown(e) {
|
|
5039
|
+
if (e.keyCode === 13 && e.ctrlKey) {
|
|
5040
|
+
var _document$getElementB;
|
|
5041
|
+
|
|
5042
|
+
handleOk(true);
|
|
5043
|
+
(_document$getElementB = document.getElementById("2345234242342")) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.focus();
|
|
5044
|
+
}
|
|
5045
|
+
|
|
5046
|
+
if (e.keyCode === 8 && e.ctrlKey) {
|
|
5047
|
+
var _e$nativeEvent$path$;
|
|
5048
|
+
|
|
5049
|
+
message.success('删除当前行');
|
|
5050
|
+
e.stopPropagation();
|
|
5051
|
+
e.preventDefault();
|
|
5052
|
+
var dom = (_e$nativeEvent$path$ = e.nativeEvent.path[5].children[index + 2]) === null || _e$nativeEvent$path$ === void 0 ? void 0 : _e$nativeEvent$path$.getElementsByTagName('input')[currentIndex];
|
|
5053
|
+
|
|
5054
|
+
if (dom) {
|
|
5055
|
+
dom.select();
|
|
5056
|
+
dom.focus();
|
|
5057
|
+
dom.scrollIntoView(false);
|
|
5058
|
+
}
|
|
5059
|
+
|
|
5060
|
+
dom = null;
|
|
5061
|
+
deleteRecord(record);
|
|
5062
|
+
}
|
|
5063
|
+
|
|
5064
|
+
if (e.keyCode === 37 && e.shiftKey) {
|
|
5065
|
+
var _e$nativeEvent$path$2;
|
|
5066
|
+
|
|
5067
|
+
// 左滑动
|
|
5068
|
+
e.stopPropagation();
|
|
5069
|
+
e.preventDefault();
|
|
5070
|
+
|
|
5071
|
+
var _dom = (_e$nativeEvent$path$2 = e.nativeEvent.path[5].children[index + 1]) === null || _e$nativeEvent$path$2 === void 0 ? void 0 : _e$nativeEvent$path$2.getElementsByTagName('input')[currentIndex - 1];
|
|
5072
|
+
|
|
5073
|
+
if (_dom) {
|
|
5074
|
+
_dom.select();
|
|
5075
|
+
|
|
5076
|
+
_dom.focus();
|
|
5077
|
+
|
|
5078
|
+
_dom.scrollIntoView(false);
|
|
5079
|
+
}
|
|
5080
|
+
|
|
5081
|
+
_dom = null;
|
|
5082
|
+
}
|
|
5083
|
+
|
|
5084
|
+
if (e.keyCode === 39 && e.shiftKey) {
|
|
5085
|
+
var _e$nativeEvent$path$3;
|
|
5086
|
+
|
|
5087
|
+
// 右滑
|
|
5088
|
+
e.stopPropagation();
|
|
5089
|
+
e.preventDefault();
|
|
5090
|
+
|
|
5091
|
+
var _dom2 = (_e$nativeEvent$path$3 = e.nativeEvent.path[5].children[index + 1]) === null || _e$nativeEvent$path$3 === void 0 ? void 0 : _e$nativeEvent$path$3.getElementsByTagName('input')[currentIndex + 1];
|
|
5092
|
+
|
|
5093
|
+
if (_dom2) {
|
|
5094
|
+
_dom2.select();
|
|
5095
|
+
|
|
5096
|
+
_dom2.focus();
|
|
5097
|
+
|
|
5098
|
+
_dom2.scrollIntoView(false);
|
|
5099
|
+
}
|
|
5100
|
+
|
|
5101
|
+
_dom2 = null;
|
|
5102
|
+
}
|
|
5103
|
+
|
|
5104
|
+
if (e.keyCode === 40) {
|
|
5105
|
+
var _e$nativeEvent$path$4;
|
|
5106
|
+
|
|
5107
|
+
e.stopPropagation();
|
|
5108
|
+
e.preventDefault();
|
|
5109
|
+
|
|
5110
|
+
var _dom3 = (_e$nativeEvent$path$4 = e.nativeEvent.path[5].children[index + 2]) === null || _e$nativeEvent$path$4 === void 0 ? void 0 : _e$nativeEvent$path$4.getElementsByTagName('input')[currentIndex];
|
|
5111
|
+
|
|
5112
|
+
if (_dom3) {
|
|
5113
|
+
_dom3.select();
|
|
5114
|
+
|
|
5115
|
+
_dom3.focus();
|
|
5116
|
+
|
|
5117
|
+
_dom3.scrollIntoView(false);
|
|
5118
|
+
}
|
|
5119
|
+
|
|
5120
|
+
_dom3 = null;
|
|
5121
|
+
} else if (e.keyCode === 38) {
|
|
5122
|
+
var _e$nativeEvent$path$5;
|
|
5123
|
+
|
|
5124
|
+
e.stopPropagation();
|
|
5125
|
+
e.preventDefault();
|
|
5126
|
+
var dom1 = (_e$nativeEvent$path$5 = e.nativeEvent.path[5].children[index]) === null || _e$nativeEvent$path$5 === void 0 ? void 0 : _e$nativeEvent$path$5.getElementsByTagName('input')[currentIndex];
|
|
5127
|
+
|
|
5128
|
+
if (dom1) {
|
|
5129
|
+
// dom1.value=""
|
|
5130
|
+
// dom1.setSelectionRange(100, 0);
|
|
5131
|
+
dom1.select();
|
|
5132
|
+
dom1.focus();
|
|
5133
|
+
dom1.scrollIntoViewIfNeeded(false); // dom1.value=record['count']
|
|
5134
|
+
}
|
|
5135
|
+
|
|
5136
|
+
dom1 = null;
|
|
5137
|
+
} else if (e.keyCode === 9 && index === selectedRowKeys.length - 1 && currentIndex === inputLength - 1) {
|
|
5138
|
+
e.stopPropagation();
|
|
5139
|
+
e.preventDefault();
|
|
5140
|
+
}
|
|
5141
|
+
}
|
|
5142
|
+
});
|
|
5143
|
+
}
|
|
5144
|
+
});
|
|
5145
|
+
}
|
|
5146
|
+
|
|
5147
|
+
return item;
|
|
5148
|
+
})), [{
|
|
5149
|
+
title: '操作',
|
|
5150
|
+
width: 150,
|
|
5151
|
+
fixed: 'right',
|
|
5152
|
+
render: function render(text, record, index) {
|
|
5153
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
5154
|
+
onClick: function onClick() {
|
|
5155
|
+
deleteRecord(record);
|
|
5156
|
+
},
|
|
5157
|
+
type: "link"
|
|
5158
|
+
}, "\u5220\u9664");
|
|
5159
|
+
}
|
|
5160
|
+
}]);
|
|
5161
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
5162
|
+
className: 'add_select'
|
|
5163
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5164
|
+
className: "add_select_show",
|
|
5165
|
+
id: "add_select_div_".concat(uniqueValue)
|
|
5166
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
5167
|
+
onClick: showModal,
|
|
5168
|
+
type: "primary"
|
|
5169
|
+
}, "\u6DFB\u52A0")), needModalTable && isModalVisible && /*#__PURE__*/React.createElement(Modal, {
|
|
5170
|
+
width: '1200px',
|
|
5171
|
+
style: {
|
|
5172
|
+
top: 20
|
|
5173
|
+
},
|
|
5174
|
+
bodyStyle: {
|
|
5175
|
+
padding: '0px'
|
|
5176
|
+
},
|
|
5177
|
+
// title={modalTableProps?.modalTableTitle}
|
|
5178
|
+
visible: isModalVisible,
|
|
5179
|
+
onOk: handleOk,
|
|
5180
|
+
closable: false,
|
|
5181
|
+
onCancel: handleCancel,
|
|
5182
|
+
footer: selectMode ? [/*#__PURE__*/React.createElement(Button, {
|
|
5183
|
+
key: "back",
|
|
5184
|
+
onClick: handleCancel
|
|
5185
|
+
}, "\u53D6\u6D88"), /*#__PURE__*/React.createElement(Button, {
|
|
5186
|
+
key: "submit",
|
|
5187
|
+
style: {
|
|
5188
|
+
color: '#005CFF',
|
|
5189
|
+
borderColor: '#005CFF'
|
|
5190
|
+
},
|
|
5191
|
+
onClick: function onClick() {
|
|
5192
|
+
handleOk(true);
|
|
5193
|
+
},
|
|
5194
|
+
disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
5195
|
+
}, "\u4FDD\u5B58\u5E76\u7EE7\u7EED"), /*#__PURE__*/React.createElement(Button, {
|
|
5196
|
+
key: "submit",
|
|
5197
|
+
type: "primary",
|
|
5198
|
+
onClick: function onClick() {
|
|
5199
|
+
handleOk(false);
|
|
5200
|
+
},
|
|
5201
|
+
disabled: !tableData.length || (selectProps === null || selectProps === void 0 ? void 0 : selectProps.disabled) || (props === null || props === void 0 ? void 0 : props.disabled)
|
|
5202
|
+
}, "\u786E\u5B9A")] : null
|
|
5203
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
5204
|
+
className: 'add_select_header'
|
|
5205
|
+
}, modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.modalTableTitle, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("span", null, "*"), " \xA0\u5FEB\u6377\u952E\uFF1A\u3010Tab\u3011-\u8DF3\u683C\u5207\u6362\uFF1B\u3010Shift+\u2190\u3001\u2192\u3011-\u5F53\u524D\u884C\u5DE6\u3001\u53F3\u79FB\u52A8\uFF1B\u3010 \u2191\u3001\u2193\u3011-\u5F53\u524D\u5217\u4E0A\u3001\u4E0B\u79FB\u52A8\uFF1B\u3010ctrl+Enter\u3011-\u4FDD\u5B58\u5E76\u7EE7\u7EED\uFF1B\u3010ctrl+Delete\u3011-\u5220\u9664\u5F53\u524D\u884C\uFF1B"), /*#__PURE__*/React.createElement("span", {
|
|
5206
|
+
className: 'add_select_header_close'
|
|
5207
|
+
}, /*#__PURE__*/React.createElement(CloseCircleOutlined$2, {
|
|
5208
|
+
style: {
|
|
5209
|
+
fontSize: '20px'
|
|
5210
|
+
},
|
|
5211
|
+
onClick: handleCancel
|
|
5212
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
5213
|
+
className: 'add_select_wrapper'
|
|
5214
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5215
|
+
className: caretLeftFlag ? 'add_select_wrapper_left' : 'add_select_wrapper_left1'
|
|
5216
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5217
|
+
className: 'select_list_columns'
|
|
5218
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5219
|
+
className: 'select_list_columns_formItems'
|
|
5220
|
+
}, /*#__PURE__*/React.createElement(Form, {
|
|
5221
|
+
form: form,
|
|
5222
|
+
layout: 'vertical',
|
|
5223
|
+
key: 'modalForm'
|
|
5224
|
+
}, formItem(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableSearchForm)))), /*#__PURE__*/React.createElement("div", {
|
|
5225
|
+
className: 'select_list_searchButton'
|
|
5226
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
5227
|
+
key: 'reset',
|
|
5228
|
+
className: 'select_list_button_space',
|
|
5229
|
+
onClick: onResetTable
|
|
5230
|
+
}, "\u91CD\u7F6E"), /*#__PURE__*/React.createElement(Button, {
|
|
5231
|
+
key: 'search',
|
|
5232
|
+
type: "primary",
|
|
5233
|
+
onClick: onSearchTable
|
|
5234
|
+
}, "\u67E5\u8BE2"))), /*#__PURE__*/React.createElement("div", {
|
|
5235
|
+
className: caretLeftFlag ? 'add_select_wrapper_right' : 'add_select_wrapper_right1'
|
|
5236
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
5237
|
+
className: 'select_list_selectTips'
|
|
5238
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5239
|
+
style: {
|
|
5240
|
+
marginLeft: 8
|
|
5241
|
+
}
|
|
5242
|
+
}, "\u641C\u7D22\u7ED3\u679C\u5171\xA0", /*#__PURE__*/React.createElement("span", {
|
|
5243
|
+
style: themeColor
|
|
5244
|
+
}, (tablePagination === null || tablePagination === void 0 ? void 0 : tablePagination.total) || 0), "\xA0\u9879", selectMode ? /*#__PURE__*/React.createElement("span", null, "\uFF0C \u672C\u6B21\u5DF2\u9009\xA0", /*#__PURE__*/React.createElement("span", {
|
|
5245
|
+
style: themeColor
|
|
5246
|
+
}, (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) || 0), "\xA0\u9879") : '')), /*#__PURE__*/React.createElement(Table, {
|
|
5247
|
+
size: 'small',
|
|
5248
|
+
rowSelection: rowSelection,
|
|
5249
|
+
columns: _toConsumableArray(modalTableProps === null || modalTableProps === void 0 ? void 0 : modalTableProps.tableColumns),
|
|
5250
|
+
dataSource: tableData,
|
|
5251
|
+
pagination: tablePagination,
|
|
5252
|
+
loading: fetching,
|
|
5253
|
+
onChange: handleTableChange,
|
|
5254
|
+
rowKey: mappingValueField,
|
|
5255
|
+
rowClassName: 'row-class',
|
|
5256
|
+
scroll: {
|
|
5257
|
+
y: 500
|
|
5258
|
+
}
|
|
5259
|
+
})))), /*#__PURE__*/React.createElement("div", {
|
|
5260
|
+
className: 'add_select_wrapper_select'
|
|
5261
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5262
|
+
className: 'select_list_selectTips'
|
|
5263
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5264
|
+
style: {
|
|
5265
|
+
marginLeft: 8
|
|
5266
|
+
}
|
|
5267
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u672C\u6B21\u5DF2\u9009\xA0", /*#__PURE__*/React.createElement("span", {
|
|
5268
|
+
style: themeColor
|
|
5269
|
+
}, (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) || 0), "\xA0\u9879")), /*#__PURE__*/React.createElement("div", {
|
|
5270
|
+
style: {
|
|
5271
|
+
marginRight: 8
|
|
5272
|
+
}
|
|
5273
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
5274
|
+
onClick: deleteSelectRows,
|
|
5275
|
+
style: _objectSpread2(_objectSpread2({}, themeColor), {}, {
|
|
5276
|
+
cursor: 'pointer'
|
|
5277
|
+
})
|
|
5278
|
+
}, "\u6E05\u7A7A\u6240\u9009\u5546\u54C1"))), /*#__PURE__*/React.createElement(Table, {
|
|
5279
|
+
size: 'small',
|
|
5280
|
+
// rowSelection={rowSelection}
|
|
5281
|
+
columns: selectColumns,
|
|
5282
|
+
dataSource: popvalue,
|
|
5283
|
+
pagination: false,
|
|
5284
|
+
// onChange={handleTableChange}
|
|
5285
|
+
rowKey: mappingValueField,
|
|
5286
|
+
rowClassName: 'row-class',
|
|
5287
|
+
scroll: {
|
|
5288
|
+
y: 500
|
|
5289
|
+
},
|
|
5290
|
+
onRow: function onRow(record) {
|
|
5291
|
+
return {
|
|
5292
|
+
onDoubleClick: function onDoubleClick(event) {
|
|
5293
|
+
return onDoubleClickSelect(event, record);
|
|
5294
|
+
}
|
|
5295
|
+
};
|
|
5296
|
+
}
|
|
5297
|
+
})))));
|
|
5298
|
+
};
|
|
5299
|
+
|
|
4376
5300
|
var shopFileType = [{
|
|
4377
5301
|
text: "线上",
|
|
4378
5302
|
value: 'online'
|
|
@@ -6620,4 +7544,4 @@ if (localStorage.getItem('x-user-auth-context')) {
|
|
|
6620
7544
|
axios.defaults.headers.common['x-user-auth-context'] = localStorage.getItem('x-user-auth-context');
|
|
6621
7545
|
}
|
|
6622
7546
|
|
|
6623
|
-
export { BusinessSearchSelect$1 as BusinessSearchSelect, index$1 as BusinessTreeSearchSelect, index as CheckOneUser, CommodityEntry, DataImport, DataValidation, QueryMutipleInput, SearchSelect, TreeSearchSelect };
|
|
7547
|
+
export { AddSelect, BusinessSearchSelect$1 as BusinessSearchSelect, index$1 as BusinessTreeSearchSelect, index as CheckOneUser, CommodityEntry, DataImport, DataValidation, QueryMutipleInput, SearchSelect, TreeSearchSelect };
|