show flowchart submission detail
Some checks failed
Deploy / deploy (push) Has been cancelled

This commit is contained in:
2025-12-29 23:22:15 +08:00
parent 76994d42b3
commit 04838dd9dd
4 changed files with 229 additions and 3 deletions

View File

@@ -2,7 +2,9 @@
<n-button v-if="showLink" type="info" text @click="goto">
{{ flowchart.id.slice(0, 12) }}
</n-button>
<n-text v-else>{{ flowchart.id.slice(0, 12) }}</n-text>
<n-text v-else class="flowchart-id" @click="handleClick">
{{ flowchart.id.slice(0, 12) }}
</n-text>
</template>
<script setup lang="ts">
import { useUserStore } from "shared/store/user"
@@ -15,11 +17,24 @@ interface Props {
}
const props = defineProps<Props>()
const emit = defineEmits<{
showDetail: [id: string]
}>()
const showLink = computed(() => {
if (!userStore.isAuthed) return false
if (userStore.isSuperAdmin) return true
return props.flowchart.username === userStore.user?.username
})
function goto() {}
function goto() {
emit("showDetail", props.flowchart.id)
}
function handleClick() {
emit("showDetail", props.flowchart.id)
}
</script>
<style scoped>
</style>