行政区划选择器修改

master
toesbieya 6 years ago
parent 70a6873ea9
commit 9702024611
  1. 13
      vue/src/components/RegionSelector/Tab/index.vue
  2. 43
      vue/src/components/RegionSelector/Tab/style.scss
  3. 7
      vue/src/components/UploadFile/index.vue

@ -4,13 +4,14 @@
:value="value"
:disabled="readonly"
:size="size"
popper-append-to-body
clearable
@clear="() => $emit('clear')"
@visible-change="visibleChange"
>
<template slot="empty">
<div class="rg-header">
<span>行政区划选择</span>
<h3>行政区划选择</h3>
<button class="rg-removeall-button" type="button" title="清除已选" @click="removeAll">
<i class="el-icon-delete"/>
</button>
@ -24,8 +25,8 @@
v-model="searchText"
class="rg-input"
type="text"
placeholder="输入地区id或名称,回车搜索"
@keyup.enter="search"
placeholder="输入地区id或名称搜索"
@input="search"
>
</div>
<div class="rg-level-tabs">
@ -53,6 +54,7 @@
</template>
<script>
import {debounce} from "@/utils"
import {createLimitTree, getNodeId} from "@/utils/tree"
import common from '../mixin'
@ -185,7 +187,9 @@
parent = result[i - 1] || {children: this.treeData}
const node = parent.children.find(predicate(str))
//退
if (!node) break
result.push(node)
}
@ -196,6 +200,8 @@
this.maxLevel = DEFAULT_MAX_LEVEL
this.selected = JSON.parse(JSON.stringify(DEFAULT_TABS))
this.currentLevel = 1
this.searchText = ''
this.setItems(this.currentLevel)
},
done() {
@ -236,6 +242,7 @@
},
created() {
this.search = debounce(this.search, 200)
this.selected = JSON.parse(JSON.stringify(DEFAULT_TABS))
},

@ -5,22 +5,10 @@
.rg-header {
h3 {
line-height: normal;
padding: 6px 80px 10px 10px;
padding: 6px;
margin: 0;
text-align: left;
color: #24292e;
font-size: 16px;
white-space: nowrap;
.rg-header-selected {
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
font-size: 14px;
max-width: 310px;
display: inline-block;
}
}
button {
@ -98,41 +86,21 @@
}
.rg-results-container {
background-color: #fff;
list-style: none;
margin: 0;
padding: 0;
position: relative;
width: 100%;
overflow-y: auto;
overflow-x: hidden;
clear: both;
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
.rg-results {
background-color: #fff;
list-style: none;
margin: 0;
padding: 5px;
width: 364px;
line-height: 1.5;
li {
margin: 0;
overflow: hidden;
padding: 3px 10px;
position: relative;
text-align: left;
white-space: nowrap;
font-size: 14px;
color: black;
cursor: pointer;
&.rg-item {
display: inline-block;
border-radius: 2px;
margin-right: 5px;
color: #777;
&:hover {
@ -150,8 +118,6 @@
height: 30px;
line-height: 30px;
text-align: center;
box-sizing: content-box;
font-size: 14px;
cursor: default;
}
}
@ -159,16 +125,11 @@
}
.rg-input {
display: block;
background-color: #f5f5f5;
margin: 0 !important;
border: 0;
width: 100%;
font-size: 14px;
line-height: 1.42;
padding: 4px 6px;
vertical-align: middle;
box-sizing: border-box;
padding: 6px;
outline: none !important;
border-radius: 2px;

@ -13,7 +13,7 @@
action=""
list-type="picture-card"
>
<i class="el-icon-plus" slot="default"/>
<i slot="default" class="el-icon-plus"/>
<template v-slot:file="{file}">
<span
@ -157,6 +157,9 @@
//remove
remove(file) {
//tooltip
this.handleBlockMouseLeave()
//
//
if (!file.raw) this.$emit('remove', {url: file.downloadUrl.replace(attachmentPrefix, '')})
@ -234,7 +237,7 @@
},
created() {
this.activateTooltip = debounce(tooltip => tooltip.handleShowPopper(), 100)
this.activateTooltip = debounce(tooltip => tooltip.handleShowPopper(), 200)
}
}
</script>

Loading…
Cancel
Save