{"id":602,"date":"2025-08-09T11:05:01","date_gmt":"2025-08-09T03:05:01","guid":{"rendered":"https:\/\/www.subkme.com\/?p=602"},"modified":"2025-08-09T11:06:09","modified_gmt":"2025-08-09T03:06:09","slug":"%e3%80%90%e6%b2%b9%e7%8c%b4%e8%84%9a%e6%9c%ac%e3%80%91%e9%9b%86%e5%9b%a2oa%e6%98%be%e7%a4%ba%e4%b8%bb%e8%a6%81%e9%a2%86%e5%af%bc%e5%90%8e%e7%bb%ad%e5%a4%84%e7%90%86%e7%8e%af%e8%8a%82","status":"publish","type":"post","link":"https:\/\/subk.me\/?p=602","title":{"rendered":"\u3010\u6cb9\u7334\u811a\u672c\u3011\u96c6\u56e2OA\u663e\u793a\u4e3b\u8981\u9886\u5bfc\u540e\u7eed\u5904\u7406\u73af\u8282"},"content":{"rendered":"<p>\u6cb9\u7334\u811a\u672c\uff0c\u5904\u7406\u96c6\u56e2OA\u6587\u4ef6\uff0c\u83b7\u53d6\u4e3b\u8981\u9886\u5bfc\u6587\u4ef6\u4e0b\u4e00\u6b65\u5206\u53d1\u52a8\u4f5c\uff0c\u9632\u6b62\u91cd\u590d\u63d0\u4ea4\u3002<\/p>\n<blockquote>\n<p>\u9690\u85cf\u90e8\u5206\u5173\u952e\u4fe1\u606f<\/p>\n<\/blockquote>\n<pre><code>\/\/ ==UserScript==\n\/\/ @name         \u96c6\u56e2OA\u663e\u793a\u5f90XX\u540e\u7eed\u5904\u7406\u73af\u8282\n\/\/ @namespace    http:\/\/tampermonkey.net\/\n\/\/ @version      2.5\n\/\/ @description  \u540e\u53f0\u83b7\u53d6\u5904\u7406\u4eba&quot;\u5f90XX&quot;\u7684&quot;\u540e\u7eed\u5904\u7406\u73af\u8282&quot;\u5185\u5bb9\u5e76\u5728\u9875\u9762\u53f3\u4e0a\u89d2\u663e\u793a\uff08\u5b8c\u5168\u65e0\u611f\u6a21\u5f0f\uff0c\u65e0\u95ea\u70c1\uff09\n\/\/ @author       You\n\/\/ @match        http:\/\/XXXXXX\/std-official-document-view\/g4\/process-form*\n\/\/ @grant        none\n\/\/ ==\/UserScript==\n\n(function () {\n    &#039;use strict&#039;;\n\n    let isProcessing = false;\n    let observer = null;\n    let dataCheckInterval = null;\n    let dialogHideInterval = null;\n\n    \/\/ \u521b\u5efa\u9875\u9762\u53f3\u4e0a\u89d2\u663e\u793a\u533a\u57df\n    function createPageDisplayArea(content) {\n        let displayDiv = document.getElementById(&#039;xuXX-display&#039;);\n        if (!displayDiv) {\n            displayDiv = document.createElement(&#039;div&#039;);\n            displayDiv.id = &#039;xuXX-display&#039;;\n            displayDiv.style.cssText = `\n                position: fixed;\n                top: 10px;\n                right: 10px;\n                background-color: #e6f7ff;\n                border: 1px solid #1890ff;\n                padding: 8px 12px;\n                z-index: 9999;\n                font-size: 12px;\n                border-radius: 4px;\n                box-shadow: 0 2px 8px rgba(0,0,0,0.15);\n                max-width: 280px;\n                max-height: 80px;\n                overflow: hidden;\n            `;\n\n            const title = document.createElement(&#039;div&#039;);\n            title.style.cssText = `\n                font-weight: bold;\n                color: #1890ff;\n                margin-bottom: 3px;\n                font-size: 12px;\n            `;\n            title.textContent = &#039;\u5f90XX\u540e\u7eed\u5904\u7406\uff1a&#039;;\n            displayDiv.appendChild(title);\n\n            const contentDiv = document.createElement(&#039;div&#039;);\n            contentDiv.id = &#039;xuXX-content&#039;;\n            contentDiv.style.cssText = `\n                color: #333;\n                word-break: break-all;\n                line-height: 1.3;\n                font-size: 11px;\n            `;\n            contentDiv.textContent = content || &#039;\u83b7\u53d6\u4e2d...&#039;;\n            displayDiv.appendChild(contentDiv);\n\n            document.body.appendChild(displayDiv);\n        } else {\n            document.getElementById(&#039;xuXX-content&#039;).textContent = content || &#039;\u672a\u627e\u5230\u76f8\u5173\u4fe1\u606f&#039;;\n            displayDiv.style.display = &#039;block&#039;;\n        }\n\n        return displayDiv;\n    }\n\n    \/\/ \u5b8c\u5168\u65e0\u611f\u9690\u85cf\u5bf9\u8bdd\u6846\n    function hideDialogCompletely() {\n        try {\n            \/\/ \u505c\u6b62\u4e4b\u524d\u7684\u9690\u85cf\u76d1\u63a7\n            if (dialogHideInterval) {\n                clearInterval(dialogHideInterval);\n            }\n\n            \/\/ \u52a8\u6001\u6ce8\u5165\u6837\u5f0f\uff0c\u5f3a\u5236\u9690\u85cf\u6240\u6709\u53ef\u80fd\u7684\u5bf9\u8bdd\u6846\n            const style = document.createElement(&#039;style&#039;);\n            style.id = &#039;xuXX-hide-dialog&#039;;\n            style.textContent = `\n                .el-dialog[aria-label=&quot;\u6d41\u7a0b\u8ddf\u8e2a&quot;],\n                .el-dialog:has(.el-dialog__title:not(:empty):contains(&quot;\u6d41\u7a0b\u8ddf\u8e2a&quot;)) {\n                    display: none !important;\n                    visibility: hidden !important;\n                    opacity: 0 !important;\n                    position: absolute !important;\n                    left: -9999px !important;\n                    top: -9999px !important;\n                    width: 0 !important;\n                    height: 0 !important;\n                    pointer-events: none !important;\n                }\n                .el-dialog__wrapper:has(.el-dialog[aria-label=&quot;\u6d41\u7a0b\u8ddf\u8e2a&quot;]),\n                .el-dialog__wrapper:has(.el-dialog .el-dialog__title:not(:empty):contains(&quot;\u6d41\u7a0b\u8ddf\u8e2a&quot;)) {\n                    display: none !important;\n                    visibility: hidden !important;\n                }\n            `;\n            document.head.appendChild(style);\n\n            \/\/ \u6301\u7eed\u76d1\u63a7\u5e76\u9690\u85cf\u5bf9\u8bdd\u6846\uff08\u4ee5\u9632\u52a8\u6001\u52a0\u8f7d\u7ed5\u8fc7\u6837\u5f0f\uff09\n            dialogHideInterval = setInterval(() =&gt; {\n                const dialogs = document.querySelectorAll(&#039;.el-dialog&#039;);\n                dialogs.forEach(dialog =&gt; {\n                    const title = dialog.querySelector(&#039;.el-dialog__title&#039;);\n                    if (title &amp;&amp; title.textContent.trim() === &#039;\u6d41\u7a0b\u8ddf\u8e2a&#039;) {\n                        dialog.style.cssText = `\n                            display: none !important;\n                            visibility: hidden !important;\n                            opacity: 0 !important;\n                            position: absolute !important;\n                            left: -9999px !important;\n                            top: -9999px !important;\n                            width: 0 !important;\n                            height: 0 !important;\n                        `;\n                        \/\/ \u9690\u85cf\u7236\u7ea7 wrapper\n                        const wrapper = dialog.closest(&#039;.el-dialog__wrapper&#039;);\n                        if (wrapper) {\n                            wrapper.style.display = &#039;none !important&#039;;\n                        }\n                    }\n                });\n            }, 20); \/\/ \u63d0\u9ad8\u68c0\u67e5\u9891\u7387\u523020ms\uff0c\u786e\u4fdd\u65e0\u95ea\u70c1\n\n            \/\/ 3\u79d2\u540e\u505c\u6b62\u9690\u85cf\u68c0\u67e5\uff08\u51cf\u5c11\u8d44\u6e90\u5360\u7528\uff09\n            setTimeout(() =&gt; {\n                if (dialogHideInterval) {\n                    clearInterval(dialogHideInterval);\n                    dialogHideInterval = null;\n                }\n                \/\/ \u79fb\u9664\u52a8\u6001\u6837\u5f0f\n                const styleElement = document.getElementById(&#039;xuXX-hide-dialog&#039;);\n                if (styleElement) {\n                    styleElement.remove();\n                }\n            }, 3000);\n\n        } catch (e) {\n            console.error(&#039;[\u5f90XX\u811a\u672c] \u9690\u85cf\u5bf9\u8bdd\u6846\u5f02\u5e38:&#039;, e);\n        }\n    }\n\n    \/\/ \u5f7b\u5e95\u5173\u95ed\u6d41\u7a0b\u8ddf\u8e2a\u5bf9\u8bdd\u6846\n    function closeProcessTraceDialog() {\n        try {\n            if (dialogHideInterval) {\n                clearInterval(dialogHideInterval);\n                dialogHideInterval = null;\n            }\n\n            const dialogs = document.querySelectorAll(&#039;.el-dialog&#039;);\n            for (let dialog of dialogs) {\n                const title = dialog.querySelector(&#039;.el-dialog__title&#039;);\n                if (title &amp;&amp; title.textContent.trim() === &#039;\u6d41\u7a0b\u8ddf\u8e2a&#039;) {\n                    const closeBtn = dialog.querySelector(&#039;.el-dialog__headerbtn&#039;);\n                    if (closeBtn) {\n                        closeBtn.click();\n                        const event = new MouseEvent(&#039;click&#039;, {\n                            view: window,\n                            bubbles: true,\n                            cancelable: true\n                        });\n                        closeBtn.dispatchEvent(event);\n                    }\n                    setTimeout(() =&gt; {\n                        if (dialog.parentNode) {\n                            dialog.parentNode.removeChild(dialog);\n                        }\n                    }, 50);\n                    return true;\n                }\n            }\n            return false;\n        } catch (e) {\n            console.error(&#039;[\u5f90XX\u811a\u672c] \u5173\u95ed\u5bf9\u8bdd\u6846\u5f02\u5e38:&#039;, e);\n            return false;\n        }\n    }\n\n    \/\/ \u6e05\u7406\u6240\u6709\u5b9a\u65f6\u5668\u548c\u89c2\u5bdf\u5668\n    function cleanup() {\n        if (dataCheckInterval) {\n            clearInterval(dataCheckInterval);\n            dataCheckInterval = null;\n        }\n\n        if (dialogHideInterval) {\n            clearInterval(dialogHideInterval);\n            dialogHideInterval = null;\n        }\n\n        if (observer) {\n            observer.disconnect();\n            observer = null;\n        }\n\n        isProcessing = false;\n    }\n\n    \/\/ \u63d0\u53d6\u5f90XX\u4fe1\u606f\n    function extractXuXXInfo(processFlow) {\n        let foundContent = &#039;\u672a\u627e\u5230\u76f8\u5173\u4fe1\u606f&#039;;\n\n        if (dataCheckInterval) {\n            clearInterval(dataCheckInterval);\n        }\n\n        const checkDataLoaded = () =&gt; {\n            try {\n                const rows = processFlow.querySelectorAll(&#039;.el-table__body tbody tr&#039;);\n                if (rows.length &gt; 0) {\n                    clearInterval(dataCheckInterval);\n                    dataCheckInterval = null;\n\n                    for (let i = 0; i &lt; rows.length; i++) {\n                        const row = rows[i];\n                        const processorCell = row.querySelector(&#039;.el-table_1_column_2 .cell&#039;);\n                        if (processorCell &amp;&amp; processorCell.textContent.trim() === &#039;\u5f90XX&#039;) {\n                            const nextStepCell = row.querySelector(&#039;.el-table_1_column_6 .cell&#039;);\n                            if (nextStepCell) {\n                                foundContent = nextStepCell.textContent.trim() || &#039;\u65e0\u540e\u7eed\u5904\u7406&#039;;\n                                break;\n                            }\n                        }\n                    }\n\n                    setTimeout(() =&gt; {\n                        closeProcessTraceDialog();\n                        createPageDisplayArea(foundContent);\n                        cleanup();\n                    }, 50);\n\n                    return true;\n                }\n                return false;\n            } catch (e) {\n                console.error(&#039;[\u5f90XX\u811a\u672c] \u68c0\u67e5\u6570\u636e\u52a0\u8f7d\u9519\u8bef:&#039;, e);\n                return false;\n            }\n        };\n\n        if (checkDataLoaded()) {\n            return;\n        }\n\n        dataCheckInterval = setInterval(() =&gt; {\n            if (checkDataLoaded()) {\n                \/\/ \u6570\u636e\u52a0\u8f7d\u5b8c\u6210\n            }\n        }, 100); \/\/ \u964d\u4f4e\u68c0\u67e5\u9891\u7387\u5230100ms\uff0c\u51cf\u5c11\u6027\u80fd\u5f00\u9500\n\n        setTimeout(() =&gt; {\n            if (dataCheckInterval) {\n                clearInterval(dataCheckInterval);\n                dataCheckInterval = null;\n                closeProcessTraceDialog();\n                createPageDisplayArea(&#039;\u6570\u636e\u52a0\u8f7d\u8d85\u65f6&#039;);\n                cleanup();\n            }\n        }, 6000); \/\/ \u7f29\u77ed\u8d85\u65f6\u65f6\u95f4\u52306\u79d2\n    }\n\n    \/\/ \u5b8c\u5168\u65e0\u611f\u83b7\u53d6\u5f90XX\u4fe1\u606f\n    function getXuXXInfoInvisible() {\n        if (isProcessing) return;\n\n        isProcessing = true;\n        createPageDisplayArea(&#039;\u6b63\u5728\u83b7\u53d6\u4fe1\u606f...&#039;);\n\n        try {\n            const traceButton = document.querySelector(&#039;button[label=&quot;\u6d41\u7a0b\u8ddf\u8e2a&quot;][event=&quot;trace&quot;]&#039;);\n            if (!traceButton) {\n                createPageDisplayArea(&#039;\u672a\u627e\u5230\u6d41\u7a0b\u8ddf\u8e2a\u6309\u94ae&#039;);\n                cleanup();\n                return;\n            }\n\n            \/\/ \u63d0\u524d\u6ce8\u5165\u9690\u85cf\u903b\u8f91\n            hideDialogCompletely();\n\n            observer = new MutationObserver((mutations, obs) =&gt; {\n                for (const mutation of mutations) {\n                    if (mutation.type === &#039;childList&#039;) {\n                        for (const node of mutation.addedNodes) {\n                            if (node.nodeType === 1) {\n                                let processFlow = null;\n                                if (node.classList?.contains(&#039;jdf-process-flow&#039;)) {\n                                    processFlow = node;\n                                } else if (node.querySelector) {\n                                    processFlow = node.querySelector(&#039;.jdf-process-flow&#039;);\n                                }\n\n                                if (processFlow) {\n                                    console.log(&#039;[\u5f90XX\u811a\u672c] \u68c0\u6d4b\u5230\u6d41\u7a0b\u8ddf\u8e2a\u5bf9\u8bdd\u6846&#039;);\n                                    extractXuXXInfo(processFlow);\n                                    return; \/\/ \u7acb\u5373\u5904\u7406\uff0c\u51cf\u5c11\u4e0d\u5fc5\u8981\u5faa\u73af\n                                }\n                            }\n                        }\n                    }\n                }\n            });\n\n            observer.observe(document.body, {\n                childList: true,\n                subtree: true\n            });\n\n            \/\/ \u5ef6\u8fdf\u70b9\u51fb\uff0c\u786e\u4fdd\u9690\u85cf\u903b\u8f91\u751f\u6548\n            setTimeout(() =&gt; {\n                console.log(&#039;[\u5f90XX\u811a\u672c] \u70b9\u51fb\u6d41\u7a0b\u8ddf\u8e2a\u6309\u94ae&#039;);\n                traceButton.click();\n            }, 100);\n\n            setTimeout(() =&gt; {\n                if (isProcessing) {\n                    console.log(&#039;[\u5f90XX\u811a\u672c] \u6574\u4f53\u8d85\u65f6&#039;);\n                    closeProcessTraceDialog();\n                    createPageDisplayArea(&#039;\u64cd\u4f5c\u8d85\u65f6&#039;);\n                    cleanup();\n                }\n            }, 10000); \/\/ \u7f29\u77ed\u6574\u4f53\u8d85\u65f6\u523010\u79d2\n\n        } catch (error) {\n            console.error(&#039;[\u5f90XX\u811a\u672c] \u9519\u8bef:&#039;, error);\n            closeProcessTraceDialog();\n            createPageDisplayArea(&#039;\u83b7\u53d6\u5931\u8d25&#039;);\n            cleanup();\n        }\n    }\n\n    \/\/ \u521d\u59cb\u5316\n    function init() {\n        console.log(&#039;[\u5f90XX\u811a\u672c] \u5b8c\u5168\u65e0\u611f\u6a21\u5f0f\u542f\u52a8&#039;);\n        setTimeout(() =&gt; {\n            getXuXXInfoInvisible();\n        }, 2000); \/\/ \u7f29\u77ed\u521d\u59cb\u5316\u5ef6\u8fdf\u52302\u79d2\n    }\n\n    if (document.readyState === &#039;loading&#039;) {\n        document.addEventListener(&#039;DOMContentLoaded&#039;, () =&gt; {\n            setTimeout(init, 1500);\n        });\n    } else {\n        setTimeout(init, 2000);\n    }\n})();<\/code><\/pre>","protected":false},"excerpt":{"rendered":"<p>\u6cb9\u7334\u811a\u672c\uff0c\u5904\u7406\u96c6\u56e2OA\u6587\u4ef6\uff0c\u83b7\u53d6\u4e3b\u8981\u9886\u5bfc\u6587\u4ef6\u4e0b\u4e00\u6b65\u5206\u53d1\u52a8\u4f5c\uff0c\u9632\u6b62\u91cd\u590d\u63d0\u4ea4\u3002 \u9690\u85cf\u90e8\u5206\u5173\u952e\u4fe1\u606f \/\/ ==Use [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[32],"class_list":["post-602","post","type-post","status-publish","format-standard","hentry","category-it","tag-32"],"_links":{"self":[{"href":"https:\/\/subk.me\/index.php?rest_route=\/wp\/v2\/posts\/602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/subk.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/subk.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/subk.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/subk.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=602"}],"version-history":[{"count":1,"href":"https:\/\/subk.me\/index.php?rest_route=\/wp\/v2\/posts\/602\/revisions"}],"predecessor-version":[{"id":603,"href":"https:\/\/subk.me\/index.php?rest_route=\/wp\/v2\/posts\/602\/revisions\/603"}],"wp:attachment":[{"href":"https:\/\/subk.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/subk.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/subk.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}