|
|
@ -35,7 +35,7 @@ |
|
|
|
<view class="flex items-center mb-1"> |
|
|
|
<view class="mr-2">{{ item.name }}</view> |
|
|
|
<!-- 状态 TODO:--> |
|
|
|
<view class="px-2 text-xs text-green-400 bg-green-100 rounded-full">进行中</view> |
|
|
|
<view class="px-2 text-xs text-green-400 bg-green-100 rounded-full flex-shrink-0">进行中</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
<view class="flex items-center text-xs text-gray-400"> |
|
|
@ -93,7 +93,7 @@ |
|
|
|
? 'text-red-400 bg-red-100' |
|
|
|
: 'text-gray-400 bg-gray-100' |
|
|
|
" |
|
|
|
class="px-2 text-xs text-gray-400 bg-gray-100 rounded-full" |
|
|
|
class="px-2 text-xs text-gray-400 bg-gray-100 rounded-full flex-shrink-0" |
|
|
|
> |
|
|
|
{{ subItem.status === 0 ? '未开始' : subItem.status === 1 ? '进行中' : subItem.status === 2 ? '暂停' : '已完成' }} |
|
|
|
</view> |
|
|
@ -200,7 +200,7 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
...mapMutations('project', ['setProjectItemShow']), |
|
|
|
...mapMutations('project', ['setProjectItemShow', 'setProjects']), |
|
|
|
// 展开子项目 |
|
|
|
openSubProject(length, index) { |
|
|
|
this.setProjectItemShow({ index, show: this.itemList[index].show ? false : true }); |
|
|
@ -224,12 +224,18 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 操作 |
|
|
|
chooseAction(index) { |
|
|
|
if (this.menuList[index].text === '排序') { |
|
|
|
chooseAction(obj) { |
|
|
|
let action = this.menuList[obj.index].text; |
|
|
|
if (action === '排序') { |
|
|
|
this.changeEvent = true; |
|
|
|
this.$t.ui.showToast('请移动进行排序'); |
|
|
|
} |
|
|
|
|
|
|
|
if (action === '删除') { |
|
|
|
this.changeEvent = false; |
|
|
|
this.delProject(obj.projectId); |
|
|
|
} |
|
|
|
|
|
|
|
if (this.showItemIndex !== undefined) { |
|
|
|
this.setProjectItemShow({ index: this.showItemIndex, show: true }); |
|
|
|
} |
|
|
@ -456,6 +462,29 @@ export default { |
|
|
|
return 0; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 删除项目 |
|
|
|
delProject(id) { |
|
|
|
uni.showModal({ |
|
|
|
title: '', |
|
|
|
content: '是否删除项目?', |
|
|
|
showCancel: true, |
|
|
|
success: async ({ confirm }) => { |
|
|
|
if (confirm) { |
|
|
|
await this.$u.api.delProject(id); |
|
|
|
let flag_index = 0; |
|
|
|
this.itemList.forEach((item, index) => { |
|
|
|
if (item.id == id) { |
|
|
|
flag_index = index; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
this.itemList.splice(flag_index, 1); |
|
|
|
this.setProjects(this.itemList); |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|