|
@@ -376,8 +376,17 @@
|
|
|
</el-form>
|
|
|
</el-col>
|
|
|
<el-row type="flex" justify="space-between" class="filter">
|
|
|
- <el-col :span="12" class="mine-filter">我的过滤器</el-col>
|
|
|
- <el-col :span="2" align="end">管理过滤器</el-col>
|
|
|
+ <el-col :span="12" class="mine-filter">
|
|
|
+ <span>我的过滤器:</span>
|
|
|
+ <span v-for="item in filterList" :key="item.id" class="filter-item" @click="getFilterItem(item.id)">
|
|
|
+ <el-tooltip class="item" effect="dark" :content="item.name" placement="bottom">
|
|
|
+ <span>{{ item.name }}</span>
|
|
|
+ </el-tooltip>
|
|
|
+ </span>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="2" align="end">
|
|
|
+ <span @click.stop="showEditSearch = true">管理过滤器</span>
|
|
|
+ </el-col>
|
|
|
</el-row>
|
|
|
</el-row>
|
|
|
</el-header>
|
|
@@ -440,7 +449,7 @@
|
|
|
<div align="right">
|
|
|
<el-pagination
|
|
|
:page-sizes="[15, 30, 45, total]"
|
|
|
- :current-page="currentPage4"
|
|
|
+ :current-page="curIndex"
|
|
|
:page-size="pageSize"
|
|
|
background
|
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
@@ -482,13 +491,22 @@
|
|
|
@cancel="showSaveSearch=false"
|
|
|
>
|
|
|
<div class="file-dialog">
|
|
|
- <el-form ref="searchForm" :model="searchForm" :rules="searchFormRules" label-width="80px">
|
|
|
- <el-form-item label="活动名称" prop="name">
|
|
|
+ <el-form ref="searchForm" :model="searchForm" :rules="searchFormRules" label-width="100px">
|
|
|
+ <el-form-item label="过滤器名称" prop="name">
|
|
|
<el-input v-model="searchForm.name" placeholder="不超过50个字符" />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</normal-dialog>
|
|
|
+ <normal-dialog
|
|
|
+ :show-footer="false"
|
|
|
+ :show-dialog="showEditSearch"
|
|
|
+ :title="'管理过滤器'"
|
|
|
+ :width="'65%'"
|
|
|
+ @cancel="showEditSearch=false"
|
|
|
+ >
|
|
|
+ <filter-list @deleteFilter="deleteFilter" />
|
|
|
+ </normal-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -496,6 +514,8 @@
|
|
|
import BugDetails from './details/index'
|
|
|
import createdBug from '@/views/projectManage/bugList/file/createdBug'
|
|
|
import normalDialog from '@/components/dialog/normalDialog'
|
|
|
+import filterList from '@/views/projectManage/bugList/details/filterList'
|
|
|
+import { deepClone } from '@/utils/global'
|
|
|
import {
|
|
|
bugList,
|
|
|
bugSelfList,
|
|
@@ -506,7 +526,8 @@ import {
|
|
|
settingQueryBizModuleList,
|
|
|
bugDownload,
|
|
|
createFilter,
|
|
|
- getFilterList
|
|
|
+ getFilterList,
|
|
|
+ getFilterItem
|
|
|
} from '@/api/defectManage'
|
|
|
import { memberQueryMemberInfoByIDAPorName } from '@/api/projectIndex'
|
|
|
import '@/views/projectManage/bugList/css/index.css'
|
|
@@ -514,7 +535,8 @@ export default {
|
|
|
components: {
|
|
|
createdBug,
|
|
|
BugDetails,
|
|
|
- normalDialog
|
|
|
+ normalDialog,
|
|
|
+ filterList
|
|
|
},
|
|
|
filters: {
|
|
|
oneA(value) {
|
|
@@ -594,7 +616,6 @@ export default {
|
|
|
curIndex: 1,
|
|
|
total: 0,
|
|
|
goodName: '更多筛选',
|
|
|
- currentPage4: 1,
|
|
|
modalShow: false, // 弹窗(新建)
|
|
|
drawerShow: false, // drawer展示
|
|
|
taskIdStr: [],
|
|
@@ -609,11 +630,14 @@ export default {
|
|
|
dialogImageUrl: '',
|
|
|
isBugNameClick: false,
|
|
|
showSaveSearch: false, // 显示保存筛选项对话框
|
|
|
- searchForm: { searchObj: null }, // 筛选项obj
|
|
|
+ showEditSearch: false, // 显示管理过滤器
|
|
|
+ searchForm: { name: null }, // 筛选项obj
|
|
|
searchFormRules: { name: [
|
|
|
{ required: true, message: '请输入筛选项名称', trigger: 'blur' },
|
|
|
{ min: 1, max: 50, message: '长度在 1 到 50 个字符', trigger: 'blur' }
|
|
|
- ] }
|
|
|
+ ] },
|
|
|
+ filterList: [], // 筛选器列表
|
|
|
+ filterDetail: null // 筛选器详情
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -631,6 +655,9 @@ export default {
|
|
|
if (this.$route.query.startDate && this.$route.query.endDate) {
|
|
|
this.stratAndEnd = [this.$route.query.startDate, this.$route.query.endDate]
|
|
|
}
|
|
|
+ if (this.$route.query.filterId) {
|
|
|
+ this.getFilterItem(this.$route.query.filterId)
|
|
|
+ }
|
|
|
this.tableData = []
|
|
|
if (this.type === 'page') {
|
|
|
this.getBugList()
|
|
@@ -652,10 +679,6 @@ export default {
|
|
|
this.$router.push({ path: this.$route.path })
|
|
|
}
|
|
|
},
|
|
|
- async getFilterList() { // 获取过滤器列表
|
|
|
- const res = await getFilterList()
|
|
|
- console.log(res)
|
|
|
- },
|
|
|
async getBugList() {
|
|
|
if (!this.stratAndEnd) {
|
|
|
this.stratAndEnd = []
|
|
@@ -702,15 +725,15 @@ export default {
|
|
|
resetQuery() {
|
|
|
this.$router.push({ path: this.$route.path })
|
|
|
this.stratAndEnd = []
|
|
|
- var combination = {}
|
|
|
+ let combination = {}
|
|
|
combination = this.formInline
|
|
|
this.formInline = {}
|
|
|
this.$set(this.formInline, 'bugId', combination.bugId)
|
|
|
this.$set(this.formInline, 'status', combination.status)
|
|
|
this.$set(this.formInline, 'priorityLevel', combination.priorityLevel)
|
|
|
+ this.curIndex = 1
|
|
|
this.getBugList()
|
|
|
},
|
|
|
- queryBug() {},
|
|
|
getClient(e) {
|
|
|
this.$set(this.formInline, 'appVersion', '')
|
|
|
this.Editionlist = this.appClient.filter(
|
|
@@ -876,12 +899,41 @@ export default {
|
|
|
return false
|
|
|
}
|
|
|
})
|
|
|
- const res = await createFilter({ name: this.searchForm.name, content: JSON.stringify(this.formInline) })
|
|
|
- console.log(res)
|
|
|
+ const saveObj = deepClone(this.formInline)
|
|
|
+ delete saveObj.curIndex
|
|
|
+ delete saveObj.pageSize
|
|
|
+ const res = await createFilter({ name: this.searchForm.name, content: JSON.stringify(saveObj) })
|
|
|
if (res.code === 200) {
|
|
|
this.$message({ showClose: true, message: '保存成功', type: 'success' })
|
|
|
this.showSaveSearch = false
|
|
|
+ this.getFilterList()
|
|
|
+ this.searchForm.name = null
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async getFilterList() { // 获取过滤器列表
|
|
|
+ const res = await getFilterList()
|
|
|
+ this.filterList = res.data
|
|
|
+ },
|
|
|
+ async getFilterItem(filterId) { // 获取单个过滤器
|
|
|
+ this.stratAndEnd = []
|
|
|
+ const combination = deepClone(this.formInline)
|
|
|
+ const { bugId, status, priorityLevel } = combination
|
|
|
+ this.formInline = { bugId, status, priorityLevel }
|
|
|
+ this.$router.push({ path: this.$route.path, query: { filterId: filterId }})
|
|
|
+ const res = await getFilterItem(filterId)
|
|
|
+ if (res.code === 200) {
|
|
|
+ const filter = JSON.parse(res.data.content)
|
|
|
+ if (filter.createStartTime && filter.createEndTime) {
|
|
|
+ this.stratAndEnd = [filter.createStartTime, filter.createEndTime]
|
|
|
+ }
|
|
|
+ Object.assign(this.formInline, filter)
|
|
|
+ this.curIndex = 1
|
|
|
+ this.getBugList()
|
|
|
}
|
|
|
+ },
|
|
|
+ deleteFilter() {
|
|
|
+ this.$router.push({ path: this.$route.path })
|
|
|
+ this.getFilterList()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -908,10 +960,15 @@ export default {
|
|
|
width: 100%;
|
|
|
padding: 0 11px 15px 15px;
|
|
|
color: #606266;
|
|
|
+ cursor: pointer;
|
|
|
.mine-filter {
|
|
|
overflow: hidden;
|
|
|
text-overflow:ellipsis;
|
|
|
white-space: nowrap;
|
|
|
+ .filter-item {
|
|
|
+ color: #409EFF;
|
|
|
+ margin-right: 15px;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|