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
71883822
Commit
71883822
authored
Nov 12, 2021
by
秦文海
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复发布main入口
parent
976ef1a4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
158 additions
and
145 deletions
+158
-145
package.json
package.json
+1
-0
.fatherrc.js
packages/base-components/TipTool/.fatherrc.js
+13
-0
package.json
packages/base-components/TipTool/package.json
+3
-3
index.js
packages/base-components/TipTool/src/index.js
+141
-1
index123.js
packages/base-components/TipTool/src/index123.js
+0
-141
No files found.
package.json
View file @
71883822
...
...
@@ -15,6 +15,7 @@
"lint:prettier"
:
"npm run prettier && git diff && prettier --version && prettier --check
\"
packages/**/**.{js,jsx,tsx,ts,less,md,json}
\"
--end-of-line auto"
,
"prettier"
:
"prettier --write
\"
**/**.{js,jsx,tsx,ts,less,md,json}
\"
"
,
"release"
:
"node ./scripts/release.js --skipBuild"
,
"release-skipBuild"
:
"node ./scripts/release.js --skipBuild"
,
"size:build"
:
"cross-env PRO_COMPONENTS_CI='CI' webpack"
,
"start"
:
"dumi dev"
,
"site"
:
"dumi build"
,
...
...
packages/base-components/TipTool/.fatherrc.js
0 → 100644
View file @
71883822
import
{
readdirSync
}
from
'fs'
;
import
{
join
}
from
'path'
;
export
default
{
cjs
:
{
type
:
'babel'
,
lazy
:
true
},
esm
:
{
type
:
'babel'
,
importLibToEs
:
true
,
},
extraBabelPlugins
:
[
[
'babel-plugin-import'
,
{
libraryName
:
'antd'
,
libraryDirectory
:
'es'
,
style
:
true
},
'antd'
],
],
};
packages/base-components/TipTool/package.json
View file @
71883822
...
...
@@ -5,8 +5,8 @@
"author"
:
"qinwenhai <939637841@qq.com>"
,
"homepage"
:
""
,
"license"
:
"ISC"
,
"main"
:
"
dist/TipTool
.js"
,
"module"
:
"
dist/TipTool
.js"
,
"main"
:
"
lib/index
.js"
,
"module"
:
"
es/index
.js"
,
"directories"
:
{
"lib"
:
"lib"
,
"test"
:
"__tests__"
...
...
@@ -23,7 +23,7 @@
},
"scripts"
:
{
"test"
:
"echo
\"
Error: run tests from root
\"
&& exit 1"
,
"build"
:
"
BUILD_TYPE=lib father-build && cross-env BUILD_TYPE=es
father-build"
"build"
:
"father-build"
},
"dependencies"
:
{
"lodash"
:
"^4.17.21"
...
...
packages/base-components/TipTool/src/index.js
View file @
71883822
console
.
log
(
123456
);
import
React
,
{
useState
,
useContext
}
from
'react'
;
import
classNames
from
'classnames'
;
import
{
ConfigProvider
}
from
'antd'
;
import
{
Header
}
from
'./header'
;
import
{
LeftList
}
from
'./leftList'
;
import
_
from
'lodash'
;
import
'./index.less'
;
const
TipTool
=
(
props
)
=>
{
const
{
style
}
=
props
;
const
{
leftSetting
,
headerSetting
,
events
}
=
props
.
dataList
;
const
{
getPrefixCls
}
=
useContext
(
ConfigProvider
.
ConfigContext
);
const
prefixCls
=
getPrefixCls
(
'panda-gis-tip'
);
const
data
=
[
{
name
:
'middle'
,
width
:
style
.
minWidth
??
'200px'
,
height
:
style
.
minHeight
??
'40px'
,
active
:
true
,
},
{
name
:
'large'
,
width
:
style
.
maxWidth
??
'200px'
,
height
:
style
.
maxHeight
??
'40px'
,
active
:
false
,
},
];
const
scale
=
{
name
:
'small'
,
width
:
'200px'
,
height
:
'40px'
,
active
:
true
,
};
const
[
styleState
,
setStyleState
]
=
useState
(
data
);
const
[
styleScale
,
setScaleState
]
=
useState
(
scale
);
const
changeStyle
=
({
name
,
flag
})
=>
{
let
data
=
styleState
.
slice
();
data
.
map
((
item
)
=>
{
if
(
name
==
item
.
name
)
{
item
.
active
=
true
;
}
else
{
item
.
active
=
false
;
}
});
setStyleState
(
data
);
};
const
changeScale
=
(
flag
)
=>
{
let
obj
=
{
...
styleScale
};
obj
.
active
=
flag
;
setScaleState
(
obj
);
};
const
computedStyle
=
()
=>
{
if
(
!
styleScale
.
active
)
{
return
{
width
:
styleScale
.
width
,
height
:
styleScale
.
height
};
}
else
{
return
styleState
.
filter
((
item
)
=>
item
.
active
)
.
map
(({
width
,
height
})
=>
{
return
{
width
,
height
};
})[
0
];
}
};
const
displayComput
=
()
=>
{
if
(
styleScale
.
active
)
{
return
{
display
:
'inline-block'
};
}
else
{
return
{
display
:
'none'
};
}
};
return
(
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-Tipwripconter`
)}
style
=
{
computedStyle
()}
>
<
Header
headerSetting
=
{
headerSetting
}
events
=
{
events
}
changeStyle
=
{
changeStyle
}
changeScale
=
{
changeScale
}
/
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-TipAll`
)}
style
=
{
displayComput
()}
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-Tipconter`
)}
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-Tipleft`
)}
>
<
LeftList
leftSetting
=
{
leftSetting
}
/
>
<
/div
>
<
/div
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-tipfooter`
)}
><
/div
>
<
/div
>
<
/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/index123.js
deleted
100644 → 0
View file @
976ef1a4
import
React
,
{
useState
,
useContext
}
from
'react'
;
import
classNames
from
'classnames'
;
import
{
ConfigProvider
}
from
'antd'
;
import
{
Header
}
from
'./header'
;
import
{
LeftList
}
from
'./leftList'
;
import
_
from
'lodash'
;
import
'./index.less'
;
const
TipTool
=
(
props
)
=>
{
const
{
style
}
=
props
;
const
{
leftSetting
,
headerSetting
,
events
}
=
props
.
dataList
;
const
{
getPrefixCls
}
=
useContext
(
ConfigProvider
.
ConfigContext
);
const
prefixCls
=
getPrefixCls
(
'panda-gis-tip'
);
const
data
=
[
{
name
:
'middle'
,
width
:
style
.
minWidth
??
'200px'
,
height
:
style
.
minHeight
??
'40px'
,
active
:
true
,
},
{
name
:
'large'
,
width
:
style
.
maxWidth
??
'200px'
,
height
:
style
.
maxHeight
??
'40px'
,
active
:
false
,
},
];
const
scale
=
{
name
:
'small'
,
width
:
'200px'
,
height
:
'40px'
,
active
:
true
,
};
const
[
styleState
,
setStyleState
]
=
useState
(
data
);
const
[
styleScale
,
setScaleState
]
=
useState
(
scale
);
const
changeStyle
=
({
name
,
flag
})
=>
{
let
data
=
styleState
.
slice
();
data
.
map
((
item
)
=>
{
if
(
name
==
item
.
name
)
{
item
.
active
=
true
;
}
else
{
item
.
active
=
false
;
}
});
setStyleState
(
data
);
};
const
changeScale
=
(
flag
)
=>
{
let
obj
=
{
...
styleScale
};
obj
.
active
=
flag
;
setScaleState
(
obj
);
};
const
computedStyle
=
()
=>
{
if
(
!
styleScale
.
active
)
{
return
{
width
:
styleScale
.
width
,
height
:
styleScale
.
height
};
}
else
{
return
styleState
.
filter
((
item
)
=>
item
.
active
)
.
map
(({
width
,
height
})
=>
{
return
{
width
,
height
};
})[
0
];
}
};
const
displayComput
=
()
=>
{
if
(
styleScale
.
active
)
{
return
{
display
:
'inline-block'
};
}
else
{
return
{
display
:
'none'
};
}
};
return
(
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-Tipwripconter`
)}
style
=
{
computedStyle
()}
>
<
Header
headerSetting
=
{
headerSetting
}
events
=
{
events
}
changeStyle
=
{
changeStyle
}
changeScale
=
{
changeScale
}
/
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-TipAll`
)}
style
=
{
displayComput
()}
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-Tipconter`
)}
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-Tipleft`
)}
>
<
LeftList
leftSetting
=
{
leftSetting
}
/
>
<
/div
>
<
/div
>
<
div
className
=
{
classNames
(
`
${
prefixCls
}
-tipfooter`
)}
><
/div
>
<
/div
>
<
/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
;
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