李志伟 3 yıl önce
ebeveyn
işleme
0a0d9b94c3

+ 11
- 3
src/pages/Machinery/Machinery/edit.jsx Dosyayı Görüntüle

@@ -58,7 +58,7 @@ export default (props) => {
58 58
         .then((res) => {
59 59
           setLoading(false);
60 60
           message.success('数据保存成功');
61
-          goBack();
61
+          history.replace(`./edit.jsx?id=${res.machineryId}`)
62 62
         })
63 63
         .catch((err) => {
64 64
           setLoading(false);
@@ -106,7 +106,15 @@ export default (props) => {
106 106
   const handleClose = () => {
107 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 119
   const handleSelect = (item) => {
112 120
     setDevice(item);
@@ -335,7 +343,7 @@ export default (props) => {
335 343
                 {
336 344
                   deviceList.map(item =>
337 345
                     <List.Item key={item.deviceId} onClick={() => handleSelect(item)}>
338
-                      <Card className='listCard'>
346
+                      <Card className='listCard' hoverable>
339 347
                         <Descriptions labelStyle={{ width: '72px', display: 'inline-block', textAlign: 'end' }} >
340 348
                           <Descriptions.Item span={3} label='型号名称'>{item.modelName}</Descriptions.Item>
341 349
                           <Descriptions.Item span={3} label='协议'>{item.protocol}</Descriptions.Item>

+ 2
- 4
src/pages/Machinery/Machinery/style.less Dosyayı Görüntüle

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