فهرست منبع

Merge pull request #277 from jetlinks/next-xyh

fix(部门管理): bug#3424、3401、3389
Lind 3 سال پیش
والد
کامیت
1f194ca76e

+ 6 - 3
src/pages/system/Department/Member/bind.tsx

@@ -81,6 +81,12 @@ const Bind = observer((props: Props) => {
         pagination={{
           pageSize: 5,
         }}
+        params={{
+          terms: [{
+            column: 'id$in-dimension$org$not',
+            value: param.id
+          }]
+        }}
         rowSelection={{
           selectedRowKeys: MemberModel.bindUsers,
           onChange: (selectedRowKeys, selectedRows) => {
@@ -88,9 +94,6 @@ const Bind = observer((props: Props) => {
           },
         }}
         request={(params) => service.queryUser(params)}
-        defaultParams={{
-          'id$in-dimension$org$not': param.id,
-        }}
       />
     </Modal>
   );

+ 3 - 3
src/pages/system/Department/Member/index.tsx

@@ -94,11 +94,11 @@ const Member = observer(() => {
           status: 0,
         },
       },
-      render: (value) => (
+      render: (_, data) => (
         <Badge
-          status={value === 1 ? 'success' : 'error'}
+          status={data.status === 1 ? 'success' : 'error'}
           text={
-            value === 1
+            data.status === 1
               ? intl.formatMessage({
                   id: 'pages.searchTable.titleStatus.normal',
                   defaultMessage: '正常',

+ 20 - 4
src/pages/system/Department/index.tsx

@@ -3,7 +3,7 @@ import { PageContainer } from '@ant-design/pro-layout';
 import ProTable from '@jetlinks/pro-table';
 import type { ActionType, ProColumns } from '@jetlinks/pro-table';
 import { useEffect, useRef, useState } from 'react';
-import { useIntl } from '@@/plugin-locale/localeExports';
+import { useIntl } from 'umi';
 import { Button, message, Popconfirm, Tooltip } from 'antd';
 import {
   EditOutlined,
@@ -167,16 +167,32 @@ export default observer(() => {
     properties: {
       name: {
         type: 'string',
-        title: '名称',
+        title: intl.formatMessage({
+          id: 'pages.table.name',
+          defaultMessage: '名称'
+        }),
         required: true,
         'x-decorator': 'FormItem',
         'x-component': 'Input',
+        'x-validator': [
+          {
+            max: 50,
+            message: '最多可输入50个字符',
+          },
+          {
+            required: true,
+            message: '请输入名称',
+          },
+        ],
       },
       sortIndex: {
         type: 'string',
-        title: '排序',
+        title: intl.formatMessage({
+          id: 'pages.device.instanceDetail.detail.sort',
+          defaultMessage: '排序'
+        }),
         'x-decorator': 'FormItem',
-        'x-component': 'Input',
+        'x-component': 'NumberPicker',
       },
     },
   };