Quellcode durchsuchen

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager

魏熙美 vor 5 Jahren
Ursprung
Commit
4b3e692a7b
4 geänderte Dateien mit 72 neuen und 62 gelöschten Zeilen
  1. 1
    1
      config/config.js
  2. 18
    0
      src/app.js
  3. 31
    31
      src/pages/staff/list/StaffList.jsx
  4. 22
    30
      src/pages/staff/list/style.less

+ 1
- 1
config/config.js Datei anzeigen

@@ -479,7 +479,7 @@ export default {
479 479
 
480 480
   proxy: {
481 481
     '/api/': {
482
-      target: 'http://localhost:8080/',
482
+      target: 'http://192.168.0.84:8080/',
483 483
       changeOrigin: true,
484 484
       // pathRewrite: { '^/server': '' },
485 485
     },

+ 18
- 0
src/app.js Datei anzeigen

@@ -1,3 +1,21 @@
1
+// (function (doc, win) {
2
+//   var docEl = doc.documentElement,
3
+//     resizeEvt = 'onorientationchange' in window ? 'onorientationchange' : 'resize',
4
+//     recalc = function () {
5
+//       var clientWidth = docEl.clientWidth;
6
+//       if (!clientWidth) return;
7
+//       if (clientWidth >= 750) {
8
+//         docEl.style.fontSize = '100px';
9
+//       } else {
10
+//         docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
11
+//       }
12
+//     };
13
+
14
+//   if (!doc.addEventListener) return;
15
+//   win.addEventListener(resizeEvt, recalc, false);
16
+//   doc.addEventListener('DOMContentLoaded', recalc, false);
17
+// })(document, window);
18
+
1 19
 export const dva = {
2 20
   config: {
3 21
     onError(e) {

+ 31
- 31
src/pages/staff/list/StaffList.jsx Datei anzeigen

@@ -29,16 +29,16 @@ const toEditStaff = (userId) => () => {
29 29
  */
30 30
 const CartBody = (props) => {
31 31
   const { data } = props
32
-    
32
+
33 33
   const confirm = () => {
34 34
     Modal.confirm({
35 35
       title: '确认停用该角色?',
36 36
       okText: '确认',
37 37
       cancelText: '取消',
38
-      onOk () {
38
+      onOk() {
39 39
         console.log('OK');
40 40
       },
41
-      onCancel () {
41
+      onCancel() {
42 42
         console.log('Cancel');
43 43
       },
44 44
     });
@@ -49,14 +49,18 @@ const CartBody = (props) => {
49 49
       <div>
50 50
 
51 51
         <Avatar src={data.avatar} style={{ width: 94, height: 94 }} />
52
-        <span className={Styles.ediText} style={{ marginLeft: '20px' }} onClick={toEditStaff(data.userId)}>
52
+        <Button type="link" style={{ marginLeft: '10px', color: '#FF925C', fontSize: '18px' }} onClick={toEditStaff(data.userId)}>
53 53
           编辑
54
-                <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
55
-        </span>
56
-        <span className={Styles.ediText} style={{ marginLeft: '50px' }} onClick={confirm}>
54
+                <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
55
+        </Button>
56
+        <Button type="link" style={{ fontSize: '18px', color: '#cacaca', position: 'absolute', top: '50px', right: '0' }} onClick={confirm}>
57 57
           停用
58
-                <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
59
-        </span>
58
+                <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
59
+        </Button>
60
+        <Button type="link" style={{ fontSize: '18px', color: '#FF925C', position: 'absolute', top: '50px', right: '0' }} onClick={confirm}>
61
+          启用
62
+                <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
63
+        </Button>
60 64
 
61 65
       </div>
62 66
       <div>
@@ -69,14 +73,11 @@ const CartBody = (props) => {
69 73
           }
70 74
         </span>
71 75
 
72
-        <p className={Styles.cardText} style={{ width: '300px' }}>
73
-          <span>姓名:{data.userName}</span>
74
-
75
-          <span style={{ float: "right" }}>状态:{data.status === '1' ? '启用' : '停用'}</span>
76
-
76
+        <p className={Styles.cardText} >姓名 : {data.userName}
77 77
         </p>
78
-        <p className={Styles.cardText} style={{ width: '300px' }}>
79
-          <span>电话:{data.phone}</span>
78
+        <p className={Styles.statusText} > 状态 : {data.status === '1' ? '启用' : '停用'} </p>
79
+        <p className={Styles.phoneText} >
80
+          电话 : {data.phone}
80 81
         </p>
81 82
       </div>
82 83
 
@@ -86,10 +87,10 @@ const CartBody = (props) => {
86 87
 
87 88
 
88 89
 const header = (props) => {
89
-  const [tempData,setTempData] = useState([])
90
+  const [tempData, setTempData] = useState([])
90 91
   useEffect(() => {
91 92
     getList({ pageNum: 1, pageSize: 10 });
92
-  },[])
93
+  }, [])
93 94
 
94 95
   const getList = (params) => {
95 96
     request({
@@ -97,8 +98,8 @@ const header = (props) => {
97 98
       method: 'GET',
98 99
       params: { ...params },
99 100
     }).then((data) => {
100
-        console.log(data,"listData")
101
-        setTempData(data.records)
101
+      console.log(data, "listData")
102
+      setTempData(data.records)
102 103
     })
103 104
   }
104 105
 
@@ -108,15 +109,15 @@ const header = (props) => {
108 109
   }
109 110
 
110 111
   // 提交事件
111
-const handleSubmit = (e, props) => {
112
-  e.preventDefault();
113
-  props.form.validateFields((err, values) => {
114
-    if (!err) {
115
-      console.log('提交数据: ', values)
116
-      getList({ pageNum: 1, pageSize: 10, ...values })
117
-    }
118
-  });
119
-}
112
+  const handleSubmit = (e, props) => {
113
+    e.preventDefault();
114
+    props.form.validateFields((err, values) => {
115
+      if (!err) {
116
+        console.log('提交数据: ', values)
117
+        getList({ pageNum: 1, pageSize: 10, ...values })
118
+      }
119
+    });
120
+  }
120 121
 
121 122
   const { getFieldDecorator } = props.form
122 123
   return (
@@ -156,8 +157,7 @@ const handleSubmit = (e, props) => {
156 157
           </Button>
157 158
         </Form.Item>
158 159
       </Form>
159
-      <Button type="danger" className={styles.addBtn} onClick={toEditStaff()}>新增</Button>
160
-
160
+      <Button type="danger" style={{ margin: '20px 0', padding: '2px 36px' }} onClick={toEditStaff()}>新增</Button>
161 161
       <Row style={{ padding: ' 0 10px' }}>
162 162
         {
163 163
           tempData.map((item, index) => (

+ 22
- 30
src/pages/staff/list/style.less Datei anzeigen

@@ -11,33 +11,37 @@
11 11
   border: 1px solid #dbdbdb;
12 12
 }
13 13
 
14
-.addButton {
15
-  // background: #50be00;
16
-  border-radius: 4px;
17
-  border: 0px;
18
-  margin: 10px 0px;
19
-}
20 14
 
21 15
 .card {
22
-  width: 348px;
16
+  min-width: 330px;
17
+  margin-right: 2vw;
23 18
   height: 244px;
24 19
   background: rgba(255, 255, 255, 1);
25 20
   box-shadow: 0px 0px 16px 2px rgba(0, 0, 0, 0.12);
26 21
   border-radius: 12px;
27 22
   margin-bottom: 40px;
28
-
23
+  position: relative;
29 24
 }
30 25
 
31
-.cardText {
32 26
 
33
-  height: 28px;
27
+.cardText {
34 28
   font-size: 20px;
35
-  font-weight: 400;
36 29
   color: rgba(102, 102, 102, 1);
37
-  line-height: 28px;
38
-  margin-top: 10px;
39
-  margin-bottom: 0;
40
-
30
+  position: absolute;
31
+  bottom:36px;
32
+}
33
+.statusText {
34
+  font-size: 20px;
35
+  color: rgba(102, 102, 102, 1);
36
+  position: absolute;
37
+  bottom:36px;
38
+  right: 20px;
39
+}
40
+.phoneText{
41
+  font-size: 20px;
42
+  color: rgba(102, 102, 102, 1);
43
+  position: absolute;
44
+  bottom:0px;
41 45
 }
42 46
 
43 47
 .cardItem {
@@ -49,26 +53,15 @@
49 53
   align-items: center;
50 54
 }
51 55
 
52
-.ediText {
53
-  width: 36px;
54
-  height: 25px;
55
-  font-size: 18px;
56
-
57
-  font-weight: 400;
58
-  color: rgba(255, 146, 92, 1);
59
-  line-height: 25px;
60
-
61
-}
62 56
 
63 57
 .cardTag {
64
-  height: 18px;
65 58
   font-size: 10px;
66
-  // background: #fdce22;
67 59
   border-radius: 4px;
68 60
   color: #ffffff;
69
-  line-height: 14px;
61
+  line-height: 16px;
70 62
   margin-top: 10px;
71 63
   padding: 1px 3px;
64
+
72 65
 }
73 66
 
74 67
 .title {
@@ -76,13 +69,12 @@
76 69
   width: 84px;
77 70
   justify-content: space-between;
78 71
   text-align: justify;
79
-  text-align-last: justify
72
+  text-align-last: justify;
80 73
 }
81 74
 
82 75
 
83 76
 .roletext {
84 77
   font-size: 20px;
85
-
86 78
   font-weight: 400;
87 79
   color: rgba(51, 51, 51, 1);
88 80
   line-height: 28px;