dev_new_shixunsrepository
tangjiang 5 years ago
parent 4d818c8520
commit f7fc049d7e

@ -63,11 +63,11 @@ export function initAxiosInterceptors(props) {
const requestMap = {}; const requestMap = {};
window.railsgettimes = function(proxy) { window.railsgettimes = function(proxy) {
$.ajax({url:`${proxy}/api/main/first_stamp.json`,async:false,success:function(data,status){ // $.ajax({url:`${proxy}/api/main/first_stamp.json`,async:false,success:function(data,status){
if(data.status===0){ // if(data.status===0){
return data.message; // return data.message;
} // }
}}); // }});
} }
window.setfalseInRequestMap = function(keyName) { window.setfalseInRequestMap = function(keyName) {
@ -101,8 +101,9 @@ export function initAxiosInterceptors(props) {
} }
} }
if(`${config[0]}`!=`true`){ if(`${config[0]}`!=`true`){
let timestamp = Date.parse(new Date())/1000;
if (window.location.port === "3007") { if (window.location.port === "3007") {
let timestamp=railsgettimes(proxy); // let timestamp=railsgettimes(proxy);
console.log(timestamp) console.log(timestamp)
let newopens=md5(opens+timestamp) let newopens=md5(opens+timestamp)
config.url = `${proxy}${url}`; config.url = `${proxy}${url}`;

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-12-30 13:51:19 * @Date: 2019-12-30 13:51:19
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-30 18:02:20 * @LastEditTime : 2019-12-30 19:21:56
*/ */
import './index.scss'; import './index.scss';
import React, { useState } from 'react'; import React, { useState } from 'react';
@ -23,6 +23,8 @@ function KnowLedge (props) {
const [selectOptions, setSelectOptions] = useState(options); const [selectOptions, setSelectOptions] = useState(options);
// 已选择的下拉项 // 已选择的下拉项
const [selectValue, setSelectValue] = useState(values); const [selectValue, setSelectValue] = useState(values);
//
const [value] = useState([]);
// 渲染下拉选项 // 渲染下拉选项
const renderOptions = (options = []) => { const renderOptions = (options = []) => {
@ -32,8 +34,9 @@ function KnowLedge (props) {
)); ));
} }
const handleSelectChange = (value) => { const handleSelectChange = (value) => {
console.log(value); console.log('过滤结果Start=====》》》》》', selectOptions, value);
const _result = selectOptions.filter(item => item !== value); const _result = selectOptions.filter(item => item !== value.join(''));
console.log('过滤结果=====》》》》》', _result, selectOptions);
setSelectOptions(_result); setSelectOptions(_result);
} }
@ -41,7 +44,8 @@ function KnowLedge (props) {
const renderSelect = (options, values) => { const renderSelect = (options, values) => {
return ( return (
<Select <Select
mode="multiple" value={value}
mode="tags"
placeholder="请选择" placeholder="请选择"
style={{ width: '100%' }} style={{ width: '100%' }}
onChange={handleSelectChange} onChange={handleSelectChange}

@ -2,4 +2,8 @@
.ant-select-selection__rendered{ .ant-select-selection__rendered{
margin-bottom: 0 !important; margin-bottom: 0 !important;
} }
.ant-select-search--inline{
margin-left: 5px;
margin-top: 2px;
}
} }

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-20 10:35:40 * @Date: 2019-11-20 10:35:40
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2019-12-30 17:53:18 * @LastEditTime : 2019-12-30 19:20:50
*/ */
import './index.scss'; import './index.scss';
// import 'katex/dist/katex.css'; // import 'katex/dist/katex.css';

Loading…
Cancel
Save