1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
/**
* 钟是志
* 2022年5月31日
* 禅道需求定制化
* 27141 [黔南]门户---单位个人中心,,双选会申请可视化展示,,发布到门户后,在邀请函页面也可视化展示
* 27345 门户--单位个人中心,,,双选会申请,选择展位的图片优化
* */
import React, { Fragment } from 'react';
import { Tag, Radio, Tooltip } from 'antd';
import styles from './styles.less';
/**
return {
showType: 'card-select',
remark: '黔南需求 禅道 27141',
cardSelectModalProps: {
title: '选择展位',
width: '90vw',
bodyStyle: {
height: '75vh',
overflowY: 'auto',
},
},
headerInfoFields: [
{
label: '批次名称',
key: 'batch_name',
},
{
label: '招聘地点',
key: 'address_name',
},
],
statusKey: 'state_id',
rowKey: 'booth_no_id',
noDataSentence: '暂无可选展位',
canSelectKeys: ['-1'],
selectedStyle: {
backgroundColor: '#4075FE',
color: '#fff',
},
typeList: {
'-1': {
style: {
// color: '',
border: '1px solid green',
cursor: 'pointer',
},
styleTips: {
border: '1px solid green',
},
text: '未选',
//canSelect: true,
},
'0': {
styleTips: {
border: '1px solid gray',
},
style: {
// color: '',
border: '1px solid gray',
},
text: '已选',
},
'1': {
styleTips: {
border: '1px solid orange',
},
style: {
// color: '',
border: '1px solid orange',
},
text: '申请中'
}
},
}
* */
export default function TableSelectZhanWei(props) {
const {
isMultiple, isShowQuanXuan,
selectAll, cancelAll,
valueName, dataSource,
columns3, allWidth,
get, otherProps,
callback, selects,
} = props;
const {
headerInfoFields,
rowKey,
prefixName = '',
statusKey,
noDataSentence = '暂无可选数据',
canSelectKeys = [],
typeList = [],
selectedStyle = {},
} = otherProps;
// console.log(otherProps, dataSource.list);
if (!dataSource || !dataSource.list || !dataSource.list.length) {
return <div className={styles.noData}>{noDataSentence}</div>;
}
const data = dataSource.list;
const selectItem = (selectData) => {
callback(selectData);
};
// console.log(selects);
return <div className={styles.zhanWei}>
{headerInfoFields && headerInfoFields.length &&
<div className={styles.header}>
{headerInfoFields.map((g) => {
return <span key={g.key} className={styles.headOne}>
<span className={styles.headTitle}>{g.label}</span> : {data[0][g.key]}
</span>;
})}
</div>
}
<div className={styles.list}>
{
data.map((item, index) => {
const status = item[statusKey];
const defaultChecked = canSelectKeys.includes(status + '');
const typeConfig = typeList[status + ''] || {};
const nowSelect = !!selects[item[rowKey]];
return <div className={styles.item}
key={item[rowKey]}
style={
nowSelect ? {
...selectedStyle,
} : {
...typeConfig.style,
}
}
onClick={() => {
if (defaultChecked) {
selectItem(item);
}
}}
>
<div className={styles.name}>
<Tooltip title={nowSelect ? '当前选择' : typeConfig.text}>
{prefixName + item.booth_no_name}
</Tooltip>
</div>
</div>;
})
}
</div>
<div className={styles.footer}>
{
Object.keys(typeList).map((g) => {
const typeOne = typeList[g];
return <span key={g} className={styles.tipsSpan}>
<span className={styles.tipsBlock} style={typeOne.styleTips}>
</span>
<span className={styles.tipsText}>{typeOne.text}</span>
</span>;
})
}
</div>
</div>;
}
{/* <div className={styles.itemHead}>
<div>
<Radio disabled={!defaultChecked}
checked={!defaultChecked || nowSelect}
onChange={(e) => {
selectItem(item);
}}
>
</Radio>
</div>
<div className={styles.statusTag}>
<Tag color={typeConfig.color}>
{typeConfig.text}
</Tag>
</div>
</div>*/
}