bri-components 1.2.48 → 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 (66) hide show
  1. package/lib/0.bri-components.min.js +1 -1
  2. package/lib/1.bri-components.min.js +1 -1
  3. package/lib/2.bri-components.min.js +1 -1
  4. package/lib/3.bri-components.min.js +1 -1
  5. package/lib/4.bri-components.min.js +1 -1
  6. package/lib/5.bri-components.min.js +1 -1
  7. package/lib/6.bri-components.min.js +1 -1
  8. package/lib/bri-components.min.js +16 -16
  9. package/package.json +2 -2
  10. package/src/components/controls/BriControlInput.vue +4 -3
  11. package/src/components/controls/base/DshCascader/DshCascader.vue +40 -23
  12. package/src/components/controls/base/DshCascader/InfoCascader.vue +7 -15
  13. package/src/components/controls/base/DshDate/DshDate.vue +146 -0
  14. package/src/components/controls/base/{DshDaterange.vue → DshDate/DshDaterange.vue} +55 -1
  15. package/src/components/controls/base/DshEditor.vue +79 -1
  16. package/src/components/controls/base/{BriInputs.vue → DshInput/BriInputs.vue} +1 -1
  17. package/src/components/controls/base/{DshInput.vue → DshInput/DshInput.vue} +24 -5
  18. package/src/components/controls/base/DshNumber/DshNumber.vue +74 -2
  19. package/src/components/controls/base/{DshNumberange.vue → DshNumber/DshNumberange.vue} +37 -2
  20. package/src/components/controls/base/DshSelect/DshCheckbox.vue +280 -0
  21. package/src/components/controls/base/DshSelect/DshSelect.vue +319 -0
  22. package/src/components/controls/base/DshSelect/selectMixin.js +241 -0
  23. package/src/components/controls/base/DshSwitch/DshSwitch.vue +84 -0
  24. package/src/components/controls/base/DshSwitch/switchMixin.js +73 -0
  25. package/src/components/controls/controlMap.js +8 -11
  26. package/src/components/controls/controlMixin.js +41 -14
  27. package/src/components/controls/senior/BriLabels.vue +2 -2
  28. package/src/components/controls/senior/selectDepartments.vue +9 -13
  29. package/src/components/controls/senior/selectUsers/selectUsers.vue +23 -21
  30. package/src/components/controls/special/DshBack.vue +6 -0
  31. package/src/components/controls/special/DshUndeveloped.vue +6 -0
  32. package/src/components/form/DshAdvSearch.vue +155 -3
  33. package/src/components/form/DshDefaultSearch.vue +94 -12
  34. package/src/components/form/DshForm.vue +24 -0
  35. package/src/components/form/searchMixin.js +5 -18
  36. package/src/components/other/BriGantt.vue +2 -2
  37. package/src/components/unit/DshFormUnit.vue +108 -0
  38. package/src/components/unit/DshListUnit.vue +6 -0
  39. package/src/index.js +10 -10
  40. package/src/styles/components/index.less +0 -19
  41. package/src/styles/components/other/BriGantt.less +1 -12
  42. package/src/styles/{control.less → global/control.less} +3 -2
  43. package/src/styles/global/global.less +2 -0
  44. package/src/styles/index.less +0 -1
  45. package/src/styles/reset-iview.less +47 -1
  46. package/src/utils/table.js +1 -0
  47. package/src/components/controls/base/DshCheckbox.vue +0 -213
  48. package/src/components/controls/base/DshDate.vue +0 -122
  49. package/src/components/controls/base/DshSelect.vue +0 -242
  50. package/src/components/controls/base/DshSwitch.vue +0 -60
  51. package/src/components/controls/base/selectMixin.js +0 -110
  52. package/src/styles/components/controls/base/DshCheckbox.less +0 -115
  53. package/src/styles/components/controls/base/DshDate.less +0 -15
  54. package/src/styles/components/controls/base/DshDaterange.less +0 -49
  55. package/src/styles/components/controls/base/DshEditor.less +0 -75
  56. package/src/styles/components/controls/base/DshNumber.less +0 -55
  57. package/src/styles/components/controls/base/DshNumberange.less +0 -29
  58. package/src/styles/components/controls/base/DshSelect.less +0 -190
  59. package/src/styles/components/controls/base/DshSwitch.less +0 -7
  60. package/src/styles/components/controls/special/DshBack.less +0 -3
  61. package/src/styles/components/controls/special/DshUndeveloped.less +0 -3
  62. package/src/styles/components/form/DshAdvSearch.less +0 -149
  63. package/src/styles/components/form/DshDefaultSearch.less +0 -82
  64. package/src/styles/components/form/DshForm.less +0 -18
  65. package/src/styles/components/unit/DshFormUnit.less +0 -105
  66. package/src/styles/components/unit/DshListUnit.less +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bri-components",
3
- "version": "1.2.48",
3
+ "version": "1.2.50",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -32,7 +32,7 @@
32
32
  "dependencies": {
33
33
  "ali-oss": "^6.13.1",
34
34
  "axios": "^0.23.0",
35
- "bri-datas": "^1.0.41",
35
+ "bri-datas": "^1.0.42",
36
36
  "jshint": "^2.12.0",
37
37
  "jsonlint": "^1.6.3",
38
38
  "minio": "7.1.0",
@@ -13,9 +13,9 @@
13
13
  class="overflow"
14
14
  :list="value"
15
15
  :propsObj="{
16
- disabled: !canEdit,
17
- closable: true
18
- }"
16
+ disabled: !canEdit,
17
+ closable: true
18
+ }"
19
19
  @delete="clickDeleteItem"
20
20
  ></dsh-tags>
21
21
 
@@ -35,6 +35,7 @@
35
35
  {{ value }}
36
36
  </div>
37
37
  </template>
38
+
38
39
  <!-- 无值 -->
39
40
  <template v-else>
40
41
  <div class="placeholder">
@@ -83,7 +83,7 @@
83
83
  :load-data="loadData"
84
84
  @on-visible-change="visibleChange"
85
85
  @on-change="changeVal"
86
- @click.stop="clickCascader"
86
+ @click="clickCascader"
87
87
  ></Cascader>
88
88
  </template>
89
89
  </template>
@@ -94,7 +94,7 @@
94
94
  <!-- 多选 -->
95
95
  <template v-if="multipleMode">
96
96
  <bri-tooltip
97
- :content="showMultipleVal"
97
+ :content="showMulVal"
98
98
  placement="top"
99
99
  maxWidth="200"
100
100
  :transfer="true"
@@ -106,7 +106,7 @@
106
106
  }">
107
107
  <!-- 有值 -->
108
108
  <dsh-tags
109
- v-if="!$isEmptyData(curValNameList)"
109
+ v-if="!$isEmptyData(curValList)"
110
110
  class="text"
111
111
  :list="curValNameList"
112
112
  ></dsh-tags>
@@ -140,7 +140,7 @@
140
140
  </template>
141
141
 
142
142
  <script>
143
- import { regionData } from "bri-datas";
143
+ import { regionData, userIndustryData } from "bri-datas";
144
144
  import controlMixin from "../../controlMixin.js";
145
145
  import InfoCascader from "./InfoCascader.vue";
146
146
 
@@ -190,22 +190,37 @@
190
190
  };
191
191
  },
192
192
  computed: {
193
+ // 级联拼接符
194
+ joinSymbol () {
195
+ return this.propsObj._joinSymbol || "/";
196
+ },
197
+ nameKey () {
198
+ return this.propsObj._nameKey || "name";
199
+ },
200
+
193
201
  selfPropsObj () {
194
202
  return {
195
203
  _showMode: false,
196
- _changeOnSelect: false, // 每级菜单都可取值
197
204
  _filterable: true,
198
- _renderFormat: (label) => label.join(this.propsObj._joinSymbol || "/"),
205
+ _changeOnSelect: false,
206
+ _renderFormat: (label) => label.join(this.joinSymbol),
199
207
  _transfer: true,
208
+
200
209
  ...this.propsObj,
201
210
  ...this.commonDealPropsObj
202
211
  };
203
212
  },
204
- // 是否多选类型
205
- multipleMode () {
206
- return ["regions", "cascaders"].includes(this.propsObj._type);
213
+ // 每级菜单都可取值
214
+ changeOnSelect () {
215
+ return this.isOnSearch ? true : this.selfPropsObj._changeOnSelect;
207
216
  },
208
- // 只有单选时有效
217
+ cascaderLevel () {
218
+ return this.selfPropsObj._cascaderLevel;
219
+ },
220
+ cascaderFilterVals () {
221
+ return this.selfPropsObj._cascaderFilterVals;
222
+ },
223
+ // 只有单选模式有效
209
224
  showMode () {
210
225
  return this.selfPropsObj._showMode;
211
226
  },
@@ -213,14 +228,16 @@
213
228
  return this.isVisible ? "ios-arrow-up" : "ios-arrow-down";
214
229
  },
215
230
 
231
+ originData () {
232
+ return ["region", "regions"].includes(this.controlType)
233
+ ? regionData
234
+ : ["userIndustry"].includes(this.controlType)
235
+ ? userIndustryData
236
+ : this.selfPropsObj._data;
237
+ },
216
238
  cascaderData: {
217
239
  get () {
218
- return loop(
219
- ["region", "regions"].includes(this.propsObj._type) ? regionData : this.selfPropsObj._data,
220
- this.selfPropsObj._cascaderLevel,
221
- undefined,
222
- this.selfPropsObj._cascaderFilterVals
223
- );
240
+ return loop(this.originData, this.cascaderLevel, undefined, this.cascaderFilterVals);
224
241
  },
225
242
  set () {}
226
243
  },
@@ -235,20 +252,20 @@
235
252
  : this.cascaderData;
236
253
  },
237
254
  curValName () {
238
- return this.$getTreeLinealDatas(this.curValList, this.cascaderData, "name").join("/");
255
+ return this.$getTreeLinealDatas(this.curValList, this.cascaderData, this.nameKey).join(this.joinSymbol);
239
256
  },
240
257
  showVal () {
241
258
  return this.$isEmptyData(this.curValList)
242
259
  ? this.emptyShowVal
243
260
  : this.curValName;
244
261
  },
245
- // 多选用 名字组成的列表
262
+ // 多选用
246
263
  curValNameList () {
247
264
  return this.curValList.map(item =>
248
- this.$getTreeLinealDatas(item, this.cascaderData, "name").join("/")
265
+ this.$getTreeLinealDatas(item, this.cascaderData, this.nameKey).join(this.joinSymbol)
249
266
  );
250
267
  },
251
- showMultipleVal () {
268
+ showMulVal () {
252
269
  return this.$isEmptyData(this.curValList)
253
270
  ? this.emptyShowVal
254
271
  : this.curValNameList.join("、");
@@ -280,9 +297,9 @@
280
297
 
281
298
  if (bool === false) {
282
299
  if (this.selectVal.length) {
283
- if (this.curValList.some(item => JSON.stringify(item) == JSON.stringify(this.selectVal))) {
300
+ if (this.curValList.some(item => JSON.stringify(item) === JSON.stringify(this.selectVal))) {
284
301
  this.$Message.error({
285
- content: `"${this.$getTreeLinealDatas(this.selectVal, this.cascaderData, "name").join("/")}"已选择,请勿重复选择!`,
302
+ content: `"${this.$getTreeLinealDatas(this.selectVal, this.cascaderData, this.nameKey).join(this.joinSymbol)}"已选择,请勿重复选择!`,
286
303
  duration: 5
287
304
  });
288
305
  } else {
@@ -353,7 +370,7 @@
353
370
  }
354
371
  },
355
372
  watch: {
356
- "propsObj._cascaderLevel" () {
373
+ "cascaderLevel" () {
357
374
  this.value[this.controlKey] = [];
358
375
  }
359
376
  }
@@ -175,22 +175,14 @@
175
175
  },
176
176
  methods: {
177
177
  change (node) {
178
- // 点击最后层级时,才出现右侧说明
179
- if (node.children.length === 0) {
180
- this.curName = node.name;
181
- this.getDescription(node.codeArr);
182
- if (node.codeArr.length && this.curSelect.codeArr && this.curSelect.codeArr.length === node.codeArr.length && node.codeArr.every((code, idx) => code === this.curSelect.codeArr[idx])) {
183
- this.curSelect = {};
184
- this.description = "";
185
- } else {
186
- if (!this.propsObj._cascaderLevel || node.level == this.propsObj._cascaderLevel || !node.children.length) {
187
- this.curSelect = node;
188
- }
189
- }
190
- } else {
191
- this.curName = "";
192
- this.description = "";
178
+ this.curName = node.name;
179
+ if (node.codeArr.length && this.curSelect.codeArr && this.curSelect.codeArr.length === node.codeArr.length && node.codeArr.every((code, idx) => code === this.curSelect.codeArr[idx])) {
193
180
  this.curSelect = {};
181
+ } else {
182
+ if (!this.propsObj._cascaderLevel || node.level == this.propsObj._cascaderLevel || !node.children.length) {
183
+ this.curSelect = node;
184
+ this.getDescription(node.codeArr);
185
+ }
194
186
  }
195
187
  },
196
188
  getDescription (nodeKeys) {
@@ -0,0 +1,146 @@
1
+ <template>
2
+ <!-- 单选模式 -->
3
+ <div
4
+ v-if="!multipleMode"
5
+ class="DshDate"
6
+ >
7
+ <template v-if="show">
8
+ <!-- 编辑 -->
9
+ <template v-if="canEdit">
10
+ <!-- 时间子类型 -->
11
+ <template v-if="['time'].includes(subType)">
12
+ <TimePicker
13
+ class="DshDate-edit"
14
+ v-model="curValDate"
15
+ :type="subType"
16
+ :placeholder="selfPropsObj._placeholder"
17
+ :disabled="!finalCanEdit"
18
+ :clearable="selfPropsObj._clearable"
19
+ :transfer="selfPropsObj._transfer"
20
+ @on-change="change"
21
+ ></TimePicker>
22
+ </template>
23
+
24
+ <!-- 日期、日期时间、年、月 -->
25
+ <template v-else>
26
+ <DatePicker
27
+ class="DshDate-edit"
28
+ v-model="curValDate"
29
+ :type="subType"
30
+ :placeholder="selfPropsObj._placeholder"
31
+ :disabled="!finalCanEdit"
32
+ :clearable="selfPropsObj._clearable"
33
+ :options="options"
34
+ :transfer="selfPropsObj._transfer"
35
+ @on-change="change"
36
+ ></DatePicker>
37
+ </template>
38
+ </template>
39
+
40
+ <!-- 查看 -->
41
+ <template v-else>
42
+ <bri-tooltip
43
+ :content="showVal"
44
+ maxWidth="200"
45
+ :transfer="true"
46
+ >
47
+ <div :class="{
48
+ ...commonClass
49
+ }">
50
+ {{ showVal }}
51
+ </div>
52
+ </bri-tooltip>
53
+ </template>
54
+ </template>
55
+ </div>
56
+
57
+ <!-- 多选模式 -->
58
+ <dsh-daterange
59
+ v-else
60
+ :canEdit="canEdit"
61
+ :value="value"
62
+ :propsObj="propsObj"
63
+ @change="change"
64
+ ></dsh-daterange>
65
+ </template>
66
+
67
+ <script>
68
+ import controlMixin from "../../controlMixin.js";
69
+ import DshDaterange from "./DshDaterange.vue";
70
+
71
+ export default {
72
+ name: "DshDate",
73
+ mixins: [
74
+ controlMixin
75
+ ],
76
+ components: {
77
+ DshDaterange
78
+ },
79
+ props: {},
80
+ data () {
81
+ return {
82
+ show: true
83
+ };
84
+ },
85
+ computed: {
86
+ selfPropsObj () {
87
+ return {
88
+ _transfer: true,
89
+
90
+ ...this.propsObj,
91
+ ...this.commonDealPropsObj
92
+ };
93
+ },
94
+
95
+ curValDate: {
96
+ get () {
97
+ const val = this.value[this.controlKey];
98
+ return this.$transformDateCompatible(val, this.subType);
99
+ },
100
+ set (val) {
101
+ this.value[this.controlKey] = this.$transformDate(val, "-", this.subType);
102
+ }
103
+ },
104
+ subType () {
105
+ return this.selfPropsObj._dateType;
106
+ },
107
+ options () {
108
+ return {
109
+ shortcuts: [],
110
+ disabledDate: (date) => {
111
+ const resultObj = this.$validateComparedRule(
112
+ [this.selfPropsObj],
113
+ {
114
+ ...this.value,
115
+ [this.controlKey]: this.$transformDate(date, "/", this.subType)
116
+ },
117
+ this.allFormList
118
+ );
119
+ return !resultObj.bool;
120
+ }
121
+ };
122
+ }
123
+ },
124
+ created () {},
125
+ methods: {},
126
+ watch: {
127
+ "subType" () {
128
+ this.show = false;
129
+ this.$nextTick(() => {
130
+ this.value[this.controlKey] = this.selfPropsObj._default;
131
+ this.show = true;
132
+ });
133
+ }
134
+ }
135
+ };
136
+ </script>
137
+
138
+ <style lang="less" scoped>
139
+ .DshDate {
140
+ width: 100%;
141
+
142
+ &-edit {
143
+ width: 100%;
144
+ }
145
+ }
146
+ </style>
@@ -92,7 +92,7 @@
92
92
  </template>
93
93
 
94
94
  <script>
95
- import controlMixin from "../controlMixin.js";
95
+ import controlMixin from "../../controlMixin.js";
96
96
 
97
97
  export default {
98
98
  name: "DshDaterange",
@@ -341,3 +341,57 @@
341
341
  }
342
342
  };
343
343
  </script>
344
+
345
+ <style lang="less" scoped>
346
+ .DshDaterange {
347
+ width: 100%;
348
+
349
+ &-left,
350
+ &-right {
351
+ width: 47%;
352
+ float: left;
353
+ background-color: #ffffff;
354
+ }
355
+
356
+ &-center {
357
+ width: 3%;
358
+ text-align: center;
359
+ color: @textColor;
360
+ overflow: hidden;
361
+ line-height: 30px;
362
+ float: left;
363
+ margin: 0 1.5%;
364
+ }
365
+
366
+ &-item {
367
+ height: 32px;
368
+ border: 1px solid @borderColor;
369
+ border-radius: 4px;
370
+ overflow: hidden;
371
+ position: relative;
372
+
373
+ &-name {
374
+ display: inline-block;
375
+ width: 100%;
376
+ height: 100%;
377
+ line-height: 30px;
378
+ overflow: hidden;
379
+ padding-right: 32px;
380
+ padding-left: 7px;
381
+ white-space: nowrap;
382
+ text-overflow: ellipsis;
383
+ }
384
+
385
+ &-icon {
386
+ position: absolute;
387
+ right: 0px;
388
+ top: 0px;
389
+ display: inline-block;
390
+ width: 32px;
391
+ height: 100%;
392
+ text-align: center;
393
+ line-height: 30px;
394
+ }
395
+ }
396
+ }
397
+ </style>
@@ -45,7 +45,7 @@
45
45
  'DshEditor-unit': !$isEmptyData(curVal)
46
46
  }"
47
47
  >
48
- {{ $isEmptyData(curVal) ? emptyShowVal : "富文本" }}
48
+ {{ $isEmptyData(curVal) ? emptyShowVal : "富文本达成纳斯达克了城市的女你说的 v 是对女生看到 v 你说的 v 说" }}
49
49
  </div>
50
50
 
51
51
  <!-- 查看页里 的查看 -->
@@ -187,3 +187,81 @@
187
187
  }
188
188
  };
189
189
  </script>
190
+
191
+ <style lang="less" scoped>
192
+ .DshEditor {
193
+ width: 100%;
194
+
195
+ #show {
196
+ white-space: pre-wrap;
197
+ word-break: break-word;
198
+
199
+ p {
200
+ font-size: 14px !important;
201
+ }
202
+
203
+ li {
204
+ margin-left: 20px;
205
+ }
206
+
207
+ ul li {
208
+ list-style: disc;
209
+ }
210
+
211
+ ol li {
212
+ list-style: auto;
213
+ }
214
+ }
215
+
216
+ &-edit {
217
+ #show();
218
+ height: 100%;
219
+ min-height: 32px;
220
+ padding: 4px 7px;
221
+ border-radius: @borderRadius;
222
+
223
+ &.bri-control-nodata {
224
+ line-height: 24px;
225
+ }
226
+ }
227
+
228
+ &-wrap {
229
+ border: 1px solid @themeColor;
230
+ border-radius: 4px;
231
+ background: #fff;
232
+
233
+ &-toolbar {
234
+ margin-top: 5px;
235
+ }
236
+
237
+ &-text {
238
+ min-height: 130px;
239
+
240
+ ul li {
241
+ list-style: disc;
242
+ }
243
+
244
+ ol li {
245
+ list-style: auto;
246
+ }
247
+ }
248
+
249
+ &-btn {
250
+ text-align: right;
251
+ padding: 10px;
252
+ }
253
+ }
254
+
255
+ &-unit {
256
+ .bri-unit-show();
257
+ }
258
+
259
+ &-show {
260
+ #show();
261
+
262
+ &-nodata {
263
+ .bri-control-nodata();
264
+ }
265
+ }
266
+ }
267
+ </style>
@@ -46,7 +46,7 @@
46
46
  </template>
47
47
 
48
48
  <script>
49
- import controlMixin from "../controlMixin.js";
49
+ import controlMixin from "../../controlMixin.js";
50
50
 
51
51
  export default {
52
52
  name: "BriInputs",
@@ -1,5 +1,9 @@
1
1
  <template>
2
- <div class="DshInput">
2
+ <!-- 单选模式 -->
3
+ <div
4
+ v-if="!multipleMode"
5
+ class="DshInput"
6
+ >
3
7
  <!-- 编辑 -->
4
8
  <template v-if="canEdit">
5
9
  <Input
@@ -8,7 +12,7 @@
8
12
  :type="inputType"
9
13
  :placeholder="selfPropsObj._placeholder"
10
14
  :readonly="selfPropsObj._readonly"
11
- :disabled="!finalCanEdit || selfPropsObj._disabled"
15
+ :disabled="selfPropsObj._disabled"
12
16
  :clearable="selfPropsObj._clearable"
13
17
  :size="selfPropsObj._size"
14
18
  :rows="selfPropsObj._rows"
@@ -76,16 +80,29 @@
76
80
  </template>
77
81
  </template>
78
82
  </div>
83
+
84
+ <!-- 多选模式 -->
85
+ <dsh-inputs
86
+ v-else
87
+ :canEdit="canEdit"
88
+ :value="value"
89
+ :propsObj="propsObj"
90
+ @change="change"
91
+ ></dsh-inputs>
79
92
  </template>
80
93
 
81
94
  <script>
82
- import controlMixin from "../controlMixin.js";
95
+ import controlMixin from "../../controlMixin.js";
96
+ import DshInputs from "./BriInputs.vue";
83
97
 
84
98
  export default {
85
99
  name: "DshInput",
86
100
  mixins: [
87
101
  controlMixin
88
102
  ],
103
+ components: {
104
+ DshInputs
105
+ },
89
106
  props: {},
90
107
  data () {
91
108
  return {
@@ -95,16 +112,18 @@
95
112
  computed: {
96
113
  selfPropsObj () {
97
114
  return {
115
+ _search: false,
98
116
  _textType: "default", // ["default", "url"]
99
117
  _readonly: ["serialNumber"].includes(this.controlType),
100
- _disabled: ["serialNumber"].includes(this.controlType),
101
118
  _showWordLimit: this.propsObj._showWordLimit || (!!this.propsObj._maxlength || this.propsObj._maxlength === 0),
102
119
  _autosize: {
103
120
  minRows: 2
104
121
  },
105
122
 
106
123
  ...this.propsObj,
107
- ...this.commonDealPropsObj
124
+ ...this.commonDealPropsObj,
125
+
126
+ _disabled: this.propsObj._disabled || ["serialNumber"].includes(this.controlType) || !this.finalCanEdit
108
127
  };
109
128
  },
110
129
  inputType () {