提交 bf922ed1 authored 作者: 钟是志's avatar 钟是志

18983 职业技能竞赛选择指导老师,第一次输入工号和姓名,可以搜索到。再次搜索其它老师工号,姓名、还有根据学院搜索,有时候根本搜索不到。属于大bug,要解决。用户体验很差。

上级 c4b6843d
......@@ -375,13 +375,18 @@ export default class tableCom extends Component {
count = [];
handleSearch = (selectedKeys, confirm) => {
confirm();
this.setState({searchText: selectedKeys[0]});
};
handleReset = clearFilters => {
clearFilters();
this.setState({searchText: ''});
this.resetSearchText();
};
resetSearchText = () => {
this.setState({
searchText: '',
});
};
getColumnSearchProps = (dataIndex, title) => ({
......@@ -445,14 +450,14 @@ export default class tableCom extends Component {
}
},
});
searchJson=(value,json,level,labs)=>{
searchJson = (value, json, level, labs) => {
for(var i=0;i<json.length;i++){
if(json[i].value==value[level]){
for (var i = 0; i < json.length; i++) {
if (json[i].value == value[level]) {
labs.push(json[i].label)
if(json[i].children){
if (json[i].children) {
this.searchJson(value,json[i].children,level+1,labs);
this.searchJson(value, json[i].children, level + 1, labs);
}
break;
}
......@@ -560,7 +565,7 @@ export default class tableCom extends Component {
}
}
dataFilter = ['Select', 'Radio', 'Checkbox','Cascader'];
dataFilter = ['Select', 'Radio', 'Checkbox', 'Cascader'];
getData = (json, dataColumn, obj, init) => {
......@@ -714,14 +719,14 @@ export default class tableCom extends Component {
break;
case 'func':
if (json.funcs != null && json.funcs != '') {
if(json.comName=="Cascader"){
if (json.comName == "Cascader") {
try {
this.getFunctionValue(json.funcs, {base52: this.props.uuid}, json, () => {
if (init != null && Object.keys(init).length > 0) {
let base52 = dataColumn.base52;
let vlu = this.props.form.getFieldValue(base52);
const labs = [];
this.searchJson(vlu,this.state.options,0,labs)
this.searchJson(vlu, this.state.options, 0, labs)
this.setState({labels: labs});
} else if (!this.props.isEdit && Object.keys(obj).length > 0) {
......@@ -730,14 +735,14 @@ export default class tableCom extends Component {
const vlu = obj[base52];
const labs = [];
this.searchJson(vlu,this.state.options,0,labs)
this.searchJson(vlu, this.state.options, 0, labs)
this.setState({labels: labs});
}
});
} catch (e) {
message.error('公式选项配置存在问题');
}
}else{
} else {
try {
this.getFunctionValue(json.funcs, {base52: this.props.uuid}, json, () => {
if (init != null && Object.keys(init).length > 0) {
......@@ -791,9 +796,6 @@ export default class tableCom extends Component {
}
}
break;
}
......@@ -2087,9 +2089,9 @@ export default class tableCom extends Component {
break;
case 'Cascader':
cm= <span>
cm = <span>
{labels != null
? labels.join(json.spliter?json.spliter:"")
? labels.join(json.spliter ? json.spliter : "")
: ''}
</span>
break;
......@@ -2819,7 +2821,7 @@ export default class tableCom extends Component {
showSearch
disabled={disabled}
placeholder={json.placeholder}
style={{width: json.width}} />);
style={{width: json.width}}/>);
if (
get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) ||
......@@ -2873,6 +2875,7 @@ export default class tableCom extends Component {
columns={this.state.columns}
dataSource={this.state.dataSource}
sqlModel={this.state.sqlModel}
resetSearchText={this.resetSearchText}
/>,
);
if (
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论