Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wisdom-components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
wisdom-components
Commits
50833df6
Commit
50833df6
authored
Nov 11, 2021
by
秦文海
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复引入问题
parent
59946673
Pipeline
#37614
passed with stages
in 5 minutes 26 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
49 deletions
+47
-49
index.js
packages/base-components/TipTool/src/demos/index.js
+0
-48
index.js
packages/base-components/TipTool/src/index.js
+46
-0
index.js
packages/base-components/TipTool/src/tableContent/index.js
+1
-1
No files found.
packages/base-components/TipTool/src/demos/index.js
View file @
50833df6
...
...
@@ -679,51 +679,3 @@ export default () => {
<
/div
>
);
};
//分类可见与不可见属性的数组
export
const
getVisibleAttribues
=
function
(
attribuesArr
,
fields
)
{
var
attrs
=
[];
fields
.
forEach
(
function
(
item
,
i
,
arr
)
{
attribuesArr
.
forEach
(
function
(
attr
,
index
)
{
if
(
i
==
0
)
{
attrs
[
index
]
=
{
show
:
{},
hide
:
{},
fields
:
[],
};
}
// 属性值
var
attrValue
=
attr
[
item
.
name
];
if
(
_
.
isUndefined
(
attrValue
)
||
_
.
isNull
(
attrValue
))
{
attrValue
=
''
;
}
// 界面展示值-处理后的
var
handleValue
=
attrValue
;
if
(
handleValue
==
''
)
{
handleValue
=
'--'
;
}
if
(
item
.
visible
)
{
attrs
[
index
][
'show'
][
item
.
alias
]
=
[
attrValue
,
handleValue
,
item
.
name
,
item
];
attrs
[
index
][
'fields'
].
push
(
item
.
alias
);
}
else
{
attrs
[
index
][
'hide'
][
item
.
alias
]
=
attrValue
;
}
});
});
attrsFieldHandle
(
attrs
);
return
attrs
;
};
//字段类型读取
function
attrsFieldHandle
(
attrs
)
{
attrs
.
forEach
((
item
)
=>
{
var
showFieldObj
=
item
[
'show'
];
for
(
var
k
in
showFieldObj
)
{
var
testField
=
showFieldObj
[
k
][
0
];
if
(
typeof
testField
==
'number'
)
{
if
(
Number
.
isInteger
(
testField
))
showFieldObj
[
k
][
1
]
=
testField
;
else
showFieldObj
[
k
][
1
]
=
Number
(
testField
.
toFixed
(
3
));
}
}
});
}
packages/base-components/TipTool/src/index.js
View file @
50833df6
...
...
@@ -88,5 +88,51 @@ const TipTool = (props) => {
<
/div
>
);
};
//分类可见与不可见属性的数组
export
const
getVisibleAttribues
=
function
(
attribuesArr
,
fields
)
{
var
attrs
=
[];
fields
.
forEach
(
function
(
item
,
i
,
arr
)
{
attribuesArr
.
forEach
(
function
(
attr
,
index
)
{
if
(
i
==
0
)
{
attrs
[
index
]
=
{
show
:
{},
hide
:
{},
fields
:
[],
};
}
// 属性值
var
attrValue
=
attr
[
item
.
name
];
if
(
_
.
isUndefined
(
attrValue
)
||
_
.
isNull
(
attrValue
))
{
attrValue
=
''
;
}
// 界面展示值-处理后的
var
handleValue
=
attrValue
;
if
(
handleValue
==
''
)
{
handleValue
=
'--'
;
}
if
(
item
.
visible
)
{
attrs
[
index
][
'show'
][
item
.
alias
]
=
[
attrValue
,
handleValue
,
item
.
name
,
item
];
attrs
[
index
][
'fields'
].
push
(
item
.
alias
);
}
else
{
attrs
[
index
][
'hide'
][
item
.
alias
]
=
attrValue
;
}
});
});
attrsFieldHandle
(
attrs
);
return
attrs
;
};
//字段类型读取
function
attrsFieldHandle
(
attrs
)
{
attrs
.
forEach
((
item
)
=>
{
var
showFieldObj
=
item
[
'show'
];
for
(
var
k
in
showFieldObj
)
{
var
testField
=
showFieldObj
[
k
][
0
];
if
(
typeof
testField
==
'number'
)
{
if
(
Number
.
isInteger
(
testField
))
showFieldObj
[
k
][
1
]
=
testField
;
else
showFieldObj
[
k
][
1
]
=
Number
(
testField
.
toFixed
(
3
));
}
}
});
}
export
default
TipTool
;
packages/base-components/TipTool/src/tableContent/index.js
View file @
50833df6
import
'./index.less'
;
import
{
getVisibleAttribues
}
from
'../
demos
'
;
import
{
getVisibleAttribues
}
from
'../
index
'
;
import
classNames
from
'classnames'
;
import
{
ConfigProvider
}
from
'antd'
;
import
React
,
{
useContext
}
from
'react'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment