Showing
4 changed files
with
201 additions
and
58 deletions
| @@ -99,6 +99,49 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | @@ -99,6 +99,49 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | ||
| 99 | const [searchValue, setSearchValue] = useState(''); | 99 | const [searchValue, setSearchValue] = useState(''); |
| 100 | const [mExpandedKeys, setMExpandedKeys] = useState(expandedKeys); | 100 | const [mExpandedKeys, setMExpandedKeys] = useState(expandedKeys); |
| 101 | const [isExpand, setIsExpand] = useState(true); | 101 | const [isExpand, setIsExpand] = useState(true); |
| 102 | + const fixedElement = document.getElementById('fixed-element'); | ||
| 103 | + const fixedElement1 = document.querySelector('.ant-table-header'); | ||
| 104 | + // 获取元素距离顶部的距离 | ||
| 105 | + const fixedElementTop = | ||
| 106 | + fixedElement1?.offsetTop < 100 | ||
| 107 | + ? 205 | ||
| 108 | + : fixedElement1?.offsetTop > 205 | ||
| 109 | + ? 205 | ||
| 110 | + : fixedElement1?.offsetTop; | ||
| 111 | + // 获取元素的高度 | ||
| 112 | + if (document.querySelector('.ant-modal-body')) { | ||
| 113 | + document.querySelector('.ant-modal-body').addEventListener('scroll', () => { | ||
| 114 | + // console.log('scrollTop', document.querySelector('.ant-modal-body').scrollTop) | ||
| 115 | + | ||
| 116 | + // 当页面滚动到固定位置时,将元素固定在指定位置 | ||
| 117 | + if (document.querySelector('.ant-modal-body').scrollTop > 0) { | ||
| 118 | + if (!document.getElementById('mask')) { | ||
| 119 | + const placeholder = document.createElement('div'); | ||
| 120 | + placeholder.id = 'mask'; | ||
| 121 | + placeholder.style.height = '90px'; | ||
| 122 | + fixedElement.parentNode.insertBefore( | ||
| 123 | + placeholder, | ||
| 124 | + fixedElement.nextSibling, | ||
| 125 | + ); | ||
| 126 | + } | ||
| 127 | + fixedElement.style.position = 'fixed'; | ||
| 128 | + fixedElement1.style.position = 'fixed'; | ||
| 129 | + fixedElement1.style.width = '1148px'; | ||
| 130 | + fixedElement1.style.zIndex = 19; | ||
| 131 | + fixedElement1.style.top = `${fixedElementTop}px`; | ||
| 132 | + } else { | ||
| 133 | + if (!!document.getElementById('mask')) { | ||
| 134 | + const mask = document.getElementById('mask'); | ||
| 135 | + mask.parentNode.removeChild(mask); | ||
| 136 | + } | ||
| 137 | + // 恢复元素的默认位置 | ||
| 138 | + fixedElement.style.position = 'relative'; | ||
| 139 | + fixedElement.style.top = 'auto'; | ||
| 140 | + fixedElement1.style.position = 'relative'; | ||
| 141 | + fixedElement1.style.top = 'auto'; | ||
| 142 | + } | ||
| 143 | + }); | ||
| 144 | + } | ||
| 102 | 145 | ||
| 103 | // const [form] = Form.useForm() | 146 | // const [form] = Form.useForm() |
| 104 | //判断数组是否只有一个子节点 | 147 | //判断数组是否只有一个子节点 |
| @@ -156,28 +199,31 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | @@ -156,28 +199,31 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | ||
| 156 | ), | 199 | ), |
| 157 | dataIndex: 'code', | 200 | dataIndex: 'code', |
| 158 | className: 'ps-table-cell-header', | 201 | className: 'ps-table-cell-header', |
| 159 | - width: '190px', | 202 | + width: '220px', |
| 203 | + fixed: 'left', | ||
| 160 | key: 'code', | 204 | key: 'code', |
| 161 | render: (text, record) => { | 205 | render: (text, record) => { |
| 162 | const strTitle = (text as string) || ''; | 206 | const strTitle = (text as string) || ''; |
| 163 | const index = strTitle.indexOf(searchValue); | 207 | const index = strTitle.indexOf(searchValue); |
| 164 | return ( | 208 | return ( |
| 165 | - <Input | ||
| 166 | - style={{ | ||
| 167 | - color: index > -1 && searchValue ? '#1890ff' : '', | ||
| 168 | - maxWidth: '110px', | ||
| 169 | - minWidth: '50px', | ||
| 170 | - }} | ||
| 171 | - draggable={true} | ||
| 172 | - onDragStart={(event) => { | ||
| 173 | - event.stopPropagation(); | ||
| 174 | - event.preventDefault(); | ||
| 175 | - }} | ||
| 176 | - defaultValue={record.code} | ||
| 177 | - bordered={false} | ||
| 178 | - disabled={record.disabled || typeDis} | ||
| 179 | - onBlur={(e) => handleChange(e, record, 'code')} | ||
| 180 | - /> | 209 | + <> |
| 210 | + <Input | ||
| 211 | + style={{ | ||
| 212 | + color: index > -1 && searchValue ? '#1890ff' : '', | ||
| 213 | + maxWidth: '110px', | ||
| 214 | + minWidth: '50px', | ||
| 215 | + }} | ||
| 216 | + draggable={true} | ||
| 217 | + onDragStart={(event) => { | ||
| 218 | + event.stopPropagation(); | ||
| 219 | + event.preventDefault(); | ||
| 220 | + }} | ||
| 221 | + defaultValue={record.code} | ||
| 222 | + bordered={false} | ||
| 223 | + disabled={record.disabled || typeDis} | ||
| 224 | + onBlur={(e) => handleChange(e, record, 'code')} | ||
| 225 | + /> | ||
| 226 | + </> | ||
| 181 | ); | 227 | ); |
| 182 | }, | 228 | }, |
| 183 | }, | 229 | }, |
| @@ -190,6 +236,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | @@ -190,6 +236,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | ||
| 190 | ), | 236 | ), |
| 191 | dataIndex: 'title', | 237 | dataIndex: 'title', |
| 192 | width: '120px', | 238 | width: '120px', |
| 239 | + fixed: 'left', | ||
| 193 | className: 'ps-table-cell', | 240 | className: 'ps-table-cell', |
| 194 | key: 'title', | 241 | key: 'title', |
| 195 | render: (text, record) => { | 242 | render: (text, record) => { |
| @@ -224,6 +271,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | @@ -224,6 +271,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | ||
| 224 | key: 'type', | 271 | key: 'type', |
| 225 | render: (text, record) => ( | 272 | render: (text, record) => ( |
| 226 | <Select | 273 | <Select |
| 274 | + style={{ width: '100%' }} | ||
| 227 | bordered={false} | 275 | bordered={false} |
| 228 | disabled={record.disabled || typeDis} | 276 | disabled={record.disabled || typeDis} |
| 229 | defaultValue={record.type} | 277 | defaultValue={record.type} |
| @@ -313,7 +361,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | @@ -313,7 +361,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | ||
| 313 | dataIndex: 'description', | 361 | dataIndex: 'description', |
| 314 | className: 'ps-table-cell', | 362 | className: 'ps-table-cell', |
| 315 | key: 'description', | 363 | key: 'description', |
| 316 | - width: '120px', | 364 | + width: '122px', |
| 317 | render: (text, record) => ( | 365 | render: (text, record) => ( |
| 318 | <Input | 366 | <Input |
| 319 | draggable={true} | 367 | draggable={true} |
| @@ -338,6 +386,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | @@ -338,6 +386,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | ||
| 338 | key: 'action', | 386 | key: 'action', |
| 339 | className: 'ps-table-cell', | 387 | className: 'ps-table-cell', |
| 340 | width: '110px', | 388 | width: '110px', |
| 389 | + fixed: 'right', | ||
| 341 | render: (text, record) => { | 390 | render: (text, record) => { |
| 342 | const isShowAdd = record && checkShowAdd(record); | 391 | const isShowAdd = record && checkShowAdd(record); |
| 343 | const isShowTree = record && checkShowTree(record); | 392 | const isShowTree = record && checkShowTree(record); |
| @@ -594,8 +643,10 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | @@ -594,8 +643,10 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | ||
| 594 | width: '86px', | 643 | width: '86px', |
| 595 | render: (text, record) => ( | 644 | render: (text, record) => ( |
| 596 | <Select | 645 | <Select |
| 646 | + style={{ width: '100%' }} | ||
| 597 | defaultValue={text || false} | 647 | defaultValue={text || false} |
| 598 | bordered={false} | 648 | bordered={false} |
| 649 | + popupMatchSelectWidth | ||
| 599 | disabled={record.disabled || typeDis} | 650 | disabled={record.disabled || typeDis} |
| 600 | onSelect={(e) => props.handleChange(e, record, 'required')} | 651 | onSelect={(e) => props.handleChange(e, record, 'required')} |
| 601 | > | 652 | > |
| @@ -615,6 +666,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | @@ -615,6 +666,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | ||
| 615 | 666 | ||
| 616 | useEffect(() => { | 667 | useEffect(() => { |
| 617 | if (visible) { | 668 | if (visible) { |
| 669 | + handleDrop(treeData); | ||
| 618 | if (data.length == 0) { | 670 | if (data.length == 0) { |
| 619 | handleAdd(''); | 671 | handleAdd(''); |
| 620 | } | 672 | } |
| @@ -623,11 +675,6 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | @@ -623,11 +675,6 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | ||
| 623 | 675 | ||
| 624 | useEffect(() => { | 676 | useEffect(() => { |
| 625 | setMExpandedKeys(expandedKeys); | 677 | setMExpandedKeys(expandedKeys); |
| 626 | - // if (visible) { | ||
| 627 | - // if (data.length == 0) { | ||
| 628 | - // handleAdd(''); | ||
| 629 | - // } | ||
| 630 | - // } | ||
| 631 | }, [expandedKeys]); | 678 | }, [expandedKeys]); |
| 632 | 679 | ||
| 633 | useEffect(() => { | 680 | useEffect(() => { |
| @@ -865,7 +912,15 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | @@ -865,7 +912,15 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | ||
| 865 | </Col> | 912 | </Col> |
| 866 | </Row> | 913 | </Row> |
| 867 | ) : ( | 914 | ) : ( |
| 868 | - <Row> | 915 | + <Row |
| 916 | + id="fixed-element" | ||
| 917 | + style={{ | ||
| 918 | + zIndex: 18, | ||
| 919 | + backgroundColor: '#fff', | ||
| 920 | + height: '50px', | ||
| 921 | + width: '1148px', | ||
| 922 | + }} | ||
| 923 | + > | ||
| 869 | <Col span={12}> | 924 | <Col span={12}> |
| 870 | <Button | 925 | <Button |
| 871 | size={'small'} | 926 | size={'small'} |
| @@ -953,14 +1008,21 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | @@ -953,14 +1008,21 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { | ||
| 953 | /> | 1008 | /> |
| 954 | </> | 1009 | </> |
| 955 | ) : record.disabled ? ( | 1010 | ) : record.disabled ? ( |
| 956 | - <></> | 1011 | + <span |
| 1012 | + style={{ width: '14px', display: 'inline-flex' }} | ||
| 1013 | + ></span> | ||
| 957 | ) : ( | 1014 | ) : ( |
| 958 | - <Icon component={SubDropIcon} className="drop-icon" /> | 1015 | + <> |
| 1016 | + <Icon component={SubDropIcon} className="drop-icon" /> | ||
| 1017 | + <span | ||
| 1018 | + style={{ width: '14px', display: 'inline-flex' }} | ||
| 1019 | + ></span> | ||
| 1020 | + </> | ||
| 959 | ), | 1021 | ), |
| 960 | }} | 1022 | }} |
| 961 | className="parameter-setting-table" | 1023 | className="parameter-setting-table" |
| 962 | onRow={onRow} | 1024 | onRow={onRow} |
| 963 | - scroll={{ y: 350 }} | 1025 | + scroll={{ y: 850 }} |
| 964 | bordered | 1026 | bordered |
| 965 | pagination={false} | 1027 | pagination={false} |
| 966 | size={'small'} | 1028 | size={'small'} |
| @@ -15,7 +15,6 @@ Demo: | @@ -15,7 +15,6 @@ Demo: | ||
| 15 | import { QxParameterSetting, request } from '@qx/common'; | 15 | import { QxParameterSetting, request } from '@qx/common'; |
| 16 | import { Input } from 'antd'; | 16 | import { Input } from 'antd'; |
| 17 | import React, { useState } from 'react'; | 17 | import React, { useState } from 'react'; |
| 18 | -import { node, nodes } from './mock-node'; | ||
| 19 | export default () => { | 18 | export default () => { |
| 20 | const [value, setValue] = useState([ | 19 | const [value, setValue] = useState([ |
| 21 | { | 20 | { |
| @@ -185,11 +184,11 @@ export default () => { | @@ -185,11 +184,11 @@ export default () => { | ||
| 185 | // nodeItem={nodeItem} | 184 | // nodeItem={nodeItem} |
| 186 | // componentItem={componentItem} | 185 | // componentItem={componentItem} |
| 187 | onChange={handleChange} | 186 | onChange={handleChange} |
| 188 | - isHideSearch={isHide} | 187 | + // isHideSearch={isHide} |
| 189 | isShowField={true} | 188 | isShowField={true} |
| 190 | // node={node} | 189 | // node={node} |
| 191 | // nodes={nodes} | 190 | // nodes={nodes} |
| 192 | - title={titleDom} | 191 | + // title={titleDom} |
| 193 | // type={'preview'} | 192 | // type={'preview'} |
| 194 | // component={QxTagsInput} | 193 | // component={QxTagsInput} |
| 195 | request={request} | 194 | request={request} |
| @@ -29,8 +29,8 @@ import { uidGen } from './stringUtil'; | @@ -29,8 +29,8 @@ import { uidGen } from './stringUtil'; | ||
| 29 | 29 | ||
| 30 | import './style.less'; | 30 | import './style.less'; |
| 31 | 31 | ||
| 32 | -import { SubDropIcon, SubNodeIcon } from './sub-node-icon'; | ||
| 33 | import { formatEnum } from '../constant'; | 32 | import { formatEnum } from '../constant'; |
| 33 | +import { SubDropIcon, SubNodeIcon } from './sub-node-icon'; | ||
| 34 | const valueOptions = [ | 34 | const valueOptions = [ |
| 35 | { key: 'STRING', label: '文本' }, | 35 | { key: 'STRING', label: '文本' }, |
| 36 | { key: 'NUMBER', label: '数字' }, | 36 | { key: 'NUMBER', label: '数字' }, |
| @@ -214,7 +214,6 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | @@ -214,7 +214,6 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | ||
| 214 | 214 | ||
| 215 | // @ts-ignore | 215 | // @ts-ignore |
| 216 | const handleChange = (e?: any, data?: any, code?: string) => { | 216 | const handleChange = (e?: any, data?: any, code?: string) => { |
| 217 | - console.log('handleChange'); | ||
| 218 | let value, | 217 | let value, |
| 219 | oldValue, | 218 | oldValue, |
| 220 | _qxProps = {}; | 219 | _qxProps = {}; |
| @@ -239,7 +238,6 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | @@ -239,7 +238,6 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | ||
| 239 | } else { | 238 | } else { |
| 240 | value = null; | 239 | value = null; |
| 241 | } | 240 | } |
| 242 | - console.log('value', value); | ||
| 243 | } | 241 | } |
| 244 | if (code == 'type') { | 242 | if (code == 'type') { |
| 245 | if (data.child && data.child.length > 0) { | 243 | if (data.child && data.child.length > 0) { |
| @@ -255,7 +253,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | @@ -255,7 +253,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | ||
| 255 | data.code = value; | 253 | data.code = value; |
| 256 | const codeValid = validateCode(data); | 254 | const codeValid = validateCode(data); |
| 257 | if (!codeValid) { | 255 | if (!codeValid) { |
| 258 | - message.error('变量名不可重复'); | 256 | + message.error('参数编码不可重复'); |
| 259 | return; | 257 | return; |
| 260 | } | 258 | } |
| 261 | } | 259 | } |
| @@ -538,6 +536,8 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | @@ -538,6 +536,8 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | ||
| 538 | const onAddTree = (key: string) => { | 536 | const onAddTree = (key: string) => { |
| 539 | const id = uidGen(); | 537 | const id = uidGen(); |
| 540 | const code = uidGen(undefined, 6); | 538 | const code = uidGen(undefined, 6); |
| 539 | + let level = []; | ||
| 540 | + const treeList = generateList(treeData); | ||
| 541 | 541 | ||
| 542 | function addNode(pid: string, data: any) { | 542 | function addNode(pid: string, data: any) { |
| 543 | data.forEach((item) => { | 543 | data.forEach((item) => { |
| @@ -555,8 +555,27 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | @@ -555,8 +555,27 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | ||
| 555 | }); | 555 | }); |
| 556 | return data; | 556 | return data; |
| 557 | } | 557 | } |
| 558 | + | ||
| 559 | + const loop = (pid: string) => { | ||
| 560 | + if (!!pid) { | ||
| 561 | + const index = treeList.findIndex((o: any) => o.id === pid); | ||
| 562 | + level.push(treeList[index]); | ||
| 563 | + loop(treeList[index].pid || ''); | ||
| 564 | + } else { | ||
| 565 | + return level; | ||
| 566 | + } | ||
| 567 | + }; | ||
| 568 | + | ||
| 569 | + loop(key); | ||
| 558 | const _treeData = JSON.parse(JSON.stringify(treeData)); | 570 | const _treeData = JSON.parse(JSON.stringify(treeData)); |
| 559 | - const _treeDataNew = addNode(key, _treeData); | 571 | + let _treeDataNew = _treeData; |
| 572 | + // console.log('level', level) | ||
| 573 | + if (!!level && level.length < 6) { | ||
| 574 | + _treeDataNew = addNode(key, _treeData); | ||
| 575 | + } else if (!!level && level.length > 5) { | ||
| 576 | + message.error('子级最多只能有5层'); | ||
| 577 | + return; | ||
| 578 | + } | ||
| 560 | setInputKey(inputKey + 1); | 579 | setInputKey(inputKey + 1); |
| 561 | setTreeData(_treeDataNew); | 580 | setTreeData(_treeDataNew); |
| 562 | props?.onChange(_treeDataNew); | 581 | props?.onChange(_treeDataNew); |
| @@ -610,7 +629,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | @@ -610,7 +629,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | ||
| 610 | if (!val || isEmpty(val)) { | 629 | if (!val || isEmpty(val)) { |
| 611 | return; | 630 | return; |
| 612 | } | 631 | } |
| 613 | - console.log('changeField', val); | 632 | + // console.log('changeField', val); |
| 614 | const _newData = cloneDeep(treeData); | 633 | const _newData = cloneDeep(treeData); |
| 615 | const loopChangeTree = (treeList: ParamDesignModel[]) => { | 634 | const loopChangeTree = (treeList: ParamDesignModel[]) => { |
| 616 | let newMappingValues = [], | 635 | let newMappingValues = [], |
| @@ -656,9 +675,9 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | @@ -656,9 +675,9 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | ||
| 656 | 675 | ||
| 657 | // const test = document.getElementByClassName('ant-tree-node-content-wrapper') | 676 | // const test = document.getElementByClassName('ant-tree-node-content-wrapper') |
| 658 | // console.log('test', test) | 677 | // console.log('test', test) |
| 659 | - const treeLevel2 = !!nodeData.pid ? level.length : 0; | ||
| 660 | - const treeLevel = nodeData.child && nodeData.child.length > 0 ? 1 : 0; | ||
| 661 | - const leftD = 22 + treeLevel * 22 + treeLevel2 * 24; | 678 | + const treeLevel2 = !!nodeData.pid ? level.length : 0; //判断是多少层的子级 |
| 679 | + const treeLevel = nodeData.child && nodeData.child.length > 0 ? 1 : 0; //判断是否有子级(是否有箭头) | ||
| 680 | + const leftD = 22 + treeLevel * 22 + treeLevel2 * 20; | ||
| 662 | const strTitle = (nodeData.title as string) || ''; | 681 | const strTitle = (nodeData.title as string) || ''; |
| 663 | const index = strTitle.indexOf(searchValue); | 682 | const index = strTitle.indexOf(searchValue); |
| 664 | const isShowTree = checkShowTree(nodeData); | 683 | const isShowTree = checkShowTree(nodeData); |
| @@ -709,7 +728,9 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | @@ -709,7 +728,9 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | ||
| 709 | onClick={() => onAddTree(nodeData.id)} | 728 | onClick={() => onAddTree(nodeData.id)} |
| 710 | /> | 729 | /> |
| 711 | ) : ( | 730 | ) : ( |
| 712 | - <div style={{ opacity: 0, height: 16, width: 16 }} /> | 731 | + <div |
| 732 | + style={{ opacity: 0, height: 16, width: 22, marginLeft: 8 }} | ||
| 733 | + /> | ||
| 713 | )} | 734 | )} |
| 714 | <Button | 735 | <Button |
| 715 | className="title-btn-del" | 736 | className="title-btn-del" |
| @@ -823,7 +844,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | @@ -823,7 +844,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | ||
| 823 | style={{ fontSize: '16px' }} | 844 | style={{ fontSize: '16px' }} |
| 824 | type={'qx-icon-plus'} | 845 | type={'qx-icon-plus'} |
| 825 | /> | 846 | /> |
| 826 | - 添加参数 | 847 | + <span style={{ marginInlineStart: '4px' }}>添加参数</span> |
| 827 | </Button> | 848 | </Button> |
| 828 | </Dropdown> | 849 | </Dropdown> |
| 829 | )} | 850 | )} |
| @@ -841,7 +862,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | @@ -841,7 +862,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { | ||
| 841 | style={{ fontSize: '16px' }} | 862 | style={{ fontSize: '16px' }} |
| 842 | type={'icon-app-terminal-box-line'} | 863 | type={'icon-app-terminal-box-line'} |
| 843 | /> | 864 | /> |
| 844 | - 高级设置 | 865 | + <span style={{ marginInlineStart: '4px' }}>高级设置</span> |
| 845 | </Button> | 866 | </Button> |
| 846 | </div> | 867 | </div> |
| 847 | {!props.isHideSearch && ( | 868 | {!props.isHideSearch && ( |
| @@ -36,7 +36,7 @@ | @@ -36,7 +36,7 @@ | ||
| 36 | width: 0; | 36 | width: 0; |
| 37 | margin-top: 11.5px; | 37 | margin-top: 11.5px; |
| 38 | display: flex; | 38 | display: flex; |
| 39 | - // justify-content: flex-end; | 39 | + justify-content: center; |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | .ant-tree-switcher_open, | 42 | .ant-tree-switcher_open, |
| @@ -45,7 +45,6 @@ | @@ -45,7 +45,6 @@ | ||
| 45 | margin-right: 10px; | 45 | margin-right: 10px; |
| 46 | margin-left: 10px; | 46 | margin-left: 10px; |
| 47 | display: flex; | 47 | display: flex; |
| 48 | - justify-content: flex-end; | ||
| 49 | } | 48 | } |
| 50 | 49 | ||
| 51 | .drop-icon { | 50 | .drop-icon { |
| @@ -229,6 +228,8 @@ | @@ -229,6 +228,8 @@ | ||
| 229 | margin: 0; | 228 | margin: 0; |
| 230 | 229 | ||
| 231 | .qx-field-setter { | 230 | .qx-field-setter { |
| 231 | + border-color: #d9d9d9; | ||
| 232 | + | ||
| 232 | .qx-tags-input { | 233 | .qx-tags-input { |
| 233 | background-color: #fff; | 234 | background-color: #fff; |
| 234 | } | 235 | } |
| @@ -253,9 +254,16 @@ | @@ -253,9 +254,16 @@ | ||
| 253 | flex-direction: row; | 254 | flex-direction: row; |
| 254 | justify-content: flex-start; | 255 | justify-content: flex-start; |
| 255 | flex-wrap: nowrap; | 256 | flex-wrap: nowrap; |
| 257 | + height: 30px; | ||
| 256 | 258 | ||
| 257 | .ant-btn-default { | 259 | .ant-btn-default { |
| 258 | border: 0; | 260 | border: 0; |
| 261 | + background-color: transparent; | ||
| 262 | + box-shadow: 0 0 0 0; | ||
| 263 | + } | ||
| 264 | + | ||
| 265 | + .ant-input-number-handler-wrap { | ||
| 266 | + background: transparent; | ||
| 259 | } | 267 | } |
| 260 | 268 | ||
| 261 | .range-cell { | 269 | .range-cell { |
| @@ -264,6 +272,12 @@ | @@ -264,6 +272,12 @@ | ||
| 264 | flex-wrap: nowrap; | 272 | flex-wrap: nowrap; |
| 265 | flex-direction: row; | 273 | flex-direction: row; |
| 266 | align-items: center; | 274 | align-items: center; |
| 275 | + | ||
| 276 | + .ant-input-number { | ||
| 277 | + align-items: center; | ||
| 278 | + height: 100%; | ||
| 279 | + display: flex; | ||
| 280 | + } | ||
| 267 | } | 281 | } |
| 268 | 282 | ||
| 269 | .ant-input-affix-wrapper, | 283 | .ant-input-affix-wrapper, |
| @@ -278,6 +292,7 @@ | @@ -278,6 +292,7 @@ | ||
| 278 | 292 | ||
| 279 | .editable-cell-default { | 293 | .editable-cell-default { |
| 280 | overflow: auto; | 294 | overflow: auto; |
| 295 | + height: 30px; | ||
| 281 | // overflow-x:hidden; | 296 | // overflow-x:hidden; |
| 282 | 297 | ||
| 283 | // ::-webkit-scrollbar{ | 298 | // ::-webkit-scrollbar{ |
| @@ -409,24 +424,40 @@ | @@ -409,24 +424,40 @@ | ||
| 409 | .ant-table-body { | 424 | .ant-table-body { |
| 410 | .ps-table-cell { | 425 | .ps-table-cell { |
| 411 | transition: all 0s ease !important; | 426 | transition: all 0s ease !important; |
| 427 | + padding: 4px 6px 4px 5px !important; | ||
| 412 | 428 | ||
| 413 | .ant-select-selection-overflow { | 429 | .ant-select-selection-overflow { |
| 414 | flex-wrap: nowrap; | 430 | flex-wrap: nowrap; |
| 415 | } | 431 | } |
| 416 | 432 | ||
| 433 | + .ant-select-selector { | ||
| 434 | + background-color: transparent !important; | ||
| 435 | + height: 30px; | ||
| 436 | + } | ||
| 437 | + | ||
| 438 | + .qx-field-setter--disabled { | ||
| 439 | + background-color: transparent !important; | ||
| 440 | + } | ||
| 441 | + | ||
| 417 | &:hover { | 442 | &:hover { |
| 418 | - border: 1px solid @N6 !important; | ||
| 419 | - box-shadow: 0 0 4px 0 @N6 !important; | 443 | + outline: 1px solid @N6; |
| 444 | + outline-offset: -1px; | ||
| 420 | } | 445 | } |
| 421 | 446 | ||
| 422 | &-header { | 447 | &-header { |
| 423 | transition: all 0s ease !important; | 448 | transition: all 0s ease !important; |
| 424 | - display: flex; | 449 | + // display: flex; |
| 425 | height: 41px !important; | 450 | height: 41px !important; |
| 451 | + padding: 4px 6px 4px 14px !important; | ||
| 426 | 452 | ||
| 427 | &:hover { | 453 | &:hover { |
| 428 | - border: 1px solid @N6 !important; | ||
| 429 | - box-shadow: 0 0 4px 0 @N6 !important; | 454 | + outline: 1px solid @N6; |
| 455 | + outline-offset: -1px; | ||
| 456 | + // outline-style: solid; | ||
| 457 | + // outline-color: @N6; | ||
| 458 | + // outline-width: thin; | ||
| 459 | + // border: 1px solid @N6 !important; | ||
| 460 | + // box-shadow: 0 0 4px 0 @N6 !important; | ||
| 430 | // border-radius: 2px; | 461 | // border-radius: 2px; |
| 431 | .drop-icon { | 462 | .drop-icon { |
| 432 | position: absolute; | 463 | position: absolute; |
| @@ -436,18 +467,25 @@ | @@ -436,18 +467,25 @@ | ||
| 436 | display: block; | 467 | display: block; |
| 437 | } | 468 | } |
| 438 | } | 469 | } |
| 470 | + | ||
| 471 | + &:focus-within { | ||
| 472 | + z-index: 99999; | ||
| 473 | + // border: 1px solid @B8 !important; | ||
| 474 | + outline: 1px solid @B8; | ||
| 475 | + outline-offset: -1px; | ||
| 476 | + box-shadow: 0 0 4px 0 @B8 !important; | ||
| 477 | + // border-radius: 2px; | ||
| 478 | + } | ||
| 439 | } | 479 | } |
| 440 | 480 | ||
| 441 | &:focus-within { | 481 | &:focus-within { |
| 442 | - border: 1px solid @B8 !important; | 482 | + z-index: 10; |
| 483 | + // border: 1px solid @B8 !important; | ||
| 484 | + outline: 1px solid @B8; | ||
| 485 | + outline-offset: -1px; | ||
| 443 | box-shadow: 0 0 4px 0 @B8 !important; | 486 | box-shadow: 0 0 4px 0 @B8 !important; |
| 444 | // border-radius: 2px; | 487 | // border-radius: 2px; |
| 445 | } | 488 | } |
| 446 | - | ||
| 447 | - // display: flex; | ||
| 448 | - // .title-btn{ | ||
| 449 | - // color: @B8; | ||
| 450 | - // } | ||
| 451 | } | 489 | } |
| 452 | } | 490 | } |
| 453 | 491 | ||
| @@ -468,6 +506,14 @@ | @@ -468,6 +506,14 @@ | ||
| 468 | display: block; | 506 | display: block; |
| 469 | } | 507 | } |
| 470 | 508 | ||
| 509 | + .ant-tree-indent-unit { | ||
| 510 | + width: 20px; | ||
| 511 | + } | ||
| 512 | + | ||
| 513 | + .ant-tree-switcher-icon { | ||
| 514 | + margin-right: 3px; | ||
| 515 | + } | ||
| 516 | + | ||
| 471 | &:hover { | 517 | &:hover { |
| 472 | background-color: @N3 !important; | 518 | background-color: @N3 !important; |
| 473 | 519 | ||
| @@ -479,11 +525,16 @@ | @@ -479,11 +525,16 @@ | ||
| 479 | // display: block; | 525 | // display: block; |
| 480 | } | 526 | } |
| 481 | 527 | ||
| 528 | + .ant-tree-switcher-icon { | ||
| 529 | + margin-right: 0; | ||
| 530 | + } | ||
| 531 | + | ||
| 482 | .ant-tree-switcher { | 532 | .ant-tree-switcher { |
| 483 | transition: all 0.2s ease; | 533 | transition: all 0.2s ease; |
| 484 | width: 24px !important; | 534 | width: 24px !important; |
| 485 | margin-top: 11.5px; | 535 | margin-top: 11.5px; |
| 486 | display: flex; | 536 | display: flex; |
| 537 | + justify-content: flex-end; | ||
| 487 | } | 538 | } |
| 488 | 539 | ||
| 489 | .title-btn-del, | 540 | .title-btn-del, |
| @@ -498,6 +549,7 @@ | @@ -498,6 +549,7 @@ | ||
| 498 | 549 | ||
| 499 | .ant-tree-node-content-wrapper { | 550 | .ant-tree-node-content-wrapper { |
| 500 | width: 100%; | 551 | width: 100%; |
| 552 | + padding-left: 0; | ||
| 501 | } | 553 | } |
| 502 | } | 554 | } |
| 503 | 555 | ||
| @@ -531,7 +583,7 @@ | @@ -531,7 +583,7 @@ | ||
| 531 | 583 | ||
| 532 | .table-expanded { | 584 | .table-expanded { |
| 533 | color: #7c7e86; | 585 | color: #7c7e86; |
| 534 | - margin-left: 8px; | 586 | + // margin-left: 8px; |
| 535 | transition: transform 0.3s; | 587 | transition: transform 0.3s; |
| 536 | } | 588 | } |
| 537 | 589 | ||
| @@ -545,17 +597,26 @@ | @@ -545,17 +597,26 @@ | ||
| 545 | 597 | ||
| 546 | .parameter-setting-table .ant-table-cell { | 598 | .parameter-setting-table .ant-table-cell { |
| 547 | height: 40px; | 599 | height: 40px; |
| 548 | - padding: 4px 16px 4px 14px !important; | 600 | + padding: 4px 6px 4px 5px; |
| 549 | } | 601 | } |
| 550 | 602 | ||
| 551 | .qx-parameter-setting__modal { | 603 | .qx-parameter-setting__modal { |
| 552 | .ant-modal-content { | 604 | .ant-modal-content { |
| 553 | min-height: 400px; | 605 | min-height: 400px; |
| 554 | max-height: 600px; | 606 | max-height: 600px; |
| 607 | + padding-bottom: 24px; | ||
| 555 | // padding-bottom: 24px !important; | 608 | // padding-bottom: 24px !important; |
| 556 | } | 609 | } |
| 557 | 610 | ||
| 558 | .ant-modal-body { | 611 | .ant-modal-body { |
| 559 | - overflow-y: hidden !important; | 612 | + overflow-y: scroll !important; |
| 613 | + padding: 0 18px 0 24px; | ||
| 560 | } | 614 | } |
| 561 | } | 615 | } |
| 616 | + | ||
| 617 | +.ant-table-body::-webkit-scrollbar { | ||
| 618 | + width: 1px; | ||
| 619 | + // position:absolute; | ||
| 620 | + // right: 20px; | ||
| 621 | + // display: none; | ||
| 622 | +} |