CreateEveModelConfigurationManagementDialog.vue 36.1 KB
Newer Older
YazhouChen's avatar
YazhouChen committed
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
<template>
  <div id="main">
    <!-- 业务模板创建对话框 -->
    <el-dialog v-dialogDrag style="font-size: 10px;" width='1200px' :title="dialogTitle" :visible.sync="dialog_elineTemplateCreate" @close="close()" >
      <el-row>
        <el-form :model="form" inline="true" ref="form" style="width:1100px">
          <el-divider contentPosition="left">{{ $t("EveModelConfigurationManagement.BasicInformation") }}</el-divider>
          <el-form-item style="margin-bottom: -10px; float:left">
            <el-form-item :label="$t('EveModelConfigurationManagement.ElineTemplateName1')" :label-width="formLabelWidth" style="margin-bottom: -10px;margin-top: -10px;">
              <el-input size='mini' :placeholder="$t('common.placeholder1')" v-model="form.elineTemplateName"
                        autocomplete="off" style="width:150px"></el-input>
            </el-form-item>
            <el-form-item :label="$t('EveModelConfigurationManagement.serviceType1')" :label-width="formLabelWidth" style="margin-bottom: -10px;margin-top: -10px;">
              <el-select size='mini' v-model="form.serviceTypeID" :placeholder="$t('common.selectOption')"
                         autocomplete="off" style="width:150px" v-on:change="serviceTypeChange">
                <el-option
                  v-for="item in ServiceTypeList"
                  :key="item.serviceTypeID"
                  :label="item.serviceTypeName"
                  :value="item.serviceTypeID">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item  :label="placeHolder" :label-width="formLabelWidth" style="margin-bottom: -10px;margin-top: -10px;">
              <el-checkbox v-model="form.defaultFlag" trueLabel=1; falseLabel=0>{{$t('EveModelConfigurationManagement.setDefaultTemplate')}}</el-checkbox>
            </el-form-item>
          </el-form-item>
          <el-form-item style="margin-bottom: -10px; float:left">
            <el-form-item :label="$t('EveModelConfigurationManagement.reversion1')" :label-width="formLabelWidth" style="margin-bottom: -10px;margin-top: -10px;">
              <el-select size='mini' v-model="form.reversion" :placeholder="$t('common.selectOption')"
                         autocomplete="off" v-on:change="reversionCheck" style="width:150px">
                <el-option
                  v-for="item in reversionFlag"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item :label="$t('EveModelConfigurationManagement.wtr1')" :label-width="formLabelWidth" style="margin-bottom: -10px;margin-top: -10px;">
              <el-input size='mini' :placeholder="$t('common.placeholder1')" v-model="form.wtr" autocomplete="off"
                        :disabled="wtr_input_disable" style="width:95px" v-on:change="wtrCheck">
              <template slot="append" style="">{{$t('EthernetELineServiceConfigurationManagement.minute')}}</template>
              </el-input>
              <small style="font-size: 9px">
                {{$t('EthernetELineServiceConfigurationManagement.inputNumber')}}
              </small>
            </el-form-item>
          </el-form-item>
          <el-form-item style="margin-bottom: -10px; float:left">
            <el-form-item :label="$t('EveModelConfigurationManagement.protectionMode1')" :label-width="formLabelWidth" style="margin-bottom: -10px;margin-top: -10px;">
              <el-select v-model="form.protectionMode" size="mini" :placeholder="$t('common.placeholder1')" style="width: 150px"
                          v-on:change="protectionModeCheck">
                <el-option
                  v-for="item in protectionModeList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item :label="$t('EveModelConfigurationManagement.oamInfo1')" :label-width="formLabelWidth" style="margin-bottom: -10px;margin-top: -10px;">
              <el-select size='mini' v-model="form.oamInfo" :placeholder="$t('common.selectOption')" autocomplete="off"
                         v-on:change="oamInfoCheck" style="width:150px" :disabled="oaminfo_select_disable">
                <el-option
                  v-for="item in oamInfoFlag"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item :label="$t('EveModelConfigurationManagement.ccmInterval1')" :label-width="formLabelWidth"
                          style="margin-bottom: -10px;margin-top: -10px; height:28px">
              <el-select v-model="form.ccmInterval" size="mini" :placeholder="$t('common.placeholder1')" style="width: 150px"
                         :disabled="ccmInterval_select_disable" :clearable="true">
                <el-option
                  v-for="item in ccmIntervalList"
                  :key="item.value"
                  :label="item.ccmIntervalTime"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-form-item>
        </el-form>
      </el-row>
      <el-row>
        <el-form :model="form" inline="true" ref="form" style="margin-bottom: -20px;margin-top:-10px;width:1100px">
          <el-divider contentPosition="left">{{ $t("EveModelConfigurationManagement.vlanInformation") }}</el-divider>
          <el-form-item style="margin-bottom: -10px; float:left">
            <el-form-item :label="$t('EveModelConfigurationManagement.encapsulationType1')" :label-width="formLabelWidth" style="margin-bottom: -10px;margin-top: -10px;">
              <el-select size='mini' v-model="form.encapsulationType" :placeholder="$t('common.selectOption')"
                         autocomplete="off" v-on:change="encapsulationTypeCheck" style="width:150px" >
                <el-option
                  v-for="item in encapsulationTypeList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item :label="$t('EveModelConfigurationManagement.l2AccessType1')" :label-width="formLabelWidth" style="margin-bottom: -10px;margin-top: -10px;">
              <el-select size='mini' v-model="form.l2AccessType" :placeholder="$t('common.selectOption')"
                         :disabled="l2AccessType_select_disable" autocomplete="off" style="width:150px" v-on:change="l2AccessTypeCheck">
                <el-option
                  v-for="item in l2AccessTypeList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-form-item>
          <el-form-item style="margin-bottom: -10px; float:left">
            <el-form-item :label="$t('EveModelConfigurationManagement.vlanAccess1')" :label-width="formLabelWidth"
                          style="margin-bottom: -10px;margin-top: -10px;">
              <el-select size='mini' v-model="form.vlanAccess" :placeholder="$t('common.selectOption')"
                         autocomplete="off" style="width:150px" v-on:change="vlanAccessCheck" :disabled="vlanAccess_select_disable">
                <el-option
                  v-for="item in vlanAccessList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item :label="$t('EthernetELineServiceConfigurationManagement.vlanRange')" :label-width="formLabelWidth"
                          style="margin-bottom: -10px;margin-top: -10px;" >
              <el-input size='mini' :placeholder="$t('common.placeholder1')" v-model="form.vlanRangeStart"
                        autocomplete="off" style="width:150px" :disabled="vlanRangeStart_input_disable" v-on:change="vlanRangeStartCheck"></el-input>
              <span> - </span>
              <el-input size='mini' :placeholder="$t('common.placeholder1')" v-model="form.vlanRangeEnd"
                        autocomplete="off" style="width:150px" :disabled="vlanRangeEnd_input_disable" v-on:change="vlanRangeEndCheck"></el-input>
              <small style="font-size: 9px">
                {{$t('EthernetELineServiceConfigurationManagement.inputNumber')}}
              </small>
            </el-form-item>
          </el-form-item>
          <el-form-item style="margin-bottom: -10px; float:left">
            <el-form-item :label="$t('EveModelConfigurationManagement.vlanSet1')" :label-width="formLabelWidth"
                          style="margin-bottom: -10px;margin-top: -10px;">
              <el-input size='mini' :placeholder="$t('common.placeholder1')" v-model="form.vlanSet" autocomplete="off"
                        style="width:150px" :disabled="vlanRangeSet_input_disable" v-on:change="vlanSetCheck"></el-input>
              <small style="font-size: 9px">
                {{$t('EthernetELineServiceConfigurationManagement.inputNumber1')}}
              </small>
            </el-form-item>
          </el-form-item>
          <el-form-item style="margin-bottom: -10px; float:left">
            <el-form-item :label="$t('EveModelConfigurationManagement.qosProfile1')" :label-width="formLabelWidth"
                          style="margin-bottom: -10px;margin-top: -10px;">
              <el-select v-model="form.qosProfile" size="mini" :placeholder="$t('common.placeholder1')" style="width: 150px" :clearable="true">
                <el-option
                  v-for="item in CDPProfileCreationList"
                  :key="item.profileName"
                  :label="item.profileName"
                  :value="item.profileName">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item :label="$t('EveModelConfigurationManagement.cosId1')" :label-width="formLabelWidth" style="margin-bottom: -10px;margin-top: -10px;">
              <el-select size='mini' v-model="form.cosId" :placeholder="$t('common.selectOption')" autocomplete="off"
                         style="width:150px">
                <el-option
                  v-for="item in cosIdList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item :label="$t('EveModelConfigurationManagement.limitedBandwidth1')" :label-width="formLabelWidth" style="margin-bottom: -10px;margin-top: -10px;">
              <el-input size='mini' :placeholder="$t('common.placeholder1')" v-model="form.limitedBandwidth" v-on:change="limitedBandwidthCheck"
                        autocomplete="off" style="width:95px">
                <template slot="append" style="">{{$t('EthernetELineServiceConfigurationManagement.mbit')}}</template>
              </el-input>
              <small style="font-size: 9px">
                {{$t('EthernetELineServiceConfigurationManagement.inputNumber')}}
              </small>
            </el-form-item>
          </el-form-item>
        </el-form>
      </el-row>
      <div slot="footer" class="dialog-footer">
        <el-button size = 'mini' type="primary" @click="createElineTemplate" v-loading.fullscreen.lock="fullscreenLoading">{{createBtnName}}</el-button>
        <el-button size = 'mini' @click="close()" >{{$t("common.cancel")}}</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import ElineTemplateService from '@/domain/services/Business/ElineTemplateService.js'
  import ServiceTypeService from '@/domain/services/Business/ServiceTypeService.js'
  import CDPService from '@/domain/services/Business/CDPService.js'
  import HelperUtil from "../../../utils/HelperUtil";
  import legitimacyCheck from "../../../utils/legitimacyCheck";

  export default {
    name: 'CreateEveModelConfigurationManagementDialog',

    //1.声明从父组件接收value
    props: ['command'],

    data: function () {   //存放数据
      return {
        //对话框名称
        dialogTitle:"业务模板创建",

        dialog_elineTemplateCreate: true,
        title: this.command.title,
        form:this.command.target,
        createBtnName: "创建",

        //window.innerHeight:浏览器的可用高度
        tableHeight : window.innerHeight*0.7,
        fullscreenLoading: false,
        formLabelWidth: '140px',

        //业务类型过滤
        ServiceTypeList: [],
        //保护模式过滤
        protectionModeList:[
          {
            value: 0,
            label: this.$t('EthernetELineServiceConfigurationManagement.unprotected')
          },
          {
            value: 1,
            label: this.$t('EthernetELineServiceConfigurationManagement.one2one')
          },
          {
            value: 2,
            label: this.$t('EthernetELineServiceConfigurationManagement.lspone2one')
          }
        ],
        //是否回滚过滤
        reversionFlag:[
          {
            value:0,
            label: this.$t('EveModelConfigurationManagement.is')
          },
          {
            value:1,
            label:this.$t('EveModelConfigurationManagement.no')
          }
        ],
        //oam选项过滤
        oamInfoFlag:[
          {
            value:0,
            label:this.$t('EveModelConfigurationManagement.is')
          },
          {
            value:1,
            label:this.$t('EveModelConfigurationManagement.no')
          }
        ],
        //vlan设置方式过滤
        vlanAccessList:[
          {
            value:0,
            label: this.$t('EthernetELineServiceConfigurationManagement.vlanRange1')
          },
          {
            value:1,
            label: this.$t('EthernetELineServiceConfigurationManagement.vlanSet')
          }
        ],
        //vlan类别过滤
        encapsulationTypeList:[
          {
            value: 0,
            label: this.$t('EthernetELineServiceConfigurationManagement.ethernetType')
          },
          {
            value: 1,
            label: this.$t('EthernetELineServiceConfigurationManagement.vlanType')
          }
        ],
        //l2AccessType类别过滤
        l2AccessTypeList:[
          {
            value: 0,
            label: "untag"
          },
          {
            value: 1,
            label: "dot1q"
          },
          {
            value: 2,
            label: "qinq"
          },
        ],
        cosIdList:[
          {
            value:'0',
            label:'0'
          },
          {
            value:'1',
            label:'1'
          },
          {
            value:'2',
            label:'2'
          },
          {
            value:'3',
            label:'3'
          },
          {
            value:'4',
            label:'4'
          },
          {
            value:'5',
            label:'5'
          },
          {
            value:'6',
            label:'6'
          },
          {
            value:'7',
            label:'7'
          },
        ],
        //是否默认
        defaultFlagList:[
          {
            value:1,
            label: this.$t('EveModelConfigurationManagement.default')
          },
          {
            value:0,
            label: this.$t('EveModelConfigurationManagement.nonDefault')
          }
        ],
        //qos策略名称下拉框列表绑定
        CDPProfileCreationList:[],
        //ccm间隔时间下拉框列表绑定
        ccmIntervalList:[
          {
            ccmIntervalTime: '3.3min',
            value:1
          },
          {
            ccmIntervalTime: '10min',
            value:2
          },
          {
            ccmIntervalTime: '60min',
            value:3
          },
          {
            ccmIntervalTime: '100min',
            value:4
          },
          {
            ccmIntervalTime: '600min',
            value:5
          },
          {
            ccmIntervalTime: '6000min',
            value:6
          }
        ],

        //弹框中的窗口是否可输入约束
        wtr_input_disable1:false,
        oaminfo_select_disable:false,
        vlanRangeStart_input_disable:false,
        vlanRangeEnd_input_disable:false,
        vlanRangeSet_input_disable:false,
        ccmInterval_select_disable:false,
        l2AccessType_select_disable:false,

        //占位符
        placeHolder: " ",
      }
    },
    //vue加载初始化函数,加载数据
    created:function(){
      //获取下拉框业务类型信息
      this.getAllServiceType();
      //获取下拉框qos信息
      this.getAllCDPProfileCreation();
      //初始化过滤
      this.initCheck();
    },
    computed: {
      openTab () {
        return this.$store.state.openTab;
      },
      activeIndex:{
        get () {
          return this.$store.state.activeIndex;
        },
        set (val) {
          this.$store.commit('set_active_index', val);
        }
      }
    },
    watch:{
    },
    methods: {
      //过滤
      initCheck:function () {
        this.wtr_input_disable = false
        this.vlanRangeStart_input_disable = false
        this.vlanRangeEnd_input_disable = false
        this.vlanRangeSet_input_disable = false
        this.oaminfo_select_disable = false
        this.ccmInterval_select_disable = false
        this.l2AccessType_select_disable = false;

        //vlan协议选择
        if(this.form.l2AccessType === 0){
          this.form.vlanAccess = 1;
          this.vlanAccess_select_disable = true;
        }

        //根据vlan设置方式设置range、set字段是否变灰
        if(this.form.vlanAccess === 0){
          this.vlanRangeSet_input_disable = true
          this.form.vlanSet = ""
        }else if(this.form.vlanAccess === 1){
          this.vlanRangeStart_input_disable = true
          this.vlanRangeEnd_input_disable = true
          this.form.vlanRangeStart = "";
          this.form.vlanRangeEnd = ""
        }

        //根据是否回滚设置回滚时间字段是否变灰
        if(this.form.reversion === 1){
          this.wtr_input_disable = true
          this.form.wtr = ""
        }
        //根据保护模式设置oam是否可选
        if(this.form.protectionMode === 0){
          this.oaminfo_select_disable = false;
        }else if(this.form.protectionMode === 1 || this.form.protectionMode === 2){
          this.oaminfo_select_disable = true;
          this.form.oaminfo = ""
        }
        //根据ocm选项设置ccm间隔时间
        if(this.form.oamInfo === 1){
          this.ccmInterval_select_disable = true;
          this.form.ccmInterval = ""
        }
        //encapsulationType为vlan-tye时,l2AccessType可选
        if (this.form.encapsulationType === 0){
          this.l2AccessType_select_disable = true;
          this.vlanAccess_select_disable = true;
          this.vlanRangeStart_input_disable = true;
          this.vlanRangeEnd_input_disable = true;
          this.vlanRangeSet_input_disable =true;
          this.form.l2AccessType = "";
          this.form.vlanAccess = "";
          this.form.vlanRangeStart = "";
          this.form.vlanRangeEnd = "";
          this.form.vlanSet = ""
        }else{
        }

        //判断按钮名称是创建还是复制
        if(this.title === "业务模板的复制"){
          this.createBtnName = this.$t('common.copyBtn');
          this.dialogTitle = this.$t('EveModelConfigurationManagement.CopyElineTemplate');
        }else{
          this.createBtnName = this.$t('common.createBtn');
          this.dialogTitle = this.$t('EveModelConfigurationManagement.CreateElineTemplate');
        }
      },

      //根据是否回滚限制回滚时间是否可填
      reversionCheck:function(){
        if(this.form.reversion === 1){
          this.wtr_input_disable = true;
          this.form.wtr = ""
        }else{
          this.wtr_input_disable = false
        }
        return
      },

      //判断回滚时间是否为负
      wtrCheck:function () {
        let legCheck = legitimacyCheck();
        let IslegCheck = legCheck.positiveIntegerCheck(this.form.wtr);
        if(IslegCheck === false){
          this.form.wtr = "";
          this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.inputInteger')})
        }
      },

      //判断vlan-rang起点是否为负
      vlanRangeStartCheck:function () {
        let legCheck = legitimacyCheck();
        let IslegCheck = true;
        //填写内容不为空
        if(this.form.vlanRangeStart !== ""){
          IslegCheck = legCheck.positiveIntegerCheck(this.form.vlanRangeStart);
        }
        if(IslegCheck === false){
          this.form.vlanRangeStart = "";
          this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.inputInteger')})
          return
        }
        //判断起点是否小于终点
        if(this.form.vlanRangeEnd !== null && this.form.vlanRangeEnd !== ""){
          if(parseInt(this.form.vlanRangeEnd) < parseInt(this.form.vlanRangeStart)){
            this.form.vlanRangeStart = "";
            this.InfoTip.warningTip(this, {message: this.$t('EthernetELineServiceConfigurationManagement.vlanRangeStartGreaterEnd')})
          }
        }
      },

      //判断vlan-rang终点是否为负
      vlanRangeEndCheck:function () {
        let legCheck = legitimacyCheck();
        let IslegCheck = true;
        //填写内容不为空
        if(this.form.vlanRangeEnd !== ""){
          IslegCheck = legCheck.positiveIntegerCheck(this.form.vlanRangeEnd);
        }
        if(IslegCheck === false){
          this.form.vlanRangeEnd = "";
          this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.inputInteger')})
          return
        }
        //判断起点是否小于终点
        if(this.form.vlanRangeStart !== null && this.form.vlanRangeStart !== ""){
          if(parseInt(this.form.vlanRangeEnd) < parseInt(this.form.vlanRangeStart)){
            this.form.vlanRangeEnd = "";
            this.InfoTip.warningTip(this, {message: this.$t('EthernetELineServiceConfigurationManagement.vlanRangeStartSmallerEnd')})
          }
        }
      },

      //判断最高带宽是否为负
      limitedBandwidthCheck:function () {
        let legCheck = legitimacyCheck();
        let IslegCheck = legCheck.positiveIntegerCheck(this.form.limitedBandwidth);
        if(IslegCheck === false){
          this.form.limitedBandwidth = "";
          this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.inputInteger')})
        }
      },

      //根据保护模式处理oaminfo字段
      protectionModeCheck:function(){
        if(this.form.protectionMode === 0){
          this.form.oamInfo = 1;
          this.form.ccmInterval = "";
          this.oaminfo_select_disable = false;
          this.ccmInterval_select_disable = true
        }else{
          this.form.oamInfo = 0;
          if(this.form.protectionMode === 1){this.form.ccmInterval = 2}
          if(this.form.protectionMode === 2){this.form.ccmInterval = 1}
          this.oaminfo_select_disable = true;
          this.ccmInterval_select_disable = false
        }
        return
      },

      //当选择utag时,vlan设置方式选择vlan-set
      l2AccessTypeCheck:function () {
        this.form.vlanRangeStart = "";
        this.form.vlanRangeEnd = "";
        this.form.vlanSet = "";
        if(this.form.l2AccessType === 0){
          this.form.vlanAccess = 1;
          this.vlanAccess_select_disable = true;
          this.vlanAccessCheck();
        }else{
          this.form.vlanAccess = "";
          this.vlanAccess_select_disable = false;
          this.vlanRangeStart_input_disable = false;
          this.vlanRangeEnd_input_disable = false;
        }
      },

      //根据vlan设置方式修改start-range、endrange、vlan-set是否可disable
      vlanAccessCheck:function(){
        if(this.form.vlanAccess === 0){
          this.form.vlanSet = '';
          this.vlanRangeStart_input_disable = false;
          this.vlanRangeEnd_input_disable = false;
          this.vlanRangeSet_input_disable = true
        }else{
          this.form.vlanRangeStart = "";
          this.form.vlanRangeEnd = "";
          this.vlanRangeStart_input_disable = true;
          this.vlanRangeEnd_input_disable = true;
          this.vlanRangeSet_input_disable = false
        }
        return
      },

      //vlanset检查
      vlanSetCheck:function () {
        let legCheck = legitimacyCheck();
        let IslegCheck = legCheck.portCheck(this.form.vlanSet)
        if(IslegCheck === false){
          this.form.vlanSet = "";
          this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.inputInteger')})
        }
      },

      //根据vlan类别,确定vlan协议是否可选,encapsulationType为vlan-tye时可选
      encapsulationTypeCheck:function () {
        if(this.form.encapsulationType === 1){    //encapsulationType为vlan-tye
          this.l2AccessType_select_disable = false;
          this.vlanAccess_select_disable = false;
          this.vlanRangeStart_input_disable = false;
          this.vlanRangeEnd_input_disable = false;
          this.vlanRangeSet_input_disable =false;
        }else{
          this.l2AccessType_select_disable = true;
          this.vlanAccess_select_disable = true;
          this.vlanRangeStart_input_disable = true;
          this.vlanRangeEnd_input_disable = true;
          this.vlanRangeSet_input_disable =true;
          this.form.l2AccessType = '';
          this.form.vlanAccess = '';
          this.form.vlanRangeStart = "";
          this.form.vlanRangeEnd = "";
          this.form.vlanSet = ''
        }
      },

      //根据oam选项设置ccm间隔时间
      oamInfoCheck:function(){
        if(this.form.oamInfo === 1){
          this.ccmInterval_select_disable = true
          this.form.ccmInterval = ""
        }else{
          this.ccmInterval_select_disable = false
          this.form.ccmInterval = ''
        }
      },

      //在点击创建或者删除之前检查数据是否都有填写
      finalCheck:function () {
        //业务模板名称是否为空
        if(this.form.elineTemplateName === "" || this.form.elineTemplateName === null){
          this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.serviceNameEmpty')});
          return false;
        }

        //业务类型是否为空
        if(this.form.serviceTypeID === "" || this.form.serviceTypeID === null){
          this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.serviceTypeIDEmpty')});
          return false;
        }

        //是否回滚是否为空
        if(this.form.reversion === "" || this.form.reversion === null){
          this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.reversionEmpty')});
          return false;
        }

        //回滚等待时间是否为空
        if(this.form.reversion === 0){  //是否回滚选是,那么回滚时间不能为空
          if(this.form.wtr === "" || this.form.wtr === null){
            this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.wtrEmpty')});
            return false;
          }
        }

        //保护模式是否为空
        if(this.form.protectionMode === "" || this.form.protectionMode === null){
          this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.protectionModeEmpty')});
          return false;
        }

        //oam选项是否为空
        if(this.form.protectionMode === 0){  //保护模式选unprotect,那么oam选项为空,剩余的选择都不能为空
          if(this.form.oamInfo === "" || this.form.oamInfo === null){
            this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.oamInfoEmpty')});
            return false;
          }
        }

        //ccm间隔时间是否为空
        if(this.form.protectionMode !== 0){  //保护模式选unprotect,那么oam选项为空,剩余的选择都不能为空
          if(this.form.oamInfo === "" || this.form.oamInfo === null){
            this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.ccmIntervalEmpty')});
            return false;
          }
        }

        //封装类别是否为空
        if(this.form.encapsulationType === "" || this.form.encapsulationType === null){
          this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.encapsulationTypeEmpty')});
          return false;
        }

        //封装类别选vlan-type,当前模式下的vlan不应为空
        if(this.form.encapsulationType === 1){
          //vlan协议是否为空
          if(this.form.l2AccessType === "" || this.form.l2AccessType === null){
            this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.l2AccessTypeEmpty')});
            return false;
          }
          //vlan设置方式是否为空
          if(this.form.vlanAccess === "" || this.form.vlanAccess === null){
            this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.vlanAccessEmpty')});
            return false;
          }
          //vlan设置方式选择range,起点和终点不能为空
          if(this.form.vlanAccess === 0){
            //vlan-range起点是否为空
            if(this.form.vlanRangeStart === "" || this.form.vlanRangeStart === null){
              this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.vlanRangeStartEmpty')});
              return false;
            }
            //vlan-range终点是否为空
            if(this.form.vlanRangeEnd === "" || this.form.vlanRangeEnd === null){
              this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.vlanRangeEndEmpty')});
              return false;
            }
          }else{
            //vlan-set集合是否为空
            if(this.form.vlanSet === "" || this.form.vlanSet === null){
              this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.vlanSetEmpty')});
              return false;
            }
          }
        }

        //qos策略名称是否为空
        if(this.form.qosProfile === "" || this.form.qosProfile === null){
          this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.qosProfileEmpty')});
          return false;
        }

        //cos-Id是否为空
        if(this.form.cosId === "" || this.form.cosId === null){
          this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.cosIdEmpty')});
          return false;
        }

        //最高带宽是否为空
        if(this.form.limitedBandwidth === "" || this.form.limitedBandwidth === null){
          this.InfoTip.warningTip(this, {message: this.$t('EveModelConfigurationManagement.limitedBandwidthEmpty')});
          return false;
        }

        //以上问题均没有出现,可以进行创建
        return true;
      },

      /***
       *  ------------获取---------------------------------------------------------------
       */
      /**
       * @Description  :获取下拉框所有业务类型消息
       * @date         : 2019/03/19 15:20
       */
      getAllServiceType: function (){
        //调用domin函数
        let _this = this;
        ServiceTypeService.getAllServiceTypeCollection().then(result => {
          //成功
          _this.ServiceTypeList = result
        }).catch(err => {
          //失败
          _this.InfoTip.errorTip(_this, err);
        })
      },

      /**
       * @Description  :获取下拉框所有qosfile消息
       * @date         : 2019/03/19 16:56
       */
      getAllCDPProfileCreation: function (){
        console.log('获取全部qosfile信息:')
        //调用domin函数
        let _this = this;
        CDPService.getAllCDPCollection().then(result => {
          //成功
          _this.CDPProfileCreationList = result
        }).catch(err => {
          //失败
          _this.InfoTip.errorTip(_this, err);
        })
      },

      /***
       * -------------创建和复制---------------------------------------------------------
       */
      /**
       * @Description  :创建业务模板
       * @date         : 2019/03/19 15:59
       */
      createElineTemplate: function () {
        //检查输入情况
        if(this.finalCheck() === false){
          return;
        }
        this.handleCreateElineModelData();
        let _this = this;
        let loadingInstance = _this.Loading.openLoading();
        ElineTemplateService.addElineTemplate({
          elineTemplateKey:'',
          elineTemplateName:this.form.elineTemplateName,
          serviceTypeID:this.form.serviceTypeID,
          protectionMode:this.form.protectionMode,
          reversion:this.form.reversion,
          wtr:parseInt(this.form.wtr),

          oamInfo:this.form.oamInfo,
          ccmInterval:this.form.ccmInterval,
          encapsulationType:this.form.encapsulationType,
          l2AccessType:this.form.l2AccessType,
          vlanAccess:this.form.vlanAccess,
          vlanRangeStart:parseInt(this.form.vlanRangeStart),

          vlanRangeEnd:parseInt(this.form.vlanRangeEnd),
          vlanSet:this.form.vlanSet,
          cosId:this.form.cosId,
          limitedBandwidth:parseInt(this.form.limitedBandwidth),
          qosProfile:this.form.qosProfile,
          defaultFlag:parseInt(this.form.defaultFlag),

          delFlag: 0,
          modifyTime: ''
        }).then(result => {
          //成功
          this.command.done();
          _this.Loading.closeLoading(loadingInstance);
          _this.InfoTip.successTip(_this,HelperUtil.getStatusCodeObjectByCode(_this.successCode.ADD_CODE));

        }).catch(err => {
          //失败
          this.handleDataFrom999ToNull();
          _this.Loading.closeLoading(loadingInstance);
          _this.InfoTip.errorTip(_this, err);
        })
      },

      /**
       * 内容处理,把int类型的字段为""的,都赋值为-999
       */
      handleCreateElineModelData:function () {
        //vlan协议
        if(this.form.l2AccessType === ""){
          this.form.l2AccessType = -999;
        }
        //vlan-range起点
        if(this.form.vlanRangeStart === ""){
          this.form.vlanRangeStart = -999;
        }
        //vlan-range终点
        if(this.form.vlanRangeEnd === ""){
          this.form.vlanRangeEnd = -999;
        }
        //回滚等待时间
        if(this.form.wtr === ""){
          this.form.wtr = -999;
        }
        //oam选项
        if(this.form.oamInfo === ""){
          this.form.oamInfo = -999;
        }
        //ccm间隔时间
        if(this.form.ccmInterval === ""){
          this.form.ccmInterval = -999;
        }
        //vlan设置方式
        if(this.form.vlanAccess === ""){
          this.form.vlanAccess = -999;
        }
      },

      /**
       * 内容处理,把int类型的字段为-999的,都赋值为""
       */
      handleDataFrom999ToNull:function () {
        //vlan协议
        if(this.form.l2AccessType === -999){
          this.form.l2AccessType = "";
        }
        //vlan-range起点
        if(this.form.vlanRangeStart === -999){
          this.form.vlanRangeStart = "";
        }
        //vlan-range终点
        if(this.form.vlanRangeEnd === -999){
          this.form.vlanRangeEnd = "";
        }
        //回滚等待时间
        if(this.form.wtr === -999){
          this.form.wtr = "";
        }
        //oam选项
        if(this.form.oamInfo === -999){
          this.form.oamInfo = "";
        }
        //ccm间隔时间
        if(this.form.ccmInterval === -999){
          this.form.ccmInterval = "";
        }
        //vlan设置方式
        if(this.form.vlanAccess === -999){
          this.form.vlanAccess = "";
        }
      },

      /***
       * 关闭对话框
       */
      close:function () {
        this.command.done()
      }
    },
  }
</script>

<style scoped>
  /*!* 外层布局容器样式 *!*/
  .el-header {
    background-color: #f9fafc;
    color: #333;
    line-height: 40px;
  }
  /deep/ .el-input__inner{
    height: 28px !important;
  }
  /deep/ .el-input-group__append{
    padding-left: 0px !important;
    padding-right: 0px !important;
    font-size: 9px !important;
  }
</style>