Commit baf50caf2dab3545524df19d4eee1f8ff04e99a6

Authored by 陈洋
1 parent a0bd68bc

pref: 根据antd5 做迭代处理;以及 lodash 全局处理为按需引用

Showing 49 changed files with 248 additions and 283 deletions
@@ -4,7 +4,7 @@ export default defineConfig({ @@ -4,7 +4,7 @@ export default defineConfig({
4 apiParser: {}, 4 apiParser: {},
5 outputPath: 'docs-dist', 5 outputPath: 'docs-dist',
6 themeConfig: { 6 themeConfig: {
7 - name: '@qx/common ', 7 + name: '@qx/common',
8 }, 8 },
9 resolve: { 9 resolve: {
10 // 配置入口文件路径,API 解析将从这里开始 10 // 配置入口文件路径,API 解析将从这里开始
@@ -11,6 +11,7 @@ @@ -11,6 +11,7 @@
11 "dependencies": { 11 "dependencies": {
12 "@ant-design/icons": "^5.2.5", 12 "@ant-design/icons": "^5.2.5",
13 "@qx/ui": "0.0.3-beta.1", 13 "@qx/ui": "0.0.3-beta.1",
  14 + "classnames": "^2.3.2",
14 "codemirror": "5.65.8", 15 "codemirror": "5.65.8",
15 "dayjs": "^1.11.9", 16 "dayjs": "^1.11.9",
16 "lodash-es": "^4.17.21", 17 "lodash-es": "^4.17.21",
@@ -49,7 +49,8 @@ @@ -49,7 +49,8 @@
49 "dayjs": "^1.11.9", 49 "dayjs": "^1.11.9",
50 "lodash-es": "^4.17.21", 50 "lodash-es": "^4.17.21",
51 "rc-virtual-list": "^3.4.13", 51 "rc-virtual-list": "^3.4.13",
52 - "react-codemirror2": "^7.2.1" 52 + "react-codemirror2": "^7.2.1",
  53 + "classnames": "^2.3.2"
53 }, 54 },
54 "devDependencies": { 55 "devDependencies": {
55 "@commitlint/cli": "^17.1.2", 56 "@commitlint/cli": "^17.1.2",
1 export * from './qx-filter-condition'; 1 export * from './qx-filter-condition';
2 export * from './qx-parameter-setting'; 2 export * from './qx-parameter-setting';
3 export * from './qx-sort-condition'; 3 export * from './qx-sort-condition';
  4 +export * from './qx-base-icon';
4 // export * from './qx-btn'; 5 // export * from './qx-btn';
5 // export { default as FieldSetter } from './qx-field-setter'; 6 // export { default as FieldSetter } from './qx-field-setter';
1 -import { DownOutlined, SearchOutlined } from '@ant-design/icons'; 1 +import { DownOutlined } from '@ant-design/icons';
2 import { 2 import {
3 Input, 3 Input,
4 Menu, 4 Menu,
@@ -10,7 +10,7 @@ import { @@ -10,7 +10,7 @@ import {
10 // TreeSelect, 10 // TreeSelect,
11 Typography, 11 Typography,
12 } from 'antd'; 12 } from 'antd';
13 -import _ from 'lodash'; 13 +import { cloneDeep } from 'lodash-es';
14 import React, { useEffect, useMemo, useState } from 'react'; 14 import React, { useEffect, useMemo, useState } from 'react';
15 import { 15 import {
16 getAggreList, 16 getAggreList,
@@ -20,6 +20,7 @@ import { @@ -20,6 +20,7 @@ import {
20 } from './service'; 20 } from './service';
21 // import { FRWidgetProps } from '@/packages/qx-form-generator/src'; 21 // import { FRWidgetProps } from '@/packages/qx-form-generator/src';
22 import type { ModalProps } from 'antd'; 22 import type { ModalProps } from 'antd';
  23 +import {QxBaseIcon} from '@qx/common';
23 24
24 import './styles.less'; 25 import './styles.less';
25 26
@@ -80,6 +81,9 @@ export const QxAppSelector: React.FC<QxAppSelectProps> = ({ @@ -80,6 +81,9 @@ export const QxAppSelector: React.FC<QxAppSelectProps> = ({
80 const _item = props.item || {}; 81 const _item = props.item || {};
81 let targetItem: any = {}; 82 let targetItem: any = {};
82 getAppList(request, { from: props.from }).then((res: any) => { 83 getAppList(request, { from: props.from }).then((res: any) => {
  84 + if (!res?.length) {
  85 + return;
  86 + }
83 // eslint-disable-next-line array-callback-return 87 // eslint-disable-next-line array-callback-return
84 res.map((item: any) => { 88 res.map((item: any) => {
85 if (item.code === _item['currentId']) { 89 if (item.code === _item['currentId']) {
@@ -192,6 +196,9 @@ export const QxAppSelector: React.FC<QxAppSelectProps> = ({ @@ -192,6 +196,9 @@ export const QxAppSelector: React.FC<QxAppSelectProps> = ({
192 } else { 196 } else {
193 if (e.target.value === 'join' && !aggreList.length) { 197 if (e.target.value === 'join' && !aggreList.length) {
194 getAggreList(request).then((res: any) => { 198 getAggreList(request).then((res: any) => {
  199 + if (!res?.length) {
  200 + return;
  201 + }
195 // eslint-disable-next-line array-callback-return 202 // eslint-disable-next-line array-callback-return
196 res.map((item: any) => { 203 res.map((item: any) => {
197 item.label = item.name; 204 item.label = item.name;
@@ -240,7 +247,7 @@ export const QxAppSelector: React.FC<QxAppSelectProps> = ({ @@ -240,7 +247,7 @@ export const QxAppSelector: React.FC<QxAppSelectProps> = ({
240 247
241 const filter = (word: string) => { 248 const filter = (word: string) => {
242 if (list) { 249 if (list) {
243 - const _data = _.cloneDeep(list); 250 + const _data = cloneDeep(list);
244 _data.forEach((it: Item) => { 251 _data.forEach((it: Item) => {
245 it.deleted = !(it.name.indexOf(word) > -1); 252 it.deleted = !(it.name.indexOf(word) > -1);
246 }); 253 });
@@ -264,7 +271,7 @@ export const QxAppSelector: React.FC<QxAppSelectProps> = ({ @@ -264,7 +271,7 @@ export const QxAppSelector: React.FC<QxAppSelectProps> = ({
264 className={'qx-selector-sub-search'} 271 className={'qx-selector-sub-search'}
265 placeholder={'输入名称,回车搜索'} 272 placeholder={'输入名称,回车搜索'}
266 allowClear 273 allowClear
267 - prefix={<SearchOutlined />} 274 + prefix={<QxBaseIcon type={'icon-app-search-line'} />}
268 onChange={(e) => { 275 onChange={(e) => {
269 handleChange(e.target.value); 276 handleChange(e.target.value);
270 }} 277 }}
  1 +@import '~@qx/ui/src/style/variable.less';
  2 +
1 .ant-input.select-source { 3 .ant-input.select-source {
2 display: flex; 4 display: flex;
3 flex-direction: row; 5 flex-direction: row;
@@ -13,7 +15,7 @@ @@ -13,7 +15,7 @@
13 15
14 > .anticon { 16 > .anticon {
15 padding: 0 6px; 17 padding: 0 6px;
16 - color: rgba(0, 0, 0, 25%); 18 + color: @N5;
17 font-size: 12px; 19 font-size: 12px;
18 } 20 }
19 } 21 }
  1 +@import '~@qx/ui/src/style/variable.less';
  2 +
1 .qx-formula-cm { 3 .qx-formula-cm {
2 .CodeMirror { 4 .CodeMirror {
3 height: auto; 5 height: auto;
@@ -6,8 +8,8 @@ @@ -6,8 +8,8 @@
6 } 8 }
7 9
8 .cm-bg .CodeMirror { 10 .cm-bg .CodeMirror {
9 - background-color: #f9f9f9 !important;  
10 - border: 1px solid #e7e6e6; 11 + background-color: @N2 !important;
  12 + border: 1px solid @N4;
11 } 13 }
12 14
13 .qx-copy-send-cm { 15 .qx-copy-send-cm {
@@ -22,6 +24,6 @@ @@ -22,6 +24,6 @@
22 position: absolute; 24 position: absolute;
23 right: 8px; 25 right: 8px;
24 bottom: 8px; 26 bottom: 8px;
25 - color: #bcb9b9; 27 + color: @N4;
26 font-size: 14px; 28 font-size: 14px;
27 } 29 }
1 import React, { useEffect, useState } from 'react'; 1 import React, { useEffect, useState } from 'react';
2 import { UnControlled as CodeMirror } from 'react-codemirror2'; 2 import { UnControlled as CodeMirror } from 'react-codemirror2';
3 -import _ from 'lodash'; 3 +import { cloneDeep, flatten, sortBy, size, isEqual, forEach, debounce } from 'lodash-es';
4 import type { VariableMappingProps } from '../qx-field-setter'; 4 import type { VariableMappingProps } from '../qx-field-setter';
5 import funObjects from './functions'; 5 import funObjects from './functions';
6 import 'codemirror/lib/codemirror.css'; 6 import 'codemirror/lib/codemirror.css';
@@ -36,7 +36,7 @@ export type VariableProps = { @@ -36,7 +36,7 @@ export type VariableProps = {
36 * @param code 36 * @param code
37 */ 37 */
38 export const getAllVariable = (code: string) => { 38 export const getAllVariable = (code: string) => {
39 - let codeLocal: string = _.clone(code); 39 + let codeLocal: string = cloneDeep(code);
40 if (!codeLocal) { 40 if (!codeLocal) {
41 return []; 41 return [];
42 } 42 }
@@ -126,11 +126,11 @@ const CodeEditor: React.FC<CodeHighLightProps> = ({ @@ -126,11 +126,11 @@ const CodeEditor: React.FC<CodeHighLightProps> = ({
126 const [isInitDone, setIsInitDone] = useState<boolean>(false); 126 const [isInitDone, setIsInitDone] = useState<boolean>(false);
127 const [focusFun, setFocusFun] = useState<string>(); 127 const [focusFun, setFocusFun] = useState<string>();
128 128
129 - const funObjs = _.flatten(funObjects.map((item: any) => item.children)); 129 + const funObjs = flatten(funObjects.map((item: any) => item.children));
130 const funObjSimple = {}; 130 const funObjSimple = {};
131 funObjs.map((item) => Object.assign(funObjSimple, { [item.title]: item.title })); 131 funObjs.map((item) => Object.assign(funObjSimple, { [item.title]: item.title }));
132 // 以变量字符长度排序,确保`DATAIF`比`IF`优先匹配 132 // 以变量字符长度排序,确保`DATAIF`比`IF`优先匹配
133 - const funObjsSort = _.sortBy(funObjs, function (o) { 133 + const funObjsSort = sortBy(funObjs, function (o) {
134 return 0 - o.title.length; 134 return 0 - o.title.length;
135 }); 135 });
136 136
@@ -141,7 +141,7 @@ const CodeEditor: React.FC<CodeHighLightProps> = ({ @@ -141,7 +141,7 @@ const CodeEditor: React.FC<CodeHighLightProps> = ({
141 setValueLocal(value); 141 setValueLocal(value);
142 } 142 }
143 143
144 - if (_.size(variableObj) > 0) { 144 + if (size(variableObj) > 0) {
145 setVariableObjLocal(variableObj); 145 setVariableObjLocal(variableObj);
146 } 146 }
147 } 147 }
@@ -180,7 +180,7 @@ const CodeEditor: React.FC<CodeHighLightProps> = ({ @@ -180,7 +180,7 @@ const CodeEditor: React.FC<CodeHighLightProps> = ({
180 return; 180 return;
181 } 181 }
182 182
183 - const code = _.cloneDeep(editor.getValue()); 183 + const code = cloneDeep(editor.getValue());
184 // 换行分隔 184 // 换行分隔
185 const codeArr = code.split('\n'); 185 const codeArr = code.split('\n');
186 const variReplace = (cm: any, line: number) => { 186 const variReplace = (cm: any, line: number) => {
@@ -276,7 +276,7 @@ const CodeEditor: React.FC<CodeHighLightProps> = ({ @@ -276,7 +276,7 @@ const CodeEditor: React.FC<CodeHighLightProps> = ({
276 cmUtils.variableRender(editor); 276 cmUtils.variableRender(editor);
277 277
278 // TODO 默认值bug修复 暂时注释 278 // TODO 默认值bug修复 暂时注释
279 - // const isSame = _.isEqual(valueLocal, val); 279 + // const isSame = isEqual(valueLocal, val);
280 // if (isSame) { 280 // if (isSame) {
281 // return; 281 // return;
282 // } 282 // }
@@ -310,7 +310,7 @@ const CodeEditor: React.FC<CodeHighLightProps> = ({ @@ -310,7 +310,7 @@ const CodeEditor: React.FC<CodeHighLightProps> = ({
310 let flag: boolean = false; 310 let flag: boolean = false;
311 let funName: string = ''; 311 let funName: string = '';
312 312
313 - _.forEach(funObjsSort, (v) => { 313 + forEach(funObjsSort, (v) => {
314 if (flag) { 314 if (flag) {
315 return; 315 return;
316 } 316 }
@@ -351,7 +351,7 @@ const CodeEditor: React.FC<CodeHighLightProps> = ({ @@ -351,7 +351,7 @@ const CodeEditor: React.FC<CodeHighLightProps> = ({
351 // 滚动(false,默认)或自动换行 351 // 滚动(false,默认)或自动换行
352 lineWrapping: true, 352 lineWrapping: true,
353 }} 353 }}
354 - onChange={_.debounce(onValueChange, 300)} 354 + onChange={debounce(onValueChange, 300)}
355 onCursor={(editor) => { 355 onCursor={(editor) => {
356 const funName = findFocusFun(editor); 356 const funName = findFocusFun(editor);
357 setFocusFun(funName); 357 setFocusFun(funName);
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 cursor: pointer; 31 cursor: pointer;
32 32
33 &:hover { 33 &:hover {
34 - background-color: @item-hover-bg; 34 + background-color: @N3;
35 } 35 }
36 } 36 }
37 } 37 }
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
44 &.ant-menu-inline > .ant-menu-submenu > .ant-menu-submenu-title { 44 &.ant-menu-inline > .ant-menu-submenu > .ant-menu-submenu-title {
45 margin-top: 0; 45 margin-top: 0;
46 margin-bottom: 1px; 46 margin-bottom: 1px;
47 - background-color: #fafafa; 47 + background-color: @N2;
48 } 48 }
49 49
50 .ant-menu-sub.ant-menu-inline { 50 .ant-menu-sub.ant-menu-inline {
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
59 59
60 &:hover { 60 &:hover {
61 color: inherit; 61 color: inherit;
62 - background-color: @item-hover-bg; 62 + background-color: @N3;
63 } 63 }
64 } 64 }
65 65
@@ -74,5 +74,5 @@ @@ -74,5 +74,5 @@
74 padding-top: 5px; 74 padding-top: 5px;
75 padding-bottom: 5px; 75 padding-bottom: 5px;
76 padding-left: 24px; 76 padding-left: 24px;
77 - border-top: 1px solid #f0f0f0; 77 + border-top: 1px solid @N4;
78 } 78 }
@@ -5,7 +5,7 @@ import type { ReactElement } from 'react'; @@ -5,7 +5,7 @@ import type { ReactElement } from 'react';
5 import { useEffect, useState } from 'react'; 5 import { useEffect, useState } from 'react';
6 import QxFieldItem from '../qx-field/src/item'; 6 import QxFieldItem from '../qx-field/src/item';
7 import { useDebounceFn } from 'ahooks'; 7 import { useDebounceFn } from 'ahooks';
8 -import _ from 'lodash'; 8 +import { isEmpty } from 'lodash-es';
9 import { QxBaseIcon } from '../qx-base-icon'; 9 import { QxBaseIcon } from '../qx-base-icon';
10 import './index.less'; 10 import './index.less';
11 11
@@ -100,7 +100,7 @@ export const QxFieldPopover: React.FC<QxFieldPopoverProp> = (props) => { @@ -100,7 +100,7 @@ export const QxFieldPopover: React.FC<QxFieldPopoverProp> = (props) => {
100 }); 100 });
101 }; 101 };
102 useEffect(() => { 102 useEffect(() => {
103 - if (!_.isEmpty(props.data)) { 103 + if (!isEmpty(props.data)) {
104 const _fields = excludeFields(props.data); 104 const _fields = excludeFields(props.data);
105 setFields(_fields); 105 setFields(_fields);
106 setFilterFields(_fields); 106 setFilterFields(_fields);
@@ -316,10 +316,9 @@ export const QxFieldPopover: React.FC<QxFieldPopoverProp> = (props) => { @@ -316,10 +316,9 @@ export const QxFieldPopover: React.FC<QxFieldPopoverProp> = (props) => {
316 // getPopupContainer={(triggerNode) => triggerNode} 316 // getPopupContainer={(triggerNode) => triggerNode}
317 content={fieldsPopContent()} 317 content={fieldsPopContent()}
318 placement={'bottomRight'} 318 placement={'bottomRight'}
319 - // TODO 默认hover改成click 因为个别电脑输入法 输入会触发气泡的失焦事件 弹框消失  
320 - trigger={props.disabled ? '' : props.trigger || 'click'}  
321 - visible={visible}  
322 - onVisibleChange={(v) => { 319 + trigger={props.disabled ? undefined : props.trigger || 'click'}
  320 + open={visible}
  321 + onOpenChange={(v) => {
323 if (!v) { 322 if (!v) {
324 setTimeout(() => { 323 setTimeout(() => {
325 setKeyword(''); 324 setKeyword('');
@@ -194,10 +194,10 @@ export const OrgSetter: React.FC<OrgSetterProps> = ({ @@ -194,10 +194,10 @@ export const OrgSetter: React.FC<OrgSetterProps> = ({
194 overlayClassName={'qx-pop-select'} 194 overlayClassName={'qx-pop-select'}
195 getPopupContainer={(triggerNode) => triggerNode} 195 getPopupContainer={(triggerNode) => triggerNode}
196 arrowContent={false} 196 arrowContent={false}
197 - visible={popVisible}  
198 - onVisibleChange={handlePopVisibleChange} 197 + open={popVisible}
  198 + onOpenChange={handlePopVisibleChange}
199 placement="bottom" 199 placement="bottom"
200 - trigger={disabled ? '' : 'click'} 200 + trigger={disabled ? undefined : 'click'}
201 > 201 >
202 <div 202 <div
203 style={style || {}} 203 style={style || {}}
1 import React, { useEffect, useState, useMemo, useRef } from 'react'; 1 import React, { useEffect, useState, useMemo, useRef } from 'react';
2 import { Input, Cascader } from 'antd'; 2 import { Input, Cascader } from 'antd';
3 import { getDictDetail } from '../service'; 3 import { getDictDetail } from '../service';
4 -import _ from 'lodash'; 4 +import { cloneDeep, isEqual, isEmpty } from 'lodash-es';
5 5
6 export interface FRWidgetProps { 6 export interface FRWidgetProps {
7 title?: string; 7 title?: string;
@@ -96,7 +96,7 @@ const QxAddress: React.FC<FRWidgetProps> = (props) => { @@ -96,7 +96,7 @@ const QxAddress: React.FC<FRWidgetProps> = (props) => {
96 // eslint-disable-next-line @typescript-eslint/no-shadow 96 // eslint-disable-next-line @typescript-eslint/no-shadow
97 const options: any = []; 97 const options: any = [];
98 Object.keys(opArr).forEach((key) => { 98 Object.keys(opArr).forEach((key) => {
99 - let num = _.cloneDeep(level); 99 + let num = cloneDeep(level);
100 const option: any = { 100 const option: any = {
101 value: opArr[key].value, 101 value: opArr[key].value,
102 label: opArr[key].label, 102 label: opArr[key].label,
@@ -142,10 +142,10 @@ const QxAddress: React.FC<FRWidgetProps> = (props) => { @@ -142,10 +142,10 @@ const QxAddress: React.FC<FRWidgetProps> = (props) => {
142 _localCasValue = []; 142 _localCasValue = [];
143 _localTextValue = ''; 143 _localTextValue = '';
144 } 144 }
145 - if (!_.isEqual(_localCasValue, localCasValue)) { 145 + if (!isEqual(_localCasValue, localCasValue)) {
146 setLocalCasValue(_localCasValue); 146 setLocalCasValue(_localCasValue);
147 } 147 }
148 - if (!_.isEqual(_localTextValue, localTextValue)) { 148 + if (!isEqual(_localTextValue, localTextValue)) {
149 setLocalTextValue(_localTextValue); 149 setLocalTextValue(_localTextValue);
150 } 150 }
151 }, [props.value]); 151 }, [props.value]);
@@ -191,10 +191,10 @@ const QxAddress: React.FC<FRWidgetProps> = (props) => { @@ -191,10 +191,10 @@ const QxAddress: React.FC<FRWidgetProps> = (props) => {
191 191
192 const handleChange = (changeObj: any) => { 192 const handleChange = (changeObj: any) => {
193 const newObj = { localCasValue, localTextValue, ...changeObj }; 193 const newObj = { localCasValue, localTextValue, ...changeObj };
194 - if (!_.isEqual(localCasValue, newObj.localCasValue)) { 194 + if (!isEqual(localCasValue, newObj.localCasValue)) {
195 setLocalCasValue(newObj.localCasValue); 195 setLocalCasValue(newObj.localCasValue);
196 } 196 }
197 - if (!_.isEqual(localTextValue, newObj.localTextValue)) { 197 + if (!isEqual(localTextValue, newObj.localTextValue)) {
198 setLocalTextValue(newObj.localTextValue); 198 setLocalTextValue(newObj.localTextValue);
199 } 199 }
200 200
@@ -248,7 +248,7 @@ const QxAddress: React.FC<FRWidgetProps> = (props) => { @@ -248,7 +248,7 @@ const QxAddress: React.FC<FRWidgetProps> = (props) => {
248 /> 248 />
249 {detail ? ( 249 {detail ? (
250 <Input 250 <Input
251 - disabled={props.disabled || _.isEmpty(localCasValue) || isDisabled} 251 + disabled={props.disabled || isEmpty(localCasValue) || isDisabled}
252 // defaultValue={finalProps.textDefaultValue} 252 // defaultValue={finalProps.textDefaultValue}
253 value={localTextValue} 253 value={localTextValue}
254 style={{ marginTop: '10px' }} 254 style={{ marginTop: '10px' }}
1 import React, { useEffect, useState } from 'react'; 1 import React, { useEffect, useState } from 'react';
2 import { Empty, Input, List, Modal, Tag } from 'antd'; 2 import { Empty, Input, List, Modal, Tag } from 'antd';
3 -import { CheckOutlined, CloseOutlined, SearchOutlined } from '@ant-design/icons'; 3 +import { CheckOutlined, CloseOutlined } from '@ant-design/icons';
4 import { getPreviewSelect, getSelect } from '../service'; 4 import { getPreviewSelect, getSelect } from '../service';
5 import VirtualList from 'rc-virtual-list'; 5 import VirtualList from 'rc-virtual-list';
6 import { ParamValueType } from '../../qx-filter-condition/filter'; 6 import { ParamValueType } from '../../qx-filter-condition/filter';
@@ -14,6 +14,7 @@ interface UserSelectProps { @@ -14,6 +14,7 @@ interface UserSelectProps {
14 getName: (str: string[]) => string; 14 getName: (str: string[]) => string;
15 modalClassName?: string | undefined; // 弹框类名自定义 用于自定义以及覆盖样式 15 modalClassName?: string | undefined; // 弹框类名自定义 用于自定义以及覆盖样式
16 } 16 }
  17 +import {QxBaseIcon} from '@qx/common';
17 18
18 const CONTAINER_HEIGHT = 300; 19 const CONTAINER_HEIGHT = 300;
19 20
@@ -273,8 +274,8 @@ export const RelSetter: React.FC<UserSelectProps> = ({ @@ -273,8 +274,8 @@ export const RelSetter: React.FC<UserSelectProps> = ({
273 title="选择" 274 title="选择"
274 width={'640px'} 275 width={'640px'}
275 className={'qx-table-selector'} 276 className={'qx-table-selector'}
276 - visible={visible}  
277 - destroyOnClose={true} 277 + open={visible}
  278 + destroyOnClose
278 onOk={handleOk} 279 onOk={handleOk}
279 onCancel={handleCancel} 280 onCancel={handleCancel}
280 wrapClassName={props?.modalClassName || ''} 281 wrapClassName={props?.modalClassName || ''}
@@ -285,7 +286,7 @@ export const RelSetter: React.FC<UserSelectProps> = ({ @@ -285,7 +286,7 @@ export const RelSetter: React.FC<UserSelectProps> = ({
285 className={'qx-selector-sub-search'} 286 className={'qx-selector-sub-search'}
286 placeholder={'输入关键字,回车搜索'} 287 placeholder={'输入关键字,回车搜索'}
287 allowClear 288 allowClear
288 - prefix={<SearchOutlined />} 289 + prefix={<QxBaseIcon type={'icon-app-search-line'} />}
289 onChange={handleChange} 290 onChange={handleChange}
290 onPressEnter={(e) => { 291 onPressEnter={(e) => {
291 handleSearch(e); 292 handleSearch(e);
1 import React, { useCallback, useEffect, useState } from 'react'; 1 import React, { useCallback, useEffect, useState } from 'react';
2 import { Empty, Input, Modal, Spin, Tag, Tree } from 'antd'; 2 import { Empty, Input, Modal, Spin, Tag, Tree } from 'antd';
3 -import { CloseOutlined, SearchOutlined } from '@ant-design/icons'; 3 +import { CloseOutlined } from '@ant-design/icons';
4 import { getPreviewSelect, getSelect } from '../service'; 4 import { getPreviewSelect, getSelect } from '../service';
5 import { ParamValueType } from '../../qx-filter-condition/filter'; 5 import { ParamValueType } from '../../qx-filter-condition/filter';
  6 +import {QxBaseIcon} from '@qx/common';
6 7
7 interface UserSelectProps { 8 interface UserSelectProps {
8 value?: string[]; 9 value?: string[];
@@ -295,8 +296,8 @@ export const RelTreeSetter: React.FC<UserSelectProps> = ({ @@ -295,8 +296,8 @@ export const RelTreeSetter: React.FC<UserSelectProps> = ({
295 title="选择" 296 title="选择"
296 width={'640px'} 297 width={'640px'}
297 className={'qx-table-selector'} 298 className={'qx-table-selector'}
298 - visible={visible}  
299 - destroyOnClose={true} 299 + open={visible}
  300 + destroyOnClose
300 onOk={handleOk} 301 onOk={handleOk}
301 onCancel={handleCancel} 302 onCancel={handleCancel}
302 wrapClassName={props?.modalClassName || ''} 303 wrapClassName={props?.modalClassName || ''}
@@ -307,7 +308,7 @@ export const RelTreeSetter: React.FC<UserSelectProps> = ({ @@ -307,7 +308,7 @@ export const RelTreeSetter: React.FC<UserSelectProps> = ({
307 style={{ borderBottom: '1px solid #f0f0f0' }} 308 style={{ borderBottom: '1px solid #f0f0f0' }}
308 placeholder={'请输入关键字,按回车键搜索'} 309 placeholder={'请输入关键字,按回车键搜索'}
309 allowClear 310 allowClear
310 - prefix={<SearchOutlined />} 311 + prefix={<QxBaseIcon type={'icon-app-search-line'} />}
311 onChange={(e) => { 312 onChange={(e) => {
312 handleChange(e); 313 handleChange(e);
313 }} 314 }}
@@ -196,10 +196,10 @@ export const UserSetter: React.FC<UserSelectProps> = ({ @@ -196,10 +196,10 @@ export const UserSetter: React.FC<UserSelectProps> = ({
196 overlayClassName={'qx-pop-select'} 196 overlayClassName={'qx-pop-select'}
197 getPopupContainer={(triggerNode) => triggerNode} 197 getPopupContainer={(triggerNode) => triggerNode}
198 arrowContent={false} 198 arrowContent={false}
199 - visible={popVisible}  
200 - onVisibleChange={handlePopVisibleChange} 199 + open={popVisible}
  200 + onOpenChange={handlePopVisibleChange}
201 placement="bottom" 201 placement="bottom"
202 - trigger={disabled ? '' : 'click'} 202 + trigger={disabled ? undefined : 'click'}
203 > 203 >
204 <div 204 <div
205 style={style || {}} 205 style={style || {}}
@@ -14,7 +14,7 @@ import moment from 'dayjs'; @@ -14,7 +14,7 @@ import moment from 'dayjs';
14 import type { MappingValueProps } from '../qx-filter-condition/filter'; 14 import type { MappingValueProps } from '../qx-filter-condition/filter';
15 import CodeEditor, { getAllVariable, VariableProps } from '../qx-code-editor'; 15 import CodeEditor, { getAllVariable, VariableProps } from '../qx-code-editor';
16 import { CloseOutlined, ControlOutlined, RightOutlined } from '@ant-design/icons'; 16 import { CloseOutlined, ControlOutlined, RightOutlined } from '@ant-design/icons';
17 -import _ from 'lodash'; 17 +import { cloneDeep, isEqual, isEmpty, findIndex, size } from 'lodash-es';
18 import { RelTreeSetter } from './components/rel-tree-setter'; 18 import { RelTreeSetter } from './components/rel-tree-setter';
19 import { AddressSetter } from './components/address-setter'; 19 import { AddressSetter } from './components/address-setter';
20 import {QxFieldPopover} from '../qx-field-popover'; 20 import {QxFieldPopover} from '../qx-field-popover';
@@ -185,11 +185,11 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({ @@ -185,11 +185,11 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({
185 const currentElem = useRef<any>(); 185 const currentElem = useRef<any>();
186 const [valueLocal, setValueLocal] = useState<MappingValueProps[]>(); 186 const [valueLocal, setValueLocal] = useState<MappingValueProps[]>();
187 useEffect(() => { 187 useEffect(() => {
188 - setValueLocal(_.cloneDeep(value)); 188 + setValueLocal(cloneDeep(value));
189 }, [JSON.stringify(value)]); 189 }, [JSON.stringify(value)]);
190 190
191 useEffect(() => { 191 useEffect(() => {
192 - const isSame = _.isEqual(value, valueLocal); 192 + const isSame = isEqual(value, valueLocal);
193 if (!valueLocal || isSame) { 193 if (!valueLocal || isSame) {
194 if (props.formula === 'MOD' && (valueLocal || []).length > 2) { 194 if (props.formula === 'MOD' && (valueLocal || []).length > 2) {
195 onChange((valueLocal || []).slice(0, 2)); 195 onChange((valueLocal || []).slice(0, 2));
@@ -290,7 +290,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({ @@ -290,7 +290,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({
290 index?: number, 290 index?: number,
291 isReplace?: boolean, 291 isReplace?: boolean,
292 ) => { 292 ) => {
293 - const valCp: string[] = _.cloneDeep(val); 293 + const valCp: string[] = cloneDeep(val);
294 let valueFin: string[] = valCp; 294 let valueFin: string[] = valCp;
295 if (isMultiTag) { 295 if (isMultiTag) {
296 if (Boolean(isReplace)) { 296 if (Boolean(isReplace)) {
@@ -313,14 +313,14 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({ @@ -313,14 +313,14 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({
313 } 313 }
314 314
315 if (isRange) { 315 if (isRange) {
316 - const oldVal = _.cloneDeep(valueLocal || []).map((v) => v.value) || [];  
317 - oldVal[index || 0] = _.cloneDeep(valueFin)[0]; 316 + const oldVal = cloneDeep(valueLocal || []).map((v) => v.value) || [];
  317 + oldVal[index || 0] = cloneDeep(valueFin)[0];
318 valueFin = oldVal; 318 valueFin = oldVal;
319 } 319 }
320 const mappingValuesNew: MappingValueProps[] = []; 320 const mappingValuesNew: MappingValueProps[] = [];
321 (valueFin || []).map((v: string) => { 321 (valueFin || []).map((v: string) => {
322 if (isMultiTag) { 322 if (isMultiTag) {
323 - const i = _.findIndex(mappingValuesNew, (o: any) => { 323 + const i = findIndex(mappingValuesNew, (o: any) => {
324 return o.type === valueType && o.value === v; 324 return o.type === valueType && o.value === v;
325 }); 325 });
326 if (i > -1) { 326 if (i > -1) {
@@ -342,7 +342,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({ @@ -342,7 +342,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({
342 342
343 const onFilterExtValueChange = (val: any) => { 343 const onFilterExtValueChange = (val: any) => {
344 setValueLocal((prevState) => { 344 setValueLocal((prevState) => {
345 - const valCp = _.cloneDeep(prevState); 345 + const valCp = cloneDeep(prevState);
346 if (valCp && valCp?.length > 0) { 346 if (valCp && valCp?.length > 0) {
347 valCp[0].extVal = val || ''; 347 valCp[0].extVal = val || '';
348 } 348 }
@@ -580,7 +580,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({ @@ -580,7 +580,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({
580 * @param type 580 * @param type
581 */ 581 */
582 function getMappingValues(mValues: MappingValueProps[], type?: ParamValueType) { 582 function getMappingValues(mValues: MappingValueProps[], type?: ParamValueType) {
583 - if (!mValues || _.size(mValues) === 0) { 583 + if (!mValues || size(mValues) === 0) {
584 return []; 584 return [];
585 } 585 }
586 if (type) { 586 if (type) {
@@ -592,7 +592,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({ @@ -592,7 +592,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({
592 } 592 }
593 593
594 function getMappingExtValue(mValues: MappingValueProps[], type?: ParamValueType) { 594 function getMappingExtValue(mValues: MappingValueProps[], type?: ParamValueType) {
595 - if (!mValues || _.size(mValues) === 0) { 595 + if (!mValues || size(mValues) === 0) {
596 return []; 596 return [];
597 } 597 }
598 if (type) { 598 if (type) {
@@ -767,7 +767,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({ @@ -767,7 +767,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({
767 ); 767 );
768 768
769 // "值选项集"按查询参数对应类型过滤 769 // "值选项集"按查询参数对应类型过滤
770 - const colsTreeCurr = _.cloneDeep(colsTree); 770 + const colsTreeCurr = cloneDeep(colsTree);
771 // 是人员、组织、日期类型时,按类型过滤数据 771 // 是人员、组织、日期类型时,按类型过滤数据
772 let colsTreeProps = colsTreeCurr || []; 772 let colsTreeProps = colsTreeCurr || [];
773 // 类型匹配处理,当前为只列出类型相同的属性 todo 773 // 类型匹配处理,当前为只列出类型相同的属性 todo
@@ -776,7 +776,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({ @@ -776,7 +776,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({
776 } 776 }
777 777
778 // 禁用选项 778 // 禁用选项
779 - if (excludeKeys && _.size(excludeKeys) > 0) { 779 + if (excludeKeys && size(excludeKeys) > 0) {
780 colsTreeProps = colsTreeProps?.filter((co: ColsTreeProps) => excludeKeys.includes(co.key)); 780 colsTreeProps = colsTreeProps?.filter((co: ColsTreeProps) => excludeKeys.includes(co.key));
781 colsTreeProps.map((col) => { 781 colsTreeProps.map((col) => {
782 col.children = col?.children?.filter((co: ColsTreeProps) => excludeKeys.includes(co.key)); 782 col.children = col?.children?.filter((co: ColsTreeProps) => excludeKeys.includes(co.key));
@@ -1326,7 +1326,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({ @@ -1326,7 +1326,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({
1326 // 原值类型 1326 // 原值类型
1327 let valueType: any; 1327 let valueType: any;
1328 // 查询原值(如果存在于`valueLocal`下)类型 1328 // 查询原值(如果存在于`valueLocal`下)类型
1329 - const i = _.findIndex(valueLocal, (it) => { 1329 + const i = findIndex(valueLocal, (it) => {
1330 return it?.value === val[0]; 1330 return it?.value === val[0];
1331 }); 1331 });
1332 1332
@@ -1519,7 +1519,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({ @@ -1519,7 +1519,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({
1519 } 1519 }
1520 placeholder="请输入日期(时间)" 1520 placeholder="请输入日期(时间)"
1521 defaultValue={ 1521 defaultValue={
1522 - !_.isEmpty(getMappingExtValue(valueLocal || [], ParamValueType.MANUAL)) 1522 + !isEmpty(getMappingExtValue(valueLocal || [], ParamValueType.MANUAL))
1523 ? moment( 1523 ? moment(
1524 getMappingExtValue(valueLocal || [], ParamValueType.MANUAL), 1524 getMappingExtValue(valueLocal || [], ParamValueType.MANUAL),
1525 formatEnum[ 1525 formatEnum[
@@ -1533,7 +1533,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({ @@ -1533,7 +1533,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({
1533 : undefined 1533 : undefined
1534 } 1534 }
1535 value={ 1535 value={
1536 - !_.isEmpty(getMappingExtValue(valueLocal || [], ParamValueType.MANUAL)) 1536 + !isEmpty(getMappingExtValue(valueLocal || [], ParamValueType.MANUAL))
1537 ? moment( 1537 ? moment(
1538 getMappingExtValue(valueLocal || [], ParamValueType.MANUAL), 1538 getMappingExtValue(valueLocal || [], ParamValueType.MANUAL),
1539 formatEnum[ 1539 formatEnum[
@@ -1555,7 +1555,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({ @@ -1555,7 +1555,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({
1555 style={{ width: '100%', marginTop: '6px' }} 1555 style={{ width: '100%', marginTop: '6px' }}
1556 placeholder="请输入时间" 1556 placeholder="请输入时间"
1557 defaultValue={ 1557 defaultValue={
1558 - !_.isEmpty(getMappingExtValue(valueLocal || [], ParamValueType.MANUAL)) 1558 + !isEmpty(getMappingExtValue(valueLocal || [], ParamValueType.MANUAL))
1559 ? moment( 1559 ? moment(
1560 getMappingExtValue(valueLocal || [], ParamValueType.MANUAL), 1560 getMappingExtValue(valueLocal || [], ParamValueType.MANUAL),
1561 formatEnum[ 1561 formatEnum[
@@ -1569,7 +1569,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({ @@ -1569,7 +1569,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({
1569 : undefined 1569 : undefined
1570 } 1570 }
1571 value={ 1571 value={
1572 - !_.isEmpty(getMappingExtValue(valueLocal || [], ParamValueType.MANUAL)) 1572 + !isEmpty(getMappingExtValue(valueLocal || [], ParamValueType.MANUAL))
1573 ? moment( 1573 ? moment(
1574 getMappingExtValue(valueLocal || [], ParamValueType.MANUAL), 1574 getMappingExtValue(valueLocal || [], ParamValueType.MANUAL),
1575 formatEnum[ 1575 formatEnum[
@@ -1594,7 +1594,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({ @@ -1594,7 +1594,7 @@ export const FieldSetter: React.FC<paramColSelectProps> = ({
1594 } 1594 }
1595 onChange={(date, dateString) => { 1595 onChange={(date, dateString) => {
1596 setValueLocal((prevState) => { 1596 setValueLocal((prevState) => {
1597 - let valCp: any = _.cloneDeep(prevState); 1597 + let valCp: any = cloneDeep(prevState);
1598 if (valCp && valCp?.length > 0) { 1598 if (valCp && valCp?.length > 0) {
1599 valCp[0].value = '__action_time'; 1599 valCp[0].value = '__action_time';
1600 valCp[0].extVal = dateString || ''; 1600 valCp[0].extVal = dateString || '';
@@ -5,9 +5,9 @@ import { FC, ReactElement, useEffect, useState } from 'react'; @@ -5,9 +5,9 @@ import { FC, ReactElement, useEffect, useState } from 'react';
5 import type { OptionField } from '../type'; 5 import type { OptionField } from '../type';
6 import { getUsefulFieldProp } from '../util'; 6 import { getUsefulFieldProp } from '../util';
7 import QxFieldItem from '../item'; 7 import QxFieldItem from '../item';
8 -import { SearchOutlined } from '@ant-design/icons';  
9 import './style.less'; 8 import './style.less';
10 import Checkbox from 'antd/es/checkbox/Checkbox'; 9 import Checkbox from 'antd/es/checkbox/Checkbox';
  10 +import {QxBaseIcon} from '@qx/common';
11 11
12 interface QxFieldPopoverProp { 12 interface QxFieldPopoverProp {
13 data: OptionField[]; 13 data: OptionField[];
@@ -42,7 +42,7 @@ const FieldsCheckboxGroup: FC<FieldsCheckboxGroupProps> = (props) => { @@ -42,7 +42,7 @@ const FieldsCheckboxGroup: FC<FieldsCheckboxGroupProps> = (props) => {
42 className={'qx-selector-sub-search'} 42 className={'qx-selector-sub-search'}
43 placeholder={'请输入字段名'} 43 placeholder={'请输入字段名'}
44 allowClear 44 allowClear
45 - prefix={<SearchOutlined />} 45 + prefix={<QxBaseIcon type={'icon-app-search-line'} />}
46 onChange={(e) => { 46 onChange={(e) => {
47 setKey(e.target.value.trim()); 47 setKey(e.target.value.trim());
48 }} 48 }}
@@ -90,6 +90,7 @@ interface QxCheckboxFieldPopoverProp extends QxFieldPopoverProp { @@ -90,6 +90,7 @@ interface QxCheckboxFieldPopoverProp extends QxFieldPopoverProp {
90 isChecked: boolean, 90 isChecked: boolean,
91 ) => void; 91 ) => void;
92 values?: string[]; 92 values?: string[];
  93 + children?: any;
93 } 94 }
94 95
95 const QxCheckboxFieldPopover: React.FC<QxCheckboxFieldPopoverProp> = (props) => { 96 const QxCheckboxFieldPopover: React.FC<QxCheckboxFieldPopoverProp> = (props) => {
@@ -131,13 +132,13 @@ const QxCheckboxFieldPopover: React.FC<QxCheckboxFieldPopoverProp> = (props) => @@ -131,13 +132,13 @@ const QxCheckboxFieldPopover: React.FC<QxCheckboxFieldPopoverProp> = (props) =>
131 <FieldsCheckboxGroup fields={fields} onChange={props.onChange} values={props.values} /> 132 <FieldsCheckboxGroup fields={fields} onChange={props.onChange} values={props.values} />
132 } 133 }
133 placement={'bottomRight'} 134 placement={'bottomRight'}
134 - trigger={props.disabled ? '' : props.trigger || 'hover'}  
135 - visible={visible}  
136 - onVisibleChange={(v) => { 135 + trigger={props.disabled ? undefined : props.trigger || 'hover'}
  136 + open={visible}
  137 + onOpenChange={(v) => {
137 setVisible(v); 138 setVisible(v);
138 }} 139 }}
139 > 140 >
140 - {props.children} 141 + {props?.children}
141 </Popover> 142 </Popover>
142 ); 143 );
143 }; 144 };
@@ -7,11 +7,10 @@ import type { OptionField } from '../type'; @@ -7,11 +7,10 @@ import type { OptionField } from '../type';
7 import { getUsefulFieldProp } from '../util'; 7 import { getUsefulFieldProp } from '../util';
8 // import {flatFields, getUsefulFieldProp} from '../util'; 8 // import {flatFields, getUsefulFieldProp} from '../util';
9 import QxFieldItem from '../item'; 9 import QxFieldItem from '../item';
10 -// import classNames from "classnames";  
11 -import { SearchOutlined } from '@ant-design/icons'; 10 +import {QxBaseIcon} from '@qx/common';
12 import './style.less'; 11 import './style.less';
13 import { useDebounceFn } from 'ahooks'; 12 import { useDebounceFn } from 'ahooks';
14 -import _ from 'lodash'; 13 +import { isEmpty } from 'lodash-es';
15 14
16 interface QxFieldPopoverProp { 15 interface QxFieldPopoverProp {
17 data: OptionField[]; 16 data: OptionField[];
@@ -55,7 +54,7 @@ const QxFieldPopover: React.FC<QxFieldPopoverProp> = (props) => { @@ -55,7 +54,7 @@ const QxFieldPopover: React.FC<QxFieldPopoverProp> = (props) => {
55 }); 54 });
56 }; 55 };
57 useEffect(() => { 56 useEffect(() => {
58 - if (!_.isEmpty(props.data)) { 57 + if (!isEmpty(props.data)) {
59 const _fields = excludeFields(props.data); 58 const _fields = excludeFields(props.data);
60 setFields(_fields); 59 setFields(_fields);
61 setFilterFields(_fields); 60 setFilterFields(_fields);
@@ -132,7 +131,7 @@ const QxFieldPopover: React.FC<QxFieldPopoverProp> = (props) => { @@ -132,7 +131,7 @@ const QxFieldPopover: React.FC<QxFieldPopoverProp> = (props) => {
132 className={'qx-selector-sub-search'} 131 className={'qx-selector-sub-search'}
133 placeholder={'搜索'} 132 placeholder={'搜索'}
134 allowClear 133 allowClear
135 - prefix={<SearchOutlined />} 134 + prefix={<QxBaseIcon type={'icon-app-search-line'} />}
136 style={{ paddingTop: '6px' }} 135 style={{ paddingTop: '6px' }}
137 onChange={(e) => { 136 onChange={(e) => {
138 handleChange(e.target.value); 137 handleChange(e.target.value);
@@ -242,13 +241,13 @@ const QxFieldPopover: React.FC<QxFieldPopoverProp> = (props) => { @@ -242,13 +241,13 @@ const QxFieldPopover: React.FC<QxFieldPopoverProp> = (props) => {
242 // getPopupContainer={(triggerNode) => triggerNode} 241 // getPopupContainer={(triggerNode) => triggerNode}
243 content={fieldsPopContent()} 242 content={fieldsPopContent()}
244 placement={'bottomRight'} 243 placement={'bottomRight'}
245 - trigger={props.disabled ? '' : props.trigger || 'hover'}  
246 - visible={visible}  
247 - onVisibleChange={(v) => { 244 + trigger={props.disabled ? undefined : props.trigger || 'hover'}
  245 + open={visible}
  246 + onOpenChange={(v) => {
248 setVisible(v); 247 setVisible(v);
249 }} 248 }}
250 > 249 >
251 - {props.children} 250 + {props?.children}
252 </Popover> 251 </Popover>
253 ); 252 );
254 }; 253 };
  1 +@import '~@qx/ui/src/style/variable.less';
  2 +
1 .qx-fields-popover { 3 .qx-fields-popover {
2 padding-top: 0; 4 padding-top: 0;
3 5
@@ -22,7 +24,7 @@ @@ -22,7 +24,7 @@
22 cursor: pointer; 24 cursor: pointer;
23 25
24 &:hover { 26 &:hover {
25 - background-color: @item-hover-bg; 27 + background-color: @N3;
26 } 28 }
27 } 29 }
28 } 30 }
@@ -35,7 +37,7 @@ @@ -35,7 +37,7 @@
35 &.ant-menu-inline > .ant-menu-submenu > .ant-menu-submenu-title { 37 &.ant-menu-inline > .ant-menu-submenu > .ant-menu-submenu-title {
36 margin-top: 0; 38 margin-top: 0;
37 margin-bottom: 1px; 39 margin-bottom: 1px;
38 - background-color: #fafafa; 40 + background-color: @N2;
39 } 41 }
40 42
41 .ant-menu-sub.ant-menu-inline { 43 .ant-menu-sub.ant-menu-inline {
@@ -50,7 +52,7 @@ @@ -50,7 +52,7 @@
50 52
51 &:hover { 53 &:hover {
52 color: inherit; 54 color: inherit;
53 - background-color: @item-hover-bg; 55 + background-color: @N3;
54 } 56 }
55 } 57 }
56 } 58 }
@@ -58,5 +60,5 @@ @@ -58,5 +60,5 @@
58 padding-top: 5px; 60 padding-top: 5px;
59 padding-bottom: 5px; 61 padding-bottom: 5px;
60 padding-left: 24px; 62 padding-left: 24px;
61 - border-top: 1px solid #f0f0f0; 63 + border-top: 1px solid @N4;
62 } 64 }
@@ -2,7 +2,7 @@ import { Input, Popover, Tree } from 'antd'; @@ -2,7 +2,7 @@ import { Input, Popover, Tree } from 'antd';
2 import React from 'react'; 2 import React from 'react';
3 import { FC, ReactElement, useEffect, useState } from 'react'; 3 import { FC, ReactElement, useEffect, useState } from 'react';
4 import type { OptionField } from '../type'; 4 import type { OptionField } from '../type';
5 -import { SearchOutlined } from '@ant-design/icons'; 5 +import {QxBaseIcon} from '@qx/common';
6 import './style.less'; 6 import './style.less';
7 7
8 interface QxFieldPopoverProp { 8 interface QxFieldPopoverProp {
@@ -29,8 +29,8 @@ const ParametersTreeGroup: FC<FieldsCheckboxGroupProps> = (props) => { @@ -29,8 +29,8 @@ const ParametersTreeGroup: FC<FieldsCheckboxGroupProps> = (props) => {
29 const [keyword, setKey] = useState(''); 29 const [keyword, setKey] = useState('');
30 30
31 const [autoExpandParent, setAutoExpandParent] = useState<boolean>(true); 31 const [autoExpandParent, setAutoExpandParent] = useState<boolean>(true);
32 - const [expandedKeys, setExpandedKeys] = useState<React.Key[]>([]);  
33 - const [checkedKeys, setCheckedKeys] = useState<React.Key[]>([]); 32 + const [expandedKeys, setExpandedKeys] = useState<any>([]);
  33 + const [checkedKeys, setCheckedKeys] = useState<any>([]);
34 34
35 const [treeData, setTreeData] = useState<any[]>([]); 35 const [treeData, setTreeData] = useState<any[]>([]);
36 36
@@ -67,7 +67,7 @@ const ParametersTreeGroup: FC<FieldsCheckboxGroupProps> = (props) => { @@ -67,7 +67,7 @@ const ParametersTreeGroup: FC<FieldsCheckboxGroupProps> = (props) => {
67 setAutoExpandParent(false); 67 setAutoExpandParent(false);
68 }; 68 };
69 69
70 - const onCheck = (checkedKeysValue: React.Key[], Item: any) => { 70 + const onCheck = (checkedKeysValue: any, Item: any) => {
71 console.log('onCheck', checkedKeysValue, Item, checkedKeysValue?.checked); 71 console.log('onCheck', checkedKeysValue, Item, checkedKeysValue?.checked);
72 setCheckedKeys(checkedKeysValue); 72 setCheckedKeys(checkedKeysValue);
73 const chooseId = Item?.node?.id; 73 const chooseId = Item?.node?.id;
@@ -83,7 +83,7 @@ const ParametersTreeGroup: FC<FieldsCheckboxGroupProps> = (props) => { @@ -83,7 +83,7 @@ const ParametersTreeGroup: FC<FieldsCheckboxGroupProps> = (props) => {
83 83
84 const KeysArr: any[] = []; 84 const KeysArr: any[] = [];
85 const loop = (data: any): any => 85 const loop = (data: any): any =>
86 - data.map((item) => { 86 + data.map((item: any) => {
87 const strTitle = item.title as string; 87 const strTitle = item.title as string;
88 const index = strTitle.indexOf(keyword); 88 const index = strTitle.indexOf(keyword);
89 const beforeStr = strTitle.substring(0, index); 89 const beforeStr = strTitle.substring(0, index);
@@ -123,7 +123,7 @@ const ParametersTreeGroup: FC<FieldsCheckboxGroupProps> = (props) => { @@ -123,7 +123,7 @@ const ParametersTreeGroup: FC<FieldsCheckboxGroupProps> = (props) => {
123 className={'qx-selector-sub-search'} 123 className={'qx-selector-sub-search'}
124 placeholder={'请输入参数名称搜索'} 124 placeholder={'请输入参数名称搜索'}
125 allowClear 125 allowClear
126 - prefix={<SearchOutlined />} 126 + prefix={<QxBaseIcon type={'icon-app-search-line'} />}
127 onChange={(e) => { 127 onChange={(e) => {
128 setKey(e.target.value.trim()); 128 setKey(e.target.value.trim());
129 }} 129 }}
@@ -152,6 +152,7 @@ const ParametersTreeGroup: FC<FieldsCheckboxGroupProps> = (props) => { @@ -152,6 +152,7 @@ const ParametersTreeGroup: FC<FieldsCheckboxGroupProps> = (props) => {
152 interface QxTreeParameterPopoverProp extends QxFieldPopoverProp { 152 interface QxTreeParameterPopoverProp extends QxFieldPopoverProp {
153 onChange: (selectedKey: string, selectedItem: OptionField, isChecked: boolean) => void; 153 onChange: (selectedKey: string, selectedItem: OptionField, isChecked: boolean) => void;
154 values?: string[]; 154 values?: string[];
  155 + children?: any;
155 } 156 }
156 157
157 const QxTreeParameterPopover: React.FC<QxTreeParameterPopoverProp> = (props) => { 158 const QxTreeParameterPopover: React.FC<QxTreeParameterPopoverProp> = (props) => {
@@ -172,7 +173,7 @@ const QxTreeParameterPopover: React.FC<QxTreeParameterPopoverProp> = (props) => @@ -172,7 +173,7 @@ const QxTreeParameterPopover: React.FC<QxTreeParameterPopoverProp> = (props) =>
172 // console.log(props.data); 173 // console.log(props.data);
173 if (props.data) { 174 if (props.data) {
174 const _fields = excludeFields(props?.data); 175 const _fields = excludeFields(props?.data);
175 - setFields(_fields); 176 + setFields(_fields || []);
176 } 177 }
177 }, [props.data]); 178 }, [props.data]);
178 179
@@ -183,13 +184,13 @@ const QxTreeParameterPopover: React.FC<QxTreeParameterPopoverProp> = (props) => @@ -183,13 +184,13 @@ const QxTreeParameterPopover: React.FC<QxTreeParameterPopoverProp> = (props) =>
183 <ParametersTreeGroup fields={fields} onChange={props.onChange} values={props.values} /> 184 <ParametersTreeGroup fields={fields} onChange={props.onChange} values={props.values} />
184 } 185 }
185 placement={'bottomRight'} 186 placement={'bottomRight'}
186 - trigger={props.disabled ? '' : props.trigger || 'hover'}  
187 - visible={visible}  
188 - onVisibleChange={(v) => { 187 + trigger={props.disabled ? undefined : props.trigger || 'hover'}
  188 + open={visible}
  189 + onOpenChange={(v) => {
189 setVisible(v); 190 setVisible(v);
190 }} 191 }}
191 > 192 >
192 - {props.children} 193 + {props?.children}
193 </Popover> 194 </Popover>
194 ); 195 );
195 }; 196 };
@@ -87,7 +87,7 @@ const QxFieldSelect: React.FC = (props: any) => { @@ -87,7 +87,7 @@ const QxFieldSelect: React.FC = (props: any) => {
87 useEffect(() => { 87 useEffect(() => {
88 if (schemaProps && !schemaProps.data && schemaProps.params && fields.length === 0) { 88 if (schemaProps && !schemaProps.data && schemaProps.params && fields.length === 0) {
89 const { ...otherParams } = schemaProps.params; 89 const { ...otherParams } = schemaProps.params;
90 - getFieldOptions(appCode, funCode, otherParams).then((res) => { 90 + getFieldOptions(appCode, funCode, otherParams).then((res: any) => {
91 setFields(includeFields(res)); 91 setFields(includeFields(res));
92 }); 92 });
93 } else if (schemaProps && schemaProps.data) { 93 } else if (schemaProps && schemaProps.data) {
@@ -126,7 +126,7 @@ const QxFieldSelect: React.FC = (props: any) => { @@ -126,7 +126,7 @@ const QxFieldSelect: React.FC = (props: any) => {
126 // @ts-ignore 126 // @ts-ignore
127 return ( 127 return (
128 ((fields || []) as any) 128 ((fields || []) as any)
129 - .filter((field) => field.code === option.key)[0] 129 + .filter((field: { code: string }) => field.code === option.key)[0]
130 .name?.indexOf(input) > -1 130 .name?.indexOf(input) > -1
131 ); 131 );
132 } 132 }
  1 +@import '~@qx/ui/src/style/variable.less';
  2 +
1 .select_mask { 3 .select_mask {
2 position: absolute; 4 position: absolute;
3 z-index: 9; 5 z-index: 9;
4 width: 100%; 6 width: 100%;
5 height: 100%; 7 height: 100%;
6 text-align: center; 8 text-align: center;
7 - background-color: @red-1;  
8 - border: 1px solid @btn-danger-border;  
9 - border-radius: @btn-border-radius-base; 9 + background-color: @E1;
  10 + border: 1px solid @E2;
  11 + border-radius: 4px;
10 pointer-events: none; 12 pointer-events: none;
11 } 13 }
12 14
13 .select_mask_text { 15 .select_mask_text {
14 z-index: 13; 16 z-index: 13;
15 - color: @error-color; 17 + color: @E3;
16 font-size: 14px; 18 font-size: 14px;
17 line-height: 30px; 19 line-height: 30px;
18 text-align: center; 20 text-align: center;
@@ -29,7 +29,7 @@ export const getUsefulFieldProp = (field: any) => { @@ -29,7 +29,7 @@ export const getUsefulFieldProp = (field: any) => {
29 * @param excludeWidgets 29 * @param excludeWidgets
30 */ 30 */
31 export const flatFields = (fields: WidgetField[] | OptionField[], excludeWidgets?: string[]) => { 31 export const flatFields = (fields: WidgetField[] | OptionField[], excludeWidgets?: string[]) => {
32 - const fieldFlatten = {}; 32 + const fieldFlatten: any = {};
33 fields.forEach((field: any) => { 33 fields.forEach((field: any) => {
34 const { code, widget } = getUsefulFieldProp(field); 34 const { code, widget } = getUsefulFieldProp(field);
35 if (excludeWidgets && excludeWidgets.indexOf(widget) > -1) { 35 if (excludeWidgets && excludeWidgets.indexOf(widget) > -1) {
  1 +import React, { useCallback, useRef } from 'react';
1 import { BlockOutlined } from '@ant-design/icons'; 2 import { BlockOutlined } from '@ant-design/icons';
2 import { useSetState } from 'ahooks'; 3 import { useSetState } from 'ahooks';
3 import { Button } from 'antd'; 4 import { Button } from 'antd';
4 import cls from 'classnames'; 5 import cls from 'classnames';
5 -import React, { useCallback, useRef } from 'react';  
6 import { QxAppSelector } from '../qx-app-selector'; 6 import { QxAppSelector } from '../qx-app-selector';
7 import type { InputSelectProps } from '../qx-input-select'; 7 import type { InputSelectProps } from '../qx-input-select';
8 import { QxInputSelect } from '../qx-input-select'; 8 import { QxInputSelect } from '../qx-input-select';
  1 +@import '~@qx/ui/src/style/variable.less';
  2 +
1 @prefix: ~'qx-datasource-select'; 3 @prefix: ~'qx-datasource-select';
2 4
3 .@{prefix} { 5 .@{prefix} {
@@ -8,6 +10,6 @@ @@ -8,6 +10,6 @@
8 height: 50px !important; 10 height: 50px !important;
9 text-align: left !important; 11 text-align: left !important;
10 background-color: #fff !important; 12 background-color: #fff !important;
11 - border-top: 1px solid #e6eaf2 !important; 13 + border-top: 1px solid @N4 !important;
12 } 14 }
13 } 15 }
@@ -2,9 +2,9 @@ import * as React from 'react'; @@ -2,9 +2,9 @@ import * as React from 'react';
2 import { useCallback, useEffect, useImperativeHandle, useState } from 'react'; 2 import { useCallback, useEffect, useImperativeHandle, useState } from 'react';
3 import { Checkbox, Empty, Input, Spin } from 'antd'; 3 import { Checkbox, Empty, Input, Spin } from 'antd';
4 import Menu from 'antd/es/menu'; 4 import Menu from 'antd/es/menu';
5 -import { SearchOutlined } from '@ant-design/icons'; 5 +import {QxBaseIcon} from '@qx/common';
6 import { getGroups } from './service'; 6 import { getGroups } from './service';
7 -import _ from 'lodash'; 7 +import { cloneDeep } from 'lodash-es';
8 8
9 type GroupCoreProps = { 9 type GroupCoreProps = {
10 appId?: string; 10 appId?: string;
@@ -144,7 +144,7 @@ const GroupSelCore: React.FC<GroupCoreProps> = ({ @@ -144,7 +144,7 @@ const GroupSelCore: React.FC<GroupCoreProps> = ({
144 }; 144 };
145 145
146 if (data) { 146 if (data) {
147 - const _data = _.cloneDeep(data); 147 + const _data = cloneDeep(data);
148 _data.forEach((item) => { 148 _data.forEach((item) => {
149 traverse(item); 149 traverse(item);
150 }); 150 });
@@ -189,7 +189,7 @@ const GroupSelCore: React.FC<GroupCoreProps> = ({ @@ -189,7 +189,7 @@ const GroupSelCore: React.FC<GroupCoreProps> = ({
189 className={'qx-selector-sub-search'} 189 className={'qx-selector-sub-search'}
190 placeholder={placeholder || '请输入群组名称,按回车键搜索'} 190 placeholder={placeholder || '请输入群组名称,按回车键搜索'}
191 allowClear 191 allowClear
192 - prefix={<SearchOutlined />} 192 + prefix={<QxBaseIcon type={'icon-app-search-line'} />}
193 onChange={(e) => { 193 onChange={(e) => {
194 handleChange(e); 194 handleChange(e);
195 }} 195 }}
1 -import { SearchOutlined } from '@ant-design/icons';  
2 -import { useScroll } from 'ahooks';  
3 -import { Empty, Input, Menu, Spin } from 'antd';  
4 -import cls from 'classnames';  
5 -import { debounce } from 'lodash';  
6 import React, { 1 import React, {
7 memo, 2 memo,
8 useCallback, 3 useCallback,
@@ -11,6 +6,11 @@ import React, { @@ -11,6 +6,11 @@ import React, {
11 useRef, 6 useRef,
12 useState, 7 useState,
13 } from 'react'; 8 } from 'react';
  9 +import {QxBaseIcon} from '@qx/common';
  10 +import { useScroll } from 'ahooks';
  11 +import { Empty, Input, Menu, Spin } from 'antd';
  12 +import cls from 'classnames';
  13 +import { debounce } from 'lodash-es';
14 import './styles.less'; 14 import './styles.less';
15 const prefix = 'qx-input-select-dropdown'; 15 const prefix = 'qx-input-select-dropdown';
16 16
@@ -115,7 +115,7 @@ const DropdownContent = React.forwardRef<any, DropdownContentProps>( @@ -115,7 +115,7 @@ const DropdownContent = React.forwardRef<any, DropdownContentProps>(
115 {showSearch ? ( 115 {showSearch ? (
116 <Input 116 <Input
117 placeholder={placeholder || '输入名称搜索'} 117 placeholder={placeholder || '输入名称搜索'}
118 - prefix={<SearchOutlined />} 118 + prefix={<QxBaseIcon type={'icon-app-search-line'} />}
119 className={`${prefix}__input`} 119 className={`${prefix}__input`}
120 onChange={onSearch} 120 onChange={onSearch}
121 /> 121 />
@@ -62,11 +62,11 @@ export const QxInputSelect = React.forwardRef<any, InputSelectProps>( @@ -62,11 +62,11 @@ export const QxInputSelect = React.forwardRef<any, InputSelectProps>(
62 return ( 62 return (
63 <div className={cls(prefix, className)}> 63 <div className={cls(prefix, className)}>
64 <Dropdown 64 <Dropdown
65 - visible={state.visible} 65 + open={state.visible}
66 destroyPopupOnHide 66 destroyPopupOnHide
67 trigger={['click']} 67 trigger={['click']}
68 className={`${prefix}__dropdown`} 68 className={`${prefix}__dropdown`}
69 - overlay={() => ( 69 + dropdownRender={() => (
70 <DropdownContent 70 <DropdownContent
71 options={options} 71 options={options}
72 onChange={handleChange} 72 onChange={handleChange}
@@ -74,7 +74,7 @@ export const QxInputSelect = React.forwardRef<any, InputSelectProps>( @@ -74,7 +74,7 @@ export const QxInputSelect = React.forwardRef<any, InputSelectProps>(
74 /> 74 />
75 )} 75 )}
76 getPopupContainer={(triggerNode) => triggerNode} 76 getPopupContainer={(triggerNode) => triggerNode}
77 - onVisibleChange={onVisibleChange} 77 + onOpenChange={onVisibleChange}
78 disabled={disabled} 78 disabled={disabled}
79 > 79 >
80 <Input 80 <Input
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 margin-bottom: 0; 31 margin-bottom: 0;
32 32
33 &:hover { 33 &:hover {
34 - background-color: #f5f5f5; 34 + background-color: @N3;
35 } 35 }
36 } 36 }
37 } 37 }
@@ -54,7 +54,7 @@ @@ -54,7 +54,7 @@
54 padding-bottom: 5px !important; 54 padding-bottom: 5px !important;
55 padding-left: 0 !important; 55 padding-left: 0 !important;
56 border: none !important; 56 border: none !important;
57 - border-bottom: 1px solid #e6eaf2 !important; 57 + border-bottom: 1px solid @N4 !important;
58 outline: none !important; 58 outline: none !important;
59 box-shadow: none !important; 59 box-shadow: none !important;
60 60
  1 +@import '~@qx/ui/src/style/variable.less';
  2 +
1 .qx-search-tree__wrap { 3 .qx-search-tree__wrap {
2 height: 100%; 4 height: 100%;
3 overflow: auto; 5 overflow: auto;
@@ -8,8 +10,8 @@ @@ -8,8 +10,8 @@
8 10
9 .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected { 11 .ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected {
10 // TODO 主题色更改 颜色暂时写死 12 // TODO 主题色更改 颜色暂时写死
11 - color: #1764ff;  
12 - background-color: #e6f7ff; 13 + color: @B8;
  14 + background-color: @B3;
13 } 15 }
14 } 16 }
15 17
@@ -3,8 +3,9 @@ import { useCallback, useEffect, useImperativeHandle, useState } from 'react'; @@ -3,8 +3,9 @@ import { useCallback, useEffect, useImperativeHandle, useState } from 'react';
3 import { Empty, Input, Spin, Tooltip, Tree } from 'antd'; 3 import { Empty, Input, Spin, Tooltip, Tree } from 'antd';
4 import './core.less'; 4 import './core.less';
5 import { getOrgTree } from './service'; 5 import { getOrgTree } from './service';
6 -import _ from 'lodash';  
7 -import { PartitionOutlined, SearchOutlined } from '@ant-design/icons'; 6 +import { cloneDeep } from 'lodash-es';
  7 +import { PartitionOutlined } from '@ant-design/icons';
  8 +import {QxBaseIcon} from '@qx/common';
8 9
9 type OrgCoreProps = { 10 type OrgCoreProps = {
10 cRef?: any; 11 cRef?: any;
@@ -243,7 +244,7 @@ const OrgCore: React.FC<OrgCoreProps> = (props) => { @@ -243,7 +244,7 @@ const OrgCore: React.FC<OrgCoreProps> = (props) => {
243 }; 244 };
244 245
245 if (data) { 246 if (data) {
246 - const _data = _.cloneDeep(data); 247 + const _data = cloneDeep(data);
247 if (word != '') { 248 if (word != '') {
248 traverse(_data); 249 traverse(_data);
249 } 250 }
@@ -301,7 +302,7 @@ const OrgCore: React.FC<OrgCoreProps> = (props) => { @@ -301,7 +302,7 @@ const OrgCore: React.FC<OrgCoreProps> = (props) => {
301 className={'qx-selector-sub-search'} 302 className={'qx-selector-sub-search'}
302 placeholder={props.placeholder || '请输入部门名称,按回车键搜索'} 303 placeholder={props.placeholder || '请输入部门名称,按回车键搜索'}
303 allowClear 304 allowClear
304 - prefix={<SearchOutlined />} 305 + prefix={<QxBaseIcon type={'icon-app-search-line'} />}
305 onChange={(e) => { 306 onChange={(e) => {
306 handleChange(e); 307 handleChange(e);
307 }} 308 }}
1 -import * as React from 'react';  
2 -import { useEffect, useRef, useState } from 'react'; 1 +import React, { useEffect, useRef, useState } from 'react';
3 import { Modal, Tag } from 'antd'; 2 import { Modal, Tag } from 'antd';
4 import OrgCore from './core'; 3 import OrgCore from './core';
5 4
@@ -56,7 +55,7 @@ const OrgSelectorDialog: React.FC<OrgSelectorDialogProps> = (props) => { @@ -56,7 +55,7 @@ const OrgSelectorDialog: React.FC<OrgSelectorDialogProps> = (props) => {
56 <Modal 55 <Modal
57 title={props.title || '选择部门'} 56 title={props.title || '选择部门'}
58 width={560} 57 width={560}
59 - visible={props.visible} 58 + open={props.visible}
60 className={'qx-org-selector__dialog'} 59 className={'qx-org-selector__dialog'}
61 onOk={handleOk} 60 onOk={handleOk}
62 onCancel={handleCancel} 61 onCancel={handleCancel}
@@ -103,7 +103,7 @@ const QxOrgSelector: React.FC<QxOrgSelectorProps> = (props) => { @@ -103,7 +103,7 @@ const QxOrgSelector: React.FC<QxOrgSelectorProps> = (props) => {
103 }, [JSON.stringify(props.defaultData)]); 103 }, [JSON.stringify(props.defaultData)]);
104 104
105 // getUserList() 105 // getUserList()
106 - const handleOk = (keys: [], data: []) => { 106 + const handleOk = (keys: any[], data: any[]) => {
107 let _value: [] | string = keys; 107 let _value: [] | string = keys;
108 if (!props.multiple && keys && keys.length > 0) { 108 if (!props.multiple && keys && keys.length > 0) {
109 // @ts-ignore 109 // @ts-ignore
  1 +@import '~@qx/ui/src/style/variable.less';
  2 +
1 .qx-org-selector { 3 .qx-org-selector {
2 padding-left: 8px; 4 padding-left: 8px;
3 line-height: 0; 5 line-height: 0;
@@ -55,7 +57,7 @@ @@ -55,7 +57,7 @@
55 57
56 .qx-selector-sub-search.ant-input-affix-wrapper { 58 .qx-selector-sub-search.ant-input-affix-wrapper {
57 margin-bottom: 8px; 59 margin-bottom: 8px;
58 - border-bottom: 1px solid #f0f0f0; 60 + border-bottom: 1px solid @N4;
59 } 61 }
60 } 62 }
61 63
@@ -68,7 +70,7 @@ @@ -68,7 +70,7 @@
68 height: 60px; 70 height: 60px;
69 padding: 5px; 71 padding: 5px;
70 overflow: auto; 72 overflow: auto;
71 - border-bottom: 1px solid #f0f0f0; 73 + border-bottom: 1px solid @N4;
72 74
73 .ant-tag { 75 .ant-tag {
74 margin: 1px 2px; 76 margin: 1px 2px;
@@ -82,14 +84,14 @@ @@ -82,14 +84,14 @@
82 84
83 .qx-org-tree__include { 85 .qx-org-tree__include {
84 margin-left: 10px; 86 margin-left: 10px;
85 - color: #999; 87 + color: @N7;
86 font-size: 16px; 88 font-size: 16px;
87 89
88 &:hover { 90 &:hover {
89 - color: #333; 91 + color: @N9;
90 } 92 }
91 93
92 .active { 94 .active {
93 - color: #1890ff; 95 + color: @B8;
94 } 96 }
95 } 97 }
@@ -3,7 +3,6 @@ @@ -3,7 +3,6 @@
3 import { 3 import {
4 DeleteOutlined, 4 DeleteOutlined,
5 PlusOutlined, 5 PlusOutlined,
6 - SearchOutlined,  
7 SisternodeOutlined, 6 SisternodeOutlined,
8 SnippetsOutlined, 7 SnippetsOutlined,
9 } from '@ant-design/icons'; 8 } from '@ant-design/icons';
@@ -40,8 +39,10 @@ import { formatEnum } from './constant'; @@ -40,8 +39,10 @@ import { formatEnum } from './constant';
40 // typeTranslateItemtype, 39 // typeTranslateItemtype,
41 // } from './constant'; 40 // } from './constant';
42 // import { Controlled as CodeMirror } from 'react-codemirror2' 41 // import { Controlled as CodeMirror } from 'react-codemirror2'
43 -import _ from 'lodash'; 42 +import { cloneDeep } from 'lodash-es';
44 import moment from 'dayjs'; 43 import moment from 'dayjs';
  44 +import {QxBaseIcon} from '@qx/common';
  45 +
45 const valueOptions = [ 46 const valueOptions = [
46 { key: 'STRING', title: '文本' }, 47 { key: 'STRING', title: '文本' },
47 { key: 'NUMBER', title: '数字' }, 48 { key: 'NUMBER', title: '数字' },
@@ -125,7 +126,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -125,7 +126,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
125 126
126 //判断数组是否只有一个子节点 127 //判断数组是否只有一个子节点
127 const checkShowAdd = (_data: any) => { 128 const checkShowAdd = (_data: any) => {
128 - const _newTreeData = _.cloneDeep(treeData); 129 + const _newTreeData = cloneDeep(treeData);
129 if (!!_data.pid) { 130 if (!!_data.pid) {
130 const pidIndex = _newTreeData.findIndex( 131 const pidIndex = _newTreeData.findIndex(
131 (item: any) => item.id === _data.pid, 132 (item: any) => item.id === _data.pid,
@@ -870,7 +871,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -870,7 +871,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
870 const dropId = 871 const dropId =
871 dropCol.getAttribute('data-row-key') || 872 dropCol.getAttribute('data-row-key') ||
872 dropCol.getAttribute('id')?.slice(4); 873 dropCol.getAttribute('id')?.slice(4);
873 - const _newTreeData = _.cloneDeep(treeData); 874 + const _newTreeData = cloneDeep(treeData);
874 const dragIndex = _newTreeData.findIndex( 875 const dragIndex = _newTreeData.findIndex(
875 (item: any) => item.id === dragId, 876 (item: any) => item.id === dragId,
876 ); //要drop的index 877 ); //要drop的index
@@ -947,7 +948,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -947,7 +948,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
947 <> 948 <>
948 <Modal 949 <Modal
949 title="高级参数设计器" 950 title="高级参数设计器"
950 - visible={visible} 951 + open={visible}
951 destroyOnClose 952 destroyOnClose
952 footer={null} 953 footer={null}
953 // onOk={handleCancel} 954 // onOk={handleCancel}
@@ -986,7 +987,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -986,7 +987,7 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
986 <Input 987 <Input
987 className={'qx-parameter-setting--search'} 988 className={'qx-parameter-setting--search'}
988 placeholder="按名称搜索" 989 placeholder="按名称搜索"
989 - prefix={<SearchOutlined />} 990 + prefix={<QxBaseIcon type={'icon-app-search-line'} />}
990 onChange={onChange} 991 onChange={onChange}
991 style={{ width: 219 }} 992 style={{ width: 219 }}
992 /> 993 />
@@ -1019,11 +1020,12 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => { @@ -1019,11 +1020,12 @@ const ParameterModal: React.FC<ParameterSettingProps> = (props) => {
1019 // <Form form={form}> 1020 // <Form form={form}>
1020 <Table 1021 <Table
1021 components={components} 1022 components={components}
1022 - defaultExpandAllRows 1023 + expandable={{
  1024 + defaultExpandAllRows: true,
  1025 + childrenColumnName: 'child'
  1026 + }}
1023 onRow={() => onRow()} 1027 onRow={() => onRow()}
1024 scroll={{ x: 1600 }} 1028 scroll={{ x: 1600 }}
1025 - childrenColumnName={'child'}  
1026 - // className={'param-setting-table'}  
1027 rowClassName={() => 'editable-row'} 1029 rowClassName={() => 'editable-row'}
1028 bordered 1030 bordered
1029 pagination={false} 1031 pagination={false}
@@ -585,4 +585,5 @@ export interface ParamDesignModel extends DataNode { @@ -585,4 +585,5 @@ export interface ParamDesignModel extends DataNode {
585 title?: string; 585 title?: string;
586 qxProps?: any; 586 qxProps?: any;
587 child?: ParamDesignModel[]; 587 child?: ParamDesignModel[];
  588 + mappingValues?: any;
588 } 589 }
@@ -5,7 +5,6 @@ import React, { useCallback, useEffect, useState } from 'react'; @@ -5,7 +5,6 @@ import React, { useCallback, useEffect, useState } from 'react';
5 import { 5 import {
6 DeleteOutlined, 6 DeleteOutlined,
7 PlusOutlined, 7 PlusOutlined,
8 - SearchOutlined,  
9 SettingOutlined, 8 SettingOutlined,
10 } from '@ant-design/icons'; 9 } from '@ant-design/icons';
11 import { 10 import {
@@ -30,10 +29,12 @@ import { formatEnum } from './constant'; @@ -30,10 +29,12 @@ import { formatEnum } from './constant';
30 // typeTranslateItemtype, 29 // typeTranslateItemtype,
31 // } from './constant'; 30 // } from './constant';
32 31
33 -import _ from 'lodash'; 32 +import { cloneDeep } from 'lodash-es';
34 import moment from 'dayjs'; 33 import moment from 'dayjs';
35 import type { ParamDesignModel } from './constant'; 34 import type { ParamDesignModel } from './constant';
36 import { uidGen } from './stringUtil'; 35 import { uidGen } from './stringUtil';
  36 +import {QxBaseIcon} from '@qx/common';
  37 +
37 import './style.less'; 38 import './style.less';
38 39
39 const valueOptions = [ 40 const valueOptions = [
@@ -106,7 +107,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { @@ -106,7 +107,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
106 107
107 useEffect(() => { 108 useEffect(() => {
108 if (props?.value?.length > 0) { 109 if (props?.value?.length > 0) {
109 - const value = _.cloneDeep(props?.value); 110 + const value = cloneDeep(props?.value);
110 const expandedArray: any = []; 111 const expandedArray: any = [];
111 (value || []).map((_item: ParamDesignModel) => { 112 (value || []).map((_item: ParamDesignModel) => {
112 expandedArray.push(_item.id); 113 expandedArray.push(_item.id);
@@ -115,7 +116,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { @@ -115,7 +116,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
115 setTreeData(value); 116 setTreeData(value);
116 // const newData = generateTreeData(value, '') 117 // const newData = generateTreeData(value, '')
117 const Treelist = generateList(value); 118 const Treelist = generateList(value);
118 - const newList = _.cloneDeep(Treelist); 119 + const newList = cloneDeep(Treelist);
119 newList.map((_item) => { 120 newList.map((_item) => {
120 delete _item.child; 121 delete _item.child;
121 }); 122 });
@@ -153,7 +154,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { @@ -153,7 +154,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
153 data: ParamDesignModel, 154 data: ParamDesignModel,
154 // newType: string, 155 // newType: string,
155 ) => { 156 ) => {
156 - let treeList = _.cloneDeep(list); 157 + let treeList = cloneDeep(list);
157 // todo 编辑重名bug 貌似有点问题 待修改 158 // todo 编辑重名bug 貌似有点问题 待修改
158 treeList = (treeList || []).filter((item) => item.id != data.id); 159 treeList = (treeList || []).filter((item) => item.id != data.id);
159 if (!treeList || treeList.length == 0) { 160 if (!treeList || treeList.length == 0) {
@@ -217,7 +218,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { @@ -217,7 +218,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
217 218
218 const isProps = code.indexOf('qxProps'); 219 const isProps = code.indexOf('qxProps');
219 const _newCode = isProps > -1 ? code.slice(8) : ''; 220 const _newCode = isProps > -1 ? code.slice(8) : '';
220 - const _newData = _.cloneDeep(treeData); 221 + const _newData = cloneDeep(treeData);
221 if (code == 'code') { 222 if (code == 'code') {
222 data.code = value; 223 data.code = value;
223 const codeValid = validateCode(data); 224 const codeValid = validateCode(data);
@@ -290,7 +291,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { @@ -290,7 +291,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
290 okText: '确认', 291 okText: '确认',
291 okType: 'danger', 292 okType: 'danger',
292 onOk: () => { 293 onOk: () => {
293 - const listData = _.cloneDeep(treeData); 294 + const listData = cloneDeep(treeData);
294 // const newData = generateTreeData(listData, ''); 295 // const newData = generateTreeData(listData, '');
295 const loopDeleteTree = (treeList: ParamDesignModel[]) => { 296 const loopDeleteTree = (treeList: ParamDesignModel[]) => {
296 for (let i = 0; i < treeList.length; i++) { 297 for (let i = 0; i < treeList.length; i++) {
@@ -334,7 +335,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { @@ -334,7 +335,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
334 } 335 }
335 }; 336 };
336 337
337 - let data = _.cloneDeep(treeData); 338 + let data = cloneDeep(treeData);
338 // Find dragObject 339 // Find dragObject
339 let dragObj: ParamDesignModel; 340 let dragObj: ParamDesignModel;
340 loop(data, dragKey, (item, index, arr) => { 341 loop(data, dragKey, (item, index, arr) => {
@@ -525,8 +526,8 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { @@ -525,8 +526,8 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
525 // return undefined; 526 // return undefined;
526 // }; 527 // };
527 528
528 - const changeField = (val: string, data: amy) => {  
529 - const _newData = _.cloneDeep(treeData); 529 + const changeField = (val: any, data: any) => {
  530 + const _newData = cloneDeep(treeData);
530 const _qxProps = {}; 531 const _qxProps = {};
531 532
532 const loopChangeTree = (treeList: ParamDesignModel[]) => { 533 const loopChangeTree = (treeList: ParamDesignModel[]) => {
@@ -543,8 +544,8 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { @@ -543,8 +544,8 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
543 treeList[i].mappingValues = [val[0].value]; 544 treeList[i].mappingValues = [val[0].value];
544 } 545 }
545 return; 546 return;
546 - } else if (treeList[i].child) {  
547 - loopChangeTree(treeList[i].child); 547 + } else if (!!treeList[i]?.child?.length) {
  548 + loopChangeTree(treeList[i].child || []);
548 } 549 }
549 } 550 }
550 }; 551 };
@@ -663,13 +664,11 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { @@ -663,13 +664,11 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
663 <Dropdown 664 <Dropdown
664 trigger={['click']} 665 trigger={['click']}
665 className={'hidden-select'} 666 className={'hidden-select'}
666 - overlay={  
667 - <Menu  
668 - items={valueOptions}  
669 - className={'dropdown'}  
670 - onClick={onSelect}  
671 - />  
672 - } 667 + menu={{
  668 + items: valueOptions,
  669 + className: 'dropdown',
  670 + onClick: onSelect
  671 + }}
673 > 672 >
674 <Button type={'link'}> 673 <Button type={'link'}>
675 <PlusOutlined /> 674 <PlusOutlined />
@@ -690,7 +689,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => { @@ -690,7 +689,7 @@ export const QxParameterSetting: React.FC<ParameterSettingProps> = (props) => {
690 <Input 689 <Input
691 className={'qx-parameter-setting--search'} 690 className={'qx-parameter-setting--search'}
692 placeholder="按名称搜索" 691 placeholder="按名称搜索"
693 - prefix={<SearchOutlined />} 692 + prefix={<QxBaseIcon type={'icon-app-search-line'} />}
694 onChange={onChange} 693 onChange={onChange}
695 /> 694 />
696 )} 695 )}
  1 +@import '~@qx/ui/src/style/variable.less';
  2 +
1 /* stylelint-disable declaration-block-no-redundant-longhand-properties */ 3 /* stylelint-disable declaration-block-no-redundant-longhand-properties */
2 .border-none .ant-select:not(.ant-select-customize-input) .ant-select-selector { 4 .border-none .ant-select:not(.ant-select-customize-input) .ant-select-selector {
3 border: none; 5 border: none;
@@ -10,22 +12,6 @@ @@ -10,22 +12,6 @@
10 flex-direction: row-reverse; 12 flex-direction: row-reverse;
11 flex-wrap: nowrap; 13 flex-wrap: nowrap;
12 justify-content: space-between; 14 justify-content: space-between;
13 - // flex-shrink:0;  
14 - // min-height: 32px;  
15 - // padding: 1px;  
16 - // position: 'relative', display: 'flex', flexWrap: 'wrap'  
17 -  
18 - // > .ant-tag {  
19 - // margin: 3px;  
20 -  
21 - // &:first-child {  
22 - // margin-left: 10px;  
23 - // }  
24 -  
25 - // ~ .qx-tags-input__box {  
26 - // padding-left: 5px;  
27 - // }  
28 - // }  
29 } 15 }
30 16
31 .tree-wrapper { 17 .tree-wrapper {
@@ -36,7 +22,7 @@ @@ -36,7 +22,7 @@
36 border-radius: 4px; 22 border-radius: 4px;
37 23
38 &:hover { 24 &:hover {
39 - background-color: #f4f4f5; 25 + background-color: @N3;
40 } 26 }
41 } 27 }
42 28
@@ -49,24 +35,6 @@ @@ -49,24 +35,6 @@
49 } 35 }
50 } 36 }
51 37
52 -// .ant-tree-node-selected:hover ~ .ant-tree-treenode:hover{  
53 -// background-color: #bae7ff !important;  
54 -// }  
55 -  
56 -// .ant-tree-node-content-wrapper :hover ~ .ant-tree-treenode{  
57 -// // background-color: #F4F4F5;  
58 -// // padding-top: 4px;  
59 -// }  
60 -  
61 -// .tree-list :hover{  
62 -// background-color: #ff72;  
63 -// }  
64 -  
65 -// .ant-tree .ant-tree-treenode :hover{  
66 -// background-color: #00f;  
67 -// border-radius:4px;  
68 -// }  
69 -  
70 .border-none 38 .border-none
71 .ant-select-focused:not(.ant-select-disabled).ant-select:not( 39 .ant-select-focused:not(.ant-select-disabled).ant-select:not(
72 .ant-select-customize-input 40 .ant-select-customize-input
@@ -98,7 +66,7 @@ @@ -98,7 +66,7 @@
98 color: #666; 66 color: #666;
99 67
100 &:hover { 68 &:hover {
101 - color: red; 69 + color: @E3;
102 opacity: 1; 70 opacity: 1;
103 } 71 }
104 } 72 }
@@ -131,7 +99,7 @@ @@ -131,7 +99,7 @@
131 // min-width: 100px; 99 // min-width: 100px;
132 margin-bottom: 2px; 100 margin-bottom: 2px;
133 overflow: hidden; 101 overflow: hidden;
134 - text-overflow: ellipsi; 102 + text-overflow: ellipsis;
135 } 103 }
136 104
137 .opt-left-down { 105 .opt-left-down {
@@ -145,7 +113,7 @@ @@ -145,7 +113,7 @@
145 margin-top: 2px; 113 margin-top: 2px;
146 margin-bottom: 2px; 114 margin-bottom: 2px;
147 overflow: hidden; 115 overflow: hidden;
148 - text-overflow: ellipsi; 116 + text-overflow: ellipsis;
149 } 117 }
150 118
151 // .ant-tree-node-content-wrapper :hover .select-tree { 119 // .ant-tree-node-content-wrapper :hover .select-tree {
@@ -237,13 +205,13 @@ @@ -237,13 +205,13 @@
237 205
238 .btn-high-del { 206 .btn-high-del {
239 &:hover { 207 &:hover {
240 - color: red !important; 208 + color: @E3 !important;
241 } 209 }
242 } 210 }
243 211
244 .editable-row:hover .editable-cell-value-wrap { 212 .editable-row:hover .editable-cell-value-wrap {
245 padding: 4px 11px; 213 padding: 4px 11px;
246 - border: 1px solid #d9d9d9; 214 + border: 1px solid @N4;
247 border-radius: 2px; 215 border-radius: 2px;
248 } 216 }
249 217
@@ -306,41 +274,6 @@ @@ -306,41 +274,6 @@
306 text-align: center !important; 274 text-align: center !important;
307 } 275 }
308 276
309 -//TODO 写法不行  
310 -// #root .hidden-select {  
311 -// .ant-select-tree  
312 -// .ant-select-tree-node-content-wrapper.ant-select-tree-node-selected {  
313 -// // background-color: #bae7ff;  
314 -// background-color: @primary-2;  
315 -// }  
316 -// }  
317 -// .ant-form-item  
318 -// .qx-parameter-setting__tree-list {  
319 -// .ant-tree-draggable-icon {  
320 -// line-height: 32px;  
321 -// }  
322 -  
323 -// &.ant-tree  
324 -// .ant-tree-treenode:not(.ant-tree-treenode-disabled)  
325 -// .ant-tree-node-content-wrapper {  
326 -// border-radius: 4px;  
327 -  
328 -// &.ant-tree-node-selected {  
329 -// background-color: transparent;  
330 -// }  
331 -  
332 -// &:hover,  
333 -// &.ant-tree-node-selected:hover {  
334 -// background-color: @N3;  
335 -// // opacity: 1 !important;  
336 -// // background-color: #91d5ff;  
337 -// }  
338 -// }  
339 -// }  
340 -  
341 -// .ant-form-item{  
342 -// margin-bottom: 0;  
343 -// }  
344 277
345 .json-editor { 278 .json-editor {
346 width: 90%; 279 width: 90%;
@@ -2,8 +2,8 @@ import * as React from 'react'; @@ -2,8 +2,8 @@ import * as React from 'react';
2 import { useCallback, useEffect, useImperativeHandle, useState } from 'react'; 2 import { useCallback, useEffect, useImperativeHandle, useState } from 'react';
3 import { Checkbox, Empty, Input, Spin } from 'antd'; 3 import { Checkbox, Empty, Input, Spin } from 'antd';
4 import { getPositions } from './service'; 4 import { getPositions } from './service';
5 -import _ from 'lodash';  
6 -import { SearchOutlined } from '@ant-design/icons'; 5 +import { cloneDeep } from 'lodash-es';
  6 +import {QxBaseIcon} from '@qx/common';
7 import Menu from 'antd/es/menu'; 7 import Menu from 'antd/es/menu';
8 8
9 type PosCoreProps = { 9 type PosCoreProps = {
@@ -143,7 +143,7 @@ const PosCore: React.FC<PosCoreProps> = (props) => { @@ -143,7 +143,7 @@ const PosCore: React.FC<PosCoreProps> = (props) => {
143 }; 143 };
144 144
145 if (data) { 145 if (data) {
146 - const _data = _.cloneDeep(data); 146 + const _data = cloneDeep(data);
147 _data.forEach((item) => { 147 _data.forEach((item) => {
148 traverse(item); 148 traverse(item);
149 }); 149 });
@@ -186,7 +186,7 @@ const PosCore: React.FC<PosCoreProps> = (props) => { @@ -186,7 +186,7 @@ const PosCore: React.FC<PosCoreProps> = (props) => {
186 className={'qx-selector-sub-search'} 186 className={'qx-selector-sub-search'}
187 placeholder={props.placeholder || '请输入岗位名称,按回车键搜索'} 187 placeholder={props.placeholder || '请输入岗位名称,按回车键搜索'}
188 allowClear 188 allowClear
189 - prefix={<SearchOutlined />} 189 + prefix={<QxBaseIcon type={'icon-app-search-line'} />}
190 onChange={(e) => { 190 onChange={(e) => {
191 handleChange(e); 191 handleChange(e);
192 }} 192 }}
@@ -52,7 +52,7 @@ const PosSelectorDialog: React.FC<PosSelectorDialogProps> = (props) => { @@ -52,7 +52,7 @@ const PosSelectorDialog: React.FC<PosSelectorDialogProps> = (props) => {
52 <Modal 52 <Modal
53 title={props.title || '选择岗位'} 53 title={props.title || '选择岗位'}
54 width={560} 54 width={560}
55 - visible={props.visible} 55 + open={props.visible}
56 className={'qx-pos-selector__dialog'} 56 className={'qx-pos-selector__dialog'}
57 onOk={handleOk} 57 onOk={handleOk}
58 onCancel={handleCancel} 58 onCancel={handleCancel}
@@ -32,7 +32,7 @@ const QxPosSelector: React.FC<QxPosSelectorProps> = (props) => { @@ -32,7 +32,7 @@ const QxPosSelector: React.FC<QxPosSelectorProps> = (props) => {
32 }, []); 32 }, []);
33 33
34 // getUserList() 34 // getUserList()
35 - const handleOk = (keys: [], data: []) => { 35 + const handleOk = (keys: [], data: any[]) => {
36 let _value: [] | string = keys; 36 let _value: [] | string = keys;
37 if (!props.multiple && keys && keys.length > 0) { 37 if (!props.multiple && keys && keys.length > 0) {
38 // @ts-ignore 38 // @ts-ignore
  1 +@import '~@qx/ui/src/style/variable.less';
  2 +
1 .qx-pos-selector__dialog { 3 .qx-pos-selector__dialog {
2 //.ant-popover-arrow { 4 //.ant-popover-arrow {
3 // display: none; 5 // display: none;
@@ -27,7 +29,7 @@ @@ -27,7 +29,7 @@
27 height: 60px; 29 height: 60px;
28 padding: 5px; 30 padding: 5px;
29 overflow: auto; 31 overflow: auto;
30 - border-bottom: 1px solid #f0f0f0; 32 + border-bottom: 1px solid @N4;
31 33
32 .ant-tag { 34 .ant-tag {
33 margin: 1px 2px; 35 margin: 1px 2px;
@@ -85,7 +85,7 @@ const QxPagination: React.FC<QxPaginationProps> = (props) => { @@ -85,7 +85,7 @@ const QxPagination: React.FC<QxPaginationProps> = (props) => {
85 <Popover 85 <Popover
86 overlayClassName={'qx-pagination__overlay'} 86 overlayClassName={'qx-pagination__overlay'}
87 content={pageContent} 87 content={pageContent}
88 - trigger={total === 0 ? '' : 'click'} 88 + trigger={total === 0 ? undefined : 'click'}
89 placement={'bottom'} 89 placement={'bottom'}
90 > 90 >
91 <li className={'ant-pagination-simple-pager'}> 91 <li className={'ant-pagination-simple-pager'}>
  1 +@import '~@qx/ui/src/style/variable.less';
  2 +
1 .qx-pagination { 3 .qx-pagination {
2 > .anticon { 4 > .anticon {
3 - color: rgba(0, 0, 0, 0.25); 5 + color: @N7;
4 } 6 }
5 7
6 .ant-pagination-simple-pager { 8 .ant-pagination-simple-pager {
7 cursor: pointer; 9 cursor: pointer;
8 10
9 &:hover { 11 &:hover {
10 - color: #007ef3; 12 + color: @B8;
11 } 13 }
12 } 14 }
13 } 15 }
@@ -2,9 +2,7 @@ import * as React from 'react'; @@ -2,9 +2,7 @@ import * as React from 'react';
2 import { useCallback, useEffect, useState } from 'react'; 2 import { useCallback, useEffect, useState } from 'react';
3 import { Empty, Input, Spin} from 'antd'; 3 import { Empty, Input, Spin} from 'antd';
4 import { getAllRole } from '../service'; 4 import { getAllRole } from '../service';
5 -import {  
6 - SearchOutlined,  
7 -} from '@ant-design/icons'; 5 +import {QxBaseIcon} from '@qx/common';
8 import Menu from 'antd/es/menu'; 6 import Menu from 'antd/es/menu';
9 7
10 type RoleProps = { 8 type RoleProps = {
@@ -188,7 +186,7 @@ const Role: React.FC<RoleProps> = (props) => { @@ -188,7 +186,7 @@ const Role: React.FC<RoleProps> = (props) => {
188 className={'qx-selector-sub-search'} 186 className={'qx-selector-sub-search'}
189 placeholder={props.placeholder || '请输入角色名称,按回车键搜索'} 187 placeholder={props.placeholder || '请输入角色名称,按回车键搜索'}
190 allowClear 188 allowClear
191 - prefix={<SearchOutlined />} 189 + prefix={<QxBaseIcon type={'icon-app-search-line'} />}
192 onChange={(e) => { 190 onChange={(e) => {
193 handleChange(e); 191 handleChange(e);
194 }} 192 }}
@@ -6,7 +6,7 @@ import { Checkbox, Empty, Input, Spin } from 'antd'; @@ -6,7 +6,7 @@ import { Checkbox, Empty, Input, Spin } from 'antd';
6 // import { InputRef } from 'antd/es/input'; 6 // import { InputRef } from 'antd/es/input';
7 import QxPagination from './qx-pagination'; 7 import QxPagination from './qx-pagination';
8 import type { CheckboxChangeEvent } from 'antd/es/checkbox'; 8 import type { CheckboxChangeEvent } from 'antd/es/checkbox';
9 -import { SearchOutlined } from '@ant-design/icons'; 9 +import {QxBaseIcon} from '@qx/common';
10 // import type { InputRef } from 'antd/lib/input'; 10 // import type { InputRef } from 'antd/lib/input';
11 11
12 type UserItem = { id: string; name: string; code: string; relName?: string }; 12 type UserItem = { id: string; name: string; code: string; relName?: string };
@@ -202,7 +202,7 @@ const UserList: React.FC<UserListProps> = (props) => { @@ -202,7 +202,7 @@ const UserList: React.FC<UserListProps> = (props) => {
202 }} 202 }}
203 onChange={(e) => handleChange(e)} 203 onChange={(e) => handleChange(e)}
204 allowClear 204 allowClear
205 - prefix={<SearchOutlined style={{ color: 'rgba(0,0,0,.45)' }} />} 205 + prefix={<QxBaseIcon style={{ color: 'rgba(0,0,0,.45)' }} type={'icon-app-search-line'} />}
206 /> 206 />
207 </div> 207 </div>
208 <QxPagination 208 <QxPagination
@@ -222,7 +222,7 @@ const UserSelectorDialog: React.FC<UserSelectorDialogProps> = (props) => { @@ -222,7 +222,7 @@ const UserSelectorDialog: React.FC<UserSelectorDialogProps> = (props) => {
222 <Modal 222 <Modal
223 title={dialogTitle} 223 title={dialogTitle}
224 width={700} 224 width={700}
225 - visible={props.visible} 225 + open={props.visible}
226 className={'qx-user-selector__dialog'} 226 className={'qx-user-selector__dialog'}
227 onOk={handleOk} 227 onOk={handleOk}
228 onCancel={handleCancel} 228 onCancel={handleCancel}
@@ -6,7 +6,7 @@ import './style.less'; @@ -6,7 +6,7 @@ import './style.less';
6 import type { UserItem } from './dialog'; 6 import type { UserItem } from './dialog';
7 import UserSelectorDialog from './dialog'; 7 import UserSelectorDialog from './dialog';
8 import { searchUserByAllType, SearchUserAllData } from './service'; 8 import { searchUserByAllType, SearchUserAllData } from './service';
9 -import _ from 'lodash'; 9 +import { debounce } from 'lodash-es';
10 10
11 export type QxUserSelectorProps = { 11 export type QxUserSelectorProps = {
12 cRef?: any; 12 cRef?: any;
@@ -266,7 +266,7 @@ const QxUserSelector: React.FC<QxUserSelectorProps> = (props) => { @@ -266,7 +266,7 @@ const QxUserSelector: React.FC<QxUserSelectorProps> = (props) => {
266 } 266 }
267 }, [popVisible]); 267 }, [popVisible]);
268 268
269 - const handleSearch = _.debounce((_keywords: string | undefined) => { 269 + const handleSearch = debounce((_keywords: string | undefined) => {
270 if (!_keywords) { 270 if (!_keywords) {
271 setUserList(null); 271 setUserList(null);
272 return; 272 return;
@@ -384,12 +384,12 @@ const QxUserSelector: React.FC<QxUserSelectorProps> = (props) => { @@ -384,12 +384,12 @@ const QxUserSelector: React.FC<QxUserSelectorProps> = (props) => {
384 <Popover 384 <Popover
385 content={userDropContent} 385 content={userDropContent}
386 placement={'bottom'} 386 placement={'bottom'}
387 - visible={ 387 + open={
388 ((props?.params?.range || !userId) && !userList) || props.readOnly ? false : popVisible 388 ((props?.params?.range || !userId) && !userList) || props.readOnly ? false : popVisible
389 } 389 }
390 trigger={'click'} 390 trigger={'click'}
391 overlayClassName={'qx-user-selector--input__pop'} 391 overlayClassName={'qx-user-selector--input__pop'}
392 - onVisibleChange={(v: boolean) => setPopVisible(v)} 392 + onOpenChange={(v: boolean) => setPopVisible(v)}
393 > 393 >
394 <div 394 <div
395 className={ 395 className={
  1 +@import '~@qx/ui/src/style/variable.less';
  2 +
1 .qx-user-input__box { 3 .qx-user-input__box {
2 padding-left: 0; 4 padding-left: 0;
3 background-color: transparent; 5 background-color: transparent;
@@ -100,7 +102,7 @@ @@ -100,7 +102,7 @@
100 color: #999; 102 color: #999;
101 font-weight: normal; 103 font-weight: normal;
102 font-size: 14px; 104 font-size: 14px;
103 - border-bottom: 1px solid #efefef; 105 + border-bottom: 1px solid @N4;
104 &:first-child { 106 &:first-child {
105 margin-top: 0; 107 margin-top: 0;
106 } 108 }
@@ -114,41 +116,41 @@ @@ -114,41 +116,41 @@
114 cursor: pointer; 116 cursor: pointer;
115 &.qx-user-selector-more { 117 &.qx-user-selector-more {
116 margin-top: 5px; 118 margin-top: 5px;
117 - color: #4ba9ff; 119 + color: @B8;
118 &:hover { 120 &:hover {
119 - color: #4ba9ff; 121 + color: @B7;
120 } 122 }
121 } 123 }
122 &.disabled { 124 &.disabled {
123 - color: #ccc; 125 + color: @N5;
124 cursor: default; 126 cursor: default;
125 &:hover { 127 &:hover {
126 - color: #ccc; 128 + color: @N5;
127 } 129 }
128 .qx-user-selector-code { 130 .qx-user-selector-code {
129 - color: #ccc; 131 + color: @N5;
130 } 132 }
131 } 133 }
132 134
133 &:hover { 135 &:hover {
134 - color: #000;  
135 - background-color: #fafafa; 136 + color: @N9;
  137 + background-color: @N2;
136 } 138 }
137 &.qx-user-selector-pop-empty { 139 &.qx-user-selector-pop-empty {
138 padding: 10px; 140 padding: 10px;
139 - color: #aaa; 141 + color: @N5;
140 text-align: center; 142 text-align: center;
141 - background-color: #fbfbfb; 143 + background-color: @N2;
142 cursor: default; 144 cursor: default;
143 &:hover { 145 &:hover {
144 - color: #aaa; 146 + color: @N5;
145 } 147 }
146 } 148 }
147 } 149 }
148 } 150 }
149 151
150 .qx-user-selector-code { 152 .qx-user-selector-code {
151 - color: rgb(102, 102, 102); 153 + color: @N7;
152 } 154 }
153 .qx-user-selector__dialog { 155 .qx-user-selector__dialog {
154 .ant-modal-body { 156 .ant-modal-body {
@@ -183,7 +185,7 @@ @@ -183,7 +185,7 @@
183 height: 60px; 185 height: 60px;
184 padding: 5px; 186 padding: 5px;
185 overflow: auto; 187 overflow: auto;
186 - border-bottom: 1px solid #f0f0f0; 188 + border-bottom: 1px solid @N4;
187 189
188 .ant-tag { 190 .ant-tag {
189 margin: 1px 2px; 191 margin: 1px 2px;
@@ -198,7 +200,7 @@ @@ -198,7 +200,7 @@
198 .qx-user-selector__left { 200 .qx-user-selector__left {
199 height: @contentHeight; 201 height: @contentHeight;
200 overflow: hidden; 202 overflow: hidden;
201 - border-right: 1px solid #f0f0f0; 203 + border-right: 1px solid @N4;
202 204
203 .qx-user-selector__collapse { 205 .qx-user-selector__collapse {
204 border: none; 206 border: none;
@@ -211,11 +213,11 @@ @@ -211,11 +213,11 @@
211 } 213 }
212 214
213 .ant-collapse-content { 215 .ant-collapse-content {
214 - border-color: #f0f0f0; 216 + border-color: @N4;
215 } 217 }
216 218
217 .ant-collapse > .ant-collapse-item { 219 .ant-collapse > .ant-collapse-item {
218 - border-color: #f0f0f0; 220 + border-color: @N4;
219 } 221 }
220 } 222 }
221 223
@@ -223,7 +225,7 @@ @@ -223,7 +225,7 @@
223 display: flex; 225 display: flex;
224 flex-direction: column; 226 flex-direction: column;
225 height: @contentHeight; 227 height: @contentHeight;
226 - border-left: 1px solid #f0f0f0; 228 + border-left: 1px solid @N4;
227 border-left: none; 229 border-left: none;
228 230
229 &__header { 231 &__header {
@@ -232,7 +234,7 @@ @@ -232,7 +234,7 @@
232 justify-content: space-between; 234 justify-content: space-between;
233 height: 40px; 235 height: 40px;
234 padding: 0 10px; 236 padding: 0 10px;
235 - border-bottom: 1px solid #f0f0f0; 237 + border-bottom: 1px solid @N4;
236 238
237 .ant-checkbox-wrapper { 239 .ant-checkbox-wrapper {
238 white-space: nowrap; 240 white-space: nowrap;
@@ -260,13 +262,13 @@ @@ -260,13 +262,13 @@
260 .ant-table-pagination.ant-pagination { 262 .ant-table-pagination.ant-pagination {
261 margin: 0; 263 margin: 0;
262 padding: 11px; 264 padding: 11px;
263 - border-top: 1px solid #f0f0f0; 265 + border-top: 1px solid @N4;
264 } 266 }
265 } 267 }
266 268
267 .qx-user-selector__user-search { 269 .qx-user-selector__user-search {
268 padding: 7px 10px; 270 padding: 7px 10px;
269 - border-bottom: 1px solid #f0f0f0; 271 + border-bottom: 1px solid @N4;
270 } 272 }
271 273
272 .qx-selector-tab { 274 .qx-selector-tab {
@@ -339,7 +341,7 @@ @@ -339,7 +341,7 @@
339 cursor: pointer; 341 cursor: pointer;
340 342
341 &:hover { 343 &:hover {
342 - background-color: #fafafa; 344 + background-color: @N2;
343 } 345 }
344 346
345 .ant-checkbox-wrapper, 347 .ant-checkbox-wrapper,