diff --git a/vue/element-ui-personal/components/Select/Select.vue b/vue/element-ui-personal/components/Select/Select.vue index 80dffd4..49f1a92 100644 --- a/vue/element-ui-personal/components/Select/Select.vue +++ b/vue/element-ui-personal/components/Select/Select.vue @@ -12,28 +12,7 @@ :style="{ 'max-width': inputWidth - 32 + 'px', width: '100%' }" > - - - {{ selected[0].currentLabel }} - - - + {{ selected.length - 1 }} - - - + { - const length = this.$refs.input.value.length * 15 + 20 - this.inputLength = this.collapseTags ? Math.min(50, length) : length + this.inputLength = this.$refs.input.value.length * 15 + 20 this.managePlaceholder() this.resetInputHeight() }) @@ -483,25 +460,21 @@ }, getOption(value) { - let option - const isObject = Object.prototype.toString.call(value).toLowerCase() === '[object object]' - const isNull = Object.prototype.toString.call(value).toLowerCase() === '[object null]' - const isUndefined = Object.prototype.toString.call(value).toLowerCase() === '[object undefined]' + const type = v => Object.prototype.toString.call(v).toLowerCase() + const isObject = type(value) === '[object object]' + const isNull = type(value) === '[object null]' + const isUndefined = type(value) === '[object undefined]' for (let i = this.cachedOptions.length - 1; i >= 0; i--) { const cachedOption = this.cachedOptions[i] const isEqual = isObject ? getValueByPath(cachedOption.value, this.valueKey) === getValueByPath(value, this.valueKey) : cachedOption.value === value - if (isEqual) { - option = cachedOption - break - } + if (isEqual) return cachedOption } - if (option) return option - const label = (!isObject && !isNull && !isUndefined) - ? value : '' - let newOption = { + + const label = (!isObject && !isNull && !isUndefined) ? value : '' + const newOption = { value: value, currentLabel: label } @@ -533,9 +506,7 @@ }) } this.selected = result - this.$nextTick(() => { - this.resetInputHeight() - }) + this.$nextTick(() => this.resetInputHeight()) }, handleFocus(event) { @@ -618,7 +589,7 @@ }, resetInputHeight() { - if (this.collapseTags && !this.filterable) return + if (!this.filterable) return this.$nextTick(() => { if (!this.$refs.reference) return let inputChildNodes = this.$refs.reference.$el.childNodes @@ -747,7 +718,7 @@ }, deleteTag(event, tag) { - let index = this.selected.indexOf(tag) + const index = this.selected.indexOf(tag) if (index > -1 && !this.selectDisabled) { const value = this.value.slice() value.splice(index, 1) diff --git a/vue/src/bizComponents/document/DocSteps.vue b/vue/src/bizComponents/document/DocSteps.vue index 786b79e..a277034 100644 --- a/vue/src/bizComponents/document/DocSteps.vue +++ b/vue/src/bizComponents/document/DocSteps.vue @@ -11,9 +11,9 @@ render(h, context) { const {status, finish} = context.props - const active = status === 2 && (finish === undefined || finish === 1) ? 3 : status + const active = status === 2 && (finish === undefined || finish === 2) ? 4 : status return ( - + diff --git a/vue/src/components/RegionSelector/Tree/TreeDialog.vue b/vue/src/components/RegionSelector/Tree/TreeDialog.vue index ecf7733..79a94be 100644 --- a/vue/src/components/RegionSelector/Tree/TreeDialog.vue +++ b/vue/src/components/RegionSelector/Tree/TreeDialog.vue @@ -1,5 +1,5 @@ + + diff --git a/vue/src/router/constant/modules/example.js b/vue/src/router/constant/modules/example.js index 135e53a..f62e6c0 100644 --- a/vue/src/router/constant/modules/example.js +++ b/vue/src/router/constant/modules/example.js @@ -77,6 +77,12 @@ const router = { name: 'regionSelectorExample', component: lazyLoadView(import('@/views/example/components/regionSelectorExample')), meta: {title: '行政区划选择'} + }, + { + path: 'treeSelectExample', + name: 'treeSelectExample', + component: lazyLoadView(import('@/views/example/components/treeSelectExample')), + meta: {title: '树选择'} } ] }, diff --git a/vue/src/router/util.js b/vue/src/router/util.js index 3547796..fc6c5bd 100644 --- a/vue/src/router/util.js +++ b/vue/src/router/util.js @@ -6,7 +6,7 @@ import PageSkeleton from "@/components/Skeleton/PageSkeleton" //拼接页面标题 export function setPageTitle(route) { const pageTitle = route.meta.title - document.title= pageTitle ? `${pageTitle} - ${title}` : title + document.title = pageTitle ? `${pageTitle} - ${title}` : title } //确定路由的标题 diff --git a/vue/src/views/example/components/regionSelectorExample.vue b/vue/src/views/example/components/regionSelectorExample.vue index 4971012..ebd400b 100644 --- a/vue/src/views/example/components/regionSelectorExample.vue +++ b/vue/src/views/example/components/regionSelectorExample.vue @@ -1,5 +1,5 @@