bri-components 1.2.49 → 1.2.50

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.
Files changed (47) hide show
  1. package/package.json +2 -2
  2. package/src/components/controls/BriControlInput.vue +4 -3
  3. package/src/components/controls/base/DshCascader/DshCascader.vue +40 -23
  4. package/src/components/controls/base/DshCascader/InfoCascader.vue +7 -15
  5. package/src/components/controls/base/DshDate/DshDate.vue +146 -0
  6. package/src/components/controls/base/{DshDaterange.vue → DshDate/DshDaterange.vue} +55 -1
  7. package/src/components/controls/base/{BriInputs.vue → DshInput/BriInputs.vue} +1 -1
  8. package/src/components/controls/base/{DshInput.vue → DshInput/DshInput.vue} +24 -5
  9. package/src/components/controls/base/DshNumber/DshNumber.vue +74 -2
  10. package/src/components/controls/base/{DshNumberange.vue → DshNumber/DshNumberange.vue} +37 -2
  11. package/src/components/controls/base/DshSelect/DshCheckbox.vue +280 -0
  12. package/src/components/controls/base/DshSelect/DshSelect.vue +319 -0
  13. package/src/components/controls/base/DshSelect/selectMixin.js +241 -0
  14. package/src/components/controls/base/DshSwitch/DshSwitch.vue +84 -0
  15. package/src/components/controls/base/DshSwitch/switchMixin.js +73 -0
  16. package/src/components/controls/controlMap.js +8 -11
  17. package/src/components/controls/controlMixin.js +33 -5
  18. package/src/components/controls/senior/BriLabels.vue +1 -1
  19. package/src/components/controls/senior/selectDepartments.vue +9 -13
  20. package/src/components/controls/senior/selectUsers/selectUsers.vue +23 -21
  21. package/src/components/form/DshAdvSearch.vue +155 -3
  22. package/src/components/form/DshDefaultSearch.vue +94 -12
  23. package/src/components/form/DshForm.vue +24 -0
  24. package/src/components/form/searchMixin.js +5 -18
  25. package/src/components/other/BriGantt.vue +2 -2
  26. package/src/components/unit/DshFormUnit.vue +108 -0
  27. package/src/components/unit/DshListUnit.vue +6 -0
  28. package/src/index.js +10 -10
  29. package/src/styles/components/index.less +0 -14
  30. package/src/styles/components/other/BriGantt.less +1 -12
  31. package/src/styles/reset-iview.less +47 -1
  32. package/src/components/controls/base/DshCheckbox.vue +0 -213
  33. package/src/components/controls/base/DshDate.vue +0 -122
  34. package/src/components/controls/base/DshSelect.vue +0 -242
  35. package/src/components/controls/base/DshSwitch.vue +0 -70
  36. package/src/components/controls/base/selectMixin.js +0 -110
  37. package/src/styles/components/controls/base/DshCheckbox.less +0 -115
  38. package/src/styles/components/controls/base/DshDate.less +0 -15
  39. package/src/styles/components/controls/base/DshDaterange.less +0 -49
  40. package/src/styles/components/controls/base/DshNumber.less +0 -55
  41. package/src/styles/components/controls/base/DshNumberange.less +0 -29
  42. package/src/styles/components/controls/base/DshSelect.less +0 -190
  43. package/src/styles/components/form/DshAdvSearch.less +0 -149
  44. package/src/styles/components/form/DshDefaultSearch.less +0 -82
  45. package/src/styles/components/form/DshForm.less +0 -18
  46. package/src/styles/components/unit/DshFormUnit.less +0 -105
  47. package/src/styles/components/unit/DshListUnit.less +0 -3
@@ -0,0 +1,241 @@
1
+ import controlMixin from "../../controlMixin.js";
2
+ import { resourceData } from "bri-datas";
3
+
4
+ export default {
5
+ mixins: [
6
+ controlMixin
7
+ ],
8
+ components: {},
9
+ props: {},
10
+ data () {
11
+ return {
12
+ initListData: [],
13
+ showTipTpl: false,
14
+ showTipModal: false,
15
+ dynamicContent: ""
16
+ };
17
+ },
18
+ computed: {
19
+ selectPropsObj () {
20
+ return {
21
+ colorMap: resourceData.colorMap,
22
+ _optionKind: "dropdown", // "flat"、"dropdown"
23
+ _useColor: false,
24
+ _filterable: true,
25
+ _data: [],
26
+ _customData: [],
27
+
28
+ ...this.propsObj,
29
+ ...this.commonDealPropsObj,
30
+
31
+ _disabled: this.propsObj._disabled || !this.finalCanEdit
32
+ };
33
+ },
34
+ showType () {
35
+ return this.selfPropsObj._optionKind;
36
+ },
37
+ useColor () {
38
+ return this.selfPropsObj._useColor;
39
+ },
40
+ colorMap () {
41
+ return this.selfPropsObj.colorMap;
42
+ },
43
+ listData () {
44
+ const listData = this.selfPropsObj._data.concat(this.initListData);
45
+
46
+ return this.$dataType(this.selfPropsObj._filterFunc, "function")
47
+ ? this.selfPropsObj._filterFunc(listData, this.selfPropsObj, this.value)
48
+ : listData;
49
+ },
50
+
51
+ openTip () {
52
+ return this.isOnSearch ? false : this.propsObj._openTip;
53
+ },
54
+ modalTipContent () {
55
+ return this.propsObj._tipContent || this.dynamicContent || "暂无信息";
56
+ },
57
+
58
+ curValObj () {
59
+ return this.$isEmptyData(this.curVal)
60
+ ? undefined
61
+ : this.getItemData(this.curVal);
62
+ },
63
+ valStr: {
64
+ get () {
65
+ return this.curValObj
66
+ ? this.curValObj.name || this.curValObj._name
67
+ : "";
68
+ },
69
+ set (val) {
70
+ if (!val) {
71
+ this.curVal = "";
72
+ }
73
+ }
74
+ },
75
+ showVal () {
76
+ return this.$isEmptyData(this.curVal)
77
+ ? this.emptyShowVal
78
+ : this.valStr;
79
+ },
80
+ // 已选择项的对象列表
81
+ curValObjList () {
82
+ return this.curValList.map(key => this.getItemData(key));
83
+ },
84
+ valListStr () {
85
+ return this.curValObjList.map(item => item.name || item._name).join("、");
86
+ },
87
+ showMulVal () {
88
+ return this.$isEmptyData(this.curValList)
89
+ ? this.emptyShowVal
90
+ : this.valListStr;
91
+ }
92
+ },
93
+ created () {
94
+ this.init();
95
+ },
96
+ methods: {
97
+ init () {
98
+ this.getTipData();
99
+ this.getListData();
100
+ },
101
+
102
+ getItemData (key) {
103
+ const obj = this.listData.find(item => item._key === key) || {
104
+ _key: key,
105
+ name: `温馨提示:选项${key}已找不到`
106
+ };
107
+
108
+ return {
109
+ ...obj,
110
+ style: this.getItemStyle(obj),
111
+ color: undefined
112
+ };
113
+ },
114
+ getItemStyle (item) {
115
+ const color = this.colorMap[item.color] || this.colorMap["color-1"];
116
+ return {
117
+ "background-color": this.useColor ? this.$getColor(color, 0.1) : "#E5E5E5",
118
+ color: this.useColor ? color : "rgba(0, 0, 0, 0.9)",
119
+ display: "inline-block",
120
+ "max-width": "100%",
121
+ padding: "0px 6px",
122
+ "border-radius": "4px"
123
+ };
124
+ },
125
+ // 获取某项的置灰状态
126
+ getItemDisabled (item) {
127
+ return !!(this.selfPropsObj._disabled || item._disabled);
128
+ },
129
+
130
+ // 是否打开tip弹窗
131
+ clickOpenTip (item) {
132
+ if (item.__isTip__) {
133
+ if (this.propsObj._tipKind === "dynamic" && !this.propsObj._tipContent) {
134
+ this.getTipUrl();
135
+ } else {
136
+ this.showTipTpl = true;
137
+ this.showTipModal = true;
138
+ }
139
+ }
140
+ },
141
+ getTipUrl () {
142
+ if (this.propsObj._tipUrl) {
143
+ this.$https({
144
+ url: {
145
+ module: "customPath",
146
+ name: this.propsObj._tipUrl
147
+ },
148
+ params: {
149
+ formData: this.value,
150
+ propsObj: this.propsObj
151
+ },
152
+ callback: res => {
153
+ this.dynamicContent = res;
154
+ this.showTipTpl = true;
155
+ this.showTipModal = true;
156
+ }
157
+ });
158
+ } else {
159
+ this.$Message.warning("请配置接口路径!");
160
+ }
161
+ },
162
+ tipModalRender (h) {
163
+ return this.showTipTpl
164
+ ? h("dsh-modal", {
165
+ props: {
166
+ value: this.showTipModal,
167
+ mode: "custom",
168
+ propsObj: {
169
+ title: "温馨提示",
170
+ maskClosable: true,
171
+ class: "DshSelect-modal"
172
+ }
173
+ },
174
+ on: {
175
+ input: bool => {
176
+ this.showTipModal = bool;
177
+ }
178
+ }
179
+ }, [
180
+ h("div", {
181
+ class: "DshSelect-modal-content",
182
+ domProps: {
183
+ innerHTML: this.modalTipContent
184
+ }
185
+ }),
186
+ h("div", {
187
+ class: "DshSelect-modal-footer"
188
+ }, [
189
+ h("Button", {
190
+ props: {
191
+ type: "primary"
192
+ },
193
+ on: {
194
+ click: () => {
195
+ this.showTipModal = false;
196
+ }
197
+ }
198
+ }, "我知道了")
199
+ ])
200
+ ])
201
+ : undefined;
202
+ },
203
+ getTipData () {
204
+ if (
205
+ (this.propsObj._key !== "_default") &&
206
+ this.finalCanEdit &&
207
+ this.openTip
208
+ ) {
209
+ let tipObj = {
210
+ _key: "openTip",
211
+ _name: this.propsObj._tipName || "其他",
212
+ __isTip__: true,
213
+ _disabled: true,
214
+ color: "#6991cc",
215
+ class: `Dsh${this.propsObj._type}-tip`
216
+ };
217
+ this.initListData.push(tipObj);
218
+ }
219
+ },
220
+ // 接口 -获取自定义的接口数据
221
+ getListData () {
222
+ this.selfPropsObj._customData.forEach(item => {
223
+ this.$https({
224
+ url: item.url,
225
+ params: item.params,
226
+ callback: data => {
227
+ this.initListData = [
228
+ ...this.initListData,
229
+ ...data.list.map(dataItem =>
230
+ ({
231
+ _key: dataItem[item._key || "_key"],
232
+ name: dataItem[item._name || "name"]
233
+ })
234
+ )
235
+ ];
236
+ }
237
+ });
238
+ });
239
+ }
240
+ }
241
+ };
@@ -0,0 +1,84 @@
1
+ <template>
2
+ <!-- 单选模式 编辑 -->
3
+ <div
4
+ v-if="!multipleMode && canEdit"
5
+ class="DshSwitch"
6
+ >
7
+ <i-switch
8
+ v-model="curVal"
9
+ :disabled="selfPropsObj._disabled"
10
+ :loading="selfPropsObj.loading"
11
+ :size="selfPropsObj._size"
12
+ :true-color="selfPropsObj._openColor"
13
+ :false-color="selfPropsObj._closeColor"
14
+ :true-value="selfPropsObj._openValue"
15
+ :false-value="selfPropsObj._closeValue"
16
+ @on-change="change"
17
+ >
18
+ <span slot="open">
19
+ {{ selfPropsObj._openText }}
20
+ </span>
21
+ <span slot="close">
22
+ {{ selfPropsObj._closeText }}
23
+ </span>
24
+ </i-switch>
25
+ </div>
26
+
27
+ <!-- 单选模式 查看 -->
28
+ <span
29
+ v-else-if="!multipleMode && !canEdit"
30
+ :class="{
31
+ ...commonClass
32
+ }"
33
+ :style="showStyle"
34
+ >
35
+ {{ showVal }}
36
+ </span>
37
+
38
+ <!-- 多选模式 -->
39
+ <dsh-checkbox
40
+ v-else
41
+ :canEdit="canEdit"
42
+ :value="value"
43
+ :propsObj="mulPropsObj"
44
+ @change="change"
45
+ ></dsh-checkbox>
46
+ </template>
47
+
48
+ <script>
49
+ import switchMixin from "./switchMixin.js";
50
+
51
+ export default {
52
+ name: "DshSwitch",
53
+ mixins: [
54
+ switchMixin
55
+ ],
56
+ components: {},
57
+ props: {},
58
+ data () {
59
+ return {};
60
+ },
61
+ computed: {
62
+ selfPropsObj () {
63
+ return {
64
+ _size: "default", // "default", "small", "large"
65
+
66
+ ...this.switchPropsObj
67
+ };
68
+ }
69
+ },
70
+ created () {},
71
+ methods: {}
72
+ };
73
+ </script>
74
+
75
+ <style lang="less" scoped>
76
+ .DshSwitch {
77
+
78
+ }
79
+ </style>
80
+ <style lang="less">
81
+ .DshSwitch {
82
+
83
+ }
84
+ </style>
@@ -0,0 +1,73 @@
1
+ import controlMixin from "../../controlMixin.js";
2
+ import DshCheckbox from "../DshSelect/DshCheckbox.vue";
3
+
4
+ export default {
5
+ mixins: [
6
+ controlMixin
7
+ ],
8
+ components: {
9
+ DshCheckbox
10
+ },
11
+ props: {},
12
+ data () {
13
+ return {};
14
+ },
15
+ computed: {
16
+ switchPropsObj () {
17
+ return {
18
+ loading: false, // 是否为加载状态
19
+ _openColor: this.$appData.themeColor, // 打开时的背景色
20
+ _closeColor: "#ccc", // 关闭时的背景色
21
+ _openValue: true, // 打开时对应的值
22
+ _closeValue: false, // 关闭时对应的值
23
+
24
+ ...this.propsObj,
25
+ ...this.commonDealPropsObj,
26
+
27
+ _openText: this.propsObj._openText || "是", // 此行放在 ...this.propsObj的下面目的是,处理_openText为空字符串的情况
28
+ _closeText: this.propsObj._closeText || "否",
29
+ _disabled: this.propsObj._disabled || !this.finalCanEdit
30
+ };
31
+ },
32
+ mulPropsObj () {
33
+ return {
34
+ ...this.propsObj,
35
+ _optionKind: "flat",
36
+ _data: [
37
+ {
38
+ _key: "true",
39
+ name: this.selfPropsObj._openText,
40
+ color: this.selfPropsObj._openColor
41
+ },
42
+ {
43
+ _key: "false",
44
+ name: this.selfPropsObj._closeText,
45
+ color: this.selfPropsObj._closeColor
46
+ }
47
+ ]
48
+ };
49
+ },
50
+ showStyle () {
51
+ return !this.$isEmptyData(this.curVal)
52
+ ? {
53
+ backgroundColor: this.curVal === true ? "#d3f3dc" : "#FDEDED",
54
+ color: this.curVal === true ? "#37C45E" : "#E83636",
55
+ display: "inline-block",
56
+ "max-width": "100%",
57
+ padding: "0px 6px",
58
+ "border-radius": "4px"
59
+ }
60
+ : {};
61
+ },
62
+
63
+ showVal () {
64
+ return this.$isEmptyData(this.curVal)
65
+ ? this.emptyShowVal
66
+ : this.curVal === true
67
+ ? this.selfPropsObj._openText
68
+ : this.selfPropsObj._closeText;
69
+ }
70
+ },
71
+ created () { },
72
+ methods: {}
73
+ };
@@ -17,11 +17,11 @@ const componentNameMap = {
17
17
  url: "DshInput",
18
18
  password: "DshInput",
19
19
  serialNumber: "DshInput",
20
- texts: "BriInputs",
20
+ texts: "DshInput",
21
21
  number: "DshNumber",
22
- numberange: "DshNumberange",
22
+ numberange: "DshNumber",
23
23
  date: "DshDate",
24
- daterange: "DshDaterange",
24
+ daterange: "DshDate",
25
25
  switch: "DshSwitch",
26
26
  select: "DshSelect",
27
27
  checkbox: "DshCheckbox",
@@ -50,15 +50,12 @@ const componentNameMap = {
50
50
  // 组件相对路径映射图
51
51
  const pathMap = {
52
52
  base: {
53
- // DshInput: "./base/DshInput.vue", // 全局已注册
54
- BriInputs: "./base/BriInputs.vue",
53
+ // DshInput: "./base/DshInput/DshInput.vue", // 全局已注册
55
54
  // DshNumber: "./base/DshNumber/DshNumber.vue", // 全局已注册
56
- DshNumberange: "./base/DshNumberange.vue",
57
- DshDate: "./base/DshDate.vue",
58
- DshDaterange: "./base/DshDaterange.vue",
59
- DshSwitch: "./base/DshSwitch.vue",
60
- // DshSelect: "./base/DshSelect.vue", // 全局已注册
61
- // DshCheckbox: "./base/DshCheckbox.vue", // 全局已注册
55
+ DshDate: "./base/DshDate/DshDate.vue",
56
+ DshSwitch: "./base/DshSwitch/DshSwitch.vue",
57
+ // DshSelect: "./base/DshSelect/DshSelect.vue", // 全局已注册
58
+ // DshCheckbox: "./base/DshSelect/DshCheckbox.vue", // 全局已注册
62
59
  // DshCascader: "./base/DshCascader/DshCascader.vue", // 全局已注册
63
60
  BriUpload: "./base/BriUpload/BriUpload.vue",
64
61
  DshCoordinates: "./base/DshCoordinates.vue",
@@ -35,7 +35,9 @@ export default {
35
35
  }
36
36
  },
37
37
  data () {
38
- return {};
38
+ return {
39
+ showModal: false
40
+ };
39
41
  },
40
42
  computed: {
41
43
  // 值为不是[]类型用的
@@ -45,6 +47,7 @@ export default {
45
47
  },
46
48
  set (val) {
47
49
  this.value[this.controlKey] = val;
50
+ // this.change();
48
51
  }
49
52
  },
50
53
  // 值为[]类型用的
@@ -52,8 +55,8 @@ export default {
52
55
  get () {
53
56
  return this.value[this.controlKey] || [];
54
57
  },
55
- set (val) {
56
- this.$set(this.value, this.controlKey, val);
58
+ set (valList) {
59
+ this.$set(this.value, this.controlKey, valList);
57
60
  this.change();
58
61
  }
59
62
  },
@@ -85,8 +88,9 @@ export default {
85
88
  finalCanEdit () {
86
89
  return this.canEdit && (this.propsObj.canEdit == undefined ? true : this.propsObj.canEdit);
87
90
  },
91
+ // 是否为多选模式
88
92
  multipleMode () {
89
- return this.selfPropsObj ? !!this.selfPropsObj._multiple : !!this.propsObj._multiple;
93
+ return ["numberange", "daterange", "checkbox", "regions", "cascaders"].includes(this.controlType) || !!this.propsObj._multiple;
90
94
  },
91
95
  commonDealPropsObj () {
92
96
  const selectControlTypes = ["date", "switch", "select", "checkbox", "file", "region", "regions", "cascader", "cascaders", "coordinates", "users", "departments"];
@@ -105,7 +109,7 @@ export default {
105
109
  "bri-control-unit": !this.canEdit && this.isInTable,
106
110
  "bri-control-show": !this.canEdit && !this.isInTable,
107
111
 
108
- "dsh-ellipsis": !(this.isUnitShow && !!this.propsObj._unitWrap),
112
+ "dsh-ellipsis": this.isUnitShow,
109
113
  "bri-control-nodata": this.$isEmptyData(this.curVal)
110
114
  };
111
115
  },
@@ -126,6 +130,9 @@ export default {
126
130
  isInTable () {
127
131
  return !!this.propsObj.isInTable;
128
132
  },
133
+ isOnSearch () {
134
+ return !!this.propsObj.onSearch;
135
+ },
129
136
  isUnitUpdate () {
130
137
  return this.isInTable && !!this.canEdit;
131
138
  },
@@ -135,6 +142,7 @@ export default {
135
142
  // isShare () {
136
143
  // return !!this.propsObj.isShare;
137
144
  // },
145
+
138
146
  /* 部分控件下 才使用的属性 */
139
147
  compKey () {
140
148
  return this.propsObj.compKey;
@@ -147,6 +155,12 @@ export default {
147
155
  },
148
156
  modKey () {
149
157
  return this.propsObj.modKey;
158
+ },
159
+ // 移动端在用 --只做校验的field框所用的propsObj
160
+ ruleFieldPropsObj () {
161
+ return {
162
+ _rules: this.propsObj._rules
163
+ };
150
164
  }
151
165
  },
152
166
  methods: {
@@ -155,6 +169,20 @@ export default {
155
169
  },
156
170
  refChange (...params) {
157
171
  this.$emit("refChange", this.value[this.controlKey]);
172
+ },
173
+
174
+ /* ----- 工具方法 ------- */
175
+ // 切换弹框
176
+ toggleModal (bool) {
177
+ this.showModal = bool;
178
+ },
179
+ // 打开弹框
180
+ openModal () {
181
+ this.showModal = true;
182
+ },
183
+ // 关闭弹框
184
+ closeModal () {
185
+ this.showModal = false;
158
186
  }
159
187
  }
160
188
  };
@@ -151,7 +151,7 @@
151
151
  return this.selfPropsObj._labelType;
152
152
  },
153
153
  onlySelect () {
154
- return this.selfPropsObj._onlySelect;
154
+ return this.isOnSearch ? true : this.selfPropsObj._onlySelect;
155
155
  },
156
156
  originLabels () {
157
157
  return this.selfPropsObj._originLabels;
@@ -57,7 +57,7 @@
57
57
  <!-- 上 已选择项 -->
58
58
  <div class="list-selected">
59
59
  <span class="list-selected-label">
60
- 已选择{{ multiple ? `(${newValList.length}个)` : "" }}:
60
+ 已选择{{ multipleMode ? `(${newValList.length}个)` : "" }}:
61
61
  </span>
62
62
 
63
63
  <span
@@ -95,16 +95,14 @@
95
95
 
96
96
  <template v-else>
97
97
  <!-- 树形形式 -->
98
- <div
99
- class="list-center-tree"
100
- >
98
+ <div class="list-center-tree">
101
99
  <template v-if="allDepartmentList.length">
102
100
  <bri-tree-item
103
101
  v-for="item in allDepartmentList"
104
102
  :key="item._key"
105
103
  :value="item"
106
104
  :changeOnSelect="changeOnSelect"
107
- :multiple="multiple"
105
+ :multiple="multipleMode"
108
106
  @on-change="changeSelect"
109
107
  ></bri-tree-item>
110
108
  </template>
@@ -179,18 +177,13 @@
179
177
  _highSearch: false,
180
178
  _changeOnSelect: true,
181
179
  _searchString: "",
180
+
182
181
  ...this.propsObj,
183
182
  ...this.commonDealPropsObj
184
183
  };
185
184
  },
186
- multiple () {
187
- return this.selfPropsObj._multiple;
188
- },
189
185
  highSearch () {
190
- return this.selfPropsObj._highSearch;
191
- },
192
- inputIcon () {
193
- return this.multiple ? "ios-people" : "ios-person";
186
+ return this.isOnSearch ? true : this.selfPropsObj._highSearch;
194
187
  },
195
188
  changeOnSelect () {
196
189
  return this.selfPropsObj._changeOnSelect;
@@ -198,6 +191,9 @@
198
191
  searchString () {
199
192
  return this.selfPropsObj._searchString;
200
193
  },
194
+ inputIcon () {
195
+ return this.multipleMode ? "ios-people" : "ios-person";
196
+ },
201
197
 
202
198
  modalPropsObj () {
203
199
  return {
@@ -259,7 +255,7 @@
259
255
  /* ---------- 弹框里 --------- */
260
256
  // 弹窗 -选项变化
261
257
  changeSelect (selectItem) {
262
- this.newValList = this.multiple
258
+ this.newValList = this.multipleMode
263
259
  ? this.selectKeys.includes(selectItem._key)
264
260
  ? this.newValList.filter(item => item._key !== selectItem._key)
265
261
  : [...this.newValList, selectItem]
@@ -120,7 +120,7 @@
120
120
  >
121
121
  <!-- 上 全选 -->
122
122
  <div
123
- v-if="multiple"
123
+ v-if="multipleMode"
124
124
  class="content-users-list-checkAll"
125
125
  >
126
126
  <Checkbox
@@ -292,15 +292,11 @@
292
292
  ...this.commonDealPropsObj
293
293
  };
294
294
  },
295
-
296
- multiple () {
297
- return this.selfPropsObj._multiple;
298
- },
299
295
  highSearch () {
300
- return this.selfPropsObj._highSearch;
296
+ return this.isOnSearch ? true : this.selfPropsObj._highSearch;
301
297
  },
302
298
  inputIcon () {
303
- return this.multiple ? "ios-people" : "ios-person";
299
+ return this.multipleMode ? "ios-people" : "ios-person";
304
300
  },
305
301
 
306
302
  curCheckAll () {
@@ -379,7 +375,7 @@
379
375
  }
380
376
  },
381
377
  clickSelectUserItem (curUserItem, bool) {
382
- if (this.multiple) {
378
+ if (this.multipleMode) {
383
379
  if (this.newValList.some(newItem => newItem._key === curUserItem._key)) {
384
380
  this.newValList = this.newValList.filter(newItem => newItem._key !== curUserItem._key);
385
381
  } else {
@@ -442,21 +438,27 @@
442
438
  searchString: this.propsObj.searchString
443
439
  },
444
440
  callback: data => {
445
- let depart = [{
446
- is_leaf: true,
447
- level: 1,
448
- name: "全部",
449
- _key: ""
450
- }];
451
- if (this.highSearch) {
452
- depart.unshift({
441
+ this.departmentList = [
442
+ ...(
443
+ this.highSearch
444
+ ? [
445
+ {
446
+ is_leaf: true,
447
+ level: 1,
448
+ name: "高级选项",
449
+ _key: "_highSearch"
450
+ }
451
+ ]
452
+ : []
453
+ ),
454
+ {
453
455
  is_leaf: true,
454
456
  level: 1,
455
- name: "高级选项",
456
- _key: "_highSearch"
457
- });
458
- }
459
- this.departmentList = depart.concat(data.list);
457
+ name: "全部",
458
+ _key: ""
459
+ },
460
+ ...data.list
461
+ ];
460
462
  }
461
463
  });
462
464
  }