kanban > step > virtual sample : fix uri
This commit is contained in:
parent
dd8d9c7fa1
commit
8c0a347d2c
7 changed files with 46 additions and 15 deletions
|
|
@ -59,7 +59,6 @@ class ProjectPage extends Page {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($child->pdf()->isNotEmpty()) {
|
if ($child->pdf()->isNotEmpty()) {
|
||||||
$uri = $child->parent()->uri() . '?dialog=' . $child->slug();
|
|
||||||
$files[] = getFileData($child->pdf()->toFile());
|
$files[] = getFileData($child->pdf()->toFile());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,10 @@
|
||||||
<template>
|
<template>
|
||||||
<Images v-if="images.length > 0" :step="step" :images="images" />
|
<Images
|
||||||
|
v-if="images.length > 0"
|
||||||
|
:step="step"
|
||||||
|
:images="images"
|
||||||
|
:uri="'/' + step.uri"
|
||||||
|
/>
|
||||||
<Document v-if="pdf" :step="step" :pdf="pdf" />
|
<Document v-if="pdf" :step="step" :pdf="pdf" />
|
||||||
|
|
||||||
<button
|
<button
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,7 @@
|
||||||
<article class="card">
|
<article class="card">
|
||||||
<hgroup class="order-last">
|
<hgroup class="order-last">
|
||||||
<h3 class="card__title | font-serif | text-lg">
|
<h3 class="card__title | font-serif | text-lg">
|
||||||
<router-link
|
<router-link :to="uri" class="link-full">
|
||||||
:to="'/' + step.uri + '&fileIndex=' + index"
|
|
||||||
class="link-full"
|
|
||||||
>
|
|
||||||
{{ pdf.label.length ? pdf.label : pdf.name.replace(".pdf", "") }}
|
{{ pdf.label.length ? pdf.label : pdf.name.replace(".pdf", "") }}
|
||||||
</router-link>
|
</router-link>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
@ -42,13 +39,18 @@ import DateTime from "./DateTime.vue";
|
||||||
const { step, pdf, index } = defineProps({
|
const { step, pdf, index } = defineProps({
|
||||||
step: Object,
|
step: Object,
|
||||||
pdf: Object,
|
pdf: Object,
|
||||||
index: {
|
index: Number,
|
||||||
default: 0,
|
|
||||||
type: Number,
|
|
||||||
},
|
|
||||||
hasImage: {
|
hasImage: {
|
||||||
default: true,
|
default: true,
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const uri =
|
||||||
|
location.pathname + "?dialog=" + step.slug + "&fileIndex=" + getIndex();
|
||||||
|
|
||||||
|
function getIndex() {
|
||||||
|
if (index) return index;
|
||||||
|
return step.files.findIndex((file) => file.type === "document");
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,7 @@
|
||||||
<article class="card">
|
<article class="card">
|
||||||
<hgroup class="order-last">
|
<hgroup class="order-last">
|
||||||
<h3 class="card__title | font-serif | text-lg">
|
<h3 class="card__title | font-serif | text-lg">
|
||||||
<router-link :to="'/' + step.uri" class="link-full">{{
|
<router-link :to="uri" class="link-full">{{ step.label }}</router-link>
|
||||||
step.label
|
|
||||||
}}</router-link>
|
|
||||||
</h3>
|
</h3>
|
||||||
</hgroup>
|
</hgroup>
|
||||||
<DateTime :date="step.modified" />
|
<DateTime :date="step.modified" />
|
||||||
|
|
@ -31,6 +29,10 @@
|
||||||
import DateTime from "./DateTime.vue";
|
import DateTime from "./DateTime.vue";
|
||||||
import { usePageStore } from "../../../stores/page";
|
import { usePageStore } from "../../../stores/page";
|
||||||
|
|
||||||
const { images, step } = defineProps({ images: Array, step: Object });
|
const { images, step, uri } = defineProps({
|
||||||
|
images: Array,
|
||||||
|
step: Object,
|
||||||
|
uri: String,
|
||||||
|
});
|
||||||
const { page } = usePageStore();
|
const { page } = usePageStore();
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<Document v-if="step.files.length > 0" :step="step" :pdf="step.files[0]" />
|
<Document
|
||||||
|
v-if="step.files.length > 0"
|
||||||
|
:step="step"
|
||||||
|
:pdf="step.files.find((file) => file.type === 'document')"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import Document from "./Document.vue";
|
import Document from "./Document.vue";
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
v-if="step.files.dynamic || step.files.static"
|
v-if="step.files.dynamic || step.files.static"
|
||||||
:step="step"
|
:step="step"
|
||||||
:images="images"
|
:images="images"
|
||||||
|
:uri="uri"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
|
@ -14,6 +15,8 @@ const images = computed(() => {
|
||||||
return step.files?.dynamic?.map((track) => getFrontView(track)) ?? [];
|
return step.files?.dynamic?.map((track) => getFrontView(track)) ?? [];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const uri = "/" + step.uri;
|
||||||
|
|
||||||
function getFrontView(track) {
|
function getFrontView(track) {
|
||||||
if (track.files.length === 1) return track.files[0];
|
if (track.files.length === 1) return track.files[0];
|
||||||
const xMax = parseInt(
|
const xMax = parseInt(
|
||||||
|
|
|
||||||
16
vite.config.js
Normal file
16
vite.config.js
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { defineConfig } from "vite";
|
||||||
|
import vue from "@vitejs/plugin-vue";
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [vue()],
|
||||||
|
base: "/",
|
||||||
|
build: {
|
||||||
|
outDir: "dist",
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
entryFileNames: "assets/dist/[name].js",
|
||||||
|
assetFileNames: "assets/dist/[name].[ext]",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue