fmui-base 2.2.57 → 2.2.58

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/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  ---npm publish
4
4
 
5
5
  ## 更新日志
6
+ - 2.2.58: 增加汇报周报组件,退回的批示意见增加标识
6
7
  - 2.2.57: 子表字段支持字段关联
7
8
  - 2.2.56: 手写签名按钮自定义,画笔上下抖动问题修复
8
9
  - 2.2.55: 流程列表分类搜索
@@ -272,6 +272,8 @@ var PageHome = function (_React$Component) {
272
272
  //是否加签
273
273
  if (item.isAddlots && item.isAddlots == '1' && userName) {
274
274
  userName = userName + "(加签)";
275
+ } else if (item.isAddlots && item.isAddlots == '2' && userName) {
276
+ userName = userName + "(退回)";
275
277
  }
276
278
  var userNameHtml = _react2.default.createElement(
277
279
  'span',
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ var _workItem = require('./workItem');
8
+
9
+ Object.defineProperty(exports, 'default', {
10
+ enumerable: true,
11
+ get: function get() {
12
+ return _interopRequireDefault(_workItem).default;
13
+ }
14
+ });
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,195 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = undefined;
7
+
8
+ var _createClass = function () { 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, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
9
+
10
+ var _class, _temp, _initialiseProps;
11
+
12
+ var _react = require('react');
13
+
14
+ var _react2 = _interopRequireDefault(_react);
15
+
16
+ var _Group = require('saltui/lib/Group');
17
+
18
+ var _Group2 = _interopRequireDefault(_Group);
19
+
20
+ var _Field = require('saltui/lib/Field');
21
+
22
+ var _Field2 = _interopRequireDefault(_Field);
23
+
24
+ var _Toast = require('saltui/lib/Toast');
25
+
26
+ var _Toast2 = _interopRequireDefault(_Toast);
27
+
28
+ require('./workItem.less');
29
+
30
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
+
32
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33
+
34
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
35
+
36
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
37
+
38
+ var workItem = (_temp = _class = function (_React$Component) {
39
+ _inherits(workItem, _React$Component);
40
+
41
+ function workItem(props) {
42
+ _classCallCheck(this, workItem);
43
+
44
+ // 传入的props参数
45
+ var _this = _possibleConstructorReturn(this, (workItem.__proto__ || Object.getPrototypeOf(workItem)).call(this, props));
46
+
47
+ _initialiseProps.call(_this);
48
+
49
+ var listValue = _this.props.value || [{ sortNo: 1, content: '' }];
50
+ var title = _this.props.label || '今日完成工作';
51
+ var readOnly = _this.props.readOnly || false;
52
+
53
+ // 组件级计数器,用于生成稳定的 React key(不暴露给外部)
54
+ _this._keyCounter = 1;
55
+ listValue = listValue.map(function (it) {
56
+ if (!it.__key) it.__key = _this._keyCounter++;
57
+ return it;
58
+ });
59
+
60
+ _this.state = {
61
+ listValue: listValue,
62
+ title: title,
63
+ readOnly: readOnly
64
+ };
65
+
66
+ return _this;
67
+ }
68
+
69
+ // 不在 componentDidMount 中保存渲染结果,直接在 render 中调用 initFn()
70
+
71
+
72
+ // 本地输入时更新 state,不立即通知父组件
73
+
74
+
75
+ // 输入完成(blur)时通知父组件或做后续处理
76
+
77
+
78
+ _createClass(workItem, [{
79
+ key: 'render',
80
+ value: function render() {
81
+ var _this2 = this;
82
+
83
+ return _react2.default.createElement(
84
+ _Group2.default.List,
85
+ { borderTopNone: true },
86
+ _react2.default.createElement(
87
+ _Field2.default,
88
+ { required: this.state.required, label: this.state.title, layout: 'v', multiLine: true },
89
+ _react2.default.createElement(
90
+ 'div',
91
+ null,
92
+ this.initFn()
93
+ ),
94
+ _react2.default.createElement(
95
+ 'div',
96
+ { className: 'iconfo', onClick: function onClick() {
97
+ return _this2.addItem();
98
+ } },
99
+ _react2.default.createElement('i', { className: 'iconfont icon-plus' })
100
+ )
101
+ )
102
+ );
103
+ }
104
+ }]);
105
+
106
+ return workItem;
107
+ }(_react2.default.Component), _initialiseProps = function _initialiseProps() {
108
+ var _this3 = this;
109
+
110
+ this.initFn = function () {
111
+ var list = _this3.state.listValue || [];
112
+ return _react2.default.createElement(
113
+ 'div',
114
+ { className: 'list' },
115
+ list.map(function (item, index) {
116
+ return _react2.default.createElement(
117
+ 'div',
118
+ { className: 'item', key: item.__key },
119
+ _react2.default.createElement(
120
+ 'span',
121
+ { className: 'number' },
122
+ index + 1
123
+ ),
124
+ _react2.default.createElement('textarea', {
125
+ disabled: _this3.state.readOnly,
126
+ maxLength: 200,
127
+ className: 'form-control',
128
+ rows: 1,
129
+ placeholder: '1-200\u4E2A\u5B57\u7B26',
130
+ value: item.content,
131
+ onChange: function onChange(e) {
132
+ return _this3.handleLocalChange(index, e.target.value);
133
+ },
134
+ onBlur: function onBlur() {
135
+ return _this3.handleContentChange(index);
136
+ }
137
+ }),
138
+ _react2.default.createElement(
139
+ 'span',
140
+ { className: 'remove-btn', onClick: function onClick() {
141
+ return _this3.removeItem(index);
142
+ } },
143
+ _react2.default.createElement('i', { className: 'iconfont icon-close' })
144
+ )
145
+ );
146
+ })
147
+ );
148
+ };
149
+
150
+ this.addItem = function () {
151
+ var listValue = JSON.parse(JSON.stringify(_this3.state.listValue));
152
+ var num = listValue.length + 1;
153
+ var newItem = { __key: _this3._keyCounter++, sortNo: num, content: '' };
154
+ if (num <= listValue.length) {
155
+ listValue.splice(num - 1, 0, newItem);
156
+ } else {
157
+ listValue.push(newItem);
158
+ }
159
+ listValue.forEach(function (it, i) {
160
+ return it.sortNo = i + 1;
161
+ });
162
+ _this3.setState({ listValue: listValue }, function () {
163
+ // 若需通知父组件,在这里回调(使用最新 state)
164
+ if (_this3.props.onChange) _this3.props.onChange(_this3.state.listValue);
165
+ });
166
+ };
167
+
168
+ this.removeItem = function (index) {
169
+ var listValue = JSON.parse(JSON.stringify(_this3.state.listValue));
170
+ if (index >= 0 && index < listValue.length && listValue.length > 1) {
171
+ listValue.splice(index, 1);
172
+ listValue.forEach(function (it, i) {
173
+ return it.sortNo = i + 1;
174
+ });
175
+ _this3.setState({ listValue: listValue }, function () {
176
+ if (_this3.props.onChange) _this3.props.onChange(_this3.state.listValue);
177
+ });
178
+ } else {
179
+ _Toast2.default.show({ type: 'error', content: '至少保留一个' });
180
+ }
181
+ };
182
+
183
+ this.handleLocalChange = function (index, value) {
184
+ var listValue = (_this3.state.listValue || []).slice();
185
+ if (index >= 0 && index < listValue.length) {
186
+ listValue[index] = Object.assign({}, listValue[index], { content: value });
187
+ _this3.setState({ listValue: listValue });
188
+ }
189
+ };
190
+
191
+ this.handleContentChange = function (index) {
192
+ if (_this3.props.onChange) _this3.props.onChange(_this3.state.listValue);
193
+ };
194
+ }, _temp);
195
+ exports.default = workItem;
@@ -0,0 +1,67 @@
1
+ .item {
2
+ position: relative;
3
+ border-radius: 4px;
4
+ margin: 5px 0;
5
+
6
+ .number {
7
+ width: 30px;
8
+ top: 1px;
9
+ left: 1px;
10
+ bottom: 1px;
11
+ position: absolute;
12
+ background: #f2f6fc;
13
+ display: flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ z-index: 9;
17
+ }
18
+
19
+ .form-control {
20
+ padding-left: 40px;
21
+ padding-right: 25px;
22
+ }
23
+
24
+ .form-control:focus {
25
+ border: 1px solid #3480fb;
26
+ border-radius: 4px;
27
+ box-shadow: none;
28
+ outline: 0;
29
+ }
30
+
31
+ .remove-btn {
32
+ width: 22px;
33
+ top: 1px;
34
+ right: 1px;
35
+ bottom: 1px;
36
+ position: absolute;
37
+ background: #f2f6fc;
38
+ display: flex;
39
+ align-items: center;
40
+ justify-content: center;
41
+ z-index: 9;
42
+
43
+ .iconfont {
44
+ font-size: 12px;
45
+ color: #909399;
46
+ }
47
+ }
48
+ }
49
+
50
+ .item:not(:last-child) {
51
+ margin: 5px 0 0 0;
52
+ }
53
+
54
+ .iconfo {
55
+ width: 30px;
56
+ height: 30px;
57
+ margin: 10px auto;
58
+ border-radius: 50%;
59
+ display: flex;
60
+ align-items: center;
61
+ justify-content: center;
62
+ background-color: #3480fb;
63
+
64
+ .iconfont {
65
+ color: #fff;
66
+ }
67
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.2.57",
3
+ "version": "2.2.58",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",