Commit f59d6525 authored by wuhao's avatar wuhao 🎯

asder

parent 4aa5a5f8
...@@ -62,15 +62,15 @@ const Dic = (props) => { ...@@ -62,15 +62,15 @@ const Dic = (props) => {
ChildRef?.onRefresh(); ChildRef?.onRefresh();
} }
const { run, loading } = useRequest(doFetch, { const { run, loading } = useRequest(doFetch, {
manual: true, manual: true,
formatResult: (res) => res, formatResult: (res) => res,
onSuccess: (result, params) => { onSuccess: (result, params) => {
if (result.code == "0000") { if (result.code == "0000") {
reload(); reload();
dispatch({ type: "close" }); dispatch({ type: "close" });
} }
}, },
}), }),
[state, dispatch] = useReducer(reducer, initState), [state, dispatch] = useReducer(reducer, initState),
{ vs, fields, iftype, curitem } = state, { vs, fields, iftype, curitem } = state,
columns = [ columns = [
...@@ -109,46 +109,46 @@ const Dic = (props) => { ...@@ -109,46 +109,46 @@ const Dic = (props) => {
ifsc = record.isBasis == 2; ifsc = record.isBasis == 2;
return [ return [
ifs && ifs &&
ifsc && ifsc&&
getPrem("sysDepartment_save", action, "新增", () => { getPrem("sysDepartment_save", action, "新增", () => {
for (let i in defaultFields) { for (let i in defaultFields) {
defaultFields[i].value = null; 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;
} }
} dispatch({
dispatch({ type: "add",
type: "edit", fields: defaultFields,
fields: defaultFields, curitem: record,
curitem: record, title: `新增 ${record.title} 下的数据字典`,
title: `修改${record.title}`4, });
}); }),
}),
!ifs && !ifs &&
getPrem("sysDepartment_deleteById", action, "删除", null, { getPrem("sysDepartment_save", action, "修改", () => {
title: "确认删除该数据字典?", for (let i in defaultFields) {
onConfirm: () => { defaultFields[i].value = record[i];
run({ if (i == "dicName") {
url: "/ngic-base-business/sysDic/deleteById", defaultFields[i].value = record.title;
params: { id: record.key }, }
if (i == "dicDescription") {
defaultFields[i].value = record.description;
}
}
dispatch({
type: "edit",
fields: defaultFields,
curitem: record,
title: `修改${record.title}`,
}); });
}, }),
}), !ifs &&
getPrem("sysDepartment_deleteById", action, "删除", null, {
title: "确认删除该数据字典?",
onConfirm: () => {
run({
url: "/ngic-base-business/sysDic/deleteById",
params: { id: record.key },
});
},
}),
]; ];
} }
let saveData = (values, fn) => { 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