-
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
10 changed files
with
179 additions
and
30 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,24 @@ | ||
.section-wrapper | ||
.navigation-wrapper | ||
.button-group | ||
button(@click='changeType(0)', :class='{"active": type==0}') 全部 | ||
button(@click='changeType(1)', :class='{"active": type==1}') 待办 | ||
button(@click='changeType(2)', :class='{"active": type==2}') 待审核 | ||
button(@click='changeType(5)', :class='{"active": type==5}') 已归档 | ||
TodoEdit.todoEdit-wrapper(:curPost='curPost', :page='$route.name', :class='{"isEdit": isEdit}') | ||
.section-content | ||
.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(v-if='item.tag') {{item.tag}} | ||
span.tag {{item.to.name}} | ||
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') |
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,98 @@ | ||
<template lang="jade" src='./todoT.jade'></template> | ||
|
||
<script> | ||
import TodoEdit from './todoEdit' | ||
import NoData from '@/components/_include/nodata' | ||
export default { | ||
name: 'ProductTodoL', | ||
components: { | ||
TodoEdit, NoData | ||
}, | ||
data () { | ||
return { | ||
allData: [], | ||
curPost: {}, | ||
isEdit: false, | ||
selected: '', | ||
type: 0, | ||
nextPageNo: 1, | ||
pageSize: this.$api.pageSize | ||
} | ||
}, | ||
created () { | ||
this.changeType(0) | ||
this.$nextTick(() => { | ||
window.addEventListener('click', () => { | ||
this.isEdit = false | ||
}) | ||
}) | ||
// 改变后,刷新页面 | ||
this.busEventRouteName() | ||
// 改变模式 | ||
this.busEventChangeMode() | ||
}, | ||
methods: { | ||
busEventRouteName () { | ||
this.$bus.off(this.$route.name) | ||
this.$bus.once(this.$route.name, content => { | ||
this.isEdit = false | ||
console.log(content) | ||
this.changeType(this.type) | ||
}) | ||
}, | ||
busEventChangeMode () { | ||
this.$bus.off('changeMode') | ||
this.$bus.once('changeMode', content => { | ||
if (content) { | ||
this.$router.push({name: 'ProductTodoM'}) | ||
} | ||
}) | ||
}, | ||
reset () { | ||
this.allData = [] | ||
this.curPost = {} | ||
this.isEdit = false | ||
this.selected = '' | ||
this.type = 0 | ||
this.nextPageNo = 1 | ||
this.pageSize = this.$api.pageSize | ||
}, | ||
getAllData () { | ||
if (this.nextPageNo === 0) { | ||
this.$Message.error('没有更多数据了!') | ||
return | ||
} | ||
let url = this.$api.postMy | ||
let body = { | ||
data: { | ||
productId: this.$route.params.id, | ||
nextPageNo: this.nextPageNo, | ||
pageSize: this.pageSize, | ||
type: this.type | ||
} | ||
} | ||
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 | ||
} | ||
}) | ||
}, | ||
handleEdit (item) { | ||
this.busEventRouteName() | ||
this.selected = item._id | ||
this.isEdit = true | ||
this.curPost = item | ||
}, | ||
changeType (type) { | ||
this.reset() | ||
this.type = type | ||
this.getAllData() | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="sass" scoped src='./todoL.sass'> | ||
</style> |
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