-
Notifications
You must be signed in to change notification settings - Fork 2
/
weaver_OA_workflow_dbfield.user.js
73 lines (53 loc) · 1.89 KB
/
weaver_OA_workflow_dbfield.user.js
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
// ==UserScript==
// @name 泛微OA 创建流程 点击左上角蓝色图标 数据库字段名显示
// @namespace https://jihulab.com/lgh06/user-js/-/blob/master/weaver_OA_workflow_dbfield.user.js
// @version 0.1
// @description try to take over the world!
// @author You
// @require https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/2.2.4/jquery.min.js
// @match http://oa.heshenghe.cn:8089/spa/workflow/static4form/index.html*
// @grant none
// ==/UserScript==
(function () {
'use strict';
var $ = jQuery.noConflict();
var clickTimes = 0;
function main() {
var list = $("[data-fieldname]").css({ "position": "relative" });
Array.from(list).forEach(ele => {
if (clickTimes == 1) {
var innerWrap = document.createElement("div");
$(innerWrap).html($(ele).data("fieldname"));
$(innerWrap).css({ "position": "absolute", right: "0px", top: "0px", "opacity": "0.8", "zoom": "1.6" }).addClass("liugh");
if ($(ele).find(".liugh").length) {
} else {
$(ele).append(innerWrap);
}
} else if (clickTimes == 2) {
var innerWrap2 = document.createElement("div");
$(innerWrap2).html($(ele).data("fieldmark").substring(5));
$(innerWrap2).css({ "position": "absolute", left: "0px", top: "0px", "opacity": "0.8", "zoom": "1.6" }).addClass("liugh2");
if ($(ele).find(".liugh2").length) {
} else {
$(ele).append(innerWrap2);
}
} else if (clickTimes == 0) {
$(ele).find(".liugh,.liugh2").remove();
}
});
}
$(document).ready(() => {
console.log($('body'));
setTimeout(() => {
//main();
$(".wea-new-top-req-icon").click(() => {
clickTimes += 1;
if (clickTimes > 2) {
clickTimes = 0;
}
console.log("INGINGING")
main();
});
}, 1000);
});
})();