From 61dcb1ec49eae533ce148aff46465c23852565ff Mon Sep 17 00:00:00 2001 From: Hunlongyu Date: Wed, 28 Oct 2020 18:22:18 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=8D=20=E4=BC=98=E5=8C=96=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E6=BA=90=E5=88=86=E7=BB=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/EditSites.vue | 16 +++++++++++++++- src/lib/element/index.js | 4 +++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/components/EditSites.vue b/src/components/EditSites.vue index e1b7553..578563b 100644 --- a/src/components/EditSites.vue +++ b/src/components/EditSites.vue @@ -89,7 +89,9 @@ - + + + @@ -129,6 +131,7 @@ export default { group: '', isActive: 1 }, + siteGroup: [], rules: { name: [ { required: true, message: '源站名不能为空', trigger: 'blur' } @@ -210,7 +213,17 @@ export default { delete i.status } }, + getSitesGroup () { + const arr = [] + for (const i of this.sites) { + if (arr.indexOf(i.group) < 0) { + arr.push(i.group) + } + } + this.siteGroup = arr + }, addSite () { + this.getSitesGroup() this.dialogType = 'new' this.dialogVisible = true this.siteInfo = { @@ -223,6 +236,7 @@ export default { } }, editSite (siteInfo) { + this.getSitesGroup() if (this.checkAllSiteLoading) { this.$message.info('正在检测, 请勿操作.') return false diff --git a/src/lib/element/index.js b/src/lib/element/index.js index 44a7ffb..ceacc31 100644 --- a/src/lib/element/index.js +++ b/src/lib/element/index.js @@ -1,5 +1,5 @@ import Vue from 'vue' -import { Message, Button, Table, TableColumn, Tag, Input, Dialog, Form, FormItem, Switch } from 'element-ui' +import { Message, Button, Table, TableColumn, Tag, Input, Dialog, Form, FormItem, Switch, Select, Option } from 'element-ui' import Plugin from 'v-fit-columns' Vue.use(Button) Vue.use(Table) @@ -11,4 +11,6 @@ Vue.use(Form) Vue.use(FormItem) Vue.use(Switch) Vue.use(Plugin) +Vue.use(Select) +Vue.use(Option) Vue.prototype.$message = Message