Browse Source

添加字段

wangwei 4 years ago
parent
commit
aac7fdbba5
2 changed files with 84 additions and 62 deletions
  1. 82 60
      src/views/member/member/data.ts
  2. 2 2
      src/views/member/unit/index.vue

+ 82 - 60
src/views/member/member/data.ts

@@ -17,6 +17,11 @@ export const columns: BasicColumn[] = [
     width: 100,
   },
   {
+    title: '姓名(名称)',
+    dataIndex: 'name',
+    width: 100,
+  },
+  {
     title: '会员身份',
     dataIndex: 'status',
     width: 130,
@@ -81,6 +86,18 @@ export function getFormConfig(): Partial<FormProps> {
         },
       },
       {
+        field: `name`,
+        label: `姓名(名称)`,
+        component: 'Input',
+        componentProps: {
+          placeholder: '姓名(名称)',
+        },
+        colProps: {
+          xl: 12,
+          xxl: 8,
+        },
+      },
+      {
         field: `status`,
         label: `会员身份`,
         component: 'Select',
@@ -173,6 +190,11 @@ export function getFormConfig(): Partial<FormProps> {
               key: 'id',
             },
             {
+              label: '姓名(名称)',
+              value: 'name',
+              key: 'name',
+            },
+            {
               label: '会员身份',
               value: 'status',
               key: 'status',
@@ -325,66 +347,66 @@ export const schemas: FormSchema[] = [
       return false;
     },
   },
-  {
-    field: 'relationUnit',
-    component: 'Input',
-    label: '相关单位',
-    labelWidth: adaptWidth.labelWidth,
-    colProps: {
-      span: adaptWidth.elContainer,
-    },
-    render: ({ model, field }) => {
-      return h(CustomInput, {
-        value: model[field],
-        placeholder: '添加相关单位',
-        onChange(value) {
-          model[field] = value;
-        },
-      });
-    },
-    show: ({ values }) => {
-      if (values.status) {
-        return true;
-      }
-      return false;
-    },
-    required: ({ values }) => {
-      if (values.status) {
-        return true;
-      }
-      return false;
-    },
-  },
-  {
-    field: 'relation',
-    component: 'Input',
-    label: '相关个人',
-    labelWidth: adaptWidth.labelWidth,
-    colProps: {
-      span: adaptWidth.elContainer,
-    },
-    render: ({ model, field }) => {
-      return h(CustomInput, {
-        value: model[field],
-        placeholder: '添加相关个人',
-        onChange(value) {
-          model[field] = value;
-        },
-      });
-    },
-    show: ({ values }) => {
-      if (!values.status) {
-        return true;
-      }
-      return false;
-    },
-    required: ({ values }) => {
-      if (!values.status) {
-        return true;
-      }
-      return false;
-    },
-  },
+  // {
+  //   field: 'relationUnit',
+  //   component: 'Input',
+  //   label: '相关单位',
+  //   labelWidth: adaptWidth.labelWidth,
+  //   colProps: {
+  //     span: adaptWidth.elContainer,
+  //   },
+  //   render: ({ model, field }) => {
+  //     return h(CustomInput, {
+  //       value: model[field],
+  //       placeholder: '添加相关单位',
+  //       onChange(value) {
+  //         model[field] = value;
+  //       },
+  //     });
+  //   },
+  //   show: ({ values }) => {
+  //     if (values.status) {
+  //       return true;
+  //     }
+  //     return false;
+  //   },
+  //   required: ({ values }) => {
+  //     if (values.status) {
+  //       return true;
+  //     }
+  //     return false;
+  //   },
+  // },
+  // {
+  //   field: 'relation',
+  //   component: 'Input',
+  //   label: '相关个人',
+  //   labelWidth: adaptWidth.labelWidth,
+  //   colProps: {
+  //     span: adaptWidth.elContainer,
+  //   },
+  //   render: ({ model, field }) => {
+  //     return h(CustomInput, {
+  //       value: model[field],
+  //       placeholder: '添加相关个人',
+  //       onChange(value) {
+  //         model[field] = value;
+  //       },
+  //     });
+  //   },
+  //   show: ({ values }) => {
+  //     if (!values.status) {
+  //       return true;
+  //     }
+  //     return false;
+  //   },
+  //   required: ({ values }) => {
+  //     if (!values.status) {
+  //       return true;
+  //     }
+  //     return false;
+  //   },
+  // },
   {
     field: 'duty',
     component: 'Select',

+ 2 - 2
src/views/member/unit/index.vue

@@ -85,7 +85,6 @@
       const [registerTable] = useTable({
         rowSelection: { type: 'checkbox' },
         columns: columns,
-        // clickToRowSelect: false, // 点击行不勾选
         api: getUnitList,
         useSearchForm: true,
         beforeFetch: beforeFetch,
@@ -110,11 +109,12 @@
         }
         return tableAction;
       }
-
       // 请求之前处理参数
       function beforeFetch(params) {
+        console.log('==========before========');
         console.log(params);
         console.log('==========before========');
+
         for (let k in params) {
           if (!params[k]) {
             delete params[k];