新增获取产品信息接口
SpecialVideo隐藏窗口大小调整按钮和字幕按钮 SpecialVideo修复按ALT开窗时显示的桌面分辨率错误的BUG
This commit is contained in:
parent
6a611eaa3b
commit
cbbb812212
11
src/App.vue
11
src/App.vue
|
@ -56,6 +56,17 @@ export default defineComponent({
|
||||||
console.log((<any>window).media_control_client_product);
|
console.log((<any>window).media_control_client_product);
|
||||||
$store.commit("setProductName", (<any>window).media_control_client_product);
|
$store.commit("setProductName", (<any>window).media_control_client_product);
|
||||||
|
|
||||||
|
// 设置标题
|
||||||
|
if (
|
||||||
|
(<any>window).media_control_client_product == EProductNames.LED_PLAYER
|
||||||
|
) {
|
||||||
|
document.title = $t.t("LedPlayer") + "WebApp";
|
||||||
|
} else if (
|
||||||
|
(<any>window).media_control_client_product == EProductNames.SPECIAL_VIDEO
|
||||||
|
) {
|
||||||
|
document.title = $t.t("SpecialVideo") + "WebApp";
|
||||||
|
}
|
||||||
|
|
||||||
// 设置 AXIOS 默认请求头
|
// 设置 AXIOS 默认请求头
|
||||||
{
|
{
|
||||||
api.defaults.headers.common["X-Product-Name"] = (<any>(
|
api.defaults.headers.common["X-Product-Name"] = (<any>(
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
export interface IScreenInfo {
|
||||||
|
screen_width: number;
|
||||||
|
screen_height: number;
|
||||||
|
unit_width: number;
|
||||||
|
unit_height: number;
|
||||||
|
wall_rows: number;
|
||||||
|
wall_cols: number;
|
||||||
|
desktop_col: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class SpecialVideoHelper {
|
||||||
|
private static kScreenWidth = 3840;
|
||||||
|
private static kScreenHeight = 2160;
|
||||||
|
|
||||||
|
public static getScreenInfo(
|
||||||
|
wall_cols: number,
|
||||||
|
wall_rows: number
|
||||||
|
): IScreenInfo {
|
||||||
|
const desktp_row = Math.ceil(Math.sqrt(wall_rows * wall_cols));
|
||||||
|
const desktop_col = desktp_row;
|
||||||
|
const unit_width = SpecialVideoHelper.kScreenWidth / desktop_col;
|
||||||
|
const unit_height = SpecialVideoHelper.kScreenHeight / desktp_row;
|
||||||
|
const screen_width = wall_cols * unit_width;
|
||||||
|
const screen_height = wall_rows * unit_height;
|
||||||
|
console.log(screen_width);
|
||||||
|
return {
|
||||||
|
screen_width,
|
||||||
|
screen_height,
|
||||||
|
unit_width,
|
||||||
|
unit_height,
|
||||||
|
wall_rows,
|
||||||
|
wall_cols,
|
||||||
|
desktop_col,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -91,6 +91,14 @@
|
||||||
>
|
>
|
||||||
</q-item>
|
</q-item>
|
||||||
</div>
|
</div>
|
||||||
|
<q-item>
|
||||||
|
<q-item-section></q-item-section>
|
||||||
|
<q-item-section>
|
||||||
|
<div class="fit text-right">
|
||||||
|
{{ product }}
|
||||||
|
</div>
|
||||||
|
</q-item-section>
|
||||||
|
</q-item>
|
||||||
</q-list>
|
</q-list>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
@ -107,6 +115,7 @@ import { useI18n } from "vue-i18n";
|
||||||
|
|
||||||
import version from "../../package.json";
|
import version from "../../package.json";
|
||||||
import GlobalData from "src/common/GlobalData";
|
import GlobalData from "src/common/GlobalData";
|
||||||
|
import { EProductNames } from "src/entities/ProductNames";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "ComponentAboutDialog",
|
name: "ComponentAboutDialog",
|
||||||
|
@ -120,6 +129,17 @@ export default defineComponent({
|
||||||
let click_count = ref(0);
|
let click_count = ref(0);
|
||||||
const target_click_count = ref(30);
|
const target_click_count = ref(30);
|
||||||
|
|
||||||
|
const product = ref("");
|
||||||
|
if (
|
||||||
|
(<any>window).media_control_client_product == EProductNames.LED_PLAYER
|
||||||
|
) {
|
||||||
|
product.value = "LedPlayer";
|
||||||
|
} else if (
|
||||||
|
(<any>window).media_control_client_product == EProductNames.SPECIAL_VIDEO
|
||||||
|
) {
|
||||||
|
product.value = "SpecialVideo";
|
||||||
|
}
|
||||||
|
|
||||||
let client_version = ref(version);
|
let client_version = ref(version);
|
||||||
let server_version = ref("unknow");
|
let server_version = ref("unknow");
|
||||||
let server_commit_hash = ref("unknow");
|
let server_commit_hash = ref("unknow");
|
||||||
|
@ -139,6 +159,7 @@ export default defineComponent({
|
||||||
server_branch_name,
|
server_branch_name,
|
||||||
kernel_version,
|
kernel_version,
|
||||||
rootfs_version,
|
rootfs_version,
|
||||||
|
product,
|
||||||
|
|
||||||
async showDialog() {
|
async showDialog() {
|
||||||
click_count.value = 0;
|
click_count.value = 0;
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
:disable="loading"
|
:disable="loading"
|
||||||
/>
|
/>
|
||||||
<q-tab
|
<q-tab
|
||||||
|
v-if="$store.state.isLedPlayer()"
|
||||||
name="graphics"
|
name="graphics"
|
||||||
no-caps
|
no-caps
|
||||||
icon="img:new_icon/graphics_setting.png"
|
icon="img:new_icon/graphics_setting.png"
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
<q-item
|
<q-item
|
||||||
clickable
|
clickable
|
||||||
v-close-popup
|
v-close-popup
|
||||||
|
v-if="$store.state.isLedPlayer()"
|
||||||
:disable="$props.disable"
|
:disable="$props.disable"
|
||||||
@click="$emit('edit_rect', $props.window.window_id)"
|
@click="$emit('edit_rect', $props.window.window_id)"
|
||||||
>
|
>
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
<q-item-label>
|
<q-item-label>
|
||||||
<span>{{ $t("desktop width") }}: </span>
|
<span>{{ $t("desktop width") }}: </span>
|
||||||
<span>
|
<span>
|
||||||
{{ $store.state.device_screen_width }}
|
{{ screen_width }}
|
||||||
</span>
|
</span>
|
||||||
<span>{{ $t("px") }}</span>
|
<span>{{ $t("px") }}</span>
|
||||||
</q-item-label>
|
</q-item-label>
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
<q-item-label>
|
<q-item-label>
|
||||||
<span>{{ $t("desktop height") }}: </span>
|
<span>{{ $t("desktop height") }}: </span>
|
||||||
<span>
|
<span>
|
||||||
{{ $store.state.device_screen_height }}
|
{{ screen_height }}
|
||||||
</span>
|
</span>
|
||||||
<span>{{ $t("px") }}</span>
|
<span>{{ $t("px") }}</span>
|
||||||
</q-item-label>
|
</q-item-label>
|
||||||
|
@ -225,6 +225,7 @@ import { useStore } from "src/store";
|
||||||
import { useQuasar } from "quasar";
|
import { useQuasar } from "quasar";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import GlobalData from "src/common/GlobalData";
|
import GlobalData from "src/common/GlobalData";
|
||||||
|
import { SpecialVideoHelper } from "src/common/SpecialVideoHelper";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "ComponentWindowRectEditDialog",
|
name: "ComponentWindowRectEditDialog",
|
||||||
|
@ -237,6 +238,18 @@ export default defineComponent({
|
||||||
let show_dialog = ref(false);
|
let show_dialog = ref(false);
|
||||||
let loading = ref(false);
|
let loading = ref(false);
|
||||||
|
|
||||||
|
const screen_width = ref($store.state.device_screen_width);
|
||||||
|
const screen_height = ref($store.state.device_screen_height);
|
||||||
|
|
||||||
|
if ($store.state.isSpecialVideo()) {
|
||||||
|
const screen_info = SpecialVideoHelper.getScreenInfo(
|
||||||
|
$store.state.wall_col,
|
||||||
|
$store.state.wall_row
|
||||||
|
);
|
||||||
|
screen_width.value = screen_info.screen_width;
|
||||||
|
screen_height.value = screen_info.screen_height;
|
||||||
|
}
|
||||||
|
|
||||||
const window_rect = reactive({
|
const window_rect = reactive({
|
||||||
x: 0,
|
x: 0,
|
||||||
y: 0,
|
y: 0,
|
||||||
|
@ -276,6 +289,8 @@ export default defineComponent({
|
||||||
show_dialog,
|
show_dialog,
|
||||||
loading,
|
loading,
|
||||||
window_rect,
|
window_rect,
|
||||||
|
screen_height,
|
||||||
|
screen_width,
|
||||||
|
|
||||||
showDialog() {
|
showDialog() {
|
||||||
throw "please use showDialogAsync function";
|
throw "please use showDialogAsync function";
|
||||||
|
@ -283,6 +298,19 @@ export default defineComponent({
|
||||||
showDialogAsync(x: number, y: number, width: number, height: number) {
|
showDialogAsync(x: number, y: number, width: number, height: number) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
clean_promise();
|
clean_promise();
|
||||||
|
|
||||||
|
screen_width.value = $store.state.device_screen_width;
|
||||||
|
screen_height.value = $store.state.device_screen_height;
|
||||||
|
|
||||||
|
if ($store.state.isSpecialVideo()) {
|
||||||
|
const screen_info = SpecialVideoHelper.getScreenInfo(
|
||||||
|
$store.state.wall_col,
|
||||||
|
$store.state.wall_row
|
||||||
|
);
|
||||||
|
screen_width.value = screen_info.screen_width;
|
||||||
|
screen_height.value = screen_info.screen_height;
|
||||||
|
}
|
||||||
|
|
||||||
window_rect.clean();
|
window_rect.clean();
|
||||||
window_rect.x = Math.round(x);
|
window_rect.x = Math.round(x);
|
||||||
window_rect.y = Math.round(y);
|
window_rect.y = Math.round(y);
|
||||||
|
|
|
@ -109,6 +109,7 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="$store.state.isLedPlayer()"
|
||||||
stretch
|
stretch
|
||||||
no-caps
|
no-caps
|
||||||
:disable="!$store.state.power_state"
|
:disable="!$store.state.power_state"
|
||||||
|
@ -145,6 +146,7 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<q-btn
|
<q-btn
|
||||||
|
v-if="$store.state.isLedPlayer()"
|
||||||
stretch
|
stretch
|
||||||
no-caps
|
no-caps
|
||||||
flat
|
flat
|
||||||
|
|
|
@ -202,6 +202,7 @@ import FileManageDialog from "src/components/FileManageDialog.vue";
|
||||||
import FileEntity from "src/entities/FileEntity";
|
import FileEntity from "src/entities/FileEntity";
|
||||||
import { SignalSourceEntity } from "src/entities/SignalSourceEntity";
|
import { SignalSourceEntity } from "src/entities/SignalSourceEntity";
|
||||||
import FileSuffixHelper from "src/common/FileSuffixHelper";
|
import FileSuffixHelper from "src/common/FileSuffixHelper";
|
||||||
|
import { SpecialVideoHelper } from "src/common/SpecialVideoHelper";
|
||||||
|
|
||||||
class Rect {
|
class Rect {
|
||||||
start_x = 0;
|
start_x = 0;
|
||||||
|
@ -289,17 +290,16 @@ export default defineComponent({
|
||||||
wall?.value?.parentElement?.offsetWidth ?? 0 / wall_cols.value;
|
wall?.value?.parentElement?.offsetWidth ?? 0 / wall_cols.value;
|
||||||
if (wall.value && wall.value.parentElement) {
|
if (wall.value && wall.value.parentElement) {
|
||||||
if ($store.state.isSpecialVideo()) {
|
if ($store.state.isSpecialVideo()) {
|
||||||
const DESKTOP_WIDTH = 3840;
|
const screen_info = SpecialVideoHelper.getScreenInfo(
|
||||||
const DESKTOP_HEIGHT = 2160;
|
wall_cols.value,
|
||||||
const desktp_row = Math.ceil(
|
wall_rows.value
|
||||||
Math.sqrt(wall_rows.value * wall_cols.value)
|
|
||||||
);
|
);
|
||||||
const desktp_col = desktp_row;
|
|
||||||
const unit_width = DESKTOP_WIDTH / desktp_col;
|
const wv_scaler = screen_info.unit_width / screen_info.unit_height;
|
||||||
const unit_height = DESKTOP_HEIGHT / desktp_row;
|
|
||||||
const wv_scaler = unit_width / unit_height;
|
|
||||||
item_height.value =
|
item_height.value =
|
||||||
wall.value.parentElement.offsetWidth / wv_scaler / desktp_row;
|
wall.value.parentElement.offsetWidth /
|
||||||
|
wv_scaler /
|
||||||
|
screen_info.desktop_col;
|
||||||
} else {
|
} else {
|
||||||
const wv_scaler =
|
const wv_scaler =
|
||||||
/*$store.state.device_screen_width / $store.state.device_screen_height*/ 1920 /
|
/*$store.state.device_screen_width / $store.state.device_screen_height*/ 1920 /
|
||||||
|
@ -875,19 +875,28 @@ export default defineComponent({
|
||||||
if (e.altKey) {
|
if (e.altKey) {
|
||||||
if (window_rect_edit_dialog.value) {
|
if (window_rect_edit_dialog.value) {
|
||||||
try {
|
try {
|
||||||
|
let screen_width = $store.state.device_screen_width;
|
||||||
|
let screen_height = $store.state.device_screen_height;
|
||||||
|
if ($store.state.isSpecialVideo()) {
|
||||||
|
const screen_info = SpecialVideoHelper.getScreenInfo(
|
||||||
|
$store.state.wall_col,
|
||||||
|
$store.state.wall_row
|
||||||
|
);
|
||||||
|
screen_width = screen_info.screen_width;
|
||||||
|
screen_height = screen_info.screen_height;
|
||||||
|
}
|
||||||
const result =
|
const result =
|
||||||
await window_rect_edit_dialog.value.showDialogAsync(
|
await window_rect_edit_dialog.value.showDialogAsync(
|
||||||
x * $store.state.device_screen_width,
|
x * screen_width,
|
||||||
y * $store.state.device_screen_height,
|
y * screen_height,
|
||||||
width * $store.state.device_screen_width,
|
width * screen_width,
|
||||||
height * $store.state.device_screen_height
|
height * screen_height
|
||||||
);
|
);
|
||||||
if (result) {
|
if (result) {
|
||||||
x = result.x / $store.state.device_screen_width;
|
x = result.x / screen_width;
|
||||||
y = result.y / $store.state.device_screen_height;
|
y = result.y / screen_height;
|
||||||
width = result.width / $store.state.device_screen_width;
|
width = result.width / screen_width;
|
||||||
height =
|
height = result.height / screen_height;
|
||||||
result.height / $store.state.device_screen_height;
|
|
||||||
} else {
|
} else {
|
||||||
// 点击了取消按钮
|
// 点击了取消按钮
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue