Skip to content

Commit ad3a834

Browse files
GermeyAceDataCloud
and
AceDataCloud
authored
Update qrart ux flow (#162)
Co-authored-by: AceDataCloud <office@acedata.cloud>
1 parent f0242c6 commit ad3a834

File tree

8 files changed

+58
-120
lines changed

8 files changed

+58
-120
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "adjust ux flow for qrart",
4+
"packageName": "@acedatacloud/nexior",
5+
"email": "office@acedata.cloud",
6+
"dependentChangeType": "patch"
7+
}

src/components/qrart/ConfigPanel.vue

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<template>
2-
<div class="panel">
3-
<div class="config">
2+
<div class="panel flex flex-col h-full">
3+
<div class="flex-1 overflow-y-scroll p-4">
44
<type-selector class="mb-4" />
5+
<content-input class="mb-4" />
6+
<prompt-input class="mb-4" />
57
<aspect-ratio-selector class="mb-4" />
68
<qrw-selector class="mb-4" />
9+
<preset-selector class="mb-4" />
710
<position-selector class="mb-4" />
811
<advanced-selector class="mb-4" />
912
<steps-selector v-if="config?.advanced" class="mb-4" />
@@ -16,6 +19,12 @@
1619
<padding-level-selector v-if="config?.advanced" class="mb-4" />
1720
<padding-noise-selector v-if="config?.advanced" class="mb-4" />
1821
</div>
22+
<div class="h-12 px-4">
23+
<el-button type="primary" class="btn w-full" round @click="$emit('generate')">
24+
<font-awesome-icon icon="fa-solid fa-magic" class="mr-2" />
25+
{{ $t('qrart.button.generate') }}
26+
</el-button>
27+
</div>
1928
</div>
2029
</template>
2130

@@ -35,10 +44,17 @@ import PaddingLevelSelector from './config/PaddingLevelSelector.vue';
3544
import PaddingNoiseSelector from './config/PaddingNoiseSelector.vue';
3645
import PixelStyleSelector from './config/PixelStyleSelector.vue';
3746
import SeedInput from './config/SeedInput.vue';
47+
import PresetSelector from './config/PresetSelector2.vue';
48+
import ContentInput from './config/ContentInput.vue';
49+
import PromptInput from './config/PromptInput.vue';
50+
import { ElButton } from 'element-plus';
51+
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
3852
3953
export default defineComponent({
40-
name: 'PresetPanel',
54+
name: 'ConfigPanel',
4155
components: {
56+
ElButton,
57+
FontAwesomeIcon,
4258
TypeSelector,
4359
PositionSelector,
4460
PixelStyleSelector,
@@ -52,7 +68,10 @@ export default defineComponent({
5268
AdvancedSelector,
5369
MarkerShapeSelector,
5470
SubMarkerSelector,
55-
RotateSelector
71+
RotateSelector,
72+
PresetSelector,
73+
ContentInput,
74+
PromptInput
5675
},
5776
emits: ['generate'],
5877
computed: {
@@ -65,23 +84,6 @@ export default defineComponent({
6584
6685
<style lang="scss" scoped>
6786
.panel {
68-
height: 100%;
69-
padding: 15px;
70-
display: flex;
71-
flex-direction: column;
72-
.config {
73-
width: 100%;
74-
height: calc(100% - 50px);
75-
flex: 1;
76-
}
77-
.actions {
78-
height: 50px;
79-
display: flex;
80-
justify-content: center;
81-
align-items: center;
82-
.btn {
83-
width: 100%;
84-
}
85-
}
87+
border-right: 1px solid var(--el-border-color);
8688
}
8789
</style>

src/components/qrart/OperationPanel.vue

Lines changed: 0 additions & 77 deletions
This file was deleted.

src/components/qrart/config/ContentInput.vue

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
<template>
22
<div class="field">
3-
<h2 class="title">{{ $t('qrart.name.content') }}</h2>
4-
<el-radio-group v-model="inputWay" class="mb-4">
5-
<el-radio-button label="input">{{ $t('qrart.inputWay.input') }} </el-radio-button>
6-
<el-radio-button label="upload">{{ $t('qrart.inputWay.upload') }} </el-radio-button>
7-
</el-radio-group>
3+
<div class="flex justify-between items-center mb-4">
4+
<div>
5+
<span>{{ $t('qrart.name.content') }}</span>
6+
</div>
7+
<div class="flex items-center">
8+
<el-radio-group v-model="inputWay">
9+
<el-radio-button label="input">{{ $t('qrart.inputWay.input') }} </el-radio-button>
10+
<el-radio-button label="upload">{{ $t('qrart.inputWay.upload') }} </el-radio-button>
11+
</el-radio-group>
12+
</div>
13+
</div>
814
<el-input
915
v-if="inputWay == 'input'"
1016
v-model="value"
@@ -26,7 +32,7 @@
2632
:on-success="onSuccess"
2733
:headers="headers"
2834
>
29-
<el-button type="primary" round>{{ $t('qrart.button.uploadQr') }}</el-button>
35+
<el-button size="small" type="primary" round>{{ $t('qrart.button.uploadQr') }}</el-button>
3036
</el-upload>
3137
<p v-if="inputWay == 'upload'" class="description">
3238
{{ $t('qrart.message.uploadQr') }}

src/components/qrart/config/PresetSelector2.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,17 +194,15 @@ export default defineComponent({
194194
flex-direction: row;
195195
justify-content: left;
196196
align-items: center;
197-
flex-wrap: wrap;
198-
height: auto;
199197
max-height: 210px;
200198
overflow-y: scroll;
201199
202200
@media (max-width: 767px) {
203201
justify-content: center;
204202
}
205203
.item {
206-
$height: 100px;
207-
$width: 100px;
204+
$height: 60px;
205+
$width: 60px;
208206
position: relative;
209207
width: $width;
210208
height: $height;
@@ -214,7 +212,7 @@ export default defineComponent({
214212
border-style: solid;
215213
border-color: var(--el-border-color);
216214
border-radius: 5px;
217-
overflow: hidden;
215+
overflow: initial;
218216
cursor: pointer;
219217
220218
&.hidden {
@@ -226,8 +224,8 @@ export default defineComponent({
226224
}
227225
228226
.preview {
229-
width: $height;
230-
height: $width;
227+
width: $height - 8px;
228+
height: $width - 8px;
231229
}
232230
.name {
233231
position: absolute;

src/components/qrart/config/PromptInput.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
<template>
22
<div class="field">
33
<h2 class="title">{{ $t('qrart.name.prompt') }}</h2>
4-
<el-input v-model="value" :rows="3" type="textarea" class="prompt" :placeholder="$t('qrart.placeholder.prompt')" />
4+
<el-input
5+
v-model="value"
6+
:rows="3"
7+
type="textarea"
8+
class="prompt"
9+
:placeholder="$t('qrart.placeholder.prompt')"
10+
resize="none"
11+
/>
512
</div>
613
</template>
714

src/layouts/Qrart.vue

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ export default defineComponent({
4343
.config {
4444
width: 300px;
4545
height: 100%;
46-
overflow-y: scroll;
47-
border-right: 1px solid var(--el-border-color);
4846
}
4947
5048
.result {

src/pages/qrart/Index.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<layout>
33
<template #config>
4-
<config-panel />
4+
<config-panel @generate="onGenerate" />
55
</template>
66
<template #result>
77
<application-status
@@ -13,7 +13,6 @@
1313
@refresh="onGetApplication"
1414
/>
1515
<recent-panel class="panel recent" />
16-
<operation-panel class="panel operation" @generate="onGenerate" />
1716
</template>
1817
</layout>
1918
</template>
@@ -27,7 +26,6 @@ import { IApplicationDetailResponse, IQrartGenerateRequest, Status } from '@/mod
2726
import { ElMessage } from 'element-plus';
2827
import { ERROR_CODE_DUPLICATION, ERROR_CODE_USED_UP } from '@/constants';
2928
import ApplicationStatus from '@/components/application/Status.vue';
30-
import OperationPanel from '@/components/qrart/OperationPanel.vue';
3129
import RecentPanel from '@/components/qrart/RecentPanel.vue';
3230
import { IQrartTask } from '@/models';
3331
@@ -44,8 +42,7 @@ export default defineComponent({
4442
ConfigPanel,
4543
Layout,
4644
ApplicationStatus,
47-
RecentPanel,
48-
OperationPanel
45+
RecentPanel
4946
},
5047
data(): IData {
5148
return {

0 commit comments

Comments
 (0)