const clipcopy = (elements) => { elements = elements || document.querySelectorAll('.copy'); const clipboard = new Clipboard(elements); clipboard.on('success', ({ text }) => { message.success(text + ' 复制成功'); }); clipboard.on('error', () => { message.error('复制失败,请再次尝试'); }); }
/** * 弹窗确认, 打开按钮菊花并请求接口 * @private */ _confirmDialog() { if (!isStringLengthLeast(this.props.des, 3)) { message.error('项目描述长度最少为3位'); return; } this.props.showConfirmLoading(true); this.props.updateInfo(this.props.data.id, this.props.logoFile, this.props.des); }
const showHistory = (dispatch, stat) => { stat.loadHistories().then(stats => { dispatch({ type: HISTORY_SHOW, payload: stats }) }).catch(e => { message.error(e.message) }) }
componentWillReceiveProps(nextProps) { const { changeStatus } = nextProps; if (changeStatus !== this.props.changeStatus && changeStatus === 'errPass') { message.error('原始密码错误'); } else if (changeStatus !== this.props.changeStatus && changeStatus === 'succ') { message.success('修改成功'); localStorage.removeItem('login_token'); this.props.history.push('/login'); } else if (changeStatus !== this.props.changeStatus && changeStatus === 'netErr') { message.error('网络错误'); } }
error(){ Modal.error({ title: '错误提示', content: '内容不能为空' }) }
componentWillMount() { let {params, paramsKey} = this.props this.state = params && {params} || {params: []} let dir = getRootNode().findDirNodeById(paramsKey) dir.loadStatNodes().then(()=>{ if (dir && dir.stats) { this.paramOptions = dir.stats this.setState(Object.assign({}, this.state)) } }).catch(e=>{ message.error(e.message) }) }
form.validateFields((err, values) => { if (!err) { console.log(values) //登陆请求 this.props.login.handleLogin(values.username, values.password, form); }else { message.error('用户名和密码不能为空!') } });
saveStat() { const {onSave, selectedDir, columns} = this.props if (onSave && columns) { const requiredCols = columns.filter(column=>column.editable && column.required) for (let col of requiredCols) { if (!this.state[col.key]) { message.error('数据不完整') return } } onSave(this.state, selectedDir) } }
setTimeout(()=>{ action(()=>{this.loading = false;})(); if(username == '111' && password == '111'){ hashHistory.push({ pathname:'/nav2' }) message.success('登陆成功!'); }else{ form.resetFields(); message.error('用户名或密码错误!'); } },3000)
/** * 弹窗确认, 打开按钮菊花并请求接口 * @private */ _confirmDialog() { if (!isStringLengthLeast(this.props.nickname, 2)) { message.error('昵称长度最少为2位'); return; } this.props.showConfirmLoading(true); this.props.updateInfo({ uId: localStorage.uId, account: this.props.data.account, nickname: this.props.nickname }); }
error(){ Modal.error({ title: '错误提示', content: '你不是又酷又帅气能旋转跳跃飞舞的鱼露,你没权进入' }) }
error(){ Modal.error({ title: '错误提示', content: '你不是又酷又帅气能旋转跳跃飞舞的鱼露,你没权操作' }) }
error(){ Modal.error({ title: '错误提示', content: '你不是又酷又帅气能旋转跳跃飞舞的鱼露,你没权操作' }) }
static error() { Modal.error({ title: 'This is an error message', content: 'some messages...some messages...', }); }
error(){ Modal.error({ title: '错误提示', content: '你不是又酷又帅气能旋转跳跃飞舞的鱼露,你没权操作' }) }