dtable-ui-component 0.3.0-beta → 0.3.0-beta2
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.
|
@@ -6,7 +6,7 @@ import React, { Component } from 'react';
|
|
|
6
6
|
import cn from 'astro-classname';
|
|
7
7
|
import ImagesLazyLoad from '../ImageFormatter/images-lazy-load';
|
|
8
8
|
import ImagePreviewerLightbox from '../ImagePreviewerLightbox';
|
|
9
|
-
import {
|
|
9
|
+
import { getDigitalSignImageUrl } from './utils';
|
|
10
10
|
import { downloadFile } from '../utils/utils';
|
|
11
11
|
import './index.css';
|
|
12
12
|
|
|
@@ -24,7 +24,7 @@ var DigitalSignFormatter = /*#__PURE__*/function (_Component) {
|
|
|
24
24
|
|
|
25
25
|
_this.getSignImages = function () {
|
|
26
26
|
var value = _this.props.value;
|
|
27
|
-
return [
|
|
27
|
+
return [getDigitalSignImageUrl(value)].filter(Boolean);
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
_this.onClickSignImage = function (index) {
|
|
@@ -73,7 +73,6 @@ var DigitalSignFormatter = /*#__PURE__*/function (_Component) {
|
|
|
73
73
|
key: "render",
|
|
74
74
|
value: function render() {
|
|
75
75
|
var _this$props = this.props,
|
|
76
|
-
value = _this$props.value,
|
|
77
76
|
server = _this$props.server,
|
|
78
77
|
containerClassName = _this$props.containerClassName,
|
|
79
78
|
readOnly = _this$props.readOnly;
|
|
@@ -86,7 +85,7 @@ var DigitalSignFormatter = /*#__PURE__*/function (_Component) {
|
|
|
86
85
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
87
86
|
className: className
|
|
88
87
|
}, /*#__PURE__*/React.createElement(ImagesLazyLoad, {
|
|
89
|
-
images:
|
|
88
|
+
images: signImages,
|
|
90
89
|
server: server,
|
|
91
90
|
onImageClick: this.onClickSignImage
|
|
92
91
|
})), isPreviewSignImage && /*#__PURE__*/React.createElement(ImagePreviewerLightbox, {
|
|
@@ -105,4 +104,12 @@ var DigitalSignFormatter = /*#__PURE__*/function (_Component) {
|
|
|
105
104
|
return DigitalSignFormatter;
|
|
106
105
|
}(Component);
|
|
107
106
|
|
|
107
|
+
DigitalSignFormatter.defaultProps = {
|
|
108
|
+
isSample: false,
|
|
109
|
+
isSupportPreview: false,
|
|
110
|
+
readOnly: true,
|
|
111
|
+
value: '',
|
|
112
|
+
server: '',
|
|
113
|
+
containerClassName: ''
|
|
114
|
+
};
|
|
108
115
|
export default DigitalSignFormatter;
|
|
@@ -1,34 +1,6 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
3
1
|
import dayjs from 'dayjs';
|
|
4
2
|
import utc from 'dayjs/plugin/utc';
|
|
5
3
|
dayjs.extend(utc);
|
|
6
4
|
export var getDigitalSignImageUrl = function getDigitalSignImageUrl(cellValue) {
|
|
7
5
|
return cellValue && cellValue.sign_image_url || '';
|
|
8
|
-
};
|
|
9
|
-
export var DigitalSignUtils = /*#__PURE__*/function () {
|
|
10
|
-
function DigitalSignUtils() {
|
|
11
|
-
_classCallCheck(this, DigitalSignUtils);
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
_createClass(DigitalSignUtils, null, [{
|
|
15
|
-
key: "getSignImageUrl",
|
|
16
|
-
value: function getSignImageUrl(sign) {
|
|
17
|
-
return getDigitalSignImageUrl(sign);
|
|
18
|
-
}
|
|
19
|
-
}, {
|
|
20
|
-
key: "getUpdatedSign",
|
|
21
|
-
value: function getUpdatedSign(_ref) {
|
|
22
|
-
var username = _ref.username,
|
|
23
|
-
sign_image_url = _ref.sign_image_url;
|
|
24
|
-
var time = dayjs().utc().format('YYYY-MM-DDTHH:mm:ss.SSSZ');
|
|
25
|
-
return {
|
|
26
|
-
username: username,
|
|
27
|
-
sign_image_url: sign_image_url,
|
|
28
|
-
sign_time: time
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
}]);
|
|
32
|
-
|
|
33
|
-
return DigitalSignUtils;
|
|
34
|
-
}();
|
|
6
|
+
};
|