bri-components 1.5.14 → 1.5.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.
Files changed (151) hide show
  1. package/README.md +83 -83
  2. package/lib/0.bri-components.min.js +1 -1
  3. package/lib/1.bri-components.min.js +1 -1
  4. package/lib/10.bri-components.min.js +1 -1
  5. package/lib/2.bri-components.min.js +1 -1
  6. package/lib/3.bri-components.min.js +1 -1
  7. package/lib/4.bri-components.min.js +1 -1
  8. package/lib/5.bri-components.min.js +1 -1
  9. package/lib/6.bri-components.min.js +1 -1
  10. package/lib/7.bri-components.min.js +1 -1
  11. package/lib/8.bri-components.min.js +1 -1
  12. package/lib/9.bri-components.min.js +1 -1
  13. package/lib/bri-components.min.js +4 -4
  14. package/lib/styles/bundle.css +12 -12
  15. package/lib/styles/font/fontello.svg +31 -31
  16. package/package.json +125 -125
  17. package/src/components/Error/Error403.vue +42 -42
  18. package/src/components/Error/Error404.vue +40 -40
  19. package/src/components/Error/Error500.vue +51 -51
  20. package/src/components/Error/error.less +162 -162
  21. package/src/components/Error/errorBack.vue +40 -40
  22. package/src/components/controls/DshControlInput.vue +195 -195
  23. package/src/components/controls/base/BriUpload/BriUpload.vue +434 -434
  24. package/src/components/controls/base/BriUpload/BriUploadImage.vue +377 -377
  25. package/src/components/controls/base/BriUpload/uploadList.vue +727 -727
  26. package/src/components/controls/base/BriUpload/uploadMixin.js +446 -446
  27. package/src/components/controls/base/DshCascader/DshCascader.vue +215 -215
  28. package/src/components/controls/base/DshCascader/components/cascaderModal.vue +366 -366
  29. package/src/components/controls/base/DshCascader/components/cascaderPicker.vue +416 -416
  30. package/src/components/controls/base/DshCascader/components/cascaderSimple.vue +141 -141
  31. package/src/components/controls/base/DshCascader/components/cascaderTree.vue +151 -151
  32. package/src/components/controls/base/DshCoordinates.vue +577 -577
  33. package/src/components/controls/base/DshDate/DshDate.vue +191 -191
  34. package/src/components/controls/base/DshDate/DshDaterange.vue +186 -186
  35. package/src/components/controls/base/DshDivider.vue +201 -201
  36. package/src/components/controls/base/DshEditor.vue +274 -274
  37. package/src/components/controls/base/DshInput/BriInputs.vue +166 -166
  38. package/src/components/controls/base/DshInput/DshInput.vue +260 -260
  39. package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +435 -435
  40. package/src/components/controls/base/DshNumber/BriInputNumber/mixins/emitter.js +34 -34
  41. package/src/components/controls/base/DshNumber/BriInputNumber/mixins/form.js +14 -14
  42. package/src/components/controls/base/DshNumber/BriInputNumber/utils/assist.js +322 -322
  43. package/src/components/controls/base/DshNumber/DshNumber.vue +143 -143
  44. package/src/components/controls/base/DshNumber/DshNumberange.vue +109 -109
  45. package/src/components/controls/base/DshSelect/DshCheckbox.vue +168 -168
  46. package/src/components/controls/base/DshSelect/DshSelect.vue +180 -180
  47. package/src/components/controls/base/DshSwitch/DshSwitch.vue +115 -115
  48. package/src/components/controls/control.less +324 -324
  49. package/src/components/controls/controlMap.js +114 -114
  50. package/src/components/controls/extra/DshColor.vue +81 -81
  51. package/src/components/controls/extra/DshThemeColor.vue +100 -100
  52. package/src/components/controls/extra/DshThemeIcon.vue +122 -122
  53. package/src/components/controls/mixins/cascaderMixin.js +325 -325
  54. package/src/components/controls/mixins/cascaderPickerMixin.js +227 -227
  55. package/src/components/controls/mixins/cascaderTableMixin.js +130 -130
  56. package/src/components/controls/mixins/controlMixin.js +393 -393
  57. package/src/components/controls/mixins/dateMixin.js +149 -149
  58. package/src/components/controls/mixins/flatTableMixin.js +111 -111
  59. package/src/components/controls/mixins/numberMixin.js +112 -112
  60. package/src/components/controls/mixins/selectMixin.js +233 -233
  61. package/src/components/controls/mixins/switchMixin.js +87 -87
  62. package/src/components/controls/mixins/userAndDepartMixin.js +260 -260
  63. package/src/components/controls/senior/DshLabels.vue +333 -333
  64. package/src/components/controls/senior/DshPackage.vue +57 -57
  65. package/src/components/controls/senior/cascaderTable.vue +213 -213
  66. package/src/components/controls/senior/flatTable.vue +138 -138
  67. package/src/components/controls/senior/selectDepartments.vue +399 -399
  68. package/src/components/controls/senior/selectUsers/departMenu.vue +293 -293
  69. package/src/components/controls/senior/selectUsers/selectUsers.vue +712 -712
  70. package/src/components/controls/special/DshBack.vue +42 -42
  71. package/src/components/controls/special/DshUndeveloped.vue +41 -41
  72. package/src/components/form/DshAdvSearch.vue +510 -510
  73. package/src/components/form/DshDefaultSearch.vue +260 -260
  74. package/src/components/form/DshForm.vue +494 -494
  75. package/src/components/form/searchMixin.js +376 -376
  76. package/src/components/list/BriCard.vue +95 -95
  77. package/src/components/list/BriTable.vue +205 -205
  78. package/src/components/list/BriTree.vue +529 -529
  79. package/src/components/list/BriTreeItem.vue +163 -163
  80. package/src/components/list/DshBox/DshBox.vue +219 -219
  81. package/src/components/list/DshBox/DshCard.vue +446 -446
  82. package/src/components/list/DshBox/DshCrossTable.vue +827 -827
  83. package/src/components/list/DshBox/DshList.vue +404 -404
  84. package/src/components/list/DshBox/DshPanel.vue +669 -669
  85. package/src/components/list/DshBox/DshSingleData.vue +119 -119
  86. package/src/components/list/DshBox/DshTable.vue +239 -239
  87. package/src/components/list/DshCascaderTable.vue +115 -115
  88. package/src/components/list/DshFlatTable.vue +337 -337
  89. package/src/components/list/DshPage.vue +194 -194
  90. package/src/components/list/DshTreeTable.vue +113 -113
  91. package/src/components/list/common/importModal.vue +243 -243
  92. package/src/components/list/common/quoteListModal.vue +206 -206
  93. package/src/components/list/mixins/DshCascaderTableMixin.js +278 -278
  94. package/src/components/list/mixins/DshFlatTableMixin.js +509 -509
  95. package/src/components/list/mixins/DshTreeTableMixin.js +286 -286
  96. package/src/components/list/mixins/tableBaseMixin.js +1653 -1653
  97. package/src/components/list/mixins/treeTableBaseMixin.js +145 -145
  98. package/src/components/other/BriAvatar.vue +166 -166
  99. package/src/components/other/BriCode.vue +125 -125
  100. package/src/components/other/BriCollapseTree.vue +207 -207
  101. package/src/components/other/BriGantt.vue +1087 -1087
  102. package/src/components/other/BriIframe.vue +116 -116
  103. package/src/components/other/BriLoading.vue +171 -171
  104. package/src/components/other/BriSvg.vue +27 -27
  105. package/src/components/other/DshColorPanel.vue +128 -128
  106. package/src/components/other/DshMenuNav.vue +188 -188
  107. package/src/components/small/BriButton.vue +71 -71
  108. package/src/components/small/BriDrawer.vue +169 -169
  109. package/src/components/small/BriTooltip.vue +87 -87
  110. package/src/components/small/DshBtnModal.vue +68 -68
  111. package/src/components/small/DshButtons.vue +324 -324
  112. package/src/components/small/DshDropdown.vue +225 -225
  113. package/src/components/small/DshIcons.vue +59 -59
  114. package/src/components/small/DshListRender.js +21 -21
  115. package/src/components/small/DshModal.vue +160 -160
  116. package/src/components/small/DshSteps.vue +141 -141
  117. package/src/components/small/DshTabs.vue +598 -598
  118. package/src/components/small/DshTabsSet.vue +309 -309
  119. package/src/components/small/DshTags.vue +251 -251
  120. package/src/components/small/DshTitle.vue +50 -50
  121. package/src/components/small/render.js +20 -20
  122. package/src/components/unit/DshFormUnit.vue +398 -398
  123. package/src/components/unit/DshListUnit.vue +115 -115
  124. package/src/components/unit/unitMixin.js +86 -86
  125. package/src/data/index.js +4 -4
  126. package/src/index.js +282 -282
  127. package/src/styles/bundle.css +12 -12
  128. package/src/styles/components/BriButton.less +307 -307
  129. package/src/styles/components/BriTable.less +344 -344
  130. package/src/styles/components/DshModal.less +257 -257
  131. package/src/styles/components/index.less +3 -3
  132. package/src/styles/global/animate.less +11 -11
  133. package/src/styles/global/base.less +45 -45
  134. package/src/styles/global/box.less +186 -186
  135. package/src/styles/global/control.less +122 -122
  136. package/src/styles/global/flex.less +282 -282
  137. package/src/styles/global/global.less +8 -8
  138. package/src/styles/global/text.less +59 -59
  139. package/src/styles/global/variables.less +85 -85
  140. package/src/styles/iconfont/iconfont.css +254 -254
  141. package/src/styles/iconfont/iconfont.json +422 -422
  142. package/src/styles/iconfont/iconfont.svg +137 -137
  143. package/src/styles/index.less +26 -26
  144. package/src/styles/reset-easytable.less +21 -21
  145. package/src/styles/reset-iview-controls.less +145 -145
  146. package/src/styles/reset-iview-other.less +49 -49
  147. package/src/styles/reset-iview-variables.less +43 -43
  148. package/src/styles/reset.less +45 -45
  149. package/src/utils/index.js +5 -5
  150. package/src/utils/table.js +175 -175
  151. package/lib/11.bri-components.min.js +0 -1
@@ -1,233 +1,233 @@
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
- };
14
- },
15
- computed: {
16
- basePropsObj () {
17
- return {
18
- _optionKind: "dropdown", // "flat"、"dropdown"
19
-
20
- _saveKey: "_key",
21
- _nameKey: "name",
22
- colorMap: resourceData.colorMap,
23
- _useColor: false,
24
- _filterable: true, // 是否支持搜索
25
- _data: [],
26
- _customData: [],
27
- _reverseFilter: false, // 是否反向过滤,默认正向过滤
28
- _selectFilterVals: [], // 过滤的数据
29
- _selectFilterKey: undefined, // 用作过滤的属性,默认用_saveKey对应的属性
30
-
31
- ...this.propsObj,
32
- ...this.commonDealPropsObj
33
- };
34
- },
35
-
36
- showMode () {
37
- return this.selfPropsObj._optionKind;
38
- },
39
- saveKey () {
40
- return this.selfPropsObj._saveKey;
41
- },
42
- nameKey () {
43
- return this.selfPropsObj._nameKey;
44
- },
45
- colorMap () {
46
- return this.selfPropsObj.colorMap;
47
- },
48
- useColor () {
49
- return this.selfPropsObj._useColor;
50
- },
51
- reverseFilter () {
52
- return this.selfPropsObj._reverseFilter;
53
- },
54
- selectFilterVals () {
55
- return this.selfPropsObj._selectFilterVals || []; // 老版级联表格层级属性那用到单选,缺这些属性,会产生undefined,有问题
56
- },
57
- selectFilterKey () {
58
- return this.selfPropsObj._selectFilterKey || this.saveKey;
59
- },
60
-
61
- listData () {
62
- let listData = this.selfPropsObj._data.concat(this.initListData);
63
- listData = this.selectFilterVals.length
64
- ? listData.filter(item =>
65
- this.reverseFilter
66
- ? !this.selectFilterVals.includes(item[this.selectFilterKey])
67
- : this.selectFilterVals.includes(item[this.selectFilterKey])
68
- )
69
- : listData;
70
- listData = this.$dataType(this.selfPropsObj._filterFunc, "function")
71
- ? this.selfPropsObj._filterFunc(listData, this.selfPropsObj, this.value)
72
- : listData;
73
-
74
- return listData;
75
- },
76
- listDataKeys () {
77
- return this.listData.map(item => item[this.saveKey]);
78
- },
79
- curValObj () {
80
- return this.getItemObj(this.curVal);
81
- },
82
- curValName: {
83
- get () {
84
- return this.curValObj
85
- ? this.curValObj[this.nameKey] || this.curValObj.name || this.curValObj._name
86
- : "";
87
- },
88
- set (val) {
89
- if (!val) {
90
- this.clickClear();
91
- }
92
- }
93
- },
94
- showVal () {
95
- return this.$isEmptyData(this.curVal)
96
- ? this.emptyShowVal
97
- : this.curValName;
98
- },
99
- // 已选择项的对象列表
100
- curValObjList () {
101
- return this.curValList.map((item, index) =>
102
- index < this.curValList.length - 1
103
- ? this.getItemObj(item, { marginRight: "4px" })
104
- : this.getItemObj(item)
105
- );
106
- },
107
- curValNameList () {
108
- return this.curValObjList.map(item => item[this.nameKey] || item.name || item._name);
109
- },
110
- showMulVal () {
111
- return this.$isEmptyData(this.curValList)
112
- ? this.emptyShowVal
113
- : this.curValNameList.join("、");
114
- }
115
- },
116
- created () {
117
- this.selectMixinInit();
118
- },
119
- methods: {
120
- selectMixinInit () {
121
- this.getListData();
122
- },
123
-
124
- // 单选模式 点击选项
125
- clickRadioItem (item, index) {
126
- if (!this.getRadioItemDisabled(item)) {
127
- if (this.curVal === item[this.saveKey]) {
128
- if (this.clearable) {
129
- this.curVal = "";
130
- }
131
- } else {
132
- this.curVal = item[this.saveKey];
133
- }
134
- }
135
- },
136
- // 单选模式 取消选择项
137
- cancelRadioItemSelect (item, index) {
138
- if (this.curVal === item[this.saveKey]) {
139
- this.clickRadioItem(item, index);
140
- }
141
- },
142
- // 多选模式 点击选项
143
- clickCheckItem (item, index) {
144
- if (!this.getCheckItemDisabled(item)) {
145
- this.curValList = this.getItemCheckStatus(item)
146
- ? this.curValList.filter(key => key !== item[this.saveKey])
147
- : [...this.curValList, item[this.saveKey]];
148
- this.curValList = this.curValList.filter(key => this.listDataKeys.includes(key));
149
- }
150
- },
151
-
152
- /* ------- 方法 ------- */
153
- // 获取某项的对象数据
154
- getItemObj (val, selfStyle = {}) {
155
- const obj = this.listData.find(item => item[this.saveKey] === val) || {
156
- [this.saveKey]: val,
157
- [this.nameKey]: `提示:选项${val}已不存在`
158
- };
159
-
160
- return !this.$isEmptyData(val)
161
- ? {
162
- ...obj,
163
- name: obj[this.nameKey] || obj.name || obj._name, // 查看状态时tag用
164
- style: {
165
- ...this.tagStyle,
166
- ...this.getItemColorStyle(obj),
167
- ...selfStyle
168
- }, // 查看状态时tag用
169
- color: undefined
170
- }
171
- : undefined;
172
- },
173
- // 获取某项的选中状态
174
- getItemCheckStatus (item) {
175
- return this.curValList.includes(item[this.saveKey]);
176
- },
177
- // 获取某项的class集合 --flat方式在用
178
- getItemClass (item) {
179
- return [
180
- this.useColor && !(item.color || "").includes("#")
181
- ? this.colorMap[item.color] ? item.color : "color-default"
182
- : undefined,
183
- item.class
184
- ];
185
- },
186
- // 获取某项的颜色相关style --flat方式在用
187
- getItemColorStyle (item) {
188
- const color = (item.color || "").includes("#")
189
- ? item.color
190
- : this.colorMap[item.color] || this.colorMap["color-default"];
191
- return this.useColor
192
- ? {
193
- backgroundColor: this.$getColor(color, 0.1),
194
- color: color
195
- }
196
- : {};
197
- },
198
- // 获取单选项的置灰状态
199
- getRadioItemDisabled (item) {
200
- return !!(
201
- this.disabled ||
202
- item._disabled
203
- );
204
- },
205
- // 获取多选项的置灰状态
206
- getCheckItemDisabled (item) {
207
- return !!(
208
- this.disabled ||
209
- item._disabled ||
210
- (this.curValList.length >= this.selfPropsObj._max && !this.getItemCheckStatus(item))
211
- );
212
- },
213
-
214
- // TODO:待删除 接口 -获取自定义的接口数据
215
- getListData () {
216
- this.selfPropsObj._customData.forEach(item => {
217
- this.$https({
218
- url: item.url,
219
- params: item.params,
220
- callback: data => {
221
- this.initListData = [
222
- ...this.initListData,
223
- ...data.list.map(dataItem => ({
224
- [this.saveKey]: dataItem[this.saveKey],
225
- [this.nameKey]: dataItem[this.nameKey]
226
- }))
227
- ];
228
- }
229
- });
230
- });
231
- }
232
- }
233
- };
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
+ };
14
+ },
15
+ computed: {
16
+ basePropsObj () {
17
+ return {
18
+ _optionKind: "dropdown", // "flat"、"dropdown"
19
+
20
+ _saveKey: "_key",
21
+ _nameKey: "name",
22
+ colorMap: resourceData.colorMap,
23
+ _useColor: false,
24
+ _filterable: true, // 是否支持搜索
25
+ _data: [],
26
+ _customData: [],
27
+ _reverseFilter: false, // 是否反向过滤,默认正向过滤
28
+ _selectFilterVals: [], // 过滤的数据
29
+ _selectFilterKey: undefined, // 用作过滤的属性,默认用_saveKey对应的属性
30
+
31
+ ...this.propsObj,
32
+ ...this.commonDealPropsObj
33
+ };
34
+ },
35
+
36
+ showMode () {
37
+ return this.selfPropsObj._optionKind;
38
+ },
39
+ saveKey () {
40
+ return this.selfPropsObj._saveKey;
41
+ },
42
+ nameKey () {
43
+ return this.selfPropsObj._nameKey;
44
+ },
45
+ colorMap () {
46
+ return this.selfPropsObj.colorMap;
47
+ },
48
+ useColor () {
49
+ return this.selfPropsObj._useColor;
50
+ },
51
+ reverseFilter () {
52
+ return this.selfPropsObj._reverseFilter;
53
+ },
54
+ selectFilterVals () {
55
+ return this.selfPropsObj._selectFilterVals || []; // 老版级联表格层级属性那用到单选,缺这些属性,会产生undefined,有问题
56
+ },
57
+ selectFilterKey () {
58
+ return this.selfPropsObj._selectFilterKey || this.saveKey;
59
+ },
60
+
61
+ listData () {
62
+ let listData = this.selfPropsObj._data.concat(this.initListData);
63
+ listData = this.selectFilterVals.length
64
+ ? listData.filter(item =>
65
+ this.reverseFilter
66
+ ? !this.selectFilterVals.includes(item[this.selectFilterKey])
67
+ : this.selectFilterVals.includes(item[this.selectFilterKey])
68
+ )
69
+ : listData;
70
+ listData = this.$dataType(this.selfPropsObj._filterFunc, "function")
71
+ ? this.selfPropsObj._filterFunc(listData, this.selfPropsObj, this.value)
72
+ : listData;
73
+
74
+ return listData;
75
+ },
76
+ listDataKeys () {
77
+ return this.listData.map(item => item[this.saveKey]);
78
+ },
79
+ curValObj () {
80
+ return this.getItemObj(this.curVal);
81
+ },
82
+ curValName: {
83
+ get () {
84
+ return this.curValObj
85
+ ? this.curValObj[this.nameKey] || this.curValObj.name || this.curValObj._name
86
+ : "";
87
+ },
88
+ set (val) {
89
+ if (!val) {
90
+ this.clickClear();
91
+ }
92
+ }
93
+ },
94
+ showVal () {
95
+ return this.$isEmptyData(this.curVal)
96
+ ? this.emptyShowVal
97
+ : this.curValName;
98
+ },
99
+ // 已选择项的对象列表
100
+ curValObjList () {
101
+ return this.curValList.map((item, index) =>
102
+ index < this.curValList.length - 1
103
+ ? this.getItemObj(item, { marginRight: "4px" })
104
+ : this.getItemObj(item)
105
+ );
106
+ },
107
+ curValNameList () {
108
+ return this.curValObjList.map(item => item[this.nameKey] || item.name || item._name);
109
+ },
110
+ showMulVal () {
111
+ return this.$isEmptyData(this.curValList)
112
+ ? this.emptyShowVal
113
+ : this.curValNameList.join("、");
114
+ }
115
+ },
116
+ created () {
117
+ this.selectMixinInit();
118
+ },
119
+ methods: {
120
+ selectMixinInit () {
121
+ this.getListData();
122
+ },
123
+
124
+ // 单选模式 点击选项
125
+ clickRadioItem (item, index) {
126
+ if (!this.getRadioItemDisabled(item)) {
127
+ if (this.curVal === item[this.saveKey]) {
128
+ if (this.clearable) {
129
+ this.curVal = "";
130
+ }
131
+ } else {
132
+ this.curVal = item[this.saveKey];
133
+ }
134
+ }
135
+ },
136
+ // 单选模式 取消选择项
137
+ cancelRadioItemSelect (item, index) {
138
+ if (this.curVal === item[this.saveKey]) {
139
+ this.clickRadioItem(item, index);
140
+ }
141
+ },
142
+ // 多选模式 点击选项
143
+ clickCheckItem (item, index) {
144
+ if (!this.getCheckItemDisabled(item)) {
145
+ this.curValList = this.getItemCheckStatus(item)
146
+ ? this.curValList.filter(key => key !== item[this.saveKey])
147
+ : [...this.curValList, item[this.saveKey]];
148
+ this.curValList = this.curValList.filter(key => this.listDataKeys.includes(key));
149
+ }
150
+ },
151
+
152
+ /* ------- 方法 ------- */
153
+ // 获取某项的对象数据
154
+ getItemObj (val, selfStyle = {}) {
155
+ const obj = this.listData.find(item => item[this.saveKey] === val) || {
156
+ [this.saveKey]: val,
157
+ [this.nameKey]: `提示:选项${val}已不存在`
158
+ };
159
+
160
+ return !this.$isEmptyData(val)
161
+ ? {
162
+ ...obj,
163
+ name: obj[this.nameKey] || obj.name || obj._name, // 查看状态时tag用
164
+ style: {
165
+ ...this.tagStyle,
166
+ ...this.getItemColorStyle(obj),
167
+ ...selfStyle
168
+ }, // 查看状态时tag用
169
+ color: undefined
170
+ }
171
+ : undefined;
172
+ },
173
+ // 获取某项的选中状态
174
+ getItemCheckStatus (item) {
175
+ return this.curValList.includes(item[this.saveKey]);
176
+ },
177
+ // 获取某项的class集合 --flat方式在用
178
+ getItemClass (item) {
179
+ return [
180
+ this.useColor && !(item.color || "").includes("#")
181
+ ? this.colorMap[item.color] ? item.color : "color-default"
182
+ : undefined,
183
+ item.class
184
+ ];
185
+ },
186
+ // 获取某项的颜色相关style --flat方式在用
187
+ getItemColorStyle (item) {
188
+ const color = (item.color || "").includes("#")
189
+ ? item.color
190
+ : this.colorMap[item.color] || this.colorMap["color-default"];
191
+ return this.useColor
192
+ ? {
193
+ backgroundColor: this.$getColor(color, 0.1),
194
+ color: color
195
+ }
196
+ : {};
197
+ },
198
+ // 获取单选项的置灰状态
199
+ getRadioItemDisabled (item) {
200
+ return !!(
201
+ this.disabled ||
202
+ item._disabled
203
+ );
204
+ },
205
+ // 获取多选项的置灰状态
206
+ getCheckItemDisabled (item) {
207
+ return !!(
208
+ this.disabled ||
209
+ item._disabled ||
210
+ (this.curValList.length >= this.selfPropsObj._max && !this.getItemCheckStatus(item))
211
+ );
212
+ },
213
+
214
+ // TODO:待删除 接口 -获取自定义的接口数据
215
+ getListData () {
216
+ this.selfPropsObj._customData.forEach(item => {
217
+ this.$https({
218
+ url: item.url,
219
+ params: item.params,
220
+ callback: data => {
221
+ this.initListData = [
222
+ ...this.initListData,
223
+ ...data.list.map(dataItem => ({
224
+ [this.saveKey]: dataItem[this.saveKey],
225
+ [this.nameKey]: dataItem[this.nameKey]
226
+ }))
227
+ ];
228
+ }
229
+ });
230
+ });
231
+ }
232
+ }
233
+ };
@@ -1,87 +1,87 @@
1
- import controlMixin from "./controlMixin.js";
2
- import DshCheckbox from "../base/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
- basePropsObj () {
17
- return {
18
- loading: false, // 是否为加载状态
19
- _openValue: true, // 打开时对应的值
20
- _closeValue: false, // 关闭时对应的值
21
-
22
- ...this.propsObj,
23
- ...this.commonDealPropsObj,
24
-
25
- _openText: this.propsObj._openText || "是", // 此行放在 ...this.propsObj的下面目的是,处理_openText为空字符串的情况
26
- _closeText: this.propsObj._closeText || "否",
27
- _openColor: this.propsObj._openColor || this.controlThemeColor, // 打开时的背景色
28
- _closeColor: this.propsObj._closeColor || "#aaaaaa" // 关闭时的背景色
29
- };
30
- },
31
- openText () {
32
- return this.selfPropsObj._openText;
33
- },
34
- closeText () {
35
- return this.selfPropsObj._closeText;
36
- },
37
- openColor () {
38
- return this.selfPropsObj._openColor;
39
- },
40
- closeColor () {
41
- return this.selfPropsObj._closeColor;
42
- },
43
- mulPropsObj () {
44
- return {
45
- _optionKind: "flat",
46
- _data: [
47
- {
48
- _key: "true",
49
- name: this.openText,
50
- color: this.openColor
51
- },
52
- {
53
- _key: "false",
54
- name: this.closeText,
55
- color: this.closeColor
56
- }
57
- ],
58
-
59
- ...this.propsObj
60
- };
61
- },
62
-
63
- curValObj () {
64
- const color = this.curVal === true ? this.openColor : this.closeColor;
65
- return !this.$isEmptyData(this.curVal)
66
- ? {
67
- _key: "1",
68
- name: this.showVal,
69
- style: {
70
- ...this.tagStyle,
71
- backgroundColor: this.$getColor(color, 0.1),
72
- color: color
73
- }
74
- }
75
- : undefined;
76
- },
77
- showVal () {
78
- return this.$isEmptyData(this.curVal)
79
- ? this.emptyShowVal
80
- : this.curVal === true
81
- ? this.openText
82
- : this.closeText;
83
- }
84
- },
85
- created () { },
86
- methods: {}
87
- };
1
+ import controlMixin from "./controlMixin.js";
2
+ import DshCheckbox from "../base/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
+ basePropsObj () {
17
+ return {
18
+ loading: false, // 是否为加载状态
19
+ _openValue: true, // 打开时对应的值
20
+ _closeValue: false, // 关闭时对应的值
21
+
22
+ ...this.propsObj,
23
+ ...this.commonDealPropsObj,
24
+
25
+ _openText: this.propsObj._openText || "是", // 此行放在 ...this.propsObj的下面目的是,处理_openText为空字符串的情况
26
+ _closeText: this.propsObj._closeText || "否",
27
+ _openColor: this.propsObj._openColor || this.controlThemeColor, // 打开时的背景色
28
+ _closeColor: this.propsObj._closeColor || "#aaaaaa" // 关闭时的背景色
29
+ };
30
+ },
31
+ openText () {
32
+ return this.selfPropsObj._openText;
33
+ },
34
+ closeText () {
35
+ return this.selfPropsObj._closeText;
36
+ },
37
+ openColor () {
38
+ return this.selfPropsObj._openColor;
39
+ },
40
+ closeColor () {
41
+ return this.selfPropsObj._closeColor;
42
+ },
43
+ mulPropsObj () {
44
+ return {
45
+ _optionKind: "flat",
46
+ _data: [
47
+ {
48
+ _key: "true",
49
+ name: this.openText,
50
+ color: this.openColor
51
+ },
52
+ {
53
+ _key: "false",
54
+ name: this.closeText,
55
+ color: this.closeColor
56
+ }
57
+ ],
58
+
59
+ ...this.propsObj
60
+ };
61
+ },
62
+
63
+ curValObj () {
64
+ const color = this.curVal === true ? this.openColor : this.closeColor;
65
+ return !this.$isEmptyData(this.curVal)
66
+ ? {
67
+ _key: "1",
68
+ name: this.showVal,
69
+ style: {
70
+ ...this.tagStyle,
71
+ backgroundColor: this.$getColor(color, 0.1),
72
+ color: color
73
+ }
74
+ }
75
+ : undefined;
76
+ },
77
+ showVal () {
78
+ return this.$isEmptyData(this.curVal)
79
+ ? this.emptyShowVal
80
+ : this.curVal === true
81
+ ? this.openText
82
+ : this.closeText;
83
+ }
84
+ },
85
+ created () { },
86
+ methods: {}
87
+ };