Commit 4aa5a5f8 authored by wuhao's avatar wuhao 🎯

asder

parent a6d7ed12
...@@ -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,45 +109,46 @@ const Dic = (props) => { ...@@ -109,45 +109,46 @@ const Dic = (props) => {
ifsc = record.isBasis == 2; ifsc = record.isBasis == 2;
return [ return [
ifs && ifs &&
getPrem("sysDepartment_save", action, "新增", () => { ifsc &&
for (let i in defaultFields) { getPrem("sysDepartment_save", action, "新增", () => {
defaultFields[i].value = null; for (let i in defaultFields) {
} defaultFields[i].value = null;
dispatch({ }
type: "add", dispatch({
fields: defaultFields, type: "add",
curitem: record, fields: defaultFields,
title: `新增 ${record.title} 下的数据字典`, curitem: record,
}); title: `新增 ${record.title} 下的数据字典`,
}), });
}),
!ifs && !ifs &&
getPrem("sysDepartment_save", action, "修改", () => { getPrem("sysDepartment_save", action, "修改", () => {
for (let i in defaultFields) { for (let i in defaultFields) {
defaultFields[i].value = record[i]; defaultFields[i].value = record[i];
if (i == "dicName") { if (i == "dicName") {
defaultFields[i].value = record.title; defaultFields[i].value = record.title;
}
if (i == "dicDescription") {
defaultFields[i].value = record.description;
}
} }
dispatch({ if (i == "dicDescription") {
type: "edit", defaultFields[i].value = record.description;
fields: defaultFields, }
curitem: record, }
title: `修改${record.title}`, dispatch({
}); type: "edit",
}), fields: defaultFields,
curitem: record,
title: `修改${record.title}`4,
});
}),
!ifs && !ifs &&
getPrem("sysDepartment_deleteById", action, "删除", null, { getPrem("sysDepartment_deleteById", action, "删除", null, {
title: "确认删除该数据字典?", title: "确认删除该数据字典?",
onConfirm: () => { onConfirm: () => {
run({ run({
url: "/ngic-base-business/sysDic/deleteById", url: "/ngic-base-business/sysDic/deleteById",
params: { id: record.key }, 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