| | |
| | | return bestFit;
|
| | | };
|
| | |
|
| | | const isSelected = (layoutIndex, rectIndex) => {
|
| | | return focusIndex.value &&
|
| | | focusIndex.value.layoutIndex === layoutIndex &&
|
| | | focusIndex.value.rectIndex === rectIndex;
|
| | | };
|
| | |
|
| | | //版图内容样式加载
|
| | | const layoutContainerStyle = (layoutIndex) => {
|
| | | const layout = layouts.value[layoutIndex];
|
| | |
| | | //版图内容小片样式加载
|
| | | const rectStyle = (glassDetail, layoutIndex) => {
|
| | | const layout = layouts.value[layoutIndex];
|
| | | const scale = Math.min(0.25
|
| | | );
|
| | | return {
|
| | | const scale = Math.min(0.25);
|
| | | const isSelectedRect = isSelected(layoutIndex, layout.glassDetails.indexOf(glassDetail));
|
| | |
|
| | | let style = {
|
| | | position: 'absolute',
|
| | | left: `${glassDetail.x * scale}px`,
|
| | | top: `${glassDetail.y * scale}px`,
|
| | |
| | | draggable: !glassDetail.isRemain,
|
| | | zIndex: glassDetail.isRemain ? 1 : 2
|
| | | };
|
| | |
|
| | | // 如果被选中,则添加内侧红框
|
| | | if (isSelectedRect) {
|
| | | style.boxShadow = 'inset 0 0 0 2px red';
|
| | | }
|
| | |
|
| | | return style;
|
| | | };
|
| | |
|
| | | const rectStyle1 = (glassDetail, layoutIndex) => {
|
| | | const layout = layouts.value[layoutIndex];
|
| | | const scale = Math.min(0.25
|
| | | );
|
| | | return {
|
| | | const scale = Math.min(0.25);
|
| | | const isSelectedRect = isSelected(layoutIndex, layout.glassDetails.indexOf(glassDetail));
|
| | |
|
| | | let style = {
|
| | | position: 'absolute',
|
| | | left: `${glassDetail.x * scale}px`,
|
| | | top: `${glassDetail.y * scale}px`,
|
| | |
| | | draggable: !glassDetail.isRemain,
|
| | | zIndex: glassDetail.isRemain ? 1 : 2
|
| | | };
|
| | |
|
| | | // 如果被选中,则添加内侧红框
|
| | | if (isSelectedRect) {
|
| | | style.boxShadow = 'inset 0 0 0 2px red';
|
| | | }
|
| | |
|
| | | return style;
|
| | | };
|
| | |
|
| | | //点击小片
|