李志伟 3 years ago
parent
commit
0a0d9b94c3
2 changed files with 13 additions and 7 deletions
  1. 11
    3
      src/pages/Machinery/Machinery/edit.jsx
  2. 2
    4
      src/pages/Machinery/Machinery/style.less

+ 11
- 3
src/pages/Machinery/Machinery/edit.jsx View File

58
         .then((res) => {
58
         .then((res) => {
59
           setLoading(false);
59
           setLoading(false);
60
           message.success('数据保存成功');
60
           message.success('数据保存成功');
61
-          goBack();
61
+          history.replace(`./edit.jsx?id=${res.machineryId}`)
62
         })
62
         })
63
         .catch((err) => {
63
         .catch((err) => {
64
           setLoading(false);
64
           setLoading(false);
106
   const handleClose = () => {
106
   const handleClose = () => {
107
     setVisible(false);
107
     setVisible(false);
108
   }
108
   }
109
-  const onSearch = (val) => { setTerminalId(val) }
109
+  const onSearch = (val) => {
110
+    if (val == '') {
111
+      getDeviceList({ pageSize: 500 }).then((res) => {
112
+        setDeviceList(res.records);
113
+      })
114
+    } else {
115
+      setTerminalId(val)
116
+    }
117
+  }
110
   //选中设备
118
   //选中设备
111
   const handleSelect = (item) => {
119
   const handleSelect = (item) => {
112
     setDevice(item);
120
     setDevice(item);
335
                 {
343
                 {
336
                   deviceList.map(item =>
344
                   deviceList.map(item =>
337
                     <List.Item key={item.deviceId} onClick={() => handleSelect(item)}>
345
                     <List.Item key={item.deviceId} onClick={() => handleSelect(item)}>
338
-                      <Card className='listCard'>
346
+                      <Card className='listCard' hoverable>
339
                         <Descriptions labelStyle={{ width: '72px', display: 'inline-block', textAlign: 'end' }} >
347
                         <Descriptions labelStyle={{ width: '72px', display: 'inline-block', textAlign: 'end' }} >
340
                           <Descriptions.Item span={3} label='型号名称'>{item.modelName}</Descriptions.Item>
348
                           <Descriptions.Item span={3} label='型号名称'>{item.modelName}</Descriptions.Item>
341
                           <Descriptions.Item span={3} label='协议'>{item.protocol}</Descriptions.Item>
349
                           <Descriptions.Item span={3} label='协议'>{item.protocol}</Descriptions.Item>

+ 2
- 4
src/pages/Machinery/Machinery/style.less View File

1
 .listCard{
1
 .listCard{
2
   position: relative;
2
   position: relative;
3
   margin-right: 24px;
3
   margin-right: 24px;
4
+  margin-left: 4px;
4
   width: 100%;
5
   width: 100%;
5
   img{
6
   img{
6
     position: absolute;
7
     position: absolute;
7
     right: -11px;
8
     right: -11px;
8
     top: 16px;
9
     top: 16px;
9
   }
10
   }
10
-}
11
-.listCard:hover{
12
-  background-color: rgb(250, 250, 250);
13
-}
11
+}