2021-08-13 16:50:03 +08:00
|
|
|
<template>
|
2022-01-25 19:41:28 +08:00
|
|
|
<q-dialog
|
|
|
|
persistent
|
|
|
|
v-model="show_dialog"
|
|
|
|
@before-hide="resetData"
|
|
|
|
@keydown="
|
|
|
|
(evt) => {
|
2022-03-19 16:29:53 +08:00
|
|
|
if (!loading && evt.keyCode == 27) {
|
2022-01-25 19:41:28 +08:00
|
|
|
show_dialog = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
"
|
|
|
|
>
|
2021-08-13 16:50:03 +08:00
|
|
|
<q-card class="overflow-hidden" style="overflow-y: scroll; max-width: 35vw">
|
|
|
|
<q-form @submit="onSubmit">
|
|
|
|
<q-card-section class="q-ma-none q-pa-sm">
|
|
|
|
<div class="row">
|
2021-08-17 17:17:51 +08:00
|
|
|
<div class="col-auto text-h6">
|
2021-08-13 16:50:03 +08:00
|
|
|
{{ $t("grid setting") }}
|
|
|
|
</div>
|
2021-08-17 17:17:51 +08:00
|
|
|
<q-space />
|
|
|
|
<div>
|
2021-08-13 16:50:03 +08:00
|
|
|
<q-btn
|
|
|
|
:loading="loading"
|
|
|
|
flat
|
|
|
|
round
|
|
|
|
icon="close"
|
|
|
|
color="red"
|
|
|
|
v-close-popup
|
|
|
|
>
|
|
|
|
<q-tooltip>
|
|
|
|
{{ $t("close") }}
|
|
|
|
</q-tooltip>
|
|
|
|
</q-btn>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</q-card-section>
|
|
|
|
|
|
|
|
<q-separator />
|
|
|
|
|
|
|
|
<q-card-section style="max-height: 50vh; width: 35vw" class="scroll">
|
|
|
|
<q-list>
|
|
|
|
<q-item>
|
|
|
|
<q-item-section>
|
|
|
|
<q-select
|
|
|
|
:label="$t('wall row')"
|
|
|
|
:hint="$t('please input') + $t('wall row') + ':'"
|
|
|
|
:options="select_options"
|
|
|
|
v-model="rows"
|
|
|
|
>
|
|
|
|
</q-select>
|
|
|
|
</q-item-section>
|
|
|
|
</q-item>
|
|
|
|
<q-item>
|
|
|
|
<q-item-section>
|
|
|
|
<q-select
|
|
|
|
:label="$t('wall col')"
|
|
|
|
:hint="$t('please input') + $t('wall col') + ':'"
|
|
|
|
:options="select_options"
|
|
|
|
v-model="cols"
|
|
|
|
>
|
|
|
|
</q-select>
|
|
|
|
</q-item-section>
|
|
|
|
</q-item>
|
|
|
|
</q-list>
|
|
|
|
</q-card-section>
|
|
|
|
|
|
|
|
<q-separator />
|
|
|
|
|
|
|
|
<q-card-actions align="right">
|
|
|
|
<q-btn
|
|
|
|
:loading="loading"
|
|
|
|
flat
|
|
|
|
:label="$t('Cancel')"
|
2022-07-04 14:20:00 +08:00
|
|
|
no-caps
|
2021-08-13 16:50:03 +08:00
|
|
|
color="primary"
|
|
|
|
v-close-popup
|
|
|
|
/>
|
|
|
|
<q-btn
|
|
|
|
ref="accept"
|
|
|
|
flat
|
|
|
|
:label="$t('Accept')"
|
2022-07-04 14:20:00 +08:00
|
|
|
no-caps
|
2021-08-13 16:50:03 +08:00
|
|
|
:loading="loading"
|
|
|
|
type="submit"
|
|
|
|
color="primary"
|
|
|
|
/>
|
|
|
|
</q-card-actions>
|
|
|
|
</q-form>
|
|
|
|
</q-card>
|
|
|
|
</q-dialog>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style scoped></style>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent, ref, watch, computed } from "vue";
|
|
|
|
import { useStore } from "src/store";
|
|
|
|
import { useQuasar } from "quasar";
|
|
|
|
import { useI18n } from "vue-i18n";
|
|
|
|
import GlobalData from "src/common/GlobalData";
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
name: "ComponentGridSettingDialog",
|
|
|
|
|
|
|
|
setup() {
|
|
|
|
let $store = useStore();
|
|
|
|
let $q = useQuasar();
|
|
|
|
let $t = useI18n();
|
|
|
|
|
|
|
|
let show_dialog = ref(false);
|
|
|
|
let loading = ref(false);
|
|
|
|
let rows = ref(1);
|
|
|
|
let cols = ref(1);
|
|
|
|
|
|
|
|
let select_options = [1, 2, 3, 4, 5, 6, 7, 8, 9];
|
|
|
|
|
|
|
|
return {
|
|
|
|
show_dialog,
|
|
|
|
loading,
|
|
|
|
rows,
|
|
|
|
cols,
|
|
|
|
select_options,
|
|
|
|
showDialog() {
|
|
|
|
show_dialog.value = true;
|
|
|
|
|
2022-07-04 14:20:00 +08:00
|
|
|
rows.value = parseInt(
|
|
|
|
(GlobalData.getInstance().applicationConfig?.wall_row ?? 1).toString()
|
|
|
|
);
|
|
|
|
cols.value = parseInt(
|
|
|
|
(GlobalData.getInstance().applicationConfig?.wall_col ?? 1).toString()
|
|
|
|
);
|
2021-08-13 16:50:03 +08:00
|
|
|
},
|
|
|
|
resetData() {
|
|
|
|
loading.value = false;
|
|
|
|
},
|
|
|
|
|
|
|
|
async onSubmit() {
|
|
|
|
loading.value = true;
|
|
|
|
try {
|
|
|
|
GlobalData.getInstance()
|
|
|
|
.getCurrentClient()
|
2021-12-17 16:55:13 +08:00
|
|
|
?.setWallRowCol(rows.value, cols.value);
|
2021-08-13 16:50:03 +08:00
|
|
|
show_dialog.value = false;
|
|
|
|
} catch {}
|
|
|
|
loading.value = false;
|
|
|
|
},
|
|
|
|
};
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|