shenwu 7 tháng trước cách đây
mục cha
commit
a71a40c3be

+ 6 - 1
config/routes.tsx

@@ -128,7 +128,12 @@ const newMenu = [
     routes: [
       {
         path: '/miniApp/entWeChat',
-        redirect: '/miniApp/entWeChat/users',
+        redirect: '/miniApp/entWeChat/auth',
+      },
+      {
+        path: '/miniApp/entWeChat/auth',
+        name: "auth",
+        component: './MiniApp/EntWeChat/Auth',
       },
       {
         path: '/miniApp/entWeChat/users',

+ 1 - 0
src/locales/zh-CN/menu.ts

@@ -78,6 +78,7 @@ export default {
   "menu.miniApp.EmsCnpl.users":"用户管理",
   // 企微
   "menu.miniApp.EntWeChat":"企业微信",
+  "menu.miniApp.EntWeChat.auth":"授权管理",
   "menu.miniApp.EntWeChat.users":"用户管理",
   "menu.miniApp.EntWeChat.welcome":"欢迎语",
 };

+ 0 - 99
src/pages/MiniApp/EmsCnpl/Auth/tableConfig.tsx

@@ -1,99 +0,0 @@
-import { ProColumns } from "@ant-design/pro-components";
-import { useModel } from "@umijs/max";
-import { Avatar, Badge, Image, Typography } from 'antd';
-const { Paragraph } = Typography;
-export const columns = (appCategory: 1 | 2): ProColumns<any>[] => {
-    let { getEnum } = useModel("global")
-    return [
-        {
-            title: "公众号AppId",
-            dataIndex: 'mpAppId',
-            key: "mpAppId",
-            align: "center",
-        },
-        {
-            title: "公众号名称",
-            dataIndex: 'nickName',
-            key: "nickName",
-            align: "center",
-            render: (_, row) => {
-                return <div> <Avatar shape="square" size={64} src={row?.headImg} />{row?.nickName}</div>
-            }
-        },
-        {
-            title: "公众号类型",
-            dataIndex: 'serviceTypeInfo',
-            key: "serviceTypeInfo",
-            align: "center",
-            hideInSearch: true,
-            render: (_, row) => {
-                return ["订阅号", "服务号"][row?.serviceTypeInfo]
-            }
-        },
-        {
-            title: "公众号认证类型",
-            dataIndex: 'verifyTypeInfo',
-            key: "verifyTypeInfo",
-            align: "center",
-            hideInSearch: true,
-            valueEnum: getEnum("VERIFYTYPE", "map")
-        },
-        {
-            title: "主体名称",
-            dataIndex: 'principalName',
-            key: "principalName",
-            align: "center",
-            hideInSearch: true,
-        },
-        {
-            title: "原始ID",
-            dataIndex: 'userName',
-            key: "userName",
-            align: "center",
-            hideInSearch: true,
-        },
-        {
-            title: "公众号所设置的微信号",
-            dataIndex: 'alias',
-            key: "alias",
-            align: "center",
-            hideInSearch: true,
-        },
-        {
-            title: "用以了解功能的开通状况",
-            dataIndex: 'businessInfo',
-            key: "businessInfo",
-            align: "center",
-            hideInSearch: true,
-            render: (_, row) => {
-                return ["未开通", "已开通"][row?.businessInfo]
-            }
-        },
-        {
-            title: "二维码",
-            dataIndex: 'qrcodeUrl',
-            key: "qrcodeUrl",
-            hideInSearch: true,
-            align: "center",
-            render: (_, row) => {
-                return  <Image src={row?.qrcodeUrl} style={{width:25}} />
-            }
-        },
-        {
-            title: "授权状态",
-            dataIndex: 'authStatus',
-            key: "authStatus",
-            hideInSearch: true,
-            align: "center",
-            valueEnum(row) {
-                let obj = {true:{
-                    text:<Badge status="success" text="已授权" />
-                },false:{
-                    text:<Badge status="error" text="未授权" />
-                }}
-                return  obj
-            },
-        },
-
-    ];
-}

+ 33 - 0
src/pages/MiniApp/EmsCnpl/Users/index.tsx

@@ -0,0 +1,33 @@
+import { PageContainer, ProTable } from "@ant-design/pro-components"
+import { columns } from "./tableConfig"
+import { useAjax } from "@/Hook/useAjax"
+import { useModel } from "@umijs/max"
+import { listOfPage } from "@/services/miniApp/emsCnpl"
+
+const Page: React.FC = () => {
+    let { initialState } = useModel("@@initialState")
+    let getList = useAjax((params) => listOfPage(params), { type: 'table' })
+    return <PageContainer
+        title={false}
+    >
+        <ProTable<any, any>
+            scroll={{ x: true}}
+            params={{
+                appId: initialState?.selectApp?.id || "",
+                appType: initialState?.selectApp?.appType || ""
+            }}
+            headerTitle={"公众号用户列表"}
+            rowKey={(r) => r.id}
+            search={{
+                labelWidth: 120,
+            }}
+            request={async (params) => {
+                return await getList.run(params)
+            }}
+            columns={columns()}
+        // bordered
+        />
+    </PageContainer>
+
+}
+export default Page

+ 75 - 31
src/pages/MiniApp/EmsCnpl/Users/tableConfig.tsx

@@ -1,58 +1,102 @@
 import { ProColumns } from "@ant-design/pro-components";
-import { Typography } from 'antd';
+import { Avatar, Space, Typography } from 'antd';
 const { Paragraph } = Typography;
-export const columns = (appCategory: 1 | 2): ProColumns<any>[] => {
+export const columns = (): ProColumns<any>[] => {
     return [
         {
-            title: "链接名称",
-            dataIndex: 'linkName',
-            key: "linkName",
+            title: "称",
+            dataIndex: 'nickname',
+            key: "nickname",
             align: "center",
+            hideInSearch: true,
+            render:(_,row)=>{
+                return <Space> <Avatar shape="square" size={34} src={row?.headimgurl} />{row?.nickname}</Space>
+            }
         },
         {
-            title: "书籍名称",
-            dataIndex: 'bookName',
-            key: "bookName",
+            title: "用户unionid",
+            dataIndex: 'mpUnionId',
+            key: "mpUnionId",
             align: "center",
+            hideInSearch: true,
         },
         {
-            title: "推广章节",
-            dataIndex: 'bookChapterName',
-            key: "bookChapterName",
+            title: "公众号小程序用户ID",
+            dataIndex: 'appUserId',
+            key: "appUserId",
             align: "center",
             hideInSearch: true,
-            hideInTable: appCategory === 2
         },
         {
-            title: "创建时间",
-            dataIndex: 'createTime',
-            key: "createTime",
+            title: "是否订阅",
+            dataIndex: 'subscribe',
+            key: "subscribe",
             align: "center",
             hideInSearch: true,
         },
         {
-            title: "链接",
-            dataIndex: 'pagePath',
-            key: "pagePath",
+            title: "关注时间",
+            dataIndex: 'subscribeTime',
+            key: "subscribeTime",
+            align: "center",
             hideInSearch: true,
+        },
+        {
+            title: "关注场景",
+            dataIndex: 'subscribeScene',
+            key: "subscribeScene",
             align: "center",
-            render: (_, row) => {
-                return <Paragraph copyable>{row.pagePath}</Paragraph>
-            }
+            hideInSearch: true,
+        },
+        {
+            title: "二维码扫码场景",
+            dataIndex: 'qrScene',
+            key: "qrScene",
+            align: "center",
+            hideInSearch: true,
         },
-
-        // 搜索条件
         {
-            title: "开始时间",
-            dataIndex: 'startTime',
-            valueType: 'date',
-            hideInTable: true
+            title: "二维码扫码场景描述",
+            dataIndex: 'qrSceneStr',
+            key: "qrSceneStr",
+            align: "center",
+            hideInSearch: true,
         },
+        // {
+        //     title: "所在的分组",
+        //     dataIndex: 'groupId',
+        //     key: "groupId",
+        //     align: "center",
+        //     hideInSearch: true,
+        // },
+        // {
+        //     title: "标签",
+        //     dataIndex: 'wxTagidList',
+        //     key: "wxTagidList",
+        //     align: "center",
+        //     hideInSearch: true,
+        // },
         {
-            title: "结束时间",
-            dataIndex: 'endTime',
-            valueType: 'date',
-            hideInTable: true
+            title: "创建时间",
+            dataIndex: 'createTime',
+            key: "createTime",
+            align: "center",
+            hideInSearch: true,
+        },
+        {
+            title: "取关时间",
+            dataIndex: 'unsubscribeTime',
+            key: "unsubscribeTime",
+            align: "center",
+            hideInSearch: true,
+        },
+        {
+            title: "备注",
+            dataIndex: 'remark',
+            key: "remark",
+            align: "center",
+            hideInSearch: true,
         },
+    
     ];
 }

+ 124 - 0
src/pages/MiniApp/EntWeChat/Auth/index.tsx

@@ -0,0 +1,124 @@
+import { PageContainer, ProTable } from "@ant-design/pro-components"
+import { columns } from "./tableConfig"
+import { useAjax } from "@/Hook/useAjax"
+import { useModel } from "@umijs/max"
+import { getAllAvailableKfs, getAllBindKfs } from "@/services/miniApp/entWeChat"
+import { Button, Modal, Space, Tag } from "antd"
+import { PlusOutlined } from "@ant-design/icons"
+import { useState } from "react"
+
+const Page: React.FC = () => {
+    let { initialState } = useModel("@@initialState")
+    let [open, setOpen] = useState(false)
+    const [editSelectedRow, setEditSelectedRow] = useState<any[]>([]); //选择
+    let getList = useAjax((params) => getAllBindKfs(params), { type: 'table' })//已授权列表
+    let getNoAuthList = useAjax((params) => getAllAvailableKfs(params), { type: 'table' })//未授权列表
+
+    const auth = () => {
+        if(editSelectedRow.length>0){
+
+        }
+    }
+    return <PageContainer
+        title={false}
+    >
+        <ProTable<any, any>
+            scroll={{ x: true }}
+            toolBarRender={() => [
+                <Button type="primary" onClick={() => { setOpen(true) }} ><PlusOutlined />添加授权</Button>,
+            ]}
+            params={{
+                appId: initialState?.selectApp?.id || "",
+                appType: initialState?.selectApp?.appType || ""
+            }}
+            headerTitle={"已授权客服号列表"}
+            rowKey={(r) => r.openid}
+            search={false}
+            request={async (params) => {
+                return await getList.run(params)
+            }}
+            columns={columns(true)}
+        // bordered
+        />
+        <Modal
+            title="添加客服号"
+            open={open}
+            onCancel={() => { setOpen(false) }}
+            onOk={auth}
+            width={900}
+        >
+            <ProTable<any, any>
+                scroll={{ x: true, y: 600 }}
+                params={{
+                    appId: initialState?.selectApp?.id || "",
+                    appType: initialState?.selectApp?.appType || ""
+                }}
+                //多选
+                rowSelection={{
+                    selectedRowKeys: editSelectedRow?.map((item: { corpUserId: any }) => item.corpUserId),
+                    onSelect: (record, selected) => {
+                        if (selected) {
+                            setEditSelectedRow([...editSelectedRow, record]);
+                        } else {
+                            setEditSelectedRow(
+                                editSelectedRow?.filter((item: { corpUserId: any }) => item.corpUserId !== record.corpUserId),
+                            );
+                        }
+                    },
+                    onSelectAll: (selected, rows, changeRows) => {
+                        if (selected) {
+                            setEditSelectedRow([...editSelectedRow, ...changeRows]);
+                        } else {
+                            let newArr = editSelectedRow?.filter((item: { corpUserId: any }) =>
+                                changeRows.every((i) => i?.corpUserId !== item?.corpUserId),
+                            );
+                            setEditSelectedRow(newArr);
+                        }
+                    },
+                }}
+                // 添加取消选择按钮
+                tableAlertOptionRender={() => {
+                    return (
+                        <Button type="link" onClick={() => {
+                            setEditSelectedRow([])
+                        }}>
+                            取消选择
+                        </Button>
+                    );
+                }}
+                //多选展示栏
+                tableAlertRender={({ selectedRowKeys, selectedRows }) => {
+                    return (
+                        <Space size={24}>
+                            <span style={{ width: 90, display: 'inline-block' }}>
+                                已选 {selectedRowKeys.length} 人
+                            </span>
+                            <span style={{ color: 'red' }}>
+                                {selectedRows
+                                    ?.map((item: { corpName:string,name: string, corpUserId: any }) => <Tag
+                                        closable
+                                        key={item?.corpUserId}
+                                        onClose={() => {
+                                            let newArr = selectedRows?.filter((i) => i?.corpUserId != item?.corpUserId)
+                                            setEditSelectedRow(newArr)
+                                        }}>{item?.corpName}-{item?.name}</Tag>)
+                                }
+                            </span>
+                        </Space>
+                    );
+                }}
+                toolBarRender={false}
+                headerTitle={false}
+                rowKey={(r) => r.corpUserId}
+                search={false}
+                request={async (params) => {
+                    return await getNoAuthList.run(params)
+                }}
+                columns={columns()}
+            // bordered
+            />
+        </Modal>
+    </PageContainer>
+
+}
+export default Page

+ 49 - 0
src/pages/MiniApp/EntWeChat/Auth/tableConfig.tsx

@@ -0,0 +1,49 @@
+import { ProColumns } from "@ant-design/pro-components";
+import {Image } from 'antd'
+export const columns = (showNum?:boolean): ProColumns<any>[] => {
+    return [
+        {
+            title: "企微名称",
+            dataIndex: 'corpName',
+            hideInSearch: true,
+            align: "center",
+        },
+        {
+            title: "客服名称",
+            dataIndex: 'name',
+            align: "center",
+            hideInSearch: true,
+        },
+     
+        {
+            title: "客服ID",
+            dataIndex: 'corpUserId',
+            hideInSearch: true,
+            align: "center",
+        },
+        {
+            title: "当前用户数",
+            dataIndex: 'customNum',
+            align: "center",
+            hideInSearch: true,
+            hideInTable:!showNum
+        },
+        {
+            title: "删除用户数",
+            dataIndex: 'delCustomNum',
+            hideInSearch: true,
+            align: "center",
+            hideInTable:!showNum
+        },
+        {
+            title: "二维码",
+            dataIndex: 'qrCode',
+            hideInSearch: true,
+            align: "center",
+            hideInTable:!showNum,
+            render:(_,row)=>{
+                return   <Image src={row?.qrCode} style={{ width: 25 }} />
+            }
+        },
+    ];
+}

+ 0 - 209
src/pages/TableList/components/UpdateForm.tsx

@@ -1,209 +0,0 @@
-import {
-  ProFormDateTimePicker,
-  ProFormRadio,
-  ProFormSelect,
-  ProFormText,
-  ProFormTextArea,
-  StepsForm,
-} from '@ant-design/pro-components';
-import { FormattedMessage, useIntl } from '@umijs/max';
-import { Modal } from 'antd';
-import React from 'react';
-
-export type FormValueType = {
-  target?: string;
-  template?: string;
-  type?: string;
-  time?: string;
-  frequency?: string;
-} & Partial<API.RuleListItem>;
-
-export type UpdateFormProps = {
-  onCancel: (flag?: boolean, formVals?: FormValueType) => void;
-  onSubmit: (values: FormValueType) => Promise<void>;
-  updateModalOpen: boolean;
-  values: Partial<API.RuleListItem>;
-};
-
-const UpdateForm: React.FC<UpdateFormProps> = (props) => {
-  const intl = useIntl();
-  return (
-    <StepsForm
-      stepsProps={{
-        size: 'small',
-      }}
-      stepsFormRender={(dom, submitter) => {
-        return (
-          <Modal
-            width={640}
-            bodyStyle={{ padding: '32px 40px 48px' }}
-            destroyOnClose
-            title={intl.formatMessage({
-              id: 'pages.searchTable.updateForm.ruleConfig',
-              defaultMessage: '规则配置',
-            })}
-            open={props.updateModalOpen}
-            footer={submitter}
-            onCancel={() => {
-              props.onCancel();
-            }}
-          >
-            {dom}
-          </Modal>
-        );
-      }}
-      onFinish={props.onSubmit}
-    >
-      <StepsForm.StepForm
-        initialValues={{
-          name: props.values.name,
-          desc: props.values.desc,
-        }}
-        title={intl.formatMessage({
-          id: 'pages.searchTable.updateForm.basicConfig',
-          defaultMessage: '基本信息',
-        })}
-      >
-        <ProFormText
-          name="name"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleName.nameLabel',
-            defaultMessage: '规则名称',
-          })}
-          width="md"
-          rules={[
-            {
-              required: true,
-              message: (
-                <FormattedMessage
-                  id="pages.searchTable.updateForm.ruleName.nameRules"
-                  defaultMessage="请输入规则名称!"
-                />
-              ),
-            },
-          ]}
-        />
-        <ProFormTextArea
-          name="desc"
-          width="md"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleDesc.descLabel',
-            defaultMessage: '规则描述',
-          })}
-          placeholder={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleDesc.descPlaceholder',
-            defaultMessage: '请输入至少五个字符',
-          })}
-          rules={[
-            {
-              required: true,
-              message: (
-                <FormattedMessage
-                  id="pages.searchTable.updateForm.ruleDesc.descRules"
-                  defaultMessage="请输入至少五个字符的规则描述!"
-                />
-              ),
-              min: 5,
-            },
-          ]}
-        />
-      </StepsForm.StepForm>
-      <StepsForm.StepForm
-        initialValues={{
-          target: '0',
-          template: '0',
-        }}
-        title={intl.formatMessage({
-          id: 'pages.searchTable.updateForm.ruleProps.title',
-          defaultMessage: '配置规则属性',
-        })}
-      >
-        <ProFormSelect
-          name="target"
-          width="md"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.object',
-            defaultMessage: '监控对象',
-          })}
-          valueEnum={{
-            0: '表一',
-            1: '表二',
-          }}
-        />
-        <ProFormSelect
-          name="template"
-          width="md"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleProps.templateLabel',
-            defaultMessage: '规则模板',
-          })}
-          valueEnum={{
-            0: '规则模板一',
-            1: '规则模板二',
-          }}
-        />
-        <ProFormRadio.Group
-          name="type"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.ruleProps.typeLabel',
-            defaultMessage: '规则类型',
-          })}
-          options={[
-            {
-              value: '0',
-              label: '强',
-            },
-            {
-              value: '1',
-              label: '弱',
-            },
-          ]}
-        />
-      </StepsForm.StepForm>
-      <StepsForm.StepForm
-        initialValues={{
-          type: '1',
-          frequency: 'month',
-        }}
-        title={intl.formatMessage({
-          id: 'pages.searchTable.updateForm.schedulingPeriod.title',
-          defaultMessage: '设定调度周期',
-        })}
-      >
-        <ProFormDateTimePicker
-          name="time"
-          width="md"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.schedulingPeriod.timeLabel',
-            defaultMessage: '开始时间',
-          })}
-          rules={[
-            {
-              required: true,
-              message: (
-                <FormattedMessage
-                  id="pages.searchTable.updateForm.schedulingPeriod.timeRules"
-                  defaultMessage="请选择开始时间!"
-                />
-              ),
-            },
-          ]}
-        />
-        <ProFormSelect
-          name="frequency"
-          label={intl.formatMessage({
-            id: 'pages.searchTable.updateForm.object',
-            defaultMessage: '监控对象',
-          })}
-          width="md"
-          valueEnum={{
-            month: '月',
-            week: '周',
-          }}
-        />
-      </StepsForm.StepForm>
-    </StepsForm>
-  );
-};
-
-export default UpdateForm;

+ 0 - 396
src/pages/TableList/index.tsx

@@ -1,396 +0,0 @@
-import { PlusOutlined } from '@ant-design/icons';
-import type { ActionType, ProColumns, ProDescriptionsItemProps } from '@ant-design/pro-components';
-import {
-  FooterToolbar,
-  ModalForm,
-  PageContainer,
-  ProDescriptions,
-  ProFormText,
-  ProFormTextArea,
-  ProTable,
-} from '@ant-design/pro-components';
-import { FormattedMessage, useIntl } from '@umijs/max';
-import { Button, Drawer, Input, message } from 'antd';
-import React, { useRef, useState } from 'react';
-import type { FormValueType } from './components/UpdateForm';
-import UpdateForm from './components/UpdateForm';
-
-/**
- * @en-US Add node
- * @zh-CN 添加节点
- * @param fields
- */
-const handleAdd = async (fields: any) => {
-  const hide = message.loading('正在添加');
-  try {
-    await addRule({ ...fields });
-    hide();
-    message.success('Added successfully');
-    return true;
-  } catch (error) {
-    hide();
-    message.error('Adding failed, please try again!');
-    return false;
-  }
-};
-
-/**
- * @en-US Update node
- * @zh-CN 更新节点
- *
- * @param fields
- */
-const handleUpdate = async (fields: FormValueType) => {
-  const hide = message.loading('Configuring');
-  try {
-    await updateRule({
-      name: fields.name,
-      desc: fields.desc,
-      key: fields.key,
-    });
-    hide();
-
-    message.success('Configuration is successful');
-    return true;
-  } catch (error) {
-    hide();
-    message.error('Configuration failed, please try again!');
-    return false;
-  }
-};
-
-/**
- *  Delete node
- * @zh-CN 删除节点
- *
- * @param selectedRows
- */
-const handleRemove = async (selectedRows: any[]) => {
-  const hide = message.loading('正在删除');
-  if (!selectedRows) return true;
-  try {
-    await removeRule({
-      key: selectedRows.map((row) => row.key),
-    });
-    hide();
-    message.success('Deleted successfully and will refresh soon');
-    return true;
-  } catch (error) {
-    hide();
-    message.error('Delete failed, please try again');
-    return false;
-  }
-};
-
-const TableList: React.FC = () => {
-  /**
-   * @en-US Pop-up window of new window
-   * @zh-CN 新建窗口的弹窗
-   *  */
-  const [createModalOpen, handleModalOpen] = useState<boolean>(false);
-  /**
-   * @en-US The pop-up window of the distribution update window
-   * @zh-CN 分布更新窗口的弹窗
-   * */
-  const [updateModalOpen, handleUpdateModalOpen] = useState<boolean>(false);
-
-  const [showDetail, setShowDetail] = useState<boolean>(false);
-
-  const actionRef = useRef<ActionType>();
-  const [currentRow, setCurrentRow] = useState<any>();
-  const [selectedRowsState, setSelectedRows] = useState<any[]>([]);
-
-  /**
-   * @en-US International configuration
-   * @zh-CN 国际化配置
-   * */
-  const intl = useIntl();
-
-  const columns: ProColumns<any>[] = [
-    {
-      title: (
-        <FormattedMessage
-          id="pages.searchTable.updateForm.ruleName.nameLabel"
-          defaultMessage="Rule name"
-        />
-      ),
-      dataIndex: 'name',
-      tip: 'The rule name is the unique key',
-      render: (dom, entity) => {
-        return (
-          <a
-            onClick={() => {
-              setCurrentRow(entity);
-              setShowDetail(true);
-            }}
-          >
-            {dom}
-          </a>
-        );
-      },
-    },
-    {
-      title: <FormattedMessage id="pages.searchTable.titleDesc" defaultMessage="Description" />,
-      dataIndex: 'desc',
-      valueType: 'textarea',
-    },
-    {
-      title: (
-        <FormattedMessage
-          id="pages.searchTable.titleCallNo"
-          defaultMessage="Number of service calls"
-        />
-      ),
-      dataIndex: 'callNo',
-      sorter: true,
-      hideInForm: true,
-      renderText: (val: string) =>
-        `${val}${intl.formatMessage({
-          id: 'pages.searchTable.tenThousand',
-          defaultMessage: ' 万 ',
-        })}`,
-    },
-    {
-      title: <FormattedMessage id="pages.searchTable.titleStatus" defaultMessage="Status" />,
-      dataIndex: 'status',
-      hideInForm: true,
-      valueEnum: {
-        0: {
-          text: (
-            <FormattedMessage
-              id="pages.searchTable.nameStatus.default"
-              defaultMessage="Shut down"
-            />
-          ),
-          status: 'Default',
-        },
-        1: {
-          text: (
-            <FormattedMessage id="pages.searchTable.nameStatus.running" defaultMessage="Running" />
-          ),
-          status: 'Processing',
-        },
-        2: {
-          text: (
-            <FormattedMessage id="pages.searchTable.nameStatus.online" defaultMessage="Online" />
-          ),
-          status: 'Success',
-        },
-        3: {
-          text: (
-            <FormattedMessage
-              id="pages.searchTable.nameStatus.abnormal"
-              defaultMessage="Abnormal"
-            />
-          ),
-          status: 'Error',
-        },
-      },
-    },
-    {
-      title: (
-        <FormattedMessage
-          id="pages.searchTable.titleUpdatedAt"
-          defaultMessage="Last scheduled time"
-        />
-      ),
-      sorter: true,
-      dataIndex: 'updatedAt',
-      valueType: 'dateTime',
-      renderFormItem: (item, { defaultRender, ...rest }, form) => {
-        const status = form.getFieldValue('status');
-        if (`${status}` === '0') {
-          return false;
-        }
-        if (`${status}` === '3') {
-          return (
-            <Input
-              {...rest}
-              placeholder={intl.formatMessage({
-                id: 'pages.searchTable.exception',
-                defaultMessage: 'Please enter the reason for the exception!',
-              })}
-            />
-          );
-        }
-        return defaultRender(item);
-      },
-    },
-    {
-      title: <FormattedMessage id="pages.searchTable.titleOption" defaultMessage="Operating" />,
-      dataIndex: 'option',
-      valueType: 'option',
-      render: (_, record) => [
-        <a
-          key="config"
-          onClick={() => {
-            handleUpdateModalOpen(true);
-            setCurrentRow(record);
-          }}
-        >
-          <FormattedMessage id="pages.searchTable.config" defaultMessage="Configuration" />
-        </a>,
-        <a key="subscribeAlert" href="https://procomponents.ant.design/">
-          <FormattedMessage
-            id="pages.searchTable.subscribeAlert"
-            defaultMessage="Subscribe to alerts"
-          />
-        </a>,
-      ],
-    },
-  ];
-
-  return (
-    <PageContainer>
-      <ProTable<any, API.PageParams>
-        headerTitle={intl.formatMessage({
-          id: 'pages.searchTable.title',
-          defaultMessage: 'Enquiry form',
-        })}
-        actionRef={actionRef}
-        rowKey="key"
-        search={{
-          labelWidth: 120,
-        }}
-        toolBarRender={() => [
-          <Button
-            type="primary"
-            key="primary"
-            onClick={() => {
-              handleModalOpen(true);
-            }}
-          >
-            <PlusOutlined /> <FormattedMessage id="pages.searchTable.new" defaultMessage="New" />
-          </Button>,
-        ]}
-        request={rule}
-        columns={columns}
-        rowSelection={{
-          onChange: (_, selectedRows) => {
-            setSelectedRows(selectedRows);
-          },
-        }}
-      />
-      {selectedRowsState?.length > 0 && (
-        <FooterToolbar
-          extra={
-            <div>
-              <FormattedMessage id="pages.searchTable.chosen" defaultMessage="Chosen" />{' '}
-              <a style={{ fontWeight: 600 }}>{selectedRowsState.length}</a>{' '}
-              <FormattedMessage id="pages.searchTable.item" defaultMessage="项" />
-              &nbsp;&nbsp;
-              <span>
-                <FormattedMessage
-                  id="pages.searchTable.totalServiceCalls"
-                  defaultMessage="Total number of service calls"
-                />{' '}
-                {selectedRowsState.reduce((pre, item) => pre + item.callNo!, 0)}{' '}
-                <FormattedMessage id="pages.searchTable.tenThousand" defaultMessage="万" />
-              </span>
-            </div>
-          }
-        >
-          <Button
-            onClick={async () => {
-              await handleRemove(selectedRowsState);
-              setSelectedRows([]);
-              actionRef.current?.reloadAndRest?.();
-            }}
-          >
-            <FormattedMessage
-              id="pages.searchTable.batchDeletion"
-              defaultMessage="Batch deletion"
-            />
-          </Button>
-          <Button type="primary">
-            <FormattedMessage
-              id="pages.searchTable.batchApproval"
-              defaultMessage="Batch approval"
-            />
-          </Button>
-        </FooterToolbar>
-      )}
-      <ModalForm
-        title={intl.formatMessage({
-          id: 'pages.searchTable.createForm.newRule',
-          defaultMessage: 'New rule',
-        })}
-        width="400px"
-        open={createModalOpen}
-        onOpenChange={handleModalOpen}
-        onFinish={async (value) => {
-          const success = await handleAdd(value as any);
-          if (success) {
-            handleModalOpen(false);
-            if (actionRef.current) {
-              actionRef.current.reload();
-            }
-          }
-        }}
-      >
-        <ProFormText
-          rules={[
-            {
-              required: true,
-              message: (
-                <FormattedMessage
-                  id="pages.searchTable.ruleName"
-                  defaultMessage="Rule name is required"
-                />
-              ),
-            },
-          ]}
-          width="md"
-          name="name"
-        />
-        <ProFormTextArea width="md" name="desc" />
-      </ModalForm>
-      {/* <UpdateForm
-        onSubmit={async (value) => {
-          const success = await handleUpdate(value);
-          if (success) {
-            handleUpdateModalOpen(false);
-            setCurrentRow(undefined);
-            if (actionRef.current) {
-              actionRef.current.reload();
-            }
-          }
-        }}
-        onCancel={() => {
-          handleUpdateModalOpen(false);
-          if (!showDetail) {
-            setCurrentRow(undefined);
-          }
-        }}
-        updateModalOpen={updateModalOpen}
-        values={currentRow || {}}
-      /> */}
-
-      <Drawer
-        width={600}
-        open={showDetail}
-        onClose={() => {
-          setCurrentRow(undefined);
-          setShowDetail(false);
-        }}
-        closable={false}
-      >
-        {currentRow?.name && (
-          <ProDescriptions<any>
-            column={2}
-            title={currentRow?.name}
-            request={async () => ({
-              data: currentRow || {},
-            })}
-            params={{
-              id: currentRow?.name,
-            }}
-            columns={columns as ProDescriptionsItemProps<any>[]}
-          />
-        )}
-      </Drawer>
-    </PageContainer>
-  );
-};
-
-export default TableList;

+ 2 - 2
src/services/miniApp/emsCnpl/index.tsx

@@ -1,8 +1,8 @@
 import { api } from '@/services/api';
 import { request } from '@umijs/max';
 /**公众号用户列表 */
-export async function longBookCoinList(params: any) {
-    return request(api + '/admin/mpAccount/listOfPage', {
+export async function listOfPage(params: any) {
+    return request(api + '/admin/mpUser/listOfPage', {
         method: 'GET',
         params
     });

+ 98 - 0
src/services/miniApp/entWeChat/index.tsx

@@ -0,0 +1,98 @@
+import { api } from '@/services/api';
+import { request } from '@umijs/max';
+/**获取客户列表 */
+export async function getCustoms(params: {
+    corpId: any,//企业ID
+    corpUserId: any,//客服ID
+    openId: any,//客户
+    pageNum: number,//
+    pageSize: number
+}) {
+    return request(api + '/admin/corp/getCustoms', {
+        method: 'GET',
+        params
+    });
+}
+type Params = {
+    appId: string,
+    appType: any,
+    pageNum: number,//
+    pageSize: number
+}
+/**已授权企微客服列表 */
+export async function getAllBindKfs(params: Params) {
+    return request(api + '/admin/corp/getAllBindKfs', {
+        method: 'GET',
+        params
+    });
+}
+/**未授权企微客服列表 */
+export async function getAllAvailableKfs(params: Params) {
+    return request(api + '/admin/corp/getAllAvailableKfs', {
+        method: 'GET',
+        params
+    });
+}
+/**批量授权客服号给指定小程序 */
+export async function configUser(data: {
+    corpId: any,
+    corpUserIds: any[],
+    appId: any,
+    appType: any
+}) {
+    return request(api + '/admin/corp/configUser', {
+        method: 'PUT',
+        data
+    });
+}
+/**取消授权 */
+export async function revoke(data: {
+    corpId: any,
+    corpUserIds: any[],
+    appId: any,
+    appType: any
+}) {
+    return request(api + '/admin/corp/revoke', {
+        method: 'PUT',
+        data
+    });
+}
+
+
+/**欢迎语列表 */
+export async function corpWelcomeMsgList(data:{
+    appId: number,
+    appType: number,
+    welcomeType: number,//0:定位身份用户;1:定位产品用户;2:其他用户
+}) {
+    return request(api + '/admin/corpWelcomeMsg/list', {
+        method: 'POST',
+        data
+    });
+}
+/**新增修改欢迎语 */
+export async function corpWelcomeMsgAddOrUpdate(data:  {
+    appId: number,
+    appType: number,
+    mediaContentList: {
+        id: number,
+        mediaType: string,//素材类型
+        textContent: string,//文本内容
+        imageUrl: string,//图片oss地址
+        linkTitle: string,//图文标题
+        linkPicurl: string,//图文封面oss地址
+        linkDesc: string,//图文描述
+        linkUrl: string,//图文链接
+        miniprogramTitle: string,//小程序标题
+        miniprogramPicurl: string,//小程序封面oss地址
+        miniprogramAppid: string,//小程序appid
+        miniprogramPage: string//小程序page路径oss地址
+    }[],
+    welcomeType: number,//0:定位身份用户;1:定位产品用户;2:其他用户
+    remark: string//备注
+}) {
+    return request(api + '/admin/corpWelcomeMsg/addOrUpdate', {
+        method: 'POST',
+        data
+    });
+}