hookehuyr

fix 修复字段权限勾选可编辑时字段不保存到本地问题

......@@ -1118,8 +1118,9 @@ export default {
// 修改缓存树的字段权限
if (state.node_tree[state.detailModel?.id]) {
state.node_tree[state.detailModel.id].field = _.cloneDeep(state.field_auths);
state.node_tree[state.detailModel.id].field_auths = _.cloneDeep(state.field_auths);
}
}
/**
......@@ -1335,7 +1336,7 @@ export default {
state.field_auths = state.node_tree[state.detailModel.id].field_auths;
state.more_attr = state.node_tree[state.detailModel.id].property;
// 初始化表单数据比较结构
// 把表单数据同步到提交数据(后端需要的字段和表单不是一个)
state.field_extend.forEach(ele => {
state.field_auths.forEach(auth => {
if (ele.field_id === auth.field_id) {
......@@ -1391,17 +1392,6 @@ export default {
state.more_attr = data.property; // 更多属性
// 初始化表单数据比较结构
state.field_extend.forEach(ele => {
state.field_auths.forEach(auth => {
if (ele.field_id === auth.field_id) {
ele.field_extend.visibled = auth.visible.checked;
ele.field_extend.editabled = auth.editable.checked;
ele.field_extend.readonly = auth.editable.disabled;
}
})
});
editor.openModel();
// 临时保存树信息
......@@ -1556,7 +1546,7 @@ export default {
const batchSaveForm = async () => { // 批量保存节点信息
for (const key in state.node_tree) {
const element = state.node_tree[key];
// 调整数据结构
// 把表单数据同步到提交数据(后端需要的字段和表单不是一个)
element.field_extend.forEach(ele => {
element.field_auths.forEach(auth => {
if (ele.field_id === auth.field_id) {
......@@ -1820,17 +1810,6 @@ export default {
}
});
// 初始化表单数据比较结构
field_extend.forEach(ele => {
field_auths.forEach(auth => {
if (ele.field_id === auth.field_id) {
ele.field_extend.visibled = auth.visible.checked;
ele.field_extend.editabled = auth.editable.checked;
ele.field_extend.readonly = auth.editable.disabled;
}
})
});
state.node_tree[model.id] = {
name: node_name,
user: userTags, // 开始节点没有负责人
......