许静 5 年之前
父節點
當前提交
c09565a489
共有 3 個文件被更改,包括 68 次插入60 次删除
  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 查看文件

@@ -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 查看文件

@@ -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) => (

+ 19
- 29
src/pages/staff/list/style.less 查看文件

@@ -11,33 +11,36 @@
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: 20px;
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 26
 .cardText {
32
-
33
-  height: 28px;
34 27
   font-size: 20px;
35
-  font-weight: 400;
36 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 46
 .cardItem {
@@ -49,21 +52,9 @@
49 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 56
 .cardTag {
64
-  height: 18px;
65 57
   font-size: 10px;
66
-  // background: #fdce22;
67 58
   border-radius: 4px;
68 59
   color: #ffffff;
69 60
   line-height: 14px;
@@ -76,13 +67,12 @@
76 67
   width: 84px;
77 68
   justify-content: space-between;
78 69
   text-align: justify;
79
-  text-align-last: justify
70
+  text-align-last: justify;
80 71
 }
81 72
 
82 73
 
83 74
 .roletext {
84 75
   font-size: 20px;
85
-
86 76
   font-weight: 400;
87 77
   color: rgba(51, 51, 51, 1);
88 78
   line-height: 28px;