From c5b4bc5788eeaf08ff65bd053885592001f2dc3b Mon Sep 17 00:00:00 2001 From: Justin Georgi Date: Sat, 16 Dec 2023 12:53:17 -0700 Subject: [PATCH] Add basic data export framework Signed-off-by: Justin Georgi --- src/pages/detect.vue | 8 +++++++- src/pages/submit-mixin.js | 13 +++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 src/pages/submit-mixin.js diff --git a/src/pages/detect.vue b/src/pages/detect.vue index ae4b5c6..06e74c1 100644 --- a/src/pages/detect.vue +++ b/src/pages/detect.vue @@ -56,7 +56,7 @@ - {{ isCordova }} + @@ -221,7 +221,10 @@ import RegionIcon from '../components/region-icon.vue' import SvgIcon from '../components/svg-icon.vue' + import submitMixin from './submit-mixin' + export default { + mixins: [submitMixin], props: { f7route: Object, }, @@ -432,6 +435,9 @@ this.selectedChip = -1 const box = this.$refs.structure_box box.style.display = 'none' + }, + submitData () { + alert(this.newUid(12)) } } } diff --git a/src/pages/submit-mixin.js b/src/pages/submit-mixin.js new file mode 100644 index 0000000..2571f5a --- /dev/null +++ b/src/pages/submit-mixin.js @@ -0,0 +1,13 @@ +export default { + methods: { + newUid (length) { + const uidLength = length || 16 + const uidChars = 'abcdefghijklmnopqrstuvwxyz0123456789' + var uid = [] + for (var i = 0; i < uidLength; i++) { + uid.push(uidChars.charAt(Math.floor(Math.random() * ((i < 4) ? 26 : 36)))) + } + return uid.join('') + } + } +} \ No newline at end of file