| 1 | /* eslint-disable array-callback-return */ | 1 | /* eslint-disable array-callback-return */ | 
| 2 | /* eslint-disable eqeqeq */ | 2 | /* eslint-disable eqeqeq */ | 
| 3 | -import { |  |  | 
| 4 | -  SnippetsOutlined, |  |  | 
| 5 | -} from '@ant-design/icons'; | 3 | +import { SnippetsOutlined } from '@ant-design/icons'; | 
|  |  | 4 | +import { QxFieldSetter, QxFormSelect } from '@qx/common'; | 
| 6 | import { | 5 | import { | 
| 7 | Button, | 6 | Button, | 
| 8 | Col, | 7 | Col, | 
| 9 | DatePicker, | 8 | DatePicker, | 
|  |  | 9 | +  Divider, | 
| 10 | Form, | 10 | Form, | 
| 11 | Input, | 11 | Input, | 
| 12 | InputNumber, | 12 | InputNumber, | 
|  | @@ -15,31 +15,23 @@ import { |  | @@ -15,31 +15,23 @@ import { | 
| 15 | Select, | 15 | Select, | 
| 16 | Space, | 16 | Space, | 
| 17 | Table, | 17 | Table, | 
| 18 | -  Divider, |  |  | 
| 19 | message, | 18 | message, | 
| 20 | } from 'antd'; | 19 | } from 'antd'; | 
| 21 | -import React, { |  |  | 
| 22 | -  useCallback, |  |  | 
| 23 | -  useEffect, |  |  | 
| 24 | -  useState, |  |  | 
| 25 | -} from 'react'; | 20 | +import React, { useCallback, useEffect, useState } from 'react'; | 
| 26 | import JSONEditor from './codeMirror'; | 21 | import JSONEditor from './codeMirror'; | 
| 27 | -import './style.less'; |  |  | 
| 28 | -import { QxFieldSetter, QxFormSelect } from '@qx/common'; |  |  | 
| 29 | -import { formatEnum } from './constant'; |  |  | 
| 30 | import { | 22 | import { | 
|  |  | 23 | +  formatEnum, | 
| 31 | typeTranslateFieIdtype, | 24 | typeTranslateFieIdtype, | 
| 32 | -  typeTranslateWidget, |  |  | 
| 33 | typeTranslateGrouptype, | 25 | typeTranslateGrouptype, | 
| 34 | -  // typeTranslateItemtype, | 26 | +  typeTranslateWidget, | 
| 35 | } from './constant'; | 27 | } from './constant'; | 
|  |  | 28 | +import './style.less'; | 
| 36 | // import { Controlled as CodeMirror } from 'react-codemirror2' | 29 | // import { Controlled as CodeMirror } from 'react-codemirror2' | 
| 37 | -import { cloneDeep } from 'lodash-es'; |  |  | 
| 38 | -import moment from 'dayjs'; |  |  | 
| 39 | -import { QxBaseIcon } from '@qx/common'; |  |  | 
| 40 | import Icon from '@ant-design/icons'; | 30 | import Icon from '@ant-design/icons'; | 
| 41 | -import { SubNodeIcon } from './sub-node-icon'; |  |  | 
| 42 | -import { SubDropIcon } from './sub-node-icon'; | 31 | +import { QxBaseIcon } from '@qx/common'; | 
|  |  | 32 | +import moment from 'dayjs'; | 
|  |  | 33 | +import { cloneDeep } from 'lodash-es'; | 
|  |  | 34 | +import { SubDropIcon, SubNodeIcon } from './sub-node-icon'; | 
| 43 |  | 35 |  | 
| 44 | import '../style/reset.less'; | 36 | import '../style/reset.less'; | 
| 45 |  | 37 |  | 
|  | @@ -90,9 +82,6 @@ interface ParameterSettingProps { |  | @@ -90,9 +82,6 @@ interface ParameterSettingProps { | 
| 90 | appId?: string; // 当前应用ID | 82 | appId?: string; // 当前应用ID | 
| 91 | } | 83 | } | 
| 92 |  | 84 |  | 
| 93 | - |  |  | 
| 94 | - |  |  | 
| 95 | - |  |  | 
| 96 | const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 85 | const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 97 | const { | 86 | const { | 
| 98 | visible, | 87 | visible, | 
|  | @@ -163,11 +152,15 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -163,11 +152,15 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 163 | const columns = [ | 152 | const columns = [ | 
| 164 | { | 153 | { | 
| 165 | title: ( | 154 | title: ( | 
| 166 | -        <div style={{ |  |  | 
| 167 | -          display: 'flex', flexDirection: 'row' |  |  | 
| 168 | -          , alignContent: 'center', flexWrap: 'wrap' |  |  | 
| 169 | -        }}> |  |  | 
| 170 | -          <span className='parameter-setting-table-title'>参数编码</span> | 155 | +        <div | 
|  |  | 156 | +          style={{ | 
|  |  | 157 | +            display: 'flex', | 
|  |  | 158 | +            flexDirection: 'row', | 
|  |  | 159 | +            alignContent: 'center', | 
|  |  | 160 | +            flexWrap: 'wrap', | 
|  |  | 161 | +          }} | 
|  |  | 162 | +        > | 
|  |  | 163 | +          <span className="parameter-setting-table-title">参数编码</span> | 
| 171 | <span style={{ color: 'red' }}>*</span> | 164 | <span style={{ color: 'red' }}>*</span> | 
| 172 | </div> | 165 | </div> | 
| 173 | ), | 166 | ), | 
|  | @@ -179,10 +172,10 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -179,10 +172,10 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 179 | const strTitle = (text as string) || ''; | 172 | const strTitle = (text as string) || ''; | 
| 180 | const index = strTitle.indexOf(searchValue); | 173 | const index = strTitle.indexOf(searchValue); | 
| 181 | return ( | 174 | return ( | 
| 182 | -          < Form.Item | 175 | +          <Form.Item | 
| 183 | name={'code' + record.id} | 176 | name={'code' + record.id} | 
| 184 | style={{ margin: 0 }} | 177 | style={{ margin: 0 }} | 
| 185 | -          // initialValue={record.code} | 178 | +            // initialValue={record.code} | 
| 186 | > | 179 | > | 
| 187 | <Input | 180 | <Input | 
| 188 | style={{ color: index > -1 && searchValue ? '#1890ff' : '' }} | 181 | style={{ color: index > -1 && searchValue ? '#1890ff' : '' }} | 
|  | @@ -193,15 +186,17 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -193,15 +186,17 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 193 | }} | 186 | }} | 
| 194 | defaultValue={record.code} | 187 | defaultValue={record.code} | 
| 195 | bordered={false} | 188 | bordered={false} | 
| 196 | -              disabled={record.disabled || typeDis} onBlur={(e) => handleChange(e, record, 'code')} /> |  |  | 
| 197 | -          </Form.Item > |  |  | 
| 198 | -        ) | 189 | +              disabled={record.disabled || typeDis} | 
|  |  | 190 | +              onBlur={(e) => handleChange(e, record, 'code')} | 
|  |  | 191 | +            /> | 
|  |  | 192 | +          </Form.Item> | 
|  |  | 193 | +        ); | 
| 199 | }, | 194 | }, | 
| 200 | }, | 195 | }, | 
| 201 | { | 196 | { | 
| 202 | title: ( | 197 | title: ( | 
| 203 | <div style={{ display: 'flex', flexDirection: 'row' }}> | 198 | <div style={{ display: 'flex', flexDirection: 'row' }}> | 
| 204 | -          <span className='parameter-setting-table-title'>参数名</span> | 199 | +          <span className="parameter-setting-table-title">参数名</span> | 
| 205 | <span style={{ color: 'red' }}>*</span> | 200 | <span style={{ color: 'red' }}>*</span> | 
| 206 | </div> | 201 | </div> | 
| 207 | ), | 202 | ), | 
|  | @@ -216,7 +211,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -216,7 +211,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 216 | <Form.Item | 211 | <Form.Item | 
| 217 | name={'title' + record.id} | 212 | name={'title' + record.id} | 
| 218 | style={{ margin: 0 }} | 213 | style={{ margin: 0 }} | 
| 219 | -          // initialValue={record.title} | 214 | +            // initialValue={record.title} | 
| 220 | > | 215 | > | 
| 221 | <Input | 216 | <Input | 
| 222 | style={{ color: index > -1 && searchValue ? '#1890ff' : '' }} | 217 | style={{ color: index > -1 && searchValue ? '#1890ff' : '' }} | 
|  | @@ -227,15 +222,17 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -227,15 +222,17 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 227 | }} | 222 | }} | 
| 228 | defaultValue={record.title} | 223 | defaultValue={record.title} | 
| 229 | bordered={false} | 224 | bordered={false} | 
| 230 | -              disabled={record.disabled || typeDis} onBlur={(e) => handleChange(e, record, 'title')} /> | 225 | +              disabled={record.disabled || typeDis} | 
|  |  | 226 | +              onBlur={(e) => handleChange(e, record, 'title')} | 
|  |  | 227 | +            /> | 
| 231 | </Form.Item> | 228 | </Form.Item> | 
| 232 | -        ) | 229 | +        ); | 
| 233 | }, | 230 | }, | 
| 234 | }, | 231 | }, | 
| 235 | { | 232 | { | 
| 236 | title: ( | 233 | title: ( | 
| 237 | <div style={{ display: 'flex', flexDirection: 'row' }}> | 234 | <div style={{ display: 'flex', flexDirection: 'row' }}> | 
| 238 | -          <span className='parameter-setting-table-title'>参数类型</span> | 235 | +          <span className="parameter-setting-table-title">参数类型</span> | 
| 239 | <span style={{ color: 'red' }}>*</span> | 236 | <span style={{ color: 'red' }}>*</span> | 
| 240 | </div> | 237 | </div> | 
| 241 | ), | 238 | ), | 
|  | @@ -243,36 +240,40 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -243,36 +240,40 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 243 | className: 'ps-table-cell', | 240 | className: 'ps-table-cell', | 
| 244 | width: '102px', | 241 | width: '102px', | 
| 245 | key: 'type', | 242 | key: 'type', | 
| 246 | -      render: (text, record) => | 243 | +      render: (text, record) => ( | 
| 247 | <Form.Item | 244 | <Form.Item | 
| 248 | style={{ margin: 0 }} | 245 | style={{ margin: 0 }} | 
| 249 | name={'type' + record.id} | 246 | name={'type' + record.id} | 
| 250 | -        // initialValue={record.type} | 247 | +          // initialValue={record.type} | 
| 251 | > | 248 | > | 
| 252 | <Select | 249 | <Select | 
| 253 | bordered={false} | 250 | bordered={false} | 
| 254 | disabled={record.disabled || typeDis} | 251 | disabled={record.disabled || typeDis} | 
| 255 | defaultValue={record.type} | 252 | defaultValue={record.type} | 
| 256 | -            onSelect={(e) => handleChange(e, record, 'type')} > |  |  | 
| 257 | -            { |  |  | 
| 258 | -              valueOptions.map((item) => { |  |  | 
| 259 | -                return <Select.Option key={item.key} value={item.key}>{item.title}</Select.Option>; |  |  | 
| 260 | -              }) |  |  | 
| 261 | -            } | 253 | +            onSelect={(e) => handleChange(e, record, 'type')} | 
|  |  | 254 | +          > | 
|  |  | 255 | +            {valueOptions.map((item) => { | 
|  |  | 256 | +              return ( | 
|  |  | 257 | +                <Select.Option key={item.key} value={item.key}> | 
|  |  | 258 | +                  {item.title} | 
|  |  | 259 | +                </Select.Option> | 
|  |  | 260 | +              ); | 
|  |  | 261 | +            })} | 
| 262 | </Select> | 262 | </Select> | 
| 263 | </Form.Item> | 263 | </Form.Item> | 
|  |  | 264 | +      ), | 
| 264 | }, | 265 | }, | 
| 265 | { | 266 | { | 
| 266 | title: ( | 267 | title: ( | 
| 267 | <div style={{ display: 'flex', flexDirection: 'row' }}> | 268 | <div style={{ display: 'flex', flexDirection: 'row' }}> | 
| 268 | -          <span className='parameter-setting-table-title'>默认值</span> | 269 | +          <span className="parameter-setting-table-title">默认值</span> | 
| 269 | </div> | 270 | </div> | 
| 270 | ), | 271 | ), | 
| 271 | dataIndex: 'valueMapping', | 272 | dataIndex: 'valueMapping', | 
| 272 | className: 'ps-table-cell', | 273 | className: 'ps-table-cell', | 
| 273 | width: '116px', | 274 | width: '116px', | 
| 274 | key: 'valueMapping', | 275 | key: 'valueMapping', | 
| 275 | -      render: (text, record) => | 276 | +      render: (text, record) => ( | 
| 276 | <div className="editable-cell "> | 277 | <div className="editable-cell "> | 
| 277 | <QxFieldSetter | 278 | <QxFieldSetter | 
| 278 | disabled={record.disabled || typeDis} | 279 | disabled={record.disabled || typeDis} | 
|  | @@ -292,14 +293,14 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -292,14 +293,14 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 292 | inputDis={true} | 293 | inputDis={true} | 
| 293 | /> | 294 | /> | 
| 294 | </div> | 295 | </div> | 
|  |  | 296 | +      ), | 
| 295 | }, | 297 | }, | 
| 296 | { | 298 | { | 
| 297 | -      title: |  |  | 
| 298 | -        ( |  |  | 
| 299 | -          <div style={{ display: 'flex', flexDirection: 'row' }}> |  |  | 
| 300 | -            <span className='parameter-setting-table-title'>参数说明</span> |  |  | 
| 301 | -          </div> |  |  | 
| 302 | -        ), | 299 | +      title: ( | 
|  |  | 300 | +        <div style={{ display: 'flex', flexDirection: 'row' }}> | 
|  |  | 301 | +          <span className="parameter-setting-table-title">参数说明</span> | 
|  |  | 302 | +        </div> | 
|  |  | 303 | +      ), | 
| 303 | dataIndex: 'description', | 304 | dataIndex: 'description', | 
| 304 | className: 'ps-table-cell', | 305 | className: 'ps-table-cell', | 
| 305 | key: 'description', | 306 | key: 'description', | 
|  | @@ -308,7 +309,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -308,7 +309,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 308 | <Form.Item | 309 | <Form.Item | 
| 309 | name={'description' + record.id} | 310 | name={'description' + record.id} | 
| 310 | style={{ margin: 0 }} | 311 | style={{ margin: 0 }} | 
| 311 | -        // initialValue={text} | 312 | +          // initialValue={text} | 
| 312 | > | 313 | > | 
| 313 | <Input | 314 | <Input | 
| 314 | draggable={true} | 315 | draggable={true} | 
|  | @@ -319,23 +320,24 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -319,23 +320,24 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 319 | key={inputKey} | 320 | key={inputKey} | 
| 320 | defaultValue={text} | 321 | defaultValue={text} | 
| 321 | bordered={false} | 322 | bordered={false} | 
| 322 | -            disabled={record.disabled || typeDis} onBlur={(e) => handleChange(e, record, 'description')} /> | 323 | +            disabled={record.disabled || typeDis} | 
|  |  | 324 | +            onBlur={(e) => handleChange(e, record, 'description')} | 
|  |  | 325 | +          /> | 
| 323 | </Form.Item> | 326 | </Form.Item> | 
| 324 | ), | 327 | ), | 
| 325 | }, | 328 | }, | 
| 326 | { | 329 | { | 
| 327 | -      title: |  |  | 
| 328 | -        ( |  |  | 
| 329 | -          <div style={{ display: 'flex', flexDirection: 'row' }}> |  |  | 
| 330 | -            <span className='parameter-setting-table-title'>操作</span> |  |  | 
| 331 | -          </div> |  |  | 
| 332 | -        ), | 330 | +      title: ( | 
|  |  | 331 | +        <div style={{ display: 'flex', flexDirection: 'row' }}> | 
|  |  | 332 | +          <span className="parameter-setting-table-title">操作</span> | 
|  |  | 333 | +        </div> | 
|  |  | 334 | +      ), | 
| 333 | key: 'action', | 335 | key: 'action', | 
| 334 | className: 'ps-table-cell', | 336 | className: 'ps-table-cell', | 
| 335 | width: '96px', | 337 | width: '96px', | 
| 336 | render: (text, record) => { | 338 | render: (text, record) => { | 
| 337 | -        const isShowAdd = (record && checkShowAdd(record)); |  |  | 
| 338 | -        const isShowTree = (record && checkShowTree(record)); | 339 | +        const isShowAdd = record && checkShowAdd(record); | 
|  |  | 340 | +        const isShowTree = record && checkShowTree(record); | 
| 339 | return ( | 341 | return ( | 
| 340 | <Space size="small"> | 342 | <Space size="small"> | 
| 341 | {isShowAdd && ( | 343 | {isShowAdd && ( | 
|  | @@ -343,7 +345,9 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -343,7 +345,9 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 343 | size={'small'} | 345 | size={'small'} | 
| 344 | type="link" | 346 | type="link" | 
| 345 | disabled={record.disabled || typeDis} | 347 | disabled={record.disabled || typeDis} | 
| 346 | -                icon={<QxBaseIcon style={{ fontSize: 16 }} type={'qx-icon-plus'} />} | 348 | +                icon={ | 
|  |  | 349 | +                  <QxBaseIcon style={{ fontSize: 16 }} type={'qx-icon-plus'} /> | 
|  |  | 350 | +                } | 
| 347 | onClick={() => handleAdd(record.pid)} | 351 | onClick={() => handleAdd(record.pid)} | 
| 348 | /> | 352 | /> | 
| 349 | )} | 353 | )} | 
|  | @@ -353,7 +357,9 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -353,7 +357,9 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 353 | size={'small'} | 357 | size={'small'} | 
| 354 | type="link" | 358 | type="link" | 
| 355 | disabled={record.disabled || typeDis} | 359 | disabled={record.disabled || typeDis} | 
| 356 | -                  icon={<Icon style={{ fontSize: 16 }} component={SubNodeIcon} />} | 360 | +                  icon={ | 
|  |  | 361 | +                    <Icon style={{ fontSize: 16 }} component={SubNodeIcon} /> | 
|  |  | 362 | +                  } | 
| 357 | onClick={() => handleAddTree(record.id)} | 363 | onClick={() => handleAddTree(record.id)} | 
| 358 | /> | 364 | /> | 
| 359 | )} | 365 | )} | 
|  | @@ -362,7 +368,13 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -362,7 +368,13 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 362 | type="link" | 368 | type="link" | 
| 363 | className="btn-high-del" | 369 | className="btn-high-del" | 
| 364 | disabled={record.disabled || typeDis} | 370 | disabled={record.disabled || typeDis} | 
| 365 | -              icon={<QxBaseIcon style={{ fontSize: 16 }} className={'title-btn-del-btn'} type={'qx-icon-delete'} />} | 371 | +              icon={ | 
|  |  | 372 | +                <QxBaseIcon | 
|  |  | 373 | +                  style={{ fontSize: 16 }} | 
|  |  | 374 | +                  className={'title-btn-del-btn'} | 
|  |  | 375 | +                  type={'qx-icon-delete'} | 
|  |  | 376 | +                /> | 
|  |  | 377 | +              } | 
| 366 | onClick={() => handleDelete(record)} | 378 | onClick={() => handleDelete(record)} | 
| 367 | /> | 379 | /> | 
| 368 | </Space> | 380 | </Space> | 
|  | @@ -372,12 +384,11 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -372,12 +384,11 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 372 | ]; | 384 | ]; | 
| 373 |  | 385 |  | 
| 374 | const range = { | 386 | const range = { | 
| 375 | -    title: |  |  | 
| 376 | -      ( |  |  | 
| 377 | -        <div style={{ display: 'flex', flexDirection: 'row' }}> |  |  | 
| 378 | -          <span className='parameter-setting-table-title'>取值范围</span> |  |  | 
| 379 | -        </div> |  |  | 
| 380 | -      ), | 387 | +    title: ( | 
|  |  | 388 | +      <div style={{ display: 'flex', flexDirection: 'row' }}> | 
|  |  | 389 | +        <span className="parameter-setting-table-title">取值范围</span> | 
|  |  | 390 | +      </div> | 
|  |  | 391 | +    ), | 
| 381 | dataIndex: 'qxProps', | 392 | dataIndex: 'qxProps', | 
| 382 | className: 'ps-table-cell', | 393 | className: 'ps-table-cell', | 
| 383 | width: '314px', | 394 | width: '314px', | 
|  | @@ -386,10 +397,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -386,10 +397,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 386 | switch (record.type) { | 397 | switch (record.type) { | 
| 387 | case 'STRING': | 398 | case 'STRING': | 
| 388 | return ( | 399 | return ( | 
| 389 | -            <div |  |  | 
| 390 | -              key={record.id} |  |  | 
| 391 | -              className="editable-cell" |  |  | 
| 392 | -            > | 400 | +            <div key={record.id} className="editable-cell"> | 
| 393 | <InputNumber | 401 | <InputNumber | 
| 394 | draggable={true} | 402 | draggable={true} | 
| 395 | disabled={record.disabled || typeDis} | 403 | disabled={record.disabled || typeDis} | 
|  | @@ -404,7 +412,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -404,7 +412,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 404 | defaultValue={qxProps?.min || undefined} | 412 | defaultValue={qxProps?.min || undefined} | 
| 405 | placeholder="最小长度" | 413 | placeholder="最小长度" | 
| 406 | /> | 414 | /> | 
| 407 | -              <div className='range-cell'>-</div> | 415 | +              <div className="range-cell">-</div> | 
| 408 | <InputNumber | 416 | <InputNumber | 
| 409 | draggable={true} | 417 | draggable={true} | 
| 410 | disabled={record.disabled || typeDis} | 418 | disabled={record.disabled || typeDis} | 
|  | @@ -423,11 +431,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -423,11 +431,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 423 | ); | 431 | ); | 
| 424 | case 'NUMBER': | 432 | case 'NUMBER': | 
| 425 | return ( | 433 | return ( | 
| 426 | -            <div |  |  | 
| 427 | -              key={record.id} |  |  | 
| 428 | -              className="editable-cell" |  |  | 
| 429 | -            > |  |  | 
| 430 | -              <div className='range-cell'> | 434 | +            <div key={record.id} className="editable-cell"> | 
|  |  | 435 | +              <div className="range-cell"> | 
| 431 | <InputNumber | 436 | <InputNumber | 
| 432 | disabled={record.disabled || typeDis} | 437 | disabled={record.disabled || typeDis} | 
| 433 | draggable={true} | 438 | draggable={true} | 
|  | @@ -437,7 +442,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -437,7 +442,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 437 | }} | 442 | }} | 
| 438 | precision={qxProps.precision || 0} | 443 | precision={qxProps.precision || 0} | 
| 439 | bordered={false} | 444 | bordered={false} | 
| 440 | -                  size='small' | 445 | +                  size="small" | 
| 441 | defaultValue={qxProps?.min || undefined} | 446 | defaultValue={qxProps?.min || undefined} | 
| 442 | onBlur={(e) => handleChange(e, record, 'qxProps-min')} | 447 | onBlur={(e) => handleChange(e, record, 'qxProps-min')} | 
| 443 | // style={{ width: '110px' }} | 448 | // style={{ width: '110px' }} | 
|  | @@ -452,7 +457,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -452,7 +457,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 452 | event.preventDefault(); | 457 | event.preventDefault(); | 
| 453 | }} | 458 | }} | 
| 454 | bordered={false} | 459 | bordered={false} | 
| 455 | -                  size='small' | 460 | +                  size="small" | 
| 456 | precision={qxProps.precision || 0} | 461 | precision={qxProps.precision || 0} | 
| 457 | defaultValue={qxProps.max || undefined} | 462 | defaultValue={qxProps.max || undefined} | 
| 458 | onBlur={(e) => handleChange(e, record, 'qxProps-max')} | 463 | onBlur={(e) => handleChange(e, record, 'qxProps-max')} | 
|  | @@ -461,8 +466,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -461,8 +466,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 461 | /> | 466 | /> | 
| 462 | <Divider type="vertical" style={{ height: '16px' }} /> | 467 | <Divider type="vertical" style={{ height: '16px' }} /> | 
| 463 | </div> | 468 | </div> | 
| 464 | -              <div className='range-cell'> |  |  | 
| 465 | - | 469 | +              <div className="range-cell"> | 
| 466 | <InputNumber | 470 | <InputNumber | 
| 467 | disabled={record.disabled || typeDis} | 471 | disabled={record.disabled || typeDis} | 
| 468 | draggable={true} | 472 | draggable={true} | 
|  | @@ -471,7 +475,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -471,7 +475,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 471 | event.preventDefault(); | 475 | event.preventDefault(); | 
| 472 | }} | 476 | }} | 
| 473 | bordered={false} | 477 | bordered={false} | 
| 474 | -                  size='small' | 478 | +                  size="small" | 
| 475 | precision={0} | 479 | precision={0} | 
| 476 | min={0} | 480 | min={0} | 
| 477 | max={8} | 481 | max={8} | 
|  | @@ -484,20 +488,13 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -484,20 +488,13 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 484 | ); | 488 | ); | 
| 485 | case 'TIME': | 489 | case 'TIME': | 
| 486 | return ( | 490 | return ( | 
| 487 | -            <div |  |  | 
| 488 | -              key={record.id} |  |  | 
| 489 | -              className="editable-cell" |  |  | 
| 490 | -            > |  |  | 
| 491 | -              <div className='range-cell'> | 491 | +            <div key={record.id} className="editable-cell"> | 
|  |  | 492 | +              <div className="range-cell"> | 
| 492 | <DatePicker | 493 | <DatePicker | 
| 493 | bordered={false} | 494 | bordered={false} | 
| 494 | disabled={record.disabled || typeDis} | 495 | disabled={record.disabled || typeDis} | 
| 495 | -                  size='small' |  |  | 
| 496 | -                  defaultValue={ |  |  | 
| 497 | -                    qxProps?.min |  |  | 
| 498 | -                      ? moment(qxProps.min) |  |  | 
| 499 | -                      : undefined |  |  | 
| 500 | -                  } | 496 | +                  size="small" | 
|  |  | 497 | +                  defaultValue={qxProps?.min ? moment(qxProps.min) : undefined} | 
| 501 | format={formatEnum[qxProps?.format] || 'YYYY-MM-DD'} | 498 | format={formatEnum[qxProps?.format] || 'YYYY-MM-DD'} | 
| 502 | // style={{ width: '110px' }} | 499 | // style={{ width: '110px' }} | 
| 503 | showTime | 500 | showTime | 
|  | @@ -507,13 +504,9 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -507,13 +504,9 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 507 | - | 504 | - | 
| 508 | <DatePicker | 505 | <DatePicker | 
| 509 | disabled={record.disabled || typeDis} | 506 | disabled={record.disabled || typeDis} | 
| 510 | -                  size='small' | 507 | +                  size="small" | 
| 511 | bordered={false} | 508 | bordered={false} | 
| 512 | -                  defaultValue={ |  |  | 
| 513 | -                    qxProps?.max |  |  | 
| 514 | -                      ? moment(qxProps.max) |  |  | 
| 515 | -                      : undefined |  |  | 
| 516 | -                  } | 509 | +                  defaultValue={qxProps?.max ? moment(qxProps.max) : undefined} | 
| 517 | format={formatEnum[qxProps?.format] || 'YYYY-MM-DD'} | 510 | format={formatEnum[qxProps?.format] || 'YYYY-MM-DD'} | 
| 518 | // style={{ width: '110px' }} | 511 | // style={{ width: '110px' }} | 
| 519 | showTime | 512 | showTime | 
|  | @@ -522,18 +515,16 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -522,18 +515,16 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 522 | /> | 515 | /> | 
| 523 | <Divider type="vertical" style={{ height: '16px' }} /> | 516 | <Divider type="vertical" style={{ height: '16px' }} /> | 
| 524 | </div> | 517 | </div> | 
| 525 | -              <div className='range-cell'> | 518 | +              <div className="range-cell"> | 
| 526 | <Select | 519 | <Select | 
| 527 | disabled={record.disabled || typeDis} | 520 | disabled={record.disabled || typeDis} | 
| 528 | -                  size='small' | 521 | +                  size="small" | 
| 529 | // style={{ width: '90px' }} | 522 | // style={{ width: '90px' }} | 
| 530 | bordered={false} | 523 | bordered={false} | 
| 531 | placeholder="格式" | 524 | placeholder="格式" | 
| 532 | popupMatchSelectWidth={false} | 525 | popupMatchSelectWidth={false} | 
| 533 | defaultValue={qxProps?.format || 'YEAR_DATE'} | 526 | defaultValue={qxProps?.format || 'YEAR_DATE'} | 
| 534 | -                  onSelect={(e) => |  |  | 
| 535 | -                    handleChange(e, record, 'qxProps-format') |  |  | 
| 536 | -                  } | 527 | +                  onSelect={(e) => handleChange(e, record, 'qxProps-format')} | 
| 537 | > | 528 | > | 
| 538 | {timeFormat.map((item) => { | 529 | {timeFormat.map((item) => { | 
| 539 | return ( | 530 | return ( | 
|  | @@ -554,10 +545,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -554,10 +545,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 554 | case 'USER': | 545 | case 'USER': | 
| 555 | case 'ORG': | 546 | case 'ORG': | 
| 556 | return ( | 547 | return ( | 
| 557 | -            <div |  |  | 
| 558 | -              className='editable-cell' |  |  | 
| 559 | -              key={record.id} |  |  | 
| 560 | -            > | 548 | +            <div className="editable-cell" key={record.id}> | 
| 561 | <QxFormSelect | 549 | <QxFormSelect | 
| 562 | value={qxProps} | 550 | value={qxProps} | 
| 563 | appId={props?.appId} | 551 | appId={props?.appId} | 
|  | @@ -566,7 +554,11 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -566,7 +554,11 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 566 | onChange={(val: any) => { | 554 | onChange={(val: any) => { | 
| 567 | handleChange(val, record, 'qxProps'); | 555 | handleChange(val, record, 'qxProps'); | 
| 568 | }} | 556 | }} | 
| 569 | -                disabled={['USER', 'ORG'].includes(record.type) || record.disabled || typeDis} | 557 | +                disabled={ | 
|  |  | 558 | +                  ['USER', 'ORG'].includes(record.type) || | 
|  |  | 559 | +                  record.disabled || | 
|  |  | 560 | +                  typeDis | 
|  |  | 561 | +                } | 
| 570 | request={props?.request} | 562 | request={props?.request} | 
| 571 | /> | 563 | /> | 
| 572 | </div> | 564 | </div> | 
|  | @@ -577,21 +569,17 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -577,21 +569,17 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 577 | }; | 569 | }; | 
| 578 |  | 570 |  | 
| 579 | const require = { | 571 | const require = { | 
| 580 | -    title: |  |  | 
| 581 | -      ( |  |  | 
| 582 | -        <div style={{ display: 'flex', flexDirection: 'row' }}> |  |  | 
| 583 | -          <span className='parameter-setting-table-title'>必填</span> |  |  | 
| 584 | -        </div> |  |  | 
| 585 | -      ), | 572 | +    title: ( | 
|  |  | 573 | +      <div style={{ display: 'flex', flexDirection: 'row' }}> | 
|  |  | 574 | +        <span className="parameter-setting-table-title">必填</span> | 
|  |  | 575 | +      </div> | 
|  |  | 576 | +    ), | 
| 586 | dataIndex: 'required', | 577 | dataIndex: 'required', | 
| 587 | className: 'ps-table-cell', | 578 | className: 'ps-table-cell', | 
| 588 | key: 'required', | 579 | key: 'required', | 
| 589 | width: '86px', | 580 | width: '86px', | 
| 590 | render: (text, record) => ( | 581 | render: (text, record) => ( | 
| 591 | -      <Form.Item |  |  | 
| 592 | -        name={'required' + record.id} |  |  | 
| 593 | -        style={{ margin: 0 }} |  |  | 
| 594 | -      > | 582 | +      <Form.Item name={'required' + record.id} style={{ margin: 0 }}> | 
| 595 | <Select | 583 | <Select | 
| 596 | defaultValue={text || false} | 584 | defaultValue={text || false} | 
| 597 | bordered={false} | 585 | bordered={false} | 
|  | @@ -601,12 +589,12 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -601,12 +589,12 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 601 | <Select.Option value={true}>是</Select.Option> | 589 | <Select.Option value={true}>是</Select.Option> | 
| 602 | <Select.Option value={false}>否</Select.Option> | 590 | <Select.Option value={false}>否</Select.Option> | 
| 603 | </Select> | 591 | </Select> | 
| 604 | -      </Form.Item > | 592 | +      </Form.Item> | 
| 605 | ), | 593 | ), | 
| 606 | }; | 594 | }; | 
| 607 |  | 595 |  | 
| 608 | if (nodeType !== 'END') { | 596 | if (nodeType !== 'END') { | 
| 609 | -    columns.splice(3, 0, range, require) | 597 | +    columns.splice(3, 0, range, require); | 
| 610 | } | 598 | } | 
| 611 |  | 599 |  | 
| 612 | // const isDeveloper = window.sessionStorage.getItem('DEVELOPER_MODE') === '1'; | 600 | // const isDeveloper = window.sessionStorage.getItem('DEVELOPER_MODE') === '1'; | 
|  | @@ -618,7 +606,6 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -618,7 +606,6 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 618 | handleAdd(''); | 606 | handleAdd(''); | 
| 619 | } | 607 | } | 
| 620 | } | 608 | } | 
| 621 | - |  |  | 
| 622 | }, [visible]); | 609 | }, [visible]); | 
| 623 |  | 610 |  | 
| 624 | //展开 所有子节点 | 611 | //展开 所有子节点 | 
|  | @@ -648,7 +635,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -648,7 +635,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 648 | style: { cursor: 'move' }, | 635 | style: { cursor: 'move' }, | 
| 649 | onDragStart: (ev: any) => { | 636 | onDragStart: (ev: any) => { | 
| 650 | ev.persist(); | 637 | ev.persist(); | 
| 651 | -      console.log('onDragStart', ev.target) | 638 | +      console.log('onDragStart', ev.target); | 
| 652 | ev.dataTransfer.effectAllowed = 'move'; | 639 | ev.dataTransfer.effectAllowed = 'move'; | 
| 653 | ev.dataTransfer.setData('text', ev.target.getAttribute('data-row-key')); | 640 | ev.dataTransfer.setData('text', ev.target.getAttribute('data-row-key')); | 
| 654 | }, | 641 | }, | 
|  | @@ -797,8 +784,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -797,8 +784,8 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 797 | /> | 784 | /> | 
| 798 | } | 785 | } | 
| 799 | > | 786 | > | 
| 800 | -        {!type && ( |  |  | 
| 801 | -          isShowJson ? ( | 787 | +        {!type && | 
|  |  | 788 | +          (isShowJson ? ( | 
| 802 | <Row> | 789 | <Row> | 
| 803 | <Col span={12}> | 790 | <Col span={12}> | 
| 804 | <Button | 791 | <Button | 
|  | @@ -816,7 +803,12 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -816,7 +803,12 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 816 | <Button | 803 | <Button | 
| 817 | size={'small'} | 804 | size={'small'} | 
| 818 | type="link" | 805 | type="link" | 
| 819 | -                  icon={<QxBaseIcon style={{ fontSize: 16 }} type={'qx-icon-flow-code'} />} | 806 | +                  icon={ | 
|  |  | 807 | +                    <QxBaseIcon | 
|  |  | 808 | +                      style={{ fontSize: 16 }} | 
|  |  | 809 | +                      type={'qx-icon-flow-code'} | 
|  |  | 810 | +                    /> | 
|  |  | 811 | +                  } | 
| 820 | style={{ | 812 | style={{ | 
| 821 | padding: 0, | 813 | padding: 0, | 
| 822 | height: '32px', | 814 | height: '32px', | 
|  | @@ -846,69 +838,68 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { |  | @@ -846,69 +838,68 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | 
| 846 | /> | 838 | /> | 
| 847 | </Col> | 839 | </Col> | 
| 848 | </Row> | 840 | </Row> | 
| 849 | -          ) |  |  | 
| 850 | -        ) |  |  | 
| 851 | -        } |  |  | 
| 852 | -        { |  |  | 
| 853 | -          isShowJson ? ( |  |  | 
| 854 | -            <> |  |  | 
| 855 | -              <JSONEditor value={midData} onChange={onJsonChange} /> |  |  | 
| 856 | -              <Col |  |  | 
| 857 | -                className="border-none" |  |  | 
| 858 | -                span={24} |  |  | 
| 859 | -                style={{ |  |  | 
| 860 | -                  display: 'flex', |  |  | 
| 861 | -                  flexDirection: 'row-reverse', |  |  | 
| 862 | -                  marginBottom: '10px', |  |  | 
| 863 | -                  textAlign: 'center', |  |  | 
| 864 | -                }} |  |  | 
| 865 | -              > |  |  | 
| 866 | -                <Space> |  |  | 
| 867 | -                  <Button onClick={() => onCancel()}>{'取消'}</Button> |  |  | 
| 868 | -                  <Button type="primary" onClick={() => submit()}> |  |  | 
| 869 | -                    {'确定'} |  |  | 
| 870 | -                  </Button> |  |  | 
| 871 | -                </Space> |  |  | 
| 872 | -              </Col> |  |  | 
| 873 | -            </> |  |  | 
| 874 | -          ) : ( |  |  | 
| 875 | -            <Table |  |  | 
| 876 | -              expandable={{ |  |  | 
| 877 | -                defaultExpandAllRows: true, |  |  | 
| 878 | -                childrenColumnName: 'child', |  |  | 
| 879 | -                expandIcon: ({ expanded, onExpand, record }) => |  |  | 
| 880 | -                  record.child && record.child.length > 0 && expanded ? ( |  |  | 
| 881 | -                    <> |  |  | 
| 882 | -                      <Icon component={SubDropIcon} |  |  | 
| 883 | -                        className='drop-icon' /> |  |  | 
| 884 | -                      <QxBaseIcon className={'table-expanded'} type={'qx-caret-down'} onClick={e => onExpand(record, e)} /> |  |  | 
| 885 | -                    </> |  |  | 
| 886 | - |  |  | 
| 887 | -                  ) : record.child && record.child.length > 0 && !expanded ? |  |  | 
| 888 | -                    ( |  |  | 
| 889 | -                      <> |  |  | 
| 890 | -                        <Icon component={SubDropIcon} |  |  | 
| 891 | -                          className='drop-icon' /> |  |  | 
| 892 | -                        <QxBaseIcon className={'table-expanded-change'} type={'qx-caret-down'} onClick={e => onExpand(record, e)} /> |  |  | 
| 893 | -                      </> |  |  | 
| 894 | -                    ) |  |  | 
| 895 | -                    : |  |  | 
| 896 | -                    <Icon component={SubDropIcon} |  |  | 
| 897 | -                      className='drop-icon' /> | 841 | +          ))} | 
|  |  | 842 | +        {isShowJson ? ( | 
|  |  | 843 | +          <> | 
|  |  | 844 | +            <JSONEditor value={midData} onChange={onJsonChange} /> | 
|  |  | 845 | +            <Col | 
|  |  | 846 | +              className="border-none" | 
|  |  | 847 | +              span={24} | 
|  |  | 848 | +              style={{ | 
|  |  | 849 | +                display: 'flex', | 
|  |  | 850 | +                flexDirection: 'row-reverse', | 
|  |  | 851 | +                marginBottom: '10px', | 
|  |  | 852 | +                textAlign: 'center', | 
| 898 | }} | 853 | }} | 
| 899 | -              className='parameter-setting-table' |  |  | 
| 900 | -              onRow={() => onRow()} |  |  | 
| 901 | -              scroll={{ x: 1000, y: 432 }} |  |  | 
| 902 | -              bordered |  |  | 
| 903 | -              pagination={false} |  |  | 
| 904 | -              size={'small'} |  |  | 
| 905 | -              // @ts-ignore |  |  | 
| 906 | -              columns={columns} |  |  | 
| 907 | -              dataSource={data} |  |  | 
| 908 | -              rowKey={'id'} |  |  | 
| 909 | -            /> |  |  | 
| 910 | -          ) |  |  | 
| 911 | -        } | 854 | +            > | 
|  |  | 855 | +              <Space> | 
|  |  | 856 | +                <Button onClick={() => onCancel()}>{'取消'}</Button> | 
|  |  | 857 | +                <Button type="primary" onClick={() => submit()}> | 
|  |  | 858 | +                  {'确定'} | 
|  |  | 859 | +                </Button> | 
|  |  | 860 | +              </Space> | 
|  |  | 861 | +            </Col> | 
|  |  | 862 | +          </> | 
|  |  | 863 | +        ) : ( | 
|  |  | 864 | +          <Table | 
|  |  | 865 | +            expandable={{ | 
|  |  | 866 | +              defaultExpandAllRows: true, | 
|  |  | 867 | +              childrenColumnName: 'child', | 
|  |  | 868 | +              expandIcon: ({ expanded, onExpand, record }) => | 
|  |  | 869 | +                record.child && record.child.length > 0 && expanded ? ( | 
|  |  | 870 | +                  <> | 
|  |  | 871 | +                    <Icon component={SubDropIcon} className="drop-icon" /> | 
|  |  | 872 | +                    <QxBaseIcon | 
|  |  | 873 | +                      className={'table-expanded'} | 
|  |  | 874 | +                      type={'qx-caret-down'} | 
|  |  | 875 | +                      onClick={(e) => onExpand(record, e)} | 
|  |  | 876 | +                    /> | 
|  |  | 877 | +                  </> | 
|  |  | 878 | +                ) : record.child && record.child.length > 0 && !expanded ? ( | 
|  |  | 879 | +                  <> | 
|  |  | 880 | +                    <Icon component={SubDropIcon} className="drop-icon" /> | 
|  |  | 881 | +                    <QxBaseIcon | 
|  |  | 882 | +                      className={'table-expanded-change'} | 
|  |  | 883 | +                      type={'qx-caret-down'} | 
|  |  | 884 | +                      onClick={(e) => onExpand(record, e)} | 
|  |  | 885 | +                    /> | 
|  |  | 886 | +                  </> | 
|  |  | 887 | +                ) : ( | 
|  |  | 888 | +                  <Icon component={SubDropIcon} className="drop-icon" /> | 
|  |  | 889 | +                ), | 
|  |  | 890 | +            }} | 
|  |  | 891 | +            className="parameter-setting-table" | 
|  |  | 892 | +            onRow={onRow} | 
|  |  | 893 | +            scroll={{ x: 1000, y: 432 }} | 
|  |  | 894 | +            bordered | 
|  |  | 895 | +            pagination={false} | 
|  |  | 896 | +            size={'small'} | 
|  |  | 897 | +            // @ts-ignore | 
|  |  | 898 | +            columns={columns} | 
|  |  | 899 | +            dataSource={data} | 
|  |  | 900 | +            rowKey={'id'} | 
|  |  | 901 | +          /> | 
|  |  | 902 | +        )} | 
| 912 | </Modal> | 903 | </Modal> | 
| 913 | </> | 904 | </> | 
| 914 | ); | 905 | ); |