|
@@ -13,13 +13,13 @@ import {
|
|
|
LockIcon,
|
|
LockIcon,
|
|
|
UnLockIcon,
|
|
UnLockIcon,
|
|
|
} from "../../../assets/icon";
|
|
} from "../../../assets/icon";
|
|
|
-import { UploadFile } from "antd/es/upload/interface";
|
|
|
|
|
-import { IAttachmentRequest, IAttachmentResponse } from "../../api/Attachments";
|
|
|
|
|
|
|
+import { IAttachmentRequest } from "../../api/Attachments";
|
|
|
import WbwDetailAttachment from "./WbwDetailAttachment";
|
|
import WbwDetailAttachment from "./WbwDetailAttachment";
|
|
|
import CommentBox from "../../discussion/DiscussionDrawer";
|
|
import CommentBox from "../../discussion/DiscussionDrawer";
|
|
|
|
|
|
|
|
interface IWidget {
|
|
interface IWidget {
|
|
|
data: IWbw;
|
|
data: IWbw;
|
|
|
|
|
+ visible?: boolean;
|
|
|
onClose?: Function;
|
|
onClose?: Function;
|
|
|
onSave?: Function;
|
|
onSave?: Function;
|
|
|
onCommentCountChange?: Function;
|
|
onCommentCountChange?: Function;
|
|
@@ -27,6 +27,7 @@ interface IWidget {
|
|
|
}
|
|
}
|
|
|
const WbwDetailWidget = ({
|
|
const WbwDetailWidget = ({
|
|
|
data,
|
|
data,
|
|
|
|
|
+ visible = true,
|
|
|
onClose,
|
|
onClose,
|
|
|
onSave,
|
|
onSave,
|
|
|
onCommentCountChange,
|
|
onCommentCountChange,
|
|
@@ -36,6 +37,8 @@ const WbwDetailWidget = ({
|
|
|
const [currWbwData, setCurrWbwData] = useState<IWbw>(
|
|
const [currWbwData, setCurrWbwData] = useState<IWbw>(
|
|
|
JSON.parse(JSON.stringify(data))
|
|
JSON.parse(JSON.stringify(data))
|
|
|
);
|
|
);
|
|
|
|
|
+ const [tabKey, setTabKey] = useState<string>("basic");
|
|
|
|
|
+
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
setCurrWbwData(JSON.parse(JSON.stringify(data)));
|
|
setCurrWbwData(JSON.parse(JSON.stringify(data)));
|
|
|
}, [data]);
|
|
}, [data]);
|
|
@@ -125,25 +128,27 @@ const WbwDetailWidget = ({
|
|
|
/>
|
|
/>
|
|
|
) : undefined
|
|
) : undefined
|
|
|
}
|
|
}
|
|
|
|
|
+ onChange={(activeKey: string) => {
|
|
|
|
|
+ setTabKey(activeKey);
|
|
|
|
|
+ }}
|
|
|
items={[
|
|
items={[
|
|
|
{
|
|
{
|
|
|
label: intl.formatMessage({ id: "buttons.basic" }),
|
|
label: intl.formatMessage({ id: "buttons.basic" }),
|
|
|
key: "basic",
|
|
key: "basic",
|
|
|
children: (
|
|
children: (
|
|
|
- <div>
|
|
|
|
|
- <WbwDetailBasic
|
|
|
|
|
- data={currWbwData}
|
|
|
|
|
- onChange={(e: IWbwField) => {
|
|
|
|
|
- console.log("WbwDetailBasic onchange", e);
|
|
|
|
|
- fieldChanged(e.field, e.value);
|
|
|
|
|
- }}
|
|
|
|
|
- onRelationAdd={() => {
|
|
|
|
|
- if (typeof onClose !== "undefined") {
|
|
|
|
|
- onClose();
|
|
|
|
|
- }
|
|
|
|
|
- }}
|
|
|
|
|
- />
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <WbwDetailBasic
|
|
|
|
|
+ visible={visible && tabKey === "basic"}
|
|
|
|
|
+ data={currWbwData}
|
|
|
|
|
+ onChange={(e: IWbwField) => {
|
|
|
|
|
+ console.log("WbwDetailBasic onchange", e);
|
|
|
|
|
+ fieldChanged(e.field, e.value);
|
|
|
|
|
+ }}
|
|
|
|
|
+ onRelationAdd={() => {
|
|
|
|
|
+ if (typeof onClose !== "undefined") {
|
|
|
|
|
+ onClose();
|
|
|
|
|
+ }
|
|
|
|
|
+ }}
|
|
|
|
|
+ />
|
|
|
),
|
|
),
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|