|
@@ -4,6 +4,7 @@ import { strategyType } from ".";
|
|
|
import { FieldTimeOutlined } from "@ant-design/icons";
|
|
|
import { useAjax } from "@/Hook/useAjax";
|
|
|
import { StrategyProps, modalStrategyApi } from "@/services/gameData/roleOperate";
|
|
|
+import { getRoleUserListApi } from "@/services/gameData";
|
|
|
|
|
|
export enum conditionEnum {
|
|
|
gt = '大于',
|
|
@@ -30,9 +31,26 @@ const StrategyModal: React.FC<Props> = ({ superGameList, initialValues, visible,
|
|
|
const amount = Form.useWatch('amount', form)
|
|
|
const amountCondition = Form.useWatch('amountCondition', form)
|
|
|
const [help, setHelp] = useState<string>()
|
|
|
+ const [operateList, setOperateList] = useState<any[]>([])
|
|
|
const modalStrategy = useAjax((params) => modalStrategyApi(params))
|
|
|
+ const getRoleUserList = useAjax((params) => getRoleUserListApi(params))
|
|
|
/*****************************/
|
|
|
|
|
|
+ useEffect(() => {
|
|
|
+ const getList = async () => {
|
|
|
+ let data = []
|
|
|
+ // 运营
|
|
|
+ let operate = await getRoleUserList.run({ authType: 'OPERATE' })
|
|
|
+ data = operate ? Object.keys(operate)?.map(key => ({ userId: key, nickname: operate[key] })) : []
|
|
|
+ // 客服
|
|
|
+ let customer = await getRoleUserList.run({ authType: 'CUSTOMER' })
|
|
|
+ let c = customer ? Object.keys(customer)?.map(key => ({ userId: key, nickname: customer[key] })) : []
|
|
|
+ data.concat(c)
|
|
|
+ setOperateList(data)
|
|
|
+ }
|
|
|
+ getList()
|
|
|
+ }, [])
|
|
|
+
|
|
|
useEffect(() => {
|
|
|
if (type) {
|
|
|
let timeTips: string = ''
|
|
@@ -69,8 +87,6 @@ const StrategyModal: React.FC<Props> = ({ superGameList, initialValues, visible,
|
|
|
}
|
|
|
}, [type, time, amount, timeCondition, amountCondition])
|
|
|
|
|
|
- console.log('---->', help)
|
|
|
-
|
|
|
const handleOk = async () => {
|
|
|
form.submit()
|
|
|
let data = await form.validateFields()
|
|
@@ -123,8 +139,8 @@ const StrategyModal: React.FC<Props> = ({ superGameList, initialValues, visible,
|
|
|
>
|
|
|
<Form
|
|
|
name="basicStrategy"
|
|
|
- labelCol={{ span: 4 }}
|
|
|
- wrapperCol={{ span: 20 }}
|
|
|
+ labelCol={{ span: 5 }}
|
|
|
+ wrapperCol={{ span: 19 }}
|
|
|
form={form}
|
|
|
autoComplete="off"
|
|
|
labelAlign="left"
|
|
@@ -156,6 +172,38 @@ const StrategyModal: React.FC<Props> = ({ superGameList, initialValues, visible,
|
|
|
{strategyType?.map((item: any) => <Select.Option value={item.value} key={item.value}>{item.label}</Select.Option>)}
|
|
|
</Select>
|
|
|
</Form.Item>
|
|
|
+ <Form.Item label="告警人员" name='userIds' rules={[{ required: true, message: '请选择告警人员!' }]}>
|
|
|
+ <Select
|
|
|
+ maxTagCount={4}
|
|
|
+ showSearch
|
|
|
+ mode="multiple"
|
|
|
+ style={{ minWidth: 140 }}
|
|
|
+ allowClear
|
|
|
+ loading={getRoleUserList.loading}
|
|
|
+ placeholder={'请选择告警人员'}
|
|
|
+ filterOption={(input, option) =>
|
|
|
+ (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
+ }
|
|
|
+ >
|
|
|
+ {operateList.map((item: any) => <Select.Option value={item.userId} key={item.userId}>{item.nickname}</Select.Option>)}
|
|
|
+ </Select>
|
|
|
+ </Form.Item>
|
|
|
+ <Form.Item label="排除指标标签" name='tagIds'>
|
|
|
+ <Select
|
|
|
+ maxTagCount={1}
|
|
|
+ showSearch
|
|
|
+ mode="multiple"
|
|
|
+ style={{ minWidth: 140 }}
|
|
|
+ allowClear
|
|
|
+ placeholder={'请选择排除指标标签'}
|
|
|
+ filterOption={(input, option) =>
|
|
|
+ (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
+ }
|
|
|
+ >
|
|
|
+ <Select.Option value={1}>已退游</Select.Option>
|
|
|
+ <Select.Option value={2}>已添加企微</Select.Option>
|
|
|
+ </Select>
|
|
|
+ </Form.Item>
|
|
|
<Form.Item
|
|
|
label="金额(元)"
|
|
|
>
|
|
@@ -232,7 +280,7 @@ const StrategyModal: React.FC<Props> = ({ superGameList, initialValues, visible,
|
|
|
<Input.TextArea placeholder="请输入备注" />
|
|
|
</Form.Item>
|
|
|
<Form.Item label="策略说明">
|
|
|
- <Input.TextArea value={help} disabled placeholder="策略说明"/>
|
|
|
+ <Input.TextArea value={help} disabled placeholder="策略说明" />
|
|
|
</Form.Item>
|
|
|
</Form>
|
|
|
</Modal>
|