diff --git a/src/mobile/quotation/detailNew.jsx b/src/mobile/quotation/detailNew.jsx
index 062d723..4e70e34 100644
--- a/src/mobile/quotation/detailNew.jsx
+++ b/src/mobile/quotation/detailNew.jsx
@@ -1,6 +1,6 @@
import { useRef, useEffect, useState, useCallback, useMemo } from "react";
import { history } from "umi";
-import { Toast, Input, Tabs, Selector, Grid, Image, Button, Checkbox, Switch, Dialog, Radio, Space } from "antd-mobile";
+import { Toast, Input, Tabs, Selector, Grid, Image, Button, Checkbox, Switch, Dialog, Radio, Space, CenterPopup } from "antd-mobile";
import { AddOutline, MinusOutline, EditFill, CloseOutline } from "antd-mobile-icons";
import commonConfig from "@/utils/config";
import * as commonServices from "@/services/services";
@@ -1171,11 +1171,11 @@ const MasterComponent = props => {
const QuotationTabs = props => {
const { state } = props;
const { selectedNode } = state;
- const sAllPartsName = selectedNode?.sAllPartsName;
- const sAllPartsNameList = sAllPartsName?.split(",");
- // sAllPartsNameList.push('+')
- const [activeKey, setActiveKey] = useState(sAllPartsNameList && sAllPartsNameList.length ? sAllPartsNameList[0] : null);
-
+ const [sAllPartsNameList, setSAllPartsNameList] = useState(selectedNode?.sAllPartsName?.split(",") || []);
+ const [activeKey, setActiveKey] = useState(sAllPartsNameList.length ? sAllPartsNameList[0] : null);
+ const [visible, setVisible] = useState(false);
+ const [value, setValue] = useState("");
+ const partsList = selectedNode?.sAllPartsName?.split(",");
useEffect(() => {
// 更新父组件的状态
props.setState(pre => ({ ...pre, boxModel: activeKey }));
@@ -1185,6 +1185,15 @@ const QuotationTabs = props => {
...props,
boxModel: activeKey,
};
+
+ // 处理添加新标签的逻辑
+ const handleAdd = () => {
+ // 弹窗
+ setVisible(true);
+ // const newSAllPartsNameList = [...sAllPartsNameList, '111']; // 创建一个新的数组,包含新增的元素
+ // setSAllPartsNameList(newSAllPartsNameList); // 更新状态,触发组件重新渲染
+ };
+
return (
@@ -1194,25 +1203,91 @@ const QuotationTabs = props => {
setActiveKey(key);
}}
>
- {sAllPartsNameList && sAllPartsNameList.length
+ {sAllPartsNameList.length
? sAllPartsNameList.map((pane, index) => (
-
-
- {/* */}
-
+ <>
+
+ {pane}
+ {partsList.includes(pane) ? (
+ ""
+ ) : (
+ {
+ const newTabs = sAllPartsNameList.filter(panes => panes !== pane);
+ setSAllPartsNameList(newTabs);
+ // 如果删除的是当前活动的 Tab,选择新的活动 Tab
+ setActiveKey(0);
+ }}
+ />
+ )}
+
+ }
+ >
+
+
+ >
))
: ""}
- {/*
*/}
+
+
{
+ // setVisible(false);
+ // }}
+ >
+
+
请输入新标签名称:
+
{
+ setValue(val);
+ }}
+ />
+
+
+
+
+
+
);
diff --git a/src/mobile/quotation/quotationDetail.css b/src/mobile/quotation/quotationDetail.css
index 6cf6a23..85ba57a 100644
--- a/src/mobile/quotation/quotationDetail.css
+++ b/src/mobile/quotation/quotationDetail.css
@@ -140,3 +140,22 @@
right: 0;
top: 0;
}
+.tabsBox .tabTitle {
+ display: flex;
+ align-items: center;
+ position: relative;
+}
+.addTabs {
+ height: 12rem;
+ padding: 1rem;
+ position: relative;
+}
+.addTabs :global .adm-input-element {
+ height: 3rem;
+ border: 1px solid #dededf;
+}
+.addTabs .addTabsBtn {
+ position: absolute;
+ right: 5%;
+ bottom: 10%;
+}
diff --git a/src/mobile/quotation/quotationDetail.less b/src/mobile/quotation/quotationDetail.less
index cce9dec..24989a4 100644
--- a/src/mobile/quotation/quotationDetail.less
+++ b/src/mobile/quotation/quotationDetail.less
@@ -148,4 +148,23 @@
right: 0;
top: 0;
}
+ .tabTitle{
+ display: flex;
+ align-items: center;
+ position: relative;
+ }
}
+.addTabs{
+ height: 12rem;
+ padding: 1rem;
+ position: relative;
+ :global .adm-input-element{
+ height: 3rem;
+ border: 1px solid #dededf;
+ }
+ .addTabsBtn{
+ position: absolute;
+ right: 5%;
+ bottom: 10%;
+ }
+}
\ No newline at end of file