Commit a743c390 authored by 罗林杰's avatar 罗林杰

修改工作区

parent 47e2a9d7
...@@ -134,12 +134,15 @@ export const approvalColumns: BasicColumn[] = [ ...@@ -134,12 +134,15 @@ export const approvalColumns: BasicColumn[] = [
dataIndex: 'flag', dataIndex: 'flag',
width: 50, width: 50,
customRender: ({ record }) => { customRender: ({ record }) => {
if (!Reflect.has(record, 'pendingStatus')) {
record.pendingStatus = false;
}
return h(Switch, { return h(Switch, {
checked: record.flag === '1', checked: record.flag === '1',
loading: record.pendingStatus, onChange(checked: CheckedType) {
const newStatus = checked ? '1' : '0';
const { createMessage } = useMessage();
record.flag = newStatus;
const text = record.flag === '1' ? '启用' : '停用';
createMessage.success(text + `成功`);
},
}); });
}, },
}, },
......
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