PC网页适配SpecialVideo自动铺满宫格

This commit is contained in:
fangxiang 2022-09-27 17:24:00 +08:00
parent 05d932586c
commit 56e3180c32
2 changed files with 14 additions and 20 deletions

View File

@ -32,8 +32,7 @@
:y="
$refs.wall?.parentElement?.offsetTop +
$refs.wall_content?.offsetTop +
item.y * wall_content_client_height +
$store.state.wall_row / ($store.state.landspace ? 2 : 1)
item.y * wall_content_client_height
"
:zIndex="
1 +
@ -77,6 +76,7 @@
</div>
<div
v-show="$store.state.power_state"
id="wall_grids"
ref="wall_grids"
@touchstart="$store.commit('setSelectedWindow', '')"
>
@ -579,15 +579,7 @@ export default defineComponent({
rect.height = rect.height ?? 0;
rect.left = rect.left ?? 0;
rect.top = rect.top ?? 0;
// moveWindow(window_id, evt);
if (wall.value) {
// GlobalData.getInstance()
// .getCurrentClient()
// ?.resizeWindow(
// window_id,
// evt.width / wall.value.clientWidth,
// evt.height / wall.value.clientHeight
// );
const x =
rect.left -
(wall.value.parentElement?.offsetLeft ?? 0) -

View File

@ -15,17 +15,17 @@
v-if="$store.state.power_state && show_windows_flag"
>
<vue3-resize-drag
:w="item.width * ($refs.wall?.clientWidth ?? 0)"
:h="item.height * ($refs.wall?.clientHeight ?? 0)"
:w="item.width * ($refs.wall?.offsetWidth ?? 0)"
:h="item.height * ($refs.wall?.offsetHeight ?? 0)"
:x="
($refs.wall?.parentElement?.offsetLeft ?? 0) +
($refs.wall?.offsetLeft ?? 0) +
item.x * ($refs.wall?.clientWidth ?? 0)
item.x * ($refs.wall?.offsetWidth ?? 0)
"
:y="
($refs.wall?.parentElement?.offsetTop ?? 0) +
($refs.wall?.offsetTop ?? 0) +
item.y * ($refs.wall?.clientHeight ?? 0)
item.y * ($refs.wall?.offsetHeight ?? 0)
"
:zIndex="
$store.state.windows_sort.findIndex((element) => element == item.uuid)
@ -68,6 +68,7 @@
</vue3-resize-drag>
</div>
<div
id="wall_grids"
ref="wall_grids"
@click="onWallGridsClick"
v-if="$store.state.power_state"
@ -286,8 +287,9 @@ export default defineComponent({
const item_height = ref(0);
const calcWallItemWH = () => {
item_witdh.value =
wall?.value?.parentElement?.offsetWidth ?? 0 / wall_cols.value;
item_witdh.value = Math.floor(
(wall?.value?.parentElement?.offsetWidth ?? 0) / wall_cols.value
);
if (wall.value && wall.value.parentElement) {
if ($store.state.isSpecialVideo()) {
const screen_info = SpecialVideoHelper.getScreenInfo(
@ -319,9 +321,9 @@ export default defineComponent({
}
item_witdh.value =
Math.ceil(item_witdh.value + wall_cols.value) & ~wall_cols.value;
Math.ceil(item_witdh.value - wall_cols.value) & ~wall_cols.value;
item_height.value =
Math.ceil(item_height.value + wall_rows.value) & ~wall_rows.value;
Math.ceil(item_height.value - wall_rows.value) & ~wall_rows.value;
};
const wallMouseDown = (evt: MouseEvent) => {
@ -739,9 +741,9 @@ export default defineComponent({
.getCurrentClient()
?.setWindowGeometry(
window_id,
x / wall.value.clientWidth,
x / wall.value.offsetWidth,
y / wall.value.clientHeight,
rect.width / wall.value.clientWidth,
rect.width / wall.value.offsetWidth,
rect.height / wall.value.clientHeight
);
}