update
This commit is contained in:
parent
c45e6b046f
commit
8188ef3135
@ -470,6 +470,12 @@ export default [
|
||||
name: 'InvestmentInformation',
|
||||
component: './travelMember/InvestmentInformation/index'
|
||||
},
|
||||
// 微信公众号管理-消息推送
|
||||
{
|
||||
path: 'WeChatAccountManagement',
|
||||
name: 'WeChatAccountManagement',
|
||||
component: './travelMember/WeChatAccountManagement/index'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@ -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": {
|
||||
|
||||
@ -621,19 +621,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (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<BasicLayoutProps> = (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<BasicLayoutProps> = (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({
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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 {
|
||||
// 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,
|
||||
</Card>
|
||||
<Card title="授予账号权限" style={{ marginTop: 24 }} bordered={false} size="default">
|
||||
<Row gutter={24}>
|
||||
{/* {
|
||||
{
|
||||
tableTab === '1000' || tableTab === '4000' || tableTab === '9000' ?
|
||||
<Col span={8}>
|
||||
{serverpartTree &&
|
||||
@ -1088,9 +1093,8 @@ const Edit = ({ tableTab, openType, detail, reloadTable, currentUser, selectTab,
|
||||
</Form.Item>
|
||||
</Card>}
|
||||
</Col>
|
||||
|
||||
: ''
|
||||
} */}
|
||||
}
|
||||
|
||||
{/* {(currentUser?.UserPattern === 9000 ? initialDetail.USER_PATTERN === 1000 : currentUser?.UserPattern === 1000) && } */}
|
||||
|
||||
|
||||
@ -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
|
||||
})
|
||||
|
||||
@ -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,
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
|
||||
@ -1,11 +1,467 @@
|
||||
// 图库信息管理
|
||||
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<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const [collapsible, setCollapsible] = useState<boolean>(false)
|
||||
const [treeView, setTreeView] = useState<any>()
|
||||
// 左侧树的枚举
|
||||
const [treeViewObj, setTreeViewObj] = useState<any>()
|
||||
// 拿到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<any>()
|
||||
// 树相关的属性和方法
|
||||
const [selectedId, setSelectedId] = useState<string>()
|
||||
// 查询的条件
|
||||
const [searchParams, setSearchParams] = useState<any>()
|
||||
const [imagePreviewVisible, setImagePreviewVisible] = useState<boolean>(false) // 预览图片
|
||||
const handleChangePreview = (val: any) => {
|
||||
setImagePreviewVisible(val)
|
||||
}
|
||||
// 详情
|
||||
const [showDetail, setShowDetail] = useState<boolean>(false)
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
const [modalLoading, setModalLoading] = useState<boolean>(false)
|
||||
const ModalFormRef = useRef<FormInstance>();
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
dataIndex: "PICTURE_URL",
|
||||
hideInSearch: true,
|
||||
width: 200,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
render: (_, record) => {
|
||||
return record?.PICTURE_URL ? <img style={{ width: '50px', height: '50px', borderRadius: '50%', cursor: 'pointer' }} onClick={() => {
|
||||
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 ? <a onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setShowDetail(true)
|
||||
}}>
|
||||
{`${record?.PICTURE_NAME ? record?.PICTURE_NAME : ""}${record?.PICTURE_TYPE && treeViewObj[record?.PICTURE_TYPE] ? `【${treeViewObj[record?.PICTURE_TYPE]}】` : ""}`}
|
||||
</a> : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
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 (
|
||||
// <Space>
|
||||
// <a
|
||||
// onClick={() => {
|
||||
// setCurrentRow(record)
|
||||
// setShowDetail(true)
|
||||
// }}
|
||||
// >
|
||||
// 编辑
|
||||
// </a>
|
||||
// <Popconfirm
|
||||
// title="确认删除该图片吗?"
|
||||
// onConfirm={async () => {
|
||||
// await handleDeleteImg(record?.PICTURE_ID)
|
||||
// }}
|
||||
// >
|
||||
// <a>删除</a>
|
||||
// </Popconfirm>
|
||||
// </Space>
|
||||
// );
|
||||
// },
|
||||
// },
|
||||
]
|
||||
|
||||
// 同步图片信息
|
||||
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 (
|
||||
<div>
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
<ProCard
|
||||
style={{ width: !collapsible ? "300px" : "60px" }}
|
||||
className="pageTable-leftnav"
|
||||
bodyStyle={{ padding: 0, paddingTop: 20, paddingLeft: 20, width: !collapsible ? "300px" : "60px" }}
|
||||
extra={
|
||||
<MenuFoldOutlined onClick={() => {
|
||||
setCollapsible(!collapsible);
|
||||
}} />
|
||||
}
|
||||
colSpan={!collapsible ? "300px" : "60px"}
|
||||
title={!collapsible ? "请选择图库类型" : ""}
|
||||
headerBordered
|
||||
collapsed={collapsible}
|
||||
>
|
||||
{treeView && treeView.length > 0 ? <Tree
|
||||
checkable
|
||||
treeData={[{
|
||||
FIELDENUM_NAME: '全部',
|
||||
FIELDENUM_ID: 0,
|
||||
key: '0-0',
|
||||
children: treeView
|
||||
}]}
|
||||
blockNode
|
||||
defaultExpandedKeys={['0-0']}
|
||||
defaultExpandAll={true}
|
||||
onCheck={(checkedKeys: React.Key[] | any, info) => {
|
||||
// 多选逻辑
|
||||
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"
|
||||
}}
|
||||
/> : ''}
|
||||
</ProCard>
|
||||
<div style={{
|
||||
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
paddingRight: 0
|
||||
}}>
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
formRef={formRef}
|
||||
columns={columns}
|
||||
bordered
|
||||
expandable={{
|
||||
expandRowByClick: true
|
||||
}}
|
||||
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||
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: [
|
||||
<Button type={'primary'} onClick={() => {
|
||||
setShowDetail(true)
|
||||
}}>添加图片</Button>
|
||||
]
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
{/* 图片预览组件 */}
|
||||
{fileList && fileList.length > 0 && <div style={{ display: 'none' }}>
|
||||
<Image.PreviewGroup
|
||||
preview={{
|
||||
visible: imagePreviewVisible,
|
||||
onVisibleChange: vis => {
|
||||
handleChangePreview(vis)
|
||||
}
|
||||
}}>
|
||||
{
|
||||
fileList.map((n) => <Image src={n.url} key={n.url} />)
|
||||
}
|
||||
</Image.PreviewGroup>
|
||||
</div>}
|
||||
|
||||
|
||||
<Modal
|
||||
open={showDetail}
|
||||
onCancel={() => {
|
||||
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={<ModalFooter
|
||||
hideDelete={!currentRow?.PICTURE_ID}
|
||||
handleDelete={async () => {
|
||||
// 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)
|
||||
})
|
||||
}}
|
||||
|
||||
/>}
|
||||
>
|
||||
<ProForm
|
||||
formRef={ModalFormRef}
|
||||
layout={'horizontal'}
|
||||
submitter={false}
|
||||
labelCol={{ style: { width: 80 } }}
|
||||
request={async () => {
|
||||
if (currentRow?.PICTURE_ID) {
|
||||
return {
|
||||
...currentRow
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
STAFF_NAME: currentUser.Name,
|
||||
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss')
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
||||
{
|
||||
currentRow ? '' :
|
||||
<>
|
||||
<Divider orientation="left">上传图片</Divider>
|
||||
<ProFormUploadButton
|
||||
name="PICTURE_URL"
|
||||
label="上传图片"
|
||||
fileList={fileList}
|
||||
listType="picture-card"
|
||||
accept="image/*"
|
||||
fieldProps={{
|
||||
beforeUpload,
|
||||
maxCount: 1,
|
||||
onPreview: handleChangePreview,
|
||||
customRequest: async (info) => {
|
||||
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("您上传的图片不存在.")
|
||||
}
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</>
|
||||
}
|
||||
|
||||
<Divider orientation="left">基本信息</Divider>
|
||||
<Row gutter={8}>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
label={"图片类型"}
|
||||
name={"PICTURE_TYPE"}
|
||||
options={treeView}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择图片类型'
|
||||
}
|
||||
]}
|
||||
fieldProps={{
|
||||
fieldNames: {
|
||||
label: "FIELDENUM_NAME",
|
||||
value: "FIELDENUM_ID"
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
label={"图片名称"}
|
||||
name={"PICTURE_NAME"}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入图片名称'
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
label={"操作人"}
|
||||
name={"STAFF_NAME"}
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
label={"操作时间"}
|
||||
name={"OPERATE_DATE"}
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</ProForm>
|
||||
</Modal>
|
||||
|
||||
</div>
|
||||
</div >
|
||||
)
|
||||
}
|
||||
|
||||
@ -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<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const [collapsible, setCollapsible] = useState<boolean>(false)
|
||||
const [treeView, setTreeView] = useState<any>()
|
||||
// 推送模板的枚举
|
||||
const [pushCodeObj, setPushCodeObj] = useState<any>()
|
||||
const [pushCodeList, setPushCodeList] = useState<any>()
|
||||
// 树相关的属性和方法
|
||||
// const [selectedId, setSelectedId] = useState<string>()
|
||||
const selectedId = useRef<string>('')
|
||||
const [showDetail, setShowDetail] = useState<boolean>(false)
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
const [currenMenu, setCurrenMenu] = useState<any>(); // 当前选中左侧菜单的服务区节点
|
||||
|
||||
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 ?
|
||||
<a onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setShowDetail(true)
|
||||
}}>{record?.NICK_NAME}</a> : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
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 (
|
||||
<SubMenu title={element.desc !== '0' ? <><span>{element.PUSHMODULE_NAME}</span>
|
||||
</> : 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)}
|
||||
</SubMenu>
|
||||
)
|
||||
}
|
||||
// 绑定嵌套树的子节点
|
||||
if (element.children && element.children.length > 0) {
|
||||
return (
|
||||
<SubMenu title={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)}
|
||||
</SubMenu>
|
||||
)
|
||||
}
|
||||
return (<Menu.Item
|
||||
key={`${element.PUSHMODULE_ID}`}>
|
||||
{element.desc !== '0' ? <><span>{element.PUSHMODULE_NAME}</span>
|
||||
</> : element.PUSHMODULE_NAME}</Menu.Item>)
|
||||
}
|
||||
// 绑定嵌套树的子节点
|
||||
if (element.children && element.children.length > 0) {
|
||||
return (
|
||||
<SubMenu title={element.desc !== '0' ? <><span>{element.PUSHMODULE_NAME}</span>
|
||||
</> : 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)}
|
||||
</SubMenu>
|
||||
)
|
||||
}
|
||||
return (<Menu.Item key={`${element.PUSHMODULE_ID}`}>{element.desc !== '0' ? <><span>{element.PUSHMODULE_NAME}</span>
|
||||
</> : element.PUSHMODULE_NAME}</Menu.Item>)
|
||||
}))
|
||||
}
|
||||
// 根据左侧选中的菜单加载右侧数据
|
||||
const loadSelectedId = (item?: any) => {
|
||||
|
||||
// 选中的子菜单key
|
||||
const value = item.key
|
||||
// setSelectedId(value)
|
||||
selectedId.current = value
|
||||
setCurrenMenu('')
|
||||
actionRef?.current?.reload()
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={{ display: 'flex' }}>
|
||||
<ProCard
|
||||
style={{ width: !collapsible ? "300px" : "60px" }}
|
||||
className="pushTemplate"
|
||||
bodyStyle={{ padding: '0', width: !collapsible ? "300px" : "60px" }}
|
||||
extra={
|
||||
<MenuFoldOutlined onClick={() => {
|
||||
setCollapsible(!collapsible);
|
||||
}} />
|
||||
}
|
||||
colSpan={!collapsible ? "300px" : "60px"}
|
||||
title={!collapsible ? "请选择推送模板" : ""}
|
||||
headerBordered
|
||||
collapsed={collapsible}
|
||||
>
|
||||
|
||||
{treeView && treeView.length > 0 && <Menu
|
||||
mode="inline"
|
||||
style={{ height: 'calc(100vh - 220px)', overflowY: 'auto', overflowX: 'hidden' }}
|
||||
// selectedKeys={ }
|
||||
onSelect={(item, key, keyPath, selectedKeys, domEvent) => {
|
||||
loadSelectedId(item)
|
||||
}}
|
||||
>
|
||||
{getMenuDom(treeView, loadSelectedId)}
|
||||
</Menu>}
|
||||
|
||||
{/* {treeView && treeView.length > 0 ? <Tree
|
||||
checkable
|
||||
treeData={[{
|
||||
PUSHMODULE_NAME: '全部推送模板',
|
||||
PUSHMODULE_ID: 0,
|
||||
key: '0-0',
|
||||
children: treeView
|
||||
}]}
|
||||
blockNode
|
||||
defaultExpandedKeys={['0-0']}
|
||||
defaultExpandAll={true}
|
||||
onCheck={(checkedKeys: React.Key[] | any, info) => {
|
||||
// 多选逻辑
|
||||
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"
|
||||
}}
|
||||
/> : ''} */}
|
||||
</ProCard>
|
||||
<div style={{
|
||||
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
paddingRight: 0
|
||||
}}>
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
formRef={formRef}
|
||||
columns={columns}
|
||||
bordered
|
||||
expandable={{
|
||||
expandRowByClick: true
|
||||
}}
|
||||
scroll={{ x: "100%", y: "400px" }}
|
||||
headerTitle={""} // 列表表头
|
||||
search={{ span: 6 }}
|
||||
request={async (params) => {
|
||||
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: []
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* 编辑用户信息 */}
|
||||
<TemplatePersonnel onShow={showDetail} setOnShow={setShowDetail} parentRow={currentRow} setParentRow={setCurrentRow} PUSH_MODULE={pushCodeObj} PUSH_MODULEList={pushCodeList} currentUser={currentUser} parentTableRef={actionRef} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({ user, }: ConnectState) => ({
|
||||
currentUser: user.currentUser,
|
||||
}))(pushTemplate);
|
||||
@ -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<ActionType>();
|
||||
const ModalFormRef = useRef<FormInstance>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
// 显示同步抽屉
|
||||
const [updateModal, setUpdateModal] = useState<boolean>(false)
|
||||
// 当前行数据
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
|
||||
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 ? <a onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setUpdateModal(true)
|
||||
}}>{record?.PUSHMODULE_NAME}</a> : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
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 (
|
||||
<div>
|
||||
<Modal
|
||||
open={onShow}
|
||||
onCancel={() => {
|
||||
setOnShow(false)
|
||||
}}
|
||||
width={1400}
|
||||
bodyStyle={{
|
||||
height: '700px', // 你可以根据需要调整高度
|
||||
overflowY: 'auto',
|
||||
}}
|
||||
destroyOnClose
|
||||
title={""}
|
||||
footer={false}
|
||||
>
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
formRef={formRef}
|
||||
columns={columns}
|
||||
bordered
|
||||
expandable={{
|
||||
expandRowByClick: true
|
||||
}}
|
||||
scroll={{ x: "100%", y: "500px" }}
|
||||
search={false}
|
||||
pagination={false}
|
||||
options={false}
|
||||
request={async () => {
|
||||
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: [
|
||||
<Button type={'primary'} onClick={() => {
|
||||
setUpdateModal(true)
|
||||
}}>添加模板</Button>
|
||||
]
|
||||
}}
|
||||
/>
|
||||
</Modal>
|
||||
|
||||
|
||||
<Modal
|
||||
open={updateModal}
|
||||
onCancel={() => {
|
||||
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)
|
||||
})
|
||||
}}
|
||||
>
|
||||
<ProForm
|
||||
formRef={ModalFormRef}
|
||||
layout={'horizontal'}
|
||||
submitter={false}
|
||||
labelCol={{ style: { width: 80 } }}
|
||||
initialValues={{
|
||||
...currentRow
|
||||
}}
|
||||
>
|
||||
<Row gutter={8}>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
label={"模板名称"}
|
||||
name={"PUSHMODULE_NAME"}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={16}>
|
||||
<ProFormText
|
||||
label={"模板编码"}
|
||||
name={"PUSHMODULE_CODE"}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
label={"模板编号"}
|
||||
name={"PUSHMODULE_NUM"}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
label={"模板索引"}
|
||||
name={"PUSHMODULE_INDEX"}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
label={"模板状态"}
|
||||
name={"PUSHMODULE_STATE"}
|
||||
options={[{ label: "有效", value: 1 }, { label: "无效", value: 0 }]}
|
||||
initialValue={1}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
label={"备注"}
|
||||
name={"PUSHMODULE_DESC"}
|
||||
fieldProps={{
|
||||
rows: 8,
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
</ProForm>
|
||||
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({ user, }: ConnectState) => ({
|
||||
currentUser: user.currentUser,
|
||||
}))(PushTemplateModal);
|
||||
@ -0,0 +1,9 @@
|
||||
.pushTemplate {
|
||||
.ant-pro-card-body {
|
||||
|
||||
.ant-tree-list {
|
||||
|
||||
.ant-tree-list-holder {}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const ModalFormRef = useRef<FormInstance>();
|
||||
const UpdateFormRef = useRef<FormInstance>();
|
||||
// 显示编辑权限的悬浮框
|
||||
const [showUpdateModal, setShowUpdateModal] = useState<boolean>(false)
|
||||
// 人员权限行数据
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
// 权限的确认loading效果
|
||||
const [permissionLoading, setPermissionLoading] = useState<boolean>(false)
|
||||
// 人员信息的loading
|
||||
const [userInfoLoading, setUserInfoLoading] = useState<boolean>(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 ? <a onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setShowUpdateModal(true)
|
||||
}}>
|
||||
{str}
|
||||
</a> : '-'
|
||||
}
|
||||
},
|
||||
{
|
||||
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 (
|
||||
<div>
|
||||
<Modal
|
||||
open={onShow}
|
||||
onCancel={() => {
|
||||
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={<ModalFooter
|
||||
hideDelete={!parentRow?.RTWECHATPUSH_ID}
|
||||
handleDelete={async () => {
|
||||
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)
|
||||
})
|
||||
}}
|
||||
|
||||
/>}
|
||||
>
|
||||
<Divider orientation="left">用户信息</Divider>
|
||||
<ProForm
|
||||
formRef={ModalFormRef}
|
||||
layout={'horizontal'}
|
||||
submitter={false}
|
||||
labelCol={{ style: { width: 80 } }}
|
||||
request={async () => {
|
||||
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') : '',
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Row gutter={8}>
|
||||
<Col span={6}>
|
||||
<ProFormSelect
|
||||
label={'分组类型'}
|
||||
name={'GROUP_TYPE'}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请选择分组类型'
|
||||
}
|
||||
]}
|
||||
request={async () => {
|
||||
const data = await getFieldEnum({ FieldExplainField: 'GROUP_TYPE' })
|
||||
return data
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<ProFormText
|
||||
label={'用户名称'}
|
||||
name={'USER_NAME'}
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入用户名称'
|
||||
}
|
||||
]}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<ProFormText
|
||||
label={'昵 称'}
|
||||
name={'NICK_NAME'}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<ProFormText
|
||||
label={'微信内码'}
|
||||
name={'WECHAT_OPENID'}
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<ProFormText
|
||||
label={'手机号码'}
|
||||
name={'MOBILEPHONE_NUMBER'}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<ProFormText
|
||||
label={'商户名称'}
|
||||
name={'BUSINESS_NAME'}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<ProFormText
|
||||
label={'头像地址'}
|
||||
name={'HEADIMAGEURL'}
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<ProFormSelect
|
||||
label={'有效状态'}
|
||||
name={'RTWECHATPUSH_STATE'}
|
||||
options={[{ label: "有效", value: 1 }, { label: "无效", value: 0 }]}
|
||||
initialValue={1}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<ProFormText
|
||||
label={'添加时间'}
|
||||
name={'ADDTIME'}
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<ProFormText
|
||||
label={'操作人员'}
|
||||
name={'STAFF_NAME'}
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
<Col span={6}>
|
||||
<ProFormText
|
||||
label={'操作时间'}
|
||||
name={'OPERATE_DATE'}
|
||||
disabled
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
label={'备 注'}
|
||||
name={'RTWECHATPUSH_DESC'}
|
||||
fieldProps={{
|
||||
rows: 4,
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
|
||||
|
||||
</Row>
|
||||
</ProForm>
|
||||
|
||||
<Divider orientation="left">推送权限</Divider>
|
||||
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
formRef={formRef}
|
||||
columns={columns}
|
||||
bordered
|
||||
expandable={{
|
||||
expandRowByClick: true
|
||||
}}
|
||||
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
||||
search={false}
|
||||
pagination={false}
|
||||
options={false}
|
||||
request={async (params) => {
|
||||
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: [
|
||||
<Button type={'primary'} onClick={() => {
|
||||
setShowUpdateModal(true)
|
||||
}}>添加</Button>
|
||||
]
|
||||
}}
|
||||
/>
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
open={showUpdateModal}
|
||||
onCancel={() => {
|
||||
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={<ModalFooter
|
||||
hideDelete={!currentRow?.RTWECHATPUSH_ID}
|
||||
handleDelete={async () => {
|
||||
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}
|
||||
/>}
|
||||
>
|
||||
<ProForm
|
||||
formRef={UpdateFormRef}
|
||||
layout={'horizontal'}
|
||||
submitter={false}
|
||||
labelCol={{ style: { width: 80 } }}
|
||||
request={async () => {
|
||||
if (currentRow) {
|
||||
let list: any = currentRow?.PUSH_MODULE.split(',') || ""
|
||||
|
||||
return {
|
||||
...currentRow,
|
||||
PUSH_MODULE: list
|
||||
}
|
||||
} else {
|
||||
return {}
|
||||
}
|
||||
}}
|
||||
>
|
||||
<Row gutter={8}>
|
||||
<Col span={24}>
|
||||
<ProFormSelect
|
||||
label={'推送模板'}
|
||||
name={'PUSH_MODULE'}
|
||||
options={PUSH_MODULEList}
|
||||
fieldProps={{
|
||||
mode: 'multiple'
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormText
|
||||
label={'商户名称'}
|
||||
name={'BUSINESS_NAME'}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
label={'所属业主'}
|
||||
name={'PROVINCE_CODE'}
|
||||
rules={[
|
||||
{ required: true, message: '请选择所属业主' }
|
||||
]}
|
||||
request={async () => {
|
||||
const data = await handleGetBindingOwnerUnitDDL({ DataType: 0 })
|
||||
return data
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
label={'分组类型'}
|
||||
name={'GROUP_TYPE'}
|
||||
rules={[
|
||||
{ required: true, message: '请选择分组类型' }
|
||||
]}
|
||||
request={async () => {
|
||||
const data = await getFieldEnum({ FieldExplainField: 'GROUP_TYPE' })
|
||||
return data
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<ProFormSelect
|
||||
label={'有效状态'}
|
||||
name={'RTWECAHTPUSHDTAIL_STATE'}
|
||||
options={[{ label: "有效", value: 1 }, { label: "无效", value: 0 }]}
|
||||
initialValue={1}
|
||||
/>
|
||||
</Col>
|
||||
{
|
||||
currentRow?.RTWECHATPUSH_ID ? <>
|
||||
<Col span={24}>
|
||||
<ProFormText
|
||||
label={'管辖区域'}
|
||||
name={'SERVERPART_IDS'}
|
||||
/>
|
||||
</Col>
|
||||
<Col span={24}>
|
||||
<ProFormText
|
||||
label={'尾行内容'}
|
||||
name={'PUSH_LASTCONTENT'}
|
||||
/>
|
||||
</Col>
|
||||
</> : ""
|
||||
}
|
||||
|
||||
<Col span={24}>
|
||||
<ProFormTextArea
|
||||
label={'备 注'}
|
||||
name={'RTWECAHTPUSHDTAIL_DESC'}
|
||||
fieldProps={{
|
||||
rows: 3,
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
</ProForm>
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({ user }: ConnectState) => ({
|
||||
currentUser: user.currentUser,
|
||||
}))(TemplatePersonnel);
|
||||
139
src/pages/travelMember/WeChatAccountManagement/index.tsx
Normal file
139
src/pages/travelMember/WeChatAccountManagement/index.tsx
Normal file
@ -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<ActionType>();
|
||||
const formRef = useRef<FormInstance>();
|
||||
const ModalFormRef = useRef<FormInstance>();
|
||||
|
||||
const [showDetail, setShowDetail] = useState<boolean>(false)
|
||||
const [currentRow, setCurrentRow] = useState<any>()
|
||||
// 图片信息
|
||||
const [fileList, setFileList] = useState<any>()
|
||||
const [modalLoading, setModalLoading] = useState<boolean>(false)
|
||||
// 同步推送模板的悬浮框内容
|
||||
const [updatePushTemplateModal, setUpdatePushTemplateModal] = useState<boolean>(false)
|
||||
|
||||
|
||||
const columns: any = [
|
||||
{
|
||||
dataIndex: 'WECHATPUBLICSIGN_NAME',
|
||||
title: '公众号名称',
|
||||
width: 150,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
return record?.WECHATPUBLICSIGN_NAME ? <a onClick={() => {
|
||||
setCurrentRow(record)
|
||||
setShowDetail(true)
|
||||
}}>{record?.WECHATPUBLICSIGN_NAME}</a> : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
dataIndex: 'OWNERUNIT_NAME',
|
||||
title: '业主单位',
|
||||
width: 150,
|
||||
align: 'center',
|
||||
ellipsis: true,
|
||||
hideInSearch: true
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
return (
|
||||
<div >
|
||||
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
|
||||
<div style={{
|
||||
width: '100%',
|
||||
paddingTop: 0,
|
||||
paddingBottom: 0,
|
||||
paddingRight: 0
|
||||
}}>
|
||||
<ProTable
|
||||
actionRef={actionRef}
|
||||
formRef={formRef}
|
||||
columns={columns}
|
||||
bordered
|
||||
expandable={{
|
||||
expandRowByClick: true
|
||||
}}
|
||||
scroll={{ x: "100%", y: "calc(100vh - 410px)" }}
|
||||
headerTitle={<PageTitleBox props={props} />} // 列表表头
|
||||
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: [
|
||||
]
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
<Modal
|
||||
open={showDetail}
|
||||
onCancel={() => {
|
||||
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={<div style={{ width: "100%", display: 'flex', justifyContent: 'flex-start', boxSizing: 'border-box', padding: '0 8px' }}>
|
||||
<Button type={"primary"} danger onClick={() => {
|
||||
setUpdatePushTemplateModal(true)
|
||||
}}>设置推送模板</Button>
|
||||
</div>}
|
||||
>
|
||||
<PushTemplate parentRow={currentRow} currentUser={currentUser} />
|
||||
</Modal>
|
||||
|
||||
|
||||
{/* 设置推送模板的悬浮框 */}
|
||||
<PushTemplateModal onShow={updatePushTemplateModal} setOnShow={setUpdatePushTemplateModal} parentRow={currentRow} currentUser={currentUser} />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default connect(({ user }: ConnectState) => ({
|
||||
currentUser: user.currentUser
|
||||
}))(WeChatAccountManagement);
|
||||
122
src/pages/travelMember/WeChatAccountManagement/service.ts
Normal file
122
src/pages/travelMember/WeChatAccountManagement/service.ts
Normal file
@ -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
|
||||
}
|
||||
@ -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`, {
|
||||
|
||||
@ -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 || ''}`, {
|
||||
|
||||
@ -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";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user