|
@@ -1,20 +1,18 @@
|
|
import * as React from "react";
|
|
import * as React from "react";
|
|
|
|
+import { useState } from "react";
|
|
import {
|
|
import {
|
|
FolderRegular,
|
|
FolderRegular,
|
|
- EditRegular,
|
|
|
|
- OpenRegular,
|
|
|
|
DocumentRegular,
|
|
DocumentRegular,
|
|
- PeopleRegular,
|
|
|
|
DocumentPdfRegular,
|
|
DocumentPdfRegular,
|
|
VideoRegular,
|
|
VideoRegular,
|
|
ChevronDown16Filled,
|
|
ChevronDown16Filled,
|
|
TextField16Regular,
|
|
TextField16Regular,
|
|
Calendar16Regular,
|
|
Calendar16Regular,
|
|
SelectAllOn16Regular,
|
|
SelectAllOn16Regular,
|
|
|
|
+ CommentAdd16Regular,
|
|
|
|
+ MoreHorizontal16Filled,
|
|
} from "@fluentui/react-icons";
|
|
} from "@fluentui/react-icons";
|
|
import {
|
|
import {
|
|
- PresenceBadgeStatus,
|
|
|
|
- Avatar,
|
|
|
|
DataGridBody,
|
|
DataGridBody,
|
|
DataGridRow,
|
|
DataGridRow,
|
|
DataGrid,
|
|
DataGrid,
|
|
@@ -30,7 +28,7 @@ import {
|
|
MenuList,
|
|
MenuList,
|
|
MenuItem,
|
|
MenuItem,
|
|
MenuPopover,
|
|
MenuPopover,
|
|
- Text,
|
|
|
|
|
|
+ Tooltip,
|
|
} from "@fluentui/react-components";
|
|
} from "@fluentui/react-components";
|
|
|
|
|
|
const items = [
|
|
const items = [
|
|
@@ -91,7 +89,7 @@ const columns = [
|
|
);
|
|
);
|
|
},
|
|
},
|
|
renderCell: (item) => {
|
|
renderCell: (item) => {
|
|
- return item.姓名.label;
|
|
|
|
|
|
+ return ChangeBtnShowType(item);
|
|
},
|
|
},
|
|
}),
|
|
}),
|
|
createTableColumn({
|
|
createTableColumn({
|
|
@@ -200,6 +198,53 @@ const columns = [
|
|
}),
|
|
}),
|
|
];
|
|
];
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * 鼠标移动到姓名列上时,显示两个按钮
|
|
|
|
+ * @param item 包含姓名标签的对象
|
|
|
|
+ * @returns 返回 JSX 元素
|
|
|
|
+ */
|
|
|
|
+const ChangeBtnShowType = (item) => {
|
|
|
|
+ const [showButton, setShowButton] = useState(false);
|
|
|
|
+ const handleMouseEnter = () => {
|
|
|
|
+ setShowButton(true);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ const handleMouseLeave = () => {
|
|
|
|
+ setShowButton(false);
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ return (
|
|
|
|
+ <div
|
|
|
|
+ style={{
|
|
|
|
+ width: "100%",
|
|
|
|
+ display: "flex",
|
|
|
|
+ justifyContent: "space-between",
|
|
|
|
+ alignItems: "center",
|
|
|
|
+ }}
|
|
|
|
+ onMouseEnter={handleMouseEnter}
|
|
|
|
+ onMouseLeave={handleMouseLeave}
|
|
|
|
+ >
|
|
|
|
+ {item.姓名.label}
|
|
|
|
+ {showButton && (
|
|
|
|
+ <div>
|
|
|
|
+ <Tooltip content="更多操作" positioning="below">
|
|
|
|
+ <Button
|
|
|
|
+ appearance="subtle"
|
|
|
|
+ icon={<MoreHorizontal16Filled />}
|
|
|
|
+ onclick={() => {
|
|
|
|
+ alert("更多操作");
|
|
|
|
+ }}
|
|
|
|
+ ></Button>
|
|
|
|
+ </Tooltip>
|
|
|
|
+ <Tooltip content="添加注释" positioning="below">
|
|
|
|
+ <Button appearance="subtle" icon={<CommentAdd16Regular />}></Button>
|
|
|
|
+ </Tooltip>
|
|
|
|
+ </div>
|
|
|
|
+ )}
|
|
|
|
+ </div>
|
|
|
|
+ );
|
|
|
|
+};
|
|
|
|
+
|
|
const List = () => {
|
|
const List = () => {
|
|
const defaultSelectedItems = React.useMemo(() => new Set([1]), []);
|
|
const defaultSelectedItems = React.useMemo(() => new Set([1]), []);
|
|
|
|
|