Skip to content

Commit

Permalink
左边底部新增添加任务选项
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Jan 7, 2022
1 parent 4e8cc36 commit 8ec1578
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 10 deletions.
31 changes: 23 additions & 8 deletions resources/assets/js/pages/manage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,17 @@
:class="{loading:projectKeyLoading > 0}">
<Input prefix="ios-search" v-model="projectKeyValue" :placeholder="$L('' + projectTotal + '个项目,搜索...')" clearable />
</div>
<Button class="manage-box-new" type="primary" icon="md-add" @click="onAddShow">{{$L('新建项目')}}</Button>
<ButtonGroup class="manage-box-new-group">
<Button class="manage-box-new" type="primary" icon="md-add" @click="onAddShow">{{$L('新建项目')}}</Button>
<Dropdown @on-click="onAddTask(0)">
<Button type="primary">
<Icon type="ios-arrow-down"></Icon>
</Button>
<DropdownMenu slot="list">
<DropdownItem>{{$L('新建任务')}} ({{mateName}}+K)</DropdownItem>
</DropdownMenu>
</Dropdown>
</ButtonGroup>
</div>

<div class="manage-box-main">
Expand Down Expand Up @@ -207,6 +217,7 @@ export default {
loadIng: 0,
curPath: this.$route.path,
mateName: /macintosh|mac os x/i.test(navigator.userAgent) ? '' : 'Ctrl',
addShow: false,
addData: {
Expand Down Expand Up @@ -252,12 +263,7 @@ export default {
this.onVisibilityChange();
//
this.addTaskSubscribe = Store.subscribe('addTask', (data) => {
this.$refs.addTask.defaultPriority();
this.$refs.addTask.setData($A.isJson(data) ? data : {
'owner': this.userId,
'column_id': data,
});
this.addTaskShow = true;
this.onAddTask(data)
});
//
document.addEventListener('keydown', this.shortcutEvent);
Expand Down Expand Up @@ -585,11 +591,20 @@ export default {
if (e.keyCode === 75 || e.keyCode === 78) {
if (e.metaKey || e.ctrlKey) {
e.preventDefault();
Store.set('addTask', 0);
this.onAddTask(0)
}
}
},
onAddTask(data) {
this.$refs.addTask.defaultPriority();
this.$refs.addTask.setData($A.isJson(data) ? data : {
'owner': this.userId,
'column_id': data,
});
this.addTaskShow = true;
},
taskVisibleChange(visible) {
if (!visible) {
this.$store.dispatch('openTask', 0)
Expand Down
18 changes: 16 additions & 2 deletions resources/assets/sass/pages/page-manage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,25 @@
}
}
}
.manage-box-new {
.manage-box-new-group {
width: 80%;
height: 38px;
margin-top: 16px;
margin-bottom: 20px;
display: flex;
align-items: center;
.manage-box-new {
flex: 1;
}
.ivu-btn {
height: 38px;
}
.ivu-dropdown {
.ivu-btn {
min-width: auto !important;
padding: 0 4px;
border-radius: 0 4px 4px 0;
}
}
}
}
.manage-box-main {
Expand Down

0 comments on commit 8ec1578

Please sign in to comment.