Explorar el Código

feat: init submodule

gemercheung hace 1 año
padre
commit
c3e15533ea
Se han modificado 6 ficheros con 24 adiciones y 38 borrados
  1. 3 0
      .gitmodules
  2. 1 0
      src/submodule
  3. 3 21
      src/view/users-add.vue
  4. 3 3
      src/view/users-edit.vue
  5. 2 2
      tsconfig.json
  6. 12 12
      vite.config.ts

+ 3 - 0
.gitmodules

@@ -0,0 +1,3 @@
+[submodule "src/submodule"]
+	path = src/submodule
+	url = http://face3d.4dage.com:7005/bill/drawing-board

+ 1 - 0
src/submodule

@@ -0,0 +1 @@
+Subproject commit cff34429ccbaf2fdacd1618ecd9e5e45f63a3fe1

+ 3 - 21
src/view/users-add.vue

@@ -37,7 +37,7 @@
 
 <script setup lang="ts">
 import { QuiskExpose } from "@/helper/mount";
-import type { FormInstance, FormRules } from "element-plus";
+import { ElMessage, type FormInstance, type FormRules } from "element-plus";
 // import { ElMessage } from "element-plus";
 import type { OrganizationType } from '@/request/organization'
 import {
@@ -103,32 +103,14 @@ onMounted(async () => {
 
 })
 
-// const setParentId = () => {
-//   if (user.value) {
-//     const isSuper = user.value.roles.filter(item => item.roleKey === "super_admin").length > 0;
-//     data.value.parentId = isSuper ? 0 : Number(user.value.orgId)
-//   }
-// }
-// const handleSelect = (item: SelectType) => {
-//   data.value.orgId = item.id
-//   console.log('handleSelect-id', item.id)
-// }
-// const querySearch = (queryString: string, cb: any) => {
-//   const results = queryString
-//     ? allOrgs.value.filter(i => i.value.toLowerCase().includes(queryString.toLowerCase()))
-//     : allOrgs.value
-//   console.log('queryString', queryString)
-//   console.log('results', results)
-//   cb(results)
-// }
+
 defineExpose<QuiskExpose>({
   async submit() {
-
     if (unref(baseFormRef)) {
-
       const res = await unref(baseFormRef)?.validate();
       if (res) {
         await props.submit(data.value as any as OrganizationType);
+        ElMessage.success('新增成功!');
       }
     } else {
       throw "";

+ 3 - 3
src/view/users-edit.vue

@@ -17,7 +17,7 @@
 
 <script setup lang="ts">
 import { QuiskExpose } from "@/helper/mount";
-import type { FormInstance, FormRules } from "element-plus";
+import { ElMessage, type FormInstance, type FormRules } from "element-plus";
 // import { ElMessage } from "element-plus";
 import type { OrganizationType } from '@/request/organization'
 import {
@@ -73,7 +73,7 @@ onMounted(async () => {
     pageNum: 1,
     pageSize: 10000,
   })
-  console.log('allOrgs', data.records);
+  // console.log('allOrgs', data.records);
   allOrgs.value = Array.from(data.records).map((item: OrganizationType) => {
     const i: SelectType = { value: item['orgName'], id: item['orgId'] }
     return i
@@ -101,10 +101,10 @@ const handleSelect = (orgId: number) => {
 defineExpose<QuiskExpose>({
   async submit() {
     if (unref(baseFormRef)) {
-
       const res = await unref(baseFormRef)?.validate();
       if (res) {
         await props.submit(data.value as any as UserType);
+        ElMessage.success('编辑成功!');
       }
     } else {
       throw "";

+ 2 - 2
tsconfig.json

@@ -27,10 +27,10 @@
         "src/*"
       ],
       "drawing-board": [
-        "../drawing-board/src/board/index.ts"
+        "./src/submodule/src/board/index.ts"
       ],
       "drawing-board/*": [
-        "../drawing-board/src/board/*"
+        "./src/submodule/src/board/*"
       ]
     }
   },

+ 12 - 12
vite.config.ts

@@ -14,7 +14,7 @@ export default defineConfig({
       },
       {
         find: "drawing-board",
-        replacement: resolve(__dirname, "../drawing-board/src/board"),
+        replacement: resolve(__dirname, "./src/submodule/src/board"),
       },
     ],
   },
@@ -23,22 +23,22 @@ export default defineConfig({
     port: 5173,
     open: true,
     proxy: {
-      "/api": {
-        target: "http://192.168.0.11:8324",
-        changeOrigin: true,
-        rewrite: (path) => path.replace(/^\/api/, ""),
-      },
+      // "/api": {
+      //   target: "http://192.168.0.11:8324",
+      //   changeOrigin: true,
+      //   rewrite: (path) => path.replace(/^\/api/, ""),
+      // },
       "/gear1": {
         target: `http://devimages.apple.com/iphone/samples/bipbop`,
         changeOrigin: true,
         rewrite: (path) => path.replace(/^\/gear1/, "/gear1"),
       },
-      // "/api": {
-      //   target: `http://sp.4dkankan.com`,
-      //   // target: `http://192.168.0.11:8324/relics/`,
-      //   changeOrigin: true,
-      //   rewrite: (path) => path.replace(/^\/api/, "/api"),
-      // },
+      "/api": {
+        target: `http://sp.4dkankan.com`,
+        // target: `http://192.168.0.11:8324/relics/`,
+        changeOrigin: true,
+        rewrite: (path) => path.replace(/^\/api/, "/api"),
+      },
  
     },
   },