优化列表排序弹窗界面

pull/392/head
lyswhut 2020-12-24 14:27:44 +08:00
parent a58d65e8af
commit 94c25b5dcb
2 changed files with 24 additions and 6 deletions

View File

@ -2,8 +2,9 @@
material-modal(:show="show" @close="handleClose") material-modal(:show="show" @close="handleClose")
main(:class="$style.main") main(:class="$style.main")
h2 {{selectedNum > 0 ? $t('material.list_sort_modal.title_multiple', { num: selectedNum }) : $t('material.list_sort_modal.title', { name: musicInfo ? musicInfo.name : '' })}} h2 {{selectedNum > 0 ? $t('material.list_sort_modal.title_multiple', { num: selectedNum }) : $t('material.list_sort_modal.title', { name: musicInfo ? musicInfo.name : '' })}}
material-input(:class="$style.input" type="number" v-model="sortNum" ref="input" :placeholder="$t('material.list_sort_modal.input_tip')" @keydown.native.enter="handleSubmit") material-input(:class="$style.input" type="number" v-model="sortNum" ref="input" @blur.native="verify" :placeholder="$t('material.list_sort_modal.input_tip')" @keydown.native.enter="handleSubmit")
material-btn(:class="$style.btn" @click="handleSubmit") {{$t('material.list_sort_modal.btn_confirm')}} div(:class="$style.footer")
material-btn(:class="$style.btn" @click="handleSubmit") {{$t('material.list_sort_modal.btn_confirm')}}
</template> </template>
<script> <script>
@ -46,10 +47,14 @@ export default {
handleClose() { handleClose() {
this.$emit('close') this.$emit('close')
}, },
handleSubmit() { verify() {
let num = /^[1-9]\d*/.exec(this.sortNum) let num = /^[1-9]\d*/.exec(this.sortNum)
num = num ? parseInt(num[0]) : '' num = num ? parseInt(num[0]) : ''
this.sortNum = num.toString() this.sortNum = num.toString()
return num
},
handleSubmit() {
let num = this.verify()
if (this.sortNum == '') return if (this.sortNum == '') return
this.$emit('confirm', num) this.$emit('confirm', num)
}, },
@ -64,7 +69,7 @@ export default {
.main { .main {
padding: 0 15px; padding: 0 15px;
max-width: 530px; max-width: 530px;
min-width: 320px; min-width: 280px;
display: flex; display: flex;
flex-flow: column nowrap; flex-flow: column nowrap;
min-height: 0; min-height: 0;
@ -74,6 +79,7 @@ export default {
font-size: 13px; font-size: 13px;
color: @color-theme_2-font; color: @color-theme_2-font;
line-height: 1.3; line-height: 1.3;
word-break: break-all;
// text-align: center; // text-align: center;
padding: 15px 0 8px; padding: 15px 0 8px;
} }
@ -84,16 +90,22 @@ export default {
// height: 26px; // height: 26px;
padding: 8px 8px; padding: 8px 8px;
} }
.footer {
margin: 20px 0 15px auto;
}
.btn { .btn {
margin: 20px auto 15px;
// box-sizing: border-box; // box-sizing: border-box;
// margin-left: 15px; // margin-left: 15px;
// margin-bottom: 15px; // margin-bottom: 15px;
// height: 36px; // height: 36px;
// line-height: 36px; // line-height: 36px;
// padding: 0 10px !important; // padding: 0 10px !important;
min-width: 100px; min-width: 70px;
// .mixin-ellipsis-1; // .mixin-ellipsis-1;
+.btn {
margin-left: 10px;
}
} }
each(@themes, { each(@themes, {

View File

@ -288,6 +288,12 @@ export default {
this.handleDelayShow() this.handleDelayShow()
}) })
}) })
this.isShowDownload = false
this.isShowDownloadMultiple = false
this.isShowListAdd = false
this.isShowListAddMultiple = false
this.isShowListSortModal = false
this.listMenu.isShowItemMenu = false
next() next()
}, },
// mounted() { // mounted() {