#
luxiaotao1123
2024-02-14 afc9ca78119731d6679ce49b7eff007b316badf1
#
2个文件已修改
57 ■■■■■ 已修改文件
zy-asrs-flow/src/pages/system/role/components/edit.jsx 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/system/role/index.jsx 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zy-asrs-flow/src/pages/system/role/components/edit.jsx
@@ -51,6 +51,11 @@
                    layout="horizontal"
                    grid={true}
                >
                    <ProFormDigit
                        name="id"
                        disabled
                        hidden={true}
                    />
                    <ProFormText
                        name="name"
                        label="角色名称"
zy-asrs-flow/src/pages/system/role/index.jsx
@@ -30,14 +30,15 @@
const handleUpdate = async (val) => {
    const hide = message.loading('正在更新');
    try {
        const resp = await updateRole(val);
        const resp = await Http.doPost('api/role/update', val);
        hide();
        if (resp.code === 200) {
            message.success('更新成功');
            return true;
        } else {
            message.error(resp.msg);
            return false;
        }
        return true;
    } catch (error) {
        hide();
        message.error('配置失败请重试!');
@@ -102,6 +103,49 @@
            title: '标识',
            dataIndex: 'code',
            valueType: 'text',
        },
        {
            title: '操作',
            dataIndex: 'option',
            width: '220px',
            valueType: 'option',
            render: (_, record) => [
                <Button
                    type="link"
                    size="small"
                    key="edit"
                    onClick={() => {
                        setModalVisible(true);
                        setCurrentRow(record);
                    }}
                >
                    编辑
                </Button>,
                <Button
                    type="link"
                    size="small"
                    danger
                    key="batchRemove"
                    onClick={async () => {
                        Modal.confirm({
                            title: '删除',
                            content: '确定删除该项吗?',
                            okText: '确认',
                            cancelText: '取消',
                            onOk: async () => {
                                const success = await handleRemoveOne(record);
                                if (success) {
                                    if (actionRef.current) {
                                        actionRef.current.reload();
                                    }
                                }
                            },
                        });
                    }}
                >
                    删除
                </Button>,
            ],
        },
    ];
@@ -226,9 +270,9 @@
                onSubmit={async (values) => {
                    let ok = false;
                    if (values.id) {
                        ok = await handleUpdate({...values})
                        ok = await handleUpdate({ ...values })
                    } else {
                        ok = await handleSave({...values})
                        ok = await handleSave({ ...values })
                    }
                    if (ok) {
                        setModalVisible(false);