Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf51e89611 | ||
|
|
2b46b64bb5 | ||
|
|
60012207ba | ||
|
|
7faef161d8 | ||
|
|
faddc50ffe | ||
|
|
65ee2302e4 | ||
|
|
cc0ddfb9c6 | ||
|
|
70376e6c47 | ||
|
|
8921dc8fde | ||
|
|
2f70ce0fae | ||
|
|
6e93a67395 | ||
|
|
11357fd74e | ||
|
|
40adaba2c2 | ||
|
|
93e79e876b | ||
|
|
af92741f04 | ||
|
|
477af8f52e | ||
|
|
f01e772b06 | ||
|
|
7284f7014e | ||
|
|
d81650b635 | ||
|
|
a1e005a761 | ||
|
|
cba1c45c33 | ||
|
|
f7d89bc6f2 | ||
|
|
04ac56c11c | ||
|
|
5f2e32cf11 | ||
|
|
217a8907b7 | ||
|
|
775f0109e4 | ||
|
|
4d126b18ad | ||
|
|
352c779b84 | ||
|
|
7d665ee664 | ||
|
|
6083594c27 | ||
|
|
0e294f2afd | ||
|
|
626542e51b | ||
|
|
a9e24fad39 | ||
|
|
13163c717c | ||
|
|
242cf1b3cb | ||
|
|
1fb611e06e | ||
|
|
06963a4ccd | ||
|
|
4d90ce245d | ||
|
|
27404a80e8 | ||
|
|
eeedca2f81 | ||
|
|
6ff2fef9a1 | ||
|
|
5aa81f6d2f | ||
|
|
a21bcf21fe | ||
|
|
7c900dfa94 | ||
|
|
18b7ddcd7e | ||
|
|
ec4a3428d3 | ||
|
|
96221f8ea3 | ||
|
|
7ddaf35a72 | ||
|
|
cef20ed05d | ||
|
|
2e35fead78 | ||
|
|
b0ab8a76a7 | ||
|
|
7063f4d870 | ||
|
|
e0a7305f87 | ||
|
|
72437d390d | ||
|
|
94429c5ad5 | ||
|
|
c200b4f513 | ||
|
|
621fbecad2 | ||
|
|
2d9fa6d0e3 | ||
|
|
072199b304 | ||
|
|
ddf005df33 | ||
|
|
79197e4e7d | ||
|
|
019583dfd8 | ||
|
|
a749fa6292 |
No files matched your search
@@ -1,35 +0,0 @@
|
|||||||
/*
|
|
||||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
前端执行SQL查询语句
|
|
||||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
// let SQL_sentence = `SELECT loginid as id,password as pw FROM hrmresource`;
|
|
||||||
// let cols = "id,pw";
|
|
||||||
function SelectByGSL(SQL_sentence, cols) {
|
|
||||||
const getUrl = '/api/gSl/GSl/gsl';
|
|
||||||
const Query1 = SQL_sentence;//编写SQL语句
|
|
||||||
const jiami = ecCom.WeaTools.Base64.encode(Query1);
|
|
||||||
const result1 = ecCom.WeaTools.Base64.encode(cols);//编写查询内容
|
|
||||||
const mynewJSON = `{
|
|
||||||
"expression": "${jiami}",
|
|
||||||
"result": "${result1}"
|
|
||||||
}`;
|
|
||||||
const result = await ecCom.WeaTools.callApi(getUrl, 'POST', JSON.parse(mynewJSON));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
前端执行SQL增、删、改语句
|
|
||||||
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
*/
|
|
||||||
// let SQL_sentence = `update hrmresource set fieldname='123' where id='43' `;
|
|
||||||
function insertOrDeleteOrUpdateByGSL(SQL_sentence) {
|
|
||||||
const getUrl = '/api/gSl/GSl/setTable';
|
|
||||||
const Query1 = SQL_sentence;//编写SQL语句
|
|
||||||
const jiami = ecCom.WeaTools.Base64.encode(Query1);
|
|
||||||
const mynewJSON = `{
|
|
||||||
"expression": "${jiami}",
|
|
||||||
}`;
|
|
||||||
const result = await ecCom.WeaTools.callApi(getUrl, 'POST', JSON.parse(mynewJSON));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
@@ -27,8 +27,9 @@ async function selectByFieldPropSyn(SFP_myJSON) {
|
|||||||
try {
|
try {
|
||||||
let postObj = JSON.parse(SFP_myJSON);
|
let postObj = JSON.parse(SFP_myJSON);
|
||||||
const response = await $.post("/api/workflow/linkage/reqFieldSqlResult", postObj);
|
const response = await $.post("/api/workflow/linkage/reqFieldSqlResult", postObj);
|
||||||
return response;
|
return JSON.parse(response);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error:', error);
|
console.error('Error:', error);
|
||||||
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
-- 查询自定义函数的源代码
|
||||||
|
SELECT
|
||||||
|
text
|
||||||
|
FROM
|
||||||
|
user_source
|
||||||
|
WHERE
|
||||||
|
name = '函数名(全大写,如:HOS_GET_SORTABLE_REF)'
|
||||||
|
AND type = 'FUNCTION'
|
||||||
|
ORDER BY
|
||||||
|
line;
|
||||||
|
|
||||||
|
-- 自定义函数
|
||||||
|
-- 函数说明:入参书编号及数字位数,返回可排序编号,如入参为'ZW1-12-123'和4,则返回'ZW0001-0012-0123',第二个参数可不填,默认为4。
|
||||||
|
FUNCTION hos_get_sortable_ref(
|
||||||
|
bh IN VARCHAR2,
|
||||||
|
len IN NUMBER DEFAULT 4
|
||||||
|
) RETURN VARCHAR2 IS v_res VARCHAR2(999);
|
||||||
|
|
||||||
|
BEGIN
|
||||||
|
SELECT
|
||||||
|
LISTAGG(str || num, '') WITHIN GROUP (
|
||||||
|
ORDER BY
|
||||||
|
lev
|
||||||
|
) INTO v_res
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
REGEXP_SUBSTR(ele, '\D*', 1) AS str,
|
||||||
|
LPAD(REGEXP_SUBSTR(ele, '\d+', 1), len, '0') AS num,
|
||||||
|
lev
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
REGEXP_SUBSTR(bh, '\D*\d+', 1, LEVEL) AS ele,
|
||||||
|
LEVEL AS lev
|
||||||
|
FROM
|
||||||
|
dual CONNECT BY REGEXP_SUBSTR(bh, '\D*\d+', 1, LEVEL) IS NOT NULL
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
RETURN v_res;
|
||||||
|
|
||||||
|
EXCEPTION
|
||||||
|
WHEN NO_DATA_FOUND THEN RETURN NULL;
|
||||||
|
|
||||||
|
WHEN OTHERS THEN DBMS_OUTPUT.PUT_LINE('Error: ' || SQLERRM);
|
||||||
|
|
||||||
|
RETURN NULL;
|
||||||
|
|
||||||
|
END hos_get_sortable_ref;
|
||||||
@@ -1 +1,25 @@
|
|||||||
这里会不定期发布一些泛微E9的自研功能代码
|
这里会不定期发布一些泛微E9的自研功能代码
|
||||||
|
|
||||||
|
阿拉伯数字转中文演示:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
页面横向滑动演示:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
星星评价演示:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
emoji评价演示:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
明细行渲染演示:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
明细行筛选演示:
|
||||||
|
|
||||||
|

|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
<svg id="emoji" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g id="color">
|
||||||
|
<path fill="#FCEA2B" d="M36,13c-12.6823,0-23,10.3177-23,23c0,12.6822,10.3177,23,23,23c12.6822,0,23-10.3178,23-23 C59,23.3177,48.6822,13,36,13z"/>
|
||||||
|
</g>
|
||||||
|
<g id="hair"/>
|
||||||
|
<g id="skin"/>
|
||||||
|
<g id="skin-shadow"/>
|
||||||
|
<g id="line">
|
||||||
|
<circle cx="36" cy="36" r="23" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-width="2"/>
|
||||||
|
<path d="M30,32.9252c0,1.6567-1.3448,3-3,3c-1.6553,0-3-1.3433-3-3c0-1.6553,1.3447-3,3-3C28.6552,29.9252,30,31.27,30,32.9252"/>
|
||||||
|
<path d="M48,32.9252c0,1.6567-1.3447,3-3,3s-3-1.3433-3-3c0-1.6553,1.3447-3,3-3S48,31.27,48,32.9252"/>
|
||||||
|
<line x1="23" x2="30" y1="24" y2="28" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
|
||||||
|
<line x1="49" x2="42" y1="24" y2="28" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
|
||||||
|
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M29.5,43c1.2841-0.6376,3.9847-1.0308,6.8421-0.9981c2.6235,0.03,4.9897,0.4146,6.1579,0.9981"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,17 @@
|
|||||||
|
<svg id="emoji" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g id="color">
|
||||||
|
<circle cx="36" cy="36" r="23" fill="#fcea2b"/>
|
||||||
|
<path fill="#fff" d="M50.595,41.64a11.5554,11.5554,0,0,1-.87,4.49c-12.49,3.03-25.43.34-27.49-.13a11.4347,11.4347,0,0,1-.83-4.36h.11s14.8,3.59,28.89.07Z"/>
|
||||||
|
<path fill="#fff" d="M49.7251,46.13c-1.79,4.27-6.35,7.23-13.69,7.23-7.41,0-12.03-3.03-13.8-7.36C24.2951,46.47,37.235,49.16,49.7251,46.13Z"/>
|
||||||
|
</g>
|
||||||
|
<g id="hair"/>
|
||||||
|
<g id="skin"/>
|
||||||
|
<g id="skin-shadow"/>
|
||||||
|
<g id="line">
|
||||||
|
<circle cx="36" cy="36" r="23" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||||
|
<path fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M50.595,41.64a11.5554,11.5554,0,0,1-.87,4.49c-12.49,3.03-25.43.34-27.49-.13a11.4347,11.4347,0,0,1-.83-4.36h.11s14.8,3.59,28.89.07Z"/>
|
||||||
|
<path fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M49.7251,46.13c-1.79,4.27-6.35,7.23-13.69,7.23-7.41,0-12.03-3.03-13.8-7.36C24.2951,46.47,37.235,49.16,49.7251,46.13Z"/>
|
||||||
|
<path fill="none" stroke="#000" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M31.6941,32.4036a4.7262,4.7262,0,0,0-8.6382,0"/>
|
||||||
|
<path fill="none" stroke="#000" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M48.9441,32.4036a4.7262,4.7262,0,0,0-8.6382,0"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,14 @@
|
|||||||
|
<svg id="emoji" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g id="color">
|
||||||
|
<path fill="#FCEA2B" d="M36,13c-12.6823,0-23,10.3177-23,23c0,12.6822,10.3177,23,23,23c12.6822,0,23-10.3178,23-23 C59,23.3177,48.6822,13,36,13z"/>
|
||||||
|
</g>
|
||||||
|
<g id="hair"/>
|
||||||
|
<g id="skin"/>
|
||||||
|
<g id="skin-shadow"/>
|
||||||
|
<g id="line">
|
||||||
|
<circle cx="36" cy="36" r="23" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-width="2"/>
|
||||||
|
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M26.5,48c1.8768-3.8326,5.8239-6.1965,10-6c3.8343,0.1804,7.2926,2.4926,9,6"/>
|
||||||
|
<path d="M30,31c0,1.6568-1.3448,3-3,3c-1.6553,0-3-1.3433-3-3c0-1.6552,1.3447-3,3-3C28.6552,28,30,29.3448,30,31"/>
|
||||||
|
<path d="M48,31c0,1.6568-1.3447,3-3,3s-3-1.3433-3-3c0-1.6552,1.3447-3,3-3S48,29.3448,48,31"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 862 B |
@@ -0,0 +1,14 @@
|
|||||||
|
<svg id="emoji" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g id="color">
|
||||||
|
<path fill="#FCEA2B" d="M36,13c-12.6823,0-23,10.3177-23,23c0,12.6822,10.3177,23,23,23c12.6822,0,23-10.3178,23-23 C59,23.3177,48.6822,13,36,13z"/>
|
||||||
|
</g>
|
||||||
|
<g id="hair"/>
|
||||||
|
<g id="skin"/>
|
||||||
|
<g id="skin-shadow"/>
|
||||||
|
<g id="line">
|
||||||
|
<circle cx="36" cy="36" r="23" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-width="2"/>
|
||||||
|
<line x1="27" x2="45" y1="43" y2="43" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
|
||||||
|
<path d="M30,31c0,1.6568-1.3448,3-3,3c-1.6553,0-3-1.3433-3-3c0-1.6552,1.3447-3,3-3C28.6552,28,30,29.3448,30,31"/>
|
||||||
|
<path d="M48,31c0,1.6568-1.3447,3-3,3s-3-1.3433-3-3c0-1.6552,1.3447-3,3-3S48,29.3448,48,31"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 816 B |
@@ -0,0 +1,14 @@
|
|||||||
|
<svg id="emoji" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g id="color">
|
||||||
|
<circle cx="36.0001" cy="36" r="22.9999" fill="#fcea2b"/>
|
||||||
|
</g>
|
||||||
|
<g id="hair"/>
|
||||||
|
<g id="skin"/>
|
||||||
|
<g id="skin-shadow"/>
|
||||||
|
<g id="line">
|
||||||
|
<circle cx="36" cy="36" r="23" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||||
|
<path fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M45.8147,45.2268a15.4294,15.4294,0,0,1-19.6294,0"/>
|
||||||
|
<path fill="none" stroke="#000" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M31.6941,33.4036a4.7262,4.7262,0,0,0-8.6382,0"/>
|
||||||
|
<path fill="none" stroke="#000" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M48.9441,33.4036a4.7262,4.7262,0,0,0-8.6382,0"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 830 B |
@@ -0,0 +1,22 @@
|
|||||||
|
<svg id="emoji" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g id="color">
|
||||||
|
<circle cx="36.0001" cy="36" r="24" fill="#FCEA2B"/>
|
||||||
|
<polygon fill="#F1B31C" points="25.0424,21.2371 33.0285,20.0364 29.1238,27.1056 32.7335,34.3298 24.8037,32.8007 19.0485,38.4662 18.0524,30.452 10.8857,26.7292 18.1999,23.3052 19.5258,15.3389"/>
|
||||||
|
<polygon fill="#F1B31C" points="46.8821,21.2371 38.896,20.0364 42.8007,27.1056 39.191,34.3298 47.1208,32.8007 52.876,38.4662 53.8721,30.452 61.0388,26.7292 53.7246,23.3052 52.3987,15.3389"/>
|
||||||
|
<path fill="#EA5A47" d="M49.7371,46.356c-1.79,4.27-6.35,7.23-13.7,7.23c-7.41,0-12.03-3.03-13.8-7.36 C24.2671,46.686,37.2171,49.3959,49.7371,46.356z"/>
|
||||||
|
<path fill="#FFFFFF" d="M50.6071,41.866c0,1.6-0.29,3.11-0.87,4.49c-12.52,3.04-25.47,0.33-27.5-0.13 c-0.55-1.35-0.83-2.82-0.83-4.36h0.11c0,0,14.81,3.59,28.89,0.07L50.6071,41.866z"/>
|
||||||
|
</g>
|
||||||
|
<g id="hair"/>
|
||||||
|
<g id="skin"/>
|
||||||
|
<g id="skin-shadow"/>
|
||||||
|
<g id="line">
|
||||||
|
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M50.6071,41.866c0,1.6-0.29,3.11-0.87,4.49c-12.52,3.04-25.47,0.33-27.5-0.13c-0.55-1.35-0.83-2.82-0.83-4.36h0.11 c0,0,14.81,3.59,28.89,0.07L50.6071,41.866z"/>
|
||||||
|
<path fill="none" stroke="#000000" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M49.7371,46.356 c-1.79,4.27-6.35,7.23-13.7,7.23c-7.41,0-12.03-3.03-13.8-7.36C24.2671,46.686,37.2171,49.3959,49.7371,46.356z"/>
|
||||||
|
<path fill="none" stroke="#000000" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M50.2271,46.236 c-0.16,0.04-0.33,0.08-0.49,0.12"/>
|
||||||
|
<path fill="none" stroke="#000000" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M22.2371,46.226 c-0.19-0.05-0.28-0.07-0.28-0.07"/>
|
||||||
|
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M46.5542,15.5591C43.3932,13.9237,39.8045,13,36,13c-3.9546,0-7.676,0.9979-10.9261,2.7556 c-0.0502,0.0271-0.1002,0.0544-0.1501,0.0819"/>
|
||||||
|
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M13.1945,32.9954c-0.1283,0.9833-0.1944,1.9862-0.1944,3.0046c0,12.7022,10.2969,23,23,23c12.7022,0,23-10.2978,23-23 c0-1.0073-0.0648-1.9995-0.1903-2.9726"/>
|
||||||
|
<polygon fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" points="25.1179,21.2371 33.104,20.0364 29.1993,27.1056 32.809,34.3298 24.8792,32.8007 19.124,38.4662 18.1279,30.452 10.9612,26.7292 18.2754,23.3052 19.6013,15.3389"/>
|
||||||
|
<polygon fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" points="46.8821,21.2371 38.896,20.0364 42.8007,27.1056 39.191,34.3298 47.1208,32.8007 52.876,38.4662 53.8721,30.452 61.0388,26.7292 53.7246,23.3052 52.3987,15.3389"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.9 KiB |
@@ -0,0 +1,222 @@
|
|||||||
|
/*
|
||||||
|
dom_id为字符串,表示单元格元素id,必填
|
||||||
|
fieldid为字符串,表示字段id,可把打星结果存入对应字段,必填
|
||||||
|
fieldValue为数组,表示每颗星对应的字段值,数组第0个值为0颗星的value,第1个值为第1个星的value,必填
|
||||||
|
noChoose为数字,表示是否允许取消选择,1表示允许,非1表示不允许,默认不允许,非必填
|
||||||
|
text_arr为数组,表示每颗星的备注,数组第0个值为0颗星的备注,实际无作用,第1个值为第1个星的备注,默认备注为“1星、2星”,非必填
|
||||||
|
size为数字,表示星星的大小,单位为px
|
||||||
|
justify_content为字符串,表示星星的横向布局,默认为“left”靠左,一般可选“right”和“center”
|
||||||
|
*/
|
||||||
|
function emojiRating(dom_id, fieldid, fieldValue, noChoose, text_arr, size, justify_content) {
|
||||||
|
let sr_size = size == undefined ? 20 : size;
|
||||||
|
let sr_justify_content = justify_content == undefined ? "left" : justify_content;
|
||||||
|
let sr_noChoose = noChoose == 1 ? 1 : 0;
|
||||||
|
let sr_text_arr = [];
|
||||||
|
if (text_arr == undefined || text_arr.length != fieldValue.length) {
|
||||||
|
fieldValue.forEach((e, index) => {
|
||||||
|
sr_text_arr.push(index + "星");
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
sr_text_arr = text_arr;
|
||||||
|
}
|
||||||
|
//添加CSS样式
|
||||||
|
let style = document.createElement('style');
|
||||||
|
let css = `
|
||||||
|
.${dom_id}_rating:not(:checked) > input {
|
||||||
|
position: absolute;
|
||||||
|
appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dom_id}_rating:not(:checked) > label {
|
||||||
|
float: right;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: ${sr_size}px;
|
||||||
|
fill: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dom_id}_rating:not(:checked) > label > svg {
|
||||||
|
fill: #fff; /* Set default color for SVG */
|
||||||
|
transition: fill 0.3s ease; /* Add a transition effect */
|
||||||
|
opacity: 0.3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dom_id}_rating > input:checked + label:hover svg {
|
||||||
|
fill: #e58e09;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dom_id}_rating:not(:checked) > label:hover svg {
|
||||||
|
fill: #ff9e0b;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dom_id}_rating > input:checked + label > svg {
|
||||||
|
fill: #fcea2b; /* Set color for selected stars */
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dom_id}_rating {
|
||||||
|
display: flex;
|
||||||
|
justify-content: ${sr_justify_content};
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
}`;
|
||||||
|
if (style.styleSheet) {
|
||||||
|
// 针对 IE
|
||||||
|
style.styleSheet.cssText = css;
|
||||||
|
} else {
|
||||||
|
// 其他浏览器
|
||||||
|
style.appendChild(document.createTextNode(css));
|
||||||
|
}
|
||||||
|
document.head.appendChild(style);
|
||||||
|
//添加图表标
|
||||||
|
$(`#${dom_id}`).append(`<div class="${dom_id}_rating"></div>`);
|
||||||
|
for (let i = fieldValue.length - 1; i > 0; i--) {
|
||||||
|
let emoji_svg;
|
||||||
|
switch (i) {
|
||||||
|
case 1:
|
||||||
|
emoji_svg = `<svg id="angry_face" viewBox="0 0 72 72" height="1.5em" class="emoji">
|
||||||
|
<g id="color">
|
||||||
|
<path d="M36,13c-12.6823,0-23,10.3177-23,23c0,12.6822,10.3177,23,23,23c12.6822,0,23-10.3178,23-23 C59,23.3177,48.6822,13,36,13z"/>
|
||||||
|
</g>
|
||||||
|
<g id="hair"/>
|
||||||
|
<g id="skin"/>
|
||||||
|
<g id="skin-shadow"/>
|
||||||
|
<g id="line">
|
||||||
|
<circle cx="36" cy="36" r="23" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-width="2"/>
|
||||||
|
<path fill="#000" d="M30,32.9252c0,1.6567-1.3448,3-3,3c-1.6553,0-3-1.3433-3-3c0-1.6553,1.3447-3,3-3C28.6552,29.9252,30,31.27,30,32.9252"/>
|
||||||
|
<path fill="#000" d="M48,32.9252c0,1.6567-1.3447,3-3,3s-3-1.3433-3-3c0-1.6553,1.3447-3,3-3S48,31.27,48,32.9252"/>
|
||||||
|
<line x1="23" x2="30" y1="24" y2="28" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
|
||||||
|
<line x1="49" x2="42" y1="24" y2="28" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
|
||||||
|
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M29.5,43c1.2841-0.6376,3.9847-1.0308,6.8421-0.9981c2.6235,0.03,4.9897,0.4146,6.1579,0.9981"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
`;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
emoji_svg = `<svg id="frowning_face" viewBox="0 0 72 72" height="1.5em" class="emoji">
|
||||||
|
<g id="color">
|
||||||
|
<path d="M36,13c-12.6823,0-23,10.3177-23,23c0,12.6822,10.3177,23,23,23c12.6822,0,23-10.3178,23-23 C59,23.3177,48.6822,13,36,13z"/>
|
||||||
|
</g>
|
||||||
|
<g id="hair"/>
|
||||||
|
<g id="skin"/>
|
||||||
|
<g id="skin-shadow"/>
|
||||||
|
<g id="line">
|
||||||
|
<circle cx="36" cy="36" r="23" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-width="2"/>
|
||||||
|
<path fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2" d="M26.5,48c1.8768-3.8326,5.8239-6.1965,10-6c3.8343,0.1804,7.2926,2.4926,9,6"/>
|
||||||
|
<path fill="#000" d="M30,31c0,1.6568-1.3448,3-3,3c-1.6553,0-3-1.3433-3-3c0-1.6552,1.3447-3,3-3C28.6552,28,30,29.3448,30,31"/>
|
||||||
|
<path fill="#000" d="M48,31c0,1.6568-1.3447,3-3,3s-3-1.3433-3-3c0-1.6552,1.3447-3,3-3S48,29.3448,48,31"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
`;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
emoji_svg = `<svg id="neutral_face" viewBox="0 0 72 72" height="1.5em" class="emoji">
|
||||||
|
<g id="color">
|
||||||
|
<path d="M36,13c-12.6823,0-23,10.3177-23,23c0,12.6822,10.3177,23,23,23c12.6822,0,23-10.3178,23-23 C59,23.3177,48.6822,13,36,13z"/>
|
||||||
|
</g>
|
||||||
|
<g id="hair"/>
|
||||||
|
<g id="skin"/>
|
||||||
|
<g id="skin-shadow"/>
|
||||||
|
<g id="line">
|
||||||
|
<circle cx="36" cy="36" r="23" fill="none" stroke="#000000" stroke-miterlimit="10" stroke-width="2"/>
|
||||||
|
<line x1="27" x2="45" y1="43" y2="43" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-width="2"/>
|
||||||
|
<path fill="#000" d="M30,31c0,1.6568-1.3448,3-3,3c-1.6553,0-3-1.3433-3-3c0-1.6552,1.3447-3,3-3C28.6552,28,30,29.3448,30,31"/>
|
||||||
|
<path fill="#000" d="M48,31c0,1.6568-1.3447,3-3,3s-3-1.3433-3-3c0-1.6552,1.3447-3,3-3S48,29.3448,48,31"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
`;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
emoji_svg = `<svg id="smiling_face" viewBox="0 0 72 72" height="1.5em" class="emoji">
|
||||||
|
<g id="color">
|
||||||
|
<circle cx="36.0001" cy="36" r="22.9999"/>
|
||||||
|
</g>
|
||||||
|
<g id="hair"/>
|
||||||
|
<g id="skin"/>
|
||||||
|
<g id="skin-shadow"/>
|
||||||
|
<g id="line">
|
||||||
|
<circle cx="36" cy="36" r="23" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||||
|
<path fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M45.8147,45.2268a15.4294,15.4294,0,0,1-19.6294,0"/>
|
||||||
|
<path fill="none" stroke="#000" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M31.6941,33.4036a4.7262,4.7262,0,0,0-8.6382,0"/>
|
||||||
|
<path fill="none" stroke="#000" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M48.9441,33.4036a4.7262,4.7262,0,0,0-8.6382,0"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
`;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
emoji_svg = `<svg id="beaming_face" viewBox="0 0 72 72" height="1.5em" class="emoji">
|
||||||
|
<g id="color">
|
||||||
|
<circle cx="36" cy="36" r="23"/>
|
||||||
|
<path fill="#fff" d="M50.595,41.64a11.5554,11.5554,0,0,1-.87,4.49c-12.49,3.03-25.43.34-27.49-.13a11.4347,11.4347,0,0,1-.83-4.36h.11s14.8,3.59,28.89.07Z"/>
|
||||||
|
<path fill="#fff" d="M49.7251,46.13c-1.79,4.27-6.35,7.23-13.69,7.23-7.41,0-12.03-3.03-13.8-7.36C24.2951,46.47,37.235,49.16,49.7251,46.13Z"/>
|
||||||
|
</g>
|
||||||
|
<g id="hair"/>
|
||||||
|
<g id="skin"/>
|
||||||
|
<g id="skin-shadow"/>
|
||||||
|
<g id="line">
|
||||||
|
<circle cx="36" cy="36" r="23" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||||
|
<path fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M50.595,41.64a11.5554,11.5554,0,0,1-.87,4.49c-12.49,3.03-25.43.34-27.49-.13a11.4347,11.4347,0,0,1-.83-4.36h.11s14.8,3.59,28.89.07Z"/>
|
||||||
|
<path fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M49.7251,46.13c-1.79,4.27-6.35,7.23-13.69,7.23-7.41,0-12.03-3.03-13.8-7.36C24.2951,46.47,37.235,49.16,49.7251,46.13Z"/>
|
||||||
|
<path fill="none" stroke="#000" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M31.6941,32.4036a4.7262,4.7262,0,0,0-8.6382,0"/>
|
||||||
|
<path fill="none" stroke="#000" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M48.9441,32.4036a4.7262,4.7262,0,0,0-8.6382,0"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
`;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
emoji_svg = `<svg
|
||||||
|
viewBox="0 0 576 512"
|
||||||
|
height="1em"
|
||||||
|
class="star-solid"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"
|
||||||
|
></path></svg>
|
||||||
|
`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$(`.${dom_id}_rating`).append(`<input type="radio" id="${dom_id}_star${i}" data-checked=0 name="${dom_id}_rate" value="${i}" />
|
||||||
|
<label for="${dom_id}_star${i}" title="${sr_text_arr[i]}"
|
||||||
|
>${emoji_svg}</label>`);
|
||||||
|
}
|
||||||
|
let initial_num = WfForm.getFieldValue(fieldid);
|
||||||
|
if (initial_num !== undefined && initial_num !== "") {
|
||||||
|
for (let i = 0; i < fieldValue.length; i++) {
|
||||||
|
if (fieldValue[i] == +initial_num) {
|
||||||
|
if (i > 0) {
|
||||||
|
$(`#${dom_id}_star${i}`).attr({ checked: true });
|
||||||
|
if (sr_noChoose == 1) {
|
||||||
|
$(`#${dom_id}_star${i}`)[0].setAttribute('data-checked', 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (sr_noChoose == 1) {
|
||||||
|
for (let i = 1; i < fieldValue.length; i++) {
|
||||||
|
$(`#${dom_id}_star${i}`).click((event) => {
|
||||||
|
if (event.target.getAttribute('data-checked') == 1) {
|
||||||
|
event.target.checked = false;
|
||||||
|
event.target.setAttribute('data-checked', 0);
|
||||||
|
WfForm.changeFieldValue(fieldid, { value: fieldValue[0] });
|
||||||
|
} else {
|
||||||
|
fieldValue.forEach((e, index) => {
|
||||||
|
if (index > 0 && index != i) {
|
||||||
|
$(`#${dom_id}_star${index}`)[0].setAttribute('data-checked', 0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
event.target.setAttribute('data-checked', 1);
|
||||||
|
WfForm.changeFieldValue(fieldid, { value: fieldValue[i] });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = 1; i < fieldValue.length; i++) {
|
||||||
|
$(`#${dom_id}_star${i}`).click(() => {
|
||||||
|
WfForm.changeFieldValue(fieldid, { value: fieldValue[i] });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
.myCSS.inputNum .wf-form-input input {
|
||||||
|
text-align: right !important;
|
||||||
|
padding-right: 7px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.myCSS.inputOnlyButtomBorder .wf-form-input input {
|
||||||
|
border-top-style: none !important;
|
||||||
|
border-left-style: none !important;
|
||||||
|
border-right-style: none !important;
|
||||||
|
}
|
||||||
@@ -0,0 +1,316 @@
|
|||||||
|
async function longStringSplit(string) {
|
||||||
|
let strExcerpt = string.replaceAll("'", "''");
|
||||||
|
let uuid = getCurrentDateTime() + " " + generateUUID();
|
||||||
|
let i = 1;
|
||||||
|
while (strExcerpt.length > 0) {
|
||||||
|
let res = await $.post(`/api/esb/oa/execute?eventkey=LongStringSplit¶ms={"uuid":"${uuid}","excerpt":"${strExcerpt.slice(0, 500)}","order":${i},"maxRunNum":3}`);
|
||||||
|
strExcerpt = strExcerpt.slice(500);
|
||||||
|
i++;
|
||||||
|
if (JSON.parse(res).flag == 0) {
|
||||||
|
alert("LongStringSplit接口有误,请联系管理员!");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateUUID() {
|
||||||
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||||
|
const r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
|
||||||
|
return v.toString(16);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCurrentDateTime() {
|
||||||
|
const now = new Date();
|
||||||
|
const pad = num => String(num).padStart(2, '0');
|
||||||
|
const formattedDateTime = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())} ${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`;
|
||||||
|
return formattedDateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
function detailresFromESBFormat(str, attr_name) {
|
||||||
|
let res = [];
|
||||||
|
JSON.parse(str)[attr_name].forEach(res_i => {
|
||||||
|
res.push(JSON.parse(res_i));
|
||||||
|
});
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------AgGrid工具类库
|
||||||
|
class CusLoadingOverlay {
|
||||||
|
eGui;
|
||||||
|
|
||||||
|
init(params) {
|
||||||
|
this.eGui = document.createElement('div');
|
||||||
|
this.refresh(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
getGui() {
|
||||||
|
return this.eGui;
|
||||||
|
}
|
||||||
|
|
||||||
|
refresh(params) {
|
||||||
|
this.eGui.innerHTML = `<div class="ant-spin ant-spin-spinning ant-spin-show-text"><span class="ant-spin-dot ant-spin-dot-spin"><i></i><i></i><i></i><i></i></span><div class="ant-spin-text">${params.loadingMessage}</div></div>`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AgGridColumnDef {
|
||||||
|
colDef = { headerClass: 'myGridHeader' };
|
||||||
|
type;
|
||||||
|
decimal;
|
||||||
|
noNegative;
|
||||||
|
|
||||||
|
constructor({ headerName, field = null, type = 'text', decimal = 2, noNegative = true, divColDef = {} } = {}) {
|
||||||
|
this.type = type;
|
||||||
|
this.colDef.headerName = headerName;
|
||||||
|
if (field) {
|
||||||
|
this.colDef.field = field;
|
||||||
|
}
|
||||||
|
switch (type) {
|
||||||
|
case 'text':
|
||||||
|
this.beTextCol();
|
||||||
|
break;
|
||||||
|
case 'order':
|
||||||
|
this.beOrderCol();
|
||||||
|
break;
|
||||||
|
case 'number':
|
||||||
|
this.beNumCol({ decimal, noNegative });
|
||||||
|
this.decimal = decimal;
|
||||||
|
this.noNegative = noNegative;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.beDivCol(divColDef);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
reField(field) {
|
||||||
|
try {
|
||||||
|
if (typeof field === 'string') {
|
||||||
|
this.colDef.field = field;
|
||||||
|
} else {
|
||||||
|
throw new Error('field参数类型错误');
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
beOrderCol({ minWidth = 60, maxWidth = 60, pinned = 'left' } = {}) {
|
||||||
|
this.type = 'order';
|
||||||
|
let { headerName, field, headerClass } = this.colDef;
|
||||||
|
this.colDef = { headerName, field, headerClass };
|
||||||
|
this.colDef.valueGetter = (params) => {
|
||||||
|
if (params.node.rowPinned) {
|
||||||
|
return "";
|
||||||
|
} else {
|
||||||
|
return params.node.rowIndex + 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.colDef.cellStyle = { 'white-space': 'normal', 'word-break': 'break-all', 'line-height': '1.1', 'display': 'flex', 'align-items': 'center', 'justify-content': 'center', 'text-align': 'center' };
|
||||||
|
this.colDef.minWidth = minWidth;
|
||||||
|
this.colDef.maxWidth = maxWidth;
|
||||||
|
this.colDef.pinned = pinned;
|
||||||
|
this.colDef.suppressHeaderMenuButton = true;
|
||||||
|
this.colDef.suppressMenu = true;
|
||||||
|
this.colDef.sortable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
beTextCol({ minWidth, maxWidth, pinned, colSpan, cellClassRules, valueSetter, valueFormatter, valueParser, filter, cellStyle = {}, editable = false } = {}) {
|
||||||
|
this.type = 'text';
|
||||||
|
let { headerName, field, headerClass } = this.colDef;
|
||||||
|
this.colDef = { headerName, field, headerClass };
|
||||||
|
|
||||||
|
if (minWidth) this.colDef.minWidth = minWidth;
|
||||||
|
if (maxWidth) this.colDef.maxWidth = maxWidth;
|
||||||
|
if (pinned) this.colDef.pinned = pinned;
|
||||||
|
if (colSpan) this.colDef.colSpan = colSpan;
|
||||||
|
if (cellClassRules) this.colDef.cellClassRules = cellClassRules;
|
||||||
|
if (valueFormatter) this.colDef.valueFormatter = valueFormatter;
|
||||||
|
if (valueParser) this.colDef.valueParser = valueParser;
|
||||||
|
|
||||||
|
this.colDef.valueSetter = valueSetter ? valueSetter : params => {
|
||||||
|
let newValue = String(params.newValue || '').trim();
|
||||||
|
if (params.oldValue === newValue) return false;
|
||||||
|
params.data[params.column.colId] = newValue;
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
this.colDef.filter = filter ? filter : "agSetColumnFilter";
|
||||||
|
if (typeof cellStyle == 'function') {
|
||||||
|
this.colDef.cellStyle = params => {
|
||||||
|
return Object.assign({ 'white-space': 'normal', 'word-break': 'break-all', 'line-height': '1.3', 'display': 'flex', 'align-items': 'center', 'justify-content': 'left', 'text-align': 'left', 'font-weight': 'bold' }, cellStyle(params));
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
this.colDef.cellStyle = Object.assign({ 'white-space': 'normal', 'word-break': 'break-all', 'line-height': '1.3', 'display': 'flex', 'align-items': 'center', 'justify-content': 'left', 'text-align': 'left', 'font-weight': 'bold' }, cellStyle);
|
||||||
|
}
|
||||||
|
this.colDef.editable = editable;
|
||||||
|
}
|
||||||
|
|
||||||
|
beNumCol({ decimal, noNegative, minWidth, maxWidth, pinned, colSpan, cellClassRules, valueSetter, valueFormatter, valueParser, filter, cellStyle = {}, editable = false } = {}) {
|
||||||
|
this.type = 'number';
|
||||||
|
this.decimal = decimal;
|
||||||
|
this.noNegative = noNegative;
|
||||||
|
let { headerName, field, headerClass } = this.colDef;
|
||||||
|
this.colDef = { headerName, field, headerClass };
|
||||||
|
|
||||||
|
if (minWidth) this.colDef.minWidth = minWidth;
|
||||||
|
if (maxWidth) this.colDef.maxWidth = maxWidth;
|
||||||
|
if (pinned) this.colDef.pinned = pinned;
|
||||||
|
if (colSpan) this.colDef.colSpan = colSpan;
|
||||||
|
if (cellClassRules) this.colDef.cellClassRules = cellClassRules;
|
||||||
|
|
||||||
|
this.colDef.valueSetter = valueSetter ? valueSetter : params => {
|
||||||
|
let newValue = AgGridCommonFunc.isLegalValue(String(params.newValue), 'number', { decimal: decimal, noNegative: noNegative }).value;
|
||||||
|
if (params.oldValue === newValue) return false;
|
||||||
|
params.data[params.column.colId] = newValue;
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
this.colDef.valueFormatter = valueFormatter ? valueFormatter : params => {
|
||||||
|
return AgGridCommonFunc.numberFormatter(params.value, decimal);
|
||||||
|
};
|
||||||
|
this.colDef.valueParser = valueParser ? valueParser : params => {
|
||||||
|
let newValue = AgGridCommonFunc.isLegalValue(String(params.newValue), 'number', { decimal: decimal, noNegative: noNegative });
|
||||||
|
if (!newValue.flag) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return newValue.value;
|
||||||
|
};
|
||||||
|
this.colDef.filter = filter ? filter : "agNumberColumnFilter";
|
||||||
|
if (typeof cellStyle == 'function') {
|
||||||
|
this.colDef.cellStyle = params => {
|
||||||
|
return Object.assign({ 'white-space': 'normal', 'word-break': 'break-all', 'line-height': '1.1', 'display': 'flex', 'align-items': 'center', 'justify-content': 'right', 'text-align': 'right', 'font-weight': 'bold' }, cellStyle(params));
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
this.colDef.cellStyle = Object.assign({ 'white-space': 'normal', 'word-break': 'break-all', 'line-height': '1.1', 'display': 'flex', 'align-items': 'center', 'justify-content': 'right', 'text-align': 'right', 'font-weight': 'bold' }, cellStyle);
|
||||||
|
}
|
||||||
|
this.colDef.editable = editable;
|
||||||
|
}
|
||||||
|
|
||||||
|
beDivCol(divColDef) {
|
||||||
|
this.type = 'div';
|
||||||
|
let { headerName, field, headerClass } = this.colDef;
|
||||||
|
this.colDef = Object.assign({ headerName, field, headerClass }, divColDef);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AgGridOption {
|
||||||
|
gridOptions = {
|
||||||
|
localeText: window.agGridLocaleCN,
|
||||||
|
undoRedoCellEditing: true,
|
||||||
|
undoRedoCellEditingLimit: 20,
|
||||||
|
alwaysMultiSort: true,
|
||||||
|
defaultColDef: {
|
||||||
|
flex: 1,
|
||||||
|
autoHeight: true,
|
||||||
|
},
|
||||||
|
suppressAggFuncInHeader: true,
|
||||||
|
cellSelection: { handle: { mode: 'range', } },
|
||||||
|
rowSelection: {
|
||||||
|
mode: "multiRow",
|
||||||
|
selectAll: 'filtered',
|
||||||
|
},
|
||||||
|
selectionColumnDef: {
|
||||||
|
sortable: false,
|
||||||
|
resizable: false,
|
||||||
|
width: 36,
|
||||||
|
suppressHeaderMenuButton: true,
|
||||||
|
pinned: 'left',
|
||||||
|
headerClass: 'myGridHeader myCheckHeader',
|
||||||
|
cellStyle: { 'padding-left': '10px', 'padding-right': '5px' },
|
||||||
|
},
|
||||||
|
loading: false,
|
||||||
|
loadingOverlayComponent: CusLoadingOverlay,
|
||||||
|
loadingOverlayComponentParams: {
|
||||||
|
loadingMessage: "加载中...",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
constructor({ colDefs, columnDefs, rowData, getRowId, isTree = false, onCellClicked, onCellValueChanged, onFilterChanged, onSortChanged, onGridReady, onRowDataUpdated, onRowSelected, onFirstDataRendered, processCellFromClipboard } = {}) {
|
||||||
|
let clipboardNumSetters = new Map();
|
||||||
|
if (colDefs) {
|
||||||
|
this.gridOptions.columnDefs = [];
|
||||||
|
colDefs.forEach(col => {
|
||||||
|
this.gridOptions.columnDefs.push(col.colDef);
|
||||||
|
if (col.type == 'number' && col.colDef.field) {
|
||||||
|
clipboardNumSetters.set(col.colDef.field, { decimal: col.decimal, noNegative: col.noNegative });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.gridOptions.columnDefs = columnDefs;
|
||||||
|
}
|
||||||
|
this.gridOptions.rowData = rowData;// [对象]
|
||||||
|
this.gridOptions.getRowId = getRowId ? getRowId : params => String(params.data.rowID);// func
|
||||||
|
this.gridOptions.treeData = isTree;// true Or false
|
||||||
|
this.gridOptions.onCellClicked = onCellClicked ? onCellClicked : params => {
|
||||||
|
let isEditing = gridApi.getEditingCells().some(c => c.rowIndex === params.rowIndex && c.colId === params.column.colId && c.rowPinned === params.rowPinned);
|
||||||
|
if (!isEditing && !params.event.shiftKey) {
|
||||||
|
params.api.startEditingCell({ rowIndex: params.rowIndex, colKey: params.column.colId });
|
||||||
|
}
|
||||||
|
};// func
|
||||||
|
if (onCellValueChanged) this.gridOptions.onCellValueChanged = onCellValueChanged;// func
|
||||||
|
if (onFilterChanged) this.gridOptions.onFilterChanged = onFilterChanged;// func
|
||||||
|
if (onSortChanged) this.gridOptions.onSortChanged = onSortChanged;// func
|
||||||
|
if (onGridReady) this.gridOptions.onGridReady = onGridReady;// func
|
||||||
|
if (onRowDataUpdated) this.gridOptions.onRowDataUpdated = onRowDataUpdated;// func
|
||||||
|
if (onRowSelected) this.gridOptions.onRowSelected = onRowSelected;// func
|
||||||
|
if (onFirstDataRendered) this.gridOptions.onFirstDataRendered = onFirstDataRendered;// func
|
||||||
|
if (processCellFromClipboard) {// func
|
||||||
|
this.gridOptions.processCellFromClipboard = processCellFromClipboard;
|
||||||
|
} else if (clipboardNumSetters.size > 0) {
|
||||||
|
this.gridOptions.processCellFromClipboard = params => {
|
||||||
|
if (clipboardNumSetters.has(params.column.colId)) {
|
||||||
|
let col_i = clipboardNumSetters.get(params.column.colId);
|
||||||
|
return AgGridCommonFunc.isLegalValue(String(params.value), 'number', { decimal: col_i.decimal, noNegative: col_i.noNegative }).value;
|
||||||
|
}
|
||||||
|
return params.value;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ------------------------------------AgGrid公共函数
|
||||||
|
class AgGridCommonFunc {
|
||||||
|
static numberFormatter(num, decimalNum) {
|
||||||
|
if (num == null || String(num).trim().length == 0) return null;
|
||||||
|
let varArr = String(num).split(".");
|
||||||
|
let big = Number(varArr[0]).toLocaleString();
|
||||||
|
if (decimalNum > 0) {
|
||||||
|
let decimal = varArr.length > 1 ? varArr[1] + '000000' : '000000';
|
||||||
|
decimal = decimal.slice(0, decimalNum);
|
||||||
|
return big + '.' + decimal;
|
||||||
|
} else {
|
||||||
|
return big;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static isLegalValue(value, type, params) {
|
||||||
|
switch (type) {
|
||||||
|
case 'number':
|
||||||
|
if (value == null || value.trim().length == 0) return { flag: false, value: null };
|
||||||
|
let number_res;
|
||||||
|
let varArr = String(value).split(".");
|
||||||
|
if (varArr.length > 2) return { flag: false, value: null };
|
||||||
|
if (varArr.length > 1) {
|
||||||
|
number_res = varArr[0].replace(/,(\d{3})/g, '$1') + '.' + varArr[1];
|
||||||
|
} else {
|
||||||
|
number_res = varArr[0].replace(/,(\d{3})/g, '$1');
|
||||||
|
}
|
||||||
|
if (isNaN(number_res)) return { flag: false, value: null };
|
||||||
|
if (params.noNegative && Number(number_res) < 0) return { flag: false, value: null };
|
||||||
|
let decimal = Math.pow(10, params.decimal);
|
||||||
|
number_res = Math.round(number_res * decimal) / decimal;
|
||||||
|
return { flag: true, value: number_res };
|
||||||
|
case 'duration':
|
||||||
|
if (value == null) return { flag: false, value: null };
|
||||||
|
let durVarStr = value.replace(/\s/g, '');
|
||||||
|
let durVarArr1 = durVarStr.match(/^\d\d:\d\d-\d\d:\d\d$/g);
|
||||||
|
if (durVarArr1) {
|
||||||
|
let durVarArr2 = durVarStr.match(/\d\d:\d\d/g);
|
||||||
|
if (durVarArr2[0] > durVarArr2[1]) return { flag: false, value: null };
|
||||||
|
return { flag: true, value: durVarArr2[0] + ' - ' + durVarArr2[1] };
|
||||||
|
}
|
||||||
|
return { flag: false, value: null };
|
||||||
|
default:
|
||||||
|
return { flag: true, value: value };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
// let originalString = "北京市(市)";
|
||||||
|
// let encodedString = encodeURIComponent(originalString);
|
||||||
|
|
||||||
|
let htmlString = await $.get(`http://xzqh.mca.gov.cn/defaultQuery?shengji=-1&diji=-1&xianji=-1`);
|
||||||
|
htmlString = htmlString.replace(/(\r\n|\n|\r)+/g, ' ').trim();
|
||||||
|
let parser = new DOMParser();
|
||||||
|
let doc = parser.parseFromString(htmlString, "text/html");
|
||||||
|
let match = /(?<=var\s+json\s*=\s*)\[.*?\](?=\s*;)/gs;
|
||||||
|
let provinceList = JSON.parse(doc.getElementsByTagName('script')[21].textContent.match(match)[0]);
|
||||||
|
let baseInfo = JSON.parse(doc.getElementById('pyArr').value);
|
||||||
|
let res = [];
|
||||||
|
res = res.concat(pushRes(provinceList.map(e => e.quHuaDaiMa), null, 1));
|
||||||
|
|
||||||
|
for (let i = 0; i < provinceList.length; i++) {
|
||||||
|
let cityList = await getChildRegion(provinceList[i].quHuaDaiMa);
|
||||||
|
if (cityList.length) {
|
||||||
|
// 将结果纳入树型数据
|
||||||
|
res = res.concat(pushRes(cityList, provinceList[i].quHuaDaiMa, 2));
|
||||||
|
for (let j = 0; j < cityList.length; j++) {
|
||||||
|
let districtList = await getChildRegion(cityList[j]);
|
||||||
|
if (districtList.length) {
|
||||||
|
// 将结果纳入树型数据
|
||||||
|
res = res.concat(pushRes(districtList, cityList[j], 3));
|
||||||
|
} else {
|
||||||
|
res.find(e => e.code == cityList[j]).level = 3;
|
||||||
|
// 补一个市,与省同名
|
||||||
|
if (res.filter(f => f.code == provinceList[i].quHuaDaiMa && f.level == 2).length == 0) {
|
||||||
|
res = res.concat(pushRes([provinceList[i].quHuaDaiMa], provinceList[i].quHuaDaiMa, 2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转换为树形结构
|
||||||
|
let resArr = [];
|
||||||
|
|
||||||
|
for (let i = 0; i < 3; i++) {
|
||||||
|
if (i == 0) {
|
||||||
|
resArr = resArr.concat(res.filter(e => e.level == i + 1));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
res.filter(e => e.level == i).forEach(fe => {
|
||||||
|
fe.children = res.filter(fl => fl.parentCode == fe.code && fl.level == i + 1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
console.log(resArr);
|
||||||
|
|
||||||
|
function pushRes(resList, parentCode, level) {
|
||||||
|
let res = [];
|
||||||
|
resList.forEach(e => {
|
||||||
|
let eObj = baseInfo.find(f => f.code == e);
|
||||||
|
res.push({
|
||||||
|
code: e,
|
||||||
|
name: eObj.cName,
|
||||||
|
py: eObj.py.match(/[^\s]+/g)[0],
|
||||||
|
jp: eObj.jp,
|
||||||
|
parentCode: parentCode,
|
||||||
|
level: level
|
||||||
|
});
|
||||||
|
});
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getChildRegion(parentRegion) {
|
||||||
|
let result = await fetch(`http://xzqh.mca.gov.cn/getInfo?code=${parentRegion}&type=2`)
|
||||||
|
let child;
|
||||||
|
try {
|
||||||
|
child = await result.json();
|
||||||
|
return Object.keys(child);
|
||||||
|
} catch (error) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
部分旧字段确认已经没有引用了,但是泛微删除一直提示字段被引用。
|
||||||
|
检查过泛微的代码,应该是某种情况之下,泛微存在bug,没有删除引用。在这里通过泛微底层检测的sql查到数据后删除,清理缓存即可。
|
||||||
|
|
||||||
|
SELECT a.formula formula, a.TRIGGERS triggers, b.nodename nodename FROM WORKFLOW_FORMULA_HTMLLAYOUT a LEFT JOIN WORKFLOW_NODEBASE b ON a.NODEID = b.id WHERE a.FORMID = -967//表单id and exists(select 1 from workflow_nodehtmllayout c where a.layoutid = c.id) and a.formula like '%97966%' //字段id
|
||||||
|
|
||||||
|
delete WORKFLOW_FORMULA_HTMLLAYOUT where TRIGGERS='1#93015##1#97966'
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
//需要是oa已经登陆的用户或者是本地服务发起
|
||||||
|
|
||||||
|
const tmpObj = { tableName: 'uf_oli_dt1' }
|
||||||
|
const urlencodedBody = new URLSearchParams(tmpObj).toString();
|
||||||
|
|
||||||
|
const done = await fetch('http://127.0.0.1:8088/api/cleanCache', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Accept': 'application/json',
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: urlencodedBody,
|
||||||
|
})
|
||||||
|
// 确保响应是文本
|
||||||
|
const result1 = await done.text();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
JSON.parse(localStorage.ecode_params)._user
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
|
|
||||||
|
|
||||||
MERGE INTO uf_WLHJMK a
|
MERGE INTO uf_WLHJMK a
|
||||||
USING (
|
USING (
|
||||||
WITH tmp AS (
|
WITH tmp AS (
|
||||||
@@ -24,7 +23,7 @@ tmp2 AS (
|
|||||||
AND PRIOR DBMS_RANDOM.VALUE IS NOT NULL
|
AND PRIOR DBMS_RANDOM.VALUE IS NOT NULL
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT id,
|
SELECT id,
|
||||||
NVL2(glgcxxsjd, '58505_gcgc' || SUBSTR(','||TO_CHAR(glgcgc)||',', INSTR(','||TO_CHAR(glgcgc)||',', ',', 1, LEVEL) + 1, INSTR(','||TO_CHAR(glgcgc)||',', ',', 1, LEVEL + 1) - INSTR(','||TO_CHAR(glgcgc)||',', ',', 1, LEVEL) - 1),'')
|
NVL2(glgcgc, '58505_gcgc' || SUBSTR(','||TO_CHAR(glgcgc)||',', INSTR(','||TO_CHAR(glgcgc)||',', ',', 1, LEVEL) + 1, INSTR(','||TO_CHAR(glgcgc)||',', ',', 1, LEVEL + 1) - INSTR(','||TO_CHAR(glgcgc)||',', ',', 1, LEVEL) - 1),'')
|
||||||
FROM tmp
|
FROM tmp
|
||||||
CONNECT BY LEVEL <= LENGTH(glgcgc) - LENGTH(REPLACE(glgcgc, ',', '')) + 1
|
CONNECT BY LEVEL <= LENGTH(glgcgc) - LENGTH(REPLACE(glgcgc, ',', '')) + 1
|
||||||
AND PRIOR id = id
|
AND PRIOR id = id
|
||||||
@@ -32,7 +31,7 @@ tmp2 AS (
|
|||||||
|
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT id,
|
SELECT id,
|
||||||
NVL2(glgcxxsjd, '58505_zb' || SUBSTR(','||TO_CHAR(glzbgl)||',', INSTR(','||TO_CHAR(glzbgl)||',', ',', 1, LEVEL) + 1, INSTR(','||TO_CHAR(glzbgl)||',', ',', 1, LEVEL + 1) - INSTR(','||TO_CHAR(glzbgl)||',', ',', 1, LEVEL) - 1),'')
|
NVL2(glzbgl, '58505_zb' || SUBSTR(','||TO_CHAR(glzbgl)||',', INSTR(','||TO_CHAR(glzbgl)||',', ',', 1, LEVEL) + 1, INSTR(','||TO_CHAR(glzbgl)||',', ',', 1, LEVEL + 1) - INSTR(','||TO_CHAR(glzbgl)||',', ',', 1, LEVEL) - 1),'')
|
||||||
FROM tmp
|
FROM tmp
|
||||||
CONNECT BY LEVEL <= LENGTH(glzbgl) - LENGTH(REPLACE(glzbgl, ',', '')) + 1
|
CONNECT BY LEVEL <= LENGTH(glzbgl) - LENGTH(REPLACE(glzbgl, ',', '')) + 1
|
||||||
AND PRIOR id = id
|
AND PRIOR id = id
|
||||||
@@ -40,7 +39,7 @@ tmp2 AS (
|
|||||||
|
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT id,
|
SELECT id,
|
||||||
NVL2(glgcxxsjd, '58505_ht' || SUBSTR(','||TO_CHAR(glhtgl)||',', INSTR(','||TO_CHAR(glhtgl)||',', ',', 1, LEVEL) + 1, INSTR(','||TO_CHAR(glhtgl)||',', ',', 1, LEVEL + 1) - INSTR(','||TO_CHAR(glhtgl)||',', ',', 1, LEVEL) - 1),'')
|
NVL2(glhtgl, '58505_ht' || SUBSTR(','||TO_CHAR(glhtgl)||',', INSTR(','||TO_CHAR(glhtgl)||',', ',', 1, LEVEL) + 1, INSTR(','||TO_CHAR(glhtgl)||',', ',', 1, LEVEL + 1) - INSTR(','||TO_CHAR(glhtgl)||',', ',', 1, LEVEL) - 1),'')
|
||||||
FROM tmp
|
FROM tmp
|
||||||
CONNECT BY LEVEL <= LENGTH(glhtgl) - LENGTH(REPLACE(glhtgl, ',', '')) + 1
|
CONNECT BY LEVEL <= LENGTH(glhtgl) - LENGTH(REPLACE(glhtgl, ',', '')) + 1
|
||||||
AND PRIOR id = id
|
AND PRIOR id = id
|
||||||
@@ -48,7 +47,7 @@ tmp2 AS (
|
|||||||
|
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT id,
|
SELECT id,
|
||||||
NVL2(glgcxxsjd, '58505_tb' || SUBSTR(','||TO_CHAR(gltbgl)||',', INSTR(','||TO_CHAR(gltbgl)||',', ',', 1, LEVEL) + 1, INSTR(','||TO_CHAR(gltbgl)||',', ',', 1, LEVEL + 1) - INSTR(','||TO_CHAR(gltbgl)||',', ',', 1, LEVEL) - 1),'')
|
NVL2(gltbgl, '58505_tb' || SUBSTR(','||TO_CHAR(gltbgl)||',', INSTR(','||TO_CHAR(gltbgl)||',', ',', 1, LEVEL) + 1, INSTR(','||TO_CHAR(gltbgl)||',', ',', 1, LEVEL + 1) - INSTR(','||TO_CHAR(gltbgl)||',', ',', 1, LEVEL) - 1),'')
|
||||||
FROM tmp
|
FROM tmp
|
||||||
CONNECT BY LEVEL <= LENGTH(gltbgl) - LENGTH(REPLACE(gltbgl, ',', '')) + 1
|
CONNECT BY LEVEL <= LENGTH(gltbgl) - LENGTH(REPLACE(gltbgl, ',', '')) + 1
|
||||||
AND PRIOR id = id
|
AND PRIOR id = id
|
||||||
@@ -56,7 +55,7 @@ tmp2 AS (
|
|||||||
|
|
||||||
UNION ALL
|
UNION ALL
|
||||||
SELECT id,
|
SELECT id,
|
||||||
NVL2(glgcxxsjd, '58505_qt' || SUBSTR(','||TO_CHAR(glqtgl)||',', INSTR(','||TO_CHAR(glqtgl)||',', ',', 1, LEVEL) + 1, INSTR(','||TO_CHAR(glqtgl)||',', ',', 1, LEVEL + 1) - INSTR(','||TO_CHAR(glqtgl)||',', ',', 1, LEVEL) - 1),'')
|
NVL2(glqtgl, '58505_qt' || SUBSTR(','||TO_CHAR(glqtgl)||',', INSTR(','||TO_CHAR(glqtgl)||',', ',', 1, LEVEL) + 1, INSTR(','||TO_CHAR(glqtgl)||',', ',', 1, LEVEL + 1) - INSTR(','||TO_CHAR(glqtgl)||',', ',', 1, LEVEL) - 1),'')
|
||||||
FROM tmp
|
FROM tmp
|
||||||
CONNECT BY LEVEL <= LENGTH(glqtgl) - LENGTH(REPLACE(glqtgl, ',', '')) + 1
|
CONNECT BY LEVEL <= LENGTH(glqtgl) - LENGTH(REPLACE(glqtgl, ',', '')) + 1
|
||||||
AND PRIOR id = id
|
AND PRIOR id = id
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
UPDATE uf_rwxx r
|
||||||
|
SET rwmc = (
|
||||||
|
(SELECT LISTAGG(mc, '/') WITHIN GROUP (ORDER BY LEVEL DESC)
|
||||||
|
FROM VIEW_TMP20250626
|
||||||
|
START WITH id = r.GLGCGLXX2025
|
||||||
|
CONNECT BY PRIOR sj = id)
|
||||||
|
||'-'||(
|
||||||
|
(SELECT LISTAGG(mc, '/') WITHIN GROUP (ORDER BY LEVEL DESC)
|
||||||
|
FROM uf_SCSXCDK
|
||||||
|
START WITH id = REPLACE(r.gzlx, '30506_', '')
|
||||||
|
CONNECT BY PRIOR sj = id)
|
||||||
|
))
|
||||||
|
where r.GLGCGLXX2025 is not null
|
||||||
|
|
||||||
|
//VIEW_TMP20250626是根据树形关系做的虚拟表单
|
||||||
@@ -0,0 +1,456 @@
|
|||||||
|
// 一键修改密码
|
||||||
|
async function changePasswordBatch(users) {
|
||||||
|
// RSA加密
|
||||||
|
function encryptPassword(password, publicKey) {
|
||||||
|
const jsencrypt = new JSEncrypt();
|
||||||
|
jsencrypt.setPublicKey(publicKey);
|
||||||
|
const encrypted = jsencrypt.encrypt(password);
|
||||||
|
if (!encrypted) throw new Error("密码加密失败");
|
||||||
|
return encrypted;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 给单个用户改密(带重试)
|
||||||
|
async function updateUserPassword(user, retry = 3) {
|
||||||
|
try {
|
||||||
|
// 1. 获取验证码
|
||||||
|
const ts1 = Date.now();
|
||||||
|
const imgRes = await fetch(
|
||||||
|
`https://oa.zwgczx.com/weaver/weaver.file.MakeValidateCode?isView=1&validatetype=0&validatenum=4&seriesnum_=${ts1}`,
|
||||||
|
{ credentials: "include" }
|
||||||
|
);
|
||||||
|
const buf = await imgRes.arrayBuffer();
|
||||||
|
const base64 = btoa(
|
||||||
|
new Uint8Array(buf).reduce((data, byte) => data + String.fromCharCode(byte), "")
|
||||||
|
);
|
||||||
|
|
||||||
|
// 2. OCR 识别验证码
|
||||||
|
const ocrRes = await fetch("https://nest.zwgczx.com/api/v1/tmp-redis/test", {
|
||||||
|
method: "POST",
|
||||||
|
headers: { "Content-Type": "application/json" },
|
||||||
|
body: JSON.stringify({ base64 })
|
||||||
|
});
|
||||||
|
const { data: validatecode } = await ocrRes.json();
|
||||||
|
console.log("识别验证码:", validatecode);
|
||||||
|
|
||||||
|
// 3. 获取RSA公钥
|
||||||
|
const ts2 = Date.now();
|
||||||
|
const { rsa_pub, rsa_flag, rsa_code } = await (
|
||||||
|
await fetch(`https://oa.zwgczx.com/rsa/weaver.rsa.GetRsaInfo?ts=${ts2}`, {
|
||||||
|
credentials: "include"
|
||||||
|
})
|
||||||
|
).json();
|
||||||
|
|
||||||
|
const encPwd = encryptPassword(user.password + rsa_code, rsa_pub) + rsa_flag;
|
||||||
|
|
||||||
|
const ts3 = Date.now();
|
||||||
|
const { rsa_pub: rsa_pub1, rsa_flag: rsa_flag1, rsa_code: rsa_code1 } = await (
|
||||||
|
await fetch(`https://oa.zwgczx.com/rsa/weaver.rsa.GetRsaInfo?ts=${ts3}`, {
|
||||||
|
credentials: "include"
|
||||||
|
})
|
||||||
|
).json();
|
||||||
|
|
||||||
|
const encPwd1 = encryptPassword(user.password + rsa_code1, rsa_pub1) + rsa_flag1;
|
||||||
|
|
||||||
|
// 4. 提交改密
|
||||||
|
const body = new URLSearchParams({
|
||||||
|
id: user.id,
|
||||||
|
loginid: user.loginid,
|
||||||
|
password: encPwd,
|
||||||
|
password1: encPwd1,
|
||||||
|
usbstate: "0",
|
||||||
|
isADAccount: "0",
|
||||||
|
validatecode,
|
||||||
|
seclevel: 0,
|
||||||
|
useSecondaryPwd: 0,
|
||||||
|
passwordlock: 0,
|
||||||
|
needauto: 0,
|
||||||
|
enableDate: "2025-09-10",
|
||||||
|
enableUsbType: 0
|
||||||
|
});
|
||||||
|
|
||||||
|
const saveRes = await fetch("https://oa.zwgczx.com/api/hrm/systeminfo/save", {
|
||||||
|
method: "POST",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/x-www-form-urlencoded; charset=utf-8",
|
||||||
|
"x-requested-with": "XMLHttpRequest"
|
||||||
|
},
|
||||||
|
body,
|
||||||
|
credentials: "include"
|
||||||
|
});
|
||||||
|
|
||||||
|
const resultText = await saveRes.text();
|
||||||
|
|
||||||
|
let result = {};
|
||||||
|
try {
|
||||||
|
result = JSON.parse(resultText);
|
||||||
|
} catch {
|
||||||
|
// 如果不是标准JSON,就简单返回原始文本
|
||||||
|
result = { raw: resultText };
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.status === "-1") {
|
||||||
|
if (retry > 0) {
|
||||||
|
console.warn(
|
||||||
|
`用户 ${user.loginid} 验证码失败,重试剩余 ${retry} 次...`
|
||||||
|
);
|
||||||
|
return await updateUserPassword(user, retry - 1);
|
||||||
|
} else {
|
||||||
|
throw new Error(`用户 ${user.loginid} 改密失败(验证码多次失败)`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`用户 ${user.loginid} 改密结果:`, result);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(`用户 ${user.loginid} 改密失败:`, err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 遍历用户批量处理
|
||||||
|
for (const user of users) {
|
||||||
|
await updateUserPassword(user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 示例调用,id需要是hrmresource的id,密码需要符合系统安全设置
|
||||||
|
changePasswordBatch([
|
||||||
|
{
|
||||||
|
"id": 523,
|
||||||
|
"loginid": "CUS-CDYH",
|
||||||
|
"password": "RY.42281"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 524,
|
||||||
|
"loginid": "CUS-GYYH",
|
||||||
|
"password": "RY.13953"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 525,
|
||||||
|
"loginid": "CUS-JTYH",
|
||||||
|
"password": "RY.98457"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 526,
|
||||||
|
"loginid": "CUS-LLT",
|
||||||
|
"password": "RY.11517"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 527,
|
||||||
|
"loginid": "CUS-NDYH",
|
||||||
|
"password": "RY.20880"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 304,
|
||||||
|
"loginid": "RY-BSFGS",
|
||||||
|
"password": "RY.48137"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 343,
|
||||||
|
"loginid": "RY-CHGS",
|
||||||
|
"password": "RY.93925"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 315,
|
||||||
|
"loginid": "RY-CSHX",
|
||||||
|
"password": "RY.78478"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 330,
|
||||||
|
"loginid": "RY-CZGLZX",
|
||||||
|
"password": "RY.41274"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 347,
|
||||||
|
"loginid": "RY-DCGS",
|
||||||
|
"password": "RY.55742"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 349,
|
||||||
|
"loginid": "RY-DYFGS",
|
||||||
|
"password": "RY.71620"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 309,
|
||||||
|
"loginid": "RY-EGFGS",
|
||||||
|
"password": "RY.20707"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 351,
|
||||||
|
"loginid": "RY-FKFGS",
|
||||||
|
"password": "RY.64596"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 350,
|
||||||
|
"loginid": "RY-GFGS",
|
||||||
|
"password": "RY.05010"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 306,
|
||||||
|
"loginid": "RY-GFZGS",
|
||||||
|
"password": "RY.86999"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 308,
|
||||||
|
"loginid": "RY-GHFGS",
|
||||||
|
"password": "RY.63878"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 337,
|
||||||
|
"loginid": "RY-GHGS",
|
||||||
|
"password": "RY.45039"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 340,
|
||||||
|
"loginid": "RY-GLGS",
|
||||||
|
"password": "RY.59570"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 310,
|
||||||
|
"loginid": "RY-GSFGS",
|
||||||
|
"password": "RY.81003"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 302,
|
||||||
|
"loginid": "RY-GSZGS",
|
||||||
|
"password": "RY.44099"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 299,
|
||||||
|
"loginid": "RY-GZXX",
|
||||||
|
"password": "RY.05592"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 328,
|
||||||
|
"loginid": "RY-HHGGLZX",
|
||||||
|
"password": "RY.90622"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 303,
|
||||||
|
"loginid": "RY-HMDQ",
|
||||||
|
"password": "RY.81619"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 301,
|
||||||
|
"loginid": "RY-HMEWFGS",
|
||||||
|
"password": "RY.25967"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 311,
|
||||||
|
"loginid": "RY-HQGS",
|
||||||
|
"password": "RY.89632"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 318,
|
||||||
|
"loginid": "RY-HZGLC",
|
||||||
|
"password": "RY.92680"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 320,
|
||||||
|
"loginid": "RY-JGGLC",
|
||||||
|
"password": "RY.29439"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 329,
|
||||||
|
"loginid": "RY-JHGLZX",
|
||||||
|
"password": "RY.83392"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 293,
|
||||||
|
"loginid": "RY-JLFGS",
|
||||||
|
"password": "RY.00699"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 354,
|
||||||
|
"loginid": "RY-JS",
|
||||||
|
"password": "RY.53500"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 353,
|
||||||
|
"loginid": "RY-JTJT",
|
||||||
|
"password": "RY.10700"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 338,
|
||||||
|
"loginid": "RY-JZB",
|
||||||
|
"password": "RY.31698"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 319,
|
||||||
|
"loginid": "RY-JZGLZX",
|
||||||
|
"password": "RY.43983"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 298,
|
||||||
|
"loginid": "RY-JZGS",
|
||||||
|
"password": "RY.91799"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 297,
|
||||||
|
"loginid": "RY-JZGSGZBD",
|
||||||
|
"password": "RY.35764"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 296,
|
||||||
|
"loginid": "RY-JZGSGZD",
|
||||||
|
"password": "RY.40224"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 335,
|
||||||
|
"loginid": "RY-KYGS",
|
||||||
|
"password": "RY.40975"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 313,
|
||||||
|
"loginid": "RY-LDFGS",
|
||||||
|
"password": "RY.43105"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 327,
|
||||||
|
"loginid": "RY-LLGLC",
|
||||||
|
"password": "RY.50593"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 355,
|
||||||
|
"loginid": "RY-LQ",
|
||||||
|
"password": "RY.37570"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 348,
|
||||||
|
"loginid": "RY-MPGS",
|
||||||
|
"password": "RY.39292"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 333,
|
||||||
|
"loginid": "RY-MZGS",
|
||||||
|
"password": "RY.14628"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 300,
|
||||||
|
"loginid": "RY-NHDFGS",
|
||||||
|
"password": "RY.50066"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 314,
|
||||||
|
"loginid": "RY-NHGS",
|
||||||
|
"password": "RY.14002"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 356,
|
||||||
|
"loginid": "RY-NY",
|
||||||
|
"password": "RY.35568"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 325,
|
||||||
|
"loginid": "RY-NYLYGLC",
|
||||||
|
"password": "RY.81717"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 321,
|
||||||
|
"loginid": "RY-QYGLZX",
|
||||||
|
"password": "RY.12508"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 324,
|
||||||
|
"loginid": "RY-RXGLC",
|
||||||
|
"password": "RY.38510"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 345,
|
||||||
|
"loginid": "RY-SFGS",
|
||||||
|
"password": "RY.55017"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 357,
|
||||||
|
"loginid": "RY-SG",
|
||||||
|
"password": "RY.98997"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 323,
|
||||||
|
"loginid": "RY-SGGLZX",
|
||||||
|
"password": "RY.16123"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 339,
|
||||||
|
"loginid": "RY-SGGQFGS",
|
||||||
|
"password": "RY.55621"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 332,
|
||||||
|
"loginid": "RY-SGZJFGS",
|
||||||
|
"password": "RY.94912"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 342,
|
||||||
|
"loginid": "RY-SSXFGS",
|
||||||
|
"password": "RY.23889"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 312,
|
||||||
|
"loginid": "RY-SZFGS",
|
||||||
|
"password": "RY.63003"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 522,
|
||||||
|
"loginid": "RY-SZTD",
|
||||||
|
"password": "RY.33575"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 358,
|
||||||
|
"loginid": "RY-TZ",
|
||||||
|
"password": "RY.84725"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 334,
|
||||||
|
"loginid": "RY-TZFGS",
|
||||||
|
"password": "RY.21588"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 326,
|
||||||
|
"loginid": "RY-XBGLC",
|
||||||
|
"password": "RY.13156"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 346,
|
||||||
|
"loginid": "RY-XBYHFGS",
|
||||||
|
"password": "RY.04216"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 336,
|
||||||
|
"loginid": "RY-YANGMAOGS",
|
||||||
|
"password": "RY.38286"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 341,
|
||||||
|
"loginid": "RY-YGFGS",
|
||||||
|
"password": "RY.06696"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 359,
|
||||||
|
"loginid": "RY-YGS",
|
||||||
|
"password": "RY.12380"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 316,
|
||||||
|
"loginid": "RY-YHGLC",
|
||||||
|
"password": "RY.92641"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 322,
|
||||||
|
"loginid": "RY-YHGLCH",
|
||||||
|
"password": "RY.86731"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 295,
|
||||||
|
"loginid": "RY-YUNMAOGS",
|
||||||
|
"password": "RY.56787"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 305,
|
||||||
|
"loginid": "RY-YWFGS",
|
||||||
|
"password": "RY.61043"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 307,
|
||||||
|
"loginid": "RY-YZGS",
|
||||||
|
"password": "RY.33185"
|
||||||
|
}
|
||||||
|
]);
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
MERGE INTO uf_jjrapxx t
|
||||||
|
USING (
|
||||||
|
|
||||||
|
WITH
|
||||||
|
paixu as (
|
||||||
|
SELECT lx,rq, ROW_NUMBER() OVER (ORDER BY id) AS id FROM uf_jjrapxx ORDER BY rq
|
||||||
|
|
||||||
|
),
|
||||||
|
tmp1 AS (
|
||||||
|
SELECT id,rq, ROW_NUMBER() OVER (ORDER BY id) AS gzrxh FROM paixu WHERE lx=0
|
||||||
|
),
|
||||||
|
|
||||||
|
tmp2 AS (
|
||||||
|
SELECT a.id,a.rq, LEVEL AS det FROM paixu a START WITH a.lx=0 OR a.id = 1 CONNECT BY PRIOR a.id=a.id-1 AND a.lx!=0 ORDER BY rq
|
||||||
|
|
||||||
|
)
|
||||||
|
SELECT a.id,a.rq, CASE WHEN a.id = 1 THEN 0 ELSE b.gzrxh END AS gzrxh FROM tmp2 a LEFT JOIN tmp1 b ON a.id-a.det+1=b.id
|
||||||
|
) s
|
||||||
|
ON (t.id = s.id)
|
||||||
|
WHEN MATCHED THEN
|
||||||
|
UPDATE SET t.gzrxh = s.gzrxh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
After Width: | Height: | Size: 346 KiB |
|
After Width: | Height: | Size: 224 KiB |
|
After Width: | Height: | Size: 1.6 MiB |
|
After Width: | Height: | Size: 1.3 MiB |
|
After Width: | Height: | Size: 290 KiB |
|
After Width: | Height: | Size: 12 MiB |
@@ -0,0 +1,3 @@
|
|||||||
|
ALTER TABLE 表单名字tablename ENABLE ROW MOVEMENT;
|
||||||
|
FLASHBACK TABLE 表单名字tablename TO TIMESTAMP (SYSTIMESTAMP - INTERVAL '10' MINUTE); //10分钟前
|
||||||
|
ALTER TABLE 表单名字tablename disable ROW MOVEMENT;
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
function detMultiFieldCombiner(detNum, handle_fie, aim_fies, hidden_class, fieNum) {
|
||||||
|
let var0 = fieNum == undefined ? aim_fies.length : fieNum;
|
||||||
|
let var1 = WfForm.getDetailAllRowIndexStr('detail_' + detNum);
|
||||||
|
if (var1.length > 0) {
|
||||||
|
var1.split(",").forEach(rowIndex => {
|
||||||
|
let var2;
|
||||||
|
let var3 = aim_fies;
|
||||||
|
let var4 = WfForm.getFieldValue(handle_fie + "_" + rowIndex);
|
||||||
|
let var5 = aim_fies.find(e => e.value == var4);
|
||||||
|
var5 = var5 == undefined ? aim_fies[0] : var5;
|
||||||
|
var2 = setInterval(() => {
|
||||||
|
for (let i = 0; i < var3.length; i++) {
|
||||||
|
if ($(`.${var3[i].fieldId}_${rowIndex}_swapDiv`).length > 0) {
|
||||||
|
$(`.${var3[i].fieldId}_${rowIndex}_swapDiv`)[0].parentElement.setAttribute('colspan', `${var0}`);
|
||||||
|
$(`.${var3[i].fieldId}_${rowIndex}_swapDiv`)[0].parentElement.classList.add(hidden_class);
|
||||||
|
} else {
|
||||||
|
var3 = var3.slice(i);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
clearInterval(var2);
|
||||||
|
$(`.${var5.fieldId}_${rowIndex}_swapDiv`)[0].parentElement.classList.remove(hidden_class);
|
||||||
|
}, 50);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
WfForm.registerAction(WfForm.ACTION_ADDROW + (detNum + ''), function (rowIndex) {
|
||||||
|
let var2 = WfForm.getFieldValue(handle_fie + "_" + rowIndex);
|
||||||
|
let var3 = aim_fies.find(e => e.value == var2);
|
||||||
|
var3 = var3 == undefined ? aim_fies[0] : var3;
|
||||||
|
aim_fies.forEach(e => {
|
||||||
|
$(`.${e.fieldId}_${rowIndex}_swapDiv`)[0].parentElement.classList.add(hidden_class);
|
||||||
|
$(`.${e.fieldId}_${rowIndex}_swapDiv`)[0].parentElement.setAttribute('colspan', `${var0}`);
|
||||||
|
});
|
||||||
|
$(`.${var3.fieldId}_${rowIndex}_swapDiv`)[0].parentElement.classList.remove(hidden_class);
|
||||||
|
});
|
||||||
|
|
||||||
|
WfForm.bindDetailFieldChangeEvent(handle_fie, function (id, rowIndex, value) {
|
||||||
|
let var2 = aim_fies.find(e => e.value == value);
|
||||||
|
var2 = var2 == undefined ? aim_fies[0] : var2;
|
||||||
|
aim_fies.forEach(e => {
|
||||||
|
$(`.${e.fieldId}_${rowIndex}_swapDiv`)[0].parentElement.classList.add(hidden_class);
|
||||||
|
});
|
||||||
|
$(`.${var2.fieldId}_${rowIndex}_swapDiv`)[0].parentElement.classList.remove(hidden_class);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1,64 @@
|
|||||||
|
<script type="text/javascript">
|
||||||
|
/*
|
||||||
|
* 代码中调用了泛微的新增明细行的钩子事件,适用时注意替换明细表编号
|
||||||
|
* 代码中的 “ wf-detail-0 ” 是明细 1 的class。
|
||||||
|
* 如需要行渲染的明细表为明细2,需将 “ wf-detail-0 ” 替换为 “ wf-detail-1 ”。
|
||||||
|
* 其他明细表以此类推。
|
||||||
|
*/
|
||||||
|
//增加行渲染效果
|
||||||
|
let myTimeout;
|
||||||
|
WfForm.registerAction(WfForm.ACTION_ADDROW + "1", function (index) {
|
||||||
|
clearTimeout(myTimeout);
|
||||||
|
myTimeout = setTimeout(() => {
|
||||||
|
$(".wf-detail-0 .excelDetailContent tbody tr.detail_data_row").off('click');
|
||||||
|
$(".wf-detail-0 .excelDetailContent tbody tr.detail_data_row").off('dblclick');
|
||||||
|
$(".wf-detail-0 .excelDetailContent tbody tr.detail_data_row").click(event => {
|
||||||
|
if (event.ctrlKey) {
|
||||||
|
if ($(event.currentTarget).hasClass("myChooseRow")) {
|
||||||
|
$(event.currentTarget).removeClass("myChooseRow");
|
||||||
|
} else {
|
||||||
|
$(event.currentTarget).addClass("myChooseRow");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$(".wf-detail-0 .excelDetailContent tbody tr.detail_data_row").dblclick(event => {
|
||||||
|
if ($(event.currentTarget).hasClass("myChooseRow")) {
|
||||||
|
$(event.currentTarget).removeClass("myChooseRow");
|
||||||
|
} else {
|
||||||
|
$(event.currentTarget).addClass("myChooseRow");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, 300);
|
||||||
|
});
|
||||||
|
$(".wf-detail-0 .excelDetailContent tbody tr.detail_data_row").click(event => {
|
||||||
|
if (event.ctrlKey) {
|
||||||
|
if ($(event.currentTarget).hasClass("myChooseRow")) {
|
||||||
|
$(event.currentTarget).removeClass("myChooseRow");
|
||||||
|
} else {
|
||||||
|
$(event.currentTarget).addClass("myChooseRow");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$(".wf-detail-0 .excelDetailContent tbody tr.detail_data_row").dblclick(event => {
|
||||||
|
if ($(event.currentTarget).hasClass("myChooseRow")) {
|
||||||
|
$(event.currentTarget).removeClass("myChooseRow");
|
||||||
|
} else {
|
||||||
|
$(event.currentTarget).addClass("myChooseRow");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
.wf-detail-0 .excelDetailContent tbody tr.detail_data_row:hover {
|
||||||
|
box-shadow:
|
||||||
|
0px 0px 0.3px rgba(0, 0, 0, 0.155),
|
||||||
|
0px 0px 0.9px rgba(0, 0, 0, 0.222),
|
||||||
|
0px 0px 1.8px rgba(0, 0, 0, 0.278),
|
||||||
|
0px 0px 3.7px rgba(0, 0, 0, 0.345),
|
||||||
|
0px 0px 10px rgba(0, 0, 0, 0.5);
|
||||||
|
}
|
||||||
|
|
||||||
|
.wf-detail-0 .excelDetailContent tbody tr.detail_data_row.myChooseRow {
|
||||||
|
background-color: bisque;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
// 明细表筛选功能函数
|
||||||
|
function myFilter(mainFieldIds, detFieldIds, det_id, comparators, emptyValues = undefined, mainFieldSeparators = undefined, detFieldSeparators = undefined, rows = undefined) {
|
||||||
|
let all_rows_str = WfForm.getDetailAllRowIndexStr("detail_" + det_id);
|
||||||
|
if (all_rows_str.length == 0) {
|
||||||
|
//如果明细为空,函数结束
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let all_rows = all_rows_str.split(",");
|
||||||
|
let det_rowIndexs;
|
||||||
|
if (rows == undefined) {
|
||||||
|
det_rowIndexs = all_rows;
|
||||||
|
} else {
|
||||||
|
det_rowIndexs = rows;
|
||||||
|
}
|
||||||
|
let mainFieldValues = [];
|
||||||
|
let new_detFieldIds = [];
|
||||||
|
mainFieldIds.forEach((mfi, i) => {
|
||||||
|
let mfi_value = WfForm.getFieldValue(mfi).toLowerCase();
|
||||||
|
if (mfi_value.length > 0) {
|
||||||
|
mainFieldValues.push(mfi_value.split(mainFieldSeparators == undefined ? "," : mainFieldSeparators[i]).filter(e => e.length > 0));
|
||||||
|
new_detFieldIds.push([detFieldIds[i], detFieldSeparators == undefined ? "," : detFieldSeparators[i], comparators[i], emptyValues == undefined ? undefined : emptyValues[i]]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//如果所有主表筛选字段均为空值,即无筛选,显示所有明细行,函数结束
|
||||||
|
if (mainFieldValues.length == 0) {
|
||||||
|
WfForm.controlDetailRowDisplay("detail_" + det_id, "all", false);
|
||||||
|
WfForm.controlDetailRowDisableCheck("detail_" + det_id, "all", false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//逐行明细判断
|
||||||
|
let oldCheckedRows = WfForm.getDetailCheckedRowIndexStr("detail_" + det_id).split(",");
|
||||||
|
let newCheckedRows = [];
|
||||||
|
det_rowIndexs.forEach(rowIndex => {
|
||||||
|
if (all_rows.includes(rowIndex)) {
|
||||||
|
//逐个筛选字段判断
|
||||||
|
let check_res1 = false;
|
||||||
|
let i = 0;
|
||||||
|
for (const dfi of new_detFieldIds) {
|
||||||
|
let dfi_values = WfForm.getFieldValue(dfi[0] + "_" + rowIndex).toLowerCase();
|
||||||
|
if (dfi_values.length == 0 && dfi[3] == undefined) {
|
||||||
|
//如果明细行对应字段为空且不允许筛选空,匹配失败,中止循环
|
||||||
|
check_res1 = true;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
//如果明细行对应字段为非空,逐个判断是否在筛选范围内
|
||||||
|
let check_res2 = myFilterComparator(mainFieldValues[i], dfi_values, dfi[1], dfi[2], dfi[3]);
|
||||||
|
if (check_res2 == false) {
|
||||||
|
//匹配失败,中止循环
|
||||||
|
check_res1 = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
WfForm.controlDetailRowDisplay("detail_" + det_id, rowIndex + "", check_res1);
|
||||||
|
WfForm.controlDetailRowDisableCheck("detail_" + det_id, rowIndex + "", check_res1);
|
||||||
|
if (check_res1 == false && oldCheckedRows.includes(rowIndex + "")) {
|
||||||
|
newCheckedRows.push(rowIndex + "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
WfForm.checkDetailRow("detail_" + det_id, newCheckedRows.join(","), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function myFilterComparator(mainFV, detFV, detSeparators, index, emptyValue) {
|
||||||
|
switch (index) {
|
||||||
|
case "文本":
|
||||||
|
if (detFV.length == 0) {
|
||||||
|
if (mainFV.includes(emptyValue)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (const mfi_value of mainFV) {
|
||||||
|
if (detFV.includes(mfi_value)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case "浏览框":
|
||||||
|
if (detFV.length == 0) {
|
||||||
|
if (mainFV.includes(emptyValue)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (const dfi_value of detFV.split(detSeparators).filter(e => e.length > 0)) {
|
||||||
|
if (mainFV.includes(dfi_value)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case "选择框":
|
||||||
|
if (detFV.length == 0) {
|
||||||
|
if (mainFV.includes(emptyValue)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (const dfi_value of detFV.split(detSeparators).filter(e => e.length > 0)) {
|
||||||
|
if (mainFV.includes(dfi_value)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
case "check框":
|
||||||
|
let emp = mainFV.includes(emptyValue) ? 1 : 0;
|
||||||
|
if (detFV.length == 0 || detFV == "0") {
|
||||||
|
if (emp == 1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (mainFV.length > emp) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
if (detFV.length == 0) {
|
||||||
|
if (mainFV.includes(emptyValue)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (const mfi_value of mainFV) {
|
||||||
|
if (detFV.includes(mfi_value)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
/*
|
||||||
|
dom_id为字符串,表示单元格元素id,必填
|
||||||
|
fieldid为字符串,表示字段id,可把打星结果存入对应字段,必填
|
||||||
|
fieldValue为数组,表示每颗星对应的字段值,数组第0个值为0颗星的value,第1个值为第1个星的value,必填
|
||||||
|
noChoose为数字,表示是否允许取消选择,1表示允许,非1表示不允许,默认不允许,非必填
|
||||||
|
text_arr为数组,表示每颗星的备注,数组第0个值为0颗星的备注,实际无作用,第1个值为第1个星的备注,默认备注为“1星、2星”,非必填
|
||||||
|
size为数字,表示星星的大小,单位为px
|
||||||
|
justify_content为字符串,表示星星的横向布局,默认为“left”靠左,一般可选“right”和“center”
|
||||||
|
*/
|
||||||
|
function starRating(dom_id, fieldid, fieldValue, noChoose, text_arr, size, justify_content) {
|
||||||
|
let sr_size = size == undefined ? 20 : size;
|
||||||
|
let sr_justify_content = justify_content == undefined ? "left" : justify_content;
|
||||||
|
let sr_noChoose = noChoose == 1 ? 1 : 0;
|
||||||
|
let sr_text_arr = [];
|
||||||
|
if (text_arr == undefined || text_arr.length != fieldValue.length) {
|
||||||
|
fieldValue.forEach((e, index) => {
|
||||||
|
sr_text_arr.push(index + "星");
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
sr_text_arr = text_arr;
|
||||||
|
}
|
||||||
|
//添加CSS样式
|
||||||
|
let style = document.createElement('style');
|
||||||
|
let css = `
|
||||||
|
.${dom_id}_rating:not(:checked) > input {
|
||||||
|
position: absolute;
|
||||||
|
appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dom_id}_rating:not(:checked) > label {
|
||||||
|
float: right;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: ${sr_size}px;
|
||||||
|
fill: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dom_id}_rating:not(:checked) > label > svg {
|
||||||
|
fill: #666; /* Set default color for SVG */
|
||||||
|
transition: fill 0.3s ease; /* Add a transition effect */
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dom_id}_rating > input:checked + label:hover svg,
|
||||||
|
.${dom_id}_rating > input:checked + label:hover ~ label svg,
|
||||||
|
.${dom_id}_rating > input:checked ~ label:hover svg,
|
||||||
|
.${dom_id}_rating > input:checked ~ label:hover ~ label svg,
|
||||||
|
.${dom_id}_rating > label:hover ~ input:checked ~ label svg {
|
||||||
|
fill: #e58e09;
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dom_id}_rating:not(:checked) > label:hover svg,
|
||||||
|
.${dom_id}_rating:not(:checked) > label:hover ~ label svg {
|
||||||
|
fill: #ff9e0b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dom_id}_rating > input:checked ~ label > svg {
|
||||||
|
fill: #ffa723; /* Set color for selected stars */
|
||||||
|
}
|
||||||
|
|
||||||
|
.${dom_id}_rating {
|
||||||
|
display: flex;
|
||||||
|
justify-content: ${sr_justify_content};
|
||||||
|
align-items: center;
|
||||||
|
flex-direction: row-reverse;
|
||||||
|
}`;
|
||||||
|
if (style.styleSheet) {
|
||||||
|
// 针对 IE
|
||||||
|
style.styleSheet.cssText = css;
|
||||||
|
} else {
|
||||||
|
// 其他浏览器
|
||||||
|
style.appendChild(document.createTextNode(css));
|
||||||
|
}
|
||||||
|
document.head.appendChild(style);
|
||||||
|
//添加图表标
|
||||||
|
$(`#${dom_id}`).append(`<div class="${dom_id}_rating"></div>`);
|
||||||
|
for (let i = fieldValue.length - 1; i > 0; i--) {
|
||||||
|
$(`.${dom_id}_rating`).append(`<input type="radio" id="${dom_id}_star${i}" data-checked=0 name="${dom_id}_rate" value="${i}" />
|
||||||
|
<label for="${dom_id}_star${i}" title="${sr_text_arr[i]}"
|
||||||
|
><svg
|
||||||
|
viewBox="0 0 576 512"
|
||||||
|
height="1em"
|
||||||
|
class="star-solid"
|
||||||
|
>
|
||||||
|
<path
|
||||||
|
d="M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"
|
||||||
|
></path></svg
|
||||||
|
></label>`);
|
||||||
|
}
|
||||||
|
let initial_num = WfForm.getFieldValue(fieldid);
|
||||||
|
if (initial_num !== undefined && initial_num !== "") {
|
||||||
|
for (let i = 0; i < fieldValue.length; i++) {
|
||||||
|
if (fieldValue[i] == +initial_num) {
|
||||||
|
if (i > 0) {
|
||||||
|
$(`#${dom_id}_star${i}`).attr({ checked: true });
|
||||||
|
if (sr_noChoose == 1) {
|
||||||
|
$(`#${dom_id}_star${i}`)[0].setAttribute('data-checked', 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (sr_noChoose == 1) {
|
||||||
|
for (let i = 1; i < fieldValue.length; i++) {
|
||||||
|
$(`#${dom_id}_star${i}`).click((event) => {
|
||||||
|
if (event.target.getAttribute('data-checked') == 1) {
|
||||||
|
event.target.checked = false;
|
||||||
|
event.target.setAttribute('data-checked', 0);
|
||||||
|
WfForm.changeFieldValue(fieldid, { value: fieldValue[0] });
|
||||||
|
} else {
|
||||||
|
fieldValue.forEach((e, index) => {
|
||||||
|
if (index > 0 && index != i) {
|
||||||
|
$(`#${dom_id}_star${index}`)[0].setAttribute('data-checked', 0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
event.target.setAttribute('data-checked', 1);
|
||||||
|
WfForm.changeFieldValue(fieldid, { value: fieldValue[i] });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (let i = 1; i < fieldValue.length; i++) {
|
||||||
|
$(`#${dom_id}_star${i}`).click(() => {
|
||||||
|
WfForm.changeFieldValue(fieldid, { value: fieldValue[i] });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
222服务器内运行
|
||||||
|
table可以改其他
|
||||||
|
impdp ecology/{数据库密码}@ecology tables=uf_AttendanceList_dt1 directory=DATA_PUMP_DIR dumpfile=OADB20241128.dmp logfile=import.log table_exists_action=replace
|
||||||
@@ -13,15 +13,6 @@ FROM (
|
|||||||
)
|
)
|
||||||
WHERE mc IS NOT NULL
|
WHERE mc IS NOT NULL
|
||||||
union
|
union
|
||||||
SELECT NVL2(
|
SELECT lx ||'/'||mc
|
||||||
LISTAGG(mc, '/') WITHIN GROUP (ORDER BY level),
|
|
||||||
'项目信息/' || LISTAGG(mc, '/') WITHIN GROUP (ORDER BY level),
|
|
||||||
''
|
|
||||||
) AS mc
|
|
||||||
FROM (
|
|
||||||
SELECT mc, level
|
|
||||||
FROM VIEW_XFR
|
FROM VIEW_XFR
|
||||||
START WITH wysb = '$main.glxmfwrw$'
|
where wysb in ('xm'||'$main.glxm$' ,'fw'||'$main.glfw$','rw'||'$main.glrw$')
|
||||||
CONNECT BY PRIOR sj = wysb
|
|
||||||
)
|
|
||||||
WHERE mc IS NOT NULL
|
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
call SP_GENERATE_FORMATTED_SEQUENCE( 'JSXMlxdj' --key,同一个模块同一个流程必须唯一 ,
|
||||||
|
'{?REQUESTID}' --传值 ,
|
||||||
|
'{?sqrq}' --日期传值,默认传2025-02-11字符串格式,
|
||||||
|
'formtable_main_1576' --需要被update的表单名称 ,
|
||||||
|
'jsxmbh' --需要被update的字段名称 ,
|
||||||
|
'requestid' --被update的where条件的字段名,
|
||||||
|
'#P-#Y-#S4' --编号排列,#S4代表补位4个,比如0014。排列也可以是'[#p-#Y]/#S',输出结果是[JSXM-2025]/1,
|
||||||
|
'JSXM' --这个就是上面的#p )
|
||||||
|
|
||||||
|
|
||||||
|
--批量更新历史表单的编号
|
||||||
|
|
||||||
|
--更新前先把YEARLY_SEQUENCE的最大值记录清空
|
||||||
|
update YEARLY_SEQUENCE set MAX_SEQ=0 where SEQ_KEY='ZHTDJ202507'
|
||||||
|
|
||||||
|
DECLARE
|
||||||
|
v_count NUMBER := 0;
|
||||||
|
v_error_count NUMBER := 0;
|
||||||
|
v_total_count NUMBER := 0;
|
||||||
|
|
||||||
|
-- 游标:获取所有需要更新的记录(按ID排序)
|
||||||
|
CURSOR c_records IS
|
||||||
|
SELECT xglc, djrq
|
||||||
|
FROM uf_gcxx
|
||||||
|
WHERE xglc IS not NULL -- 只更新空编号的记录
|
||||||
|
ORDER BY xglc; -- 按ID排序
|
||||||
|
|
||||||
|
BEGIN
|
||||||
|
-- 统计总记录数
|
||||||
|
SELECT COUNT(*) INTO v_total_count
|
||||||
|
FROM uf_gcxx
|
||||||
|
WHERE xglc IS not NULL;
|
||||||
|
|
||||||
|
DBMS_OUTPUT.PUT_LINE('开始批量更新历史数据...');
|
||||||
|
DBMS_OUTPUT.PUT_LINE('需要更新的记录总数: ' || v_total_count);
|
||||||
|
DBMS_OUTPUT.PUT_LINE('----------------------------------------');
|
||||||
|
|
||||||
|
-- 遍历每条记录
|
||||||
|
FOR rec IN c_records LOOP
|
||||||
|
BEGIN
|
||||||
|
-- 调用存储过程为每条记录生成编号
|
||||||
|
SP_GENERATE_FORMATTED_SEQUENCE(
|
||||||
|
'JSXMlxdj', -- 序列键
|
||||||
|
rec.xglc, -- 请求ID/记录ID
|
||||||
|
rec.djrq, -- 日期值
|
||||||
|
'uf_gcxx', -- 目标表名
|
||||||
|
'gcbhz', -- 目标字段名
|
||||||
|
'xglc', -- 记录ID字段名
|
||||||
|
'#P-#Y-#S4', -- 编号格式模式
|
||||||
|
'JSXM' -- 前缀
|
||||||
|
);
|
||||||
|
|
||||||
|
v_count := v_count + 1;
|
||||||
|
|
||||||
|
-- 每处理100条记录显示一次进度
|
||||||
|
IF MOD(v_count, 100) = 0 THEN
|
||||||
|
DBMS_OUTPUT.PUT_LINE('已处理: ' || v_count || '/' || v_total_count || ' 条记录');
|
||||||
|
END IF;
|
||||||
|
|
||||||
|
EXCEPTION
|
||||||
|
WHEN OTHERS THEN
|
||||||
|
v_error_count := v_error_count + 1;
|
||||||
|
DBMS_OUTPUT.PUT_LINE('处理记录失败 - ID: ' || rec.xglc || ', 日期: ' || rec.djrq || ', 错误: ' || SQLERRM);
|
||||||
|
|
||||||
|
-- 如果错误太多,停止处理
|
||||||
|
IF v_error_count > 50 THEN
|
||||||
|
DBMS_OUTPUT.PUT_LINE('错误过多,停止处理');
|
||||||
|
EXIT;
|
||||||
|
END IF;
|
||||||
|
END;
|
||||||
|
END LOOP;
|
||||||
|
|
||||||
|
DBMS_OUTPUT.PUT_LINE('----------------------------------------');
|
||||||
|
DBMS_OUTPUT.PUT_LINE('批量更新完成!');
|
||||||
|
DBMS_OUTPUT.PUT_LINE('成功更新: ' || v_count || ' 条记录');
|
||||||
|
DBMS_OUTPUT.PUT_LINE('失败记录: ' || v_error_count || ' 条记录');
|
||||||
|
|
||||||
|
-- 验证更新结果
|
||||||
|
DECLARE
|
||||||
|
v_updated_count NUMBER;
|
||||||
|
v_empty_count NUMBER;
|
||||||
|
BEGIN
|
||||||
|
SELECT COUNT(*) INTO v_updated_count
|
||||||
|
FROM uf_gcxx
|
||||||
|
WHERE gcbhz IS NOT NULL AND gcbhz != '';
|
||||||
|
|
||||||
|
SELECT COUNT(*) INTO v_empty_count
|
||||||
|
FROM uf_gcxx
|
||||||
|
WHERE gcbhz IS NULL OR gcbhz = '';
|
||||||
|
|
||||||
|
DBMS_OUTPUT.PUT_LINE('----------------------------------------');
|
||||||
|
DBMS_OUTPUT.PUT_LINE('验证结果:');
|
||||||
|
DBMS_OUTPUT.PUT_LINE('已有编号的记录: ' || v_updated_count);
|
||||||
|
DBMS_OUTPUT.PUT_LINE('仍为空编号的记录: ' || v_empty_count);
|
||||||
|
END;
|
||||||
|
|
||||||
|
EXCEPTION
|
||||||
|
WHEN OTHERS THEN
|
||||||
|
DBMS_OUTPUT.PUT_LINE('批量更新过程出错: ' || SQLERRM);
|
||||||
|
ROLLBACK;
|
||||||
|
END;
|
||||||
|
|
||||||
|
|
||||||
|
--更新模块后使用update同步到流程表单
|
||||||
|
UPDATE formtable_main_1576 a
|
||||||
|
SET jsxmbh = (
|
||||||
|
SELECT gcbhz
|
||||||
|
FROM uf_gcxx
|
||||||
|
WHERE xglc = a.requestid
|
||||||
|
)
|
||||||
|
WHERE EXISTS (
|
||||||
|
SELECT 1
|
||||||
|
FROM uf_gcxx
|
||||||
|
WHERE xglc = a.requestid
|
||||||
|
);
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
MERGE INTO uf_AttendanceList_dt1 a
|
||||||
|
USING (
|
||||||
|
SELECT
|
||||||
|
a1.id,
|
||||||
|
LEAD(TO_DATE(a1.EFF_DATE, 'YYYY-MM-DD'))
|
||||||
|
OVER (PARTITION BY a1.mainid ORDER BY TO_DATE(a1.EFF_DATE, 'YYYY-MM-DD')) AS NEXT_EFF_DATE
|
||||||
|
FROM uf_AttendanceList_dt1 a1
|
||||||
|
) t
|
||||||
|
ON (a.id = t.id)
|
||||||
|
WHEN MATCHED THEN
|
||||||
|
UPDATE SET a.EXP_DATE = TO_CHAR(t.NEXT_EFF_DATE - 1, 'YYYY-MM-DD')
|
||||||
|
|
||||||
|
WHERE t.NEXT_EFF_DATE IS NOT NULL;
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
let oldFieldIds = ["field242087", "field242066", "field242067", "field242069", "field242068", "field242070", "field242071", "field242073", "field242074", "field242095", "field242075", "field242347", "field242099"];
|
||||||
|
// 版本编号0 字段名称1 起用日期2 字段类别3 字段性质4 词典级别5 词典示范信息6 词典数据库7 词典查询网址8 词典附件9 数据源说明10 作废日期11 状态12
|
||||||
|
let newFieldIds = ["field242051", "field242052", "field242053", "field242055", "field242054", "field242077", "field242057", "field242078", "field242061", "field242058", "field242062", "field242346", "field242098"];
|
||||||
|
|
||||||
|
let oldDetFieldIds = ["field242100", "field242101", "field242119", "field242102", "field242103", "field242104", "field242841"];
|
||||||
|
// 编号0 名称1 上级编号2 上级名称3 显示顺序4 状态5 备注6
|
||||||
|
let newDetFieldIds = ["field242040", "field242041", "field242120", "field242042", "field242043", "field242081", "field242044"];
|
||||||
|
|
||||||
|
mainFieldComparator(newFieldIds, oldFieldIds);
|
||||||
|
function mainFieldComparator(newFieldIds, oldFieldIds) {
|
||||||
|
newFieldIds.forEach((id, index) => {
|
||||||
|
let var1 = setInterval(() => {
|
||||||
|
if ($(`.${id}_swapDiv`).length > 0) {
|
||||||
|
clearInterval(var1);
|
||||||
|
fn1(index);
|
||||||
|
}
|
||||||
|
}, 50);
|
||||||
|
});
|
||||||
|
|
||||||
|
let newFieldIds_str = newFieldIds.join(",");
|
||||||
|
WfForm.bindFieldChangeEvent(newFieldIds_str, function (obj, id, value) {
|
||||||
|
let index = newFieldIds.indexOf(id);
|
||||||
|
fn1(index);
|
||||||
|
});
|
||||||
|
|
||||||
|
function fn1(index) {
|
||||||
|
let var1 = WfForm.getFieldValue(oldFieldIds[index]);
|
||||||
|
let var2 = WfForm.getFieldValue(newFieldIds[index]);
|
||||||
|
if (var1 == var2) {
|
||||||
|
document.getElementsByClassName(newFieldIds[index] + "_swapDiv")[0].parentElement.style.background = '#fff';
|
||||||
|
} else {
|
||||||
|
document.getElementsByClassName(newFieldIds[index] + "_swapDiv")[0].parentElement.style.background = '#ccc';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
detailFieldComparator(newDetFieldIds, oldDetFieldIds, 1);
|
||||||
|
function detailFieldComparator(newDetFieldIds, oldDetFieldIds, detnum) {
|
||||||
|
let detRows_str = WfForm.getDetailAllRowIndexStr("detail_" + detnum);
|
||||||
|
if (detRows_str.length > 0) {
|
||||||
|
let detRows = detRows_str.split(",");
|
||||||
|
detRows.forEach(rowIndex => {
|
||||||
|
newDetFieldIds.forEach((id, index) => {
|
||||||
|
let var1 = setInterval(() => {
|
||||||
|
if ($(`.${id}_${rowIndex}_swapDiv`).length > 0) {
|
||||||
|
clearInterval(var1);
|
||||||
|
fn1(index, rowIndex);
|
||||||
|
}
|
||||||
|
}, 50);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let newDetFieldIds_str = newDetFieldIds.join(",");
|
||||||
|
WfForm.bindDetailFieldChangeEvent(newDetFieldIds_str, function (id, rowIndex, value) {
|
||||||
|
let index = newDetFieldIds.indexOf(id);
|
||||||
|
fn1(index, rowIndex);
|
||||||
|
});
|
||||||
|
|
||||||
|
function fn1(index, rowIndex) {
|
||||||
|
let var1 = WfForm.getFieldValue(oldDetFieldIds[index] + "_" + rowIndex);
|
||||||
|
let var2 = WfForm.getFieldValue(newDetFieldIds[index] + "_" + rowIndex);
|
||||||
|
if (var1 == var2) {
|
||||||
|
document.getElementsByClassName(newDetFieldIds[index] + "_" + rowIndex + "_swapDiv")[0].parentElement.style.background = '#fff';
|
||||||
|
} else {
|
||||||
|
document.getElementsByClassName(newDetFieldIds[index] + "_" + rowIndex + "_swapDiv")[0].parentElement.style.background = '#ccc';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
let cblbOptions = WfForm.getSelectItemList('268403'); // 成本类别
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
async function getExpresswayServiceAreaAddress(location_name) {
|
||||||
|
fetch('https://restapi.amap.com/v3/geocode/geo?key=53a92850ca00d7f77aef3297effd8d59&s=rsv3&jscode=220df7c191b808547be3626cbaa9d2bf&callback=&platform=JS&logversion=2.0&appname=http%3A%2F%2F192.168.2.221%3A8088%2Fwui%2Findex.html%23%2Fmain%2Fcube%2Fsearch&csid=AE54D9C0-AC7B-469C-BB7F-F677AFB04F05&sdkversion=1.4.27&address=' + location_name)
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
if (data.info == "OK") {
|
||||||
|
let res = data.geocodes.find(e => e.province == "广东省" && e.level == "道路");
|
||||||
|
if (res != undefined) {
|
||||||
|
return (res.district);
|
||||||
|
} else {
|
||||||
|
res = data.geocodes.find(e => e.province == "广东省");
|
||||||
|
if (res != undefined) {
|
||||||
|
return (res.district);
|
||||||
|
} else {
|
||||||
|
return ("no matched");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return ("no matched");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error:', error);
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
select DISTINCT c.workflowname,b.TABLENAME,a.* from workflow_billfield a join workflow_bill b on a.BILLID =b.id left join workflow_base c on c.formid = a.billid where a.FIELDDBTYPE='38506' //树的id
|
||||||
@@ -1,221 +0,0 @@
|
|||||||
<script src="/myJavaScript/anime.min.js">
|
|
||||||
</script>
|
|
||||||
<script>
|
|
||||||
/*
|
|
||||||
每一步内容都必须存放在一个标签页,标签页横向排列,标签页前后各空出一列
|
|
||||||
每个标签都要在默认的style属性上设置为opacity:0,以默认隐藏步骤内容
|
|
||||||
每个步骤的内容默认隐藏
|
|
||||||
方法参数为对象:{curStepFieldId:"field216855",cols:4,vars:[{tab:"tab1",cnt:"cnt1",top:1},{tab:"tab2",cnt:"cnt2",top:0}],els:["title","identifier"]}
|
|
||||||
curStepFieldId为当前步骤字段id
|
|
||||||
cols为表格有效范围内的列数
|
|
||||||
vars为每个步骤对应的一组参数,vars参数组顺序与标签页DOM节点顺序一致
|
|
||||||
其中第一组参数代表意思为:tab1为标签页class,cnt1为步骤一页面的全部内容,1表示隐藏标签页顶部标签(0表示不隐藏)
|
|
||||||
els为其他需要在方法中将display属性还原的单元格class
|
|
||||||
|
|
||||||
注意:
|
|
||||||
这个方法需要结合以下CSS样式使用,以解决明细表头的问题
|
|
||||||
.excelDetailFixedHead {
|
|
||||||
position: sticky !important;
|
|
||||||
top: 0px !important;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
function pageLateralSlider(obj) {
|
|
||||||
document.getElementsByClassName("wf-req-top-button")[0].parentNode.parentNode.id = "submitBtn";
|
|
||||||
$("#submitBtn").css("cssText", "display:none !important;");
|
|
||||||
const steps = obj.vars.length;
|
|
||||||
//基础判断
|
|
||||||
if (obj.cols !== steps + 2) {
|
|
||||||
console.log("cols数量与vars参数组数量矛盾");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let myIntv = setInterval(() => {
|
|
||||||
//页面元素加载判断
|
|
||||||
for (let i = 0; i < steps; i++) {
|
|
||||||
if ($("." + obj.vars[i].tab).length === 0 || $("." + obj.vars[i].cnt).length === 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
for (let i = 0; i < obj.els.length; i++) {
|
|
||||||
if ($("." + obj.els[i]).length === 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($(".tab_top").length !== steps) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ($("#buttonCell").length === 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ($(".excelMainTable>colgroup col").length !== obj.cols) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ($(".wf-req-form").length === 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if ($(".wf-req-top-button").length === 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
clearInterval(myIntv);
|
|
||||||
//自适应列宽
|
|
||||||
const screen_width = $(".wf-req-form")[0].offsetWidth;
|
|
||||||
const padding_width = Math.floor(0.02 * screen_width);
|
|
||||||
const content_width = screen_width - 2 * padding_width;
|
|
||||||
$(".excelMainTable>colgroup col")[0].style.width = `${padding_width}px`;
|
|
||||||
$(".excelMainTable>colgroup col")[obj.cols - 1].style.width = `${padding_width}px`;
|
|
||||||
for (let i = 1; i <= steps; i++) {
|
|
||||||
$(".excelMainTable>colgroup col")[i].style.width = `${content_width}px`;
|
|
||||||
}
|
|
||||||
//隐藏标签页顶部标签
|
|
||||||
obj.vars.forEach((e, index) => {
|
|
||||||
if (e.top === 1) {
|
|
||||||
$(".tab_top")[index].style.display = "none";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//显示其他需要还原display属性的单元格
|
|
||||||
obj.els.forEach(e => {
|
|
||||||
$("." + e).css("display", "");
|
|
||||||
});
|
|
||||||
//显示当前步骤内容
|
|
||||||
var curStepVar = + WfForm.getFieldValue(obj.curStepFieldId);
|
|
||||||
if (curStepVar === 0) {
|
|
||||||
$("." + obj.vars[curStepVar].cnt).css("display", "");
|
|
||||||
$("." + obj.vars[curStepVar].tab).css("opacity", "1");
|
|
||||||
} else {
|
|
||||||
let distance_0 = -curStepVar * content_width;
|
|
||||||
obj.vars.forEach(e => {
|
|
||||||
anime({
|
|
||||||
targets: '.' + e.tab + '_swap',
|
|
||||||
translateX: distance_0,
|
|
||||||
duration: 0,
|
|
||||||
easing: 'easeInOutQuad',
|
|
||||||
});
|
|
||||||
});
|
|
||||||
$("." + obj.vars[curStepVar].cnt).css("display", "");
|
|
||||||
$("." + obj.vars[curStepVar].tab).css("opacity", "1");
|
|
||||||
}
|
|
||||||
//核心功能
|
|
||||||
$("#buttonCell").append("<span class='ant-btn preStep' style='display:none;'>上一步</span><span class='step-blank' style='display:none;'>  </span><span class='ant-btn nexStep' style='display:none;'>下一步</span>");
|
|
||||||
if (curStepVar === 0) {
|
|
||||||
$(".preStep").css({ "display": "none" });
|
|
||||||
$(".step-blank").css({ "display": "none" });
|
|
||||||
$(".nexStep").css({ "display": "inline" });
|
|
||||||
$("#submitBtn").css("cssText", "display:none !important;");
|
|
||||||
} else if (curStepVar === steps - 1) {
|
|
||||||
$(".preStep").css({ "display": "inline" });
|
|
||||||
$(".step-blank").css({ "display": "none" });
|
|
||||||
$(".nexStep").css({ "display": "none" });
|
|
||||||
$("#submitBtn").css("cssText", "display:inline-block !important;");
|
|
||||||
} else {
|
|
||||||
$(".preStep").css({ "display": "inline" });
|
|
||||||
$(".step-blank").css({ "display": "inline" });
|
|
||||||
$(".nexStep").css({ "display": "inline" });
|
|
||||||
$("#submitBtn").css("cssText", "display:none !important;");
|
|
||||||
}
|
|
||||||
//点击事件
|
|
||||||
var click_judg = 0;
|
|
||||||
$(".nexStep").click(() => {
|
|
||||||
if (click_judg === 0) {
|
|
||||||
click_judg++;
|
|
||||||
curStepVar++;
|
|
||||||
obj.vars.forEach((e, index) => {
|
|
||||||
if (index !== curStepVar) {
|
|
||||||
anime({
|
|
||||||
targets: '.' + e.tab + '_swap',
|
|
||||||
translateX: - curStepVar * content_width,
|
|
||||||
opacity: 0,
|
|
||||||
duration: 500,
|
|
||||||
easing: 'easeInOutQuad',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("." + obj.vars[curStepVar].cnt).css("display", "");
|
|
||||||
$("." + obj.vars[curStepVar].tab).css("opacity", '1');
|
|
||||||
anime({
|
|
||||||
targets: '.' + obj.vars[curStepVar].tab + '_swap',
|
|
||||||
translateX: - curStepVar * content_width,
|
|
||||||
opacity: [0, 1],
|
|
||||||
duration: 500,
|
|
||||||
easing: 'easeInOutQuad'
|
|
||||||
});
|
|
||||||
$("." + obj.vars[curStepVar - 1].cnt).css("display", "none");
|
|
||||||
if (curStepVar === 0) {
|
|
||||||
$(".preStep").css({ "display": "none" });
|
|
||||||
$(".step-blank").css({ "display": "none" });
|
|
||||||
$(".nexStep").css({ "display": "inline" });
|
|
||||||
$("#submitBtn").css("cssText", "display:none !important;");
|
|
||||||
} else if (curStepVar === steps - 1) {
|
|
||||||
$(".preStep").css({ "display": "inline" });
|
|
||||||
$(".step-blank").css({ "display": "none" });
|
|
||||||
$(".nexStep").css({ "display": "none" });
|
|
||||||
$("#submitBtn").css("cssText", "display:inline-block !important;");
|
|
||||||
} else {
|
|
||||||
$(".preStep").css({ "display": "inline" });
|
|
||||||
$(".step-blank").css({ "display": "inline" });
|
|
||||||
$(".nexStep").css({ "display": "inline" });
|
|
||||||
$("#submitBtn").css("cssText", "display:none !important;");
|
|
||||||
}
|
|
||||||
WfForm.changeFieldValue(obj.curStepFieldId, { value: curStepVar });
|
|
||||||
click_judg--;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$(".preStep").click(() => {
|
|
||||||
if (click_judg === 0) {
|
|
||||||
click_judg++;
|
|
||||||
curStepVar--;
|
|
||||||
obj.vars.forEach((e, index) => {
|
|
||||||
if (index !== curStepVar) {
|
|
||||||
anime({
|
|
||||||
targets: '.' + e.tab + '_swap',
|
|
||||||
translateX: - curStepVar * content_width,
|
|
||||||
opacity: 0,
|
|
||||||
duration: 500,
|
|
||||||
easing: 'easeInOutQuad',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("." + obj.vars[curStepVar].cnt).css("display", "");
|
|
||||||
$("." + obj.vars[curStepVar].tab).css("opacity", '1');
|
|
||||||
anime({
|
|
||||||
targets: '.' + obj.vars[curStepVar].tab + '_swap',
|
|
||||||
translateX: - curStepVar * content_width,
|
|
||||||
opacity: [0, 1],
|
|
||||||
duration: 500,
|
|
||||||
easing: 'easeInOutQuad'
|
|
||||||
});
|
|
||||||
$("." + obj.vars[curStepVar + 1].cnt).css("display", "none");
|
|
||||||
if (curStepVar === 0) {
|
|
||||||
$(".preStep").css({ "display": "none" });
|
|
||||||
$(".step-blank").css({ "display": "none" });
|
|
||||||
$(".nexStep").css({ "display": "inline" });
|
|
||||||
$("#submitBtn").css("cssText", "display:none !important;");
|
|
||||||
} else if (curStepVar === steps - 1) {
|
|
||||||
$(".preStep").css({ "display": "inline" });
|
|
||||||
$(".step-blank").css({ "display": "none" });
|
|
||||||
$(".nexStep").css({ "display": "none" });
|
|
||||||
$("#submitBtn").css("cssText", "display:inline-block !important;");
|
|
||||||
} else {
|
|
||||||
$(".preStep").css({ "display": "inline" });
|
|
||||||
$(".step-blank").css({ "display": "inline" });
|
|
||||||
$(".nexStep").css({ "display": "inline" });
|
|
||||||
$("#submitBtn").css("cssText", "display:none !important;");
|
|
||||||
}
|
|
||||||
WfForm.changeFieldValue(obj.curStepFieldId, { value: curStepVar });
|
|
||||||
click_judg--;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
/*隐藏提交按钮*/
|
|
||||||
.ant-col-xs-18>div>span:nth-of-type(1) {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*修复明细浮动表头问题*/
|
|
||||||
.excelDetailFixedHead {
|
|
||||||
position: sticky !important;
|
|
||||||
top: 0px !important;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -0,0 +1,400 @@
|
|||||||
|
/*
|
||||||
|
每一步内容都必须存放在一个标签页,标签页横向排列,标签页前后各空出一列
|
||||||
|
每个标签都要在默认的style属性上设置为opacity:0,以默认隐藏步骤内容
|
||||||
|
每个步骤的内容默认隐藏
|
||||||
|
方法参数为对象:
|
||||||
|
{
|
||||||
|
curStepFieldId: curStep_FI,
|
||||||
|
cols: 5,
|
||||||
|
title_class: ".title",
|
||||||
|
title_value: ["OA开发需求", "流程开发需求", "台账开发需求"],
|
||||||
|
vars: [{
|
||||||
|
page: "tab1",
|
||||||
|
cnt: "cnt1",
|
||||||
|
top: 1,
|
||||||
|
titleIndex: 0,
|
||||||
|
mainTabCol: 1,
|
||||||
|
default_tab: 5,
|
||||||
|
tab_required_info: [
|
||||||
|
{
|
||||||
|
tabid: 5,
|
||||||
|
main_feild: [xqlx_FI, cdfj_FI, ssbk_FI, glbm_FI, syjg_FI, sybm_FI, aim_FI],
|
||||||
|
det_field: [{ det_id: 1, noEmpty: true, det_name: "节点信息明细", field_id: [jdxh_dt1_FI, jdmc_dt1_FI, jdczz_dt1_FI, sm_dt1_FI] }],
|
||||||
|
}
|
||||||
|
],
|
||||||
|
}],
|
||||||
|
els: ["title"],
|
||||||
|
archiveNodeId: 172868,// 归档节点ID
|
||||||
|
}
|
||||||
|
curStepFieldId为当前步骤字段id
|
||||||
|
cols为表格有效范围内的列数
|
||||||
|
title_class为流程页面标题的jQuery选择器
|
||||||
|
title_value为所有步骤相关的标题名称
|
||||||
|
vars为每个步骤对应的一组参数,vars参数组顺序与标签页DOM节点顺序一致
|
||||||
|
其中第一组参数代表意思为:tab1为标签页class,cnt1为步骤一页面全部内容的统一class,top值1表示隐藏标签页顶部标签(0表示不隐藏),titleIndex值0为该标签对应的标题名称在title_value中的序号(从0开始),mainTabCol为标签页在主表中的列数(从0开始),default_tab为默认子标签,tab_required_info用于处理标签页内子标签的必填字段排查、必增明细排查
|
||||||
|
els为其他需要在方法中将display属性还原的单元格class
|
||||||
|
|
||||||
|
注意:
|
||||||
|
(1)当步骤发生变化时,需修改参数对象 sld_obj ,并执行一遍 initialization(sld_obj)的列宽设置
|
||||||
|
(2)这个方法需要结合以下CSS样式使用,以解决明细表头的问题
|
||||||
|
.excelDetailFixedHead {
|
||||||
|
position: sticky !important;
|
||||||
|
top: 0px !important;
|
||||||
|
}
|
||||||
|
(3)结合以下CSS样式,以解决提交按钮问题,前提是要把提交按钮放在快捷按钮的第一位
|
||||||
|
.ant-col-xs-18>div>span:nth-of-type(1):not(.wea-new-top-req-drop-btn) {
|
||||||
|
display: none !important;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ant-menu-vertical>.ant-menu-item:nth-of-type(1) {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
function pageLateralSlider(sld_obj) {
|
||||||
|
Object.assign(sld_obj, {
|
||||||
|
currentnode: true,
|
||||||
|
});
|
||||||
|
if (WfForm.getGlobalStore().commonParam.currentnodeid != undefined && (WfForm.getGlobalStore().commonParam.currentnodeid == sld_obj.archiveNodeId || WfForm.getGlobalStore().commonParam.currentnodeid != WfForm.getGlobalStore().commonParam.nodeid)) {
|
||||||
|
sld_obj.currentnode = false;
|
||||||
|
}
|
||||||
|
var steps = sld_obj.vars.length;
|
||||||
|
let myIntv1 = setInterval(() => {
|
||||||
|
//页面元素加载判断
|
||||||
|
for (let i = 0; i < steps; i++) {
|
||||||
|
if ($("." + sld_obj.vars[i].page).length === 0 || $("." + sld_obj.vars[i].cnt).length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let i = 0; i < sld_obj.els.length; i++) {
|
||||||
|
if ($("." + sld_obj.els[i]).length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($("#buttonCell").length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($(sld_obj.title_class + " span").length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($(".excelMainTable>colgroup col").length !== sld_obj.cols) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($(".wf-req-form").length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ($(".wf-req-top-button").length === 0 && sld_obj.currentnode == true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
clearInterval(myIntv1);
|
||||||
|
if (sld_obj.currentnode == true) {
|
||||||
|
document.getElementsByClassName("wf-req-top-button")[0].parentNode.parentNode.id = "submitBtn";
|
||||||
|
$(".ant-menu-vertical>.ant-menu-item:nth-of-type(1)").css("cssText", "display:none !important;");
|
||||||
|
$("#submitBtn").css("cssText", "display:none !important;");
|
||||||
|
} else {
|
||||||
|
$(".ant-menu-vertical>.ant-menu-item:nth-of-type(1)").css("cssText", "display:list-item !important;");
|
||||||
|
$(".ant-col-xs-18>div>span:nth-of-type(1)").css("cssText", "display:inline-block !important;");
|
||||||
|
}
|
||||||
|
//自适应列宽
|
||||||
|
const screen_width = $(".wf-req-form")[0].offsetWidth;
|
||||||
|
const padding_width = Math.floor(0.02 * screen_width);
|
||||||
|
const content_width = screen_width - 2 * padding_width;
|
||||||
|
Object.assign(sld_obj, {
|
||||||
|
content_width: content_width,
|
||||||
|
});
|
||||||
|
$(".excelMainTable>colgroup col")[0].style.width = `${padding_width}px`;
|
||||||
|
$(".excelMainTable>colgroup col")[sld_obj.cols - 1].style.width = `${padding_width}px`;
|
||||||
|
initialization(sld_obj);
|
||||||
|
//添加消除prompt的字段集
|
||||||
|
Object.assign(sld_obj, {
|
||||||
|
eraser_fis: [],
|
||||||
|
});
|
||||||
|
//获取当前步骤标题信息
|
||||||
|
Object.assign(sld_obj, {
|
||||||
|
curStep: 0,
|
||||||
|
});
|
||||||
|
var curStepVar = + WfForm.getFieldValue(sld_obj.curStepFieldId);
|
||||||
|
//添加功能按钮
|
||||||
|
$("#buttonCell").append("<span class='ant-btn preStep' style='display:none;'>上一步</span><span class='step-blank' style='display:none;'>  </span><span class='ant-btn nexStep' style='display:none;'>下一步</span>");
|
||||||
|
//添加按钮功能
|
||||||
|
pageLateralSliderClick(sld_obj);
|
||||||
|
//显示其他需要还原display属性的单元格
|
||||||
|
sld_obj.els.forEach(e => {
|
||||||
|
$("." + e).css("display", "");
|
||||||
|
});
|
||||||
|
//显示当前步骤内容
|
||||||
|
$("." + sld_obj.vars[0].cnt).css("display", "");
|
||||||
|
$("." + sld_obj.vars[0].page).css("opacity", "1");
|
||||||
|
$(".preStep").css({ "display": "none" });
|
||||||
|
$(".step-blank").css({ "display": "none" });
|
||||||
|
$(".nexStep").css({ "display": "inline" });
|
||||||
|
if (sld_obj.currentnode == true) {
|
||||||
|
$(".ant-menu-vertical>.ant-menu-item:nth-of-type(1)").css("cssText", "display:none !important;");
|
||||||
|
$("#submitBtn").css("cssText", "display:none !important;");
|
||||||
|
}
|
||||||
|
if (curStepVar > 0) {
|
||||||
|
for (let i = 0; i < curStepVar; i++) {
|
||||||
|
if (i === 0) {
|
||||||
|
$(".nexStep")[0].click();
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
$(".nexStep")[0].click();
|
||||||
|
}, i * 500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
function initialization(init_obj) {
|
||||||
|
//设置列宽
|
||||||
|
let useful_cols = [];
|
||||||
|
init_obj.vars.forEach(e => {
|
||||||
|
useful_cols.push(e.mainTabCol);
|
||||||
|
});
|
||||||
|
for (let i = 1; i <= init_obj.cols - 2; i++) {
|
||||||
|
if (useful_cols.includes(i)) {
|
||||||
|
$(".excelMainTable>colgroup col")[i].style.width = `${init_obj.content_width}px`;
|
||||||
|
} else {
|
||||||
|
$(".excelMainTable>colgroup col")[i].style.width = `1px`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//隐藏标签页顶部标签
|
||||||
|
init_obj.vars.forEach(e => {
|
||||||
|
if (e.top === 1) {
|
||||||
|
$("." + e.page + " .tab_top")[0].style.display = "none";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function pageLateralSliderClick(clc_obj) {
|
||||||
|
var clc_content_width = clc_obj.content_width;
|
||||||
|
$(".nexStep").off("click");
|
||||||
|
$(".preStep").off("click");
|
||||||
|
//点击事件
|
||||||
|
var click_judg = 0;
|
||||||
|
$(".nexStep").click(() => {
|
||||||
|
if (click_judg === 0) {
|
||||||
|
if (showEmptyRequiredField(clc_obj) == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
click_judg++;
|
||||||
|
clc_obj.curStep++;
|
||||||
|
$(clc_obj.title_class + " span")[0].innerHTML = clc_obj.title_value[clc_obj.vars[clc_obj.curStep].titleIndex];
|
||||||
|
let offset = (clc_obj.vars[clc_obj.curStep].mainTabCol - 1 - clc_obj.curStep);
|
||||||
|
clc_obj.vars.forEach((e, index) => {
|
||||||
|
if (index !== clc_obj.curStep) {
|
||||||
|
anime({
|
||||||
|
targets: '.' + e.page,
|
||||||
|
translateX: - clc_obj.curStep * clc_content_width - offset,
|
||||||
|
opacity: 0,
|
||||||
|
duration: 500,
|
||||||
|
easing: 'easeInOutQuad',
|
||||||
|
complete: () => {
|
||||||
|
$("." + e.cnt).css("display", "none");
|
||||||
|
$("#tab_" + e.default_tab).click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("." + clc_obj.vars[clc_obj.curStep].cnt).css("display", "");
|
||||||
|
anime({
|
||||||
|
targets: '.' + clc_obj.vars[clc_obj.curStep].page,
|
||||||
|
translateX: - clc_obj.curStep * clc_content_width - offset,
|
||||||
|
opacity: 1,
|
||||||
|
duration: 500,
|
||||||
|
easing: 'easeInOutQuad',
|
||||||
|
complete: () => {
|
||||||
|
$('.' + clc_obj.vars[clc_obj.curStep].cnt).css("display", "");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (clc_obj.curStep === 0) {
|
||||||
|
$(".preStep").css({ "display": "none" });
|
||||||
|
$(".step-blank").css({ "display": "none" });
|
||||||
|
$(".nexStep").css({ "display": "inline" });
|
||||||
|
if (clc_obj.currentnode == true) {
|
||||||
|
$(".ant-menu-vertical>.ant-menu-item:nth-of-type(1)").css("cssText", "display:none !important;");
|
||||||
|
$("#submitBtn").css("cssText", "display:none !important;");
|
||||||
|
}
|
||||||
|
} else if (clc_obj.curStep === clc_obj.vars.length - 1) {
|
||||||
|
$(".preStep").css({ "display": "inline" });
|
||||||
|
$(".step-blank").css({ "display": "none" });
|
||||||
|
$(".nexStep").css({ "display": "none" });
|
||||||
|
if (clc_obj.currentnode == true) {
|
||||||
|
$(".ant-menu-vertical>.ant-menu-item:nth-of-type(1)").css("cssText", "display:list-item !important;");
|
||||||
|
$("#submitBtn").css("cssText", "display:inline-block !important;");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$(".preStep").css({ "display": "inline" });
|
||||||
|
$(".step-blank").css({ "display": "inline" });
|
||||||
|
$(".nexStep").css({ "display": "inline" });
|
||||||
|
if (clc_obj.currentnode == true) {
|
||||||
|
$(".ant-menu-vertical>.ant-menu-item:nth-of-type(1)").css("cssText", "display:none !important;");
|
||||||
|
$("#submitBtn").css("cssText", "display:none !important;");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
WfForm.changeFieldValue(clc_obj.curStepFieldId, { value: clc_obj.curStep });
|
||||||
|
click_judg--;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$(".preStep").click(() => {
|
||||||
|
$(`.myprom`).remove();
|
||||||
|
if (click_judg === 0) {
|
||||||
|
click_judg++;
|
||||||
|
clc_obj.curStep--;
|
||||||
|
$(clc_obj.title_class + " span")[0].innerHTML = clc_obj.title_value[clc_obj.vars[clc_obj.curStep].titleIndex];
|
||||||
|
let offset = (clc_obj.vars[clc_obj.curStep].mainTabCol - 1 - clc_obj.curStep);
|
||||||
|
clc_obj.vars.forEach((e, index) => {
|
||||||
|
if (index !== clc_obj.curStep) {
|
||||||
|
anime({
|
||||||
|
targets: '.' + e.page,
|
||||||
|
translateX: - clc_obj.curStep * clc_content_width - offset,
|
||||||
|
opacity: 0,
|
||||||
|
duration: 500,
|
||||||
|
easing: 'easeInOutQuad',
|
||||||
|
complete: () => {
|
||||||
|
$("." + e.cnt).css("display", "none");
|
||||||
|
$("#tab_" + e.default_tab).click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("." + clc_obj.vars[clc_obj.curStep].cnt).css("display", "");
|
||||||
|
anime({
|
||||||
|
targets: '.' + clc_obj.vars[clc_obj.curStep].page,
|
||||||
|
translateX: - clc_obj.curStep * clc_content_width - offset,
|
||||||
|
opacity: 1,
|
||||||
|
duration: 500,
|
||||||
|
easing: 'easeInOutQuad',
|
||||||
|
complete: () => {
|
||||||
|
$('.' + clc_obj.vars[clc_obj.curStep].cnt).css("display", "");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (clc_obj.curStep === 0) {
|
||||||
|
$(".preStep").css({ "display": "none" });
|
||||||
|
$(".step-blank").css({ "display": "none" });
|
||||||
|
$(".nexStep").css({ "display": "inline" });
|
||||||
|
if (clc_obj.currentnode == true) {
|
||||||
|
$(".ant-menu-vertical>.ant-menu-item:nth-of-type(1)").css("cssText", "display:none !important;");
|
||||||
|
$("#submitBtn").css("cssText", "display:none !important;");
|
||||||
|
}
|
||||||
|
} else if (clc_obj.curStep === clc_obj.vars.length - 1) {
|
||||||
|
$(".preStep").css({ "display": "inline" });
|
||||||
|
$(".step-blank").css({ "display": "none" });
|
||||||
|
$(".nexStep").css({ "display": "none" });
|
||||||
|
if (clc_obj.currentnode == true) {
|
||||||
|
$(".ant-menu-vertical>.ant-menu-item:nth-of-type(1)").css("cssText", "display:list-item !important;");
|
||||||
|
$("#submitBtn").css("cssText", "display:inline-block !important;");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$(".preStep").css({ "display": "inline" });
|
||||||
|
$(".step-blank").css({ "display": "inline" });
|
||||||
|
$(".nexStep").css({ "display": "inline" });
|
||||||
|
if (clc_obj.currentnode == true) {
|
||||||
|
$(".ant-menu-vertical>.ant-menu-item:nth-of-type(1)").css("cssText", "display:none !important;");
|
||||||
|
$("#submitBtn").css("cssText", "display:none !important;");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
WfForm.changeFieldValue(clc_obj.curStepFieldId, { value: clc_obj.curStep });
|
||||||
|
click_judg--;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
function showEmptyRequiredField(serf_obj) {
|
||||||
|
let serf_arr = serf_obj.vars[serf_obj.curStep].tab_required_info;
|
||||||
|
for (let e of serf_arr) {
|
||||||
|
for (let me of e.main_feild) {
|
||||||
|
if (WfForm.getFieldValue(me) == "" && WfForm.getFieldCurViewAttr(me) == 3) {
|
||||||
|
$(`.myprom`).remove();
|
||||||
|
showPrompt(me, "必填字段不能空!", e.tabid);
|
||||||
|
checkPrompt();
|
||||||
|
if (!serf_obj.eraser_fis.includes(me)) {
|
||||||
|
serf_obj.eraser_fis.push(me);
|
||||||
|
WfForm.bindFieldChangeEvent(me, function (obj, id, value) {
|
||||||
|
if (value !== "") {
|
||||||
|
eraseFieldPrompt(me);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let de of e.det_field) {
|
||||||
|
let detRows_str = WfForm.getDetailAllRowIndexStr("detail_" + de.det_id);
|
||||||
|
if (detRows_str.length > 0) {
|
||||||
|
let detRows_arr = detRows_str.split(",");
|
||||||
|
for (let rowI of detRows_arr) {
|
||||||
|
for (let de_f of de.field_id) {
|
||||||
|
if (WfForm.getFieldValue(de_f + "_" + rowI) == "" && WfForm.getFieldCurViewAttr(de_f + "_" + rowI) == 3) {
|
||||||
|
$(`.myprom`).remove();
|
||||||
|
showPrompt(de_f, "必填字段不能空!", e.tabid, rowI);
|
||||||
|
checkPrompt();
|
||||||
|
if (!serf_obj.eraser_fis.includes(de_f)) {
|
||||||
|
serf_obj.eraser_fis.push(de_f);
|
||||||
|
WfForm.bindDetailFieldChangeEvent(de_f, function (id, rowIndex, value) {
|
||||||
|
if (value !== "") {
|
||||||
|
eraseFieldPrompt(de_f, rowIndex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (de.noEmpty == true) {
|
||||||
|
WfForm.showMessage(de.det_name + "不能为空!", 2, 5);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
function showPrompt(SP_fieldid, SP_content, SP_tabid, SP_rowIndex) {//添加提示,SP_rowIndex选填;如要填SP_rowIndex,SP_tabid必填,可填null
|
||||||
|
if (SP_rowIndex === null || SP_rowIndex === undefined) {
|
||||||
|
$(`.myprom_${SP_fieldid}`).remove();
|
||||||
|
if ($(`.${SP_fieldid}_swapDiv`).length > 0) {
|
||||||
|
$(`.${SP_fieldid}_swapDiv`).after(`<div class="prompt-box myprom myprom_${SP_fieldid}" data_tab_id=${SP_tabid}><div class="prompt-arrow" style="top: -3px;"></div><div class="prompt-content"><i class="anticon anticon-exclamation-circle"></i><span class="prompt-content-label">${SP_content}</span><span class="prompt-content-info"></span></div></div>`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$(`.myprom_${SP_fieldid}_${SP_rowIndex}`).remove();
|
||||||
|
if ($(`.${SP_fieldid}_${SP_rowIndex}_swapDiv`).length > 0) {
|
||||||
|
$(`.${SP_fieldid}_${SP_rowIndex}_swapDiv`).after(`<div class="prompt-box myprom myprom_${SP_fieldid}_${SP_rowIndex}" data_tab_id=${SP_tabid}><div class="prompt-arrow" style="top: -3px;"></div><div class="prompt-content"><i class="anticon anticon-exclamation-circle"></i><span class="prompt-content-label">${SP_content}</span><span class="prompt-content-info"></span></div></div>`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function eraseFieldPrompt(EFP_fieldid, EFP_rowIndex) {//移除提示,SP_rowIndex选填
|
||||||
|
if (EFP_rowIndex === null || EFP_rowIndex === undefined) {
|
||||||
|
$(`.myprom_${EFP_fieldid}`).remove();
|
||||||
|
} else {
|
||||||
|
$(`.myprom_${EFP_fieldid}_${EFP_rowIndex}`).remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function checkPrompt() {//提交前判断,先做一次if ($(".myprom").length > 0) {}判断,true则触发该方法,并禁断提交,false不执行
|
||||||
|
let tab_id = $(".myprom")[0].getAttribute("data_tab_id");
|
||||||
|
if (tab_id === "null" || tab_id === "undefined") {
|
||||||
|
let scroll_to_windowTop = $(".wf-req-form-scroll")[0].getBoundingClientRect().top;//scroll框距离window顶部的距离
|
||||||
|
let dom_to_scrollTop = $(".myprom")[0].getBoundingClientRect().top - scroll_to_windowTop;//DOM节点距离scroll框顶部的距离
|
||||||
|
let scroll_display_height = window.innerHeight - scroll_to_windowTop;//scroll框最大显示高度
|
||||||
|
if (dom_to_scrollTop < scroll_display_height / 4 || dom_to_scrollTop > scroll_display_height / 4 * 3) {
|
||||||
|
$(".wf-req-form-scroll")[0].scrollTo({
|
||||||
|
top: dom_to_scrollTop + $(".wf-req-form-scroll")[0].scrollTop - scroll_display_height / 2,
|
||||||
|
behavior: "smooth"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$("#tab_" + tab_id)[0].click();
|
||||||
|
let myInterval2;
|
||||||
|
myInterval2 = setInterval(() => {
|
||||||
|
if ($("#tab_" + tab_id + "_content").css("display") == "block") {
|
||||||
|
clearInterval(myInterval2);
|
||||||
|
let scroll_to_windowTop = $(".wf-req-form-scroll")[0].getBoundingClientRect().top;//scroll框距离window顶部的距离
|
||||||
|
let dom_to_scrollTop = $(".myprom")[0].getBoundingClientRect().top - scroll_to_windowTop;//DOM节点距离scroll框顶部的距离
|
||||||
|
let scroll_display_height = window.innerHeight - scroll_to_windowTop;//scroll框最大显示高度
|
||||||
|
if (dom_to_scrollTop < scroll_display_height / 4 || dom_to_scrollTop > scroll_display_height / 4 * 3) {
|
||||||
|
$(".wf-req-form-scroll")[0].scrollTo({
|
||||||
|
top: dom_to_scrollTop + $(".wf-req-form-scroll")[0].scrollTop - scroll_display_height / 2,
|
||||||
|
behavior: "smooth"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
|
}
|
||||||