mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 11:58:10 +08:00
修复 city 某些城市不可以选中的问题 (#1046)
This commit is contained in:
parent
71c17eee2e
commit
475da52706
@ -5,7 +5,7 @@ const path = require('path');
|
||||
const fs = require('fs');
|
||||
const package = require('./package.json');
|
||||
const parserMarkdown = require('./scripts/md-parser');
|
||||
fis.get('project.ignore').push('public/**', 'gh-pages/**');
|
||||
fis.get('project.ignore').push('public/**', 'npm/**', 'gh-pages/**');
|
||||
// 配置只编译哪些文件。
|
||||
|
||||
const Resource = fis.require('postpackager-loader/lib/resource.js');
|
||||
|
@ -349,13 +349,18 @@ export class TreeSelector extends React.Component<
|
||||
|
||||
@autobind
|
||||
handleEdit(item: Option) {
|
||||
const labelField = this.props.labelField;
|
||||
this.setState({
|
||||
isEditing: true,
|
||||
isAdding: false,
|
||||
editingItem: item,
|
||||
inputValue: item[labelField]
|
||||
});
|
||||
const {bultinCUD, onEdit, labelField, options} = this.props;
|
||||
|
||||
if (!bultinCUD) {
|
||||
onEdit?.(item);
|
||||
} else {
|
||||
this.setState({
|
||||
isEditing: true,
|
||||
isAdding: false,
|
||||
editingItem: item,
|
||||
inputValue: item[labelField]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@autobind
|
||||
|
@ -250,6 +250,9 @@ export class CityPicker extends React.Component<
|
||||
if (db[cityCode]) {
|
||||
state.cityCode = cityCode;
|
||||
state.city = db[cityCode];
|
||||
} else if (~db.city[provinceCode]?.indexOf(code)) {
|
||||
state.cityCode = code;
|
||||
state.city = db[code];
|
||||
}
|
||||
|
||||
if (code % 100) {
|
||||
@ -353,8 +356,7 @@ export class CityPicker extends React.Component<
|
||||
|
||||
{cityCode &&
|
||||
allowDistrict &&
|
||||
db.district[provinceCode] &&
|
||||
db.district[provinceCode][cityCode] ? (
|
||||
(db.district[provinceCode]?.[cityCode] as any)?.length ? (
|
||||
<Select
|
||||
disabled={disabled}
|
||||
options={(db.district[provinceCode][cityCode] as Array<number>).map(
|
||||
|
Loading…
Reference in New Issue
Block a user