cnhis-design-vue 2.0.13 → 2.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -157,20 +157,20 @@
157
157
  <a-row>
158
158
  <a-col>
159
159
  <span style="display: inline-block;width: 70px;">PC:</span>
160
- <a-checkbox :value="item.value" v-for="(item, index) in toolbarList.filter(item => item.source === 'PC')" :key="index">
160
+ <a-checkbox @change="toolbarChange(item, $event)" :value="item.value" v-for="(item, index) in toolbarList.filter(item => item.source === 'PC')" :key="index">
161
161
  {{ item.label }}
162
162
  </a-checkbox>
163
163
  </a-col>
164
164
  <a-col>
165
165
  <span style="display: inline-block;width: 70px;">MOBILE:</span>
166
- <a-checkbox :value="item.value" v-for="(item, index) in toolbarList.filter(item => item.source === 'MOBILE')" :key="index">
166
+ <a-checkbox @change="toolbarChange(item, $event)" :value="item.value" v-for="(item, index) in toolbarList.filter(item => item.source === 'MOBILE')" :key="index">
167
167
  {{ item.label }}
168
168
  </a-checkbox>
169
169
  </a-col>
170
170
  </a-row>
171
171
  </a-checkbox-group>
172
172
  </a-form-item>
173
- <a-form-item :label="i18nText('1.9.699')" v-if="closedToolbarList.length > 0">
173
+ <a-form-item :label="i18nText('1.9.699')" v-if="toolbarList.length > 0">
174
174
  <a-checkbox-group v-decorator="[`closedToolbar`]">
175
175
  <a-row>
176
176
  <a-col>
@@ -401,7 +401,6 @@ export default {
401
401
  functionList: [], // 服务端功能下拉列表
402
402
  clientFunctionList: [], // 客户端功能下拉列表
403
403
  toolbar: [],
404
- closedToolbar: [],
405
404
  toolbarList: [],
406
405
  closedToolbarList: [],
407
406
  queryTimeSetting: [],
@@ -547,7 +546,6 @@ export default {
547
546
  robotObj,
548
547
  robotSetting,
549
548
  toolbar = [],
550
- closedToolbar = [],
551
549
  isListClassify,
552
550
  listClassify = [],
553
551
  rightClickSetting = [],
@@ -577,7 +575,6 @@ export default {
577
575
  });
578
576
  this.fillClientSetting(clientSetting);
579
577
  this.fillToolbar(toolbar);
580
- this.fillClosedToolbar(closedToolbar);
581
578
  this.fillQueryTimeSetting(queryTimeSetting);
582
579
  this.fillBroadcast(broadcast);
583
580
  this.fillTabBar(setting.tabBarSetting);
@@ -642,7 +639,17 @@ export default {
642
639
  this.toolbarList = toolbar.map(item => ({
643
640
  label: item.name,
644
641
  value: item.name + '-' + item.source,
645
- source: item.source
642
+ source: item.source,
643
+ isClosedAble: item.isClosedAble,
644
+ isCloseChecked: item.isCloseChecked
645
+ }));
646
+ const btwList = toolbar.filter(item => item.isClosedAble == "Y" && item.isChecked == "Y");
647
+ this.closedToolbarList = btwList.map(item => ({
648
+ label: item.name,
649
+ value: item.name + '-' + item.source,
650
+ source: item.source,
651
+ isClosedAble: item.isClosedAble,
652
+ isCloseChecked: item.isCloseChecked
646
653
  }));
647
654
  this.toolbar = toolbar;
648
655
  let toolbarChecked = toolbar.reduce((result, item) => {
@@ -654,17 +661,9 @@ export default {
654
661
  this.$nextTick(() => {
655
662
  this.form.setFieldsValue({ toolbar: toolbarChecked });
656
663
  });
657
- },
658
- fillClosedToolbar(closedToolbar) {
659
- this.closedToolbarList = closedToolbar.map(item => ({
660
- label: item.name,
661
- value: item.name + '-' + item.source,
662
- source: item.source
663
- }));
664
- this.closedToolbar = closedToolbar;
665
- let closedToolbarChecked = closedToolbar.reduce((result, item) => {
666
- if (item.isChecked === 'Y') {
667
- result.push(item.name + '-' + item.source);
664
+ let closedToolbarChecked = this.closedToolbarList.reduce((result, item) => {
665
+ if (item.isCloseChecked === 'Y') {
666
+ result.push(item.label + '-' + item.source);
668
667
  }
669
668
  return result;
670
669
  }, []);
@@ -672,6 +671,24 @@ export default {
672
671
  this.form.setFieldsValue({ closedToolbar: closedToolbarChecked });
673
672
  });
674
673
  },
674
+ toolbarChange(item, e) {
675
+ const checked = e.target.checked;
676
+ let checkedItemIndex = -1;
677
+ const checkedItems = [];
678
+ this.closedToolbarList.forEach((itm, index) => {
679
+ if (item.source == itm.source && item.value == itm.value) {
680
+ checkedItemIndex = index;
681
+ } else {
682
+ checkedItems.push(itm.value);
683
+ }
684
+ })
685
+ if (checked && checkedItemIndex == -1 && item.isClosedAble == "Y") {
686
+ this.closedToolbarList.push(item);
687
+ } else if (!checked && checkedItemIndex != -1) {
688
+ this.form.setFieldsValue({ closedToolbar: checkedItems });
689
+ this.closedToolbarList.splice(checkedItemIndex, 1);
690
+ }
691
+ },
675
692
  fillTabBar(data) {
676
693
  const mobileSetting = {
677
694
  isChecked: 'N',
@@ -850,7 +867,6 @@ export default {
850
867
  let setting = {};
851
868
  this.handleTimeSetting(setting, values);
852
869
  this.handleToolbar(setting, values);
853
- this.handleClosedToolbar(setting, values);
854
870
  this.handleQueryTimeSetting(setting, values);
855
871
  this.handleClassify(setting);
856
872
  let validate = this.handleServiceSetting(setting, values);
@@ -941,7 +957,7 @@ export default {
941
957
  },
942
958
  handleToolbar(setting, values) {
943
959
  if (this.toolbarList.length === 0) return;
944
- let { toolbar } = values;
960
+ let { toolbar, closedToolbar } = values;
945
961
  let clone = JSON.parse(JSON.stringify(this.toolbar));
946
962
  setting.toolbar = clone.reduce((result, item) => {
947
963
  if (toolbar.includes(item.name + '-' + item.source)) {
@@ -949,19 +965,10 @@ export default {
949
965
  } else {
950
966
  item.isChecked = 'N';
951
967
  }
952
- result.push(item);
953
- return result;
954
- }, []);
955
- },
956
- handleClosedToolbar(setting, values) {
957
- if (this.closedToolbarList.length === 0) return;
958
- let { closedToolbar } = values;
959
- let clone = JSON.parse(JSON.stringify(this.closedToolbar));
960
- setting.closedToolbar = clone.reduce((result, item) => {
961
968
  if (closedToolbar.includes(item.name + '-' + item.source)) {
962
- item.isChecked = 'Y';
969
+ item.isCloseChecked = 'Y';
963
970
  } else {
964
- item.isChecked = 'N';
971
+ item.isCloseChecked = 'N';
965
972
  }
966
973
  result.push(item);
967
974
  return result;