PCqiandao
杨树林 5 years ago
parent c6b6843cf6
commit 515c5cd937

@ -3,13 +3,16 @@ import '../css/signincdi.css';
import {Progress, message} from 'antd';
import QRCode from 'qrcode.react';
import axios from 'axios';
function clearSlct() {
if ("getSelection" in window) {
window.getSelection().removeAllRanges();
} else {
document.selection.empty();
};
}
;
}
function jsCopy(s) {
clearSlct();
const copyEle = document.getElementById(s);
@ -26,15 +29,14 @@ function copyStatuss(copyStatus){
message.error('复制失败');
}
}
//条目
class Detailss extends Component {
//条目组件
constructor(props) {
super(props);
this.state={
}
this.state = {}
}
componentDidMount() {
@ -47,10 +49,10 @@ class Detailss extends Component{
}
render() {
const isAdmin = this.props.isAdmin();
let item = this.props.headdata;
let defaultActiveKey = this.props.defaultActiveKey;
let jdt;
try {
jdt = item.normal_count / item.all_count * 100;
@ -75,7 +77,8 @@ class Detailss extends Component{
<Progress percent={jdt} showInfo={false} strokeColor="#1890ff"/>
</div>
<div className="progressivpss">
已签到{item&&item.normal_count ? item.normal_count : 0} / 应签到 {item&&item.all_count ? item.all_count : 0}
已签到{item && item.normal_count ? item.normal_count : 0} /
应签到 {item && item.all_count ? item.all_count : 0}
</div>
</div>
@ -113,34 +116,39 @@ class Detailss extends Component{
{item && item.attendance_date} {item && item.start_time}-{item && item.end_time}
</div>
</div>
<div className="ws25s xaxisreverseorder" style={{
{
defaultActiveKey === "1" ?
<div className="ws25s" style={{
position: "relative",
}}>
{/*<p className="h40s font-16 xiaoshou" style={{*/}
{/* color:"#1890FF"*/}
{/*}} onClick={() => {*/}
{/* jsCopy("file_path"+1)*/}
{/*}}>*/}
{/* 复制签到码*/}
{/*</p>*/}
{/*<p className="h40s font-16" style={{*/}
{/* color:"#333333",*/}
{/* marginRight:"10px",*/}
{/*}}>*/}
{/* 88866*/}
{/*</p>*/}
{/*<p className="h40s font-16" style={{*/}
{/* color:"#909399"*/}
{/*}}>签到码:</p>*/}
{
item && item.mode === "NUMBER" ?
<div className="ws100s xaxisreverseorder ">
<p className="h40s font-16 xiaoshou" style={{
color: "#1890FF"
}} onClick={() => {
jsCopy("file_path" + 1)
}}>
复制签到码
</p>
<p className="h40s font-16" style={{
color: "#333333",
marginRight: "10px",
}}>
88866
</p>
<p className="h40s font-16" style={{
color: "#909399"
}}>签到码</p>
</div>
:
item && item.mode === "QRCODE" ?
<div style={{
position: "absolute",
bottom: "-11px",
}}>
<QRCode
value={111111111} //value参数为生成二维码的链接
value={item&&item.code} //value参数为生成二维码的链接
size={84} //二维码的宽高尺寸
fgColor="#000000" //二维码的颜色
/>
@ -152,14 +160,32 @@ class Detailss extends Component{
扫码签到
</div>
</div>
: ""
}
</div>
:
""
}
</div>
</div>
<input id={"file_path"+1} className="file_path_input" value={"复制签到码"}/>
{
defaultActiveKey === "1" ?
item && item.mode === "NUMBER" ?
<input id={"file_path" + 1} className="file_path_input" value={item&&item.code}/>
:""
:
""
}
</div>
</React.Fragment>
)
}
}
export default Detailss;

@ -63,6 +63,7 @@ class Signindetails extends Component{
</div>
<Detailss
defaultActiveKey={this.props.defaultActiveKey}
headdata={headdata}
switattendance_id={this.props.switattendance_id}
{...this.props}

Loading…
Cancel
Save