许静 5 years ago
parent
commit
c09565a489
3 changed files with 68 additions and 60 deletions
  1. 18
    0
      src/app.js
  2. 31
    31
      src/pages/staff/list/StaffList.jsx
  3. 19
    29
      src/pages/staff/list/style.less

+ 18
- 0
src/app.js View File

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
 export const dva = {
19
 export const dva = {
2
   config: {
20
   config: {
3
     onError(e) {
21
     onError(e) {

+ 31
- 31
src/pages/staff/list/StaffList.jsx View File

29
  */
29
  */
30
 const CartBody = (props) => {
30
 const CartBody = (props) => {
31
   const { data } = props
31
   const { data } = props
32
-    
32
+
33
   const confirm = () => {
33
   const confirm = () => {
34
     Modal.confirm({
34
     Modal.confirm({
35
       title: '确认停用该角色?',
35
       title: '确认停用该角色?',
36
       okText: '确认',
36
       okText: '确认',
37
       cancelText: '取消',
37
       cancelText: '取消',
38
-      onOk () {
38
+      onOk() {
39
         console.log('OK');
39
         console.log('OK');
40
       },
40
       },
41
-      onCancel () {
41
+      onCancel() {
42
         console.log('Cancel');
42
         console.log('Cancel');
43
       },
43
       },
44
     });
44
     });
49
       <div>
49
       <div>
50
 
50
 
51
         <Avatar src={data.avatar} style={{ width: 94, height: 94 }} />
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
       </div>
65
       </div>
62
       <div>
66
       <div>
69
           }
73
           }
70
         </span>
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
         </p>
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
         </p>
81
         </p>
81
       </div>
82
       </div>
82
 
83
 
86
 
87
 
87
 
88
 
88
 const header = (props) => {
89
 const header = (props) => {
89
-  const [tempData,setTempData] = useState([])
90
+  const [tempData, setTempData] = useState([])
90
   useEffect(() => {
91
   useEffect(() => {
91
     getList({ pageNum: 1, pageSize: 10 });
92
     getList({ pageNum: 1, pageSize: 10 });
92
-  },[])
93
+  }, [])
93
 
94
 
94
   const getList = (params) => {
95
   const getList = (params) => {
95
     request({
96
     request({
97
       method: 'GET',
98
       method: 'GET',
98
       params: { ...params },
99
       params: { ...params },
99
     }).then((data) => {
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
   }
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
   const { getFieldDecorator } = props.form
122
   const { getFieldDecorator } = props.form
122
   return (
123
   return (
156
           </Button>
157
           </Button>
157
         </Form.Item>
158
         </Form.Item>
158
       </Form>
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
       <Row style={{ padding: ' 0 10px' }}>
161
       <Row style={{ padding: ' 0 10px' }}>
162
         {
162
         {
163
           tempData.map((item, index) => (
163
           tempData.map((item, index) => (

+ 19
- 29
src/pages/staff/list/style.less View File

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