-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
98 lines (95 loc) · 3.86 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>XLS to VCF</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.11"></script>
<script src="https://unpkg.com/vue-multiselect@2.1.6"></script>
<script src="https://cdn.sheetjs.com/xlsx-0.20.0/package/dist/xlsx.mini.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css">
<link rel="stylesheet" href="https://unpkg.com/vue-multiselect@2.1.6/dist/vue-multiselect.min.css">
</head>
<body>
<div id="app" class="container is-fluid is-widescreen">
<section class="section">
<div class="content">
<h1 class="title">
<a href="">XLS to VCF</a>
</h1>
<div class="columns is-vcentered">
<div class="column is-3">
<div class="file">
<label class="file-label">
<input class="file-input" ref="file" type="file" name="file" @change="readFile()" accept=".xls,.xlsx,.csv">
<span class="file-cta">
<span class="file-label">Upload Excel file…</span>
</span>
</label>
</div>
</div>
<div class="column">
{{ filename }}
</div>
</div>
<div v-show="data.length">
<h3>Table data</h3>
<div class="table-container">
<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
<thead>
<th>#</th>
<th v-for="(header, key) in tableHeaders">{{ header }}</th>
</thead>
<tr v-for="(row, index) in firstThreeRows" :key="index">
<td>{{ index + 1 }}</td>
<td v-for="(header, key) in tableHeaders" :key="key">{{ row[header] || '' }}</td>
</tr>
<tr v-if="data.length > 4">
<td colspan="100">...</td>
</tr>
<tr v-if="data.length > 3">
<td>{{ data.length }}</td>
<td v-for="(header, key) in tableHeaders" :key="key">{{ lastRow[header] || '' }}</td>
</tr>
</table>
</div>
<h3>Mapping</h3>
<div v-for="(field, index) in fields">
<div class="columns is-vcentered">
<div class="column is-one-fifth">
<label :for="index" class="">{{ field.description }}:</label>
</div>
<div class="column">
<multiselect :id="index" :key="index" v-model="field.values" :options="tableHeaders" :multiple="true"
placeholder="Select fields or leave empty">
</div>
</div>
</div>
<br />
<div class="content">
<h3>Preview of the first {{ firstThreeRows.length }} rows</h3>
<div class="tile is-ancestor">
<div class="tile is-vertical is-12">
<div class="tile">
<div v-for="(row, index) in firstThreeRows" :key="index" class="tile is-parent">
<article class="tile is-child notification">
<div v-for="(field, i) in fields">
<span v-show="field.values.length" class="small">{{ field.description}}: </span>
<span v-for="val in field.values" class="small"> {{ row[val] }} </span>
</div>
</article>
</div>
</div>
</div>
</div>
</div>
<br />
<a id="downloadLink" style="display: none">Download VCF</a>
<button :disabled="canDownload" class="button" @click="handleDownloadButton">Download vcf file</button>
</div>
</div>
</section>
</div>
</body>
<script src="js/app.js"></script>
</html>