tanghaolin
2022-09-07 f6ed109d2075ec9dd2a15d606be0a43129d080c9
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
<template>
  <div class="selectParm_Box">
    <!-- 头部导航栏 -->
    <van-nav-bar style="background-color: #528abe">
      <template #left>
        <div @click="pageBack" style="display: flex; align-items: center">
          <van-icon name="arrow-left" size="18" />
          <span>{{ $t("selectPage.index.TR") }}</span>
        </div>
      </template>
      <template #title>
        <label>{{ $t("selectPage.productSeries.TR") }}</label>
      </template>
      <template #right>
        <div @click="toSelSeries" style="display: flex; align-items: center">
          <span>{{ $t("selectPage.nextStep.TR") }}</span>
          <van-icon name="arrow" size="18" />
        </div>
      </template>
    </van-nav-bar>
    <div class="selectParm_main">
      <!-- 流量 -->
      <van-field
        center
        clearable
        v-model="m_DpQ"
        label-align="center"
        :label="$t('ebookPage.flow.TR')"
        type="number"
        :placeholder="$t('selectPage.flowRule.TR')"
        style="padding: 10px 26px"
      >
        <template #label>
          <span style="font-size: 14px">{{ $t("ebookPage.flow.TR") }}</span>
        </template>
        <template #button>
          <van-button
            size="small"
            type="primary"
            @click="m_showDpQuPicker = true"
            >{{ m_DpQuText }}</van-button
          >
        </template>
      </van-field>
      <!-- 扬程 -->
      <van-field
        center
        clearable
        v-model="m_DpH"
        label-align="center"
        :label="$t('ebookPage.head.TR')"
        type="number"
        :placeholder="$t('selectPage.headRule.TR')"
        style="padding: 10px 26px"
      >
        <template #label>
          <span style="font-size: 14px">{{ $t("ebookPage.head.TR") }}</span>
        </template>
        <template #button>
          <van-button
            size="small"
            type="primary"
            @click="m_showDpHuPicker = true">{{ m_DpHuText }}</van-button>
        </template>
      </van-field>
      <!-- 设置频率 -->
      <van-field
        readonly
        clickable
        center
        v-model="m_PinLvShowValue"
        v-if="m_DeviceTpyeValue != 3"
        :label="$t('selectPage.setFrequency.TR')"
        label-align="center"
        style="padding: 10px 26px"
        @click="m_ShowPinLvPicker = true"
      >
        <template #button>
          <van-button disabled size="small" type="primary">Hz</van-button>
        </template>
      </van-field>
      <!-- 消防泵 -->
      <van-field
        readonly
        center
        clickable
        label-align="center"
        v-model="m_FireTypeShowValue"
        :label="$t('selectPage.firePump.TR')"
        style="padding: 10px 26px"
        @click="m_ShowFireTypePicker = true"
      >
        <template #button>
          <van-button disabled size="small" type="primary">
            <van-icon name="arrow-down" />
          </van-button>
        </template>
      </van-field>
      <!-- 转速 -->
      <van-field
        readonly
        center
        clearable
        v-model="m_MotorPoleShowValue"
        v-if="m_DeviceTpyeValue != 3"
        :label="$t('selectPage.speed.TR')"
        label-align="center"
        style="padding: 10px 26px"
        @click="m_ShowMotorPolePicker = true"
      >
        <template #button>
          <van-button disabled size="small" type="primary">
            <van-icon name="arrow-down" />
          </van-button>
        </template>
      </van-field>
      <!-- 品牌 -->
      <van-field
      v-if="false"
        readonly
        center
        clearable
        v-model="m_BrandShowValue"
        label="品牌"
        label-align="center"
        style="margin-bottom: 10px; padding: 10px 26px"
        @click="getBrandData"
      >
        <template #button>
          <van-button disabled size="small" type="primary">
            <van-icon name="arrow" />
          </van-button>
        </template>
      </van-field>
      <van-collapse v-model="m_activeNames">
        <!-- 更多条件 -->
        <van-collapse-item name="moreTrade" style="margin-bottom: 10px">
          <template #title>
            <span style="font-size: 14px; font-weight: 600">{{
              $t("selectPage.drivingConditions.TR")
            }}</span>
          </template>
          <van-field
            readonly
            center
            clickable
            :label="$t('selectPage.driveType.TR')"
            v-model="m_DeviceTpyeShowValue"
            @click="m_ShowDeviceTpyePicker = true"
          >
            <template #button>
              <van-button disabled size="small" type="primary">
                <van-icon name="arrow-down" />
              </van-button>
            </template>
          </van-field>
          <van-field
            readonly
            center
            clearable
            v-model="m_MotorStdShowValue"
            :label="$t('selectPage.motorPowerStd.TR')"
            @click="m_ShowMotorStdPicker = true"
          >
            <template #button>
              <van-button size="small" type="primary" disabled>
                <van-icon name="arrow-down" />
              </van-button>
            </template>
          </van-field>
        </van-collapse-item>
        <!-- 参数范围 -->
        <van-collapse-item name="paramLimit" style="margin-bottom: 10px">
          <template #title>
            <span style="font-size: 14px; font-weight: 600">{{
              $t("detailPage.medium.TR")
            }}</span>
          </template>
          <van-field
            readonly
            center
            clearable
            v-model="m_JieZhiNameShowValue"
            :label="$t('selectPage.mediaName.TR')"
            @click="m_ShowJieZhiNamePicker = true"
          >
            <template #button>
              <van-button disabled size="small" type="primary">
                <van-icon name="arrow-down" />
              </van-button>
            </template>
          </van-field>
          <van-field
            center
            clearable
            type="number"
            v-model="m_Temperature"
            :label="$t('selectPage.maxTemperature.TR')"
          >
            <template #button>
              <van-button size="small" disabled type="primary">℃</van-button>
            </template>
          </van-field>
          <van-field
            center
            clearable
            type="number"
            readonly
            v-model="m_CalcDensity"
            :label="$t('selectPage.maxDensity.TR')"
          >
            <template #button>
              <van-button size="small" type="primary" disabled>
                {{ m_CalcDensityUnit }}
              </van-button>
            </template>
          </van-field>
          <van-field
            center
            clearable
            type="number"
            readonly
            v-model="m_CalcViscosity"
            :label="$t('selectPage.mediumViscosity.TR')"
          >
            <template #button>
              <van-button size="small" type="primary" disabled>{{
                m_CalcViscosityUnit
              }}</van-button>
            </template>
          </van-field>
        </van-collapse-item>
        <!-- 容差范围 -->
        <van-collapse-item name="tolerances">
          <template #title>
            <span style="font-size: 14px; font-weight: 600">{{
              $t("selectPage.toleranceRange.TR")
            }}</span>
          </template>
          <van-field
            readonly
            center
            clearable
            v-model="m_ToleranceStandardShowValue"
            :label="$t('selectPage.toleranceStand.TR')"
            placeholder
            @click="m_ToleranceStandardPicker = true"
          >
            <template #button>
              <van-button disabled size="small" type="primary">
                <van-icon name="arrow-down" />
              </van-button>
            </template>
          </van-field>
          <van-field
            readonly
            center
            v-model="m_ToleranceLevelShowValue"
            :label="$t('selectPage.toleranceGrade.TR')"
            placeholder
            style="text-indent: 0; text-align: center"
            @click="m_ToleranceLevelPicker = true"
          >
            <template #button>
              <van-button disabled size="small" type="primary">
                <van-icon name="arrow-down" />
              </van-button>
            </template>
          </van-field>
          <van-field
            center
            type="number"
            :disabled="!isToleranceLevelCustom"
            v-model="m_MinFlowPerecent"
            :label="$t('selectPage.MinFlowPercentage.TR')"
          >
            <template #button>
              <van-button size="small" type="primary" :disabled="true"
                >%</van-button
              >
            </template>
          </van-field>
          <van-field
            center
            type="number"
            :disabled="!isToleranceLevelCustom"
            v-model="m_MaxFlowPerecent"
            :label="$t('selectPage.MaxFlowPercentage.TR')"
          >
            <template #button>
              <van-button size="small" type="primary" :disabled="true"
                >%</van-button
              >
            </template>
          </van-field>
          <van-field
            center
            type="number"
            :disabled="!isToleranceLevelCustom"
            v-model="m_MinHeadPerecent"
            :label="$t('selectPage.MinHeadPercentage.TR')"
          >
            <template #button>
              <van-button size="small" type="primary" :disabled="true"
                >%</van-button
              >
            </template>
          </van-field>
          <van-field
            center
            type="number"
            :disabled="!isToleranceLevelCustom"
            v-model="m_MaxHeadPerecent"
            :label="$t('selectPage.MaxHeadPercentage.TR')"
          >
            <template #button>
              <van-button size="small" type="primary" :disabled="true"
                >%</van-button
              >
            </template>
          </van-field>
        </van-collapse-item>
      </van-collapse>
      <!-- 流量单位弹框 -->
      <van-popup
        v-model:show="m_showDpQuPicker"
        round
        position="bottom"
        safe-area-inset-bottom
      >
        <van-picker
          show-toolbar
          :default-index="m_DpQuIndex"
          :columns="m_DpQuColumns"
          value-key="label"
          @cancel="m_showDpQuPicker = false"
          @confirm="onChangeDpQuConfirm"
        />
      </van-popup>
      <!-- 扬程单位弹框 -->
      <van-popup
        v-model:show="m_showDpHuPicker"
        round
        position="bottom"
        safe-area-inset-bottom
      >
        <van-picker
          show-toolbar
          :default-index="m_DpHuIndex"
          :columns="m_DpHuColumns"
          value-key="label"
          @cancel="m_showDpHuPicker = false"
          @confirm="onChangeDpHuConfirm"
        />
      </van-popup>
      <!-- 电机转速选择弹框 -->
      <van-popup
        v-model:show="m_ShowDeviceTpyePicker"
        round
        position="bottom"
        safe-area-inset-bottom
      >
        <van-picker
          show-toolbar
          :columns="m_DeviceTpyeColumns"
          @cancel="m_ShowDeviceTpyePicker = false"
          @confirm="onChangeDeviceTypeConfirm"
        />
      </van-popup>
      <!-- 设置频率 -->
      <van-popup
        v-model:show="m_ShowPinLvPicker"
        round
        position="bottom"
        safe-area-inset-bottom
      >
        <van-picker
          show-toolbar
          :columns="m_PinLvColumns"
          @cancel="m_ShowPinLvPicker = false"
          @confirm="onChangePinLvConfirm"
        />
      </van-popup>
      <!-- 消防泵类型 -->
      <van-popup
        v-model:show="m_ShowFireTypePicker"
        round
        position="bottom"
        safe-area-inset-bottom
      >
        <van-picker
          show-toolbar
          :columns="m_FireTypeColumns"
          @cancel="m_ShowFireTypePicker = false"
          @confirm="onChangeFireTypeConfirm"
        />
      </van-popup>
      <!-- 转速等级 -->
      <van-popup
        v-model:show="m_ShowMotorPolePicker"
        round
        position="bottom"
        safe-area-inset-bottom
      >
        <van-picker
          show-toolbar
          :columns="m_MotorPoleColumns"
          @cancel="m_ShowMotorPolePicker = false"
          @confirm="onChangeMotorPoleConfirm"
        />
      </van-popup>
      <!-- 品牌 -->
      <van-action-sheet v-model:show="m_ShowBrandPicker" title="品牌选择">
        <div class="brand-content">
          <div class="brand-item" @click="onChangeBrandSelectAll" :class="brandSelectAll?'brand-item-active':''">
            <span>全部</span>
          </div>
          <div class="brand-item" @click="onChangeBrandSelect(brand_item)" :class="brand_item.IsSelect?'brand-item-active':''" v-for="(brand_item,brand_index) in m_BrandColumns" :key="brand_index">
            <span>{{brand_item.ShortName}}</span>
          </div>
        </div>
      </van-action-sheet>
      <!-- 电机功率标准 -->
      <van-popup
        v-model:show="m_ShowMotorStdPicker"
        round
        position="bottom"
        safe-area-inset-bottom
      >
        <van-picker
          show-toolbar
          :columns="m_MotorStdColumns"
          @cancel="m_ShowMotorStdPicker = false"
          @confirm="onChangeMotorStdConfirm"
        />
      </van-popup>
      <!-- 介质名称 -->
      <van-popup
        v-model:show="m_ShowJieZhiNamePicker"
        round
        position="bottom"
        safe-area-inset-bottom
      >
        <van-picker
          show-toolbar
          :columns="m_JieZhiNameColumns"
          @cancel="m_ShowJieZhiNamePicker = false"
          @confirm="onChangeJieZhiNameConfirm"
        />
      </van-popup>
      <!-- 验收容差标准 -->
      <van-popup
        v-model:show="m_ToleranceStandardPicker"
        round
        position="bottom"
        safe-area-inset-bottom
      >
        <van-picker
          show-toolbar
          :default-index="m_ToleranceStandardIndex"
          :columns="m_ToleranceStandardColumns"
          @cancel="m_ToleranceStandardPicker = false"
          @confirm="onChangeToleranceStandardConfirm"
        />
      </van-popup>
      <!-- 验收容差等级 -->
      <van-popup
        v-model:show="m_ToleranceLevelPicker"
        round
        position="bottom"
        safe-area-inset-bottom
      >
        <van-picker
          show-toolbar
          :default-index="m_ToleranceLevelIndex"
          :columns="m_ToleranceLevelColumns"
          @cancel="m_ToleranceLevelPicker = false"
          @confirm="onChangeToleranceLevelConfirm"
        />
      </van-popup>
    </div>
    <!-- <nav id="footerBar" class="tang-footer">上海义维流体科技有限公司</nav> -->
  </div>
</template>
 
<script>
import UnitHelper from "@/utils/unit";
import languageMixin from "@/mixin/language";
export default {
  mixins: [languageMixin],
  data() {
    return {
      m_Title: "",
      m_activeNames: [], //折叠菜单默认不展开
 
      m_DpQ: "", //流量的值
      m_showDpQuPicker: false, //流量单位弹框
      m_DpQuColumns: UnitHelper.Q_Value_List,
      m_DpQuText: UnitHelper.GetUnitNameQ(UnitHelper.Default.Q), //流量单位默认展示的值
      m_DpQuValue: UnitHelper.Default.Q, //流量单位的默认枚举
      m_DpQuIndex: UnitHelper.getQunitValueInQArrIndex(UnitHelper.Default.Q), //当前默认选择的下拉框的项
 
      m_DpH: "", //扬程的值
      m_showDpHuPicker: false, //扬程单位弹框
      m_DpHuColumns: UnitHelper.H_Value_List,
      m_DpHuText: UnitHelper.GetUnitNameH(UnitHelper.Default.H), //扬程单位默认展示的值
      m_DpHuValue: UnitHelper.Default.H, //扬程单位的默认枚举
      m_DpHuIndex: UnitHelper.getHunitValueInHArrIndex(UnitHelper.Default.H), //当前默认选择的下拉框的项
 
      m_ShowDeviceTpyePicker: false, //驱动类型选择弹框
      m_DeviceTpyeValue: 0, //当前选择的电机类型值
      m_DeviceTpyeShowValue: "", //用于展示的驱动类型
      m_DeviceTpyeColumns: [], //驱动类型
 
      m_ShowPinLvPicker: false, //频率选择弹框
      m_PinLvValue: 50, //当前选择的频率类型值
      m_PinLvShowValue: "50", //用于展示的频率类型
      m_PinLvColumns: ["50", "60"], //频率类型
 
      m_ShowFireTypePicker: false, //消防泵类型选择弹框
      m_FireTypeValue: 0, //当前选择的消防泵类型的值
      m_FireTypeShowValue: "", //消防泵类型
      m_FireTypeColumns: [], //消防泵类型
 
      m_ShowMotorPolePicker: false, //转速等级选择弹框
      m_MotorPoleValue: null, //当前选择的转速等级的值
      m_MotorPoleShowValue: "不限", //转速等级
      m_MotorPoleColumns: [
        { text: "不限", value: null, disabled: false },
        { text: "2p", value: 2, disabled: false },
        { text: "4p", value: 4, disabled: false },
        { text: "6p", value: 6, disabled: false },
        { text: "8p", value: 8, disabled: false },
        { text: "10p", value: 10, disabled: false },
        { text: "12p", value: 12, disabled: false },
      ], //转速等级
 
      m_ShowBrandPicker: false, //显示品牌弹框
      m_BrandValue: null, //选择的品牌的值
      m_BrandShowValue: "全部", //展示品牌选择后的值
      m_BrandColumns: [], //品牌选择数
      isInitBrandData:false,//是否获取了品牌数据
      brandSelectAll:false,
 
      m_DieselSpeed: "", //柴油机转速
 
      m_ShowMotorStdPicker: false, //转速等级选择弹框
      m_MotorStdValue: 0, //当前选择的转速等级的值
      m_MotorStdShowValue: "", //转速等级
      m_MotorStdColumns: [], //转速等级
 
      m_ShowJieZhiNamePicker: false, //介质名称选择弹框
      m_JieZhiNameValue: 3, //当前选择的介质名称的值
      m_JieZhiNameShowValue: "清水", //介质名称
      m_JieZhiNameColumns: [{ text: "清水", value: "清水", disabled: false }], //介质选择数据
 
      m_Temperature: "20", //温度
      m_TemperatureUnit: "deg C", //温度单位
      m_CalcDensity: "1000", //密度
      m_CalcDensityUnit: "kg/m³",
      m_CalcViscosity: "1", //粘度
      m_CalcViscosityUnit: "cSt",
 
      m_ToleranceStandardPicker: false, //校验标准容差选择弹框显/隐
      m_ToleranceStandardIndex: 0, //当前选择的容差标准索引
      m_ToleranceStandardValue: "", //验收容差标准
      m_ToleranceStandardShowValue: "", //介质名称
      m_ToleranceStandardColumns: [],
 
      m_ToleranceLevelPicker: false, //校验标准容差选择弹框显/隐
      m_ToleranceLevelIndex: 0, //当前选择的容差等级索引
      m_ToleranceLevelValue: "", //验收容差标准
      m_ToleranceLevelShowValue: "", //介质名称
      m_ToleranceLevelColumns: [],
 
      m_MinFlowPerecent: "", //最小流量百分比
      m_MaxFlowPerecent: "", //最大流量百分比
      m_MinHeadPerecent: "", //最小扬程百分比
      m_MaxHeadPerecent: "", //最大扬程百分比
      isToleranceLevelCustom: false, //容差等级是否是自定义
 
      m_HistoryRecordDataObj: null, //历史存储数据
 
      pointToleranceConfig: window.pointToleranceConfig,
    };
  },
  mounted() {
    this.m_Title = this.getSoftName();
    // console.log(this.$i18n.locale,554)
    this.translateParamsToLang();
    this.getParaPageInfo();
 
    this.m_DpQuText = UnitHelper.GetUnitNameQ(
      this.$globalConfig.UnitDefault.UnitQ.value
    );
    this.m_DpQuValue = this.$globalConfig.UnitDefault.UnitQ.value;
 
    this.m_DpHuText = UnitHelper.GetUnitNameH(
      this.$globalConfig.UnitDefault.UnitH.value
    );
    this.m_DpHuValue = this.$globalConfig.UnitDefault.UnitH.value;
  },
  methods: {
    getParaPageInfo() {
      let _this = this;
      let Toast = _this.$toast;
      Toast.loading({
        message: "loading...",
        forbidClick: true,
      });
      _this
        .$axios({
          url:
            _this.$globalConfig.WebApiUrl.MainUrl +
            "/v1/Mobile/SelectByParas/GetParaPageInfo",
          params: {
            Lang: _this.getCurrentLanguageType(),
          },
        })
        .then((res) => {
          Toast.clear();
          let result = res.data;
          // console.log(res, 575);
          if (result.Code != 0) {
            Toast.fail(result.Message);
            return;
          }
          if (result.Data.DriveTypeList) {
            _this.m_DeviceTpyeValue = result.Data.DriveTypeList[0].Value;
            _this.m_DeviceTpyeShowValue = result.Data.DriveTypeList[0].Text;
 
            // console.log(_this.m_DeviceTpyeValue, _this.m_DeviceTpyeShowValue);
            //获取驱动类型
            let deviceTpyeColumns = [];
            result.Data.DriveTypeList.forEach((element) => {
              let columns = {
                text: element.Text,
                value: element.Value,
                disable: !element.Enable,
              };
              deviceTpyeColumns.push(columns);
            });
            _this.m_DeviceTpyeColumns = deviceTpyeColumns;
          }
          if (result.Data.FireTypeList) {
            //获取消防泵类型
            _this.m_FireTypeValue = _this.$globalConfig.FireTypeDefault.value;
            _this.m_FireTypeShowValue =
              _this.$globalConfig.FireTypeDefault.text;
            let fireTypeColumns = [];
            result.Data.FireTypeList.forEach((element) => {
              let columns = {
                text: element.Text,
                value: element.Value,
                disable: !element.Enable,
              };
              if (element.Value == _this.m_FireTypeValue) {
                _this.m_FireTypeShowValue = element.Text;
              }
              fireTypeColumns.push(columns);
            });
            _this.m_FireTypeColumns = fireTypeColumns;
          }
          if (result.Data.MotorStdList) {
            //获取电机类型
            this.m_MotorStdValue = result.Data.MotorStdList[0].Value;
            this.m_MotorStdShowValue = result.Data.MotorStdList[0].Text;
            let motorStdColumns = [];
            result.Data.MotorStdList.forEach((element) => {
              let columns = {
                text: element.Text,
                value: element.Value,
                disabled: !element.Enable,
              };
              motorStdColumns.push(columns);
            });
            _this.m_MotorStdColumns = motorStdColumns;
          }
          _this.initHistoryRecord();
          _this.getToleranceDefaultValue();
          _this.buildToleranceRangData();
          //console.log(res, 344);
        })
        .catch((err) => {
          console.log(err);
        });
    },
    //获取品牌数据
    getBrandData() {
      this.m_ShowBrandPicker = true;
      console.log(this.isInitBrandData,987)
      if(this.isInitBrandData)return
      this.getBrandList();
    },
 
    //获取品牌列表
    getBrandList() {
      let _this = this;
      _this
        .$axios({
          methods: "get",
          url: _this.$globalConfig.WebApiUrl.MainUrl + "v1/Web/Corp/GetList",
          params: {
            lang: _this.getCurrentLanguageType(),
          },
        })
        .then(function (res) {
          _this.isInitBrandData = true
          //  console.log(res,"类型列表");
          let result = res.data;
          if (result.Code != 0) {
            return;
          }
          if (result.Data) {
            // console.log(result.Data, 158);
            let brandList = [];
            result.Data.forEach((element) => {
              let brandNode = {
                Description: element.Description,
                FullName: element.FullName,
                ID: element.ID,
                LogoPath:
                  _this.$globalConfig.WebApiUrl.FileUrl + element.LogoPath,
                ShortName: element.ShortName,
                IsSelect: false,
              };
              brandList.push(brandNode);
            });
            _this.m_BrandColumns = brandList;
          }
        })
        .catch(function (err) {
          console.log(err);
        });
    },
    translateParamsToLang() {
      let currentLang = this.$i18n.locale;
      if (currentLang == "en") {
        this.m_JieZhiNameColumns[0].text = `${this.$t(
          "selectPage.cleanWater.TR"
        )}`;
        this.m_JieZhiNameShowValue = this.m_JieZhiNameColumns[0].text;
 
        this.m_MotorPoleColumns[0].text = `${this.$t(
          "selectPage.unlimited.TR"
        )}`;
        this.m_MotorPoleShowValue = this.m_MotorPoleColumns[0].text;
      }
    },
    //获取上次填写表单的记录
    initHistoryRecord() {
      // if(this.$store.state.instante.select.ByParas == undefined) return;
      let prvePathDataObj =
        this.$store.state.instante.select.ByParas.filterData;
      // console.log(prvePathDataObj, 398);
      if (prvePathDataObj == null || prvePathDataObj == undefined) return;
 
      //console.log(prvePathDataObj);
      this.m_HistoryRecordDataObj = prvePathDataObj;
      this.m_DpH = prvePathDataObj.DesignInfo.DpH;
      this.m_DpHuValue = prvePathDataObj.DesignInfo.UnitH;
      this.m_DpHuText = UnitHelper.GetUnitNameH(
        prvePathDataObj.DesignInfo.UnitH
      );
 
      this.m_DpQ = prvePathDataObj.DesignInfo.DpQ; //流量
      this.m_DpQuValue = prvePathDataObj.DesignInfo.UnitQ; //流量单位
      this.m_DpQuText = UnitHelper.GetUnitNameQ(
        //流量单位显示文字
        prvePathDataObj.DesignInfo.UnitQ
      );
 
      this.m_ToleranceStandardValue =
        prvePathDataObj.DesignInfo.ToleranceStandard; //容差标准
      this.m_ToleranceLevelValue =
        prvePathDataObj.DesignInfo.PointTolerance.ToleranceGrade; //容差等级
      if (this.m_ToleranceLevelValue == 0) {
        this.isToleranceLevelCustom = true;
      }
      this.m_MinFlowPerecent = parseFloat(
        prvePathDataObj.DesignInfo.PointTolerance.RatioMinQ * 100
      ).toFixed(1); //最小流量百分比
      this.m_MaxFlowPerecent = parseFloat(
        prvePathDataObj.DesignInfo.PointTolerance.RatioMaxQ * 100
      ).toFixed(1); //最大流量百分比
      this.m_MinHeadPerecent = parseFloat(
        prvePathDataObj.DesignInfo.PointTolerance.RatioMinH * 100
      ).toFixed(1); //最小扬程百分比
      this.m_MaxHeadPerecent = parseFloat(
        prvePathDataObj.DesignInfo.PointTolerance.RatioMaxH * 100
      ).toFixed(1); //最大扬程百分比
 
      this.m_PinLvValue = prvePathDataObj.FilterInfo.MotorFrequence; //电机频率
      this.m_PinLvShowValue = prvePathDataObj.FilterInfo.MotorFrequence; //电机频率显示文字
 
      this.MotorPoleNum = prvePathDataObj.FilterInfo.MotorPoleNum;
      this.m_FireTypeValue = prvePathDataObj.FilterInfo.FirePumpType;
 
      this.m_FireTypeColumns.forEach((item) => {
        if (item.value == prvePathDataObj.FilterInfo.FirePumpType) {
          this.m_FireTypeShowValue = item.text;
        }
      });
    },
    //获取容差标准的默认值
    getToleranceDefaultValue() {
      let currentLangType = this.getCurrentLanguageUrl();
      let defauleValueObj = this.pointToleranceConfig.DefaultValue;
      let currentDefauleValue = {
        Standard: "",
        ToleranceGrade: "",
      };
      // console.log(this.m_ToleranceStandardValue,this.m_ToleranceLevelValue,689)
      if (
        this.m_ToleranceStandardValue == "" ||
        this.m_ToleranceStandardValue == undefined ||
        this.m_ToleranceStandardValue == null
      ) {
        Object.keys(defauleValueObj).forEach((item) => {
          if (item == currentLangType) {
            currentDefauleValue = defauleValueObj[item];
          }
        });
      } else {
        currentDefauleValue.Standard = this.m_ToleranceStandardValue;
        currentDefauleValue.ToleranceGrade = this.m_ToleranceLevelValue;
      }
 
      let selectList = this.pointToleranceConfig.Standard4PumpSelectList;
      selectList.forEach((item) => {
        if (item.Value == currentDefauleValue.Standard) {
          this.m_ToleranceStandardShowValue = item.Name;
        }
        item.ToleranceGrade.forEach((grade) => {
          if (grade.Value == currentDefauleValue.ToleranceGrade) {
            this.m_ToleranceLevelShowValue = grade.Name;
          }
          if (
            grade.Value != currentDefauleValue.ToleranceGrade &&
            currentDefauleValue.ToleranceGrade == 0
          ) {
            this.m_ToleranceLevelShowValue = `${this.$t(
              "selectPage.custom.TR"
            )}`;
          }
        });
      });
 
      this.m_ToleranceStandardValue = currentDefauleValue.Standard;
      this.m_ToleranceLevelValue = currentDefauleValue.ToleranceGrade;
    },
    //获取容差范围的数据
    buildToleranceRangData() {
      let ToleranceStandardColumns = [];
      let ToleranceLevelColumns = [];
      let SelectList = this.pointToleranceConfig.Standard4PumpSelectList;
      SelectList.forEach((item, index) => {
        if (item.Value == this.m_ToleranceStandardValue) {
          this.m_ToleranceStandardIndex = index;
        }
        let standColumn = {
          text: "",
          value: "",
          disable: false,
        };
        standColumn.text = item.Name;
        standColumn.value = item.Value;
        ToleranceStandardColumns.push(standColumn);
 
        item.ToleranceGrade.forEach((grade, gradeIndex) => {
          if (
            item.Value == this.m_ToleranceStandardValue &&
            grade.Value == this.m_ToleranceLevelValue
          ) {
            this.m_ToleranceLevelIndex = gradeIndex;
            this.m_MinFlowPerecent = parseFloat(
              grade.Tol.RatioMinQ * 100
            ).toFixed(1); //最小流量百分比
            this.m_MaxFlowPerecent = parseFloat(
              grade.Tol.RatioMaxQ * 100
            ).toFixed(1); //最大流量百分比
            this.m_MinHeadPerecent = parseFloat(
              grade.Tol.RatioMinH * 100
            ).toFixed(1); //最小扬程百分比
            this.m_MaxHeadPerecent = parseFloat(
              grade.Tol.RatioMaxH * 100
            ).toFixed(1); //最大扬程百分比
          }
          if (item.Value == this.m_ToleranceStandardValue) {
            let gradeColumn = {
              text: "",
              value: "",
              disable: false,
            };
            gradeColumn.text = grade.Name;
            gradeColumn.value = grade.Value;
            ToleranceLevelColumns.push(gradeColumn);
          }
        });
      });
      ToleranceLevelColumns.push({
        text: `${this.$t("selectPage.custom.TR")}`,
        value: 0,
        disable: false,
      });
      if (this.m_ToleranceStandardValue == 0) {
        this.m_ToleranceLevelIndex = ToleranceLevelColumns.length - 1;
      }
      this.m_ToleranceStandardColumns = ToleranceStandardColumns;
      this.m_ToleranceLevelColumns = ToleranceLevelColumns;
      // console.log(ToleranceStandardColumns,ToleranceLevelColumns,629)
    },
 
    //监听流量选择
    onChangeDpQuConfirm(columns, index) {
      this.m_DpQuValue = columns.value;
      this.m_DpQuText = columns.label;
      this.m_DpQuIndex = index;
      this.m_showDpQuPicker = false;
    },
    //监听扬程选择
    onChangeDpHuConfirm(columns, index) {
      this.m_DpHuValue = columns.value;
      this.m_DpHuText = columns.label;
      this.m_DpHuIndex = index;
      this.m_showDpHuPicker = false;
    },
    //电机转速选择切换
    motorToggle(item, index) {
      let motorResult = this.m_MotorValue;
      if (motorResult.indexOf(item) != -1) {
        motorResult.slice(motorResult.indexOf(item), motorResult.length - 1);
      } else {
        motorResult.push(item);
      }
      this.m_MotorValue = motorResult;
      this.m_MotorShowValue = motorResult.join(",");
 
      this.$refs.checkboxes[index].toggle();
    },
    //监听驱动类型选择
    onChangeDeviceTypeConfirm(e) {
      this.m_ShowDeviceTpyePicker = false;
      this.m_DeviceTpyeValue = e.value;
      this.m_DeviceTpyeShowValue = e.text;
    },
    //监听频率选择
    onChangePinLvConfirm(e) {
      this.m_ShowPinLvPicker = false;
      this.m_PinLvValue = e;
      this.m_PinLvShowValue = e;
    },
    //监听消防类型选择
    onChangeFireTypeConfirm(e) {
      if (e.value != 0) {
        this.IsFirePump = true;
      }
      this.m_ShowFireTypePicker = false;
      this.m_FireTypeValue = e.value;
      this.m_FireTypeShowValue = e.text;
    },
    //监听转速等级选择
    onChangeMotorPoleConfirm(e) {
      this.m_ShowMotorPolePicker = false;
      this.m_MotorPoleValue = e.value;
      this.m_MotorPoleShowValue = e.text;
    },
    onChangeBrandSelectAll(){
      this.brandSelectAll = !this.brandSelectAll
      let currentBrandSelectArr= []
      let currentBrandSelectName = []
      this.m_BrandColumns.forEach(item=>{
        if(this.brandSelectAll){
          item.IsSelect = true
        }else {
          item.IsSelect = false
        }
 
        if(item.IsSelect){
         currentBrandSelectArr.push(item.ID)
         currentBrandSelectName.push(item.ShortName)
        }
      })
 
      this.m_BrandShowValue = currentBrandSelectName.join(',')
      this.m_BrandValue = currentBrandSelectArr
    },
    //监听品牌选择
    onChangeBrandSelect(e){
      // console.log(e,965)
      let currentBrandSelectArr= []
      let currentBrandSelectName = []
      this.m_BrandColumns.forEach(item=>{
        if(item.ID == e.ID){
          item.IsSelect = !item.IsSelect
        }
        if(item.IsSelect){
         currentBrandSelectArr.push(item.ID)
         currentBrandSelectName.push(item.ShortName)
        }
      })
 
      this.m_BrandShowValue = currentBrandSelectName.join(',')
      this.m_BrandValue = currentBrandSelectArr
      //判断当前是否是全选
      if(this.m_BrandValue.length != this.m_BrandColumns.length){
        this.brandSelectAll = false
      }else {
        this.brandSelectAll = true
      }
      
    },
    //监听电机功率标准选择
    onChangeMotorStdConfirm(e) {
      this.m_ShowMotorStdPicker = false;
      this.m_MotorStdValue = e.value;
      this.m_MotorStdShowValue = e.text;
    },
    //监听介质名称选额
    onChangeJieZhiNameConfirm(e) {
      this.m_ShowJieZhiNamePicker = false;
      this.m_JieZhiNameValue = e.value;
      this.m_JieZhiNameShowValue = e.text;
    },
    //监听校验容差标准的选择
    onChangeToleranceStandardConfirm(e, index) {
      this.isToleranceLevelCustom = false;
      this.m_ToleranceStandardIndex = index;
      this.m_ToleranceStandardPicker = false;
      this.m_ToleranceStandardValue = e.value;
      this.m_ToleranceStandardShowValue = e.text;
 
      let SelectList = this.pointToleranceConfig.Standard4PumpSelectList;
      SelectList.forEach((item) => {
        if (item.Value == e.value) {
          this.m_ToleranceLevelValue = SelectList[0].ToleranceGrade[0].Value;
          this.m_ToleranceLevelShowValue = SelectList[0].ToleranceGrade[0].Name;
          // console.log(this.m_ToleranceLevelValue,710)
        }
      });
      this.buildToleranceRangData();
    },
    //监听容差等级的选择
    onChangeToleranceLevelConfirm(e, index) {
      this.isToleranceLevelCustom = false;
      this.m_ToleranceLevelPicker = false;
      this.m_ToleranceLevelValue = e.value;
      this.m_ToleranceLevelIndex = index;
      this.m_ToleranceLevelShowValue = e.text;
      if (e.value == 0) {
        this.isToleranceLevelCustom = true;
        return;
      }
      this.buildToleranceRangData();
    },
    //下一页
    toSelSeries() {
      let Toast = this.$toast;
      if (this.m_DpQ == "") {
        Toast.fail({
          duration: 1000, //为0时 不关闭toast框
          message: "请输入流量",
          forbidClick: true,
        });
        return;
      }
      if (this.m_DpH == "") {
        Toast.fail({
          duration: 1000, //为0时 不关闭toast框
          message: "请输入扬程",
          forbidClick: true,
        });
        return;
      }
 
      let groupPageData = {
        //介质
        JieZhi: {
          ID: 0, //介质id
          Name: "清水", //介质名称
          CalcDensity: this.m_CalcDensity, //密度
          CalcViscosity: this.m_CalcViscosity, //粘度
        },
        //筛选信息
        FilterInfo: {
          DriveType: this.m_DeviceTpyeValue, //设备类型 0电机 3柴油机
          KeyWord: "", //关键字 暂时默认空
          MotorPoleNum: this.m_MotorPoleValue, //电机效率等级 暂时为空
          DieselSpeed: this.m_DieselSpeed, //柴油机转速 暂时默认
          MotorFrequence: this.m_PinLvValue, //电机赫兹
          FirePumpType: this.m_FireTypeValue, //
          Temperature: this.m_Temperature, //温度
          MotorStandard: this.m_MotorStdValue, //电机功率标准
          SeriesSelectMethod: 1, //0 用的是 CatalogID   1 用的是SeriesID      2 行业
          SeriesID: "", //泵系列ID 暂时默认为空
          CatalogID: "", //泵类型id
        },
        //设计点参数
        DesignInfo: {
          UnitQ: this.m_DpQuValue, //流量单位
          UnitH: this.m_DpHuValue, //扬程单位
          DpQ: this.m_DpQ, //输入的流量的值
          DpH: this.m_DpH, //输入的扬程的值
          ToleranceStandard: this.m_ToleranceStandardValue, //容差标准的值
          // PointTolerance: {
          //   ToleranceGrade: this.m_ToleranceLevelValue,//容差等级的值
          //   RatioMinQ: this.m_MinFlowPerecent / 100,
          //   RatioMaxQ: this.m_MaxFlowPerecent / 100,
          //   RatioMinH: this.m_MinHeadPerecent / 100,
          //   RatioMaxH: this.m_MaxHeadPerecent / 100,
          // },
          PointTolerance: "",
          IsVisCorrect: false, //是否修正粘度 默认false
        },
      };
      if (this.m_HistoryRecordDataObj) {
        groupPageData.FilterInfo.SeriesID =
          this.m_HistoryRecordDataObj.FilterInfo.SeriesID;
        groupPageData.FilterInfo.CatalogID =
          this.m_HistoryRecordDataObj.FilterInfo.CatalogID;
      }
      // console.log(groupPageData, 468);
 
      //将筛选数据存储到vuex中
      this.$store.commit("instante/select/ByParas", {
        //select 表示vuex的文件名
        filterData: groupPageData,
      });
      this.gotoPage("/Select/PumpCategory", "", null);
    },
    //返回上一页
    pageBack() {
      this.gotoPage("/Index", "", null);
    },
  },
};
</script>
 
<style lang="scss">
.selectParm_Box {
  width: 100%;
  height: 100vh;
  .selectParm_main {
    width: 100%;
    height: calc(100% - 47px);
    overflow: auto;
    background-color: #fafafa;
    .van-button--primary {
      color: #000;
      background-color: unset;
      border: unset;
    }
    .van-cell__title,
    .van-cell__value {
      text-align: left;
      font-size: 13px;
    }
    .van-collapse-item__content {
      padding: 0px 16px;
    }
    .van-field__label {
      width: 7em;
    }
    .van-field__label--center {
      text-align: center !important;
    }
    .van-field__control {
      text-indent: 5.5em;
      text-overflow: ellipsis;
    }
    .brand-content {
      height: 50vh;
      padding: 0px 5px;
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-start;
      align-content: flex-start;
    }
    .brand-item {
      display: flex;
      flex-direction: column;
      width: 120px;
      height: 32px;
      justify-content: center;
      align-items: center;
      background-color: #f1f2f3;
      border-radius: 20px;
      margin-bottom: 10px;
      margin-right: 5px;
      box-sizing: border-box;
        span{
          font-size: 12px;
        }
    }
    .brand-item-active{
      border: 1px solid #578ebe;
      background-color: #ecf5ff;
      span{
        font-size: 12px;
        color:#578ebe
      }
    }
  }
}
</style>