@abi-software/scaffoldvuer 0.2.3-alpha-2 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +12 -12
- package/CHANGELOG.md +344 -316
- package/LICENSE +201 -201
- package/README.md +164 -164
- package/babel.config.js +14 -14
- package/dist/scaffoldvuer-wc.common.js +277 -34
- package/dist/scaffoldvuer-wc.umd.js +277 -34
- package/dist/scaffoldvuer-wc.umd.min.js +277 -34
- package/dist/scaffoldvuer.common.js +1252 -529
- package/dist/scaffoldvuer.common.js.map +1 -1
- package/dist/scaffoldvuer.css +1 -1
- package/dist/scaffoldvuer.umd.js +1252 -529
- package/dist/scaffoldvuer.umd.js.map +1 -1
- package/dist/scaffoldvuer.umd.min.js +1 -1
- package/dist/scaffoldvuer.umd.min.js.map +1 -1
- package/package-lock.json +18121 -18119
- package/package.json +89 -89
- package/public/index.html +17 -17
- package/src/App.vue +669 -669
- package/src/ScaffoldVuer-wc.js +13 -13
- package/src/app/DropZone.vue +114 -114
- package/src/app/ModelsInformation.js +35 -35
- package/src/app/ModelsTable.vue +113 -113
- package/src/app/TextureDemos.js +114 -114
- package/src/assets/_variables.scss +43 -43
- package/src/assets/styles.scss +7 -7
- package/src/components/OpacityControls.vue +123 -222
- package/src/components/PrimitiveControls.vue +173 -0
- package/src/components/ScaffoldTooltip.vue +142 -142
- package/src/components/ScaffoldVuer.md +44 -44
- package/src/components/ScaffoldVuer.vue +2007 -2007
- package/src/components/TextureSlidesControls.vue +272 -0
- package/src/components/TreeControls.vue +707 -699
- package/src/components/index.js +7 -7
- package/src/credential.json +12 -0
- package/src/main.js +14 -14
- package/src/scripts/BaseModule.js +80 -80
- package/src/scripts/RendererModule.js +289 -289
- package/src/scripts/WebGL.js +94 -94
- package/src/scripts/annotation.js +5 -5
- package/src/scripts/eventNotifier.js +66 -66
- package/src/scripts/graphicsHighlight.js +134 -134
- package/src/scripts/organsRenderer.js +587 -587
- package/src/scripts/search.js +182 -182
- package/src/scripts/utilities.js +146 -146
- package/styleguide.config.js +22 -22
- package/vue.config.js +41 -41
- package/src/components/test.pdf +0 -0
- package/src/searchControls.vue +0 -122
package/src/ScaffoldVuer-wc.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
import vueCustomElement from 'vue-custom-element';
|
|
3
|
-
|
|
4
|
-
Vue.use(vueCustomElement);
|
|
5
|
-
|
|
6
|
-
import ScaffoldVuer from "./components/ScaffoldVuer.vue";
|
|
7
|
-
|
|
8
|
-
Vue.customElement("scaffoldvuer-wc", ScaffoldVuer);
|
|
9
|
-
|
|
10
|
-
/*
|
|
11
|
-
const wrappedElement = wrap(Vue, ScaffoldVuer);
|
|
12
|
-
|
|
13
|
-
window.customElements.define("scaffoldvuer-wc", wrappedElement);
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
import vueCustomElement from 'vue-custom-element';
|
|
3
|
+
|
|
4
|
+
Vue.use(vueCustomElement);
|
|
5
|
+
|
|
6
|
+
import ScaffoldVuer from "./components/ScaffoldVuer.vue";
|
|
7
|
+
|
|
8
|
+
Vue.customElement("scaffoldvuer-wc", ScaffoldVuer);
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
const wrappedElement = wrap(Vue, ScaffoldVuer);
|
|
12
|
+
|
|
13
|
+
window.customElements.define("scaffoldvuer-wc", wrappedElement);
|
|
14
14
|
*/
|
package/src/app/DropZone.vue
CHANGED
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="dropEl"
|
|
4
|
-
class="dropzone"
|
|
5
|
-
>
|
|
6
|
-
<slot />
|
|
7
|
-
<input
|
|
8
|
-
ref="fileInput"
|
|
9
|
-
type="file"
|
|
10
|
-
>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script>
|
|
15
|
-
/* eslint-disable no-alert, no-console */
|
|
16
|
-
import { SimpleDropzone } from "simple-dropzone";
|
|
17
|
-
import path from "path";
|
|
18
|
-
|
|
19
|
-
export default {
|
|
20
|
-
name: "DropZone",
|
|
21
|
-
data: function () {
|
|
22
|
-
return {
|
|
23
|
-
objectURLs: [],
|
|
24
|
-
};
|
|
25
|
-
},
|
|
26
|
-
mounted: function () {
|
|
27
|
-
const dropCtrl = new SimpleDropzone(
|
|
28
|
-
this.$refs.dropEl,
|
|
29
|
-
this.$refs.fileInput
|
|
30
|
-
);
|
|
31
|
-
dropCtrl.on("drop", ({ files }) => {
|
|
32
|
-
this.localDrop(files);
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
methods: {
|
|
36
|
-
createMetadataObjectURLs: function (text, list) {
|
|
37
|
-
let content = text;
|
|
38
|
-
for (const [key, file] of Object.entries(list)) {
|
|
39
|
-
if (content.includes(key)) {
|
|
40
|
-
const objectURL = URL.createObjectURL(file);
|
|
41
|
-
const re = new RegExp(key, "g");
|
|
42
|
-
content = content.replace(re, objectURL);
|
|
43
|
-
this.objectURLs.push(objectURL);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
let blob = new Blob([content], { type: "application/json" });
|
|
47
|
-
const metaURL = URL.createObjectURL(blob);
|
|
48
|
-
this.objectURLs.push(metaURL);
|
|
49
|
-
this.$emit("files-drop", { url: metaURL, format : "metadata" } );
|
|
50
|
-
},
|
|
51
|
-
createGLTFURL: function (content, binary) {
|
|
52
|
-
let type = binary ? 'model/gltf+binary' : 'model/gltf+json';
|
|
53
|
-
let blob = new Blob([content], { type });
|
|
54
|
-
const gltfURL = URL.createObjectURL(blob);
|
|
55
|
-
this.objectURLs.push(gltfURL);
|
|
56
|
-
this.$emit("files-drop", { url: gltfURL, format : "gltf" });
|
|
57
|
-
},
|
|
58
|
-
revokeURLs: function () {
|
|
59
|
-
this.objectURLs.forEach(objectURL => URL.revokeObjectURL(objectURL));
|
|
60
|
-
this.objectURLs = [];
|
|
61
|
-
},
|
|
62
|
-
localDrop: function (fileMap) {
|
|
63
|
-
const dataMaps = {};
|
|
64
|
-
let list = {};
|
|
65
|
-
let metadata = undefined;
|
|
66
|
-
let gltf = undefined;
|
|
67
|
-
let binary = false;
|
|
68
|
-
const flatarray = Array.from(fileMap);
|
|
69
|
-
let rootPath = "";
|
|
70
|
-
for (let i = 0; i < flatarray.length; i++) {
|
|
71
|
-
if (flatarray[i][1].name.includes("metadata.json")) {
|
|
72
|
-
rootPath = flatarray[i][0].replace(flatarray[i][1].name, "");
|
|
73
|
-
metadata = { rootPath, file: flatarray[i][1] };
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
if (flatarray[i][1].name.includes(".glb")) {
|
|
77
|
-
gltf = { rootPath, file: flatarray[i][1] };
|
|
78
|
-
binary = true;
|
|
79
|
-
break;
|
|
80
|
-
}
|
|
81
|
-
if (flatarray[i][1].name.includes(".gltf")) {
|
|
82
|
-
gltf = { rootPath, file: flatarray[i][1] };
|
|
83
|
-
binary = false;
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
if (metadata) {
|
|
88
|
-
flatarray.forEach(([filePath, file]) => {
|
|
89
|
-
if (file.name.match(/\.(json)$/)) {
|
|
90
|
-
const relativePath = path.relative(rootPath, filePath);
|
|
91
|
-
list[relativePath] = file;
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
const metaFileURL = URL.createObjectURL(metadata.file);
|
|
95
|
-
fetch(metaFileURL)
|
|
96
|
-
.then((response) => response.text())
|
|
97
|
-
.then((text) => this.createMetadataObjectURLs(text, list));
|
|
98
|
-
URL.revokeObjectURL(metaFileURL);
|
|
99
|
-
}
|
|
100
|
-
if (gltf) {
|
|
101
|
-
this.createGLTFURL(gltf.file, binary);
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
</script>
|
|
107
|
-
|
|
108
|
-
<style scoped lang="scss">
|
|
109
|
-
.dropzone {
|
|
110
|
-
position: absolute;
|
|
111
|
-
width: 100%;
|
|
112
|
-
height: 100%;
|
|
113
|
-
}
|
|
114
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="dropEl"
|
|
4
|
+
class="dropzone"
|
|
5
|
+
>
|
|
6
|
+
<slot />
|
|
7
|
+
<input
|
|
8
|
+
ref="fileInput"
|
|
9
|
+
type="file"
|
|
10
|
+
>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script>
|
|
15
|
+
/* eslint-disable no-alert, no-console */
|
|
16
|
+
import { SimpleDropzone } from "simple-dropzone";
|
|
17
|
+
import path from "path";
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: "DropZone",
|
|
21
|
+
data: function () {
|
|
22
|
+
return {
|
|
23
|
+
objectURLs: [],
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
mounted: function () {
|
|
27
|
+
const dropCtrl = new SimpleDropzone(
|
|
28
|
+
this.$refs.dropEl,
|
|
29
|
+
this.$refs.fileInput
|
|
30
|
+
);
|
|
31
|
+
dropCtrl.on("drop", ({ files }) => {
|
|
32
|
+
this.localDrop(files);
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
createMetadataObjectURLs: function (text, list) {
|
|
37
|
+
let content = text;
|
|
38
|
+
for (const [key, file] of Object.entries(list)) {
|
|
39
|
+
if (content.includes(key)) {
|
|
40
|
+
const objectURL = URL.createObjectURL(file);
|
|
41
|
+
const re = new RegExp(key, "g");
|
|
42
|
+
content = content.replace(re, objectURL);
|
|
43
|
+
this.objectURLs.push(objectURL);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
let blob = new Blob([content], { type: "application/json" });
|
|
47
|
+
const metaURL = URL.createObjectURL(blob);
|
|
48
|
+
this.objectURLs.push(metaURL);
|
|
49
|
+
this.$emit("files-drop", { url: metaURL, format : "metadata" } );
|
|
50
|
+
},
|
|
51
|
+
createGLTFURL: function (content, binary) {
|
|
52
|
+
let type = binary ? 'model/gltf+binary' : 'model/gltf+json';
|
|
53
|
+
let blob = new Blob([content], { type });
|
|
54
|
+
const gltfURL = URL.createObjectURL(blob);
|
|
55
|
+
this.objectURLs.push(gltfURL);
|
|
56
|
+
this.$emit("files-drop", { url: gltfURL, format : "gltf" });
|
|
57
|
+
},
|
|
58
|
+
revokeURLs: function () {
|
|
59
|
+
this.objectURLs.forEach(objectURL => URL.revokeObjectURL(objectURL));
|
|
60
|
+
this.objectURLs = [];
|
|
61
|
+
},
|
|
62
|
+
localDrop: function (fileMap) {
|
|
63
|
+
const dataMaps = {};
|
|
64
|
+
let list = {};
|
|
65
|
+
let metadata = undefined;
|
|
66
|
+
let gltf = undefined;
|
|
67
|
+
let binary = false;
|
|
68
|
+
const flatarray = Array.from(fileMap);
|
|
69
|
+
let rootPath = "";
|
|
70
|
+
for (let i = 0; i < flatarray.length; i++) {
|
|
71
|
+
if (flatarray[i][1].name.includes("metadata.json")) {
|
|
72
|
+
rootPath = flatarray[i][0].replace(flatarray[i][1].name, "");
|
|
73
|
+
metadata = { rootPath, file: flatarray[i][1] };
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
if (flatarray[i][1].name.includes(".glb")) {
|
|
77
|
+
gltf = { rootPath, file: flatarray[i][1] };
|
|
78
|
+
binary = true;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
if (flatarray[i][1].name.includes(".gltf")) {
|
|
82
|
+
gltf = { rootPath, file: flatarray[i][1] };
|
|
83
|
+
binary = false;
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (metadata) {
|
|
88
|
+
flatarray.forEach(([filePath, file]) => {
|
|
89
|
+
if (file.name.match(/\.(json)$/)) {
|
|
90
|
+
const relativePath = path.relative(rootPath, filePath);
|
|
91
|
+
list[relativePath] = file;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
const metaFileURL = URL.createObjectURL(metadata.file);
|
|
95
|
+
fetch(metaFileURL)
|
|
96
|
+
.then((response) => response.text())
|
|
97
|
+
.then((text) => this.createMetadataObjectURLs(text, list));
|
|
98
|
+
URL.revokeObjectURL(metaFileURL);
|
|
99
|
+
}
|
|
100
|
+
if (gltf) {
|
|
101
|
+
this.createGLTFURL(gltf.file, binary);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<style scoped lang="scss">
|
|
109
|
+
.dropzone {
|
|
110
|
+
position: absolute;
|
|
111
|
+
width: 100%;
|
|
112
|
+
height: 100%;
|
|
113
|
+
}
|
|
114
|
+
</style>
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
const { GoogleSpreadsheet } = require('google-spreadsheet');
|
|
2
|
-
|
|
3
|
-
/* eslint-disable no-alert, no-console */
|
|
4
|
-
export default {
|
|
5
|
-
data: function() {
|
|
6
|
-
return {
|
|
7
|
-
tableData: [],
|
|
8
|
-
};
|
|
9
|
-
},
|
|
10
|
-
methods: {
|
|
11
|
-
createTable: async function(sheetRows, keywords) {
|
|
12
|
-
for (let i = 0; i < sheetRows.length; i++) {
|
|
13
|
-
let mappedData = {};
|
|
14
|
-
for (let j = 0; j < keywords.length; j++) {
|
|
15
|
-
let keyword = keywords[j];
|
|
16
|
-
mappedData[keyword] = sheetRows[i][keyword];
|
|
17
|
-
}
|
|
18
|
-
this.tableData.push(mappedData);
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
getModelsInformation: async function() {
|
|
22
|
-
const doc = new GoogleSpreadsheet(process.env.VUE_APP_GOOGLE_SPREADSHEET_ID);
|
|
23
|
-
await doc.useServiceAccountAuth({
|
|
24
|
-
client_email: process.env.VUE_APP_GOOGLE_SERVICE_SCAFFOLDVUER_EMAIL,
|
|
25
|
-
private_key: process.env.VUE_APP_GOOGLE_PRIVATE_SCAFFOLDVUER_KEY,
|
|
26
|
-
});
|
|
27
|
-
await doc.loadInfo(); // loads document properties and worksheets
|
|
28
|
-
const sheet = doc.sheetsByIndex[0];
|
|
29
|
-
const sheetRows = await sheet.getRows();
|
|
30
|
-
const keys = ["Organ", "Species", "Note", "Location",
|
|
31
|
-
"Last modified","Blackfynn dataset", "Published", "Discover"];
|
|
32
|
-
this.createTable(sheetRows, keys);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
const { GoogleSpreadsheet } = require('google-spreadsheet');
|
|
2
|
+
|
|
3
|
+
/* eslint-disable no-alert, no-console */
|
|
4
|
+
export default {
|
|
5
|
+
data: function() {
|
|
6
|
+
return {
|
|
7
|
+
tableData: [],
|
|
8
|
+
};
|
|
9
|
+
},
|
|
10
|
+
methods: {
|
|
11
|
+
createTable: async function(sheetRows, keywords) {
|
|
12
|
+
for (let i = 0; i < sheetRows.length; i++) {
|
|
13
|
+
let mappedData = {};
|
|
14
|
+
for (let j = 0; j < keywords.length; j++) {
|
|
15
|
+
let keyword = keywords[j];
|
|
16
|
+
mappedData[keyword] = sheetRows[i][keyword];
|
|
17
|
+
}
|
|
18
|
+
this.tableData.push(mappedData);
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
getModelsInformation: async function() {
|
|
22
|
+
const doc = new GoogleSpreadsheet(process.env.VUE_APP_GOOGLE_SPREADSHEET_ID);
|
|
23
|
+
await doc.useServiceAccountAuth({
|
|
24
|
+
client_email: process.env.VUE_APP_GOOGLE_SERVICE_SCAFFOLDVUER_EMAIL,
|
|
25
|
+
private_key: process.env.VUE_APP_GOOGLE_PRIVATE_SCAFFOLDVUER_KEY,
|
|
26
|
+
});
|
|
27
|
+
await doc.loadInfo(); // loads document properties and worksheets
|
|
28
|
+
const sheet = doc.sheetsByIndex[0];
|
|
29
|
+
const sheetRows = await sheet.getRows();
|
|
30
|
+
const keys = ["Organ", "Species", "Note", "Location",
|
|
31
|
+
"Last modified","Blackfynn dataset", "Published", "Discover"];
|
|
32
|
+
this.createTable(sheetRows, keys);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
package/src/app/ModelsTable.vue
CHANGED
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<el-input
|
|
4
|
-
v-model="search"
|
|
5
|
-
size="mini"
|
|
6
|
-
placeholder="Type to search"
|
|
7
|
-
/>
|
|
8
|
-
<el-table
|
|
9
|
-
:data="tableData.filter(
|
|
10
|
-
data => !search ||
|
|
11
|
-
data.Organ.toLowerCase().includes(search.toLowerCase()) ||
|
|
12
|
-
data.Species.toLowerCase().includes(search.toLowerCase()) ||
|
|
13
|
-
data.Note.toLowerCase().includes(search.toLowerCase()))"
|
|
14
|
-
style="width: 100%;"
|
|
15
|
-
height="600"
|
|
16
|
-
>
|
|
17
|
-
<el-table-column
|
|
18
|
-
prop="Organ"
|
|
19
|
-
label="Organ"
|
|
20
|
-
width="100"
|
|
21
|
-
/>
|
|
22
|
-
<el-table-column
|
|
23
|
-
prop="Species"
|
|
24
|
-
label="Species"
|
|
25
|
-
width="100"
|
|
26
|
-
/>
|
|
27
|
-
<el-table-column
|
|
28
|
-
prop="Note"
|
|
29
|
-
label="Note"
|
|
30
|
-
width="200"
|
|
31
|
-
/>
|
|
32
|
-
<el-table-column
|
|
33
|
-
prop="Last modified"
|
|
34
|
-
label="Last modified"
|
|
35
|
-
width="250"
|
|
36
|
-
/>
|
|
37
|
-
<el-table-column
|
|
38
|
-
fixed="right"
|
|
39
|
-
label="Action"
|
|
40
|
-
width="300"
|
|
41
|
-
>
|
|
42
|
-
<template slot-scope="scope">
|
|
43
|
-
<el-button
|
|
44
|
-
size="mini"
|
|
45
|
-
@click="handleView(scope.row)"
|
|
46
|
-
>
|
|
47
|
-
View
|
|
48
|
-
</el-button>
|
|
49
|
-
<el-button
|
|
50
|
-
v-if="scope.row.Discover !== 'Not even'"
|
|
51
|
-
size="mini"
|
|
52
|
-
@click="handleDiscover(scope.row)"
|
|
53
|
-
>
|
|
54
|
-
Discover
|
|
55
|
-
</el-button>
|
|
56
|
-
<el-button
|
|
57
|
-
v-if="scope.row['Blackfynn dataset'] !== '/'"
|
|
58
|
-
size="mini"
|
|
59
|
-
@click="handleBlackfynn(scope.row)"
|
|
60
|
-
>
|
|
61
|
-
Blackfynn
|
|
62
|
-
</el-button>
|
|
63
|
-
</template>
|
|
64
|
-
</el-table-column>
|
|
65
|
-
</el-table>
|
|
66
|
-
</div>
|
|
67
|
-
</template>
|
|
68
|
-
|
|
69
|
-
<script>
|
|
70
|
-
/* eslint-disable no-alert, no-console */
|
|
71
|
-
import Vue from "vue";
|
|
72
|
-
import models from './ModelsInformation'
|
|
73
|
-
import { Button, Input, Table, TableColumn } from "element-ui";
|
|
74
|
-
import lang from "element-ui/lib/locale/lang/en";
|
|
75
|
-
import locale from "element-ui/lib/locale";
|
|
76
|
-
|
|
77
|
-
locale.use(lang);
|
|
78
|
-
Vue.use(Button);
|
|
79
|
-
Vue.use(Input);
|
|
80
|
-
Vue.use(Table);
|
|
81
|
-
Vue.use(TableColumn);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
export default {
|
|
85
|
-
name: "ModelsTable",
|
|
86
|
-
mixins: [models],
|
|
87
|
-
data() {
|
|
88
|
-
return {
|
|
89
|
-
search: '',
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
created: function() {
|
|
93
|
-
this.getModelsInformation();
|
|
94
|
-
},
|
|
95
|
-
methods: {
|
|
96
|
-
handleView: function(row) {
|
|
97
|
-
this.$emit("viewModelClicked", row.Location);
|
|
98
|
-
},
|
|
99
|
-
handleDiscover: function(row) {
|
|
100
|
-
window.open(row.Discover, "_blank");
|
|
101
|
-
},
|
|
102
|
-
handleBlackfynn: function(row) {
|
|
103
|
-
window.open(row['Blackfynn dataset'], "_blank");
|
|
104
|
-
},
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
</script>
|
|
108
|
-
|
|
109
|
-
<style scoped lang="scss">
|
|
110
|
-
@import "~element-ui/packages/theme-chalk/src/input";
|
|
111
|
-
@import "~element-ui/packages/theme-chalk/src/table";
|
|
112
|
-
@import "~element-ui/packages/theme-chalk/src/table-column";
|
|
113
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-input
|
|
4
|
+
v-model="search"
|
|
5
|
+
size="mini"
|
|
6
|
+
placeholder="Type to search"
|
|
7
|
+
/>
|
|
8
|
+
<el-table
|
|
9
|
+
:data="tableData.filter(
|
|
10
|
+
data => !search ||
|
|
11
|
+
data.Organ.toLowerCase().includes(search.toLowerCase()) ||
|
|
12
|
+
data.Species.toLowerCase().includes(search.toLowerCase()) ||
|
|
13
|
+
data.Note.toLowerCase().includes(search.toLowerCase()))"
|
|
14
|
+
style="width: 100%;"
|
|
15
|
+
height="600"
|
|
16
|
+
>
|
|
17
|
+
<el-table-column
|
|
18
|
+
prop="Organ"
|
|
19
|
+
label="Organ"
|
|
20
|
+
width="100"
|
|
21
|
+
/>
|
|
22
|
+
<el-table-column
|
|
23
|
+
prop="Species"
|
|
24
|
+
label="Species"
|
|
25
|
+
width="100"
|
|
26
|
+
/>
|
|
27
|
+
<el-table-column
|
|
28
|
+
prop="Note"
|
|
29
|
+
label="Note"
|
|
30
|
+
width="200"
|
|
31
|
+
/>
|
|
32
|
+
<el-table-column
|
|
33
|
+
prop="Last modified"
|
|
34
|
+
label="Last modified"
|
|
35
|
+
width="250"
|
|
36
|
+
/>
|
|
37
|
+
<el-table-column
|
|
38
|
+
fixed="right"
|
|
39
|
+
label="Action"
|
|
40
|
+
width="300"
|
|
41
|
+
>
|
|
42
|
+
<template slot-scope="scope">
|
|
43
|
+
<el-button
|
|
44
|
+
size="mini"
|
|
45
|
+
@click="handleView(scope.row)"
|
|
46
|
+
>
|
|
47
|
+
View
|
|
48
|
+
</el-button>
|
|
49
|
+
<el-button
|
|
50
|
+
v-if="scope.row.Discover !== 'Not even'"
|
|
51
|
+
size="mini"
|
|
52
|
+
@click="handleDiscover(scope.row)"
|
|
53
|
+
>
|
|
54
|
+
Discover
|
|
55
|
+
</el-button>
|
|
56
|
+
<el-button
|
|
57
|
+
v-if="scope.row['Blackfynn dataset'] !== '/'"
|
|
58
|
+
size="mini"
|
|
59
|
+
@click="handleBlackfynn(scope.row)"
|
|
60
|
+
>
|
|
61
|
+
Blackfynn
|
|
62
|
+
</el-button>
|
|
63
|
+
</template>
|
|
64
|
+
</el-table-column>
|
|
65
|
+
</el-table>
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|
|
68
|
+
|
|
69
|
+
<script>
|
|
70
|
+
/* eslint-disable no-alert, no-console */
|
|
71
|
+
import Vue from "vue";
|
|
72
|
+
import models from './ModelsInformation'
|
|
73
|
+
import { Button, Input, Table, TableColumn } from "element-ui";
|
|
74
|
+
import lang from "element-ui/lib/locale/lang/en";
|
|
75
|
+
import locale from "element-ui/lib/locale";
|
|
76
|
+
|
|
77
|
+
locale.use(lang);
|
|
78
|
+
Vue.use(Button);
|
|
79
|
+
Vue.use(Input);
|
|
80
|
+
Vue.use(Table);
|
|
81
|
+
Vue.use(TableColumn);
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
export default {
|
|
85
|
+
name: "ModelsTable",
|
|
86
|
+
mixins: [models],
|
|
87
|
+
data() {
|
|
88
|
+
return {
|
|
89
|
+
search: '',
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
created: function() {
|
|
93
|
+
this.getModelsInformation();
|
|
94
|
+
},
|
|
95
|
+
methods: {
|
|
96
|
+
handleView: function(row) {
|
|
97
|
+
this.$emit("viewModelClicked", row.Location);
|
|
98
|
+
},
|
|
99
|
+
handleDiscover: function(row) {
|
|
100
|
+
window.open(row.Discover, "_blank");
|
|
101
|
+
},
|
|
102
|
+
handleBlackfynn: function(row) {
|
|
103
|
+
window.open(row['Blackfynn dataset'], "_blank");
|
|
104
|
+
},
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
<style scoped lang="scss">
|
|
110
|
+
@import "~element-ui/packages/theme-chalk/src/input";
|
|
111
|
+
@import "~element-ui/packages/theme-chalk/src/table";
|
|
112
|
+
@import "~element-ui/packages/theme-chalk/src/table-column";
|
|
113
|
+
</style>
|