💥 feat(模块): 添加了个很棒的功能

This commit is contained in:
ylj20011123 2025-05-09 15:08:59 +08:00
parent d89b543e2b
commit a9b517ffb0
15 changed files with 1075 additions and 59 deletions

View File

@ -84,10 +84,15 @@ export default [
path: "identification", path: "identification",
name: "三证管理", name: "三证管理",
component: "@/pages/test/identification/index" component: "@/pages/test/identification/index"
},
{
path: "YNPoint",
name: "云南附近服务区",
component: "@/pages/test/YNPoint/index"
} }
] ]
} }
] ]
} }

View File

@ -20,8 +20,9 @@ type DetailProps = {
haveTest?: boolean;// 是否有测试服务区 haveTest?: boolean;// 是否有测试服务区
handleGetLeftTreeData?: any // 拿到树数据的方法 必须要有输出值的 handleGetLeftTreeData?: any // 拿到树数据的方法 必须要有输出值的
noWj?: any // 把万佳商贸隐藏 noWj?: any // 把万佳商贸隐藏
provinceCode?: string;// 省份
} }
const LeftSelectTree = ({ setSelectedId, reload, actionRef, currentUser, width, otherFun, setCollapsible, collapsible, haveTest, handleGetLeftTreeData, noWj }: DetailProps) => { const LeftSelectTree = ({ setSelectedId, reload, actionRef, currentUser, width, otherFun, setCollapsible, collapsible, haveTest, handleGetLeftTreeData, noWj, provinceCode }: DetailProps) => {
const searchTreeRef = useRef<FormInstance>(); const searchTreeRef = useRef<FormInstance>();
// 默认的服务区树 // 默认的服务区树
const [allTreeViews, setAllTreeViews] = useState<any>() const [allTreeViews, setAllTreeViews] = useState<any>()
@ -33,7 +34,7 @@ const LeftSelectTree = ({ setSelectedId, reload, actionRef, currentUser, width,
if (currentUser?.UserPattern === 2000) { if (currentUser?.UserPattern === 2000) {
// data = await getMerchantShopTree({ BusinessManId: currentUser?.BusinessManID, ShowShop: false }); // data = await getMerchantShopTree({ BusinessManId: currentUser?.BusinessManID, ShowShop: false });
} else { } else {
data = await getServerpartTree('340000', currentUser?.CityAuthority, true, true, true) data = await getServerpartTree(provinceCode || '340000', currentUser?.CityAuthority, true, true, true)
} }
console.log('datatree', data); console.log('datatree', data);

View File

@ -107,7 +107,6 @@ const UserModel: UserModelType = {
try { try {
const res: API.LoginResponse = yield call(userLogin, payload); const res: API.LoginResponse = yield call(userLogin, payload);
console.log('resresresresresresres21212', res);
if (res.Result_Code === 100) { if (res.Result_Code === 100) {
localStorage.setItem('Authorization', res.Result_Data.token); localStorage.setItem('Authorization', res.Result_Data.token);
@ -175,8 +174,6 @@ const UserModel: UserModelType = {
Result_Desc: '', Result_Desc: '',
}; };
console.log('typetypetypetypetypetype', type);
//用户在登录页登录完成之后执行 //用户在登录页登录完成之后执行
if (type === 'concurrent') { if (type === 'concurrent') {
@ -189,7 +186,6 @@ const UserModel: UserModelType = {
//其他情形首先查询用户的登录状态, 未登录则不继续操作 //其他情形首先查询用户的登录状态, 未登录则不继续操作
try { try {
userInfoRes = yield call(retrieveUserInfo); userInfoRes = yield call(retrieveUserInfo);
console.log('dsadhsaoudisahoudahs', userInfoRes);
if (userInfoRes) { if (userInfoRes) {
} else { } else {
@ -233,9 +229,6 @@ const UserModel: UserModelType = {
menuRes = res[1] as API.MenuDataResponse; menuRes = res[1] as API.MenuDataResponse;
} }
console.log('userAuthorityResuserAuthorityResuserAuthorityResuserAuthorityRes', userAuthorityRes);
let userAuthorityList: any = [] let userAuthorityList: any = []
if (userAuthorityRes && userAuthorityRes.length > 0) { if (userAuthorityRes && userAuthorityRes.length > 0) {
userAuthorityList = handleAllUserPermission(userAuthorityRes) userAuthorityList = handleAllUserPermission(userAuthorityRes)

View File

@ -2,7 +2,7 @@
import React, { useState, useRef } from 'react'; import React, { useState, useRef } from 'react';
import './modelStyle.less' import './modelStyle.less'
import { Button, Form, FormInstance, message, Space, TreeSelect } from 'antd'; import { Button, Form, FormInstance, message, Space, TreeSelect } from 'antd';
import { deleteSystemMenu, getSystemMenu, handleGetMenuList, updataModule, updataSystemMenu } from './service'; import { deleteSystemMenu, getSystemMenu, handleAddMenu, handleEditModel, handleGetMenuList, handleSaveModel, handleUpdateMenu, updataModule, updataSystemMenu } from './service';
import { ActionType, ModalForm, PageContainer, ProFormDigit, ProFormRadio, ProFormText, ProFormTextArea, ProTable } from '@ant-design/pro-components'; import { ActionType, ModalForm, PageContainer, ProFormDigit, ProFormRadio, ProFormText, ProFormTextArea, ProTable } from '@ant-design/pro-components';
import { PlusOutlined } from '@ant-design/icons'; import { PlusOutlined } from '@ant-design/icons';
import * as Icon from '@ant-design/icons' import * as Icon from '@ant-design/icons'
@ -11,10 +11,11 @@ import * as Icon from '@ant-design/icons'
const handleAddUpdate = async (fields: any) => { const handleAddUpdate = async (fields: any) => {
console.log('fields', fields); console.log('fields', fields);
const hide = message.loading('正在提交...'); const hide = message.loading('正在提交...');
try { try {
const result = fields?.systemmenuName ? await updataSystemMenu(fields) : await updataModule(fields) // const result = fields?.systemmenuName ? await updataSystemMenu(fields) : await updataModule(fields)
// 先判断模块 还是 菜单
const result = fields?.systemmenuName ? fields?.systemmenuId ? await handleUpdateMenu(fields) : await handleAddMenu(fields) : fields?.systemmoduleId ? await handleEditModel(fields) : await handleSaveModel(fields)
hide(); hide();
if (result.Result_Code !== 100) { if (result.Result_Code !== 100) {
@ -30,6 +31,9 @@ const handleAddUpdate = async (fields: any) => {
} }
} }
const handleDelete = async (nodeId: number) => { const handleDelete = async (nodeId: number) => {
const hide = message.loading('正在更新...'); const hide = message.loading('正在更新...');
try { try {

View File

@ -24,3 +24,25 @@ export async function updataModule(params: any) {
const data: any = await request.post('/menu/synchroModel', params) const data: any = await request.post('/menu/synchroModel', params)
return data return data
} }
// 新增菜单信息
export async function handleAddMenu(params: any) {
const data: any = await request.post('/menu/saveMenu', params)
return data
}
// 更新菜单信息
export async function handleUpdateMenu(params: any) {
const data: any = await request.post('/menu/editMenu', params)
return data
}
// 新增模块信息
export async function handleSaveModel(params: any) {
const data: any = await request.post('/menu/saveModel', params)
return data
}
// 新增模块信息
export async function handleEditModel(params: any) {
const data: any = await request.post('/menu/editModel', params)
return data
}

View File

@ -6,7 +6,7 @@ import type { ActionType } from "@ant-design/pro-table";
import ProTable from "@ant-design/pro-table"; import ProTable from "@ant-design/pro-table";
import moment from "moment"; import moment from "moment";
import OldLeftSelectTree from "@/components/leftSelectTree/oldLeftSelectTree"; import OldLeftSelectTree from "@/components/leftSelectTree/oldLeftSelectTree";
import { handleGetGDNearServiceList, handleGetNearServiceList, handlesynchroAmapLocation } from "./service"; import { handleGetGDNearServiceList, handleGetNearServiceList, handleGetSERVERPARTDetail, handlesynchroAmapLocation, handleUpdateServiceInfo } from "./service";
import { secondsToHuman } from "@/utils/format"; import { secondsToHuman } from "@/utils/format";
import './style.less' import './style.less'
@ -286,6 +286,7 @@ const GDPoint: React.FC<{ currentUser: CurrentUser }> = (props) => {
width: 80, width: 80,
dataIndex: 'index', dataIndex: 'index',
align: "center", align: "center",
ellipsis: true,
valueType: "index" valueType: "index"
}, },
{ {
@ -293,9 +294,12 @@ const GDPoint: React.FC<{ currentUser: CurrentUser }> = (props) => {
width: 200, width: 200,
dataIndex: 'SERVERPART_NAME', dataIndex: 'SERVERPART_NAME',
align: "center", align: "center",
ellipsis: true,
hideInSearch: true, hideInSearch: true,
render: (_, record) => { render: (_, record) => {
return <span style={{ color: record?.HASAMAP ? "#0000005e" : "" }}>{record?.SERVERPART_NAME ? record?.SERVERPART_NAME : ""}</span> return <div style={{ color: record?.HASAMAP ? "#0000005e" : "", display: 'inline-block', width: '180px', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
{record?.SERVERPART_NAME ? record?.SERVERPART_NAME : ""}
</div>
} }
}, },
{ {
@ -429,15 +433,40 @@ const GDPoint: React.FC<{ currentUser: CurrentUser }> = (props) => {
// 将高德的定位数据同步到自己的 // 将高德的定位数据同步到自己的
const handleUpdateGDPosition = async (obj: any) => { const handleUpdateGDPosition = async (obj: any) => {
let req: any = { console.log('obj', obj);
SERVERPART_IDS: obj.SERVERPART_ID // 同步掉老的数据库的数据
// 拿到老的服务区详情数据
let detail: any = await handleGetSERVERPARTDetail({ ServerpartId: obj.SERVERPART_ID })
console.log('detaildetaildetaildetail', detail);
// 拿到需要变得经纬度数据
let SERVERPART_X: number = obj.AMAP_SERVERPART_X
let SERVERPART_Y: number = obj.AMAP_SERVERPART_Y
let newObj: any = {
...detail,
SERVERPART_X: SERVERPART_X,
SERVERPART_Y: SERVERPART_Y,
RtServerPart: {
...detail.RtServerPart,
SERVERPART_X: SERVERPART_X,
SERVERPART_Y: SERVERPART_Y,
}
} }
const data = await handlesynchroAmapLocation(req) console.log('newObj', newObj);
if (data.Result_Code) { // newObj 已经替换成新经纬度的数据在里面了 直接去请求同步接口
message.success("更新成功!") const oldDetail = await handleUpdateServiceInfo(newObj)
actionRef.current?.reload() console.log('oldDetail', oldDetail);
} else { if (oldDetail.Result_Code === 100) {
message.error(data.Result_Desc!) // 将java的数据库里面的数据同步掉
let req: any = {
SERVERPART_IDS: obj.SERVERPART_ID
}
const data = await handlesynchroAmapLocation(req)
if (data.Result_Code === 100) {
message.success("更新成功!")
actionRef.current?.reload()
} else {
message.error(data.Result_Desc!)
}
} }
} }
@ -468,8 +497,8 @@ const GDPoint: React.FC<{ currentUser: CurrentUser }> = (props) => {
// expandRowByClick: true // expandRowByClick: true
// }} // }}
expandable={{ expandable={{
// expandRowByClick: true, // expandRowByClick: true,
expandedRowRender, expandedRowRender,
}} }}
pagination={false} pagination={false}
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}></span>} headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}></span>}

View File

@ -1,5 +1,6 @@
// import requestTest from '@/utils/requestTest' // import requestTest from '@/utils/requestTest'
import requestTest from '@/utils/request' import requestTest from '@/utils/request'
import requestOld from '@/utils/requestOld'
export async function handleGetNearServiceList(params: any) { export async function handleGetNearServiceList(params: any) {
const data: any = await requestTest.post('/location/search', params) const data: any = await requestTest.post('/location/search', params)
@ -26,3 +27,29 @@ export async function handlesynchroAmapLocation(params: any) {
} }
return data return data
} }
// 查询服务区的详情接口
export async function handleGetSERVERPARTDetail(params: any) {
const data: any = await requestOld('/BaseInfo/GetSERVERPARTDetail', {
method: 'GET',
params
})
if (data.Result_Code !== 100) {
return data.Result_Data
}
return data.Result_Data
}
// 同步服务区详情数据
export async function handleUpdateServiceInfo(params: any) {
const data: any = await requestOld('/BaseInfo/SynchroSERVERPART', {
method: 'POST',
data: params
})
if (data.Result_Code !== 100) {
return data
}
return data
}

View File

@ -0,0 +1,605 @@
import { connect } from "umi";
import { Children, useRef, useState } from "react";
import { Button, Drawer, message, Modal, Popconfirm, Space, Spin, type FormInstance } from "antd";
import type { ActionType } from "@ant-design/pro-table";
import ProTable from "@ant-design/pro-table";
import moment from "moment";
import OldLeftSelectTree from "@/components/leftSelectTree/oldLeftSelectTree";
import { handleGetGDNearServiceList, handleGetNearServiceList, handlesynchroAmapLocation } from "./service";
import { secondsToHuman } from "@/utils/format";
import './style.less'
import { handleGetSERVERPARTDetail, handleUpdateServiceInfo } from "../GDPoint/service";
const GDPoint: React.FC<{ currentUser: CurrentUser }> = (props) => {
const { currentUser } = props
const downloadBtnRef = useRef<any>()
const actionRef = useRef<ActionType>();
const formRef = useRef<FormInstance>();
const [reqDetailList, setReqDetailList] = useState<any>(); // 合计项数据源
const [printOut, setPrintOut] = useState<any>(); // 打印数据的内容
const [collapsible, setCollapsible] = useState<boolean>(false)
const [treeView, setTreeView] = useState<any>()
const [printIndex, setPrintIndex] = useState<number>(new Date().getTime())
const [columnsState, setColumnsState] = useState<any>({
SERVERPART_X: { show: false },
SERVERPART_Y: { show: false },
// AMAP_LOCATION_AGREED: { show: false },
UPDATE_TIME: { show: false },
AMAP_SERVERPART_X: { show: false },
AMAP_SERVERPART_Y: { show: false },
HASCHARGE: { show: false },
HASGUESTROOM: { show: false },
HASMOTHER: { show: false },
HASPILOTLOUNGE: { show: false },
OWNERUNIT_NAME: { show: false },
// SERVERPART_ADDRESS: { show: false },
SERVERPART_TEL: { show: false },
SPREGIONTYPE_NAME: { show: false },
});
const [columnsStateChildren, setColumnsStateChildren] = useState<any>({
PROVINCE_NAME: { show: false },
REAL_DURATION: { show: false },
REAL_TOLLS: { show: false },
SERVERPART_ADDRESS: { show: false },
UPDATE_TIME: { show: false },
})
// 树相关的属性和方法
const [selectedId, setSelectedId] = useState<string>()
// 导出的加载效果
const [showLoading, setShowLoading] = useState<boolean>(false)
// 是否显示打印的表格
const [showExportTable, setShowExportTable] = useState<boolean>(false)
// 查询的条件
const [searchParams, setSearchParams] = useState<any>()
// 显示关联服务区的抽屉
const [showDrawer, setShowDrawer] = useState<boolean>(false)
// 选择的当行数据
const [currentRow, setCurrentRow] = useState<any>()
const columns: any = [
{
title: <div style={{ textAlign: "center" }}></div>,
width: 80,
dataIndex: 'index',
align: "center",
valueType: "index"
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "SERVERPART_NAME",
width: 200,
ellipsis: true,
hideInSearch: true,
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "AMAP_LOCATION_AGREED",
width: 150,
ellipsis: true,
align: "center",
hideInSearch: true,
render: (_, record) => {
return record?.AMAP_LOCATION_AGREED ? "一致" :
<Popconfirm
title="提示"
description="确认同步高德定位?"
onConfirm={async () => {
await handleUpdateGDPosition(record)
}}
okText="确认"
cancelText="取消"
>
<a style={{ color: record?.AMAP_LOCATION_AGREED ? '' : "red" }}>
</a>
</Popconfirm>
}
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "SERVERPART_X",
width: 150,
align: "center",
ellipsis: true,
hideInSearch: true,
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "SERVERPART_Y",
width: 150,
align: "center",
ellipsis: true,
hideInSearch: true,
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "HASBORDER",
valueType: "select",
align: "center",
valueEnum: {
"0": "否",
"1": "是"
},
initialValue: "",
width: 100,
ellipsis: true,
render: (_, record) => {
return record?.HASBORDER ? '是' : '否'
}
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "haveChildren",
align: "center",
ellipsis: true,
width: 100,
hideInSearch: true,
render: (_, record) => {
return record?.newChildren && record.newChildren.length > 0 ? showDrawer ? record.newChildren.length : <a onClick={() => {
// setCurrentRow(record)
// setShowDrawer(true)
}}>
{record.newChildren.length}
</a> : '-'
}
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "UPDATE_TIME",
width: 150,
ellipsis: true,
hideInSearch: true,
align: "center",
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "SERVERPART_ADDRESS",
width: 200,
align: "left",
ellipsis: true,
hideInSearch: true,
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "serverpartExpressway",
width: 150,
ellipsis: true,
align: "center",
hideInSearch: true,
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "AMAP_SERVERPART_X",
width: 150,
ellipsis: true,
align: "center",
hideInSearch: true,
render: (_, record) => {
return <span style={{ color: record?.AMAP_LOCATION_AGREED ? "" : "#FBC342" }}>{record?.AMAP_SERVERPART_X}</span>
}
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "AMAP_SERVERPART_Y",
width: 150,
align: "center",
ellipsis: true,
hideInSearch: true,
render: (_, record) => {
return <span style={{ color: record?.AMAP_LOCATION_AGREED ? "" : "#FBC342" }}>{record?.AMAP_SERVERPART_Y}</span>
}
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "HASCHARGE",
width: 120,
align: "center",
ellipsis: true,
hideInSearch: true,
render: (_, record) => {
return <span style={{ color: record?.HASCHARGE ? '' : "red" }}>
{record?.HASCHARGE ? '有' : '无'}
</span>
}
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "HASGUESTROOM",
width: 120,
align: "center",
ellipsis: true,
hideInSearch: true,
render: (_, record) => {
return <span style={{ color: record?.HASGUESTROOM ? '' : "red" }}>
{record?.HASGUESTROOM ? '有' : '无'}
</span>
}
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "HASMOTHER",
width: 120,
align: "center",
ellipsis: true,
hideInSearch: true,
render: (_, record) => {
return <span style={{ color: record?.HASMOTHER ? '' : "red" }}>
{record?.HASMOTHER ? '有' : '无'}
</span>
}
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "HASPILOTLOUNGE",
width: 120,
align: "center",
ellipsis: true,
hideInSearch: true,
render: (_, record) => {
return <span style={{ color: record?.HASPILOTLOUNGE ? '' : "red" }}>
{record?.HASPILOTLOUNGE ? '有' : '无'}
</span>
}
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "OWNERUNIT_NAME",
width: 200,
align: "center",
ellipsis: true,
hideInSearch: true,
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "SERVERPART_TEL",
width: 150,
align: "center",
ellipsis: true,
hideInSearch: true,
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "SPREGIONTYPE_NAME",
width: 150,
align: "center",
ellipsis: true,
hideInSearch: true,
}
]
// 模块列表
const expandedRowRender = (data: any) => {
console.log('data', data);
return (data.newChildren && data.newChildren.length > 0 ?
<ProTable
className={"childrenProTableBox"}
rowKey={(record) => `${record.SERVERPART_ID}-${record.index}`}
columns={[
{
title: <div style={{ textAlign: "center" }}></div>,
width: 80,
dataIndex: 'index',
align: "center",
valueType: "index"
},
{
title: <div style={{ textAlign: "center" }}></div>,
width: 200,
dataIndex: 'SERVERPART_NAME',
align: "center",
hideInSearch: true,
render: (_, record) => {
return <div style={{ color: record?.HASAMAP ? "#0000005e" : "", display: 'inline-block', width: '180px', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
{record?.SERVERPART_NAME ? record?.SERVERPART_NAME : ""}
</div>
}
},
{
title: <div style={{ textAlign: "center" }}>线(KM)</div>,
dataIndex: "SELECT_DISTANCE",
width: 150,
ellipsis: true,
align: "center",
hideInSearch: true,
},
{
title: <div style={{ textAlign: "center" }}>(KM)</div>,
dataIndex: "REAL_DISTANCE",
width: 150,
align: "center",
ellipsis: true,
hideInSearch: true,
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "REAL_DURATION",
width: 150,
align: "center",
ellipsis: true,
hideInSearch: true,
render: (_, record) => {
return record.REAL_DURATION ? secondsToHuman(record.REAL_DURATION) : "-"
}
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "REAL_TOLLS",
width: 120,
ellipsis: true,
align: "center",
hideInSearch: true,
render: (_, record) => {
return record?.REAL_TOLLS ? record?.REAL_TOLLS + '元' : "-"
}
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: 'HASPROVINCE',
width: 120,
ellipsis: true,
align: "center",
hideInSearch: true,
render: (_, record) => {
return <span style={{ color: record?.HASPROVINCE ? '' : "red" }}>
{record?.HASPROVINCE ? '是' : '否'}
</span>
}
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "PROVINCE_NAME",
width: 120,
align: "center",
ellipsis: true,
hideInSearch: true,
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: 'SERVERPART_EXPRESSWAY',
width: 200,
align: "left",
ellipsis: true,
hideInSearch: true,
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: 'HASEXPRESSWAY',
width: 120,
align: "center",
ellipsis: true,
hideInSearch: true,
render: (_, record) => {
return <span>
{record?.HASEXPRESSWAY ? '是' : '否'}
</span>
}
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: 'HASAMAP',
hideInSearch: true,
align: "center",
width: 120,
ellipsis: true,
render: (_, record) => {
return <span style={{ color: record?.HASAMAP ? 'red' : "" }}>
{record?.HASAMAP ? '是' : '否'}
</span>
}
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "UPDATE_TIME",
width: 150,
align: "center",
ellipsis: true,
hideInSearch: true,
},
{
title: <div style={{ textAlign: "center" }}></div>,
dataIndex: "SERVERPART_ADDRESS",
width: 120,
align: "center",
ellipsis: true,
hideInSearch: true,
},
]
}
scroll={{ x: '100%' }}
headerTitle={false}
bordered
search={false}
// options={false}
dataSource={data.newChildren}
pagination={false}
columnsState={{
value: columnsStateChildren,
onChange: setColumnsStateChildren,
}}
/>
: []
);
};
// 将高德的定位数据同步到自己的
const handleUpdateGDPosition = async (obj: any) => {
let detail: any = await handleGetSERVERPARTDetail({ ServerpartId: obj.SERVERPART_ID })
let SERVERPART_X: number = obj.AMAP_SERVERPART_X
let SERVERPART_Y: number = obj.AMAP_SERVERPART_Y
let newObj: any = {
...detail,
SERVERPART_X: SERVERPART_X,
SERVERPART_Y: SERVERPART_Y,
RtServerPart: {
...detail.RtServerPart,
SERVERPART_X: SERVERPART_X,
SERVERPART_Y: SERVERPART_Y,
},
STAFF_ID: currentUser?.ID, // 操作人内码
STAFF_NAME: currentUser?.Name, // 操作人员
OPERATE_DATE: moment().format('YYYY-MM-DD HH:mm:ss')
}
const oldDetail = await handleUpdateServiceInfo(newObj)
if (oldDetail.Result_Code === 100) {
// 将java的数据库里面的数据同步掉
let req: any = {
SERVERPART_IDS: obj.SERVERPART_ID
}
const data = await handlesynchroAmapLocation(req)
console.log('data', data);
if (data.Result_Code === 100) {
message.success("更新成功!")
actionRef.current?.reload()
} else {
message.error(data.Result_Desc!)
}
}
// let req: any = {
// SERVERPART_IDS: obj.SERVERPART_ID
// }
// const data = await handlesynchroAmapLocation(req)
// if (data.Result_Code) {
// message.success("更新成功!")
// actionRef.current?.reload()
// } else {
// message.error(data.Result_Desc!)
// }
}
return (
<div ref={(el) => {
// 打印报表
if (!reqDetailList || reqDetailList.length === 0) return;
setPrintOut(el);
}} >
<div style={{ backgroundColor: '#fff', display: 'flex' }}>
<OldLeftSelectTree setSelectedId={setSelectedId} setCollapsible={setCollapsible} collapsible={collapsible} provinceCode={"530000"} />
<div style={{
width: !collapsible ? 'calc(100% - 300px)' : 'calc(100% - 60px)',
paddingTop: 0,
paddingBottom: 0,
paddingRight: 0
}}>
<ProTable
rowKey="SERVERPART_ID"
actionRef={actionRef}
formRef={formRef}
columns={columns}
bordered
scroll={{ x: "100%", y: "calc(100vh - 400px)" }}
// expandable={{
// expandRowByClick: true
// }}
expandable={{
// expandRowByClick: true,
expandedRowRender,
}}
pagination={false}
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}></span>}
search={{ span: 6 }}
request={async (params) => {
if (!selectedId) {
return
}
const req = {
PageIndex: 1,
PageSize: 999999,
SearchParameter: {
SERVERPART_IDS: selectedId,
HASBORDER: params?.HASBORDER === "1" ? true : params?.HASBORDER === "0" ? false : ""
}
}
setSearchParams(params)
const data = await handleGetGDNearServiceList(req)
console.log('data222', data)
if (data && data.length > 0) {
data.forEach((item: any) => {
if (item.children && item.children.length > 0) {
item.children.forEach((subItem: any, subIndex: number) => {
subItem.index = subIndex
})
item.newChildren = item.children
item.children = null
}
})
console.log('data2223', data)
return { data, success: true }
}
return { data: [], success: true }
}}
columnsState={{
value: columnsState,
onChange: setColumnsState,
}}
columnSetting={{
drag: false, // 禁止拖拽调整顺序
}}
/>
</div>
</div>
<Drawer
title={false}
closeIcon={false}
onClose={() => {
setShowDrawer(false)
setCurrentRow(undefined)
}}
open={showDrawer}
destroyOnClose
width={'80%'}
>
<ProTable
columns={columns}
rowKey="SERVERPART_ID"
bordered
scroll={{ x: "100%", y: "calc(100vh - 400px)" }}
pagination={false}
search={false}
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}>{`${currentRow?.SERVERPART_NAME || ''}附近服务区列表`}</span>}
// dataSource={[currentRow]}
request={() => {
// let list: any = currentRow?.newChildren
return { data: [currentRow], success: true }
}}
columnsState={{
value: columnsState,
onChange: setColumnsState,
}}
expandable={{
expandedRowKeys: [currentRow?.SERVERPART_ID],
expandedRowRender,
}}
>
</ProTable>
</Drawer>
</div>
)
}
export default connect(({ user }: ConnectState) => ({
currentUser: user.data
}))(GDPoint);

View File

@ -0,0 +1,28 @@
import requestTestTest from '@/utils/requestTest'
import requestTest from '@/utils/request'
export async function handleGetNearServiceList(params: any) {
const data: any = await requestTest.post('/location/search', params)
if (data.Result_Code !== 100) {
return data
}
return data.Result_Data.List
}
export async function handleGetGDNearServiceList(params: any) {
const data: any = await requestTest.post('/location/searchAround', params)
if (data.Result_Code !== 100) {
return data
}
return data.Result_Data.List
}
// 同步高德坐标
export async function handlesynchroAmapLocation(params: any) {
const data: any = await requestTest.post('/location/synchroAmapLocation', params)
if (data.Result_Code !== 100) {
return data
}
return data
}

View File

@ -0,0 +1,11 @@
.childrenProTableBox {
.ant-pro-card {
.ant-pro-card-body {
.ant-pro-table-list-toolbar {
.ant-pro-table-list-toolbar-container {
padding-block: 0 !important;
}
}
}
}
}

View File

@ -7,7 +7,8 @@ import ProTable from "@ant-design/pro-table";
import moment from "moment"; import moment from "moment";
import OldLeftSelectTree from "@/components/leftSelectTree/oldLeftSelectTree"; import OldLeftSelectTree from "@/components/leftSelectTree/oldLeftSelectTree";
import { secondsToHuman } from "@/utils/format"; import { secondsToHuman } from "@/utils/format";
import { handleGetDRIVERLICENSEList, handleGetIDCARDINFOList, handleGetVEHICLELICENSEList } from "./service"; import { handleGetDRIVERLICENSEList, handleGetIDCARDINFOList, handleGetMemberShipLicenseList, handleGetVEHICLELICENSEList } from "./service";
import { getFieldEnum } from "@/utils/publicService";
const Identification: React.FC<{ currentUser: CurrentUser }> = (props) => { const Identification: React.FC<{ currentUser: CurrentUser }> = (props) => {
@ -32,6 +33,15 @@ const Identification: React.FC<{ currentUser: CurrentUser }> = (props) => {
// 当前查询的类型 // 当前查询的类型
const [currentSearchType, setCurrentSearchType] = useState<string>("1") const [currentSearchType, setCurrentSearchType] = useState<string>("1")
// 显示详情抽屉
const [showDetailDrawer, setShowDetailDrawer] = useState<boolean>(false)
// 当前的点击行数据
const [currentRow, setCurrentRow] = useState<any>()
// 表格数据
const [tableData, setTableData] = useState<any>()
// 表格的加载效果
const [tableLoading, setTableLoading] = useState<boolean>(false)
const idCardcolumns: any = [ const idCardcolumns: any = [
{ {
title: "证件类型", title: "证件类型",
@ -61,7 +71,7 @@ const Identification: React.FC<{ currentUser: CurrentUser }> = (props) => {
ellipsis: true, ellipsis: true,
}, },
{ {
dataIndex: 'IDCARDINFO_CODE', dataIndex: 'PLATE_NUMBER',
title: '证件号码', title: '证件号码',
align: 'center', align: 'center',
hideInSearch: true, hideInSearch: true,
@ -271,7 +281,6 @@ const Identification: React.FC<{ currentUser: CurrentUser }> = (props) => {
] ]
const vehicleliColumns: any = [ const vehicleliColumns: any = [
{ {
title: "证件类型", title: "证件类型",
@ -384,6 +393,139 @@ const Identification: React.FC<{ currentUser: CurrentUser }> = (props) => {
}, },
] ]
const columns: any = [
{
title: "会员类型",
dataIndex: "MEMBERSHIP_TYPE",
width: 120,
ellipsis: true,
hideInSearch: true,
valueType: "select",
align: 'center',
request: async () => {
const data = await getFieldEnum({ FieldExplainField: 'MEMBERSHIP_TYPE' })
return data
}
},
{
title: "会员姓名",
dataIndex: "MEMBERSHIP_NAME",
align: 'center',
width: 120,
ellipsis: true,
},
{
title: "绑定车辆",
dataIndex: "PLATE_NUMBER",
align: 'center',
width: 120,
hideInSearch: true,
ellipsis: true,
render: (_, record) => {
return record?.PLATE_NUMBER ? <a onClick={() => {
setCurrentRow(record)
setShowDetailDrawer(true)
}}>
{record?.PLATE_NUMBER}
</a> : <span style={{ color: 'red' }}></span>
}
},
{
title: "会员积分",
dataIndex: "MEMBERSHIP_POINT",
width: 120,
align: 'center',
hideInSearch: true,
ellipsis: true,
},
{
title: "手机号码",
dataIndex: "MEMBERSHIP_MOBILEPHONE",
align: 'center',
width: 150,
hideInSearch: true,
ellipsis: true,
},
{
title: "会员归属",
dataIndex: "OWNERUNIT_NAME",
align: 'center',
width: 250,
hideInSearch: true,
ellipsis: true,
},
{
title: "添加时间",
dataIndex: "ADDTIME",
align: 'center',
width: 150,
hideInSearch: true,
ellipsis: true,
render: (_, record) => {
return record?.ADDTIME ? moment(record?.ADDTIME).format('YYYY-MM-DD HH:mm:ss') : "-"
}
},
{
title: "会员状态",
dataIndex: "MEMBERSHIP_STATE",
align: 'center',
width: 150,
hideInSearch: true,
ellipsis: true,
render: (_, record) => {
return record?.MEMBERSHIP_STATE === 1000 ? "有效" : record?.MEMBERSHIP_STATE === 2000 ? "无效" : "-"
}
},
// {
// title: "车牌号",
// dataIndex: "LICENSEPLATE_NUMBER",
// width: 150,
// hideInSearch: true,
// ellipsis: true,
// },
// {
// dataIndex: 'VEHICLE_TYPE',
// title: '车辆类型',
// hideInSearch: true,
// width: 150,
// ellipsis: true,
// },
// {
// title: "会员性别",
// dataIndex: "MEMBERSHIP_SEX",
// width: 120,
// hideInSearch: true,
// ellipsis: true,
// render: (_, record) => {
// return record?.MEMBERSHIP_SEX === 1 ? '男' : record?.MEMBERSHIP_SEX === 2 ? '女' : '-'
// }
// },
// {
// title: "会员等级",
// dataIndex: "MEMBERSHIP_LEVEL",
// width: 120,
// hideInSearch: true,
// ellipsis: true,
// valueType: "select",
// valueEnum: {
// 1000: "普卡会员",
// 2000: "高速驿网会员",
// 3000: "银卡会员",
// 4000: "金卡会员",
// 5000: "钻卡会员",
// 6000: "皇冠会员",
// 9000: "企业会员",
// }
// },
// {
// title: "证件号码",
// dataIndex: "CERTIFICATE_NUMBER",
// width: 150,
// hideInSearch: true,
// ellipsis: true,
// },
]
return ( return (
<div ref={(el) => { <div ref={(el) => {
// 打印报表 // 打印报表
@ -403,38 +545,162 @@ const Identification: React.FC<{ currentUser: CurrentUser }> = (props) => {
rowKey="SERVERPART_ID" rowKey="SERVERPART_ID"
actionRef={actionRef} actionRef={actionRef}
formRef={formRef} formRef={formRef}
columns={currentSearchType === '1' ? idCardcolumns : currentSearchType === '2' ? drivingColumns : currentSearchType === '3' ? vehicleliColumns : []} columns={columns}
bordered bordered
scroll={{ x: "100%", y: "calc(100vh - 400px)" }} scroll={{ x: "100%", y: "calc(100vh - 400px)" }}
pagination={false} pagination={{
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}></span>} defaultPageSize: 50
}}
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}></span>}
search={{ span: 6 }} search={{ span: 6 }}
dataSource={tableData}
loading={tableLoading}
request={async (params) => { request={async (params) => {
let req: any = {
const req: any = {
SearchParameter: { SearchParameter: {
MEMBERSHIP_ID: 3104148 OWNERUNIT_ID: 249
},
keyWord: {
key: "MEMBERSHIP_NAME",
Value: params?.MEMBERSHIP_NAME || ""
}, },
PageIndex: 1, PageIndex: 1,
PageSize: 9999 PageSize: 50
} }
let data = [] setTableLoading(true)
if (currentSearchType === '1') { const data = await handleGetMemberShipLicenseList(req)
data = await handleGetIDCARDINFOList(req) setTableLoading(false)
} else if (currentSearchType === '2') { console.log('datadatadatadata', data);
data = await handleGetDRIVERLICENSEList(req)
} else if (currentSearchType === '3') {
data = await handleGetVEHICLELICENSEList(req)
}
console.log('datadatadatadatadata', data);
if (data && data.length > 0) { setTableData(data)
return { data: data, success: true }
const allReq: any = {
SearchParameter: {
OWNERUNIT_ID: 249
},
keyWord: {
key: "MEMBERSHIP_NAME",
Value: params?.MEMBERSHIP_NAME || ""
},
PageIndex: 1,
PageSize: 999999
} }
return { data: [], success: true } const allData = await handleGetMemberShipLicenseList(allReq)
console.log('datadatadatadata', allData);
setTableData(allData)
// if (data && data.length > 0) {
// return { data, success: true }
// }
// return { data: [], success: true }
// let req: any = {
// SearchParameter: {
// MEMBERSHIP_ID: 3104148
// },
// PageIndex: 1,
// PageSize: 9999
// }
// let data = []
// if (currentSearchType === '1') {
// data = await handleGetIDCARDINFOList(req)
// } else if (currentSearchType === '2') {
// data = await handleGetDRIVERLICENSEList(req)
// } else if (currentSearchType === '3') {
// data = await handleGetVEHICLELICENSEList(req)
// }
// console.log('datadatadatadatadata', data);
// if (data && data.length > 0) {
// return { data: data, success: true }
// }
// return { data: [], success: true }
}} }}
/> />
</div> </div>
</div> </div>
<Drawer
title={false}
closeIcon={false}
onClose={() => {
setShowDetailDrawer(false)
setCurrentRow(undefined)
}}
open={showDetailDrawer}
destroyOnClose
width={'80%'}
>
<ProTable
columns={idCardcolumns}
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}></span>}
search={false}
scroll={{ x: "100%", y: "calc(100vh - 400px)" }}
pagination={false}
request={async () => {
let req: any = {
SearchParameter: {
MEMBERSHIP_ID: currentRow?.MEMBERSHIP_ID
},
PageIndex: 1,
PageSize: 9999
}
const data = await handleGetIDCARDINFOList(req)
if (data && data.length > 0) {
return { data: data, success: true }
}
return { data: [], success: true }
}}
/>
<ProTable
columns={drivingColumns}
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}></span>}
search={false}
scroll={{ x: "100%", y: "calc(100vh - 400px)" }}
pagination={false}
request={async () => {
let req: any = {
SearchParameter: {
MEMBERSHIP_ID: currentRow?.MEMBERSHIP_ID
},
PageIndex: 1,
PageSize: 9999
}
const data = await handleGetDRIVERLICENSEList(req)
if (data && data.length > 0) {
return { data: data, success: true }
}
return { data: [], success: true }
}}
/>
<ProTable
columns={vehicleliColumns}
headerTitle={<span style={{ color: "#1890ff", fontSize: 14, fontWeight: 600 }}></span>}
search={false}
scroll={{ x: "100%", y: "calc(100vh - 400px)" }}
pagination={false}
request={async () => {
let req: any = {
SearchParameter: {
MEMBERSHIP_ID: currentRow?.MEMBERSHIP_ID
},
PageIndex: 1,
PageSize: 9999
}
const data = await handleGetVEHICLELICENSEList(req)
if (data && data.length > 0) {
return { data: data, success: true }
}
return { data: [], success: true }
}}
/>
</Drawer>
</div> </div>
) )
} }

View File

@ -43,3 +43,19 @@ export async function handleGetVEHICLELICENSEList(params?: any) {
return data.Result_Data.List; return data.Result_Data.List;
} }
// 拿到会员和车牌的列表
export async function handleGetMemberShipLicenseList(params?: any) {
const data = await request('/Member/GetMemberShipLicenseList', {
method: 'POST',
data: params,
})
if (data.Result_Code !== 100) {
return [];
}
return data.Result_Data.List;
}

View File

@ -31,12 +31,6 @@ const handleRedirect = (
console.log('matchedRes', matchedRes); console.log('matchedRes', matchedRes);
if (matchedRes) { if (matchedRes) {
//还要考虑redirect参数是否有效 //还要考虑redirect参数是否有效
let decodeRedirect = decodeURIComponent(matchedRes[1]); let decodeRedirect = decodeURIComponent(matchedRes[1]);

View File

@ -1,4 +1,4 @@
import { tableList, wrapTreeNode } from "./format"; import { formateField, tableList, wrapTreeNode } from "./format";
import request from "./requestOld"; import request from "./requestOld";
import requestJAVA from "./request"; import requestJAVA from "./request";
@ -62,8 +62,23 @@ export async function getUserList(params?: any) {
export function synchroBehaviorRecord(data: any): void { export function synchroBehaviorRecord(data: any): void {
request(`/Platform/SynchroBehaviorrecord`, { request(`/Platform/SynchroBehaviorrecord`, {
method: 'POST', method: 'POST',
data data
}); });
} }
// 拿到枚举值
export async function getFieldEnum(params: any): Promise<{ label: string; value: string | number }[]> {
const data = await request(`/FrameWork/GetFieldEnumByField`, {
method: 'GET',
params,
});
if (data.Result_Code !== 100) {
return [];
}
const options = params.notformate ? data.Result_Data.List : formateField(data.Result_Data.List);
return options;
}

View File

@ -16,9 +16,9 @@ const { UMI_APP_BASEURL } = process.env;
// const instance = axios.create({ baseURL: 'https://es.eshangtech.com' }); // const instance = axios.create({ baseURL: 'https://es.eshangtech.com' });
// 本地 // 本地
// const instance = axios.create({ baseURL: 'http://10.104.1.159:8088/' }); const instance = axios.create({ baseURL: 'http://10.104.1.175:8070/platform' });
// 线上 // 线上
const instance = axios.create({ baseURL: 'https://admin.es.eshangtech.com/prod-api/' }); // const instance = axios.create({ baseURL: 'https://admin.es.eshangtech.com/prod-api/' });