tanghaolin
2025-04-07 fb5bec5a9659d2a00c0eed835c6dcd4f91cd7508
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
<template>
  <div class="productSeries">
    <div id="productLines" style="height: 100%; position: relative; overflow: auto">
      <div class="sticky-container" style="height: 55px">
        <div style=" width: 100%; max-width: 536px; margin-top: 0px; top: 0px; bottom: auto; "
          class="sticky is-anchored is-at-top">
          <div id="productlinePicker">
            <div class="row">
              <div class="columns">
                <ul class="menu head-tool-style">
                  <li style="margin-right: 5px;height: unset;">
                    <el-checkbox class="select_all_style" v-model="state.m_isSelectAllSeries"
                      @change="clickSelAllSeries" v-if="state.m_selSeriesMethod.current == 0"><span>
                        {{ state.m_isSelectAllSeries ? t("selectPage.reselect.TR") : t("selectPage.selectAll.TR") }}
                      </span>
                    </el-checkbox>
                  </li>
                  <li class="select-type-style">
                    <el-radio-group v-model="state.m_selSeriesMethod.current" size="small"
                      @change="changeSelSeriesMethod">
                      <el-radio-button :disabled="state.m_selSeriesMethod.byCatalog.isDisable"
                        v-if="state.m_selSeriesMethod.byCatalog.isVisible" :value="0">{{ t("selectPage.byType.TR")
                        }}</el-radio-button>
                      <el-radio-button :disabled="state.m_selSeriesMethod.byHY.isDisable"
                        v-if="state.m_selSeriesMethod.byHY.isVisible" :value="1">{{ t("selectPage.byIndustry.TR")
                        }}</el-radio-button>
                      <el-radio-button :disabled="state.m_selSeriesMethod.byMedia.isDisable"
                        v-if="state.m_selSeriesMethod.byMedia.isVisible" :value="2">{{ t("selectPage.byMedia.TR")
                        }}</el-radio-button>
                    </el-radio-group>
                  </li>
                </ul>
              </div>
            </div>
          </div>
        </div>
      </div>
      <!-- 按类型下拉 -->
      <div class="row" id="prod_line_filters" v-show="state.m_selSeriesMethod.current == 0">
        <div class="shrink columns" style="display: flex; align-items: center">
          <label class="c-form-label" style="width: 65px; margin-bottom: 16px" for="comboxCatalog">{{
            t("selectPage.type.TR") }}:</label>
          <select name="comboxCatalog" class="small" v-model="state.m_selCatalogID" @change="changeCatalog">
            <option v-for="item in state.m_allCatalogList" :key="item.ID" :value="item.ID">
              {{ item.Name }}
            </option>
          </select>
        </div>
      </div>
      <!-- 按类型分类 -->
      <div style="height: calc(100% - 110px); overflow: auto" v-if="state.m_selSeriesMethod.current == 0">
        <label v-if="state.m_ruleSelectStatus" style="position: absolute; top: 100px; font-size: 0.100px; color: red">*{{
          t("selectPage.seriesRule.TR") }}</label>
        <div class="c-product-line-select" v-for="(series_item, series_index) in state.m_allDispSeriesList"
          :key="series_index" :class="series_item.isSelected ? 'is-selected' : ''" style="position: relative">
          <div @click="clickSeriesItem(series_index)">
            <div class="c-product-line-select__overview" style="height: 150px">
              <button type="button" class="c-product-line-select__select-button" style="flex-grow: 1;">
                <span class="fa fa-fw c-product-line-select__select-icon"></span>
                <span class="c-product-line-select__name"
                  style="max-width: 219px;display: inline-block; word-wrap: break-word;">
                  {{ series_item.Name }}
                </span>
                <img alt="Product Line" :onerror="useDefaultImage" :src="series_item.ThumbnailImage"
                  class="c-product-line-select__image" style="height: 100%;" />
              </button>
              <button @click.stop="series_item.isShowDetail = !series_item.isShowDetail" type="button"
                class="c-product-line-select__summary-button">
                <span class="fa fa-fw fa-info-circle"></span>
              </button>
            </div>
            <div class="c-product-line-select__summary" :class="series_item.isShowDetail ? '' : 'hide'">
              <p class="u-no-margin" style="white-space: pre-line;">{{ series_item.ShortDescription }}</p>
            </div>
          </div>
          <div v-show="!series_item.isSelectEnable" class="unclick-mask">
            <div class="error_tip">{{ series_item.errorTips }}</div>
          </div>
        </div>
      </div>
      <!-- 按行业分类 -->
      <div style="height: calc(100% - 55px); overflow: auto" v-if="state.m_selSeriesMethod.current == 1">
        <label v-if="state.m_ruleSelectHY" style="position: absolute; top: 30px; font-size: 0.100px; color: red">*{{
          $t("selectPage.hangyeRule.TR") }}</label>
        <div v-for="(hy_item, hy_index) in state.m_allHangYeList" :key="hy_index" class="c-product-line-select"
          :class="hy_item.isSelected ? 'is-selected' : ''" @click="clickHangYeItem(hy_index)">
          <div class="c-product-line-select__overview" style="height: 150px">
            <button type="button" class="c-product-line-select__select-button">
              <span class="fa fa-fw c-product-line-select__select-icon"></span>
              <span class="c-product-line-select__name">{{
                hy_item.Name
              }}</span>
              <img alt="Product Line" :src="hy_item.ImageSrc"
                style=" height: 120px; width: 120px; filter: drop-shadow(2px 4px 6px black); "
                class="c-product-line-select__image" />
            </button>
            <button @click.stop="hy_item.isShowDetail = !hy_item.isShowDetail" type="button"
              class="c-product-line-select__summary-button">
              <span class="fa fa-fw fa-info-circle"></span>
            </button>
          </div>
          <div class="c-product-line-select__summary" :class="hy_item.isShowDetail ? '' : 'hide'">
            <p class="u-no-margin">{{ hy_item.ShortDescription }}</p>
          </div>
        </div>
      </div>
      <!-- 按介质分类 -->
      <div style="height: calc(100% - 55px); overflow: auto" v-if="state.m_selSeriesMethod.current == 2">
        <label v-if="state.m_ruleSelectJZ" style="position: absolute; top: 30px; font-size: 0.100px; color: red">*{{
          t("selectPage.jiezhiRule.TR") }}</label>
        <div v-for="(jz_item, jz_index) in state.m_allJieZhiList" :key="jz_index" class="c-product-line-select"
          :class="jz_item.isSelected ? 'is-selected' : ''" @click="clickJieZhiItem(jz_index)">
          <div class="c-product-line-select__overview" style="height: 150px">
            <button type="button" class="c-product-line-select__select-button">
              <span class="fa fa-fw c-product-line-select__select-icon"></span>
              <span class="c-product-line-select__name">{{
                jz_item.Name
              }}</span>
            </button>
            <button @click.stop="jz_item.isShowDetail = !jz_item.isShowDetail" type="button"
              class="c-product-line-select__summary-button">
              <span class="fa fa-fw fa-info-circle"></span>
            </button>
          </div>
          <div class="c-product-line-select__summary" :class="jz_item.isShowDetail ? '' : 'hide'">
            <p class="u-no-margin">{{ jz_item.ShortDescription }}</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
 
<script setup name="selPumpSeries">
import { onMounted, reactive } from "vue";
import { ElRadioGroup, ElRadioButton, ElCheckbox, ElCheckboxGroup } from 'element-plus'
import { useSelect } from '@/stores/select';
import ConstParas from "@/utils/constParas";
import Utils from "@/utils/utils";
import SelectByCorpFlag from "@/utils/selectByCorpFlag.js";
import defaultImgUrl from '@/assets/img_fail.png';
import { useI18n } from 'vue-i18n';
import noneImg from '@/assets/none_img.png'
const { t } = useI18n()
const selectStore = useSelect()
let state = reactive({
  m_currentCorpFlag: 'DESMI',
  m_selSeriesMethod: {
    current: 0, //0 类型
    byCatalog: {
      isDisable: true,
      isVisible: false,
    },
    byHY: {
      isDisable: true,
      isVisible: false,
    },
    byMedia: {
      isDisable: true,
      isVisible: false,
    },
  },
  m_isSelectAllSeries: false, //是否全选 默认全选
 
  m_allCatalogList: [], //所有的类型
  m_allSeriesList: [], //所有的系列
  m_allDispSeriesList: [], //用于显示的系列列表
 
  m_allHangYeList: [], //所有行业列表
 
  m_allJieZhiList: [], //所有介质列表
 
  m_selSeriesIDs: [], //当前选中的系列id
  m_selCatalogID: 0, //当前用来展示的类型id
 
  m_DriveType: 0, //驱动类型
  m_MotorFrequence: 50,
  m_FirePumpType: 0,//消防泵类型,
  m_isFilterByjieZhiTemperature: false,//是否过滤介质温度 默认不过滤
  m_jieZhiTemperature: null, //介质温度
  m_ruleSelectStatus: false, //判断是否选择了系列
  m_ruleSelectHY: false, //判断是否选择了行业
  m_ruleSelectJZ: false, //判断是否选择了介质
})
//初始化产品系列数据
const initData = (all_catalog, all_series, currentLanguageType, seriesApplicationData) => {
  if (all_catalog == null || all_catalog.length == 0) return;
  state.m_selSeriesMethod.byCatalog.isDisable = false;
  state.m_selSeriesMethod.byCatalog.isVisible = true;
 
  state.m_allCatalogList = all_catalog;
  state.m_allSeriesList = all_series;
 
  state.m_selCatalogID = all_catalog[0].ID;
 
  var allInfoList = [];
  all_series.forEach((element, index) => {
    let series_info = {
      ID: element.ID,
      CatalogID: element.CatalogID,
      SeriesID: element.ID,
      CatalogName: element.CatalogName,
      ChartType: element.ChartType,
      DriveType: element.DriveType,
      FirePumpStatus: element.FirePumpStatus,
      MotorFrequece: element.MotorFrequece,
      Name: element.Name,
      MaxTemperture: element.MaxTemperture,
      MinTemperture: element.MinTemperture,
      errorTips: "",
      ShortDescription: element.ShortDescription == "" ? t('ebookPage.noProfile.TR') : element.ShortDescription.replace(/<br\/>/g, "\n"),
      ThumbnailImage: "",
      isSelected: false, //是否被选择
      isShowDetail: false, //是否展示详情
      isSelectEnable: true, //能否被选择
    };
 
    let ThumbnailImage = noneImg
    if (element.ThumbnailImage && element.ThumbnailImage != "") {
      ThumbnailImage = window.globalConfig.WebApiUrl.FileUrl  + 'Data/' +  element.ThumbnailImage
    }
    series_info.ThumbnailImage = ThumbnailImage
    allInfoList.push(series_info);
  });
  state.m_allSeriesList = allInfoList
  // _this.m_allDispSeriesList = allInfoList
  initDataFromHistory();
  if (seriesApplicationData) {
    //构建行业列表
    buildHangYeList(currentLanguageType, seriesApplicationData);
    //构建介质列表
    buildJieZhiList(currentLanguageType, seriesApplicationData);
  }
}
 
//构建行业列表
const buildHangYeList = (langType, seriesApplicationData) => {
  if (
    seriesApplicationData.HangYe == "undefind" ||
    seriesApplicationData.HangYe == null
  ) {
    seriesApplicationData.HangYe = {};
  }
  let HYData = seriesApplicationData.HangYe.List;
  if (HYData == null || HYData.length == 0) {
    state.m_allHangYeList = [];
    return;
  }
  state.m_selSeriesMethod.byHY.isDisable = false;
  state.m_selSeriesMethod.byHY.isVisible = true;
 
  let list = [];
 
  HYData.forEach((element, index) => {
    let itemObj = {
      HID: element.ID,
      PumpSeriesID: element.PumpSeriesID,
      Name: element.NameCN,
      isSelected: false,
      isShowDetail: false, //是否展示详情
      ShortDescription: element.DescriptionCN,
      ImageSrc: "static/img/HangYe/" + element.ImageName + "/ffffffx128.png",
    };
    if (langType == 0) {
      itemObj.Name = element.NameCN
      itemObj.ShortDescription = element.DescriptionCN
    } else if (langType == 2) {
      itemObj.Name = element.NameEN
      itemObj.ShortDescription = element.DescriptionEN
    } else if (langType == 6) {
      itemObj.Name = element.NameKO ? element.NameKO : element.NameEN
      itemObj.ShortDescription = element.DescriptionKO ? element.DescriptionKO : element.DescriptionEN
    } else if (langType == 5) {
      itemObj.Name = element.NameRU ? element.NameRU : element.NameEN
      itemObj.ShortDescription = element.DescriptionRU ? element.DescriptionRU : element.DescriptionEN
    } else {
      itemObj.Name = element.NameCN
      itemObj.ShortDescription = element.DescriptionCN
    }
    list.push(itemObj);
  });
 
  state.m_allHangYeList = list;
}
//构建介质列表
const buildJieZhiList = (langType, seriesApplicationData) => {
  // console.log(seriesApplicationData,406)
  if (
    seriesApplicationData.JieZhiParas == "undefind" ||
    seriesApplicationData.JieZhiParas == null
  ) {
    seriesApplicationData.JieZhiParas = {};
  }
  let jieZhiList = seriesApplicationData.JieZhiParas.List;
  if (jieZhiList == null || jieZhiList.length == 0) {
    state.m_allJieZhiList = [];
    return
  }
  state.m_selSeriesMethod.byMedia.isDisable = false;
  state.m_selSeriesMethod.byMedia.isVisible = true;
 
  let list = [];
  if (langType == 0) {
    jieZhiList.forEach((element, index) => {
      let itemObj = {
        ID: element.ID,
        PumpSeriesID: element.PumpSeriesID,
        Name: element.NameCN,
        isSelected: false,
        isShowDetail: false, //是否展示详情
        ShortDescription: element.DescriptionCN,
      };
      if (element.ImageName) {
        itemObj.ImageSrc = "static/img/HangYe/" + element.ImageName + "/ffffffx128.png";
      } else {
        itemObj.ImageSrc = "";
      }
      list.push(itemObj);
    });
  }
  else {
    jieZhiList.forEach((element, index) => {
      let itemObj = {
        ID: element.ID,
        PumpSeriesID: element.PumpSeriesID,
        Name: element.NameEN,
        isSelected: false,
        isShowDetail: false, //是否展示详情
        ShortDescription: element.DescriptionCN,
      };
      if (element.ImageName) {
        itemObj.ImageSrc = "static/img/HangYe/" + element.ImageName + "/ffffffx128.png";
      } else {
        itemObj.ImageSrc = "";
      }
      list.push(itemObj);
    });
  }
  state.m_allJieZhiList = list;
}
//筛选系列列表
const filterSeriseList = (DriveType, MotorFrequece, FirePumpType) => {
  state.m_FirePumpType = FirePumpType;
  // debugger
  resetSeriesCheckStatus()
  state.m_DriveType = DriveType;
  state.m_MotorFrequence = MotorFrequece;
 
  let showSeriesArr = [];
  state.m_allSeriesList.forEach((item) => {
    item.isSelectEnable = true;
    //判断是否是电机
    if (DriveType == ConstParas.DriveType.Motor) {
      if (item.MotorFrequece == MotorFrequece && item.DriveType == DriveType) {
        if (item.FirePumpStatus) {
          if (item.FirePumpStatus.includes(Number(FirePumpType))) {
            if (state.m_selCatalogID == 0) {
              //判断类型是否是全部
              showSeriesArr.push(item);
            } else {
              if (state.m_selCatalogID == item.CatalogID) {
                showSeriesArr.push(item);
              }
            }
          }
        } else {
          if (state.m_selCatalogID == 0) {
            //判断类型是否是全部
            showSeriesArr.push(item);
          } else {
            if (state.m_selCatalogID == item.CatalogID) {
              showSeriesArr.push(item);
            }
          }
        }
      }
    }
    // 是否是柴油机
    else if (DriveType == ConstParas.DriveType.Diesel) {
      if (item.DriveType == DriveType) {
        if (item.FirePumpStatus) {
          if (item.FirePumpStatus.includes(Number(FirePumpType))) {
            if (state.m_selCatalogID == 0) {
              //判断类型是否是全部
              showSeriesArr.push(item);
            } else {
              if (state.m_selCatalogID == item.CatalogID) {
                showSeriesArr.push(item);
              }
            }
          }
        } else {
          if (state.m_selCatalogID == 0) {
            //判断类型是否是全部
            showSeriesArr.push(item);
          } else {
            if (state.m_selCatalogID == item.CatalogID) {
              showSeriesArr.push(item);
            }
          }
 
        }
      }
    }
  });
  //判断历史是否选择了系列,如果有则将所选系列勾上
  if (state.m_selSeriesIDs.length != 0) {
    state.m_selSeriesIDs.forEach(serIDs => {
      showSeriesArr.forEach((item) => {
        if (serIDs == item.ID) {
          item.isSelected = true
        }
      })
    })
  }
  state.m_allDispSeriesList = showSeriesArr;
  buildDispSeriesList();
}
//设置介质温度
const setJieZhiTemperture = (temperture) => {
  state.m_jieZhiTemperature = temperture;
  state.m_isFilterByjieZhiTemperature = true;
  buildDispSeriesList();
}
// 获取历史表单记录
const initDataFromHistory = () => {
  //获取上次的表单填写记录
  let historyFormData = selectStore.ByParas.selectParas;
  let corpSelectDataByFlag = SelectByCorpFlag.getData(state.m_currentCorpFlag)
  if (historyFormData == null || historyFormData.FilterInfo == null) {
    return;
  }
  if (corpSelectDataByFlag.CatalogID == "" || corpSelectDataByFlag.CatalogID.length == 0) {
    return
  }
  if (corpSelectDataByFlag.SeriesID == "" || corpSelectDataByFlag.SeriesID.length == 0) {
    return
  }
 
  if (historyFormData.FilterInfo.CatalogID) {
    historyFormData.FilterInfo.CatalogID = corpSelectDataByFlag.CatalogID
    var selCatalogIDs = historyFormData.FilterInfo.CatalogID;
    if (selCatalogIDs.length > 0)
      state.m_selCatalogID = selCatalogIDs[0];
  }
  state.m_selSeriesMethod.current = corpSelectDataByFlag.SelMethod
  // 判断历史选型方式 是否是按行业 如果是则不赋值历史系列id
  if (corpSelectDataByFlag.SelMethod == 0) {
    if (historyFormData.FilterInfo.SeriesID) {
      historyFormData.FilterInfo.SeriesID = corpSelectDataByFlag.SeriesID
      var selSeriesIDs = historyFormData.FilterInfo.SeriesID;
      state.m_selSeriesIDs = selSeriesIDs;
      // 根据历史选中的系列id勾选上
      // selSeriesIDs.forEach(sid => {
      //   this.m_allDispSeriesList.forEach(serItem => {
      //     if (sid == serItem.SeriesID) {
      //       serItem.isSelected = true
      //     }
      //   })
      // })
    }
  }
 
}
//构建展示的系列列表
const buildDispSeriesList = () => {
  if (state.m_jieZhiTemperature == null) {
    state.m_allDispSeriesList.forEach((element) => {
      element.isSelectEnable = true;
      element.errorTips = "";
    });
    return;
  }
  // console.log(this.m_jieZhiTemperature, _this.m_allDispSeriesList,292)
 
  state.m_allDispSeriesList.forEach((element) => {
    element.isSelectEnable = true;
    element.errorTips = "";
    if (element.MaxTemperture != null) {
      if (state.m_jieZhiTemperature >= element.MaxTemperture) {
        element.isSelected = false;
        element.isSelectEnable = false;
        element.errorTips = "高于最大适用温度" + element.MaxTemperture;
      }
    }
    if (element.MinTemperture != null) {
      if (state.m_jieZhiTemperature <= element.MinTemperture) {
        element.isSelected = false;
        element.isSelectEnable = false;
        element.errorTips = "低于最小适用温度" + element.MinTemperture;
      }
    }
  });
}
// 重置一部分数据
const resetData = () => {
 
}
//监听系列筛选选项切换的变化 默认按行业
const changeSelSeriesMethod = (val) => {
  state.m_selSeriesMethod.current = val;
  state.m_selSeriesIDs = [];
}
//是否全选
const clickSelAllSeries = () => {
  let ser_id = [];
  if (state.m_isSelectAllSeries) {
    state.m_selSeriesIDs = [];
    if (state.m_selSeriesMethod.current == 0) {
      state.m_allDispSeriesList.forEach((item) => {
        if (item.isSelectEnable) {
          item.isSelected = true;
          ser_id.push(item.SeriesID);
        }
      });
      state.m_selSeriesIDs = ser_id;
 
      // console.log(this.m_selSeriesIDs,"m_selSeriesIDs")
    }
    // 当前为按行业模块
    if (state.m_selSeriesMethod.current == 1) {
      state.m_allHangYeList.forEach((item) => {
        item.isSelected = true;
        ser_id.push(...item.PumpSeriesID);
      });
      state.m_selSeriesIDs = Utils.uniqueInArray(ser_id);
    }
    state.m_ruleSelectStatus = false;
  } else {
    state.m_selSeriesIDs = [];
    if (state.m_selSeriesMethod.current == 0) {
      state.m_allDispSeriesList.forEach((item) => {
        item.isSelected = false;
      });
    }
    if (state.m_selSeriesMethod.current == 1) {
      state.m_allHangYeList.forEach((item) => {
        item.isSelected = false;
      });
    }
  }
}
//监听按类型下拉的变化
const changeCatalog = (e) => {
  //切换类型后,取消全选和置空已选择的seriesID数组
  state.m_isSelectAllSeries = false
  state.m_selSeriesIDs = [];
  state.m_selCatalogID = parseInt(e.target.value) || state.m_allCatalogList[0].ID;
 
  filterSeriseList(
    state.m_DriveType,
    state.m_MotorFrequence,
    state.m_FirePumpType
  );
  if (state.m_isFilterByjieZhiTemperature) {
    buildDispSeriesList();
  }
}
//选择系列
const clickSeriesItem = (index) => {
  state.m_allDispSeriesList[index].isSelected = !state.m_allDispSeriesList[index].isSelected;
  var sel_ids = [];
 
  state.m_isSelectAllSeries = false;
  state.m_allDispSeriesList.forEach((series_item) => {
    if (series_item.isSelected) {
      //   this.m_isSelectAllSeries = true;
      sel_ids.push(series_item.SeriesID);
    }
  });
 
  state.m_selSeriesIDs = sel_ids;
  // console.log(this.m_selSeriesIDs,630)
  //判断当前选中的系列id个数是否和全部的系列个数相同,相同则代表已经全选
  if (state.m_selSeriesIDs.length == state.m_allDispSeriesList.length) {
    state.m_isSelectAllSeries = true
  }
  if (state.m_selSeriesIDs.length > 0) {
    state.m_ruleSelectStatus = false;
  }
 
  //console.log(this.m_selSeriesIDs, 375);
}
//选择行业
const clickHangYeItem = (index) => {
  state.m_allHangYeList.forEach((old_item) => {
    old_item.isSelected = false;
  });
 
  state.m_allHangYeList[index].isSelected = !state.m_allHangYeList[index].isSelected;
}
//选择介质
const clickJieZhiItem = (index) => {
  state.m_allJieZhiList.forEach((old_item) => {
    old_item.isSelected = false;
  });
 
  state.m_allJieZhiList[index].isSelected = !state.m_allJieZhiList[index].isSelected;
}
//返回给主页面 选择的类型id 和 系列id
const getSelectData = () => {
  var sel_series_ids = [];
  var sel_catalog_ids = [];
  if (state.m_selSeriesMethod.current == 0) {
    if (state.m_selSeriesIDs == null || state.m_selSeriesIDs.length == 0) {
      state.m_ruleSelectStatus = true;
      return null;
    }
    sel_series_ids = state.m_selSeriesIDs;
    sel_catalog_ids.push(state.m_selCatalogID);
  }
 
  if (state.m_selSeriesMethod.current == 1) {
    state.m_allHangYeList.forEach((hy_item) => {
      if (hy_item.isSelected) {
        state.m_isSelectAllSeries = true;
        sel_series_ids.push(...hy_item.PumpSeriesID);
      }
    });
 
    sel_series_ids = getFilterSeriseIdList(sel_series_ids); //过滤一下, 哪些系列ID可行
 
    if (sel_series_ids == null || sel_series_ids.length == 0) {
      state.m_ruleSelectHY = true;
      return null;
    }
  }
  if (state.m_selSeriesMethod.current == 2) {
    state.m_allJieZhiList.forEach((jz_item1, index1) => {
      if (jz_item1.isSelected) {
        //判断当前选中的介质项对应的泵系列id是否等于 -1
        if (
          jz_item1.PumpSeriesID.length == 1 &&
          jz_item1.PumpSeriesID[0] == -1
        ) {
          state.m_allJieZhiList.forEach((jz_item2, index2) => {
            if (index1 != index2) {
              sel_series_ids.push(...jz_item2.PumpSeriesID);
            }
          });
        } else {
          sel_series_ids.push(...jz_item1.PumpSeriesID);
        }
      }
    });
 
    sel_series_ids = getFilterSeriseIdList(sel_series_ids); //过滤一下, 哪些系列ID可行
    if (sel_series_ids == null || sel_series_ids.length == 0) {
      state.m_ruleSelectJZ = true;
      return null;
    }
  }
  //console.log(sel_series_ids)
  let data = {
    CorpFlag: state.m_currentCorpFlag,
    SeriesID: sel_series_ids,
    CatalogID: sel_catalog_ids,
    SelMethod: state.m_selSeriesMethod.current
  };
 
  SelectByCorpFlag.saveData(state.m_currentCorpFlag, data)
  state.m_ruleSelectStatus = false;
  return data;
}
//过滤可以可以选择的系列ID(行业 , 介质用)
const getFilterSeriseIdList = (series_id_list) => {
  //  console.log(series_id_list)
  if (series_id_list == null) return [];
  var ava_id = [];
  state.m_allSeriesList.forEach((item) => {
    if (!item.isSelectEnable) return true;
    if (series_id_list.indexOf(item.ID) < 0) return true;
    //判断是否是电机
    if (state.m_DriveType == ConstParas.DriveType.Motor) {
      if (
        item.MotorFrequece == state.m_MotorFrequence &&
        item.DriveType == state.m_DriveType
      ) {
        ava_id.push(item.ID);
      }
    }
    // 是否是柴油机
    else if (state.m_DriveType == ConstParas.DriveType.Diesel) {
      if (item.state.m_DriveType == DriveType) {
        ava_id.push(item.ID);
      }
    }
  });
 
  return ava_id;
}
//清除系列列表的选中状态、
const resetSeriesCheckStatus = () => {
  if (state.m_allDispSeriesList && state.m_allDispSeriesList.length > 0) {
    state.m_allDispSeriesList.forEach(item => {
      item.isSelected = false
    })
  }
}
const useDefaultImage = (event) => {
  event.target.src = defaultImgUrl;
}
 
defineExpose({
  initData,
  filterSeriseList,
  getSelectData,
  setJieZhiTemperture
})
</script>
 
<style lang="scss">
.productSeries {
  height: calc(100% - 0px);
 
  .c-card {
    margin: 0 0 16px 0;
    padding: 16px;
    border-radius: 3px;
    position: relative;
    color: #16181a;
    background: #fefefe;
    border: 1px solid #dbe0e3;
    box-shadow: 0 1px 3px rgba(145, 161, 170, 0.25);
  }
 
  .c-card> :last-child {
    margin-bottom: 0;
  }
 
  .c-card> :first-child {
    margin-top: 0;
  }
 
  .row .row {
    max-width: none;
  }
 
  .row {
    display: flex;
    flex-flow: row wrap;
  }
 
  .columns {
    padding: 0 15px;
  }
 
  .column,
  .columns {
    padding-left: 8px;
    padding-right: 8px;
  }
 
  .column,
  .columns {
    flex: 1 1 0px;
    min-width: initial;
  }
 
  .menu {
    margin: 0;
    list-style-type: none;
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    flex-wrap: nowrap;
  }
 
  .menu>li {
    flex: 0 0 auto;
  }
 
  .menu>li>a {
    flex-flow: row nowrap;
  }
 
  .menu>li>a {
    display: flex;
  }
 
  .menu>li>a {
    display: block;
    padding: 8px 0px;
    line-height: 1;
  }
 
  .menu input,
  .menu a,
  .menu button {
    margin-bottom: 0;
  }
 
  .shrink {
    flex: 0 0 auto;
    max-width: 100%;
  }
 
  .text-right {
    text-align: right;
  }
 
  .menu input,
  .menu a,
  .menu button {
    margin-bottom: 0;
  }
 
  .c-product-line-select {
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #555;
    margin-top: 8px;
    overflow: hidden;
  }
 
  .c-product-line-select.is-selected {
    background-color: #efefef;
    border-color: currentColor;
    color: black;
  }
 
  .c-product-line-select__overview {
    display: flex;
  }
 
  .c-product-line-select__select-button,
  .c-product-line-select__summary-button {
    background: 0;
    border: 0;
    border-radius: 0;
    color: currentColor;
    font-size: calc(0.5vw + 16px);
  }
 
  .c-product-line-select__select-button {
    display: flex;
    align-items: center;
    flex-grow: 1;
    padding: 0;
    text-align: left;
  }
 
  .c-product-line-select__select-icon {
    display: block;
    flex: none;
    padding: 16px;
  }
 
  .c-product-line-select__name {
    flex-grow: 1;
    font-size: calc(0.5vw + 12px);
    padding: 16px 0 16px 32px;
  }
 
  .c-product-line-select__select-icon::before {
    content: "\f096";
  }
 
  .c-product-line-select.is-selected .c-product-line-select__select-icon::before {
    color: currentColor;
    content: "\f046";
    opacity: 1;
  }
 
  .c-product-line-select__select-button:hover .c-product-line-select__select-icon::before {
    content: "\f046";
    opacity: 0.5;
  }
 
  .c-product-line-select__image {
    display: block;
    flex: none;
    max-width: -webkit-calc(4vw + 640px);
    max-width: calc(4vw + 640px);
    padding: 16px;
  }
 
  .c-product-line-select__summary-button {
    background-color: #ddd;
    color: currentColor;
    flex: none;
    padding: 0 12px;
  }
 
  .c-product-line-select__summary {
    background-color: #ddd;
    color: black;
    padding: 16px;
    text-align: left;
  }
 
  .u-no-margin {
    margin: 0 !important;
  }
 
  .hide {
    display: none !important;
  }
 
  .error_tip {
    color: red;
    padding: 16px;
    text-align: left;
    font-size: 18px;
    font-weight: 600;
  }
 
  .unclick-mask {
    width: 100%;
    height: 150px;
    background-color: #fff;
    position: absolute;
    top: 0;
    opacity: 0.7;
    cursor: not-allowed;
  }
 
  .head-tool-style li.active,
  li:hover {
    background-color: unset;
  }
 
  .select-type-style {
    label {
      display: unset;
    }
  }
 
  .select_all_style {
    display: inline-flex !important;
  }
}
</style>