How to use the antd.Modal.confirm function in antd

To help you get started, we’ve selected a few antd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rekit / rekit / packages / rekit-studio / src / features / editor / CodeEditor.js View on Github external
});
    } else if (nextProps.fileContentNeedReload[nextProps.file]) {
      const oldContent = this.getFileContent();
      const hasChange = this.hasChange(); // has changed
      await this.checkAndFetchFileContent(nextProps);
      modelManager.setInitialValue(nextProps.file, this.getFileContent(nextProps.file), true);
      this.setState({
        loadingFile: false,
      });
      const newContent = this.getFileContent();
      if (
        hasChange &&
        oldContent !== newContent &&
        newContent !== modelManager.getValue(nextProps.file)
      ) {
        Modal.confirm({
          title: 'The file has changed on disk.',
          content: 'Do you want to reload it?',
          okText: 'Yes',
          cancelText: 'No',
          onOk: () => {
            modelManager.reset(nextProps.file);
          },
        });
      }
    }
  }
github ppdaicorp / das / das-console-static / src / view / components / pages / init / Init.jsx View on Github external
submitInitData(current) {
        const _this = this
        Modal.confirm({
            title: '温馨提示!!',
            content: '将会删除并创建DAS的相关物理库表,是否继续?',
            okText: '继续',
            cancelText: '取消',
            onOk() {
                const dbconectInfo = _this.getValueToJson(_this.objName)
                _this.props.addInit(dbconectInfo, _this, (_this, data) => {
                    if (data.code == 200) {
                        _this.showSuccessMsg('初始化成功')
                        window.setTimeout(() => {
                            _this.setState({current})
                        }, 800)
                    } else {
                        _this.showErrorsNotification(data.msg)
                    }
                })
github rekit / rekit / packages / rekit-studio / src / features / plugin-default / ui / menu.js View on Github external
targetId: elementId,
            elementType: 'folder',
          });
          break;
        }
        case 'move': {
          showDialog('core.element.move.component', 'Move', {
            action: 'move',
            targetId: elementId,
          });
          break;
        }
        case 'del-file-folder': {
          const ele = byId(elementId);
          
          Modal.confirm({
            title: `Are you sure to delete the ${ele.type}?`,
            onOk() {
              if (!ele) {
                Modal.error({
                  title: 'No element to delete',
                  content: `Element not found: ${elementId}`,
                });
                return;
              }
              const name = ele.id;
              execCoreCommand({
                commandName: 'remove',
                type: ele.type,
                name,
              }).then(
                () => {
github phonegapX / QuantBot / web / src / containers / App.js View on Github external
switch (e.key) {
      case 'dashboard':
        browserHistory.push('/');
        break;
      case 'algorithm':
        browserHistory.push('/algorithm');
        break;
      case 'exchange':
        browserHistory.push('/exchange');
        break;
      case 'user':
        browserHistory.push('/user');
        break;
      case 'logout':
        Modal.confirm({
          title: 'Are you sure to logout ?',
          onOk: () => {
            dispatch(Logout());
            browserHistory.push('/login');
          },
          iconType: 'exclamation-circle',
        });
        break;
    }
  }
github gangtao / dataplay3 / client / src / pages / Prediction / TimeSerial / index.js View on Github external
const onDelete = r => {
      Modal.confirm({
        title: 'Do you Want to delete this job?',
        content: `job ${r.name} will be deleted! `,
        onOk() {
          dispatch({
            type: 'timeserials/removeJob',
            payload: r.id,
          });
        },
      });
    };
github miaolz123 / stockdb / admin / src / containers / App.js View on Github external
if (e.key !== 'logout') {
      this.setState({
        current: e.key,
      });
    }

    switch (e.key) {
      case 'home':
        browserHistory.push('/');
        break;
      case 'chart':
        browserHistory.push('/chart');
        break;
      case 'logout':
        Modal.confirm({
          title: 'Are you sure to log out ?',
          onOk: () => {
            dispatch(logout());
            browserHistory.push('/login');
          },
          iconType: 'exclamation-circle',
        });
        break;
    }
  }
github knstvk / akkount / modules / front / src / app / currency / CurrencyList.tsx View on Github external
showDeletionDialog = (e: SerializedEntity) => {
    Modal.confirm({
      title: this.props.intl.formatMessage(
        { id: "management.browser.delete.areYouSure" },
        { instanceName: e._instanceName }
      ),
      okText: this.props.intl.formatMessage({
        id: "management.browser.delete.ok"
      }),
      cancelText: this.props.intl.formatMessage({
        id: "management.browser.delete.cancel"
      }),
      onOk: () => {
        return this.dataCollection.delete(e);
      }
    });
  };
github silentbalanceyh / vertx-ui / src / ux / _backup / Ux.Ant.js View on Github external
const uiDialogConfirm = (config = {}, execFunc) =>
    Modal.confirm({
        ...config,
        onOk: execFunc
    });
const uiItemCheckbox = (item = [], jsx) => {
github chenxiaolei / ZLMediaKit_NVR_UI / src / view / home / Home.jsx View on Github external
title: '提示!',
                            content: "您确定要重启ZlMedia吗",
                            type: 'confirm',
                            okText: '确定',
                            okType: 'danger',
                            cancelText: '放弃',
                            okCancel: true,
                            onOk: () => {
                                restartZlmediaServer().then((res) => {
                                    if (res.code == 0) {
                                        message.info(res.msg);
                                    }
                                })
                            }
                        };
                        return Modal.confirm(config);
                    }}>重启服务