wjx 7 місяців тому
батько
коміт
d09d700a53
30 змінених файлів з 1792 додано та 235 видалено
  1. 12 0
      config/routerConfig.ts
  2. 2 3
      package.json
  3. 2 2
      src/components/Cropper/index.tsx
  4. 2 2
      src/components/CropperImg/index.tsx
  5. 5 5
      src/components/CustomList/index.tsx
  6. 18 39
      src/components/RightContent/AvatarDropdown.tsx
  7. 19 19
      src/global.less
  8. 38 0
      src/pages/iaaSystem/manage/application/delApp.tsx
  9. 119 0
      src/pages/iaaSystem/manage/application/index.tsx
  10. 151 0
      src/pages/iaaSystem/manage/application/modalApp.tsx
  11. 83 0
      src/pages/iaaSystem/manage/application/tableConfig.tsx
  12. 53 36
      src/pages/iaaSystem/manage/backPolicy/index.tsx
  13. 78 0
      src/pages/iaaSystem/manage/backPolicy/modalBackPolicy.tsx
  14. 39 18
      src/pages/iaaSystem/manage/backPolicy/tableConfig.tsx
  15. 40 0
      src/pages/iaaSystem/manage/channel/cancelBackPolicy.tsx
  16. 67 0
      src/pages/iaaSystem/manage/channel/configBackPolicy.tsx
  17. 66 0
      src/pages/iaaSystem/manage/channel/configPutStatus.tsx
  18. 167 92
      src/pages/iaaSystem/manage/channel/index.tsx
  19. 139 0
      src/pages/iaaSystem/manage/channel/modalChannel.tsx
  20. 147 0
      src/pages/iaaSystem/manage/channel/tableConfig.tsx
  21. 38 0
      src/pages/iaaSystem/manage/power/delPower.tsx
  22. 122 0
      src/pages/iaaSystem/manage/power/index.tsx
  23. 86 0
      src/pages/iaaSystem/manage/power/modalPower.tsx
  24. 75 0
      src/pages/iaaSystem/manage/power/tableConfig.tsx
  25. 84 0
      src/services/iaaSystem/application.ts
  26. 10 0
      src/services/iaaSystem/index.ts
  27. 73 0
      src/services/iaaSystem/power.ts
  28. 31 2
      src/services/iaaSystem/typings.d.ts
  29. 5 0
      src/services/operating/account.ts
  30. 21 17
      src/services/user.ts

+ 12 - 0
config/routerConfig.ts

@@ -92,6 +92,18 @@ const iaaSystem = {
             name: 'IAA后台管理',
             access: 'manage',
             routes: [
+                {
+                    path: '/iaaSystem/manage/power',
+                    name: '角色分配',
+                    access: 'power',
+                    component: './iaaSystem/manage/power',
+                },
+                {
+                    path: '/iaaSystem/manage/application',
+                    name: '应用管理',
+                    access: 'application',
+                    component: './iaaSystem/manage/application',
+                },
                 {
                     path: '/iaaSystem/manage/channel',
                     name: '渠道管理',

+ 2 - 3
package.json

@@ -50,7 +50,6 @@
   ],
   "dependencies": {
     "@ant-design/icons": "^4.0.0",
-    "@ant-design/pro-components": "^2.7.15",
     "@ant-design/pro-layout": "^6.2.5",
     "@ant-design/pro-table": "^2.4.0",
     "@antv/data-set": "^0.11.5",
@@ -63,7 +62,7 @@
     "@types/sortablejs": "^1.10.6",
     "@types/spark-md5": "^3.0.2",
     "ahooks": "^2.9.1",
-    "antd": "4.20.0",
+    "antd": "4.24.12",
     "antd-img-crop": "^3.13.2",
     "array-move": "^3.0.1",
     "classnames": "^2.2.6",
@@ -136,4 +135,4 @@
   "engines": {
     "node": ">=10.0.0"
   }
-}
+}

+ 2 - 2
src/components/Cropper/index.tsx

@@ -180,7 +180,7 @@ export const Demo = (props: Props) => {
             </Dragger>
         }
         { visible && <Modal
-            visible={visible}
+            open={visible}
             onCancel={cancel}
             width={1000}
             footer={<div style={{ display: 'flex', justifyContent: 'center' }}>
@@ -255,7 +255,7 @@ export const Demo = (props: Props) => {
                                                 disabled={isChangeCropperSize ? isChangeCropperSize : isLaunch ? false : false}
                                                 min={1}
                                                 max={1536}
-                                                onChange={(e) => {setDetail({...detail, height: e})}}
+                                                onChange={(e) => {setDetail({...detail, height: e as number})}}
                                             />
                                             }
                                         </Form.Item>

+ 2 - 2
src/components/CropperImg/index.tsx

@@ -49,7 +49,7 @@ function CropperImg(props: PropsType) {
     }, [visible, cropper])
 
     return <Modal
-        visible={visible}
+        open={visible}
         onCancel={() => { onClose && onClose() }}
         width={1000}
         footer={<div style={{ display: 'flex', justifyContent: 'center' }}>
@@ -127,7 +127,7 @@ function CropperImg(props: PropsType) {
                                                     disabled={isChangeCropperSize ? isChangeCropperSize : false}
                                                     min={1}
                                                     max={1536}
-                                                    onChange={(e) => { setDetail({ ...detail, height: e }) }}
+                                                    onChange={(e) => { setDetail({ ...detail, height: e as number }) }}
                                                 />
                                         }
                                     </Form.Item>

+ 5 - 5
src/components/CustomList/index.tsx

@@ -19,7 +19,7 @@ const SortableItem = SortableElement(({ item, del, setConfig }: any) => {
             <Popover
                 content={
                     <div>
-                        <InputNumber min={0} max={500} onChange={(value: number) => {
+                        <InputNumber min={0} max={500} onChange={(value) => {
                             if (value) {
                                 setWidth(value)
                             }
@@ -144,7 +144,7 @@ function CustomListModel(props: customProps) {
         if (selectData?.length === columns?.length && !selectData?.every((item: any) => item.width)) {
             let newSelectData: any[] = []
             newSelectData = selectData?.map((item: { [x: string]: any }, index: string | number) => {
-                item['width'] = columns[index]['width']
+                item['width'] = columns[index as any]['width']
                 return item
             })
             setSelectData(newSelectData)
@@ -300,7 +300,7 @@ function CustomListModel(props: customProps) {
     return <Modal
         title={null}
         footer={null}
-        visible={visible}
+        open={visible}
         width={1100}
         className='customListModel'
         onCancel={cancel}
@@ -346,8 +346,8 @@ function CustomListModel(props: customProps) {
                     <a onClick={defaultConfig} style={{ marginRight: 30 }}>恢复默认</a>
                 </div>
                 <div style={{ display: 'flex', flexFlow: 'row nowarp', padding: '0 28px', justifyContent: 'space-between' }}>
-                    <div>左侧固定列数:<InputNumber size='small' style={{ width: 50 }} onChange={(value: number) => { changeFixed('left', value) }} value={fixed.left} max={100} min={0} /></div>
-                    <div>右侧固定列数:<InputNumber size='small' style={{ width: 50 }} onChange={(value: number) => { changeFixed('right', value) }} value={fixed.right} max={100} min={0} /></div>
+                    <div>左侧固定列数:<InputNumber size='small' style={{ width: 50 }} onChange={(value) => { changeFixed('left', value as number) }} value={fixed.left} max={100} min={0} /></div>
+                    <div>右侧固定列数:<InputNumber size='small' style={{ width: 50 }} onChange={(value) => { changeFixed('right', value as number) }} value={fixed.right} max={100} min={0} /></div>
                 </div>
                 <SortableList axis='y' onSortEnd={onSortEnd} useDragHandle>
                     {selectData.map((item: dataProps, index: number) => <SortableItem key={'li' + index} index={index} item={item} del={() => { selectHandle(false, item) }} setConfig={setConfig} />)}

+ 18 - 39
src/components/RightContent/AvatarDropdown.tsx

@@ -38,7 +38,7 @@ const loginOut = async () => {
 
 const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
   const { copy } = useCopy()
-  const selectCompany = useAjax((companyId: number) => selectCompanyApi(companyId), { formatResult: true })
+  const selectCompany = useAjax((companyId: number) => selectCompanyApi(companyId))
   const { initialState, setInitialState } = useModel('@@initialState');
   const { modifyPassword } = useModel('useOperating.useUser')
   const [visible, setVisible] = useState<boolean>(false)
@@ -130,44 +130,23 @@ const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
     return loading;
   }
 
+  let items = []
+  if (menu) {
+    items.push({ label: '个人中心', key: 'center', icon: <UserOutlined /> })
+    items.push({ label: '个人设置', key: 'settings', icon: <SettingOutlined /> })
+  }
+  if (currentUser?.powerLevel === 999) {
+    items.push({ label: '管理系统', key: 'admin', icon: <SendOutlined /> })
+  }
+  items.push({ label: '切换公司', key: 'company', icon: <SwapOutlined /> })
+  items.push({ label: '修改密码', key: 'edit', icon: <EditOutlined /> })
+  items.push({ label: '退出登录', key: 'logout', icon: <LogoutOutlined /> })
+
   const menuHeaderDropdown = (
-    <Menu className={styles.menu} selectedKeys={[]} onClick={onMenuClick}>
-      {menu && (
-        <Menu.Item key="center">
-          <UserOutlined />
-          个人中心
-        </Menu.Item>
-      )}
-      {menu && (
-        <Menu.Item key="settings">
-          <SettingOutlined />
-          个人设置
-        </Menu.Item>
-      )}
-      {menu && <Menu.Divider />}
-      {
-        currentUser?.powerLevel === 999 && <Menu.Item key="admin">
-          <SendOutlined />
-          管理系统
-        </Menu.Item>
-      }
-      <Menu.Item key="release">
-        <span role="img" aria-label="fund-view" className="anticon anticon-fund-view"><LaunchSvg /></span>
-        新投放系统
-      </Menu.Item>
-      <Menu.Item key="company">
-        <SwapOutlined />
-        切换公司
-      </Menu.Item>
-      <Menu.Item key="edit">
-        <EditOutlined />
-        修改密码
-      </Menu.Item>
-      <Menu.Item key="logout">
-        <LogoutOutlined />
-        退出登录
-      </Menu.Item>
-    </Menu>
+    <Menu
+      items={items}
+      className={styles.menu} selectedKeys={[]} onClick={onMenuClick}
+    />
   );
 
   // 切换公司
@@ -191,7 +170,7 @@ const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
       </HeaderDropdown>
       <Modal
         title="修改密码"
-        visible={visible}
+        open={visible}
         onOk={submit}
         onCancel={() => setVisible(false)}
       >

+ 19 - 19
src/global.less

@@ -142,23 +142,23 @@ select:-webkit-autofill {
 body {
   #root {
 
-    .ant-table.ant-table-small .ant-table-title,
-    .ant-table.ant-table-middle .ant-table-title,
-    .ant-table.ant-table-small .ant-table-footer,
-    .ant-table.ant-table-middle .ant-table-footer,
-    .ant-table.ant-table-small .ant-table-thead>tr>th,
-    .ant-table.ant-table-middle .ant-table-thead>tr>th,
-    .ant-table.ant-table-small .ant-table-tbody>tr>td,
-    .ant-table.ant-table-middle .ant-table-tbody>tr>td,
-    .ant-table.ant-table-small tfoot>tr>th,
-    .ant-table.ant-table-middle tfoot>tr>th,
-    .ant-table.ant-table-small tfoot>tr>td .ant-table.ant-table-middle tfoot>tr>td {
-      padding: 5px;
-    }
+    // .ant-table.ant-table-small .ant-table-title,
+    // .ant-table.ant-table-middle .ant-table-title,
+    // .ant-table.ant-table-small .ant-table-footer,
+    // .ant-table.ant-table-middle .ant-table-footer,
+    // .ant-table.ant-table-small .ant-table-thead>tr>th,
+    // .ant-table.ant-table-middle .ant-table-thead>tr>th,
+    // .ant-table.ant-table-small .ant-table-tbody>tr>td,
+    // .ant-table.ant-table-middle .ant-table-tbody>tr>td,
+    // .ant-table.ant-table-small tfoot>tr>th,
+    // .ant-table.ant-table-middle tfoot>tr>th,
+    // .ant-table.ant-table-small tfoot>tr>td .ant-table.ant-table-middle tfoot>tr>td {
+    //   padding: 5px;
+    // }
 
-    .ant-table.ant-table-small .ant-table-thead .ant-table-column-sorters {
-      padding: 0;
-    }
+    // .ant-table.ant-table-small .ant-table-thead .ant-table-column-sorters {
+    //   padding: 0;
+    // }
 
     // .ant-table.ant-table-small .ant-table-tbody > tr > td.ant-table-cell {
     //   padding-top: 8px;
@@ -302,9 +302,9 @@ body {
   border-radius: 0 6px 6px 0 !important;
 }
 
-.ant-table-cell {
-  padding: 2px 5px !important;
-}
+// .ant-table-cell {
+//   padding: 2px 5px !important;
+// }
 
 .progress {
   padding: 0 !important;

+ 38 - 0
src/pages/iaaSystem/manage/application/delApp.tsx

@@ -0,0 +1,38 @@
+import { useAjax } from "@/Hook/useAjax"
+import { delAppApi } from "@/services/iaaSystem/application"
+import { Button, Popconfirm } from "antd"
+import React from "react"
+
+interface Props {
+    id: number
+    onChange?: () => void
+}
+
+/**
+ * 删除
+ * @param param0 
+ * @returns 
+ */
+const DelApp: React.FC<Props> = ({ id, onChange }) => {
+
+    /********************************/
+    const delApp = useAjax((params) => delAppApi(params))
+    /********************************/
+
+    const confirm = () => {
+        delApp.run({ id }).then(res => {
+            if (res?.data) {
+                onChange?.()
+            }
+        })
+    }
+
+    return <Popconfirm
+        title="确定删除?"
+        onConfirm={confirm}
+    >
+        <Button type="link" loading={delApp.loading} danger style={{ padding: 0, height: 'auto' }} >删除</Button>
+    </Popconfirm>
+}
+
+export default React.memo(DelApp)

+ 119 - 0
src/pages/iaaSystem/manage/application/index.tsx

@@ -0,0 +1,119 @@
+import { PlusOutlined } from "@ant-design/icons";
+import ProTable, { ActionType } from "@ant-design/pro-table";
+import { Button } from "antd";
+import React, { useEffect, useRef, useState } from "react"
+import tableConfig from "./tableConfig";
+import { useAjax } from "@/Hook/useAjax";
+import { getMenuUserListApi } from "@/services/iaaSystem/power";
+import { getAppAllApi, getAppListApi } from "@/services/iaaSystem/application";
+import { DefaultOptionType } from "antd/lib/select";
+import ModalApp from "./modalApp";
+
+/**
+ * 应用管理
+ * @returns 
+ */
+const Application: React.FC = () => {
+    /*******************************************/
+    const actionRef = useRef<ActionType>();
+    const [visible, setVisible] = useState<boolean>(false)
+    const [initialValues, setInitialValues] = useState<any>()
+    const [appList, setAppList] = useState<DefaultOptionType[]>([])
+    const [appObj, setAppObj] = useState<any>({})
+    const [userList, setUserList] = useState<DefaultOptionType[]>([])
+    const [userObj, setUserObj] = useState<any>({})
+
+
+    const getAppList = useAjax((params) => getAppListApi(params), { type: 'table' })
+    const getMenuUserList = useAjax(() => getMenuUserListApi())
+    const getAppAll = useAjax(() => getAppAllApi())
+    /*******************************************/
+
+    useEffect(() => {
+        getMenuUserList.run().then(res => {
+            if (res?.data) {
+                let newUserList: DefaultOptionType[] = []
+                let newUserObj: any = {}
+                Object.keys(res.data).forEach(key => {
+                    newUserList.push({ label: res.data[key], value: key })
+                    newUserObj[key] = {
+                        text: res.data[key]
+                    }
+                })
+                setUserList(newUserList)
+                setUserObj(newUserObj)
+            }
+        })
+        getAppAll.run().then(res => {
+            if (res?.data) {
+                let newAppList: DefaultOptionType[] = []
+                let newAppObj: any = {}
+                res.data.forEach((item: { name: any; id: any; }) => {
+                    newAppList.push({ label: item.name, value: item.id })
+                    newAppObj[item.id] = {
+                        text: item.name
+                    }
+                })
+                setAppList(newAppList)
+                setAppObj(newAppObj)
+            }
+        })
+    }, [])
+
+    /**
+     * 修改
+     * @param data 
+     */
+    const handleEdit = (data: any) => {
+        console.log(data)
+        setInitialValues(data)
+        setVisible(true)
+    }
+
+    return <>
+        <ProTable<any>
+            columns={tableConfig(handleEdit, userObj, appObj)}
+            actionRef={actionRef}
+            cardBordered
+            request={async (params, sort, filter) => {
+                console.log(sort, filter);
+                return await getAppList.run(params)
+            }}
+            editable={{
+                type: 'multiple',
+            }}
+            rowKey="id"
+            search={{
+                labelWidth: 'auto',
+            }}
+            headerTitle={<strong>应用管理</strong>}
+            toolBarRender={() => [
+                <Button type="primary" onClick={() => {
+                    setVisible(true)
+                }}>
+                    <PlusOutlined />
+                    新建
+                </Button>
+            ]}
+        />
+
+        {/* 新增修改 */}
+        {visible && <ModalApp
+            initialValues={initialValues}
+            appAllList={appList}
+            userList={userList}
+            visible={visible}
+            onChange={() => {
+                setVisible(false)
+                setInitialValues(undefined)
+                actionRef.current?.reload()
+            }}
+            onClose={() => {
+                setVisible(false)
+                setInitialValues(undefined)
+            }}
+        />}
+    </>
+}
+
+export default Application

+ 151 - 0
src/pages/iaaSystem/manage/application/modalApp.tsx

@@ -0,0 +1,151 @@
+import { useAjax } from "@/Hook/useAjax";
+import { addAppApi, updateAppApi } from "@/services/iaaSystem/application";
+import { MinusCircleOutlined, PlusOutlined } from "@ant-design/icons";
+import { Button, Form, message, Modal, Select, Space, Switch } from "antd";
+import { DefaultOptionType } from "antd/lib/select";
+import React from "react"
+
+
+interface Props {
+    appAllList: DefaultOptionType[]
+    userList: DefaultOptionType[]
+    onChange?: () => void
+    visible?: boolean
+    onClose?: () => void
+    initialValues?: any
+}
+
+/**
+ * 新增修改应用权限
+ * @returns 
+ */
+const ModalApp: React.FC<Props> = ({ appAllList, userList, onChange, visible, onClose, initialValues }) => {
+
+    /*******************************/
+    const [form] = Form.useForm();
+
+    console.log(appAllList)
+
+    const addApp = useAjax((params) => addAppApi(params))
+    const updateApp = useAjax((params) => updateAppApi(params))
+    /*******************************/
+
+    const handleOk = async () => {
+        form.submit()
+        let data = await form.validateFields()
+        if (initialValues?.id) {
+            data.id = initialValues?.id
+            updateApp.run(data).then(res => {
+                if (res?.data) {
+                    message.success('修改成功')
+                    onChange && onChange()
+                }
+            })
+        } else {
+            addApp.run(data).then(res => {
+                if (res?.data) {
+                    message.success('新增成功')
+                    onChange && onChange()
+                }
+            })
+        }
+
+    }
+
+    return <Modal
+        title={<strong>{initialValues?.id ? `修改 ${initialValues?.userName} 应用权限` : '新增应用权限'}</strong>}
+        open={visible}
+        onCancel={onClose}
+        onOk={handleOk}
+        confirmLoading={addApp.loading || updateApp.loading}
+    >
+        <Form
+            name="basicApp"
+            layout="vertical"
+            form={form}
+            autoComplete="off"
+            colon={false}
+            initialValues={initialValues ? { ...initialValues } : { authMemberAppList: [{}] }}
+        >
+            {initialValues?.id ? <>
+                <Form.Item
+                    label={<strong>应用</strong>}
+                    name={'iaaAppId'}
+                    rules={[{ required: true, message: '请选选择应用' }]}
+                >
+                    <Select
+                        showSearch
+                        allowClear
+                        placeholder="选择应用"
+                        filterOption={(input, option) =>
+                            (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
+                        }
+                        options={appAllList}
+                    />
+                </Form.Item>
+                <Form.Item
+                    label={<strong>是否包含自然量</strong>}
+                    name={'defaultAgent'}
+                    valuePropName="checked"
+                    initialValue={false}
+                >
+                    <Switch checkedChildren="是" unCheckedChildren="否" />
+                </Form.Item>
+            </> : <>
+                <Form.Item label={<strong>用户</strong>} name="userIdList" rules={[{ required: true, message: '请选择用户!' }]}>
+                    <Select
+                        mode="multiple"
+                        allowClear
+                        placeholder="请选择用户"
+                        options={userList}
+                    />
+                </Form.Item>
+                <Form.List name="authMemberAppList">
+                    {(fields, { add, remove }) => {
+                        return <>
+                            {fields.map(({ key, name, ...restField }) => (
+                                <Space key={key} style={{ display: 'flex', marginBottom: 8, width: '100%' }} align="center">
+                                    <Form.Item
+                                        {...restField}
+                                        label={<strong>应用</strong>}
+                                        name={[name, 'iaaAppId']}
+                                        rules={[{ required: true, message: '请选选择应用' }]}
+                                    >
+                                        <Select
+                                            style={{ width: 300 }}
+                                            showSearch
+                                            allowClear
+                                            placeholder="选择应用"
+                                            filterOption={(input, option) =>
+                                                (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
+                                            }
+                                            options={appAllList}
+                                        />
+                                    </Form.Item>
+                                    <Form.Item
+                                        {...restField}
+                                        label={<strong>是否包含自然量</strong>}
+                                        name={[name, 'defaultAgent']}
+                                        valuePropName="checked"
+                                        initialValue={false}
+                                    >
+                                        <Switch checkedChildren="是" unCheckedChildren="否" />
+                                    </Form.Item>
+                                    <MinusCircleOutlined style={{ color: 'red' }} onClick={() => remove(name)} />
+                                </Space>
+                            ))}
+                            <Form.Item>
+                                <Button type="dashed" onClick={() => add()} block icon={<PlusOutlined />}>
+                                    增加
+                                </Button>
+                            </Form.Item>
+                        </>
+                    }}
+                </Form.List>
+            </>}
+
+        </Form>
+    </Modal>
+}
+
+export default React.memo(ModalApp)

+ 83 - 0
src/pages/iaaSystem/manage/application/tableConfig.tsx

@@ -0,0 +1,83 @@
+import { ProColumns } from "@ant-design/pro-table";
+import React from "react";
+import DelApp from "./delApp";
+
+
+const tableConfig = (handleEdit: (data: any) => void, userObj: any, appObj: any) => {
+
+    const columns: ProColumns<any>[] = [
+        {
+            title: '用户名称',
+            dataIndex: 'userName',
+            width: 120,
+            hideInSearch: true
+        },
+        {
+            title: '用户',
+            dataIndex: 'userId',
+            hideInTable: true,
+            valueEnum: userObj
+        },
+        {
+            title: '应用名称',
+            key: 'iaaAppId',
+            dataIndex: 'iaaAppId',
+            align: 'center',
+            width: 110,
+            valueEnum: appObj
+        },
+        {
+            title: '是否包含自然量',
+            dataIndex: 'defaultAgent',
+            search: false,
+            align: 'center',
+            width: 80,
+            valueEnum: {
+                false: {
+                    text: '否',
+                    status: 'error'
+                },
+                true: {
+                    text: '是',
+                    status: 'success'
+                }
+            }
+        },
+        {
+            title: '创建人',
+            dataIndex: 'createName',
+            search: false,
+            align: 'center',
+            width: 100,
+        },
+        {
+            title: '更新人',
+            dataIndex: 'updateByName',
+            search: false,
+            align: 'center',
+            width: 100,
+        },
+        {
+            title: '创建时间',
+            dataIndex: 'createTime',
+            search: false,
+            align: 'center',
+            width: 150
+        },
+        {
+            title: '操作',
+            key: 'option',
+            valueType: 'option',
+            render: (_, row, index, action) => [
+                <a key={'xg'} onClick={() => { handleEdit(row); }} >编辑</a>,
+                <div key={'delete'}><DelApp
+                    id={row.id}
+                    onChange={() => action?.reload()}
+                /></div>
+            ],
+        },
+    ];
+    return columns
+}
+
+export default tableConfig

+ 53 - 36
src/pages/iaaSystem/manage/backPolicy/index.tsx

@@ -1,10 +1,11 @@
 import { PlusOutlined } from "@ant-design/icons"
 import ProTable, { ActionType } from "@ant-design/pro-table";
-import { Button, Card, Col, Form, Input, Row, Space } from "antd"
+import { Button } from "antd"
 import React, { useRef, useState } from "react"
 import tableConfig from "./tableConfig";
 import { useAjax } from "@/Hook/useAjax";
 import { getBackPolicyListApi } from "@/services/iaaSystem/backPolicy";
+import ModalBackPolicy from "./modalBackPolicy";
 
 /**
  * 回传策略
@@ -14,49 +15,65 @@ const BackPolicy: React.FC = () => {
 
     /***************************************/
     const actionRef = useRef<ActionType>();
-    const [form] = Form.useForm()
-    const [initialValues, setInitialValues] = useState<any>({})
     const [visible, setVisible] = useState<boolean>(false)
-    const [queryFrom, setQueryForm] = useState<IAAAPI.GetBackPolicyListProps>({ pageNum: 1, pageSize: 20 })
+    const [initialValues, setInitialValues] = useState<any>()
 
 
     const getFolderList = useAjax((params) => getBackPolicyListApi(params), { type: 'table' })
     /***************************************/
 
-    const onFinish = (data: any) => {
-        let oldQueryFrom = JSON.parse(JSON.stringify(queryFrom))
-        setQueryForm({ ...oldQueryFrom, ...data, pageNum: 1 })
+    /**
+     * 修改
+     * @param data 
+     */
+    const handleEdit = (data: any) => {
+        console.log(data)
+        setInitialValues(data)
+        setVisible(true)
     }
 
-    return <ProTable<any>
-        columns={tableConfig()}
-        actionRef={actionRef}
-        cardBordered
-        request={async (params, sort, filter) => {
-            console.log(sort, filter);
-            return await getFolderList.run(params)
-        }}
-        editable={{
-            type: 'multiple',
-        }}
-        rowKey="id"
-        search={{
-            labelWidth: 'auto',
-        }}
-        headerTitle="回传策略"
-        toolBarRender={() => [
-            <Button
-                key="button"
-                icon={<PlusOutlined />}
-                onClick={() => {
-                    actionRef.current?.reload();
-                }}
-                type="primary"
-            >
-                新建
-            </Button>
-        ]}
-    />
+    return <>
+        <ProTable<any>
+            columns={tableConfig(handleEdit)}
+            actionRef={actionRef}
+            cardBordered
+            request={async (params, sort, filter) => {
+                console.log(sort, filter);
+                return await getFolderList.run(params)
+            }}
+            editable={{
+                type: 'multiple',
+            }}
+            rowKey="id"
+            search={{
+                labelWidth: 'auto',
+            }}
+            headerTitle={<strong>回传策略</strong>}
+            toolBarRender={() => [
+                <Button type="primary" onClick={() => {
+                    setVisible(true)
+                }}>
+                    <PlusOutlined />
+                    新建
+                </Button>
+            ]}
+        />
+
+        {/* 新增修改 */}
+        {visible && <ModalBackPolicy 
+            visible={visible}
+            initialValues={initialValues}
+            onChange={() => {
+                setVisible(false)
+                setInitialValues(undefined)
+                actionRef.current?.reload()
+            }}
+            onClose={() => {
+                setVisible(false)
+                setInitialValues(undefined)
+            }}
+        />}
+    </>
 }
 
 export default BackPolicy

+ 78 - 0
src/pages/iaaSystem/manage/backPolicy/modalBackPolicy.tsx

@@ -0,0 +1,78 @@
+import { useAjax } from "@/Hook/useAjax";
+import { addOrUpdateBackPolicyApi } from "@/services/iaaSystem/backPolicy";
+import { Form, Input, InputNumber, message, Modal } from "antd";
+import React from "react"
+
+
+interface Props {
+    onChange?: () => void
+    visible?: boolean
+    onClose?: () => void
+    initialValues?: any
+}
+
+/**
+ * 新增修改回传策略
+ * @returns 
+ */
+const ModalBackPolicy: React.FC<Props> = ({ onChange, visible, onClose, initialValues }) => {
+
+    /*******************************/
+    const [form] = Form.useForm<IAAAPI.AddOrUpdateBackPolicyProps>();
+
+    const addOrUpdateBackPolicy = useAjax((params) => addOrUpdateBackPolicyApi(params))
+    /*******************************/
+
+    const handleOk = async () => {
+        form.submit()
+        let data = await form.validateFields()
+        if (initialValues?.id) {
+            data.id = initialValues?.id
+        }
+        addOrUpdateBackPolicy.run(data).then(res => {
+            if (res?.data) {
+                if (initialValues?.id) {
+                    message.success('修改成功')
+                } else {
+                    message.success('新增成功')
+                }
+                onChange && onChange()
+            }
+        })
+    }
+
+    return <Modal
+        title={<strong>{initialValues?.id ? '修改策略' : '新增策略'}</strong>}
+        open={visible}
+        onCancel={onClose}
+        onOk={handleOk}
+        confirmLoading={addOrUpdateBackPolicy.loading}
+    >
+        <Form
+            name="basicBackPolicy"
+            layout="vertical"
+            form={form}
+            autoComplete="off"
+            colon={false}
+            initialValues={{ ...initialValues }}
+        >
+            <Form.Item label={<strong>策略名称</strong>} name="backPolicyName" rules={[{ required: true, message: '请输入策略名称!' }]}>
+                <Input min={0} placeholder="请输入策略名称" />
+            </Form.Item>
+            <Form.Item label={<strong>广告观看次数</strong>} name="ipu">
+                <InputNumber min={0} placeholder="请输入广告观看次数" style={{ minWidth: 472 }} />
+            </Form.Item>
+            <Form.Item label={<strong>广告千次收益(分)</strong>} name="ecpm">
+                <InputNumber min={0} placeholder="请输入广告千次收益" style={{ minWidth: 472 }} />
+            </Form.Item>
+            <Form.Item label={<strong>广告总收益(分)</strong>} name="costTotal">
+                <InputNumber min={0} placeholder="请输入广告千次收益" style={{ minWidth: 472 }} />
+            </Form.Item>
+            <Form.Item label={<strong>有效窗口时间(分钟)</strong>} name="validWindowTime">
+                <InputNumber min={0} placeholder="请输入广告千次收益" style={{ minWidth: 472 }} />
+            </Form.Item>
+        </Form>
+    </Modal>
+}
+
+export default React.memo(ModalBackPolicy)

+ 39 - 18
src/pages/iaaSystem/manage/backPolicy/tableConfig.tsx

@@ -1,29 +1,50 @@
 import { ProColumns } from "@ant-design/pro-table";
+import React from "react";
 
 
-const tableConfig = () => {
+const tableConfig = (handleEdit: (data: any) => void) => {
 
     const columns: ProColumns<any>[] = [
         {
-            dataIndex: 'index',
-            valueType: 'indexBorder',
-            width: 48,
-        },
-        {
-            title: '标题',
-            dataIndex: 'title',
+            title: '策略名称',
+            dataIndex: 'backPolicyName',
             copyable: true,
             ellipsis: true,
-            tooltip: '标题过长会自动收缩',
-            formItemProps: {
-                rules: [
-                    {
-                        required: true,
-                        message: '此项为必填项',
-                    },
-                ],
-            },
-        }
+            width: 300
+        },
+        {
+            title: '广告观看次数',
+            dataIndex: 'ipu',
+            search: false,
+            align: 'center'
+        },
+        {
+            title: '广告千次收益(分)',
+            dataIndex: 'ecpm',
+            search: false,
+            align: 'center'
+        },
+        {
+            title: '广告总收益(分)',
+            dataIndex: 'costTotal',
+            search: false,
+            align: 'center'
+        },
+        {
+            title: '有效窗口时间(分钟)',
+            dataIndex: 'validWindowTime',
+            search: false,
+            align: 'center'
+        },
+        {
+            title: '操作',
+            key: 'option',
+            width: 120,
+            valueType: 'option',
+            render: (_, row) => [
+                <a key={'xg'} onClick={() => { handleEdit(row); }} >编辑</a>
+            ],
+        },
     ];
     return columns
 }

+ 40 - 0
src/pages/iaaSystem/manage/channel/cancelBackPolicy.tsx

@@ -0,0 +1,40 @@
+import { useAjax } from "@/Hook/useAjax";
+import { iaaConfigBackPolicyApi } from "@/services/iaaSystem/channel";
+import { Button, Popconfirm } from "antd";
+import React from "react"
+
+interface Props {
+    id: number
+    onChange?: () => void
+    key?: React.Key
+}
+
+/**
+ * 取消绑定回传策略
+ * @param param0 
+ * @returns 
+ */
+const CancelBackPolicy: React.FC<Props> = ({ key, id, onChange }) => {
+
+    /********************************/
+    const iaaConfigBackPolicy = useAjax((params) => iaaConfigBackPolicyApi(params))
+    /********************************/
+
+    const confirm = () => {
+        iaaConfigBackPolicy.run({ agentIds: id }).then(res => {
+            if (res?.data) {
+                onChange?.()
+            }
+        })
+    }
+
+    return <Popconfirm
+        key={key}
+        title="取消绑定回传策略?"
+        onConfirm={confirm}
+    >
+        <Button type="link" loading={iaaConfigBackPolicy.loading} danger style={{ padding: 0, height: 'auto' }} >取消绑定回传策略</Button>
+    </Popconfirm>
+}
+
+export default React.memo(CancelBackPolicy)

+ 67 - 0
src/pages/iaaSystem/manage/channel/configBackPolicy.tsx

@@ -0,0 +1,67 @@
+import { AjaxPromise, useAjax } from "@/Hook/useAjax";
+import { iaaConfigBackPolicyBackApi } from "@/services/iaaSystem/channel";
+import { Form, message, Modal, Select } from "antd";
+import React from "react"
+
+
+interface Props {
+    getBackPolicyAllList: AjaxPromise,
+    selectedRows: any[]
+    onChange?: () => void
+    visible?: boolean
+    onClose?: () => void
+}
+
+/**
+ * 新增修改回传策略
+ * @returns 
+ */
+const ConfigBackPolicy: React.FC<Props> = ({ onChange, visible, onClose, selectedRows, getBackPolicyAllList }) => {
+
+    /*******************************/
+    const [form] = Form.useForm<IAAAPI.AddIaaAgentProps>();
+
+    const iaaConfigBackPolicyBack = useAjax((params) => iaaConfigBackPolicyBackApi(params))
+    /*******************************/
+
+
+    const handleOk = async () => {
+        form.submit()
+        let data: any = await form.validateFields()
+        iaaConfigBackPolicyBack.run({...data, agentIds: selectedRows.map(item => item.id).toString()}).then(res => {
+            if (res?.data) {
+                message.success('修改成功')
+                onChange && onChange()
+            }
+        })
+    }
+
+    return <Modal
+        title={<strong>{'修改回传策略'}</strong>}
+        open={visible}
+        onCancel={onClose}
+        onOk={handleOk}
+        confirmLoading={iaaConfigBackPolicyBack.loading}
+    >
+        <Form
+            name="configBackPolicy"
+            layout="vertical"
+            form={form}
+            autoComplete="off"
+            colon={false}
+        >
+            <Form.Item label={<strong>回传策略</strong>} name="backPolicyId">
+                <Select
+                    placeholder="请选择回传策略"
+                    allowClear
+                    options={getBackPolicyAllList?.data?.data?.map((item: { id: any; backPolicyName: any; }) => ({
+                        value: item.id,
+                        label: item.backPolicyName,
+                    }))}
+                />
+            </Form.Item>
+        </Form>
+    </Modal>
+}
+
+export default React.memo(ConfigBackPolicy)

+ 66 - 0
src/pages/iaaSystem/manage/channel/configPutStatus.tsx

@@ -0,0 +1,66 @@
+import { useAjax } from "@/Hook/useAjax";
+import { iaaConfigPutStatusApi } from "@/services/iaaSystem/channel";
+import { Form, message, Modal, Select } from "antd";
+import React from "react"
+
+interface Props {
+    selectedRows: any[]
+    onChange?: () => void
+    visible?: boolean
+    onClose?: () => void
+}
+
+const ConfigPutStatus: React.FC<Props> = ({ selectedRows, onChange, visible, onClose }) => {
+
+    /*******************************/
+    const [form] = Form.useForm<IAAAPI.AddIaaAgentProps>();
+
+    const iaaConfigPutStatus = useAjax((params) => iaaConfigPutStatusApi(params))
+    /*******************************/
+
+
+    const handleOk = async () => {
+        form.submit()
+        let data: any = await form.validateFields()
+        iaaConfigPutStatus.run({...data, agentIds: selectedRows.map(item => item.id).toString()}).then(res => {
+            if (res?.data) {
+                message.success('变更成功')
+                onChange && onChange()
+            }
+        })
+    }
+
+    return <Modal
+        title={<strong>{'变更投放状态'}</strong>}
+        open={visible}
+        onCancel={onClose}
+        onOk={handleOk}
+        confirmLoading={iaaConfigPutStatus.loading}
+    >
+        <Form
+            name="configPutStatus"
+            layout="vertical"
+            form={form}
+            autoComplete="off"
+            colon={false}
+        >
+            <Form.Item label={<strong>投放状态</strong>} name="putStatus">
+                <Select
+                    placeholder="请选择投放状态"
+                    options={[
+                        {
+                            value: 'PUT_STATUS_PUT_ING',
+                            label: '投放中',
+                        },
+                        {
+                            value: 'PUT_STATUS_PUT_STOP',
+                            label: '投放结束',
+                        }
+                    ]}
+                />
+            </Form.Item>
+        </Form>
+    </Modal> 
+}
+
+export default React.memo(ConfigPutStatus)

+ 167 - 92
src/pages/iaaSystem/manage/channel/index.tsx

@@ -1,6 +1,17 @@
+import { useAjax } from "@/Hook/useAjax";
+import { getIaaAgentListApi } from "@/services/iaaSystem/channel";
 import { PlusOutlined } from "@ant-design/icons"
-import { Button, Card, Col, Form, Row, Space } from "antd"
-import React, { useState } from "react"
+import ProTable, { ActionType } from "@ant-design/pro-table";
+import { Button, Space, Table } from "antd"
+import React, { useEffect, useRef, useState } from "react"
+import tableConfig from "./tableConfig";
+import ModalChannel from "./modalChannel";
+import { getBackPolicyAllListApi } from "@/services/iaaSystem/backPolicy";
+import ConfigPutStatus from "./configPutStatus";
+import ConfigBackPolicy from "./configBackPolicy";
+import { getAllOfOwnerUserApi, getTtAllUserListApi } from "@/services/iaaSystem";
+import { getAppAuthListApi } from "@/services/iaaSystem/application";
+import { DefaultOptionType } from "antd/lib/select";
 
 
 /**
@@ -10,102 +21,166 @@ import React, { useState } from "react"
 const Channel: React.FC = () => {
 
     /***************************************/
-    const [form] = Form.useForm()
-    const [initialValues, setInitialValues] = useState<any>({})
-    // const [queryFrom, setQueryForm] = useState<GameVipProps>({ pageNum: 1, pageSize: 20 })
+    const actionRef = useRef<ActionType>();
+    const [visible, setVisible] = useState<boolean>(false)
+    const [initialValues, setInitialValues] = useState<any>()
+    const [backValueEnum, setBackValueEnum] = useState<any>({})
+    const [selectedRows, setSelectedRows] = useState<any[]>([])
+    const [putStatusVisible, setPutStatusVisible] = useState<boolean>(false)
+    const [backPolicyVisible, setBackPolicyVisible] = useState<boolean>(false)
+    const [appList, setAppList] = useState<DefaultOptionType[]>([])
+    const [appObj, setAppObj] = useState<any>({})
+
+    const getFolderList = useAjax((params) => getIaaAgentListApi(params), { type: 'table' })
+    const getBackPolicyAllList = useAjax(() => getBackPolicyAllListApi())
+    const getAllOfOwnerUser = useAjax(() => getAllOfOwnerUserApi())
+    const getTtAllUserList = useAjax(() => getTtAllUserListApi())
+    const getAppAuthList = useAjax(() => getAppAuthListApi())
     /***************************************/
 
-    const onFinish = (data: any) => {
-        // let oldQueryFrom = JSON.parse(JSON.stringify(queryFrom))
-        // setQueryForm({ ...oldQueryFrom, ...data, pageNum: 1 })
+
+    useEffect(() => {
+        getBackPolicyAllList.run().then(res => {
+            console.log(res)
+            let newBackValueEnum: any = {}
+            res?.data?.forEach((item: any) => {
+                newBackValueEnum[item.id] = item.backPolicyName
+            })
+            setBackValueEnum(newBackValueEnum)
+        })
+        getAllOfOwnerUser.run()
+        getTtAllUserList.run()
+        getAppAuthList.run().then(res => {
+            if (res?.data) {
+                let newAppList: DefaultOptionType[] = []
+                let newAppObj: any = {}
+                res.data?.third.forEach((item: { name: any; id: any; }) => {
+                    newAppList.push({ label: item.name, value: item.id })
+                    newAppObj[item.id] = {
+                        text: item.name
+                    }
+                })
+                setAppList(newAppList)
+                setAppObj(newAppObj)
+            }
+        })
+    }, [])
+
+    // 变更投放状态
+    const handlePutStatus = () => {
+        setPutStatusVisible(true)
     }
 
-    return <Card
-        style={{ borderRadius: 8 }}
-        headStyle={{ textAlign: 'left' }}
-        bodyStyle={{ padding: '5px 10px' }}
-    >
-        <div style={{ textAlign: 'center', fontWeight: 'bold', padding: '4px 6px 6px', fontSize: 16, marginBottom: 4, position: 'relative' }}>
-            渠道管理
-        </div>
+    return <>
+        <ProTable<any>
+            columns={tableConfig(backValueEnum, appObj)}
+            actionRef={actionRef}
+            cardBordered
+            request={async (params, sort, filter) => {
+                console.log(sort, filter);
+                return await getFolderList.run(params)
+            }}
+            editable={{
+                type: 'multiple',
+            }}
+            rowKey="id"
+            search={{
+                labelWidth: 'auto',
+            }}
+            headerTitle={<strong>推广渠道</strong>}
+            toolBarRender={() => [
+                <Button type="primary" onClick={() => {
+                    setVisible(true)
+                }}>
+                    <PlusOutlined />
+                    新建
+                </Button>
+            ]}
+            scroll={{ x: 1200 }}
+            rowSelection={{
+                // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
+                // 注释该行则默认不显示下拉选项
+                selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
+                onChange(_, selectedRows) {
+                    setSelectedRows(selectedRows)
+                },
+            }}
+            tableAlertRender={({
+                selectedRowKeys,
+                selectedRows,
+                onCleanSelected,
+            }) => {
+                return (
+                    <Space size={24}>
+                        <span>
+                            已选 {selectedRowKeys.length} 项
+                            <a style={{ marginInlineStart: 8 }} onClick={onCleanSelected}>
+                                取消选择
+                            </a>
+                        </span>
+                    </Space>
+                );
+            }}
+            tableAlertOptionRender={() => {
+                return (
+                    <Space size={16}>
+                        <a onClick={handlePutStatus}>变更投放状态</a>
+                        <a onClick={() => setBackPolicyVisible(true)}>修改回传策略</a>
+                    </Space>
+                );
+            }}
+        />
+
+        {/* 新增修改 */}
+        {visible && <ModalChannel
+            appList={appList}
+            getAllOfOwnerUser={getAllOfOwnerUser}
+            getTtAllUserList={getTtAllUserList}
+            getBackPolicyAllList={getBackPolicyAllList}
+            visible={visible}
+            initialValues={initialValues}
+            onChange={() => {
+                setVisible(false)
+                setInitialValues(undefined)
+                actionRef.current?.reload()
+            }}
+            onClose={() => {
+                setVisible(false)
+                setInitialValues(undefined)
+            }}
+        />}
 
-        <Space style={{ width: '100%' }} direction="vertical" size={10}>
-            <Form layout="inline" className='queryForm' initialValues={initialValues} name="basicGameVip" form={form} onFinish={onFinish}>
-                <Row gutter={[0, 6]}>
-                    {/* <Col><Form.Item name='vipLevel'>
-                        <Input placeholder="VIP档位" allowClear style={{ width: 140 }} />
-                    </Form.Item></Col>
-                    <Col><Form.Item name='superGameId'>
-                        <Select
-                            maxTagCount={1}
-                            showSearch
-                            style={{ minWidth: 140 }}
-                            allowClear
-                            placeholder={'请选择超父游戏'}
-                            filterOption={(input, option) =>
-                                (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
-                            }
-                        >
-                            {superGameList?.map((item: any) => <Select.Option value={item.super_game_id} key={item.super_game_id}>{item.super_game_name}</Select.Option>)}
-                        </Select>
-                    </Form.Item></Col>
-                    <Col><Form.Item name='parentGameId'>
-                        <Select
-                            maxTagCount={1}
-                            showSearch
-                            style={{ minWidth: 140 }}
-                            allowClear
-                            placeholder={'请选择父游戏'}
-                            filterOption={(input, option) =>
-                                (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
-                            }
-                        >
-                            {thatStoreData?.gameList?.map((item: any) => <Select.Option value={item.id} key={item.id}>{item.name}</Select.Option>)}
-                        </Select>
-                    </Form.Item></Col> */}
-                    <Col>
-                        {/* <Space>
-                            <Button type="primary" htmlType="submit">搜索</Button>
-                            <Button onClick={() => form.resetFields()}>重置</Button>
-                            <Button icon={<PlusOutlined />} type="primary" onClick={() => { setVisible(true); setInitialValues({}) }}>新增VIP档位</Button>
-                            <Button icon={<PlusOutlined />} type="primary" onClick={() => { setVisibleS(true); setInitialValues({}) }}>批量新增VIP档位</Button>
-                        </Space> */}
-                    </Col>
-                </Row>
-            </Form>
+        {/* 变更状态 */}
+        {putStatusVisible && <ConfigPutStatus
+            selectedRows={selectedRows}
+            visible={putStatusVisible}
+            onChange={() => {
+                setPutStatusVisible(false)
+                actionRef.current?.reload();
+                (actionRef.current as any)?.clearSelected()
+            }}
+            onClose={() => {
+                (actionRef.current as any)?.clearSelected()
+                setPutStatusVisible(false)
+            }}
+        />}
 
-            {/* <div className={`${style['small']}`}> */}
-                {/* <Tables
-                    className={`all_table content_table_body`}
-                    bordered
-                    sortDirections={['ascend', 'descend', null]}
-                    current={queryFrom.pageNum}
-                    pageSize={queryFrom.pageSize}
-                    columns={columnsPos(editVip, del)}
-                    dataSource={getGameVip?.data?.records}
-                    scroll={{ x: 1000, y: 600 }}
-                    onChange={(pagination: any, filters: any, sortData: any) => {
-                        let { current, pageSize } = pagination
-                        let newQueryForm = JSON.parse(JSON.stringify(queryFrom))
-                        if (sortData && sortData?.order) {
-                            newQueryForm['sortType'] = sortData?.order === 'ascend' ? 'asc' : 'desc'
-                            newQueryForm['sortFiled'] = sortData?.field
-                        } else {
-                            delete newQueryForm['sortType']
-                            delete newQueryForm['sortFiled']
-                        }
-                        newQueryForm.pageNum = current
-                        newQueryForm.pageSize = pageSize
-                        setQueryForm({ ...newQueryForm })
-                    }}
-                    size="small"
-                    total={getGameVip?.data?.total}
-                    loading={getGameVip?.loading}
-                    defaultPageSize={20}
-                /> */}
-            {/* </div> */}
-        </Space>
-    </Card>
+        {/* 修改回传策略 */}
+        {backPolicyVisible && <ConfigBackPolicy
+            getBackPolicyAllList={getBackPolicyAllList}
+            selectedRows={selectedRows}
+            visible={backPolicyVisible}
+            onChange={() => {
+                setBackPolicyVisible(false)
+                actionRef.current?.reload();
+                (actionRef.current as any)?.clearSelected()
+            }}
+            onClose={() => {
+                (actionRef.current as any)?.clearSelected()
+                setBackPolicyVisible(false)
+            }}
+        />}
+    </>
 }
 
 export default Channel

+ 139 - 0
src/pages/iaaSystem/manage/channel/modalChannel.tsx

@@ -0,0 +1,139 @@
+import { AjaxPromise, useAjax } from "@/Hook/useAjax";
+import { addIaaAgentApi } from "@/services/iaaSystem/channel";
+import { Form, Input, message, Modal, Select } from "antd";
+import { DefaultOptionType } from "antd/lib/select";
+import React from "react"
+
+
+interface Props {
+    getBackPolicyAllList: AjaxPromise
+    getAllOfOwnerUser: AjaxPromise
+    getTtAllUserList: AjaxPromise
+    appList: DefaultOptionType[]
+    onChange?: () => void
+    visible?: boolean
+    onClose?: () => void
+    initialValues?: any
+}
+
+/**
+ * 新增修改回传策略
+ * @returns 
+ */
+const ModalChannel: React.FC<Props> = ({ onChange, visible, onClose, initialValues, appList, getBackPolicyAllList, getAllOfOwnerUser, getTtAllUserList }) => {
+
+    /*******************************/
+    const [form] = Form.useForm<IAAAPI.AddIaaAgentProps>();
+    const accountType = Form.useWatch('accountType', form)
+
+    const addIaaAgent = useAjax((params) => addIaaAgentApi(params))
+    /*******************************/
+
+
+    const handleOk = async () => {
+        form.submit()
+        let data: any = await form.validateFields()
+        if (data.accountType === 'OUTSIDE_APPLICATION') {
+            data.accountIdList = data.accountIdList.replace(/[,,\s]/g, ',')
+            data.accountIdList = data.accountIdList.split(',')
+        }
+        addIaaAgent.run(data).then(res => {
+            if (res?.data) {
+                message.success('新增成功')
+                onChange && onChange()
+            }
+        })
+    }
+
+    return <Modal
+        title={<strong>{initialValues?.id ? '修改渠道' : '新增渠道'}</strong>}
+        open={visible}
+        onCancel={onClose}
+        onOk={handleOk}
+        confirmLoading={addIaaAgent.loading}
+    >
+        <Form
+            name="basicChannel"
+            layout="vertical"
+            form={form}
+            autoComplete="off"
+            colon={false}
+            initialValues={{ ...initialValues }}
+        >
+            <Form.Item label={<strong>渠道名称</strong>} name="agentName" rules={[{ required: true, message: '请输入策略名称!' }]}>
+                <Input min={0} placeholder="请输入策略名称" />
+            </Form.Item>
+            <Form.Item label={<strong>推广账号类型</strong>} name="accountType" rules={[{ required: true, message: '请选择推广账号类型!' }]}>
+                <Select
+                    placeholder="请选择推广账号类型"
+                    options={[
+                        {
+                            value: 'OUTSIDE_APPLICATION',
+                            label: '外部应用',
+                        },
+                        {
+                            value: 'TENCENT_MINI_GAME',
+                            label: '腾讯小游戏',
+                        },
+                        {
+                            value: 'OCENAENGINE_MINI_GAME',
+                            label: '头条小游戏',
+                        }
+                    ]}
+                />
+            </Form.Item>
+            {accountType && <Form.Item label={<strong>广告账号</strong>} name="accountIdList" rules={[{ required: true, message: '请输入广告账号!' }]}>
+                {['TENCENT_MINI_GAME', 'OCENAENGINE_MINI_GAME'].includes(accountType) ? <Select
+                    placeholder="请选择广告账号"
+                    mode="multiple"
+                    filterOption={(input, option) =>
+                        ((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase())
+                    }
+                    options={accountType === 'TENCENT_MINI_GAME' ? getAllOfOwnerUser?.data?.data?.map((item: { memo: string; accountId: any; }) => ({
+                        value: item.accountId,
+                        label: item.accountId + (item.memo ? '_' + item.memo : '')
+                    })) : getTtAllUserList?.data?.data?.map((item: { groupName: string; accountName: string; accountId: any; }) => ({
+                        value: item.accountId,
+                        label: item.accountId + '_' + item.accountName + (item.groupName ? '_' + item.groupName : ''),
+                    }))}
+                /> : <Input.TextArea placeholder="请输入广告账号(多个逗号,换行隔开)" />}
+            </Form.Item>}
+            <Form.Item label={<strong>应用</strong>} name="iaaAppId" rules={[{ required: true, message: '请选择应用!' }]}>
+                <Select
+                    placeholder="请选择应用"
+                    filterOption={(input, option) =>
+                        ((option?.label ?? '') as any).toLowerCase().includes(input.toLowerCase())
+                    }
+                    allowClear
+                    options={appList}
+                />
+            </Form.Item>
+            <Form.Item label={<strong>投放状态</strong>} name="putStatus">
+                <Select
+                    placeholder="请选择投放状态"
+                    options={[
+                        {
+                            value: 'PUT_STATUS_PUT_ING',
+                            label: '投放中',
+                        },
+                        {
+                            value: 'PUT_STATUS_PUT_STOP',
+                            label: '投放结束',
+                        }
+                    ]}
+                />
+            </Form.Item>
+            <Form.Item label={<strong>回传策略</strong>} name="backPolicyId">
+                <Select
+                    placeholder="请选择回传策略"
+                    options={getBackPolicyAllList?.data?.data?.map((item: { id: any; backPolicyName: any; }) => ({
+                        value: item.id,
+                        label: item.backPolicyName,
+                    }))}
+                />
+            </Form.Item>
+        </Form>
+    </Modal>
+}
+
+export default React.memo(ModalChannel)

+ 147 - 0
src/pages/iaaSystem/manage/channel/tableConfig.tsx

@@ -0,0 +1,147 @@
+import { ProColumns } from "@ant-design/pro-table";
+import { Tag } from "antd";
+import React from "react";
+import CancelBackPolicy from "./cancelBackPolicy";
+
+const AccountTypeEnum = {
+    OUTSIDE_APPLICATION: <Tag color="#f50">外部应用</Tag>,
+    TENCENT_MINI_GAME: <Tag color="#2db7f5">腾讯小游戏</Tag>,
+    OCENAENGINE_MINI_GAME: <Tag color="#87d068">头条小游戏</Tag>
+}
+
+const tableConfig = (backValueEnum: any, appObj: any) => {
+
+    const columns: ProColumns<any>[] = [
+        {
+            title: '渠道名称',
+            dataIndex: 'agentName',
+            copyable: true,
+            ellipsis: true,
+            width: 220
+        },
+        {
+            title: '渠道标识',
+            dataIndex: 'agentKey',
+            align: 'center',
+            width: 180,
+            ellipsis: true
+        },
+        {
+            title: '广告账号',
+            dataIndex: 'accountId',
+            align: 'center',
+            width: 100,
+            ellipsis: true
+        },
+        {
+            title: '广告账号类型',
+            dataIndex: 'accountType',
+            align: 'center',
+            width: 100,
+            valueEnum: {
+                OUTSIDE_APPLICATION: {
+                    text: '外部应用'
+                },
+                TENCENT_MINI_GAME: {
+                    text: '腾讯小游戏'
+                },
+                OCENAENGINE_MINI_GAME: {
+                    text: '头条小游戏'
+                }
+            },
+            render: (_, row) => {
+                return AccountTypeEnum[row.accountType as keyof typeof AccountTypeEnum]
+            },
+        },
+        {
+            title: '应用',
+            dataIndex: 'iaaAppId',
+            align: 'center',
+            width: 120,
+            ellipsis: true,
+            valueEnum: appObj
+        },
+        {
+            title: '投放状态',
+            dataIndex: 'putStatus',
+            align: 'center',
+            width: 90,
+            valueEnum: {
+                PUT_STATUS_PUT_STOP: {
+                    text: '投放结束',
+                    status: 'Success'
+                },
+                PUT_STATUS_PUT_ING: {
+                    text: '投放中',
+                    status: 'Processing',
+                }
+            },
+        },
+        {
+            title: '回传策略',
+            dataIndex: 'backPolicyId',
+            align: 'center',
+            width: 120,
+            ellipsis: true,
+            valueEnum: backValueEnum,
+            render: (_, row) => {
+                return row?.iaaAgentBackPolicyDTO?.backPolicyName || '-'
+            },
+        },
+        {
+            title: '创建人',
+            dataIndex: 'createByName',
+            search: false,
+            align: 'center',
+            width: 100
+        },
+        {
+            title: '更新人',
+            dataIndex: 'updateByName',
+            search: false,
+            align: 'center',
+            width: 100
+        },
+        {
+            title: '创建时间',
+            key: 'showTime',
+            dataIndex: 'createTime',
+            valueType: 'date',
+            hideInSearch: true,
+            width: 140
+        },
+        {
+            title: '创建时间',
+            dataIndex: 'createTime',
+            valueType: 'dateRange',
+            hideInTable: true,
+            search: {
+                transform: (value) => {
+                    return {
+                        createBeginTime: value[0],
+                        createEndTime: value[1],
+                    };
+                },
+            },
+        },
+        {
+            title: '更新时间',
+            dataIndex: 'updateTime',
+            search: false,
+            align: 'center',
+            width: 140
+        },
+        {
+            title: '操作',
+            key: 'option',
+            width: 125,
+            valueType: 'option',
+            render: (_, row, index, action) => row?.iaaAgentBackPolicyDTO ? [
+                <div key={'qx'}><CancelBackPolicy id={row.id} onChange={() => action?.reload()}/></div>
+            ] : '-'
+        },
+    ];
+    return columns
+}
+
+export default tableConfig

+ 38 - 0
src/pages/iaaSystem/manage/power/delPower.tsx

@@ -0,0 +1,38 @@
+import { useAjax } from "@/Hook/useAjax"
+import { delRoleApi } from "@/services/iaaSystem/power"
+import { Button, Popconfirm } from "antd"
+import React from "react"
+
+interface Props {
+    userId: number
+    onChange?: () => void
+}
+
+/**
+ * 删除
+ * @param param0 
+ * @returns 
+ */
+const DelPower: React.FC<Props> = ({userId, onChange}) => {
+    
+    /********************************/
+    const delRole = useAjax((params) => delRoleApi(params))
+    /********************************/
+
+    const confirm = () => {
+        delRole.run({ id: userId }).then(res => {
+            if (res?.data) {
+                onChange?.()
+            }
+        })
+    }
+
+    return <Popconfirm
+        title="确定删除?"
+        onConfirm={confirm}
+    >
+        <Button type="link" loading={delRole.loading} danger style={{ padding: 0, height: 'auto' }} >删除</Button>
+    </Popconfirm>
+}
+
+export default React.memo(DelPower)

+ 122 - 0
src/pages/iaaSystem/manage/power/index.tsx

@@ -0,0 +1,122 @@
+import ProTable, { ActionType } from "@ant-design/pro-table"
+import React, { useEffect, useRef, useState } from "react"
+import tableConfig from "./tableConfig"
+import { useAjax } from "@/Hook/useAjax";
+import { getRoleEnumApi, getRoleListApi } from "@/services/iaaSystem/power";
+import { Button } from "antd";
+import { PlusOutlined } from "@ant-design/icons";
+import { getUserAllApi } from "@/services/user";
+import { DefaultOptionType } from "antd/lib/select";
+import ModalPower from "./modalPower";
+
+
+
+/**
+ * 角色分配
+ */
+const Power: React.FC = () => {
+
+    /*******************************************/
+    const actionRef = useRef<ActionType>();
+    const [visible, setVisible] = useState<boolean>(false)
+    const [initialValues, setInitialValues] = useState<any>()
+    const [roleTypeList, setRoleTypeList] = useState<DefaultOptionType[]>([])
+    const [roleTypeEnum, setRoleTypeEnum] = useState<any>({})
+    const [userList, setUserList] = useState<DefaultOptionType[]>([])
+    const [userObj, setUserObj] = useState<any>({})
+
+
+    const getRoleList = useAjax((params) => getRoleListApi(params), { type: 'table' })
+    const getUserAll = useAjax(() => getUserAllApi())
+    const getRoleEnum = useAjax(() => getRoleEnumApi())
+    /*******************************************/
+
+    useEffect(() => {
+        getUserAll.run().then(res => {
+            if (res?.data) {
+                let newUserList: DefaultOptionType[] = []
+                let newUserObj: any = {}
+                res.data.forEach((item: { nickname: any; userId: any; }) => {
+                    newUserList.push({ label: item.nickname, value: item.userId })
+                    newUserObj[item.userId] = {
+                        text: item.nickname
+                    }
+                })
+                setUserList(newUserList)
+                setUserObj(newUserObj)
+            }
+        })
+        getRoleEnum.run().then(res => {
+            console.log(res.data)
+            if (res?.data) {
+                let newRoleTypeList: DefaultOptionType[] = []
+                let newRoleTypeEnum: any = {}
+                Object.keys(res.data).forEach(key => {
+                    newRoleTypeList.push({ label: res.data[key], value: key })
+                    newRoleTypeEnum[key] = {
+                        text: res.data[key]
+                    }
+                })
+                setRoleTypeList(newRoleTypeList)
+                setRoleTypeEnum(newRoleTypeEnum)
+            }
+        })
+    }, [])
+
+    /**
+     * 修改
+     * @param data 
+     */
+    const handleEdit = (data: any) => {
+        console.log(data)
+        setInitialValues(data)
+        setVisible(true)
+    }
+
+    return <>
+        <ProTable<any>
+            columns={tableConfig(handleEdit, roleTypeEnum, userObj)}
+            actionRef={actionRef}
+            cardBordered
+            request={async (params, sort, filter) => {
+                console.log(sort, filter);
+                return await getRoleList.run(params)
+            }}
+            editable={{
+                type: 'multiple',
+            }}
+            rowKey="userId"
+            search={{
+                labelWidth: 'auto',
+            }}
+            headerTitle={<strong>角色分配</strong>}
+            toolBarRender={() => [
+                <Button type="primary" onClick={() => {
+                    setVisible(true)
+                }}>
+                    <PlusOutlined />
+                    新建
+                </Button>
+            ]}
+        />
+
+        {/* 新增修改 */}
+        {visible && <ModalPower
+            initialValues={initialValues}
+            roleTypeList={roleTypeList}
+            userList={userList}
+            visible={visible}
+            onChange={() => {
+                setVisible(false)
+                setInitialValues(undefined)
+                actionRef.current?.reload()
+            }}
+            onClose={() => {
+                setVisible(false)
+                setInitialValues(undefined)
+            }}
+        />}
+    </>
+}
+
+export default Power

+ 86 - 0
src/pages/iaaSystem/manage/power/modalPower.tsx

@@ -0,0 +1,86 @@
+import { useAjax } from "@/Hook/useAjax";
+import { addRoleApi, updateRoleApi } from "@/services/iaaSystem/power";
+import { Form, message, Modal, Select } from "antd";
+import { DefaultOptionType } from "antd/lib/select";
+import React from "react"
+
+
+interface Props {
+    roleTypeList: DefaultOptionType[]
+    userList: DefaultOptionType[]
+    onChange?: () => void
+    visible?: boolean
+    onClose?: () => void
+    initialValues?: any
+}
+
+/**
+ * 新增修改用户权限
+ * @returns 
+ */
+const ModalPower: React.FC<Props> = ({ roleTypeList, userList, onChange, visible, onClose, initialValues }) => {
+
+    /*******************************/
+    const [form] = Form.useForm();
+
+    const addRole = useAjax((params) => addRoleApi(params))
+    const updateRole = useAjax((params) => updateRoleApi(params))
+    /*******************************/
+
+    const handleOk = async () => {
+        form.submit()
+        let data = await form.validateFields()
+        if (initialValues?.userId) {
+            data.userId = initialValues?.userId
+            updateRole.run(data).then(res => {
+                if (res?.data) {
+                    message.success('修改成功')
+                    onChange && onChange()
+                }
+            })
+        } else {
+            addRole.run(data).then(res => {
+                if (res?.data) {
+                    message.success('新增成功')
+                    onChange && onChange()
+                }
+            })
+        }
+
+    }
+
+    return <Modal
+        title={<strong>{initialValues?.userId ? `修改 ${initialValues?.userName} 用户权限` : '新增用户权限'}</strong>}
+        open={visible}
+        onCancel={onClose}
+        onOk={handleOk}
+        confirmLoading={addRole.loading || updateRole.loading}
+    >
+        <Form
+            name="basicPower"
+            layout="vertical"
+            form={form}
+            autoComplete="off"
+            colon={false}
+            initialValues={{ ...initialValues }}
+        >
+            <Form.Item label={<strong>权限类型</strong>} name="authType" rules={[{ required: true, message: '请选择权限类型!' }]}>
+                <Select
+                    placeholder="请选择回传策略"
+                    options={roleTypeList}
+                    allowClear
+                />
+            </Form.Item>
+            {!initialValues?.userId && <Form.Item label={<strong>用户</strong>} name="userIdList" rules={[{ required: true, message: '请选择用户!' }]}>
+                <Select
+                    mode="multiple"
+                    allowClear
+                    placeholder="请选择用户"
+                    options={userList}
+                />
+            </Form.Item>}
+        </Form>
+    </Modal>
+}
+
+export default React.memo(ModalPower)

+ 75 - 0
src/pages/iaaSystem/manage/power/tableConfig.tsx

@@ -0,0 +1,75 @@
+import { ProColumns } from "@ant-design/pro-table";
+import React from "react";
+import DelPower from "./delPower";
+
+
+const tableConfig = (handleEdit: (data: any) => void, roleTypeEnum: any, userObj: any) => {
+
+    const columns: ProColumns<any>[] = [
+        {
+            title: '用户名称',
+            dataIndex: 'userName',
+            width: 100,
+            search: false
+        },
+        {
+            title: '用户ID',
+            key: 'userId',
+            dataIndex: 'userId',
+            align: 'center',
+            width: 80,
+            hideInSearch: true
+        },
+        {
+            title: '用户',
+            dataIndex: 'userId',
+            hideInTable: true,
+            valueEnum: userObj
+        },
+        {
+            title: '权限类型',
+            dataIndex: 'authType',
+            align: 'center',
+            width: 100,
+            valueEnum: roleTypeEnum
+        },
+        {
+            title: '创建人',
+            dataIndex: 'createBy',
+            search: false,
+            align: 'center',
+            width: 100,
+            valueEnum: userObj
+        },
+        {
+            title: '更新人',
+            dataIndex: 'updateBy',
+            search: false,
+            align: 'center',
+            width: 100,
+            valueEnum: userObj
+        },
+        {
+            title: '创建时间',
+            dataIndex: 'createTime',
+            search: false,
+            align: 'center',
+            width: 140
+        },
+        {
+            title: '操作',
+            key: 'option',
+            valueType: 'option',
+            render: (_, row, index, action) => [
+                <a key={'xg'} onClick={() => { handleEdit(row); }} >编辑</a>,
+                <div key={'delete'}><DelPower
+                    userId={row.userId}
+                    onChange={() => action?.reload()}
+                /></div>
+            ],
+        },
+    ];
+    return columns
+}
+
+export default tableConfig

+ 84 - 0
src/services/iaaSystem/application.ts

@@ -0,0 +1,84 @@
+import { request } from 'umi';
+import { api } from '../api';
+
+const iaaApi = api + '/iaaManage'
+
+
+/**
+ * 获取授权应用列表
+ * @returns 
+ */
+export async function getAppListApi(data: IAAAPI.GetAppListProps) {
+    return request(iaaApi + `/auth/member/app/list`, {
+        method: 'POST',
+        data
+    });
+}
+
+/**
+ * 新增应用
+ * @param data 
+ * @returns 
+ */
+export async function addAppApi(data: IAAAPI.AddAppProps) {
+    return request(iaaApi + `/auth/member/app/add`, {
+        method: 'POST',
+        data
+    });
+}
+
+
+/**
+ * 更新应用
+ * @param data 
+ * @returns 
+ */
+export async function updateAppApi(data: IAAAPI.UpdateAppProps) {
+    return request(iaaApi + `/auth/member/app/update`, {
+        method: 'POST',
+        data
+    });
+}
+
+/**
+ * 删除
+ * @param params 
+ * @returns 
+ */
+export async function delAppApi(params: { id: number }) {
+    return request(iaaApi + `/auth/member/app/delete`, {
+        method: 'DELETE',
+        params
+    });
+}
+
+/**
+ * 查询系统所有应用列表
+ * @returns 
+ */
+export async function getAppAllApi() {
+    return request(iaaApi + `/app/all/list`, {
+        method: 'GET'
+    });
+}
+
+
+/**
+ * 查询应用授权成员列表
+ * @returns 
+ */
+export async function getAppMemberApi() {
+    return request(iaaApi + `/auth/app/member/list`, {
+        method: 'GET'
+    });
+}
+
+/**
+ * 查询成员被授权应用列表
+ * @returns 
+ */
+export async function getAppAuthListApi() {
+    return request(iaaApi + `/app/auth/list`, {
+        method: 'GET'
+    });
+}

+ 10 - 0
src/services/iaaSystem/index.ts

@@ -11,4 +11,14 @@ export async function getAllOfOwnerUserApi() {
     return request(api + `/adq/adAccount/allOfOwnerUser`, {
         method: 'GET',
     });
+}
+
+/**
+ * 头条所有广告账号
+ * @returns 
+ */
+export async function getTtAllUserListApi() {
+    return request(api + `/oceanengine/adAccount/allOfUser`, {
+        method: 'GET',
+    });
 }

+ 73 - 0
src/services/iaaSystem/power.ts

@@ -0,0 +1,73 @@
+import { request } from 'umi';
+import { api } from '../api';
+
+const iaaApi = api + '/iaaManage'
+
+
+/**
+ * 获取授权角色列表
+ * @returns 
+ */
+export async function getRoleListApi(data: IAAAPI.GetPowerListProps) {
+    return request(iaaApi + `/auth/member/role/list`, {
+        method: 'POST',
+        data
+    });
+}
+
+
+/**
+ * 新增角色列表
+ * @param data 
+ * @returns 
+ */
+export async function addRoleApi(data: IAAAPI.AddRoleProps) {
+    return request(iaaApi + `/auth/member/role/add`, {
+        method: 'POST',
+        data
+    });
+}
+
+/**
+ * 更新授权角色
+ * @param data 
+ * @returns 
+ */
+export async function updateRoleApi(data: IAAAPI.UpdateRoleProps) {
+    return request(iaaApi + `/auth/member/role/update`, {
+        method: 'POST',
+        data
+    });
+}
+
+/**
+ * 获取角色美剧
+ * @returns 
+ */
+export async function getRoleEnumApi() {
+    return request(iaaApi + `/auth/member/role/auth/type`, {
+        method: 'GET'
+    });
+}
+
+/**
+ * 删除
+ * @param params 
+ * @returns 
+ */
+export async function delRoleApi(params: {id: number}) {
+    return request(iaaApi + `/auth/member/role/delete`, {
+        method: 'DELETE',
+        params
+    });
+}
+
+/**
+ * 查询系统授权人员列表
+ * @returns 
+ */
+export async function getMenuUserListApi() {
+    return request(iaaApi + `/auth/member/all/list`, {
+        method: 'GET'
+    });
+}

+ 31 - 2
src/services/iaaSystem/typings.d.ts

@@ -3,8 +3,8 @@ declare namespace IAAAPI {
         "agentName": string,
         "accountType": string,
         "iaaAppId": number,
-        "accountId": number,
-        "putStatus":  string, //"投放状态"
+        "accountIdList": number[],
+        "putStatus": string, //"投放状态"
         "backPolicyId"?: number,   //回传策略
     }
     interface GetIaaAgentListProps {
@@ -34,4 +34,33 @@ declare namespace IAAAPI {
         validWindowTime?: number,
         id?: number
     }
+    interface GetPowerListProps {
+        pageNum: number
+        pageSize: number
+        authType?: string
+        userId?: number
+    }
+    interface AddRoleProps {
+        authType: string,
+        userIdList: number[]
+    }
+    interface UpdateRoleProps {
+        userId: number,
+        authType: string,
+    }
+    interface GetAppListProps {
+        pageNum: number,
+        pageSize: number,
+        iaaAppId?: string,
+        userId?: number
+    }
+    interface UpdateAppProps {
+        id?: boolean
+        iaaAppId: any,
+        defaultAgent: boolean
+    }
+    interface AddAppProps {
+        userIdList: number[]
+        authMemberAppList: UpdateAppProps
+    }
 }

+ 5 - 0
src/services/operating/account.ts

@@ -3,4 +3,9 @@ import { erpApi } from '../api';
 /** 获取账号 */
 export async function getAllZhMemBerApi() {
   return request(`${erpApi}/erp/resourceOfUser/allOfMember/10`);
+}
+
+/** 投手列表 */
+export async function getSubUserWithSelfListApi() {
+  return request(erpApi + '/choice/agent/user/list');
 }

+ 21 - 17
src/services/user.ts

@@ -3,37 +3,41 @@ import { request } from 'umi';
 import { erpApi } from './api'
 
 export async function query() {
-  return request('/api/users');
+    return request('/api/users');
 }
 // export async function queryCurrent() {
 //   return request<API.CurrentUser>('/api/currentUser');
 // }
 export async function queryCurrent() {
-  return request(erpApi + '/erp/user/loginUserInfo');
+    return request(erpApi + '/erp/user/loginUserInfo');
 }
 
 
 export async function getMenu(): Promise<any> {
-  return request(erpApi + '/erp/menu/getRouters', {
-    method: 'PUT',
-    data: ['iaa']
-  })
+    return request(erpApi + '/erp/menu/getRouters', {
+        method: 'PUT',
+        data: ['iaa']
+    })
 }
 
 export async function editUser(prams: { oldPassword: string, password: string }) {
-  return request(`${erpApi}/erp/user/profile/updatePwd${queryStr(prams)}`, {
-    method: 'PUT'
-  })
+    return request(`${erpApi}/erp/user/profile/updatePwd${queryStr(prams)}`, {
+        method: 'PUT'
+    })
 }
 /** 重置密码 */
 export async function modifyPasswordAjax(prams: { userId: string, password: string, oldPassword: string }) {
-  let { userId, ...parm } = prams
-  return request(`${erpApi}/erp/user/modifyPassword/${userId}`, {
-    method: 'PUT',
-    data: parm
-  })
+    let { userId, ...parm } = prams
+    return request(`${erpApi}/erp/user/modifyPassword/${userId}`, {
+        method: 'PUT',
+        data: parm
+    })
 }
-/**查询公众号到期 */
-export async function getMpsTimeOut(userId: any): Promise<any> {
-  return request(erpApi + `/system/mp/getMpsTimeOut/${userId}`)
+
+/**
+ * 获取所有用户
+ * @returns 
+ */
+export async function getUserAllApi(): Promise<any> {
+    return request(erpApi + `/erp/user/all`)
 }