feat(Area): getArea method filter placeholder (#4717)

This commit is contained in:
Jake 2019-10-14 16:47:49 +08:00 committed by neverland
parent 06ad0e47d3
commit 309a5bc071
3 changed files with 7 additions and 3 deletions

View File

@ -2,7 +2,6 @@
// This file is auto gererated by build/build-entry.js
export default {
'changelog.en-US': () => import('../markdown/changelog.en-US.md'),
'changelog.generated': () => import('../markdown/changelog.generated.md'),
'changelog.zh-CN': () => import('../markdown/changelog.zh-CN.md'),
'contribution.zh-CN': () => import('../markdown/contribution.zh-CN.md'),
'design.zh-CN': () => import('../markdown/design.zh-CN.md'),

View File

@ -8,6 +8,7 @@
show-set-default
show-search-result
:search-result="searchResult"
:area-columns-placeholder="['请选择','请选择','请选择']"
@save="onSave"
@delete="onDelete"
@change-detail="onChangeDetail"

View File

@ -198,7 +198,10 @@ export default sfc({
},
getValues() {
return this.$refs.picker ? this.$refs.picker.getValues().filter(value => !!value) : [];
const { picker } = this.$refs;
let getValues = picker ? picker.getValues() : [];
getValues = this.parseOutputValues(getValues);
return getValues.filter(value => !!value);
},
getArea() {
@ -216,8 +219,9 @@ export default sfc({
}
const names = values.map(item => item.name);
const filterCodeValues = values.filter(value => !!value.code);
area.code = filterCodeValues.length ? filterCodeValues[filterCodeValues.length - 1].code : '';
area.code = values[values.length - 1].code;
if (area.code[0] === '9') {
area.country = names[1] || '';
area.province = names[2] || '';