角色配置、单位类型配置

master
LiuJiaNan 2026-08-05 14:23:12 +08:00
parent 494e8947ef
commit f58b6020b8
1 changed files with 6 additions and 2 deletions

View File

@ -155,6 +155,7 @@ function List(props) {
const AddModalComponent = (props) => { const AddModalComponent = (props) => {
const { parentId, id } = props; const { parentId, id } = props;
const level = parentId === "0" ? 1 : 2;
const [tenantTypes, setTenantTypes] = useState([]); const [tenantTypes, setTenantTypes] = useState([]);
const [fullServiceMenu, setFullServiceMenu] = useState([]); const [fullServiceMenu, setFullServiceMenu] = useState([]);
@ -199,7 +200,7 @@ const AddModalComponent = (props) => {
const { success } = await props[id ? "editUnitTypeConfig" : "saveUnitTypeConfig"]({ const { success } = await props[id ? "editUnitTypeConfig" : "saveUnitTypeConfig"]({
...values, ...values,
id, id,
level: parentId === "0" ? 1 : 2, level,
parentId, parentId,
menuIds: values.menuIds?.join(","), menuIds: values.menuIds?.join(","),
}); });
@ -211,9 +212,10 @@ const AddModalComponent = (props) => {
}; };
const onSubmit = async (values) => { const onSubmit = async (values) => {
if (parentId !== "0") { if (parentId !== "0" && values.defaultType) {
const { data } = await props["verifyUnitTypeConfig"]({ const { data } = await props["verifyUnitTypeConfig"]({
defaultType: values.defaultType, defaultType: values.defaultType,
level,
id, id,
}); });
if (!data.available) { if (!data.available) {
@ -260,6 +262,7 @@ const AddModalComponent = (props) => {
if (value) { if (value) {
const { data } = await props["verifyUnitTypeConfig"]({ const { data } = await props["verifyUnitTypeConfig"]({
tenantTypeId: value, tenantTypeId: value,
level,
id, id,
}); });
return data.available ? Promise.resolve() : Promise.reject(new Error(data.msg)); return data.available ? Promise.resolve() : Promise.reject(new Error(data.msg));
@ -294,6 +297,7 @@ const AddModalComponent = (props) => {
if (value) { if (value) {
const { data } = await props["verifyUnitTypeConfig"]({ const { data } = await props["verifyUnitTypeConfig"]({
code: value, code: value,
level,
id, id,
}); });
return data.available ? Promise.resolve() : Promise.reject(new Error(data.msg)); return data.available ? Promise.resolve() : Promise.reject(new Error(data.msg));