Commit 4aa5a5f8 authored by wuhao's avatar wuhao 🎯

asder

parent a6d7ed12
......@@ -62,15 +62,15 @@ const Dic = (props) => {
ChildRef?.onRefresh();
}
const { run, loading } = useRequest(doFetch, {
manual: true,
formatResult: (res) => res,
onSuccess: (result, params) => {
if (result.code == "0000") {
reload();
dispatch({ type: "close" });
}
},
}),
manual: true,
formatResult: (res) => res,
onSuccess: (result, params) => {
if (result.code == "0000") {
reload();
dispatch({ type: "close" });
}
},
}),
[state, dispatch] = useReducer(reducer, initState),
{ vs, fields, iftype, curitem } = state,
columns = [
......@@ -109,45 +109,46 @@ const Dic = (props) => {
ifsc = record.isBasis == 2;
return [
ifs &&
getPrem("sysDepartment_save", action, "新增", () => {
for (let i in defaultFields) {
defaultFields[i].value = null;
}
dispatch({
type: "add",
fields: defaultFields,
curitem: record,
title: `新增 ${record.title} 下的数据字典`,
});
}),
ifsc &&
getPrem("sysDepartment_save", action, "新增", () => {
for (let i in defaultFields) {
defaultFields[i].value = null;
}
dispatch({
type: "add",
fields: defaultFields,
curitem: record,
title: `新增 ${record.title} 下的数据字典`,
});
}),
!ifs &&
getPrem("sysDepartment_save", action, "修改", () => {
for (let i in defaultFields) {
defaultFields[i].value = record[i];
if (i == "dicName") {
defaultFields[i].value = record.title;
}
if (i == "dicDescription") {
defaultFields[i].value = record.description;
}
getPrem("sysDepartment_save", action, "修改", () => {
for (let i in defaultFields) {
defaultFields[i].value = record[i];
if (i == "dicName") {
defaultFields[i].value = record.title;
}
dispatch({
type: "edit",
fields: defaultFields,
curitem: record,
title: `修改${record.title}`,
});
}),
if (i == "dicDescription") {
defaultFields[i].value = record.description;
}
}
dispatch({
type: "edit",
fields: defaultFields,
curitem: record,
title: `修改${record.title}`4,
});
}),
!ifs &&
getPrem("sysDepartment_deleteById", action, "删除", null, {
title: "确认删除该数据字典?",
onConfirm: () => {
run({
url: "/ngic-base-business/sysDic/deleteById",
params: { id: record.key },
});
},
}),
getPrem("sysDepartment_deleteById", action, "删除", null, {
title: "确认删除该数据字典?",
onConfirm: () => {
run({
url: "/ngic-base-business/sysDic/deleteById",
params: { id: record.key },
});
},
}),
];
}
let saveData = (values, fn) => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment