diff --git a/config/routes.ts b/config/routes.ts index ca6c322..638e0ba 100644 --- a/config/routes.ts +++ b/config/routes.ts @@ -470,6 +470,12 @@ export default [ name: 'InvestmentInformation', component: './travelMember/InvestmentInformation/index' }, + // 微信公众号管理-消息推送 + { + path: 'WeChatAccountManagement', + name: 'WeChatAccountManagement', + component: './travelMember/WeChatAccountManagement/index' + } ] }, { diff --git a/dist.zip b/dist.zip index a90a04a..42da0a0 100644 Binary files a/dist.zip and b/dist.zip differ diff --git a/package.json b/package.json index 90e861a..18707ca 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ant-design-pro", - "version": "4.5.77", + "version": "4.5.79", "private": true, "description": "An out-of-box UI solution for enterprise applications", "scripts": { diff --git a/src/layouts/BasicLayout.tsx b/src/layouts/BasicLayout.tsx index 9756223..3c5e972 100644 --- a/src/layouts/BasicLayout.tsx +++ b/src/layouts/BasicLayout.tsx @@ -621,19 +621,7 @@ const BasicLayout: React.FC = (props) => { session.set('SHOPTRADEObj', SHOPTRADEObj); }) - // 经营品牌 - // const BUSINESSBRANDList = await - getFieldEnumTree({ FieldExplainField: 'BusinessBrandIds', FieldEnumPID: null, noStorge: true }).then(BUSINESSBRANDList => { - session.set('BUSINESSBRANDList', BUSINESSBRANDList); - const BUSINESSBRANDObj: any = {} - if (BUSINESSBRANDList && BUSINESSBRANDList.length > 0) { - BUSINESSBRANDList.forEach((item: any) => { - BUSINESSBRANDObj[item.value] = item.label - }) - } - session.set('BUSINESSBRANDObj', BUSINESSBRANDObj); - }) // 经营状态 @@ -665,17 +653,17 @@ const BasicLayout: React.FC = (props) => { }) - // 服务区枚举 - // const ServerpartIdsList = await - getFieldEnumTree({ FieldExplainField: 'ServerpartIds' }).then(ServerpartIdsList => { - const obj: any = {} - if (ServerpartIdsList && ServerpartIdsList.length > 0) { - ServerpartIdsList.forEach((item: any) => { - obj[item.value] = item.label - }) - } - session.set('ServerpartIdsList', obj); - }) + // // 服务区枚举 + // // const ServerpartIdsList = await + // getFieldEnumTree({ FieldExplainField: 'ServerpartIds' }).then(ServerpartIdsList => { + // const obj: any = {} + // if (ServerpartIdsList && ServerpartIdsList.length > 0) { + // ServerpartIdsList.forEach((item: any) => { + // obj[item.value] = item.label + // }) + // } + // session.set('ServerpartIdsList', obj); + // }) // 服务区类型 @@ -692,34 +680,6 @@ const BasicLayout: React.FC = (props) => { }) - // 经营业态 - // const BusinessTradeIdsList = await - getFieldEnumTree({ FieldExplainField: 'BusinessTradeIds' }).then(BusinessTradeIdsList => { - console.log('BusinessTradeIdsListBusinessTradeIdsListBusinessTradeIdsList', BusinessTradeIdsList); - - const BusinessTradeIdsObj: any = {} - const BusinessTradeIdsBigObj: any = {} - if (BusinessTradeIdsList && BusinessTradeIdsList.length > 0) { - BusinessTradeIdsList.forEach((item: any) => { - const childrenValue: any = [] - BusinessTradeIdsObj[item.value] = item.label - BusinessTradeIdsBigObj[item.value] = item.label - if (item.children && item.children.length > 0) { - item.children.forEach((subItem: any) => { - if (childrenValue.indexOf(subItem.value) === -1) { - childrenValue.push(subItem.value) - } - BusinessTradeIdsObj[subItem.value] = subItem.label - }) - } - item.childrenValue = childrenValue - }) - } - session.set('BusinessTradeIdsObj', BusinessTradeIdsObj); - session.set('BusinessTradeIdsChildrenList', BusinessTradeIdsList); - session.set('BusinessTradeIdsBigObj', BusinessTradeIdsBigObj); - }) - // 服务区枚举 // const serverpartList = await handleGetServerpartTree({ diff --git a/src/pages/CardInformation/CardCouponApplicRules/components/selectServiceShop.tsx b/src/pages/CardInformation/CardCouponApplicRules/components/selectServiceShop.tsx index ca7c887..945e49f 100644 --- a/src/pages/CardInformation/CardCouponApplicRules/components/selectServiceShop.tsx +++ b/src/pages/CardInformation/CardCouponApplicRules/components/selectServiceShop.tsx @@ -53,19 +53,24 @@ const SelectServiceShop = ({ currentUser, showDetail, onCancel, onOk, currentRow ellipsis: true, }, { - title: "经营业态", + title: "服务区名称", width: 150, - dataIndex: "BUSINESS_TRADE", - valueType: 'select', - valueEnum: BusinessTradeIdsObj, + dataIndex: "SERVERPART_NAME", hideInSearch: true, align: 'center', ellipsis: true, }, { - title: "服务区名称", + title: "门店状态", width: 150, - dataIndex: "SERVERPART_NAME", + dataIndex: "BUSINESS_STATE", + valueType: 'select', + valueEnum: { + 3000: { text: '关闭', status: 'error' }, + 2000: { text: '暂停', status: 'warning' }, + 1000: { text: '运营中', status: 'processing' }, + 1010: { text: '待运营', status: 'default' } + }, hideInSearch: true, align: 'center', ellipsis: true, diff --git a/src/pages/Setting/Users/components/edit.tsx b/src/pages/Setting/Users/components/edit.tsx index e59cbc1..2113da8 100644 --- a/src/pages/Setting/Users/components/edit.tsx +++ b/src/pages/Setting/Users/components/edit.tsx @@ -121,7 +121,7 @@ const Edit = ({ tableTab, openType, detail, reloadTable, currentUser, selectTab, // 查询可配置的服务区 const { data: serverpartTree } = useRequest(async () => { - const data = await getServerpartTree() + const data = await getServerpartTree({ ProvinceCode: '530000' }) console.log('all', data); @@ -185,7 +185,7 @@ const Edit = ({ tableTab, openType, detail, reloadTable, currentUser, selectTab, const getServiceList = async (PROVINCEID: any, id: any) => { const typeId = id || showServiceList const req = { - ProvinceCode: PROVINCEID || selectDetail || '530000', + ProvinceCode: PROVINCEID, ServerpartType: typeId === 1020 ? 1010 : 1000, ShowWholePower: true } @@ -368,10 +368,12 @@ const Edit = ({ tableTab, openType, detail, reloadTable, currentUser, selectTab, setCheckedShop(serverpartShopList) if (tableTab === '1000') { - getServiceList(initDetail.USER_PROVINCE, initDetail.PushList && initDetail.PushList.length > 0 && initDetail.PushList[0] ? initDetail.PushList[0].type : null) + // getServiceList(initDetail.USER_PROVINCE, initDetail.PushList && initDetail.PushList.length > 0 && initDetail.PushList[0] ? initDetail.PushList[0].type : null) + getServiceList('530000', initDetail.PushList && initDetail.PushList.length > 0 && initDetail.PushList[0] ? initDetail.PushList[0].type : null) } const res = JSON.parse(JSON.stringify(initDetail)) - setSelectDetail(initDetail.USER_PROVINCE) + // setSelectDetail(initDetail.USER_PROVINCE) + setSelectDetail('530000') console.log('initDetail', initDetail); @@ -404,7 +406,7 @@ const Edit = ({ tableTab, openType, detail, reloadTable, currentUser, selectTab, getRoleMenu(initDetail.SystemRoleList.toString()) } setCopyData(res) - return { ...initDetail, ServerpartIds: res?.ServerpartIds || [], ServerpartList: serverpartList, SystemRoleList: systemRoleList, ServerpartShopList: serverpartShopList } + return { ...initDetail, ServerpartIds: res?.ServerpartIds || [], ServerpartList: serverpartList, SystemRoleList: systemRoleList, ServerpartShopList: serverpartShopList, USER_PROVINCE: 911 } } handleGetMerchantTree() @@ -427,7 +429,7 @@ const Edit = ({ tableTab, openType, detail, reloadTable, currentUser, selectTab, } - return { USER_STATUS: 1, USER_REPEATLOGON: 1, SUPER_ADMIN: 0 } + return { USER_STATUS: 1, USER_REPEATLOGON: 1, SUPER_ADMIN: 0, USER_PROVINCE: 911 } }} onFinish={async (value) => { let newValue: any = { ...value } @@ -447,7 +449,7 @@ const Edit = ({ tableTab, openType, detail, reloadTable, currentUser, selectTab, newValue.SystemRoleList = checkedRole && checkedRole.length > 0 ? checkedRole : [] newValue.OperateUser = currentUser?.Name newValue.ServerpartIds = newValue.ServerpartIds && newValue.ServerpartIds.length > 0 ? newValue.ServerpartIds.toString() : '' - + newValue.USER_PROVINCE = '530000' // 拿到新修改的数据 const newData = detailForm.current?.getFieldsValue() @@ -510,13 +512,14 @@ const Edit = ({ tableTab, openType, detail, reloadTable, currentUser, selectTab, OperateUser: currentUser?.Name, } } - getWeiChatPush(req).then(async res => { - if (res.Result_Code === 200) { - message.error(res.Result_Desc) - } else { - message.success(newValue.USER_ID ? "更新成功!" : "新建成功!") - } - }) + // getWeiChatPush(req).then(async res => { + // if (res.Result_Code === 200) { + // message.error(res.Result_Desc) + // } else { + // message.success(newValue.USER_ID ? "更新成功!" : "新建成功!") + // } + // }) + message.success(newValue.USER_ID ? "更新成功!" : "新建成功!") } else { message.success(newValue.USER_ID ? "更新成功!" : "新建成功!") } @@ -664,6 +667,8 @@ const Edit = ({ tableTab, openType, detail, reloadTable, currentUser, selectTab, // key: "value" }, onSelect: (_: any, options: any) => { + console.log("optionsoptions", options); + detailForm.current?.setFieldsValue({ ServerpartIds: [] }) setSelectDetail(options.value) getServiceList(options.value, showServiceList || null) @@ -756,7 +761,7 @@ const Edit = ({ tableTab, openType, detail, reloadTable, currentUser, selectTab, console.log('params', params); if (pageType === 'merchantManagement') { const req: any = { - // ProvinceCode: currentUser?.ProvinceCode || '530000', + ProvinceCode: '530000', UserTypePattern: 2000 } const data = await getUserTypeTree(req) @@ -769,7 +774,7 @@ const Edit = ({ tableTab, openType, detail, reloadTable, currentUser, selectTab, return data } if (params.USER_PROVINCE || params.USER_PATTERN) { const req: any = { - // ProvinceCode: '530000', + ProvinceCode: '530000', UserTypePattern: tableTab === 9000 ? 1000 : tableTab } const data = await getUserTypeTree(req) @@ -1055,7 +1060,7 @@ const Edit = ({ tableTab, openType, detail, reloadTable, currentUser, selectTab, - {/* { + { tableTab === '1000' || tableTab === '4000' || tableTab === '9000' ? {serverpartTree && @@ -1088,9 +1093,8 @@ const Edit = ({ tableTab, openType, detail, reloadTable, currentUser, selectTab, } - : '' - } */} + } {/* {(currentUser?.UserPattern === 9000 ? initialDetail.USER_PATTERN === 1000 : currentUser?.UserPattern === 1000) && } */} diff --git a/src/pages/Setting/Users/service.ts b/src/pages/Setting/Users/service.ts index 9feb078..5609595 100644 --- a/src/pages/Setting/Users/service.ts +++ b/src/pages/Setting/Users/service.ts @@ -12,6 +12,7 @@ import request from '@/utils/request'; import { tableList, wrapTreeNode } from '@/utils/format'; import type { UserModel } from './data'; import requestEncryption from '@/utils/requestEncryption'; +import requestYNUpload from '@/utils/requestYNUpload'; // import type { ModuleItem } from './data'; // 获取列表数据 @@ -35,7 +36,7 @@ export async function getUserList(params?: any) { } // 获取服务区树 export async function getServerpartTree(params?: any) { - const data = await request('/FrameWork/GetServerpartTree', { + const data = await requestYNUpload('/FrameWork/GetServerpartTree', { method: 'GET', params }) diff --git a/src/pages/travelMember/InvestmentInformation/index.tsx b/src/pages/travelMember/InvestmentInformation/index.tsx index e103047..24e7cd8 100644 --- a/src/pages/travelMember/InvestmentInformation/index.tsx +++ b/src/pages/travelMember/InvestmentInformation/index.tsx @@ -429,9 +429,20 @@ const InvestmentInformation: React.FC<{ currentUser: CurrentUser }> = (props) => required: true, message: '请选择头条类型' }]} + request={async () => { + const data = await getFieldEnumTree({ FieldExplainField: 'NOTICEINFO_TYPE' }) + let list: any = data && data.length > 0 ? JSON.parse(JSON.stringify(data)) : [] + if (list && list.length > 0) { + list.forEach((item: any) => { + if (item.children && item.children.length > 0) { + item.disabled = true + } + }) + } + return list + }} fieldProps={{ - options: NOTICEINFO_TYPESList, - treeDefaultExpandAll: true + treeDefaultExpandAll: true, }} /> diff --git a/src/pages/travelMember/LibraryInformationManager/index.tsx b/src/pages/travelMember/LibraryInformationManager/index.tsx index b3f4bdb..6f614b5 100644 --- a/src/pages/travelMember/LibraryInformationManager/index.tsx +++ b/src/pages/travelMember/LibraryInformationManager/index.tsx @@ -1,15 +1,471 @@ -// 图库信息管理 -import { ConnectState } from "@/models/connect"; -import { connect, CurrentUser } from "umi"; +import { connect, useRequest } from "umi"; +import type { CurrentUser } from "umi"; +import type { ConnectState } from "@/models/connect"; +import React, { useRef, useState } from "react"; +import ProCard from "@ant-design/pro-card"; +import { MenuFoldOutlined } from "@ant-design/icons"; +import type { FormInstance } from "antd"; +import { Popconfirm, Space, Tree, Image, Modal, Divider, Row, Col, message, Button } from "antd"; +import type { ActionType } from "@ant-design/pro-table"; +import ProTable from "@ant-design/pro-table"; +import PageTitleBox from "@/components/PageTitleBox"; +import { getFieldEnumTreeNoSession, handleGetFIELDENUMList } from "@/services/options"; +import { handeGetPictureList } from "../service"; +import { hanleDeletePICTURE, hanleGetPictureListPost, hanleSaveImgFile, hanleSynchroPICTURE, uploadAHYDPicture } from "@/services/picture"; +import ModalFooter from "../scenicSpotConfig/component/modalFooter"; +import ProForm, { ProFormSelect, ProFormText, ProFormUploadButton } from "@ant-design/pro-form"; +import moment from 'moment' + +const beforeUpload = (file: any) => { + const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'; + if (!isJpgOrPng) { + message.error('请上传JPEG、jpg、png格式的图片文件!'); + } + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + message.error('图片大小不超过 2MB!'); + } + return isJpgOrPng && isLt2M; +} + +const LibraryInformationManager: React.FC<{ currentUser: CurrentUser }> = (props) => { + const { currentUser } = props + const actionRef = useRef(); + const formRef = useRef(); + const [collapsible, setCollapsible] = useState(false) + const [treeView, setTreeView] = useState() + // 左侧树的枚举 + const [treeViewObj, setTreeViewObj] = useState() + // 拿到headerTitle + const { loading: imageLibraryLoading, data: imageLibrary } = useRequest(async () => { + const req: any = { + SearchParameter: { + FIELDENUM_IDS: "11462,11423,11422,11473,11472", + }, + requestEncryption: true + } + const data = await handleGetFIELDENUMList(req) + setTreeView(data) + let obj: any = {} + if (data && data.length > 0) { + data.forEach((item: any) => { + obj[item.FIELDENUM_ID] = item.FIELDENUM_NAME + }) + } + setTreeViewObj(obj) + return data + }) + // 图片信息 + const [fileList, setFileList] = useState() + // 树相关的属性和方法 + const [selectedId, setSelectedId] = useState() + // 查询的条件 + const [searchParams, setSearchParams] = useState() + const [imagePreviewVisible, setImagePreviewVisible] = useState(false) // 预览图片 + const handleChangePreview = (val: any) => { + setImagePreviewVisible(val) + } + // 详情 + const [showDetail, setShowDetail] = useState(false) + const [currentRow, setCurrentRow] = useState() + const [modalLoading, setModalLoading] = useState(false) + const ModalFormRef = useRef(); + + const columns: any = [ + { + dataIndex: "PICTURE_URL", + hideInSearch: true, + width: 200, + align: 'center', + ellipsis: true, + render: (_, record) => { + return record?.PICTURE_URL ? { + let list: any = [{ url: record?.PICTURE_URL }] + setFileList(list) + handleChangePreview(true) + }} src={record?.PICTURE_URL} alt="" /> : "-" + } + }, + { + dataIndex: 'PICTURE_NAME', + title: '图片名称', + width: 200, + align: 'center', + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return record?.PICTURE_NAME ? { + setCurrentRow(record) + setShowDetail(true) + }}> + {`${record?.PICTURE_NAME ? record?.PICTURE_NAME : ""}${record?.PICTURE_TYPE && treeViewObj[record?.PICTURE_TYPE] ? `【${treeViewObj[record?.PICTURE_TYPE]}】` : ""}`} + : "" + } + }, + { + dataIndex: 'STAFF_NAME', + title: '操作人', + width: 200, + align: 'center', + ellipsis: true, + hideInSearch: true, + }, + { + dataIndex: 'OPERATE_DATE', + title: '操作时间', + width: 200, + align: 'center', + ellipsis: true, + hideInSearch: true, + }, + // { + // dataIndex: 'option', + // title: '操作', + // width: 150, + // align: 'center', + // valueType: 'option', + // hideInSearch: true, + // render: (_, record) => { + // return ( + // + // { + // setCurrentRow(record) + // setShowDetail(true) + // }} + // > + // 编辑 + // + // { + // await handleDeleteImg(record?.PICTURE_ID) + // }} + // > + // 删除 + // + // + // ); + // }, + // }, + ] + + // 同步图片信息 + const handleSynchroImage = async (obj: any) => { + let req: any = {} + if (currentRow?.PICTURE_ID) { + req = { + ...currentRow, + ...obj, + requestEncryption: true + } + } else { + req = { + ...obj, + PICTURE_URL: fileList[0].url, + PICTURE_INDEX: 0, + STAFF_ID: currentUser.ID, + STAFF_NAME: currentUser.Name, + OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'), + requestEncryption: true + } + } + const data = await hanleSynchroPICTURE(req) + console.log('datadatadatadatadata', data); + if (data.Result_Code === 100) { + message.success('同步成功!') + setCurrentRow(null) + setShowDetail(false) + + actionRef.current?.reload() + } else { + message.error(data.Result_Desc) + } + } + + // 删除图片信息 + const handleDeleteImg = async (id: any) => { + const req: any = { + PICTUREId: id, + requestEncryption: true + } + const data = await hanleDeletePICTURE(req) + if (data.Result_Code === 100) { + message.success('同步成功!') + setCurrentRow(null) + setShowDetail(false) + + actionRef.current?.reload() + } else { + message.error(data.Result_Desc) + } + } + -const LibraryInformationManager: React.FC<{ currentUser: CurrentUser | undefined }> = (props) => { return (
+
+ { + setCollapsible(!collapsible); + }} /> + } + colSpan={!collapsible ? "300px" : "60px"} + title={!collapsible ? "请选择图库类型" : ""} + headerBordered + collapsed={collapsible} + > + {treeView && treeView.length > 0 ? { + // 多选逻辑 + const selectedIds = info.checkedNodes.filter((n: any) => n?.key !== '0-0') + setSelectedId(selectedIds.map((n: any) => n?.FIELDENUM_ID)?.toString() || '') + }} + fieldNames={{ + title: "FIELDENUM_NAME", + key: "FIELDENUM_ID" + }} + /> : ''} + +
+ } // 列表表头 + search={{ span: 6 }} + request={async (params) => { + console.log('selectedIdselectedIdselectedId', selectedId); + if (!selectedId) { + return + } + const req: any = { + SearchParameter: { + PICTURE_TYPES: selectedId, + }, + PageIndex: 1, + PageSize: 999999, + requestEncryption: true + } -
+ setSearchParams(params) + const data = await hanleGetPictureListPost(req) + console.log('tableDatatableData', data); + if (data && data.length > 0) { + return { data, success: true } + } + return { data: [], success: true } + }} + toolbar={{ + actions: [ + + ] + }} + /> +
+ + + {/* 图片预览组件 */} + {fileList && fileList.length > 0 &&
+ { + handleChangePreview(vis) + } + }}> + { + fileList.map((n) => ) + } + +
} + + + { + ModalFormRef?.current?.resetFields() + setCurrentRow(null) + setShowDetail(false) + setFileList([]) + }} + confirmLoading={modalLoading} + width={1400} + bodyStyle={{ + height: '700px', // 你可以根据需要调整高度 + overflowY: 'auto', + }} + destroyOnClose + title={currentRow?.PICTURE_ID ? '编辑图片' : "新增卡券"} + onOk={() => { + ModalFormRef?.current?.validateFields().then(async (res) => { + await handleSynchroImage(res) + }) + }} + footer={ { + // await handleDeleteShopRule(currentRow?.PICTURE_ID) + await handleDeleteImg(currentRow?.PICTURE_ID) + }} + handleCancel={() => { + ModalFormRef?.current?.resetFields() + setCurrentRow(null) + setShowDetail(false) + setFileList([]) + }} + handleOK={() => { + ModalFormRef?.current?.validateFields().then(async (res) => { + await handleSynchroImage(res) + }) + }} + + />} + > + { + if (currentRow?.PICTURE_ID) { + return { + ...currentRow + } + } else { + return { + STAFF_NAME: currentUser.Name, + OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss') + } + } + }} + > + + { + currentRow ? '' : + <> + 上传图片 + { + const formData = new FormData(); + formData.append('files', info.file); + formData.append('TableType', "1203"); + formData.append('ImageName', typeof info.file !== 'string' ? info.file?.name : ''); + if (info.filename) { + const success = await hanleSaveImgFile(formData) + + console.log('successsuccesssuccess', success); + + if (success) { + const list = [{ + uid: `${success.Result_Data.ImageId}`, // 注意,这个uid一定不能少,否则上传失败 + name: success.Result_Data.ImageName, + status: 'done', + url: success.Result_Data.ImageUrl, // url 是展示在页面上的绝对链接 + // imgUrl: success.ImagePath // + success.ImageUrl, + }] + setFileList(list) + } + } else { + message.error("您上传的图片不存在.") + } + } + }} + /> + + } + + 基本信息 + + + + + + + + + + + + + + + + + +
+ ) } export default connect(({ user }: ConnectState) => ({ currentUser: user.currentUser -}))(LibraryInformationManager); \ No newline at end of file +}))(LibraryInformationManager); diff --git a/src/pages/travelMember/WeChatAccountManagement/components/pushTemplate.tsx b/src/pages/travelMember/WeChatAccountManagement/components/pushTemplate.tsx new file mode 100644 index 0000000..6bc3cca --- /dev/null +++ b/src/pages/travelMember/WeChatAccountManagement/components/pushTemplate.tsx @@ -0,0 +1,319 @@ +import { connect } from "umi"; +import type { ConnectState } from "@/models/connect"; +import ProCard from "@ant-design/pro-card"; +import { useEffect, useRef, useState } from "react"; +import { MenuFoldOutlined } from "@ant-design/icons"; +import { Avatar, Divider, FormInstance, Menu, Modal, Tree } from "antd"; +import ProTable, { ActionType } from "@ant-design/pro-table"; +import { handleGetPUSHMODULEList, handleGetRTWECHATPUSHList } from "../service"; +import './style.less' +import { getFieldEnum } from "@/services/options"; +import TemplatePersonnel from "./templatePersonnel"; +import moment from 'moment' +import SubMenu from "antd/lib/menu/SubMenu"; + +type DetailProps = { + parentRow: any // 行数据 + currentUser: any +} +const pushTemplate = ({ parentRow, currentUser }: DetailProps) => { + const actionRef = useRef(); + const formRef = useRef(); + const [collapsible, setCollapsible] = useState(false) + const [treeView, setTreeView] = useState() + // 推送模板的枚举 + const [pushCodeObj, setPushCodeObj] = useState() + const [pushCodeList, setPushCodeList] = useState() + // 树相关的属性和方法 + // const [selectedId, setSelectedId] = useState() + const selectedId = useRef('') + const [showDetail, setShowDetail] = useState(false) + const [currentRow, setCurrentRow] = useState() + const [currenMenu, setCurrenMenu] = useState(); // 当前选中左侧菜单的服务区节点 + + const columns: any = [ + { + dataIndex: 'GROUP_TYPE', + title: '推送类型', + width: 120, + align: 'center', + ellipsis: true, + hideInSearch: true, + valueType: 'select', + request: async () => { + const data = await getFieldEnum({ FieldExplainField: 'GROUP_TYPE' }) + return data + } + }, + { + dataIndex: 'USER_NAME', + title: '用户名称', + width: 120, + align: 'center', + ellipsis: true, + hideInSearch: true + }, + { + dataIndex: 'NICK_NAME', + title: '昵称', + width: 120, + align: 'center', + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return record?.NICK_NAME ? + { + setCurrentRow(record) + setShowDetail(true) + }}>{record?.NICK_NAME} : "" + } + }, + { + dataIndex: 'MOBILEPHONE_NUMBER', + title: '手机号码', + width: 120, + align: 'center', + ellipsis: true, + hideInSearch: true + }, + { + dataIndex: 'BUSINESS_NAME', + title: '商户名称', + width: 120, + align: 'center', + ellipsis: true, + hideInSearch: true + }, + { + dataIndex: 'RTWECHATPUSH_STATE', + title: '有效状态', + width: 120, + align: 'center', + ellipsis: true, + hideInSearch: true, + valueType: 'select', + fieldProps: { + options: [{ label: "有效", value: 1 }, { label: "无效", value: 0 }] + } + }, + { + dataIndex: 'OPERATE_DATE', + title: '操作时间', + width: 180, + align: 'center', + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return record?.OPERATE_DATE ? moment(record?.OPERATE_DATE).format('YYYY-MM-DD HH:mm:ss') : '' + } + }, + ] + + useEffect(async () => { + const req: any = { + SearchParameter: { + WECHATPUBLICSIGN_ID: parentRow?.WECHATPUBLICSIGN_ID, + }, + PageIndex: 1, + PageSize: 999999, + requestEncryption: true + } + const data = await handleGetPUSHMODULEList(req) + setTreeView(data) + let obj: any = {} + let list: any = [] + if (data && data.length > 0) { + data.forEach((item: any) => { + obj[item.PUSHMODULE_CODE] = item.PUSHMODULE_NAME + list.push({ label: item.PUSHMODULE_NAME, value: item.PUSHMODULE_CODE }) + }) + } + setPushCodeList(list) + setPushCodeObj(obj) + }, []) + + // 生成左侧菜单 + const getMenuDom = (data: any[], callback: (item: any) => void) => { + // PUSHMODULE_NAME + // PUSHMODULE_ID + console.log('datadatadatadata', data); + + return (data.map((element: any) => { + if (element) { + // 绑定当前节点的子集 + if (element.children && element.children.length > 0) { + return ( + {element.PUSHMODULE_NAME} + : element.PUSHMODULE_NAME} + key={`${element.nodePUSHMODULE_ID}`} + onTitleClick={(item) => { + // 选中一级菜单 + if (!currenMenu || item.key !== `${currenMenu?.key}`) { + callback.call(callback, item) + } + item.domEvent.stopPropagation(); + }} + > + {element.children && element.children.length > 0 && getMenuDom(element.children, callback)} + + ) + } + // 绑定嵌套树的子节点 + if (element.children && element.children.length > 0) { + return ( + { + // 选中一级菜单 + if (!currenMenu || item.key !== `${currenMenu?.key}`) { + callback.call(callback, item) + } + item.domEvent.stopPropagation(); + }} + > + {element.children && element.children.length > 0 && getMenuDom(element.children, callback)} + + ) + } + return ( + {element.desc !== '0' ? <>{element.PUSHMODULE_NAME} + : element.PUSHMODULE_NAME}) + } + // 绑定嵌套树的子节点 + if (element.children && element.children.length > 0) { + return ( + {element.PUSHMODULE_NAME} + : element.PUSHMODULE_NAME} + key={`${element.PUSHMODULE_ID}`} + onTitleClick={(item) => { + // 选中一级菜单 + if (!currenMenu || item.key !== `${currenMenu?.key}`) { + callback.call(callback, item) + } + item.domEvent.stopPropagation(); + }} + > + {element.children && element.children.length > 0 && getMenuDom(element.children, callback)} + + ) + } + return ({element.desc !== '0' ? <>{element.PUSHMODULE_NAME} + : element.PUSHMODULE_NAME}) + })) + } + // 根据左侧选中的菜单加载右侧数据 + const loadSelectedId = (item?: any) => { + + // 选中的子菜单key + const value = item.key + // setSelectedId(value) + selectedId.current = value + setCurrenMenu('') + actionRef?.current?.reload() + } + + return ( +
+ { + setCollapsible(!collapsible); + }} /> + } + colSpan={!collapsible ? "300px" : "60px"} + title={!collapsible ? "请选择推送模板" : ""} + headerBordered + collapsed={collapsible} + > + + {treeView && treeView.length > 0 && { + loadSelectedId(item) + }} + > + {getMenuDom(treeView, loadSelectedId)} + } + + {/* {treeView && treeView.length > 0 ? { + // 多选逻辑 + const selectedIds = info.checkedNodes.filter((n: any) => n?.key !== '0-0') + setSelectedId(selectedIds.map((n: any) => n?.PUSHMODULE_ID)?.toString() || '') + }} + fieldNames={{ + title: "PUSHMODULE_NAME", + key: "PUSHMODULE_ID" + }} + /> : ''} */} + +
+ { + if (!selectedId.current) { + return + } + const req: any = { + SearchParameter: { + WECHATPUBLICSIGN_ID: parentRow?.WECHATPUBLICSIGN_ID, + PROVINCE_CODES: "530000", + RTWECHATPUSH_STATE: 1, + PUSHMODULE_CODE: selectedId.current + }, + PageIndex: 1, + PageSize: 999999, + SortStr: "ADDTIME desc", + } + + const data = await handleGetRTWECHATPUSHList(req) + if (data && data.length > 0) { + return { data: data, success: true } + } + return { data: [], success: true } + }} + toolbar={{ + actions: [] + }} + /> +
+ + {/* 编辑用户信息 */} + +
+ ) +} + +export default connect(({ user, }: ConnectState) => ({ + currentUser: user.currentUser, +}))(pushTemplate); diff --git a/src/pages/travelMember/WeChatAccountManagement/components/pushTemplateModal.tsx b/src/pages/travelMember/WeChatAccountManagement/components/pushTemplateModal.tsx new file mode 100644 index 0000000..1ab19a8 --- /dev/null +++ b/src/pages/travelMember/WeChatAccountManagement/components/pushTemplateModal.tsx @@ -0,0 +1,277 @@ +import { connect } from "umi"; +import type { ConnectState } from "@/models/connect"; +import { Button, Col, FormInstance, message, Modal, Row } from "antd"; +import ProTable, { ActionType } from "@ant-design/pro-table"; +import { useRef, useState } from "react"; +import { handleGetPUSHMODULEList, handleSynchroPUSHMODULE } from "../service"; +import moment from 'moment' +import ProForm, { ProFormSelect, ProFormText, ProFormTextArea } from "@ant-design/pro-form"; + +type DetailProps = { + onShow: boolean // 显示的判断 + setOnShow: any // 控制是否显示 + parentRow: any // 父级传入的行数据 + currentUser: any // 公参信息 +} +const PushTemplateModal = ({ onShow, setOnShow, parentRow, currentUser }: DetailProps) => { + const actionRef = useRef(); + const ModalFormRef = useRef(); + const formRef = useRef(); + // 显示同步抽屉 + const [updateModal, setUpdateModal] = useState(false) + // 当前行数据 + const [currentRow, setCurrentRow] = useState() + + const columns: any = [ + { + dataIndex: 'PUSHMODULE_NUM', + title: '模板序号', + width: 150, + align: 'center', + ellipsis: true, + hideInSearch: true, + }, + { + dataIndex: 'PUSHMODULE_NAME', + title: '模板名称', + width: 150, + align: 'center', + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return record?.PUSHMODULE_NAME ? { + setCurrentRow(record) + setUpdateModal(true) + }}>{record?.PUSHMODULE_NAME} : "" + } + }, + { + dataIndex: 'PUSHMODULE_CODE', + title: '模板编码', + width: 250, + align: 'center', + ellipsis: true, + hideInSearch: true, + }, + { + dataIndex: 'PUSHMODULE_INDEX', + title: '模板索引', + width: 100, + align: 'center', + ellipsis: true, + hideInSearch: true, + }, + { + dataIndex: 'PUSHMODULE_STATE', + title: '模板状态', + width: 100, + align: 'center', + ellipsis: true, + hideInSearch: true, + valueType: 'select', + fieldProps: { + options: [{ label: "有效", value: 1 }, { label: "无效", value: 0 }] + } + }, + { + dataIndex: 'STAFF_NAME', + title: '操作员名称', + width: 120, + align: 'center', + ellipsis: true, + hideInSearch: true, + }, + { + dataIndex: 'OPERATE_DATE', + title: '操作时间', + width: 180, + align: 'center', + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return record?.OPERATE_DATE ? moment(record?.OPERATE_DATE).format('YYYY-MM-DD HH:mm:ss') : "" + } + }, + { + dataIndex: 'PUSHMODULE_DESC', + title: '备注', + width: 250, + align: 'center', + ellipsis: true, + hideInSearch: true, + }, + ] + + // 同步推送模板信息 + const handleUpdatePushModal = async (res: any) => { + let req: any = {} + if (currentRow?.PUSHMODULE_ID) { + req = { + WECHATPUBLICSIGN_ID: parentRow?.WECHATPUBLICSIGN_ID, + ...currentRow, + ...res, + STAFF_ID: currentUser?.ID, + STAFF_NAME: currentUser?.Name, + OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss') + } + } else { + req = { + ...res, + WECHATPUBLICSIGN_ID: parentRow?.WECHATPUBLICSIGN_ID, + STAFF_ID: currentUser?.ID, + STAFF_NAME: currentUser?.Name, + OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'), + ADDTIME: moment().format('YYYY-MM-DD HH:mm:ss'), + } + } + const data = await handleSynchroPUSHMODULE(req) + + console.log('datadatadatadata', data); + if (data.Result_Code === 100) { + message.success(data.Result_Desc) + setCurrentRow(null) + setUpdateModal(false) + actionRef.current?.reload() + } else { + message.error(data.Result_Desc) + } + } + + return ( +
+ { + setOnShow(false) + }} + width={1400} + bodyStyle={{ + height: '700px', // 你可以根据需要调整高度 + overflowY: 'auto', + }} + destroyOnClose + title={""} + footer={false} + > + { + const req: any = { + SearchParameter: { + WECHATPUBLICSIGN_ID: parentRow?.WECHATPUBLICSIGN_ID, + PUSHMODULE_STATE: 1 + }, + PageIndex: 1, + PageSize: 999999, + SortStr: "ADDTIME desc", + requestEncryption: true + } + const data = await handleGetPUSHMODULEList(req) + console.log('datadatadatadatadatadata222', data); + if (data && data.length > 0) { + return { data, success: true } + } + return { data: [], success: true } + }} + toolbar={{ + actions: [ + + ] + }} + /> + + + + { + setCurrentRow(null) + setUpdateModal(false) + }} + width={1400} + bodyStyle={{ + height: '700px', // 你可以根据需要调整高度 + overflowY: 'auto', + }} + destroyOnClose + title={currentRow?.PUSHMODULE_NAME || "新增模板"} + onOk={() => { + ModalFormRef?.current?.validateFields().then(async (res) => { + handleUpdatePushModal(res) + }) + }} + > + + + + + + + + + + + + + + + + + + + + + + + + +
+ ) +} + +export default connect(({ user, }: ConnectState) => ({ + currentUser: user.currentUser, +}))(PushTemplateModal); diff --git a/src/pages/travelMember/WeChatAccountManagement/components/style.less b/src/pages/travelMember/WeChatAccountManagement/components/style.less new file mode 100644 index 0000000..dea472a --- /dev/null +++ b/src/pages/travelMember/WeChatAccountManagement/components/style.less @@ -0,0 +1,9 @@ +.pushTemplate { + .ant-pro-card-body { + + .ant-tree-list { + + .ant-tree-list-holder {} + } + } +} \ No newline at end of file diff --git a/src/pages/travelMember/WeChatAccountManagement/components/templatePersonnel.tsx b/src/pages/travelMember/WeChatAccountManagement/components/templatePersonnel.tsx new file mode 100644 index 0000000..8a8bae8 --- /dev/null +++ b/src/pages/travelMember/WeChatAccountManagement/components/templatePersonnel.tsx @@ -0,0 +1,584 @@ +import { connect } from "umi"; +import type { ConnectState } from "@/models/connect"; +import { Button, Col, Divider, FormInstance, message, Modal, Row } from "antd"; +import { useRef, useState } from "react"; +import ModalFooter from "../../scenicSpotConfig/component/modalFooter"; +import ProForm, { ProFormSelect, ProFormText, ProFormTextArea } from "@ant-design/pro-form"; +import ProTable, { ActionType } from "@ant-design/pro-table"; +import { getFieldEnum } from "@/services/options"; +import moment from 'moment' +import { handleDeleteRTWECAHTPUSHDTAIL, handleDeleteRTWECHATPUSH, handleGetBindingOwnerUnitDDL, handleGetRTWECAHTPUSHDTAILList, handleSynchroRTWECAHTPUSHDTAIL, handleSynchroRTWECHATPUSH } from "../service"; +import e from "express"; + +type DetailProps = { + onShow: any + setOnShow: any + parentRow: any + setParentRow: any + PUSH_MODULE?: any // 推送模板内容 对象形式 + PUSH_MODULEList?: any + currentUser: any + parentTableRef: any // 父级表格的实例 +} +const TemplatePersonnel = ({ onShow, setOnShow, parentRow, setParentRow, PUSH_MODULE, PUSH_MODULEList, currentUser, parentTableRef }: DetailProps) => { + const actionRef = useRef(); + const formRef = useRef(); + const ModalFormRef = useRef(); + const UpdateFormRef = useRef(); + // 显示编辑权限的悬浮框 + const [showUpdateModal, setShowUpdateModal] = useState(false) + // 人员权限行数据 + const [currentRow, setCurrentRow] = useState() + // 权限的确认loading效果 + const [permissionLoading, setPermissionLoading] = useState(false) + // 人员信息的loading + const [userInfoLoading, setUserInfoLoading] = useState(false) + + const columns: any = [ + { + dataIndex: 'GROUP_TYPE', + title: '推送类型', + width: 150, + align: 'center', + ellipsis: true, + hideInSearch: true, + valueType: 'select', + request: async () => { + const data = await getFieldEnum({ FieldExplainField: 'GROUP_TYPE' }) + return data + } + }, + { + dataIndex: 'BUSINESS_NAME', + title: '商户名称', + width: 150, + align: 'center', + ellipsis: true, + hideInSearch: true + }, + { + dataIndex: 'PROVINCE_CODE', + title: '所属业主', + width: 250, + align: 'center', + ellipsis: true, + hideInSearch: true, + valueType: 'select', + request: async () => { + const data = await handleGetBindingOwnerUnitDDL({ DataType: 0 }) + return data + } + }, + { + dataIndex: 'SERVERPART_IDS', + title: '管辖区域', + width: 150, + align: 'center', + ellipsis: true, + hideInSearch: true + }, + { + dataIndex: 'PUSH_MODULE', + title: '推送模板', + width: 150, + align: 'center', + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + let str: string = '' + let list: any = record?.PUSH_MODULE ? record?.PUSH_MODULE.split(',') : [] + if (list && list.length > 0) { + list.forEach((item: string) => { + if (str) { + str += PUSH_MODULE && item ? `,${PUSH_MODULE[item]}` : "" + } else { + str = PUSH_MODULE && item ? `${PUSH_MODULE[item]}` : "" + } + }) + } + return PUSH_MODULE && str ? { + setCurrentRow(record) + setShowUpdateModal(true) + }}> + {str} + : '-' + } + }, + { + dataIndex: 'RTWECAHTPUSHDTAIL_STATE', + title: '有效状态', + width: 120, + align: 'center', + ellipsis: true, + hideInSearch: true, + valueType: 'select', + fieldProps: { + options: [{ label: "有效", value: 1 }, { label: "无效", value: 0 }] + } + }, + { + dataIndex: 'STAFF_NAME', + title: '操作员名称', + width: 120, + align: 'center', + ellipsis: true, + hideInSearch: true + }, + { + dataIndex: 'OPERATE_DATE', + title: '操作时间', + width: 180, + align: 'center', + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return record?.OPERATE_DATE ? moment(record?.OPERATE_DATE).format('YYYY-MM-DD HH:mm:ss') : '-' + } + } + ] + + // 同步人员权限信息列表 + const handleUpdateUserInfo = async (obj: any) => { + let req: any = {} + + if (currentRow?.RTWECHATPUSH_ID) { + req = { + ...currentRow, + ...obj, + PUSH_MODULE: obj.PUSH_MODULE.toString(), + STAFF_ID: currentUser.ID, + STAFF_NAME: currentUser.Name, + OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'), + } + } else { + req = { + ...obj, + RTWECHATPUSH_ID: currentRow?.RTWECHATPUSH_ID || parentRow?.RTWECHATPUSH_ID, + PUSH_MODULE: obj.PUSH_MODULE.toString(), + STAFF_ID: currentUser.ID, + STAFF_NAME: currentUser.Name, + OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'), + ADDTIME: moment().format('YYYY-MM-DD HH:mm:ss'), + } + } + + const data = await handleSynchroRTWECAHTPUSHDTAIL(req) + console.log('datadata', data); + setPermissionLoading(false) + if (data.Result_Code === 100) { + message.success(data.Result_Desc) + setCurrentRow(null) + setShowUpdateModal(false) + actionRef.current?.reload() + } else { + message.error(data.Result_Desc) + } + } + + // 删除同步人员权限信息 + const handleDeleteUserInfo = async (id: any) => { + const req: any = { + RTWECAHTPUSHDTAILId: id + } + const data = await handleDeleteRTWECAHTPUSHDTAIL(req) + if (data.Result_Code === 100) { + message.success(data.Result_Desc) + setCurrentRow(null) + setShowUpdateModal(false) + actionRef.current?.reload() + } else { + message.error(data.Result_Desc) + } + } + + // 同步人员信息 + const handleUpdatePersonInfo = async (obj: any) => { + const req: any = { + ...parentRow, + ...obj, + STAFF_ID: currentUser.ID, + STAFF_NAME: currentUser.Name, + OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss'), + } + + const data = await handleSynchroRTWECHATPUSH(req) + setUserInfoLoading(false) + if (data.Result_Code === 100) { + message.success(data.Result_Desc) + ModalFormRef?.current?.resetFields() + setParentRow(null) + setOnShow(false) + if (parentTableRef) { + parentTableRef.current?.reload() + } + } else { + message.error(data.Result_Desc) + } + } + + // 删除同步人员信息 + const handleDeleteUser = async (id: string) => { + const req: any = { + RTWECHATPUSHId: id + } + const data = await handleDeleteRTWECHATPUSH(req) + if (data.Result_Code === 100) { + message.success(data.Result_Desc) + ModalFormRef?.current?.resetFields() + setParentRow(null) + setOnShow(false) + if (parentTableRef) { + parentTableRef.current?.reload() + } + } else { + message.error(data.Result_Desc) + } + } + + return ( +
+ { + ModalFormRef?.current?.resetFields() + setParentRow(null) + setOnShow(false) + }} + width={1400} + bodyStyle={{ + height: '700px', // 你可以根据需要调整高度 + overflowY: 'auto', + }} + destroyOnClose + title={parentRow?.RTWECHATPUSH_ID ? '编辑用户信息' : "新增用户信息"} + onOk={() => { + ModalFormRef?.current?.validateFields().then(async (res) => { + setUserInfoLoading(true) + await handleUpdatePersonInfo(res) + }) + }} + footer={ { + handleDeleteUser(parentRow?.RTWECHATPUSH_ID) + }} + handleCancel={() => { + ModalFormRef?.current?.resetFields() + setParentRow(null) + setOnShow(false) + }} + confirmLoading={userInfoLoading} + handleOK={() => { + ModalFormRef?.current?.validateFields().then(async (res) => { + setUserInfoLoading(true) + await handleUpdatePersonInfo(res) + }) + }} + + />} + > + 用户信息 + { + return { + ...parentRow, + ADDTIME: parentRow?.ADDTIME ? moment(parentRow?.ADDTIME).format('YYYY-MM-DD HH:mm:ss') : '', + OPERATE_DATE: parentRow?.OPERATE_DATE ? moment(parentRow?.OPERATE_DATE).format('YYYY-MM-DD HH:mm:ss') : '', + } + }} + > + + + { + const data = await getFieldEnum({ FieldExplainField: 'GROUP_TYPE' }) + return data + }} + /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 推送权限 + + { + console.log('parentRow', parentRow); + + const req: any = { + SearchParameter: { + RTWECHATPUSH_ID: parentRow?.RTWECHATPUSH_ID, + RTWECAHTPUSHDTAIL_STATE: 1 + }, + PageIndex: 1, + PageSize: 999999, + } + const data = await handleGetRTWECAHTPUSHDTAILList(req) + if (data && data.length > 0) { + return { data, success: true } + } + return { data: [], success: true } + }} + toolbar={{ + actions: [ + + ] + }} + /> + + + { + UpdateFormRef?.current?.resetFields() + setCurrentRow(null) + setShowUpdateModal(false) + }} + width={1200} + bodyStyle={{ + height: '700px', // 你可以根据需要调整高度 + overflowY: 'auto', + }} + destroyOnClose + title={currentRow?.RTWECHATPUSH_ID ? '编辑用户信息' : "新增用户信息"} + onOk={() => { + UpdateFormRef?.current?.validateFields().then(async (res) => { + setPermissionLoading(true) + handleUpdateUserInfo(res) + }) + }} + confirmLoading={permissionLoading} + footer={ { + handleDeleteUserInfo(currentRow?.RTWECAHTPUSHDTAIL_ID) + }} + handleCancel={() => { + UpdateFormRef?.current?.resetFields() + setCurrentRow(null) + setShowUpdateModal(false) + }} + handleOK={() => { + UpdateFormRef?.current?.validateFields().then(async (res) => { + setPermissionLoading(true) + handleUpdateUserInfo(res) + }) + }} + confirmLoading={permissionLoading} + />} + > + { + if (currentRow) { + let list: any = currentRow?.PUSH_MODULE.split(',') || "" + + return { + ...currentRow, + PUSH_MODULE: list + } + } else { + return {} + } + }} + > + + + + + + + + + { + const data = await handleGetBindingOwnerUnitDDL({ DataType: 0 }) + return data + }} + /> + + + { + const data = await getFieldEnum({ FieldExplainField: 'GROUP_TYPE' }) + return data + }} + /> + + + + + { + currentRow?.RTWECHATPUSH_ID ? <> + + + + + + + : "" + } + + + + + + + + +
+ ) +} + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.currentUser, +}))(TemplatePersonnel); diff --git a/src/pages/travelMember/WeChatAccountManagement/index.tsx b/src/pages/travelMember/WeChatAccountManagement/index.tsx new file mode 100644 index 0000000..6d22b2e --- /dev/null +++ b/src/pages/travelMember/WeChatAccountManagement/index.tsx @@ -0,0 +1,139 @@ +import { connect } from "umi"; +import type { CurrentUser } from "umi"; +import type { ConnectState } from "@/models/connect"; +import React, { useRef, useState } from "react"; +import type { FormInstance } from "antd"; +import { Button, Divider, message, Modal, } from "antd"; +import type { ActionType } from "@ant-design/pro-table"; +import ProTable from "@ant-design/pro-table"; +import PageTitleBox from "@/components/PageTitleBox"; +import { handleGetWECHATPUBLICSIGNList } from "./service"; +import ProForm, { ProFormUploadButton } from "@ant-design/pro-form"; +import moment from 'moment' +import PushTemplate from "./components/pushTemplate"; +import PushTemplateModal from "./components/pushTemplateModal"; + + +const WeChatAccountManagement: React.FC<{ currentUser: CurrentUser }> = (props) => { + const { currentUser } = props + const actionRef = useRef(); + const formRef = useRef(); + const ModalFormRef = useRef(); + + const [showDetail, setShowDetail] = useState(false) + const [currentRow, setCurrentRow] = useState() + // 图片信息 + const [fileList, setFileList] = useState() + const [modalLoading, setModalLoading] = useState(false) + // 同步推送模板的悬浮框内容 + const [updatePushTemplateModal, setUpdatePushTemplateModal] = useState(false) + + + const columns: any = [ + { + dataIndex: 'WECHATPUBLICSIGN_NAME', + title: '公众号名称', + width: 150, + align: 'center', + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return record?.WECHATPUBLICSIGN_NAME ? { + setCurrentRow(record) + setShowDetail(true) + }}>{record?.WECHATPUBLICSIGN_NAME} : "" + } + }, + { + dataIndex: 'OWNERUNIT_NAME', + title: '业主单位', + width: 150, + align: 'center', + ellipsis: true, + hideInSearch: true + } + ] + + + return ( +
+
+
+ } // 列表表头 + search={{ span: 6 }} + request={async (params) => { + const req: any = { + SearchParameter: { + WECHATPUBLICSIGN_ID: 3 + }, + PageIndex: 1, + PageSize: 999999, + } + const data = await handleGetWECHATPUBLICSIGNList(req) + if (data && data.length > 0) { + return { data, success: true } + } + return { data: [], success: true } + }} + toolbar={{ + actions: [ + ] + }} + /> +
+ + + { + ModalFormRef?.current?.resetFields() + setCurrentRow(null) + setShowDetail(false) + setFileList([]) + }} + confirmLoading={modalLoading} + width={1400} + bodyStyle={{ + height: '700px', // 你可以根据需要调整高度 + overflowY: 'auto', + }} + destroyOnClose + title={currentRow?.WECHATPUBLICSIGN_NAME || ""} + onOk={() => { + ModalFormRef?.current?.validateFields().then(async (res) => { + }) + }} + footer={
+ +
} + > + +
+ + + {/* 设置推送模板的悬浮框 */} + +
+
+ ) +} + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.currentUser +}))(WeChatAccountManagement); diff --git a/src/pages/travelMember/WeChatAccountManagement/service.ts b/src/pages/travelMember/WeChatAccountManagement/service.ts new file mode 100644 index 0000000..c6a8697 --- /dev/null +++ b/src/pages/travelMember/WeChatAccountManagement/service.ts @@ -0,0 +1,122 @@ +import request from '@/utils/request'; + +// 获取微信公众号列表 +export async function handleGetWECHATPUBLICSIGNList(params: any) { + const data = await request(`/WeChat/GetWECHATPUBLICSIGNList`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data.List +} + +// 获取推送模板列表 +export async function handleGetPUSHMODULEList(params: any) { + const data = await request(`/WeChat/GetPUSHMODULEList`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data.List +} + +// 获取推送模板列表 +export async function handleGetRTWECHATPUSHList(params: any) { + const data = await request(`/WeChat/GetRTWECHATPUSHList`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data.List +} + +// 同步推送模板 +export async function handleSynchroPUSHMODULE(params: any) { + const data = await request(`/WeChat/SynchroPUSHMODULE`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return data + } + return data +} + +// 获取人员推送权限表列表 +export async function handleGetRTWECAHTPUSHDTAILList(params: any) { + const data = await request(`/WeChat/GetRTWECAHTPUSHDTAILList`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data.List +} + +// 获取业主单位 +export async function handleGetBindingOwnerUnitDDL(params: any) { + const data = await request(`/BaseInfo/BindingOwnerUnitDDL`, { + method: 'GET', + params + }) + if (data.Result_Code !== 100) { + return [] + } + return data.Result_Data.List +} + +// 同步人员推送权限表 +export async function handleSynchroRTWECAHTPUSHDTAIL(params: any) { + const data = await request(`/WeChat/SynchroRTWECAHTPUSHDTAIL`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data +} + + +// 删除人员推送权限表 +export async function handleDeleteRTWECAHTPUSHDTAIL(params: any) { + const data = await request(`/WeChat/DeleteRTWECAHTPUSHDTAIL`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data +} + +// 同步人员信息表 +export async function handleSynchroRTWECHATPUSH(params: any) { + const data = await request(`/WeChat/SynchroRTWECHATPUSH`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data +} + +// 删除人员信息表 +export async function handleDeleteRTWECHATPUSH(params: any) { + const data = await request(`/WeChat/DeleteRTWECHATPUSH`, { + method: 'POST', + data: { ...params, requestEncryption: true } + }) + if (data.Result_Code !== 100) { + return [] + } + return data +} \ No newline at end of file diff --git a/src/services/options/index.ts b/src/services/options/index.ts index f812a9b..dbb4ae8 100644 --- a/src/services/options/index.ts +++ b/src/services/options/index.ts @@ -79,6 +79,19 @@ export async function getFieldEnumTreeNoSession(params: any) { } +export async function handleGetFIELDENUMList(params: any) { + const data = await request(`/Dictionary/GetFIELDENUMList`, { + method: 'POST', + data: params, + }); + if (data.Result_Code !== 100) { + return []; + } + + return data.Result_Data.List +} + + // 新枚举方法 export async function getFieldGetFieEnumList(params: any) { const data = await request(`/Dictionary/GetFieEnumList`, { diff --git a/src/services/picture.ts b/src/services/picture.ts index 6c0483a..4271979 100644 --- a/src/services/picture.ts +++ b/src/services/picture.ts @@ -36,6 +36,68 @@ export async function SavePicture(uploadFilds?: any) { } +// post的同步图片 +export async function hanleSynchroPICTURE(params: any) { + const data = await request(`/Picture/SynchroPICTURE`, { + method: 'POST', + data: params + }) + + if (data.Result_Code !== 100) { + return data + } + return data +} + + +// post的获取图片 +export async function hanleGetPictureListPost(params: any) { + const data = await request(`/Picture/GetPictureList`, { + method: 'POST', + data: params + }) + + if (data.Result_Code !== 100) { + return { + data: [], + current: 1, + pageSize: 10, + total: 0, + success: false + } + } + return data.Result_Data.List +} + +// post加密生成图片地址的 +export async function hanleSaveImgFile(params: any) { + const data = await requestAHYD(`/Picture/SaveImgFile`, { + method: 'POST', + data: params + }) + + if (data.Result_Code !== 100) { + return data + } + return data +} + + + +// post的删除图片 +export async function hanleDeletePICTURE(params: any) { + const data = await request(`/Picture/DeletePICTUREData`, { + method: 'POST', + data: params + }) + + if (data.Result_Code !== 100) { + return data + } + return data +} + + // 获取附件图片 export async function getPictureList(id: number, TableType?: string) { const data = await request(`/Picture/GetPictureList?TableId=${id}&TableType=${TableType || ''}`, { diff --git a/src/versionEnv.ts b/src/versionEnv.ts index d0c27a6..ab5fc23 100644 --- a/src/versionEnv.ts +++ b/src/versionEnv.ts @@ -1,4 +1,4 @@ // 由 scripts/writeVersion.js 自动生成 -export const VERSION = "4.5.77"; -export const GIT_HASH = "1cd8c40"; -export const BUILD_TIME = "2025-11-18T09:36:29.591Z"; +export const VERSION = "4.5.79"; +export const GIT_HASH = "c45e6b0"; +export const BUILD_TIME = "2025-11-28T11:05:07.039Z";