|
@@ -1,4 +1,4 @@
|
|
|
-import { useState, useEffect, useMemo } from "react";
|
|
|
+import { useState } from "react";
|
|
|
import { View } from "@tarojs/components";
|
|
|
import Taro, { useRouter } from "@tarojs/taro";
|
|
|
import PageCustom from "@/components/page-custom/index";
|
|
@@ -20,6 +20,7 @@ import IconMoreBlack from "@/components/icon/IconMoreBlack";
|
|
|
import PopupSheets from "@/components/popup/popup-sheets";
|
|
|
import { EComponentType } from "@/consts/enum";
|
|
|
import { useComponentStore } from "@/store/componentStore";
|
|
|
+import { useAgentStore } from "@/store/agentStore";
|
|
|
|
|
|
export default function Index() {
|
|
|
const { saveComponent } = useComponentStore();
|
|
@@ -27,8 +28,9 @@ export default function Index() {
|
|
|
const loading = useComponentStore((state) => state.loading);
|
|
|
const prevData = currentComponent?.data.values ?? []
|
|
|
const [picked, setPicked] = useState<(TContactItem|TAgent)[]>(prevData);
|
|
|
- const [agents, setAgents] = useState<TAgent[]>(prevData);
|
|
|
+ const [agents, setAgents] = useState<(TContactItem|TAgent)[]>(prevData);
|
|
|
const [current, setCurrent] = useState<(TContactItem|TAgent)|null>(null);
|
|
|
+ const agent = useAgentStore((state)=> state.agent)
|
|
|
|
|
|
// 是否显示选择器
|
|
|
const [show, setShow] = useState(false);
|
|
@@ -91,7 +93,9 @@ export default function Index() {
|
|
|
}
|
|
|
|
|
|
setShowPopupSheets(false)
|
|
|
- setPicked(picked.filter(item => item.agentId !== current.agentId))
|
|
|
+ const restAgent = picked.filter(item => item.agentId !== current.agentId);
|
|
|
+ setPicked(restAgent)
|
|
|
+ setAgents(restAgent)
|
|
|
setCurrent(null)
|
|
|
}
|
|
|
|
|
@@ -134,9 +138,17 @@ export default function Index() {
|
|
|
};
|
|
|
|
|
|
|
|
|
+ const colleagues = {
|
|
|
+ key: "3",
|
|
|
+ label: "企业同事",
|
|
|
+ children: (
|
|
|
+ <View className={style.tabContainer}>
|
|
|
+ <MyEntAgentsScrollList selected={agents} setSelected={setAgents}></MyEntAgentsScrollList>
|
|
|
+ </View>
|
|
|
+ ),
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- const tabList = [
|
|
|
+ const tabsBaseList = [
|
|
|
{
|
|
|
key: "1",
|
|
|
label: "我创建的",
|
|
@@ -155,17 +167,11 @@ export default function Index() {
|
|
|
</View>
|
|
|
),
|
|
|
},
|
|
|
- {
|
|
|
- key: "3",
|
|
|
- label: "企业同事",
|
|
|
- children: (
|
|
|
- <View className={style.tabContainer}>
|
|
|
- <MyEntAgentsScrollList selected={agents} setSelected={setAgents}></MyEntAgentsScrollList>
|
|
|
- </View>
|
|
|
- ),
|
|
|
- },
|
|
|
- ];
|
|
|
+ ]
|
|
|
+
|
|
|
+ const tabList = agent?.isEnt ? [...tabsBaseList, colleagues] : tabsBaseList;
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -181,7 +187,7 @@ export default function Index() {
|
|
|
onClick={handleClick}
|
|
|
></ButtonCardAdd>
|
|
|
|
|
|
- <View className="pt-24">
|
|
|
+ <View className="pt-24 pb-162">
|
|
|
{renderContactList()}
|
|
|
</View>
|
|
|
</View>
|