Commit 9beeda4e4b39e1aff04b4ddad1d5d3a76ebff56c
0 parents
初始化代码;
Showing
18 changed files
with
3697 additions
and
0 deletions
.gitignore
0 → 100644
.npmrc
0 → 100644
.prettierrc
0 → 100644
| 1 | +++ a/.prettierrc | ||
| 1 | +{ | ||
| 2 | + "printWidth": 100, | ||
| 3 | + "eslintIntegration": true, | ||
| 4 | + "stylelintIntegration": true, | ||
| 5 | + "tabWidth": 2, | ||
| 6 | + "semi": true, | ||
| 7 | + "singleQuote": false, | ||
| 8 | + "quoteProps": "as-needed", | ||
| 9 | + "jsxSingleQuote": false, | ||
| 10 | + "bracketSpacing": true, | ||
| 11 | + "arrowParens": "avoid", | ||
| 12 | + "htmlWhitespaceSensitivity": "css", | ||
| 13 | + "javascript.format.insertSpaceBeforeFunctionParenthesis": true, | ||
| 14 | + "files.insertFinalNewline": true, | ||
| 15 | + "useTabs": false, | ||
| 16 | + "endOfLine": "lf", | ||
| 17 | + "ignorePath": ".gnore", | ||
| 18 | + "trailingComma": "es5", | ||
| 19 | + "jsxBracketSameLine": false, | ||
| 20 | + "bracketSameLine": false | ||
| 21 | +} | ||
| 0 | \ No newline at end of file | 22 | \ No newline at end of file |
.umirc.ts
0 → 100644
| 1 | +++ a/.umirc.ts | ||
| 1 | +import { defineConfig } from "umi"; | ||
| 2 | + | ||
| 3 | +export default defineConfig({ | ||
| 4 | + routes: [ | ||
| 5 | + { path: "/", redirect: "/index" }, | ||
| 6 | + { path: "/index", component: "index" }, | ||
| 7 | + ], | ||
| 8 | + npmClient: 'pnpm', | ||
| 9 | + publicPath: '/InsSet/', | ||
| 10 | + history: { type: 'hash' }, | ||
| 11 | + hash: true, | ||
| 12 | +}); |
package.json
0 → 100644
| 1 | +++ a/package.json | ||
| 1 | +{ | ||
| 2 | + "private": true, | ||
| 3 | + "author": "zhangzhen <525765282@qq.com>", | ||
| 4 | + "scripts": { | ||
| 5 | + "dev": "cross-env PORT=9099 umi dev", | ||
| 6 | + "build": "umi build", | ||
| 7 | + "postinstall": "umi setup", | ||
| 8 | + "setup": "umi setup", | ||
| 9 | + "start": "npm run dev" | ||
| 10 | + }, | ||
| 11 | + "dependencies": { | ||
| 12 | + "@ant-design/icons": "^6.0.0", | ||
| 13 | + "antd": "^5.26.4", | ||
| 14 | + "cross-env": "^7.0.3", | ||
| 15 | + "dt-react-component": "5.2.0-beta.0", | ||
| 16 | + "lodash": "^4.17.21", | ||
| 17 | + "sortablejs": "^1.15.6", | ||
| 18 | + "umi": "^4.4.11" | ||
| 19 | + }, | ||
| 20 | + "devDependencies": { | ||
| 21 | + "@types/lodash": "^4.17.20", | ||
| 22 | + "@types/react": "^18.0.33", | ||
| 23 | + "@types/react-dom": "^18.0.11", | ||
| 24 | + "@types/sortablejs": "^1.15.8", | ||
| 25 | + "@umijs/plugins": "^4.4.11", | ||
| 26 | + "typescript": "^5.0.3" | ||
| 27 | + } | ||
| 28 | +} | ||
| 0 | \ No newline at end of file | 29 | \ No newline at end of file |
src/assets/yay.jpg
0 → 100644
177 KB
src/assets/指令集说明文档.html
0 → 100644
| 1 | +++ a/src/assets/指令集说明文档.html | ||
| 1 | +<!doctype html> | ||
| 2 | +<html> | ||
| 3 | +<head> | ||
| 4 | +<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'> | ||
| 5 | + | ||
| 6 | +<link href='https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext' rel='stylesheet' type='text/css' /><style type='text/css'>html {overflow-x: initial !important;}:root { --bg-color: #ffffff; --text-color: #333333; --select-text-bg-color: #B5D6FC; --select-text-font-color: auto; --monospace: "Lucida Console",Consolas,"Courier",monospace; --title-bar-height: 20px; } | ||
| 7 | +.mac-os-11 { --title-bar-height: 28px; } | ||
| 8 | +html { font-size: 14px; background-color: var(--bg-color); color: var(--text-color); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; } | ||
| 9 | +h1, h2, h3, h4, h5 { white-space: pre-wrap; } | ||
| 10 | +body { margin: 0px; padding: 0px; height: auto; inset: 0px; font-size: 1rem; line-height: 1.428571; overflow-x: hidden; background: inherit; tab-size: 4; } | ||
| 11 | +iframe { margin: auto; } | ||
| 12 | +a.url { word-break: break-all; } | ||
| 13 | +a:active, a:hover { outline: 0px; } | ||
| 14 | +.in-text-selection, ::selection { text-shadow: none; background: var(--select-text-bg-color); color: var(--select-text-font-color); } | ||
| 15 | +#write { margin: 0px auto; height: auto; width: inherit; word-break: normal; overflow-wrap: break-word; position: relative; white-space: normal; overflow-x: visible; padding-top: 36px; } | ||
| 16 | +#write.first-line-indent p { text-indent: 2em; } | ||
| 17 | +#write.first-line-indent li p, #write.first-line-indent p * { text-indent: 0px; } | ||
| 18 | +#write.first-line-indent li { margin-left: 2em; } | ||
| 19 | +.for-image #write { padding-left: 8px; padding-right: 8px; } | ||
| 20 | +body.typora-export { padding-left: 30px; padding-right: 30px; } | ||
| 21 | +.typora-export .footnote-line, .typora-export li, .typora-export p { white-space: pre-wrap; } | ||
| 22 | +.typora-export .task-list-item input { pointer-events: none; } | ||
| 23 | +@media screen and (max-width: 500px) { | ||
| 24 | + body.typora-export { padding-left: 0px; padding-right: 0px; } | ||
| 25 | + #write { padding-left: 20px; padding-right: 20px; } | ||
| 26 | +} | ||
| 27 | +#write li > figure:last-child { margin-bottom: 0.5rem; } | ||
| 28 | +#write ol, #write ul { position: relative; } | ||
| 29 | +img { max-width: 100%; vertical-align: middle; image-orientation: from-image; } | ||
| 30 | +button, input, select, textarea { color: inherit; font-style: inherit; font-variant-caps: inherit; font-weight: inherit; font-stretch: inherit; font-size: inherit; line-height: inherit; font-family: inherit; font-size-adjust: inherit; font-kerning: inherit; font-variant-alternates: inherit; font-variant-ligatures: inherit; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-variant-position: inherit; font-variant-emoji: inherit; font-feature-settings: inherit; font-optical-sizing: inherit; font-variation-settings: inherit; } | ||
| 31 | +input[type="checkbox"], input[type="radio"] { line-height: normal; padding: 0px; } | ||
| 32 | +*, ::after, ::before { box-sizing: border-box; } | ||
| 33 | +#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p, #write pre { width: inherit; } | ||
| 34 | +#write h1, #write h2, #write h3, #write h4, #write h5, #write h6, #write p { position: relative; } | ||
| 35 | +p { line-height: inherit; } | ||
| 36 | +h1, h2, h3, h4, h5, h6 { break-after: avoid-page; break-inside: avoid; orphans: 4; } | ||
| 37 | +p { orphans: 4; } | ||
| 38 | +h1 { font-size: 2rem; } | ||
| 39 | +h2 { font-size: 1.8rem; } | ||
| 40 | +h3 { font-size: 1.6rem; } | ||
| 41 | +h4 { font-size: 1.4rem; } | ||
| 42 | +h5 { font-size: 1.2rem; } | ||
| 43 | +h6 { font-size: 1rem; } | ||
| 44 | +.md-math-block, .md-rawblock, h1, h2, h3, h4, h5, h6, p { margin-top: 1rem; margin-bottom: 1rem; } | ||
| 45 | +.hidden { display: none; } | ||
| 46 | +.md-blockmeta { color: rgb(204, 204, 204); font-weight: 700; font-style: italic; } | ||
| 47 | +a { cursor: pointer; } | ||
| 48 | +sup.md-footnote { padding: 2px 4px; background-color: rgba(238, 238, 238, 0.7); color: rgb(85, 85, 85); border-radius: 4px; cursor: pointer; } | ||
| 49 | +sup.md-footnote a, sup.md-footnote a:hover { color: inherit; text-transform: inherit; text-decoration: inherit; } | ||
| 50 | +#write input[type="checkbox"] { cursor: pointer; width: inherit; height: inherit; } | ||
| 51 | +figure { overflow-x: auto; margin: 1.2em 0px; max-width: calc(100% + 16px); padding: 0px; } | ||
| 52 | +figure > table { margin: 0px; } | ||
| 53 | +thead, tr { break-inside: avoid; break-after: auto; } | ||
| 54 | +thead { display: table-header-group; } | ||
| 55 | +table { border-collapse: collapse; border-spacing: 0px; width: 100%; overflow: auto; break-inside: auto; text-align: left; } | ||
| 56 | +table.md-table td { min-width: 32px; } | ||
| 57 | +.CodeMirror-gutters { border-right-width: 0px; border-right-style: none; border-right-color: currentcolor; background-color: inherit; } | ||
| 58 | +.CodeMirror-linenumber { -webkit-user-select: none; } | ||
| 59 | +.CodeMirror { text-align: left; } | ||
| 60 | +.CodeMirror-placeholder { opacity: 0.3; } | ||
| 61 | +.CodeMirror pre { padding: 0px 4px; } | ||
| 62 | +.CodeMirror-lines { padding: 0px; } | ||
| 63 | +div.hr:focus { cursor: none; } | ||
| 64 | +#write pre { white-space: pre-wrap; } | ||
| 65 | +#write.fences-no-line-wrapping pre { white-space: pre; } | ||
| 66 | +#write pre.ty-contain-cm { white-space: normal; } | ||
| 67 | +.CodeMirror-gutters { margin-right: 4px; } | ||
| 68 | +.md-fences { font-size: 0.9rem; display: block; break-inside: avoid; text-align: left; overflow: visible; white-space: pre; background: inherit; position: relative !important; } | ||
| 69 | +.md-fences-adv-panel { width: 100%; margin-top: 10px; text-align: center; padding-top: 0px; padding-bottom: 8px; overflow-x: auto; } | ||
| 70 | +#write .md-fences.mock-cm { white-space: pre-wrap; } | ||
| 71 | +.md-fences.md-fences-with-lineno { padding-left: 0px; } | ||
| 72 | +#write.fences-no-line-wrapping .md-fences.mock-cm { white-space: pre; overflow-x: auto; } | ||
| 73 | +.md-fences.mock-cm.md-fences-with-lineno { padding-left: 8px; } | ||
| 74 | +.CodeMirror-line, twitterwidget { break-inside: avoid; } | ||
| 75 | +svg { break-inside: avoid; } | ||
| 76 | +.footnotes { opacity: 0.8; font-size: 0.9rem; margin-top: 1em; margin-bottom: 1em; } | ||
| 77 | +.footnotes + .footnotes { margin-top: 0px; } | ||
| 78 | +.md-reset { margin: 0px; padding: 0px; border: 0px; outline: 0px; vertical-align: top; background: 0px 0px; text-decoration: none; text-shadow: none; float: none; position: static; width: auto; height: auto; white-space: nowrap; cursor: inherit; line-height: normal; font-weight: 400; text-align: left; box-sizing: content-box; direction: ltr; } | ||
| 79 | +li div { padding-top: 0px; } | ||
| 80 | +blockquote { margin: 1rem 0px; } | ||
| 81 | +li .mathjax-block, li p { margin: 0.5rem 0px; } | ||
| 82 | +li blockquote { margin: 1rem 0px; } | ||
| 83 | +li { margin: 0px; position: relative; } | ||
| 84 | +blockquote > :last-child { margin-bottom: 0px; } | ||
| 85 | +blockquote > :first-child, li > :first-child { margin-top: 0px; } | ||
| 86 | +.footnotes-area { color: rgb(136, 136, 136); margin-top: 0.714rem; padding-bottom: 0.143rem; white-space: normal; } | ||
| 87 | +#write .footnote-line { white-space: pre-wrap; } | ||
| 88 | +@media print { | ||
| 89 | + body, html { border: 1px solid transparent; height: 99%; break-after: avoid; break-before: avoid; font-variant-ligatures: no-common-ligatures; } | ||
| 90 | + #write { margin-top: 0px; border-color: transparent !important; padding-top: 0px !important; padding-bottom: 0px !important; } | ||
| 91 | + .typora-export * { print-color-adjust: exact; } | ||
| 92 | + .typora-export #write { break-after: avoid; } | ||
| 93 | + .typora-export #write::after { height: 0px; } | ||
| 94 | + .is-mac table { break-inside: avoid; } | ||
| 95 | + #write > p:nth-child(1) { margin-top: 0px; } | ||
| 96 | + .typora-export-show-outline .typora-export-sidebar { display: none; } | ||
| 97 | + figure { overflow-x: visible; } | ||
| 98 | +} | ||
| 99 | +.footnote-line { margin-top: 0.714em; font-size: 0.7em; } | ||
| 100 | +a img, img a { cursor: pointer; } | ||
| 101 | +pre.md-meta-block { font-size: 0.8rem; min-height: 0.8rem; white-space: pre-wrap; background: rgb(204, 204, 204); display: block; overflow-x: hidden; } | ||
| 102 | +p > .md-image:only-child:not(.md-img-error) img, p > img:only-child { display: block; margin: auto; } | ||
| 103 | +#write.first-line-indent p > .md-image:only-child:not(.md-img-error) img { left: -2em; position: relative; } | ||
| 104 | +p > .md-image:only-child { display: inline-block; width: 100%; } | ||
| 105 | +#write .MathJax_Display { margin: 0.8em 0px 0px; } | ||
| 106 | +.md-math-block { width: 100%; } | ||
| 107 | +.md-math-block:not(:empty)::after { display: none; } | ||
| 108 | +.MathJax_ref { fill: currentcolor; } | ||
| 109 | +[contenteditable="true"]:active, [contenteditable="true"]:focus, [contenteditable="false"]:active, [contenteditable="false"]:focus { outline: 0px; box-shadow: none; } | ||
| 110 | +.md-task-list-item { position: relative; list-style-type: none; } | ||
| 111 | +.task-list-item.md-task-list-item { padding-left: 0px; } | ||
| 112 | +.md-task-list-item > input { position: absolute; top: 0px; left: 0px; margin-left: -1.2em; margin-top: calc(1em - 10px); border: medium; } | ||
| 113 | +.math { font-size: 1rem; } | ||
| 114 | +.md-toc { min-height: 3.58rem; position: relative; font-size: 0.9rem; border-radius: 10px; } | ||
| 115 | +.md-toc-content { position: relative; margin-left: 0px; } | ||
| 116 | +.md-toc-content::after, .md-toc::after { display: none; } | ||
| 117 | +.md-toc-item { display: block; color: rgb(65, 131, 196); } | ||
| 118 | +.md-toc-item a { text-decoration: none; } | ||
| 119 | +.md-toc-inner:hover { text-decoration: underline; } | ||
| 120 | +.md-toc-inner { display: inline-block; cursor: pointer; } | ||
| 121 | +.md-toc-h1 .md-toc-inner { margin-left: 0px; font-weight: 700; } | ||
| 122 | +.md-toc-h2 .md-toc-inner { margin-left: 2em; } | ||
| 123 | +.md-toc-h3 .md-toc-inner { margin-left: 4em; } | ||
| 124 | +.md-toc-h4 .md-toc-inner { margin-left: 6em; } | ||
| 125 | +.md-toc-h5 .md-toc-inner { margin-left: 8em; } | ||
| 126 | +.md-toc-h6 .md-toc-inner { margin-left: 10em; } | ||
| 127 | +@media screen and (max-width: 48em) { | ||
| 128 | + .md-toc-h3 .md-toc-inner { margin-left: 3.5em; } | ||
| 129 | + .md-toc-h4 .md-toc-inner { margin-left: 5em; } | ||
| 130 | + .md-toc-h5 .md-toc-inner { margin-left: 6.5em; } | ||
| 131 | + .md-toc-h6 .md-toc-inner { margin-left: 8em; } | ||
| 132 | +} | ||
| 133 | +a.md-toc-inner { font-size: inherit; font-style: inherit; font-weight: inherit; line-height: inherit; } | ||
| 134 | +.footnote-line a:not(.reversefootnote) { color: inherit; } | ||
| 135 | +.reversefootnote { font-family: ui-monospace, sans-serif; } | ||
| 136 | +.md-attr { display: none; } | ||
| 137 | +.md-fn-count::after { content: "."; } | ||
| 138 | +code, pre, samp, tt { font-family: var(--monospace); } | ||
| 139 | +kbd { margin: 0px 0.1em; padding: 0.1em 0.6em; font-size: 0.8em; color: rgb(36, 39, 41); background: rgb(255, 255, 255); border: 1px solid rgb(173, 179, 185); border-radius: 3px; box-shadow: rgba(12, 13, 14, 0.2) 0px 1px 0px, rgb(255, 255, 255) 0px 0px 0px 2px inset; white-space: nowrap; vertical-align: middle; } | ||
| 140 | +.md-comment { color: rgb(162, 127, 3); opacity: 0.6; font-family: var(--monospace); } | ||
| 141 | +code { text-align: left; vertical-align: initial; } | ||
| 142 | +a.md-print-anchor { white-space: pre !important; border-width: medium !important; border-style: none !important; border-color: currentcolor !important; display: inline-block !important; position: absolute !important; width: 1px !important; right: 0px !important; outline: 0px !important; background: 0px 0px !important; text-decoration: initial !important; text-shadow: initial !important; } | ||
| 143 | +.os-windows.monocolor-emoji .md-emoji { font-family: "Segoe UI Symbol", sans-serif; } | ||
| 144 | +.md-diagram-panel > svg { max-width: 100%; } | ||
| 145 | +[lang="flow"] svg, [lang="mermaid"] svg { max-width: 100%; height: auto; } | ||
| 146 | +[lang="mermaid"] .node text { font-size: 1rem; } | ||
| 147 | +table tr th { border-bottom-width: 0px; border-bottom-style: none; border-bottom-color: currentcolor; } | ||
| 148 | +video { max-width: 100%; display: block; margin: 0px auto; } | ||
| 149 | +iframe { max-width: 100%; width: 100%; border: medium; } | ||
| 150 | +.highlight td, .highlight tr { border: 0px; } | ||
| 151 | +mark { background: rgb(255, 255, 0); color: rgb(0, 0, 0); } | ||
| 152 | +.md-html-inline .md-plain, .md-html-inline strong, mark .md-inline-math, mark strong { color: inherit; } | ||
| 153 | +.md-expand mark .md-meta { opacity: 0.3 !important; } | ||
| 154 | +mark .md-meta { color: rgb(0, 0, 0); } | ||
| 155 | +@media print { | ||
| 156 | + .typora-export h1, .typora-export h2, .typora-export h3, .typora-export h4, .typora-export h5, .typora-export h6 { break-inside: avoid; } | ||
| 157 | +} | ||
| 158 | +.md-diagram-panel .messageText { stroke: none !important; } | ||
| 159 | +.md-diagram-panel .start-state { fill: var(--node-fill); } | ||
| 160 | +.md-diagram-panel .edgeLabel rect { opacity: 1 !important; } | ||
| 161 | +.md-fences.md-fences-math { font-size: 1em; } | ||
| 162 | +.md-fences-advanced:not(.md-focus) { padding: 0px; white-space: nowrap; border: 0px; } | ||
| 163 | +.md-fences-advanced:not(.md-focus) { background: inherit; } | ||
| 164 | +.typora-export-show-outline .typora-export-content { max-width: 1440px; margin: auto; display: flex; flex-direction: row; } | ||
| 165 | +.typora-export-sidebar { width: 300px; font-size: 0.8rem; margin-top: 80px; margin-right: 18px; } | ||
| 166 | +.typora-export-show-outline #write { --webkit-flex: 2; flex: 2 1 0%; } | ||
| 167 | +.typora-export-sidebar .outline-content { position: fixed; top: 0px; max-height: 100%; overflow: hidden auto; padding-bottom: 30px; padding-top: 60px; width: 300px; } | ||
| 168 | +@media screen and (max-width: 1024px) { | ||
| 169 | + .typora-export-sidebar, .typora-export-sidebar .outline-content { width: 240px; } | ||
| 170 | +} | ||
| 171 | +@media screen and (max-width: 800px) { | ||
| 172 | + .typora-export-sidebar { display: none; } | ||
| 173 | +} | ||
| 174 | +.outline-content li, .outline-content ul { margin-left: 0px; margin-right: 0px; padding-left: 0px; padding-right: 0px; list-style: none; overflow-wrap: anywhere; } | ||
| 175 | +.outline-content ul { margin-top: 0px; margin-bottom: 0px; } | ||
| 176 | +.outline-content strong { font-weight: 400; } | ||
| 177 | +.outline-expander { width: 1rem; height: 1.428571rem; position: relative; display: table-cell; vertical-align: middle; cursor: pointer; padding-left: 4px; } | ||
| 178 | +.outline-expander::before { content: ""; position: relative; font-family: Ionicons; display: inline-block; font-size: 8px; vertical-align: middle; } | ||
| 179 | +.outline-item { padding-top: 3px; padding-bottom: 3px; cursor: pointer; } | ||
| 180 | +.outline-expander:hover::before { content: ""; } | ||
| 181 | +.outline-h1 > .outline-item { padding-left: 0px; } | ||
| 182 | +.outline-h2 > .outline-item { padding-left: 1em; } | ||
| 183 | +.outline-h3 > .outline-item { padding-left: 2em; } | ||
| 184 | +.outline-h4 > .outline-item { padding-left: 3em; } | ||
| 185 | +.outline-h5 > .outline-item { padding-left: 4em; } | ||
| 186 | +.outline-h6 > .outline-item { padding-left: 5em; } | ||
| 187 | +.outline-label { cursor: pointer; display: table-cell; vertical-align: middle; text-decoration: none; color: inherit; } | ||
| 188 | +.outline-label:hover { text-decoration: underline; } | ||
| 189 | +.outline-item:hover { border-color: rgb(245, 245, 245); background-color: var(--item-hover-bg-color); } | ||
| 190 | +.outline-item:hover { margin-left: -28px; margin-right: -28px; border-left-width: 28px; border-left-style: solid; border-left-color: transparent; border-right-width: 28px; border-right-style: solid; border-right-color: transparent; } | ||
| 191 | +.outline-item-single .outline-expander::before, .outline-item-single .outline-expander:hover::before { display: none; } | ||
| 192 | +.outline-item-open > .outline-item > .outline-expander::before { content: ""; } | ||
| 193 | +.outline-children { display: none; } | ||
| 194 | +.info-panel-tab-wrapper { display: none; } | ||
| 195 | +.outline-item-open > .outline-children { display: block; } | ||
| 196 | +.typora-export .outline-item { padding-top: 1px; padding-bottom: 1px; } | ||
| 197 | +.typora-export .outline-item:hover { margin-right: -8px; border-right-width: 8px; border-right-style: solid; border-right-color: transparent; } | ||
| 198 | +.typora-export .outline-expander::before { content: "+"; font-family: inherit; top: -1px; } | ||
| 199 | +.typora-export .outline-expander:hover::before, .typora-export .outline-item-open > .outline-item > .outline-expander::before { content: "−"; } | ||
| 200 | +.typora-export-collapse-outline .outline-children { display: none; } | ||
| 201 | +.typora-export-collapse-outline .outline-item-open > .outline-children, .typora-export-no-collapse-outline .outline-children { display: block; } | ||
| 202 | +.typora-export-no-collapse-outline .outline-expander::before { content: "" !important; } | ||
| 203 | +.typora-export-show-outline .outline-item-active > .outline-item .outline-label { font-weight: 700; } | ||
| 204 | +.md-inline-math-container mjx-container { zoom: 0.95; } | ||
| 205 | +mjx-container { break-inside: avoid; } | ||
| 206 | + | ||
| 207 | + | ||
| 208 | +.CodeMirror { height: auto; } | ||
| 209 | +.CodeMirror.cm-s-inner { background: inherit; } | ||
| 210 | +.CodeMirror-scroll { overflow: auto hidden; z-index: 3; } | ||
| 211 | +.CodeMirror-gutter-filler, .CodeMirror-scrollbar-filler { background-color: rgb(255, 255, 255); } | ||
| 212 | +.CodeMirror-gutters { border-right-width: 1px; border-right-style: solid; border-right-color: rgb(221, 221, 221); background: inherit; white-space: nowrap; } | ||
| 213 | +.CodeMirror-linenumber { padding: 0px 3px 0px 5px; text-align: right; color: rgb(153, 153, 153); } | ||
| 214 | +.cm-s-inner .cm-keyword { color: rgb(119, 0, 136); } | ||
| 215 | +.cm-s-inner .cm-atom, .cm-s-inner.cm-atom { color: rgb(34, 17, 153); } | ||
| 216 | +.cm-s-inner .cm-number { color: rgb(17, 102, 68); } | ||
| 217 | +.cm-s-inner .cm-def { color: rgb(0, 0, 255); } | ||
| 218 | +.cm-s-inner .cm-variable { color: rgb(0, 0, 0); } | ||
| 219 | +.cm-s-inner .cm-variable-2 { color: rgb(0, 85, 170); } | ||
| 220 | +.cm-s-inner .cm-variable-3 { color: rgb(0, 136, 85); } | ||
| 221 | +.cm-s-inner .cm-string { color: rgb(170, 17, 17); } | ||
| 222 | +.cm-s-inner .cm-property { color: rgb(0, 0, 0); } | ||
| 223 | +.cm-s-inner .cm-operator { color: rgb(152, 26, 26); } | ||
| 224 | +.cm-s-inner .cm-comment, .cm-s-inner.cm-comment { color: rgb(170, 85, 0); } | ||
| 225 | +.cm-s-inner .cm-string-2 { color: rgb(255, 85, 0); } | ||
| 226 | +.cm-s-inner .cm-meta { color: rgb(85, 85, 85); } | ||
| 227 | +.cm-s-inner .cm-qualifier { color: rgb(85, 85, 85); } | ||
| 228 | +.cm-s-inner .cm-builtin { color: rgb(51, 0, 170); } | ||
| 229 | +.cm-s-inner .cm-bracket { color: rgb(153, 153, 119); } | ||
| 230 | +.cm-s-inner .cm-tag { color: rgb(17, 119, 0); } | ||
| 231 | +.cm-s-inner .cm-attribute { color: rgb(0, 0, 204); } | ||
| 232 | +.cm-s-inner .cm-header, .cm-s-inner.cm-header { color: rgb(0, 0, 255); } | ||
| 233 | +.cm-s-inner .cm-quote, .cm-s-inner.cm-quote { color: rgb(0, 153, 0); } | ||
| 234 | +.cm-s-inner .cm-hr, .cm-s-inner.cm-hr { color: rgb(153, 153, 153); } | ||
| 235 | +.cm-s-inner .cm-link, .cm-s-inner.cm-link { color: rgb(0, 0, 204); } | ||
| 236 | +.cm-negative { color: rgb(221, 68, 68); } | ||
| 237 | +.cm-positive { color: rgb(34, 153, 34); } | ||
| 238 | +.cm-header, .cm-strong { font-weight: 700; } | ||
| 239 | +.cm-del { text-decoration: line-through; } | ||
| 240 | +.cm-em { font-style: italic; } | ||
| 241 | +.cm-link { text-decoration: underline; } | ||
| 242 | +.cm-error { color: red; } | ||
| 243 | +.cm-invalidchar { color: red; } | ||
| 244 | +.cm-constant { color: rgb(38, 139, 210); } | ||
| 245 | +.cm-defined { color: rgb(181, 137, 0); } | ||
| 246 | +div.CodeMirror span.CodeMirror-matchingbracket { color: rgb(0, 255, 0); } | ||
| 247 | +div.CodeMirror span.CodeMirror-nonmatchingbracket { color: rgb(255, 34, 34); } | ||
| 248 | +.cm-s-inner .CodeMirror-activeline-background { background: inherit; } | ||
| 249 | +.CodeMirror { position: relative; overflow: hidden; } | ||
| 250 | +.CodeMirror-scroll { height: 100%; outline: 0px; position: relative; box-sizing: content-box; background: inherit; } | ||
| 251 | +.CodeMirror-sizer { position: relative; } | ||
| 252 | +.CodeMirror-gutter-filler, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-vscrollbar { position: absolute; z-index: 6; display: none; outline: 0px; } | ||
| 253 | +.CodeMirror-vscrollbar { right: 0px; top: 0px; overflow: hidden; } | ||
| 254 | +.CodeMirror-hscrollbar { bottom: 0px; left: 0px; overflow: auto hidden; } | ||
| 255 | +.CodeMirror-scrollbar-filler { right: 0px; bottom: 0px; } | ||
| 256 | +.CodeMirror-gutter-filler { left: 0px; bottom: 0px; } | ||
| 257 | +.CodeMirror-gutters { position: absolute; left: 0px; top: 0px; padding-bottom: 10px; z-index: 3; overflow-y: hidden; } | ||
| 258 | +.CodeMirror-gutter { white-space: normal; height: 100%; box-sizing: content-box; padding-bottom: 30px; margin-bottom: -32px; display: inline-block; } | ||
| 259 | +.CodeMirror-gutter-wrapper { position: absolute; z-index: 4; background: 0px 0px !important; border: medium !important; } | ||
| 260 | +.CodeMirror-gutter-background { position: absolute; top: 0px; bottom: 0px; z-index: 4; } | ||
| 261 | +.CodeMirror-gutter-elt { position: absolute; cursor: default; z-index: 4; } | ||
| 262 | +.CodeMirror-lines { cursor: text; } | ||
| 263 | +.CodeMirror pre { border-radius: 0px; border-width: 0px; background: 0px 0px; font-family: inherit; font-size: inherit; margin: 0px; white-space: pre; overflow-wrap: normal; color: inherit; z-index: 2; position: relative; overflow: visible; } | ||
| 264 | +.CodeMirror-wrap pre { overflow-wrap: break-word; white-space: pre-wrap; word-break: normal; } | ||
| 265 | +.CodeMirror-code pre { border-right-width: 30px; border-right-style: solid; border-right-color: transparent; width: fit-content; } | ||
| 266 | +.CodeMirror-wrap .CodeMirror-code pre { border-right-width: medium; border-right-style: none; border-right-color: currentcolor; width: auto; } | ||
| 267 | +.CodeMirror-linebackground { position: absolute; inset: 0px; z-index: 0; } | ||
| 268 | +.CodeMirror-linewidget { position: relative; z-index: 2; overflow: auto; } | ||
| 269 | +.CodeMirror-wrap .CodeMirror-scroll { overflow-x: hidden; } | ||
| 270 | +.CodeMirror-measure { position: absolute; width: 100%; height: 0px; overflow: hidden; visibility: hidden; } | ||
| 271 | +.CodeMirror-measure pre { position: static; } | ||
| 272 | +.CodeMirror div.CodeMirror-cursor { position: absolute; visibility: hidden; border-right-width: medium; border-right-style: none; border-right-color: currentcolor; width: 0px; } | ||
| 273 | +.CodeMirror div.CodeMirror-cursor { visibility: hidden; } | ||
| 274 | +.CodeMirror-focused div.CodeMirror-cursor { visibility: inherit; } | ||
| 275 | +.cm-searching { background: rgba(255, 255, 0, 0.4); } | ||
| 276 | +span.cm-underlined { text-decoration: underline; } | ||
| 277 | +span.cm-strikethrough { text-decoration: line-through; } | ||
| 278 | +.cm-tw-syntaxerror { color: rgb(255, 255, 255); background-color: rgb(153, 0, 0); } | ||
| 279 | +.cm-tw-deleted { text-decoration: line-through; } | ||
| 280 | +.cm-tw-header5 { font-weight: 700; } | ||
| 281 | +.cm-tw-listitem:first-child { padding-left: 10px; } | ||
| 282 | +.cm-tw-box { border-style: solid; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-color: inherit; border-top-width: 0px !important; } | ||
| 283 | +.cm-tw-underline { text-decoration: underline; } | ||
| 284 | +@media print { | ||
| 285 | + .CodeMirror div.CodeMirror-cursor { visibility: hidden; } | ||
| 286 | +} | ||
| 287 | + | ||
| 288 | + | ||
| 289 | +:root { | ||
| 290 | + --side-bar-bg-color: #fafafa; | ||
| 291 | + --control-text-color: #777; | ||
| 292 | +} | ||
| 293 | + | ||
| 294 | +@include-when-export url(https://fonts.loli.net/css?family=Open+Sans:400italic,700italic,700,400&subset=latin,latin-ext); | ||
| 295 | + | ||
| 296 | +/* open-sans-regular - latin-ext_latin */ | ||
| 297 | + /* open-sans-italic - latin-ext_latin */ | ||
| 298 | + /* open-sans-700 - latin-ext_latin */ | ||
| 299 | + /* open-sans-700italic - latin-ext_latin */ | ||
| 300 | + html { | ||
| 301 | + font-size: 16px; | ||
| 302 | + -webkit-font-smoothing: antialiased; | ||
| 303 | +} | ||
| 304 | + | ||
| 305 | +body { | ||
| 306 | + font-family: "Open Sans","Clear Sans", "Helvetica Neue", Helvetica, Arial, 'Segoe UI Emoji', sans-serif; | ||
| 307 | + color: rgb(51, 51, 51); | ||
| 308 | + line-height: 1.6; | ||
| 309 | +} | ||
| 310 | + | ||
| 311 | +#write { | ||
| 312 | + max-width: 860px; | ||
| 313 | + margin: 0 auto; | ||
| 314 | + padding: 30px; | ||
| 315 | + padding-bottom: 100px; | ||
| 316 | +} | ||
| 317 | + | ||
| 318 | +@media only screen and (min-width: 1400px) { | ||
| 319 | + #write { | ||
| 320 | + max-width: 1024px; | ||
| 321 | + } | ||
| 322 | +} | ||
| 323 | + | ||
| 324 | +@media only screen and (min-width: 1800px) { | ||
| 325 | + #write { | ||
| 326 | + max-width: 1200px; | ||
| 327 | + } | ||
| 328 | +} | ||
| 329 | + | ||
| 330 | +#write > ul:first-child, | ||
| 331 | +#write > ol:first-child{ | ||
| 332 | + margin-top: 30px; | ||
| 333 | +} | ||
| 334 | + | ||
| 335 | +a { | ||
| 336 | + color: #4183C4; | ||
| 337 | +} | ||
| 338 | +h1, | ||
| 339 | +h2, | ||
| 340 | +h3, | ||
| 341 | +h4, | ||
| 342 | +h5, | ||
| 343 | +h6 { | ||
| 344 | + position: relative; | ||
| 345 | + margin-top: 1rem; | ||
| 346 | + margin-bottom: 1rem; | ||
| 347 | + font-weight: bold; | ||
| 348 | + line-height: 1.4; | ||
| 349 | + cursor: text; | ||
| 350 | +} | ||
| 351 | +h1:hover a.anchor, | ||
| 352 | +h2:hover a.anchor, | ||
| 353 | +h3:hover a.anchor, | ||
| 354 | +h4:hover a.anchor, | ||
| 355 | +h5:hover a.anchor, | ||
| 356 | +h6:hover a.anchor { | ||
| 357 | + text-decoration: none; | ||
| 358 | +} | ||
| 359 | +h1 tt, | ||
| 360 | +h1 code { | ||
| 361 | + font-size: inherit; | ||
| 362 | +} | ||
| 363 | +h2 tt, | ||
| 364 | +h2 code { | ||
| 365 | + font-size: inherit; | ||
| 366 | +} | ||
| 367 | +h3 tt, | ||
| 368 | +h3 code { | ||
| 369 | + font-size: inherit; | ||
| 370 | +} | ||
| 371 | +h4 tt, | ||
| 372 | +h4 code { | ||
| 373 | + font-size: inherit; | ||
| 374 | +} | ||
| 375 | +h5 tt, | ||
| 376 | +h5 code { | ||
| 377 | + font-size: inherit; | ||
| 378 | +} | ||
| 379 | +h6 tt, | ||
| 380 | +h6 code { | ||
| 381 | + font-size: inherit; | ||
| 382 | +} | ||
| 383 | +h1 { | ||
| 384 | + font-size: 2.25em; | ||
| 385 | + line-height: 1.2; | ||
| 386 | + border-bottom: 1px solid #eee; | ||
| 387 | +} | ||
| 388 | +h2 { | ||
| 389 | + font-size: 1.75em; | ||
| 390 | + line-height: 1.225; | ||
| 391 | + border-bottom: 1px solid #eee; | ||
| 392 | +} | ||
| 393 | + | ||
| 394 | +/*@media print { | ||
| 395 | + .typora-export h1, | ||
| 396 | + .typora-export h2 { | ||
| 397 | + border-bottom: none; | ||
| 398 | + padding-bottom: initial; | ||
| 399 | + } | ||
| 400 | + | ||
| 401 | + .typora-export h1::after, | ||
| 402 | + .typora-export h2::after { | ||
| 403 | + content: ""; | ||
| 404 | + display: block; | ||
| 405 | + height: 100px; | ||
| 406 | + margin-top: -96px; | ||
| 407 | + border-top: 1px solid #eee; | ||
| 408 | + } | ||
| 409 | +}*/ | ||
| 410 | + | ||
| 411 | +h3 { | ||
| 412 | + font-size: 1.5em; | ||
| 413 | + line-height: 1.43; | ||
| 414 | +} | ||
| 415 | +h4 { | ||
| 416 | + font-size: 1.25em; | ||
| 417 | +} | ||
| 418 | +h5 { | ||
| 419 | + font-size: 1em; | ||
| 420 | +} | ||
| 421 | +h6 { | ||
| 422 | + font-size: 1em; | ||
| 423 | + color: #777; | ||
| 424 | +} | ||
| 425 | +p, | ||
| 426 | +blockquote, | ||
| 427 | +ul, | ||
| 428 | +ol, | ||
| 429 | +dl, | ||
| 430 | +table{ | ||
| 431 | + margin: 0.8em 0; | ||
| 432 | +} | ||
| 433 | +li>ol, | ||
| 434 | +li>ul { | ||
| 435 | + margin: 0 0; | ||
| 436 | +} | ||
| 437 | +hr { | ||
| 438 | + height: 2px; | ||
| 439 | + padding: 0; | ||
| 440 | + margin: 16px 0; | ||
| 441 | + background-color: #e7e7e7; | ||
| 442 | + border: 0 none; | ||
| 443 | + overflow: hidden; | ||
| 444 | + box-sizing: content-box; | ||
| 445 | +} | ||
| 446 | + | ||
| 447 | +li p.first { | ||
| 448 | + display: inline-block; | ||
| 449 | +} | ||
| 450 | +ul, | ||
| 451 | +ol { | ||
| 452 | + padding-left: 30px; | ||
| 453 | +} | ||
| 454 | +ul:first-child, | ||
| 455 | +ol:first-child { | ||
| 456 | + margin-top: 0; | ||
| 457 | +} | ||
| 458 | +ul:last-child, | ||
| 459 | +ol:last-child { | ||
| 460 | + margin-bottom: 0; | ||
| 461 | +} | ||
| 462 | +blockquote { | ||
| 463 | + border-left: 4px solid #dfe2e5; | ||
| 464 | + padding: 0 15px; | ||
| 465 | + color: #777777; | ||
| 466 | +} | ||
| 467 | +blockquote blockquote { | ||
| 468 | + padding-right: 0; | ||
| 469 | +} | ||
| 470 | +table { | ||
| 471 | + padding: 0; | ||
| 472 | + word-break: initial; | ||
| 473 | +} | ||
| 474 | +table tr { | ||
| 475 | + border: 1px solid #dfe2e5; | ||
| 476 | + margin: 0; | ||
| 477 | + padding: 0; | ||
| 478 | +} | ||
| 479 | +table tr:nth-child(2n), | ||
| 480 | +thead { | ||
| 481 | + background-color: #f8f8f8; | ||
| 482 | +} | ||
| 483 | +table th { | ||
| 484 | + font-weight: bold; | ||
| 485 | + border: 1px solid #dfe2e5; | ||
| 486 | + border-bottom: 0; | ||
| 487 | + margin: 0; | ||
| 488 | + padding: 6px 13px; | ||
| 489 | +} | ||
| 490 | +table td { | ||
| 491 | + border: 1px solid #dfe2e5; | ||
| 492 | + margin: 0; | ||
| 493 | + padding: 6px 13px; | ||
| 494 | +} | ||
| 495 | +table th:first-child, | ||
| 496 | +table td:first-child { | ||
| 497 | + margin-top: 0; | ||
| 498 | +} | ||
| 499 | +table th:last-child, | ||
| 500 | +table td:last-child { | ||
| 501 | + margin-bottom: 0; | ||
| 502 | +} | ||
| 503 | + | ||
| 504 | +.CodeMirror-lines { | ||
| 505 | + padding-left: 4px; | ||
| 506 | +} | ||
| 507 | + | ||
| 508 | +.code-tooltip { | ||
| 509 | + box-shadow: 0 1px 1px 0 rgba(0,28,36,.3); | ||
| 510 | + border-top: 1px solid #eef2f2; | ||
| 511 | +} | ||
| 512 | + | ||
| 513 | +.md-fences, | ||
| 514 | +code, | ||
| 515 | +tt { | ||
| 516 | + border: 1px solid #e7eaed; | ||
| 517 | + background-color: #f8f8f8; | ||
| 518 | + border-radius: 3px; | ||
| 519 | + padding: 0; | ||
| 520 | + padding: 2px 4px 0px 4px; | ||
| 521 | + font-size: 0.9em; | ||
| 522 | +} | ||
| 523 | + | ||
| 524 | +code { | ||
| 525 | + background-color: #f3f4f4; | ||
| 526 | + padding: 0 2px 0 2px; | ||
| 527 | +} | ||
| 528 | + | ||
| 529 | +.md-fences { | ||
| 530 | + margin-bottom: 15px; | ||
| 531 | + margin-top: 15px; | ||
| 532 | + padding-top: 8px; | ||
| 533 | + padding-bottom: 6px; | ||
| 534 | +} | ||
| 535 | + | ||
| 536 | + | ||
| 537 | +.md-task-list-item > input { | ||
| 538 | + margin-left: -1.3em; | ||
| 539 | +} | ||
| 540 | + | ||
| 541 | +@media print { | ||
| 542 | + html { | ||
| 543 | + font-size: 13px; | ||
| 544 | + } | ||
| 545 | + pre { | ||
| 546 | + page-break-inside: avoid; | ||
| 547 | + word-wrap: break-word; | ||
| 548 | + } | ||
| 549 | +} | ||
| 550 | + | ||
| 551 | +.md-fences { | ||
| 552 | + background-color: #f8f8f8; | ||
| 553 | +} | ||
| 554 | +#write pre.md-meta-block { | ||
| 555 | + padding: 1rem; | ||
| 556 | + font-size: 85%; | ||
| 557 | + line-height: 1.45; | ||
| 558 | + background-color: #f7f7f7; | ||
| 559 | + border: 0; | ||
| 560 | + border-radius: 3px; | ||
| 561 | + color: #777777; | ||
| 562 | + margin-top: 0 !important; | ||
| 563 | +} | ||
| 564 | + | ||
| 565 | +.mathjax-block>.code-tooltip { | ||
| 566 | + bottom: .375rem; | ||
| 567 | +} | ||
| 568 | + | ||
| 569 | +.md-mathjax-midline { | ||
| 570 | + background: #fafafa; | ||
| 571 | +} | ||
| 572 | + | ||
| 573 | +#write>h3.md-focus:before{ | ||
| 574 | + left: -1.5625rem; | ||
| 575 | + top: .375rem; | ||
| 576 | +} | ||
| 577 | +#write>h4.md-focus:before{ | ||
| 578 | + left: -1.5625rem; | ||
| 579 | + top: .285714286rem; | ||
| 580 | +} | ||
| 581 | +#write>h5.md-focus:before{ | ||
| 582 | + left: -1.5625rem; | ||
| 583 | + top: .285714286rem; | ||
| 584 | +} | ||
| 585 | +#write>h6.md-focus:before{ | ||
| 586 | + left: -1.5625rem; | ||
| 587 | + top: .285714286rem; | ||
| 588 | +} | ||
| 589 | +.md-image>.md-meta { | ||
| 590 | + /*border: 1px solid #ddd;*/ | ||
| 591 | + border-radius: 3px; | ||
| 592 | + padding: 2px 0px 0px 4px; | ||
| 593 | + font-size: 0.9em; | ||
| 594 | + color: inherit; | ||
| 595 | +} | ||
| 596 | + | ||
| 597 | +.md-tag { | ||
| 598 | + color: #a7a7a7; | ||
| 599 | + opacity: 1; | ||
| 600 | +} | ||
| 601 | + | ||
| 602 | +.md-toc { | ||
| 603 | + margin-top:20px; | ||
| 604 | + padding-bottom:20px; | ||
| 605 | +} | ||
| 606 | + | ||
| 607 | +.sidebar-tabs { | ||
| 608 | + border-bottom: none; | ||
| 609 | +} | ||
| 610 | + | ||
| 611 | +#typora-quick-open { | ||
| 612 | + border: 1px solid #ddd; | ||
| 613 | + background-color: #f8f8f8; | ||
| 614 | +} | ||
| 615 | + | ||
| 616 | +#typora-quick-open-item { | ||
| 617 | + background-color: #FAFAFA; | ||
| 618 | + border-color: #FEFEFE #e5e5e5 #e5e5e5 #eee; | ||
| 619 | + border-style: solid; | ||
| 620 | + border-width: 1px; | ||
| 621 | +} | ||
| 622 | + | ||
| 623 | +/** focus mode */ | ||
| 624 | +.on-focus-mode blockquote { | ||
| 625 | + border-left-color: rgba(85, 85, 85, 0.12); | ||
| 626 | +} | ||
| 627 | + | ||
| 628 | +header, .context-menu, .megamenu-content, footer{ | ||
| 629 | + font-family: "Segoe UI", "Arial", sans-serif; | ||
| 630 | +} | ||
| 631 | + | ||
| 632 | +.file-node-content:hover .file-node-icon, | ||
| 633 | +.file-node-content:hover .file-node-open-state{ | ||
| 634 | + visibility: visible; | ||
| 635 | +} | ||
| 636 | + | ||
| 637 | +.mac-seamless-mode #typora-sidebar { | ||
| 638 | + background-color: #fafafa; | ||
| 639 | + background-color: var(--side-bar-bg-color); | ||
| 640 | +} | ||
| 641 | + | ||
| 642 | +.md-lang { | ||
| 643 | + color: #b4654d; | ||
| 644 | +} | ||
| 645 | + | ||
| 646 | +/*.html-for-mac { | ||
| 647 | + --item-hover-bg-color: #E6F0FE; | ||
| 648 | +}*/ | ||
| 649 | + | ||
| 650 | +#md-notification .btn { | ||
| 651 | + border: 0; | ||
| 652 | +} | ||
| 653 | + | ||
| 654 | +.dropdown-menu .divider { | ||
| 655 | + border-color: #e5e5e5; | ||
| 656 | + opacity: 0.4; | ||
| 657 | +} | ||
| 658 | + | ||
| 659 | +.ty-preferences .window-content { | ||
| 660 | + background-color: #fafafa; | ||
| 661 | +} | ||
| 662 | + | ||
| 663 | +.ty-preferences .nav-group-item.active { | ||
| 664 | + color: white; | ||
| 665 | + background: #999; | ||
| 666 | +} | ||
| 667 | + | ||
| 668 | +.menu-item-container a.menu-style-btn { | ||
| 669 | + background-color: #f5f8fa; | ||
| 670 | + background-image: linear-gradient( 180deg , hsla(0, 0%, 100%, 0.8), hsla(0, 0%, 100%, 0)); | ||
| 671 | +} | ||
| 672 | + | ||
| 673 | + | ||
| 674 | + @media print { @page {margin: 0 0 0 0;} body.typora-export {padding-left: 0; padding-right: 0;} #write {padding:0;}} | ||
| 675 | +</style><title>指令集说明文档</title> | ||
| 676 | +</head> | ||
| 677 | +<body class='typora-export'><div class='typora-export-content'> | ||
| 678 | +<div id='write' class=''><h1 id='指令集说明文档'><span>指令集说明文档</span></h1><div class='md-toc' mdtype='toc'><p class="md-toc-content" role="list"><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n1122"><a class="md-toc-inner" style="" href="#指令集说明文档">指令集说明文档</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1126"><a class="md-toc-inner" style="" href="#创建空数据集-----newempty">创建空数据集 --- newempty</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1127"><a class="md-toc-inner" style="" href="#api-1">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1153"><a class="md-toc-inner" style="" href="#举例1-1">举例1</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1155"><a class="md-toc-inner" style="" href="#举例2-1">举例2</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1158"><a class="md-toc-inner" style="" href="#清空表数据-----emptyall">清空表数据 --- emptyAll</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1160"><a class="md-toc-inner" style="" href="#api-2">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1180"><a class="md-toc-inner" style="" href="#举例-1">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1183"><a class="md-toc-inner" style="" href="#过滤-----filter">过滤 --- filter</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1184"><a class="md-toc-inner" style="" href="#api-3">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1222"><a class="md-toc-inner" style="" href="#举例-2">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1225"><a class="md-toc-inner" style="" href="#如果-----ifdo">如果 --- ifdo</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1226"><a class="md-toc-inner" style="" href="#api-4">API</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n1252"><a class="md-toc-inner" style="" href="#conditions-api">conditions API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1284"><a class="md-toc-inner" style="" href="#举例1-2">举例1</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1286"><a class="md-toc-inner" style="" href="#举例2-2">举例2</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1289"><a class="md-toc-inner" style="" href="#循环-----fordo">循环 --- fordo</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1290"><a class="md-toc-inner" style="" href="#api-5">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1316"><a class="md-toc-inner" style="" href="#说明-1">说明</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1318"><a class="md-toc-inner" style="" href="#举例-3">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1321"><a class="md-toc-inner" style="" href="#新增-----add">新增 --- add</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1322"><a class="md-toc-inner" style="" href="#api-6">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1365"><a class="md-toc-inner" style="" href="#举例-4">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1369"><a class="md-toc-inner" style="" href="#删除-----del">删除 --- del</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1370"><a class="md-toc-inner" style="" href="#api-7">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1402"><a class="md-toc-inner" style="" href="#举例-5">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1404"><a class="md-toc-inner" style="" href="#复制-----copy">复制 --- copy</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1405"><a class="md-toc-inner" style="" href="#api-8">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1443"><a class="md-toc-inner" style="" href="#举例-6">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1446"><a class="md-toc-inner" style="" href="#编辑-----edit">编辑 --- edit</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1447"><a class="md-toc-inner" style="" href="#api-9">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1485"><a class="md-toc-inner" style="" href="#举例-7">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1489"><a class="md-toc-inner" style="" href="#打印-----print">打印 --- print</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1490"><a class="md-toc-inner" style="" href="#api-10">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1528"><a class="md-toc-inner" style="" href="#举例-8">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1531"><a class="md-toc-inner" style="" href="#刷新-----refresh">刷新 --- refresh</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1532"><a class="md-toc-inner" style="" href="#api-11">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1552"><a class="md-toc-inner" style="" href="#举例-9">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1554"><a class="md-toc-inner" style="" href="#清空选中-----clearrowkey">清空选中 --- clearrowkey</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1555"><a class="md-toc-inner" style="" href="#api-12">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1575"><a class="md-toc-inner" style="" href="#举例-10">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1577"><a class="md-toc-inner" style="" href="#选中表格第一行-----selectfirstline">选中表格第一行 --- selectfirstline</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1578"><a class="md-toc-inner" style="" href="#api-13">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1598"><a class="md-toc-inner" style="" href="#举例-11">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1600"><a class="md-toc-inner" style="" href="#查询sql-----opensql">查询SQL --- opensql</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1601"><a class="md-toc-inner" style="" href="#api-14">API</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n1621"><a class="md-toc-inner" style="" href="#data-api-1">data API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1653"><a class="md-toc-inner" style="" href="#举例-12">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1656"><a class="md-toc-inner" style="" href="#执行sql-----exesql">执行SQL --- exesql</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1657"><a class="md-toc-inner" style="" href="#api-15">API</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n1677"><a class="md-toc-inner" style="" href="#data-api-2">data API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1697"><a class="md-toc-inner" style="" href="#举例-13">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1700"><a class="md-toc-inner" style="" href="#消息指令-----msg">消息指令 --- msg</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1701"><a class="md-toc-inner" style="" href="#api-16">API</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n1733"><a class="md-toc-inner" style="" href="#code类型-api">code类型 API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1759"><a class="md-toc-inner" style="" href="#举例-14">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1762"><a class="md-toc-inner" style="" href="#保存指令-----save">保存指令 --- save</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1763"><a class="md-toc-inner" style="" href="#api-17">API</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n1795"><a class="md-toc-inner" style="" href="#data-api-3">data API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1815"><a class="md-toc-inner" style="" href="#举例-15">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1818"><a class="md-toc-inner" style="" href="#弹窗指令-----popup">弹窗指令 --- popup</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1819"><a class="md-toc-inner" style="" href="#api-18">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1839"><a class="md-toc-inner" style="" href="#举例-16">举例</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1841"><a class="md-toc-inner" style="" href="#弹窗内容说明">弹窗内容说明</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1844"><a class="md-toc-inner" style="" href="#关闭弹窗指令集-----closepop">关闭弹窗指令集 --- closepop</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1845"><a class="md-toc-inner" style="" href="#api-19">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1859"><a class="md-toc-inner" style="" href="#举例-17">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1862"><a class="md-toc-inner" style="" href="#按钮指令集-----btnhandle">按钮指令集 --- btnhandle</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1863"><a class="md-toc-inner" style="" href="#api-20">API</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n1889"><a class="md-toc-inner" style="" href="#conditiongroup-介绍">conditionGroup 介绍</a></span><span role="listitem" class="md-toc-item md-toc-h5" data-ref="n1893"><a class="md-toc-inner" style="" href="#举例-18">举例</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n1896"><a class="md-toc-inner" style="" href="#data-api-4">data API</a></span><span role="listitem" class="md-toc-item md-toc-h5" data-ref="n1946"><a class="md-toc-inner" style="" href="#showtext-api">showText API</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n1966"><a class="md-toc-inner" style="" href="#说明-2">说明</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1970"><a class="md-toc-inner" style="" href="#举例1顶部工具栏按钮指令集">举例1:顶部工具栏按钮指令集</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1972"><a class="md-toc-inner" style="" href="#举例2-表格按钮指令集">举例2: 表格按钮指令集</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1974"><a class="md-toc-inner" style="" href="#特殊说明">特殊说明</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n1980"><a class="md-toc-inner" style="" href="#tab页签显示隐藏-----btnhandle">tab页签显示隐藏 --- btnhandle</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n1981"><a class="md-toc-inner" style="" href="#api-21">API</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n2001"><a class="md-toc-inner" style="" href="#data-api-5">data API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2021"><a class="md-toc-inner" style="" href="#举例-19">举例</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2023"><a class="md-toc-inner" style="" href="#说明-3">说明</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n2034"><a class="md-toc-inner" style="" href="#存储过程指令-----procedure">存储过程指令 --- procedure</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2035"><a class="md-toc-inner" style="" href="#api-22">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2067"><a class="md-toc-inner" style="" href="#举例-20">举例</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2069"><a class="md-toc-inner" style="" href="#说明-4">说明</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n2072"><a class="md-toc-inner" style="" href="#跳转tab指令-----changetab">跳转tab指令 --- changetab</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2073"><a class="md-toc-inner" style="" href="#api-23">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2093"><a class="md-toc-inner" style="" href="#举例-21">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n2096"><a class="md-toc-inner" style="" href="#弹窗修改字段指令-----poprepair">弹窗修改字段指令 --- poprepair</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2097"><a class="md-toc-inner" style="" href="#api-24">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2153"><a class="md-toc-inner" style="" href="#fieldnames说明">fieldNames说明</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2155"><a class="md-toc-inner" style="" href="#举例-22">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n2157"><a class="md-toc-inner" style="" href="#calcprocedure指令">calcprocedure指令</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2158"><a class="md-toc-inner" style="" href="#api-25">API</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2190"><a class="md-toc-inner" style="" href="#举例-23">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n2193"><a class="md-toc-inner" style="" href="#svalue说明">sValue说明</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n2196"><a class="md-toc-inner" style="" href="#简单js运算说明">简单js运算说明</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n2198"><a class="md-toc-inner" style="" href="#dataset说明">dataset说明</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n2210"><a class="md-toc-inner" style="" href="#合计合并语法适用于svalue)">合计、合并语法(适用于sValue)</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2211"><a class="md-toc-inner" style="" href="#合计">合计</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2216"><a class="md-toc-inner" style="" href="#合并">合并</a></span><span role="listitem" class="md-toc-item md-toc-h4" data-ref="n2220"><a class="md-toc-inner" style="" href="#连接符类型">连接符类型</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2243"><a class="md-toc-inner" style="" href="#合并1">合并1</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n2248"><a class="md-toc-inner" style="" href="#获取最大值适用于svalue)">获取最大值(适用于sValue)</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2250"><a class="md-toc-inner" style="" href="#举例-24">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n2254"><a class="md-toc-inner" style="" href="#获取表格数据数量适用于svalue)">获取表格数据数量(适用于sValue)</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2256"><a class="md-toc-inner" style="" href="#举例-25">举例</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n2259"><a class="md-toc-inner" style="" href="#获取数组中某个字段分组后的组数">获取数组中某个字段分组后的组数</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2261"><a class="md-toc-inner" style="" href="#举例适用于svalue)">举例(适用于sValue)</a></span><span role="listitem" class="md-toc-item md-toc-h3" data-ref="n2263"><a class="md-toc-inner" style="" href="#举例-适用于condition)">举例 (适用于condition)</a></span></p></div><p> </p><h2 id='创建空数据集-----newempty'><span>创建空数据集 --- newempty</span></h2><h3 id='api-1'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>newDataset</span></td><td><span>新产生的临时数据</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是(newDataset/desDataset二选一)</span></td></tr><tr><td><span>desDataset</span></td><td><span>覆盖掉原来的数据(新增新表单时用)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是(newDataset/desDataset二选一)</span></td></tr></tbody></table></figure><h3 id='举例1-1'><span>举例1</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"newempty"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"newDataset"</span>: <span class="cm-string">"table0"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 92px;"></div><div class="CodeMirror-gutters" style="display: none; height: 92px;"></div></div></div></pre><h3 id='举例2-1'><span>举例2</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">[</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"newempty"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"desDataset"</span>: <span class="cm-string">"table0"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"refresh"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"dataset"</span>: <span class="cm-string">"table1,table2"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">]</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 230px;"></div><div class="CodeMirror-gutters" style="display: none; height: 230px;"></div></div></div></pre><p> </p><h2 id='清空表数据-----emptyall'><span>清空表数据 --- emptyAll</span></h2><p><span>说明:清空数据集,但不保存到数据库</span></p><h3 id='api-2'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>desDataset</span></td><td><span>被编辑的数据源(仅支持逗号)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h3 id='举例-1'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"emptyAll"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"desDataset"</span>: <span class="cm-string">"table0,table1,table2"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 92px;"></div><div class="CodeMirror-gutters" style="display: none; height: 92px;"></div></div></div></pre><p> </p><h2 id='过滤-----filter'><span>过滤 --- filter</span></h2><h3 id='api-3'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>srcDataset</span></td><td><span>被过滤的数据(支持@筛选)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>newDataset</span></td><td><span>新产生的临时数据</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>dataset</span></td><td><span>condition用到的数据集</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>condition</span></td><td><span>筛选srcDataset数据(需要用到js判断的情况下使用,简单的可以用desDataset的@删选实现)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr></tbody></table></figure><h3 id='举例-2'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"filter"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"srcDataset"</span>: <span class="cm-string">"process"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"newDataset"</span>: <span class="cm-string">"processNew"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"dataset"</span>: <span class="cm-string">"processOne,controlOne"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"condition"</span>: <span class="cm-string">"${processOne.sControlId}==${controlOne.sId}"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 161px;"></div><div class="CodeMirror-gutters" style="display: none; height: 161px;"></div></div></div></pre><p> </p><h2 id='如果-----ifdo'><span>如果 --- ifdo</span></h2><h3 id='api-4'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>dataset</span></td><td><span>condition用到的数据集</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>conditions</span></td><td><span>固定格式,里面写详细条件</span></td><td><span>object[]</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h4 id='conditions-api'><span>conditions API</span></h4><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>condition</span></td><td><span>条件语句</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>commands</span></td><td><span>满足条件后执行的指令集</span></td><td><span>object[]</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>conditionNotEmpty</span></td><td><span>数据集如果都不为空,继续执行(多个数据集逗号分隔)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>conditionEmpty</span></td><td><span>数据集如果都为空,继续执行(多个数据集逗号分隔)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr></tbody></table></figure><h3 id='举例1-2'><span>举例1</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"ifdo"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"dataset"</span>: <span class="cm-string">"table1@sec"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"conditions"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"condition"</span>: <span class="cm-string">"'${table1.iJobStatus}' == '3'"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"commands"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"msg"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"msg"</span>: <span class="cm-string">"如果状态为3指令集..."</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"condition"</span>: <span class="cm-string">"'${table1.iJobStatus}' == '2'"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"commands"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"msg"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"msg"</span>: <span class="cm-string">"如果状态为2指令集..."</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 552px;"></div><div class="CodeMirror-gutters" style="display: none; height: 552px;"></div></div></div></pre><h3 id='举例2-2'><span>举例2</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"ifdo"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"conditions"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"conditionNotEmpty"</span>: <span class="cm-string">"slave"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"commands"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"msg"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"msg"</span>: <span class="cm-string">"slave不为空情况"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"conditionEmpty"</span>: <span class="cm-string">"slave"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"commands"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"msg"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"msg"</span>: <span class="cm-string">"slave情况"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 529px;"></div><div class="CodeMirror-gutters" style="display: none; height: 529px;"></div></div></div></pre><p> </p><h2 id='循环-----fordo'><span>循环 --- fordo</span></h2><h3 id='api-5'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>dataset</span></td><td><span>被循环的数据集(不支持@、不支持逗号分隔)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>conditions</span></td><td><span>固定写法,里面写具体条件</span></td><td><span>Object[]</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h3 id='说明-1'><span>说明</span></h3><p><span>循环中当前条数据用 dataset名称+One 表示</span></p><h3 id='举例-3'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"fordo"</span>, </span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"dataset"</span>: <span class="cm-string">"control"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"foropr"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-comment">// 循环执行的指令</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 161px;"></div><div class="CodeMirror-gutters" style="display: none; height: 161px;"></div></div></div></pre><p> </p><h2 id='新增-----add'><span>新增 --- add</span></h2><h3 id='api-6'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>desDataset</span></td><td><span>被新增的数据集</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>dataset</span></td><td><span>sValue进行简单计算用到的数据集(支持逗号分隔,@筛选)</span><a href='#dataset说明'><span>dataset说明</span></a></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>sValue</span></td><td><span>赋值规则 </span><del><a href='#svalue说明'><span>sValue说明</span></a></del></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr></tbody></table></figure><p><span>sValue说明</span><span> </span></p><p><span>支持如下写法:</span></p><ul><li><p><span>*(所有数据集的所有字段)</span></p></li><li><p><span>数据集名称.* (某个数据集的所有字段)</span></p></li><li><p><span>新字段名称:数据集名称.数据集内字段名称</span></p></li><li><p><span>新字段名称:数据集内字段名称(单个数据集简写时使用)</span></p></li></ul><h3 id='举例-4'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"add"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"dataset"</span>: <span class="cm-string">"machinedata@sec,workerOrderBatchMaterial@sec"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"desDataset"</span>: <span class="cm-string">"jytable0"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"sValue"</span>: <span class="cm-string">"sLayingOffArea:machinedata.sWorkOrderNo,sMemo:workerOrderBatchMaterial.sMaterialsNo"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 138px;"></div><div class="CodeMirror-gutters" style="display: none; height: 138px;"></div></div></div></pre><p> </p><p> </p><h2 id='删除-----del'><span>删除 --- del</span></h2><h3 id='api-7'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>desDataset</span></td><td><span>被编辑的数据源(仅支持@筛选)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>dataset</span></td><td><span>condition用到的数据集(支持逗号分隔,@筛选)</span><a href='#dataset说明'><span>dataset说明</span></a></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>condition</span></td><td><span>筛选srcDataset数据(需要用到js判断的情况下使用,简单的可以用desDataset的@删选实现)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr></tbody></table></figure><h3 id='举例-5'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"del"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"desDataset"</span>: <span class="cm-string">"table2@sec"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 92px;"></div><div class="CodeMirror-gutters" style="display: none; height: 92px;"></div></div></div></pre><h2 id='复制-----copy'><span>复制 --- copy</span></h2><h3 id='api-8'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>srcDataset</span></td><td><span>被复制的数据源(仅支持@筛选)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>newDataset</span></td><td><span>新产生的临时数据</span></td><td><span>stirng</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>dataset</span></td><td><span>sValue进行简单计算用到的数据集(支持逗号分隔,@筛选)</span><a href='#dataset说明'><span>dataset说明</span></a></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>sValue</span></td><td><span>赋值规则 </span><a href='#svalue说明'><span>sValue说明</span></a></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr></tbody></table></figure><h3 id='举例-6'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"copy"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"srcDataset"</span>: <span class="cm-string">"machinedata@sec"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"newDataset"</span>: <span class="cm-string">"machinedataNew"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"sValue"</span>: <span class="cm-string">"sWorkOrderNo:sWorkOrderNo,sWorkOrderId:${sWorkOrderId}+1"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 138px;"></div><div class="CodeMirror-gutters" style="display: none; height: 138px;"></div></div></div></pre><p> </p><h2 id='编辑-----edit'><span>编辑 --- edit</span></h2><h3 id='api-9'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>desDataset</span></td><td><span>被编辑的数据源(仅支持@筛选)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>dataset</span></td><td><span>condition/sValue进行简单计算用到的数据集(支持逗号分隔,@筛选)</span><a href='#dataset说明'><span>dataset说明</span></a></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>condition</span></td><td><span>筛选srcDataset数据(需要用到js判断的情况下使用,简单的可以用desDataset的@删选实现)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>sValue</span></td><td><span>赋值规则</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h3 id='举例-7'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"edit"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"desDataset"</span>: <span class="cm-string">"jytable0"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"dataset"</span>: <span class="cm-string">"machinedata@sec,workerOrderBatchMaterial@sec"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"condition"</span>: <span class="cm-string">"${machinedata.sWorkOrderId}==${workerOrderBatchMaterial.sWorkOrderId}"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"sValue"</span>: <span class="cm-string">"sMemo:'${machinedata.sProductName}'+'(复制指令)',sLayingOffArea:${machinedata.sWorkOrderNo}+3"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 161px;"></div><div class="CodeMirror-gutters" style="display: none; height: 161px;"></div></div></div></pre><p> </p><p> </p><h2 id='打印-----print'><span>打印 --- print</span></h2><h3 id='api-10'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>reportName</span></td><td><span>报表名称</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>reportType</span></td><td><span>报表类型</span></td><td><span>stirng</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>srcDataset</span></td><td><span>报表数据源(支持逗号分隔,@筛选)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>bPreviewOnly</span></td><td><span>只要预览,不要显示打印页面</span></td><td><span>bolean</span></td><td><span>false</span></td><td><span>否</span></td></tr></tbody></table></figure><h3 id='举例-8'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"print"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"srcDataset"</span>: <span class="cm-string">"upSlave,master"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"reportName"</span>: <span class="cm-string">"生产工单A4(二维码22)_SizeW210H297"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"reportType"</span>: <span class="cm-string">".pdf"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 138px;"></div><div class="CodeMirror-gutters" style="display: none; height: 138px;"></div></div></div></pre><p> </p><h2 id='刷新-----refresh'><span>刷新 --- refresh</span></h2><h3 id='api-11'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>dataset</span></td><td><span>需要刷新的数据源</span><br /><span>(不填/填*表示刷新整个页面)</span><br /><span>(parent.数据源名 表示刷新父页面数据源)</span></td><td><span>string</span></td><td><span>*</span></td><td><span>否</span></td></tr></tbody></table></figure><h3 id='举例-9'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"refresh"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"dataset"</span>: <span class="cm-string">"table0,table1"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 92px;"></div><div class="CodeMirror-gutters" style="display: none; height: 92px;"></div></div></div></pre><h2 id='清空选中-----clearrowkey'><span>清空选中 --- clearrowkey</span></h2><h3 id='api-12'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>dataset</span></td><td><span>需要刷新的数据源(支持逗号分隔)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h3 id='举例-10'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"clearrowkey"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"dataset"</span>: <span class="cm-string">"slaveWypj1"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 92px;"></div><div class="CodeMirror-gutters" style="display: none; height: 92px;"></div></div></div></pre><h2 id='选中表格第一行-----selectfirstline'><span>选中表格第一行 --- selectfirstline</span></h2><h3 id='api-13'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>dataset</span></td><td><span>需要选中的数据源(支持逗号分隔)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h3 id='举例-11'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded md-focus" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 32.5px; left: 224px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="" style="position: relative;"><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"selectfirstline"</span>,</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"dataset"</span>: <span class="cm-string">"slaveWypj1"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 92px;"></div><div class="CodeMirror-gutters" style="display: none; height: 92px;"></div></div></div></pre><h2 id='查询sql-----opensql'><span>查询SQL --- opensql</span></h2><h3 id='api-14'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>data</span></td><td><span>详细配置</span></td><td><span>object[]</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h4 id='data-api-1'><span>data API</span></h4><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>sql</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>srcDataset</span></td><td><span>传入接口的数据源(支持@筛选, 逗号分隔会把两个数据合并)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>newDataset</span></td><td><span>接口返回数据的存放数据源</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>sSqlCondition</span></td><td><span>后台用到的参数</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h3 id='举例-12'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"opensql"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"data"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"sql"</span>: <span class="cm-string">"select IFNULL(max(sBoardNo),0)+1 AS sBoardNo,IFNULL(max(sIndexNo),0)+1 AS sIndexNo FROM plc_machinedate_tray WHERE sWorkOrderId = ${sWorkOrderId} and sMachineId = ${sMachineId} "</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"srcDataset"</span>: <span class="cm-string">"machinedata@sec"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"newDataset"</span>: <span class="cm-string">"openPlctray"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"sSqlCondition"</span>: <span class="cm-string">"machinedata.sWorkOrderId.sWorkOrderId,machinedata.sMachineId.sMachineId"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 276px;"></div><div class="CodeMirror-gutters" style="display: none; height: 276px;"></div></div></div></pre><p> </p><h2 id='执行sql-----exesql'><span>执行SQL --- exesql</span></h2><h3 id='api-15'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>data</span></td><td><span>详细配置</span></td><td><span>object[]</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h4 id='data-api-2'><span>data API</span></h4><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>sql</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>srcDataset</span></td><td><span>传入接口的数据源(仅支持@筛选)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h3 id='举例-13'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"exesql"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"data"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"sql"</span>: <span class="cm-string">"update plc_machinedate_tray SET bWlStatus= 1 WHERE sId=${sParentId}"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"srcDataset"</span>: <span class="cm-string">"palletBatchMaterial@sec"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 207px;"></div><div class="CodeMirror-gutters" style="display: none; height: 207px;"></div></div></div></pre><p> </p><h2 id='消息指令-----msg'><span>消息指令 --- msg</span></h2><h3 id='api-16'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>sql</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>code</span></td><td><span>消息类型</span></td><td><span>number</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>msg</span></td><td><span>消息内容</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>time</span></td><td><span>弹窗消失时间(单位:秒)(能自动消失的类型才生效)</span></td><td><span>number</span></td><td><span>3</span></td><td><span>否</span></td></tr></tbody></table></figure><h4 id='code类型-api'><span>code类型 API</span></h4><figure><table><thead><tr><th><span>值</span></th><th><span>说明</span></th><th><span>是否自动消失</span></th></tr></thead><tbody><tr><td><span>-1</span></td><td><span>错误类型消息</span></td><td><span>是</span></td></tr><tr><td><span>1</span></td><td><span>成功类型消息</span></td><td><span>是</span></td></tr><tr><td><span>2</span></td><td><span>提示类型消息</span></td><td><span>否</span></td></tr><tr><td><span>-8</span></td><td><span>错误类型消息</span></td><td><span>否</span></td></tr><tr><td><span>-7</span></td><td><span>确认类型消息(确定:继续执行,取消:指令集立即结束)</span></td><td><span>否</span></td></tr></tbody></table></figure><h3 id='举例-14'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"msg"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"code"</span>: <span class="cm-number">1</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"time"</span>: <span class="cm-number">3</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"msg"</span>: <span class="cm-string">"删除成功"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 138px;"></div><div class="CodeMirror-gutters" style="display: none; height: 138px;"></div></div></div></pre><p> </p><h2 id='保存指令-----save'><span>保存指令 --- save</span></h2><h3 id='api-17'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>data</span></td><td><span>单表保存专用</span><br /><span>(传统表单保存请不要添加这个属性)</span></td><td><span>object[]</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>doNotValidate</span></td><td><span>保存不进行校验</span></td><td><span>boolean</span></td><td><span>false</span></td><td><span>否</span></td></tr><tr><td><span>doNotRefresh</span></td><td><span>保存后不刷新表格</span></td><td><span>boolean</span></td><td><span>false</span></td><td><span>否</span></td></tr></tbody></table></figure><h4 id='data-api-3'><span>data API</span></h4><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>tablename</span></td><td><span>表名</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>srcDataset</span></td><td><span>表格名称</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h3 id='举例-15'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 表单模式保存</span></span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"save"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp=""> | ||
| 679 | +</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 单表模式保存</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"save"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"data"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"tablename"</span>: <span class="cm-string">"plc_machinedate_tray_slave"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"srcDataset"</span>: <span class="cm-string">"table0"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"tablename"</span>: <span class="cm-string">"plc_machinedate_tray_slave1"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"srcDataset"</span>: <span class="cm-string">"table1"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp=""> | ||
| 680 | +</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 单表模式保存(不刷新表格)</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"save"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"doNotRefresh"</span>: <span class="cm-atom">true</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"data"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"tablename"</span>: <span class="cm-string">"eptmachinemaintainplanslave"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"srcDataset"</span>: <span class="cm-string">"table1"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 713px;"></div><div class="CodeMirror-gutters" style="display: none; height: 713px;"></div></div></div></pre><p> </p><h2 id='弹窗指令-----popup'><span>弹窗指令 --- popup</span></h2><h3 id='api-18'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>dataset</span></td><td><span>弹窗【SQL条件】用到的数据源</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr></tbody></table></figure><h3 id='举例-16'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"popup"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"dataset"</span>: <span class="cm-string">"slave@sec"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 92px;"></div><div class="CodeMirror-gutters" style="display: none; height: 92px;"></div></div></div></pre><h3 id='弹窗内容说明'><span>弹窗内容说明</span></h3><p><span>弹窗配置参照【MES功能配置】-【 6、表格按钮弹窗带参数配置】</span></p><p> </p><h2 id='关闭弹窗指令集-----closepop'><span>关闭弹窗指令集 --- closepop</span></h2><h3 id='api-19'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h3 id='举例-17'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"closepop"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 69px;"></div><div class="CodeMirror-gutters" style="display: none; height: 69px;"></div></div></div></pre><p> </p><h2 id='按钮指令集-----btnhandle'><span>按钮指令集 --- btnhandle</span></h2><h3 id='api-20'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>data</span></td><td><span>各个按钮配置</span></td><td><span>object[]</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>conditionGroup</span></td><td><span>可多次复用的条件数组</span></td><td><span>object{}</span></td><td><span>/</span></td><td><span>否</span></td></tr></tbody></table></figure><h4 id='conditiongroup-介绍'><span>conditionGroup 介绍</span></h4><p><span> </span><span>key值: 自定义</span></p><p><span> </span><span>value值:下方enabled/show/condition内会复用到的条件</span></p><p><span> </span><span>调用时支持 conditionGroup.key值 或 !conditionGroup.key值 两种格式</span></p><h5 id='举例-18'><span>举例</span></h5><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"btnhandle"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"conditionGroup"</span>: {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"condition1"</span>: <span class="cm-string">"${slave@one.sState.===.未审核}"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"data"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"name"</span>: <span class="cm-string">"BtnBatchSubmit"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"enabled"</span>: <span class="cm-string">"conditionGroup.condition1"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-tab" role="presentation" cm-text=" "> </span>{</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"name"</span>: <span class="cm-string">"BtnBatchSubmit1"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"enabled"</span>: <span class="cm-string">"!conditionGroup.condition1"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 368px;"></div><div class="CodeMirror-gutters" style="display: none; height: 368px;"></div></div></div></pre><p> </p><h4 id='data-api-4'><span>data API</span></h4><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>name</span></td><td><span>按钮的控件名(支持逗号分隔)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>show</span></td><td><span>是否显示</span></td><td><span>boolean/string</span></td><td><span>true</span></td><td><span>否</span></td></tr><tr><td><span>enabled</span></td><td><span>是否可以点击</span></td><td><span>boolean/string</span></td><td><span>false</span></td><td><span>否</span></td></tr><tr><td><span>showText</span></td><td><span>按钮名称</span></td><td><span>object[]</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>click</span></td><td><span>点击指令集(表格中生效)</span></td><td><span>object[]</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>afterClick</span></td><td><span>按钮点击后调用</span></td><td><span>boolean</span></td><td><span>false</span></td><td><span>否</span></td></tr><tr><td><span>clickOnly</span></td><td><span>只执行指令集,不执行原先按钮功能</span></td><td><span>boolean</span></td><td><span>false</span></td><td><span>否</span></td></tr></tbody></table></figure><h5 id='showtext-api'><span>showText API</span></h5><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>condition</span></td><td><span>条件</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>text</span></td><td><span>按钮显示名称</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h4 id='说明-2'><span>说明</span></h4><p><span>show/enabled的值</span></p><p><span> </span><span>填 true/false 时就是固定情况,永远不变</span></p><p><span> </span><span>填${xxx}就是根据条件判断显示不显示/可点击不可点击</span></p><h3 id='举例1顶部工具栏按钮指令集'><span>举例1:顶部工具栏按钮指令集</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"btnhandle"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"data"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"name"</span>: <span class="cm-string">"BtnBatchSubmit,BtnBatchExamine"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"enabled"</span>: <span class="cm-string">"${slave@one.sState.===.未审核}"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"show"</span>: <span class="cm-string">"${master.bCheck} !== true"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"click"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"msg"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"msg"</span>: <span class="cm-string">"我是按钮前指令"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"name"</span>: <span class="cm-string">"BtnOut"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"enabled"</span>: <span class="cm-atom">true</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"showText"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"condition"</span>: <span class="cm-string">"${slave@one.sState.===.未审核}"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"text"</span>: <span class="cm-string">"导出1"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"condition"</span>: <span class="cm-string">"${slave@one.sState.!==.未审核}"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"text"</span>: <span class="cm-string">"导出2"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 690px;"></div><div class="CodeMirror-gutters" style="display: none; height: 690px;"></div></div></div></pre><h3 id='举例2-表格按钮指令集'><span>举例2: 表格按钮指令集</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"btnhandle"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"data"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"name"</span>: <span class="cm-string">"BtnAdd"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"enabled"</span>: <span class="cm-string">"${props.enabled} && ${slave.dProductQty} > 0"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"click"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"msg"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"msg"</span>: <span class="cm-string">"表格行按钮指令集测试"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 345px;"></div><div class="CodeMirror-gutters" style="display: none; height: 345px;"></div></div></div></pre><h3 id='特殊说明'><span>特殊说明</span></h3><p><span>${表名@one.表字段.比较条件.比较内容} </span></p><p><span> </span><span>表示:【某表所有选中数据中】【只要有一条数据满足】 【某个字段】【等于/不等于/大于/小于】【比较内容】</span></p><p><span>${表名@all.表字段.比较条件.比较内容} </span></p><p><span> </span><span>表示:【某表所有选中数据中】【所有数据都满足】 【某个字段】【等于/不等于/大于/小于】【比较内容】</span></p><p> </p><h2 id='tab页签显示隐藏-----btnhandle'><span>tab页签显示隐藏 --- btnhandle</span></h2><h3 id='api-21'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>tabs</span></td><td><span>各个tab页签配置</span></td><td><span>object[]</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h4 id='data-api-5'><span>data API</span></h4><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>name</span></td><td><span>tab页签名称</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>show</span></td><td><span>是否显示</span></td><td><span>boolean/string</span></td><td><span>true</span></td><td><span>是</span></td></tr></tbody></table></figure><h3 id='举例-19'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"btnhandle"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"tabs"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"name"</span>: <span class="cm-string">"可用数量评审"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"show"</span>: <span class="cm-string">"${props.enabled} && ${slave.dProductQty} > 0"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 207px;"></div><div class="CodeMirror-gutters" style="display: none; height: 207px;"></div></div></div></pre><h3 id='说明-3'><span>说明</span></h3><ul><li><p><span>show的配置同按钮显示隐藏功能的enable一致</span></p></li><li><p><span>配置配在【主表】</span></p></li><li><p><span>同时有按钮显示隐藏、tab页签显示隐藏时,配置如下</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"btnhandle"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"data"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"name"</span>: <span class="cm-string">"BtnAdd"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"enabled"</span>: <span class="cm-string">"${props.enabled} && ${slave.dProductQty} > 0"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ],</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-tab" role="presentation" cm-text=" "> </span><span class="cm-string cm-property">"tabs"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"name"</span>: <span class="cm-string">"可用数量评审"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"show"</span>: <span class="cm-string">"${props.enabled} && ${slave.dProductQty} > 0"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 345px;"></div><div class="CodeMirror-gutters" style="display: none; height: 345px;"></div></div></div></pre><p> </p></li></ul><p> </p><h2 id='存储过程指令-----procedure'><span>存储过程指令 --- procedure</span></h2><h3 id='api-22'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>config</span></td><td><span>存储过程配置(配置和普通存储过程配置保持一致)</span></td><td><span>object{}</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>bRefresh</span></td><td><span>等待刷新后继续执行剩余指令集</span></td><td><span>boolean</span></td><td><span>false</span></td><td><span>否</span></td></tr><tr><td><span>bValidateList</span></td><td><span>表单校验</span></td><td><span>object[]</span></td><td><span>/</span></td><td><span>否</span></td></tr></tbody></table></figure><h3 id='举例-20'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"procedure"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"config"</span>: {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"sproName"</span>: <span class="cm-string">"sp_working_staff"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"inMap"</span>: <span class="cm-string">"table0.sMachineName,table0.sBillNo,userinfo.sEmployeeName"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"staticData"</span>: {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"sOperate"</span>: <span class="cm-string">"start"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp=""> | ||
| 681 | +</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-comment">// 带表单校验</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"procedure"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"bValidateList"</span>: [<span class="cm-string">"table4"</span>],</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"config"</span>: {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"sproName"</span>: <span class="cm-string">"Sp_Check_DailyReport"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"inMap"</span>: <span class="cm-string">"table4.*,userinfo.sWorkshopId"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp=""> | ||
| 682 | +</span></span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 483px;"></div><div class="CodeMirror-gutters" style="display: none; height: 483px;"></div></div></div></pre><h3 id='说明-4'><span>说明</span></h3><p><span>存储过程指令执行完成后,会刷新页面,页面重新获取数据后再执行剩余指令集</span></p><p> </p><h2 id='跳转tab指令-----changetab'><span>跳转tab指令 --- changetab</span></h2><h3 id='api-23'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>tabName</span></td><td><span>需要跳转到的tab名称(中文)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr></tbody></table></figure><h3 id='举例-21'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">{</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> "opr": "changetab",</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> "tabName": "年保养"</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">}</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 92px;"></div><div class="CodeMirror-gutters" style="display: none; height: 92px;"></div></div></div></pre><p> </p><h2 id='弹窗修改字段指令-----poprepair'><span>弹窗修改字段指令 --- poprepair</span></h2><h3 id='api-24'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>title</span></td><td><span>弹窗名称</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>confirmBtnName</span></td><td><span>自定义确认按钮名称</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>fieldNames</span></td><td><span>弹窗展示字段</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>dataset</span></td><td><span>sValue用到的数据集(支持@和逗号分割)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>sValue</span></td><td><span>给弹窗数据赋默认值</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>srcDataset</span></td><td><span>表单下方按钮弹窗时指定的当前表名(表单时才有用!)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr><tr><td><span>formEnabledCondition</span></td><td><span>表单可编辑条件(优先级高于表单的formEnabledCondition)</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr></tbody></table></figure><h3 id='fieldnames说明'><span>fieldNames说明</span></h3><p><span>表格配置的【字段名】,多个时用英文逗号【,】拼接</span></p><h3 id='举例-22'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">[</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"poprepair"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"title"</span>: <span class="cm-string">"领班验收"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"fieldNames"</span>: <span class="cm-string">"sForeman,bForemanAccept,tForemanAcceptDate"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"dataset"</span>: <span class="cm-string">"userface@sec"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"sValue"</span>: <span class="cm-string">"sForeman:userface.name"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"save"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"data"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"tablename"</span>: <span class="cm-string">"EptMachineMaintenanceMaster"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"srcDataset"</span>: <span class="cm-string">"table2"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">]</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 414px;"></div><div class="CodeMirror-gutters" style="display: none; height: 414px;"></div></div></div></pre><h2 id='calcprocedure指令'><span>calcprocedure指令</span></h2><h3 id='api-25'><span>API</span></h3><figure><table><thead><tr><th><span>属性</span></th><th><span>说明</span></th><th><span>类型</span></th><th><span>默认值</span></th><th><span>是否必填</span></th></tr></thead><tbody><tr><td><span>opr</span></td><td><span>指令类型</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>dataset</span></td><td><span>指令传给后台的数据集(默认全部,若要指定,用逗号分隔,例如tabe1,table2)</span></td><td><span>string</span></td><td><span>*</span></td><td><span>否</span></td></tr><tr><td><span>sProName</span></td><td><span>存储过程名称</span></td><td><span>string</span></td><td><span>/</span></td><td><span>是</span></td></tr><tr><td><span>sButtonParam</span></td><td><span>sButtonParam参数</span></td><td><span>string</span></td><td><span>/</span></td><td><span>否</span></td></tr></tbody></table></figure><h3 id='举例-23'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">[{ <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"calcprocedure"</span>, <span class="cm-string cm-property">"sProName"</span>: <span class="cm-string">"Sp_SalesOrderReviewPassRate_calc"</span> }]</span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 23px;"></div><div class="CodeMirror-gutters" style="display: none; height: 23px;"></div></div></div></pre><p> </p><h2 id='svalue说明'><span>sValue说明</span></h2><p><span>格式1:newDataset的字段名.srcDataset的字段名</span> | ||
| 683 | +<span>格式2:newDataset的字段名.简单js运算 // 详见</span><a href='#简单js运算'><span>简单js运算</span></a> | ||
| 684 | +<span>格式2: var运算</span></p><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">sMachinetrayId: '${var sReturn = ''; if (Object.keys(jytable0@).length > 0) { sReturn = jytable0.sId} else if (Object.keys(wytable0@).length > 0) { sReturn = wytable0.sId } sReturn }'</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">字段赋值时需要在不同条件下数据集中取数据。</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">增加支持JS语法。</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">识别前缀'${var'与后缀 '}'中的数据做解析。</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">之前支持 jytable0.sId 取字段值, 增加 jytable0@ 判断数据集长度来识别数据集是否为空。</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">上面例子场景:</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span>MES登录 凹印设备或胶印设备时,版材选择时,需要对应到MES中设备的托盘id,在MES界面中是两个不同的数据集。</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span class="cm-tab" role="presentation" cm-text=" "> </span>需要取 jytable0, wytable0 两个数据集哪个有值取哪个数据集中的sId. </span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 207px;"></div><div class="CodeMirror-gutters" style="display: none; height: 207px;"></div></div></div></pre><h2 id='简单js运算说明'><span>简单js运算说明</span></h2><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang=""><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang=""><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation"><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"><span cm-text="" cm-zwsp=""> | ||
| 685 | +</span></span></pre></div></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 23px;"></div><div class="CodeMirror-gutters" style="display: none; height: 23px;"></div></div></div></pre><h2 id='dataset说明'><span>dataset说明</span></h2><p><span>作用:condition、sValue做js运算时用到的数据</span></p><p><span>特点:筛选出的数据只有一条</span></p><p><span>种类:</span></p><ol start='' ><li><p><span>只有数据集名称, 例如:slave,传到运算中的数据为【当前数据集的第一条】</span></p></li><li><p><span>数据集名称@过滤类型,例如:slave@sec, 传到运算中的数据为【过滤出数据集的第一条】</span></p></li><li><p><span>数据集名称@parnet过滤类型,例如:slave@parentsec, 传到运算中的数据为【过滤出父页面该数据集的第一条】</span></p></li></ol><p> </p><h2 id='合计合并语法适用于svalue)'><span>合计、合并语法(适用于sValue)</span></h2><h3 id='合计'><span>合计</span></h3><p><span>${表名@sum保留小数位数.字段名}</span></p><p><span> </span><span>表示合计某张表的某个字段的数量,并保留指定位小数</span></p><p><span>举例:${slave@sum2.dProductPrice} 表示合计slave表的dProductPrice数量,并保留两位小数</span></p><p> </p><h3 id='合并'><span>合并</span></h3><p><span>${表名@merge连接符.字段名}</span></p><p><span> </span><span>表示合并某张表的某个字段的值,并用连接符连接</span></p><p><span>举例:${slave@mergedot.sId} 表示合并slave表的sId的值,并用逗号连接,输出结果类似:"12345,23456'"</span></p><h4 id='连接符类型'><span>连接符类型</span></h4><figure><table><thead><tr><th><span>连接符名称</span></th><th><span>实际连接符</span></th></tr></thead><tbody><tr><td><span>空(merge.字段名)</span></td><td><span>空</span></td></tr><tr><td><span>dot</span></td><td><span>,</span></td></tr><tr><td><span>minus</span></td><td><span>-</span></td></tr><tr><td><span>plus</span></td><td><span>+</span></td></tr><tr><td><span>divide</span></td><td><span>/</span></td></tr><tr><td><span>underline</span></td><td><span>_</span></td></tr></tbody></table></figure><h3 id='合并1'><span>合并1</span></h3><p><span>${表名@mergequo连接符.字段名}</span></p><p><span> </span><span>用法同上</span></p><p><span> </span><span>区别,mergequo输出的结果会带单引号,输出结果类似:"'12345','23456'"</span></p><p> </p><h2 id='获取最大值适用于svalue)'><span>获取最大值(适用于sValue)</span></h2><p><span>${表名@max.字段名}</span></p><h3 id='举例-24'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">[</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"newempty"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"newDataset"</span>: <span class="cm-string">"temp0"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"edit"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"desDataset"</span>: <span class="cm-string">"temp0"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"sValue"</span>: <span class="cm-string">"max:${table0@max.iRowNum}"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">]</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 253px;"></div><div class="CodeMirror-gutters" style="display: none; height: 253px;"></div></div></div></pre><p> </p><p> </p><h2 id='获取表格数据数量适用于svalue)'><span>获取表格数据数量(适用于sValue)</span></h2><p><span>${表名@count}</span></p><h3 id='举例-25'><span>举例</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">[</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"newempty"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"newDataset"</span>: <span class="cm-string">"temp0"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"edit"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"desDataset"</span>: <span class="cm-string">"temp0"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"sValue"</span>: <span class="cm-string">"count:${table0@count}"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">]</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 253px;"></div><div class="CodeMirror-gutters" style="display: none; height: 253px;"></div></div></div></pre><p> </p><h2 id='获取数组中某个字段分组后的组数'><span>获取数组中某个字段分组后的组数</span></h2><p><span>${表名@groupCount.字段名}</span></p><h3 id='举例适用于svalue)'><span>举例(适用于sValue)</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">[</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"newempty"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"newDataset"</span>: <span class="cm-string">"temp0"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"edit"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"desDataset"</span>: <span class="cm-string">"temp0"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"sValue"</span>: <span class="cm-string">"count:${table0@groupCount.sBusinessType}"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">]</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 253px;"></div><div class="CodeMirror-gutters" style="display: none; height: 253px;"></div></div></div></pre><h3 id='举例-适用于condition)'><span>举例 (适用于condition)</span></h3><pre class="md-fences md-end-block ty-contain-cm modeLoaded" spellcheck="false" lang="json" style="break-inside: unset;"><div class="CodeMirror cm-s-inner cm-s-null-scroll CodeMirror-wrap" lang="json"><div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 9.5px; left: 8px;"><textarea autocorrect="off" autocapitalize="off" spellcheck="false" tabindex="0" style="position: absolute; bottom: -1em; padding: 0px; width: 1000px; height: 1em; outline: currentcolor;"></textarea></div><div class="CodeMirror-scrollbar-filler" cm-not-content="true"></div><div class="CodeMirror-gutter-filler" cm-not-content="true"></div><div class="CodeMirror-scroll" tabindex="-1"><div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 0px; padding-right: 0px; padding-bottom: 0px;"><div style="position: relative; top: 0px;"><div class="CodeMirror-lines" role="presentation"><div role="presentation" style="position: relative; outline: currentcolor;"><div class="CodeMirror-measure"><pre><span>xxxxxxxxxx</span></pre></div><div class="CodeMirror-measure"></div><div style="position: relative; z-index: 1;"></div><div class="CodeMirror-code" role="presentation" style=""><div class="CodeMirror-activeline" style="position: relative;"><div class="CodeMirror-activeline-background CodeMirror-linebackground"></div><div class="CodeMirror-gutter-background CodeMirror-activeline-gutter" style="left: 0px; width: 0px;"></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">[</span></pre></div><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"filter"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"srcDataset"</span>: <span class="cm-string">"slave@sec"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"newDataset"</span>: <span class="cm-string">"slaveNew"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"ifdo"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"conditions"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"condition"</span>: <span class="cm-string">"#${slaveNew@groupCount.sBusinessType}# === 2"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"commands"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"msg"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"code"</span>: <span class="cm-operator">-</span><span class="cm-number">1</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"msg"</span>: <span class="cm-string">"订单类型需要保持一致!"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> },</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"condition"</span>: <span class="cm-string">"#${slaveNew@groupCount.sBusinessType}# === 1"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"commands"</span>: [</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> {</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"opr"</span>: <span class="cm-string">"msg"</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"code"</span>: <span class="cm-number">1</span>,</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> <span class="cm-string cm-property">"msg"</span>: <span class="cm-string">"订单类型校验通过 !"</span></span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> ]</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;"> }</span></pre><pre class=" CodeMirror-line " role="presentation"><span role="presentation" style="padding-right: 0.1px;">]</span></pre></div></div></div></div></div><div style="position: absolute; height: 0px; width: 1px; border-bottom-width: 0px; border-bottom-style: solid; border-bottom-color: transparent; top: 736px;"></div><div class="CodeMirror-gutters" style="display: none; height: 736px;"></div></div></div></pre><p><span> </span></p></div></div> | ||
| 686 | +</body> | ||
| 687 | +</html> | ||
| 0 | \ No newline at end of file | 688 | \ No newline at end of file |
src/component/add.ts
0 → 100644
src/constants/common.tsx
0 → 100644
| 1 | +++ a/src/constants/common.tsx | ||
| 1 | +// 判断条件下拉 | ||
| 2 | +export const CONDITION_DATA = [ | ||
| 3 | + { | ||
| 4 | + label: "等于", | ||
| 5 | + value: "===", | ||
| 6 | + }, | ||
| 7 | + { | ||
| 8 | + label: "不等于", | ||
| 9 | + value: "!=", | ||
| 10 | + }, | ||
| 11 | + | ||
| 12 | + { | ||
| 13 | + label: "大于", | ||
| 14 | + value: ">", | ||
| 15 | + }, | ||
| 16 | + { | ||
| 17 | + label: "小于", | ||
| 18 | + value: "<", | ||
| 19 | + }, | ||
| 20 | + { | ||
| 21 | + label: "大于等于", | ||
| 22 | + value: ">=", | ||
| 23 | + }, | ||
| 24 | + { | ||
| 25 | + label: "小于等于", | ||
| 26 | + value: "<=", | ||
| 27 | + }, | ||
| 28 | + { | ||
| 29 | + label: "包含", | ||
| 30 | + value: "includes", | ||
| 31 | + }, | ||
| 32 | + { | ||
| 33 | + label: "不包含", | ||
| 34 | + value: "!includes", | ||
| 35 | + }, | ||
| 36 | + { | ||
| 37 | + label: "为(空/0)", | ||
| 38 | + value: "empty", | ||
| 39 | + }, | ||
| 40 | + { | ||
| 41 | + label: "不为(空/0)", | ||
| 42 | + value: "!empty", | ||
| 43 | + }, | ||
| 44 | +]; | ||
| 45 | + | ||
| 46 | +// 判断条件下拉 按钮非主表 b类型 | ||
| 47 | +export const CONDITION_DATA_TYPEB = [ | ||
| 48 | + { | ||
| 49 | + label: "全部为true", | ||
| 50 | + value: "trueAll", | ||
| 51 | + }, | ||
| 52 | + { | ||
| 53 | + label: "全部为false", | ||
| 54 | + value: "falseAll", | ||
| 55 | + }, | ||
| 56 | + { | ||
| 57 | + label: "至少一个为true", | ||
| 58 | + value: "trueOne", | ||
| 59 | + }, | ||
| 60 | + { | ||
| 61 | + label: "至少一个为false", | ||
| 62 | + value: "falseOne", | ||
| 63 | + }, | ||
| 64 | +]; | ||
| 65 | + | ||
| 66 | +// 判断条件下拉 按钮非主表 非b类型 | ||
| 67 | +export const CONDITION_DATA_TYPE_NOTB = CONDITION_DATA.reduce((pre, item): any => { | ||
| 68 | + const { label, value } = item; | ||
| 69 | + if (value.includes("includes")) { | ||
| 70 | + return pre; | ||
| 71 | + } | ||
| 72 | + pre.push({ | ||
| 73 | + label: `全部${label}`, | ||
| 74 | + value: `${value}All`, | ||
| 75 | + }); | ||
| 76 | + pre.push({ | ||
| 77 | + label: `至少一个${label}`, | ||
| 78 | + value: `${value}One`, | ||
| 79 | + }); | ||
| 80 | + return pre; | ||
| 81 | +}, []); | ||
| 82 | + | ||
| 83 | +// 且或组件rowValues默认值 | ||
| 84 | +export const INIT_ROW_VALUES = { | ||
| 85 | + pre1: undefined, | ||
| 86 | + value1: "", | ||
| 87 | + condition: undefined, | ||
| 88 | + pre2: undefined, | ||
| 89 | + value2: "", | ||
| 90 | +}; | ||
| 91 | + | ||
| 92 | +// 且或组件表名下拉固定类型 | ||
| 93 | +export const ROW_PRE_OPTIONS = [ | ||
| 94 | + { | ||
| 95 | + label: "字符串", | ||
| 96 | + value: "string", | ||
| 97 | + }, | ||
| 98 | + { | ||
| 99 | + label: "数字", | ||
| 100 | + value: "number", | ||
| 101 | + }, | ||
| 102 | +]; | ||
| 103 | + | ||
| 104 | +// props | ||
| 105 | +export const PROPS_OPTIONS = [ | ||
| 106 | + { | ||
| 107 | + label: "全局变量", | ||
| 108 | + value: "props", | ||
| 109 | + }, | ||
| 110 | +]; | ||
| 111 | + | ||
| 112 | +// 简易筛选数据集 | ||
| 113 | +export const SIMPLE_DATASET_FILTER_OPTIONS = [ | ||
| 114 | + { | ||
| 115 | + label: "全部数据", | ||
| 116 | + value: "", | ||
| 117 | + }, | ||
| 118 | + { | ||
| 119 | + label: "选中数据", | ||
| 120 | + value: "sec", | ||
| 121 | + }, | ||
| 122 | + { | ||
| 123 | + label: "首条数据", | ||
| 124 | + value: "first", | ||
| 125 | + }, | ||
| 126 | + { | ||
| 127 | + label: "末条数据", | ||
| 128 | + value: "last", | ||
| 129 | + }, | ||
| 130 | +]; | ||
| 131 | + | ||
| 132 | +// radio是否选项 | ||
| 133 | +export const RADIO_OPTIONS = [ | ||
| 134 | + { | ||
| 135 | + label: "是", | ||
| 136 | + value: "!empty", | ||
| 137 | + }, | ||
| 138 | + { | ||
| 139 | + label: "否", | ||
| 140 | + value: "empty", | ||
| 141 | + }, | ||
| 142 | +]; |
src/global.less
0 → 100644
| 1 | +++ a/src/global.less | ||
| 1 | +* { | ||
| 2 | + box-sizing: border-box; | ||
| 3 | +} | ||
| 4 | + | ||
| 5 | +html, | ||
| 6 | +body, | ||
| 7 | +#root { | ||
| 8 | + width: 100%; | ||
| 9 | + height: 100%; | ||
| 10 | + padding: 0; | ||
| 11 | + margin: 0; | ||
| 12 | +} | ||
| 13 | + | ||
| 14 | +html { | ||
| 15 | + background: #f6f6f6; | ||
| 16 | +} | ||
| 17 | + | ||
| 18 | +.ant-form-item-extra { | ||
| 19 | + min-height: 0 !important; | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +.dtc-ruleController__item--operation { | ||
| 23 | + width: 50px !important; | ||
| 24 | +} | ||
| 0 | \ No newline at end of file | 25 | \ No newline at end of file |
src/layouts/index.less
0 → 100644
src/layouts/index.tsx
0 → 100644
src/pages/index.less
0 → 100644
| 1 | +++ a/src/pages/index.less | ||
| 1 | +.indexCard { | ||
| 2 | + height: 100%; | ||
| 3 | + | ||
| 4 | + :global { | ||
| 5 | + .ant-card-body { | ||
| 6 | + padding: 0; | ||
| 7 | + height: calc(100% - 38px); | ||
| 8 | + display: flex; | ||
| 9 | + } | ||
| 10 | + } | ||
| 11 | + | ||
| 12 | + .instructionSet { | ||
| 13 | + width: 200px; | ||
| 14 | + height: 100%; | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + .instructionContent { | ||
| 18 | + width: calc(100% - 400px); | ||
| 19 | + height: 100%; | ||
| 20 | + } | ||
| 21 | + | ||
| 22 | + .draggableTree { | ||
| 23 | + width: 100%; | ||
| 24 | + overflow: auto; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + .instructionResult { | ||
| 28 | + width: 200px; | ||
| 29 | + height: 100%; | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | + .collapseItem { | ||
| 33 | + margin-bottom: 0; | ||
| 34 | + background: transparent; | ||
| 35 | + border-radius: 0; | ||
| 36 | + border: none; | ||
| 37 | + | ||
| 38 | + :global { | ||
| 39 | + .ant-collapse-content-box { | ||
| 40 | + padding: 10px 10px 4px 16px !important; | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + .ant-form-item { | ||
| 44 | + margin-bottom: 16px; | ||
| 45 | + } | ||
| 46 | + } | ||
| 47 | + } | ||
| 48 | + | ||
| 49 | + .draggableList { | ||
| 50 | + width: 100%; | ||
| 51 | + height: 100%; | ||
| 52 | + overflow-y: auto; | ||
| 53 | + | ||
| 54 | + :global { | ||
| 55 | + .draggable-item { | ||
| 56 | + width: 100%; | ||
| 57 | + min-height: 50px; | ||
| 58 | + border: 1px solid rgba(0, 0, 0, .125); | ||
| 59 | + padding: 20px; | ||
| 60 | + margin-bottom: 4px; | ||
| 61 | + border-radius: 4px; | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + .draggable-item.lv1 { | ||
| 65 | + background-color: #e6e6e6; | ||
| 66 | + } | ||
| 67 | + | ||
| 68 | + .draggable-item.lv2 { | ||
| 69 | + background-color: #cccccc; | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + .draggable-item-title { | ||
| 73 | + width: 100%; | ||
| 74 | + height: 40px; | ||
| 75 | + } | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + .settingBtn { | ||
| 80 | + position: absolute; | ||
| 81 | + top: 0; | ||
| 82 | + right: 0; | ||
| 83 | + display: flex; | ||
| 84 | + flex-direction: column; | ||
| 85 | + gap: 4px; | ||
| 86 | + width: 25px; | ||
| 87 | + height: auto; | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | +} | ||
| 91 | + | ||
| 92 | +.draggableItemSelected { | ||
| 93 | + background: rgb(140, 204, 228) !important; | ||
| 94 | +} | ||
| 95 | + | ||
| 96 | +// 下拉颜色 | ||
| 97 | +.code1 { | ||
| 98 | + background-color: rgba(34, 197, 94, 0.2) !important; | ||
| 99 | + margin-bottom: 2px; | ||
| 100 | +} | ||
| 101 | + | ||
| 102 | +.code_1 { | ||
| 103 | + background-color: rgba(239, 68, 68, 0.2) !important; | ||
| 104 | + margin-bottom: 2px; | ||
| 105 | +} | ||
| 106 | + | ||
| 107 | +.code_8 { | ||
| 108 | + background-color: rgba(220, 38, 38, 0.3) !important; | ||
| 109 | + margin-bottom: 2px; | ||
| 110 | +} | ||
| 111 | + | ||
| 112 | +.code2 { | ||
| 113 | + background-color: rgba(234, 179, 8, 0.2) !important; | ||
| 114 | + margin-bottom: 2px; | ||
| 115 | +} | ||
| 116 | + | ||
| 117 | +.code_7 { | ||
| 118 | + background-color: rgba(59, 130, 246, 0.2) !important; | ||
| 119 | +} | ||
| 120 | + | ||
| 121 | +.settingModal { | ||
| 122 | + top: 20px; | ||
| 123 | + left: 10px; | ||
| 124 | + width: auto !important; | ||
| 125 | + | ||
| 126 | + :global { | ||
| 127 | + .ant-modal-content { | ||
| 128 | + margin: 0; | ||
| 129 | + width: calc(100vw - 50px); | ||
| 130 | + height: calc(100vh - 50px); | ||
| 131 | + } | ||
| 132 | + } | ||
| 133 | +} | ||
| 134 | + | ||
| 135 | +// .settingModal { | ||
| 136 | +// width: calc(100vw - 20px); | ||
| 137 | +// height: calc(100vh - 100px); | ||
| 138 | +// } | ||
| 0 | \ No newline at end of file | 139 | \ No newline at end of file |
src/pages/index.tsx
0 → 100644
| 1 | +++ a/src/pages/index.tsx | ||
| 1 | +import { createContext, useReducer, useContext, useEffect, useRef, useState, useMemo } from "react"; | ||
| 2 | +import { | ||
| 3 | + Card, | ||
| 4 | + Collapse, | ||
| 5 | + List, | ||
| 6 | + Form, | ||
| 7 | + Input, | ||
| 8 | + InputNumber, | ||
| 9 | + Button, | ||
| 10 | + Select, | ||
| 11 | + Radio, | ||
| 12 | + Space, | ||
| 13 | + Table, | ||
| 14 | + Checkbox, | ||
| 15 | + Divider, | ||
| 16 | + Modal, | ||
| 17 | + Tree, | ||
| 18 | + message, | ||
| 19 | +} from "antd"; | ||
| 20 | +import { | ||
| 21 | + PlusOutlined, | ||
| 22 | + MinusCircleOutlined, | ||
| 23 | + FileSearchOutlined, | ||
| 24 | + SettingOutlined, | ||
| 25 | +} from "@ant-design/icons"; | ||
| 26 | +import { cloneDeep, cond, set } from "lodash"; | ||
| 27 | +import Sortable from "sortablejs"; | ||
| 28 | +import { FilterRules } from "dt-react-component"; | ||
| 29 | +import styles from "./index.less"; | ||
| 30 | + | ||
| 31 | +import type { InstructionItem, ContextType } from "./type"; | ||
| 32 | +import { shortid } from "../utils/utils"; | ||
| 33 | +import { | ||
| 34 | + CONDITION_DATA, | ||
| 35 | + CONDITION_DATA_TYPEB, | ||
| 36 | + CONDITION_DATA_TYPE_NOTB, | ||
| 37 | + INIT_ROW_VALUES, | ||
| 38 | + ROW_PRE_OPTIONS, | ||
| 39 | + PROPS_OPTIONS, | ||
| 40 | + SIMPLE_DATASET_FILTER_OPTIONS, | ||
| 41 | + RADIO_OPTIONS, | ||
| 42 | +} from "../constants/common"; | ||
| 43 | + | ||
| 44 | +const initValues = { | ||
| 45 | + baseList: [ | ||
| 46 | + { | ||
| 47 | + title: "条件判断", | ||
| 48 | + key: "ifdo", | ||
| 49 | + component: (props: any) => <FormIfdo {...props} />, | ||
| 50 | + }, | ||
| 51 | + { | ||
| 52 | + title: "新增", | ||
| 53 | + key: "add", | ||
| 54 | + component: (props: any) => <FormAdd {...props} />, | ||
| 55 | + }, | ||
| 56 | + { | ||
| 57 | + title: "修改", | ||
| 58 | + key: "edit", | ||
| 59 | + component: (props: any) => <FormEdit {...props} />, | ||
| 60 | + bFullMode: true, | ||
| 61 | + }, | ||
| 62 | + { | ||
| 63 | + title: "删除", | ||
| 64 | + key: "del", | ||
| 65 | + component: (props: any) => <FormDel {...props} />, | ||
| 66 | + bFullMode: true, | ||
| 67 | + }, | ||
| 68 | + { | ||
| 69 | + title: "复制", | ||
| 70 | + key: "copy", | ||
| 71 | + component: (props: any) => <FormCopy {...props} />, | ||
| 72 | + bFullMode: true, | ||
| 73 | + }, | ||
| 74 | + { | ||
| 75 | + title: "保存", | ||
| 76 | + key: "save", | ||
| 77 | + component: (props: any) => <FormSave {...props} />, | ||
| 78 | + }, | ||
| 79 | + { | ||
| 80 | + title: "过滤", | ||
| 81 | + key: "filter", | ||
| 82 | + component: (props: any) => <FormFilter {...props} />, | ||
| 83 | + bFullMode: true, | ||
| 84 | + }, | ||
| 85 | + { | ||
| 86 | + title: "创建新数据集", | ||
| 87 | + key: "newempty", | ||
| 88 | + component: (props: any) => <FormNewempty {...props} />, | ||
| 89 | + }, | ||
| 90 | + { | ||
| 91 | + title: "清空数据集", | ||
| 92 | + key: "emptyAll", | ||
| 93 | + component: (props: any) => <FormEmptyAll {...props} />, | ||
| 94 | + }, | ||
| 95 | + { | ||
| 96 | + title: "刷新数据集", | ||
| 97 | + key: "refresh", | ||
| 98 | + component: (props: any) => <FormRefresh {...props} />, | ||
| 99 | + }, | ||
| 100 | + { | ||
| 101 | + title: "清空选中行", | ||
| 102 | + key: "clearrowkey", | ||
| 103 | + component: (props: any) => <FormClearRowKey {...props} />, | ||
| 104 | + }, | ||
| 105 | + { | ||
| 106 | + title: "选中表格第一行", | ||
| 107 | + key: "selectfirstline", | ||
| 108 | + component: (props: any) => <FormSelectFirstLine {...props} />, | ||
| 109 | + }, | ||
| 110 | + ], | ||
| 111 | + funList: [ | ||
| 112 | + { | ||
| 113 | + title: "打印", | ||
| 114 | + key: "print", | ||
| 115 | + component: (props: any) => <FormPrint {...props} />, | ||
| 116 | + }, | ||
| 117 | + { | ||
| 118 | + title: "查询sql", | ||
| 119 | + key: "opensql", | ||
| 120 | + component: (props: any) => <FormOpenSql {...props} />, | ||
| 121 | + }, | ||
| 122 | + { | ||
| 123 | + title: "执行sql", | ||
| 124 | + key: "exesql", | ||
| 125 | + component: (props: any) => <FormExesql {...props} />, | ||
| 126 | + }, | ||
| 127 | + { | ||
| 128 | + title: "提示信息", | ||
| 129 | + key: "msg", | ||
| 130 | + component: (props: any) => <FormMsg {...props} />, | ||
| 131 | + }, | ||
| 132 | + ], | ||
| 133 | + btnsList: [ | ||
| 134 | + { | ||
| 135 | + title: "工具栏按钮配置", | ||
| 136 | + key: "btnhandle", | ||
| 137 | + component: (props: any) => <FormBtnHandle {...props} />, | ||
| 138 | + }, | ||
| 139 | + ], | ||
| 140 | + instructionList: [], // 步骤列表 | ||
| 141 | + settingPorps: {}, | ||
| 142 | +}; | ||
| 143 | + | ||
| 144 | +const myContext = createContext<ContextType>(null as any); | ||
| 145 | +const reducer = (state: any, action: [any, any]) => { | ||
| 146 | + const [type, payload] = action; | ||
| 147 | + switch (type) { | ||
| 148 | + case "saveState": | ||
| 149 | + return { | ||
| 150 | + ...state, | ||
| 151 | + ...payload, | ||
| 152 | + }; | ||
| 153 | + default: | ||
| 154 | + return { | ||
| 155 | + ...state, | ||
| 156 | + ...payload, | ||
| 157 | + }; | ||
| 158 | + } | ||
| 159 | +}; | ||
| 160 | + | ||
| 161 | +const oThis: any = { | ||
| 162 | + activeJson: {}, | ||
| 163 | +}; | ||
| 164 | + | ||
| 165 | +const convertData2Str = (dataValue: any, bList: boolean) => { | ||
| 166 | + const { type, children = [] } = dataValue; | ||
| 167 | + const childrenFilter = children.filter((child: any) => { | ||
| 168 | + if (child.children?.length) { | ||
| 169 | + return true; | ||
| 170 | + } | ||
| 171 | + if (child.rowValues) { | ||
| 172 | + const { pre1, value1, condition, pre2 } = child.rowValues; | ||
| 173 | + return ( | ||
| 174 | + child.children || | ||
| 175 | + (pre1 === "custom" && value1 !== undefined) || | ||
| 176 | + (pre1 && | ||
| 177 | + condition && | ||
| 178 | + (pre2 || | ||
| 179 | + condition?.includes("empty") || | ||
| 180 | + condition?.includes("All") || | ||
| 181 | + condition?.includes("One"))) | ||
| 182 | + ); | ||
| 183 | + } | ||
| 184 | + return false; | ||
| 185 | + }); | ||
| 186 | + | ||
| 187 | + if (bList) { | ||
| 188 | + const result = [ | ||
| 189 | + ...childrenFilter.map((child: any) => { | ||
| 190 | + if (child.children) { | ||
| 191 | + return convertData2Str(child, bList); | ||
| 192 | + } else { | ||
| 193 | + const { pre1, value1, condition, pre2, value2 } = child.rowValues; | ||
| 194 | + return [pre1, value1, condition, pre2, value2]; | ||
| 195 | + } | ||
| 196 | + }), | ||
| 197 | + type, | ||
| 198 | + ]; | ||
| 199 | + | ||
| 200 | + return result; | ||
| 201 | + } | ||
| 202 | + | ||
| 203 | + return childrenFilter | ||
| 204 | + .map((child: any) => { | ||
| 205 | + if (child.children) { | ||
| 206 | + return `(${convertData2Str(child, bList)})`; | ||
| 207 | + } else { | ||
| 208 | + const { pre1, value1, condition, pre2, value2 } = child.rowValues; | ||
| 209 | + let key1 = ""; | ||
| 210 | + let key2 = ""; | ||
| 211 | + if (pre1 === "number" || pre1 === "boolean") { | ||
| 212 | + key1 = value1; | ||
| 213 | + } else if (pre1 === "string") { | ||
| 214 | + key1 = `'${value1}'`; | ||
| 215 | + } else { | ||
| 216 | + if ( | ||
| 217 | + value1?.startsWith("i") || | ||
| 218 | + value1?.startsWith("d") || | ||
| 219 | + value1?.startsWith("b") || | ||
| 220 | + value1 === "enabled" | ||
| 221 | + ) { | ||
| 222 | + key1 = `\${${pre1}.${value1}}`; | ||
| 223 | + } else { | ||
| 224 | + key1 = `'\${${pre1}.${value1}}'`; | ||
| 225 | + } | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | + if (pre2 === "number" || pre2 === "boolean") { | ||
| 229 | + key2 = value2; | ||
| 230 | + } else if (pre2 === "string") { | ||
| 231 | + key2 = `'${value2}'`; | ||
| 232 | + } else { | ||
| 233 | + if ( | ||
| 234 | + value2?.startsWith("i") || | ||
| 235 | + value2?.startsWith("d") || | ||
| 236 | + value2?.startsWith("b") || | ||
| 237 | + value2 === "enabled" | ||
| 238 | + ) { | ||
| 239 | + key2 = `\${${pre2}.${value2}}`; | ||
| 240 | + } else { | ||
| 241 | + key2 = `'\${${pre2}.${value2}}'`; | ||
| 242 | + } | ||
| 243 | + } | ||
| 244 | + | ||
| 245 | + if (condition === "includes") { | ||
| 246 | + return `${key1}.includes(${key2})`; | ||
| 247 | + } else if (condition === "!includes") { | ||
| 248 | + return `!${key1}.includes(${key2})`; | ||
| 249 | + } else if (condition === "empty") { | ||
| 250 | + return `!${key1}`; | ||
| 251 | + } else if (condition === "!empty") { | ||
| 252 | + return `!!${key1}`; | ||
| 253 | + } else if (condition === "trueAll") { | ||
| 254 | + return `$\{${pre1}@all.${value1}.===.true\}`; | ||
| 255 | + } else if (condition === "trueOne") { | ||
| 256 | + return `$\{${pre1}@one.${value1}.===.true\}`; | ||
| 257 | + } else if (condition === "falseAll") { | ||
| 258 | + return `$\{${pre1}@all.${value1}.===.false\}`; | ||
| 259 | + } else if (condition === "falseOne") { | ||
| 260 | + return `$\{${pre1}@one.${value1}.===.false\}`; | ||
| 261 | + } else if (condition.includes("All")) { | ||
| 262 | + let conditionNew = condition.replace("All", ""); | ||
| 263 | + if (conditionNew === "!empty") { | ||
| 264 | + conditionNew = "!="; | ||
| 265 | + } else if (conditionNew === "empty") { | ||
| 266 | + conditionNew = "=="; | ||
| 267 | + } | ||
| 268 | + return `$\{${pre1}@all.${value1}.${conditionNew}.${value2}\}`; | ||
| 269 | + } else if (condition.includes("One")) { | ||
| 270 | + let conditionNew = condition.replace("One", ""); | ||
| 271 | + if (conditionNew === "!empty") { | ||
| 272 | + conditionNew = "!="; | ||
| 273 | + } else if (conditionNew === "empty") { | ||
| 274 | + conditionNew = "=="; | ||
| 275 | + } | ||
| 276 | + return `$\{${pre1}@one.${value1}.${conditionNew}.${value2}\}`; | ||
| 277 | + } else if (pre1 === "custom") { | ||
| 278 | + return value1; | ||
| 279 | + } else { | ||
| 280 | + return `${key1} ${condition} ${key2}`; | ||
| 281 | + } | ||
| 282 | + } | ||
| 283 | + }) | ||
| 284 | + .join(` ${type === 1 ? "&&" : "||"} `); | ||
| 285 | +}; | ||
| 286 | + | ||
| 287 | +const convertStr2Data = (arr: any, level: number = 1) => { | ||
| 288 | + const type = arr.find((item: any) => typeof item === "number"); | ||
| 289 | + const restArr = arr.filter((item: any) => typeof item !== "number"); | ||
| 290 | + | ||
| 291 | + return { | ||
| 292 | + key: shortid(), | ||
| 293 | + level: level, | ||
| 294 | + type, | ||
| 295 | + children: restArr.map((child: any) => { | ||
| 296 | + if (child.some((item: any) => typeof item === "number")) { | ||
| 297 | + return convertStr2Data(child, level + 1); | ||
| 298 | + } else { | ||
| 299 | + return { | ||
| 300 | + rowValues: { | ||
| 301 | + pre1: child[0], | ||
| 302 | + value1: child[1], | ||
| 303 | + condition: child[2], | ||
| 304 | + pre2: child[3], | ||
| 305 | + value2: child[4], | ||
| 306 | + }, | ||
| 307 | + key: shortid(), | ||
| 308 | + level: level, | ||
| 309 | + }; | ||
| 310 | + } | ||
| 311 | + }), | ||
| 312 | + }; | ||
| 313 | +}; | ||
| 314 | + | ||
| 315 | +// 入口 | ||
| 316 | +const Index = () => { | ||
| 317 | + const [state, dispatch] = useReducer(reducer, initValues); | ||
| 318 | + const setState = (payload: any) => { | ||
| 319 | + dispatch(["saveState", payload]); | ||
| 320 | + }; | ||
| 321 | + | ||
| 322 | + return ( | ||
| 323 | + <myContext.Provider | ||
| 324 | + value={{ | ||
| 325 | + setState, | ||
| 326 | + ...state, | ||
| 327 | + }} | ||
| 328 | + > | ||
| 329 | + <Card | ||
| 330 | + title={ | ||
| 331 | + <div> | ||
| 332 | + 指令集可视化{" "} | ||
| 333 | + <FileSearchOutlined | ||
| 334 | + onClick={() => { | ||
| 335 | + const screenWidth = window.screen.width; | ||
| 336 | + const screenHeight = window.screen.height; | ||
| 337 | + window.open( | ||
| 338 | + location.origin + "/InsSet/指令集说明文档.html", | ||
| 339 | + "指令集说明文档", | ||
| 340 | + `width=${screenWidth},height=${screenHeight},left=0,top=0` | ||
| 341 | + ); | ||
| 342 | + }} | ||
| 343 | + /> | ||
| 344 | + </div> | ||
| 345 | + } | ||
| 346 | + className={styles.indexCard} | ||
| 347 | + > | ||
| 348 | + <Card title="指令集列表" className={styles.instructionSet}> | ||
| 349 | + <InstructionSetList /> | ||
| 350 | + </Card> | ||
| 351 | + <Card title="指令集内容" className={styles.instructionContent}> | ||
| 352 | + <InstructionContent /> | ||
| 353 | + </Card> | ||
| 354 | + <Card title="指令集结果" className={styles.instructionResult}> | ||
| 355 | + <InstructionResult /> | ||
| 356 | + </Card> | ||
| 357 | + </Card> | ||
| 358 | + <SettingModal /> | ||
| 359 | + </myContext.Provider> | ||
| 360 | + ); | ||
| 361 | +}; | ||
| 362 | + | ||
| 363 | +// 左侧列表区域 | ||
| 364 | +const InstructionSetList = () => { | ||
| 365 | + const { tableName, sFieldName, baseList, funList, btnsList, instructionList, setState } = | ||
| 366 | + useContext(myContext); | ||
| 367 | + | ||
| 368 | + const addInstruction = (item: any) => { | ||
| 369 | + instructionList.push({ ...item, type: item.key, key: shortid(), mode: "easy" }); | ||
| 370 | + setState({ instructionList }); | ||
| 371 | + }; | ||
| 372 | + | ||
| 373 | + const ListItem = (item: any) => { | ||
| 374 | + return ( | ||
| 375 | + <List.Item style={{ cursor: "default" }} onClick={addInstruction.bind(this, item)}> | ||
| 376 | + {item.title} | ||
| 377 | + </List.Item> | ||
| 378 | + ); | ||
| 379 | + }; | ||
| 380 | + | ||
| 381 | + let items = []; | ||
| 382 | + | ||
| 383 | + if (tableName === "master" && sFieldName === "sInstruct") { | ||
| 384 | + items = [ | ||
| 385 | + { | ||
| 386 | + key: "3", | ||
| 387 | + label: "按钮指令集", | ||
| 388 | + children: <List split={false} dataSource={btnsList} renderItem={item => ListItem(item)} />, | ||
| 389 | + className: styles.collapseItem, | ||
| 390 | + }, | ||
| 391 | + ]; | ||
| 392 | + } else { | ||
| 393 | + items = [ | ||
| 394 | + { | ||
| 395 | + key: "1", | ||
| 396 | + label: " 基础指令集", | ||
| 397 | + children: <List split={false} dataSource={baseList} renderItem={item => ListItem(item)} />, | ||
| 398 | + className: styles.collapseItem, | ||
| 399 | + }, | ||
| 400 | + { | ||
| 401 | + key: "2", | ||
| 402 | + label: "功能指令集", | ||
| 403 | + children: <List split={false} dataSource={funList} renderItem={item => ListItem(item)} />, | ||
| 404 | + className: styles.collapseItem, | ||
| 405 | + }, | ||
| 406 | + ]; | ||
| 407 | + } | ||
| 408 | + | ||
| 409 | + return ( | ||
| 410 | + <Collapse | ||
| 411 | + bordered={false} | ||
| 412 | + defaultActiveKey={["1", "2", "3"]} | ||
| 413 | + style={{ background: "transparent", overflow: "auto", width: "100%" }} | ||
| 414 | + items={items} | ||
| 415 | + /> | ||
| 416 | + ); | ||
| 417 | +}; | ||
| 418 | + | ||
| 419 | +const getTargetParentAndIndex = ( | ||
| 420 | + arr: InstructionItem[], | ||
| 421 | + path: number[] | ||
| 422 | +): { parentArr: InstructionItem[]; targetIndex: number; targetItem: InstructionItem } | null => { | ||
| 423 | + let current: any = { children: arr }; | ||
| 424 | + for (let i = 0; i < path.length - 1; i++) { | ||
| 425 | + const index = path[i]; | ||
| 426 | + if (!Array.isArray(current.children) || !current.children[index]) return null; | ||
| 427 | + current = current.children[index]; | ||
| 428 | + } | ||
| 429 | + const targetIndex = path[path.length - 1]; | ||
| 430 | + const parentArr = current.children || []; | ||
| 431 | + const targetItem = parentArr[targetIndex]; | ||
| 432 | + return { parentArr, targetIndex, targetItem }; | ||
| 433 | +}; | ||
| 434 | + | ||
| 435 | +const updateInstructionListByMove = ( | ||
| 436 | + instructionList: InstructionItem[], | ||
| 437 | + fromPath: number[], // 被移动项的原始路径,如 [0, 1, 1] | ||
| 438 | + toPath: number[], // 目标插入位置路径,如 [0, 1, 2] | ||
| 439 | + insertIndex: number // 插入到该层级下的哪个索引 | ||
| 440 | +): InstructionItem[] => { | ||
| 441 | + const deepClone = cloneDeep(instructionList) as InstructionItem[]; | ||
| 442 | + | ||
| 443 | + // Step 1: 获取要删除的节点及其父级数组和索引 | ||
| 444 | + const deleteInfo = getTargetParentAndIndex(deepClone, fromPath); | ||
| 445 | + | ||
| 446 | + if (!deleteInfo) return instructionList; | ||
| 447 | + | ||
| 448 | + const { parentArr: deleteParent, targetIndex: deleteIndex, targetItem } = deleteInfo; | ||
| 449 | + | ||
| 450 | + // Step 2: 删除节点 | ||
| 451 | + const deletedItem = deleteParent.splice(deleteIndex, 1)[0]; | ||
| 452 | + | ||
| 453 | + // Step 3: 获取插入位置的父级数组 | ||
| 454 | + const insertInfo = getTargetParentAndIndex(deepClone, toPath); | ||
| 455 | + if (!insertInfo) return instructionList; | ||
| 456 | + | ||
| 457 | + const { parentArr: insertParent } = insertInfo; | ||
| 458 | + | ||
| 459 | + // Step 4: 插入节点到指定位置 | ||
| 460 | + insertParent.splice(insertIndex, 0, deletedItem); | ||
| 461 | + | ||
| 462 | + return deepClone; | ||
| 463 | +}; | ||
| 464 | + | ||
| 465 | +const InstructionContent = () => { | ||
| 466 | + const { instructionList, setState } = useContext(myContext); | ||
| 467 | + | ||
| 468 | + const [treeData, setTreeData] = useState([]); | ||
| 469 | + useEffect(() => { | ||
| 470 | + const treeData = instructionList.map(item => { | ||
| 471 | + // 递归处理子节点 | ||
| 472 | + const processChildren = (nodeItem: any): any => { | ||
| 473 | + const treeNode: any = { | ||
| 474 | + title: <InstructionDetail item={nodeItem} />, | ||
| 475 | + key: nodeItem.key, | ||
| 476 | + // 只有特定类型的节点才允许添加子节点,比如"条件判断" | ||
| 477 | + bDropTo: nodeItem.title === "条件判断" || nodeItem.type === "ifdo", | ||
| 478 | + }; | ||
| 479 | + | ||
| 480 | + // 如果有子节点,递归处理 | ||
| 481 | + if (nodeItem.children && nodeItem.children.length > 0) { | ||
| 482 | + treeNode.children = nodeItem.children.map((child: any) => processChildren(child)); | ||
| 483 | + } | ||
| 484 | + | ||
| 485 | + return treeNode; | ||
| 486 | + }; | ||
| 487 | + | ||
| 488 | + return processChildren(item); | ||
| 489 | + }) as any; | ||
| 490 | + | ||
| 491 | + setTreeData(treeData); | ||
| 492 | + }, [JSON.stringify(instructionList)]); | ||
| 493 | + | ||
| 494 | + const [expandedKeys, setExpandedKeys] = useState<any[]>([]); | ||
| 495 | + const onDrop = (info: any) => { | ||
| 496 | + const dropKey = info.node.key; | ||
| 497 | + const dragKey = info.dragNode.key; | ||
| 498 | + const dropPos = info.node.pos.split("-"); | ||
| 499 | + const dropPosition = info.dropPosition - Number(dropPos[dropPos.length - 1]); | ||
| 500 | + | ||
| 501 | + // 如果节点被放入另一个节点内部,则将其加入展开列表 | ||
| 502 | + if (!info.dropToGap) { | ||
| 503 | + setExpandedKeys(prev => [...new Set([...prev, dropKey])]); | ||
| 504 | + } | ||
| 505 | + | ||
| 506 | + // 克隆当前 instructionList | ||
| 507 | + const newData = cloneDeep(instructionList); | ||
| 508 | + | ||
| 509 | + // 查找拖拽节点和目标节点 | ||
| 510 | + let dragItem: any = null; | ||
| 511 | + let dragParent: any[] = newData; | ||
| 512 | + let dragIndex = -1; | ||
| 513 | + | ||
| 514 | + const findDragItem = (items: any[], parent: any[], index: number) => { | ||
| 515 | + for (let i = 0; i < items.length; i++) { | ||
| 516 | + if (items[i].key === dragKey) { | ||
| 517 | + dragItem = items[i]; | ||
| 518 | + dragParent = parent; | ||
| 519 | + dragIndex = i; | ||
| 520 | + return true; | ||
| 521 | + } | ||
| 522 | + if (items[i].children) { | ||
| 523 | + if (findDragItem(items[i].children, items[i].children, i)) { | ||
| 524 | + return true; | ||
| 525 | + } | ||
| 526 | + } | ||
| 527 | + } | ||
| 528 | + return false; | ||
| 529 | + }; | ||
| 530 | + | ||
| 531 | + findDragItem(newData, newData, -1); | ||
| 532 | + | ||
| 533 | + // 从原位置删除拖拽节点 | ||
| 534 | + if (dragItem) { | ||
| 535 | + dragParent.splice(dragIndex, 1); | ||
| 536 | + } | ||
| 537 | + | ||
| 538 | + // 查找目标节点并插入 | ||
| 539 | + if (!info.dropToGap) { | ||
| 540 | + // 插入为子节点 | ||
| 541 | + const insertIntoChildren = (items: any[]) => { | ||
| 542 | + for (let i = 0; i < items.length; i++) { | ||
| 543 | + if (items[i].key === dropKey) { | ||
| 544 | + if (!items[i].children) { | ||
| 545 | + items[i].children = []; | ||
| 546 | + } | ||
| 547 | + items[i].children.unshift(dragItem); | ||
| 548 | + return true; | ||
| 549 | + } | ||
| 550 | + if (items[i].children) { | ||
| 551 | + if (insertIntoChildren(items[i].children)) { | ||
| 552 | + return true; | ||
| 553 | + } | ||
| 554 | + } | ||
| 555 | + } | ||
| 556 | + return false; | ||
| 557 | + }; | ||
| 558 | + | ||
| 559 | + insertIntoChildren(newData); | ||
| 560 | + } else { | ||
| 561 | + // 插入为兄弟节点 | ||
| 562 | + const insertAsSibling = (items: any[]) => { | ||
| 563 | + for (let i = 0; i < items.length; i++) { | ||
| 564 | + if (items[i].key === dropKey) { | ||
| 565 | + const parent = items === newData ? newData : items; | ||
| 566 | + const dropIndex = parent.indexOf(items[i]); | ||
| 567 | + const insertIndex = dropPosition === -1 ? dropIndex : dropIndex + 1; | ||
| 568 | + parent.splice(insertIndex, 0, dragItem); | ||
| 569 | + return true; | ||
| 570 | + } | ||
| 571 | + if (items[i].children) { | ||
| 572 | + if (insertAsSibling(items[i].children)) { | ||
| 573 | + return true; | ||
| 574 | + } | ||
| 575 | + } | ||
| 576 | + } | ||
| 577 | + return false; | ||
| 578 | + }; | ||
| 579 | + | ||
| 580 | + insertAsSibling(newData); | ||
| 581 | + } | ||
| 582 | + | ||
| 583 | + // 更新 instructionList | ||
| 584 | + setState({ instructionList: newData }); | ||
| 585 | + }; | ||
| 586 | + | ||
| 587 | + return ( | ||
| 588 | + <Tree | ||
| 589 | + className={styles.draggableTree} | ||
| 590 | + defaultExpandAll | ||
| 591 | + expandedKeys={expandedKeys} | ||
| 592 | + onExpand={setExpandedKeys} | ||
| 593 | + draggable={{ | ||
| 594 | + icon: false, | ||
| 595 | + }} | ||
| 596 | + allowDrop={info => { | ||
| 597 | + // 根据节点的自定义属性判断 | ||
| 598 | + if (info.dropPosition === 0) { | ||
| 599 | + const { bDropTo } = info.dropNode; | ||
| 600 | + return !!bDropTo; | ||
| 601 | + } | ||
| 602 | + return true; | ||
| 603 | + }} | ||
| 604 | + blockNode | ||
| 605 | + showLine | ||
| 606 | + onDrop={onDrop} | ||
| 607 | + treeData={treeData} | ||
| 608 | + /> | ||
| 609 | + ); | ||
| 610 | +}; | ||
| 611 | + | ||
| 612 | +// 中间内容区域 | ||
| 613 | +const InstructionContent1 = () => { | ||
| 614 | + const { instructionList, setState } = useContext(myContext); | ||
| 615 | + | ||
| 616 | + const listRef = useRef<any>(null); | ||
| 617 | + const instructionListRef = useRef<any>(null); | ||
| 618 | + | ||
| 619 | + useEffect(() => { | ||
| 620 | + instructionListRef.current = instructionList; | ||
| 621 | + }, [JSON.stringify(instructionList)]); | ||
| 622 | + | ||
| 623 | + useEffect(() => { | ||
| 624 | + const oDom = listRef.current as HTMLElement; | ||
| 625 | + new Sortable(oDom, { | ||
| 626 | + group: "instructionGroup", // 分组 | ||
| 627 | + animation: 150, // 动画时间 | ||
| 628 | + ghostClass: styles.draggableItemSelected, // 移动行样式 | ||
| 629 | + handle: ".ant-collapse-header", | ||
| 630 | + draggable: ".draggable-item", | ||
| 631 | + onEnd: evt => { | ||
| 632 | + const { from, to, oldIndex, newIndex, item } = evt; | ||
| 633 | + | ||
| 634 | + // 根据item的data-id获取数据并删除 | ||
| 635 | + const dataId = item.getAttribute("data-id") as String; | ||
| 636 | + const fromPath = dataId | ||
| 637 | + .split("-") | ||
| 638 | + .filter((_, index) => index > 0) | ||
| 639 | + .map(Number); | ||
| 640 | + | ||
| 641 | + // 根据to的data-id获取数据并添加到newIndex位置 | ||
| 642 | + const toDataId = to.getAttribute("data-id") as String; | ||
| 643 | + const toPath = toDataId.split("-").map(Number); | ||
| 644 | + | ||
| 645 | + const instructionListNew = updateInstructionListByMove( | ||
| 646 | + instructionListRef.current, | ||
| 647 | + fromPath, | ||
| 648 | + toPath, | ||
| 649 | + newIndex as number | ||
| 650 | + ); | ||
| 651 | + setState({ instructionList: instructionListNew }); | ||
| 652 | + }, | ||
| 653 | + }); | ||
| 654 | + }, []); | ||
| 655 | + | ||
| 656 | + const RecursiveItem = ({ item, level, index }: { item: any; level: number; index: number }) => { | ||
| 657 | + const currentLevelClass = `draggable-item lv${level}`; | ||
| 658 | + const dataId = `${level - 1}-${index}`; | ||
| 659 | + | ||
| 660 | + return ( | ||
| 661 | + <div className={currentLevelClass} data-id={dataId}> | ||
| 662 | + <InstructionDetail item={item} dataId={dataId} /> | ||
| 663 | + {item.children && item.children.length > 0 && ( | ||
| 664 | + <div> | ||
| 665 | + {item.children.map((child: any, index1: number) => ( | ||
| 666 | + <RecursiveItem key={child.key} item={child} level={level + 1} index={index1} /> | ||
| 667 | + ))} | ||
| 668 | + </div> | ||
| 669 | + )} | ||
| 670 | + </div> | ||
| 671 | + ); | ||
| 672 | + }; | ||
| 673 | + | ||
| 674 | + return ( | ||
| 675 | + <div className={styles.draggableList} data-id="0" ref={listRef}> | ||
| 676 | + {instructionList.map((item: any, index) => ( | ||
| 677 | + <RecursiveItem key={item.key} item={item} level={1} index={index} /> | ||
| 678 | + ))} | ||
| 679 | + </div> | ||
| 680 | + ); | ||
| 681 | +}; | ||
| 682 | + | ||
| 683 | +// 中间内容区域-具体组件 | ||
| 684 | +const InstructionDetail = (props: any) => { | ||
| 685 | + const { item, dataId } = props; | ||
| 686 | + | ||
| 687 | + const contentData = useContext(myContext); | ||
| 688 | + const { instructionList, setState } = contentData; | ||
| 689 | + | ||
| 690 | + const [activeKey, setActiveKey] = useState(oThis.activeJson[item.key] || [item.key]); | ||
| 691 | + const setInstructionMode = (value: string) => { | ||
| 692 | + const { instructionListNew, targetItem } = handleGetChangeData({ ...contentData, ...props }); | ||
| 693 | + targetItem.mode = value; | ||
| 694 | + setState({ instructionList: instructionListNew }); | ||
| 695 | + }; | ||
| 696 | + let lableTitle = item.content?.desDataset || item.content?.srcDataset; | ||
| 697 | + if (item.type === "print") { | ||
| 698 | + lableTitle = `${item.content?.reportName || ""}${item.content?.reportType || ""}`; | ||
| 699 | + } | ||
| 700 | + let label = `${item.title}${lableTitle ? `【${lableTitle}】` : ""}`; | ||
| 701 | + | ||
| 702 | + if (item.type === "opensql") { | ||
| 703 | + label = `${item.title}${ | ||
| 704 | + item.content?.newDataset ? `-> 保存到【${item.content.newDataset}】` : "" | ||
| 705 | + }`; | ||
| 706 | + } | ||
| 707 | + | ||
| 708 | + return ( | ||
| 709 | + <div className={styles.collapseItem} key={item.key}> | ||
| 710 | + <Collapse | ||
| 711 | + activeKey={activeKey} | ||
| 712 | + onChange={(keys: string[]) => { | ||
| 713 | + setTimeout(() => { | ||
| 714 | + if (oThis.changeMode) { | ||
| 715 | + oThis.changeMode = false; | ||
| 716 | + return; | ||
| 717 | + } | ||
| 718 | + setActiveKey(keys); | ||
| 719 | + oThis.activeJson[item.key] = keys; | ||
| 720 | + }, 10); | ||
| 721 | + }} | ||
| 722 | + items={[ | ||
| 723 | + { | ||
| 724 | + key: item.key, | ||
| 725 | + label, | ||
| 726 | + extra: ( | ||
| 727 | + <Space> | ||
| 728 | + {item.bFullMode && ( | ||
| 729 | + <Radio.Group | ||
| 730 | + value={item.mode} | ||
| 731 | + options={[ | ||
| 732 | + { value: "easy", label: "简易模式" }, | ||
| 733 | + { value: "full", label: "高级模式" }, | ||
| 734 | + ]} | ||
| 735 | + onChange={e => { | ||
| 736 | + oThis.changeMode = true; | ||
| 737 | + setInstructionMode(e.target.value); | ||
| 738 | + }} | ||
| 739 | + /> | ||
| 740 | + )} | ||
| 741 | + | ||
| 742 | + <Button | ||
| 743 | + type="link" | ||
| 744 | + onClick={event => { | ||
| 745 | + event.stopPropagation(); | ||
| 746 | + handleUpdateData({ ...props, ...contentData }, "delete"); | ||
| 747 | + }} | ||
| 748 | + > | ||
| 749 | + 删除 | ||
| 750 | + </Button> | ||
| 751 | + </Space> | ||
| 752 | + ), | ||
| 753 | + children: item.component(props), | ||
| 754 | + }, | ||
| 755 | + ]} | ||
| 756 | + /> | ||
| 757 | + </div> | ||
| 758 | + ); | ||
| 759 | +}; | ||
| 760 | + | ||
| 761 | +// 右侧结果区域 | ||
| 762 | +const InstructionResult = () => { | ||
| 763 | + const { | ||
| 764 | + instructionList, | ||
| 765 | + setState, | ||
| 766 | + baseList, | ||
| 767 | + funList, | ||
| 768 | + btnsList, | ||
| 769 | + configList = [], | ||
| 770 | + srcModelsList = [], | ||
| 771 | + } = useContext(myContext); | ||
| 772 | + | ||
| 773 | + const outputContent = instructionList | ||
| 774 | + .filter(item => item.content) | ||
| 775 | + .map(item => { | ||
| 776 | + if (item.children && item.children.length > 0) { | ||
| 777 | + const processChildren = (children: any[]): any[] => { | ||
| 778 | + return children | ||
| 779 | + .map(child => { | ||
| 780 | + if (child.content) { | ||
| 781 | + if (child.children && child.children.length > 0) { | ||
| 782 | + return { | ||
| 783 | + ...child.content, | ||
| 784 | + conditions: [ | ||
| 785 | + { | ||
| 786 | + condition: child.content.condition, | ||
| 787 | + commands: processChildren(child.children), | ||
| 788 | + }, | ||
| 789 | + ], | ||
| 790 | + }; | ||
| 791 | + } | ||
| 792 | + return child.content; | ||
| 793 | + } | ||
| 794 | + return null; | ||
| 795 | + }) | ||
| 796 | + .filter(Boolean); | ||
| 797 | + }; | ||
| 798 | + | ||
| 799 | + return { | ||
| 800 | + ...item.content, | ||
| 801 | + conditions: [ | ||
| 802 | + { | ||
| 803 | + condition: item.content.condition, | ||
| 804 | + commands: processChildren(item.children), | ||
| 805 | + }, | ||
| 806 | + ], | ||
| 807 | + }; | ||
| 808 | + } | ||
| 809 | + | ||
| 810 | + return item.content; | ||
| 811 | + }); | ||
| 812 | + | ||
| 813 | + useEffect(() => { | ||
| 814 | + if (!configList.length) return; | ||
| 815 | + | ||
| 816 | + const configOptions = configList.map((item: any) => ({ | ||
| 817 | + label: item.showName, | ||
| 818 | + value: item.tableName, | ||
| 819 | + tableName: item.sTbName, | ||
| 820 | + })); | ||
| 821 | + const configValueOptions = configList.reduce((pre: any, cur: any) => { | ||
| 822 | + pre[cur.tableName] = cur.gdsconfigformslave | ||
| 823 | + .filter((x: any) => x.sName && x.showName && !x.sControlName?.startsWith("Btn")) | ||
| 824 | + .map((x: any) => ({ label: x.showName, value: x.sName })); | ||
| 825 | + return pre; | ||
| 826 | + }, {}); | ||
| 827 | + | ||
| 828 | + const propsOptions = [ | ||
| 829 | + { | ||
| 830 | + label: "是否可编辑", | ||
| 831 | + value: "enabled", | ||
| 832 | + }, | ||
| 833 | + { | ||
| 834 | + label: "模块id", | ||
| 835 | + value: "sSrcModelsId", | ||
| 836 | + }, | ||
| 837 | + ]; | ||
| 838 | + | ||
| 839 | + configValueOptions.props = propsOptions; | ||
| 840 | + | ||
| 841 | + let srcModelsOptions = []; | ||
| 842 | + if (srcModelsList.length) { | ||
| 843 | + const showKey = Object.keys(srcModelsList[0])[0]; | ||
| 844 | + srcModelsOptions = srcModelsList.map((x: any) => ({ | ||
| 845 | + label: x[showKey], | ||
| 846 | + value: x.sId, | ||
| 847 | + })); | ||
| 848 | + } | ||
| 849 | + | ||
| 850 | + setState({ configOptions, configValueOptions, srcModelsOptions }); | ||
| 851 | + }, [configList.length]); | ||
| 852 | + | ||
| 853 | + const onReceiveData = (event: any) => { | ||
| 854 | + // 验证来源 | ||
| 855 | + if (!document.referrer.includes(event.origin)) { | ||
| 856 | + return; | ||
| 857 | + } | ||
| 858 | + | ||
| 859 | + // 处理接收到的命令 | ||
| 860 | + if (event.data.command === "initData") { | ||
| 861 | + const value = event.data.value || []; | ||
| 862 | + | ||
| 863 | + // 执行相应操作 | ||
| 864 | + setState({ | ||
| 865 | + tableName: event.data.tableName, | ||
| 866 | + sFieldName: event.data.sFieldName, | ||
| 867 | + slave0Data: event.data.slave0Data, | ||
| 868 | + configList: event.data.configList, | ||
| 869 | + srcModelsList: event.data.srcModelsList, | ||
| 870 | + instructionList: value.map((item: any) => { | ||
| 871 | + const allList = [...baseList, ...funList, ...btnsList]; | ||
| 872 | + const config = allList.find(listItem => listItem.key === item.opr); | ||
| 873 | + // const bFullMode = item.bFullMode; | ||
| 874 | + // delete item.bFullMode; | ||
| 875 | + const result = { | ||
| 876 | + ...config, | ||
| 877 | + type: config?.key, | ||
| 878 | + key: shortid(), | ||
| 879 | + mode: "full", | ||
| 880 | + content: item, | ||
| 881 | + }; | ||
| 882 | + // if (bFullMode) { | ||
| 883 | + // result.bFullMode = true; | ||
| 884 | + // } | ||
| 885 | + return result; | ||
| 886 | + }), | ||
| 887 | + }); | ||
| 888 | + } | ||
| 889 | + }; | ||
| 890 | + | ||
| 891 | + useEffect(() => { | ||
| 892 | + window.addEventListener("message", onReceiveData); | ||
| 893 | + try { | ||
| 894 | + window.parent.postMessage( | ||
| 895 | + { | ||
| 896 | + command: "initData", | ||
| 897 | + }, | ||
| 898 | + document.referrer | ||
| 899 | + ); | ||
| 900 | + } catch (error) {} | ||
| 901 | + return () => { | ||
| 902 | + window.removeEventListener("message", onReceiveData); | ||
| 903 | + }; | ||
| 904 | + }, []); | ||
| 905 | + // 复制到剪贴板 | ||
| 906 | + const handleCopy = (bZip: boolean) => { | ||
| 907 | + const value = bZip ? JSON.stringify(outputContent) : JSON.stringify(outputContent, null, 2); | ||
| 908 | + navigator.clipboard.writeText(value); | ||
| 909 | + }; | ||
| 910 | + | ||
| 911 | + const handleSave = () => { | ||
| 912 | + window.parent.postMessage( | ||
| 913 | + { | ||
| 914 | + command: "saveData", | ||
| 915 | + data: outputContent, | ||
| 916 | + }, | ||
| 917 | + document.referrer | ||
| 918 | + ); | ||
| 919 | + }; | ||
| 920 | + | ||
| 921 | + return ( | ||
| 922 | + <div | ||
| 923 | + style={{ | ||
| 924 | + width: "100%", | ||
| 925 | + height: "100%", | ||
| 926 | + display: "flex", | ||
| 927 | + flexDirection: "column", | ||
| 928 | + alignItems: "center", | ||
| 929 | + justifyContent: "center", | ||
| 930 | + }} | ||
| 931 | + > | ||
| 932 | + <Input.TextArea | ||
| 933 | + style={{ height: "calc(100% - 40px)" }} | ||
| 934 | + value={JSON.stringify(outputContent, null, 2)} | ||
| 935 | + readOnly | ||
| 936 | + /> | ||
| 937 | + <Space align="center" style={{ height: 40 }}> | ||
| 938 | + <Button type="primary" onClick={handleCopy.bind(this, true)}> | ||
| 939 | + 压缩复制 | ||
| 940 | + </Button> | ||
| 941 | + {/* <Button type="primary" onClick={handleCopy.bind(this, false)}> | ||
| 942 | + 格式化复制 | ||
| 943 | + </Button> */} | ||
| 944 | + <Button type="primary" onClick={handleSave.bind(this)}> | ||
| 945 | + 保存 | ||
| 946 | + </Button> | ||
| 947 | + </Space> | ||
| 948 | + </div> | ||
| 949 | + ); | ||
| 950 | +}; | ||
| 951 | + | ||
| 952 | +const FormIfdo = (props: any) => { | ||
| 953 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 954 | + const { form } = commonProps; | ||
| 955 | + const conditionType = Form.useWatch("conditionType", form) || "0"; | ||
| 956 | + | ||
| 957 | + return ( | ||
| 958 | + <> | ||
| 959 | + <Form {...formProps}> | ||
| 960 | + <Form.Item name="conditionType" label=" " colon={false}> | ||
| 961 | + <Radio.Group | ||
| 962 | + defaultValue={"0"} | ||
| 963 | + options={[ | ||
| 964 | + { value: "0", label: "自定义规则" }, | ||
| 965 | + { value: "1", label: "数据集为空" }, | ||
| 966 | + { value: "2", label: "数据集不为空" }, | ||
| 967 | + ]} | ||
| 968 | + /> | ||
| 969 | + </Form.Item> | ||
| 970 | + {conditionType === "0" && <CommonDataset {...commonProps} />} | ||
| 971 | + {conditionType === "0" ? ( | ||
| 972 | + <CommonCondition {...commonProps} dependsWith="dataset" /> | ||
| 973 | + ) : conditionType === "1" ? ( | ||
| 974 | + <CommonDataset | ||
| 975 | + {...commonProps} | ||
| 976 | + sName="conditionEmpty" | ||
| 977 | + sLabel="为空数据集" | ||
| 978 | + onlyAllData | ||
| 979 | + bMust | ||
| 980 | + /> | ||
| 981 | + ) : ( | ||
| 982 | + <CommonDataset | ||
| 983 | + {...commonProps} | ||
| 984 | + sName="conditionNotEmpty" | ||
| 985 | + sLabel="不为空数据集" | ||
| 986 | + onlyAllData | ||
| 987 | + bMust | ||
| 988 | + /> | ||
| 989 | + )} | ||
| 990 | + <CommonSaveBtn {...commonProps} /> | ||
| 991 | + </Form> | ||
| 992 | + </> | ||
| 993 | + ); | ||
| 994 | +}; | ||
| 995 | + | ||
| 996 | +// 新增 | ||
| 997 | +const FormAdd = (props: any) => { | ||
| 998 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 999 | + return ( | ||
| 1000 | + <Form {...formProps}> | ||
| 1001 | + <CommonInput {...commonProps} /> | ||
| 1002 | + <CommonDataset {...commonProps} /> | ||
| 1003 | + <CommonSValue {...commonProps} /> | ||
| 1004 | + <CommonSaveBtn {...commonProps} /> | ||
| 1005 | + </Form> | ||
| 1006 | + ); | ||
| 1007 | +}; | ||
| 1008 | + | ||
| 1009 | +// 编辑 | ||
| 1010 | +const FormEdit = (props: any) => { | ||
| 1011 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 1012 | + const bFullMode = props.item.mode === "full"; | ||
| 1013 | + return ( | ||
| 1014 | + <Form {...formProps}> | ||
| 1015 | + <CommonInput {...commonProps} bFilter /> | ||
| 1016 | + <CommonDataset {...commonProps} /> | ||
| 1017 | + {bFullMode && <CommonCondition {...commonProps} />} | ||
| 1018 | + <CommonSValue {...commonProps} /> | ||
| 1019 | + <CommonSaveBtn {...commonProps} /> | ||
| 1020 | + </Form> | ||
| 1021 | + ); | ||
| 1022 | +}; | ||
| 1023 | + | ||
| 1024 | +// 删除 | ||
| 1025 | +const FormDel = (props: any) => { | ||
| 1026 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 1027 | + const bFullMode = props.item.mode === "full"; | ||
| 1028 | + return ( | ||
| 1029 | + <Form {...formProps}> | ||
| 1030 | + <CommonInput {...commonProps} bFilter /> | ||
| 1031 | + {bFullMode && <CommonDataset {...commonProps} />} | ||
| 1032 | + {bFullMode && <CommonCondition {...commonProps} />} | ||
| 1033 | + <CommonSaveBtn {...commonProps} /> | ||
| 1034 | + </Form> | ||
| 1035 | + ); | ||
| 1036 | +}; | ||
| 1037 | + | ||
| 1038 | +// 复制 | ||
| 1039 | +const FormCopy = (props: any) => { | ||
| 1040 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 1041 | + const bFullMode = props.item.mode === "full"; | ||
| 1042 | + return ( | ||
| 1043 | + <Form {...formProps}> | ||
| 1044 | + <CommonInput {...commonProps} sName="srcDataset" sLabel="数据源(复制从)" bFilter /> | ||
| 1045 | + <CommonInput {...commonProps} sName="newDataset" sLabel="数据源(复制到)" /> | ||
| 1046 | + {bFullMode && <CommonDataset {...commonProps} />} | ||
| 1047 | + {bFullMode && <CommonSValue {...commonProps} />} | ||
| 1048 | + <CommonSaveBtn {...commonProps} /> | ||
| 1049 | + </Form> | ||
| 1050 | + ); | ||
| 1051 | +}; | ||
| 1052 | + | ||
| 1053 | +// 保存 | ||
| 1054 | +const FormSave = (props: any) => { | ||
| 1055 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 1056 | + const { form, configOptions = [] } = commonProps; | ||
| 1057 | + const saveType = Form.useWatch("saveType", form); | ||
| 1058 | + const data = Form.useWatch("data", form) || []; | ||
| 1059 | + | ||
| 1060 | + return ( | ||
| 1061 | + <Form {...formProps}> | ||
| 1062 | + <Form.Item name="saveType" label=" " colon={false}> | ||
| 1063 | + <Radio.Group | ||
| 1064 | + defaultValue={"saveAll"} | ||
| 1065 | + options={[ | ||
| 1066 | + { value: "saveAll", label: "保存全部数据集" }, | ||
| 1067 | + { value: "saveCustom", label: "保存指定数据集" }, | ||
| 1068 | + ]} | ||
| 1069 | + /> | ||
| 1070 | + </Form.Item> | ||
| 1071 | + {saveType === "saveCustom" && ( | ||
| 1072 | + <> | ||
| 1073 | + <Form.List name="data"> | ||
| 1074 | + {(fields, { add, remove }) => ( | ||
| 1075 | + <> | ||
| 1076 | + {fields.map(field => { | ||
| 1077 | + const srcDataset = data[field.name]?.srcDataset; | ||
| 1078 | + const selectValue = configOptions.some((item: any) => item.value === srcDataset) | ||
| 1079 | + ? srcDataset | ||
| 1080 | + : "custom"; | ||
| 1081 | + return ( | ||
| 1082 | + <Space key={field.key} align="baseline"> | ||
| 1083 | + <Form.Item | ||
| 1084 | + {...field} | ||
| 1085 | + label="数据集名称" | ||
| 1086 | + name={[field.name, "srcDataset"]} | ||
| 1087 | + rules={[{ required: true, message: "请输入数据集名称" }]} | ||
| 1088 | + > | ||
| 1089 | + <Input | ||
| 1090 | + addonBefore={ | ||
| 1091 | + <Select | ||
| 1092 | + options={[...configOptions, { label: "自定义", value: "custom" }]} | ||
| 1093 | + value={selectValue} | ||
| 1094 | + style={{ minWidth: 100 }} | ||
| 1095 | + popupMatchSelectWidth={false} | ||
| 1096 | + onChange={(value, option) => { | ||
| 1097 | + // 给Input赋值 | ||
| 1098 | + form.setFieldsValue({ | ||
| 1099 | + data: form.getFieldValue("data").map((item: any, index: number) => | ||
| 1100 | + index === field.name | ||
| 1101 | + ? { | ||
| 1102 | + ...item, | ||
| 1103 | + srcDataset: value === "custom" ? "" : value, | ||
| 1104 | + tablename: option.tableName || "", | ||
| 1105 | + } | ||
| 1106 | + : item | ||
| 1107 | + ), | ||
| 1108 | + }); | ||
| 1109 | + }} | ||
| 1110 | + /> | ||
| 1111 | + } | ||
| 1112 | + /> | ||
| 1113 | + </Form.Item> | ||
| 1114 | + <Form.Item | ||
| 1115 | + {...field} | ||
| 1116 | + label="数据库表名" | ||
| 1117 | + name={[field.name, "tablename"]} | ||
| 1118 | + rules={[{ required: true, message: "请输入数据库表名" }]} | ||
| 1119 | + > | ||
| 1120 | + <Input /> | ||
| 1121 | + </Form.Item> | ||
| 1122 | + <MinusCircleOutlined onClick={() => remove(field.name)} /> | ||
| 1123 | + </Space> | ||
| 1124 | + ); | ||
| 1125 | + })} | ||
| 1126 | + | ||
| 1127 | + <Form.Item label=" " colon={false}> | ||
| 1128 | + <Button | ||
| 1129 | + type="dashed" | ||
| 1130 | + style={{ width: 502 }} | ||
| 1131 | + onClick={() => add()} | ||
| 1132 | + block | ||
| 1133 | + icon={<PlusOutlined />} | ||
| 1134 | + > | ||
| 1135 | + 新增 | ||
| 1136 | + </Button> | ||
| 1137 | + </Form.Item> | ||
| 1138 | + </> | ||
| 1139 | + )} | ||
| 1140 | + </Form.List> | ||
| 1141 | + | ||
| 1142 | + <CommonCheckBox {...commonProps} sName="doNotValidate" sLabel="保存不进行校验" /> | ||
| 1143 | + <CommonCheckBox {...commonProps} sName="doNotRefresh" sLabel="保存后不刷新表格" /> | ||
| 1144 | + </> | ||
| 1145 | + )} | ||
| 1146 | + <CommonSaveBtn {...commonProps} /> | ||
| 1147 | + </Form> | ||
| 1148 | + ); | ||
| 1149 | +}; | ||
| 1150 | + | ||
| 1151 | +// 过滤 | ||
| 1152 | +const FormFilter = (props: any) => { | ||
| 1153 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 1154 | + const bFullMode = props.item.mode === "full"; | ||
| 1155 | + return ( | ||
| 1156 | + <Form {...formProps}> | ||
| 1157 | + <CommonInput {...commonProps} sName="srcDataset" sLabel="数据源(过滤从)" bFilter /> | ||
| 1158 | + <CommonInput {...commonProps} sName="newDataset" sLabel="数据源(过滤到)" /> | ||
| 1159 | + {bFullMode && <CommonDataset {...commonProps} />} | ||
| 1160 | + {bFullMode && <CommonCondition {...commonProps} />} | ||
| 1161 | + <CommonSaveBtn {...commonProps} /> | ||
| 1162 | + </Form> | ||
| 1163 | + ); | ||
| 1164 | +}; | ||
| 1165 | + | ||
| 1166 | +// 创建新数据集 | ||
| 1167 | +const FormNewempty = (props: any) => { | ||
| 1168 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 1169 | + const radioValue = | ||
| 1170 | + Form.useWatch("radioValue", formProps.form) || | ||
| 1171 | + (props.item.content?.desDataset ? "desDataset" : "") || | ||
| 1172 | + "srcDataset"; | ||
| 1173 | + return ( | ||
| 1174 | + <Form {...formProps}> | ||
| 1175 | + <Form.Item name="radioValue" label=" " colon={false}> | ||
| 1176 | + <Radio.Group | ||
| 1177 | + value={radioValue} | ||
| 1178 | + options={[ | ||
| 1179 | + { value: "srcDataset", label: "新增临时数据集" }, | ||
| 1180 | + { value: "desDataset", label: "覆盖已有数据集" }, | ||
| 1181 | + ]} | ||
| 1182 | + onChange={e => { | ||
| 1183 | + formProps.form.setFieldValue("radioValue", e.target.value); | ||
| 1184 | + }} | ||
| 1185 | + /> | ||
| 1186 | + <Input style={{ display: "none" }} /> | ||
| 1187 | + </Form.Item> | ||
| 1188 | + {radioValue === "srcDataset" ? ( | ||
| 1189 | + <CommonInput {...commonProps} sName="srcDataset" /> | ||
| 1190 | + ) : ( | ||
| 1191 | + <CommonInput {...commonProps} /> | ||
| 1192 | + )} | ||
| 1193 | + <CommonSaveBtn {...commonProps} /> | ||
| 1194 | + </Form> | ||
| 1195 | + ); | ||
| 1196 | +}; | ||
| 1197 | + | ||
| 1198 | +// 清空数据集 | ||
| 1199 | +const FormEmptyAll = (props: any) => { | ||
| 1200 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 1201 | + return ( | ||
| 1202 | + <Form {...formProps}> | ||
| 1203 | + <CommonInput {...commonProps} bMuti sLabel="数据集名称" /> | ||
| 1204 | + <CommonSaveBtn {...commonProps} /> | ||
| 1205 | + </Form> | ||
| 1206 | + ); | ||
| 1207 | +}; | ||
| 1208 | + | ||
| 1209 | +// 刷新数据集 | ||
| 1210 | +const FormRefresh = (props: any) => { | ||
| 1211 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 1212 | + return ( | ||
| 1213 | + <Form {...formProps}> | ||
| 1214 | + <CommonInput {...commonProps} bMuti sLabel="数据集名称" sName="dataset" /> | ||
| 1215 | + <CommonSaveBtn {...commonProps} /> | ||
| 1216 | + </Form> | ||
| 1217 | + ); | ||
| 1218 | +}; | ||
| 1219 | + | ||
| 1220 | +// 清空选中行 | ||
| 1221 | +const FormClearRowKey = (props: any) => { | ||
| 1222 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 1223 | + return ( | ||
| 1224 | + <Form {...formProps}> | ||
| 1225 | + <CommonInput {...commonProps} bMuti sLabel="数据集名称" sName="dataset" /> | ||
| 1226 | + <CommonSaveBtn {...commonProps} /> | ||
| 1227 | + </Form> | ||
| 1228 | + ); | ||
| 1229 | +}; | ||
| 1230 | + | ||
| 1231 | +// 选中表格第一行 | ||
| 1232 | +const FormSelectFirstLine = (props: any) => { | ||
| 1233 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 1234 | + return ( | ||
| 1235 | + <Form {...formProps}> | ||
| 1236 | + <CommonInput {...commonProps} bMuti sLabel="表格名称" sName="dataset" /> | ||
| 1237 | + <CommonSaveBtn {...commonProps} /> | ||
| 1238 | + </Form> | ||
| 1239 | + ); | ||
| 1240 | +}; | ||
| 1241 | + | ||
| 1242 | +// 打印 | ||
| 1243 | +const FormPrint = (props: any) => { | ||
| 1244 | + const [formProps, commonProps] = useFormCommon({ | ||
| 1245 | + ...props, | ||
| 1246 | + formPreFuc: (values: any) => { | ||
| 1247 | + return { | ||
| 1248 | + ...values, | ||
| 1249 | + srcDataset: values.srcDataset?.split(",").filter((item: any) => item), | ||
| 1250 | + }; | ||
| 1251 | + }, | ||
| 1252 | + }); | ||
| 1253 | + return ( | ||
| 1254 | + <Form {...formProps}> | ||
| 1255 | + <CommonInput | ||
| 1256 | + {...commonProps} | ||
| 1257 | + sName="reportName" | ||
| 1258 | + sLabel="报表名称" | ||
| 1259 | + noAddonBefore | ||
| 1260 | + extraProps={{ placeholder: "请输入报表名称(举例:生产工单报表)" }} | ||
| 1261 | + /> | ||
| 1262 | + <CommonSelect | ||
| 1263 | + {...commonProps} | ||
| 1264 | + sName="reportType" | ||
| 1265 | + sLabel="报表类型" | ||
| 1266 | + options={[ | ||
| 1267 | + { label: "PDF", value: ".pdf" }, | ||
| 1268 | + { label: "Execl", value: ".xlsx" }, | ||
| 1269 | + ]} | ||
| 1270 | + /> | ||
| 1271 | + <CommonDataset {...commonProps} sName="srcDataset" sLabel="数据源" bMust /> | ||
| 1272 | + <CommonSingleChoice {...commonProps} sName="bPreviewOnly" sLabel="不显示打印" /> | ||
| 1273 | + <CommonSaveBtn {...commonProps} /> | ||
| 1274 | + </Form> | ||
| 1275 | + ); | ||
| 1276 | +}; | ||
| 1277 | + | ||
| 1278 | +// 查询sql | ||
| 1279 | +const FormOpenSql = (props: any) => { | ||
| 1280 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 1281 | + return ( | ||
| 1282 | + <Form {...formProps}> | ||
| 1283 | + <CommonDataset {...commonProps} sName="srcDataset" sLabel="数据源" bMust /> | ||
| 1284 | + <CommonInput {...commonProps} sName="newDataset" sLabel="数据集(保存到)" bMust /> | ||
| 1285 | + <CommonInput | ||
| 1286 | + {...commonProps} | ||
| 1287 | + sName="sql" | ||
| 1288 | + sLabel="sql查询语句" | ||
| 1289 | + bMust | ||
| 1290 | + bArea | ||
| 1291 | + extraProps={{ | ||
| 1292 | + placeholder: | ||
| 1293 | + "举例:select sBoardNo FROM plc_machinedate_tray WHERE sWorkOrderId = ${sWorkOrderId} limit 1", | ||
| 1294 | + }} | ||
| 1295 | + /> | ||
| 1296 | + <CommonInput | ||
| 1297 | + {...commonProps} | ||
| 1298 | + sName="sSqlCondition" | ||
| 1299 | + sLabel="sql条件" | ||
| 1300 | + bMust | ||
| 1301 | + bArea | ||
| 1302 | + extraProps={{ placeholder: "举例:slave.sWorkOrderId.sWorkOrderId" }} | ||
| 1303 | + /> | ||
| 1304 | + <CommonSaveBtn {...commonProps} /> | ||
| 1305 | + </Form> | ||
| 1306 | + ); | ||
| 1307 | +}; | ||
| 1308 | + | ||
| 1309 | +// 执行sql | ||
| 1310 | +const FormExesql = (props: any) => { | ||
| 1311 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 1312 | + return ( | ||
| 1313 | + <Form {...formProps}> | ||
| 1314 | + <CommonDataset {...commonProps} sName="srcDataset" sLabel="数据源" bMust /> | ||
| 1315 | + <CommonInput | ||
| 1316 | + {...commonProps} | ||
| 1317 | + sName="sSqlCondition" | ||
| 1318 | + sLabel="sql执行语句" | ||
| 1319 | + bMust | ||
| 1320 | + bArea | ||
| 1321 | + extraProps={{ | ||
| 1322 | + placeholder: "举例:update plc_machinedate_tray SET bWlStatus= 1 WHERE sId=${sParentId}", | ||
| 1323 | + }} | ||
| 1324 | + /> | ||
| 1325 | + <CommonSaveBtn {...commonProps} /> | ||
| 1326 | + </Form> | ||
| 1327 | + ); | ||
| 1328 | +}; | ||
| 1329 | + | ||
| 1330 | +// 消息提示 | ||
| 1331 | +const FormMsg = (props: any) => { | ||
| 1332 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 1333 | + const { form } = commonProps; | ||
| 1334 | + const codeValue = Form.useWatch("code", form); | ||
| 1335 | + | ||
| 1336 | + return ( | ||
| 1337 | + <Form {...formProps}> | ||
| 1338 | + <Form.Item | ||
| 1339 | + label="消息类型" | ||
| 1340 | + name="code" | ||
| 1341 | + rules={[{ required: true, message: "请选择消息类型" }]} | ||
| 1342 | + > | ||
| 1343 | + <Select | ||
| 1344 | + value={codeValue} | ||
| 1345 | + options={[ | ||
| 1346 | + { | ||
| 1347 | + label: "成功(code:1)", | ||
| 1348 | + value: 1, | ||
| 1349 | + className: styles.code1, | ||
| 1350 | + }, | ||
| 1351 | + { | ||
| 1352 | + label: "错误(code:-1)", | ||
| 1353 | + value: -1, | ||
| 1354 | + className: styles.code_1, | ||
| 1355 | + }, | ||
| 1356 | + { | ||
| 1357 | + label: "错误(code:-8)", | ||
| 1358 | + value: -8, | ||
| 1359 | + className: styles.code_8, | ||
| 1360 | + }, | ||
| 1361 | + { | ||
| 1362 | + label: "提示(code:2)", | ||
| 1363 | + value: 2, | ||
| 1364 | + className: styles.code2, | ||
| 1365 | + }, | ||
| 1366 | + { | ||
| 1367 | + label: "确认(code:-7)", | ||
| 1368 | + value: -7, | ||
| 1369 | + className: styles.code_7, | ||
| 1370 | + }, | ||
| 1371 | + ]} | ||
| 1372 | + /> | ||
| 1373 | + </Form.Item> | ||
| 1374 | + <CommonInput {...commonProps} sName="msg" sLabel="消息内容" bMust bArea /> | ||
| 1375 | + <CommonInputNumber | ||
| 1376 | + {...commonProps} | ||
| 1377 | + sName="time" | ||
| 1378 | + sLabel="弹窗持续时间" | ||
| 1379 | + extraProps={{ addonAfter: "秒", placeholder: "2" }} | ||
| 1380 | + /> | ||
| 1381 | + <CommonSaveBtn {...commonProps} /> | ||
| 1382 | + </Form> | ||
| 1383 | + ); | ||
| 1384 | +}; | ||
| 1385 | + | ||
| 1386 | +// 按钮组件 | ||
| 1387 | +const FormBtnHandle = (props: any) => { | ||
| 1388 | + const [formProps, commonProps] = useFormCommon(props); | ||
| 1389 | + const { slave0Data, setState, settingPorps = {} } = useContext(myContext); | ||
| 1390 | + const { form } = commonProps; | ||
| 1391 | + | ||
| 1392 | + const selectData = useMemo( | ||
| 1393 | + () => | ||
| 1394 | + slave0Data | ||
| 1395 | + ?.filter((item: any) => item.bVisible && item.sControlName?.startsWith("Btn")) | ||
| 1396 | + .map((item: any) => ({ | ||
| 1397 | + label: item.sChinese, | ||
| 1398 | + value: item.sControlName, | ||
| 1399 | + })) || [], | ||
| 1400 | + [!!slave0Data] | ||
| 1401 | + ); | ||
| 1402 | + | ||
| 1403 | + const { open, condition, conditionData, index, name } = settingPorps; | ||
| 1404 | + useEffect(() => { | ||
| 1405 | + if (!open) { | ||
| 1406 | + const data = [...(form.getFieldValue("data") || [])]; | ||
| 1407 | + if (condition && conditionData) { | ||
| 1408 | + data[index][name] = condition; | ||
| 1409 | + data[index][`${name}Data`] = conditionData; | ||
| 1410 | + form.setFieldValue("data", data); | ||
| 1411 | + } else if (conditionData == "[1]") { | ||
| 1412 | + delete data[index][name]; | ||
| 1413 | + delete data[index][`${name}Data`]; | ||
| 1414 | + } | ||
| 1415 | + setTimeout(() => { | ||
| 1416 | + setState({ | ||
| 1417 | + settingPorps: {}, | ||
| 1418 | + }); | ||
| 1419 | + form.submit(); | ||
| 1420 | + }, 100); | ||
| 1421 | + } | ||
| 1422 | + }, [open]); | ||
| 1423 | + | ||
| 1424 | + const handleOpenSettingModal = (index: number, name: string) => { | ||
| 1425 | + const itemData = form.getFieldValue("data")[index]; | ||
| 1426 | + if (!itemData) { | ||
| 1427 | + message.error("请先选择按钮名称!"); | ||
| 1428 | + return; | ||
| 1429 | + } | ||
| 1430 | + setState({ | ||
| 1431 | + settingPorps: { | ||
| 1432 | + open: true, | ||
| 1433 | + index, | ||
| 1434 | + name, | ||
| 1435 | + conditionData: form.getFieldValue("data")[index][`${name}Data`], | ||
| 1436 | + }, | ||
| 1437 | + }); | ||
| 1438 | + }; | ||
| 1439 | + | ||
| 1440 | + const removeLine = (index: number) => { | ||
| 1441 | + const data = [...form.getFieldValue("data")]; | ||
| 1442 | + data.splice(index, 1); | ||
| 1443 | + form.setFieldValue("data", data); | ||
| 1444 | + form.submit(); | ||
| 1445 | + }; | ||
| 1446 | + | ||
| 1447 | + return ( | ||
| 1448 | + <Form {...formProps}> | ||
| 1449 | + <Form.List name="data"> | ||
| 1450 | + {(fields, { add, remove }) => ( | ||
| 1451 | + <> | ||
| 1452 | + {fields.map((field, index) => ( | ||
| 1453 | + <> | ||
| 1454 | + <Divider orientation="left" style={{ position: "relative" }}> | ||
| 1455 | + 配置{index + 1} | ||
| 1456 | + <MinusCircleOutlined | ||
| 1457 | + style={{ position: "absolute", right: 8, top: 5, color: "red" }} | ||
| 1458 | + onClick={() => removeLine(index)} | ||
| 1459 | + /> | ||
| 1460 | + </Divider> | ||
| 1461 | + <Form.Item | ||
| 1462 | + {...field} | ||
| 1463 | + label="按钮名称" | ||
| 1464 | + name={[field.name, "name"]} | ||
| 1465 | + rules={[{ required: true, message: "请输入按钮名称" }]} | ||
| 1466 | + > | ||
| 1467 | + <Select | ||
| 1468 | + options={selectData} | ||
| 1469 | + mode="tags" | ||
| 1470 | + onBlur={() => { | ||
| 1471 | + form.submit(); | ||
| 1472 | + }} | ||
| 1473 | + /> | ||
| 1474 | + </Form.Item> | ||
| 1475 | + <Form.Item | ||
| 1476 | + {...field} | ||
| 1477 | + label="可点击条件" | ||
| 1478 | + name={[field.name, "enabled"]} | ||
| 1479 | + extra={ | ||
| 1480 | + <Button | ||
| 1481 | + type="primary" | ||
| 1482 | + className={styles.settingBtn} | ||
| 1483 | + onClick={handleOpenSettingModal.bind(this, index, "enabled")} | ||
| 1484 | + > | ||
| 1485 | + <span>配</span> | ||
| 1486 | + <span>置</span> | ||
| 1487 | + </Button> | ||
| 1488 | + } | ||
| 1489 | + > | ||
| 1490 | + <Input.TextArea readOnly style={{ width: "calc(100% - 30px)" }}></Input.TextArea> | ||
| 1491 | + </Form.Item> | ||
| 1492 | + <Form.Item | ||
| 1493 | + {...field} | ||
| 1494 | + label="可显示条件" | ||
| 1495 | + name={[field.name, "show"]} | ||
| 1496 | + extra={ | ||
| 1497 | + <Button | ||
| 1498 | + type="primary" | ||
| 1499 | + className={styles.settingBtn} | ||
| 1500 | + onClick={handleOpenSettingModal.bind(this, index, "show")} | ||
| 1501 | + > | ||
| 1502 | + <span>配</span> | ||
| 1503 | + <span>置</span> | ||
| 1504 | + </Button> | ||
| 1505 | + } | ||
| 1506 | + > | ||
| 1507 | + <Input.TextArea readOnly style={{ width: "calc(100% - 30px)" }} /> | ||
| 1508 | + </Form.Item> | ||
| 1509 | + </> | ||
| 1510 | + ))} | ||
| 1511 | + | ||
| 1512 | + <Form.Item label=" " colon={false}> | ||
| 1513 | + <Button | ||
| 1514 | + type="dashed" | ||
| 1515 | + style={{ width: "100%" }} | ||
| 1516 | + onClick={() => add()} | ||
| 1517 | + block | ||
| 1518 | + icon={<PlusOutlined />} | ||
| 1519 | + > | ||
| 1520 | + 新增 | ||
| 1521 | + </Button> | ||
| 1522 | + </Form.Item> | ||
| 1523 | + </> | ||
| 1524 | + )} | ||
| 1525 | + </Form.List> | ||
| 1526 | + <CommonSaveBtn {...commonProps} /> | ||
| 1527 | + </Form> | ||
| 1528 | + ); | ||
| 1529 | +}; | ||
| 1530 | + | ||
| 1531 | +const SettingModal = () => { | ||
| 1532 | + const { setState, settingPorps } = useContext(myContext); | ||
| 1533 | + const { open, index, name, conditionData } = settingPorps; | ||
| 1534 | + | ||
| 1535 | + if (!open) return ""; | ||
| 1536 | + | ||
| 1537 | + const initData = { | ||
| 1538 | + key: shortid(), | ||
| 1539 | + level: 1, | ||
| 1540 | + type: 1, | ||
| 1541 | + children: [ | ||
| 1542 | + { | ||
| 1543 | + rowValues: INIT_ROW_VALUES, | ||
| 1544 | + key: shortid(), | ||
| 1545 | + level: 1, | ||
| 1546 | + }, | ||
| 1547 | + ], | ||
| 1548 | + }; | ||
| 1549 | + | ||
| 1550 | + const [data, setData] = useState( | ||
| 1551 | + conditionData ? convertStr2Data(JSON.parse(conditionData)) : initData | ||
| 1552 | + ); | ||
| 1553 | + const onCancel = () => { | ||
| 1554 | + setState({ settingPorps: { open: false } }); | ||
| 1555 | + }; | ||
| 1556 | + | ||
| 1557 | + const onOk = () => { | ||
| 1558 | + const condition = convertData2Str(data, false); | ||
| 1559 | + | ||
| 1560 | + const conditionData = JSON.stringify(convertData2Str(data, true)); | ||
| 1561 | + setState({ settingPorps: { open: false, condition, conditionData, index, name } }); | ||
| 1562 | + }; | ||
| 1563 | + | ||
| 1564 | + return ( | ||
| 1565 | + <Modal | ||
| 1566 | + title="配置" | ||
| 1567 | + open={open} | ||
| 1568 | + className={styles.settingModal} | ||
| 1569 | + footer={ | ||
| 1570 | + <Space style={{ position: "fixed", bottom: 42, right: 40 }}> | ||
| 1571 | + <Button type="primary" onClick={onOk}> | ||
| 1572 | + 确认 | ||
| 1573 | + </Button> | ||
| 1574 | + <Button onClick={onCancel}>取消</Button> | ||
| 1575 | + </Space> | ||
| 1576 | + } | ||
| 1577 | + onCancel={onCancel} | ||
| 1578 | + > | ||
| 1579 | + <FilterRules | ||
| 1580 | + component={props => <MyFilterRulesGroup {...props} dataSetList={[]} />} | ||
| 1581 | + value={data} | ||
| 1582 | + onChange={(value: any) => { | ||
| 1583 | + let valueNew = cloneDeep(value); | ||
| 1584 | + if (!valueNew) { | ||
| 1585 | + valueNew = initData; | ||
| 1586 | + } else if (!valueNew.children) { | ||
| 1587 | + valueNew = { | ||
| 1588 | + key: shortid(), | ||
| 1589 | + level: 1, | ||
| 1590 | + type: 1, | ||
| 1591 | + children: [value], | ||
| 1592 | + }; | ||
| 1593 | + } else if (!valueNew.children.length) { | ||
| 1594 | + valueNew = initData; | ||
| 1595 | + } | ||
| 1596 | + setData(valueNew); | ||
| 1597 | + }} | ||
| 1598 | + initValues={INIT_ROW_VALUES} | ||
| 1599 | + notEmpty={{ data: false }} | ||
| 1600 | + /> | ||
| 1601 | + </Modal> | ||
| 1602 | + ); | ||
| 1603 | +}; | ||
| 1604 | + | ||
| 1605 | +const useFormCommon = (props: any) => { | ||
| 1606 | + const { ...rest } = useContext(myContext); | ||
| 1607 | + const [form] = Form.useForm(); | ||
| 1608 | + useEffect(() => { | ||
| 1609 | + const { item, formPreFuc } = props; | ||
| 1610 | + const { content = {} } = item; | ||
| 1611 | + const { dataset, data } = content; | ||
| 1612 | + let initValue = { | ||
| 1613 | + ...content, | ||
| 1614 | + dataset: dataset?.split(",").filter((item: any) => item), | ||
| 1615 | + }; | ||
| 1616 | + if (data?.length) { | ||
| 1617 | + initValue.data = data.map((item: any) => { | ||
| 1618 | + if (item.name && typeof item.name === "string") { | ||
| 1619 | + return { ...item, name: item.name.split(",").filter((item: any) => item) }; | ||
| 1620 | + } | ||
| 1621 | + return item; | ||
| 1622 | + }); | ||
| 1623 | + } | ||
| 1624 | + if (formPreFuc) { | ||
| 1625 | + initValue = formPreFuc(initValue); | ||
| 1626 | + } | ||
| 1627 | + form.setFieldsValue(initValue); | ||
| 1628 | + }, []); | ||
| 1629 | + | ||
| 1630 | + const commonProps = { | ||
| 1631 | + ...props, | ||
| 1632 | + ...rest, | ||
| 1633 | + form, | ||
| 1634 | + }; | ||
| 1635 | + const onFinish = () => { | ||
| 1636 | + handleUpdateData({ ...commonProps }); | ||
| 1637 | + }; | ||
| 1638 | + | ||
| 1639 | + const formProps = { | ||
| 1640 | + form, | ||
| 1641 | + labelCol: { flex: "150px" }, | ||
| 1642 | + wrapperCol: { flex: "auto" }, | ||
| 1643 | + autoComplete: "off", | ||
| 1644 | + onFinish, | ||
| 1645 | + }; | ||
| 1646 | + return [formProps, commonProps]; | ||
| 1647 | +}; | ||
| 1648 | + | ||
| 1649 | +const CommonInput = (props: any) => { | ||
| 1650 | + const { | ||
| 1651 | + form, | ||
| 1652 | + sName = "desDataset", | ||
| 1653 | + sLabel = "数据集名称", | ||
| 1654 | + bMuti, | ||
| 1655 | + bFilter, | ||
| 1656 | + bArea, | ||
| 1657 | + noAddonBefore, | ||
| 1658 | + extraProps = {}, | ||
| 1659 | + configOptions = [], | ||
| 1660 | + } = props; | ||
| 1661 | + | ||
| 1662 | + let inputValue = Form.useWatch(sName, form) || []; | ||
| 1663 | + inputValue = inputValue.toString() || ""; | ||
| 1664 | + | ||
| 1665 | + const [valueFilter, afterValue = ""] = inputValue.split("@"); | ||
| 1666 | + | ||
| 1667 | + return ( | ||
| 1668 | + <> | ||
| 1669 | + {bMuti && ( | ||
| 1670 | + <Form.Item label={sLabel}> | ||
| 1671 | + <Select | ||
| 1672 | + options={[...configOptions]} | ||
| 1673 | + value={inputValue ? inputValue.split(",") : []} | ||
| 1674 | + mode="tags" | ||
| 1675 | + onChange={value => form.setFieldsValue({ [sName]: value.join(",") })} | ||
| 1676 | + {...extraProps} | ||
| 1677 | + /> | ||
| 1678 | + </Form.Item> | ||
| 1679 | + )} | ||
| 1680 | + <Form.Item | ||
| 1681 | + label={sLabel} | ||
| 1682 | + name={sName} | ||
| 1683 | + rules={[{ required: true, message: `请输入${sLabel}` }]} | ||
| 1684 | + hidden={bMuti} | ||
| 1685 | + > | ||
| 1686 | + {bArea ? ( | ||
| 1687 | + <Input.TextArea {...extraProps} /> | ||
| 1688 | + ) : ( | ||
| 1689 | + <Input | ||
| 1690 | + addonBefore={ | ||
| 1691 | + !noAddonBefore && ( | ||
| 1692 | + <Space size={20} split={<span style={{ color: "rgba(0,0,0,0.25)" }}>{">>"}</span>}> | ||
| 1693 | + <Select | ||
| 1694 | + style={{ width: 100 }} | ||
| 1695 | + popupMatchSelectWidth={false} | ||
| 1696 | + options={[...configOptions, { label: "自定义", value: "custom" }]} | ||
| 1697 | + optionRender={({ label, value }) => { | ||
| 1698 | + return ( | ||
| 1699 | + <span> | ||
| 1700 | + {label}({value}) | ||
| 1701 | + </span> | ||
| 1702 | + ); | ||
| 1703 | + }} | ||
| 1704 | + value={ | ||
| 1705 | + configOptions.some((item: any) => item.value === valueFilter) | ||
| 1706 | + ? valueFilter | ||
| 1707 | + : "custom" | ||
| 1708 | + } | ||
| 1709 | + onChange={value => { | ||
| 1710 | + let result = value === "custom" ? "" : value; | ||
| 1711 | + if (afterValue) { | ||
| 1712 | + result += `@${afterValue}`; | ||
| 1713 | + } | ||
| 1714 | + form.setFieldValue(sName, result); | ||
| 1715 | + }} | ||
| 1716 | + /> | ||
| 1717 | + {bFilter && ( | ||
| 1718 | + <Select | ||
| 1719 | + style={{ width: 100 }} | ||
| 1720 | + value={afterValue} | ||
| 1721 | + options={[...SIMPLE_DATASET_FILTER_OPTIONS]} | ||
| 1722 | + onChange={value => { | ||
| 1723 | + let result = valueFilter; | ||
| 1724 | + if (value) { | ||
| 1725 | + result += `@${value}`; | ||
| 1726 | + } | ||
| 1727 | + form.setFieldValue(sName, result); | ||
| 1728 | + }} | ||
| 1729 | + /> | ||
| 1730 | + )} | ||
| 1731 | + </Space> | ||
| 1732 | + ) | ||
| 1733 | + } | ||
| 1734 | + // addonAfter={ | ||
| 1735 | + | ||
| 1736 | + // } | ||
| 1737 | + {...extraProps} | ||
| 1738 | + /> | ||
| 1739 | + )} | ||
| 1740 | + </Form.Item> | ||
| 1741 | + </> | ||
| 1742 | + ); | ||
| 1743 | +}; | ||
| 1744 | + | ||
| 1745 | +const CommonInputNumber = (props: any) => { | ||
| 1746 | + const { sName = "time", sLabel = "时间", bMust = false, extraProps = {} } = props; | ||
| 1747 | + return ( | ||
| 1748 | + <Form.Item | ||
| 1749 | + label={sLabel} | ||
| 1750 | + name={sName} | ||
| 1751 | + rules={[{ required: bMust, message: `请输入${sLabel}` }]} | ||
| 1752 | + > | ||
| 1753 | + <InputNumber {...extraProps} /> | ||
| 1754 | + </Form.Item> | ||
| 1755 | + ); | ||
| 1756 | +}; | ||
| 1757 | + | ||
| 1758 | +const CommonCheckBox = (props: any) => { | ||
| 1759 | + const { sName = "", sLabel = "", extraProps = {} } = props; | ||
| 1760 | + return ( | ||
| 1761 | + <Form.Item name={sName} valuePropName="checked" label=" " colon={false} {...extraProps}> | ||
| 1762 | + <Checkbox>{sLabel}</Checkbox> | ||
| 1763 | + </Form.Item> | ||
| 1764 | + ); | ||
| 1765 | +}; | ||
| 1766 | + | ||
| 1767 | +const CommonSelect = (props: any) => { | ||
| 1768 | + const { sName = "reportType", sLabel = "报表类型", options = [] } = props; | ||
| 1769 | + return ( | ||
| 1770 | + <Form.Item label={sLabel} name={sName}> | ||
| 1771 | + <Select options={options} /> | ||
| 1772 | + </Form.Item> | ||
| 1773 | + ); | ||
| 1774 | +}; | ||
| 1775 | + | ||
| 1776 | +const CommonSingleChoice = (props: any) => { | ||
| 1777 | + const { sName = "bPreviewOnly", sLabel = "不显示打印" } = props; | ||
| 1778 | + return ( | ||
| 1779 | + <Form.Item label=" " colon={false} name={sName} valuePropName="checked"> | ||
| 1780 | + <Checkbox>{sLabel}</Checkbox> | ||
| 1781 | + </Form.Item> | ||
| 1782 | + ); | ||
| 1783 | +}; | ||
| 1784 | + | ||
| 1785 | +const CommonDataset = (props: any) => { | ||
| 1786 | + const { | ||
| 1787 | + form, | ||
| 1788 | + sName = "dataset", | ||
| 1789 | + sLabel = "辅助数据集", | ||
| 1790 | + onlyAllData, | ||
| 1791 | + bMust, | ||
| 1792 | + configOptions = [], | ||
| 1793 | + } = props; | ||
| 1794 | + | ||
| 1795 | + const searchRef = useRef<any>(null); | ||
| 1796 | + const [searchValue, setSearchValue] = useState(""); | ||
| 1797 | + | ||
| 1798 | + // 获取当前已选择的值 | ||
| 1799 | + const selectedValues = Form.useWatch(sName, form) || []; | ||
| 1800 | + | ||
| 1801 | + if (typeof selectedValues === "string" && selectedValues) { | ||
| 1802 | + form.setFieldsValue({ [sName]: selectedValues.split(",") }); | ||
| 1803 | + return null; | ||
| 1804 | + } | ||
| 1805 | + | ||
| 1806 | + const option0 = configOptions.map((item: { label: any; value: any }) => ({ | ||
| 1807 | + ...item, | ||
| 1808 | + label: `${item.label}(${item.value})`, | ||
| 1809 | + })); | ||
| 1810 | + | ||
| 1811 | + // 根据已选择的值动态生成选项 | ||
| 1812 | + const options = useMemo(() => { | ||
| 1813 | + return option0.filter( | ||
| 1814 | + (item: { value: string }) => | ||
| 1815 | + !selectedValues.some((i: string) => i.split("@")[0] === item.value) | ||
| 1816 | + ); | ||
| 1817 | + }, [selectedValues]); | ||
| 1818 | + | ||
| 1819 | + return ( | ||
| 1820 | + <Form.Item | ||
| 1821 | + label={sLabel} | ||
| 1822 | + name={sName} | ||
| 1823 | + rules={bMust ? [{ required: true, message: `请填写${sLabel}` }] : []} | ||
| 1824 | + > | ||
| 1825 | + <Select | ||
| 1826 | + ref={searchRef} | ||
| 1827 | + mode="tags" | ||
| 1828 | + searchValue={searchValue} | ||
| 1829 | + onSearch={value => setSearchValue(value)} | ||
| 1830 | + onChange={() => { | ||
| 1831 | + setSearchValue(""); | ||
| 1832 | + }} | ||
| 1833 | + options={options} | ||
| 1834 | + filterSort={(optionA: any, optionB: any) => { | ||
| 1835 | + const valueA = optionA.value.split("@")[0]; | ||
| 1836 | + const valueB = optionB.value.split("@")[0]; | ||
| 1837 | + const bType1 = option0.some((item: any) => item.value === valueA); | ||
| 1838 | + const bType2 = option0.some((item: any) => item.value === valueB); | ||
| 1839 | + | ||
| 1840 | + if (bType1 && !bType2) { | ||
| 1841 | + return -1; | ||
| 1842 | + } | ||
| 1843 | + | ||
| 1844 | + if (bType2 && !bType1) { | ||
| 1845 | + return 1; | ||
| 1846 | + } | ||
| 1847 | + | ||
| 1848 | + if (bType1 && bType2) { | ||
| 1849 | + return ( | ||
| 1850 | + option0.findIndex((item: any) => item.value === valueA) - | ||
| 1851 | + option0.findIndex((item: any) => item.value === valueB) | ||
| 1852 | + ); | ||
| 1853 | + } | ||
| 1854 | + | ||
| 1855 | + if (!bType1 && !bType2) { | ||
| 1856 | + return ( | ||
| 1857 | + selectedValues.findIndex((item: any) => item === optionA.value) - | ||
| 1858 | + selectedValues.findIndex((item: any) => item === optionB.value) | ||
| 1859 | + ); | ||
| 1860 | + } | ||
| 1861 | + | ||
| 1862 | + return 1; | ||
| 1863 | + }} | ||
| 1864 | + optionRender={option => { | ||
| 1865 | + const value0 = option.value as string; | ||
| 1866 | + const [label, type = ""] = value0.split("@"); | ||
| 1867 | + const labelNew = | ||
| 1868 | + option0.find((item: { value: string }) => item.value === label)?.label || label; | ||
| 1869 | + | ||
| 1870 | + return ( | ||
| 1871 | + <Space> | ||
| 1872 | + <div>{labelNew}</div> | ||
| 1873 | + {SIMPLE_DATASET_FILTER_OPTIONS.filter(item => !onlyAllData || !item.value) | ||
| 1874 | + .map(item => ({ | ||
| 1875 | + title: item.label, | ||
| 1876 | + type: item.value, | ||
| 1877 | + })) | ||
| 1878 | + .map(item => ( | ||
| 1879 | + <Button | ||
| 1880 | + type={type === item.type ? "primary" : "default"} | ||
| 1881 | + onClick={event => { | ||
| 1882 | + event.stopPropagation(); | ||
| 1883 | + const selectValue = form.getFieldValue(sName) || []; | ||
| 1884 | + form.setFieldValue(sName, [ | ||
| 1885 | + ...selectValue.filter((x: string) => x.split("@")[0] !== label), | ||
| 1886 | + `${label}${item.type ? "@" : ""}${item.type}`, | ||
| 1887 | + ]); | ||
| 1888 | + setSearchValue(""); | ||
| 1889 | + }} | ||
| 1890 | + > | ||
| 1891 | + {item.title} | ||
| 1892 | + </Button> | ||
| 1893 | + ))} | ||
| 1894 | + </Space> | ||
| 1895 | + ); | ||
| 1896 | + }} | ||
| 1897 | + /> | ||
| 1898 | + </Form.Item> | ||
| 1899 | + ); | ||
| 1900 | +}; | ||
| 1901 | + | ||
| 1902 | +const CommonSValue = (props: any) => { | ||
| 1903 | + const { form } = props; | ||
| 1904 | + | ||
| 1905 | + const dataset = Form.useWatch("dataset", form); | ||
| 1906 | + const datasetList = dataset | ||
| 1907 | + ? dataset.map((item: any) => ({ | ||
| 1908 | + value: item.split("@")[0], | ||
| 1909 | + label: item.split("@")[0], | ||
| 1910 | + })) | ||
| 1911 | + : []; | ||
| 1912 | + | ||
| 1913 | + const sValue = Form.useWatch("sValue", form); | ||
| 1914 | + const tableData = sValue | ||
| 1915 | + ? sValue.split(",").map((item: any, index: number) => { | ||
| 1916 | + if (item === "*") { | ||
| 1917 | + return { | ||
| 1918 | + iRowNum: index + 1, | ||
| 1919 | + sFieldNameNew: "", | ||
| 1920 | + sFieldNameOldPre: "*", | ||
| 1921 | + sFieldNameOld: "", | ||
| 1922 | + }; | ||
| 1923 | + } | ||
| 1924 | + | ||
| 1925 | + if (item.includes(".*")) { | ||
| 1926 | + const sFieldNameOldPre = item.split(".*")[0]; | ||
| 1927 | + return { | ||
| 1928 | + iRowNum: index + 1, | ||
| 1929 | + sFieldNameNew: "", | ||
| 1930 | + sFieldNameOldPre, | ||
| 1931 | + sFieldNameOld: "*", | ||
| 1932 | + }; | ||
| 1933 | + } | ||
| 1934 | + | ||
| 1935 | + const [sFieldNameNew, sFieldNameOld0 = ""] = item.split(":"); | ||
| 1936 | + let [sFieldNameOldPre, sFieldNameOld] = [undefined as any, ""]; | ||
| 1937 | + if (sFieldNameOld0.includes("$") || sFieldNameOld0.includes("var")) { | ||
| 1938 | + [sFieldNameOldPre, sFieldNameOld] = ["var", sFieldNameOld0]; | ||
| 1939 | + } else if (sFieldNameOld0.includes(".")) { | ||
| 1940 | + [sFieldNameOldPre, sFieldNameOld] = sFieldNameOld0.split("."); | ||
| 1941 | + } else if (sFieldNameOld0.includes("'")) { | ||
| 1942 | + [sFieldNameOldPre, sFieldNameOld] = ["string", sFieldNameOld0.replace(/'/g, "")]; | ||
| 1943 | + } else if (sFieldNameOld0 !== "") { | ||
| 1944 | + [sFieldNameOldPre, sFieldNameOld] = ["number", sFieldNameOld0]; | ||
| 1945 | + } else { | ||
| 1946 | + [sFieldNameOldPre, sFieldNameOld] = [undefined, ""]; | ||
| 1947 | + } | ||
| 1948 | + | ||
| 1949 | + return { | ||
| 1950 | + iRowNum: index + 1, | ||
| 1951 | + sFieldNameNew, | ||
| 1952 | + sFieldNameOldPre, | ||
| 1953 | + sFieldNameOld, | ||
| 1954 | + }; | ||
| 1955 | + }) | ||
| 1956 | + : []; | ||
| 1957 | + | ||
| 1958 | + const handleChangeValue = (record: any) => { | ||
| 1959 | + const sValueList = sValue.split(","); | ||
| 1960 | + const { sFieldNameOldPre, index } = record; | ||
| 1961 | + | ||
| 1962 | + if (sFieldNameOldPre === "*") { | ||
| 1963 | + sValueList[index] = "*"; | ||
| 1964 | + } else if (sFieldNameOldPre === "number") { | ||
| 1965 | + sValueList[index] = `${record.sFieldNameNew || ""}:${Number(record.sFieldNameOld) || 0}`; | ||
| 1966 | + } else if (sFieldNameOldPre === "string") { | ||
| 1967 | + sValueList[index] = `${record.sFieldNameNew || ""}:'${record.sFieldNameOld || ""}'`; | ||
| 1968 | + } else if (sFieldNameOldPre === "var") { | ||
| 1969 | + sValueList[index] = `${record.sFieldNameNew || ""}:${record.sFieldNameOld || "${}"}`; | ||
| 1970 | + } else if (sFieldNameOldPre) { | ||
| 1971 | + sValueList[index] = `${record.sFieldNameNew || ""}${ | ||
| 1972 | + record.sFieldNameOld !== "*" ? ":" : "" | ||
| 1973 | + }${sFieldNameOldPre}.${record.sFieldNameOld || ""}`; | ||
| 1974 | + } else { | ||
| 1975 | + sValueList[index] = `${record.sFieldNameNew || ""}:`; | ||
| 1976 | + } | ||
| 1977 | + form.setFieldValue("sValue", sValueList.toString()); | ||
| 1978 | + }; | ||
| 1979 | + | ||
| 1980 | + return ( | ||
| 1981 | + <> | ||
| 1982 | + <Form.Item label="赋值" name="sValue" rules={[{ required: true, message: "请输入赋值内容" }]}> | ||
| 1983 | + <Input.TextArea /> | ||
| 1984 | + </Form.Item> | ||
| 1985 | + <Form.Item label=" " colon={false} wrapperCol={{ flex: "calc(100% - 150px)" }}> | ||
| 1986 | + <Table | ||
| 1987 | + bordered | ||
| 1988 | + dataSource={tableData} | ||
| 1989 | + columns={[ | ||
| 1990 | + { | ||
| 1991 | + title: "#", | ||
| 1992 | + width: 50, | ||
| 1993 | + dataIndex: "iRowNum", | ||
| 1994 | + }, | ||
| 1995 | + { | ||
| 1996 | + title: "现字段", | ||
| 1997 | + width: "auto", | ||
| 1998 | + dataIndex: "sFieldNameNew", | ||
| 1999 | + render: (text: string, record: any, index: number) => { | ||
| 2000 | + return ( | ||
| 2001 | + <Input | ||
| 2002 | + value={text} | ||
| 2003 | + disabled={[record.sFieldNameOldPre, record.sFieldNameOld].includes("*")} | ||
| 2004 | + onChange={event => { | ||
| 2005 | + handleChangeValue({ ...record, sFieldNameNew: event.target.value, index }); | ||
| 2006 | + }} | ||
| 2007 | + /> | ||
| 2008 | + ); | ||
| 2009 | + }, | ||
| 2010 | + }, | ||
| 2011 | + { | ||
| 2012 | + title: "源字段", | ||
| 2013 | + width: "auto", | ||
| 2014 | + dataIndex: "sFieldNameOld", | ||
| 2015 | + render: (text: string, record: any, index: number) => { | ||
| 2016 | + return ( | ||
| 2017 | + <Input | ||
| 2018 | + value={text} | ||
| 2019 | + disabled={record.sFieldNameOldPre === "*"} | ||
| 2020 | + onChange={event => { | ||
| 2021 | + handleChangeValue({ ...record, sFieldNameOld: event.target.value, index }); | ||
| 2022 | + }} | ||
| 2023 | + addonBefore={ | ||
| 2024 | + <Select | ||
| 2025 | + value={record.sFieldNameOldPre} | ||
| 2026 | + placeholder="类型" | ||
| 2027 | + style={{ minWidth: 80 }} | ||
| 2028 | + popupMatchSelectWidth={false} | ||
| 2029 | + options={[ | ||
| 2030 | + { label: "全部(*)", value: "*" }, | ||
| 2031 | + ...ROW_PRE_OPTIONS, | ||
| 2032 | + ...datasetList, | ||
| 2033 | + { label: "自定义计算", value: "var" }, | ||
| 2034 | + ]} | ||
| 2035 | + onChange={value => { | ||
| 2036 | + handleChangeValue({ | ||
| 2037 | + ...record, | ||
| 2038 | + sFieldNameOldPre: value, | ||
| 2039 | + sFieldNameOld: "", | ||
| 2040 | + index, | ||
| 2041 | + }); | ||
| 2042 | + }} | ||
| 2043 | + /> | ||
| 2044 | + } | ||
| 2045 | + /> | ||
| 2046 | + ); | ||
| 2047 | + }, | ||
| 2048 | + }, | ||
| 2049 | + { | ||
| 2050 | + title: () => { | ||
| 2051 | + return ( | ||
| 2052 | + <Space> | ||
| 2053 | + <div>操作</div> | ||
| 2054 | + <Button | ||
| 2055 | + type="link" | ||
| 2056 | + onClick={() => { | ||
| 2057 | + const sValue = form.getFieldValue("sValue") || ""; | ||
| 2058 | + form.setFieldValue("sValue", sValue ? `${sValue},` : ":"); | ||
| 2059 | + }} | ||
| 2060 | + > | ||
| 2061 | + 新增 | ||
| 2062 | + </Button> | ||
| 2063 | + </Space> | ||
| 2064 | + ); | ||
| 2065 | + }, | ||
| 2066 | + width: 150, | ||
| 2067 | + dataIndex: "operation", | ||
| 2068 | + render: (_, _1, index) => { | ||
| 2069 | + return ( | ||
| 2070 | + <Button | ||
| 2071 | + type="primary" | ||
| 2072 | + onClick={() => { | ||
| 2073 | + const sValue = form.getFieldValue("sValue"); | ||
| 2074 | + const sValueList = sValue.split(","); | ||
| 2075 | + sValueList.splice(index, 1); | ||
| 2076 | + form.setFieldValue("sValue", sValueList.toString()); | ||
| 2077 | + }} | ||
| 2078 | + > | ||
| 2079 | + 删除 | ||
| 2080 | + </Button> | ||
| 2081 | + ); | ||
| 2082 | + }, | ||
| 2083 | + }, | ||
| 2084 | + ]} | ||
| 2085 | + locale={{ emptyText: "暂无数据" }} | ||
| 2086 | + pagination={false} | ||
| 2087 | + scroll={{ y: 410 }} | ||
| 2088 | + /> | ||
| 2089 | + </Form.Item> | ||
| 2090 | + </> | ||
| 2091 | + ); | ||
| 2092 | +}; | ||
| 2093 | + | ||
| 2094 | +const MyFilterRulesGroup = ({ dataSetList, rowValues, rowKey, onChange, form }: any) => { | ||
| 2095 | + const { | ||
| 2096 | + configOptions = [], | ||
| 2097 | + configValueOptions = {}, | ||
| 2098 | + srcModelsOptions = [], | ||
| 2099 | + } = useContext(myContext); | ||
| 2100 | + const { pre1, value1, condition, pre2, value2 } = rowValues; | ||
| 2101 | + const bHasDataset = !!form?.getFieldValue("dataset"); | ||
| 2102 | + | ||
| 2103 | + let conditionOption = CONDITION_DATA; // 条件下拉 | ||
| 2104 | + let hide2 = false; // pre2、value2隐藏 | ||
| 2105 | + let showRaido = false; // 显示raido选择框 | ||
| 2106 | + let bModelsId = value1 === "sSrcModelsId"; // 是否模块id | ||
| 2107 | + let bCustom = pre1 === "custom"; // 自定义代码 | ||
| 2108 | + | ||
| 2109 | + //如果pre1为slave之类 | ||
| 2110 | + if ( | ||
| 2111 | + pre1 && | ||
| 2112 | + value1 && | ||
| 2113 | + pre1 !== "master" && | ||
| 2114 | + configOptions.some((item: any) => item.value === pre1) && | ||
| 2115 | + !bHasDataset | ||
| 2116 | + ) { | ||
| 2117 | + // value1为b开头 | ||
| 2118 | + if (value1.startsWith("b")) { | ||
| 2119 | + hide2 = true; | ||
| 2120 | + conditionOption = CONDITION_DATA_TYPEB; | ||
| 2121 | + } else { | ||
| 2122 | + conditionOption = CONDITION_DATA_TYPE_NOTB; | ||
| 2123 | + } | ||
| 2124 | + } | ||
| 2125 | + | ||
| 2126 | + // 如果是模块id且pre1为props|master,condition取前两个 | ||
| 2127 | + if (bModelsId && ["props", "master"].includes(pre1)) { | ||
| 2128 | + conditionOption = [conditionOption[0], conditionOption[1]]; | ||
| 2129 | + } | ||
| 2130 | + | ||
| 2131 | + // 如果条件包含empty字段 | ||
| 2132 | + if (condition?.includes("empty")) { | ||
| 2133 | + hide2 = true; | ||
| 2134 | + } | ||
| 2135 | + | ||
| 2136 | + if (["props", "master"].includes(pre1) && (value1?.startsWith("b") || value1 === "enabled")) { | ||
| 2137 | + showRaido = true; | ||
| 2138 | + } | ||
| 2139 | + | ||
| 2140 | + // condition默认为第一个 | ||
| 2141 | + useEffect(() => { | ||
| 2142 | + if (!condition || !conditionOption.some((item: any) => item.value === condition)) { | ||
| 2143 | + onChange(rowKey, { ...rowValues, condition: conditionOption[0].value }); | ||
| 2144 | + } | ||
| 2145 | + }, [pre1]); | ||
| 2146 | + | ||
| 2147 | + // 如果hide2为true,保证pre2、value2为空 | ||
| 2148 | + useEffect(() => { | ||
| 2149 | + if (hide2 && (pre2 || value2)) { | ||
| 2150 | + onChange(rowKey, { ...rowValues, pre2: undefined, value2: "" }); | ||
| 2151 | + } | ||
| 2152 | + }, [hide2]); | ||
| 2153 | + | ||
| 2154 | + // 如果显示raido选择框且condition不包含empty字段时,默认condition为是 | ||
| 2155 | + useEffect(() => { | ||
| 2156 | + if (showRaido && !condition?.includes("empty")) { | ||
| 2157 | + onChange(rowKey, { ...rowValues, condition: "!empty", pre2: undefined, value2: "" }); | ||
| 2158 | + } | ||
| 2159 | + }, [showRaido]); | ||
| 2160 | + | ||
| 2161 | + // 如果value1为s|i|d|t开头且hide2为false | ||
| 2162 | + useEffect(() => { | ||
| 2163 | + let addState = {} as any; | ||
| 2164 | + // condition默认为第一个 | ||
| 2165 | + if (!condition || !conditionOption.some((item: any) => item.value === condition)) { | ||
| 2166 | + addState.condition = conditionOption[0].value; | ||
| 2167 | + } | ||
| 2168 | + if ( | ||
| 2169 | + value1?.startsWith("s") || | ||
| 2170 | + value1?.startsWith("i") || | ||
| 2171 | + value1?.startsWith("d") || | ||
| 2172 | + value1?.startsWith("t") | ||
| 2173 | + ) { | ||
| 2174 | + if (!hide2 && (value1?.startsWith("s") || value1?.startsWith("t"))) { | ||
| 2175 | + // 如果pre2不是string,设置为string | ||
| 2176 | + if (pre2 !== "string") { | ||
| 2177 | + addState.pre2 = "string"; | ||
| 2178 | + } | ||
| 2179 | + } | ||
| 2180 | + if (!hide2 && (value1?.startsWith("i") || value1?.startsWith("d"))) { | ||
| 2181 | + // 如果pre2不是number,设置为number | ||
| 2182 | + if (pre2 !== "number") { | ||
| 2183 | + addState.pre2 = "number"; | ||
| 2184 | + } | ||
| 2185 | + } | ||
| 2186 | + } | ||
| 2187 | + if (JSON.stringify(addState) !== "{}") { | ||
| 2188 | + onChange(rowKey, { ...rowValues, ...addState }); | ||
| 2189 | + } | ||
| 2190 | + }, [value1, condition]); | ||
| 2191 | + | ||
| 2192 | + // 自定义时多余字段清空 | ||
| 2193 | + useEffect(() => { | ||
| 2194 | + if (bCustom) { | ||
| 2195 | + onChange(rowKey, { ...rowValues, condition: undefined, pre2: undefined, value2: "" }); | ||
| 2196 | + } | ||
| 2197 | + }, [bCustom]); | ||
| 2198 | + | ||
| 2199 | + const handleChangeValue = (value: any, key: string) => { | ||
| 2200 | + let changeValue = { pre1, value1, condition, pre2, value2, [key]: value }; | ||
| 2201 | + onChange(rowKey, changeValue); | ||
| 2202 | + }; | ||
| 2203 | + | ||
| 2204 | + const options = [ | ||
| 2205 | + ...dataSetList, | ||
| 2206 | + ...PROPS_OPTIONS, | ||
| 2207 | + ...(!bHasDataset ? configOptions : []), | ||
| 2208 | + { label: "自定义", value: "custom" }, | ||
| 2209 | + ]; | ||
| 2210 | + | ||
| 2211 | + return ( | ||
| 2212 | + <Space> | ||
| 2213 | + <Input | ||
| 2214 | + style={{ width: bCustom ? 800 : "auto" }} | ||
| 2215 | + placeholder={bCustom ? "请输入自定义内容" : "字段名"} | ||
| 2216 | + addonBefore={ | ||
| 2217 | + <Select | ||
| 2218 | + style={{ minWidth: 80 }} | ||
| 2219 | + popupMatchSelectWidth={false} | ||
| 2220 | + placeholder="表名" | ||
| 2221 | + options={options} | ||
| 2222 | + optionRender={({ label, value }) => { | ||
| 2223 | + return ( | ||
| 2224 | + <span> | ||
| 2225 | + {label}({value}) | ||
| 2226 | + </span> | ||
| 2227 | + ); | ||
| 2228 | + }} | ||
| 2229 | + value={pre1} | ||
| 2230 | + showSearch | ||
| 2231 | + filterOption={(inputValue, option) => { | ||
| 2232 | + const condition1 = | ||
| 2233 | + option?.value?.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1; | ||
| 2234 | + const condition2 = | ||
| 2235 | + option?.label?.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1; | ||
| 2236 | + return condition1 || condition2; | ||
| 2237 | + }} | ||
| 2238 | + onChange={value => handleChangeValue(value, "pre1")} | ||
| 2239 | + /> | ||
| 2240 | + } | ||
| 2241 | + addonAfter={ | ||
| 2242 | + !bCustom && ( | ||
| 2243 | + <Select | ||
| 2244 | + // style={{ minWidth: 80 }} | ||
| 2245 | + popupMatchSelectWidth={false} | ||
| 2246 | + // placeholder="表字段" | ||
| 2247 | + options={[...(configValueOptions[pre1] || [])]} | ||
| 2248 | + value={ | ||
| 2249 | + configValueOptions[pre1]?.some((item: any) => item.value === value1) ? value1 : null | ||
| 2250 | + } | ||
| 2251 | + showSearch | ||
| 2252 | + filterOption={(inputValue, option) => { | ||
| 2253 | + const condition1 = | ||
| 2254 | + option?.value?.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1; | ||
| 2255 | + const condition2 = | ||
| 2256 | + option?.label?.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1; | ||
| 2257 | + return condition1 || condition2; | ||
| 2258 | + }} | ||
| 2259 | + optionRender={({ label, value }) => { | ||
| 2260 | + return ( | ||
| 2261 | + <span> | ||
| 2262 | + {label}({value}) | ||
| 2263 | + </span> | ||
| 2264 | + ); | ||
| 2265 | + }} | ||
| 2266 | + onChange={value => handleChangeValue(value, "value1")} | ||
| 2267 | + /> | ||
| 2268 | + ) | ||
| 2269 | + } | ||
| 2270 | + value={value1} | ||
| 2271 | + onChange={e => handleChangeValue(e.target.value, "value1")} | ||
| 2272 | + /> | ||
| 2273 | + {(() => { | ||
| 2274 | + if (bCustom) return ""; | ||
| 2275 | + if (showRaido) { | ||
| 2276 | + return ( | ||
| 2277 | + <Radio.Group | ||
| 2278 | + options={RADIO_OPTIONS} | ||
| 2279 | + onChange={e => handleChangeValue(e.target.value, "condition")} | ||
| 2280 | + value={condition} | ||
| 2281 | + optionType="button" | ||
| 2282 | + buttonStyle="solid" | ||
| 2283 | + /> | ||
| 2284 | + ); | ||
| 2285 | + } | ||
| 2286 | + return ( | ||
| 2287 | + <> | ||
| 2288 | + <Select | ||
| 2289 | + value={condition} | ||
| 2290 | + style={{ width: "auto", minWidth: 140 }} | ||
| 2291 | + placeholder="判断条件" | ||
| 2292 | + options={conditionOption} | ||
| 2293 | + showSearch | ||
| 2294 | + filterOption={(inputValue, option) => { | ||
| 2295 | + const condition1 = | ||
| 2296 | + option?.value?.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1; | ||
| 2297 | + const condition2 = | ||
| 2298 | + option?.label?.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1; | ||
| 2299 | + return condition1 || condition2; | ||
| 2300 | + }} | ||
| 2301 | + onChange={value => handleChangeValue(value, "condition")} | ||
| 2302 | + /> | ||
| 2303 | + <Input | ||
| 2304 | + style={{ width: "auto", ...(hide2 ? { display: "none" } : {}) }} | ||
| 2305 | + placeholder="字段值" | ||
| 2306 | + addonBefore={ | ||
| 2307 | + <Select | ||
| 2308 | + style={{ minWidth: 80 }} | ||
| 2309 | + popupMatchSelectWidth={false} | ||
| 2310 | + placeholder="表名" | ||
| 2311 | + options={[...ROW_PRE_OPTIONS, ...dataSetList]} | ||
| 2312 | + value={pre2} | ||
| 2313 | + onChange={value => handleChangeValue(value, "pre2")} | ||
| 2314 | + /> | ||
| 2315 | + } | ||
| 2316 | + value={value2} | ||
| 2317 | + onChange={e => handleChangeValue(e.target.value, "value2")} | ||
| 2318 | + {...(() => { | ||
| 2319 | + if (bModelsId) { | ||
| 2320 | + return { | ||
| 2321 | + addonAfter: ( | ||
| 2322 | + <Select | ||
| 2323 | + // style={{ minWidth: 80 }} | ||
| 2324 | + popupMatchSelectWidth={300} | ||
| 2325 | + // placeholder="表字段" | ||
| 2326 | + virtual={true} | ||
| 2327 | + options={[...srcModelsOptions]} | ||
| 2328 | + value={ | ||
| 2329 | + srcModelsOptions.some((item: any) => item.value === value2) | ||
| 2330 | + ? value2 | ||
| 2331 | + : null | ||
| 2332 | + } | ||
| 2333 | + showSearch | ||
| 2334 | + filterOption={(inputValue, option) => { | ||
| 2335 | + const condition1 = | ||
| 2336 | + option?.value?.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1; | ||
| 2337 | + const condition2 = | ||
| 2338 | + option?.label?.toUpperCase().indexOf(inputValue.toUpperCase()) !== -1; | ||
| 2339 | + return condition1 || condition2; | ||
| 2340 | + }} | ||
| 2341 | + onChange={value => handleChangeValue(value, "value2")} | ||
| 2342 | + /> | ||
| 2343 | + ), | ||
| 2344 | + }; | ||
| 2345 | + } | ||
| 2346 | + return {}; | ||
| 2347 | + })()} | ||
| 2348 | + /> | ||
| 2349 | + </> | ||
| 2350 | + ); | ||
| 2351 | + })()} | ||
| 2352 | + </Space> | ||
| 2353 | + ); | ||
| 2354 | +}; | ||
| 2355 | +const CommonCondition = (props: any) => { | ||
| 2356 | + const { form, item, dependsWith } = props; | ||
| 2357 | + | ||
| 2358 | + const typeJson = SIMPLE_DATASET_FILTER_OPTIONS.reduce((pre: any, item) => { | ||
| 2359 | + pre[item.value] = item.label; | ||
| 2360 | + return pre; | ||
| 2361 | + }, {}); | ||
| 2362 | + | ||
| 2363 | + const desDataset = Form.useWatch("desDataset", form) || ""; | ||
| 2364 | + const dataset = Form.useWatch("dataset", form) || []; | ||
| 2365 | + const dataSetList = dataset.map((item: any) => ({ | ||
| 2366 | + label: item.split("@")[0] + typeJson[item.split("@")[1] || ""], | ||
| 2367 | + value: item.split("@")[0], | ||
| 2368 | + })); | ||
| 2369 | + | ||
| 2370 | + const initData = { | ||
| 2371 | + key: shortid(), | ||
| 2372 | + level: 1, | ||
| 2373 | + type: 1, | ||
| 2374 | + children: [ | ||
| 2375 | + { | ||
| 2376 | + rowValues: INIT_ROW_VALUES, | ||
| 2377 | + key: shortid(), | ||
| 2378 | + level: 1, | ||
| 2379 | + }, | ||
| 2380 | + ], | ||
| 2381 | + }; | ||
| 2382 | + | ||
| 2383 | + const [data, setData] = useState(initData); | ||
| 2384 | + | ||
| 2385 | + const conditionData = Form.useWatch("conditionData", form); | ||
| 2386 | + const flag = useRef(0); | ||
| 2387 | + useEffect(() => { | ||
| 2388 | + if (flag.current > 2) return; | ||
| 2389 | + if (conditionData) { | ||
| 2390 | + const dataNew = JSON.parse(conditionData); | ||
| 2391 | + if (dataNew.length >= 2) { | ||
| 2392 | + setData(convertStr2Data(dataNew)); | ||
| 2393 | + } | ||
| 2394 | + } | ||
| 2395 | + }, [conditionData]); | ||
| 2396 | + | ||
| 2397 | + let preDataSetList = desDataset | ||
| 2398 | + ? [{ label: `${desDataset}每条数据`, value: `${desDataset}One` }] | ||
| 2399 | + : []; | ||
| 2400 | + if (item.type === "filter") { | ||
| 2401 | + const srcDataset = Form.useWatch("srcDataset", form) || ""; | ||
| 2402 | + const srcDatasetNew = srcDataset.split("@")[0]; | ||
| 2403 | + preDataSetList = srcDataset | ||
| 2404 | + ? [{ label: `${srcDatasetNew}每条数据`, value: `${srcDatasetNew}One` }] | ||
| 2405 | + : []; | ||
| 2406 | + } else if (item.type === "edit") { | ||
| 2407 | + const desDatasetNew = desDataset.split("@")[0]; | ||
| 2408 | + preDataSetList = desDataset | ||
| 2409 | + ? [{ label: `${desDatasetNew}每条数据`, value: `${desDatasetNew}One` }] | ||
| 2410 | + : []; | ||
| 2411 | + } else if (dependsWith) { | ||
| 2412 | + // const dataset = Form.useWatch(dependsWith, form) || []; | ||
| 2413 | + // preDataSetList = dataset.length ? [{ label: `${dataset[0].split("@")[0]}One`, value: `${dataset[0].split("@")[0]}One` }] : []; | ||
| 2414 | + } | ||
| 2415 | + | ||
| 2416 | + return ( | ||
| 2417 | + <> | ||
| 2418 | + <Form.Item label="筛选条件" name="condition"> | ||
| 2419 | + <Input.TextArea readOnly /> | ||
| 2420 | + </Form.Item> | ||
| 2421 | + <Form.Item label="筛选数据" name="conditionData" style={{ display: "none" }}> | ||
| 2422 | + <Input.TextArea /> | ||
| 2423 | + </Form.Item> | ||
| 2424 | + <div style={{ paddingLeft: 150, marginBottom: 10 }}> | ||
| 2425 | + <FilterRules | ||
| 2426 | + component={props => ( | ||
| 2427 | + <MyFilterRulesGroup | ||
| 2428 | + {...props} | ||
| 2429 | + form={form} | ||
| 2430 | + dataSetList={[...preDataSetList, ...dataSetList]} | ||
| 2431 | + /> | ||
| 2432 | + )} | ||
| 2433 | + value={data} | ||
| 2434 | + onChange={(value: any) => { | ||
| 2435 | + let valueNew = cloneDeep(value); | ||
| 2436 | + if (!valueNew) { | ||
| 2437 | + valueNew = initData; | ||
| 2438 | + } else if (!valueNew.children) { | ||
| 2439 | + valueNew = { | ||
| 2440 | + key: shortid(), | ||
| 2441 | + level: 1, | ||
| 2442 | + type: 1, | ||
| 2443 | + children: [value], | ||
| 2444 | + }; | ||
| 2445 | + } else if (!valueNew.children.length) { | ||
| 2446 | + valueNew = initData; | ||
| 2447 | + } | ||
| 2448 | + setData(valueNew); | ||
| 2449 | + flag.current++; | ||
| 2450 | + form.setFieldValue("condition", convertData2Str(valueNew, false)); | ||
| 2451 | + form.setFieldValue("conditionData", JSON.stringify(convertData2Str(valueNew, true))); | ||
| 2452 | + }} | ||
| 2453 | + initValues={INIT_ROW_VALUES} | ||
| 2454 | + notEmpty={{ data: false }} | ||
| 2455 | + /> | ||
| 2456 | + </div> | ||
| 2457 | + </> | ||
| 2458 | + ); | ||
| 2459 | +}; | ||
| 2460 | + | ||
| 2461 | +const CommonSaveBtn = (props: any) => { | ||
| 2462 | + return ( | ||
| 2463 | + <Form.Item label=" " colon={false}> | ||
| 2464 | + <Button type="primary" htmlType="submit"> | ||
| 2465 | + 更新指令集 | ||
| 2466 | + </Button> | ||
| 2467 | + </Form.Item> | ||
| 2468 | + ); | ||
| 2469 | +}; | ||
| 2470 | + | ||
| 2471 | +const handleGetChangeData = (props: any) => { | ||
| 2472 | + const { instructionList, item } = props; | ||
| 2473 | + | ||
| 2474 | + const instructionListNew = cloneDeep(instructionList) as InstructionItem[]; | ||
| 2475 | + | ||
| 2476 | + const findNodePath = (treeData: any[], key: string, path: number[] = []): number[] | null => { | ||
| 2477 | + for (let i = 0; i < treeData.length; i++) { | ||
| 2478 | + const node = treeData[i]; | ||
| 2479 | + // 如果当前节点匹配key,返回当前路径 | ||
| 2480 | + if (node.key === key) { | ||
| 2481 | + return [...path, i]; | ||
| 2482 | + } | ||
| 2483 | + | ||
| 2484 | + // 如果当前节点有子节点,递归查找 | ||
| 2485 | + if (node.children && node.children.length > 0) { | ||
| 2486 | + const foundPath = findNodePath(node.children, key, [...path, i]); | ||
| 2487 | + if (foundPath) { | ||
| 2488 | + return foundPath; | ||
| 2489 | + } | ||
| 2490 | + } | ||
| 2491 | + } | ||
| 2492 | + | ||
| 2493 | + // 未找到返回null | ||
| 2494 | + return null; | ||
| 2495 | + }; | ||
| 2496 | + | ||
| 2497 | + const targetNodePath = findNodePath(instructionListNew, item.key) || []; | ||
| 2498 | + | ||
| 2499 | + let targetItem = instructionListNew as any; | ||
| 2500 | + for (let i = 0; i < targetNodePath.length; i++) { | ||
| 2501 | + if (i === targetNodePath.length - 1) { | ||
| 2502 | + targetItem = targetItem[targetNodePath[i]]; | ||
| 2503 | + } else { | ||
| 2504 | + targetItem = targetItem[targetNodePath[i]].children; | ||
| 2505 | + } | ||
| 2506 | + } | ||
| 2507 | + | ||
| 2508 | + return { | ||
| 2509 | + instructionListNew, | ||
| 2510 | + targetItem, | ||
| 2511 | + targetNodePath, | ||
| 2512 | + }; | ||
| 2513 | +}; | ||
| 2514 | + | ||
| 2515 | +const handleUpdateData = (props: any, handleType = "update") => { | ||
| 2516 | + const { setState, form, item } = props; | ||
| 2517 | + | ||
| 2518 | + const { instructionListNew, targetItem, targetNodePath } = handleGetChangeData(props); | ||
| 2519 | + | ||
| 2520 | + if (handleType == "update") { | ||
| 2521 | + // Step 2: 修改节点 | ||
| 2522 | + const values = form.getFieldsValue(); | ||
| 2523 | + targetItem.content = Object.keys(values).reduce( | ||
| 2524 | + (pre: { opr: any; [key: string]: any }, key) => { | ||
| 2525 | + if (key === "data" && values[key].length) { | ||
| 2526 | + pre[key] = values[key].map((item: any) => { | ||
| 2527 | + if (item.name && typeof item.name === "object") { | ||
| 2528 | + return { | ||
| 2529 | + ...item, | ||
| 2530 | + name: item.name.join(","), | ||
| 2531 | + }; | ||
| 2532 | + } else { | ||
| 2533 | + return item; | ||
| 2534 | + } | ||
| 2535 | + }); | ||
| 2536 | + } else if (typeof values[key] === "object" && key !== "data") { | ||
| 2537 | + pre[key] = values[key].join(","); | ||
| 2538 | + } else if (values[key]) { | ||
| 2539 | + pre[key] = values[key]; | ||
| 2540 | + } | ||
| 2541 | + return pre; | ||
| 2542 | + }, | ||
| 2543 | + { opr: item.type } | ||
| 2544 | + ) as any; | ||
| 2545 | + } else if (handleType == "delete") { | ||
| 2546 | + // Step 2: 删除节点 | ||
| 2547 | + let evalStr = "instructionListNew"; | ||
| 2548 | + for (let i = 0; i < targetNodePath.length; i++) { | ||
| 2549 | + if (i === targetNodePath.length - 1) { | ||
| 2550 | + evalStr += `.splice(${targetNodePath[i]}, 1)`; | ||
| 2551 | + } else { | ||
| 2552 | + evalStr += `[${targetNodePath[i]}].children`; | ||
| 2553 | + } | ||
| 2554 | + } | ||
| 2555 | + | ||
| 2556 | + eval(evalStr); | ||
| 2557 | + } | ||
| 2558 | + | ||
| 2559 | + setState({ instructionList: instructionListNew }); | ||
| 2560 | +}; | ||
| 2561 | + | ||
| 2562 | +export default Index; |
src/pages/type.ts
0 → 100644
| 1 | +++ a/src/pages/type.ts | ||
| 1 | +export interface InstructionItem { | ||
| 2 | + bFullMode: boolean; | ||
| 3 | + title: string; | ||
| 4 | + key: string; | ||
| 5 | + type: string; | ||
| 6 | + mode: string; | ||
| 7 | + content: { | ||
| 8 | + opr: string; | ||
| 9 | + desDataset: string; | ||
| 10 | + srcDataset: string; | ||
| 11 | + newDataset: string; | ||
| 12 | + dataset: string; | ||
| 13 | + sValue: string; | ||
| 14 | + condition: string; | ||
| 15 | + conditionData: any; | ||
| 16 | + }; | ||
| 17 | + children?: InstructionItem[]; | ||
| 18 | +} | ||
| 19 | + | ||
| 20 | +export interface StateType { | ||
| 21 | + baseList: InstructionItem[]; | ||
| 22 | + funList: InstructionItem[]; | ||
| 23 | + btnsList: InstructionItem[]; | ||
| 24 | + instructionList: InstructionItem[]; | ||
| 25 | + [propName: string]: any; | ||
| 26 | +} | ||
| 27 | + | ||
| 28 | +export interface ContextType extends StateType { | ||
| 29 | + setState: (payload: Partial<StateType>) => void; | ||
| 30 | +} |
src/utils/utils.tsx
0 → 100644
tsconfig.json
0 → 100644
typings.d.ts
0 → 100644