From 3388a6763bbc64f9c90845d464a82d29779a3243 Mon Sep 17 00:00:00 2001
From: xuesinan <1404152492@qq.com>
Date: Tue, 19 Jul 2022 15:24:05 +0800
Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E8=B5=84=E6=9D=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
index.html | 78 ++++++++++++++++++++++++++++++++----------------------
1 file changed, 46 insertions(+), 32 deletions(-)
diff --git a/index.html b/index.html
index b1331e3..8152a8b 100644
--- a/index.html
+++ b/index.html
@@ -48,18 +48,19 @@
+ data-pid="1473556016628244480"
+ data-uid="1217647686598135808"
+ data-rid="1473556018582790144"
+ data-token="eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2NTM2MTQwOTksInN1YiI6IjE0ODE0NTg3NDEyOTU3MTQzMDQiLCJhdXRoSWQiOiIxNDgxNDU4NzQxNTMwNTk1MzI4IiwiZXhwIjoxNjUzNjIxMjk5fQ.kM15-gERv5j5qWBeWEG0kDxLWMJesHInnwFQnUaKcGg"
+ data-url="http://101.201.226.163:7320/v1.0"
+ data-tTime="1660492800000"
+ data-type="1"
+ data-tid="tid444"
+ data-did="did555"
+ style="height:50px;width:100%">
@@ -69,35 +70,48 @@
init() {
this.dom = document.querySelector("div[data-root=p1541239500222763008]");
- if (this.dom) {
- var title = this.dom.querySelector('.title');
+ var title = this.dom.querySelector('.title');
- var myDate = new Date();
- var tMonth = myDate.getMonth();
- title.innerHTML = tMonth === 0 ? '12月份工资表' : tMonth + '月份工资表';
- }
+ const currTime = this.dom.parentNode.getAttribute('data-tTime'); // 任务时间
+ let tMonth = '';
+ if (currTime) {
+ tMonth = this.format(currTime);
+ } else {
+ var myDate = new Date();
+ tMonth = myDate.getMonth();
+ }
+
+ title.innerHTML = tMonth === 0 ? '12月份工资表' : tMonth + '月份工资表';
},
+ // 时间戳转时间格式
+ format(shijianchuo){
+ //shijianchuo是整数,否则要parseInt转换
+ var time = new Date(+shijianchuo);
+ var m = time.getMonth();
+ return m;
+ },
+
jumpDetails(that) {
- const pId = this.dom.parentNode.getAttribute('data-pid');
- const uId = this.dom.parentNode.getAttribute('data-uid');
- const token = this.dom.parentNode.getAttribute('data-token');
- const rId = this.dom.parentNode.getAttribute('data-rid');
- const url = this.dom.parentNode.getAttribute('data-url');
- const type = this.dom.parentNode.getAttribute('data-type') ? 1 : 0;
+ const pId = this.dom.parentNode.getAttribute('data-pid');
+ const uId = this.dom.parentNode.getAttribute('data-uid');
+ const token = this.dom.parentNode.getAttribute('data-token');
+ const rId = this.dom.parentNode.getAttribute('data-rid');
+ const url = this.dom.parentNode.getAttribute('data-url');
+ const type = this.dom.parentNode.getAttribute('data-type') ? 1 : 0;
- const param = `http://101.201.226.163/tallsalary/?pid=${pId}&uid=${uId}&rid=${rId}&token=${token}&url=${url}`;
- if (type === 1) {
- sessionStorage.setItem('targetUrl', param);
- } else {
- location.href = param;
- }
+ const param = `http://101.201.226.163/tallsalary/?pid=${pId}&uid=${uId}&rid=${rId}&token=${token}&url=${url}`;
+ if (type === 1) {
+ sessionStorage.setItem('targetUrl', param);
+ } else {
+ location.href = param;
+ }
- // var pId = that.parentNode.parentNode.getAttribute('data-pid');
- // var rId = that.parentNode.parentNode.getAttribute('data-rid');
- // var uId = that.parentNode.parentNode.getAttribute('data-uid');
- // location.href = `http://101.201.226.163/checkwork/salary/?pid=${pId}&uid=${uId}&rid=${rId}`;
+ // var pId = that.parentNode.parentNode.getAttribute('data-pid');
+ // var rId = that.parentNode.parentNode.getAttribute('data-rid');
+ // var uId = that.parentNode.parentNode.getAttribute('data-uid');
+ // location.href = `http://101.201.226.163/checkwork/salary/?pid=${pId}&uid=${uId}&rid=${rId}`;
}
}
p1541239500222763008.init()