Add new parameters for QR Art (#36)
This commit is contained in:
1 parent
f80a05c181
commit
2654d336e7
54 files changed
+4747
-404
No files matched your search
@@ -8,6 +8,16 @@
|
||||
<qrw-selector class="mb-4" />
|
||||
<steps-selector class="mb-4" />
|
||||
<preset-selector class="mb-4" />
|
||||
<advanced-selector class="mb-4" />
|
||||
<seed-input v-if="config.advanced" class="mb-4" />
|
||||
<position-selector v-if="config.advanced" class="mb-4" />
|
||||
<pixel-style-selector v-if="config.advanced" class="mb-4" />
|
||||
<marker-shape-selector v-if="config.advanced" class="mb-4" />
|
||||
<sub-marker-selector v-if="config.advanced" class="mb-4" />
|
||||
<rotate-selector v-if="config.advanced" class="mb-4" />
|
||||
<ecl-selector v-if="config.advanced" class="mb-4" />
|
||||
<padding-level-selector v-if="config.advanced" class="mb-4" />
|
||||
<padding-noise-selector v-if="config.advanced" class="mb-4" />
|
||||
</div>
|
||||
<div class="actions">
|
||||
<el-button type="primary" class="btn" round @click="onGenerate">
|
||||
@@ -27,6 +37,16 @@ import AspectRatioSelector from './config/AspectRatioSelector.vue';
|
||||
import QrwSelector from './config/QrwSelector.vue';
|
||||
import StepsSelector from './config/StepsSelector.vue';
|
||||
import PresetSelector from './config/PresetSelector.vue';
|
||||
import AdvancedSelector from './config/AdvancedSelector.vue';
|
||||
import MarkerShapeSelector from './config/MarkerShapeSelector.vue';
|
||||
import SubMarkerSelector from './config/SubMarkerSelector.vue';
|
||||
import RotateSelector from './config/RotateSelector.vue';
|
||||
import EclSelector from './config/EclSelector.vue';
|
||||
import PositionSelector from './config/PositionSelector.vue';
|
||||
import PaddingLevelSelector from './config/PaddingLevelSelector.vue';
|
||||
import PaddingNoiseSelector from './config/PaddingNoiseSelector.vue';
|
||||
import PixelStyleSelector from './config/PixelStyleSelector.vue';
|
||||
import SeedInput from './config/SeedInput.vue';
|
||||
import { ElButton } from 'element-plus';
|
||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
||||
|
||||
@@ -36,12 +56,22 @@ export default defineComponent({
|
||||
TypeSelector,
|
||||
FontAwesomeIcon,
|
||||
ContentInput,
|
||||
PositionSelector,
|
||||
PixelStyleSelector,
|
||||
PaddingLevelSelector,
|
||||
SeedInput,
|
||||
PromptInput,
|
||||
AspectRatioSelector,
|
||||
ElButton,
|
||||
QrwSelector,
|
||||
EclSelector,
|
||||
StepsSelector,
|
||||
PresetSelector
|
||||
PaddingNoiseSelector,
|
||||
PresetSelector,
|
||||
AdvancedSelector,
|
||||
MarkerShapeSelector,
|
||||
SubMarkerSelector,
|
||||
RotateSelector
|
||||
},
|
||||
emits: ['generate'],
|
||||
computed: {
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('qrart.name.advanced') }}</h2>
|
||||
<el-switch v-model="value" class="value" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSwitch } from 'element-plus';
|
||||
import { QRART_DEFAULT_ADVANCED } from '@/constants';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'AdvancedSelector',
|
||||
components: {
|
||||
ElSwitch
|
||||
},
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart.config?.advanced;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set advanced', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart.config,
|
||||
advanced: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.value === undefined) {
|
||||
this.value = QRART_DEFAULT_ADVANCED;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
.info {
|
||||
width: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('qrart.name.ecl') }}</h2>
|
||||
<el-select v-model="value" clearable class="value" :placeholder="$t('qrart.placeholder.ecl')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { QRART_DEFAULT_ECL } from '@/constants';
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'EclSelector',
|
||||
components: {
|
||||
ElSelect,
|
||||
ElOption
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [
|
||||
{
|
||||
value: 'L',
|
||||
label: 'L'
|
||||
},
|
||||
{
|
||||
value: 'M',
|
||||
label: 'M'
|
||||
},
|
||||
{
|
||||
value: 'Q',
|
||||
label: 'Q'
|
||||
},
|
||||
{
|
||||
value: 'H',
|
||||
label: 'H'
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart?.config?.ecl;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set ecl', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart?.config,
|
||||
ecl: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = QRART_DEFAULT_ECL;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('qrart.name.markerShape') }}</h2>
|
||||
<el-select v-model="value" clearable class="value" :placeholder="$t('qrart.placeholder.markerShape')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { QRART_DEFAULT_MARKER_SHAPE } from '@/constants';
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'MarkerShapeSelector',
|
||||
components: {
|
||||
ElSelect,
|
||||
ElOption
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [
|
||||
{
|
||||
value: 'square',
|
||||
label: this.$t('qrart.markerShape.square')
|
||||
},
|
||||
{
|
||||
value: 'circle',
|
||||
label: this.$t('qrart.markerShape.circle')
|
||||
},
|
||||
{
|
||||
value: 'plus',
|
||||
label: this.$t('qrart.markerShape.plus')
|
||||
},
|
||||
{
|
||||
value: 'box',
|
||||
label: this.$t('qrart.markerShape.box')
|
||||
},
|
||||
{
|
||||
value: 'octagon',
|
||||
label: this.$t('qrart.markerShape.octagon')
|
||||
},
|
||||
{
|
||||
value: 'tiny-plus',
|
||||
label: this.$t('qrart.markerShape.tinyPlus')
|
||||
},
|
||||
{
|
||||
value: 'random',
|
||||
label: this.$t('qrart.markerShape.random')
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart?.config?.marker_shape;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set marker_shape', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart?.config,
|
||||
marker_shape: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = QRART_DEFAULT_MARKER_SHAPE;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('qrart.name.paddingLevel') }}</h2>
|
||||
<el-select v-model="value" clearable class="value" :placeholder="$t('qrart.placeholder.paddingLevel')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { QRART_DEFAULT_PADDING_LEVEL } from '@/constants';
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'PaddingLevelSelector',
|
||||
components: {
|
||||
ElSelect,
|
||||
ElOption
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [
|
||||
{
|
||||
value: 0,
|
||||
label: 0
|
||||
},
|
||||
{
|
||||
value: 5,
|
||||
label: 5
|
||||
},
|
||||
{
|
||||
value: 10,
|
||||
label: 10
|
||||
},
|
||||
{
|
||||
value: 10,
|
||||
label: 10
|
||||
},
|
||||
{
|
||||
value: 15,
|
||||
label: 15
|
||||
},
|
||||
{
|
||||
value: 20,
|
||||
label: 20
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart?.config?.padding_level;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set padding_level', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart?.config,
|
||||
padding_level: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = QRART_DEFAULT_PADDING_LEVEL;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,84 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('qrart.name.paddingNoise') }}</h2>
|
||||
<el-select v-model="value" clearable class="value" :placeholder="$t('qrart.placeholder.paddingNoise')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { QRART_DEFAULT_PADDING_NOISE } from '@/constants';
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'PaddingNoiseSelector',
|
||||
components: {
|
||||
ElSelect,
|
||||
ElOption
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [
|
||||
{
|
||||
value: 0,
|
||||
label: 0
|
||||
},
|
||||
{
|
||||
value: 0.25,
|
||||
label: 0.25
|
||||
},
|
||||
{
|
||||
value: 0.5,
|
||||
label: 0.5
|
||||
},
|
||||
{
|
||||
value: 0.75,
|
||||
label: 0.75
|
||||
},
|
||||
{
|
||||
value: 1,
|
||||
label: 1
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart?.config?.padding_noise;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set padding_noise', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart?.config,
|
||||
padding_noise: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = QRART_DEFAULT_PADDING_NOISE;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,88 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('qrart.name.pixelStyle') }}</h2>
|
||||
<el-select v-model="value" clearable class="value" :placeholder="$t('qrart.placeholder.pixelStyle')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { QRART_DEFAULT_PIXEL_STYLE } from '@/constants';
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'PixelStyleSelector',
|
||||
components: {
|
||||
ElSelect,
|
||||
ElOption
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [
|
||||
{
|
||||
value: 'square',
|
||||
label: this.$t('qrart.pixelStyle.square')
|
||||
},
|
||||
{
|
||||
value: 'rounded',
|
||||
label: this.$t('qrart.pixelStyle.rounded')
|
||||
},
|
||||
{
|
||||
value: 'dot',
|
||||
label: this.$t('qrart.pixelStyle.dot')
|
||||
},
|
||||
{
|
||||
value: 'squircle',
|
||||
label: this.$t('qrart.pixelStyle.squircle')
|
||||
},
|
||||
{
|
||||
value: 'row',
|
||||
label: this.$t('qrart.pixelStyle.row')
|
||||
},
|
||||
{
|
||||
value: 'column',
|
||||
label: this.$t('qrart.pixelStyle.column')
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart?.config?.pixel_style;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set pixel_style', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart?.config,
|
||||
pixel_style: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = QRART_DEFAULT_PIXEL_STYLE;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('qrart.name.position') }}</h2>
|
||||
<el-select v-model="value" clearable class="value" :placeholder="$t('qrart.placeholder.position')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { QRART_DEFAULT_POSITION } from '@/constants';
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'MarkerShapeSelector',
|
||||
components: {
|
||||
ElSelect,
|
||||
ElOption
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [
|
||||
{
|
||||
value: 'center',
|
||||
label: this.$t('qrart.position.center')
|
||||
},
|
||||
{
|
||||
value: 'top',
|
||||
label: this.$t('qrart.position.top')
|
||||
},
|
||||
{
|
||||
value: 'right',
|
||||
label: this.$t('qrart.position.right')
|
||||
},
|
||||
{
|
||||
value: 'bottom',
|
||||
label: this.$t('qrart.position.bottom')
|
||||
},
|
||||
{
|
||||
value: 'left',
|
||||
label: this.$t('qrart.position.left')
|
||||
},
|
||||
{
|
||||
value: 'top-left',
|
||||
label: this.$t('qrart.position.topLeft')
|
||||
},
|
||||
{
|
||||
value: 'top-right',
|
||||
label: this.$t('qrart.position.topRight')
|
||||
},
|
||||
{
|
||||
value: 'bottom-left',
|
||||
label: this.$t('qrart.position.bottomLeft')
|
||||
},
|
||||
{
|
||||
value: 'bottom-right',
|
||||
label: this.$t('qrart.position.bottomRight')
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart?.config?.position;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set position', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart?.config,
|
||||
position: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = QRART_DEFAULT_POSITION;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,58 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('qrart.name.rawurl') }}</h2>
|
||||
<el-switch v-model="value" class="value" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSwitch } from 'element-plus';
|
||||
import { QRART_DEFAULT_ADVANCED } from '@/constants';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'RawurlSelector',
|
||||
components: {
|
||||
ElSwitch
|
||||
},
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart.config?.rawurl;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set rawurl', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart.config,
|
||||
rawurl: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.value === undefined) {
|
||||
this.value = QRART_DEFAULT_RAWURL;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
.info {
|
||||
width: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,80 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('qrart.name.rotate') }}</h2>
|
||||
<el-select v-model="value" clearable class="value" :placeholder="$t('qrart.placeholder.rotate')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { QRART_DEFAULT_ROTATE } from '@/constants';
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'RotateSelector',
|
||||
components: {
|
||||
ElSelect,
|
||||
ElOption
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [
|
||||
{
|
||||
value: 0,
|
||||
label: 0
|
||||
},
|
||||
{
|
||||
value: 90,
|
||||
label: 90
|
||||
},
|
||||
{
|
||||
value: 180,
|
||||
label: 180
|
||||
},
|
||||
{
|
||||
value: 270,
|
||||
label: 270
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart?.config?.rotate;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set rotate', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart?.config,
|
||||
rotate: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = QRART_DEFAULT_ROTATE;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,57 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('qrart.name.seed') }}</h2>
|
||||
<el-input v-model="value" class="value" :placeholder="$t('qrart.placeholder.seed')" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElInput } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'SeedInput',
|
||||
components: {
|
||||
ElInput
|
||||
},
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart?.config?.seed;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set seed', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart?.config,
|
||||
seed: val ? parseInt(val) : undefined
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = undefined;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,84 @@
|
||||
<template>
|
||||
<div class="field">
|
||||
<h2 class="title">{{ $t('qrart.name.subMarker') }}</h2>
|
||||
<el-select v-model="value" clearable class="value" :placeholder="$t('qrart.placeholder.subMarker')">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { QRART_DEFAULT_SUB_MARKER } from '@/constants';
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElSelect, ElOption } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'SubMarkerSelector',
|
||||
components: {
|
||||
ElSelect,
|
||||
ElOption
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
options: [
|
||||
{
|
||||
value: 'square',
|
||||
label: this.$t('qrart.subMarker.square')
|
||||
},
|
||||
{
|
||||
value: 'circle',
|
||||
label: this.$t('qrart.subMarker.circle')
|
||||
},
|
||||
{
|
||||
value: 'plus',
|
||||
label: this.$t('qrart.subMarker.plus')
|
||||
},
|
||||
{
|
||||
value: 'box',
|
||||
label: this.$t('qrart.subMarker.box')
|
||||
},
|
||||
{
|
||||
value: 'random',
|
||||
label: this.$t('qrart.subMarker.random')
|
||||
}
|
||||
]
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
value: {
|
||||
get() {
|
||||
return this.$store.state.qrart?.config?.sub_marker;
|
||||
},
|
||||
set(val) {
|
||||
console.debug('set sub_marker', val);
|
||||
this.$store.commit('qrart/setConfig', {
|
||||
...this.$store.state.qrart?.config,
|
||||
sub_marker: val
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (!this.value) {
|
||||
this.value = QRART_DEFAULT_SUB_MARKER;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 14px;
|
||||
margin: 0;
|
||||
width: 30%;
|
||||
}
|
||||
.value {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -29,12 +29,24 @@ export default defineComponent({
|
||||
return {
|
||||
options: [
|
||||
{
|
||||
label: 'Text',
|
||||
label: this.$t('qrart.type.text'),
|
||||
value: 'text'
|
||||
},
|
||||
{
|
||||
label: 'Link',
|
||||
label: this.$t('qrart.type.link'),
|
||||
value: 'link'
|
||||
},
|
||||
{
|
||||
label: this.$t('qrart.type.email'),
|
||||
value: 'email'
|
||||
},
|
||||
{
|
||||
label: this.$t('qrart.type.phone'),
|
||||
value: 'phone'
|
||||
},
|
||||
{
|
||||
label: this.$t('qrart.type.sms'),
|
||||
value: 'sms'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user