diff --git a/Cunkebao/dist/.vite/manifest.json b/Cunkebao/dist/.vite/manifest.json index 48503171..84b25020 100644 --- a/Cunkebao/dist/.vite/manifest.json +++ b/Cunkebao/dist/.vite/manifest.json @@ -33,7 +33,7 @@ "name": "vendor" }, "index.html": { - "file": "assets/index-Bx3nG52V.js", + "file": "assets/index-Czxez1-3.js", "name": "index", "src": "index.html", "isEntry": true, diff --git a/Cunkebao/dist/index.html b/Cunkebao/dist/index.html index 0e38d6c1..6e11cb6c 100644 --- a/Cunkebao/dist/index.html +++ b/Cunkebao/dist/index.html @@ -11,7 +11,7 @@ - + diff --git a/Cunkebao/src/pages/mobile/workspace/traffic-distribution/form/index.tsx b/Cunkebao/src/pages/mobile/workspace/traffic-distribution/form/index.tsx index b94b4214..02fbb104 100644 --- a/Cunkebao/src/pages/mobile/workspace/traffic-distribution/form/index.tsx +++ b/Cunkebao/src/pages/mobile/workspace/traffic-distribution/form/index.tsx @@ -19,18 +19,6 @@ import { import type { TrafficDistributionFormData } from "./data"; import dayjs from "dayjs"; -// const scenarioList = [...]; -const poolList = [ - { - id: "pool-1", - name: "高价值客户池", - userCount: 156, - tags: ["高价值", "优先添加"], - }, - { id: "pool-2", name: "潜在客户池", userCount: 289, tags: ["潜在客户"] }, - { id: "pool-3", name: "新用户池", userCount: 432, tags: ["新用户"] }, -]; - const stepList = [ { id: 1, title: "基本信息", subtitle: "基本信息" }, { id: 2, title: "目标设置", subtitle: "目标设置" }, @@ -57,14 +45,9 @@ const TrafficDistributionForm: React.FC = () => { const [loading, setLoading] = useState(false); const [detailLoading, setDetailLoading] = useState(false); - const [selectedPools, setSelectedPools] = useState([]); const [poolGroupsOptions, setPoolGroupsOptions] = useState< PoolSelectionItem[] >([]); - const [poolSearch, setPoolSearch] = useState(""); - const [targetSelectionTab, setTargetSelectionTab] = useState< - "device" | "account" - >("device"); // 编辑时的详情数据(不需要保存整份数据,仅回填表单与本地状态) @@ -122,8 +105,7 @@ const TrafficDistributionForm: React.FC = () => { form.setFieldsValue({ timeRange: [startTime, endTime] }); } - // 设置流量池 - setSelectedPools(config.pools.map((pool: any) => pool.id || pool)); + // 设置流量池 - 交由 PoolSelection 控件受控 } catch (error) { console.error("获取详情失败:", error); message.error("获取详情失败"); @@ -142,11 +124,15 @@ const TrafficDistributionForm: React.FC = () => { form.submit(); }; - // 移除未使用的 handleFinish3 - const handleFinish2 = async (values?: any) => { setLoading(true); try { + // 校验流量池至少选择一个 + if (!poolGroupsOptions || poolGroupsOptions.length === 0) { + message.error("请至少选择一个流量池"); + setLoading(false); + return; + } // 如果没有传递values参数,从表单中获取 const formValues = values || form.getFieldsValue(); @@ -168,9 +154,9 @@ const TrafficDistributionForm: React.FC = () => { formValues.timeType === 2 && formValues.timeRange?.[1] ? formValues.timeRange[1].format("HH:mm") : "", - deviceGroups: deviceGroups, + deviceGroups: deviceGroupsOptions.map(v => v.id), deviceGroupsOptions: deviceGroupsOptions, - accountGroups: accountGroups, + accountGroups: accountGroupsOptions.map(v => v.id), accountGroupsOptions: accountGroupsOptions, pools: poolGroupsOptions.map(v => v.id), enabled: true, @@ -208,10 +194,8 @@ const TrafficDistributionForm: React.FC = () => { // 第二步:目标设置至少需要选择设备或客服之一 const hasDevice = Array.isArray(selectedDevices) && selectedDevices.length > 0; - const hasAccount = - Array.isArray(selectedAccounts) && selectedAccounts.length > 0; - if (!hasDevice && !hasAccount) { - message.error("请至少选择一个设备或一个客服"); + if (!hasDevice) { + message.error("请至少选择一个设备"); return; } setCurrent(cur => cur + 1); @@ -221,9 +205,6 @@ const TrafficDistributionForm: React.FC = () => { }; const prev = () => setCurrent(cur => cur - 1); - // 过滤流量池 - const filteredPools = poolList.filter(pool => pool.name.includes(poolSearch)); - const handPoolAction = params => { setPoolGroupsOptions(params); }; @@ -355,107 +336,40 @@ const TrafficDistributionForm: React.FC = () => { /> )} + +
客服选择
+
+ { + setAccountGroupsOptions(accounts); + }} + placeholder="请选择客服" + showSelectedList={true} + selectedListMaxHeight={300} + accountGroups={accountGroups} + /> +
{current === 1 && (
目标设置
- - {/* Tab 切换 */} -
-
-
setTargetSelectionTab("device")} - > - 设备选择 -
-
setTargetSelectionTab("account")} - > - 客服选择 -
-
-
- - {/* Tab 内容 */} -
- {targetSelectionTab === "device" && ( -
- { - setSelectedDevices(devices); - setDeviceGroupsOptions(devices); - }} - placeholder="请选择设备" - showSelectedList={true} - selectedListMaxHeight={300} - deviceGroups={deviceGroups} - /> -
- )} - {targetSelectionTab === "account" && ( -
- { - setSelectedAccounts(accounts); - setAccountGroupsOptions(accounts); - }} - placeholder="请选择客服" - showSelectedList={true} - selectedListMaxHeight={300} - accountGroups={accountGroups} - /> -
- )} +
+ { + setSelectedDevices(devices); + setDeviceGroupsOptions(devices); + }} + placeholder="请选择设备" + showSelectedList={true} + selectedListMaxHeight={300} + deviceGroups={deviceGroups} + />
)} {current === 2 && ( - //
- //
流量池选择
- //
- // setPoolSearch(e.target.value)} - // style={{ marginBottom: 12 }} - // /> - //
- // {filteredPools.map(pool => ( - // - // ))} - //
- //
- // 已选流量池:{selectedPools.length} 个 - //
- //
- //