新增获取产品信息接口
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);
|
||||
$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 默认请求头
|
||||
{
|
||||
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>
|
||||
</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-card-section>
|
||||
</q-card>
|
||||
|
@ -107,6 +115,7 @@ import { useI18n } from "vue-i18n";
|
|||
|
||||
import version from "../../package.json";
|
||||
import GlobalData from "src/common/GlobalData";
|
||||
import { EProductNames } from "src/entities/ProductNames";
|
||||
|
||||
export default defineComponent({
|
||||
name: "ComponentAboutDialog",
|
||||
|
@ -120,6 +129,17 @@ export default defineComponent({
|
|||
let click_count = ref(0);
|
||||
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 server_version = ref("unknow");
|
||||
let server_commit_hash = ref("unknow");
|
||||
|
@ -139,6 +159,7 @@ export default defineComponent({
|
|||
server_branch_name,
|
||||
kernel_version,
|
||||
rootfs_version,
|
||||
product,
|
||||
|
||||
async showDialog() {
|
||||
click_count.value = 0;
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
:disable="loading"
|
||||
/>
|
||||
<q-tab
|
||||
v-if="$store.state.isLedPlayer()"
|
||||
name="graphics"
|
||||
no-caps
|
||||
icon="img:new_icon/graphics_setting.png"
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
<q-item
|
||||
clickable
|
||||
v-close-popup
|
||||
v-if="$store.state.isLedPlayer()"
|
||||
:disable="$props.disable"
|
||||
@click="$emit('edit_rect', $props.window.window_id)"
|
||||
>
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
<q-item-label>
|
||||
<span>{{ $t("desktop width") }}: </span>
|
||||
<span>
|
||||
{{ $store.state.device_screen_width }}
|
||||
{{ screen_width }}
|
||||
</span>
|
||||
<span>{{ $t("px") }}</span>
|
||||
</q-item-label>
|
||||
|
@ -54,7 +54,7 @@
|
|||
<q-item-label>
|
||||
<span>{{ $t("desktop height") }}: </span>
|
||||
<span>
|
||||
{{ $store.state.device_screen_height }}
|
||||
{{ screen_height }}
|
||||
</span>
|
||||
<span>{{ $t("px") }}</span>
|
||||
</q-item-label>
|
||||
|
@ -225,6 +225,7 @@ import { useStore } from "src/store";
|
|||
import { useQuasar } from "quasar";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import GlobalData from "src/common/GlobalData";
|
||||
import { SpecialVideoHelper } from "src/common/SpecialVideoHelper";
|
||||
|
||||
export default defineComponent({
|
||||
name: "ComponentWindowRectEditDialog",
|
||||
|
@ -237,6 +238,18 @@ export default defineComponent({
|
|||
let show_dialog = 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({
|
||||
x: 0,
|
||||
y: 0,
|
||||
|
@ -276,6 +289,8 @@ export default defineComponent({
|
|||
show_dialog,
|
||||
loading,
|
||||
window_rect,
|
||||
screen_height,
|
||||
screen_width,
|
||||
|
||||
showDialog() {
|
||||
throw "please use showDialogAsync function";
|
||||
|
@ -283,6 +298,19 @@ export default defineComponent({
|
|||
showDialogAsync(x: number, y: number, width: number, height: number) {
|
||||
return new Promise((resolve, reject) => {
|
||||
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.x = Math.round(x);
|
||||
window_rect.y = Math.round(y);
|
||||
|
|
|
@ -109,6 +109,7 @@
|
|||
/>
|
||||
|
||||
<q-btn
|
||||
v-if="$store.state.isLedPlayer()"
|
||||
stretch
|
||||
no-caps
|
||||
:disable="!$store.state.power_state"
|
||||
|
@ -145,6 +146,7 @@
|
|||
/>
|
||||
|
||||
<q-btn
|
||||
v-if="$store.state.isLedPlayer()"
|
||||
stretch
|
||||
no-caps
|
||||
flat
|
||||
|
|
|
@ -202,6 +202,7 @@ import FileManageDialog from "src/components/FileManageDialog.vue";
|
|||
import FileEntity from "src/entities/FileEntity";
|
||||
import { SignalSourceEntity } from "src/entities/SignalSourceEntity";
|
||||
import FileSuffixHelper from "src/common/FileSuffixHelper";
|
||||
import { SpecialVideoHelper } from "src/common/SpecialVideoHelper";
|
||||
|
||||
class Rect {
|
||||
start_x = 0;
|
||||
|
@ -289,17 +290,16 @@ export default defineComponent({
|
|||
wall?.value?.parentElement?.offsetWidth ?? 0 / wall_cols.value;
|
||||
if (wall.value && wall.value.parentElement) {
|
||||
if ($store.state.isSpecialVideo()) {
|
||||
const DESKTOP_WIDTH = 3840;
|
||||
const DESKTOP_HEIGHT = 2160;
|
||||
const desktp_row = Math.ceil(
|
||||
Math.sqrt(wall_rows.value * wall_cols.value)
|
||||
const screen_info = SpecialVideoHelper.getScreenInfo(
|
||||
wall_cols.value,
|
||||
wall_rows.value
|
||||
);
|
||||
const desktp_col = desktp_row;
|
||||
const unit_width = DESKTOP_WIDTH / desktp_col;
|
||||
const unit_height = DESKTOP_HEIGHT / desktp_row;
|
||||
const wv_scaler = unit_width / unit_height;
|
||||
|
||||
const wv_scaler = screen_info.unit_width / screen_info.unit_height;
|
||||
item_height.value =
|
||||
wall.value.parentElement.offsetWidth / wv_scaler / desktp_row;
|
||||
wall.value.parentElement.offsetWidth /
|
||||
wv_scaler /
|
||||
screen_info.desktop_col;
|
||||
} else {
|
||||
const wv_scaler =
|
||||
/*$store.state.device_screen_width / $store.state.device_screen_height*/ 1920 /
|
||||
|
@ -875,19 +875,28 @@ export default defineComponent({
|
|||
if (e.altKey) {
|
||||
if (window_rect_edit_dialog.value) {
|
||||
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 =
|
||||
await window_rect_edit_dialog.value.showDialogAsync(
|
||||
x * $store.state.device_screen_width,
|
||||
y * $store.state.device_screen_height,
|
||||
width * $store.state.device_screen_width,
|
||||
height * $store.state.device_screen_height
|
||||
x * screen_width,
|
||||
y * screen_height,
|
||||
width * screen_width,
|
||||
height * screen_height
|
||||
);
|
||||
if (result) {
|
||||
x = result.x / $store.state.device_screen_width;
|
||||
y = result.y / $store.state.device_screen_height;
|
||||
width = result.width / $store.state.device_screen_width;
|
||||
height =
|
||||
result.height / $store.state.device_screen_height;
|
||||
x = result.x / screen_width;
|
||||
y = result.y / screen_height;
|
||||
width = result.width / screen_width;
|
||||
height = result.height / screen_height;
|
||||
} else {
|
||||
// 点击了取消按钮
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue