修复: 前端UI审查问题(项目状态badge+confirm替换+加载态+CSS修正)
- ProjectDetail: 加载态/不存在态 + stage badge CSS 类名修正(7个实际状态) - Tasks: confirm()替换为useConfirm + 死代码清理 + priority CSS去重 - Knowledge: 列表加载态 - Projects: CSS变量名拼写修正(--df-mono→--df-font-mono) - EmptyState: opacity从容器移到图标(对比度修复) - Ideas: 5处内联style替换为modal-field class - ProjectDetail: 删除注释stages死代码
This commit is contained in:
+8
-18
@@ -155,11 +155,14 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 确认弹层(删除任务,替代原生 window.confirm) -->
|
||||
<ConfirmDialog :visible="confirmState.visible" :msg="confirmState.msg" @result="answerConfirm" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted, watch, reactive } from 'vue'
|
||||
import { ref, computed, onMounted, onUnmounted, watch, reactive } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useProjectStore } from '@/stores/project'
|
||||
@@ -168,10 +171,13 @@ import { taskStatusLabel as statusLabel, taskStatusClass, priorityLabel, priorit
|
||||
import { taskApi } from '@/api'
|
||||
import type { TaskRecord, TaskQuery, ProjectId } from '@/api/types'
|
||||
import Paginator from '../components/Paginator.vue'
|
||||
import ConfirmDialog from '@/components/ConfirmDialog.vue'
|
||||
import { useConfirm } from '@/composables/useConfirm'
|
||||
|
||||
const router = useRouter()
|
||||
const store = useProjectStore()
|
||||
const { t } = useI18n()
|
||||
const { confirmState, confirmDialog, answerConfirm } = useConfirm()
|
||||
|
||||
const activeProject = ref('all')
|
||||
const activeStatus = ref('all')
|
||||
@@ -222,7 +228,7 @@ async function quickPriority(id: string, priority: number) {
|
||||
}
|
||||
async function quickDelete(task: TaskRecord) {
|
||||
quickMenuId.value = null
|
||||
if (!confirm(t('tasks.confirmDelete', { title: task.title }))) return
|
||||
if (!await confirmDialog(t('tasks.confirmDelete', { title: task.title }))) return
|
||||
try {
|
||||
await store.deleteTask(task.id)
|
||||
} catch (e) { console.error('删除失败:', e) }
|
||||
@@ -343,17 +349,6 @@ function buildTaskQuery(): TaskQuery | undefined {
|
||||
return query
|
||||
}
|
||||
|
||||
async function refresh() {
|
||||
loading.value = true
|
||||
try {
|
||||
await store.loadTasks(buildTaskQuery())
|
||||
totalTasks.value = store.tasks.length
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
void refresh // 保留:将来可能由下拉刷新/手动刷新按钮触发
|
||||
|
||||
function openCreateModal() {
|
||||
newTaskProjectId.value = store.projects.length > 0 ? store.projects[0].id : ''
|
||||
newTaskTitle.value = ''
|
||||
@@ -439,7 +434,6 @@ onMounted(async () => {
|
||||
document.addEventListener('click', closeQuickMenu)
|
||||
})
|
||||
|
||||
import { onUnmounted } from 'vue'
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('keydown', onKeydown)
|
||||
document.removeEventListener('click', closeQuickMenu)
|
||||
@@ -697,10 +691,6 @@ onUnmounted(() => {
|
||||
margin: 4px 0;
|
||||
}
|
||||
.quick-menu-danger { color: var(--df-danger); }
|
||||
.priority-critical { color: var(--df-danger); }
|
||||
.priority-high { color: #ff9800; }
|
||||
.priority-medium { color: var(--df-info); }
|
||||
.priority-low { color: var(--df-text-dim); }
|
||||
|
||||
/* 空态 */
|
||||
.empty-state {
|
||||
|
||||
Reference in New Issue
Block a user