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

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

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

Loading…
Cancel
Save