FlowNodeStartNewFlow.vue 52.2 KB
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 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 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 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 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 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610
<template>
  <div class="form-inline">
    <label class="control-label">{{ node.name }}({{ node.nodeId }})</label>
    <el-button type="primary" size="mini" @click="editTaskReminder"
      >设置</el-button
    >
    <br />
    <label
      v-if="!confList || confList.length == 0"
      class="control-label"
      style="color: #dd6161"
      >尚未配置自动触发新流程</label
    >
    <div v-if="confList && confList.length > 0">
      <label
        style="display: block; text-align: left"
        class="control-label"
        v-for="taskReminder in confList"
        :key="taskReminder.name"
        >{{ taskReminder.name }}</label
      >
      <div class="control-label" style="text-align: right">
        查看更多信息请编辑
      </div>
      <br />
    </div>
    <el-dialog
      width="68%"
      top="8vh"
      :title="'触发新流程设置(' + node.name + ')'"
      :visible="dialogVisibleSetting"
      :before-close="close"
      :close-on-click-modal="false"
      append-to-body
    >
      <div style="width: 100%; height: 550px;min-width:880px">
        <div
          ref="flowNodeSetting"
          @scroll="handlerScroll()"
          class="flow-node-setting"
        >
          <el-form
            v-model="reminder"
            data-vv-scope="settingSave"
            v-form
            class="elForm"
          >
            <table
              class="form-table flow-form-table"
              cellspacing="0"
              cellpadding="0"
              border="0"
            >
              <tbody>
                <tr>
                  <th width="110px" class="is-required">名称:</th>
                  <td>
                    <el-input
                      v-model="reminder.name"
                      placeholder="请输入配置名称"
                      style="width:400px"
                    />
                  </td>
                </tr>
                <tr>
                  <th
                    width="110px"
                    class="is-required"
                    v-if="node.nodeType != 'START' && node.nodeType != 'END'"
                  >
                    触发动作:
                  </th>
                  <td v-if="node.nodeType != 'START' && node.nodeType != 'END'">
                    <el-radio v-model="reminder.triggerAction" label="agree"
                      >同意</el-radio
                    >
                    <el-radio v-model="reminder.triggerAction" label="reject"
                      >驳回</el-radio
                    >
                    <el-radio v-model="reminder.triggerAction" label="oppose"
                      >反对</el-radio
                    >
                  </td>
                </tr>

                <tr>
                  <th width="110px" class="is-required">选择流程:</th>
                  <td>
                    <div>
                      <el-input
                        v-model="reminder.defName"
                        placeholder="选择触发的新流程"
                        validate="required"
                        :readonly="true"
                        disabled
                        style="width:300px"
                      />
                      <el-button
                        type="primary"
                        @click="selectDef"
                        style="margin-left:8px !important"
                        >选择流程
                      </el-button>
                    </div>
                  </td>
                </tr>
                <tr>
                  <th width="110px" class="is-required">触发类型:</th>
                  <td>
                    <el-radio-group
                      v-model="reminder.triggerType"
                      @change="handleOldDefVar()"
                    >
                      <el-radio label="1">按发起人</el-radio>
                      <el-radio label="2">按表单对象</el-radio>
                    </el-radio-group>
                  </td>
                </tr>

                <tr v-if="reminder.triggerType == '2'">
                  <th width="110px" class="is-required">触发对象:</th>
                  <td>
                    <div>
                      <ht-select
                        v-model="curSelectEntity"
                        :options="boEntityList"
                        :validate="{required: true}"
                        @change="handleEntityChange()"
                        style="width:250px"
                      />
                    </div>
                  </td>
                  <th width="110px">触发时机:</th>
                  <td>
                    <el-radio-group
                      v-model="reminder.triggerTiming"
                      @change="initCondition()"
                    >
                      <el-radio label="1">直接触发</el-radio>
                      <el-radio label="2">按规则触发</el-radio>
                    </el-radio-group>
                  </td>
                </tr>
                <tr v-if="reminder.triggerTiming == '2'">
                  <th width="110px">规则设置:</th>
                  <td colspan="3">
                    <div>
                      <span>{{ reminder.condition.conditionDes }}</span
                      >&nbsp;
                      <el-button
                        type="text"
                        size="mini"
                        icon="el-icon-setting"
                        @click="openConditionDialog()"
                        >设置规则</el-button
                      >
                    </div>
                  </td>
                </tr>
                <tr>
                  <th width="150px" class="is-required th_notes">
                    <el-tooltip effect="dark" placement="right"
                      ><div slot="content">
                        ①可不选,不选则取节点完成时的审批人作为发起人<br />
                        ②所选用户拥有该流程启动权限方可触发<br />
                      </div>
                      <i class="icon-notes"></i>:
                    </el-tooltip>
                    <label style="margin-left:25px">流程发起人:</label>
                  </th>
                  <td colspan="3">
                    <div
                      v-if="reminder.triggerType == '1'"
                      @click="addUserCondition"
                    >
                      <el-input
                        v-model="reminder.userRule.description"
                        autosize
                        type="textarea"
                        placeholder="设置流程发起人"
                        validate="required"
                        :readonly="true"
                        style="width:300px"
                      />
                    </div>
                    <ht-user-selector-input
                      v-else
                      :appendToBody="true"
                      v-model="reminder.startName"
                      :config="{account: 'reminder.startAccount'}"
                      class="flow-selector-input"
                    />
                  </td>
                </tr>

                <tr>
                  <th width="110px" style="    display: flex;">
                    对应字段:
                  </th>
                  <td colspan="3" style="padding: 15px">
                    <el-button
                      type="primary"
                      size="mini"
                      icon="el-icon-plus"
                      @click="addFormVarConf()"
                      >添加</el-button
                    >
                    <div class="table-wrap">
                      <div class="table-header">
                        <div
                          class="header-item"
                          v-for="item in tableHeader"
                          :key="item.key"
                        >
                          {{ item.value }}
                        </div>
                      </div>
                      <div class="table-content">
                        <ul
                          class="row"
                          v-for="(userRule, userIndex) in reminder.formVarConf"
                          :key="userIndex"
                        >
                          <li class="col flex-column">
                            <div class="col-item-box">
                              <span>选择主流程表:</span>
                              <FlowVarSelector
                                v-show="false"
                                type="3"
                                :varData="flowVarWithOutSub"
                                v-model="userRule.oldVar"
                                @node-click="handleClickNode"
                                @getData="getData"
                                style="width:33%;display:none"
                              />
                              <el-select
                                v-model="userRule.oldTable"
                                placeholder="请选择表"
                                :popper-append-to-body="false"
                                @change="
                                  change($event, 1, userIndex, `oldDisabled`)
                                "
                                style="    margin-right: 10px;"
                              >
                                <el-option
                                  v-for="item in optionsOld.filter(
                                    it => it.name !== '扩展变量'
                                  )"
                                  :key="item.id"
                                  :label="item.desc"
                                  :value="item.id"
                                  :disabled="
                                    selectedOldTableList.includes(item.id)
                                  "
                                >
                                </el-option>
                              </el-select>
                            </div>
                            <div class="col-item-box">
                              <span>选择触发流程表:</span>
                              <FlowVarSelector
                                v-show="false"
                                type="3"
                                v-if="defVarMap[reminder.defKey]"
                                :varData="defVarMap[reminder.defKey]"
                                :isNewFlow="true"
                                :isSubOrSunTable="isSubOrSunTable"
                                v-model="userRule.newVar"
                                @getData="getData"
                                style="width:33%;display:none"
                              />
                              <el-select
                                v-model="userRule.newTable"
                                placeholder="请选择表"
                                :disabled="userRule.oldNewTable"
                                :popper-append-to-body="false"
                                @change="
                                  change($event, 3, userIndex, `oldNewField`)
                                "
                                style="    margin-right: 10px;"
                              >
                                <el-option
                                  v-for="item in userRule.optionsNew &&
                                    userRule.optionsNew.filter(
                                      it => it.name !== '扩展变量'
                                    )"
                                  :key="item.id"
                                  :label="item.desc"
                                  :value="item.id"
                                  :disabled="
                                    selectedNewTableList.includes(item.id)
                                  "
                                >
                                </el-option>
                              </el-select>
                            </div>
                          </li>
                          <li class="col two-column">
                            <div
                              class="col-field-item"
                              v-for="(it, idx) in userRule.fieldList"
                              :key="idx"
                            >
                              <el-select
                                v-model="it.oldField"
                                :disabled="userRule.oldDisabled"
                                :popper-append-to-body="false"
                                placeholder="请选择流程字段"
                                @change="
                                  change(
                                    $event,
                                    2,
                                    userIndex,
                                    `oldNewTable`,
                                    idx
                                  )
                                "
                              >
                                <el-option
                                  v-for="item in userRule.oldFieldOptions"
                                  :key="item.id"
                                  :label="item.desc"
                                  :value="item.id"
                                  :disabled="oldFieldList.includes(item.id)"
                                >
                                </el-option>
                              </el-select>
                              <el-select
                                v-model="it.newField"
                                style="margin-left:20px"
                                placeholder="请选择流程字段"
                                :popper-append-to-body="false"
                                :disabled="userRule.oldNewField"
                                @change="change($event, 4, userIndex, '', idx)"
                              >
                                <el-option
                                  v-for="item in userRule.newFieldOptions"
                                  :key="item.id"
                                  :label="item.desc"
                                  :value="item.id"
                                  :disabled="newFieldList.includes(item.id)"
                                >
                                </el-option>
                              </el-select>
                              <el-button
                                style="margin-left:10px !important"
                                size="small"
                                icon="el-icon-delete"
                                type="text"
                                v-show="userRule.fieldList.length > 1"
                                @click="handleDel(userIndex, idx)"
                              ></el-button>
                            </div>
                          </li>
                          <li class="col last-col">
                            <el-button
                              size="small"
                              icon="el-icon-plus"
                              @click="handleAdd(userIndex)"
                            ></el-button>
                            <el-button
                              size="small"
                              icon="el-icon-delete"
                              @click="deleteItem(userIndex)"
                            ></el-button>
                          </li>
                        </ul>
                      </div>
                    </div>
                    <!-- <table
                      class="table table-bordered var-conf-table"
                      style="width: 100%;margin-top: 15px;"
                    >
                      <thead> 
                        <tr>
                          <th width="45%">
                            主流程字段
                          </th>

                          <th width="45%">新流程字段</th>
                          <th width="10%">操作</th>
                        </tr>
                      </thead>
                      <tr
                        v-for="(userRule, userIndex) in reminder.formVarConf"
                        :key="userIndex"
                      >
                        <td>
                          <FlowVarSelector
                            v-show="false"
                            type="3"
                            :varData="flowVarWithOutSub"
                            v-model="userRule.oldVar"
                            @node-click="handleClickNode"
                            @getData="getData"
                            style="width:33%;display:none"
                          />
                          <el-select
                            v-model="userRule.oldTable"
                            placeholder="请选择表"
                            @change="
                              change($event, 1, userIndex, `oldDisabled`)
                            "
                            style="    margin-right: 10px;"
                          >
                            <el-option
                              v-for="item in optionsOld"
                              :key="item.id"
                              :label="item.desc"
                              :value="item.id"
                            >
                            </el-option>
                          </el-select>
                          <el-select
                            v-model="userRule.oldField"
                            :disabled="userRule.oldDisabled"
                            placeholder="请选择流程字段"
                            @change="
                              change($event, 2, userIndex, `oldNewTable`)
                            "
                          >
                            <el-option
                              v-for="item in optionsFilter[
                                `oldFieldOptions_${userIndex}`
                              ]"
                              :key="item.id"
                              :label="item.desc"
                              :value="item.id"
                            >
                            </el-option>
                          </el-select>
                        </td>
                        <td>
                          <FlowVarSelector
                            v-show="false"
                            type="3"
                            v-if="defVarMap[reminder.defKey]"
                            :varData="defVarMap[reminder.defKey]"
                            :isNewFlow="true"
                            :isSubOrSunTable="isSubOrSunTable"
                            v-model="userRule.newVar"
                            @getData="getData"
                            style="width:33%;display:none"
                          />
                          <el-select
                            v-model="userRule.newTable"
                            placeholder="请选择表"
                            :disabled="userRule.oldNewTable"
                            @change="
                              change($event, 3, userIndex, `oldNewField`)
                            "
                            style="    margin-right: 10px;"
                          >
                            <el-option
                              v-for="item in optionsFilter[
                                `optionsNew_${userIndex}`
                              ]"
                              :key="item.id"
                              :label="item.desc"
                              :value="item.id"
                            >
                            </el-option>
                          </el-select>
                          <el-select
                            v-model="userRule.newField"
                            placeholder="请选择流程字段"
                            :disabled="userRule.oldNewField"
                            @change="change($event, 4, userIndex)"
                          >
                            <el-option
                              v-for="item in optionsFilter[
                                `newFieldOptions_${userIndex}`
                              ]"
                              :key="item.id"
                              :label="item.desc"
                              :value="item.id"
                            >
                            </el-option>
                          </el-select>
                        </td>
                        <td>
                          <el-button
                            size="mini"
                            type="text"
                            @click="deleteItem(userIndex)"
                            >删除</el-button
                          >
                        </td>
                      </tr>
                    </table> -->
                  </td>
                </tr>
              </tbody>
            </table>
          </el-form>
        </div>
      </div>
      <div slot="footer" style="margin-bottom: 10px">
        <el-button type="default" @click="close">关闭</el-button>
        <el-button type="primary" plain @click="clear">清空</el-button>
        <el-button type="primary" @click="addRemind">保存</el-button>
      </div>
    </el-dialog>
    <!-- 人员配置选择器 -->
    <FlowNodeUserCondition
      @nodeUserConditionConfirm="nodeUserConditionConfirm"
      ref="flowNodeUserCondition"
    />
    <FlowConditionBuildDialog
      @onConfirmWithData="conditionDialogConfirm"
      ref="flowConditionBuildDialog"
    />
    <eip-flow-dialog
      ref="eipFlowDialog"
      name="eipFlowDialog"
      @onConfirm="handleDialogSure"
      :single="true"
      append-to-body
    />
  </div>
</template>

<script>
import req from '@/request.js'
import {mapState, mapActions} from 'vuex'
import {Message} from 'element-ui'
const eipScriptDialog = () => import('@/components/dialog/EipScriptDialog.vue')
const FlowNodeUserCondition = () =>
  import('@/components/flow/FlowNodeUserCondition.vue')
const eipFlowDialog = () => import('@/components/dialog/EipFlowDialog.vue')
const FlowVarSelector = () => import('@/components/flow/FlowVarSelector.vue')
import FlowConditionBuildDialog from '@/components/flow/FlowConditionBuildDialog.vue'

export default {
  name: 'FlowStartConf',
  components: {
    eipScriptDialog,
    FlowNodeUserCondition,
    eipFlowDialog,
    FlowVarSelector,
    FlowConditionBuildDialog
  },
  props: {
    //任务节点信息
    node: {
      type: Object,
      required: true
    },
    //流程配置信息
    defConfigData: {
      type: Object,
      required: true
    },
    //所有的自动触发新流程的配置
    confList: {
      type: Array,
      required: true
    },
    flowVar: {
      type: Array,
      required: false
    }
  },

  data() {
    return {
      dialogVisibleSetting: false, //是否显示设置节点新流程触发设置侧边栏
      reminder: {
        name: '',
        triggerAction: 'agree',
        userRule: {description: ''},
        defName: '',
        defKey: '',
        formVarConf: [],
        isAdd: true,
        startName: '',
        startAccount: '',
        triggerEntity: '',
        condition: {}
      },
      isSave: false, //判断是否可以保存
      confListCopy: [], //复制一份最开始的新流程触发设置配置的信息
      defVarMap: {},
      boEntityList: [],
      flowVarWithOutSub: [],
      curSelectEntity: '',
      isSubOrSunTable: false,
      optionsOld: [],
      optionsNew: [],
      newFieldOptions: [],
      oldFieldOptions: [],
      //被选的
      newFieldList: [],
      oldFieldList: [],
      //
      optionsFilter: {},
      tableHeader: [
        {
          key: 'selectTable',
          value: '所选表'
        },
        {
          key: 'mainFlowField',
          value: '主流程字段'
        },
        {
          key: 'newFlowField',
          value: '触发流程字段'
        },
        {
          key: 'operate',
          value: '操作'
        }
      ],
      selectedOldTableList: [],
      selectedNewTableList: [],
   
    }
  },
  watch: {
    'reminder.defKey': function(n, o) {
      if (n && !this.defVarMap[n]) {
        this.getNewDefVar()
      }
    },
    confList: {
      handler(val) {},
      immediate: true,
      deep: true
    }
  },
  methods: {
    handlerScroll() {
      this.scrollBol = true
      let target = this.$refs.flowNodeSetting.querySelectorAll(
        '.el-select-dropdown'
      )
      for (let item of target) {
        item.style.display = 'none'
      }
    },
    //监听父子滚动
    handleDel(index, idx) {
      this.reminder.formVarConf[index].fieldList.splice(idx, 1)
      this.setSelectedIds()
    },
    handleAdd(index) {
      this.reminder.formVarConf[index].fieldList.push({
        oldTable: '',
        oldField: '',
        newTable: '',
        newField: ''
      })
    },
    //typeDiff 1主 2子
    getData(list, Bol) {
      let data = _.cloneDeep(list)
      let options = []
      let optionsField = []

      data.forEach(item => {
        if (item.children && item.children.length) {
          item.children.forEach(zhubItem => {
            if (zhubItem.children && zhubItem.children.length) {
              zhubItem.children.forEach(ziItem => {
                if (ziItem.children && ziItem.children.length) {
                  ziItem.children.forEach(sunItem => {
                    if (sunItem.children && sunItem.children.length) {
                    } else {
                      ziItem.typeDiff = 2
                      options.push(ziItem)
                      sunItem.typeDiff = 2
                      optionsField.push(sunItem)
                    }
                  })
                } else {
                  zhubItem.typeDiff = 1
                  options.push(zhubItem)
                  ziItem.typeDiff = 1
                  optionsField.push(ziItem)
                }
              })
            } else {
              item.typeDiff = 1
              options.push(item)
              zhubItem.typeDiff = 1
              optionsField.push(zhubItem)
            }
          })
        }
      })
      options = this.filterList(options)
      optionsField = this.filterList(optionsField)
      if (Bol) {
        this.optionsNew = options
        this.newFieldOptions = optionsField
      } else {
        this.optionsOld = options
        this.oldFieldOptions = optionsField
      }
    },
    filterList(data) {
      let map = new Map()
      for (let item of data) {
        map.set(item.id, item)
      }
      data = [...map.values()]
      return data
    },
    change($event, type, index, disabled, idx) {
      let that = this

      // if (this.oldFieldList.includes($event)) {
      //   this.$message.warning('该流程字段已被选择')

      //   this.$nextTick(() => {
      //     that.reminder.formVarConf[index].oldField = ''
      //   })
      //   return
      // }
      // if (this.newFieldList.includes($event)) {
      //   this.$message.warning('该流程字段已被选择')
      //   this.$nextTick(() => {
      //     that.reminder.formVarConf[index].newField = ''
      //   })
      //   return
      // }
      if ([1, 2, 3].includes(type)) {
        that.reminder.formVarConf[index][disabled] = false
      }
      if (type == 1) {
        that.reminder.formVarConf[index].oldField = ''
        that.reminder.formVarConf[index].newTable = ''
        that.reminder.formVarConf[index].newField = ''
        this.filterListOptions($event, index, 'oldFieldOptions')
        this.filterListOptions($event, index, 'optionsNew')
        this.filterListOptions($event, index, 'newFieldOptions')
        const selectTable = that.optionsOld.find(it => it.id === $event)
        const currentNewTableList = that.optionsNew.filter(
          item => item.typeDiff === selectTable.typeDiff
        )
        const currentFieldList = that.oldFieldOptions.filter(
          item =>
            item.path === selectTable.path ||
            (item.typeDiff == selectTable.typeDiff && !item.path)
        )
        that.$set(
          that.reminder.formVarConf[index],
          'oldFieldOptions',
          currentFieldList
        )
        that.$set(
          that.reminder.formVarConf[index],
          'optionsNew',
          currentNewTableList
        )
      }
      if (type == 2) {
        // that.reminder.formVarConf[index].newTable = ''
        // that.reminder.formVarConf[index].newField = ''
        // userRule.oldVar
        this.addDataList($event, 'oldVar', index, 'oldFieldOptions', idx)
      }
      if (type == 3) {
        that.reminder.formVarConf[index].newField = ''
        const selectTable = that.optionsNew.find(it => it.id === $event)
        const currentFieldList = that.newFieldOptions.filter(
          it =>
            it.path === selectTable.path ||
            (it.typeDiff == selectTable.typeDiff && !it.path)
        )
        that.$set(
          that.reminder.formVarConf[index],
          'newFieldOptions',
          currentFieldList
        )
      }
      if (type == 4) {
        // userRule.newVar
        this.addDataList($event, 'newVar', index, 'newFieldOptions', idx)
      }
      this.oldFieldList = []
      this.newFieldList = []
      const oldFieldList = []
      const newFieldList = []
      this.selectedOldTableList = []
      this.selectedNewTableList = []
      this.reminder.formVarConf.forEach(item => {
        if (item.oldTable) {
          this.selectedOldTableList.push(item.oldTable)
        }
        if (item.newTable) {
          this.selectedNewTableList.push(item.newTable)
        }
        if (item.fieldList && item.fieldList.length) {
          oldFieldList.push(item.fieldList.map(it => it.oldField))
          newFieldList.push(item.fieldList.map(it => it.newField))
        }
      })
      this.oldFieldList = oldFieldList.flat().filter(Boolean)
      this.newFieldList = newFieldList.flat().filter(Boolean)
      that.reminder = Object.assign({}, that.reminder)
    },
    //合成传参
    addDataList(even, name, index, opName, idx) {
      this.optionsFilter[`${opName}_${index}`].forEach(item => {
        if (item.id == even) {
          this.reminder.formVarConf[index].fieldList[idx][name] =
            // this.reminder.formVarConf[index][name] =
            item.desc +
            '【' +
            item.path +
            '.' +
            item.name +
            '】-' +
            item.dataType
          this.reminder.formVarConf[index].fieldList[
            idx
          ].oldTable = this.reminder.formVarConf[index].oldTable
          this.reminder.formVarConf[index].fieldList[
            idx
          ].newTable = this.reminder.formVarConf[index].newTable
        }
      })
    },
    //过滤选项
    filterListOptions(event, index, name) {
      this.optionsOld.forEach(item => {
        if (item.id == event) {
          if (item.typeDiff) {
            this.optionsFilter[`${name}_${index}`] = this[name].filter(i => {
              return i.typeDiff == item.typeDiff
            })
          }
        }
      })
    },
    //删除
    deleteItem(userIndex) {
      this.reminder.formVarConf.splice(userIndex, 1)
      this.reminder = Object.assign({}, this.reminder)
      this.setSelectedIds()
    },
    updateOptions() {},
    handleClickNode(data, node) {
      this.isSubOrSunTable = data.path && data.path.split('.').length > 1
    },
    handleClickNewFlowNode() {},
    initCondition() {
      this.reminder.condition = {
        conditionString: '',
        conditionDes: '',
        conditionObj: ''
      }
    },
    // 当触发对象发生变化时。计算旧流程的可选变量
    handleOldDefVar(remainVarCinf) {
      if (!remainVarCinf) {
        this.reminder.formVarConf = []
        this.selectedOldTableList = []
        this.selectedNewTableList = []
        this.newFieldList = []
        this.oldFieldList = []
      }
      let pathArr = []
      if (this.reminder.triggerType == '2') {
        pathArr = this.reminder.triggerEntity.split('.')
      }
      this.flowVarWithOutSub = JSON.parse(JSON.stringify(this.flowVar))
      //只保留主表字段
      if (!this.flowVarWithOutSub || this.flowVarWithOutSub.length <= 0) {
        return
      }
      this.flowVarWithOutSub[0].children.forEach(mainEnt => {
        if (mainEnt.childre == undefined || mainEnt.childre.length == 0) {
          return
        }
        for (let index = mainEnt.children.length - 1; index > 0; index--) {
          const mainEntFiled = mainEnt.children[index]
          // 主表字段有children的表名为子表
          if (mainEntFiled.children) {
            // pathArr.length < 3 表示所选的是主表,则移除掉子表。  或者选了子表,移除掉非所选则子表
            if (
              pathArr.length < 3 ||
              (pathArr.length > 2 && pathArr[2] != 'sub_' + mainEntFiled.name)
            ) {
              mainEnt.children.splice(index, 1)
            } else {
              // 选择的触发对象是子表的,遍历子表移除孙表 或者选了孙表,移除非所选孙表
              for (let i = mainEntFiled.children.length - 1; i > 0; i--) {
                const subFiled = mainEntFiled.children[i]
                if (
                  subFiled.children &&
                  (pathArr.length == 3 ||
                    (pathArr.length > 3 &&
                      pathArr[3] != 'sub_' + subFiled.name))
                ) {
                  mainEntFiled.children.splice(i, 1)
                }
              }
            }
          }
        }
      })
    },
    handleEntityChange() {
      if (this.reminder.condition.conditionObj) {
        this.$confirm('修改触发对象会清空触发规则, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        })
          .then(() => {
            this.reminder.triggerEntity = this.curSelectEntity
            this.reminder.condition = {}
            this.handleOldDefVar()
          })
          .catch(() => {
            this.curSelectEntity = this.reminder.triggerEntity
          })
      } else {
        this.reminder.triggerEntity = this.curSelectEntity
        this.handleOldDefVar()
      }
    },
    openConditionDialog() {
      if (!this.reminder.triggerEntity) {
        this.$message.warning('请先选择触发对象')
        return
      }
      let boVar = {}
      this.boEntityList.forEach(bo => {
        if (bo.key == this.reminder.triggerEntity) {
          bo = bo.entity
          bo.path = bo.name
          if (bo.children) {
            for (let index = bo.children.length - 1; index > 0; index--) {
              const filed = bo.children[index]
              filed.path = bo.name
              if (filed.children) {
                bo.children.splice(index, 1)
              }
            }
          }
          boVar = bo
        }
      })
      let varArray = [
        {name: 'curUserId', desc: '当前用户ID', comment: '当前用户ID'},
        {name: 'curUserAccount', desc: '当前用户账号', comment: '当前用户账号'},
        {name: 'curUserName', desc: '当前用户姓名', comment: '当前用户姓名'}
      ]
      let param = {
        boVar: [
          {name: '表单变量', children: [boVar]},
          {name: '流程变量', isFlow: true, children: varArray}
        ]
      }

      if (this.reminder.condition.conditionObj) {
        param.conditionObj = JSON.parse(this.reminder.condition.conditionObj)
      }
      this.$refs.flowConditionBuildDialog.showDialog(param)
    },
    conditionDialogConfirm(data) {
      this.reminder.condition = data
    },
    getNewDefVar() {
      let me_ = this
      req
        .post(window.context.bpmModel + '/flow/node/v1/varTree', {
          flowKey: this.reminder.defKey,
          nodeId: this.node.nodeId,
          includeBpmConstants: false,
          removeSub: false,
          bpmForm: true
        })
        .then(response => {
          if (
            response &&
            response.data[0] &&
            response.data[0].children &&
            response.data[0].children.length > 1
          ) {
            this.reminder.defName = ''
            this.reminder.defKey = ''
            return this.$message.warning(
              '当前选择流程绑定的是多实体表单,请选择单实体表单流程'
            )
          }
          me_.$set(me_.defVarMap, me_.reminder.defKey, response.data || [])
        })
    },
    handleDialogSure(data) {
      if (
        (data && data.length > 0 && this.reminder.defKey == data[0].defKey) ||
        !this.reminder.defKey
      ) {
        this.reminder.defName = data[0].name
        this.reminder.defKey = data[0].defKey
        return
      }
      this.$confirm(`更换流程将会清空对应字段的配置,是否确定更换?`).then(() => {
        if (data && data.length > 0) {
          this.reminder.defName = data[0].name
          this.reminder.defKey = data[0].defKey
        } else {
          this.reminder.defName = ''
          this.reminder.defKey = ''
        }
        this.reminder.formVarConf = []
        this.selectedOldTableList = []
        this.selectedNewTableList = []
        this.newFieldList = []
        this.oldFieldList = []
      })
    },
    selectDef() {
      this.$refs.eipFlowDialog.showDialog()
    },
    addFormVarConf() {
      if (!this.reminder.defKey) {
        Message.warning('要先选择要触发的流程才能配置对应字段')
        return
      }
      if (this.reminder.triggerType == '2' && !this.reminder.triggerEntity) {
        Message.warning('要先选择触发对象才能配置对应字段')
        return
      }
      this.reminder.formVarConf.push({
        oldDisabled: true,
        oldNewTable: true,
        oldNewField: true,
        oldTable: '',
        oldField: '',
        newTable: '',
        newField: '',
        fieldList: [
          {
            oldDisabled: true,
            oldNewTable: true,
            oldNewField: true,
            oldTable: '',
            oldField: '',
            newTable: '',
            newField: ''
          }
        ]
      })
      this.reminder = Object.assign({}, this.reminder)
    },
    nodeUserConditionConfirm(res) {
      this.reminder.userRule = res
    },
    //添加人员配置(办结抄送)
    addUserCondition() {
      let conf = {}
      if (
        this.reminder &&
        this.reminder.userRule &&
        this.reminder.userRule.description
      ) {
        conf.userRule = JSON.parse(JSON.stringify(this.reminder.userRule))
      }
      conf = {...conf, ...{nodeType: '', nodeId: '', defId: this.defId}}
      this.$refs.flowNodeUserCondition.showDialog(conf)
    },
    setSelectedIds() {
      const oldFieldList = []
      const newFieldList = []
      this.selectedOldTableList = this.reminder.formVarConf.map(item => {
        if (item.fieldList && item.fieldList.length) {
          oldFieldList.push(item.fieldList.map(it => it.oldField))
          newFieldList.push(item.fieldList.map(it => it.newField))
        }
        return item.oldTable
      })
      this.selectedNewTableList = this.reminder.formVarConf.map(
        item => item.newTable
      )
      this.oldFieldList = oldFieldList.flat().filter(Boolean)
      this.newFieldList = newFieldList.flat().filter(Boolean)
    },
    //编辑触发新流程设置
    editTaskReminder() {
      if (
        !this.defConfigData.nodeSetData.bpmDefSetting.globalForm ||
        !this.defConfigData.nodeSetData.bpmDefSetting.globalForm.formValue
      ) {
        this.$message.warning('请先设置全局表单')
        return
      }
      this.confListCopy = JSON.parse(JSON.stringify(this.confList))

      this.confListCopy.forEach(conf => {
        const formVarConf = conf.formVarConf && JSON.parse(conf.formVarConf)
        conf.formVarConf =
          formVarConf && formVarConf[0]
            ? JSON.parse(formVarConf[0].formVarConf)
            : []
        conf.userRule = conf.userRule ? JSON.parse(conf.userRule) : {}
        conf.condition = conf.condition ? JSON.parse(conf.condition) : {}
        conf.triggerType = conf.triggerType ? conf.triggerType : '1'
      })
      if (this.confListCopy.length > 0) {
        this.$set(this, 'reminder', this.confListCopy[0])

        this.curSelectEntity = this.reminder.triggerEntity
        if (
          this.reminder &&
          this.reminder.formVarConf &&
          this.reminder.formVarConf[0] &&
          this.reminder.formVarConf[0].optionsFilter
        ) {
          this.optionsFilter = this.reminder.formVarConf[0].optionsFilter
        }
        this.setSelectedIds()
        this.handleOldDefVar(true)
      } else {
        this.restConf()
      }
      this.handleOldDefVar(true)
      this.boEntityList = []
      // if (!this.flowVar[0]) {
      //   return
      // }
      if (this.flowVar) {
        if (this.flowVar.length) {
          this.flowVar[0].children.forEach(mainEnt => {
            if (mainEnt.children) {
              this.boEntityList.push({
                key: mainEnt.path + '.' + mainEnt.name,
                value: mainEnt.desc + '(' + mainEnt.name + ')——主表',
                entity: mainEnt
              })
              mainEnt.children.forEach(mainEntFiled => {
                if (mainEntFiled.children) {
                  this.boEntityList.push({
                    key:
                      mainEnt.path +
                      '.' +
                      mainEnt.name +
                      '.sub_' +
                      mainEntFiled.name,
                    value:
                      mainEntFiled.desc + '(' + mainEntFiled.name + ')——子表',
                    entity: mainEntFiled
                  })
                }
              })
            }
          })
        }
        if (this.boEntityList.length > 0) {
          this.isSave = true
          this.dialogVisibleSetting = true
        }
      }
      if (this.boEntityList.length == 0) {
        req
          .get(
            window.context.form +
              '/form/form/v1/getBoJsonByFormKey?formkey=' +
              this.defConfigData.nodeSetData.bpmDefSetting.globalForm.formValue
          )
          .then(response => {
            let data = response.data[0]
            if (data) {
              this.boEntityList.push({
                key: data.path + '.' + data.name,
                value: data.desc + '(' + data.name + ')——主表',
                entity: data
              })
            }
            if (data.children) {
              data.children.forEach(mainEnt => {
                if (mainEnt.children) {
                  this.boEntityList.push({
                    key: data.path + '.' + data.name + '.sub_' + mainEnt.name,
                    value: mainEnt.desc + '(' + mainEnt.name + ')——子表',
                    entity: mainEnt
                  })
                }
              })
            }

            this.isSave = true
            this.dialogVisibleSetting = true
          })
      }
    },
    //列表某一条数据时触发
    orgRowClick(row, column, event) {
      if (column.label != '操作') {
        row.formVarConf = row.formVarConf || []
        row.userRule = row.userRule || {description: ''}
        row.startDef = row.startDef || {}
        this.reminder = row
        this.isSave = true
      }
    },
    //保存新流程触发设置
    saveRemind(isSaveOption) {
      const this_ = this
      //判断是否有新增的数据
      if (!this_.isSave) {
        Message.warning('请先新增新流程触发设置信息再保存')
        return
      } else {
        let saveConf = JSON.parse(JSON.stringify(this_.confListCopy))

        // if (this.reminder.formVarConf && this.reminder.formVarConf[0]) {
        //   this.reminder.formVarConf[0].optionsFilter = this.optionsFilter
        // }

        //校验是否有必填字段没有填写
        // for (let x = 0; x < saveConf.length; x++) {
        saveConf = [{...this.reminder}]
        const currentFormVarConf = this.reminder.formVarConf
          .map(item => item.fieldList)
          .flat()

        for (let x = 0; x < saveConf.length; x++) {
          if (this.validateData(saveConf[x])) {
            if (currentFormVarConf.length > 0) {
              this_.$message({
                showClose: true,
                message:
                  '列表第' +
                  (x + 1) +
                  '行有字段未通过校验,请正确填写表单内容。',
                type: 'warning'
              })
              return
            }
          }
          saveConf[x].formVarConf = JSON.stringify(
            this.getCurrentFormVarConfig(saveConf[x].formVarConf)
          )
          saveConf[x].userRule = JSON.stringify(saveConf[x].userRule)
          saveConf[x].condition = JSON.stringify(saveConf[x].condition)
        }

        let remindersCopyJson = JSON.stringify(saveConf) //转json字符串
        req
          .post(
            '${bpmModel}/flow/plugins/v1/startNewFlowSave?defId=' +
              this_.node.defId +
              '&nodeId=' +
              this_.node.nodeId,
            remindersCopyJson
          )
          .then(function(data) {
            data = data.data
            if (data.state) {
              if (isSaveOption) {
                Message.success('保存成功!')
              } else {
                Message.success('清除成功!')
              }
              this_.$emit('update:confList', saveConf) //子组件更新父组件的值
              this_.restConf()
              if (isSaveOption) {
                this_.dialogVisibleSetting = false
              }
            } else {
              Message.error('新流程触发设置保存出现异常:' + data.message)
            }
          })
      }
    },
    getCurrentFormVarConfig(data) {
      let newData = data && data.map(item => item.fieldList).flat()
      if (newData && newData[0]) {
        newData[0].formVarConf = JSON.stringify(this.reminder.formVarConf)
      }
      return newData
    },
    validateData(data) {
      //新增数据
      let errMsg = []
      if (!data.name) {
        errMsg.push('名称')
      }
      if (!data.defKey) {
        errMsg.push('新流程')
      }
      if (data.triggerType == '2' && !data.triggerEntity) {
        errMsg.push('触发对象')
      }

      if (
        (data.triggerType == '1' &&
          (!data.userRule || !data.userRule.description)) ||
        (data.triggerType == '2' && !data.startAccount)
      ) {
        //errMsg.push('流程发起人');
      }
      return errMsg.join(',')
    },
    //新增新流程触发设置
    addRemind() {
      if (this.validateData(this.reminder)) {
        Message.warning(this.validateData(this.reminder) + '不能为空')
        return
      }
      this.isSave = true
      delete this.reminder.isAdd

      this.confListCopy = []
      this.confListCopy.push(this.reminder) //新增新流程触发设置基本信息、消息设置

      if (this.reminder.formVarConf) {
        const currentFormVarConf = this.reminder.formVarConf
          .map(item => item.fieldList)
          .flat()
        for (let index = 0; index < currentFormVarConf.length; index++) {
          const conf = currentFormVarConf[index]
          if (!conf.oldVar || !conf.newVar) {
            this.$message({
              showClose: true,
              message: '对应字段第' + (index + 1) + '行不完整',
              type: 'warning'
            })
            return
          }
          if (
            conf.newVar.split('】-')[conf.newVar.split('】-').length - 1] !=
            conf.oldVar.split('】-')[conf.oldVar.split('】-').length - 1]
          ) {
            this.$message({
              showClose: true,
              message: '对应字段第' + (index + 1) + '行字段类型必须一致',
              type: 'warning'
            })
            return
          }
        }
      }
      this.saveRemind(true)
    },
    clear() {
      this.$confirm(`是否确定清空该节点已有配置?`).then(() => {
        this.confListCopy = []
        this.restConf()
        this.saveRemind(false)
        this.oldFieldList = []
        this.newFieldList = []
        this.selectedOldTableList = []
        this.selectedNewTableList = []
      })
    },
    //关闭设置节点新流程触发设置列弹框
    close() {
      this.dialogVisibleSetting = false
    },
    //删除新流程触发设置
    deleteSetting(list, index) {
      list.splice(index, 1)
      this.isSave = true
      this.restConf()
    },
    //初始化设置
    restConf() {
      let rest = {
        name: '',
        triggerAction: 'agree',
        triggerType: '1',
        userRule: {description: ''},
        defName: '',
        defKey: '',
        formVarConf: [],
        isAdd: true,
        startName: '',
        startAccount: '',
        triggerEntity: '',
        condition: {}
      }
      this.curSelectEntity = ''
      this.$set(this, 'reminder', rest)
    }
  },
  mounted() {
    this.$validator = this.$root.$validator
  }
}
</script>

<style lang="scss" scoped>
div >>> .el-dialog__body {
  padding: 10px 20px;
  color: #606266;
  font-size: 14px;
  word-break: break-all;
}

.div_list {
  height: 30px;
  background: #e2e2e2;
  line-height: 30px;
  font-weight: bold;
  padding-left: 10px;
  margin-bottom: 10px;
}
>>> label.el-checkbox {
  margin: 5px 10px 0 0;
}
.ht {
  width: 300px;
}
.form-inline {
  float: left;
  width: 100%;
}
.left-label {
  width: 18%;
  float: left;
}
.control-label {
  word-break: break-all;
  text-align: right;
  color: #545252;
  font-size: 12px;
  padding: 0px 10px !important;
  font-weight: bold;
  line-height: 35px;
}
div >>> .box-card {
  margin-bottom: 20px;
}

div >>> .box-card .clearfix {
  padding-top: 20px;
}

div >>> .el-button {
  margin-right: 10px;
  margin-left: 0px !important;
}

.table {
  border-bottom: 1px solid #e7eaec;
  border-right: 1px solid #e7eaec;
}

.var-conf-table th,
.var-conf-table td {
  border-top: 1px solid #e7eaec;
  border-left: 1px solid #e7eaec;
  line-height: 1.4em;
  padding: 4px;
  vertical-align: middle;
  text-align: center;
}

.var-conf-table > thead > tr > th,
.var-conf-table > tbody > tr > th {
  background: #fafafa;
  height: 30px;
}

.table {
  border-bottom: 1px solid #e7eaec;
  border-right: 1px solid #e7eaec;
  border-collapse: collapse;
}
.flow-selector-input {
  width: 400px;

  ::v-deep {
    .inputs {
      width: 400px !important;
    }
    .el-select__tags {
      max-height: 190px !important;
      overflow: auto;
    }
    .el-select {
      max-height: 200px;
      overflow: hidden;
    }
    .el-input__inner {
      max-height: 200px;
    }
    .el-tag--info {
      color: #0080fe;
    }
    .el-tag__close {
      background: rgba(0, 128, 254, 0.1);
      border-radius: 50%;
      color: #0080fe;
      font-weight: bold;
    }
  }
}
.flow-node-setting {
  width: 96%;
  float: left;
  height: 100%;
  overflow: auto;
  .flow-form-table {
    & > tbody > tr,
    & > tbody > tr > td,
    & > tbody > tr > th {
      border: none;
    }
  }
  .form-table > tbody > tr > th,
  .form-table > tbody > tr > td,
  .form-table > tfoot > tr > td,
  .form-table > thead > tr > th {
    white-space: nowrap;
    padding: 15px;
    // vertical-align: text-top;
  }
}
.elForm {
  tbody > tr > th {
    color: #888888;
    text-align: left !important;
  }

  ::v-deep {
    .el-tooltip {
      margin-left: 4px;
    }
  }
  .icon-notes {
    position: absolute;
    left: 8px;
    top: 24px;
  }
}
.th_notes {
  position: relative;
  &::before {
    position: absolute;
    left: 30px;
  }
}
.is-plain {
  background: #fff;
}
.table-wrap {
  display: grid;
  .table-header {
    display: flex;

    height: 40px;
    background: #fafafa;
    border: 1px solid #e7eaec;
    .header-item {
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
      flex: 1;

      border-right: 1px solid #e7eaec;
      color: #333;
      font-weight: bold;
      &:last-child {
        border-right: none;
      }
    }
  }
  .table-content {
    .row {
      display: flex;
      border: 1px solid #e7eaec;
      border-top: none;
      .col {
        padding: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
        border-right: 1px solid #e7eaec;
        &:last-child {
          border-right: none;
        }
      }
      .two-column {
        flex: 2;
        flex-direction: column;
        .col-field-item {
          margin-bottom: 10px;
        }
      }
      .flex-column {
        flex-direction: column;
        padding-right: 0;
        .col-item-box {
          display: flex;
          flex-direction: column;
          span {
            padding-bottom: 8px;
          }
          &:last-child {
            padding-top: 16px;
          }
        }
      }
      .last-col {
        padding-left: 0;
      }
    }
  }
}
</style>