fmui-base 2.3.60 → 2.3.62

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,8 @@
3
3
  ---npm publish
4
4
 
5
5
  ## 更新日志
6
+ - 2.3.62:单选多选可输入选项支持设置提示文字
7
+ - 2.3.61:移动端流程提交时过滤主键无效参数,如null字符串
6
8
  - 2.3.60:移动端支持减签
7
9
  - 2.3.59:移动端不通过的流程允许作废,移动端支持关联流程
8
10
  - 2.3.58:移动端数据表设置字段的关联值支持用户岗位
@@ -244,7 +244,12 @@ function cloneAndFilterEmptySubTblRows(editFormData) {
244
244
  try {
245
245
  data = JSON.parse(JSON.stringify(editFormData));
246
246
  } catch (e) {
247
- return editFormData;
247
+ // 深拷贝失败时仍做顶层清洗,避免新建把 formItem/optlock 原样提交
248
+ try {
249
+ data = Object.assign({}, editFormData);
250
+ } catch (e2) {
251
+ return slimFormDataForSubmit(editFormData);
252
+ }
248
253
  }
249
254
  var subTbl = data.subTbl || [];
250
255
  for (var i = 0; i < subTbl.length; i++) {
package/lib/form/form.js CHANGED
@@ -827,6 +827,8 @@ var PageHome = function (_React$Component) {
827
827
  itemParam.isinput = '0';
828
828
  var selectItem = form.multiItems; //选项
829
829
  var selectOptions = [];
830
+ // 可填空原始存值(如 a$#$#备注),须原样交给 SelectInput,不能转成 {value,text}
831
+ var radioRawValue = value;
830
832
  if (selectItem) {
831
833
  if (selectItem.length > 0) {
832
834
  selectItem.map(function (item) {
@@ -834,11 +836,12 @@ var PageHome = function (_React$Component) {
834
836
  var option = {};
835
837
  option.value = item.value;
836
838
  option.text = item.name;
837
- // if(status != '0'){
838
- if (value == item.value) {
839
- value = { value: value, text: item.name };
839
+ // 含可填空分隔符时保持字符串,避免丢失填空内容
840
+ if (typeof value !== 'string' || value.indexOf('$#$#') < 0 && value.indexOf('#$#$') < 0) {
841
+ if (value == item.value || String(value) === String(item.value)) {
842
+ value = { value: value, text: item.name };
843
+ }
840
844
  }
841
- // }
842
845
  selectOptions.push(option);
843
846
  }
844
847
  });
@@ -855,6 +858,9 @@ var PageHome = function (_React$Component) {
855
858
  if (itemParam.isinput == '1') {
856
859
  itemParam.selectOptions = selectItem;
857
860
  itemParam.selectItem = selectItem;
861
+ if (radioRawValue !== null && typeof radioRawValue !== 'undefined' && radioRawValue !== '') {
862
+ value = radioRawValue;
863
+ }
858
864
  } else {
859
865
  itemParam.selectOptions = selectOptions;
860
866
  itemParam.selectItem = selectOptions;
@@ -864,14 +870,19 @@ var PageHome = function (_React$Component) {
864
870
  itemParam.isinput = '0';
865
871
  var selectItem = form.multiItems; //选项
866
872
  var selectOptions = [];
873
+ var checkboxRawValue = value;
867
874
  if (selectItem) {
868
875
  var valueArray = [];
869
876
  //if(status != '0'){
870
877
  if (value || value == 0) {
871
- if (value.indexOf("[") >= 0) {
872
- valueArray = JSON.parse(value);
878
+ var valueStr = String(value);
879
+ if (valueStr.indexOf("[") >= 0) {
880
+ valueArray = JSON.parse(valueStr);
881
+ } else if (valueStr.indexOf("#$#$") >= 0 || valueStr.indexOf("$#$#") >= 0) {
882
+ // 可填空编码串勿按逗号拆,避免破坏 #$#$ / $#$#
883
+ valueArray = [];
873
884
  } else {
874
- valueArray = value.split(",");
885
+ valueArray = valueStr.split(",");
875
886
  }
876
887
  }
877
888
  // }
@@ -885,7 +896,7 @@ var PageHome = function (_React$Component) {
885
896
  option.checked = false;
886
897
  if (valueArray.length > 0) {
887
898
  for (var i = 0; i < valueArray.length; i++) {
888
- if (valueArray[i] == item.value) {
899
+ if (valueArray[i] == item.value || String(valueArray[i]) === String(item.value)) {
889
900
  option.checked = true;
890
901
  }
891
902
  }
@@ -903,6 +914,9 @@ var PageHome = function (_React$Component) {
903
914
  if (itemParam.isinput == '1') {
904
915
  itemParam.selectOptions = selectItem;
905
916
  itemParam.selectItem = selectItem;
917
+ if (checkboxRawValue !== null && typeof checkboxRawValue !== 'undefined') {
918
+ value = checkboxRawValue;
919
+ }
906
920
  } else {
907
921
  itemParam.selectOptions = selectOptions;
908
922
  itemParam.selectItem = selectOptions;
@@ -2213,16 +2227,26 @@ var PageHome = function (_React$Component) {
2213
2227
  var key = itemNew[i].key;
2214
2228
  if (key == 'value') {
2215
2229
  if (itemParam.itemType == 'positioning') {} else if (itemParam.itemType == 'select' || itemParam.itemType == 'radio') {
2216
- var selectOptions = itemParam.selectOptions;
2217
- var valueHas = false; //判断传过来的值是否有匹配
2218
- selectOptions.map(function (item) {
2219
- if (item.value == itemNew[i].value) {
2220
- itemParam[key] = item;
2221
- valueHas = true;
2230
+ // 可填空单选:保留 a$#$#填空 原串,禁止因匹配不上选项被置 null
2231
+ if (itemParam.isinput == '1') {
2232
+ itemParam[key] = itemNew[i].value == null ? '' : itemNew[i].value;
2233
+ } else {
2234
+ var selectOptions = itemParam.selectOptions;
2235
+ var valueHas = false; //判断传过来的值是否有匹配
2236
+ var incomingVal = itemNew[i].value;
2237
+ var incomingCode = incomingVal;
2238
+ if (typeof incomingVal === 'string' && incomingVal.indexOf('$#$#') >= 0) {
2239
+ incomingCode = incomingVal.split('$#$#')[0];
2240
+ }
2241
+ selectOptions.map(function (item) {
2242
+ if (item.value == incomingVal || String(item.value) === String(incomingCode)) {
2243
+ itemParam[key] = item;
2244
+ valueHas = true;
2245
+ }
2246
+ });
2247
+ if (!valueHas) {
2248
+ itemParam[key] = null;
2222
2249
  }
2223
- });
2224
- if (!valueHas) {
2225
- itemParam[key] = null;
2226
2250
  }
2227
2251
  } else if (itemParam.itemType == 'checkbox') {
2228
2252
  var selectOptions = itemParam.selectOptions;
@@ -2907,6 +2931,10 @@ var PageHome = function (_React$Component) {
2907
2931
  var selectedValue = null;
2908
2932
  if (currentValue != null && currentValue !== '') {
2909
2933
  selectedValue = (typeof currentValue === 'undefined' ? 'undefined' : _typeof(currentValue)) === 'object' ? currentValue.value : currentValue;
2934
+ // 可填空存值只取选项码做选中匹配
2935
+ if (typeof selectedValue === 'string' && selectedValue.indexOf('$#$#') >= 0) {
2936
+ selectedValue = selectedValue.split('$#$#')[0];
2937
+ }
2910
2938
  }
2911
2939
  return (selectOptions || []).map(function (opt) {
2912
2940
  return {
@@ -2965,16 +2993,13 @@ var PageHome = function (_React$Component) {
2965
2993
  }, {
2966
2994
  key: 'selectInputChange',
2967
2995
  value: function selectInputChange(code, value) {
2968
- if (value) {
2996
+ // 允许空串回写(取消全选),勿用 if(value) 挡住
2997
+ if (value !== undefined && value !== null) {
2969
2998
  var data = this.props.data;
2970
2999
  var selectValue = value;
2971
3000
  data = this.editData(code, selectValue, data);
2972
3001
  var itemParam = this.state.itemParam;
2973
3002
  itemParam.value = value;
2974
- // this.setState({
2975
- // itemParam: itemParam
2976
- // });
2977
- // this.props.onChange(data,itemParam);
2978
3003
  this.setState({
2979
3004
  itemParam: itemParam
2980
3005
  }, function () {
@@ -1615,11 +1615,17 @@ var PageHome = function (_React$Component) {
1615
1615
  t._pendingForceOptlock = null;
1616
1616
  forceOptlock = true;
1617
1617
  }
1618
- // 无有效主表主键时不缓存 optlock,避免发起/新建误传版本号
1619
- if (!forceOptlock && !(0, _filterEmptySubTblRows.isValidFormDataId)(formData && formData.dataId) && !(0, _filterEmptySubTblRows.isValidFormDataId)(t.state.dataId)) {
1618
+ // 无有效主表主键时不缓存 optlock,避免发起/新建误传版本号。
1619
+ // 仅认 formData.dataId(提交真正用的主键);不要用 businessKey 单独保留版本号,否则会顶栏带 optlock、formData 无 dataId 被后端拦。
1620
+ if (!forceOptlock && !(0, _filterEmptySubTblRows.isValidFormDataId)(formData && formData.dataId)) {
1620
1621
  var contentDataId = content && (content.dataId || content.businessKey);
1621
- if (!(0, _filterEmptySubTblRows.isValidFormDataId)(contentDataId)) {
1622
+ if ((0, _filterEmptySubTblRows.isValidFormDataId)(contentDataId)) {
1623
+ formData.dataId = contentDataId;
1624
+ } else {
1622
1625
  resolvedOptlock = '';
1626
+ if (formData && formData.hasOwnProperty('optlock')) {
1627
+ delete formData.optlock;
1628
+ }
1623
1629
  }
1624
1630
  }
1625
1631
  t.setState({
@@ -2720,12 +2726,12 @@ var PageHome = function (_React$Component) {
2720
2726
  reminderContent: _this2.state.reminderContent,
2721
2727
  processInstanceId: _this2.state.processInstanceId,
2722
2728
  permissionCode: _this2.state.permissionCode
2723
- };
2724
- if (t.state.module === 'approve' && t.state.formDataOptlock !== '' && t.state.formDataOptlock !== null && typeof t.state.formDataOptlock !== 'undefined') {
2725
- // 无有效主表 dataId 时不传 optlock,避免后端「已传版本却无主键」直接报冲突
2726
- var optlockDataId = dataId || sendData && sendData.dataId || t.state.dataId;
2727
- if ((0, _filterEmptySubTblRows.isValidFormDataId)(optlockDataId)) {
2729
+ // 仅当提交 formData 有真实主键时带 optlock(勿用 state.dataId 兜底,新建易误传)
2730
+ };if (t.state.module === 'approve') {
2731
+ if ((0, _filterEmptySubTblRows.isValidFormDataId)(sendData && sendData.dataId) && t.state.formDataOptlock !== '' && t.state.formDataOptlock != null) {
2728
2732
  param.optlock = t.state.formDataOptlock;
2733
+ } else if (param.optlock !== undefined) {
2734
+ delete param.optlock;
2729
2735
  }
2730
2736
  }
2731
2737
  var dealActionName = "";
@@ -5762,6 +5768,67 @@ var PageHome = function (_React$Component) {
5762
5768
  _Toast2.default.show({ type: 'error', content: '刷新表单失败,请手动刷新页面' });
5763
5769
  });
5764
5770
  }
5771
+
5772
+ /**
5773
+ * sendFlow 提交前清洗 optlock:
5774
+ * - 以 formData.dataId 为准(再 slim 一次)
5775
+ * - 无有效主键时删除顶栏 optlock,并去掉 formData 内 optlock
5776
+ * - 勿用 state.dataId 兜底(新建场景易误传 0)
5777
+ */
5778
+
5779
+ }, {
5780
+ key: 'sanitizeSendFlowOptlockParam',
5781
+ value: function sanitizeSendFlowOptlockParam(param) {
5782
+ var t = this;
5783
+ if (!param || t.state.module !== 'approve') {
5784
+ return;
5785
+ }
5786
+ var fd = null;
5787
+ try {
5788
+ if (param.formData) {
5789
+ fd = typeof param.formData === 'string' ? JSON.parse(param.formData) : param.formData;
5790
+ fd = (0, _filterEmptySubTblRows.cloneAndFilterEmptySubTblRows)(fd) || fd;
5791
+ }
5792
+ } catch (e1) {
5793
+ fd = null;
5794
+ }
5795
+ var payloadDataId = '';
5796
+ if (fd && (0, _filterEmptySubTblRows.isValidFormDataId)(fd.dataId)) {
5797
+ payloadDataId = fd.dataId;
5798
+ } else if ((0, _filterEmptySubTblRows.isValidFormDataId)(param.dataId)) {
5799
+ payloadDataId = param.dataId;
5800
+ }
5801
+ if (!(0, _filterEmptySubTblRows.isValidFormDataId)(payloadDataId)) {
5802
+ delete param.optlock;
5803
+ if (fd) {
5804
+ fd.dataId = '';
5805
+ if (fd.hasOwnProperty('optlock')) {
5806
+ delete fd.optlock;
5807
+ }
5808
+ try {
5809
+ param.formData = JSON.stringify(fd);
5810
+ } catch (e2) {}
5811
+ }
5812
+ return;
5813
+ }
5814
+ if (t.state.formDataOptlock !== '' && t.state.formDataOptlock != null && typeof t.state.formDataOptlock !== 'undefined') {
5815
+ param.optlock = t.state.formDataOptlock;
5816
+ if (fd) {
5817
+ fd.optlock = t.state.formDataOptlock;
5818
+ try {
5819
+ param.formData = JSON.stringify(fd);
5820
+ } catch (e3) {}
5821
+ }
5822
+ } else {
5823
+ delete param.optlock;
5824
+ if (fd && fd.hasOwnProperty('optlock')) {
5825
+ delete fd.optlock;
5826
+ try {
5827
+ param.formData = JSON.stringify(fd);
5828
+ } catch (e4) {}
5829
+ }
5830
+ }
5831
+ }
5765
5832
  }, {
5766
5833
  key: 'sendFlowFuc',
5767
5834
  value: function sendFlowFuc(param) {
@@ -5828,23 +5895,8 @@ var PageHome = function (_React$Component) {
5828
5895
  // param.commentbizSn=commentbizSn;
5829
5896
  // }
5830
5897
  param.commentbizSn = commentbizSn;
5831
- if (t.state.module === 'approve' && t.state.formDataOptlock !== '' && t.state.formDataOptlock !== null && typeof t.state.formDataOptlock !== 'undefined') {
5832
- // 无有效主表 dataId 时不传 optlock,避免后端「已传版本却无主键」直接报冲突
5833
- var sendOptlockDataId = param.dataId || t.state.dataId;
5834
- try {
5835
- if ((!sendOptlockDataId || !(0, _filterEmptySubTblRows.isValidFormDataId)(sendOptlockDataId)) && param.formData) {
5836
- var parsedFd = typeof param.formData === 'string' ? JSON.parse(param.formData) : param.formData;
5837
- if (parsedFd && (0, _filterEmptySubTblRows.isValidFormDataId)(parsedFd.dataId)) {
5838
- sendOptlockDataId = parsedFd.dataId;
5839
- }
5840
- }
5841
- } catch (eOpt) {}
5842
- if ((0, _filterEmptySubTblRows.isValidFormDataId)(sendOptlockDataId)) {
5843
- param.optlock = t.state.formDataOptlock;
5844
- } else if (param.optlock !== undefined) {
5845
- delete param.optlock;
5846
- }
5847
- }
5898
+ // 提交前统一清洗:新建无主键绝不带 optlock(含 getNextActivity 残留)
5899
+ t.sanitizeSendFlowOptlockParam(param);
5848
5900
 
5849
5901
  var db = _db2.default;
5850
5902
  db.FlowModuleAPI.sendFlow(param).then(function (content) {
@@ -61,9 +61,22 @@ var SelectInput = function (_React$Component) {
61
61
  this.setState(this.buildStateFromProps(this.props));
62
62
  }
63
63
  }
64
+
65
+ /** 选项码统一转字符串,避免 "2" === 2 导致不回显 */
66
+
67
+ }, {
68
+ key: 'toOptionKey',
69
+ value: function toOptionKey(v) {
70
+ if (v === null || v === undefined) {
71
+ return '';
72
+ }
73
+ return String(v);
74
+ }
64
75
  }, {
65
76
  key: 'getOptions',
66
77
  value: function getOptions(props) {
78
+ var _this2 = this;
79
+
67
80
  // 统一标准化外部 options,屏蔽不同页面传值字段差异。
68
81
  // 最终内部只使用:value、text、isInput、isDefault。
69
82
  var options = props.options || [];
@@ -72,10 +85,11 @@ var SelectInput = function (_React$Component) {
72
85
  var isInput = item.isinput === '1' || item.isinput === 1 || item.isInput === true;
73
86
  var isDefault = item.isDefault === 1 || item.isDefault === '1';
74
87
  return {
75
- value: item.value,
88
+ value: _this2.toOptionKey(item.value),
76
89
  text: text,
77
90
  isInput: isInput,
78
- isDefault: isDefault
91
+ isDefault: isDefault,
92
+ inputTip: item.inputTip || item.inputtip || ''
79
93
  };
80
94
  });
81
95
  }
@@ -101,6 +115,8 @@ var SelectInput = function (_React$Component) {
101
115
  }, {
102
116
  key: 'parseValueByType',
103
117
  value: function parseValueByType(value, selectType, options) {
118
+ var _this3 = this;
119
+
104
120
  // 解析外部传入的 value,转换成组件内部可直接渲染的状态:
105
121
  // 1. inputValues: 各选项输入框值,格式如 { c: '111', d: '222' }
106
122
  // 2. selectedRadio: 单选当前选中的 value
@@ -116,12 +132,23 @@ var SelectInput = function (_React$Component) {
116
132
  // 2. 对象:{ value: 'a', text: 'A' }
117
133
  if (typeof value === 'string' && value !== '') {
118
134
  var pair = this.splitPair(value);
119
- selectedRadio = pair.selected;
135
+ selectedRadio = this.toOptionKey(pair.selected);
120
136
  if (pair.inputValue !== '') {
121
- inputValues[pair.selected] = pair.inputValue;
137
+ inputValues[selectedRadio] = pair.inputValue;
138
+ }
139
+ } else if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.value !== undefined && value.value !== null) {
140
+ selectedRadio = this.toOptionKey(value.value);
141
+ if (value.inputValue != null && value.inputValue !== '') {
142
+ inputValues[selectedRadio] = String(value.inputValue);
143
+ } else if (typeof value.text === 'string' && value.text.indexOf(KV_SEP) >= 0) {
144
+ var _pair = this.splitPair(value.text);
145
+ if (_pair.inputValue !== '') {
146
+ inputValues[selectedRadio] = _pair.inputValue;
147
+ }
122
148
  }
123
- } else if (value && (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && value.value !== undefined) {
124
- selectedRadio = value.value;
149
+ } else if (value !== null && value !== undefined && value !== '') {
150
+ // 兼容数字等非字符串码值
151
+ selectedRadio = this.toOptionKey(value);
125
152
  }
126
153
 
127
154
  if (!selectedRadio) {
@@ -129,7 +156,7 @@ var SelectInput = function (_React$Component) {
129
156
  // 这里的“默认选中”依赖 options[i].isDefault。
130
157
  for (var i = 0; i < options.length; i++) {
131
158
  if (options[i].isDefault) {
132
- selectedRadio = options[i].value;
159
+ selectedRadio = this.toOptionKey(options[i].value);
133
160
  break;
134
161
  }
135
162
  }
@@ -149,35 +176,42 @@ var SelectInput = function (_React$Component) {
149
176
  if (!parts[_i]) {
150
177
  continue;
151
178
  }
152
- var _pair = this.splitPair(parts[_i]);
153
- if (_pair.selected !== '') {
179
+ var _pair2 = this.splitPair(parts[_i]);
180
+ var key = this.toOptionKey(_pair2.selected);
181
+ if (key !== '') {
154
182
  // 选中项单独存进 selectedValues,输入框值按 value 建索引。
155
- selectedValues.push(_pair.selected);
156
- inputValues[_pair.selected] = _pair.inputValue;
183
+ selectedValues.push(key);
184
+ inputValues[key] = _pair2.inputValue;
157
185
  }
158
186
  }
159
187
  } else {
160
188
  // 兼容普通逗号分隔的多选值,例如 a,b,c。
161
189
  selectedValues = value.split(',').filter(function (item) {
162
190
  return item !== '';
191
+ }).map(function (item) {
192
+ return _this3.toOptionKey(item);
163
193
  });
164
194
  }
165
195
  } else if (Array.isArray(value)) {
166
- selectedValues = value;
196
+ selectedValues = value.map(function (item) {
197
+ return _this3.toOptionKey(item);
198
+ }).filter(function (item) {
199
+ return item !== '';
200
+ });
167
201
  }
168
202
 
169
203
  if (selectedValues.length === 0) {
170
204
  // 没有传值时,多选回退到所有默认选中且未禁用的项。
171
205
  for (var _i2 = 0; _i2 < options.length; _i2++) {
172
206
  if (options[_i2].isDefault) {
173
- selectedValues.push(options[_i2].value);
207
+ selectedValues.push(this.toOptionKey(options[_i2].value));
174
208
  }
175
209
  }
176
210
  }
177
211
 
178
212
  selectedValues.forEach(function (item) {
179
213
  // selectedMap 用来支撑 render 时的 O(1) 勾选判断。
180
- selectedMap[item] = true;
214
+ selectedMap[_this3.toOptionKey(item)] = true;
181
215
  });
182
216
  }
183
217
 
@@ -213,9 +247,10 @@ var SelectInput = function (_React$Component) {
213
247
  key: 'getOptionByValue',
214
248
  value: function getOptionByValue(value) {
215
249
  // 根据 value 找到当前选项元数据,用于判断该选项是否带输入框等属性。
250
+ var key = this.toOptionKey(value);
216
251
  var options = this.state.options;
217
252
  for (var i = 0; i < options.length; i++) {
218
- if (options[i].value === value) {
253
+ if (this.toOptionKey(options[i].value) === key) {
219
254
  return options[i];
220
255
  }
221
256
  }
@@ -292,7 +327,7 @@ var SelectInput = function (_React$Component) {
292
327
  }, {
293
328
  key: 'handleSelectChange',
294
329
  value: function handleSelectChange(optionValue, checked) {
295
- var _this2 = this;
330
+ var _this4 = this;
296
331
 
297
332
  if (this.props.readOnly) {
298
333
  return;
@@ -306,7 +341,7 @@ var SelectInput = function (_React$Component) {
306
341
  selectedRadio: optionValue
307
342
  });
308
343
  this.setState(_nextState, function () {
309
- _this2.emitValue(_this2.state);
344
+ _this4.emitValue(_this4.state);
310
345
  });
311
346
  return;
312
347
  }
@@ -326,7 +361,7 @@ var SelectInput = function (_React$Component) {
326
361
  });
327
362
 
328
363
  this.setState(nextState, function () {
329
- _this2.emitValue(_this2.state);
364
+ _this4.emitValue(_this4.state);
330
365
  });
331
366
  }
332
367
  }, {
@@ -361,17 +396,18 @@ var SelectInput = function (_React$Component) {
361
396
  }, {
362
397
  key: 'renderOptions',
363
398
  value: function renderOptions() {
364
- var _this3 = this;
399
+ var _this5 = this;
365
400
 
366
401
  var readOnly = this.props.readOnly;
367
402
  var selectType = this.state.selectType;
368
403
  var options = this.state.options;
369
404
 
370
405
  return options.map(function (option, index) {
371
- var optionValue = option.value;
372
- // 单选看 selectedRadio,多选看 selectedMap 是否包含当前 value。
373
- var checked = selectType === 'radio' ? _this3.state.selectedRadio === optionValue : !!_this3.state.selectedMap[optionValue];
406
+ var optionValue = _this5.toOptionKey(option.value);
407
+ // 单选看 selectedRadio,多选看 selectedMap 是否包含当前 value(统一字符串比较)。
408
+ var checked = selectType === 'radio' ? _this5.toOptionKey(_this5.state.selectedRadio) === optionValue : !!_this5.state.selectedMap[optionValue];
374
409
  var showInput = option.isInput;
410
+ var fillText = _this5.state.inputValues[optionValue] || '';
375
411
  var optionClassName = checked ? 'dd-select-input-option checked' : 'dd-select-input-option';
376
412
  var inputDisabled = readOnly || !showInput;
377
413
 
@@ -384,7 +420,7 @@ var SelectInput = function (_React$Component) {
384
420
  checked: checked,
385
421
  disabled: readOnly,
386
422
  onChange: function onChange(e) {
387
- _this3.handleSelectChange(optionValue, e.target.checked);
423
+ _this5.handleSelectChange(optionValue, e.target.checked);
388
424
  }
389
425
  }),
390
426
  _react2.default.createElement('span', { className: selectType === 'radio' ? 'dd-select-input-icon radio' : 'dd-select-input-icon checkbox' }),
@@ -393,19 +429,25 @@ var SelectInput = function (_React$Component) {
393
429
  { className: 'dd-select-input-option-text' },
394
430
  option.text
395
431
  ),
396
- showInput ? _react2.default.createElement('input', {
432
+ showInput && !readOnly ? _react2.default.createElement('input', {
397
433
  className: 'dd-select-input-text',
398
434
  type: 'text',
399
- value: _this3.state.inputValues[optionValue] || ''
435
+ placeholder: option.inputTip || '',
436
+ value: fillText
400
437
  // 输入框只有在当前项已选中且 readOnly=false 时才允许输入。
401
438
  , disabled: inputDisabled,
402
439
  onChange: function onChange(e) {
403
- _this3.handleInputChange(optionValue, e.target.value);
440
+ _this5.handleInputChange(optionValue, e.target.value);
404
441
  },
405
442
  onBlur: function onBlur() {
406
- _this3.handleInputBlur();
443
+ _this5.handleInputBlur();
407
444
  }
408
- }) : null
445
+ }) : null,
446
+ showInput && readOnly && fillText ? _react2.default.createElement(
447
+ 'span',
448
+ { className: 'dd-select-input-text-ro' },
449
+ fillText
450
+ ) : null
409
451
  );
410
452
  });
411
453
  }
@@ -5,7 +5,7 @@
5
5
  .dd-select-input-option {
6
6
  display: flex;
7
7
  align-items: center;
8
- margin: 8px 0;
8
+ margin: 8px 12px 8px 0;
9
9
  cursor: pointer;
10
10
  }
11
11
 
@@ -71,11 +71,12 @@
71
71
 
72
72
  .dd-select-input-text {
73
73
  flex: 1;
74
- min-width: 120px;
74
+ min-width: 48px;
75
75
  border: none;
76
- border-bottom: 1px solid #ddd;
76
+ border-bottom: 2px solid #999;
77
77
  outline: none;
78
- padding: 4px 2px;
78
+ padding: 4px 5px;
79
+ margin-left: 6px;
79
80
  font-size: 14px;
80
81
  background-color: transparent;
81
82
  }
@@ -84,4 +85,14 @@
84
85
  color: #333;
85
86
  border-bottom-color: #eee;
86
87
  cursor: not-allowed;
88
+ }
89
+
90
+ .dd-select-input-text-ro {
91
+ display: inline-block;
92
+ margin-left: 8px;
93
+ padding: 0 5px;
94
+ min-width: 48px;
95
+ color: #333;
96
+ line-height: 1.47;
97
+ word-break: break-all;
87
98
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fmui-base",
3
- "version": "2.3.60",
3
+ "version": "2.3.62",
4
4
  "title": "fmui-base",
5
5
  "description": "fmui移动端组件",
6
6
  "main": "lib/index.js",