td class="lines-num lines-num-new">
<dialog-panel
v-if="showImport"
:dialog-data="dialogData"
@confirm-dialog="confirmModelDialog"
@close-dialog="closeModelDialog"
>
<!-- 选择 -->
<el-radio-group v-model="selectTab">
<el-radio-button label="attributes">自定义属性</el-radio-button>
<el-radio-button label="models">模型</el-radio-button>
</el-radio-group>
<!-- 数据展示 -->
<common-table
class="table"
:table-header="table[selectTab].header"
:table-data="table[selectTab].data"
:is-check="true"
@selection-change="handleSelectChange"
></common-table>
</dialog-panel>
</template>
<script setup>
import { computed, ref, watch } from 'vue';
import { useRoute } from 'vue-router';
const route = useRoute();
const dataBus = JSON.parse(localStorage.getItem('panelGlobal')) || {};
const flowId = computed(() => route.query.id);
const props = defineProps({
targetNode: {
type: Object,
default: () => {}
}
});
const nodePanelData = ref(props.targetNode.cell.getData()?.attrsData || null);
const panelData = ref(
nodePanelData.value || {
basicData: {},
inputOutput: {},
function: {
tableData: []
}
}
);
const tableHeader = ref([
{
label: 'ID',
name: 'id',
'min-width': '150'
},
{
label: '名称',
name: 'name',
'min-width': '150'
},
{
label: '类型',
name: 'type',
'min-width': '150'
},
{
label: '描述',
name: 'desc',
'min-width': '150'
},
{
label: '操作',
name: 'custom',
type: 'custom',
fixed: 'right',
width: '100'
}
]);
watch(
panelData,
() => {
setNodeAttrData();
},
{ deep: true }
);
// 存储到节点中
function setNodeAttrData() {
props.targetNode.cell.setData({
attrsData: panelData.value
});
}
// 开始节点
function initStartNode() {
const activeName = ref('action');
// 引入
const dialogData = ref({
title: '引入'
});
const showImport = ref(false);
function importData() {
showImport.value = true;
}
function closeModelDialog() {
showImport.value = false;
}
function confirmModelDialog() {
panelData.value.function.tableData = checkedAttrs.value;
closeModelDialog();
}
function confirmEvent(row) {
panelData.value.function.tableData.forEach((item, index) => {
if (item.id === row.id) {
panelData.value.function.tableData.splice(index, 1);
}
});
}
function cancelEvent() {}
return {
activeName,
dialogData,
showImport,
importData,
confirmEvent,
closeModelDialog,
confirmModelDialog
};
}
const {
activeName,
dialogData,
showImport,
importData,
confirmEvent,
closeModelDialog,
confirmModelDialog
} = initStartNode();
// 设置弹窗信息
function setDialogInfo() {
const selectTab = ref('attributes');
const checkedAttrs = ref([]);
const table = ref({
models: {
header: [
{
label: '模型',
name: 'model',
'min-width': '150'
},
{
label: '已选属性',
name: 'attributes',
'min-width': '150'
}
],
data: []
},
attributes: {
header: [
{
label: '属性',
name: 'id',
'min-width': '150'
},
{
label: '名称',
name: 'name',
'min-width': '150'
}
],
data: dataBus?.[flowId.value]?.customAttrs?.data || []
}
});
const handleSelectChange = (checkeds) => {
checkedAttrs.value = checkeds;
};
return { selectTab, table, checkedAttrs, handleSelectChange };
}
const { selectTab, table, checkedAttrs, handleSelectChange } = setDialogInfo();
</script>
<script>
export default {
name: 'PanelStart'
};
</script>
<style scoped lang="scss">
.table {
margin-top: 10px;
}
</style>
|
||
1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|
45 |
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
|
|
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
|
|
61 |
|
|
62 |
|
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
|
84 |
|
|
85 |
|
|
86 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
|
98 |
|
|
99 |
|
|
100 |
|
|
101 |
|
|
102 |
|
|
103 |
|
|
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
|
|
130 |
|
|
131 |
|
|
132 |
|
|
133 |
|
|
134 |
|
|
135 |
|
|
136 |
|
|
137 |
|
|
138 |
|
|
139 |
|
|
140 |
|
|
141 |
|
|
142 |
|
|
143 |
|
|
144 |
|
|
145 |
|
|
146 |
|
|
147 |
|
|
148 |
|
|
149 |
|
|
150 |
|
|
151 |
|
|
152 |
|
|
153 |
|
|
154 |
|
|
155 |
|
|
156 |
|
|
157 |
|
|
158 |
|
|
159 |
|
|
160 |
|
|
161 |
|
|
162 |
|
|
163 |
|
|
164 |
|
|
165 |
|
|
166 |
|
|
167 |
|
|
168 |
|
|
169 |
|
|
||
49 | 49 |
|
50 | 50 |
|
51 | 51 |
|
52 |
|
|
53 |
|
|
52 |
|
|
53 |
|
|
54 | 54 |
|
55 | 55 |
|
56 | 56 |
|
|
||
96 | 96 |
|
97 | 97 |
|
98 | 98 |
|
99 |
|
|
100 |
|
|
99 |
|
|
100 |
|
|
101 | 101 |
|
102 | 102 |
|
103 | 103 |
|
|
||
33 | 33 |
|
34 | 34 |
|
35 | 35 |
|
36 |
|
|
36 | 37 |
|
37 | 38 |
|
38 | 39 |
|
|
||
94 | 95 |
|
95 | 96 |
|
96 | 97 |
|
97 |
|
|
98 |
|
|
98 | 99 |
|
99 | 100 |
|
100 | 101 |
|
|
||
114 | 115 |
|
115 | 116 |
|
116 | 117 |
|
117 |
|
|
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
|
||
6 | 6 |
|
7 | 7 |
|
8 | 8 |
|
9 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
10 | 16 |
|
11 | 17 |
|
12 | 18 |
|
13 | 19 |
|
14 | 20 |
|
15 | 21 |
|
22 |
|
|
16 | 23 |
|
17 | 24 |
|
18 | 25 |
|
26 |
|
|
19 | 27 |
|
20 | 28 |
|
21 | 29 |
|
|
||
39 | 47 |
|
40 | 48 |
|
41 | 49 |
|
50 |
|
|
42 | 51 |
|
43 | 52 |
|
44 | 53 |
|
|
||
51 | 60 |
|
52 | 61 |
|
53 | 62 |
|
63 |
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
|
70 |
|
|
71 |
|
|
72 |
|
|
54 | 73 |
|
55 | 74 |
|
56 | 75 |
|
|
||
65 | 84 |
|
66 | 85 |
|
67 | 86 |
|
68 |
|
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
|
|
91 |
|
|
92 |
|
|
69 | 93 |
|
70 | 94 |
|
71 | 95 |
|
|
||
82 | 106 |
|
83 | 107 |
|
84 | 108 |
|
85 |
|
|
86 | 109 |
|
87 | 110 |
|
88 | 111 |
|
89 | 112 |
|
90 | 113 |
|
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
91 | 124 |
|
92 | 125 |
|
93 | 126 |
|
|
||
103 | 136 |
|
104 | 137 |
|
105 | 138 |
|
139 |
|
|
140 |
|
|
106 | 141 |
|
107 | 142 |
|
108 | 143 |
|
109 | 144 |
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
|
145 |
|
|
146 |
|
|
147 |
|
|
116 | 148 |
|
117 | 149 |
|
118 | 150 |
|
119 | 151 |
|
120 | 152 |
|
153 |
|
|
154 |
|
|
155 |
|
|
156 |
|
|
121 | 157 |
|
122 | 158 |
|
123 | 159 |
|
|
||
134 | 170 |
|
135 | 171 |
|
136 | 172 |
|
173 |
|
|
137 | 174 |
|
138 | 175 |
|
139 | 176 |
|
|
||
144 | 181 |
|
145 | 182 |
|
146 | 183 |
|
147 |
|
|
184 |
|
|
185 |
|
|
186 |
|
|
148 | 187 |
|
149 | 188 |
|
150 | 189 |
|
151 | 190 |
|
152 | 191 |
|
153 | 192 |
|
154 |
|
|
193 |
|
|
155 | 194 |
|
156 | 195 |
|
157 | 196 |
|
|
||
175 | 214 |
|
176 | 215 |
|
177 | 216 |
|
178 |
|
|
217 |
|
|
179 | 218 |
|
180 | 219 |
|
181 | 220 |
|
|
||
183 | 222 |
|
184 | 223 |
|
185 | 224 |
|
225 |
|
|
226 |
|
|
227 |
|
|
228 |
|
|
229 |
|
|
230 |
|
|
231 |
|
|
232 |
|
|
233 |
|
|
186 | 234 |
|
187 | 235 |
|
188 | 236 |
|
|
||
207 | 255 |
|
208 | 256 |
|
209 | 257 |
|
258 |
|
|
259 |
|
|
260 |
|
|
261 |
|
|
262 |
|
|
263 |
|
|
264 |
|
|
265 |
|
|
266 |
|
|
267 |
|
|
268 |
|
|
269 |
|
|
270 |
|
|
271 |
|
|
272 |
|
|
210 | 273 |
|
211 | 274 |
|
212 | 275 |
|
213 |
|
|
276 |
|
|
214 | 277 |
|
215 | 278 |
|
216 | 279 |
|
|
||
228 | 291 |
|
229 | 292 |
|
230 | 293 |
|
294 |
|
|
295 |
|
|
296 |
|
|
231 | 297 |
|
232 | 298 |
|
233 | 299 |
|
234 |
|
|
235 |
|
|
236 | 300 |
|
237 | 301 |
|
238 | 302 |
|
|
||
266 | 330 |
|
267 | 331 |
|
268 | 332 |
|
333 |
|
|
334 |
|
|
269 | 335 |
|
270 | 336 |
|
271 | 337 |
|
|
||
273 | 339 |
|
274 | 340 |
|
275 | 341 |
|
276 |
|
|
342 |
|
|
343 |
|
|
344 |
|
|
345 |
|
|
277 | 346 |
|
278 |
|
|
279 |
|
|
280 |
|
|
281 |
|
|
282 |
|
|
283 |
|
|
284 |
|
|
285 |
|
|
347 |
|
|
348 |
|
|
349 |
|
|
350 |
|
|
351 |
|
|
352 |
|
|
353 |
|
|
354 |
|
|
355 |
|
|
356 |
|
|
357 |
|
|
358 |
|
|
359 |
|
|
360 |
|
|
361 |
|
|
362 |
|
|
363 |
|
|
364 |
|
|
365 |
|
|
366 |
|
|
367 |
|
|
368 |
|
|
369 |
|
|
370 |
|
|
371 |
|
|
372 |
|
|
373 |
|
|
374 |
|
|
375 |
|
|
376 |
|
|
377 |
|
|
378 |
|
|
379 |
|
|
380 |
|
|
381 |
|
|
382 |
|
|
383 |
|
|
384 |
|
|
385 |
|
|
386 |
|
|
387 |
|
|
388 |
|
|
389 |
|
|
390 |
|
|
391 |
|
|
392 |
|
|
393 |
|
|
394 |
|
|
395 |
|
|
396 |
|
|
397 |
|
|
398 |
|
|
399 |
|
|
400 |
|
|
401 |
|
|
402 |
|
|
403 |
|
|
404 |
|
|
405 |
|
|
406 |
|
|
407 |
|
|
408 |
|
|
409 |
|
|
410 |
|
|
411 |
|
|
412 |
|
|
413 |
|
|
414 |
|
|
415 |
|
|
416 |
|
|
417 |
|
|
418 |
|
|
419 |
|
|
420 |
|
|
421 |
|
|
422 |
|
|
423 |
|
|
424 |
|
|
425 |
|
|
426 |
|
|
427 |
|
|
428 |
|
|
286 | 429 |
|
430 |
|
|
431 |
|
|
432 |
|
|
433 |
|
|
434 |
|
|
435 |
|
|
287 | 436 |
|
288 |
|
|
437 |
|
|
438 |
|
|
289 | 439 |
|
290 | 440 |
|
291 | 441 |
|
|
||
294 | 444 |
|
295 | 445 |
|
296 | 446 |
|
297 |
|
|
447 |
|
|
298 | 448 |
|
299 | 449 |
|
450 |
|
|
451 |
|
|
300 | 452 |
|
301 | 453 |
|
302 | 454 |
|
303 | 455 |
|
304 | 456 |
|
457 |
|
|
458 |
|
|
459 |
|
|
460 |
|
|
461 |
|
|
462 |
|
|
463 |
|
|
464 |
|
|
465 |
|
|
466 |
|
|
467 |
|
|
468 |
|
|
469 |
|
|
470 |
|
|
471 |
|
|
472 |
|
|
473 |
|
|
474 |
|
|
475 |
|
|
476 |
|
|
477 |
|
|
478 |
|
|
479 |
|
|
480 |
|
|
481 |
|
|
482 |
|
|
483 |
|
|
484 |
|
|
485 |
|
|
486 |
|
|
487 |
|
|
488 |
|
|
305 | 489 |
|
306 | 490 |
|
307 | 491 |
|
|
||
314 | 498 |
|
315 | 499 |
|
316 | 500 |
|
317 |
|
|
501 |
|
|
502 |
|
|
318 | 503 |
|
319 | 504 |
|
320 | 505 |
|
321 | 506 |
|
322 | 507 |
|
508 |
|
|
323 | 509 |
|
324 | 510 |
|
325 | 511 |
|
|
||
337 | 523 |
|
338 | 524 |
|
339 | 525 |
|
340 |
|
|
526 |
|
|
527 |
|
|
528 |
|
|
529 |
|
|
530 |
|
|
341 | 531 |
|
342 | 532 |
|
343 | 533 |
|
|
||
371 | 561 |
|
372 | 562 |
|
373 | 563 |
|
374 |
|
|
564 |
|
|
565 |
|
|
566 |
|
|
567 |
|
|
568 |
|
|
569 |
|
|
375 | 570 |
|
376 | 571 |
|
377 | 572 |
|
|
||
25 | 25 |
|
26 | 26 |
|
27 | 27 |
|
28 |
|
|
28 | 29 |
|
29 | 30 |
|
30 | 31 |
|
31 | 32 |
|
32 | 33 |
|
33 |
|
|
34 |
|
|
34 | 35 |
|
35 | 36 |
|
36 | 37 |
|
|
||
69 | 70 |
|
70 | 71 |
|
71 | 72 |
|
73 |
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
|
|
72 | 78 |
|
73 | 79 |
|
74 | 80 |
|