This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react' | |
import { Modal } from 'antd' | |
function useAntModal (initVisibleState = false) { | |
const [visible, setVisible] = useState(initVisibleState) | |
const handleCancel = ({ onCancel }) => { | |
onCancel && onCancel() | |
setVisible(false) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useRef, useLayoutEffect } from 'react' | |
import PropTypes from 'prop-types' | |
import { message } from 'antd' | |
import ClipboardJS from 'clipboard' | |
function Copy (props) { | |
const copyCtrl = useRef(null) | |
useLayoutEffect(() => { | |
const clipboard = new ClipboardJS(copyCtrl.current) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
option = { | |
"title": { | |
"text": "品牌流动关系" | |
}, | |
"tooltip": { | |
"trigger": "item", | |
"triggerOn": "mousemove", | |
formatter: (params) => { | |
const { name, data } = params | |
if (name === '苹果') { // 此样例centerNode为'苹果' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
option = { | |
"title": { | |
"text": "品牌流动关系" | |
}, | |
"color": [ | |
"#3583FF", | |
"#FB7962", | |
"#A5D33E", | |
"#FFCD3A", | |
"#68A2FF", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"title": { | |
"text": "品牌流动关系" | |
}, | |
"color": [ | |
"#3583FF", | |
"#FB7962", | |
"#A5D33E", | |
"#FFCD3A", | |
"#68A2FF", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
option = { | |
"title": { | |
"text": "品牌流动关系" | |
}, | |
"color": [ | |
"#3583FF", | |
"#FB7962", | |
"#A5D33E", | |
"#FFCD3A", | |
"#68A2FF", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
option = { | |
"title": { | |
"text": "品牌流动关系" | |
}, | |
"color": [ | |
"#3583FF", | |
"#FB7962", | |
"#A5D33E", | |
"#FFCD3A", | |
"#68A2FF", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const floatToPercent = (value) => { | |
if (isNaN(value)) return value | |
return `${Number(value * 100).toFixed(2)}%` | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const formatBigIntNum = (value) => { | |
if (isNaN(value)) return value | |
const isInteger = Math.floor(value) === value | |
return isInteger ? | |
String(value).replace(/(?=(\B\d{3})+$)/g, ',') : | |
value | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const value2TimeFormat = (value) => { | |
return moment.utc().startOf('day').second(parseInt(value)).format('HH:mm:ss') | |
} |
NewerOlder