bri-components 1.2.57 → 1.2.59

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 (42) hide show
  1. package/package.json +2 -2
  2. package/src/components/controls/base/BriUpload/BriUpload.vue +1 -1
  3. package/src/components/controls/base/DshCascader/DshCascader.vue +68 -231
  4. package/src/components/controls/base/DshCascader/{cascaderModal.vue → components/cascaderModal.vue} +22 -31
  5. package/src/components/controls/base/DshCascader/{cascaderPicker.vue → components/cascaderPicker.vue} +22 -18
  6. package/src/components/controls/base/DshCascader/components/cascaderSimple.vue +141 -0
  7. package/src/components/controls/base/DshCoordinates.vue +1 -1
  8. package/src/components/controls/base/DshDate/DshDate.vue +1 -1
  9. package/src/components/controls/base/DshDate/DshDaterange.vue +1 -1
  10. package/src/components/controls/base/DshDivider.vue +1 -1
  11. package/src/components/controls/base/DshEditor.vue +1 -1
  12. package/src/components/controls/base/DshInput/BriInputs.vue +1 -1
  13. package/src/components/controls/base/DshInput/DshInput.vue +1 -1
  14. package/src/components/controls/base/DshNumber/DshNumber.vue +1 -1
  15. package/src/components/controls/base/DshNumber/DshNumberange.vue +1 -1
  16. package/src/components/controls/base/DshSelect/DshCheckbox.vue +187 -185
  17. package/src/components/controls/base/DshSelect/DshSelect.vue +140 -137
  18. package/src/components/controls/base/DshSwitch/switchMixin.js +1 -1
  19. package/src/components/controls/extra/themeColor.vue +1 -1
  20. package/src/components/controls/extra/themeIcon.vue +1 -1
  21. package/src/components/controls/{base/DshCascader → mixins}/cascaderMixin.js +16 -33
  22. package/src/components/controls/{base/DshCascader → mixins}/cascaderPickerMixin.js +52 -44
  23. package/src/components/controls/{controlMixin.js → mixins/controlMixin.js} +25 -4
  24. package/src/components/controls/mixins/selectMixin.js +192 -0
  25. package/src/components/controls/senior/BriLabels.vue +1 -1
  26. package/src/components/controls/senior/DshPackage.vue +1 -1
  27. package/src/components/controls/senior/cascaderTable.vue +1 -1
  28. package/src/components/controls/senior/flatTable.vue +1 -1
  29. package/src/components/controls/senior/selectDepartments.vue +1 -1
  30. package/src/components/controls/senior/selectUsers/selectUsers.vue +1 -1
  31. package/src/components/controls/special/DshBack.vue +1 -1
  32. package/src/components/controls/special/DshUndeveloped.vue +1 -1
  33. package/src/components/form/DshAdvSearch.vue +1 -1
  34. package/src/components/list/DshBox/DshCard.vue +153 -38
  35. package/src/components/list/DshBox/DshPanel.vue +260 -93
  36. package/src/components/small/BriTooltip.vue +2 -3
  37. package/src/components/unit/DshFormUnit.vue +7 -19
  38. package/src/styles/components/index.less +0 -2
  39. package/src/components/controls/base/DshSelect/selectMixin.js +0 -239
  40. package/src/styles/components/list/DshBox/DshCard.less +0 -59
  41. package/src/styles/components/list/DshBox/DshPanel.less +0 -107
  42. package/src/styles/components/small/BriTooltip.less +0 -0
@@ -0,0 +1,141 @@
1
+ <template>
2
+ <div class="cascaderSimple">
3
+ <Cascader
4
+ :value="activeCodeValue"
5
+ :data="renderData"
6
+ :placeholder="selfPropsObj._placeholder"
7
+ :disabled="selfPropsObj._disabled"
8
+ :clearable="selfPropsObj._clearable"
9
+ :size="selfPropsObj._size"
10
+ :filterable="useFilter"
11
+ :render-format="renderFormat"
12
+ :change-on-select="changeOnSelect"
13
+ :transfer="selfPropsObj._transfer"
14
+ :transfer-class-name="selfPropsObj._transferClassName"
15
+ :load-data="loadData"
16
+ @on-visible-change="changeVisible"
17
+ @on-change="changeSelect"
18
+ @click.native="clickCascader"
19
+ >
20
+ <slot></slot>
21
+ </Cascader>
22
+ </div>
23
+ </template>
24
+
25
+ <script>
26
+ import cascaderPickerMixin from "../../../mixins/cascaderPickerMixin.js";
27
+
28
+ export default {
29
+ name: "cascaderSimple",
30
+ mixins: [
31
+ cascaderPickerMixin
32
+ ],
33
+ components: {},
34
+ props: {},
35
+ data () {
36
+ return {
37
+ renderAll: false
38
+ };
39
+ },
40
+ computed: {
41
+ selfPropsObj () {
42
+ return {
43
+ ...this.propsObj
44
+ };
45
+ },
46
+ useFilter () {
47
+ // 多选暂不支持搜索,值得弄成false,不然出bug
48
+ return this.multipleMode ? false : this.filterable;
49
+ },
50
+
51
+ renderData () {
52
+ return this.renderAll
53
+ ? this.data
54
+ : this.data.map(item => {
55
+ return {
56
+ ...item,
57
+ children: []
58
+ };
59
+ });
60
+ }
61
+ },
62
+ created () {},
63
+ methods: {
64
+ // 动态加载数据
65
+ loadData (treeItem, cb) {
66
+ const linealDatas = this.$getTreeLinealDatas(treeItem.keys, this.data, undefined, this.saveKey);
67
+ const lastData = linealDatas.slice(-1)[0];
68
+ treeItem.children = lastData.children.map(item =>
69
+ ({
70
+ ...item,
71
+ children: []
72
+ })
73
+ );
74
+
75
+ cb();
76
+ },
77
+ // 点击级联框 如果是需要搜索,需要先渲染完多有节点,不然搜索起来
78
+ clickCascader () {
79
+ // if (
80
+ // !this.selfPropsObj._disabled &&
81
+ // this.useFilter === true &&
82
+ // this.renderAll === false &&
83
+ // !this.clickFlag
84
+ // ) {
85
+ // this.clickFlag = true; // 这个处理其实觉大概率没必要,有没有不受影响
86
+ // setTimeout(() => {
87
+ // this.renderAll = true;
88
+ // }, 0);
89
+ // }
90
+ },
91
+ // 展开和关闭弹窗时触发
92
+ changeVisible (bool) {
93
+ this.isVisible = bool;
94
+
95
+ if (this.isVisible === false) {
96
+ // 多选时
97
+ if (this.multipleMode) {
98
+ this.clickConfirm();
99
+ }
100
+ }
101
+ },
102
+ // 选项变化
103
+ changeSelect (value, selectedOptions) {
104
+ if (this.isVisible || !value.length) {
105
+ const node = selectedOptions.slice(-1)[0] || {
106
+ keys: [],
107
+ loading: false
108
+ };
109
+
110
+ // 避免重复点击 -简易模式其实无效,不过为了代码对照好看
111
+ if (JSON.stringify(this.selectedValue) !== JSON.stringify(node.keys)) {
112
+ this.selectedValue = node.keys;
113
+
114
+ const obj = {
115
+ value: this.selectedValue,
116
+ selectedOptions: this.selectedOptions
117
+ };
118
+ this.$emit("change", obj);
119
+ node.loading === undefined && this.$emit("finish", obj);
120
+
121
+ // 单选时
122
+ if (!this.multipleMode) {
123
+ this.clickConfirm();
124
+ }
125
+ }
126
+ }
127
+ },
128
+ clickConfirm () {
129
+ if (this.selectedValue.length && this.selectedOptions.length) {
130
+ this.$emit("confirm", this.selectedValue, this.selectedOptions);
131
+ }
132
+ }
133
+ }
134
+ };
135
+ </script>
136
+
137
+ <style lang="less">
138
+ .cascaderSimple {
139
+
140
+ }
141
+ </style>>
@@ -141,7 +141,7 @@
141
141
  </template>
142
142
 
143
143
  <script>
144
- import controlMixin from "../controlMixin.js";
144
+ import controlMixin from "../mixins/controlMixin.js";
145
145
 
146
146
  const plotStrokeColor = "#4575EF";
147
147
  const plotFillColor = "#4575EF";
@@ -65,7 +65,7 @@
65
65
  </template>
66
66
 
67
67
  <script>
68
- import controlMixin from "../../controlMixin.js";
68
+ import controlMixin from "../../mixins/controlMixin.js";
69
69
  import DshDaterange from "./DshDaterange.vue";
70
70
 
71
71
  export default {
@@ -76,7 +76,7 @@
76
76
  </template>
77
77
 
78
78
  <script>
79
- import controlMixin from "../../controlMixin.js";
79
+ import controlMixin from "../../mixins/controlMixin.js";
80
80
 
81
81
  export default {
82
82
  name: "DshDaterange",
@@ -42,7 +42,7 @@
42
42
  </template>
43
43
 
44
44
  <script>
45
- import controlMixin from "../controlMixin.js";
45
+ import controlMixin from "../mixins/controlMixin.js";
46
46
 
47
47
  export default {
48
48
  name: "DshDivider",
@@ -62,7 +62,7 @@
62
62
  </template>
63
63
 
64
64
  <script>
65
- import controlMixin from "../controlMixin.js";
65
+ import controlMixin from "../mixins/controlMixin.js";
66
66
  import uploadMixin from "./BriUpload/uploadMixin.js";
67
67
  import E from "wangeditor";
68
68
 
@@ -46,7 +46,7 @@
46
46
  </template>
47
47
 
48
48
  <script>
49
- import controlMixin from "../../controlMixin.js";
49
+ import controlMixin from "../../mixins/controlMixin.js";
50
50
 
51
51
  export default {
52
52
  name: "BriInputs",
@@ -92,7 +92,7 @@
92
92
  </template>
93
93
 
94
94
  <script>
95
- import controlMixin from "../../controlMixin.js";
95
+ import controlMixin from "../../mixins/controlMixin.js";
96
96
  import DshInputs from "./BriInputs.vue";
97
97
 
98
98
  export default {
@@ -62,7 +62,7 @@
62
62
  </template>
63
63
 
64
64
  <script>
65
- import controlMixin from "../../controlMixin.js";
65
+ import controlMixin from "../../mixins/controlMixin.js";
66
66
  import BriInputNumber from "./BriInputNumber/BriInputNumber.vue";
67
67
  import DshNumberange from "./DshNumberange.vue";
68
68
 
@@ -52,7 +52,7 @@
52
52
  </template>
53
53
 
54
54
  <script>
55
- import controlMixin from "../../controlMixin.js";
55
+ import controlMixin from "../../mixins/controlMixin.js";
56
56
  import BriInputNumber from "./BriInputNumber/BriInputNumber.vue";
57
57
 
58
58
  export default {