Skip to content

Commit e775241

Browse files
committed
1.2
1 parent 537c8e0 commit e775241

File tree

10 files changed

+179
-30
lines changed

10 files changed

+179
-30
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pm_vue",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"author": "jeodiong <jeodiong@hotmail.com>",
55
"description": "An electron-vue project",
66
"license": null,

src/index.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8">
55
<title>Product Manager</title>
6-
<link rel="stylesheet" href="https://at.alicdn.com/t/font_374327_hm62n4rb2ekrcnmi.css">
6+
<link rel="stylesheet" href="https://at.alicdn.com/t/font_374327_ui77nrzntq7d5cdi.css">
77
<% if (htmlWebpackPlugin.options.nodeModules) { %>
88
<!-- Add `node_modules/` to global paths so `require` works properly in development -->
99
<script>

src/renderer/components/productInfo/allFilter.jade

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
.section-wrapper.allFilter-wrapper(v-if='stateInfo && stateInfo.curProduct')
22
.filter-wrapper
3-
Tooltip(content='类型' placement="top")
4-
Select(placeholder='类型' v-model='formData.type' @on-change='handleChange')
5-
Option(v-for='item of stateInfo.typeArr', :value='item.id', :key='item.id') {{item.name}}
6-
Tooltip(content='版本' placement="top")
7-
Select(placeholder='版本' v-model='formData.version' @on-change='handleChange')
8-
Option(v-for='item of stateInfo.curProduct.versions', :value='item', :key='item')
93
Tooltip(content='标签' placement="top")
104
Select(placeholder='标签' v-model='formData.tag' @on-change='handleChange')
115
Option(v-for='item of stateInfo.curProduct.tags', :value='item', :key='item')
@@ -29,6 +23,12 @@
2923
Tooltip(content='完成人' placement="top")
3024
Select(placeholder='完成人' v-model='formData.finisherId' @on-change='handleChange')
3125
Option(v-for='item of allUser', :value='item.userId._id', :key='item.userId._id') {{item.userId.name}}
26+
Tooltip(content='类型' placement="top")
27+
Select(placeholder='类型' v-model='formData.type' @on-change='handleChange')
28+
Option(v-for='item of stateInfo.typeArr', :value='item.id', :key='item.id') {{item.name}}
29+
Tooltip(content='版本' placement="top")
30+
Select(placeholder='版本' v-model='formData.version' @on-change='handleChange')
31+
Option(v-for='item of stateInfo.curProduct.versions', :value='item', :key='item')
3232
Button(type='primary' @click='handleReset') 重置
3333
.allData-wrapper
3434
.section-content(v-if='allData && allData.length > 0')

src/renderer/components/productInfo/index.jade

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,29 @@
88
p.con-title
99
router-link(:to='{name: "ProductCreate"}' exact)
1010
i.iconfont.icon-createBom
11-
span 创建任务
12-
router-link(:to='{name: "ProductTodoM"}' exact v-if='isMatrix')
13-
i.iconfont.icon-daiban
14-
span 我的任务
15-
router-link(:to='{name: "ProductTodoL"}' exact v-else)
16-
i.iconfont.icon-daiban
11+
span 创建
12+
router-link(:to='{name: "ProductTodoL"}' exact)
13+
i.iconfont.icon-wancheng
1714
span 我的任务
15+
router-link(:to='{name: "ProductTodoT"}' exact)
16+
i.iconfont.icon-lishirenwu
17+
span 创建历史
18+
//- div(v-if='$api.GetAuth() && $api.GetAuth().userInfo.role == "测试者"')
19+
//- //- 测试人员
20+
//- router-link(:to='{name: "ProductTodoL"}' exact)
21+
//- i.iconfont.icon-list
22+
//- span 我的任务
23+
//- router-link(:to='{name: "ProductTodoT"}' exact)
24+
//- i.iconfont.icon-lishirenwu
25+
//- span 我创建的
26+
//- div(v-else)
27+
//- //- 开发者
28+
//- router-link(:to='{name: "ProductTodoM"}' exact v-if='isMatrix')
29+
//- i.iconfont.icon-list
30+
//- span 我的任务
31+
//- router-link(:to='{name: "ProductTodoL"}' exact v-else)
32+
//- i.iconfont.icon-list
33+
//- span 我的任务
1834
router-link(:to='{name: "ProductNotification"}' exact)
1935
i.iconfont.icon-xiaoxi
2036
span 消息中心
@@ -47,16 +63,11 @@
4763
router-link(:to='{name: "ProductSetting"}' exact)
4864
i.iconfont.icon-settings
4965
span 产品设置
50-
//- .mode-wrapper
51-
//- span.title 全栈模式
52-
//- i-switch(v-model="isFullStack")
66+
//- .isMatrix-wrapper(:class='{"true": isMatrix}' v-if='$api.GetAuth() && $api.GetAuth().userInfo.role == "开发者"')
67+
//- span.title Matrix Mode
68+
//- i-switch.isMatrix(v-model='isMatrix', @on-change='handleIsMatrix')
5369
//- span(slot="open") 开
5470
//- span(slot="close") 关
55-
.isMatrix-wrapper(:class='{"true": isMatrix}')
56-
span.title Matrix Mode
57-
i-switch.isMatrix(v-model='isMatrix', @on-change='handleIsMatrix')
58-
span(slot="open")
59-
span(slot="close")
6071
.main-wrapper
6172
router-view.contain-wrapper
6273

src/renderer/components/productInfo/todoL.jade

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
button(@click='changeType(0)', :class='{"active": type==0}') 全部
55
button(@click='changeType(1)', :class='{"active": type==1}') Bug
66
button(@click='changeType(2)', :class='{"active": type==2}') 需求
7-
button(@click='changeType("my")', :class='{"active": type=="my"}') 创建
7+
//- button(@click='changeType("my")', :class='{"active": type=="my"}') 创建
88
TodoEdit.todoEdit-wrapper(:curPost='curPost', :page='$route.name', :class='{"isEdit": isEdit}')
99
.section-content
1010
.item-wrapper(v-for='item of allData' @click.stop='handleEdit(item)', :class='{"selected": selected==item._id}')
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.section-wrapper
2+
.navigation-wrapper
3+
.button-group
4+
button(@click='changeType(0)', :class='{"active": type==0}') 全部
5+
button(@click='changeType(1)', :class='{"active": type==1}') 待办
6+
button(@click='changeType(2)', :class='{"active": type==2}') 待审核
7+
button(@click='changeType(5)', :class='{"active": type==5}') 已归档
8+
TodoEdit.todoEdit-wrapper(:curPost='curPost', :page='$route.name', :class='{"isEdit": isEdit}')
9+
.section-content
10+
.item-wrapper(v-for='item of allData' @click.stop='handleEdit(item)', :class='{"selected": selected==item._id}')
11+
.state
12+
span.isImportant(v-if='item.isImportant') 重要
13+
span.not(v-else) -
14+
span.isUrgent(v-if='item.isUrgent') 紧急
15+
span.not(v-else) -
16+
span.title(v-text='item.title')
17+
.state
18+
span.type(v-if='item.type == 1') Bug
19+
span.type.newNeed(v-else-if='item.type == 2') 需求
20+
span.tag(v-if='item.tag') {{item.tag}}
21+
span.tag {{item.to.name}}
22+
span.tag(v-if='item.version') V{{item.version}}
23+
.loadMore(@click='getAllData' v-if='allData && allData.length > 0 && nextPageNo > 0') 加载更多
24+
NoData(v-if='allData && allData.length == 0 && nextPageNo==0')
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<template lang="jade" src='./todoT.jade'></template>
2+
3+
<script>
4+
import TodoEdit from './todoEdit'
5+
import NoData from '@/components/_include/nodata'
6+
export default {
7+
name: 'ProductTodoL',
8+
components: {
9+
TodoEdit, NoData
10+
},
11+
data () {
12+
return {
13+
allData: [],
14+
curPost: {},
15+
isEdit: false,
16+
selected: '',
17+
type: 0,
18+
nextPageNo: 1,
19+
pageSize: this.$api.pageSize
20+
}
21+
},
22+
created () {
23+
this.changeType(0)
24+
this.$nextTick(() => {
25+
window.addEventListener('click', () => {
26+
this.isEdit = false
27+
})
28+
})
29+
// 改变后,刷新页面
30+
this.busEventRouteName()
31+
// 改变模式
32+
this.busEventChangeMode()
33+
},
34+
methods: {
35+
busEventRouteName () {
36+
this.$bus.off(this.$route.name)
37+
this.$bus.once(this.$route.name, content => {
38+
this.isEdit = false
39+
console.log(content)
40+
this.changeType(this.type)
41+
})
42+
},
43+
busEventChangeMode () {
44+
this.$bus.off('changeMode')
45+
this.$bus.once('changeMode', content => {
46+
if (content) {
47+
this.$router.push({name: 'ProductTodoM'})
48+
}
49+
})
50+
},
51+
reset () {
52+
this.allData = []
53+
this.curPost = {}
54+
this.isEdit = false
55+
this.selected = ''
56+
this.type = 0
57+
this.nextPageNo = 1
58+
this.pageSize = this.$api.pageSize
59+
},
60+
getAllData () {
61+
if (this.nextPageNo === 0) {
62+
this.$Message.error('没有更多数据了!')
63+
return
64+
}
65+
let url = this.$api.postMy
66+
let body = {
67+
data: {
68+
productId: this.$route.params.id,
69+
nextPageNo: this.nextPageNo,
70+
pageSize: this.pageSize,
71+
type: this.type
72+
}
73+
}
74+
this.$http.post(url, body).then((res) => {
75+
if (res.data.code === 0) {
76+
let { allData, nextPageNo } = res.data.data
77+
this.allData = this.allData.concat(allData)
78+
this.nextPageNo = nextPageNo
79+
}
80+
})
81+
},
82+
handleEdit (item) {
83+
this.busEventRouteName()
84+
this.selected = item._id
85+
this.isEdit = true
86+
this.curPost = item
87+
},
88+
changeType (type) {
89+
this.reset()
90+
this.type = type
91+
this.getAllData()
92+
}
93+
}
94+
}
95+
</script>
96+
97+
<style lang="sass" scoped src='./todoL.sass'>
98+
</style>

src/renderer/components/user/setting.jade

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,9 @@
2020
:picroot='$api.link.qiniuUrl',
2121
imageName='useravatar'
2222
@fileUploaded='fileUploaded')
23+
Form-item.input-wrapper(label='角色')
24+
Radio-group(v-model='formData.role')
25+
Radio(label='开发者') 开发者
26+
Radio(label='测试者') 测试者
2327
Form-item.input-wrapper
2428
Button.btn-submit(type="primary" size='large' @click='handleSubmit', :loading="modal_create_loading") 保存

src/renderer/components/user/setting.vue

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,33 @@ export default {
1616
formData: {
1717
position: '',
1818
name: '',
19-
avatar: ''
19+
avatar: '',
20+
role: '开发者'
2021
}
2122
}
2223
},
2324
created () {
24-
this.formData = this.$api.GetAuth().userInfo
25+
// this.formData = this.$api.GetAuth().userInfo
26+
// if (!this.formData.role) {
27+
// this.formData.role = '开发者'
28+
// }
29+
this.getUserInfo()
2530
},
2631
methods: {
32+
getUserInfo () {
33+
let url = this.$api.userInfo
34+
let body = {}
35+
this.$http.post(url, body).then((res) => {
36+
if (res.data.code === 0) {
37+
this.formData = res.data.data.curUser
38+
}
39+
})
40+
},
2741
handleSubmit () {
2842
this.modal_create_loading = true
2943
let url = this.$api.userSetting
3044
let body = {
31-
data: {
32-
name: this.formData.name,
33-
position: this.formData.position,
34-
avatar: this.formData.avatar
35-
}
45+
data: this.formData
3646
}
3747
this.$http.post(url, body).then((res) => {
3848
this.modal_create_loading = false

src/renderer/router/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const ProductInfo = resolve => require(['@/components/productInfo'], resolve)
1212
const ProductCreate = resolve => require(['@/components/productInfo/create'], resolve)
1313
const ProductTodoL = resolve => require(['@/components/productInfo/todoL'], resolve)
1414
const ProductTodoM = resolve => require(['@/components/productInfo/todoM'], resolve)
15+
const ProductTodoT = resolve => require(['@/components/productInfo/todoT'], resolve)
1516
const ProductMember = resolve => require(['@/components/productInfo/member'], resolve)
1617
const ProductSetting = resolve => require(['@/components/productInfo/setting'], resolve)
1718
const ProductNotification = resolve => require(['@/components/productInfo/notification'], resolve)
@@ -35,6 +36,7 @@ export default new Router({
3536
{ path: 'create', name: 'ProductCreate', component: ProductCreate, meta: { requireAuth: true } },
3637
{ path: 'todoL', name: 'ProductTodoL', component: ProductTodoL, meta: { requireAuth: true } },
3738
{ path: 'todoM', name: 'ProductTodoM', component: ProductTodoM, meta: { requireAuth: true } },
39+
{ path: 'todoT', name: 'ProductTodoT', component: ProductTodoT, meta: { requireAuth: true } },
3840
{ path: 'member', name: 'ProductMember', component: ProductMember, meta: { requireAuth: true } },
3941
{ path: 'setting', name: 'ProductSetting', component: ProductSetting, meta: { requireAuth: true } },
4042
{ path: 'notification', name: 'ProductNotification', component: ProductNotification, meta: { requireAuth: true } },

0 commit comments

Comments
 (0)