qinyan 1 year ago
parent
commit
d1057c4673

+ 3 - 2
package.json

@@ -18,6 +18,7 @@
     "@queenjs-modules/auth": "^0.0.18",
     "@queenjs-modules/queditor": "^0.0.9",
     "@queenjs-modules/queentree": "^0.0.8",
+    "@queenjs-modules/queentree-explorer": "^0.0.2",
     "@queenjs/components": "^0.0.5",
     "@queenjs/controllers": "^0.0.6",
     "@queenjs/icons": "^0.0.20",
@@ -30,7 +31,7 @@
     "@types/qrcode": "^1.5.0",
     "@vueuse/core": "^9.13.0",
     "ali-oss": "^6.17.1",
-    "ant-design-vue": "^3.2.18",
+    "ant-design-vue": "3.2.12",
     "clipboard": "^2.0.11",
     "co": "^4.6.0",
     "core-js": "^3.8.3",
@@ -45,7 +46,7 @@
     "nats.ws": "^1.12.0",
     "proto.gl": "^1.0.0",
     "qrcode": "^1.5.1",
-    "queen3d": "^0.0.80",
+    "queen3d": "^0.0.85",
     "queenjs": "^1.0.0-beta.69",
     "queentree": "^0.1.86-nocheck",
     "rimraf": "^3.0.2",

+ 25 - 0
src/dict/apis.ts

@@ -0,0 +1,25 @@
+const baseURL = "https://www.3dqueen.cloud";
+// const baseURL = "http://192.168.110.180:8910";
+
+const baseVersion = "/cloud/v1";
+const treeVersion = "/tree/v1";
+
+// const _params = new URLSearchParams(decodeURIComponent(location.search));
+// const base = _params.get("base") || "";
+// const user = _params.get("user") || "";
+// console.log("base=>",base, user);
+
+const Dict_Apis = {
+  // authLocal: user,
+  // queentreeLocal: base,
+  auth: `${baseURL}${baseVersion}/usercenter`,
+  product: `${baseURL}${baseVersion}/queencloud`,
+  material: `${baseURL}${baseVersion}/queenmat`,
+  mesh: `${baseURL}${baseVersion}/queenmesh`,
+  promote: `${baseURL}${baseVersion}/matpromote`,
+  promoteMesh: `${baseURL}${baseVersion}/meshpromote`,
+  queentree: `${baseURL}${treeVersion}/assetcenter`,
+  queenter: `${baseURL}${baseVersion}/queenmat`,
+};
+
+export { Dict_Apis };

+ 2 - 1
src/modules-ctx/collocationCtx/index.ts

@@ -1,6 +1,7 @@
 import { initCollocation } from "@/modules/collocation";
 import { initAuthDef } from "@/modules/_default/auth";
 import { ModuleRoot } from "queenjs";
+import "../storage";
 
 export class CollocationCtxModule extends ModuleRoot {
   store = {};
@@ -13,7 +14,7 @@ export class CollocationCtxModule extends ModuleRoot {
     initCollocation({
       config: {
         httpConfig: {
-          baseURL: "https://www.3dqueen.cloud/cloud/v1/usercenter",
+          baseURL: "https://www.3dqueen.cloud/cloud/v1",
         },
       },
     });

+ 63 - 0
src/modules-ctx/storage.ts

@@ -0,0 +1,63 @@
+import { Exp_Storage } from "@queenjs-modules/queentree-explorer/dicts/storage";
+import {
+  HostRootItem,
+  NodeRootItem,
+} from "@queenjs-modules/queentree-explorer/typings";
+
+Exp_Storage.setVersion("1.0.0").setDefaultValue(() => {
+  const expHosts: { [name: string]: HostRootItem } = {};
+
+  const cloudRootNode: NodeRootItem = {
+    names: ["云盘"],
+    ids: [Math.random().toString()],
+    nodeType: "host",
+    tabPerms: ["rename", "login"],
+    nodePerms: ["editable", "saveAs"],
+  };
+
+  const platformRootNode: NodeRootItem = {
+    names: ["平台", "楦库", "面料"],
+    ids: [
+      cloudRootNode.ids[0],
+      "628b4ae8633d10f8e3658557",
+      "62a300a0a4fd6456392ebe76",
+    ],
+    nodeType: "branch",
+    assetType: 31,
+    tabPerms: [],
+    nodePerms: ["saveAs"],
+  };
+
+  const myRootNodes = [cloudRootNode];
+
+  expHosts[cloudRootNode.ids[0]] = {
+    baseURL: "https://www.3dqueen.cloud/tree/v1/assetcenter",
+    authURL: "https://www.3dqueen.cloud/cloud/v1/usercenter",
+    authKey: "queentreesku3d",
+  };
+
+  const expNodeRoots = [...myRootNodes, platformRootNode];
+
+  return {
+    expHosts,
+    expWindows: [
+      {
+        groupName: "我的资源",
+        rootNodeIds: myRootNodes.map((rootNode) => rootNode.ids.at(-1) || ""),
+      },
+      {
+        groupName: "平台资源",
+        rootNodeIds: [platformRootNode.ids.at(-1) as string],
+      },
+      {
+        groupName: "共享资源",
+        rootNodeIds: [],
+        showShareBtn: true,
+      },
+    ],
+    expNodeRoots,
+    expActiveState: {
+      currWindowName: "我的资源",
+    },
+  };
+});

+ 9 - 0
src/modules/collocation/index.ts

@@ -1,3 +1,4 @@
+import { PageListController } from "@queenjs/controllers";
 import { ModuleRoot } from "queenjs";
 import { designAction } from "./module/actions/design";
 import { initAction } from "./module/actions/init";
@@ -12,6 +13,14 @@ export class CollocationModule extends ModuleRoot {
   store = this.createStore(sourceStore);
   helper = this.createHelper(helper);
   actions = this.createActions([initAction, sourceAction, designAction]);
+
+  controls = {
+    listCtrl: new PageListController(this.config?.httpConfig),
+  };
+
+  onReady() {
+    this.controls.listCtrl.setCrudPrefix("/match/style");
+  }
 }
 
 export const { initCollocation, useCollocation } =

+ 4 - 4
src/modules/collocation/module/actions/design.ts

@@ -2,16 +2,16 @@ import { queenApi } from "queenjs";
 import { CollocationModule } from "../..";
 
 export const designAction = CollocationModule.action({
-  async delDesign(item) {
+  async delDesign(item: IStyle) {
     const result = await queenApi.showConfirm({
       title: "删除提示",
       content: `删除后不可恢复,是否删除${item.name}?`,
       type: "danger",
     });
-    if (!result) return;
 
-    const res = await this.https.delDesign(item._id);
+    if (!result) return;
+    const res = await this.https.deleteStyle(item._id);
     if (res.errorNo != 200) return;
-    // design.DesignList.fresh();
+    this.controls.listCtrl.fresh();
   },
 });

+ 16 - 3
src/modules/collocation/module/http.ts

@@ -1,10 +1,23 @@
 import { CollocationModule } from "..";
 
 export const https = CollocationModule.http({
-  addDesign(data) {
-    return this.request("", { method: "POST", data });
+  getStyleDetail(id: string) {
+    return this.request(`match/style/detail/${id}`, { method: "GET" });
   },
-  delDesign(id: string) {
+
+  createStyle(data) {
+    return this.request("/match/style/create", { method: "POST", data });
+  },
+
+  queryStyleList(params) {
+    return this.request("/match/style/list", { method: "GET", params });
+  },
+
+  updateStyle(data: IStyle) {
+    return this.request("/match/style/update", { method: "POST", data });
+  },
+
+  deleteStyle(id: string) {
     return this.request(`/delete/${id}`, { method: "POST" });
   },
 });

+ 13 - 0
src/modules/expViewer/index.ts

@@ -0,0 +1,13 @@
+import { initQueditor } from "@queenjs-modules/queditor";
+import { initQueentreeExplorer } from "@queenjs-modules/queentree-explorer";
+import { ModuleRoot } from "queenjs";
+
+export class ExpViewerModule extends ModuleRoot {
+  modules = this.useModules({
+    explorer: initQueentreeExplorer,
+    queditor: initQueditor,
+  });
+}
+
+export const { initExpViewer, useExpViewer, setExpViewer } =
+  ExpViewerModule.hook("ExpViewer");

+ 1 - 1
src/pages/collocation/Editor/components/Header/index.tsx

@@ -26,7 +26,7 @@ export default defineComponent({
     return () => {
       return (
         <div class={headerStyles}>
-          <span class="title">智能搭配中心</span>
+          <span class="title">搭配定制中心</span>
           {/* <TipIcon
             icon="undo"
             tip="撤销"

+ 4 - 1
src/pages/collocation/Editor/components/SourcePanel/index.tsx

@@ -1,4 +1,5 @@
 import { css } from "@linaria/core";
+import { initQueentreeExplorer } from "@queenjs-modules/queentree-explorer";
 import { defineComponent } from "vue";
 import { string } from "vue-types";
 
@@ -7,9 +8,11 @@ export default defineComponent({
     msg: string(),
   },
   setup(props) {
+    const queentreeExp = initQueentreeExplorer();
+    queentreeExp.actions.init();
     return () => (
       <div class={rootStyle}>
-        <h1>{props.msg}</h1>
+        <queentreeExp.components.Viewport class="h-1/1"/>
       </div>
     );
   },

+ 28 - 11
src/pages/collocation/Editor/index.tsx

@@ -1,22 +1,39 @@
+import { initExpViewer } from "@/modules/expViewer";
 import { css } from "@linaria/core";
+import { DefaultUI } from "queenjs";
 import { defineComponent } from "vue";
-import Canvas3d from "./components/Canvas3d";
 import Header from "./components/Header";
 import RightPanel from "./components/RightPanel";
 import SourcePanel from "./components/SourcePanel";
 
 export default defineComponent({
   setup() {
-    return () => {
-      return (
-        <div class={modalStyles}>
-          <Header />
-          <SourcePanel />
-          <Canvas3d />
-          <RightPanel />
-        </div>
-      );
-    };
+    const expViewer = initExpViewer();
+    const { queditor } = expViewer.modules;
+
+    queditor.initComponents({
+      Viewport: {
+        Header: () => <Header />,
+        SiderLeft: () => <SourcePanel class="w-340px h-1/1" />,
+        SiderRight: () => <RightPanel />,
+        Toolbar: {
+          default: () => null,
+        },
+      },
+    });
+
+    return () => (
+      <div class="h-100vh">
+        <queditor.components.Viewport />
+      </div>
+
+      // <div class={modalStyles}>
+      //   <Header />
+      //   <SourcePanel />
+      //   <Canvas3d />
+      //   <RightPanel />
+      // </div>
+    );
   },
 });
 

+ 16 - 187
src/pages/collocation/Home/components/DesignListModel.tsx

@@ -1,198 +1,27 @@
-import { useCollocation } from "@/modules/collocation";
-import { css } from "@linaria/core";
-import { Image, List } from "@queenjs/ui";
-import { Button, Checkbox, Empty, Pagination, Space } from "ant-design-vue";
+import PickNodeSteps from "@queenjs-modules/queentree-explorer/components/PickNodeSteps";
 import { useModal } from "queenjs";
-import { computed, defineComponent, onMounted, reactive } from "vue";
-import { object } from "vue-types";
+import { defineComponent } from "vue";
 
 export default defineComponent({
-  props: {
-    value: object(),
-  },
-  setup(props) {
+  setup() {
     const modal = useModal();
 
-    const collocation = useCollocation();
-
-    const state = reactive({
-      curScope: "user",
-      curSelect: {
-        _id: props.value?._id,
-      } as any,
-    });
-
-    // const PageListController = computed(() => {
-    //   if (state.curScope == "platform") {
-    //     return ctx.queentree.actions.getPlatformPageList("shoes");
-    //   }
-    //   return ctx.queentree.actions.getTreePageList(
-    //     state.curScope as any,
-    //     "shoes",
-    //     ctx.user.getUserType()
-    //   );
-    // });
-
-    onMounted(() => {
-      // ctx.design.UserList.loadPage(1);
-      // PageListController.value.loadPage(1);
-    });
-
-    // const controller = {
-    //   user: ctx.design.UserList,
-    //   team: ctx.design.TeamList,
-    //   company: ctx.design.CompanyList,
-    // };
-
-    const submit = async () => {
-      // if (state.curSelect._id) {
-      //   let res = await PageListController.value.AssetController.getScenePack(
-      //     state.curSelect._id
-      //   );
-      //   modal.submit(res);
-      //   return false;
-      // }
-      modal.submit(null);
-    };
-
-    const selectDesign = (item: any) => {
-      state.curSelect = item;
-    };
-
     return () => {
-      const dataSource: any = [];
       return (
-        <div class={modalStyle}>
-          <div class="list_view">
-            <List
-              columns={5}
-              gap="24px"
-              data={dataSource}
-              // data={PageListController.value.state.list}
-            >
-              {{
-                item: (item: any) => (
-                  <DesignItem
-                    item={item}
-                    key={item._id}
-                    current={state.curSelect}
-                    onClick={selectDesign}
-                  />
-                ),
-                empty: () => {
-                  return <Empty class="py-50px" type="default" />;
-                },
-              }}
-            </List>
-            <div class="text-center mt-30px mb-30px">
-              <Pagination
-                key={state.curScope}
-                hideOnSinglePage
-                // pageSize={PageListController.value.state.size}
-                // hideOnSinglePage={true}
-                // current={PageListController.value.state.page}
-                // total={PageListController.value.state.total}
-                // onChange={(p) => PageListController.value.loadPage(p)}
-              />
-            </div>
-          </div>
-          <div class="text-center">
-            <Space>
-              <Button onClick={() => modal.cancel()}>取消</Button>
-              <Button type="primary" onClick={submit}>
-                确认
-              </Button>
-            </Space>
-          </div>
-        </div>
+        <PickNodeSteps
+          onCancel={() => modal.cancel()}
+          onSubmit={(data) => modal.submit(data)}
+          lastStepText="确定"
+          steps={[
+            {
+              title: "选择资产",
+              content: () => (
+                <PickNodeSteps.PickNodeStep options={{ nodeType: "pack" }} />
+              ),
+            },
+          ]}
+        />
       );
     };
   },
 });
-
-const DesignItem = defineComponent({
-  props: ["item", "current", "onClick"],
-  setup(props) {
-    const thumbnailUrl = computed(() => {
-      const { item } = props;
-
-      const DefaultThumbnail = require("@/assets/images/default.png");
-      let thumbnailUrl = DefaultThumbnail;
-      if (item.thumbnail) {
-        if (typeof item.thumbnail == "string") thumbnailUrl = item.thumbnail;
-        else if (item.thumbnail.url) thumbnailUrl = item.thumbnail.url;
-      }
-
-      return thumbnailUrl;
-    });
-
-    return () => {
-      const { current, item } = props;
-
-      return (
-        <div class={DesignItemStyle}>
-          <div
-            class="card_main"
-            onClick={() => {
-              props.onClick && props.onClick(item);
-            }}
-          >
-            <div class="card_check">
-              <Checkbox checked={item._id == current._id} />
-            </div>
-            <div class="thumbnail_card">
-              <Image src={thumbnailUrl.value} size={300} class="card_img" />
-            </div>
-            <div class="card_footer">{item.name}</div>
-          </div>
-        </div>
-      );
-    };
-  },
-});
-
-const modalStyle = css`
-  background-color: #fff;
-  overflow: hidden;
-  .source_radio {
-    text-align: center;
-  }
-  .list_view {
-    margin-top: 20px;
-  }
-`;
-const DesignItemStyle = css`
-  width: 100%;
-  background-color: rgba(255, 255, 255, 1);
-  border: 1px solid #f5f6f7;
-  cursor: pointer;
-  overflow: hidden;
-  .card_main {
-    position: relative;
-    .card_check {
-      position: absolute;
-      top: 5px;
-      right: 5px;
-    }
-    .thumbnail_card {
-      width: 100%;
-      overflow: hidden;
-    }
-
-    .card_img {
-      width: 100%;
-      height: 150px;
-      object-fit: cover;
-    }
-  }
-  .card_footer {
-    border-top: 1px solid #f5f6f7;
-    padding: 15px;
-    color: #333;
-    width: 100%;
-    font-size: 16px;
-    overflow: hidden;
-    white-space: nowrap;
-    text-overflow: ellipsis;
-  }
-`;

+ 24 - 21
src/pages/collocation/Home/components/OperationModal.tsx

@@ -1,7 +1,10 @@
+import { useCollocation } from "@/modules/collocation";
 import { css } from "@linaria/core";
 import { Button, Form, Input } from "ant-design-vue";
+import { Rule } from "ant-design-vue/lib/form";
 import { queenApi } from "queenjs";
 import { defineComponent, reactive, ref } from "vue";
+import { object } from "vue-types";
 import Thumbnail from "./Thumbnail";
 
 const layout = {
@@ -10,21 +13,33 @@ const layout = {
 };
 
 export default defineComponent({
+  props: {
+    data: object<IStyle>(),
+  },
   setup(props) {
     const modal = queenApi.useDialog();
+    const collocation = useCollocation();
 
     const formRef = ref();
 
     const formState = reactive({
-      scenePack: {},
-      name: "",
+      scenePack: props.data?.scenePack || {},
+      name: props.data?.name || "",
     });
 
-    const submit = () => {
-      formRef.value.validate().then(async (values: any) => {
-        console.log("values: ", values);
-      });
-      // modal.cancel();
+    const checkPack = async (_rule: Rule, value: any) => {
+      if (!value.id) {
+        return Promise.reject("款式不能为空");
+      } else {
+        return Promise.resolve();
+      }
+    };
+
+    const submit = async () => {
+      const values = await formRef.value?.validateFields();
+      values.thumbnail = values.scenePack.thumbnail;
+      const res = await collocation.https.createStyle(values);
+      return res;
     };
 
     return () => {
@@ -34,17 +49,9 @@ export default defineComponent({
             <Form.Item
               name="scenePack"
               label="选择款式"
-              rules={[{ required: true, message: "款式不能为空" }]}
+              rules={[{ validator: checkPack, trigger: "change" }]}
             >
-              <Thumbnail
-                v-model={[formState.scenePack, "value"]}
-                // value={value}
-                // values={values}
-                // onChange={(v) => {
-                //   values.name = v.name || null;
-                //   emitChange(v);
-                // }}
-              />
+              <Thumbnail v-model={[formState.scenePack, "value"]} />
             </Form.Item>
             <Form.Item
               name="name"
@@ -54,10 +61,6 @@ export default defineComponent({
               <Input
                 v-model={[formState.name, "value"]}
                 placeholder="请输入款式名"
-                // value={value == undefined ? values.scenePack?.name : value}
-                onChange={(e: any) => {
-                  // emitChange(e.target.value);
-                }}
               />
             </Form.Item>
             <Form.Item class="text-center" wrapperCol={{ span: 24 }}>

+ 21 - 12
src/pages/collocation/Home/components/Thumbnail.tsx

@@ -11,29 +11,33 @@ import DesignListModel from "./DesignListModel";
 export default defineComponent({
   props: {
     value: object().def({}),
-    values: object().def({}),
   },
-  emits: ["change"],
+  emits: ["update:value"],
   setup(props, { emit }) {
     const collocation = useCollocation();
     const modal = useModal();
 
-    // const thumbnail = values.thumbnail ? values.thumbnail : value.thumbnail;
-
     const state = reactive({
-      thumbnail: "thumbnail",
+      thumbnail: props.value.thumbnail,
     }) as any;
 
     const selectDesign = async () => {
-      collocation.showModal(<DesignListModel value={props.value} />, {
-        title: "选择模型",
-        width: "900px",
+      collocation.showModal(<DesignListModel />, {
+        // title: "选择模型",
+        width: "800px",
         onOk: async (v: any) => {
           if (v) {
-            state.thumbnail = v.thumbnail;
-            emit("change", v);
+            const folder = v[0][0];
+            // const asset = await folder.getAssetDetail(true);
+            // emit("update:value", asset);
+            emit("update:value", folder.state);
+
+            const DefaultThumbnail = require("@/assets/images/default.png");
+            state.thumbnail = folder.state?.thumbnail;
+            if (!state.thumbnail.url) {
+              state.thumbnail.url = DefaultThumbnail;
+            }
           }
-          modal.cancel();
         },
         onCancel: () => modal.cancel(),
       });
@@ -61,7 +65,7 @@ export default defineComponent({
           {thumbnail && thumbnail.url ? (
             <div class={DesignSelect}>
               <Image src={thumbnail.url} size={98} />
-              <div class={"thumbnail_cover"}>
+              <div class="thumbnail_cover">
                 <Button type="text" onClick={selectDesign}>
                   更换款式
                 </Button>
@@ -119,6 +123,11 @@ const DesignSelect = css`
     background-color: rgba(0, 0, 0, 0.2);
     button.ant-btn {
       padding: 0;
+      color: @inf-primary-color;
+      &:hover {
+        background: #f5f6f7;
+        border-color: #f5f6f7;
+      }
       &:last-child {
         margin-top: 10px;
       }

+ 37 - 35
src/pages/collocation/Home/index.tsx

@@ -1,21 +1,22 @@
 import { useCollocation } from "@/modules/collocation";
 import { css } from "@linaria/core";
+import { Image } from "@queenjs/ui";
 import { Button, Space, Table } from "ant-design-vue";
+import { ColumnsType } from "ant-design-vue/lib/table/Table";
+import { queenApi } from "queenjs";
 import { defineComponent, onMounted } from "vue";
-import { Image } from "@queenjs/ui";
 import OperationModal from "./components/OperationModal";
-import { queenApi } from "queenjs";
 
 export default defineComponent({
   setup() {
     const collocation = useCollocation();
 
-    const columns = [
+    const columns: ColumnsType = [
       {
         title: "款式图片",
         dataIndex: "thumbnail",
         key: "thumbnail",
-        customRender: ({ text }: any) => (
+        customRender: ({ text }) => (
           <Image class="thumbnail" src={text?.url} size={120} />
         ),
       },
@@ -39,13 +40,13 @@ export default defineComponent({
         title: "价格(元)",
         dataIndex: "price",
         key: "price",
-        customRender: ({ text }: any) => (text / 100 || 0).toFixed(2),
+        customRender: ({ text }) => (text / 100 || 0).toFixed(2),
       },
       {
         title: "操作",
         key: "action",
         dataIndex: "action",
-        customRender: ({ record }: any) => {
+        customRender: ({ record }) => {
           return (
             <Space>
               <Button type="link" onClick={() => showEdit(record)}>
@@ -60,7 +61,11 @@ export default defineComponent({
               >
                 定制内容
               </Button>
-              <Button type="text" danger onClick={() => delDesign(record)}>
+              <Button
+                type="text"
+                danger
+                onClick={() => collocation.actions.delDesign(record)}
+              >
                 删除
               </Button>
             </Space>
@@ -70,41 +75,39 @@ export default defineComponent({
     ];
 
     onMounted(() => {
-      // ctx.design.DesignList.loadPage(1, 20);
-      // ctx.design.SizeList.loadPage(1, 1000);
+      collocation.controls.listCtrl.loadPage(1, 20);
     });
 
     const showAddDesign = async () => {
-      const values: any = await collocation.showModal(<OperationModal />, {
+      const values: IStyle = await collocation.showModal(<OperationModal />, {
         title: "添加可定制款式",
         width: "500px",
       });
       if (!values) return;
-      values.thumbnail = values.scenePack.thumbnail;
-      // values.price = parseInt(values.price * 100 + "");
-      // let res = await ctx.design.actions.addDesign(values);
-    };
 
-    const showEdit = async (record: any) => {
-      // let item = await ctx.design.actions.getDesignDTL(record._id);
-      // if (!item) return false;
-      // item.price = (item.price / 100).toFixed(2);
-      const values: any = await collocation.showModal(<OperationModal />, {
-        title: "编辑可定制款式",
-        width: "500px",
-      });
-      // if (!values) return;
-      // values.thumbnail = values.scenePack.thumbnail;
-      // values.price = parseInt(values.price * 100 + "");
-      // let res = await ctx.design.actions.updateDesign(values);
+      values.thumbnail = values.scenePack?.thumbnail;
+      await collocation.https.createStyle(values);
     };
 
-    const delDesign = (item: any) => {
-      collocation.actions.delDesign(item);
+    const showEdit = async (record: IStyle) => {
+      const item: IStyle = await collocation.https.getStyleDetail(record._id);
+      if (!item) return false;
+
+      const values: IStyle = await collocation.showModal(
+        <OperationModal data={record} />,
+        {
+          title: "编辑可定制款式",
+          width: "500px",
+        }
+      );
+      if (!values) return;
+
+      values.thumbnail = values.scenePack.thumbnail;
+      await collocation.https.updateStyle(values);
     };
 
     return () => {
-      const dataSource: any = [{ name: "456", _id: "122" }];
+      const listCtrl = collocation.controls.listCtrl;
       return (
         <div class={DesignStyle}>
           <div class="mb-20px table_header">
@@ -116,14 +119,13 @@ export default defineComponent({
           <Table
             size="small"
             columns={columns}
-            dataSource={dataSource}
             rowKey={(record) => record._id}
+            dataSource={listCtrl.state.list}
             pagination={{
-              size: "default",
-              // pageSize: ctx.design.DesignList.state.size,
-              // current: ctx.design.DesignList.state.page,
-              // total: ctx.design.DesignList.state.total,
-              // onChange: (p) => ctx.design.DesignList.loadPage(p),
+              pageSize: listCtrl.state.size,
+              current: listCtrl.state.page,
+              total: listCtrl.state.total,
+              onChange: (p) => listCtrl.loadPage(p),
             }}
           />
         </div>

+ 2 - 2
src/pages/collocation/components/AvatarDropDown.tsx

@@ -1,6 +1,5 @@
 import { useAuth } from "@queenjs-modules/auth";
 import { Avatar, Button, Dropdown, Menu } from "ant-design-vue";
-import { queenApi } from "queenjs";
 import { defineComponent } from "vue";
 
 export default defineComponent({
@@ -12,7 +11,8 @@ export default defineComponent({
     };
 
     const login = () => {
-      queenApi.router.push("/login");
+      const loginUrl = `${location.origin}/login.html`;
+      location.href = loginUrl;
     };
 
     const menu = (

+ 1 - 1
src/pages/collocation/components/BasicLayout.tsx

@@ -31,7 +31,7 @@ export default defineComponent({
             trigger={null}
             collapsible
           >
-            <h3 class="text-light-200 text-center py-20px">智能搭配</h3>
+            <h3 class="text-light-200 text-center py-20px">搭配定制</h3>
             <Menu
               theme="dark"
               selectedKeys={state.menuKey}

+ 10 - 10
src/pages/login/router.ts

@@ -6,16 +6,16 @@ const routes: Array<RouteRecordRaw> = [
     name: "login",
     component: () => import("@queenjs-modules/auth/components/Login"),
   },
-  // {
-  //   path: "/forget",
-  //   name: "forget",
-  //   component: () => import("@queenjs-modules/auth/components/Forget"),
-  // },
-  // {
-  //   path: "/register",
-  //   name: "register",
-  //   component: () => import("@queenjs-modules/auth/components/Register"),
-  // },
+  {
+    path: "/forget",
+    name: "forget",
+    component: () => import("@queenjs-modules/auth/components/Forget"),
+  },
+  {
+    path: "/register",
+    name: "register",
+    component: () => import("@queenjs-modules/auth/components/Register"),
+  },
 ];
 
 const router = createRouter({

+ 25 - 0
src/typings/collocation.d.ts

@@ -0,0 +1,25 @@
+declare interface MatsMatchComp {
+  index?: number;
+  matIds?: string[];
+  name?: string;
+  productId?: string;
+  sceneProId?: string;
+  visible?: boolean;
+}
+declare interface ProductMatching {
+  index?: number;
+  category?: string;
+  group?: string;
+  productIds?: string[];
+}
+
+declare interface IStyle {
+  _id: string;
+  useId?: string;
+  name?: string;
+  thumbnail?: Image;
+  category?: string[];
+  matMatchs?: MatsMatchComp[];
+  proMatchs?: ProductMatching[];
+  scenePack: IAssetMesh;
+}

+ 15 - 0
src/typings/dict.d.ts

@@ -0,0 +1,15 @@
+declare type MapKey<T> = T extends Map<infer P, any> ? P : never;
+
+declare module "queen3d/three" {
+  export * from "node_modules/queen3d/three";
+  export function loadMesh(url: string, ext: string): Promise<[string, Mesh]> {}
+}
+
+declare module "queenjs/framework" {
+  export { Events as Bus } from "queenjs";
+}
+
+declare type FuncProps<T> = {
+  class?: string;
+  onClick?: any;
+} & T;

+ 2 - 1
tsconfig.json

@@ -31,7 +31,8 @@
   "include": [
     "src/**/*.ts",
     "src/**/*.tsx",
-    "src/**/*.vue"
+    "src/**/*.vue",
+    "node_modules/queenjs/**/*.ts"
   ],
   "exclude": [
     "node_modules"

+ 21 - 16
yarn.lock

@@ -1229,6 +1229,11 @@
   resolved "http://124.70.149.18:4873/@queenjs-modules%2fqueditor/-/queditor-0.0.9.tgz#2c4c0b8d68da48e3e30dc92b0acb5f1f8d8761ce"
   integrity sha512-iK9PykYQO0gZOcz851e4NNBUAg/DlmhuQrQgRkmlK287oD7u6r8pD/ONOD7Anyy04FP6BTe9DOhGMW55imdlVw==
 
+"@queenjs-modules/queentree-explorer@^0.0.2":
+  version "0.0.2"
+  resolved "http://124.70.149.18:4873/@queenjs-modules%2fqueentree-explorer/-/queentree-explorer-0.0.2.tgz#fbbee041ed4d6de19edc7401f1c2734a2b971952"
+  integrity sha512-gV3Uba0LJxcpgDltktvtQ6F2ndj3w7T57PV1iD0xpezLCDYgNGnOVWBGrpKekr2QAnbxlX2z2jRv6XotHicRww==
+
 "@queenjs-modules/queentree@^0.0.8":
   version "0.0.8"
   resolved "http://124.70.149.18:4873/@queenjs-modules%2fqueentree/-/queentree-0.0.8.tgz#2a471100a1d09e72dcbc54daa453fc4c275a71b7"
@@ -2351,10 +2356,10 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0:
   dependencies:
     color-convert "^2.0.1"
 
-ant-design-vue@^3.2.18:
-  version "3.2.18"
-  resolved "http://124.70.149.18:4873/ant-design-vue/-/ant-design-vue-3.2.18.tgz#9abb0e7d9349d2d370ebfd036f1fa310e3878395"
-  integrity sha512-8jqy2on2W7E2JQ/bxGsrHz6f/nwXLvOJV11Js1TIFJOlcHRKOzhomt0QArew88Tx1IL8KjXQbRHlN/h0qBdbLw==
+ant-design-vue@3.2.12:
+  version "3.2.12"
+  resolved "http://124.70.149.18:4873/ant-design-vue/-/ant-design-vue-3.2.12.tgz#996361982884b1d0d82186dba67962983bc1fbac"
+  integrity sha512-CPsoWJ3t+sqq/EPINPXb4fC5/9iKkUdYOfK9M9kLKbXlRN3MAoVwWUbaFnUqc+ngtbEpn/d69hTF/Eh7MeWMhQ==
   dependencies:
     "@ant-design/colors" "^6.0.0"
     "@ant-design/icons-vue" "^6.1.0"
@@ -6360,20 +6365,20 @@ qs@^6.4.0:
   dependencies:
     side-channel "^1.0.4"
 
-queen3d@^0.0.80:
-  version "0.0.80"
-  resolved "http://124.70.149.18:4873/queen3d/-/queen3d-0.0.80.tgz"
-  integrity sha512-GaBzki+vcjC4JDN4olh/UI3oW6BRc1qbk1+pwUlbBN0oC+ilKNn9C64tLSEio0zWZikEtGb6A9jrUXntX1no4A==
+queen3d@^0.0.85:
+  version "0.0.85"
+  resolved "http://124.70.149.18:4873/queen3d/-/queen3d-0.0.85.tgz#34f2914fb7a7a8f723f29c62b1d4454c83008de0"
+  integrity sha512-LPJsLl6nlUnf+rDXlutxO0BACJrr6QOFaKxRhv+V1mJkFqljyXVsIKhV+VvDHwCq+hCt4tSX+bRAbog3kF5W6w==
 
 queenjs@^1.0.0-beta.69:
-  version "1.0.0-beta.69"
-  resolved "http://124.70.149.18:4873/queenjs/-/queenjs-1.0.0-beta.69.tgz"
-  integrity sha512-PrEzn48RiuI7gbAhMhWL0zVF9Yp1w9fgHCahEPTDW2LUozyhL7rMA4Q6g7IuGy3H4ydxj3SHVl1KhqmYMI1IeQ==
+  version "1.0.0-beta.70"
+  resolved "http://124.70.149.18:4873/queenjs/-/queenjs-1.0.0-beta.70.tgz#c920261bd4fba3b77747a0b9d270de8fbab9c88d"
+  integrity sha512-dA9Xy+sY8WD7vpNZuuM44+QrukAgoSDty/Sz1iaVzP08rPrpSTvv/6BQqUiMnKF6b5wEpAy4IjuBm5F+9YxHzA==
   dependencies:
     axios "^0.27.2"
     eventemitter3 "^4.0.7"
     moduse "^0.0.7"
-    vue-moduse "^0.0.8"
+    vue-moduse "^0.0.9"
 
 queentree@^0.1.86-nocheck:
   version "0.1.86-nocheck"
@@ -7608,10 +7613,10 @@ vue-loader@^17.0.0:
     hash-sum "^2.0.0"
     loader-utils "^2.0.0"
 
-vue-moduse@^0.0.8:
-  version "0.0.8"
-  resolved "http://124.70.149.18:4873/vue-moduse/-/vue-moduse-0.0.8.tgz"
-  integrity sha512-5MdR2/ZJ6FeALmg+cK+FOzjfqFU/hnHaatNDRtbic3mCHDy/XQiFxTZFre7Yuck6VD1Jdl1sLPhv3Exg0iMYgA==
+vue-moduse@^0.0.9:
+  version "0.0.9"
+  resolved "http://124.70.149.18:4873/vue-moduse/-/vue-moduse-0.0.9.tgz"
+  integrity sha512-flnd6a+C4RvsNEz7jfAWO1dssbGfr7rbZWS5w9V2Kmj1ZOKJRCGzLumoyLNFJ/pwa6qQEXkN7jI6bRN1uAi9Tg==
 
 vue-router@^4.0.3:
   version "4.1.5"