added exctract coming from niminum index #765
This commit is contained in:
@@ -2,9 +2,10 @@
|
|||||||
<section :class="{opened: isopened}">
|
<section :class="{opened: isopened}">
|
||||||
<h4>
|
<h4>
|
||||||
<a
|
<a
|
||||||
:href="'/edition/'+ed.item+'/'+oc.uuid"
|
:href="'/edition/'+ed.item+'/'+oc.uuid+'/'+oc.form"
|
||||||
:uuid="oc.uuid"
|
:uuid="oc.uuid"
|
||||||
:eduuid="ed.item"
|
:eduuid="ed.item"
|
||||||
|
:form="oc.form"
|
||||||
@click.prevent="onGoToText"
|
@click.prevent="onGoToText"
|
||||||
@keyup.enter="onGoToText"
|
@keyup.enter="onGoToText"
|
||||||
>
|
>
|
||||||
@@ -88,13 +89,24 @@ export default {
|
|||||||
title: this.oc.title,
|
title: this.oc.title,
|
||||||
editionTitle: this.editionTitle
|
editionTitle: this.editionTitle
|
||||||
})
|
})
|
||||||
|
// if (e.target.getAttribute('form')) {
|
||||||
|
// this.$router.push({
|
||||||
|
// name: `editiontext`,
|
||||||
|
// params: {
|
||||||
|
// id: e.target.getAttribute('eduuid'),
|
||||||
|
// textid: e.target.getAttribute('uuid')
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: `editiontext`,
|
name: `editiontextextract`,
|
||||||
params: {
|
params: {
|
||||||
id: e.target.getAttribute('eduuid'),
|
id: e.target.getAttribute('eduuid'),
|
||||||
textid: e.target.getAttribute('uuid')
|
textid: e.target.getAttribute('uuid'),
|
||||||
|
extract: e.target.getAttribute('form')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
// }
|
||||||
} else {
|
} else {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: `edition`,
|
name: `edition`,
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ export default {
|
|||||||
meta: null,
|
meta: null,
|
||||||
editionid: null,
|
editionid: null,
|
||||||
textid: null,
|
textid: null,
|
||||||
|
extract: null,
|
||||||
texts: [],
|
texts: [],
|
||||||
textsuuids: [],
|
textsuuids: [],
|
||||||
metainfotitle: undefined,
|
metainfotitle: undefined,
|
||||||
|
|||||||
+25
-3
@@ -29,7 +29,7 @@
|
|||||||
<!-- default slot -->
|
<!-- default slot -->
|
||||||
<IndexItemOcurrences v-if="content" :content="content" />
|
<IndexItemOcurrences v-if="content" :content="content" />
|
||||||
|
|
||||||
<template v-slot:nav>
|
<template v-if="content" v-slot:nav>
|
||||||
<section v-if="content.attestedForms" class="attested-forms">
|
<section v-if="content.attestedForms" class="attested-forms">
|
||||||
<h3>Attested forms</h3>
|
<h3>Attested forms</h3>
|
||||||
<ul>
|
<ul>
|
||||||
@@ -67,13 +67,13 @@ export default {
|
|||||||
title: `Nominum ${this.$route.params.id}`
|
title: `Nominum ${this.$route.params.id}`
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeCreate () {
|
created () {
|
||||||
console.log('nominum this.$route', this.$route)
|
console.log('nominum this.$route', this.$route)
|
||||||
REST.get(`${window.apipath}/indexNominum/` + this.$route.params.id, {})
|
REST.get(`${window.apipath}/indexNominum/` + this.$route.params.id, {})
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
console.log('nominum REST: data', data)
|
console.log('nominum REST: data', data)
|
||||||
if (data.content) {
|
if (data.content) {
|
||||||
this.content = data.content
|
this.parseOccurences(data.content)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@@ -84,6 +84,28 @@ export default {
|
|||||||
query: { fullpath: this.$route.path }
|
query: { fullpath: this.$route.path }
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
parseOccurences (content) {
|
||||||
|
console.log('parseOccurences', content)
|
||||||
|
for (let i = 0; i < content.occurences.length; i++) {
|
||||||
|
let ed = content.occurences[i]
|
||||||
|
for (let j = 0; j < ed.occurences.length; j++) {
|
||||||
|
let o = ed.occurences[j]
|
||||||
|
const uuid = o.uuid
|
||||||
|
for (let k = 0; k < content.attestedForms.length; k++) {
|
||||||
|
const form = content.attestedForms[k]
|
||||||
|
if (form.uuid.indexOf(uuid) >= 0) {
|
||||||
|
content.occurences[i].occurences[j].form = form.title
|
||||||
|
break
|
||||||
|
}
|
||||||
|
console.warn('no form for occurence', o.uuid, o.title)
|
||||||
|
content.occurences[i].occurences[j].form = ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.content = content
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user