bri-components 1.4.93 → 1.4.94

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 (156) hide show
  1. package/README.md +83 -83
  2. package/lib/0.bri-components.min.js +1 -0
  3. package/lib/1.bri-components.min.js +1 -0
  4. package/lib/10.bri-components.min.js +1 -0
  5. package/lib/11.bri-components.min.js +1 -0
  6. package/lib/2.bri-components.min.js +1 -0
  7. package/lib/3.bri-components.min.js +1 -0
  8. package/lib/4.bri-components.min.js +1 -0
  9. package/lib/5.bri-components.min.js +1 -0
  10. package/lib/6.bri-components.min.js +1 -0
  11. package/lib/7.bri-components.min.js +1 -0
  12. package/lib/8.bri-components.min.js +1 -0
  13. package/lib/9.bri-components.min.js +1 -0
  14. package/lib/bri-components.min.js +18 -0
  15. package/lib/styles/bundle.css +12 -12
  16. package/lib/styles/font/fontello.svg +31 -31
  17. package/package.json +125 -125
  18. package/src/.DS_Store +0 -0
  19. package/src/components/.DS_Store +0 -0
  20. package/src/components/Error/Error403.vue +42 -42
  21. package/src/components/Error/Error404.vue +40 -40
  22. package/src/components/Error/Error500.vue +51 -51
  23. package/src/components/Error/error.less +162 -162
  24. package/src/components/Error/errorBack.vue +40 -40
  25. package/src/components/controls/.DS_Store +0 -0
  26. package/src/components/controls/DshControlInput.vue +195 -195
  27. package/src/components/controls/base/BriUpload/BriUpload.vue +434 -434
  28. package/src/components/controls/base/BriUpload/BriUploadImage.vue +373 -373
  29. package/src/components/controls/base/BriUpload/uploadList.vue +724 -724
  30. package/src/components/controls/base/BriUpload/uploadMixin.js +446 -446
  31. package/src/components/controls/base/DshCascader/DshCascader.vue +210 -210
  32. package/src/components/controls/base/DshCascader/components/cascaderModal.vue +366 -366
  33. package/src/components/controls/base/DshCascader/components/cascaderPicker.vue +416 -416
  34. package/src/components/controls/base/DshCascader/components/cascaderSimple.vue +143 -143
  35. package/src/components/controls/base/DshCoordinates.vue +577 -577
  36. package/src/components/controls/base/DshDate/DshDate.vue +191 -191
  37. package/src/components/controls/base/DshDate/DshDaterange.vue +186 -186
  38. package/src/components/controls/base/DshDivider.vue +201 -201
  39. package/src/components/controls/base/DshEditor.vue +274 -274
  40. package/src/components/controls/base/DshInput/BriInputs.vue +166 -166
  41. package/src/components/controls/base/DshInput/DshInput.vue +255 -255
  42. package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +435 -435
  43. package/src/components/controls/base/DshNumber/BriInputNumber/mixins/emitter.js +34 -34
  44. package/src/components/controls/base/DshNumber/BriInputNumber/mixins/form.js +14 -14
  45. package/src/components/controls/base/DshNumber/BriInputNumber/utils/assist.js +322 -322
  46. package/src/components/controls/base/DshNumber/DshNumber.vue +143 -143
  47. package/src/components/controls/base/DshNumber/DshNumberange.vue +109 -109
  48. package/src/components/controls/base/DshSelect/DshCheckbox.vue +168 -168
  49. package/src/components/controls/base/DshSelect/DshSelect.vue +180 -180
  50. package/src/components/controls/base/DshSwitch/DshSwitch.vue +115 -115
  51. package/src/components/controls/control.less +324 -324
  52. package/src/components/controls/controlMap.js +114 -114
  53. package/src/components/controls/extra/DshColor.vue +81 -81
  54. package/src/components/controls/extra/themeColor.vue +104 -104
  55. package/src/components/controls/extra/themeIcon.vue +114 -114
  56. package/src/components/controls/mixins/cascaderMixin.js +295 -295
  57. package/src/components/controls/mixins/cascaderPickerMixin.js +216 -216
  58. package/src/components/controls/mixins/cascaderTableMixin.js +130 -130
  59. package/src/components/controls/mixins/controlMixin.js +368 -368
  60. package/src/components/controls/mixins/dateMixin.js +149 -149
  61. package/src/components/controls/mixins/flatTableMixin.js +111 -111
  62. package/src/components/controls/mixins/numberMixin.js +112 -112
  63. package/src/components/controls/mixins/selectMixin.js +233 -233
  64. package/src/components/controls/mixins/switchMixin.js +87 -87
  65. package/src/components/controls/mixins/userAndDepartMixin.js +218 -218
  66. package/src/components/controls/senior/.DS_Store +0 -0
  67. package/src/components/controls/senior/DshLabels.vue +331 -331
  68. package/src/components/controls/senior/DshPackage.vue +57 -57
  69. package/src/components/controls/senior/cascaderTable.vue +210 -210
  70. package/src/components/controls/senior/flatTable.vue +135 -135
  71. package/src/components/controls/senior/selectDepartments.vue +438 -438
  72. package/src/components/controls/senior/selectUsers/departMenu.vue +293 -293
  73. package/src/components/controls/senior/selectUsers/selectUsers.vue +752 -752
  74. package/src/components/controls/special/DshBack.vue +42 -42
  75. package/src/components/controls/special/DshUndeveloped.vue +41 -41
  76. package/src/components/form/DshAdvSearch.vue +510 -510
  77. package/src/components/form/DshDefaultSearch.vue +258 -258
  78. package/src/components/form/DshForm.vue +494 -494
  79. package/src/components/form/searchMixin.js +375 -375
  80. package/src/components/list/BriCard.vue +95 -95
  81. package/src/components/list/BriTable.vue +205 -205
  82. package/src/components/list/BriTree.vue +529 -529
  83. package/src/components/list/BriTreeItem.vue +163 -163
  84. package/src/components/list/DshBox/DshBox.vue +219 -219
  85. package/src/components/list/DshBox/DshCard.vue +446 -446
  86. package/src/components/list/DshBox/DshCrossTable.vue +827 -827
  87. package/src/components/list/DshBox/DshList.vue +404 -404
  88. package/src/components/list/DshBox/DshPanel.vue +669 -669
  89. package/src/components/list/DshBox/DshSingleData.vue +119 -119
  90. package/src/components/list/DshBox/DshTable.vue +239 -239
  91. package/src/components/list/DshCascaderTable.vue +115 -115
  92. package/src/components/list/DshFlatTable.vue +339 -339
  93. package/src/components/list/DshPage.vue +194 -194
  94. package/src/components/list/DshTreeTable.vue +113 -113
  95. package/src/components/list/common/importModal.vue +243 -243
  96. package/src/components/list/common/quoteListModal.vue +206 -206
  97. package/src/components/list/mixins/DshCascaderTableMixin.js +278 -278
  98. package/src/components/list/mixins/DshFlatTableMixin.js +493 -493
  99. package/src/components/list/mixins/DshTreeTableMixin.js +286 -286
  100. package/src/components/list/mixins/tableBaseMixin.js +1661 -1661
  101. package/src/components/list/mixins/treeTableBaseMixin.js +149 -149
  102. package/src/components/other/BriAvatar.vue +166 -166
  103. package/src/components/other/BriCode.vue +125 -125
  104. package/src/components/other/BriCollapseTree.vue +207 -207
  105. package/src/components/other/BriGantt.vue +1084 -1084
  106. package/src/components/other/BriIframe.vue +116 -116
  107. package/src/components/other/BriLoading.vue +171 -171
  108. package/src/components/other/BriSvg.vue +28 -28
  109. package/src/components/other/DshColorPanel.vue +128 -128
  110. package/src/components/other/DshMenuNav.vue +188 -188
  111. package/src/components/small/BriButton.vue +71 -71
  112. package/src/components/small/BriDrawer.vue +169 -169
  113. package/src/components/small/BriTooltip.vue +87 -87
  114. package/src/components/small/DshBtnModal.vue +68 -68
  115. package/src/components/small/DshButtons.vue +324 -324
  116. package/src/components/small/DshDropdown.vue +225 -225
  117. package/src/components/small/DshIcons.vue +59 -59
  118. package/src/components/small/DshListRender.js +21 -21
  119. package/src/components/small/DshModal.vue +160 -160
  120. package/src/components/small/DshSteps.vue +141 -141
  121. package/src/components/small/DshTabs.vue +598 -598
  122. package/src/components/small/DshTabsSet.vue +309 -309
  123. package/src/components/small/DshTags.vue +251 -251
  124. package/src/components/small/DshTitle.vue +50 -50
  125. package/src/components/small/render.js +20 -20
  126. package/src/components/unit/DshFormUnit.vue +398 -398
  127. package/src/components/unit/DshListUnit.vue +115 -115
  128. package/src/components/unit/unitMixin.js +86 -86
  129. package/src/data/index.js +9 -9
  130. package/src/index.js +271 -271
  131. package/src/styles/.DS_Store +0 -0
  132. package/src/styles/bundle.css +12 -12
  133. package/src/styles/components/.DS_Store +0 -0
  134. package/src/styles/components/BriButton.less +292 -292
  135. package/src/styles/components/BriTable.less +344 -344
  136. package/src/styles/components/DshModal.less +257 -250
  137. package/src/styles/components/index.less +3 -3
  138. package/src/styles/global/animate.less +11 -11
  139. package/src/styles/global/base.less +45 -45
  140. package/src/styles/global/box.less +186 -186
  141. package/src/styles/global/control.less +122 -122
  142. package/src/styles/global/flex.less +282 -282
  143. package/src/styles/global/global.less +8 -8
  144. package/src/styles/global/text.less +59 -59
  145. package/src/styles/global/variables.less +85 -85
  146. package/src/styles/iconfont/iconfont.css +254 -254
  147. package/src/styles/iconfont/iconfont.json +422 -422
  148. package/src/styles/iconfont/iconfont.svg +137 -137
  149. package/src/styles/index.less +11 -11
  150. package/src/styles/reset-easytable.less +21 -21
  151. package/src/styles/reset-iview-controls.less +145 -145
  152. package/src/styles/reset-iview-other.less +49 -49
  153. package/src/styles/reset-iview-variables.less +34 -34
  154. package/src/styles/reset.less +45 -45
  155. package/src/utils/index.js +5 -5
  156. package/src/utils/table.js +175 -175
@@ -1,368 +1,368 @@
1
- export default {
2
- props: {
3
- canEdit: {
4
- type: Boolean,
5
- default: true
6
- },
7
- value: {
8
- type: Object,
9
- default () {
10
- return {};
11
- }
12
- },
13
- propsObj: {
14
- type: Object,
15
- default () {
16
- return {};
17
- }
18
- },
19
- // 暂时是dshDate里在用,时间对比时需要用其他时间字段
20
- allFormList: {
21
- type: Array,
22
- default () {
23
- return [];
24
- }
25
- },
26
-
27
- /* 表格字段内用到的 */
28
- inTableType: {
29
- type: String,
30
- validator (val) {
31
- return ["flatTable", "treeTable", "cascaderTable"].includes(val);
32
- }
33
- },
34
- allListRows: {
35
- type: Array,
36
- default () {
37
- return [];
38
- }
39
- },
40
- rowIndex: Number,
41
- parentObj: {
42
- type: Object,
43
- default () {
44
- return {};
45
- }
46
- },
47
- parentFormList: {
48
- type: Array,
49
- default () {
50
- return [];
51
- }
52
- }
53
- },
54
- data () {
55
- return {
56
- showModal: false,
57
- showUnitModal: false,
58
-
59
- tagStyle: {
60
- display: "inline-block",
61
- "max-width": "100%",
62
- height: "24px",
63
- "min-height": "24px",
64
- padding: "4px 8px",
65
- margin: "2px 0px",
66
- "border-radius": "4px",
67
- "line-height": "16px",
68
- "font-size": "12px",
69
-
70
- backgroundColor: "#E5E5E5",
71
- color: "rgb(0, 0, 0, 0.9)"
72
- }
73
- };
74
- },
75
- computed: {
76
- typeInfoData () {
77
- return this.$modFieldMap[this.controlType] || {};
78
- },
79
- unitModalPropsObj () {
80
- return {
81
- mode: "fullscreen",
82
- title: this.controlName
83
- };
84
- },
85
-
86
- /* ----- 基本 ----- */
87
- finalCanEdit () {
88
- return this.canEdit && (this.propsObj.canEdit == undefined ? true : this.propsObj.canEdit);
89
- },
90
- controlKey () {
91
- return this.propsObj._key;
92
- },
93
- // 字段的真实key
94
- fieldKey () {
95
- return this.isDftSet
96
- ? this.value._key
97
- : (this.propsObj.__realKey__ || this.controlKey);
98
- },
99
- controlType () {
100
- return this.propsObj._type;
101
- },
102
- controlName () {
103
- return this.propsObj._name;
104
- },
105
- commonDealPropsObj () {
106
- const selectControlTypes = [
107
- "date", "daterange", "switch", "select", "checkbox", "region", "regions", "cascader", "cascaders",
108
- "file", "coordinates", "users", "departments", "reference"
109
- ];
110
- return {
111
- _placeholder: this.canEdit && this.propsObj._enterType !== "calculate" && this.propsObj._disabled !== true && this.propsObj._readonly !== true
112
- ? (this.propsObj._placeholder || `${selectControlTypes.includes(this.controlType) ? "选择" : "输入"}${this.propsObj._name}`)
113
- : "",
114
- _clearable: this.finalCanEdit && !this.propsObj._disabled && !this.propsObj._readonly && (this.propsObj._clearable === undefined ? true : this.propsObj._clearable),
115
- _disabled: !(this.finalCanEdit && !this.propsObj._disabled && !this.propsObj._readonly),
116
- // 目前部门、用户在用,以后还会增多
117
- _useDeleteTip: this.isInDftSearch || this.isInSearch
118
- ? false
119
- : this.propsObj._useDeleteTip == undefined
120
- ? false
121
- : this.propsObj._useDeleteTip // 删除项进行提示(筛选下删除项不提示)
122
- };
123
- },
124
- // 是否为多选模式
125
- multipleMode () {
126
- return this.isInDftSearch || this.isInSearch
127
- ? true
128
- : ["numberange", "daterange", "checkbox", "regions", "cascaders", "labels", "refCheckbox"].includes(this.controlType)
129
- ? true
130
- : !!this.selfPropsObj && !!this.selfPropsObj._multiple;
131
- },
132
- // 是否高度自由(在表格内且_heightAuto为true,2.详情页内且独占一行)
133
- isHeightAuto () {
134
- return this.isInTable
135
- ? !!this.propsObj._heightAuto
136
- : this.isFullRow;
137
- },
138
- // 是否为tag显示
139
- isTagShow () {
140
- return ["switch", "select", "checkbox", "regions", "cascaders", "users", "departments", "labels", "refSelect", "refCheckbox"].includes(this.controlType);
141
- },
142
-
143
- /* ----- 表单相关 ----- */
144
- clearable () {
145
- return this.commonDealPropsObj._clearable;
146
- },
147
- disabled () {
148
- return this.commonDealPropsObj._disabled;
149
- },
150
- // 单独一行
151
- isFullRow () {
152
- return this.propsObj._span === 24 || !this.propsObj._span;
153
- },
154
- // 查看页下的展示模式
155
- showStatusMode () {
156
- return this.propsObj.showStatusMode || "defaut"; // "default", "frame", "backdrop"
157
- },
158
- commonClass () {
159
- return {
160
- "bri-control-edit": this.canEdit && !this.disabled,
161
- "bri-control-disabled": this.canEdit && this.disabled,
162
- "bri-control-unit": this.isUnitShow,
163
- "bri-control-show": this.isDetailShow,
164
- [`control-show-${this.showStatusMode}${this.isTagShow ? "-tag" : ""}`]: this.isDetailShow,
165
- "dsh-ellipsis": this.isUnitShow,
166
- "bri-control-nodata": this.$isEmptyData(this.curVal)
167
- };
168
- },
169
-
170
- /* ----- 单元格相关 ----- */
171
- unitAlign () {
172
- return this.propsObj._align || this.typeInfoData.align || "left"; // "left", "center", "right"
173
- },
174
-
175
- /* ----- 部分条件下 才使用的属性 ----- */
176
- // isShare () {
177
- // return !!this.propsObj.isShare;
178
- // },
179
- // 是否在设置默认值下
180
- isDftSet () {
181
- return this.controlKey === "_default";
182
- },
183
- // 在单元格内
184
- isInTable () {
185
- return !!this.propsObj.inTable;
186
- },
187
- // 单条关联内 使用详情模式的
188
- isInRefDetail () {
189
- return !!this.propsObj.inRefDetail;
190
- },
191
- // 高级搜索状态
192
- isInSearch () {
193
- return !!this.propsObj.inSearch;
194
- },
195
- // 默认搜索状态
196
- isInDftSearch () {
197
- return !!this.propsObj.inDftSearch;
198
- },
199
- isUnitUpdate () {
200
- return this.isInTable && !!this.canEdit;
201
- },
202
- isUnitShow () {
203
- return this.isInTable && !this.canEdit;
204
- },
205
- isDetailUpdate () {
206
- return !this.isInTable && !!this.canEdit;
207
- },
208
- isDetailShow () {
209
- return !this.isInTable && !this.canEdit;
210
- },
211
-
212
- /* ----- 部分控件下 才使用的属性 ----- */
213
- compKey () {
214
- return this.propsObj.compKey;
215
- },
216
- appKey () {
217
- return this.propsObj.appKey;
218
- },
219
- entityKey () {
220
- return this.propsObj.entityKey;
221
- },
222
- modKey () {
223
- return this.propsObj.modKey;
224
- },
225
- screenKey () {
226
- return this.propsObj.screenKey;
227
- },
228
- allScreenKey () {
229
- return this.propsObj.allScreenKey;
230
- },
231
-
232
- /* ----- 移动端在用 ----- */
233
- // 只做校验而隐藏的的field框,所用的propsObj
234
- ruleFieldPropsObj () {
235
- return {
236
- _rules: this.propsObj._rules
237
- };
238
- },
239
- // 只做校验而隐藏的的field框,所用的value
240
- ruleFieldStr () {
241
- return this.$isEmptyData(this.curVal) && this.$isEmptyData(this.curValList)
242
- ? ""
243
- : "有值";
244
- },
245
-
246
- /* ----- 值 ----- */
247
- // 值为不是[]类型用的
248
- curVal: {
249
- get () {
250
- // // 原选项变动了或选项动态改变时,过滤掉已不存在的选项值
251
- // if (!this.isInTable) {
252
- // if (["select"].includes(this.controlType)) {
253
- // if (!this.$dataType(this.propsObj._filterFunc, "function")) {
254
- // this.value[this.controlKey] = this.listData.some(item => item[this.saveKey] === this.value[this.controlKey])
255
- // ? this.value[this.controlKey]
256
- // : "";
257
- // }
258
- // }
259
- // }
260
-
261
- return this.value[this.controlKey];
262
- },
263
- set (val) {
264
- // 修复文本框clear后值为undefined,后端无法更新保存数据bug
265
- if (["select"].includes(this.controlType) && val === undefined) {
266
- val = "";
267
- }
268
-
269
- this.$set(this.value, this.controlKey, val);
270
- this.change();
271
- }
272
- },
273
- // 值为[]类型用的
274
- curValList: {
275
- get () {
276
- // // 原选项变动了或选项动态改变时,过滤掉已不存在的选项值
277
- // if (!this.isInTable) {
278
- // const valList = this.value[this.controlKey] || [];
279
- // if ((["select"].includes(this.controlType) && this.multipleMode) || ["checkbox"].includes(this.controlType)) {
280
- // this.value[this.controlKey] = valList.some(valKey => !this.listDataKeys.includes(valKey))
281
- // ? valList.filter(valKey => this.listDataKeys.includes(valKey))
282
- // : valList;
283
- // }
284
- // // else if (["region", "cascader"].includes(this.controlType)) {
285
- // // this.value[this.controlKey] = this.$getTreeLinealDatas(valList, this.cascaderAllData, undefined, this.saveKey).length
286
- // // ? valList
287
- // // : [];
288
- // // }
289
- // // else if (["regions", "cascaders"].includes(this.controlType)) {
290
- // // this.value[this.controlKey] = valList.filter(valListItem =>
291
- // // this.$getTreeLinealDatas(valListItem, this.cascaderAllData, undefined, this.saveKey).length
292
- // // );
293
- // // }
294
- // }
295
-
296
- return this.value[this.controlKey] || [];
297
- },
298
- set (valList) {
299
- this.$set(this.value, this.controlKey, valList);
300
- this.change();
301
- }
302
- },
303
- emptyShowVal () {
304
- return this.canEdit
305
- ? this.commonDealPropsObj._placeholder
306
- : this.isUnitShow
307
- ? "--"
308
- : "暂无内容";
309
- },
310
- showVal () {
311
- return this.$isEmptyData(this.curVal)
312
- ? this.emptyShowVal
313
- : this.curVal;
314
- }
315
- },
316
- methods: {
317
- change (...params) {
318
- this.$emit("change", this.value[this.controlKey]);
319
- },
320
- refChange (...params) {
321
- this.$emit("refChange", this.value[this.controlKey]);
322
- },
323
- quickChange (...params) {
324
- this.$emit("quickChange", this.value[this.controlKey]);
325
- },
326
-
327
- // 点击输入框
328
- clickInput () {
329
- if (!this.disabled) {
330
- this.openModal();
331
- }
332
- },
333
- // 点击清除
334
- clickClear () {
335
- if (this.controlType === "coordinates") {
336
- this.curVal = {
337
- name: "",
338
- lnglat: []
339
- };
340
- }
341
- else if (this.typeInfoData.dataType === "array" || this.multipleMode) {
342
- this.curValList = [];
343
- } else {
344
- this.curVal = "";
345
- }
346
- },
347
-
348
- /* ----- 工具方法 ------- */
349
- // 切换弹框
350
- toggleModal (bool) {
351
- this.showModal = bool;
352
- },
353
- // 打开弹框 ---!!!!pc端的selectUsers、selectDepartments控件,外部调用组件时也在使用,不能轻易删除
354
- openModal () {
355
- this.showModal = true;
356
- },
357
- // 关闭弹框 ---!!!!pc端的selectUsers、selectDepartments控件,外部调用组件时也在使用,不能轻易删除
358
- closeModal () {
359
- this.showModal = false;
360
- },
361
-
362
- // 单元格展示 -打开列表模态框
363
- openUnitModal (event) {
364
- this.showUnitModal = true;
365
- event.stopPropagation();
366
- }
367
- }
368
- };
1
+ export default {
2
+ props: {
3
+ canEdit: {
4
+ type: Boolean,
5
+ default: true
6
+ },
7
+ value: {
8
+ type: Object,
9
+ default () {
10
+ return {};
11
+ }
12
+ },
13
+ propsObj: {
14
+ type: Object,
15
+ default () {
16
+ return {};
17
+ }
18
+ },
19
+ // 暂时是dshDate里在用,时间对比时需要用其他时间字段
20
+ allFormList: {
21
+ type: Array,
22
+ default () {
23
+ return [];
24
+ }
25
+ },
26
+
27
+ /* 表格字段内用到的 */
28
+ inTableType: {
29
+ type: String,
30
+ validator (val) {
31
+ return ["flatTable", "treeTable", "cascaderTable"].includes(val);
32
+ }
33
+ },
34
+ allListRows: {
35
+ type: Array,
36
+ default () {
37
+ return [];
38
+ }
39
+ },
40
+ rowIndex: Number,
41
+ parentObj: {
42
+ type: Object,
43
+ default () {
44
+ return {};
45
+ }
46
+ },
47
+ parentFormList: {
48
+ type: Array,
49
+ default () {
50
+ return [];
51
+ }
52
+ }
53
+ },
54
+ data () {
55
+ return {
56
+ showModal: false,
57
+ showUnitModal: false,
58
+
59
+ tagStyle: {
60
+ display: "inline-block",
61
+ "max-width": "100%",
62
+ height: "24px",
63
+ "min-height": "24px",
64
+ padding: "4px 8px",
65
+ margin: "2px 0px",
66
+ "border-radius": "4px",
67
+ "line-height": "16px",
68
+ "font-size": "12px",
69
+
70
+ backgroundColor: "#E5E5E5",
71
+ color: "rgb(0, 0, 0, 0.9)"
72
+ }
73
+ };
74
+ },
75
+ computed: {
76
+ typeInfoData () {
77
+ return this.$modFieldMap[this.controlType] || {};
78
+ },
79
+ unitModalPropsObj () {
80
+ return {
81
+ mode: "fullscreen",
82
+ title: this.controlName
83
+ };
84
+ },
85
+
86
+ /* ----- 基本 ----- */
87
+ finalCanEdit () {
88
+ return this.canEdit && (this.propsObj.canEdit == undefined ? true : this.propsObj.canEdit);
89
+ },
90
+ controlKey () {
91
+ return this.propsObj._key;
92
+ },
93
+ // 字段的真实key
94
+ fieldKey () {
95
+ return this.isDftSet
96
+ ? this.value._key
97
+ : (this.propsObj.__realKey__ || this.controlKey);
98
+ },
99
+ controlType () {
100
+ return this.propsObj._type;
101
+ },
102
+ controlName () {
103
+ return this.propsObj._name;
104
+ },
105
+ commonDealPropsObj () {
106
+ const selectControlTypes = [
107
+ "date", "daterange", "switch", "select", "checkbox", "region", "regions", "cascader", "cascaders",
108
+ "file", "coordinates", "users", "departments", "reference"
109
+ ];
110
+ return {
111
+ _placeholder: this.canEdit && this.propsObj._enterType !== "calculate" && this.propsObj._disabled !== true && this.propsObj._readonly !== true
112
+ ? (this.propsObj._placeholder || `${selectControlTypes.includes(this.controlType) ? "选择" : "输入"}${this.propsObj._name}`)
113
+ : "",
114
+ _clearable: this.finalCanEdit && !this.propsObj._disabled && !this.propsObj._readonly && (this.propsObj._clearable === undefined ? true : this.propsObj._clearable),
115
+ _disabled: !(this.finalCanEdit && !this.propsObj._disabled && !this.propsObj._readonly),
116
+ // 目前部门、用户在用,以后还会增多
117
+ _useDeleteTip: this.isInDftSearch || this.isInSearch
118
+ ? false
119
+ : this.propsObj._useDeleteTip == undefined
120
+ ? false
121
+ : this.propsObj._useDeleteTip // 删除项进行提示(筛选下删除项不提示)
122
+ };
123
+ },
124
+ // 是否为多选模式
125
+ multipleMode () {
126
+ return this.isInDftSearch || this.isInSearch
127
+ ? true
128
+ : ["numberange", "daterange", "checkbox", "regions", "cascaders", "labels", "refCheckbox"].includes(this.controlType)
129
+ ? true
130
+ : !!this.selfPropsObj && !!this.selfPropsObj._multiple;
131
+ },
132
+ // 是否高度自由(在表格内且_heightAuto为true,2.详情页内且独占一行)
133
+ isHeightAuto () {
134
+ return this.isInTable
135
+ ? !!this.propsObj._heightAuto
136
+ : this.isFullRow;
137
+ },
138
+ // 是否为tag显示
139
+ isTagShow () {
140
+ return ["switch", "select", "checkbox", "regions", "cascaders", "users", "departments", "labels", "refSelect", "refCheckbox"].includes(this.controlType);
141
+ },
142
+
143
+ /* ----- 表单相关 ----- */
144
+ clearable () {
145
+ return this.commonDealPropsObj._clearable;
146
+ },
147
+ disabled () {
148
+ return this.commonDealPropsObj._disabled;
149
+ },
150
+ // 单独一行
151
+ isFullRow () {
152
+ return this.propsObj._span === 24 || !this.propsObj._span;
153
+ },
154
+ // 查看页下的展示模式
155
+ showStatusMode () {
156
+ return this.propsObj.showStatusMode || "defaut"; // "default", "frame", "backdrop"
157
+ },
158
+ commonClass () {
159
+ return {
160
+ "bri-control-edit": this.canEdit && !this.disabled,
161
+ "bri-control-disabled": this.canEdit && this.disabled,
162
+ "bri-control-unit": this.isUnitShow,
163
+ "bri-control-show": this.isDetailShow,
164
+ [`control-show-${this.showStatusMode}${this.isTagShow ? "-tag" : ""}`]: this.isDetailShow,
165
+ "dsh-ellipsis": this.isUnitShow,
166
+ "bri-control-nodata": this.$isEmptyData(this.curVal)
167
+ };
168
+ },
169
+
170
+ /* ----- 单元格相关 ----- */
171
+ unitAlign () {
172
+ return this.propsObj._align || this.typeInfoData.align || "left"; // "left", "center", "right"
173
+ },
174
+
175
+ /* ----- 部分条件下 才使用的属性 ----- */
176
+ // isShare () {
177
+ // return !!this.propsObj.isShare;
178
+ // },
179
+ // 是否在设置默认值下
180
+ isDftSet () {
181
+ return this.controlKey === "_default";
182
+ },
183
+ // 在单元格内
184
+ isInTable () {
185
+ return !!this.propsObj.inTable;
186
+ },
187
+ // 单条关联内 使用详情模式的
188
+ isInRefDetail () {
189
+ return !!this.propsObj.inRefDetail;
190
+ },
191
+ // 高级搜索状态
192
+ isInSearch () {
193
+ return !!this.propsObj.inSearch;
194
+ },
195
+ // 默认搜索状态
196
+ isInDftSearch () {
197
+ return !!this.propsObj.inDftSearch;
198
+ },
199
+ isUnitUpdate () {
200
+ return this.isInTable && !!this.canEdit;
201
+ },
202
+ isUnitShow () {
203
+ return this.isInTable && !this.canEdit;
204
+ },
205
+ isDetailUpdate () {
206
+ return !this.isInTable && !!this.canEdit;
207
+ },
208
+ isDetailShow () {
209
+ return !this.isInTable && !this.canEdit;
210
+ },
211
+
212
+ /* ----- 部分控件下 才使用的属性 ----- */
213
+ compKey () {
214
+ return this.propsObj.compKey;
215
+ },
216
+ appKey () {
217
+ return this.propsObj.appKey;
218
+ },
219
+ entityKey () {
220
+ return this.propsObj.entityKey;
221
+ },
222
+ modKey () {
223
+ return this.propsObj.modKey;
224
+ },
225
+ screenKey () {
226
+ return this.propsObj.screenKey;
227
+ },
228
+ allScreenKey () {
229
+ return this.propsObj.allScreenKey;
230
+ },
231
+
232
+ /* ----- 移动端在用 ----- */
233
+ // 只做校验而隐藏的的field框,所用的propsObj
234
+ ruleFieldPropsObj () {
235
+ return {
236
+ _rules: this.propsObj._rules
237
+ };
238
+ },
239
+ // 只做校验而隐藏的的field框,所用的value
240
+ ruleFieldStr () {
241
+ return this.$isEmptyData(this.curVal) && this.$isEmptyData(this.curValList)
242
+ ? ""
243
+ : "有值";
244
+ },
245
+
246
+ /* ----- 值 ----- */
247
+ // 值为不是[]类型用的
248
+ curVal: {
249
+ get () {
250
+ // // 原选项变动了或选项动态改变时,过滤掉已不存在的选项值
251
+ // if (!this.isInTable) {
252
+ // if (["select"].includes(this.controlType)) {
253
+ // if (!this.$dataType(this.propsObj._filterFunc, "function")) {
254
+ // this.value[this.controlKey] = this.listData.some(item => item[this.saveKey] === this.value[this.controlKey])
255
+ // ? this.value[this.controlKey]
256
+ // : "";
257
+ // }
258
+ // }
259
+ // }
260
+
261
+ return this.value[this.controlKey];
262
+ },
263
+ set (val) {
264
+ // 修复文本框clear后值为undefined,后端无法更新保存数据bug
265
+ if (["select"].includes(this.controlType) && val === undefined) {
266
+ val = "";
267
+ }
268
+
269
+ this.$set(this.value, this.controlKey, val);
270
+ this.change();
271
+ }
272
+ },
273
+ // 值为[]类型用的
274
+ curValList: {
275
+ get () {
276
+ // // 原选项变动了或选项动态改变时,过滤掉已不存在的选项值
277
+ // if (!this.isInTable) {
278
+ // const valList = this.value[this.controlKey] || [];
279
+ // if ((["select"].includes(this.controlType) && this.multipleMode) || ["checkbox"].includes(this.controlType)) {
280
+ // this.value[this.controlKey] = valList.some(valKey => !this.listDataKeys.includes(valKey))
281
+ // ? valList.filter(valKey => this.listDataKeys.includes(valKey))
282
+ // : valList;
283
+ // }
284
+ // // else if (["region", "cascader"].includes(this.controlType)) {
285
+ // // this.value[this.controlKey] = this.$getTreeLinealDatas(valList, this.cascaderAllData, undefined, this.saveKey).length
286
+ // // ? valList
287
+ // // : [];
288
+ // // }
289
+ // // else if (["regions", "cascaders"].includes(this.controlType)) {
290
+ // // this.value[this.controlKey] = valList.filter(valListItem =>
291
+ // // this.$getTreeLinealDatas(valListItem, this.cascaderAllData, undefined, this.saveKey).length
292
+ // // );
293
+ // // }
294
+ // }
295
+
296
+ return this.value[this.controlKey] || [];
297
+ },
298
+ set (valList) {
299
+ this.$set(this.value, this.controlKey, valList);
300
+ this.change();
301
+ }
302
+ },
303
+ emptyShowVal () {
304
+ return this.canEdit
305
+ ? this.commonDealPropsObj._placeholder
306
+ : this.isUnitShow
307
+ ? "--"
308
+ : "暂无内容";
309
+ },
310
+ showVal () {
311
+ return this.$isEmptyData(this.curVal)
312
+ ? this.emptyShowVal
313
+ : this.curVal;
314
+ }
315
+ },
316
+ methods: {
317
+ change (...params) {
318
+ this.$emit("change", this.value[this.controlKey]);
319
+ },
320
+ refChange (...params) {
321
+ this.$emit("refChange", this.value[this.controlKey]);
322
+ },
323
+ quickChange (...params) {
324
+ this.$emit("quickChange", this.value[this.controlKey]);
325
+ },
326
+
327
+ // 点击输入框
328
+ clickInput () {
329
+ if (!this.disabled) {
330
+ this.openModal();
331
+ }
332
+ },
333
+ // 点击清除
334
+ clickClear () {
335
+ if (this.controlType === "coordinates") {
336
+ this.curVal = {
337
+ name: "",
338
+ lnglat: []
339
+ };
340
+ }
341
+ else if (this.typeInfoData.dataType === "array" || this.multipleMode) {
342
+ this.curValList = [];
343
+ } else {
344
+ this.curVal = "";
345
+ }
346
+ },
347
+
348
+ /* ----- 工具方法 ------- */
349
+ // 切换弹框
350
+ toggleModal (bool) {
351
+ this.showModal = bool;
352
+ },
353
+ // 打开弹框 ---!!!!pc端的selectUsers、selectDepartments控件,外部调用组件时也在使用,不能轻易删除
354
+ openModal () {
355
+ this.showModal = true;
356
+ },
357
+ // 关闭弹框 ---!!!!pc端的selectUsers、selectDepartments控件,外部调用组件时也在使用,不能轻易删除
358
+ closeModal () {
359
+ this.showModal = false;
360
+ },
361
+
362
+ // 单元格展示 -打开列表模态框
363
+ openUnitModal (event) {
364
+ this.showUnitModal = true;
365
+ event.stopPropagation();
366
+ }
367
+ }
368
+ };