Browse Source

v0.1.4 字典管理-项目属性

任一存 1 year ago
parent
commit
613cbb18ea

+ 2 - 0
.vscode/settings.json

@@ -0,0 +1,2 @@
+{
+}

+ 5 - 1
README.md

@@ -50,4 +50,8 @@ mySelect:SelectType
 
 
 
 
 3.插件问题
 3.插件问题
-npm --registry https://registry.npmjs.org/ install react-file-viewer --force
+npm --registry https://registry.npmjs.org/ install react-file-viewer --force
+
+4.蓝湖
+地址:https://lanhuapp.com/link/#/invite?sid=qXnODvNa
+密码:8Hn3

+ 1 - 0
package.json

@@ -27,6 +27,7 @@
     "redux-devtools-extension": "^2.13.9",
     "redux-devtools-extension": "^2.13.9",
     "redux-thunk": "^2.4.1",
     "redux-thunk": "^2.4.1",
     "sass": "^1.55.0",
     "sass": "^1.55.0",
+    "sortablejs": "^1.15.2",
     "typescript": "^4.8.4",
     "typescript": "^4.8.4",
     "web-vitals": "^2.1.4"
     "web-vitals": "^2.1.4"
   },
   },

+ 7 - 1
src/pages/A2Dict/A2Tab1/A2Tab1Add/index.tsx

@@ -46,7 +46,13 @@ function A2Tab1Add({ info, closeFu, addFu }: Props) {
   }, [info]);
   }, [info]);
 
 
   const A2Tilele = useMemo(() => {
   const A2Tilele = useMemo(() => {
-    let txt1 = info.type === "job" ? "职能" : "状态";
+    const type2text = {
+      job: "职能",
+      status: "状态",
+      main: '主体',
+      dept: '部门',
+    }
+    let txt1 = type2text[info.type];
     let txt2 = info.id === -1 ? "新增" : "编辑";
     let txt2 = info.id === -1 ? "新增" : "编辑";
     return txt2 + txt1;
     return txt2 + txt1;
   }, [info.id, info.type]);
   }, [info.id, info.type]);

+ 1 - 1
src/pages/A2Dict/A2Tab1/A2Table1.tsx

@@ -10,7 +10,7 @@ import { MessageFu } from "@/utils/message";
 type Props = {
 type Props = {
   editFu: (item: A2Tab1_1) => void;
   editFu: (item: A2Tab1_1) => void;
   upTaleFu: () => void;
   upTaleFu: () => void;
-  type: "job" | "status";
+  type: "job" | "status" | "main" | "dept";
 };
 };
 
 
 function A2Table1({ editFu, upTaleFu, type }: Props) {
 function A2Table1({ editFu, upTaleFu, type }: Props) {

+ 36 - 1
src/pages/A2Dict/A2Tab1/index.tsx

@@ -69,6 +69,41 @@ function A2Tab1() {
 
 
       <div className="A2tableBox">
       <div className="A2tableBox">
         <div className="A2tableBoxBtn">
         <div className="A2tableBoxBtn">
+          <h3>签订主体</h3>
+          <Button
+            type="primary"
+            onClick={() => setAddInfo1({ id: -1, type: "main" } as A2Tab1_1)}
+          >
+            新增
+          </Button>
+        </div>
+        <A2Table1
+          editFu={(item) => setAddInfo1(item)}
+          upTaleFu={() => getListFu1()}
+          type="main"
+        />
+      </div>
+
+      {/* 新增一个table: 业务部门(dept)*/}
+      <div className="A2tableBox">
+        <div className="A2tableBoxBtn">
+          <h3>业务部门</h3>
+          <Button
+            type="primary"
+            onClick={() => setAddInfo1({ id: -1, type: "dept" } as A2Tab1_1)}
+          >
+            新增
+          </Button>
+        </div>
+        <A2Table1
+          editFu={(item) => setAddInfo1(item)}
+          upTaleFu={() => getListFu1()}
+          type="dept"
+        />
+      </div>
+      
+      <div className="A2tableBox">
+        <div className="A2tableBoxBtn">
           <h3>阶段</h3>
           <h3>阶段</h3>
           <Button
           <Button
             type="primary"
             type="primary"
@@ -86,7 +121,7 @@ function A2Tab1() {
         />
         />
       </div>
       </div>
 
 
-      {/* 新增职能 和 状态 */}
+      {/* 新增职能、状态、签订主体、业务部门 */}
       {addInfo1.id ? (
       {addInfo1.id ? (
         <A2Tab1Add
         <A2Tab1Add
           info={addInfo1}
           info={addInfo1}

+ 7 - 1
src/store/action/A2Dict.ts

@@ -3,7 +3,7 @@ import { AppDispatch } from "..";
 import { A2Tab1Type, A2Tab1_1 } from "@/types/api/A2Dict";
 import { A2Tab1Type, A2Tab1_1 } from "@/types/api/A2Dict";
 import { A5TableType } from "@/types";
 import { A5TableType } from "@/types";
 /**
 /**
- * 获取项目属性 职能,状态
+ * 获取项目属性 职能,状态,签订主体,业务部门
  */
  */
 export const A2_APIgetList1 = () => {
 export const A2_APIgetList1 = () => {
   return async (dispatch: AppDispatch) => {
   return async (dispatch: AppDispatch) => {
@@ -14,15 +14,21 @@ export const A2_APIgetList1 = () => {
 
 
       const arr1: A2Tab1_1[] = [];
       const arr1: A2Tab1_1[] = [];
       const arr2: A2Tab1_1[] = [];
       const arr2: A2Tab1_1[] = [];
+      const arrMain: A2Tab1_1[] = []; // 签订主体
+      const arrDept: A2Tab1_1[] = []; // 业务部门
 
 
       arrTemp.forEach((v) => {
       arrTemp.forEach((v) => {
         if (v.type === "job") arr1.push(v);
         if (v.type === "job") arr1.push(v);
         else if (v.type === "status") arr2.push(v);
         else if (v.type === "status") arr2.push(v);
+        else if (v.type === "main") arrMain.push(v);
+        else if (v.type === "dept") arrDept.push(v);
       });
       });
 
 
       const obj: A2Tab1Type = {
       const obj: A2Tab1Type = {
         job: arr1,
         job: arr1,
         status: arr2,
         status: arr2,
+        main: arrMain,
+        dept: arrDept,
       };
       };
       dispatch({ type: "A2/getInfo1_1", payload: obj });
       dispatch({ type: "A2/getInfo1_1", payload: obj });
     }
     }

+ 2 - 0
src/store/reducer/A2Dict.ts

@@ -7,6 +7,8 @@ const initState = {
   A2Tab1_1Obj: {
   A2Tab1_1Obj: {
     status: [],
     status: [],
     job: [],
     job: [],
+    main: [],
+    dept: [],
   } as A2Tab1Type,
   } as A2Tab1Type,
 
 
   // 阶段
   // 阶段

+ 3 - 1
src/types/api/A2Dict.d.ts

@@ -8,13 +8,15 @@ export type A2Tab1_1 = {
   name: string;
   name: string;
   parentId: number;
   parentId: number;
   sort: number;
   sort: number;
-  type: "status" | "job";
+  type: "status" | "job" | "main" | "dept";
   updateTime: string;
   updateTime: string;
 };
 };
 
 
 export type A2Tab1Type = {
 export type A2Tab1Type = {
   status: A2Tab1_1[];
   status: A2Tab1_1[];
   job: A2Tab1_1[];
   job: A2Tab1_1[];
+  main: A2Tab1_1[];
+  dept: A2Tab1_1[];
 };
 };
 
 
 export type A2Tab2Type = {
 export type A2Tab2Type = {

File diff suppressed because it is too large
+ 11151 - 0
yarn.lock