Showing
1 changed file
with
60 additions
and
56 deletions
... | ... | @@ -237,65 +237,10 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
237 | 237 | // </Select> |
238 | 238 | // </Form.Item> |
239 | 239 | }, |
240 | - nodeType !== 'END' && | |
241 | - { | |
242 | - title: '取值范围', | |
243 | - dataIndex: 'qxProps', | |
244 | - editable: true, | |
245 | - key: 'qxProps', | |
246 | - render: (text: any, record: any) => { | |
247 | - return ( | |
248 | - <> | |
249 | - {record.type === 'FORM' ? <> | |
250 | - <div key={record.id}> | |
251 | - <span> | |
252 | - {text?.name} | |
253 | - </span> | |
254 | - </div> | |
255 | - </> : <> | |
256 | - <div key={record.id}> | |
257 | - <span>{record.type == 'TIME' ? text?.min ? moment(text.min).format( | |
258 | - formatEnum[text?.format] || 'YYYY-MM-DD') : undefined : text?.min} | |
259 | - </span> | |
260 | - {!!text?.min || text?.min >= 0 && ( | |
261 | - <Space style={{ marginLeft: 5, marginRight: 5 }}>-</Space> | |
262 | - )} | |
263 | - <span>{record.type == 'TIME' ? text?.max ? moment(text.max).format( | |
264 | - formatEnum[text?.format] || 'YYYY-MM-DD') : undefined : text?.max} | |
265 | - </span> | |
266 | - </div> | |
267 | - </>} | |
268 | - </> | |
269 | - ) | |
270 | - }, | |
271 | - }, | |
272 | - nodeType !== 'END' && | |
273 | - { | |
274 | - title: '必填', | |
275 | - dataIndex: 'required', | |
276 | - editable: true, | |
277 | - key: 'required', | |
278 | - width: '5%', | |
279 | - render: (text, record) => ( | |
280 | - <span key={record.id}>{text ? '是' : '否'}</span> | |
281 | - // <Form.Item | |
282 | - // name={'required' + record.id} | |
283 | - // initialValue={record.required} | |
284 | - // > | |
285 | - // <Select | |
286 | - // disabled={record.disabled} | |
287 | - // onSelect={(e) => props.handleChange(e, record, 'required')} | |
288 | - // > | |
289 | - // <Select.Option value={true}>是</Select.Option> | |
290 | - // <Select.Option value={false}>否</Select.Option> | |
291 | - // </Select> | |
292 | - // </Form.Item> | |
293 | - ), | |
294 | - }, | |
295 | 240 | { |
296 | 241 | title: '默认值', |
297 | 242 | dataIndex: 'mappingValues', |
298 | - width: '12%', | |
243 | + width: '15%', | |
299 | 244 | editable: true, |
300 | 245 | key: 'mappingValues', |
301 | 246 | render: (text) => |
... | ... | @@ -386,6 +331,65 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |
386 | 331 | }, |
387 | 332 | ]; |
388 | 333 | |
334 | + const range = { | |
335 | + title: '取值范围', | |
336 | + dataIndex: 'qxProps', | |
337 | + editable: true, | |
338 | + key: 'qxProps', | |
339 | + render: (text: any, record: any) => { | |
340 | + return ( | |
341 | + <> | |
342 | + {record.type === 'FORM' ? <> | |
343 | + <div key={record.id}> | |
344 | + <span> | |
345 | + {text?.name} | |
346 | + </span> | |
347 | + </div> | |
348 | + </> : <> | |
349 | + <div key={record.id}> | |
350 | + <span>{record.type == 'TIME' ? text?.min ? moment(text.min).format( | |
351 | + formatEnum[text?.format] || 'YYYY-MM-DD') : undefined : text?.min} | |
352 | + </span> | |
353 | + {!!text?.min || text?.min >= 0 && ( | |
354 | + <Space style={{ marginLeft: 5, marginRight: 5 }}>-</Space> | |
355 | + )} | |
356 | + <span>{record.type == 'TIME' ? text?.max ? moment(text.max).format( | |
357 | + formatEnum[text?.format] || 'YYYY-MM-DD') : undefined : text?.max} | |
358 | + </span> | |
359 | + </div> | |
360 | + </>} | |
361 | + </> | |
362 | + ) | |
363 | + }, | |
364 | + }; | |
365 | + | |
366 | + const require = { | |
367 | + title: '必填', | |
368 | + dataIndex: 'required', | |
369 | + editable: true, | |
370 | + key: 'required', | |
371 | + width: '5%', | |
372 | + render: (text, record) => ( | |
373 | + <span key={record.id}>{text ? '是' : '否'}</span> | |
374 | + // <Form.Item | |
375 | + // name={'required' + record.id} | |
376 | + // initialValue={record.required} | |
377 | + // > | |
378 | + // <Select | |
379 | + // disabled={record.disabled} | |
380 | + // onSelect={(e) => props.handleChange(e, record, 'required')} | |
381 | + // > | |
382 | + // <Select.Option value={true}>是</Select.Option> | |
383 | + // <Select.Option value={false}>否</Select.Option> | |
384 | + // </Select> | |
385 | + // </Form.Item> | |
386 | + ), | |
387 | + }; | |
388 | + | |
389 | + if (nodeType !== 'END') { | |
390 | + columns.splice(3, 0, range, require) | |
391 | + } | |
392 | + | |
389 | 393 | interface EditableRowProps { |
390 | 394 | index: number; |
391 | 395 | } | ... | ... |