diff --git a/config/router.ts b/config/router.ts index 4ca42d1..734b484 100644 --- a/config/router.ts +++ b/config/router.ts @@ -84,10 +84,15 @@ export default [ path: "identification", name: "三证管理", component: "@/pages/test/identification/index" + }, + { + path: "YNPoint", + name: "云南附近服务区", + component: "@/pages/test/YNPoint/index" } + ] } - ] } diff --git a/src/components/leftSelectTree/oldLeftSelectTree.tsx b/src/components/leftSelectTree/oldLeftSelectTree.tsx index fcd259e..477fa3c 100644 --- a/src/components/leftSelectTree/oldLeftSelectTree.tsx +++ b/src/components/leftSelectTree/oldLeftSelectTree.tsx @@ -20,8 +20,9 @@ type DetailProps = { haveTest?: boolean;// 是否有测试服务区 handleGetLeftTreeData?: 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(); // 默认的服务区树 const [allTreeViews, setAllTreeViews] = useState() @@ -33,7 +34,7 @@ const LeftSelectTree = ({ setSelectedId, reload, actionRef, currentUser, width, if (currentUser?.UserPattern === 2000) { // data = await getMerchantShopTree({ BusinessManId: currentUser?.BusinessManID, ShowShop: false }); } else { - data = await getServerpartTree('340000', currentUser?.CityAuthority, true, true, true) + data = await getServerpartTree(provinceCode || '340000', currentUser?.CityAuthority, true, true, true) } console.log('datatree', data); diff --git a/src/models/user.ts b/src/models/user.ts index 3c4c5bf..9f42a63 100644 --- a/src/models/user.ts +++ b/src/models/user.ts @@ -107,7 +107,6 @@ const UserModel: UserModelType = { try { const res: API.LoginResponse = yield call(userLogin, payload); - console.log('resresresresresresres21212', res); if (res.Result_Code === 100) { localStorage.setItem('Authorization', res.Result_Data.token); @@ -175,8 +174,6 @@ const UserModel: UserModelType = { Result_Desc: '', }; - console.log('typetypetypetypetypetype', type); - //用户在登录页登录完成之后执行 if (type === 'concurrent') { @@ -189,7 +186,6 @@ const UserModel: UserModelType = { //其他情形首先查询用户的登录状态, 未登录则不继续操作 try { userInfoRes = yield call(retrieveUserInfo); - console.log('dsadhsaoudisahoudahs', userInfoRes); if (userInfoRes) { } else { @@ -233,9 +229,6 @@ const UserModel: UserModelType = { menuRes = res[1] as API.MenuDataResponse; } - - console.log('userAuthorityResuserAuthorityResuserAuthorityResuserAuthorityRes', userAuthorityRes); - let userAuthorityList: any = [] if (userAuthorityRes && userAuthorityRes.length > 0) { userAuthorityList = handleAllUserPermission(userAuthorityRes) diff --git a/src/pages/setting/menu/index.tsx b/src/pages/setting/menu/index.tsx index afbb7ee..190df1b 100644 --- a/src/pages/setting/menu/index.tsx +++ b/src/pages/setting/menu/index.tsx @@ -2,7 +2,7 @@ import React, { useState, useRef } from 'react'; import './modelStyle.less' 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 { PlusOutlined } 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) => { console.log('fields', fields); - const hide = message.loading('正在提交...'); 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(); if (result.Result_Code !== 100) { @@ -30,6 +31,9 @@ const handleAddUpdate = async (fields: any) => { } } + + + const handleDelete = async (nodeId: number) => { const hide = message.loading('正在更新...'); try { diff --git a/src/pages/setting/menu/service.ts b/src/pages/setting/menu/service.ts index e3d5eca..6498e9d 100644 --- a/src/pages/setting/menu/service.ts +++ b/src/pages/setting/menu/service.ts @@ -24,3 +24,25 @@ export async function updataModule(params: any) { const data: any = await request.post('/menu/synchroModel', params) 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 +} diff --git a/src/pages/test/GDPoint/index.tsx b/src/pages/test/GDPoint/index.tsx index 74524c2..a518e8f 100644 --- a/src/pages/test/GDPoint/index.tsx +++ b/src/pages/test/GDPoint/index.tsx @@ -6,7 +6,7 @@ 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 { handleGetGDNearServiceList, handleGetNearServiceList, handleGetSERVERPARTDetail, handlesynchroAmapLocation, handleUpdateServiceInfo } from "./service"; import { secondsToHuman } from "@/utils/format"; import './style.less' @@ -286,6 +286,7 @@ const GDPoint: React.FC<{ currentUser: CurrentUser }> = (props) => { width: 80, dataIndex: 'index', align: "center", + ellipsis: true, valueType: "index" }, { @@ -293,9 +294,12 @@ const GDPoint: React.FC<{ currentUser: CurrentUser }> = (props) => { width: 200, dataIndex: 'SERVERPART_NAME', align: "center", + ellipsis: true, hideInSearch: true, render: (_, record) => { - return {record?.SERVERPART_NAME ? record?.SERVERPART_NAME : ""} + return
+ {record?.SERVERPART_NAME ? record?.SERVERPART_NAME : ""} +
} }, { @@ -429,15 +433,40 @@ const GDPoint: React.FC<{ currentUser: CurrentUser }> = (props) => { // 将高德的定位数据同步到自己的 const handleUpdateGDPosition = async (obj: any) => { - let req: any = { - SERVERPART_IDS: obj.SERVERPART_ID + console.log('obj', obj); + // 同步掉老的数据库的数据 + // 拿到老的服务区详情数据 + 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) - if (data.Result_Code) { - message.success("更新成功!") - actionRef.current?.reload() - } else { - message.error(data.Result_Desc!) + console.log('newObj', newObj); + // newObj 已经替换成新经纬度的数据在里面了 直接去请求同步接口 + const oldDetail = await handleUpdateServiceInfo(newObj) + console.log('oldDetail', oldDetail); + if (oldDetail.Result_Code === 100) { + // 将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 // }} expandable={{ - // expandRowByClick: true, - expandedRowRender, + // expandRowByClick: true, + expandedRowRender, }} pagination={false} headerTitle={附近服务区列表} diff --git a/src/pages/test/GDPoint/service.ts b/src/pages/test/GDPoint/service.ts index 4371cb6..9787711 100644 --- a/src/pages/test/GDPoint/service.ts +++ b/src/pages/test/GDPoint/service.ts @@ -1,5 +1,6 @@ // import requestTest from '@/utils/requestTest' import requestTest from '@/utils/request' +import requestOld from '@/utils/requestOld' export async function handleGetNearServiceList(params: any) { const data: any = await requestTest.post('/location/search', params) @@ -26,3 +27,29 @@ export async function handlesynchroAmapLocation(params: any) { } 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 +} diff --git a/src/pages/test/YNPoint/index.tsx b/src/pages/test/YNPoint/index.tsx new file mode 100644 index 0000000..9bffece --- /dev/null +++ b/src/pages/test/YNPoint/index.tsx @@ -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() + const actionRef = useRef(); + const formRef = useRef(); + const [reqDetailList, setReqDetailList] = useState(); // 合计项数据源 + const [printOut, setPrintOut] = useState(); // 打印数据的内容 + const [collapsible, setCollapsible] = useState(false) + const [treeView, setTreeView] = useState() + const [printIndex, setPrintIndex] = useState(new Date().getTime()) + + const [columnsState, setColumnsState] = useState({ + 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({ + PROVINCE_NAME: { show: false }, + REAL_DURATION: { show: false }, + REAL_TOLLS: { show: false }, + SERVERPART_ADDRESS: { show: false }, + UPDATE_TIME: { show: false }, + }) + + // 树相关的属性和方法 + const [selectedId, setSelectedId] = useState() + // 导出的加载效果 + const [showLoading, setShowLoading] = useState(false) + // 是否显示打印的表格 + const [showExportTable, setShowExportTable] = useState(false) + // 查询的条件 + const [searchParams, setSearchParams] = useState() + // 显示关联服务区的抽屉 + const [showDrawer, setShowDrawer] = useState(false) + // 选择的当行数据 + const [currentRow, setCurrentRow] = useState() + + const columns: any = [ + { + title:
序号
, + width: 80, + dataIndex: 'index', + align: "center", + valueType: "index" + }, + { + title:
服务区名称
, + dataIndex: "SERVERPART_NAME", + width: 200, + ellipsis: true, + hideInSearch: true, + }, + { + title:
定位偏差
, + dataIndex: "AMAP_LOCATION_AGREED", + width: 150, + ellipsis: true, + align: "center", + hideInSearch: true, + render: (_, record) => { + return record?.AMAP_LOCATION_AGREED ? "一致" : + { + await handleUpdateGDPosition(record) + }} + okText="确认" + cancelText="取消" + > + + 差异 + + + + } + }, + { + title:
经度
, + dataIndex: "SERVERPART_X", + width: 150, + align: "center", + ellipsis: true, + hideInSearch: true, + }, + { + title:
维度
, + dataIndex: "SERVERPART_Y", + width: 150, + align: "center", + ellipsis: true, + hideInSearch: true, + }, + { + title:
边界服务区
, + dataIndex: "HASBORDER", + valueType: "select", + align: "center", + valueEnum: { + "0": "否", + "1": "是" + }, + initialValue: "", + width: 100, + ellipsis: true, + render: (_, record) => { + return record?.HASBORDER ? '是' : '否' + } + }, + { + title:
关联服务区
, + dataIndex: "haveChildren", + align: "center", + ellipsis: true, + width: 100, + hideInSearch: true, + render: (_, record) => { + return record?.newChildren && record.newChildren.length > 0 ? showDrawer ? record.newChildren.length : { + // setCurrentRow(record) + // setShowDrawer(true) + }}> + {record.newChildren.length} + : '-' + } + }, + { + title:
更新时间
, + dataIndex: "UPDATE_TIME", + width: 150, + ellipsis: true, + hideInSearch: true, + align: "center", + }, + { + title:
服务区地址
, + dataIndex: "SERVERPART_ADDRESS", + width: 200, + align: "left", + ellipsis: true, + hideInSearch: true, + }, + { + title:
高速路段
, + dataIndex: "serverpartExpressway", + width: 150, + ellipsis: true, + align: "center", + hideInSearch: true, + }, + { + title:
高德经度
, + dataIndex: "AMAP_SERVERPART_X", + width: 150, + ellipsis: true, + align: "center", + hideInSearch: true, + render: (_, record) => { + return {record?.AMAP_SERVERPART_X} + } + }, + { + title:
高德维度
, + dataIndex: "AMAP_SERVERPART_Y", + width: 150, + align: "center", + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return {record?.AMAP_SERVERPART_Y} + } + }, + { + title:
是否有充电桩
, + dataIndex: "HASCHARGE", + width: 120, + align: "center", + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return + {record?.HASCHARGE ? '有' : '无'} + + } + }, + { + title:
是否有客房
, + dataIndex: "HASGUESTROOM", + width: 120, + align: "center", + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return + {record?.HASGUESTROOM ? '有' : '无'} + + } + }, + { + title:
是否有母婴室
, + dataIndex: "HASMOTHER", + width: 120, + align: "center", + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return + {record?.HASMOTHER ? '有' : '无'} + + } + }, + { + title:
是否有司机之家
, + dataIndex: "HASPILOTLOUNGE", + width: 120, + align: "center", + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return + {record?.HASPILOTLOUNGE ? '有' : '无'} + + } + }, + { + title:
业主单位名称
, + dataIndex: "OWNERUNIT_NAME", + width: 200, + align: "center", + ellipsis: true, + hideInSearch: true, + }, + + { + title:
联系电话
, + dataIndex: "SERVERPART_TEL", + width: 150, + align: "center", + ellipsis: true, + hideInSearch: true, + }, + { + title:
片区名称
, + 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 ? + `${record.SERVERPART_ID}-${record.index}`} + columns={[ + { + title:
序号
, + width: 80, + dataIndex: 'index', + align: "center", + valueType: "index" + }, + { + title:
关联服务区
, + width: 200, + dataIndex: 'SERVERPART_NAME', + align: "center", + hideInSearch: true, + render: (_, record) => { + return
+ {record?.SERVERPART_NAME ? record?.SERVERPART_NAME : ""} +
+ } + }, + { + title:
直线距离(KM)
, + dataIndex: "SELECT_DISTANCE", + width: 150, + ellipsis: true, + align: "center", + hideInSearch: true, + }, + { + title:
通行距离(KM)
, + dataIndex: "REAL_DISTANCE", + width: 150, + align: "center", + ellipsis: true, + hideInSearch: true, + }, + { + title:
实际耗时
, + dataIndex: "REAL_DURATION", + width: 150, + align: "center", + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return record.REAL_DURATION ? secondsToHuman(record.REAL_DURATION) : "-" + } + }, + { + title:
高速费
, + dataIndex: "REAL_TOLLS", + width: 120, + ellipsis: true, + align: "center", + hideInSearch: true, + render: (_, record) => { + return record?.REAL_TOLLS ? record?.REAL_TOLLS + '元' : "-" + } + }, + { + title:
是否同省
, + dataIndex: 'HASPROVINCE', + width: 120, + ellipsis: true, + align: "center", + hideInSearch: true, + render: (_, record) => { + return + {record?.HASPROVINCE ? '是' : '否'} + + } + }, + { + title:
服务区省份名称
, + dataIndex: "PROVINCE_NAME", + width: 120, + align: "center", + ellipsis: true, + hideInSearch: true, + }, + { + title:
服务区高速公路
, + dataIndex: 'SERVERPART_EXPRESSWAY', + width: 200, + align: "left", + ellipsis: true, + hideInSearch: true, + }, + { + title:
是否同路段
, + dataIndex: 'HASEXPRESSWAY', + width: 120, + align: "center", + ellipsis: true, + hideInSearch: true, + render: (_, record) => { + return + {record?.HASEXPRESSWAY ? '是' : '否'} + + } + }, + { + title:
高德新增
, + dataIndex: 'HASAMAP', + hideInSearch: true, + align: "center", + width: 120, + ellipsis: true, + render: (_, record) => { + return + {record?.HASAMAP ? '是' : '否'} + + } + }, + { + title:
更新时间
, + dataIndex: "UPDATE_TIME", + width: 150, + align: "center", + ellipsis: true, + hideInSearch: true, + }, + + { + title:
服务区地址
, + 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 ( +
{ + // 打印报表 + if (!reqDetailList || reqDetailList.length === 0) return; + setPrintOut(el); + }} > + + +
+ +
+ 附近服务区列表} + 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, // 禁止拖拽调整顺序 + }} + /> +
+
+ + + + { + setShowDrawer(false) + setCurrentRow(undefined) + }} + open={showDrawer} + destroyOnClose + width={'80%'} + > + {`${currentRow?.SERVERPART_NAME || ''}附近服务区列表`}} + // dataSource={[currentRow]} + request={() => { + // let list: any = currentRow?.newChildren + return { data: [currentRow], success: true } + }} + columnsState={{ + value: columnsState, + onChange: setColumnsState, + }} + expandable={{ + expandedRowKeys: [currentRow?.SERVERPART_ID], + expandedRowRender, + }} + > + + + + +
+ ) +} + +export default connect(({ user }: ConnectState) => ({ + currentUser: user.data +}))(GDPoint); + + diff --git a/src/pages/test/YNPoint/service.ts b/src/pages/test/YNPoint/service.ts new file mode 100644 index 0000000..9eaa050 --- /dev/null +++ b/src/pages/test/YNPoint/service.ts @@ -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 +} diff --git a/src/pages/test/YNPoint/style.less b/src/pages/test/YNPoint/style.less new file mode 100644 index 0000000..2055f58 --- /dev/null +++ b/src/pages/test/YNPoint/style.less @@ -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; + } + } + } + } +} \ No newline at end of file diff --git a/src/pages/test/identification/index.tsx b/src/pages/test/identification/index.tsx index 690df2c..e08cde4 100644 --- a/src/pages/test/identification/index.tsx +++ b/src/pages/test/identification/index.tsx @@ -7,7 +7,8 @@ import ProTable from "@ant-design/pro-table"; import moment from "moment"; import OldLeftSelectTree from "@/components/leftSelectTree/oldLeftSelectTree"; 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) => { @@ -32,6 +33,15 @@ const Identification: React.FC<{ currentUser: CurrentUser }> = (props) => { // 当前查询的类型 const [currentSearchType, setCurrentSearchType] = useState("1") + // 显示详情抽屉 + const [showDetailDrawer, setShowDetailDrawer] = useState(false) + // 当前的点击行数据 + const [currentRow, setCurrentRow] = useState() + // 表格数据 + const [tableData, setTableData] = useState() + // 表格的加载效果 + const [tableLoading, setTableLoading] = useState(false) + const idCardcolumns: any = [ { title: "证件类型", @@ -61,7 +71,7 @@ const Identification: React.FC<{ currentUser: CurrentUser }> = (props) => { ellipsis: true, }, { - dataIndex: 'IDCARDINFO_CODE', + dataIndex: 'PLATE_NUMBER', title: '证件号码', align: 'center', hideInSearch: true, @@ -271,7 +281,6 @@ const Identification: React.FC<{ currentUser: CurrentUser }> = (props) => { ] - const vehicleliColumns: any = [ { 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 ? { + setCurrentRow(record) + setShowDetailDrawer(true) + }}> + {record?.PLATE_NUMBER} + : 未绑定 + } + }, + { + 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 (
{ // 打印报表 @@ -403,38 +545,162 @@ const Identification: React.FC<{ currentUser: CurrentUser }> = (props) => { rowKey="SERVERPART_ID" actionRef={actionRef} formRef={formRef} - columns={currentSearchType === '1' ? idCardcolumns : currentSearchType === '2' ? drivingColumns : currentSearchType === '3' ? vehicleliColumns : []} + columns={columns} bordered scroll={{ x: "100%", y: "calc(100vh - 400px)" }} - pagination={false} - headerTitle={三证合一列表} + pagination={{ + defaultPageSize: 50 + }} + headerTitle={会员信息列表} search={{ span: 6 }} + dataSource={tableData} + loading={tableLoading} request={async (params) => { - let req: any = { + + const req: any = { SearchParameter: { - MEMBERSHIP_ID: 3104148 + OWNERUNIT_ID: 249 + }, + keyWord: { + key: "MEMBERSHIP_NAME", + Value: params?.MEMBERSHIP_NAME || "" }, PageIndex: 1, - PageSize: 9999 + PageSize: 50 } - 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); + setTableLoading(true) + const data = await handleGetMemberShipLicenseList(req) + setTableLoading(false) + console.log('datadatadatadata', data); - if (data && data.length > 0) { - return { data: data, success: true } + setTableData(data) + + 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 } }} />
+ + + { + setShowDetailDrawer(false) + setCurrentRow(undefined) + }} + open={showDetailDrawer} + destroyOnClose + width={'80%'} + > + + 身份证信息} + 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 } + }} + /> + + 驾驶证信息} + 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 } + }} + /> + + 行驶证信息} + 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 } + }} + /> + + + ) } diff --git a/src/pages/test/identification/service.ts b/src/pages/test/identification/service.ts index d0a5e0c..f2fe646 100644 --- a/src/pages/test/identification/service.ts +++ b/src/pages/test/identification/service.ts @@ -41,5 +41,21 @@ export async function handleGetVEHICLELICENSEList(params?: any) { return []; } + 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; } \ No newline at end of file diff --git a/src/utils/handleRedirect.ts b/src/utils/handleRedirect.ts index ba6c1a8..b55fb66 100644 --- a/src/utils/handleRedirect.ts +++ b/src/utils/handleRedirect.ts @@ -31,12 +31,6 @@ const handleRedirect = ( console.log('matchedRes', matchedRes); - - - - - - if (matchedRes) { //还要考虑redirect参数是否有效 let decodeRedirect = decodeURIComponent(matchedRes[1]); diff --git a/src/utils/publicService.ts b/src/utils/publicService.ts index cb57648..f8328e2 100644 --- a/src/utils/publicService.ts +++ b/src/utils/publicService.ts @@ -1,4 +1,4 @@ -import { tableList, wrapTreeNode } from "./format"; +import { formateField, tableList, wrapTreeNode } from "./format"; import request from "./requestOld"; import requestJAVA from "./request"; @@ -62,8 +62,23 @@ export async function getUserList(params?: any) { export function synchroBehaviorRecord(data: any): void { request(`/Platform/SynchroBehaviorrecord`, { - method: 'POST', - data + method: 'POST', + data }); - - } \ No newline at end of file + +} + + +// 拿到枚举值 +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; +} \ No newline at end of file diff --git a/src/utils/requestTest.ts b/src/utils/requestTest.ts index d4c1d77..158cd86 100644 --- a/src/utils/requestTest.ts +++ b/src/utils/requestTest.ts @@ -16,9 +16,9 @@ const { UMI_APP_BASEURL } = process.env; // 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/' });