Skip to content

Commit

Permalink
1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-lz committed Sep 1, 2017
1 parent 537c8e0 commit e775241
Show file tree
Hide file tree
Showing 10 changed files with 179 additions and 30 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pm_vue",
"version": "1.3.0",
"version": "1.4.0",
"author": "jeodiong <jeodiong@hotmail.com>",
"description": "An electron-vue project",
"license": null,
Expand Down
2 changes: 1 addition & 1 deletion src/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>Product Manager</title>
<link rel="stylesheet" href="https://at.alicdn.com/t/font_374327_hm62n4rb2ekrcnmi.css">
<link rel="stylesheet" href="https://at.alicdn.com/t/font_374327_ui77nrzntq7d5cdi.css">
<% if (htmlWebpackPlugin.options.nodeModules) { %>
<!-- Add `node_modules/` to global paths so `require` works properly in development -->
<script>
Expand Down
12 changes: 6 additions & 6 deletions src/renderer/components/productInfo/allFilter.jade
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
.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')
Expand All @@ -29,6 +23,12 @@
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}}
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')
Button(type='primary' @click='handleReset') 重置
.allData-wrapper
.section-content(v-if='allData && allData.length > 0')
Expand Down
39 changes: 25 additions & 14 deletions src/renderer/components/productInfo/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,29 @@
p.con-title
router-link(:to='{name: "ProductCreate"}' exact)
i.iconfont.icon-createBom
span 创建任务
router-link(:to='{name: "ProductTodoM"}' exact v-if='isMatrix')
i.iconfont.icon-daiban
span 我的任务
router-link(:to='{name: "ProductTodoL"}' exact v-else)
i.iconfont.icon-daiban
span 创建
router-link(:to='{name: "ProductTodoL"}' exact)
i.iconfont.icon-wancheng
span 我的任务
router-link(:to='{name: "ProductTodoT"}' exact)
i.iconfont.icon-lishirenwu
span 创建历史
//- div(v-if='$api.GetAuth() && $api.GetAuth().userInfo.role == "测试者"')
//- //- 测试人员
//- router-link(:to='{name: "ProductTodoL"}' exact)
//- i.iconfont.icon-list
//- span 我的任务
//- router-link(:to='{name: "ProductTodoT"}' exact)
//- i.iconfont.icon-lishirenwu
//- span 我创建的
//- div(v-else)
//- //- 开发者
//- router-link(:to='{name: "ProductTodoM"}' exact v-if='isMatrix')
//- i.iconfont.icon-list
//- span 我的任务
//- router-link(:to='{name: "ProductTodoL"}' exact v-else)
//- i.iconfont.icon-list
//- span 我的任务
router-link(:to='{name: "ProductNotification"}' exact)
i.iconfont.icon-xiaoxi
span 消息中心
Expand Down Expand Up @@ -47,16 +63,11 @@
router-link(:to='{name: "ProductSetting"}' exact)
i.iconfont.icon-settings
span 产品设置
//- .mode-wrapper
//- span.title 全栈模式
//- i-switch(v-model="isFullStack")
//- .isMatrix-wrapper(:class='{"true": isMatrix}' v-if='$api.GetAuth() && $api.GetAuth().userInfo.role == "开发者"')
//- span.title Matrix Mode
//- i-switch.isMatrix(v-model='isMatrix', @on-change='handleIsMatrix')
//- span(slot="open") 开
//- span(slot="close") 关
.isMatrix-wrapper(:class='{"true": isMatrix}')
span.title Matrix Mode
i-switch.isMatrix(v-model='isMatrix', @on-change='handleIsMatrix')
span(slot="open")
span(slot="close")
.main-wrapper
router-view.contain-wrapper

2 changes: 1 addition & 1 deletion src/renderer/components/productInfo/todoL.jade
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
button(@click='changeType(0)', :class='{"active": type==0}') 全部
button(@click='changeType(1)', :class='{"active": type==1}') Bug
button(@click='changeType(2)', :class='{"active": type==2}') 需求
button(@click='changeType("my")', :class='{"active": type=="my"}') 创建
//- button(@click='changeType("my")', :class='{"active": type=="my"}') 创建
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}')
Expand Down
24 changes: 24 additions & 0 deletions src/renderer/components/productInfo/todoT.jade
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')
98 changes: 98 additions & 0 deletions src/renderer/components/productInfo/todoT.vue
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>
4 changes: 4 additions & 0 deletions src/renderer/components/user/setting.jade
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@
:picroot='$api.link.qiniuUrl',
imageName='useravatar'
@fileUploaded='fileUploaded')
Form-item.input-wrapper(label='角色')
Radio-group(v-model='formData.role')
Radio(label='开发者') 开发者
Radio(label='测试者') 测试者
Form-item.input-wrapper
Button.btn-submit(type="primary" size='large' @click='handleSubmit', :loading="modal_create_loading") 保存
24 changes: 17 additions & 7 deletions src/renderer/components/user/setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,33 @@ export default {
formData: {
position: '',
name: '',
avatar: ''
avatar: '',
role: '开发者'
}
}
},
created () {
this.formData = this.$api.GetAuth().userInfo
// this.formData = this.$api.GetAuth().userInfo
// if (!this.formData.role) {
// this.formData.role = '开发者'
// }
this.getUserInfo()
},
methods: {
getUserInfo () {
let url = this.$api.userInfo
let body = {}
this.$http.post(url, body).then((res) => {
if (res.data.code === 0) {
this.formData = res.data.data.curUser
}
})
},
handleSubmit () {
this.modal_create_loading = true
let url = this.$api.userSetting
let body = {
data: {
name: this.formData.name,
position: this.formData.position,
avatar: this.formData.avatar
}
data: this.formData
}
this.$http.post(url, body).then((res) => {
this.modal_create_loading = false
Expand Down
2 changes: 2 additions & 0 deletions src/renderer/router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const ProductInfo = resolve => require(['@/components/productInfo'], resolve)
const ProductCreate = resolve => require(['@/components/productInfo/create'], resolve)
const ProductTodoL = resolve => require(['@/components/productInfo/todoL'], resolve)
const ProductTodoM = resolve => require(['@/components/productInfo/todoM'], resolve)
const ProductTodoT = resolve => require(['@/components/productInfo/todoT'], resolve)
const ProductMember = resolve => require(['@/components/productInfo/member'], resolve)
const ProductSetting = resolve => require(['@/components/productInfo/setting'], resolve)
const ProductNotification = resolve => require(['@/components/productInfo/notification'], resolve)
Expand All @@ -35,6 +36,7 @@ export default new Router({
{ path: 'create', name: 'ProductCreate', component: ProductCreate, meta: { requireAuth: true } },
{ path: 'todoL', name: 'ProductTodoL', component: ProductTodoL, meta: { requireAuth: true } },
{ path: 'todoM', name: 'ProductTodoM', component: ProductTodoM, meta: { requireAuth: true } },
{ path: 'todoT', name: 'ProductTodoT', component: ProductTodoT, meta: { requireAuth: true } },
{ path: 'member', name: 'ProductMember', component: ProductMember, meta: { requireAuth: true } },
{ path: 'setting', name: 'ProductSetting', component: ProductSetting, meta: { requireAuth: true } },
{ path: 'notification', name: 'ProductNotification', component: ProductNotification, meta: { requireAuth: true } },
Expand Down

0 comments on commit e775241

Please sign in to comment.