From 8954fe89c0b11b531e3cf2dcae86b080f40cc9f6 Mon Sep 17 00:00:00 2001
From: toesbieya <1647775459@qq.com>
Date: Wed, 10 Jun 2020 18:51:42 +0800
Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=A1=8C=E6=94=BF=E5=8C=BA?=
=?UTF-8?q?=E5=88=92=E9=80=89=E6=8B=A9=E7=BB=84=E4=BB=B6=20=E7=A7=BB?=
=?UTF-8?q?=E9=99=A4=E4=BA=86=E6=94=B9=E5=86=99=E7=9A=84popover?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/Popover/index.vue | 217 ---------------
vue/element-ui-personal/index.js | 3 +-
vue/src/assets/styles/element-ui.scss | 2 +
.../bizComponents/DocumentHistory/index.vue | 2 +-
.../components/RegionSelector/Tab/index.vue | 263 ++++++++++++++++++
.../components/RegionSelector/Tab/style.scss | 178 ++++++++++++
.../RegionSelector/Tree/TreeDialog.vue | 11 +-
.../components/RegionSelector/Tree/index.vue | 16 +-
vue/src/components/RegionSelector/index.vue | 18 ++
vue/src/components/RegionSelector/mixin.js | 10 +
vue/src/router/constant/modules/example.js | 6 +
vue/src/utils/validate.js | 2 +-
.../components/regionSelectorExample.vue | 41 +++
vue/src/views/stock/current/index.vue | 2 +-
vue/src/views/system/customer/EditDialog.vue | 3 +-
vue/src/views/system/customer/index.vue | 4 +-
vue/src/views/system/supplier/EditDialog.vue | 1 -
vue/src/views/system/supplier/index.vue | 2 +-
18 files changed, 537 insertions(+), 244 deletions(-)
delete mode 100644 vue/element-ui-personal/components/Popover/index.vue
create mode 100644 vue/src/components/RegionSelector/Tab/index.vue
create mode 100644 vue/src/components/RegionSelector/Tab/style.scss
create mode 100644 vue/src/components/RegionSelector/index.vue
create mode 100644 vue/src/components/RegionSelector/mixin.js
create mode 100644 vue/src/views/example/components/regionSelectorExample.vue
diff --git a/vue/element-ui-personal/components/Popover/index.vue b/vue/element-ui-personal/components/Popover/index.vue
deleted file mode 100644
index 0a5e25b..0000000
--- a/vue/element-ui-personal/components/Popover/index.vue
+++ /dev/null
@@ -1,217 +0,0 @@
-
-
-
-
-
-
- {{title}}
-
-
{{ content }}
-
-
-
-
-
-
diff --git a/vue/element-ui-personal/index.js b/vue/element-ui-personal/index.js
index 6612258..0d6836a 100644
--- a/vue/element-ui-personal/index.js
+++ b/vue/element-ui-personal/index.js
@@ -1,8 +1,7 @@
import Message from "./components/Message"
-import Popover from './components/Popover'
import Select from './components/Select/Select'
-const components = [Popover, Select]
+const components = [Select]
export default function (Vue) {
components.forEach(component => {
diff --git a/vue/src/assets/styles/element-ui.scss b/vue/src/assets/styles/element-ui.scss
index b79a82a..afa7797 100644
--- a/vue/src/assets/styles/element-ui.scss
+++ b/vue/src/assets/styles/element-ui.scss
@@ -20,6 +20,8 @@
}
.el-card {
+ overflow: visible;
+
.el-card__body {
height: 100%;
}
diff --git a/vue/src/bizComponents/DocumentHistory/index.vue b/vue/src/bizComponents/DocumentHistory/index.vue
index d89591a..761b01d 100644
--- a/vue/src/bizComponents/DocumentHistory/index.vue
+++ b/vue/src/bizComponents/DocumentHistory/index.vue
@@ -11,7 +11,7 @@
if (type === 'add') return ''
return (
+ $emit('clear')"
+ @visible-change="visibleChange"
+ >
+
+
+
+
+
+
+
+
+ - clickItem(item)"
+ >
+ {{limit ? item.name + `(${item.value})` : item.name}}
+
+ - 无匹配项目
+
+
+
+
+
+
+
+
+
diff --git a/vue/src/components/RegionSelector/Tab/style.scss b/vue/src/components/RegionSelector/Tab/style.scss
new file mode 100644
index 0000000..56ca779
--- /dev/null
+++ b/vue/src/components/RegionSelector/Tab/style.scss
@@ -0,0 +1,178 @@
+.rg-header, .rg-search {
+ padding: 2px 10px 0;
+ background-color: white;
+}
+
+.rg-header {
+ h3 {
+ line-height: normal;
+ padding: 6px 80px 10px 10px;
+ 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 {
+ position: absolute;
+ -webkit-appearance: none;
+ padding: 0;
+ cursor: pointer;
+ background: 0 0;
+ border: 0;
+ outline: none;
+ color: #999;
+ top: 9px;
+
+ i {
+ font-size: 16px;
+ }
+
+ &:hover {
+ color: black;
+ }
+
+ &.rg-removeall-button {
+ right: 32px
+ }
+
+ &.rg-done-button {
+ right: 8px;
+ }
+ }
+}
+
+.rg-level-tabs {
+ margin-top: 10px;
+ background-color: #fff;
+
+ ul {
+ padding: 0;
+ margin: 0;
+ line-height: 1.5;
+ border-bottom: 1px solid #eee;
+
+ li {
+ display: inline-block;
+ position: relative;
+
+ a {
+ display: block;
+ padding: 0.2rem 1rem 0.6rem;
+ font-size: 14px;
+ color: #bbb;
+ text-decoration: none;
+ cursor: pointer;
+ line-height: 1.43;
+ }
+
+ &.active {
+ a {
+ color: #333;
+ background-color: #fff;
+ font-weight: 600;
+ }
+
+ &::after {
+ content: "";
+ display: block;
+ position: absolute;
+ bottom: 0;
+ height: 0.2rem;
+ width: 100%;
+ background-color: #bbb;
+ }
+ }
+ }
+ }
+}
+
+.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 {
+ color: black;
+ background-color: #F5F5F5;
+ }
+
+ &.active {
+ background-color: #E4EAEE;
+ color: black;
+ }
+ }
+
+ &.rg-message-box {
+ height: 30px;
+ line-height: 30px;
+ text-align: center;
+ box-sizing: content-box;
+ font-size: 14px;
+ cursor: default;
+ }
+ }
+ }
+}
+
+.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;
+ outline: none !important;
+ border-radius: 2px;
+
+ &::-webkit-input-placeholder {
+ color: #999;
+ }
+}
diff --git a/vue/src/components/RegionSelector/Tree/TreeDialog.vue b/vue/src/components/RegionSelector/Tree/TreeDialog.vue
index afb1a3f..2a37373 100644
--- a/vue/src/components/RegionSelector/Tree/TreeDialog.vue
+++ b/vue/src/components/RegionSelector/Tree/TreeDialog.vue
@@ -1,4 +1,5 @@
diff --git a/vue/src/components/RegionSelector/mixin.js b/vue/src/components/RegionSelector/mixin.js
new file mode 100644
index 0000000..6087103
--- /dev/null
+++ b/vue/src/components/RegionSelector/mixin.js
@@ -0,0 +1,10 @@
+export default {
+ props: {
+ value: String,
+ readonly: Boolean,
+ size: String,
+ getChildrenOnSelect: Boolean,
+ limit: Boolean,
+ limitApi: Function
+ }
+}
diff --git a/vue/src/router/constant/modules/example.js b/vue/src/router/constant/modules/example.js
index cbb696c..ba59d63 100644
--- a/vue/src/router/constant/modules/example.js
+++ b/vue/src/router/constant/modules/example.js
@@ -76,6 +76,12 @@ const router = {
name: 'signatureExample',
component: () => import('@/views/example/components/signatureExample'),
meta: {title: '手写签名'}
+ },
+ {
+ path: 'regionSelectorExample',
+ name: 'regionSelectorExample',
+ component: () => import('@/views/example/components/regionSelectorExample'),
+ meta: {title: '行政区划选择'}
}
]
},
diff --git a/vue/src/utils/validate.js b/vue/src/utils/validate.js
index a35fb4d..721a2df 100644
--- a/vue/src/utils/validate.js
+++ b/vue/src/utils/validate.js
@@ -57,7 +57,7 @@ export function isString(str) {
export function isInteger(v) {
let t = parseFloat(v)
- return t.toString() !== 'Nan' && t < 2147483647 && t > -2147483648
+ return t.toString() !== 'NaN' && t < 2147483647 && t > -2147483648
}
export function isImage(str) {
diff --git a/vue/src/views/example/components/regionSelectorExample.vue b/vue/src/views/example/components/regionSelectorExample.vue
new file mode 100644
index 0000000..4971012
--- /dev/null
+++ b/vue/src/views/example/components/regionSelectorExample.vue
@@ -0,0 +1,41 @@
+
+
+
+
+
+
选项卡型,支持v-model,样式搬的这个
+
+
+
+
+
+
+
+
diff --git a/vue/src/views/stock/current/index.vue b/vue/src/views/stock/current/index.vue
index 28e132a..d444a3b 100644
--- a/vue/src/views/stock/current/index.vue
+++ b/vue/src/views/stock/current/index.vue
@@ -156,7 +156,7 @@
exportExcel(baseUrl + '/export', this.mergeSearchForm(), this.excel)
},
nodeClick(obj) {
- let ids = getNodeId(obj.children)
+ const ids = getNodeId(obj.children)
ids.unshift(obj.id)
this.searchForm.cids = ids.join(',')
this.temp.cname = obj.name
diff --git a/vue/src/views/system/customer/EditDialog.vue b/vue/src/views/system/customer/EditDialog.vue
index 4e1a494..ff06d7c 100644
--- a/vue/src/views/system/customer/EditDialog.vue
+++ b/vue/src/views/system/customer/EditDialog.vue
@@ -14,7 +14,6 @@
import DialogForm from '@/components/DialogForm'
- import RegionSelector from '@/components/RegionSelector/Tree'
+ import RegionSelector from '@/components/RegionSelector'
import dialogMixin from "@/mixins/dialogMixin"
import {addCustomer, updateCustomer} from "@/api/system/customer"
import {isEmpty, mergeObj, resetObj} from '@/utils'
diff --git a/vue/src/views/system/customer/index.vue b/vue/src/views/system/customer/index.vue
index ceab14f..d4a3144 100644
--- a/vue/src/views/system/customer/index.vue
+++ b/vue/src/views/system/customer/index.vue
@@ -9,7 +9,7 @@
:value="temp.region_name"
limit
:limit-api="getLimitRegion"
- get-children-on-click
+ get-children-on-select
@clear="clearSidSearch"
@select="selectRegion"
/>
@@ -79,7 +79,7 @@