Showing
3 changed files
with
41 additions
and
70 deletions
| ... | @@ -478,28 +478,30 @@ | ... | @@ -478,28 +478,30 @@ |
| 478 | </template> | 478 | </template> |
| 479 | </el-dialog> | 479 | </el-dialog> |
| 480 | 480 | ||
| 481 | - <el-dialog v-model="state.dialogPreviewVisible" title="预览" width="80%" center> | 481 | + <el-dialog class="preview-dialog" v-model="state.dialogPreviewVisible" title="预览节点流程" width="100%" center style="margin-top: 0; margin-bottom: 0;"> |
| 482 | - <div class="preview-container" style="height: 500px; overflow: scroll;"> | 482 | + <div class="preview-container" :style="{height: state.window_height}"> |
| 483 | <vue-flow-editor-form | 483 | <vue-flow-editor-form |
| 484 | ref="editor" | 484 | ref="editor" |
| 485 | - height="500px" | 485 | + :height="state.window_height" |
| 486 | :data="flowData" | 486 | :data="flowData" |
| 487 | :grid="showGrid" | 487 | :grid="showGrid" |
| 488 | :miniMap="showMiniMap" | 488 | :miniMap="showMiniMap" |
| 489 | :onRef="onRef" | 489 | :onRef="onRef" |
| 490 | :multipleSelect="showMultipleSelect" | 490 | :multipleSelect="showMultipleSelect" |
| 491 | :loading="state.editorLoading" | 491 | :loading="state.editorLoading" |
| 492 | - :beforeAdd="handlePreviewBeforeAdd" | ||
| 493 | - @dragstart-node="onDragStartNode" | ||
| 494 | @click-node="onClickNodePreview" | 492 | @click-node="onClickNodePreview" |
| 495 | :controlConfig="state.controlConfig" | 493 | :controlConfig="state.controlConfig" |
| 496 | :toolbarButtonHandler="toolbarButtonHandler" | 494 | :toolbarButtonHandler="toolbarButtonHandler" |
| 497 | ></vue-flow-editor-form> | 495 | ></vue-flow-editor-form> |
| 498 | </div> | 496 | </div> |
| 497 | + <div class="preview-detail-container"> | ||
| 498 | + {{ state.detailModel }} | ||
| 499 | + <iframe src="https://oa-dev.onwall.cn/f/custom_form/front/index.html#/?code=fboupg&model=preview" width="100%" height="100%" style="border: 0;"></iframe> | ||
| 500 | + </div> | ||
| 499 | <template #footer> | 501 | <template #footer> |
| 500 | <span class="dialog-footer"> | 502 | <span class="dialog-footer"> |
| 501 | <el-button @click="state.dialogPreviewVisible = false">取消</el-button> | 503 | <el-button @click="state.dialogPreviewVisible = false">取消</el-button> |
| 502 | - <el-button color="#009688" @click="confirmSort">确认</el-button> | 504 | + <el-button color="#009688" @click="state.dialogPreviewVisible = false">确认</el-button> |
| 503 | </span> | 505 | </span> |
| 504 | </template> | 506 | </template> |
| 505 | </el-dialog> | 507 | </el-dialog> |
| ... | @@ -672,6 +674,7 @@ export default { | ... | @@ -672,6 +674,7 @@ export default { |
| 672 | node_attr: {}, | 674 | node_attr: {}, |
| 673 | node_tree: {}, | 675 | node_tree: {}, |
| 674 | show_preview: false, | 676 | show_preview: false, |
| 677 | + window_height: '500px' | ||
| 675 | }); | 678 | }); |
| 676 | 679 | ||
| 677 | const setNodeTree = (id: string, data: object) => { | 680 | const setNodeTree = (id: string, data: object) => { |
| ... | @@ -908,6 +911,8 @@ export default { | ... | @@ -908,6 +911,8 @@ export default { |
| 908 | // state.detailModel = null; | 911 | // state.detailModel = null; |
| 909 | // editor.closeModel(); | 912 | // editor.closeModel(); |
| 910 | // }); | 913 | // }); |
| 914 | + // 适口高度 | ||
| 915 | + state.window_height = $(window).height() - 200 + 'px'; | ||
| 911 | }); | 916 | }); |
| 912 | 917 | ||
| 913 | /** | 918 | /** |
| ... | @@ -2262,60 +2267,7 @@ export default { | ... | @@ -2262,60 +2267,7 @@ export default { |
| 2262 | 2267 | ||
| 2263 | model.data = model.data ? model.data : {}; | 2268 | model.data = model.data ? model.data : {}; |
| 2264 | 2269 | ||
| 2265 | - // 判断是否是流程节点 | 2270 | + state.detailModel = model; |
| 2266 | - let model_id = model.id; | ||
| 2267 | - | ||
| 2268 | - if (model_id !== 'end-node') { | ||
| 2269 | - // 判断是否是开始节点, 不设置负责人 | ||
| 2270 | - if (model_id ==='start-node') { | ||
| 2271 | - state.user_attr_set = false; | ||
| 2272 | - } else { | ||
| 2273 | - state.user_attr_set = true; | ||
| 2274 | - } | ||
| 2275 | - | ||
| 2276 | - // 判断是否是抄送节点 | ||
| 2277 | - if (model.control === 'cc') { | ||
| 2278 | - state.select_attr_set = false; | ||
| 2279 | - } else { | ||
| 2280 | - state.select_attr_set = true; | ||
| 2281 | - } | ||
| 2282 | - | ||
| 2283 | - flowData.value.nodes.forEach((ele: any, idx: number) => { | ||
| 2284 | - if (ele.id === model.id) { | ||
| 2285 | - state.node_idx = idx; // 详情里显示节点索引 | ||
| 2286 | - } | ||
| 2287 | - }); | ||
| 2288 | - | ||
| 2289 | - } else { | ||
| 2290 | - state.detailModel = null; | ||
| 2291 | - editor.closeModel(); | ||
| 2292 | - } | ||
| 2293 | - } | ||
| 2294 | - | ||
| 2295 | - /** | ||
| 2296 | - * 预览添加前校验 | ||
| 2297 | - * | ||
| 2298 | - * @param {object} model - The model object. | ||
| 2299 | - * @param {string} type - The type of the model. | ||
| 2300 | - * @return {Promise} A promise that resolves to a result or rejects with an error. | ||
| 2301 | - */ | ||
| 2302 | - function handlePreviewBeforeAdd(model: myObj, type: string): Promise<any> { | ||
| 2303 | - const source = model.source; | ||
| 2304 | - const target = model.target; | ||
| 2305 | - let { nodes, edges } = editor.editorState.graph.save(); | ||
| 2306 | - | ||
| 2307 | - if (type === 'edge') { | ||
| 2308 | - ElNotification.error('预览模式禁止操作') | ||
| 2309 | - return Promise.reject('reject') | ||
| 2310 | - } | ||
| 2311 | - } | ||
| 2312 | - | ||
| 2313 | - function onDragStartNode(e) { | ||
| 2314 | - // const source = model.source; | ||
| 2315 | - // const target = model.target; | ||
| 2316 | - // let { nodes, edges } = editor.editorState.graph.save(); | ||
| 2317 | - ElNotification.error('预览模式禁止操作') | ||
| 2318 | - | ||
| 2319 | } | 2271 | } |
| 2320 | 2272 | ||
| 2321 | return { | 2273 | return { |
| ... | @@ -2376,8 +2328,6 @@ export default { | ... | @@ -2376,8 +2328,6 @@ export default { |
| 2376 | toolbarButtonHandler, | 2328 | toolbarButtonHandler, |
| 2377 | openPreview, | 2329 | openPreview, |
| 2378 | onClickNodePreview, | 2330 | onClickNodePreview, |
| 2379 | - handlePreviewBeforeAdd, | ||
| 2380 | - onDragStartNode, | ||
| 2381 | 2331 | ||
| 2382 | onRef: (e: any) => (editor = e), | 2332 | onRef: (e: any) => (editor = e), |
| 2383 | staticPath, | 2333 | staticPath, |
| ... | @@ -2647,5 +2597,21 @@ body { | ... | @@ -2647,5 +2597,21 @@ body { |
| 2647 | .sort-item-border { | 2597 | .sort-item-border { |
| 2648 | border-bottom: 0 !important; | 2598 | border-bottom: 0 !important; |
| 2649 | } | 2599 | } |
| 2650 | - | 2600 | +.preview-dialog { |
| 2601 | + .el-dialog__body { | ||
| 2602 | + padding-right: 0; | ||
| 2603 | + padding-left: 0; | ||
| 2604 | + } | ||
| 2605 | +} | ||
| 2606 | +.preview-detail-container { | ||
| 2607 | + position: fixed; | ||
| 2608 | + width: 30vw; | ||
| 2609 | + height: 80vh; | ||
| 2610 | + top: 10vh; | ||
| 2611 | + right: 20px; | ||
| 2612 | + border: 1px solid #c3c3c3; | ||
| 2613 | + background: #fff; | ||
| 2614 | + /* padding: 1rem; */ | ||
| 2615 | + /* border-radius: 5px; */ | ||
| 2616 | +} | ||
| 2651 | </style> | 2617 | </style> | ... | ... |
| ... | @@ -26,7 +26,7 @@ | ... | @@ -26,7 +26,7 @@ |
| 26 | "@vue/composition-api": "^1.7.2", | 26 | "@vue/composition-api": "^1.7.2", |
| 27 | "axios": "^1.6.0", | 27 | "axios": "^1.6.0", |
| 28 | "echarts": "^5.1.2", | 28 | "echarts": "^5.1.2", |
| 29 | - "element-plus": "^2.4.2", | 29 | + "element-plus": "^2.5.6", |
| 30 | "jquery": "^3.7.1", | 30 | "jquery": "^3.7.1", |
| 31 | "lodash": "^4.17.21", | 31 | "lodash": "^4.17.21", |
| 32 | "qs": "^6.11.2", | 32 | "qs": "^6.11.2", | ... | ... |
| ... | @@ -958,11 +958,16 @@ | ... | @@ -958,11 +958,16 @@ |
| 958 | resolved "https://mirrors.cloud.tencent.com/npm/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz#b6c75a56a1947cc916ea058772d666a2c8932f31" | 958 | resolved "https://mirrors.cloud.tencent.com/npm/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz#b6c75a56a1947cc916ea058772d666a2c8932f31" |
| 959 | integrity sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA== | 959 | integrity sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA== |
| 960 | 960 | ||
| 961 | -"@element-plus/icons-vue@^2.0.6", "@element-plus/icons-vue@^2.1.0": | 961 | +"@element-plus/icons-vue@^2.1.0": |
| 962 | version "2.1.0" | 962 | version "2.1.0" |
| 963 | resolved "https://mirrors.cloud.tencent.com/npm/@element-plus/icons-vue/-/icons-vue-2.1.0.tgz#7ad90d08a8c0d5fd3af31c4f73264ca89614397a" | 963 | resolved "https://mirrors.cloud.tencent.com/npm/@element-plus/icons-vue/-/icons-vue-2.1.0.tgz#7ad90d08a8c0d5fd3af31c4f73264ca89614397a" |
| 964 | integrity sha512-PSBn3elNoanENc1vnCfh+3WA9fimRC7n+fWkf3rE5jvv+aBohNHABC/KAR5KWPecxWxDTVT1ERpRbOMRcOV/vA== | 964 | integrity sha512-PSBn3elNoanENc1vnCfh+3WA9fimRC7n+fWkf3rE5jvv+aBohNHABC/KAR5KWPecxWxDTVT1ERpRbOMRcOV/vA== |
| 965 | 965 | ||
| 966 | +"@element-plus/icons-vue@^2.3.1": | ||
| 967 | + version "2.3.1" | ||
| 968 | + resolved "https://mirrors.cloud.tencent.com/npm/@element-plus/icons-vue/-/icons-vue-2.3.1.tgz#1f635ad5fdd5c85ed936481525570e82b5a8307a" | ||
| 969 | + integrity sha512-XxVUZv48RZAd87ucGS48jPf6pKu0yV5UCg9f4FFwtrYxXOwWuVJo6wOvSLKEoMQKjv8GsX/mhP6UsC1lRwbUWg== | ||
| 970 | + | ||
| 966 | "@floating-ui/core@^1.4.2": | 971 | "@floating-ui/core@^1.4.2": |
| 967 | version "1.5.0" | 972 | version "1.5.0" |
| 968 | resolved "https://mirrors.cloud.tencent.com/npm/@floating-ui/core/-/core-1.5.0.tgz#5c05c60d5ae2d05101c3021c1a2a350ddc027f8c" | 973 | resolved "https://mirrors.cloud.tencent.com/npm/@floating-ui/core/-/core-1.5.0.tgz#5c05c60d5ae2d05101c3021c1a2a350ddc027f8c" |
| ... | @@ -3792,13 +3797,13 @@ electron-to-chromium@^1.3.793: | ... | @@ -3792,13 +3797,13 @@ electron-to-chromium@^1.3.793: |
| 3792 | resolved "https://registry.nlark.com/electron-to-chromium/download/electron-to-chromium-1.3.806.tgz?cache=0&sync_timestamp=1628906712766&other_urls=https%3A%2F%2Fregistry.nlark.com%2Felectron-to-chromium%2Fdownload%2Felectron-to-chromium-1.3.806.tgz" | 3797 | resolved "https://registry.nlark.com/electron-to-chromium/download/electron-to-chromium-1.3.806.tgz?cache=0&sync_timestamp=1628906712766&other_urls=https%3A%2F%2Fregistry.nlark.com%2Felectron-to-chromium%2Fdownload%2Felectron-to-chromium-1.3.806.tgz" |
| 3793 | integrity sha1-IVAhAPEa6tbFAdHNfyUE8WyTZkI= | 3798 | integrity sha1-IVAhAPEa6tbFAdHNfyUE8WyTZkI= |
| 3794 | 3799 | ||
| 3795 | -element-plus@^2.4.2: | 3800 | +element-plus@^2.5.6: |
| 3796 | - version "2.4.2" | 3801 | + version "2.5.6" |
| 3797 | - resolved "https://mirrors.cloud.tencent.com/npm/element-plus/-/element-plus-2.4.2.tgz#2a24632e0904ccd7bbbd64c269704f6b9969833c" | 3802 | + resolved "https://mirrors.cloud.tencent.com/npm/element-plus/-/element-plus-2.5.6.tgz#d63dabc6330c0e2abe6f97cf99013a30140940d1" |
| 3798 | - integrity sha512-E/HwXX7JF1LPvQSjs0fZ8WblIoc0quoXsRXQZiL7QDq7xJdNGSUaXtdk7xiEv7axPmLfEFtxE5du9fFspDrmJw== | 3803 | + integrity sha512-zctKTiyIDmcnMp3K5WG1hglgraW9EbiCLiIDVtaMCS5mPMl2fRKdS0vOFGnECIq9taFoxnyoDwxHD81nv0B4RA== |
| 3799 | dependencies: | 3804 | dependencies: |
| 3800 | "@ctrl/tinycolor" "^3.4.1" | 3805 | "@ctrl/tinycolor" "^3.4.1" |
| 3801 | - "@element-plus/icons-vue" "^2.0.6" | 3806 | + "@element-plus/icons-vue" "^2.3.1" |
| 3802 | "@floating-ui/dom" "^1.0.1" | 3807 | "@floating-ui/dom" "^1.0.1" |
| 3803 | "@popperjs/core" "npm:@sxzz/popperjs-es@^2.11.7" | 3808 | "@popperjs/core" "npm:@sxzz/popperjs-es@^2.11.7" |
| 3804 | "@types/lodash" "^4.14.182" | 3809 | "@types/lodash" "^4.14.182" | ... | ... |
-
Please register or login to post a comment