树表的局部刷新改进,删除、停用、启用、修改父节点的情况下完美体验
This commit is contained in:
@@ -51,7 +51,7 @@
|
|||||||
formKey="${table.optionMap['bpmFormKey']}"
|
formKey="${table.optionMap['bpmFormKey']}"
|
||||||
completeText="提交"
|
completeText="提交"
|
||||||
:loading="loadingRef"
|
:loading="loadingRef"
|
||||||
:auth="'oa:oaLeave:edit'"
|
:auth="'${permissionPrefix}:edit'"
|
||||||
@complete="handleSubmit"
|
@complete="handleSubmit"
|
||||||
@success="handleSuccess"
|
@success="handleSuccess"
|
||||||
@close="closeDrawer"
|
@close="closeDrawer"
|
||||||
@@ -576,17 +576,17 @@ for (c in table.columnList){
|
|||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
try {
|
try {
|
||||||
const data = await validate();
|
const data = await validate();
|
||||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
data.bpm = record.value.bpm; // 流程信息
|
data.bpm = record.value.bpm; // 流程信息
|
||||||
data.status = record.value.status; // 提交状态
|
data.status = record.value.status; // 提交状态
|
||||||
loadingRef.value = true;
|
loadingRef.value = true;
|
||||||
<% } %>
|
<% } %>
|
||||||
setDrawerProps({ confirmLoading: true });
|
setDrawerProps({ confirmLoading: true });
|
||||||
const params: any = {
|
const params: any = {
|
||||||
isNewRecord: record.value.isNewRecord,
|
isNewRecord: record.value.isNewRecord,
|
||||||
<%
|
<%
|
||||||
for (c in table.columnList){
|
for (c in table.columnList){
|
||||||
if (c.isPk == '1' || c.showType == 'hidden'){ %>
|
if (c.isPk == '1' || c.showType == 'hidden'){ %>
|
||||||
${c.attrName}: record.value.${c.attrName},
|
${c.attrName}: record.value.${c.attrName},
|
||||||
<%
|
<%
|
||||||
}
|
}
|
||||||
@@ -595,6 +595,9 @@ for (c in table.columnList){
|
|||||||
};
|
};
|
||||||
<% for (child in table.childList){ %>
|
<% for (child in table.childList){ %>
|
||||||
data.${@StringUtils.uncap(child.className)}List = await get${child.className}List();
|
data.${@StringUtils.uncap(child.className)}List = await get${child.className}List();
|
||||||
|
<% } %>
|
||||||
|
<% if(table.isTreeEntity){ %>
|
||||||
|
data.oldParentCode = record.value.parentCode;
|
||||||
<% } %>
|
<% } %>
|
||||||
// console.log('submit', params, data, record);
|
// console.log('submit', params, data, record);
|
||||||
const res = await ${className}Save(params, data);
|
const res = await ${className}Save(params, data);
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ for(c in table.columnList){
|
|||||||
title: t('停用${functionNameSimple}'),
|
title: t('停用${functionNameSimple}'),
|
||||||
popConfirm: {
|
popConfirm: {
|
||||||
title: t('是否确认停用${functionNameSimple}'),
|
title: t('是否确认停用${functionNameSimple}'),
|
||||||
confirm: handleDisable.bind(this, { ${idParam} }),
|
confirm: handleDisable.bind(this, record),
|
||||||
},
|
},
|
||||||
auth: '${permissionPrefix}:edit',
|
auth: '${permissionPrefix}:edit',
|
||||||
ifShow: () => record.status === '0',
|
ifShow: () => record.status === '0',
|
||||||
@@ -335,7 +335,7 @@ for(c in table.columnList){
|
|||||||
title: t('启用${functionNameSimple}'),
|
title: t('启用${functionNameSimple}'),
|
||||||
popConfirm: {
|
popConfirm: {
|
||||||
title: t('是否确认启用${functionNameSimple}'),
|
title: t('是否确认启用${functionNameSimple}'),
|
||||||
confirm: handleEnable.bind(this, { ${idParam} }),
|
confirm: handleEnable.bind(this, record),
|
||||||
},
|
},
|
||||||
auth: '${permissionPrefix}:edit',
|
auth: '${permissionPrefix}:edit',
|
||||||
ifShow: () => record.status === '2',
|
ifShow: () => record.status === '2',
|
||||||
@@ -348,7 +348,7 @@ for(c in table.columnList){
|
|||||||
title: t('删除${functionNameSimple}'),
|
title: t('删除${functionNameSimple}'),
|
||||||
popConfirm: {
|
popConfirm: {
|
||||||
title: t('是否确认删除${functionNameSimple}'),
|
title: t('是否确认删除${functionNameSimple}'),
|
||||||
confirm: handleDelete.bind(this, { ${idParam} }),
|
confirm: handleDelete.bind(this, record),
|
||||||
},
|
},
|
||||||
auth: '${permissionPrefix}:edit',
|
auth: '${permissionPrefix}:edit',
|
||||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
@@ -444,26 +444,29 @@ for(c in table.columnList){
|
|||||||
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
|
<% if(toBoolean(table.optionMap['isHaveDisableEnable'])){ %>
|
||||||
|
|
||||||
async function handleDisable(record: Recordable) {
|
async function handleDisable(record: Recordable) {
|
||||||
const res = await ${className}Disable(record);
|
const params = { ${idParam} };
|
||||||
|
const res = await ${className}Disable(params);
|
||||||
showMessage(res.message);
|
showMessage(res.message);
|
||||||
handleSuccess();
|
handleSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleEnable(record: Recordable) {
|
async function handleEnable(record: Recordable) {
|
||||||
const res = await ${className}Enable(record);
|
const params = { ${idParam} };
|
||||||
|
const res = await ${className}Enable(params);
|
||||||
showMessage(res.message);
|
showMessage(res.message);
|
||||||
handleSuccess();
|
handleSuccess(record);
|
||||||
}
|
}
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
async function handleDelete(record: Recordable) {
|
async function handleDelete(record: Recordable) {
|
||||||
const res = await ${className}Delete(record);
|
const params = { ${idParam} };
|
||||||
|
const res = await ${className}Delete(params);
|
||||||
showMessage(res.message);
|
showMessage(res.message);
|
||||||
handleSuccess();
|
handleSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleSuccess() {
|
function handleSuccess(record: Recordable) {
|
||||||
reload();
|
reload({ record });
|
||||||
}
|
}
|
||||||
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
<% if(toBoolean(table.optionMap['isBpmForm'])){ %>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user