dev_new_shixunsrepository
tangjiang 5 years ago
parent 831051c65c
commit f41321ba18

@ -83,7 +83,7 @@ export function initAxiosInterceptors(props) {
//proxy="http://47.96.87.25:48080"
proxy="https://pre-newweb.educoder.net"
proxy="https://test-newweb.educoder.net"
// proxy="https://test-jupyterweb.educoder.net"
proxy="https://test-jupyterweb.educoder.net"
//proxy="http://192.168.2.63:3001"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-12-30 13:51:19
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-02 17:00:10
* @LastEditTime : 2020-01-03 09:32:24
*/
import './index.scss';
import React, { useState, useEffect } from 'react';
@ -21,13 +21,23 @@ function KnowLedge (props) {
} = props;
useEffect(() => {
setSelectOptions(options || []);
const _options = [];
const _selects = [];
options.forEach(opt => {
if (!values.includes(opt.id)) {
_options.push(opt);
} else {
_selects.push(opt);
}
});
setSelectOptions(_options || []);
setSelectValue(_selects || []);
}, [props]);
// 显示的下拉项
const [selectOptions, setSelectOptions] = useState(options);
// 已选择的下拉项
const [selectValue, setSelectValue] = useState(values);
const [selectValue, setSelectValue] = useState([]);
//
const [value] = useState([]);
@ -87,8 +97,9 @@ function KnowLedge (props) {
));
}
// 渲染下拉列表
const renderSelect = (options) => {
const renderSelect = (options = []) => {
// console.log('+++++', options);
// setSelectValue(_selects);
return (
<Select
value={value}

@ -4,7 +4,7 @@
* @Github:
* @Date: 2019-11-20 10:35:40
* @LastEditors : tangjiang
* @LastEditTime : 2020-01-02 17:42:04
* @LastEditTime : 2020-01-03 09:20:12
*/
import './index.scss';
// import 'katex/dist/katex.css';
@ -146,7 +146,8 @@ class EditTab extends React.Component {
if (value[0] && item.id === value[0]) {
item.sub_disciplines && item.sub_disciplines.forEach(c => {
if (value[1] && c.id === value[1]) {
saveKnowledge(...c.tag_disciplines)
saveKnowledge(c.tag_disciplines)
console.log(c.tag_disciplines);
} else if (!value[1]) {
saveKnowledge([]);
}
@ -178,7 +179,7 @@ class EditTab extends React.Component {
tag_discipline_id,
knowledges
} = this.props;
console.log('+++++++++', knowledges);
console.log('knowledge======>>>>>>', knowledges);
// const {knowledges} = this.state;
// 表单label
const myLabel = (name, subTitle, nostar) => {

Loading…
Cancel
Save