bri-components 1.2.54 → 1.2.56

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.
@@ -9,18 +9,15 @@
9
9
  <div @click="clickInput">
10
10
  <slot>
11
11
  <!-- 编辑 -->
12
- <bri-control-input
12
+ <dsh-control-input
13
13
  v-if="canEdit"
14
- :class="{
15
- ...commonClass
16
- }"
17
- :canEdit="finalCanEdit"
14
+ :class="commonClass"
18
15
  :value="curValList"
19
- :inputIcon="inputIcon"
16
+ :disabled="selfPropsObj._disabled"
20
17
  :propsObj="selfPropsObj"
21
18
  @deleteItem="clickDeleteItem"
22
19
  @clear="clickClear"
23
- ></bri-control-input>
20
+ ></dsh-control-input>
24
21
 
25
22
  <!-- 表格查看 -->
26
23
  <div
@@ -283,7 +280,7 @@
283
280
  computed: {
284
281
  selfPropsObj () {
285
282
  return {
286
- _multiple: false,
283
+ _icon: this.multipleMode ? "ios-people" : "ios-person",
287
284
  _highSearch: false,
288
285
 
289
286
  ...this.propsObj,
@@ -293,9 +290,6 @@
293
290
  highSearch () {
294
291
  return this.isOnSearch ? true : this.selfPropsObj._highSearch;
295
292
  },
296
- inputIcon () {
297
- return this.multipleMode ? "ios-people" : "ios-person";
298
- },
299
293
 
300
294
  curCheckAll () {
301
295
  return this.userList.length && this.userList.every(userItem =>
@@ -239,7 +239,7 @@
239
239
  input,
240
240
  .ivu-select-selection,
241
241
  .ivu-input-number,
242
- .BriControlInput,
242
+ .DshControlInput,
243
243
  .DshDaterange-item {
244
244
  border-radius: 0px!important;
245
245
  }
@@ -112,6 +112,18 @@
112
112
 
113
113
  <template v-else>
114
114
  {{ colItem.title }}
115
+ <Tooltip
116
+ v-if="colItem._comment"
117
+ :content="colItem._comment"
118
+ :transfer="true"
119
+ placement="top-start"
120
+ max-width="200"
121
+ >
122
+ <Icon
123
+ type="ios-help-circle-outline"
124
+ size="16"
125
+ />
126
+ </Tooltip>
115
127
  </template>
116
128
  </slot>
117
129
  </div>
@@ -79,6 +79,7 @@
79
79
 
80
80
  <slot>
81
81
  <component
82
+ class="DshFormUnit-control-component"
82
83
  ref="control"
83
84
  :is="curComponentName"
84
85
  :canEdit="canEdit"
@@ -247,6 +248,10 @@
247
248
  display: flex;
248
249
  justify-content: flex-end;
249
250
  align-items: center;
251
+
252
+ &-component {
253
+ width: 100%;
254
+ }
250
255
  }
251
256
  }
252
257
 
package/src/index.js CHANGED
@@ -25,7 +25,7 @@ import DshDefaultSearch from "./components/form/DshDefaultSearch.vue";
25
25
  import DshFormUnit from "./components/unit/DshFormUnit.vue";
26
26
  import DshListUnit from "./components/unit/DshListUnit.vue";
27
27
  // controls
28
- import BriControlInput from "./components/controls/BriControlInput.vue";
28
+ import DshControlInput from "./components/controls/DshControlInput.vue";
29
29
  import DshInput from "./components/controls/base/DshInput/DshInput.vue";
30
30
  import DshNumber from "./components/controls/base/DshNumber/DshNumber.vue";
31
31
  import DshSelect from "./components/controls/base/DshSelect/DshSelect.vue";
@@ -115,7 +115,7 @@ const map = {
115
115
  DshFormUnit,
116
116
  DshListUnit,
117
117
  // controls
118
- BriControlInput,
118
+ DshControlInput,
119
119
  DshInput,
120
120
  DshNumber,
121
121
  DshSelect,
@@ -195,7 +195,7 @@ export {
195
195
  DshFormUnit,
196
196
  DshListUnit,
197
197
  // controls
198
- BriControlInput,
198
+ DshControlInput,
199
199
  DshInput,
200
200
  DshNumber,
201
201
  DshSelect,
@@ -1,345 +0,0 @@
1
- <template>
2
- <div class="InfoCascader">
3
- <dsh-modal
4
- v-model="modalVal"
5
- mode="middle"
6
- :propsObj="modalPropsObj"
7
- >
8
- <dsh-input
9
- class="InfoCascader-search"
10
- :value="searchData"
11
- :propsObj="searchPropsObj"
12
- ></dsh-input>
13
-
14
- <div class="InfoCascader-content">
15
- <div class="InfoCascader-content-left">
16
- <Tree
17
- v-if="show"
18
- expand-node
19
- :data="treeData"
20
- ></Tree>
21
- </div>
22
-
23
- <div class="InfoCascader-content-right">
24
- <div class="InfoCascader-content-right-title">
25
- {{ curName }}说明
26
- </div>
27
- <p
28
- class="InfoCascader-content-right-content"
29
- v-html="description"
30
- ></p>
31
- </div>
32
- </div>
33
-
34
- <div class="InfoCascader-footer">
35
- <dsh-buttons
36
- class="InfoCascader-footer-btns"
37
- :list="$getOperationList(['canCancel', 'canConfirm'])"
38
- @click="$dispatchEvent($event)"
39
- ></dsh-buttons>
40
- </div>
41
- </dsh-modal>
42
- </div>
43
- </template>
44
-
45
- <script>
46
- export default {
47
- name: "InfoCascader",
48
- props: {
49
- showModal: {
50
- type: Boolean,
51
- default: false
52
- },
53
-
54
- value: {
55
- type: Array,
56
- default () {
57
- return [];
58
- }
59
- },
60
- data: {
61
- type: Array,
62
- default () {
63
- return [];
64
- }
65
- },
66
- propsObj: {
67
- type: Object,
68
- default () {
69
- return {};
70
- }
71
- }
72
- },
73
- data () {
74
- return {
75
- searchData: {
76
- search: ""
77
- },
78
- searchPropsObj: {
79
- _key: "search",
80
- _name: "关键字搜索"
81
- },
82
- curSelect: {},
83
-
84
- show: true,
85
- curName: "",
86
- description: "",
87
-
88
- operationMap: {
89
- canCancel: {
90
- name: "取消",
91
- type: "canCancel",
92
- class: "z-default",
93
- event: "clickCancel"
94
- },
95
- canConfirm: {
96
- name: "确定",
97
- btnType: "primary",
98
- type: "clickConfirm",
99
- event: "clickConfirm",
100
- class: "z-primary"
101
- }
102
- }
103
- };
104
- },
105
- computed: {
106
- modalVal: {
107
- get () {
108
- return this.showModal;
109
- },
110
- set (val) {
111
- this.$emit("close", val);
112
- }
113
- },
114
-
115
- modalPropsObj () {
116
- return {
117
- title: this.propsObj._name
118
- };
119
- },
120
- selfPropsObj () {
121
- return {
122
- ...this.propsObj
123
- };
124
- },
125
- saveKey () {
126
- return this.selfPropsObj._saveKey;
127
- },
128
- resourceKey () {
129
- return this.selfPropsObj._resourceKey;
130
- },
131
-
132
- initData () {
133
- return this.loop(this.data, null);
134
- },
135
- treeData () {
136
- // 内容为空时,查询所有
137
- if (!this.searchData.search) {
138
- return this.initData;
139
- } else {
140
- const loop = (value, treeList) => {
141
- let newarr = [];
142
- treeList.forEach(element => {
143
- if (element.children && element.children.length) {
144
- const ab = loop(value, element.children);
145
- const obj = {
146
- ...element,
147
- expand: true,
148
- children: ab
149
- };
150
- if (ab && ab.length) {
151
- newarr.push(obj);
152
- } else if (element.title.indexOf(value) > -1) {
153
- element.expand = true;
154
- newarr.push(element);
155
- }
156
- } else {
157
- if (element.title.indexOf(value) > -1) {
158
- newarr.push(element);
159
- }
160
- }
161
- });
162
- return newarr;
163
- };
164
-
165
- return loop(this.searchData.search, this.initData);
166
- }
167
- }
168
- },
169
- created () {
170
- this.init();
171
- },
172
- methods: {
173
- init () {
174
- this.curSelect.keys = this.value;
175
-
176
- if (this.value.length) {
177
- // 回显已选择的名称
178
- const loop = (arr) => {
179
- for (let item of arr) {
180
- if (
181
- item.keys.length === this.value.length &&
182
- item.keys.every((code, idx) => code === this.value[idx])
183
- ) {
184
- this.curName = item.name;
185
- break;
186
- }
187
- if (item.children.length) {
188
- loop(item.children);
189
- }
190
- }
191
- };
192
- loop(this.initData);
193
- this.getDescription(this.value);
194
- }
195
- },
196
-
197
- clickCancel () {
198
- this.$emit("close", false);
199
- },
200
- clickConfirm () {
201
- if (this.curName) {
202
- this.$emit("input", this.curSelect.keys);
203
- this.$emit("change", this.curSelect.keys);
204
- this.$emit("close", false);
205
- } else {
206
- this.$Message.warning(`请选择${this.propsObj._name}!`);
207
- }
208
- },
209
- change (node) {
210
- this.curName = node.name;
211
-
212
- if (
213
- this.curSelect.keys &&
214
- this.curSelect.keys.length === node.keys.length &&
215
- node.keys.length &&
216
- node.keys.every((code, idx) => code === this.curSelect.keys[idx])
217
- ) {
218
- this.curSelect = {};
219
- } else {
220
- if (!this.propsObj._cascaderLevel || node.level == this.propsObj._cascaderLevel || !node.children.length) {
221
- this.curSelect = node;
222
- }
223
- this.getDescription(node.keys);
224
- }
225
- },
226
-
227
- loop (data = [], level) {
228
- return data
229
- ? data.reduce((arr, item) => {
230
- item.expand = false;
231
- if (this.value.length) {
232
- let arr = this.$getTreeLinealDatas(this.value, this.data, undefined, this.saveKey);
233
- arr.forEach(i => { i.expand = true; });
234
- }
235
- const newItem = {
236
- ...item,
237
- value: item._key,
238
- title: item.name,
239
- disabled: this.propsObj._cascaderLevel ? (item.level < this.propsObj._cascaderLevel) : true,
240
- render: (h, { root, node, data }) => {
241
- return h("span", {
242
- class: {
243
- "ivu-tree-title-selected": this.curSelect.keys && this.curSelect.keys.length && this.curSelect.keys.length === data.keys.length && this.curSelect.keys.every((code, idx) => code === data.keys[idx])
244
- },
245
- style: {
246
- display: "inline-block",
247
- width: "100%"
248
- },
249
- on: {
250
- click: () => {
251
- this.change(data);
252
- }
253
- }
254
- }, data.title);
255
- }
256
- };
257
- if (!level || level > item.level) {
258
- newItem.children = this.loop(item.children, level);
259
- }
260
- arr.push(newItem);
261
-
262
- return arr;
263
- }, [])
264
- : [];
265
- },
266
- getDescription (nodeKeys) {
267
- this.$https({
268
- url: {
269
- module: "sheet",
270
- name: "getResourceDescription"
271
- },
272
- params: {
273
- resourceKey: this.resourceKey,
274
- nodeKeys
275
- },
276
- callback: data => {
277
- this.description = data;
278
- }
279
- });
280
- }
281
- }
282
- };
283
- </script>
284
-
285
- <style lang="less">
286
- .InfoCascader {
287
- height: 100%;
288
-
289
- &-search {
290
- padding: 24px 24px 0;
291
- width: 100%;
292
- }
293
-
294
- &-content {
295
- height: calc(100% - 142px);
296
- margin: 5px 24px 24px;
297
- display: flex;
298
- border: 1px solid #E5E5E5;
299
-
300
- &-left {
301
- flex: 1;
302
- padding: 5px 0 5px 10px;
303
- overflow: auto;
304
- border-right: 1px solid #E5E5E5;
305
- }
306
-
307
- &-right {
308
- flex: 1;
309
-
310
- &-title {
311
- border-bottom: 1px solid #E5E5E5;
312
- font-weight: 700;
313
- // height: 32px;
314
- // line-height: 32px;
315
-
316
- padding: 6px 16px;
317
- }
318
-
319
- &-content {
320
- height: calc(100% - 32px);
321
- overflow: auto;
322
- padding: 16px;
323
- white-space: pre-line;
324
- }
325
- }
326
-
327
- .ivu-tree-title-selected {
328
- color: #3D84EE;
329
- background-color: #eee;
330
- }
331
-
332
- .ivu-tree-empty {
333
- text-align: center;
334
- }
335
- }
336
-
337
- &-footer {
338
- &-btns {
339
- display: flex;
340
- justify-content: flex-end;
341
- padding-right: 16px;
342
- }
343
- }
344
- }
345
- </style>