Commit 92ba75df9d2540c883b4edd7518a17a148d86a32

Authored by fengwotao
2 parents 4eca225b 93a63321

Merge branch 'main' into dev-ft

... ... @@ -122,11 +122,11 @@ export const addDataComponent = (params: AddDataComponentParams) => {
122 122 * @param params
123 123 * @returns
124 124 */
125   -export const deleteDataComponent = (params: string[]) => {
  125 +export const deleteDataComponent = (params: { dataBoardId: string; ids: string[] }) => {
126 126 return defHttp.delete({
127   - url: DataComponentUrl.DELETE_DATA_COMPONENT,
  127 + url: `${DataComponentUrl.DELETE_DATA_COMPONENT}/${params.dataBoardId}`,
128 128 params: {
129   - ids: params,
  129 + ids: params.ids,
130 130 },
131 131 });
132 132 };
... ...
... ... @@ -111,7 +111,6 @@
111 111 initChart();
112 112 props.add && props.add(props.value.id, update);
113 113 if (props.random) timeout = setInterval(handleRandomValue, 2000) as unknown as number;
114   - console.log(unref(chartRef));
115 114 });
116 115
117 116 onUnmounted(() => {
... ...
... ... @@ -65,7 +65,7 @@
65 65 <Tooltip :title="item.deviceName" placement="topLeft">
66 66 <span>
67 67 <SvgIcon name="" prefix="iconfont" class="!fill-emerald-400" />
68   - <span>{{ item.deviceName }}</span>
  68 + <span>{{ item.deviceRename || item.deviceName }}</span>
69 69 </span>
70 70 </Tooltip>
71 71 </div>
... ...
  1 +<!DOCTYPE html>
  2 +<html lang="en">
  3 + <head>
  4 + <meta charset="UTF-8" />
  5 + <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6 + <title>Document</title>
  7 + <!-- <link rel="stylesheet" type="text/css" href="./common.css" />
  8 + <link rel="stylesheet" type="text/css" href="./index.css" /> -->
  9 + <style>
  10 + body * {
  11 + box-sizing: border-box;
  12 + flex-shrink: 0;
  13 + }
  14 + body {
  15 + font-family: PingFangSC-Regular, Roboto, Helvetica Neue, Helvetica, Tahoma, Arial,
  16 + PingFang SC-Light, Microsoft YaHei;
  17 + }
  18 + input {
  19 + background-color: transparent;
  20 + border: 0;
  21 + }
  22 + button {
  23 + margin: 0;
  24 + padding: 0;
  25 + border: 1px solid transparent;
  26 + outline: none;
  27 + background-color: transparent;
  28 + }
  29 +
  30 + button:active {
  31 + opacity: 0.6;
  32 + }
  33 + .flex-col {
  34 + display: flex;
  35 + flex-direction: column;
  36 + }
  37 + .flex-row {
  38 + display: flex;
  39 + flex-direction: row;
  40 + }
  41 + .justify-start {
  42 + display: flex;
  43 + justify-content: flex-start;
  44 + }
  45 + .justify-center {
  46 + display: flex;
  47 + justify-content: center;
  48 + }
  49 +
  50 + .justify-end {
  51 + display: flex;
  52 + justify-content: flex-end;
  53 + }
  54 + .justify-evenly {
  55 + display: flex;
  56 + justify-content: space-evenly;
  57 + }
  58 + .justify-around {
  59 + display: flex;
  60 + justify-content: space-around;
  61 + }
  62 + .justify-between {
  63 + display: flex;
  64 + justify-content: space-between;
  65 + }
  66 + .align-start {
  67 + display: flex;
  68 + align-items: flex-start;
  69 + }
  70 + .align-center {
  71 + display: flex;
  72 + align-items: center;
  73 + }
  74 + .align-end {
  75 + display: flex;
  76 + align-items: flex-end;
  77 + }
  78 + </style>
  79 + <style>
  80 + .page {
  81 + position: relative;
  82 + width: 1920px;
  83 + height: 1080px;
  84 + overflow: hidden;
  85 + }
  86 +
  87 + .image_1 {
  88 + width: 1920px;
  89 + height: 960px;
  90 + }
  91 +
  92 + .section_1 {
  93 + height: 972px;
  94 + background-color: rgba(240, 242, 245, 1);
  95 + width: 1638px;
  96 + position: absolute;
  97 + left: 282px;
  98 + top: 108px;
  99 + }
  100 +
  101 + .box_1 {
  102 + width: 1598px;
  103 + height: 796px;
  104 + margin: 20px 0 0 20px;
  105 + }
  106 +
  107 + .box_2 {
  108 + height: 78px;
  109 + border-radius: 3px;
  110 + background-color: rgba(255, 255, 255, 1);
  111 + width: 1598px;
  112 + }
  113 +
  114 + .box_3 {
  115 + width: 208px;
  116 + height: 25px;
  117 + margin: 27px 0 0 20px;
  118 + }
  119 +
  120 + .thumbnail_1 {
  121 + width: 20px;
  122 + height: 19px;
  123 + margin-top: 4px;
  124 + }
  125 +
  126 + .text_1 {
  127 + width: 80px;
  128 + height: 25px;
  129 + display: inline-block;
  130 + overflow-wrap: break-word;
  131 + color: rgba(51, 51, 51, 1);
  132 + font-size: 18px;
  133 + font-family: PingFangSC-Semibold;
  134 + white-space: nowrap;
  135 + line-height: 25px;
  136 + text-align: left;
  137 + margin-left: 12px;
  138 + }
  139 +
  140 + .text_2 {
  141 + width: 72px;
  142 + height: 25px;
  143 + display: inline-block;
  144 + overflow-wrap: break-word;
  145 + color: rgba(255, 255, 255, 1);
  146 + font-size: 18px;
  147 + font-family: PingFangSC-Regular;
  148 + white-space: nowrap;
  149 + line-height: 25px;
  150 + text-align: left;
  151 + margin-left: 24px;
  152 + }
  153 +
  154 + .text-wrapper_1 {
  155 + width: 107px;
  156 + height: 20px;
  157 + overflow-wrap: break-word;
  158 + text-align: left;
  159 + white-space: nowrap;
  160 + margin-top: 20px;
  161 + font-size: 0;
  162 + }
  163 +
  164 + .text_3 {
  165 + font-size: 14px;
  166 + font-family: PingFangSC-Regular;
  167 + color: rgba(102, 102, 102, 1);
  168 + line-height: 20px;
  169 + }
  170 +
  171 + .text_4 {
  172 + font-size: 14px;
  173 + font-family: PingFangSC-Regular;
  174 + color: rgba(55, 125, 255, 1);
  175 + line-height: 20px;
  176 + }
  177 +
  178 + .box_4 {
  179 + width: 1597px;
  180 + height: 319px;
  181 + margin-top: 20px;
  182 + }
  183 +
  184 + .group_1 {
  185 + height: 319px;
  186 + border-radius: 3px;
  187 + background-color: rgba(255, 255, 255, 1);
  188 + width: 519px;
  189 + position: relative;
  190 + justify-content: flex-center;
  191 + }
  192 +
  193 + .group_2 {
  194 + width: 480px;
  195 + height: 22px;
  196 + margin: 20px 0 0 20px;
  197 + }
  198 +
  199 + .text_5 {
  200 + width: 116px;
  201 + height: 22px;
  202 + display: inline-block;
  203 + overflow-wrap: break-word;
  204 + color: rgba(51, 51, 51, 1);
  205 + font-size: 16px;
  206 + font-family: PingFangSC-Medium;
  207 + white-space: nowrap;
  208 + line-height: 22px;
  209 + text-align: left;
  210 + }
  211 +
  212 + .block_1 {
  213 + width: 17px;
  214 + height: 15px;
  215 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng61e21a4ecb6a4c3e09659c9ed2eef4056c7aa9553190d0490d78d97726e898df) -1px
  216 + 0px no-repeat;
  217 + background-size: 17px 16px;
  218 + margin: 3px 0 0 312px;
  219 + }
  220 +
  221 + .block_2 {
  222 + width: 4px;
  223 + height: 4px;
  224 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng7fbe2300f4a054a715c64dbc28a72022345b6e8c29d87ba5be6e58b9222e6888)
  225 + 0px 0px no-repeat;
  226 + background-size: 4px 4px;
  227 + margin: 10px 0 0 20px;
  228 + }
  229 +
  230 + .block_3 {
  231 + width: 4px;
  232 + height: 4px;
  233 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng6bbeb27f239784515cbdbc576c0480e4f9218af9c9e465da945579af452e11a3)
  234 + 0px 0px no-repeat;
  235 + background-size: 4px 4px;
  236 + margin: 10px 0 0 2px;
  237 + }
  238 +
  239 + .block_4 {
  240 + width: 4px;
  241 + height: 4px;
  242 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng788c665bd82de9347efef08b24329265e7db13cb2ec04e9b336304cb6383bab2) -1px
  243 + 0px no-repeat;
  244 + background-size: 4px 4px;
  245 + margin: 10px 0 0 1px;
  246 + }
  247 +
  248 + .group_3 {
  249 + width: 50px;
  250 + height: 50px;
  251 + margin: 60px 0 0 235px;
  252 + }
  253 +
  254 + .box_5 {
  255 + width: 50px;
  256 + height: 50px;
  257 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng90c6d301b6ba3ed6900f8b58d1970285c1f71afde72e8b0306f787be649088ae)
  258 + 0px 0px no-repeat;
  259 + background-size: 51px 50px;
  260 + }
  261 +
  262 + .text-wrapper_2 {
  263 + width: 49px;
  264 + height: 33px;
  265 + margin: 12px 0 0 235px;
  266 + }
  267 +
  268 + .text_6 {
  269 + width: 49px;
  270 + height: 33px;
  271 + display: inline-block;
  272 + overflow-wrap: break-word;
  273 + color: rgba(51, 51, 51, 1);
  274 + font-size: 24px;
  275 + font-family: PingFangSC-Medium;
  276 + white-space: nowrap;
  277 + line-height: 33px;
  278 + text-align: center;
  279 + }
  280 +
  281 + .text-wrapper_3 {
  282 + width: 32px;
  283 + height: 22px;
  284 + margin-left: 244px;
  285 + }
  286 +
  287 + .text_7 {
  288 + width: 32px;
  289 + height: 22px;
  290 + display: inline-block;
  291 + overflow-wrap: break-word;
  292 + color: rgba(102, 102, 102, 1);
  293 + font-size: 16px;
  294 + font-family: PingFangSC-Medium;
  295 + white-space: nowrap;
  296 + line-height: 22px;
  297 + text-align: center;
  298 + }
  299 +
  300 + .text-wrapper_4 {
  301 + width: 213px;
  302 + height: 20px;
  303 + margin: 60px 0 20px 153px;
  304 + }
  305 +
  306 + .text_8 {
  307 + width: 213px;
  308 + height: 20px;
  309 + display: inline-block;
  310 + overflow-wrap: break-word;
  311 + color: rgba(153, 153, 153, 1);
  312 + font-size: 14px;
  313 + font-family: PingFangSC-Regular;
  314 + white-space: nowrap;
  315 + line-height: 20px;
  316 + text-align: left;
  317 + }
  318 +
  319 + .group_4 {
  320 + position: absolute;
  321 + left: 448px;
  322 + top: 23px;
  323 + width: 18px;
  324 + height: 18px;
  325 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng0cbcb409c7bbb5544db0b197f5910ab50a6e5df351202723fcde68db454dc5e6)
  326 + 0px 0px no-repeat;
  327 + background-size: 18px 18px;
  328 + }
  329 +
  330 + .group_5 {
  331 + height: 319px;
  332 + border-radius: 3px;
  333 + background-color: rgba(255, 255, 255, 1);
  334 + margin-left: 20px;
  335 + width: 519px;
  336 + justify-content: flex-center;
  337 + }
  338 +
  339 + .group_6 {
  340 + width: 480px;
  341 + height: 22px;
  342 + margin: 20px 0 0 20px;
  343 + }
  344 +
  345 + .text_9 {
  346 + width: 118px;
  347 + height: 22px;
  348 + display: inline-block;
  349 + overflow-wrap: break-word;
  350 + color: rgba(51, 51, 51, 1);
  351 + font-size: 16px;
  352 + font-family: PingFangSC-Medium;
  353 + white-space: nowrap;
  354 + line-height: 22px;
  355 + text-align: left;
  356 + }
  357 +
  358 + .thumbnail_2 {
  359 + width: 18px;
  360 + height: 18px;
  361 + margin: 3px 0 0 309px;
  362 + }
  363 +
  364 + .block_5 {
  365 + width: 4px;
  366 + height: 4px;
  367 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng7fbe2300f4a054a715c64dbc28a72022345b6e8c29d87ba5be6e58b9222e6888)
  368 + 0px 0px no-repeat;
  369 + background-size: 4px 4px;
  370 + margin: 10px 0 0 20px;
  371 + }
  372 +
  373 + .block_6 {
  374 + width: 4px;
  375 + height: 4px;
  376 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng6bbeb27f239784515cbdbc576c0480e4f9218af9c9e465da945579af452e11a3)
  377 + 0px 0px no-repeat;
  378 + background-size: 4px 4px;
  379 + margin: 10px 0 0 2px;
  380 + }
  381 +
  382 + .block_7 {
  383 + width: 4px;
  384 + height: 4px;
  385 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng788c665bd82de9347efef08b24329265e7db13cb2ec04e9b336304cb6383bab2) -1px
  386 + 0px no-repeat;
  387 + background-size: 4px 4px;
  388 + margin: 10px 0 0 1px;
  389 + }
  390 +
  391 + .image-wrapper_1 {
  392 + width: 53px;
  393 + height: 50px;
  394 + margin: 60px 0 0 233px;
  395 + }
  396 +
  397 + .image_2 {
  398 + width: 53px;
  399 + height: 50px;
  400 + }
  401 +
  402 + .text-wrapper_5 {
  403 + width: 53px;
  404 + height: 33px;
  405 + margin: 12px 0 0 233px;
  406 + }
  407 +
  408 + .text_10 {
  409 + width: 53px;
  410 + height: 33px;
  411 + display: inline-block;
  412 + overflow-wrap: break-word;
  413 + color: rgba(51, 51, 51, 1);
  414 + font-size: 24px;
  415 + font-family: PingFangSC-Medium;
  416 + white-space: nowrap;
  417 + line-height: 33px;
  418 + text-align: center;
  419 + }
  420 +
  421 + .text-wrapper_6 {
  422 + width: 66px;
  423 + height: 22px;
  424 + margin-left: 227px;
  425 + }
  426 +
  427 + .text_11 {
  428 + width: 66px;
  429 + height: 22px;
  430 + display: inline-block;
  431 + overflow-wrap: break-word;
  432 + color: rgba(102, 102, 102, 1);
  433 + font-size: 16px;
  434 + font-family: PingFangSC-Medium;
  435 + white-space: nowrap;
  436 + line-height: 22px;
  437 + text-align: center;
  438 + }
  439 +
  440 + .text-wrapper_7 {
  441 + width: 213px;
  442 + height: 20px;
  443 + margin: 60px 0 20px 153px;
  444 + }
  445 +
  446 + .text_12 {
  447 + width: 213px;
  448 + height: 20px;
  449 + display: inline-block;
  450 + overflow-wrap: break-word;
  451 + color: rgba(153, 153, 153, 1);
  452 + font-size: 14px;
  453 + font-family: PingFangSC-Regular;
  454 + white-space: nowrap;
  455 + line-height: 20px;
  456 + text-align: left;
  457 + }
  458 +
  459 + .group_7 {
  460 + height: 319px;
  461 + border-radius: 3px;
  462 + background-color: rgba(255, 255, 255, 1);
  463 + margin-left: 20px;
  464 + width: 519px;
  465 + justify-content: flex-center;
  466 + }
  467 +
  468 + .group_8 {
  469 + width: 480px;
  470 + height: 22px;
  471 + margin: 20px 0 0 20px;
  472 + }
  473 +
  474 + .text_13 {
  475 + width: 180px;
  476 + height: 22px;
  477 + display: inline-block;
  478 + overflow-wrap: break-word;
  479 + color: rgba(51, 51, 51, 1);
  480 + font-size: 16px;
  481 + font-family: PingFangSC-Medium;
  482 + white-space: nowrap;
  483 + line-height: 22px;
  484 + text-align: left;
  485 + }
  486 +
  487 + .thumbnail_3 {
  488 + width: 18px;
  489 + height: 18px;
  490 + margin: 3px 0 0 247px;
  491 + }
  492 +
  493 + .group_9 {
  494 + width: 4px;
  495 + height: 4px;
  496 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng7fbe2300f4a054a715c64dbc28a72022345b6e8c29d87ba5be6e58b9222e6888)
  497 + 0px 0px no-repeat;
  498 + background-size: 4px 4px;
  499 + margin: 10px 0 0 20px;
  500 + }
  501 +
  502 + .group_10 {
  503 + width: 4px;
  504 + height: 4px;
  505 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng6bbeb27f239784515cbdbc576c0480e4f9218af9c9e465da945579af452e11a3)
  506 + 0px 0px no-repeat;
  507 + background-size: 4px 4px;
  508 + margin: 10px 0 0 2px;
  509 + }
  510 +
  511 + .group_11 {
  512 + width: 4px;
  513 + height: 4px;
  514 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng788c665bd82de9347efef08b24329265e7db13cb2ec04e9b336304cb6383bab2) -1px
  515 + 0px no-repeat;
  516 + background-size: 4px 4px;
  517 + margin: 10px 0 0 1px;
  518 + }
  519 +
  520 + .group_12 {
  521 + width: 52px;
  522 + height: 50px;
  523 + margin: 60px 0 0 234px;
  524 + }
  525 +
  526 + .group_13 {
  527 + width: 52px;
  528 + height: 50px;
  529 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng2a8b4bc257a393d46c08a8d61148cae372cdba88e38494116f9a9f58e70b0bfd)
  530 + 0px 0px no-repeat;
  531 + background-size: 53px 50px;
  532 + }
  533 +
  534 + .text-wrapper_8 {
  535 + width: 29px;
  536 + height: 33px;
  537 + margin: 12px 0 0 245px;
  538 + }
  539 +
  540 + .text_14 {
  541 + width: 29px;
  542 + height: 33px;
  543 + display: inline-block;
  544 + overflow-wrap: break-word;
  545 + color: rgba(51, 51, 51, 1);
  546 + font-size: 24px;
  547 + font-family: PingFangSC-Medium;
  548 + white-space: nowrap;
  549 + line-height: 33px;
  550 + text-align: center;
  551 + }
  552 +
  553 + .text-wrapper_9 {
  554 + width: 96px;
  555 + height: 22px;
  556 + margin-left: 212px;
  557 + }
  558 +
  559 + .text_15 {
  560 + width: 96px;
  561 + height: 22px;
  562 + display: inline-block;
  563 + overflow-wrap: break-word;
  564 + color: rgba(102, 102, 102, 1);
  565 + font-size: 16px;
  566 + font-family: PingFangSC-Medium;
  567 + white-space: nowrap;
  568 + line-height: 22px;
  569 + text-align: center;
  570 + }
  571 +
  572 + .text-wrapper_10 {
  573 + width: 213px;
  574 + height: 20px;
  575 + margin: 60px 0 20px 153px;
  576 + }
  577 +
  578 + .text_16 {
  579 + width: 213px;
  580 + height: 20px;
  581 + display: inline-block;
  582 + overflow-wrap: break-word;
  583 + color: rgba(153, 153, 153, 1);
  584 + font-size: 14px;
  585 + font-family: PingFangSC-Regular;
  586 + white-space: nowrap;
  587 + line-height: 20px;
  588 + text-align: left;
  589 + }
  590 +
  591 + .box_6 {
  592 + width: 1597px;
  593 + height: 319px;
  594 + margin-top: 20px;
  595 + }
  596 +
  597 + .box_7 {
  598 + height: 319px;
  599 + border-radius: 3px;
  600 + background-color: rgba(255, 255, 255, 1);
  601 + width: 1058px;
  602 + justify-content: flex-center;
  603 + }
  604 +
  605 + .group_14 {
  606 + width: 1019px;
  607 + height: 22px;
  608 + margin: 20px 0 0 20px;
  609 + }
  610 +
  611 + .text_17 {
  612 + width: 116px;
  613 + height: 22px;
  614 + display: inline-block;
  615 + overflow-wrap: break-word;
  616 + color: rgba(51, 51, 51, 1);
  617 + font-size: 16px;
  618 + font-family: PingFangSC-Medium;
  619 + white-space: nowrap;
  620 + line-height: 22px;
  621 + text-align: left;
  622 + }
  623 +
  624 + .text_18 {
  625 + width: 118px;
  626 + height: 22px;
  627 + display: inline-block;
  628 + overflow-wrap: break-word;
  629 + color: rgba(51, 51, 51, 1);
  630 + font-size: 16px;
  631 + font-family: PingFangSC-Medium;
  632 + white-space: nowrap;
  633 + line-height: 22px;
  634 + text-align: left;
  635 + margin-left: 423px;
  636 + }
  637 +
  638 + .thumbnail_4 {
  639 + width: 18px;
  640 + height: 18px;
  641 + margin: 3px 0 0 309px;
  642 + }
  643 +
  644 + .group_15 {
  645 + width: 4px;
  646 + height: 4px;
  647 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng7fbe2300f4a054a715c64dbc28a72022345b6e8c29d87ba5be6e58b9222e6888)
  648 + 0px 0px no-repeat;
  649 + background-size: 4px 4px;
  650 + margin: 10px 0 0 20px;
  651 + }
  652 +
  653 + .group_16 {
  654 + width: 4px;
  655 + height: 4px;
  656 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng6bbeb27f239784515cbdbc576c0480e4f9218af9c9e465da945579af452e11a3)
  657 + 0px 0px no-repeat;
  658 + background-size: 4px 4px;
  659 + margin: 10px 0 0 2px;
  660 + }
  661 +
  662 + .group_17 {
  663 + width: 4px;
  664 + height: 4px;
  665 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng788c665bd82de9347efef08b24329265e7db13cb2ec04e9b336304cb6383bab2) -1px
  666 + 0px no-repeat;
  667 + background-size: 4px 4px;
  668 + margin: 10px 0 0 1px;
  669 + }
  670 +
  671 + .group_18 {
  672 + width: 590px;
  673 + height: 95px;
  674 + margin: 60px 0 0 235px;
  675 + }
  676 +
  677 + .group_18 {
  678 + width: 590px;
  679 + height: 95px;
  680 + }
  681 +
  682 + .box_8 {
  683 + width: 50px;
  684 + height: 95px;
  685 + }
  686 +
  687 + .box_8 {
  688 + width: 50px;
  689 + height: 95px;
  690 + }
  691 +
  692 + .box_9 {
  693 + width: 50px;
  694 + height: 50px;
  695 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng90c6d301b6ba3ed6900f8b58d1970285c1f71afde72e8b0306f787be649088ae)
  696 + 0px 0px no-repeat;
  697 + background-size: 51px 50px;
  698 + }
  699 +
  700 + .text_19 {
  701 + width: 49px;
  702 + height: 33px;
  703 + display: inline-block;
  704 + overflow-wrap: break-word;
  705 + color: rgba(51, 51, 51, 1);
  706 + font-size: 24px;
  707 + font-family: PingFangSC-Medium;
  708 + white-space: nowrap;
  709 + line-height: 33px;
  710 + text-align: center;
  711 + margin-top: 12px;
  712 + }
  713 +
  714 + .box_10 {
  715 + width: 53px;
  716 + height: 95px;
  717 + }
  718 +
  719 + .box_10 {
  720 + width: 53px;
  721 + height: 95px;
  722 + }
  723 +
  724 + .image_3 {
  725 + width: 53px;
  726 + height: 50px;
  727 + }
  728 +
  729 + .text_20 {
  730 + width: 53px;
  731 + height: 33px;
  732 + display: inline-block;
  733 + overflow-wrap: break-word;
  734 + color: rgba(51, 51, 51, 1);
  735 + font-size: 24px;
  736 + font-family: PingFangSC-Medium;
  737 + white-space: nowrap;
  738 + line-height: 33px;
  739 + text-align: center;
  740 + margin-top: 12px;
  741 + }
  742 +
  743 + .text-wrapper_11 {
  744 + width: 588px;
  745 + height: 22px;
  746 + margin-left: 244px;
  747 + }
  748 +
  749 + .text_21 {
  750 + width: 32px;
  751 + height: 22px;
  752 + display: inline-block;
  753 + overflow-wrap: break-word;
  754 + color: rgba(102, 102, 102, 1);
  755 + font-size: 16px;
  756 + font-family: PingFangSC-Medium;
  757 + white-space: nowrap;
  758 + line-height: 22px;
  759 + text-align: center;
  760 + }
  761 +
  762 + .text_22 {
  763 + width: 66px;
  764 + height: 22px;
  765 + display: inline-block;
  766 + overflow-wrap: break-word;
  767 + color: rgba(102, 102, 102, 1);
  768 + font-size: 16px;
  769 + font-family: PingFangSC-Medium;
  770 + white-space: nowrap;
  771 + line-height: 22px;
  772 + text-align: center;
  773 + }
  774 +
  775 + .text-wrapper_12 {
  776 + width: 752px;
  777 + height: 20px;
  778 + margin: 60px 0 20px 153px;
  779 + }
  780 +
  781 + .text_23 {
  782 + width: 213px;
  783 + height: 20px;
  784 + display: inline-block;
  785 + overflow-wrap: break-word;
  786 + color: rgba(153, 153, 153, 1);
  787 + font-size: 14px;
  788 + font-family: PingFangSC-Regular;
  789 + white-space: nowrap;
  790 + line-height: 20px;
  791 + text-align: left;
  792 + }
  793 +
  794 + .text_24 {
  795 + width: 213px;
  796 + height: 20px;
  797 + display: inline-block;
  798 + overflow-wrap: break-word;
  799 + color: rgba(153, 153, 153, 1);
  800 + font-size: 14px;
  801 + font-family: PingFangSC-Regular;
  802 + white-space: nowrap;
  803 + line-height: 20px;
  804 + text-align: left;
  805 + }
  806 +
  807 + .box_11 {
  808 + height: 319px;
  809 + border-radius: 3px;
  810 + background-color: rgba(255, 255, 255, 1);
  811 + width: 519px;
  812 + justify-content: flex-center;
  813 + }
  814 +
  815 + .section_2 {
  816 + width: 480px;
  817 + height: 22px;
  818 + margin: 20px 0 0 20px;
  819 + }
  820 +
  821 + .text_25 {
  822 + width: 68px;
  823 + height: 22px;
  824 + display: inline-block;
  825 + overflow-wrap: break-word;
  826 + color: rgba(51, 51, 51, 1);
  827 + font-size: 16px;
  828 + font-family: PingFangSC-Medium;
  829 + white-space: nowrap;
  830 + line-height: 22px;
  831 + text-align: left;
  832 + }
  833 +
  834 + .thumbnail_5 {
  835 + width: 18px;
  836 + height: 18px;
  837 + margin: 3px 0 0 359px;
  838 + }
  839 +
  840 + .block_8 {
  841 + width: 4px;
  842 + height: 4px;
  843 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng7fbe2300f4a054a715c64dbc28a72022345b6e8c29d87ba5be6e58b9222e6888)
  844 + 0px 0px no-repeat;
  845 + background-size: 4px 4px;
  846 + margin: 10px 0 0 20px;
  847 + }
  848 +
  849 + .block_9 {
  850 + width: 4px;
  851 + height: 4px;
  852 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng6bbeb27f239784515cbdbc576c0480e4f9218af9c9e465da945579af452e11a3)
  853 + 0px 0px no-repeat;
  854 + background-size: 4px 4px;
  855 + margin: 10px 0 0 2px;
  856 + }
  857 +
  858 + .block_10 {
  859 + width: 4px;
  860 + height: 4px;
  861 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng788c665bd82de9347efef08b24329265e7db13cb2ec04e9b336304cb6383bab2) -1px
  862 + 0px no-repeat;
  863 + background-size: 4px 4px;
  864 + margin: 10px 0 0 1px;
  865 + }
  866 +
  867 + .section_3 {
  868 + width: 374px;
  869 + height: 67px;
  870 + margin: 58px 0 0 73px;
  871 + }
  872 +
  873 + .box_12 {
  874 + height: 67px;
  875 + background-color: rgba(88, 83, 87, 1);
  876 + width: 210px;
  877 + }
  878 +
  879 + .box_13 {
  880 + width: 186px;
  881 + height: 50px;
  882 + margin: 9px 0 0 12px;
  883 + }
  884 +
  885 + .text-wrapper_13 {
  886 + height: 50px;
  887 + border-radius: 1px;
  888 + box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.7);
  889 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPngeb43fd189a34f107a87016160a0bb4a06b7227a89dd0e8872666398c06e106f0)
  890 + 0px -1px no-repeat;
  891 + background-size: 35px 51px;
  892 + width: 34px;
  893 + }
  894 +
  895 + .text_26 {
  896 + width: 21px;
  897 + height: 48px;
  898 + display: inline-block;
  899 + overflow-wrap: break-word;
  900 + color: rgba(255, 255, 255, 1);
  901 + font-size: 34px;
  902 + font-family: PingFangSC-Medium;
  903 + white-space: nowrap;
  904 + line-height: 48px;
  905 + text-align: center;
  906 + margin: 1px 0 0 6px;
  907 + }
  908 +
  909 + .text-wrapper_14 {
  910 + height: 50px;
  911 + border-radius: 1px;
  912 + box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.7);
  913 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPngeb43fd189a34f107a87016160a0bb4a06b7227a89dd0e8872666398c06e106f0)
  914 + 0px -1px no-repeat;
  915 + background-size: 35px 51px;
  916 + margin-left: 4px;
  917 + width: 34px;
  918 + }
  919 +
  920 + .text_27 {
  921 + width: 21px;
  922 + height: 48px;
  923 + display: inline-block;
  924 + overflow-wrap: break-word;
  925 + color: rgba(255, 255, 255, 1);
  926 + font-size: 34px;
  927 + font-family: PingFangSC-Medium;
  928 + white-space: nowrap;
  929 + line-height: 48px;
  930 + text-align: center;
  931 + margin: 1px 0 0 6px;
  932 + }
  933 +
  934 + .text-wrapper_15 {
  935 + height: 50px;
  936 + border-radius: 1px;
  937 + box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.7);
  938 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng2d347ae288939c4a28ddfa3b9f27c8fc682791a470f3b2106c28f1bdb6ab4ace)
  939 + 0px 0px no-repeat;
  940 + background-size: 35px 51px;
  941 + margin-left: 4px;
  942 + width: 34px;
  943 + }
  944 +
  945 + .text_28 {
  946 + width: 21px;
  947 + height: 48px;
  948 + display: inline-block;
  949 + overflow-wrap: break-word;
  950 + color: rgba(255, 255, 255, 1);
  951 + font-size: 34px;
  952 + font-family: PingFangSC-Medium;
  953 + white-space: nowrap;
  954 + line-height: 48px;
  955 + text-align: center;
  956 + margin: 1px 0 0 6px;
  957 + }
  958 +
  959 + .text-wrapper_16 {
  960 + height: 50px;
  961 + border-radius: 1px;
  962 + box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.7);
  963 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng2d347ae288939c4a28ddfa3b9f27c8fc682791a470f3b2106c28f1bdb6ab4ace)
  964 + 0px 0px no-repeat;
  965 + background-size: 35px 51px;
  966 + margin-left: 4px;
  967 + width: 34px;
  968 + }
  969 +
  970 + .text_29 {
  971 + width: 21px;
  972 + height: 48px;
  973 + display: inline-block;
  974 + overflow-wrap: break-word;
  975 + color: rgba(255, 255, 255, 1);
  976 + font-size: 34px;
  977 + font-family: PingFangSC-Medium;
  978 + white-space: nowrap;
  979 + line-height: 48px;
  980 + text-align: center;
  981 + margin: 1px 0 0 6px;
  982 + }
  983 +
  984 + .text-wrapper_17 {
  985 + height: 50px;
  986 + border-radius: 1px;
  987 + box-shadow: inset 0px 1px 3px 0px rgba(0, 0, 0, 0.7);
  988 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng2d347ae288939c4a28ddfa3b9f27c8fc682791a470f3b2106c28f1bdb6ab4ace)
  989 + 0px 0px no-repeat;
  990 + background-size: 35px 51px;
  991 + margin-left: 4px;
  992 + width: 34px;
  993 + }
  994 +
  995 + .text_30 {
  996 + width: 21px;
  997 + height: 48px;
  998 + display: inline-block;
  999 + overflow-wrap: break-word;
  1000 + color: rgba(255, 255, 255, 1);
  1001 + font-size: 34px;
  1002 + font-family: PingFangSC-Medium;
  1003 + white-space: nowrap;
  1004 + line-height: 48px;
  1005 + text-align: center;
  1006 + margin: 1px 0 0 6px;
  1007 + }
  1008 +
  1009 + .box_14 {
  1010 + width: 6px;
  1011 + height: 6px;
  1012 + background-color: rgba(51, 51, 51, 1);
  1013 + border-radius: 50%;
  1014 + margin: 60px 0 0 2px;
  1015 + }
  1016 +
  1017 + .box_15 {
  1018 + height: 67px;
  1019 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng82651a6dc918e308532b3fe2dc1839fae8d05c8efa7578d83cb239444ce9f549)
  1020 + 0px 0px no-repeat;
  1021 + background-size: 97px 67px;
  1022 + margin-left: 2px;
  1023 + width: 96px;
  1024 + }
  1025 +
  1026 + .box_16 {
  1027 + width: 72px;
  1028 + height: 50px;
  1029 + margin: 9px 0 0 12px;
  1030 + }
  1031 +
  1032 + .text-wrapper_18 {
  1033 + height: 50px;
  1034 + border-radius: 1px;
  1035 + box-shadow: inset 0px 1px 3px 0px rgba(112, 22, 15, 1);
  1036 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng245035e9da82a72a23044b1c0c3b0bbb68a44b2232ab4d286959d67553e1f40c)
  1037 + 0px -1px no-repeat;
  1038 + background-size: 35px 51px;
  1039 + width: 34px;
  1040 + }
  1041 +
  1042 + .text_31 {
  1043 + width: 21px;
  1044 + height: 48px;
  1045 + display: inline-block;
  1046 + overflow-wrap: break-word;
  1047 + color: rgba(255, 255, 255, 1);
  1048 + font-size: 34px;
  1049 + font-family: PingFangSC-Medium;
  1050 + white-space: nowrap;
  1051 + line-height: 48px;
  1052 + text-align: center;
  1053 + margin: 1px 0 0 6px;
  1054 + }
  1055 +
  1056 + .text-wrapper_19 {
  1057 + height: 50px;
  1058 + border-radius: 1px;
  1059 + box-shadow: inset 0px 1px 3px 0px rgba(112, 22, 15, 1);
  1060 + background: url(https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng245035e9da82a72a23044b1c0c3b0bbb68a44b2232ab4d286959d67553e1f40c)
  1061 + 0px -1px no-repeat;
  1062 + background-size: 35px 51px;
  1063 + width: 34px;
  1064 + }
  1065 +
  1066 + .text_32 {
  1067 + width: 21px;
  1068 + height: 48px;
  1069 + display: inline-block;
  1070 + overflow-wrap: break-word;
  1071 + color: rgba(255, 255, 255, 1);
  1072 + font-size: 34px;
  1073 + font-family: PingFangSC-Medium;
  1074 + white-space: nowrap;
  1075 + line-height: 48px;
  1076 + text-align: center;
  1077 + margin: 1px 0 0 6px;
  1078 + }
  1079 +
  1080 + .text_33 {
  1081 + width: 50px;
  1082 + height: 37px;
  1083 + display: inline-block;
  1084 + overflow-wrap: break-word;
  1085 + color: rgba(51, 51, 51, 1);
  1086 + font-size: 26px;
  1087 + font-family: PingFangSC-Medium;
  1088 + white-space: nowrap;
  1089 + line-height: 37px;
  1090 + text-align: center;
  1091 + margin: 15px 0 0 8px;
  1092 + }
  1093 +
  1094 + .text-wrapper_20 {
  1095 + width: 32px;
  1096 + height: 22px;
  1097 + margin: 30px 0 0 244px;
  1098 + }
  1099 +
  1100 + .text_34 {
  1101 + width: 32px;
  1102 + height: 22px;
  1103 + display: inline-block;
  1104 + overflow-wrap: break-word;
  1105 + color: rgba(102, 102, 102, 1);
  1106 + font-size: 16px;
  1107 + font-family: PingFangSC-Medium;
  1108 + white-space: nowrap;
  1109 + line-height: 22px;
  1110 + text-align: center;
  1111 + }
  1112 +
  1113 + .text-wrapper_21 {
  1114 + width: 213px;
  1115 + height: 20px;
  1116 + margin: 60px 0 20px 153px;
  1117 + }
  1118 +
  1119 + .text_35 {
  1120 + width: 213px;
  1121 + height: 20px;
  1122 + display: inline-block;
  1123 + overflow-wrap: break-word;
  1124 + color: rgba(153, 153, 153, 1);
  1125 + font-size: 14px;
  1126 + font-family: PingFangSC-Regular;
  1127 + white-space: nowrap;
  1128 + line-height: 20px;
  1129 + text-align: left;
  1130 + }
  1131 +
  1132 + .section_4 {
  1133 + position: absolute;
  1134 + left: 0;
  1135 + top: 875px;
  1136 + width: 282px;
  1137 + height: 205px;
  1138 + background-color: rgba(255, 255, 255, 1);
  1139 + }
  1140 + </style>
  1141 + </head>
  1142 + <body>
  1143 + <div class="section_3 flex-row">
  1144 + <div class="box_12 flex-col">
  1145 + <div class="box_13 flex-row justify-between">
  1146 + <div class="text-wrapper_13 flex-col">
  1147 + <span class="text_26">0</span>
  1148 + </div>
  1149 + <div class="text-wrapper_14 flex-col">
  1150 + <span class="text_27">0</span>
  1151 + </div>
  1152 + <div class="text-wrapper_15 flex-col">
  1153 + <span class="text_28">2</span>
  1154 + </div>
  1155 + <div class="text-wrapper_16 flex-col">
  1156 + <span class="text_29">6</span>
  1157 + </div>
  1158 + <div class="text-wrapper_17 flex-col">
  1159 + <span class="text_30">3</span>
  1160 + </div>
  1161 + </div>
  1162 + </div>
  1163 + <div class="box_14 flex-col"></div>
  1164 + <div class="box_15 flex-col">
  1165 + <div class="box_16 flex-row justify-between">
  1166 + <div class="text-wrapper_18 flex-col">
  1167 + <span class="text_31">0</span>
  1168 + </div>
  1169 + <div class="text-wrapper_19 flex-col">
  1170 + <span class="text_32">5</span>
  1171 + </div>
  1172 + </div>
  1173 + </div>
  1174 + <span class="text_33">kwh</span>
  1175 + </div>
  1176 + </body>
  1177 +</html>
... ...
... ... @@ -26,10 +26,6 @@
26 26
27 27 const { createMessage } = useMessage();
28 28
29   - // const componentRecord = reactive<DataBoardLayoutInfo>({
30   - // ...props.record,
31   - // } as unknown as DataBoardLayoutInfo);
32   -
33 29 const dataSource = ref<DataSourceEl[]>([
34 30 { id: buildUUID(), componentInfo: props.defaultConfig || {} } as unknown as DataSourceEl,
35 31 ]);
... ... @@ -49,6 +45,11 @@
49 45 }
50 46 };
51 47
  48 + const validate = async () => {
  49 + await basicMethod.validate();
  50 + await validateDataSourceField();
  51 + };
  52 +
52 53 const getAllDataSourceFieldValue = () => {
53 54 const _dataSource = getDataSourceField();
54 55 const basicInfo = basicMethod.getFieldsValue();
... ... @@ -58,6 +59,16 @@
58 59 };
59 60 };
60 61
  62 + const validateDataSourceField = async () => {
  63 + const hasExistEl = Object.keys(dataSourceEl).filter((key) => dataSourceEl[key]);
  64 + const _dataSource: boolean[] = [];
  65 + for (const id of hasExistEl) {
  66 + const flag = (await (dataSourceEl[id] as FormActionType).validate()) as boolean;
  67 + _dataSource.push(flag);
  68 + }
  69 + return _dataSource;
  70 + };
  71 +
61 72 const getDataSourceField = () => {
62 73 const hasExistEl = Object.keys(dataSourceEl).filter((key) => dataSourceEl[key]);
63 74 const _dataSource: DataSource[] = [];
... ... @@ -66,7 +77,7 @@
66 77 const value = (dataSourceEl[id] as FormActionType).getFieldsValue() as DataSource;
67 78 if (!~index) continue;
68 79 const componentInfo = unref(dataSource)[index].componentInfo || {};
69   - _dataSource.push({
  80 + _dataSource.unshift({
70 81 ...value,
71 82 componentInfo: { ...(props.defaultConfig || {}), ...componentInfo },
72 83 });
... ... @@ -90,6 +101,7 @@
90 101 });
91 102 await nextTick();
92 103 (dataSourceEl[copyRecordId] as FormActionType).setFieldsValue(value);
  104 + (dataSourceEl[copyRecordId] as FormActionType).clearValidate();
93 105 };
94 106
95 107 const [registerVisualOptionModal, { openModal }] = useModal();
... ... @@ -128,6 +140,7 @@
128 140
129 141 const echoDataSource = () => {
130 142 basicMethod.setFieldsValue(props.record.record);
  143 + basicMethod.clearValidate();
131 144 dataSource.value = [];
132 145 dataSource.value = props.record.record.dataSource.map((item) => {
133 146 const id = buildUUID();
... ... @@ -139,6 +152,7 @@
139 152
140 153 nextTick(() => {
141 154 (dataSourceEl[id] as FormActionType).setFieldsValue(item);
  155 + (dataSourceEl[id] as FormActionType).clearValidate();
142 156 });
143 157 return {
144 158 id,
... ... @@ -165,6 +179,7 @@
165 179
166 180 defineExpose({
167 181 getAllDataSourceFieldValue,
  182 + validate,
168 183 });
169 184 </script>
170 185
... ...
... ... @@ -44,6 +44,7 @@
44 44
45 45 const basicConfigurationEl = ref<{
46 46 getAllDataSourceFieldValue: Fn<any, Recordable>;
  47 + validate: Fn;
47 48 }>();
48 49
49 50 const resetForm = () => {
... ... @@ -53,8 +54,9 @@
53 54 componentDefaultConfig.value = {};
54 55 };
55 56
56   - const handleSubmit = () => {
57   - const { getAllDataSourceFieldValue } = unref(basicConfigurationEl)!;
  57 + const handleSubmit = async () => {
  58 + const { getAllDataSourceFieldValue, validate } = unref(basicConfigurationEl)!;
  59 + await validate();
58 60 const value = getAllDataSourceFieldValue();
59 61 unref(isEdit) ? handleUpdateComponent(value) : handleAddComponent(value);
60 62 resetForm();
... ...
... ... @@ -32,6 +32,7 @@ export const basicSchema: FormSchema[] = [
32 32 field: BasicConfigField.NAME,
33 33 label: '组件名称',
34 34 component: 'Input',
  35 + rules: [{ required: true, message: '组件名称为必填项' }],
35 36 componentProps: {
36 37 placeholder: '请输入组件名称',
37 38 },
... ... @@ -40,6 +41,7 @@ export const basicSchema: FormSchema[] = [
40 41 field: BasicConfigField.REMARK,
41 42 label: '组件备注',
42 43 component: 'InputTextArea',
  44 + // rules: [{ required: true, message: '组件备注为必填项' }],
43 45 componentProps: {
44 46 placeholder: '请输入组件备注',
45 47 },
... ... @@ -64,6 +66,7 @@ export const dataSourceSchema: FormSchema[] = [
64 66 component: 'ApiTreeSelect',
65 67 label: '组织',
66 68 colProps: { span: 8 },
  69 + rules: [{ required: true, message: '组织为必填项' }],
67 70 componentProps({ formActionType }) {
68 71 const { setFieldsValue } = formActionType;
69 72 return {
... ... @@ -90,6 +93,7 @@ export const dataSourceSchema: FormSchema[] = [
90 93 component: 'ApiSelect',
91 94 label: '设备',
92 95 colProps: { span: 8 },
  96 + rules: [{ required: true, message: '设备名称为必填项' }],
93 97 componentProps({ formModel, formActionType }) {
94 98 const { setFieldsValue } = formActionType;
95 99 const organizationId = formModel[DataSourceField.ORIGINATION_ID];
... ... @@ -126,6 +130,7 @@ export const dataSourceSchema: FormSchema[] = [
126 130 label: '网关子设备',
127 131 component: 'ApiSelect',
128 132 colProps: { span: 8 },
  133 + rules: [{ required: true, message: '网关子设备为必填项' }],
129 134 ifShow({ model }) {
130 135 return model[DataSourceField.IS_GATEWAY_DEVICE];
131 136 },
... ... @@ -168,6 +173,7 @@ export const dataSourceSchema: FormSchema[] = [
168 173 component: 'ApiSelect',
169 174 label: '属性',
170 175 colProps: { span: 8 },
  176 + rules: [{ required: true, message: '属性为必填项' }],
171 177 componentProps({ formModel }) {
172 178 const organizationId = formModel[DataSourceField.ORIGINATION_ID];
173 179 const isGatewayDevice = formModel[DataSourceField.IS_GATEWAY_DEVICE];
... ...
... ... @@ -177,21 +177,23 @@
177 177 openModal(true, { isEdit: false });
178 178 };
179 179
  180 + const getLayoutInfo = () => {
  181 + return unref(dataBoardList).map((item) => {
  182 + return {
  183 + id: item.i,
  184 + h: item.h,
  185 + w: item.w,
  186 + x: item.x,
  187 + y: item.y,
  188 + } as Layout;
  189 + });
  190 + };
  191 +
180 192 const handleSaveLayoutInfo = async () => {
181 193 try {
182   - const layoutInfo = unref(dataBoardList).map((item) => {
183   - return {
184   - id: item.i,
185   - h: item.h,
186   - w: item.w,
187   - x: item.x,
188   - y: item.y,
189   - } as Layout;
190   - });
191   -
192 194 await updateDataBoardLayout({
193 195 boardId: unref(getBoardId),
194   - layout: layoutInfo,
  196 + layout: getLayoutInfo(),
195 197 });
196 198 } catch (error) {}
197 199 };
... ... @@ -231,7 +233,6 @@
231 233
232 234 if (!data.data.componentData) {
233 235 dataBoardList.value = [];
234   - console.log(unref(dataBoardList));
235 236 return;
236 237 }
237 238 dataBoardList.value = data.data.componentData.map((item) => {
... ... @@ -311,7 +312,7 @@
311 312 const handleCopy = async (id: string) => {
312 313 const record = unref(dataBoardList).find((item) => item.i === id);
313 314 try {
314   - await addDataComponent({
  315 + const data = await addDataComponent({
315 316 boardId: unref(getBoardId),
316 317 record: {
317 318 dataBoardId: unref(getBoardId),
... ... @@ -320,14 +321,33 @@
320 321 },
321 322 });
322 323 createMessage.success('复制成功');
323   - getDataBoardComponent();
  324 + const _id = data.data.id;
  325 + const layoutInfo = getLayoutInfo();
  326 +
  327 + layoutInfo.push({
  328 + id: _id,
  329 + h: record?.h,
  330 + w: record?.w,
  331 + x: record?.x,
  332 + y: record?.y,
  333 + } as Layout);
  334 +
  335 + await updateDataBoardLayout({
  336 + boardId: unref(getBoardId),
  337 + layout: layoutInfo,
  338 + });
  339 +
  340 + await getDataBoardComponent();
324 341 } catch (error) {}
325 342 };
326 343
327 344 const handleDelete = async (id: string) => {
328 345 try {
329   - await deleteDataComponent([id]);
  346 + const dataBoardId = unref(dataBoardList).find((item) => item.i == id)?.record.dataBoardId;
  347 + if (!dataBoardId) return;
  348 + await deleteDataComponent({ dataBoardId, ids: [id] });
330 349 createMessage.success('删除成功');
  350 + await handleSaveLayoutInfo();
331 351 await getDataBoardComponent();
332 352 } catch (error) {
333 353 // createMessage.error('删除失败');
... ...