diff --git a/public/react/src/common/components/MyIcon.js b/public/react/src/common/components/MyIcon.js new file mode 100644 index 000000000..7c6f4bb94 --- /dev/null +++ b/public/react/src/common/components/MyIcon.js @@ -0,0 +1,15 @@ +/* + * @Description: 引入阿里图标库 + * @Author: tangjiang + * @Github: + * @Date: 2019-12-10 09:03:48 + * @LastEditors: tangjiang + * @LastEditTime: 2019-12-10 09:05:41 + */ +import { Icon } from 'antd'; + +const MyIcon = Icon.createFromIconfontCN({ + scriptUrl: '//at.alicdn.com/t/font_1535266_ss6796i6f6j.js' +}); + +export default MyIcon; diff --git a/public/react/src/modules/developer/DeveloperHome.js b/public/react/src/modules/developer/DeveloperHome.js index 1816ccbc7..178e13ef5 100644 --- a/public/react/src/modules/developer/DeveloperHome.js +++ b/public/react/src/modules/developer/DeveloperHome.js @@ -9,13 +9,15 @@ import './index.scss'; import React from 'react'; -import { Table, Button, Dropdown, Icon, Menu, Card, Input, Select, Tag } from 'antd'; +import { Table, Button, Dropdown, Icon, Menu, Card, Input, Select, Tag, Modal } from 'antd'; import { connect } from 'react-redux'; import actions from '../../redux/actions'; import MultipTags from './components/multiptags'; -import { Link } from 'react-router-dom'; +// import { Link } from 'react-router-dom'; import CONST from '../../constants'; import { withRouter } from 'react-router'; +import { toStore } from 'educoder'; +// import MyIcon from '../../common/components/MyIcon'; const {tagBackground, diffText} = CONST; const { Search } = Input; @@ -104,14 +106,30 @@ class DeveloperHome extends React.PureComponent { options = { title: '操作', key: 'action', - fixed: 'right', + // fixed: 'right', width: 100, render: (text, record) => ( - - - + + ), } @@ -222,6 +240,22 @@ class DeveloperHome extends React.PureComponent { this.props.history.push(`/problems/${identifier}/edit`) } } + + // 删除 + handleClickDelete = (record) => { + const { deleteItem } = this.props; + Modal.confirm({ + title: '删除', + content: `确定要删除${record.name}吗?`, + okText: '确定', + cancelText: '取消', + onOk () { + // 调用删除接口 + console.log(record.identifier); + deleteItem(record.identifier); + } + }); + } // table条件变化时 handleTableChange = (pagination, filters, sorter) => { const {field, order} = sorter; @@ -374,7 +408,7 @@ class DeveloperHome extends React.PureComponent { // console.log('name has click', record); // 先调用start接口获取返回的 identifier, 再跳转到开启编辑 if (this.isLogin()) { - // console.log(record); + toStore('hack_identifier', record.identifier); // 保存当前编辑的id号 this.props.startProgramQuestion(record.identifier, this.props); } } @@ -499,7 +533,8 @@ const mapDispatchToProps = (dispatch) => ({ handleClick: () => dispatch(actions.toggleTodo()), fetchOJList: (params) => dispatch(actions.getOJList(params)), changePaginationInfo: (obj) => dispatch(actions.changePaginationInfo(obj)), - startProgramQuestion: (id, props) => dispatch(actions.startProgramQuestion(id, props)) + startProgramQuestion: (id, props) => dispatch(actions.startProgramQuestion(id, props)), + deleteItem: (identifier) => dispatch(actions.deleteItem(identifier)) }); export default withRouter(connect( diff --git a/public/react/src/modules/developer/components/controlSetting/index.js b/public/react/src/modules/developer/components/controlSetting/index.js index b6ab66c10..690bbad36 100644 --- a/public/react/src/modules/developer/components/controlSetting/index.js +++ b/public/react/src/modules/developer/components/controlSetting/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 16:02:36 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-03 09:19:54 + * @LastEditTime: 2019-12-10 09:30:27 */ import './index.scss'; import React, { useState, useRef } from 'react'; diff --git a/public/react/src/modules/developer/components/execResult/index.js b/public/react/src/modules/developer/components/execResult/index.js index 5f8526ca4..32bbbee91 100644 --- a/public/react/src/modules/developer/components/execResult/index.js +++ b/public/react/src/modules/developer/components/execResult/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-28 08:44:54 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-03 12:38:27 + * @LastEditTime: 2019-12-10 09:24:02 */ import './index.scss'; import React, { useState, useEffect } from 'react'; @@ -19,7 +19,7 @@ function ExecResult (props) { // 指定渲染初始, 加载中, 加载完成页面内容 const renderInit = () => (
- 请先点击“调试代码”运行您的代码 + 请填写测试用例的输入值,点击“调试代码”
); const renderLoading = () => ( diff --git a/public/react/src/modules/developer/components/initTabCtx/index.js b/public/react/src/modules/developer/components/initTabCtx/index.js index 221558cdc..19f4230b1 100644 --- a/public/react/src/modules/developer/components/initTabCtx/index.js +++ b/public/react/src/modules/developer/components/initTabCtx/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 19:46:14 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-03 09:14:59 + * @LastEditTime: 2019-12-10 09:31:00 */ import './index.scss'; import React, { useState, useEffect, useRef, useImperativeHandle, forwardRef } from 'react'; @@ -42,7 +42,6 @@ function InitTabCtx (props, ref) {
{ getFieldDecorator('input', { @@ -50,7 +49,10 @@ function InitTabCtx (props, ref) { { required: true, message: '输入值不能为空'} ], initialValue: inputValue - })(