From da64ab0923bf8817fc8599a6e37b953ce38f64c8 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期日, 27 八月 2023 18:37:36 +0800 Subject: [PATCH] 2023-08-27 --- src/pc/modulesource/index.jsx | 53 +---------------------------------------------------- 1 files changed, 1 insertions(+), 52 deletions(-) diff --git a/src/pc/modulesource/index.jsx b/src/pc/modulesource/index.jsx index f84cdd7..feabed5 100644 --- a/src/pc/modulesource/index.jsx +++ b/src/pc/modulesource/index.jsx @@ -1,14 +1,9 @@ import React, {Component} from 'react' import { is, fromJS } from 'immutable' -import { Modal, notification } from 'antd' -import Api from '@/api' import { menuOptions } from './option' import SourceWrap from './dragsource' -import MKEmitter from '@/utils/events.js' import './index.scss' - -const { confirm } = Modal class ModelSource extends Component { state = { @@ -30,54 +25,8 @@ }) } - UNSAFE_componentWillReceiveProps (nextProps) { - if (nextProps.components && !is(fromJS(this.props.components), fromJS(nextProps.components))) { - this.setState({ - menuOptions: fromJS(nextProps.components).toJS() - }) - } - } - shouldComponentUpdate (nextProps, nextState) { return !is(fromJS(this.state), fromJS(nextState)) - } - - triggerDel = (item) => { - confirm({ - title: `纭畾鍒犻櫎<${item.title}>鍚楋紵`, - content: '', - onOk() { - return new Promise(resolve => { - Api.getSystemConfig({ - func: 's_custom_components_adduptdel', - c_id: item.uuid, - images: '', - c_name: item.title, - typename: sessionStorage.getItem('appType') || '', - long_param: '', - del_type: 'Y' - }).then(result => { - if (result.status) { - notification.success({ - top: 92, - message: '鍒犻櫎鎴愬姛锛�', - duration: 5 - }) - - MKEmitter.emit('updateCustomComponent') - } else { - notification.warning({ - top: 92, - message: result.message, - duration: 5 - }) - } - resolve() - }) - }) - }, - onCancel() {} - }) } render() { @@ -85,7 +34,7 @@ return ( <div className="mob-card-source-box"> - {menuOptions.map((item, index) => (<SourceWrap key={index} item={item} triggerDel={this.triggerDel} />))} + {menuOptions.map((item, index) => (<SourceWrap key={index} item={item}/>))} </div> ) } -- Gitblit v1.8.0