Commit 6a7a5204 authored by kewei.jia's avatar kewei.jia

修改bug 模糊查询 等等

parent 9e05e5b9
...@@ -5,6 +5,12 @@ ...@@ -5,6 +5,12 @@
<el-input v-model="listQuery.new_user" placeholder="新建用户" clearable style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter"/> <el-input v-model="listQuery.new_user" placeholder="新建用户" clearable style="width: 200px;" class="filter-item" @keyup.enter.native="handleFilter"/>
<el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">{{ $t('table.search') }}</el-button> <el-button v-waves class="filter-item" type="primary" icon="el-icon-search" @click="handleFilter">{{ $t('table.search') }}</el-button>
<el-button class="filter-item" type="primary" icon="el-icon-edit" @click="handleCreate">添加</el-button> <el-button class="filter-item" type="primary" icon="el-icon-edit" @click="handleCreate">添加</el-button>
<el-switch
v-model="value1"
style="float: right"
inactive-text="系统列表"
active-text="用户列表"
@change="filterUserData(value1)"/>
</div> </div>
<el-table <el-table
...@@ -24,7 +30,7 @@ ...@@ -24,7 +30,7 @@
<span class="link-type" @click="handleUpdate(scope.row)">{{ scope.row.application_name }}</span> <span class="link-type" @click="handleUpdate(scope.row)">{{ scope.row.application_name }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="项目->分支" align="center"> <el-table-column label="项目->分支" align="center" width="300px">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-for="item in scope.row.repos" :key="item.id"><b>{{ item.repository }}</b> -> {{ item.ref.name | replaceeRef }}</div> <div v-for="item in scope.row.repos" :key="item.id"><b>{{ item.repository }}</b> -> {{ item.ref.name | replaceeRef }}</div>
</template> </template>
...@@ -62,7 +68,7 @@ ...@@ -62,7 +68,7 @@
<el-option v-for="item in repos" :value="item.project_name" :label="item.project_name" :key="item.project_name" /> <el-option v-for="item in repos" :value="item.project_name" :label="item.project_name" :key="item.project_name" />
</el-select> </el-select>
<label style="margin:20px">分支</label> <label style="margin:20px">分支</label>
<el-select v-model="repoAndRefItem.ref" filterable value-key="id" style="width:30%" class="filter-item"> <el-select v-model="repoAndRefItem.ref.name" filterable value-key="id" style="width:30%" class="filter-item">
<el-option v-for="item in refs[repoAndRefItem.repository]" :value="item" :label="item.name" :key="item.name" /> <el-option v-for="item in refs[repoAndRefItem.repository]" :value="item" :label="item.name" :key="item.name" />
</el-select> </el-select>
<el-button :disabled="index===0?true:false" style="margin-left:5px" @click="temp.repos.splice(index, 1)">删除</el-button> <el-button :disabled="index===0?true:false" style="margin-left:5px" @click="temp.repos.splice(index, 1)">删除</el-button>
...@@ -133,6 +139,7 @@ export default { ...@@ -133,6 +139,7 @@ export default {
}, },
data() { data() {
return { return {
value1: true,
repository: '', repository: '',
total: 0, total: 0,
cacheData: {}, cacheData: {},
...@@ -167,6 +174,9 @@ export default { ...@@ -167,6 +174,9 @@ export default {
this.getApplications() this.getApplications()
}, },
methods: { methods: {
filterUserData() {
this.getApplications()
},
getApplications() { getApplications() {
for (const prop in this.listQuery) { for (const prop in this.listQuery) {
if (this.listQuery[prop] === '') { if (this.listQuery[prop] === '') {
...@@ -175,7 +185,22 @@ export default { ...@@ -175,7 +185,22 @@ export default {
} }
var arr = Object.keys(this.listQuery) var arr = Object.keys(this.listQuery)
getApplications(arr.length > 0 ? this.listQuery : null).then(res => { getApplications(arr.length > 0 ? this.listQuery : null).then(res => {
this.applications = res.data if (!this.value1) {
this.applications = res.data.filter((item) => {
if (item.application_name.indexOf('master分支订阅') > -1 && item.new_user.indexOf('胡慧') > -1) {
return item
}
})
} else {
this.applications = res.data.filter((item) => {
if (item.application_name.indexOf('master分支订阅') <= 0 && item.new_user.indexOf('胡慧') <= 0) {
return item
}
})
}
// this.applications = res.data.map((item)=>{
//
// })
this.listLoading = false this.listLoading = false
}) })
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment