@kmkf-fe-packages/services-components 0.3.1-alpha.10
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/esm/commonComponents/ItemView/index.d.ts +7 -0
- package/dist/esm/commonComponents/ItemView/index.js +15 -0
- package/dist/esm/commonComponents/ItemView/index.module.scss +20 -0
- package/dist/esm/commonComponents/PlatBuyer/index.d.ts +9 -0
- package/dist/esm/commonComponents/PlatBuyer/index.js +45 -0
- package/dist/esm/commonComponents/Wangwang/img/wang.gif +0 -0
- package/dist/esm/commonComponents/Wangwang/index.d.ts +7 -0
- package/dist/esm/commonComponents/Wangwang/index.js +31 -0
- package/dist/esm/components/ActualPayment/index.d.ts +27 -0
- package/dist/esm/components/ActualPayment/index.js +82 -0
- package/dist/esm/components/Address/index.d.ts +37 -0
- package/dist/esm/components/Address/index.js +112 -0
- package/dist/esm/components/Alipay/index.d.ts +36 -0
- package/dist/esm/components/Alipay/index.js +88 -0
- package/dist/esm/components/AlipayAccount/index.d.ts +31 -0
- package/dist/esm/components/AlipayAccount/index.js +90 -0
- package/dist/esm/components/AlipayName/index.d.ts +31 -0
- package/dist/esm/components/AlipayName/index.js +89 -0
- package/dist/esm/components/BuyerNick/index.d.ts +31 -0
- package/dist/esm/components/BuyerNick/index.js +103 -0
- package/dist/esm/components/Cascader/index.d.ts +45 -0
- package/dist/esm/components/Cascader/index.js +112 -0
- package/dist/esm/components/Checkbox/index.d.ts +31 -0
- package/dist/esm/components/Checkbox/index.js +102 -0
- package/dist/esm/components/Common/img/default-img.png +0 -0
- package/dist/esm/components/Common/index.d.ts +18 -0
- package/dist/esm/components/Common/index.js +223 -0
- package/dist/esm/components/Common/index.module.less +8 -0
- package/dist/esm/components/CommonDataTime/index.d.ts +30 -0
- package/dist/esm/components/CommonDataTime/index.js +79 -0
- package/dist/esm/components/DataTime/ApaasDate.d.ts +9 -0
- package/dist/esm/components/DataTime/ApaasDate.js +22 -0
- package/dist/esm/components/DataTime/index.d.ts +29 -0
- package/dist/esm/components/DataTime/index.js +103 -0
- package/dist/esm/components/EItemEnCode/ItemEncode.d.ts +3 -0
- package/dist/esm/components/EItemEnCode/ItemEncode.js +26 -0
- package/dist/esm/components/EItemEnCode/index.d.ts +27 -0
- package/dist/esm/components/EItemEnCode/index.js +109 -0
- package/dist/esm/components/EItemId/ItemId.d.ts +4 -0
- package/dist/esm/components/EItemId/ItemId.js +26 -0
- package/dist/esm/components/EItemId/index.d.ts +27 -0
- package/dist/esm/components/EItemId/index.js +110 -0
- package/dist/esm/components/EItemSelect/ItemSelect.d.ts +4 -0
- package/dist/esm/components/EItemSelect/ItemSelect.js +27 -0
- package/dist/esm/components/EItemSelect/index.d.ts +27 -0
- package/dist/esm/components/EItemSelect/index.js +92 -0
- package/dist/esm/components/ErpTradeId/index.d.ts +27 -0
- package/dist/esm/components/ErpTradeId/index.js +76 -0
- package/dist/esm/components/Express/index.d.ts +33 -0
- package/dist/esm/components/Express/index.js +94 -0
- package/dist/esm/components/ExpressCode/index.d.ts +30 -0
- package/dist/esm/components/ExpressCode/index.js +87 -0
- package/dist/esm/components/ExpressCompany/index.d.ts +3 -0
- package/dist/esm/components/ExpressCompany/index.js +20 -0
- package/dist/esm/components/FlowStatusSelect/index.d.ts +51 -0
- package/dist/esm/components/FlowStatusSelect/index.js +124 -0
- package/dist/esm/components/GetFormItem/index.d.ts +10 -0
- package/dist/esm/components/GetFormItem/index.js +28 -0
- package/dist/esm/components/Grade/index.d.ts +26 -0
- package/dist/esm/components/Grade/index.js +75 -0
- package/dist/esm/components/Input/index.d.ts +27 -0
- package/dist/esm/components/Input/index.js +84 -0
- package/dist/esm/components/JstItemSelect/index.d.ts +29 -0
- package/dist/esm/components/JstItemSelect/index.js +115 -0
- package/dist/esm/components/JstLogistics/index.d.ts +29 -0
- package/dist/esm/components/JstLogistics/index.js +107 -0
- package/dist/esm/components/JstSendGood/index.d.ts +27 -0
- package/dist/esm/components/JstSendGood/index.js +112 -0
- package/dist/esm/components/JstSupply/index.d.ts +27 -0
- package/dist/esm/components/JstSupply/index.js +113 -0
- package/dist/esm/components/Logistics/index.d.ts +44 -0
- package/dist/esm/components/Logistics/index.js +107 -0
- package/dist/esm/components/MultSelect/index.d.ts +27 -0
- package/dist/esm/components/MultSelect/index.js +84 -0
- package/dist/esm/components/Ordinary/OrdinaryHeader.d.ts +39 -0
- package/dist/esm/components/Ordinary/OrdinaryHeader.js +93 -0
- package/dist/esm/components/Ordinary/OrdinaryMoney.d.ts +39 -0
- package/dist/esm/components/Ordinary/OrdinaryMoney.js +93 -0
- package/dist/esm/components/Ordinary/OrdinarySerial.d.ts +39 -0
- package/dist/esm/components/Ordinary/OrdinarySerial.js +86 -0
- package/dist/esm/components/Ordinary/index.d.ts +46 -0
- package/dist/esm/components/Ordinary/index.js +90 -0
- package/dist/esm/components/OrdinaryHeader/index.d.ts +7 -0
- package/dist/esm/components/OrdinaryHeader/index.js +157 -0
- package/dist/esm/components/OrdinaryHeader/index.module.less +46 -0
- package/dist/esm/components/Payment/AlipayNick.d.ts +39 -0
- package/dist/esm/components/Payment/AlipayNick.js +94 -0
- package/dist/esm/components/Payment/AlipayNo.d.ts +38 -0
- package/dist/esm/components/Payment/AlipayNo.js +101 -0
- package/dist/esm/components/Payment/AlipayTime.d.ts +39 -0
- package/dist/esm/components/Payment/AlipayTime.js +93 -0
- package/dist/esm/components/Payment/BuyerNick.d.ts +39 -0
- package/dist/esm/components/Payment/BuyerNick.js +112 -0
- package/dist/esm/components/Payment/PaymentAmount.d.ts +38 -0
- package/dist/esm/components/Payment/PaymentAmount.js +91 -0
- package/dist/esm/components/Payment/PaymentStatus.d.ts +50 -0
- package/dist/esm/components/Payment/PaymentStatus.js +96 -0
- package/dist/esm/components/Payment/PaymentTid.d.ts +38 -0
- package/dist/esm/components/Payment/PaymentTid.js +84 -0
- package/dist/esm/components/Payment/index.d.ts +120 -0
- package/dist/esm/components/Payment/index.js +118 -0
- package/dist/esm/components/Picture/index.d.ts +31 -0
- package/dist/esm/components/Picture/index.js +118 -0
- package/dist/esm/components/Popover/index.d.ts +3 -0
- package/dist/esm/components/Popover/index.js +51 -0
- package/dist/esm/components/Popover/index.module.less +22 -0
- package/dist/esm/components/Radio/index.d.ts +30 -0
- package/dist/esm/components/Radio/index.js +93 -0
- package/dist/esm/components/Rate/index.d.ts +34 -0
- package/dist/esm/components/Rate/index.js +158 -0
- package/dist/esm/components/ReceiverAddress/index.d.ts +35 -0
- package/dist/esm/components/ReceiverAddress/index.js +133 -0
- package/dist/esm/components/ReceiverMobile/index.d.ts +28 -0
- package/dist/esm/components/ReceiverMobile/index.js +91 -0
- package/dist/esm/components/ReceiverName/index.d.ts +28 -0
- package/dist/esm/components/ReceiverName/index.js +88 -0
- package/dist/esm/components/Remark/flag/trade-icon-flag-0.png +0 -0
- package/dist/esm/components/Remark/flag/trade-icon-flag-1.png +0 -0
- package/dist/esm/components/Remark/flag/trade-icon-flag-2.png +0 -0
- package/dist/esm/components/Remark/flag/trade-icon-flag-3.png +0 -0
- package/dist/esm/components/Remark/flag/trade-icon-flag-4.png +0 -0
- package/dist/esm/components/Remark/flag/trade-icon-flag-5.png +0 -0
- package/dist/esm/components/Remark/index.d.ts +33 -0
- package/dist/esm/components/Remark/index.js +113 -0
- package/dist/esm/components/ReturnLogistics/index.d.ts +44 -0
- package/dist/esm/components/ReturnLogistics/index.js +107 -0
- package/dist/esm/components/Select/index.d.ts +26 -0
- package/dist/esm/components/Select/index.js +79 -0
- package/dist/esm/components/ShopName/index.d.ts +27 -0
- package/dist/esm/components/ShopName/index.js +78 -0
- package/dist/esm/components/SystemOrderNo/index.d.ts +28 -0
- package/dist/esm/components/SystemOrderNo/index.js +81 -0
- package/dist/esm/components/TemplateSelect/index.d.ts +28 -0
- package/dist/esm/components/TemplateSelect/index.js +79 -0
- package/dist/esm/components/TextArea/index.d.ts +26 -0
- package/dist/esm/components/TextArea/index.js +78 -0
- package/dist/esm/components/ThirdItemSelect/ItemEncode.d.ts +4 -0
- package/dist/esm/components/ThirdItemSelect/ItemEncode.js +31 -0
- package/dist/esm/components/ThirdItemSelect/index.d.ts +27 -0
- package/dist/esm/components/ThirdItemSelect/index.js +120 -0
- package/dist/esm/components/TradeDateTime/index.d.ts +27 -0
- package/dist/esm/components/TradeDateTime/index.js +92 -0
- package/dist/esm/components/TradeId/index.d.ts +28 -0
- package/dist/esm/components/TradeId/index.js +89 -0
- package/dist/esm/components/WorkOrderId/img/repeat.png +0 -0
- package/dist/esm/components/WorkOrderId/index.d.ts +28 -0
- package/dist/esm/components/WorkOrderId/index.js +98 -0
- package/dist/esm/index.d.ts +40 -0
- package/dist/esm/index.js +40 -0
- package/dist/esm/type.d.ts +174 -0
- package/dist/esm/type.js +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
/*
|
|
8
|
+
* @Description:
|
|
9
|
+
* @Author: litian
|
|
10
|
+
* @Date: 2022-09-07 17:58:35
|
|
11
|
+
* @LastEditors: litian
|
|
12
|
+
* @LastEditTime: 2022-09-07 19:44:10
|
|
13
|
+
*/
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import { useState } from 'react';
|
|
16
|
+
import { Dropdown } from 'antd';
|
|
17
|
+
import styles from "./index.module.less";
|
|
18
|
+
var Popover = function Popover(_ref) {
|
|
19
|
+
var Overlay = _ref.Overlay,
|
|
20
|
+
ShowComponent = _ref.ShowComponent;
|
|
21
|
+
var _useState = useState(false),
|
|
22
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
23
|
+
visible = _useState2[0],
|
|
24
|
+
setVisible = _useState2[1];
|
|
25
|
+
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
26
|
+
visible: visible,
|
|
27
|
+
trigger: ['click'],
|
|
28
|
+
onVisibleChange: function onVisibleChange(v) {
|
|
29
|
+
return setVisible(v);
|
|
30
|
+
},
|
|
31
|
+
overlay: /*#__PURE__*/React.createElement("div", {
|
|
32
|
+
className: styles.radio
|
|
33
|
+
}, Overlay),
|
|
34
|
+
placement: "bottomLeft"
|
|
35
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
className: styles.container,
|
|
37
|
+
onClick: function onClick() {
|
|
38
|
+
return setVisible(function (x) {
|
|
39
|
+
return !x;
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}, /*#__PURE__*/React.createElement("i", {
|
|
43
|
+
className: "iconfont fz-12 icon-a-12PX-zengjia",
|
|
44
|
+
style: {
|
|
45
|
+
margin: '0 8px'
|
|
46
|
+
}
|
|
47
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
48
|
+
className: styles.ellipsis
|
|
49
|
+
}, ShowComponent)));
|
|
50
|
+
};
|
|
51
|
+
export default Popover;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
min-height: 32px;
|
|
5
|
+
background: #f2f3f5;
|
|
6
|
+
border: 1px solid #f2f3f5;
|
|
7
|
+
}
|
|
8
|
+
.radio {
|
|
9
|
+
min-height: 48px;
|
|
10
|
+
max-height: 200px;
|
|
11
|
+
padding: 8px;
|
|
12
|
+
overflow-y: auto;
|
|
13
|
+
background: #fff;
|
|
14
|
+
border-radius: 4px;
|
|
15
|
+
box-shadow: 1px 1px 14px rgba(38, 38, 38, 0.1);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ellipsis {
|
|
19
|
+
overflow: hidden;
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentInterface, PickOption, DataType, Record } from '../../type';
|
|
3
|
+
declare type Value = {
|
|
4
|
+
value?: string;
|
|
5
|
+
other?: string;
|
|
6
|
+
};
|
|
7
|
+
declare class BasicRadio implements ComponentInterface {
|
|
8
|
+
name: string;
|
|
9
|
+
id: string;
|
|
10
|
+
type: string;
|
|
11
|
+
rules: any[];
|
|
12
|
+
canFilter: boolean;
|
|
13
|
+
canGroup: boolean;
|
|
14
|
+
canHidden: boolean;
|
|
15
|
+
dataType: DataType;
|
|
16
|
+
showContains: boolean;
|
|
17
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
18
|
+
constructor(options: PickOption);
|
|
19
|
+
render: (value: Value) => JSX.Element;
|
|
20
|
+
renderPc: (value: any, record: Record) => JSX.Element;
|
|
21
|
+
renderExport: (value: any, record: Record) => string;
|
|
22
|
+
renderClient: (record: Record) => JSX.Element | null;
|
|
23
|
+
editRender: () => JSX.Element;
|
|
24
|
+
getColumns: () => this & {
|
|
25
|
+
dataIndex: string;
|
|
26
|
+
title: string;
|
|
27
|
+
renderExport: (value: any, record: Record) => string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export default BasicRadio;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
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); }
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { ApaasSelect } from '@kmkf-fe-packages/basic-components';
|
|
13
|
+
import GetFormItem from "../GetFormItem";
|
|
14
|
+
import ItemView from "../../commonComponents/ItemView";
|
|
15
|
+
import { isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
16
|
+
import get from 'lodash/get';
|
|
17
|
+
var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
|
|
18
|
+
var _this = this,
|
|
19
|
+
_this$componentConfig3;
|
|
20
|
+
_classCallCheck(this, BasicRadio);
|
|
21
|
+
_defineProperty(this, "name", void 0);
|
|
22
|
+
_defineProperty(this, "id", void 0);
|
|
23
|
+
_defineProperty(this, "type", void 0);
|
|
24
|
+
_defineProperty(this, "rules", void 0);
|
|
25
|
+
_defineProperty(this, "canFilter", void 0);
|
|
26
|
+
_defineProperty(this, "canGroup", void 0);
|
|
27
|
+
_defineProperty(this, "canHidden", void 0);
|
|
28
|
+
_defineProperty(this, "dataType", void 0);
|
|
29
|
+
_defineProperty(this, "showContains", void 0);
|
|
30
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
31
|
+
_defineProperty(this, "render", function (value) {
|
|
32
|
+
var _value$value;
|
|
33
|
+
return /*#__PURE__*/React.createElement("span", null, value === null || value === void 0 ? void 0 : value.value, (value === null || value === void 0 ? void 0 : value.value) && (value === null || value === void 0 ? void 0 : (_value$value = value.value) === null || _value$value === void 0 ? void 0 : _value$value.indexOf('其他')) > -1 && (value === null || value === void 0 ? void 0 : value.other) && "(".concat(value === null || value === void 0 ? void 0 : value.other, ")"));
|
|
34
|
+
});
|
|
35
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
36
|
+
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radio")]) === undefined && (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radioOther")]) === undefined) {
|
|
37
|
+
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
38
|
+
}
|
|
39
|
+
return /*#__PURE__*/React.createElement("span", null, record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radio")], record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radioOther")]);
|
|
40
|
+
});
|
|
41
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
42
|
+
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radio")]) === undefined) {
|
|
43
|
+
return '--';
|
|
44
|
+
}
|
|
45
|
+
return "".concat(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radio")], " ").concat(get(record, "".concat(_this.id, "_radioOther"), ''));
|
|
46
|
+
});
|
|
47
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
48
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
49
|
+
id: _this.id,
|
|
50
|
+
label: _this.name,
|
|
51
|
+
value: _this.render(record === null || record === void 0 ? void 0 : record[_this.id])
|
|
52
|
+
}) : null;
|
|
53
|
+
});
|
|
54
|
+
_defineProperty(this, "editRender", function () {
|
|
55
|
+
var _this$componentConfig, _this$componentConfig2;
|
|
56
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
57
|
+
title: _this.name,
|
|
58
|
+
name: _this.id,
|
|
59
|
+
rules: _this.rules,
|
|
60
|
+
required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
|
|
61
|
+
component: /*#__PURE__*/React.createElement(ApaasSelect, _extends({}, _this.componentConfig, {
|
|
62
|
+
placeholder: "\u8BF7\u8F93\u5165".concat(_this.name),
|
|
63
|
+
showSearch: true
|
|
64
|
+
}))
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
_defineProperty(this, "getColumns", function () {
|
|
68
|
+
return _objectSpread(_objectSpread({}, _this), {}, {
|
|
69
|
+
dataIndex: _this.id,
|
|
70
|
+
title: _this.name,
|
|
71
|
+
renderExport: _this.renderExport
|
|
72
|
+
});
|
|
73
|
+
;
|
|
74
|
+
});
|
|
75
|
+
this.name = options.name;
|
|
76
|
+
this.id = options.id;
|
|
77
|
+
this.type = options.type;
|
|
78
|
+
this.canFilter = true;
|
|
79
|
+
this.canGroup = true;
|
|
80
|
+
this.canHidden = true;
|
|
81
|
+
this.showContains = false;
|
|
82
|
+
this.dataType = 'string';
|
|
83
|
+
this.componentConfig = options.componentConfig;
|
|
84
|
+
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
85
|
+
validator: function validator(_, value) {
|
|
86
|
+
if (!(value !== null && value !== void 0 && value.value)) {
|
|
87
|
+
return Promise.reject(new Error('请选择'));
|
|
88
|
+
}
|
|
89
|
+
return Promise.resolve();
|
|
90
|
+
}
|
|
91
|
+
}] : [];
|
|
92
|
+
});
|
|
93
|
+
export default BasicRadio;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentInterface, PickOption, DataType, Record } from '../../type';
|
|
3
|
+
declare type Value = {
|
|
4
|
+
name: string;
|
|
5
|
+
value: number;
|
|
6
|
+
id?: string;
|
|
7
|
+
}[] | undefined;
|
|
8
|
+
declare class BasicRate implements ComponentInterface {
|
|
9
|
+
name: string;
|
|
10
|
+
id: string;
|
|
11
|
+
type: string;
|
|
12
|
+
rules: any[];
|
|
13
|
+
canFilter: boolean;
|
|
14
|
+
canGroup: boolean;
|
|
15
|
+
canHidden: boolean;
|
|
16
|
+
dataType: DataType;
|
|
17
|
+
showContains: boolean;
|
|
18
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
19
|
+
rateMap: {
|
|
20
|
+
[prop in number]: string;
|
|
21
|
+
};
|
|
22
|
+
constructor(options: PickOption);
|
|
23
|
+
render: (value: Value) => JSX.Element;
|
|
24
|
+
renderClient: (record: Record) => JSX.Element | null;
|
|
25
|
+
renderPc: (value: any, record: Record) => JSX.Element | null;
|
|
26
|
+
renderExport: (value: any, record: any) => any;
|
|
27
|
+
editRender: () => JSX.Element;
|
|
28
|
+
getColumns: () => this & {
|
|
29
|
+
dataIndex: string;
|
|
30
|
+
title: string;
|
|
31
|
+
renderExport: (value: any, record: any) => any;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export default BasicRate;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
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); }
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { Rate } from 'antd';
|
|
13
|
+
import { ApaasRate } from '@kmkf-fe-packages/basic-components';
|
|
14
|
+
import GetFormItem from "../GetFormItem";
|
|
15
|
+
import ItemView from "../../commonComponents/ItemView";
|
|
16
|
+
import { isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
17
|
+
var BasicRate = /*#__PURE__*/_createClass(function BasicRate(options) {
|
|
18
|
+
var _this = this,
|
|
19
|
+
_this$componentConfig3;
|
|
20
|
+
_classCallCheck(this, BasicRate);
|
|
21
|
+
_defineProperty(this, "name", void 0);
|
|
22
|
+
_defineProperty(this, "id", void 0);
|
|
23
|
+
_defineProperty(this, "type", void 0);
|
|
24
|
+
_defineProperty(this, "rules", void 0);
|
|
25
|
+
_defineProperty(this, "canFilter", void 0);
|
|
26
|
+
_defineProperty(this, "canGroup", void 0);
|
|
27
|
+
_defineProperty(this, "canHidden", void 0);
|
|
28
|
+
_defineProperty(this, "dataType", void 0);
|
|
29
|
+
_defineProperty(this, "showContains", void 0);
|
|
30
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
31
|
+
_defineProperty(this, "rateMap", void 0);
|
|
32
|
+
_defineProperty(this, "render", function (value) {
|
|
33
|
+
return /*#__PURE__*/React.createElement("div", null, value === null || value === void 0 ? void 0 : value.map(function (item) {
|
|
34
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
key: item.id
|
|
36
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
37
|
+
style: {
|
|
38
|
+
marginRight: '8px'
|
|
39
|
+
}
|
|
40
|
+
}, item.name), /*#__PURE__*/React.createElement(Rate, {
|
|
41
|
+
value: item.value,
|
|
42
|
+
style: {
|
|
43
|
+
color: 'red',
|
|
44
|
+
fontSize: '12px'
|
|
45
|
+
},
|
|
46
|
+
disabled: true
|
|
47
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
48
|
+
style: {
|
|
49
|
+
color: 'red',
|
|
50
|
+
fontSize: '12px'
|
|
51
|
+
}
|
|
52
|
+
}, _this.rateMap[item.value]));
|
|
53
|
+
}));
|
|
54
|
+
});
|
|
55
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
56
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
57
|
+
id: _this.id,
|
|
58
|
+
label: _this.name,
|
|
59
|
+
value: _this.render(record === null || record === void 0 ? void 0 : record[_this.id])
|
|
60
|
+
}) : null;
|
|
61
|
+
});
|
|
62
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
63
|
+
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_rate")]) === undefined) {
|
|
64
|
+
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
65
|
+
}
|
|
66
|
+
if (Array.isArray(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_rate")])) {
|
|
67
|
+
var _record;
|
|
68
|
+
return /*#__PURE__*/React.createElement("div", null, record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id, "_rate")]) === null || _record === void 0 ? void 0 : _record.map(function (item) {
|
|
69
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
70
|
+
style: {
|
|
71
|
+
marginRight: '8px'
|
|
72
|
+
}
|
|
73
|
+
}, item === null || item === void 0 ? void 0 : item.name), /*#__PURE__*/React.createElement(Rate, {
|
|
74
|
+
value: item === null || item === void 0 ? void 0 : item.value,
|
|
75
|
+
style: {
|
|
76
|
+
color: 'red',
|
|
77
|
+
fontSize: '12px'
|
|
78
|
+
},
|
|
79
|
+
disabled: true
|
|
80
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
81
|
+
style: {
|
|
82
|
+
color: 'red',
|
|
83
|
+
fontSize: '12px'
|
|
84
|
+
}
|
|
85
|
+
}, _this.rateMap[item === null || item === void 0 ? void 0 : item.value]));
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
});
|
|
90
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
91
|
+
var _ref;
|
|
92
|
+
var textArr = ((_ref = (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_rate")]) || []) === null || _ref === void 0 ? void 0 : _ref.reduce(function (prv, next) {
|
|
93
|
+
if (next.value) {
|
|
94
|
+
prv.push("".concat(next.name, ":").concat(next.value, "\u661F"));
|
|
95
|
+
}
|
|
96
|
+
return prv;
|
|
97
|
+
}, [])) || [];
|
|
98
|
+
return textArr === null || textArr === void 0 ? void 0 : textArr.join(';');
|
|
99
|
+
});
|
|
100
|
+
_defineProperty(this, "editRender", function () {
|
|
101
|
+
var _this$componentConfig, _this$componentConfig2;
|
|
102
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
103
|
+
title: _this.name,
|
|
104
|
+
name: _this.id,
|
|
105
|
+
rules: _this.rules,
|
|
106
|
+
required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
|
|
107
|
+
component: /*#__PURE__*/React.createElement(ApaasRate, _extends({}, _this.componentConfig, {
|
|
108
|
+
allowClear: false,
|
|
109
|
+
style: {
|
|
110
|
+
color: '#FD5105'
|
|
111
|
+
},
|
|
112
|
+
textStyle: {
|
|
113
|
+
color: '#FD5105'
|
|
114
|
+
}
|
|
115
|
+
}))
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
_defineProperty(this, "getColumns", function () {
|
|
119
|
+
return _objectSpread(_objectSpread({}, _this), {}, {
|
|
120
|
+
dataIndex: _this.id,
|
|
121
|
+
title: _this.name,
|
|
122
|
+
renderExport: _this.renderExport
|
|
123
|
+
});
|
|
124
|
+
;
|
|
125
|
+
});
|
|
126
|
+
this.name = options.name;
|
|
127
|
+
this.id = options.id;
|
|
128
|
+
this.type = options.type;
|
|
129
|
+
this.canFilter = false;
|
|
130
|
+
this.canGroup = false;
|
|
131
|
+
this.canHidden = true;
|
|
132
|
+
this.showContains = false;
|
|
133
|
+
this.dataType = 'array';
|
|
134
|
+
this.componentConfig = options.componentConfig;
|
|
135
|
+
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
136
|
+
required: true,
|
|
137
|
+
validator: function validator(_, value) {
|
|
138
|
+
if (value && !value.length) {
|
|
139
|
+
return Promise.reject(new Error("\u8BF7\u9009\u62E9".concat(_this.name)));
|
|
140
|
+
}
|
|
141
|
+
return Promise.resolve();
|
|
142
|
+
}
|
|
143
|
+
}] : [];
|
|
144
|
+
this.rateMap = {
|
|
145
|
+
0: '',
|
|
146
|
+
0.5: '非常差',
|
|
147
|
+
1: '非常差',
|
|
148
|
+
1.5: '差',
|
|
149
|
+
2: '差',
|
|
150
|
+
2.5: '一般',
|
|
151
|
+
3: '一般',
|
|
152
|
+
3.5: '好',
|
|
153
|
+
4: '好',
|
|
154
|
+
4.5: '非常好',
|
|
155
|
+
5: '非常好'
|
|
156
|
+
};
|
|
157
|
+
});
|
|
158
|
+
export default BasicRate;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentInterface, PickOption, DataType, Record } from '../../type';
|
|
3
|
+
import { AddressData } from '@kmkf-fe-packages/kmkf-utils';
|
|
4
|
+
declare type Value = {
|
|
5
|
+
address?: (string | number)[];
|
|
6
|
+
detail?: string;
|
|
7
|
+
} | undefined;
|
|
8
|
+
declare class BasicInput implements ComponentInterface {
|
|
9
|
+
name: string;
|
|
10
|
+
id: string;
|
|
11
|
+
type: string;
|
|
12
|
+
rules: any[];
|
|
13
|
+
canFilter: boolean;
|
|
14
|
+
canGroup: boolean;
|
|
15
|
+
canHidden: boolean;
|
|
16
|
+
dataType: DataType;
|
|
17
|
+
showContains: boolean;
|
|
18
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
19
|
+
effects: ComponentInterface["effects"];
|
|
20
|
+
addressDateInstance: AddressData;
|
|
21
|
+
constructor(options: PickOption);
|
|
22
|
+
render: (value: Value, record: any) => JSX.Element;
|
|
23
|
+
transTextToNumber: (value?: string) => string | number | undefined;
|
|
24
|
+
renderPc: (value: any, record: Record) => JSX.Element;
|
|
25
|
+
renderExport: (value: any, record: any) => string;
|
|
26
|
+
renderClient: (record: any) => JSX.Element | null;
|
|
27
|
+
editRender: (value: any) => JSX.Element;
|
|
28
|
+
getColumns: () => this & {
|
|
29
|
+
dataIndex: string;
|
|
30
|
+
title: string;
|
|
31
|
+
componentType: (value: any) => JSX.Element;
|
|
32
|
+
renderExport: (value: any, record: any) => string;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export default BasicInput;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
5
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { Address } from '@kmkf-fe-packages/basic-components';
|
|
12
|
+
import { AddressData } from '@kmkf-fe-packages/kmkf-utils';
|
|
13
|
+
import GetFormItem from "../GetFormItem";
|
|
14
|
+
import ItemView from "../../commonComponents/ItemView";
|
|
15
|
+
import { isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
16
|
+
import every from 'lodash/every';
|
|
17
|
+
var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
18
|
+
var _this = this,
|
|
19
|
+
_this$componentConfig3;
|
|
20
|
+
_classCallCheck(this, BasicInput);
|
|
21
|
+
_defineProperty(this, "name", void 0);
|
|
22
|
+
_defineProperty(this, "id", void 0);
|
|
23
|
+
_defineProperty(this, "type", void 0);
|
|
24
|
+
_defineProperty(this, "rules", void 0);
|
|
25
|
+
_defineProperty(this, "canFilter", void 0);
|
|
26
|
+
_defineProperty(this, "canGroup", void 0);
|
|
27
|
+
_defineProperty(this, "canHidden", void 0);
|
|
28
|
+
_defineProperty(this, "dataType", void 0);
|
|
29
|
+
_defineProperty(this, "showContains", void 0);
|
|
30
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
31
|
+
_defineProperty(this, "effects", void 0);
|
|
32
|
+
_defineProperty(this, "addressDateInstance", void 0);
|
|
33
|
+
_defineProperty(this, "render", function (value, record) {
|
|
34
|
+
var _value$address;
|
|
35
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
36
|
+
className: "pointer",
|
|
37
|
+
onClick: function onClick() {
|
|
38
|
+
var _this$effects;
|
|
39
|
+
return _this === null || _this === void 0 ? void 0 : (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.queryWorkOrderDetail(record);
|
|
40
|
+
}
|
|
41
|
+
}, value === null || value === void 0 ? void 0 : (_value$address = value.address) === null || _value$address === void 0 ? void 0 : _value$address.map(function (suffix) {
|
|
42
|
+
return _this.addressDateInstance.getNameByCode(suffix);
|
|
43
|
+
}).join(''), value === null || value === void 0 ? void 0 : value.detail);
|
|
44
|
+
});
|
|
45
|
+
_defineProperty(this, "transTextToNumber", function (value) {
|
|
46
|
+
return value ? +value : value;
|
|
47
|
+
});
|
|
48
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
49
|
+
var _address;
|
|
50
|
+
if (record["".concat(_this.id, "_province")] === undefined) {
|
|
51
|
+
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
52
|
+
}
|
|
53
|
+
var address = [_this.transTextToNumber(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_province")]), _this.transTextToNumber(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_city")]), _this.transTextToNumber(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_district")])];
|
|
54
|
+
address = every(address, function (item) {
|
|
55
|
+
return !item;
|
|
56
|
+
}) ? [] : address;
|
|
57
|
+
var detail = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_address")];
|
|
58
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
59
|
+
className: "pointer",
|
|
60
|
+
onClick: function onClick() {
|
|
61
|
+
var _this$effects2;
|
|
62
|
+
return _this === null || _this === void 0 ? void 0 : (_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.queryWorkOrderDetail(record);
|
|
63
|
+
}
|
|
64
|
+
}, (_address = address) === null || _address === void 0 ? void 0 : _address.map(function () {
|
|
65
|
+
var suffix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
66
|
+
return _this.addressDateInstance.getNameByCode(suffix);
|
|
67
|
+
}).join(''), detail);
|
|
68
|
+
});
|
|
69
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
70
|
+
var _address2;
|
|
71
|
+
if (record["".concat(_this.id, "_province")] === undefined) {
|
|
72
|
+
return '--';
|
|
73
|
+
}
|
|
74
|
+
var address = [_this.transTextToNumber(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_province")]), _this.transTextToNumber(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_city")]), _this.transTextToNumber(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_district")])];
|
|
75
|
+
address = every(address, function (item) {
|
|
76
|
+
return !item;
|
|
77
|
+
}) ? [] : address;
|
|
78
|
+
var detail = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_address")];
|
|
79
|
+
return "".concat((_address2 = address) === null || _address2 === void 0 ? void 0 : _address2.map(function () {
|
|
80
|
+
var suffix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
81
|
+
return _this.addressDateInstance.getNameByCode(suffix);
|
|
82
|
+
}).join(''), " ").concat(detail || '');
|
|
83
|
+
});
|
|
84
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
85
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
86
|
+
id: _this.id,
|
|
87
|
+
label: _this.name,
|
|
88
|
+
value: _this.render(record === null || record === void 0 ? void 0 : record[_this.id], record)
|
|
89
|
+
}) : null;
|
|
90
|
+
});
|
|
91
|
+
_defineProperty(this, "editRender", function (value) {
|
|
92
|
+
var _this$componentConfig, _this$componentConfig2;
|
|
93
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
94
|
+
title: _this.name,
|
|
95
|
+
name: _this.id,
|
|
96
|
+
rules: _this.rules,
|
|
97
|
+
required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
|
|
98
|
+
component: /*#__PURE__*/React.createElement(Address, _this.componentConfig)
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
_defineProperty(this, "getColumns", function () {
|
|
102
|
+
return _objectSpread(_objectSpread({}, _this), {}, {
|
|
103
|
+
dataIndex: _this.id,
|
|
104
|
+
title: _this.name,
|
|
105
|
+
componentType: _this.editRender,
|
|
106
|
+
renderExport: _this.renderExport
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
this.name = options.name;
|
|
110
|
+
this.id = options.id;
|
|
111
|
+
this.type = options.type;
|
|
112
|
+
this.canFilter = false;
|
|
113
|
+
this.canGroup = false;
|
|
114
|
+
this.canHidden = true;
|
|
115
|
+
this.dataType = 'array';
|
|
116
|
+
this.showContains = false;
|
|
117
|
+
this.componentConfig = options.componentConfig;
|
|
118
|
+
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
119
|
+
validator: function validator(_, value) {
|
|
120
|
+
var _value$address2;
|
|
121
|
+
if (!(value !== null && value !== void 0 && (_value$address2 = value.address) !== null && _value$address2 !== void 0 && _value$address2.length)) {
|
|
122
|
+
return Promise.reject(new Error('请选择地址'));
|
|
123
|
+
}
|
|
124
|
+
if (!(value !== null && value !== void 0 && value.detail)) {
|
|
125
|
+
return Promise.reject(new Error('请填写详细地址'));
|
|
126
|
+
}
|
|
127
|
+
return Promise.resolve();
|
|
128
|
+
}
|
|
129
|
+
}] : [];
|
|
130
|
+
this.effects = options.effects;
|
|
131
|
+
this.addressDateInstance = AddressData.getInstance();
|
|
132
|
+
});
|
|
133
|
+
export default BasicInput;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ComponentInterface, PickOption, DataType, Record } from '../../type';
|
|
3
|
+
declare class ReceiverMobile implements ComponentInterface {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
type: string;
|
|
7
|
+
rules: any[];
|
|
8
|
+
canFilter: boolean;
|
|
9
|
+
canGroup: boolean;
|
|
10
|
+
canHidden: boolean;
|
|
11
|
+
dataType: DataType;
|
|
12
|
+
showContains: boolean;
|
|
13
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
14
|
+
effects: ComponentInterface["effects"];
|
|
15
|
+
constructor(options: PickOption);
|
|
16
|
+
render: (value: string, record: Record) => JSX.Element;
|
|
17
|
+
renderClient: (record: Record) => JSX.Element | null;
|
|
18
|
+
renderPc: (value: any, record: Record) => JSX.Element;
|
|
19
|
+
renderExport: (value: any, record: Record) => any;
|
|
20
|
+
editRender: (value: any) => JSX.Element;
|
|
21
|
+
getColumns: () => this & {
|
|
22
|
+
dataIndex: string;
|
|
23
|
+
title: string;
|
|
24
|
+
componentType: (value: any) => JSX.Element;
|
|
25
|
+
renderExport: (value: any, record: Record) => any;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export default ReceiverMobile;
|