special_video 改为自由设置宫格行列,增加窗口大小调整对话框
This commit is contained in:
parent
a41fd4dec0
commit
0ebd503dda
|
@ -44,9 +44,23 @@
|
||||||
<q-item>
|
<q-item>
|
||||||
<q-item-section>
|
<q-item-section>
|
||||||
<q-select
|
<q-select
|
||||||
:label="$t('layout')"
|
:label="$t('wall row')"
|
||||||
:options="select_options"
|
:options="[1, 2, 3, 4, 5, 6, 7, 8, 9]"
|
||||||
v-model="layout"
|
v-model="wall_row"
|
||||||
|
:error="has_error"
|
||||||
|
:error-message="error_message"
|
||||||
|
>
|
||||||
|
</q-select>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section>
|
||||||
|
<q-select
|
||||||
|
:label="$t('wall col')"
|
||||||
|
:options="[1, 2, 3, 4, 5, 6, 7, 8, 9]"
|
||||||
|
v-model="wall_col"
|
||||||
|
:error="has_error"
|
||||||
|
:error-message="error_message"
|
||||||
>
|
>
|
||||||
</q-select>
|
</q-select>
|
||||||
</q-item-section>
|
</q-item-section>
|
||||||
|
@ -109,31 +123,10 @@ export default defineComponent({
|
||||||
|
|
||||||
let show_dialog = ref(false);
|
let show_dialog = ref(false);
|
||||||
let loading = ref(false);
|
let loading = ref(false);
|
||||||
let layout = ref("1X3");
|
const wall_row = ref(1);
|
||||||
|
const wall_col = ref(4);
|
||||||
const row_values: number[] = [];
|
const has_error = ref(false);
|
||||||
const col_values: number[] = [];
|
const error_message = ref("");
|
||||||
const select_options: string[] = [];
|
|
||||||
|
|
||||||
// 生成布局选项
|
|
||||||
{
|
|
||||||
const target_row_col_values = [3, 4, 5, 6];
|
|
||||||
for (let i = 0; i < target_row_col_values.length; ++i) {
|
|
||||||
row_values.push(1);
|
|
||||||
col_values.push(target_row_col_values[i]);
|
|
||||||
select_options.push(row_values[i] + "X" + col_values[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (let i = 0; i < target_row_col_values.length; ++i) {
|
|
||||||
row_values.push(target_row_col_values[i]);
|
|
||||||
col_values.push(1);
|
|
||||||
select_options.push(
|
|
||||||
row_values[target_row_col_values.length + i] +
|
|
||||||
"X" +
|
|
||||||
col_values[target_row_col_values.length + i]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const rotation_options = ref(["0", "90", "180", "270"]);
|
const rotation_options = ref(["0", "90", "180", "270"]);
|
||||||
const rotation = ref("0");
|
const rotation = ref("0");
|
||||||
|
@ -142,37 +135,79 @@ export default defineComponent({
|
||||||
GlobalData.getInstance()?.applicationConfig
|
GlobalData.getInstance()?.applicationConfig
|
||||||
?.special_video_layout_rotation ?? "0";
|
?.special_video_layout_rotation ?? "0";
|
||||||
|
|
||||||
|
const check_wall_col_row = (
|
||||||
|
col: number,
|
||||||
|
row: number,
|
||||||
|
show_tooltip: boolean = true
|
||||||
|
) => {
|
||||||
|
if (col * row > 9) {
|
||||||
|
if (show_tooltip) {
|
||||||
|
const message =
|
||||||
|
$t.t("row multiply column should be less than or equal to ") +
|
||||||
|
9 +
|
||||||
|
"!";
|
||||||
|
|
||||||
|
$q.notify({
|
||||||
|
type: "warning",
|
||||||
|
message: message,
|
||||||
|
position: "top",
|
||||||
|
timeout: 2000,
|
||||||
|
});
|
||||||
|
has_error.value = true;
|
||||||
|
error_message.value = message;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => wall_row.value,
|
||||||
|
(nv, ov) => {
|
||||||
|
if (check_wall_col_row(wall_col.value, nv, false)) {
|
||||||
|
if (has_error.value) {
|
||||||
|
has_error.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => wall_col.value,
|
||||||
|
(nv, ov) => {
|
||||||
|
if (check_wall_col_row(nv, wall_row.value, false)) {
|
||||||
|
if (has_error.value) {
|
||||||
|
has_error.value = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
show_dialog,
|
show_dialog,
|
||||||
loading,
|
loading,
|
||||||
layout,
|
wall_row,
|
||||||
select_options,
|
wall_col,
|
||||||
rotation_options,
|
rotation_options,
|
||||||
rotation,
|
rotation,
|
||||||
|
has_error,
|
||||||
|
error_message,
|
||||||
|
|
||||||
showDialog() {
|
showDialog() {
|
||||||
show_dialog.value = true;
|
show_dialog.value = true;
|
||||||
|
|
||||||
let col = parseInt(
|
wall_col.value = parseInt(
|
||||||
(GlobalData.getInstance().applicationConfig?.wall_col ?? 1).toString()
|
(GlobalData.getInstance().applicationConfig?.wall_col ?? 1).toString()
|
||||||
);
|
);
|
||||||
if (isNaN(col)) {
|
if (isNaN(wall_col.value)) {
|
||||||
col = 1;
|
wall_col.value = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
let row = parseInt(
|
wall_row.value = parseInt(
|
||||||
(GlobalData.getInstance().applicationConfig?.wall_row ?? 4).toString()
|
(GlobalData.getInstance().applicationConfig?.wall_row ?? 4).toString()
|
||||||
);
|
);
|
||||||
if (isNaN(row)) {
|
if (isNaN(wall_row.value)) {
|
||||||
row = 4;
|
wall_row.value = 4;
|
||||||
}
|
|
||||||
|
|
||||||
layout.value = row + "X" + col;
|
|
||||||
const v = select_options.find(
|
|
||||||
(element) => element && element == layout.value
|
|
||||||
);
|
|
||||||
if (!v) {
|
|
||||||
layout.value = "1X4";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rotation.value =
|
rotation.value =
|
||||||
|
@ -186,12 +221,10 @@ export default defineComponent({
|
||||||
async onSubmit() {
|
async onSubmit() {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
try {
|
try {
|
||||||
const index = select_options.findIndex((e) => e && e == layout.value);
|
if (check_wall_col_row(wall_col.value, wall_row.value)) {
|
||||||
if (index != -1) {
|
|
||||||
// console.log(row_values[index] + "X" + col_values[index]);
|
|
||||||
GlobalData.getInstance()
|
GlobalData.getInstance()
|
||||||
.getCurrentClient()
|
.getCurrentClient()
|
||||||
?.setWallRowCol(row_values[index], col_values[index]);
|
?.setWallRowCol(wall_row.value, wall_col.value);
|
||||||
switch (rotation.value) {
|
switch (rotation.value) {
|
||||||
case "0":
|
case "0":
|
||||||
case "90":
|
case "90":
|
||||||
|
@ -207,9 +240,9 @@ export default defineComponent({
|
||||||
?.setSpecialVideoLayoutRotation("0");
|
?.setSpecialVideoLayoutRotation("0");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
show_dialog.value = false;
|
show_dialog.value = false;
|
||||||
|
}
|
||||||
} catch {}
|
} catch {}
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
},
|
},
|
||||||
|
|
|
@ -46,7 +46,6 @@
|
||||||
<q-item
|
<q-item
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
v-if="!$store.state.isSpecialVideo()"
|
|
||||||
:disable="$props.disable"
|
:disable="$props.disable"
|
||||||
@click="$emit('edit_rect', $props.window.window_id)"
|
@click="$emit('edit_rect', $props.window.window_id)"
|
||||||
>
|
>
|
||||||
|
|
|
@ -373,4 +373,6 @@ export default {
|
||||||
system: "System",
|
system: "System",
|
||||||
"clean browser cache command send success":
|
"clean browser cache command send success":
|
||||||
"Clean Browser Cache Command Send Success",
|
"Clean Browser Cache Command Send Success",
|
||||||
|
"row multiply column should be less than or equal to ":
|
||||||
|
"Row Multiply Column Should Be Less Than Or Equal To ",
|
||||||
};
|
};
|
||||||
|
|
|
@ -645,4 +645,6 @@ export default {
|
||||||
"clean browser cache": "清空浏览器缓存",
|
"clean browser cache": "清空浏览器缓存",
|
||||||
system: "系统",
|
system: "系统",
|
||||||
"clean browser cache command send success": "清除浏览器缓存指令发送成功",
|
"clean browser cache command send success": "清除浏览器缓存指令发送成功",
|
||||||
|
"row multiply column should be less than or equal to ":
|
||||||
|
"行乘以列的值不能大于",
|
||||||
};
|
};
|
||||||
|
|
|
@ -141,7 +141,6 @@
|
||||||
icon="img:pad/toolbar/edit_window_rect.png"
|
icon="img:pad/toolbar/edit_window_rect.png"
|
||||||
:label="$t('toolbar edit window rect')"
|
:label="$t('toolbar edit window rect')"
|
||||||
class="col-auto"
|
class="col-auto"
|
||||||
v-if="!$store.state.isSpecialVideo()"
|
|
||||||
@click="editRect"
|
@click="editRect"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,6 @@
|
||||||
stretch
|
stretch
|
||||||
no-caps
|
no-caps
|
||||||
flat
|
flat
|
||||||
v-if="!$store.state.isSpecialVideo()"
|
|
||||||
stack
|
stack
|
||||||
:disable="plan_running || !$store.state.power_state"
|
:disable="plan_running || !$store.state.power_state"
|
||||||
:icon="/*vertical_align_bottom*/ 'img:new_icon/edit_window_rect.png'"
|
:icon="/*vertical_align_bottom*/ 'img:new_icon/edit_window_rect.png'"
|
||||||
|
|
Loading…
Reference in New Issue