-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
363 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.section-wrapper.allFilter-wrapper(v-if='stateInfo && stateInfo.curProduct') | ||
.filter-wrapper | ||
Tooltip(content='类型' placement="top") | ||
Select(placeholder='类型' v-model='formData.type' @on-change='handleChange') | ||
Option(v-for='item of stateInfo.typeArr', :value='item.id', :key='item.id') {{item.name}} | ||
Tooltip(content='版本' placement="top") | ||
Select(placeholder='版本' v-model='formData.version' @on-change='handleChange') | ||
Option(v-for='item of stateInfo.curProduct.versions', :value='item', :key='item') | ||
Tooltip(content='标签' placement="top") | ||
Select(placeholder='标签' v-model='formData.tag' @on-change='handleChange') | ||
Option(v-for='item of stateInfo.curProduct.tags', :value='item', :key='item') | ||
//- Tooltip(content='重要性' placement="top") | ||
//- Select(placeholder='重要性' @on-change='handleChange') | ||
//- Option(value='true') 重要 | ||
//- Option(value='false') 不重要 | ||
//- Tooltip(content='紧急性' placement="top") | ||
//- Select(placeholder='紧急性' @on-change='handleChange') | ||
//- Option(value='true') 紧急 | ||
//- Option(value='false') 不紧急 | ||
Tooltip(content='状态' placement="top") | ||
Select(placeholder='状态' @on-change='handleChange' v-model='formData.level') | ||
Option(v-for='item of stateInfo.levelArr', :value='item.id', :key='item.id') {{item.name}} | ||
Tooltip(content='创建人' placement="top") | ||
Select(placeholder='创建人' v-model='formData.createrId' @on-change='handleChange') | ||
Option(v-for='item of allUser', :value='item.userId._id', :key='item.userId._id') {{item.userId.name}} | ||
Tooltip(content='执行人' placement="top") | ||
Select(placeholder='执行人' v-model='formData.to' @on-change='handleChange') | ||
Option(v-for='item of allUser', :value='item.userId._id', :key='item.userId._id') {{item.userId.name}} | ||
Tooltip(content='完成人' placement="top") | ||
Select(placeholder='完成人' v-model='formData.finisherId' @on-change='handleChange') | ||
Option(v-for='item of allUser', :value='item.userId._id', :key='item.userId._id') {{item.userId.name}} | ||
Button(type='primary' @click='handleReset') 重置 | ||
.allData-wrapper | ||
.section-content(v-if='allData && allData.length > 0') | ||
.item-wrapper(v-for='item of allData' @click.stop='handleEdit(item)', :class='{"selected": selected==item._id}') | ||
.state | ||
span.isImportant(v-if='item.isImportant') 重要 | ||
span.not(v-else) - | ||
span.isUrgent(v-if='item.isUrgent') 紧急 | ||
span.not(v-else) - | ||
span.title(v-text='item.title') | ||
.state | ||
span.type(v-if='item.type == 1') Bug | ||
span.type.newNeed(v-else-if='item.type == 2') 需求 | ||
span.tag {{item.to.name}} | ||
span.tag(v-if='item.tag') {{item.tag}} | ||
span.tag(v-if='item.version') V{{item.version}} | ||
.loadMore(@click='getAllData' v-if='allData && allData.length > 0 && nextPageNo > 0') 加载更多 | ||
NoData(v-if='allData && allData.length == 0 && nextPageNo==0') | ||
TodoEdit.todoEdit-wrapper(:curPost='curPost', :page='$route.name', :class='{"isEdit": isEdit}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
@import "../_mixin/mixin.sass" | ||
|
||
.section-wrapper | ||
height: 100% | ||
.filter-wrapper | ||
display: flex | ||
border-bottom: $border | ||
.section-content | ||
padding-bottom: 50px | ||
.item-wrapper | ||
padding-left: 10px | ||
display: flex | ||
height: 44px | ||
line-height: 44px | ||
border-bottom: $border | ||
cursor: pointer | ||
opacity: 0.5 | ||
font-weight: $fw-lg | ||
&:hover, &.selected | ||
// background: $bg-color | ||
background: $gray-sub-sub | ||
opacity: 1 | ||
.tag | ||
padding: 0 10px | ||
margin-right: 5px | ||
height: 22px | ||
line-height: 22px | ||
background: $gray-sub-sub | ||
color: $gray | ||
border-radius: 11px | ||
margin-top: 11px | ||
.state | ||
display: inline-block | ||
padding-right: 5px | ||
span | ||
display: inline-block | ||
width: 30px | ||
height: 18px | ||
line-height: 18px | ||
text-align: center | ||
margin-right: 5px | ||
background: transparent | ||
color: $gray-sub-sub | ||
.isImportant, .isUrgent | ||
// background: $red | ||
color: $red | ||
.isUrgent | ||
// background: $yellow | ||
color: $yellow | ||
.type | ||
display: inline-block | ||
background: transparent | ||
color: $gray-sub | ||
&.newNeed | ||
color: $a-color | ||
.title | ||
flex: 1 | ||
white-space: nowrap | ||
text-overflow: ellipsis | ||
overflow: hidden | ||
// color: $gray | ||
.todoEdit-wrapper | ||
right: -600px | ||
transition: $transition | ||
&.isEdit | ||
right: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
<template lang="jade" src='./allFilter.jade'> | ||
|
||
</template> | ||
|
||
<script> | ||
import TodoEdit from './todoEdit' | ||
import NoData from '@/components/_include/nodata' | ||
export default { | ||
name: 'ProductAllFilter', | ||
components: { | ||
TodoEdit, NoData | ||
}, | ||
data () { | ||
return { | ||
stateInfo: {}, | ||
allUser: [], | ||
allData: [], | ||
formData: { | ||
productId: this.$route.params.id, | ||
type: '', | ||
level: '', | ||
tag: '', | ||
version: '', | ||
createrId: '', | ||
to: '', | ||
finisherId: '' | ||
}, | ||
pageSize: this.$api.pageSize, | ||
nextPageNo: 1, | ||
curPost: {}, | ||
isEdit: false, | ||
selected: '' | ||
} | ||
}, | ||
created () { | ||
this.getAllUser() | ||
this.getAllData() | ||
this.$nextTick(() => { | ||
window.addEventListener('click', () => { | ||
this.isEdit = false | ||
}) | ||
}) | ||
this.busEventStateInfo() | ||
this.busEventRouteName() | ||
}, | ||
methods: { | ||
reset () { | ||
this.allData = [] | ||
this.curPost = {} | ||
this.isEdit = false | ||
this.selected = '' | ||
this.nextPageNo = 1 | ||
}, | ||
resetForm () { | ||
this.formData = { | ||
productId: this.$route.params.id, | ||
type: '', | ||
level: '', | ||
tag: '', | ||
version: '', | ||
createrId: '', | ||
to: '', | ||
finisherId: '' | ||
} | ||
}, | ||
busEventStateInfo () { | ||
this.$bus.off('StateInfo') | ||
this.$bus.once('StateInfo', content => { | ||
this.stateInfo = content | ||
}) | ||
}, | ||
busEventRouteName () { | ||
this.$bus.off(this.$route.name) | ||
this.$bus.once(this.$route.name, content => { | ||
this.isEdit = false | ||
this.getAllData() | ||
}) | ||
}, | ||
getAllUser () { | ||
let url = this.$api.productAllUser | ||
let body = { | ||
data: { | ||
productId: this.$route.params.id | ||
} | ||
} | ||
this.$http.post(url, body).then((res) => { | ||
if (res.data.code === 0) { | ||
this.allUser = res.data.data.allData | ||
} | ||
}) | ||
}, | ||
getAllData () { | ||
let url = this.$api.postAllByFilter | ||
let body = { | ||
data: { | ||
formData: this.formData, | ||
pageSize: this.pageSize, | ||
nextPageNo: this.nextPageNo | ||
} | ||
} | ||
this.$http.post(url, body).then((res) => { | ||
if (res.data.code === 0) { | ||
let { allData, nextPageNo } = res.data.data | ||
this.allData = this.allData.concat(allData) | ||
this.nextPageNo = nextPageNo | ||
} | ||
}) | ||
}, | ||
handleChange () { | ||
this.reset() | ||
this.getAllData() | ||
}, | ||
handleReset () { | ||
this.reset() | ||
this.resetForm() | ||
this.getAllData() | ||
}, | ||
handleEdit (item) { | ||
this.busEventRouteName() | ||
this.selected = item._id | ||
this.isEdit = true | ||
this.curPost = item | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="sass" scoped src='./allFilter.sass'> | ||
</style> | ||
<style lang='sass'> | ||
.allFilter-wrapper | ||
.filter-wrapper | ||
.ivu-tooltip | ||
flex: 1 | ||
.ivu-tooltip-rel | ||
min-width: 80px | ||
.ivu-select-selection | ||
border: none | ||
box-shadow: none | ||
height: 44px | ||
.ivu-select-placeholder, .ivu-select-selected-value | ||
text-align: right | ||
height: 44px | ||
line-height: 44px | ||
</style> |
Oops, something went wrong.