Adds command to automatically parse xlsx into json data for app

This commit is contained in:
Moritz Kröger 2019-04-17 08:55:08 +01:00
parent 92986f2512
commit 7049108f1a
13 changed files with 1887 additions and 15 deletions

View File

@ -1,7 +1,7 @@
const fs = require('fs')
const yaml = require('js-yaml')
const ora = require('ora')
const { writeFile } = require('../helper')
const {
category,
baseConfig,
@ -12,15 +12,7 @@ const {
markdownField,
listField,
objectField
} = require('./config')
const writeFile = (path, data, opts = 'utf8') =>
new Promise((resolve, reject) => {
fs.writeFile(path, data, opts, (err) => {
if (err) reject(err)
else resolve()
})
})
} = require('./helper')
const PATH_DESTINATION = './public/admin/config.yml'

22
bin/helper.js Normal file
View File

@ -0,0 +1,22 @@
const fs = require('fs')
const writeFile = (path, data, opts = 'utf8') =>
new Promise((resolve, reject) => {
fs.writeFile(path, data, opts, (err) => {
if (err) reject(err)
else resolve()
})
})
const readFile = (path, opts = 'utf8') =>
new Promise((resolve, reject) => {
fs.readFile(path, opts, (err, data) => {
if (err) reject(err)
else resolve(data)
})
})
module.exports = {
writeFile,
readFile
}

144
bin/xlsx-data/index.js Normal file
View File

@ -0,0 +1,144 @@
const XLSX = require('xlsx')
const ora = require('ora')
const { writeFile } = require('../helper')
/**
* Cell Object Structure
* v: raw value (see Data Types section for more info)
* w: formatted text (if applicable)
* t: type: b Boolean, e Error, n Number, d Date, s Text, z Stub
* f: cell formula encoded as an A1-style string (if applicable)
* F: range of enclosing array if formula is array formula (if applicable)
* r: rich text encoding (if applicable)
* h: HTML rendering of the rich text (if applicable)
* c: comments associated with the cell
* z: number format string associated with the cell (if requested)
* l: cell hyperlink object (.Target holds link, .Tooltip is tooltip)
* s: the style/theme of the cell (if applicable)
*/
function createLocaleMap (section, data = {}) {
return Object.keys(data)
.filter(key => key.includes(section))
.reduce((acc, keyLabel) => {
const splitKeyLabel = keyLabel.split(' ')
const locale = splitKeyLabel[splitKeyLabel.length - 1].toLowerCase()
acc[locale] = data[keyLabel].trim()
return acc
}, {})
}
function createPartyPositionMap (sheetName) {
if (!sheetName) return []
const rawData = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName])
return rawData.map(block => {
return {
thesis: block.Thesis,
position: block.Position,
statement: createLocaleMap('Statement', block)
}
})
}
function toJSON (data = {}) {
return JSON.stringify(data, null, 2)
}
async function writeDataset (fileName, data = {}) {
const path = `${DIRECTORY}/${fileName}`
try {
await writeFile(path, toJSON(data))
spinner.succeed(`Success! It's located at ${path}`)
} catch (error) {
spinner.fail(`Failure! Couldn't write '${fileName}'. Error: ${error.message}`)
}
}
async function createOptionsDataset (sheetName) {
if (!sheetName) {
throw new Error(`createOptionsDataset() requires 'sheetName', got "${sheetName}"`)
}
await writeDataset(
'options.json',
XLSX.utils.sheet_to_json(workbook.Sheets[sheetName])
)
}
async function createThesesDataset (sheetName) {
if (!sheetName) {
throw new Error(`createThesesDataset() requires 'sheetName', got "${sheetName}"`)
}
const rawData = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName])
const data = rawData.map(block => {
return {
id: parseInt(block.ID, 10),
category: createLocaleMap('Category', block),
thesis: createLocaleMap('Thesis', block),
terminology: block.Terminology || []
}
})
await writeDataset('theses.json', data)
}
async function createTerminologyDataset (sheetName) {
if (!sheetName) {
throw new Error(`createTerminologyDataset() requires 'sheetName', got "${sheetName}"`)
}
const rawData = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName])
const data = rawData.map(block => {
return {
id: parseInt(block.ID, 10),
explanation: createLocaleMap('Explanation', block),
reference: createLocaleMap('Reference', block)
}
})
await writeDataset('terminology.json', data)
}
async function createPartiesDataset (sheetName, partySheets) {
if (!sheetName) {
throw new Error(`createPartiesDataset() requires 'sheetName', got "${sheetName}"`)
}
const rawData = XLSX.utils.sheet_to_json(workbook.Sheets[sheetName])
const data = rawData.map(block => {
return {
id: parseInt(block.ID, 10),
token: block.Token,
european_profile: {
party: createLocaleMap('European Party', block)
},
program: createLocaleMap('Program', block),
positions: createPartyPositionMap(partySheets.find(sName => sName === block.Token))
}
})
await writeDataset('parties.json', data)
}
const DIRECTORY = './bin/xlsx-data/test'
const RESOURCE_FILE = 'euromat-dataset.xlsx'
const spinner = ora()
const workbook = XLSX.readFile(`./resources/${RESOURCE_FILE}`)
const [options, theses, terminology, parties, ...morePartySheets] = workbook.SheetNames
;(async () => {
spinner.start()
spinner.info(`Parsing '${RESOURCE_FILE}' to JSON files`)
spinner.info(`XLSX SheetNames: ${workbook.SheetNames}`)
spinner.info(`Writing 'options.json' file`)
await createOptionsDataset(options)
spinner.info(`Writing 'theses.json' file`)
await createThesesDataset(theses)
spinner.info(`Writing 'terminology.json' file`)
await createTerminologyDataset(terminology)
spinner.info(`Writing 'parties.json' file`)
await createPartiesDataset(parties, morePartySheets)
spinner.stopAndPersist()
})()

View File

@ -0,0 +1,18 @@
[
{
"position": "positive",
"id": 0
},
{
"position": "neutral",
"id": 1
},
{
"position": "negative",
"id": 2
},
{
"position": "skipped",
"id": 3
}
]

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,112 @@
[
{
"id": 0,
"explanation": {
"de": "Gebiet, das die EU-Mitgliedstaaten umfasst, die den Euro als Währung eingeführt haben, und in dem eine einheitliche Geldpolitik unter Aufsicht des EZB-Rats durchgeführt wird.",
"en": "The group of EU Member States that have adopted the euro as their currenc"
},
"reference": {
"de": "http://iate.europa.eu/FindTermsByLilId.do?lilId=894832&langId=de",
"en": "http://iate.europa.eu/FindTermsByLilId.do?lilId=894832&langId=en"
}
},
{
"id": 1,
"explanation": {
"de": "Das Europäische Parlament ist die auf der Grundlage der Verträge, des Akts vom 20. September 1976 zur Einführung allgemeiner unmittelbarer Wahlen der Mitglieder des Europäischen Parlaments und der in Anwendung der Verträge erlassenen nationalen Rechtsvorsc",
"en": "The European Parliament is the assembly elected pursuant to the Treaties, the Act of 20 September 1976 concerning the election of the members of the European Parliament by direct universal suffrage and national legislation deriving from the Treaties."
},
"reference": {
"de": "http://iate.europa.eu/FindTermsByLilId.do?lilId=126540&langId=de",
"en": "http://iate.europa.eu/FindTermsByLilId.do?lilId=126540&langId=en"
}
},
{
"id": 2,
"explanation": {
"de": "Die Europäische Union beruht auf rechtstaatlichen Grundsätzen. Das bedeutet, dass jede Tätigkeit der EU auf Verträgen beruht, die von allen EU-Mitgliedstaaten auf freiwilliger und demokratischer Basis angenommen wurden. Wenn ein Politikbereich beispielswei",
"en": "The European Union is based on the rule of law. This means that every action taken by the EU is founded on treaties that have been approved voluntarily and democratically by all EU member countries. For example, if a policy area is not cited in a treaty, t"
},
"reference": {
"de": "https://europa.eu/european-union/law/treaties_de",
"en": "https://europa.eu/european-union/law/treaties_en"
}
},
{
"id": 3,
"explanation": {
"de": "Anschlag auf Informationssysteme bzw. Steuersysteme kritischer Infrastrukturen mit Hilfe bösartiger Software, der zum Verlust lebenswichtiger Infrastrukturdienste führt.",
"en": "Deliberate act, generally using malicious computer code, designed to alter, disrupt, deny, degrade, or destroy information resident in computers and computer networks, or the computers and networks themselves."
},
"reference": {
"de": "http://iate.europa.eu/FindTermsByLilId.do?lilId=919510&langId=de",
"en": "http://iate.europa.eu/FindTermsByLilId.do?lilId=919510&langId=en"
}
},
{
"id": 4,
"explanation": {
"de": "Unzutreffende Nachrichtenmeldung. Sie entsteht durch die fehlerhafte oder nachlässige Recherche eines Journalisten oder wird von Journalisten, amtlichen Stellen, Politikern, Unternehmen, Privatpersonen und anderen Informanten absichtlich lanciert. Abzugren",
"en": "Fabricated news stories with the deliberate aim of fooling readers"
},
"reference": {
"de": "http://iate.europa.eu/FindTermsByLilId.do?lilId=3572432&langId=de",
"en": "http://iate.europa.eu/FindTermsByLilId.do?lilId=3572432&langId=en"
}
},
{
"id": 5,
"explanation": {
"de": "Land, das nicht Mitglied der Europäischen Union ist; \"Drittland\" bezeichnet im weiteren Sinne auch ein Land, das bei internationalen Verträgen nicht Vertragspartner ist bzw. einer internationalen Organisation nicht angehört.",
"en": "Country that is not a member of the European Union."
},
"reference": {
"de": "http://iate.europa.eu/FindTermsByLilId.do?lilId=768108&langId=de",
"en": "http://iate.europa.eu/FindTermsByLilId.do?lilId=768108&langId=en"
}
},
{
"id": 6,
"explanation": {
"de": "Zentrales Organ der Internationalen Staatengemeinschaft für Friedenssicherung und Konfliktmanagement; fasst Beschlüsse (Resolutionen), die anders als die der Generalversammlung für alle Mitgliedstaaten bindend sind; damit verfügt er über weit gehende B",
"en": "UN body that has the primary responsibility for the maintenance of international peace and security; Composed of five permanent members — China, France, Russian Federation, the United Kingdom and the United States — and ten non-permanent members."
},
"reference": {
"de": "http://iate.europa.eu/FindTermsByLilId.do?lilId=877820&langId=de",
"en": "http://iate.europa.eu/FindTermsByLilId.do?lilId=877820&langId=en"
}
},
{
"id": 7,
"explanation": {
"de": "Die Europäische Union (EU) besteht seit dem 1. Juli 2013 aus 28 Mitgliedstaaten (Unionsmitgliedstaaten). Belgien, Bulgarien, Dänemark, Deutschland, Estland, Finnland, Frankreich, Griechenland, Irland, Italien, Kroatien, Lettland, Litauen, Luxemburg, Malta,",
"en": "One of the sovereign nation states that have acceded to the European Union (EU). As from 1 July 2013 the 28 Member States of the EU are Austria, Belgium, Bulgaria, Croatia, Cyprus, Czech Republic, Denmark, Estonia, Finland, France, Germany, Greece, Hungary"
},
"reference": {
"de": "https://de.wikipedia.org/wiki/Mitgliedstaaten_der_Europ%C3%A4ischen_Union",
"en": "http://iate.europa.eu/FindTermsByLilId.do?lilId=1568826&langId=en"
}
},
{
"id": 8,
"explanation": {
"de": "(I) Der Haushaltsplan ist der Rechtsakt, durch den für jedes Haushaltsjahr sämtliche als erforderlich erachteten Einnahmen und Ausgaben der Europäischen Gemeinschaft und der Europäischen Atomgemeinschaft veranschlagt und bewilligt werden. ; (II) Der Haush",
"en": "(I) The budget is the instrument which, for each financial year, forecasts and authorises all revenue and expenditure considered necessary for the European Community and the European Atomic Energy Community. ; (II) The budget shall consist of: Quelle (I) C"
},
"reference": {
"de": "http://iate.europa.eu/FindTermsByLilId.do?lilId=749055&langId=de",
"en": "http://iate.europa.eu/FindTermsByLilId.do?lilId=749055&langId=en"
}
},
{
"id": 9,
"explanation": {
"de": "Der Haushaltsplan umfasst a) den allgemeinen Einnahmen- und Ausgabenplan, b) Einzelpläne mit den Einnahmen- und Ausgabenplänen für jedes der Organe einzeln mit Ausnahme des Europäischen Rates und des Rates, die in demselben Einzelplan zusammengefasst werde",
"en": "TBD"
},
"reference": {
"de": "http://iate.europa.eu/FindTermsByLilId.do?lilId=1077513&langId=de",
"en": "http://iate.europa.eu/FindTermsByLilId.do?lilId=1077513&langId=en"
}
}
]

View File

@ -0,0 +1,398 @@
[
{
"id": 0,
"category": {
"de": "Politische Bildung",
"en": "Civic Education"
},
"thesis": {
"de": "Europapolitische Bildung sollte Teil der Lehrpläne aller Mitgliedsländer sein.",
"en": "European civic education should be part of the school curricula of all member countries."
},
"terminology": []
},
{
"id": 1,
"category": {
"de": "Europäische Armee",
"en": "European Army"
},
"thesis": {
"de": "Langfristig sollten die EU-Mitgliedstaaten ihre Streitkräfte zu einer europäischen Armee zusammenschließen.",
"en": "In the long-term EU member states should merge their armed forces to a European army."
},
"terminology": []
},
{
"id": 2,
"category": {
"de": "Zuständigkeiten der EU",
"en": "Competencies of the EU"
},
"thesis": {
"de": "Die EU hat zu viele Aufgaben übernommen, die an die Mitgiedsstaaten zurück gegeben werden sollten.",
"en": "The EU has taken on too many tasks that should be transferred back to the member states."
},
"terminology": []
},
{
"id": 3,
"category": {
"de": "Atomenergie",
"en": "Nuclear Energy"
},
"thesis": {
"de": "Alle Mitgliedsstaaten sollen bis spätestens 2040 aus der Atomkraft aussteigen.",
"en": "Every member state should eliminate atomic energy by 2040."
},
"terminology": []
},
{
"id": 4,
"category": {
"de": "Handelspolitik",
"en": "Trade Policy"
},
"thesis": {
"de": "Die Europäische Union soll zum Schutz europäischer Produkte verstärkt Zölle erheben.",
"en": "The EU should raise tarifs to secure European products from foreign competition."
},
"terminology": []
},
{
"id": 5,
"category": {
"de": "Grenzschutz",
"en": "Border Protection"
},
"thesis": {
"de": "Alle Mitgliedsstaaten sollten Geld und Personal für den Schutz der europäischen Außengrenzen zur Verfügung stellen.",
"en": "Each member state should provide funds and human resources to secure the European border."
},
"terminology": []
},
{
"id": 6,
"category": {
"de": "Gleichberechtigung",
"en": "Equality"
},
"thesis": {
"de": "Die EU sollte sich für eine verpflichtende Frauenquote auf Führungsebene von Unternehmen einsetzen.",
"en": "The EU should be committed to introducing a quota for women in leading managerial positions."
},
"terminology": []
},
{
"id": 7,
"category": {
"de": "Datenschutz",
"en": "Data Protection"
},
"thesis": {
"de": "Unternehmen soll die Nutzung personalisierter Daten erleichtert werden.",
"en": "Personalized data should be made easier for companies to use."
},
"terminology": []
},
{
"id": 8,
"category": {
"de": "Verteilung Flüchtlinge:",
"en": "Distribution Refugees"
},
"thesis": {
"de": "Innerhalb der EU sollten Flüchtlinge nach einem Verteilungsschlüssel auf alle Mitgliedsstaaten verteilt werden.",
"en": "The refugees should be distributed between every member state based on a quota within the EU."
},
"terminology": []
},
{
"id": 9,
"category": {
"de": "Erweiterung",
"en": "EU Enlargement"
},
"thesis": {
"de": "Die EU sollte keine neuen Mitgliedsländer aufnehmen.",
"en": "The EU should not accept any new member states."
},
"terminology": []
},
{
"id": 10,
"category": {
"de": "CO2 Steuer",
"en": "CO2 Tax"
},
"thesis": {
"de": "Es soll eine EU-weite CO2-Steuer geben.",
"en": "A European carbon tax should be introduced."
},
"terminology": []
},
{
"id": 11,
"category": {
"de": "Agrarsubventionen",
"en": "Agricultural Subsidies"
},
"thesis": {
"de": "Die EU sollte die finanzielle Unterstützung der Landwirtschaft verringern.",
"en": "The EU should reduce financial subsidies given to the agriculture sector."
},
"terminology": []
},
{
"id": 12,
"category": {
"de": "Europäischer Geheimdienst",
"en": "Intelligence Service"
},
"thesis": {
"de": "Die EU sollte einen gemeinsamen europäischen Geheimdienst zur effektiveren Terrorismusbekämpfung aufbauen.",
"en": "The EU should install a common European intelligent service in order to effectivly counter terrorism."
},
"terminology": []
},
{
"id": 13,
"category": {
"de": "Europäischer Mindestlohn:",
"en": "Minimum Wage"
},
"thesis": {
"de": "Es sollten europaweit Mindestlöhne abhängig vom Durchschnittseinkommen des jeweiligen Mitgliedsstaates eingeführt werden.",
"en": "A European minimum wage should be introduced, dependent on the average income of the member state."
},
"terminology": []
},
{
"id": 14,
"category": {
"de": "Russland",
"en": "Russia"
},
"thesis": {
"de": "Alle EU-Sanktionen gegen Russland sollten aufgehoben werden.",
"en": "All EU sanctions against Russia should be lifted."
},
"terminology": []
},
{
"id": 15,
"category": {
"de": "Netzpolitik",
"en": "Net Policy"
},
"thesis": {
"de": "Straftaten wie Mobbing, Falschinformation oder Verleumdung im Internet sollen EU-weit konsequent verfolgt werden.",
"en": "Criminal offences such as bullying, misinformation or defamation on the Internet should be consistently prosecuted throughout the EU."
},
"terminology": []
},
{
"id": 16,
"category": {
"de": "Jugendarbeitslosigkeit",
"en": "Youth Unemployment"
},
"thesis": {
"de": "Jugendarbeitslosigkeit sollte national bekämpft werden.",
"en": "Youth unemployment should be combated at national level."
},
"terminology": []
},
{
"id": 17,
"category": {
"de": "Mobilität",
"en": "Mobility"
},
"thesis": {
"de": "Durch Ausbau des öffentlichen Nah- und Fernverkehrs soll es jedem EU-Bürger möglich sein, auf ein eigenes Auto zu verzichten.",
"en": "By expanding public local and long-distance transport, every EU citizen should be able to renounce their own car."
},
"terminology": []
},
{
"id": 18,
"category": {
"de": "Unternehmensbesteuerung",
"en": "Taxation of Companies"
},
"thesis": {
"de": "Um Steuervermeidung zu bekämpfen, sollen EU-Mindeststeuersätze für Unternehmen eingeführt werden.",
"en": "To prevent tax avoidance, an EU minimum taxation for companies should be introduced."
},
"terminology": []
},
{
"id": 19,
"category": {
"de": "Abschiebung",
"en": "Deportation"
},
"thesis": {
"de": "Straffällig gewordene Asylbewerber und Menschen ohne anerkanntem Aufenthaltsstatus sollen aus der EU ausgewiesen werden.",
"en": "Previously convicted asylum seekers and persons without a residence permit should be expelled from the EU."
},
"terminology": []
},
{
"id": 20,
"category": {
"de": "Bargeld",
"en": "Cash"
},
"thesis": {
"de": "Die EU sollte langfristig Bargeld abschaffen.",
"en": "The EU should abolish cash in the long-term."
},
"terminology": []
},
{
"id": 21,
"category": {
"de": "Direktwahl",
"en": "Direct Election"
},
"thesis": {
"de": "Der/die PräsidentIn der Europäischen Kommission soll von den Bürgerinnen und Bürgern der Europäischen Union direkt gewählt werden.",
"en": "The President of the European Commission should be directly elected by the citizens of the European Union."
},
"terminology": []
},
{
"id": 22,
"category": {
"de": "Militärausgaben",
"en": "Military Spending"
},
"thesis": {
"de": "Die EU-Mitgliedsstaaten sollten ihre Militärausgaben stark erhöhen.",
"en": "EU member states should substantially increase their military spending."
},
"terminology": []
},
{
"id": 23,
"category": {
"de": "Arbeitslosenversicherung:",
"en": "Unemployment Insurance"
},
"thesis": {
"de": "Es sollte eine gemeinsame Arbeitslosenversicherung auf europäischer Ebene geben.",
"en": "There should be a common unemployment insurance for all member states within Europe."
},
"terminology": []
},
{
"id": 24,
"category": {
"de": "Freihandel",
"en": "Free Trade Agreements"
},
"thesis": {
"de": "Die EU sollte keine weitere Freihandelsabkommen abschließen.",
"en": "The EU should not conclude further free trade agreements."
},
"terminology": []
},
{
"id": 25,
"category": {
"de": "Bürokratieabbau",
"en": "Reduction of Bureaucracy"
},
"thesis": {
"de": "Der Standort des Europäischen Parlaments in Strasbourg sollte abgeschafft werden (Brüssel bleibt als einziger Standort erhalten).",
"en": "The site of the European Parliament in Strasbourg should be abolished (Brussels remains as the only site)."
},
"terminology": []
},
{
"id": 26,
"category": {
"de": "Ländliche Regionen",
"en": "Rural Regions"
},
"thesis": {
"de": "Verkehr und öffentliche Versorgung sollen schwerpunktmäßig in ländlichen Regionen gefördert werden.",
"en": "Transport and public services are to be promoted primarily in rural regions."
},
"terminology": []
},
{
"id": 27,
"category": {
"de": "Grenzkontrollen",
"en": "Border Control"
},
"thesis": {
"de": "Grenzkontrollen im Schengen-Raum sollten immer möglich sein.",
"en": "Border controls should always be possible in the Schengen area."
},
"terminology": []
},
{
"id": 28,
"category": {
"de": "Sozialleistungen",
"en": "Social Welfare Benefits"
},
"thesis": {
"de": "EU-Bürger sollen Sozialleistungen hauptsächlich von ihrem Heimatland empfangen können.",
"en": "EU-citizens should receive social welfare benefits primarily from their home countries."
},
"terminology": []
},
{
"id": 29,
"category": {
"de": "Vetorecht in der Außenpolitik",
"en": "Veto Right in Foreign Policy"
},
"thesis": {
"de": "Ein einzelner Mitgliedsstaat sollte in Zukunft keine Mehrheitsentscheidung in der europäischen Außenpolitik blockieren können.",
"en": "In future, a single member state should not be able to block majority decisions in European foreign policy."
},
"terminology": []
},
{
"id": 30,
"category": {
"de": "Lebensmittel/Verbraucherschutz",
"en": "Food/Consumer Protection"
},
"thesis": {
"de": "Es sollte eine EU-weite Ampelkennzeichnung von Zucker-, Fett- und Kaloriengehalt für Lebensmittel eingeführt werden.",
"en": "EU-wide colour-coded labelling of sugar, fat and calorie content for food should be introduced."
},
"terminology": []
},
{
"id": 31,
"category": {
"de": "Finanzmärkte (Finanztransaktionssteuer)",
"en": "Financial Markets (Financial Transaction Tax)"
},
"thesis": {
"de": "Die EU sollte Finanzmärkte besteuern.",
"en": "The EU should tax financial markets."
},
"terminology": []
},
{
"id": 32,
"category": {
"de": "EU Mitgliedschaft",
"en": "EU Membership"
},
"thesis": {
"de": "Es sollte in meinem Land ein Referendum über die EU-Mitgliedschaft meines Landes geben.",
"en": "My country should have a referendum on its EU membership."
},
"terminology": []
}
]

100
package-lock.json generated
View File

@ -2204,6 +2204,16 @@
"integrity": "sha512-z55ocwKBRLryBs394Sm3ushTtBeg6VAeuku7utSoSnsJKvKcnXFIyC6vh27n3rXyxSgkJBBCAvyOn7gSUcTYjg==",
"dev": true
},
"adler-32": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/adler-32/-/adler-32-1.2.0.tgz",
"integrity": "sha1-aj5r8KY5ALoVZSgIyxXGgT0aXyU=",
"dev": true,
"requires": {
"exit-on-epipe": "~1.0.1",
"printj": "~1.1.0"
}
},
"ajv": {
"version": "6.10.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz",
@ -3677,6 +3687,18 @@
"resolved": "https://registry.npmjs.org/ccount/-/ccount-1.0.3.tgz",
"integrity": "sha512-Jt9tIBkRc9POUof7QA/VwWd+58fKkEEfI+/t1/eOlxKM7ZhrczNzMFefge7Ai+39y1pR/pP6cI19guHy3FSLmw=="
},
"cfb": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/cfb/-/cfb-1.1.0.tgz",
"integrity": "sha512-ZqfxNGWTMKhd0a/n6YKJLq8hWbd5kR3cA4kXwUj9vVEdHlwJ09werR8gN15Z7Y1FTXqdD6dE3GGCxv4uc28raA==",
"dev": true,
"requires": {
"adler-32": "~1.2.0",
"commander": "^2.16.0",
"crc-32": "~1.2.0",
"printj": "~1.1.2"
}
},
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
@ -4027,6 +4049,24 @@
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
},
"codepage": {
"version": "1.14.0",
"resolved": "https://registry.npmjs.org/codepage/-/codepage-1.14.0.tgz",
"integrity": "sha1-jL4lSBMjVZ19MHVxsP/5HnodL5k=",
"dev": true,
"requires": {
"commander": "~2.14.1",
"exit-on-epipe": "~1.0.1"
},
"dependencies": {
"commander": {
"version": "2.14.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.14.1.tgz",
"integrity": "sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==",
"dev": true
}
}
},
"collapse-white-space": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.4.tgz",
@ -4527,6 +4567,16 @@
}
}
},
"crc-32": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.0.tgz",
"integrity": "sha512-1uBwHxF+Y/4yF5G48fwnKq6QsIXheor3ZLPT80yGBV1oEUwpPojlEhQbWKVw1VwcTQyMGHK1/XMmTjmlsmTTGA==",
"dev": true,
"requires": {
"exit-on-epipe": "~1.0.1",
"printj": "~1.1.0"
}
},
"create-ecdh": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz",
@ -6298,6 +6348,12 @@
"integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=",
"dev": true
},
"exit-on-epipe": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/exit-on-epipe/-/exit-on-epipe-1.0.1.tgz",
"integrity": "sha512-h2z5mrROTxce56S+pnvAV890uu7ls7f1kEvVGJbw1OlFH3/mlJ5bkXu0KRyW94v37zzHPiUd55iLn3DA7TjWpw==",
"dev": true
},
"expand-brackets": {
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
@ -6881,6 +6937,12 @@
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ=",
"dev": true
},
"frac": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/frac/-/frac-1.1.2.tgz",
"integrity": "sha512-w/XBfkibaTl3YDqASwfDUqkna4Z2p9cFSr1aHDt0WoMTECnRfBOv2WArlZILlqgWlmdIlALXGpM2AOhEk5W3IA==",
"dev": true
},
"fragment-cache": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
@ -13341,6 +13403,12 @@
}
}
},
"printj": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/printj/-/printj-1.1.2.tgz",
"integrity": "sha512-zA2SmoLaxZyArQTOPj5LXecR+RagfPSU5Kw1qP+jkWeNlrq+eJZyY2oS68SU1Z/7/myXM4lo9716laOFAVStCQ==",
"dev": true
},
"private": {
"version": "0.1.8",
"resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz",
@ -14914,6 +14982,15 @@
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw="
},
"ssf": {
"version": "0.10.2",
"resolved": "https://registry.npmjs.org/ssf/-/ssf-0.10.2.tgz",
"integrity": "sha512-rDhAPm9WyIsY8eZEKyE8Qsotb3j/wBdvMWBUsOhJdfhKGLfQidRjiBUV0y/MkyCLiXQ38FG6LWW/VYUtqlIDZQ==",
"dev": true,
"requires": {
"frac": "~1.1.2"
}
},
"sshpk": {
"version": "1.16.1",
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
@ -17425,6 +17502,29 @@
"resolved": "https://registry.npmjs.org/x-is-string/-/x-is-string-0.1.0.tgz",
"integrity": "sha1-R0tQhlrzpJqcRlfwWs0UVFj3fYI="
},
"xlsx": {
"version": "0.14.2",
"resolved": "https://registry.npmjs.org/xlsx/-/xlsx-0.14.2.tgz",
"integrity": "sha512-6+4TkmU34s1p/qsl8omWSEOa7pOtWlw4SuRJH/FGRk3iF/gcvSWGgCI1L28NaSDx2tI82aeq2SPY+xeFQJD27A==",
"dev": true,
"requires": {
"adler-32": "~1.2.0",
"cfb": "^1.1.0",
"codepage": "~1.14.0",
"commander": "~2.17.1",
"crc-32": "~1.2.0",
"exit-on-epipe": "~1.0.1",
"ssf": "~0.10.2"
},
"dependencies": {
"commander": {
"version": "2.17.1",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz",
"integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==",
"dev": true
}
}
},
"xml-name-validator": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",

View File

@ -8,7 +8,8 @@
"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit",
"svg": "vsvg -s ./src/assets/svg -t ./src/assets/icons",
"admin": "node bin/admin"
"admin": "node bin/admin-yml",
"data": "node bin/xlsx-data"
},
"dependencies": {
"lint-staged": "^8.1.5",
@ -45,7 +46,8 @@
"normalize.css": "^8.0.1",
"ora": "^3.4.0",
"sass-loader": "^7.1.0",
"vue-template-compiler": "^2.5.21"
"vue-template-compiler": "^2.5.21",
"xlsx": "^0.14.2"
},
"husky": {
"hooks": {

Binary file not shown.

Binary file not shown.

View File

@ -77,10 +77,7 @@
this.languageMenuSelected = false
},
changeLanguage (locale) {
// console.log('this.$router.currentRoute', this.$router.currentRoute)
// const currentRoute = this.$router.currentRoute.name
setCurrentLocale(locale)
// this.$router.replace(getTranslatedUrl(currentRoute))
this.hideLanguageSelection()
}
}