|
@@ -1,11 +1,11 @@
|
|
|
import { IconAdd, IconMove } from "@/assets/icons";
|
|
|
+import { CompObject } from "@/modules/editor/controllers/SelectCtrl/compObj";
|
|
|
import { css } from "@linaria/core";
|
|
|
import { IconDelete } from "@queenjs/icons";
|
|
|
-import { defineComponent , onMounted, ref} from "vue";
|
|
|
+import { defineComponent, onMounted, ref } from "vue";
|
|
|
import { string } from "vue-types";
|
|
|
import { useEditor } from "../../..";
|
|
|
import { useCompRef } from "./hooks";
|
|
|
-import { CompObject } from "@/modules/editor/controllers/SelectCtrl/compObj";
|
|
|
|
|
|
export const View = defineComponent({
|
|
|
props: {
|
|
@@ -21,7 +21,7 @@ export const View = defineComponent({
|
|
|
if (!comp) return store.isEditMode ? <div>无效组件</div> : null;
|
|
|
const isStreamCard = helper.isStreamCard(props.compId);
|
|
|
const isGroupComp = helper.isGroupComp(props.compId);
|
|
|
- const obj =new CompObject(store.compMap[props.compId])
|
|
|
+ const obj = new CompObject(store.compMap[props.compId]);
|
|
|
const m = obj.worldTransform.clone();
|
|
|
m.invert();
|
|
|
|
|
@@ -32,7 +32,7 @@ export const View = defineComponent({
|
|
|
viewStyle,
|
|
|
store.isEditMode && editCompStyle,
|
|
|
isGroupComp && groupCompCls,
|
|
|
- store.currStreamCardId == props.compId && CurrCompStyle
|
|
|
+ store.currStreamCardId == props.compId && CurrCompStyle,
|
|
|
]}
|
|
|
style={helper.createStyle(comp.layout)}
|
|
|
onClick={(e) => {
|
|
@@ -63,12 +63,9 @@ export const View = defineComponent({
|
|
|
actions.pickComp(props.compId);
|
|
|
}}
|
|
|
>
|
|
|
-
|
|
|
{slots.default?.()}
|
|
|
</div>
|
|
|
- {
|
|
|
- store.isEditMode && isStreamCard && <Hudop compId={props.compId} />
|
|
|
- }
|
|
|
+ {store.isEditMode && isStreamCard && <Hudop compId={props.compId} />}
|
|
|
</div>
|
|
|
);
|
|
|
};
|
|
@@ -82,31 +79,39 @@ export const Hudop = defineComponent({
|
|
|
setup(props) {
|
|
|
const { store, actions, helper, controls } = useEditor();
|
|
|
|
|
|
- const opref= ref();
|
|
|
- onMounted(()=>{
|
|
|
- opref.value.editable = "hudop";
|
|
|
- })
|
|
|
- return ()=>(
|
|
|
- <div class="hudop" ref={opref}>
|
|
|
- {store.streamCardIds.length > 1 && (
|
|
|
- <IconMove class="draganchor" />
|
|
|
- )}
|
|
|
- {store.streamCardIds.length > 1 && (
|
|
|
- <IconDelete
|
|
|
- onClick={() => actions.removeStreamCard(props.compId)}
|
|
|
- />
|
|
|
- )}
|
|
|
- <IconAdd
|
|
|
- onClick={() => {
|
|
|
- const index = store.streamCardIds.indexOf(props.compId) + 1;
|
|
|
- actions.addCompToDesign("Container", index);
|
|
|
+ const opref = ref();
|
|
|
|
|
|
- }}
|
|
|
- />
|
|
|
- </div>
|
|
|
- )
|
|
|
- }
|
|
|
-})
|
|
|
+ onMounted(() => {
|
|
|
+ opref.value.editable = "hudop";
|
|
|
+ });
|
|
|
+
|
|
|
+ return () => (
|
|
|
+ <div class="hudop" ref={opref}>
|
|
|
+ {store.streamCardIds.length > 1 && (
|
|
|
+ <IconMove
|
|
|
+ class="draganchor"
|
|
|
+ onMousedown={() => actions.pickComp(props.compId)}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ {store.streamCardIds.length > 1 && (
|
|
|
+ <IconDelete
|
|
|
+ onClick={(e: any) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ actions.removeStreamCard(props.compId);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ <IconAdd
|
|
|
+ onClick={(e: any) => {
|
|
|
+ e.stopPropagation();
|
|
|
+ const index = store.streamCardIds.indexOf(props.compId) + 1;
|
|
|
+ actions.addCompToDesign("Container", index);
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ },
|
|
|
+});
|
|
|
|
|
|
const viewStyle = css`
|
|
|
position: relative;
|
|
@@ -133,7 +138,7 @@ const viewStyle = css`
|
|
|
.inficon {
|
|
|
padding: 8px;
|
|
|
}
|
|
|
- z-index: 1000;
|
|
|
+ z-index: 999;
|
|
|
}
|
|
|
`;
|
|
|
|
|
@@ -143,11 +148,12 @@ const editCompStyle = css`
|
|
|
}
|
|
|
`;
|
|
|
|
|
|
-
|
|
|
const CurrCompStyle = css`
|
|
|
+ position: relative;
|
|
|
outline: 1px solid @inf-primary-color;
|
|
|
box-shadow: 0 0 0 3000px rgba(0, 0, 0, 0.5);
|
|
|
-`
|
|
|
+ z-index: 998;
|
|
|
+`;
|
|
|
|
|
|
const groupCompCls = css`
|
|
|
outline: 2px solid @inf-primary-color !important;
|