2019-11-05 23:53:18 +01:00
|
|
|
import Vue from 'vue'
|
|
|
|
|
|
|
|
|
|
import Component from 'vue-class-component'
|
|
|
|
|
import { func_tools } from '../store/Modules/toolsext'
|
|
|
|
|
import { tools } from '../store/Modules/tools'
|
|
|
|
|
import { toolsext } from '@src/store/Modules/toolsext'
|
|
|
|
|
import { GlobalStore } from '../store/Modules'
|
|
|
|
|
|
|
|
|
|
// You can declare a mixin as the same style as components.
|
|
|
|
|
@Component
|
|
|
|
|
export default class MixinBase extends Vue {
|
|
|
|
|
public mythis() {
|
|
|
|
|
return this
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get toolsext() {
|
|
|
|
|
return toolsext
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get func_tools() {
|
|
|
|
|
return func_tools
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get tools() {
|
|
|
|
|
return tools
|
|
|
|
|
}
|
|
|
|
|
|
2019-11-15 00:32:39 +01:00
|
|
|
public getValDb(keystr, def?) {
|
|
|
|
|
const ris = GlobalStore.getters.getValueSettingsByKey(keystr)
|
|
|
|
|
if (ris === '')
|
|
|
|
|
return def
|
|
|
|
|
else
|
|
|
|
|
return ris
|
2019-11-05 23:53:18 +01:00
|
|
|
}
|
|
|
|
|
public getarrValDb(keystr) {
|
|
|
|
|
const myval = GlobalStore.getters.getValueSettingsByKey(keystr)
|
|
|
|
|
// console.log('myval', myval)
|
2019-11-06 22:28:45 +01:00
|
|
|
try {
|
|
|
|
|
if (myval) {
|
|
|
|
|
const myrec = JSON.parse(myval)
|
|
|
|
|
// console.log('*************** getarrValDb')
|
|
|
|
|
// console.table(myrec)
|
|
|
|
|
return myrec
|
|
|
|
|
} else {
|
|
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
2019-11-05 23:53:18 +01:00
|
|
|
return []
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|