/basicInfo/corpInfo/basicList 接口去掉enterpriseType参数,增加menuId参数
parent
9f7d121693
commit
95f7d94911
|
|
@ -14,19 +14,21 @@ import useTable from "zy-react-library/hooks/useTable";
|
|||
import { UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE, NS_GLOBAL } from "~/enumerate/namespace";
|
||||
import { getTenantTypeConfigList, useDebounce } from "~/utils";
|
||||
import { getMenuIdByPath, getTenantTypeConfigList, useDebounce } from "~/utils";
|
||||
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
|
||||
const [cityData, setCityData] = useState([]);
|
||||
const [tenantTypeConfigList, setTenantTypeConfigList] = useState([]);
|
||||
const [menuId, setMenuId] = useState();
|
||||
const { tableProps, getData } = useTable(props["corpInfoList"], {
|
||||
form,
|
||||
ready: menuId !== undefined,
|
||||
params: () => ({ menuid: menuId }),
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
enterpriseType: 3,
|
||||
geCreateTime: formData.CreateTime?.[0],
|
||||
leCreateTime: formData.CreateTime?.[1],
|
||||
// eqProvince: formData.cityRecord?.[0],
|
||||
|
|
@ -40,6 +42,9 @@ function List(props) {
|
|||
});
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
useEffect(() => {
|
||||
getMenuIdByPath().then(setMenuId);
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
getTenantTypeConfigList({ request: props.tenantTypeConfigList }).then(setTenantTypeConfigList);
|
||||
}, []);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import useTable from "zy-react-library/hooks/useTable";
|
|||
import { UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE, NS_GLOBAL } from "~/enumerate/namespace";
|
||||
import { getTenantTypeConfigList, useDebounce } from "~/utils";
|
||||
import { getMenuIdByPath, getTenantTypeConfigList, useDebounce } from "~/utils";
|
||||
|
||||
const USER_FLAG = [
|
||||
{
|
||||
|
|
@ -50,18 +50,18 @@ const ENTERPRISE_STATUS = [
|
|||
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [menuId, setMenuId] = useState();
|
||||
const { tableProps, getData } = useTable(props["corpInfoList"], {
|
||||
form,
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
enterpriseType: 2,
|
||||
};
|
||||
},
|
||||
ready: menuId !== undefined,
|
||||
params: () => ({ menuid: menuId }),
|
||||
});
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
const [openType, setOpenType] = useState("");
|
||||
useEffect(() => {
|
||||
getMenuIdByPath().then(setMenuId);
|
||||
}, []);
|
||||
const onResetPassword = (id) => {
|
||||
Modal.confirm({
|
||||
title: "提示",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Permission } from "@cqsjjb/jjb-common-decorator/permission";
|
||||
import { Connect } from "@cqsjjb/jjb-dva-runtime";
|
||||
import { Button, Form, message, Space } from "antd";
|
||||
import { useState } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
import MapSelector from "zy-react-library/components/Map/MapSelector";
|
||||
|
||||
import Page from "zy-react-library/components/Page";
|
||||
|
|
@ -10,6 +10,7 @@ import Table from "zy-react-library/components/Table";
|
|||
import { FORM_ITEM_RENDER_ENUM } from "zy-react-library/enum/formItemRender";
|
||||
import useTable from "zy-react-library/hooks/useTable";
|
||||
import { NS_ENTERPRISE } from "~/enumerate/namespace";
|
||||
import { getMenuIdByPath } from "~/utils";
|
||||
|
||||
const ENTERPRISE_STATUS = [
|
||||
{
|
||||
|
|
@ -45,17 +46,22 @@ const STATUS = [
|
|||
];
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [menuId, setMenuId] = useState();
|
||||
const { tableProps, getData } = useTable(props["corpInfoList"], {
|
||||
form,
|
||||
ready: menuId !== undefined,
|
||||
params: () => ({ menuid: menuId }),
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
enterpriseType: 2,
|
||||
geCreateDate: formData.eqCreateDate?.[0],
|
||||
leCreateDate: formData.eqCreateDate?.[1],
|
||||
};
|
||||
},
|
||||
});
|
||||
useEffect(() => {
|
||||
getMenuIdByPath().then(setMenuId);
|
||||
}, []);
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [selectedLng, setSelectedLng] = useState("");
|
||||
const [selectedLat, setSelectedLat] = useState("");
|
||||
|
|
|
|||
|
|
@ -13,18 +13,20 @@ import useTable from "zy-react-library/hooks/useTable";
|
|||
import { UNIFIED_SOCIAL_CREDIT_CODE } from "zy-react-library/regular";
|
||||
import { getLabelName } from "zy-react-library/utils";
|
||||
import { NS_ENTERPRISE, NS_GLOBAL } from "~/enumerate/namespace";
|
||||
import { getTenantTypeConfigList, useDebounce } from "~/utils";
|
||||
import { getMenuIdByPath, getTenantTypeConfigList, useDebounce } from "~/utils";
|
||||
|
||||
function List(props) {
|
||||
const [form] = Form.useForm();
|
||||
const [tenantTypeConfigList, setTenantTypeConfigList] = useState([]);
|
||||
const [menuId, setMenuId] = useState();
|
||||
// const [cityData, setCityData] = useState([]);
|
||||
const { tableProps, getData } = useTable(props["corpInfoList"], {
|
||||
form,
|
||||
ready: menuId !== undefined,
|
||||
params: () => ({ menuid: menuId }),
|
||||
transform: (formData) => {
|
||||
return {
|
||||
...formData,
|
||||
enterpriseType: 3,
|
||||
geCreateTime: formData.CreateTime?.[0],
|
||||
leCreateTime: formData.CreateTime?.[1],
|
||||
// eqProvince: formData.cityRecord?.[0],
|
||||
|
|
@ -38,6 +40,9 @@ function List(props) {
|
|||
});
|
||||
const [addModalOpen, setAddModalOpen] = useState(false);
|
||||
const [currentId, setCurrentId] = useState("");
|
||||
useEffect(() => {
|
||||
getMenuIdByPath().then(setMenuId);
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
getTenantTypeConfigList({ request: props.tenantTypeConfigList }).then(setTenantTypeConfigList);
|
||||
}, []);
|
||||
|
|
|
|||
|
|
@ -207,18 +207,25 @@ export function useDebounce(value, delay = 500) {
|
|||
return debouncedValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据页面路由获取底座菜单编码。
|
||||
* 非底座环境或没有匹配菜单时返回空字符串。
|
||||
*/
|
||||
export async function getMenuIdByPath(menuPath = window.location.pathname) {
|
||||
if (!window.__IN_BASE__) {
|
||||
return "";
|
||||
}
|
||||
|
||||
const menuInfo = await window.base.call.getMenuInfoByPath({ path: menuPath });
|
||||
return menuInfo?.[0]?.menuCode || "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据菜单路由获取当前租户配置的企业类型列表。
|
||||
* 子页面需要传入实际菜单入口路由,避免使用非菜单路由查询不到 menuId。
|
||||
*/
|
||||
export async function getTenantTypeConfigList({ request, menuPath = window.location.pathname }) {
|
||||
let menuId = "";
|
||||
|
||||
if (window.__IN_BASE__) {
|
||||
const menuInfo = await window.base.call.getMenuInfoByPath({ path: menuPath });
|
||||
menuId = menuInfo?.[0]?.menuCode || "";
|
||||
}
|
||||
|
||||
const menuId = await getMenuIdByPath(menuPath);
|
||||
const res = await request({ menuId, pageIndex: 1, pageSize: 9999 });
|
||||
return Array.isArray(res?.data) ? res.data : [];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue