bri-components 1.1.2 → 1.1.3

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 (80) 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/10.bri-components.min.js +1 -0
  4. package/lib/2.bri-components.min.js +1 -1
  5. package/lib/3.bri-components.min.js +1 -1
  6. package/lib/4.bri-components.min.js +1 -1
  7. package/lib/5.bri-components.min.js +1 -1
  8. package/lib/6.bri-components.min.js +1 -1
  9. package/lib/7.bri-components.min.js +1 -1
  10. package/lib/8.bri-components.min.js +1 -1
  11. package/lib/9.bri-components.min.js +1 -1
  12. package/lib/bri-components.min.js +6 -6
  13. package/package.json +1 -1
  14. package/src/components/controls/base/DshCascader.vue +14 -11
  15. package/src/components/controls/base/DshCascaderMultiple.vue +13 -4
  16. package/src/components/controls/base/DshCheckbox.vue +16 -19
  17. package/src/components/controls/base/DshCoordinates.vue +9 -8
  18. package/src/components/controls/base/DshDate.vue +24 -37
  19. package/src/components/controls/base/DshDaterange.vue +3 -1
  20. package/src/components/controls/base/DshEditor.vue +72 -59
  21. package/src/components/controls/base/DshInput.vue +66 -59
  22. package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +1 -1
  23. package/src/components/controls/base/DshNumber/DshNumber.vue +50 -48
  24. package/src/components/controls/base/DshNumberange.vue +11 -21
  25. package/src/components/controls/base/DshSelect.vue +12 -16
  26. package/src/components/controls/base/YSerialNumber.vue +10 -3
  27. package/src/components/controls/base/ZUpload/index.vue +16 -12
  28. package/src/components/controls/base/ZUpload/upload-list.vue +20 -13
  29. package/src/components/controls/base/ZUpload/uploadMixin.js +5 -1
  30. package/src/components/controls/base/textMultiple/DshTextMultiple.vue +13 -5
  31. package/src/components/controls/base/textMultiple/MultipleInput.vue +5 -5
  32. package/src/components/controls/controlMap.js +6 -4
  33. package/src/components/controls/controlMixin.js +36 -26
  34. package/src/components/controls/controlShow.vue +44 -0
  35. package/src/components/controls/{base → senior}/BriLabels.vue +7 -12
  36. package/src/components/controls/{base → senior}/DshPackage.vue +6 -25
  37. package/src/components/controls/senior/cascaderTable.vue +52 -51
  38. package/src/components/controls/senior/flatTable.vue +20 -17
  39. package/src/components/controls/{base → special}/DshBack.vue +4 -4
  40. package/src/components/controls/{base → special}/DshUndeveloped.vue +3 -1
  41. package/src/components/form/DshAdvSearchForm.vue +10 -1
  42. package/src/components/form/DshForm.vue +10 -3
  43. package/src/components/list/BriFlatTable.vue +5 -5
  44. package/src/components/list/BriTable.vue +6 -8
  45. package/src/components/list/DshBox/DshCard.vue +2 -2
  46. package/src/components/list/DshBox/DshCrossTable.vue +4 -8
  47. package/src/components/list/DshCascaderTable.vue +1 -1
  48. package/src/components/small/DshControlDefine.vue +1 -1
  49. package/src/components/small/DshModal.vue +0 -134
  50. package/src/components/unit/DshFormItem.vue +7 -10
  51. package/src/components/unit/DshUnit.vue +1 -11
  52. package/src/components/unit/unitMixin.js +8 -5
  53. package/src/index.js +5 -10
  54. package/src/styles/common/control.less +49 -12
  55. package/src/styles/components/controls/BriLabels.less +4 -2
  56. package/src/styles/components/controls/DshCheckbox.less +45 -42
  57. package/src/styles/components/controls/DshCoordinates.less +24 -27
  58. package/src/styles/components/controls/DshDate.less +1 -52
  59. package/src/styles/components/controls/DshEditor.less +51 -34
  60. package/src/styles/components/controls/DshInput.less +13 -34
  61. package/src/styles/components/controls/DshNumber.less +33 -0
  62. package/src/styles/components/controls/DshNumberange.less +8 -3
  63. package/src/styles/components/controls/DshSelect.less +78 -92
  64. package/src/styles/components/controls/ZUpload.less +1 -2
  65. package/src/styles/components/controls/cascaderTable.less +10 -24
  66. package/src/styles/components/controls/controlShow.less +3 -1
  67. package/src/styles/components/controls/flatTable.less +10 -23
  68. package/src/styles/components/form/DshAdvSearchForm.less +0 -9
  69. package/src/styles/components/form/DshDefaultSearch.less +0 -20
  70. package/src/styles/components/index.less +2 -1
  71. package/src/styles/components/other/InfoCascader.less +4 -4
  72. package/src/styles/components/small/DshControlDefine.less +4 -7
  73. package/src/styles/components/small/DshDropdown.less +1 -0
  74. package/src/styles/components/small/DshModal.less +207 -0
  75. package/src/styles/components/unit/DshFormItem.less +2 -0
  76. package/src/styles/reset.less +14 -0
  77. package/src/utils/table.js +3 -3
  78. package/src/components/controls/base/DshLabels.vue +0 -309
  79. package/src/components/controls/base/controlShow.vue +0 -52
  80. package/src/styles/components/controls/DshLabels.less +0 -187
@@ -1,309 +0,0 @@
1
- <!-- 动态标签 -->
2
- <template>
3
- <div
4
- ref="dshLabelsRef"
5
- class="DshLabels"
6
- >
7
- <!-- 编辑 -->
8
- <template v-if="canEdit">
9
- <!-- 编辑区 -->
10
- <Input
11
- v-show="status === 'edit'"
12
- v-model="curVal"
13
- ref="dshLabelsInput"
14
- class="DshLabels-input"
15
- type="text"
16
- :icon="selfPropsObj._inputIcon"
17
- :placeholder="selfPropsObj._placeholder"
18
- :disabled="!finalCanEdit"
19
- @on-enter="onClick"
20
- @on-click="onClick"
21
- @on-change="onChange"
22
- @on-focus="onChange"
23
- ></Input>
24
-
25
- <!-- 查看区 -->
26
- <div
27
- v-show="status === 'show'"
28
- :class="{
29
- 'DshLabels-show':true,
30
- 'DshLabels-showReadOnly':!finalCanEdit
31
- }"
32
- @click="clickAdd"
33
- >
34
- <div
35
- class="DshLabels-show-content"
36
- @click="clickAdd"
37
- >
38
- <span
39
- v-for="labelItem in val"
40
- :key="labelItem._key"
41
- class="DshLabels-show-content-item"
42
- >
43
- <span
44
- class="DshLabels-show-content-item-content"
45
- :title="labelItem.name"
46
- @click.stop="clickEdit(labelItem)"
47
- >
48
- {{ labelItem.name }}
49
- </span>
50
- <Icon
51
- class="DshLabels-show-content-item-del"
52
- type="ios-close"
53
- size="20"
54
- @click.stop="clickDelete(labelItem)"
55
- />
56
- </span>
57
- </div>
58
- <div
59
- v-if="canEdit"
60
- class="DshLabels-show-add"
61
- >
62
- <Icon
63
- type="md-create"
64
- @click="clickAdd"
65
- />
66
- </div>
67
-
68
- </div>
69
-
70
- <!-- 数据选择区:接口依据用户输入返回数据 -->
71
- <div
72
- v-if="ShowTagList"
73
- ref="searchResultRef"
74
- class="DshLabels-searchResult"
75
- :style="{
76
- width: getStyle()
77
- }"
78
- >
79
- <Icon
80
- type="md-close"
81
- class="DshLabels-searchResult-close"
82
- @click="closeTagList"
83
- />
84
- <ul
85
- v-if="list&&list.length>0"
86
- class="DshLabels-searchResult-list"
87
- >
88
- <li
89
- v-for="item in list"
90
- :key="item._id"
91
- :class="{'selected':item.selected}"
92
- @click="clickTag(item)"
93
- >{{ item.name }}
94
- </li>
95
- </ul>
96
- <div
97
- v-else
98
- class="DshLabels-searchResult-nodata"
99
- >
100
- 无匹配数据
101
- </div>
102
- </div>
103
- </template>
104
-
105
- <!-- 查看 -->
106
- <div
107
- v-else
108
- :class="{'DshLabels-view':true,
109
- 'DshLabels-view-readonly': $isReadonly(canEdit, selfPropsObj),
110
- 'DshLabels-view-disabled': $isDisabled(canEdit, selfPropsObj),
111
- }"
112
- >
113
- <template v-if="val.length">
114
- <Tag
115
- v-for="tagItem in val"
116
- :key="tagItem._key"
117
- size="medium"
118
- class="DshLabels-view-tag"
119
- >
120
- {{ tagItem.name }}
121
- </Tag>
122
- </template>
123
-
124
- <div
125
- v-else
126
- class="DshLabels-view-nodata"
127
- >
128
- <template v-if="isUnit">
129
- -
130
- </template>
131
- <template v-else>
132
- 暂无内容
133
- </template>
134
- </div>
135
- </div>
136
- </div>
137
- </template>
138
-
139
- <script>
140
- import controlMixin from "../controlMixin.js";
141
-
142
- export default {
143
- name: "DshLabels",
144
- mixins: [controlMixin],
145
-
146
- data () {
147
- return {
148
- status: "", // edit/show
149
- curVal: "",
150
- curKey: "", // 当前正在修改label的_key
151
- ShowTagList: false,
152
- list: []
153
- };
154
- },
155
- computed: {
156
- selfPropsObj () {
157
- return {
158
- ...this.propsObj,
159
- ...this.commonDealPropsObj,
160
- _inputIcon: !this.propsObj._onlySelect ? "md-add" : ""
161
- };
162
- },
163
- modKey () {
164
- return this.propsObj.modKey;
165
- },
166
- val: {
167
- get () {
168
- return this.value[this.propsObj._key] || [];
169
- },
170
- set (val) {
171
- this.value[this.propsObj._key] = val;
172
- }
173
- }
174
- },
175
- created () {
176
- this.init();
177
- },
178
- methods: {
179
- init () {
180
- this.status = this.canEdit && !this.val.length
181
- ? "edit"
182
- : "show";
183
-
184
- },
185
- // 确认输入
186
- onClick () {
187
- if (this.finalCanEdit && !this.selfPropsObj._onlySelect) {
188
- if (this.curVal.trim().length > 0) {
189
- this.status = "show";
190
- let labelItem = {_key: "", name: ""};
191
- labelItem._key = this.curKey || this.$randomB36("Labels");
192
- labelItem.name = this.curVal.trim();
193
- labelItem.labelType = this.selfPropsObj._labelType;
194
- this.val = this.val.concat([labelItem]);
195
- this.ShowTagList = false;
196
- this.change();
197
- } else {
198
- this.status = "show";
199
- this.ShowTagList = false;
200
- }
201
- }
202
- },
203
- onChange () {
204
- this.getListData();
205
- },
206
- getListData () {
207
- this.$https({
208
- url: {
209
- module: "sheet",
210
- name: "memberAll"
211
- },
212
- params: {
213
- search: {
214
- entityKey: this.entityKey, // 当前工作表关联的数据表Key
215
- modKey: this.modKey,
216
- name: this.curVal,
217
- fieldKey: this.selfPropsObj._key === "_default" ? this.value._key : (this.selfPropsObj.__realKey__ || this.selfPropsObj._key), // 当前字段Key
218
- labelType: this.selfPropsObj._labelType
219
- },
220
- pagination: {
221
- page: 1,
222
- pagesize: 999
223
- }
224
- },
225
- callback: data => {
226
- // 当前已选择的标签
227
- let keysArr = this.val.map(item => item._key);
228
- if (data.list.length > 0) {
229
- this.list = data.list.map(item => ({
230
- ...item,
231
- selected: !!keysArr.includes(item._key)
232
- }));
233
- } else {
234
- this.list = [];
235
- }
236
- this.ShowTagList = true;
237
- // this.ShowTagList = !this.ShowTagList;
238
- }
239
- });
240
- },
241
- clickTag (item) {
242
- if (this.finalCanEdit) {
243
- this.status = "show";
244
- let keysArr = this.val.map(i => i._key);
245
- if (!keysArr.includes(item._key)) {
246
- this.val = this.val.concat(this.list.filter(listItem => listItem._key == item._key));
247
- this.ShowTagList = false;
248
- this.change();
249
- } else {
250
- this.ShowTagList = false;
251
- this.status = "show";
252
- this.curVal = "";
253
- }
254
- }
255
- },
256
- clickEdit (labelItem) {
257
- if (this.finalCanEdit) {
258
- this.status = "edit";
259
- this.curVal = labelItem.name;
260
- this.curKey = labelItem._key;
261
- this.val = this.val.filter(i => i._key != labelItem._key);
262
- }
263
- },
264
- // 切换为输入框编辑模式
265
- clickAdd () {
266
- if (this.finalCanEdit) {
267
- this.status = "edit";
268
- this.curVal = "";
269
- this.$nextTick(() => {
270
- this.$refs.dshLabelsInput.focus({
271
- cursor: "start"
272
- });
273
- });
274
-
275
- this.$debounce(this.getListData(), 100);
276
- }
277
- },
278
- clickDelete (labelItem) {
279
- if (this.finalCanEdit) {
280
- this.val = this.val.filter(i => i._key != labelItem._key);
281
-
282
- if (!this.val.length) {
283
- this.curVal = "";
284
- this.status = "edit";
285
- this.change();
286
- }
287
- this.change();
288
- }
289
- },
290
- closeTagList () {
291
- this.ShowTagList = false;
292
- this.status = "show";
293
- },
294
- getStyle () {
295
- this.$nextTick(() => {
296
- this.$refs.searchResultRef.style.width = `${this.$refs.dshLabelsRef.offsetWidth}px`;
297
- this.$refs.searchResultRef.style.top = `${this.$refs.dshLabelsRef.getBoundingClientRect().top + 34}px`;
298
- });
299
- }
300
- },
301
- watch: {
302
- value (newVal, oldVal) {
303
- if (newVal !== oldVal) {
304
- this.init();
305
- }
306
- }
307
- }
308
- };
309
- </script>
@@ -1,52 +0,0 @@
1
- <template>
2
- <div class="controlShow">
3
- <Ctooltip
4
- :transfer="true"
5
- maxWidth="200"
6
- :content="showVal"
7
- >
8
- <div
9
- v-if="$isFormItemHasData(showVal)"
10
- class="dsh-ellipsis controlShow-val"
11
- >
12
- {{ showVal }}
13
- </div>
14
- <div
15
- v-else
16
- class="controlShow-nodata dsh-ellipsis"
17
- >
18
- {{noDataText}}
19
- </div>
20
- </Ctooltip>
21
- </div>
22
- </template>
23
-
24
- <script>
25
-
26
- export default {
27
- name: "controlShow",
28
- props: {
29
- showVal: String,
30
- propsObj: {
31
- type: Object,
32
- default: () => {
33
- return {};
34
- }
35
- },
36
- isUnit: Boolean
37
- },
38
- data () {
39
- return {
40
- };
41
- },
42
- computed: {
43
- noDataText () {
44
- return this.isUnit ? "-" : "暂无内容";
45
- }
46
- },
47
- created () {
48
- },
49
- methods: {
50
- }
51
- };
52
- </script>
@@ -1,187 +0,0 @@
1
- .DshLabels {
2
- width: 100%;
3
- position: relative;
4
-
5
- i {
6
- font-size: 16px;
7
- cursor: pointer;
8
- }
9
-
10
- &-input{
11
- .ivu-input{
12
- height: 30px;
13
- border: 1px solid #e5e5e5;
14
- border-radius: 0;
15
- }
16
- }
17
-
18
- &-show {
19
- display: flex;
20
- align-items: center;
21
- border: 1px solid #e5e5e5;
22
- border-radius: 4px;
23
- background: @white;
24
- color: #515a6e;
25
- padding-left: 5px;
26
- height: 30px;
27
-
28
- &-content {
29
- display: flex;
30
- width: calc(100% - 20px);
31
- height: 100%;
32
- white-space: nowrap;
33
-
34
- div{
35
- width: 100%;
36
- height: 38px;
37
- display: flex;
38
- overflow-x: scroll;
39
- overflow-y: hidden;
40
-
41
- .DshLabels-show-content-item {
42
- display: flex;
43
- width: fit-content;
44
- max-width: 50%;
45
- height: 28px;
46
- margin: 0 4px 1px 0;
47
- padding-left: 8px;
48
- background: #f7f7f7;
49
- border: 1px solid #e8eaec;
50
- border-radius: 3px;
51
- font-size: 14px;
52
- cursor: pointer;
53
-
54
- &-content {
55
- width: fit-content;
56
- line-height: 28px;
57
- vertical-align: middle;
58
- display: inline-block;
59
- overflow: hidden;
60
- white-space: nowrap;
61
- overflow: hidden;
62
- text-overflow: ellipsis;
63
- }
64
-
65
- &-del {
66
- display: inline-block;
67
- width: 20px;
68
- vertical-align: middle;
69
- }
70
- }
71
- }
72
- }
73
-
74
- &-add {
75
- .dsh-flex ();
76
- position: absolute;
77
- right: 5px;
78
- width: 24px;
79
- height: 28px;
80
- background: #fff;
81
-
82
- }
83
- }
84
-
85
- &-showReadOnly{
86
- cursor: not-allowed;
87
-
88
- .DshLabels-show-content{
89
- width: 100%;
90
- }
91
- }
92
-
93
- &-view{
94
- .dsh-flex-row-start-start();
95
- flex-wrap: wrap;
96
- height: 32px;
97
- overflow-y: hidden;
98
-
99
- &-readonly{
100
- width: 100%;
101
- background: @white;
102
- border: 1px solid #eee;
103
- border-radius: 4px;
104
- height: 32px;
105
- cursor: not-allowed;
106
-
107
- .DshLabels-view-nodata{
108
- display: none;
109
- }
110
- }
111
-
112
- &-tag {
113
- width: fit-content;
114
- margin-right: 10px;
115
- }
116
-
117
- &-nodata {
118
- color: @textColor;
119
- }
120
- }
121
-
122
- &-searchResult {
123
- position: fixed;
124
- z-index: 333;
125
- max-height: 150px;
126
- overflow: auto;
127
- padding: 5px 10px;
128
- background: @white;
129
- box-sizing: border-box;
130
- border-radius: 4px;
131
- box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
132
-
133
- &-close{
134
- position: absolute;
135
- top: 5px;
136
- right: 5px;
137
- z-index: 670;
138
- }
139
-
140
- &-select{
141
- position: relative;
142
- z-index: 666;
143
- margin-right: 16px;
144
- }
145
-
146
- &-list{
147
- .dsh-flex-row-start-start();
148
- flex-wrap: wrap;
149
-
150
- &>li{
151
- display: inline-block;
152
- width: fit-content;
153
- background: #f5f5f5;
154
- margin: 5px 10px 5px 0;
155
- cursor: pointer;
156
- font-size: @textSize;
157
- line-height: 28px;
158
- padding: 0 5px;
159
- border-radius: 3px;
160
-
161
- &:hover{
162
- background: #f0faff;
163
- color:@themeColor;
164
- }
165
-
166
- &.active{
167
- background: #f0faff;
168
- color:@themeColor;
169
- }
170
-
171
- &.selected{
172
- cursor: not-allowed;
173
- background: #f0faff;
174
- color:@themeColor;
175
- &:hover{
176
- background: #f0faff;
177
- color:@themeColor;
178
- }
179
- }
180
- }
181
- }
182
-
183
-
184
-
185
- }
186
-
187
- }