|
@@ -1,4 +1,4 @@
|
|
|
-import { useCollocation } from "@/modules/collocation";
|
|
|
+import { useMatch } from "@/modules/match";
|
|
|
import { useQueditor } from "@queenjs-modules/queditor";
|
|
|
import { List } from "@queenjs/ui";
|
|
|
import { queenApi } from "queenjs";
|
|
@@ -10,7 +10,7 @@ import MatItem from "./MatItem";
|
|
|
export default defineComponent({
|
|
|
setup() {
|
|
|
const queditor = useQueditor();
|
|
|
- const collocation = useCollocation();
|
|
|
+ const match = useMatch();
|
|
|
|
|
|
queditor.controls.drager.on(
|
|
|
"drop:selfDrop",
|
|
@@ -54,7 +54,7 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
function findmatsGroup(target: MatsMatchComp) {
|
|
|
- const currGroup = collocation.store.menuOptions.sourceData.mat.find(
|
|
|
+ const currGroup = match.store.menuOptions.sourceData.mat.find(
|
|
|
(r: MatsMatchComp) =>
|
|
|
r.name == target.name && r.productId == target.productId
|
|
|
);
|
|
@@ -64,13 +64,13 @@ export default defineComponent({
|
|
|
const handleChange = (key: string, matsGroup: MatsMatchComp) => {
|
|
|
switch (key) {
|
|
|
case "rename":
|
|
|
- collocation.actions.renameMatGroup();
|
|
|
+ match.actions.renameMatGroup();
|
|
|
break;
|
|
|
case "lock":
|
|
|
- collocation.actions.lockMatGroup();
|
|
|
+ match.actions.lockMatGroup();
|
|
|
break;
|
|
|
case "clear":
|
|
|
- collocation.actions.clearMatGroup(matsGroup);
|
|
|
+ match.actions.clearMatGroup(matsGroup);
|
|
|
break;
|
|
|
}
|
|
|
};
|
|
@@ -81,12 +81,12 @@ export default defineComponent({
|
|
|
title="部件库"
|
|
|
onSave={() => {
|
|
|
console.error(queditor.store.pack);
|
|
|
- collocation.store.designDetail.scenePack.source =
|
|
|
+ match.store.designDetail.scenePack.source =
|
|
|
queditor.store.pack;
|
|
|
- collocation.actions.saveDesign();
|
|
|
+ match.actions.saveDesign();
|
|
|
}}
|
|
|
>
|
|
|
- {collocation.store.menuOptions.sourceData?.mat.map(
|
|
|
+ {match.store.menuOptions.sourceData?.mat.map(
|
|
|
(matsGroup: MatsMatchComp, index: number) => {
|
|
|
return (
|
|
|
<PanelGroup
|
|
@@ -100,20 +100,20 @@ export default defineComponent({
|
|
|
tools={["rename", "lock", "clear"]}
|
|
|
target={matsGroup}
|
|
|
onChange={(key) => handleChange(key, matsGroup)}
|
|
|
- onSelect={collocation.actions.switchMatsGroup}
|
|
|
+ onSelect={match.actions.switchMatsGroup}
|
|
|
>
|
|
|
<List data={matsGroup.matIds || []} columns={5} gap="5px">
|
|
|
{{
|
|
|
item: (matId: string, index: number) => {
|
|
|
const currentMats =
|
|
|
- collocation.helper.findMatById(matId);
|
|
|
+ match.helper.findMatById(matId);
|
|
|
return (
|
|
|
<MatItem
|
|
|
key={matId}
|
|
|
mat={currentMats}
|
|
|
active={index == matsGroup.index}
|
|
|
onClick={() =>
|
|
|
- collocation.actions.switchMatsGroupIndex(
|
|
|
+ match.actions.switchMatsGroupIndex(
|
|
|
matsGroup,
|
|
|
index
|
|
|
)
|
|
@@ -121,13 +121,13 @@ export default defineComponent({
|
|
|
onAction={(key: string) => {
|
|
|
switch (key) {
|
|
|
case "delete":
|
|
|
- collocation.actions.deleteGroupMat(
|
|
|
+ match.actions.deleteGroupMat(
|
|
|
matsGroup,
|
|
|
index
|
|
|
);
|
|
|
break;
|
|
|
case "rename":
|
|
|
- collocation.actions.renameGroupMat(
|
|
|
+ match.actions.renameGroupMat(
|
|
|
currentMats
|
|
|
);
|
|
|
break;
|