Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_item_bank

yslnewtiku
杨树林 5 years ago
commit 97295c824f

@ -83,9 +83,9 @@ class Admins::ShixunSettingsController < Admins::BaseController
sheet1[count_row, 6] = shixun.myshixuns_count
sheet1[count_row, 7] = shixun.myshixuns.select{|m| m.status == 1}.size
sheet1[count_row, 8] = shixun.shixun_status
sheet1[count_row, 9] = shixun.user.show_real_name
sheet1[count_row, 10] = shixun.user.school_name
sheet1[count_row, 11] = shixun.user.identity
sheet1[count_row, 9] = shixun.user&.show_real_name
sheet1[count_row, 10] = shixun.user&.school_name
sheet1[count_row, 11] = shixun.user&.identity
shixun.challenges.each do |challenge|
sheet1[count_row, 12] = "#{challenge.position}"
sheet1[count_row, 13] = challenge.subject

@ -180,7 +180,7 @@ $ml: 20px;
background: #fff;
left: 0px;
right: 0px;
top: -220px;
top: -250px;
padding: 0 20px;
}
}

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-23 11:33:41
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-25 11:07:42
* @LastEditTime : 2019-12-25 17:10:30
// */
import './index.scss';
import React, { useState, useEffect, useMemo } from 'react';
@ -129,7 +129,7 @@ const LeftPane = (props) => {
/>
</div>
<div className="number_flex flex_info">
<TextNumber text="huifu1" number={comments_count} type="icon" onIconClick={handleClickMessage}/>
<TextNumber text="huifu1" number={hack.comments_count} type="icon" onIconClick={handleClickMessage}/>
<TextNumber
className={user_praise ? 'like active' : 'like'}
text="dianzan"

@ -56,6 +56,7 @@ const types = {
CLEAR_OJ_FOR_USER_REDUCER: 'CLEAR_OJ_FOR_USER_REDUCER', // 退出时清空 ojForUserReducer保存内容
ADD_OJ_LIKE_COUNT: 'ADD_OJ_LIKE_COUNT', // 增加点赞数
CHANGE_RECORD_PAGINATION_PAGE: 'CHANGE_RECORD_PAGINATION_PAGE', // 改变提交分页
UPDATE_OJ_FOR_USER_COMMENT_COUNT: 'UPDATE_OJ_FOR_USER_COMMENT_COUNT', // 更新 hack 中的评论数
/*** jupyter */
GET_JUPYTER_DATA_SETS: 'GET_JUPYTER_DATA_SETS', // jupyter 数据集
GET_JUPYTER_TPI_URL: 'GET_JUPYTER_TPI_URL', // 获取 jupyter url

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-12-23 10:53:25
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-25 10:55:27
* @LastEditTime : 2019-12-25 17:06:57
*/
import types from "./actionTypes";
@ -24,6 +24,11 @@ export const addComment = (identifier, comments) => {
if (res.status === 200) {
// 重新加载评论列表
dispatch(getCommentLists(identifier));
// 成功后,评论加一条
dispatch({
type: types.UPDATE_OJ_FOR_USER_COMMENT_COUNT,
payload: 'add' //
});
}
});
}
@ -57,6 +62,11 @@ export const replayChildComment = (identifier, comment) => {
if (res.status === 200) {
// 重新加载评论列表
dispatch(getCommentLists(identifier));
// 成功后,评论加一条
dispatch({
type: types.UPDATE_OJ_FOR_USER_COMMENT_COUNT,
payload: 'add' //
});
}
});
}
@ -69,6 +79,11 @@ export const deleteComment = (identifier, delId) => {
if (res.status === 200) {
// 重新加载评论列表
dispatch(getCommentLists(identifier));
// 成功后,评论加一条
dispatch({
type: types.UPDATE_OJ_FOR_USER_COMMENT_COUNT,
payload: 'minus' //
});
}
});
}

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-27 13:41:48
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-25 14:45:47
* @LastEditTime : 2019-12-25 17:09:53
*/
import types from "../actions/actionTypes";
import { Base64 } from 'js-base64';
@ -211,6 +211,13 @@ const ojForUserReducer = (state = initialState, action) => {
...state,
pages: Object.assign({}, state.pages, { page: action.payload})
}
case types.UPDATE_OJ_FOR_USER_COMMENT_COUNT:
const {comments_count} = state.hack;
const _comments_count = action.payload === 'add' ? comments_count + 1 : comments_count - 1;
return {
...state,
hack: Object.assign({}, state.hack, { comments_count: _comments_count })
}
default:
return state;
}

Loading…
Cancel
Save