bri-components 1.0.2 → 1.0.5
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.
- package/lib/0.bri-components.min.js +1 -1
- package/lib/1.bri-components.min.js +1 -1
- package/lib/3.bri-components.min.js +1 -1
- package/lib/4.bri-components.min.js +1 -1
- package/lib/5.bri-components.min.js +1 -1
- package/lib/6.bri-components.min.js +1 -1
- package/lib/bri-components.min.js +8 -6
- package/package.json +3 -2
- package/src/.DS_Store +0 -0
- package/src/components/controls/base/DshCascader.vue +1 -1
- package/src/components/controls/base/DshCascaderMultiple.vue +1 -1
- package/src/components/controls/base/DshCheckbox.vue +1 -1
- package/src/components/controls/base/DshSelect.vue +1 -1
- package/src/components/controls/controlMixin.js +10 -15
- package/src/components/form/DshForm.vue +1 -27
- package/src/components/list/DshBox/DshPanel.vue +66 -77
- package/src/components/list/DshFlatTable.vue +16 -18
- package/src/components/list/ZTree.vue +5 -2
- package/src/components/unit/DshFormItem.vue +11 -4
- package/src/components/unit/DshUnit.vue +0 -2
- package/src/index.js +10 -2
- package/src/utils/index.js +5 -0
- package/src/utils/table.js +1002 -0
- package/src/datas/.DS_Store +0 -0
- package/src/datas/common/region.json +0 -1
- package/src/datas/common/resourceData.json +0 -20
- package/src/datas/index.js +0 -11
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bri-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"author": "dengshanghui",
|
|
5
5
|
"description": "a component lib for vue project",
|
|
6
|
-
"main": "
|
|
6
|
+
"main": "src/index.js",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"editor",
|
|
9
9
|
"tinymce"
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"axios": "^0.23.0",
|
|
34
|
+
"bri-datas": "^1.0.8-0",
|
|
34
35
|
"jshint": "^2.12.0",
|
|
35
36
|
"minio": "^7.0.26",
|
|
36
37
|
"stream": "^0.0.2",
|
package/src/.DS_Store
CHANGED
|
Binary file
|
|
@@ -117,9 +117,9 @@
|
|
|
117
117
|
</template>
|
|
118
118
|
|
|
119
119
|
<script>
|
|
120
|
+
import { resourceData } from "bri-datas";
|
|
120
121
|
import controlMixin from "../controlMixin.js";
|
|
121
122
|
import selectMixin from "./selectMixin.js";
|
|
122
|
-
import { resourceData } from "../../../datas/index.js";
|
|
123
123
|
|
|
124
124
|
// optionKind值 'flat'、'dropdown'
|
|
125
125
|
export default {
|
|
@@ -114,9 +114,9 @@
|
|
|
114
114
|
</template>
|
|
115
115
|
|
|
116
116
|
<script>
|
|
117
|
+
import { resourceData } from "bri-datas";
|
|
117
118
|
import controlMixin from "../controlMixin.js";
|
|
118
119
|
import selectMixin from "./selectMixin.js";
|
|
119
|
-
import { resourceData } from "../../../datas/index.js";
|
|
120
120
|
|
|
121
121
|
export default {
|
|
122
122
|
name: "DshSelect",
|
|
@@ -19,8 +19,7 @@ export default {
|
|
|
19
19
|
default () {
|
|
20
20
|
return {};
|
|
21
21
|
}
|
|
22
|
-
}
|
|
23
|
-
isShare: Boolean
|
|
22
|
+
}
|
|
24
23
|
},
|
|
25
24
|
data () {
|
|
26
25
|
return {};
|
|
@@ -38,6 +37,9 @@ export default {
|
|
|
38
37
|
inTable () {
|
|
39
38
|
return !!this.propsObj.inTable;
|
|
40
39
|
},
|
|
40
|
+
isShare () {
|
|
41
|
+
return !!this.propsObj.isShare;
|
|
42
|
+
},
|
|
41
43
|
controlKey () {
|
|
42
44
|
return this.propsObj._key;
|
|
43
45
|
},
|
|
@@ -57,20 +59,13 @@ export default {
|
|
|
57
59
|
},
|
|
58
60
|
// 不同mode模式下readOnly 和disabled样式名
|
|
59
61
|
commonClass () {
|
|
60
|
-
let commonClass = `control-${this.mode}-${
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
? "disabled"
|
|
66
|
-
: "edit"
|
|
67
|
-
)
|
|
62
|
+
let commonClass = `control-${this.mode}-${this.$isReadonly(this.canEdit, this.propsObj)
|
|
63
|
+
? "readonly"
|
|
64
|
+
: this.$isDisabled(this.canEdit, this.propsObj)
|
|
65
|
+
? "disabled"
|
|
66
|
+
: "edit"
|
|
68
67
|
}`;
|
|
69
|
-
|
|
70
|
-
if (this.mode === "rimless" && this.propsObj._line) {
|
|
71
|
-
// otherClass = `control-${this.mode}-span${this.propsObj._span}`;
|
|
72
|
-
}
|
|
73
|
-
return commonClass + " " + otherClass;
|
|
68
|
+
return commonClass;
|
|
74
69
|
}
|
|
75
70
|
},
|
|
76
71
|
methods: {
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
:mode="mode"
|
|
26
26
|
:canEdit="canEdit"
|
|
27
27
|
:formData="formData"
|
|
28
|
-
:isShare="isShare"
|
|
29
28
|
:formItem="formItem"
|
|
30
29
|
:allFormList="allFormList"
|
|
31
30
|
:changedFields="changedFields"
|
|
@@ -141,7 +140,6 @@
|
|
|
141
140
|
labelWidth: [String, Number],
|
|
142
141
|
formItemClass: String,
|
|
143
142
|
formControlClass: String,
|
|
144
|
-
isShare: Boolean,
|
|
145
143
|
showRules: {
|
|
146
144
|
type: Boolean,
|
|
147
145
|
default: true
|
|
@@ -235,31 +233,7 @@
|
|
|
235
233
|
});
|
|
236
234
|
}
|
|
237
235
|
|
|
238
|
-
|
|
239
|
-
if (formItem._displayType === "show") {
|
|
240
|
-
return true;
|
|
241
|
-
} else if (formItem._displayType === "hide") {
|
|
242
|
-
return false;
|
|
243
|
-
} else {
|
|
244
|
-
if (
|
|
245
|
-
(formItem._advRely && formItem._advRely.conditions && formItem._advRely.conditions.length) ||
|
|
246
|
-
(formItem._rely && formItem._rely.length)
|
|
247
|
-
) {
|
|
248
|
-
const isAccord = formItem._advRely && formItem._advRely.conditions && formItem._advRely.conditions.length
|
|
249
|
-
? this.$isAdvRelyAccord(formItem._advRely, formData)
|
|
250
|
-
: this.$isRelyAccord(formItem, formData);
|
|
251
|
-
|
|
252
|
-
formData[formItem._key] = isAccord === true
|
|
253
|
-
? formData[formItem._key] !== undefined
|
|
254
|
-
? formData[formItem._key]
|
|
255
|
-
: this.$deepCopy(formItem._default)
|
|
256
|
-
: undefined;
|
|
257
|
-
|
|
258
|
-
return isAccord;
|
|
259
|
-
} else {
|
|
260
|
-
return true;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
236
|
+
return this.$isAdvRelyShow(formItem, formData);
|
|
263
237
|
},
|
|
264
238
|
getRules (formItem) {
|
|
265
239
|
let rules = [];
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
class="DshPanel-group-title"
|
|
11
11
|
:style="{
|
|
12
12
|
backgroundColor: getBgColor(groupItem),
|
|
13
|
-
color:
|
|
13
|
+
color: '#ffffff'
|
|
14
14
|
}"
|
|
15
15
|
>
|
|
16
16
|
<span class="DshPanel-group-title-name">
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
class="dsh-tip"
|
|
46
46
|
style="position: absolute; top: 0px; left: 0px; width: 100%;"
|
|
47
47
|
>
|
|
48
|
-
{{noDataText}}
|
|
48
|
+
{{ noDataText }}
|
|
49
49
|
</div>
|
|
50
50
|
|
|
51
51
|
<!-- 拖拽 -->
|
|
@@ -64,15 +64,15 @@
|
|
|
64
64
|
@scroll.native="groupScroll(groupItem, groupIndex, $event)"
|
|
65
65
|
>
|
|
66
66
|
<div
|
|
67
|
-
class="list-item"
|
|
68
67
|
v-for="(dataItem, dataIndex) in groupItem.list"
|
|
69
68
|
:key="dataItem._id"
|
|
70
69
|
:id="dataItem._id"
|
|
70
|
+
class="item"
|
|
71
71
|
@click="clickRow(dataItem, dataIndex)"
|
|
72
72
|
>
|
|
73
73
|
<!-- 下拉操作 -->
|
|
74
74
|
<dsh-dropdown
|
|
75
|
-
class="
|
|
75
|
+
class="item-dropdown"
|
|
76
76
|
:dropdownObj="dropdownObj"
|
|
77
77
|
:list="operationList"
|
|
78
78
|
@click="$dshEmit($event, dataItem, dataIndex)"
|
|
@@ -80,11 +80,11 @@
|
|
|
80
80
|
></dsh-dropdown>
|
|
81
81
|
|
|
82
82
|
<!-- 标题 -->
|
|
83
|
-
<div class="
|
|
83
|
+
<div class="item-title dsh-ellipsis">{{ dataItem[titleField] }}</div>
|
|
84
84
|
|
|
85
85
|
<!-- 显示字段 -->
|
|
86
86
|
<div
|
|
87
|
-
class="
|
|
87
|
+
class="item-cols unit"
|
|
88
88
|
v-for="colItem in selfColumns"
|
|
89
89
|
:key="colItem._key"
|
|
90
90
|
>
|
|
@@ -124,33 +124,21 @@
|
|
|
124
124
|
</div>
|
|
125
125
|
</transition-group>
|
|
126
126
|
</dsh-draggable>
|
|
127
|
+
|
|
127
128
|
<!-- 组 操作按钮(添加) -->
|
|
128
129
|
<dsh-buttons
|
|
129
|
-
class="
|
|
130
|
+
class="list-btns"
|
|
130
131
|
:list="groupBtnOperationList"
|
|
131
132
|
@click="$dshEmit($event, { [groupField]: groupItem._key })"
|
|
132
133
|
></dsh-buttons>
|
|
133
134
|
</div>
|
|
134
|
-
|
|
135
135
|
</div>
|
|
136
136
|
</div>
|
|
137
137
|
</template>
|
|
138
138
|
|
|
139
139
|
<script>
|
|
140
|
-
|
|
141
|
-
const colorMap = {
|
|
142
|
-
"#CDE6FF": "#6DAEF2",
|
|
143
|
-
"#C1FCFF": "#40CBD2",
|
|
144
|
-
"#C5FFD9": "#50C979",
|
|
145
|
-
"#FFEDC8": "#FFC53B",
|
|
146
|
-
"#FFDCAC": "#FF9300",
|
|
147
|
-
"#FFD3B6": "#FA6400",
|
|
148
|
-
"#EEB0FF": "#B620E0",
|
|
149
|
-
"#D1B3FF": "#7E41DF",
|
|
150
|
-
"#B1C7FF": "#25428D",
|
|
151
|
-
"#DCDCDC": "#5D5D5D"
|
|
140
|
+
import { resourceData } from "bri-datas";
|
|
152
141
|
|
|
153
|
-
};
|
|
154
142
|
export default {
|
|
155
143
|
name: "DshPanel",
|
|
156
144
|
props: {
|
|
@@ -204,10 +192,10 @@
|
|
|
204
192
|
|
|
205
193
|
getBgColor (groupItem) {
|
|
206
194
|
return this.groupFieldObj._useColor
|
|
207
|
-
? (this.groupFieldObj._data.find(item => item._key === groupItem._key) || { color: "
|
|
208
|
-
: "
|
|
195
|
+
? this.colorMap[(this.groupFieldObj._data.find(item => item._key === groupItem._key) || { color: "color-default" }).color]
|
|
196
|
+
: "color-default";
|
|
209
197
|
},
|
|
210
|
-
colorMap
|
|
198
|
+
colorMap: resourceData.colorMap
|
|
211
199
|
};
|
|
212
200
|
},
|
|
213
201
|
computed: {
|
|
@@ -293,7 +281,7 @@
|
|
|
293
281
|
};
|
|
294
282
|
</script>
|
|
295
283
|
|
|
296
|
-
<style lang="less"
|
|
284
|
+
<style lang="less">
|
|
297
285
|
.DshPanel {
|
|
298
286
|
min-width: 100%;
|
|
299
287
|
height: 100%;
|
|
@@ -317,6 +305,7 @@
|
|
|
317
305
|
display: flex;
|
|
318
306
|
border-radius: 10px 10px 0px 0px;
|
|
319
307
|
font-size: 14px;
|
|
308
|
+
|
|
320
309
|
&-name {
|
|
321
310
|
max-width: 120px;
|
|
322
311
|
}
|
|
@@ -330,77 +319,77 @@
|
|
|
330
319
|
flex: 1;
|
|
331
320
|
min-height: 0px;
|
|
332
321
|
border: 1px dashed #cccccc;
|
|
333
|
-
padding: 10px 10px 40px;
|
|
334
322
|
border-top: none;
|
|
335
|
-
|
|
323
|
+
display: flex;
|
|
324
|
+
flex-direction: column;
|
|
336
325
|
|
|
337
326
|
.list-drag {
|
|
338
327
|
width: 100%;
|
|
339
|
-
|
|
328
|
+
flex: 1;
|
|
329
|
+
min-height: 0px;
|
|
330
|
+
|
|
340
331
|
&-transition {
|
|
341
332
|
display: block;
|
|
342
333
|
width: 100%;
|
|
343
334
|
height: 100%;
|
|
335
|
+
padding: 10px;
|
|
344
336
|
overflow: auto;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
.list-item {
|
|
348
|
-
margin-bottom: 10px;
|
|
349
|
-
height: 60px;
|
|
350
|
-
background: #FFFFFF;
|
|
351
|
-
border: 1px solid rgba(102, 110, 126, 0.1);
|
|
352
|
-
border-radius: 4px;
|
|
353
|
-
cursor: pointer;
|
|
354
|
-
position: relative;
|
|
355
|
-
padding: 10px 17px;
|
|
356
337
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
338
|
+
.item {
|
|
339
|
+
height: 60px;
|
|
340
|
+
padding: 10px 17px;
|
|
341
|
+
margin-bottom: 10px;
|
|
342
|
+
border: 1px solid rgba(102, 110, 126, 0.1);
|
|
343
|
+
border-radius: 4px;
|
|
344
|
+
background: #FFFFFF;
|
|
345
|
+
cursor: pointer;
|
|
346
|
+
position: relative;
|
|
362
347
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
color: #515A6E;
|
|
369
|
-
margin-bottom: 2px;
|
|
370
|
-
}
|
|
348
|
+
&-dropdown {
|
|
349
|
+
position: absolute;
|
|
350
|
+
top: 5px;
|
|
351
|
+
right: 5px;
|
|
352
|
+
}
|
|
371
353
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}
|
|
381
|
-
&-colon {
|
|
354
|
+
&-title {
|
|
355
|
+
width: calc(100% - 22px);
|
|
356
|
+
margin-bottom: 2px;
|
|
357
|
+
font-family: Source Han Sans CN;
|
|
358
|
+
font-size: 14px;
|
|
359
|
+
font-weight: 500;
|
|
360
|
+
color: #515A6E;
|
|
361
|
+
}
|
|
382
362
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
363
|
+
&-cols {}
|
|
364
|
+
|
|
365
|
+
.unit {
|
|
366
|
+
display: flex;
|
|
367
|
+
flex-direction: row;
|
|
368
|
+
color: #515A6E;
|
|
369
|
+
&-label {
|
|
370
|
+
max-width: 60px;
|
|
371
|
+
}
|
|
372
|
+
&-colon {
|
|
373
|
+
|
|
374
|
+
}
|
|
375
|
+
&-value {
|
|
376
|
+
flex: 1;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
386
379
|
}
|
|
387
380
|
}
|
|
388
381
|
}
|
|
389
|
-
|
|
382
|
+
|
|
383
|
+
.list-btns {
|
|
390
384
|
width: 100%;
|
|
385
|
+
height: 40px;
|
|
386
|
+
padding: 0px 10px;
|
|
391
387
|
text-align: center;
|
|
392
|
-
height: 33px;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
388
|
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
.DshPanel {
|
|
401
|
-
&-group-list-btns {
|
|
402
|
-
.ivu-btn {
|
|
403
|
-
background: transparent;
|
|
389
|
+
.ivu-btn {
|
|
390
|
+
background: transparent;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
404
393
|
}
|
|
405
394
|
}
|
|
406
395
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="`DshFlatTable control
|
|
2
|
+
<div :class="`DshFlatTable control-default`">
|
|
3
3
|
<!-- 表格内容 -->
|
|
4
4
|
<div class="DshFlatTable-block">
|
|
5
5
|
<table
|
|
@@ -74,8 +74,6 @@
|
|
|
74
74
|
class="td-inner"
|
|
75
75
|
:style="{
|
|
76
76
|
padding: '5px 8px 16px'
|
|
77
|
-
// margin: isShowCompare(col, row, oldListData[rowIndex]) ? '-1px' : undefined,
|
|
78
|
-
// border: isShowCompare(col, row, oldListData[rowIndex]) ? '1px solid #ed4014' : undefined
|
|
79
77
|
}"
|
|
80
78
|
>
|
|
81
79
|
<!--对比值 -->
|
|
@@ -89,12 +87,10 @@
|
|
|
89
87
|
>
|
|
90
88
|
<dsh-unit
|
|
91
89
|
class="td-inner-compare-unit"
|
|
92
|
-
:mode="mode"
|
|
93
90
|
:canEdit="getUnitCanEdit(col, row)"
|
|
94
91
|
:parentData="listData"
|
|
95
92
|
:formData="row"
|
|
96
93
|
:formItem="col"
|
|
97
|
-
:isShare="isShare"
|
|
98
94
|
:rowIndex="rowIndex"
|
|
99
95
|
@blur="controlBlur(null, col, row, arguments)"
|
|
100
96
|
@change="$dispatchEvent(operationMap.changeVal, col, row, rowIndex, arguments)"
|
|
@@ -103,12 +99,10 @@
|
|
|
103
99
|
|
|
104
100
|
<dsh-unit
|
|
105
101
|
v-else
|
|
106
|
-
:mode="mode"
|
|
107
102
|
:canEdit="getUnitCanEdit(col, row)"
|
|
108
103
|
:parentData="listData"
|
|
109
104
|
:formData="row"
|
|
110
105
|
:formItem="col"
|
|
111
|
-
:isShare="isShare"
|
|
112
106
|
:rowIndex="rowIndex"
|
|
113
107
|
@blur="controlBlur(null, col, row, arguments)"
|
|
114
108
|
@change="$dispatchEvent(operationMap.changeVal, col, row, rowIndex, arguments)"
|
|
@@ -184,11 +178,6 @@
|
|
|
184
178
|
DshUnit
|
|
185
179
|
},
|
|
186
180
|
props: {
|
|
187
|
-
mode: {
|
|
188
|
-
type: String,
|
|
189
|
-
default: "default"
|
|
190
|
-
},
|
|
191
|
-
|
|
192
181
|
canEdit: {
|
|
193
182
|
type: Boolean,
|
|
194
183
|
default: true
|
|
@@ -218,13 +207,18 @@
|
|
|
218
207
|
}
|
|
219
208
|
},
|
|
220
209
|
|
|
221
|
-
|
|
210
|
+
outObj: {
|
|
222
211
|
type: Object,
|
|
223
212
|
default () {
|
|
224
213
|
return {};
|
|
225
214
|
}
|
|
226
215
|
},
|
|
227
|
-
|
|
216
|
+
propsObj: {
|
|
217
|
+
type: Object,
|
|
218
|
+
default () {
|
|
219
|
+
return {};
|
|
220
|
+
}
|
|
221
|
+
}
|
|
228
222
|
},
|
|
229
223
|
data () {
|
|
230
224
|
return {
|
|
@@ -251,6 +245,7 @@
|
|
|
251
245
|
|
|
252
246
|
selfPropsObj () {
|
|
253
247
|
return {
|
|
248
|
+
isShare: false, // 是否是分享页在用
|
|
254
249
|
_contentHeight: 500,
|
|
255
250
|
_useSelection: false, // 使用选择列
|
|
256
251
|
_useIndex: true, // 使用序号列
|
|
@@ -262,6 +257,9 @@
|
|
|
262
257
|
...this.propsObj
|
|
263
258
|
};
|
|
264
259
|
},
|
|
260
|
+
isShare () {
|
|
261
|
+
return this.selfPropsObj.isShare;
|
|
262
|
+
},
|
|
265
263
|
contentHeight () {
|
|
266
264
|
return this.selfPropsObj._contentHeight;
|
|
267
265
|
},
|
|
@@ -283,10 +281,10 @@
|
|
|
283
281
|
disabledOldDataRow () {
|
|
284
282
|
return this.selfPropsObj._disabledOldDataRow;
|
|
285
283
|
},
|
|
286
|
-
|
|
284
|
+
|
|
285
|
+
useCompare () {
|
|
287
286
|
return !!this.oldListData.length;
|
|
288
287
|
},
|
|
289
|
-
|
|
290
288
|
showColumns () {
|
|
291
289
|
const operationList = this.$getOperationList(["delete"]);
|
|
292
290
|
const showColumns = [
|
|
@@ -328,7 +326,7 @@
|
|
|
328
326
|
: []
|
|
329
327
|
),
|
|
330
328
|
|
|
331
|
-
...this.columns.filter(colItem => colItem._displayType !== "hide"),
|
|
329
|
+
...this.columns.filter(colItem => colItem._displayType !== "hide" && this.$isAdvRelyShow(colItem, this.outObj)),
|
|
332
330
|
|
|
333
331
|
...(
|
|
334
332
|
this.canEdit && operationList.length
|
|
@@ -501,7 +499,7 @@
|
|
|
501
499
|
(!col.dependRowCanEdit || row.canEdit !== false); // 在老数据行里某些列不可编辑
|
|
502
500
|
},
|
|
503
501
|
isShowCompare (col, row, oldRow = {}) {
|
|
504
|
-
return this.
|
|
502
|
+
return this.useCompare && ["number"].includes(col._type) &&
|
|
505
503
|
!(this.$isEmptyData(row[col._key]) && this.$isEmptyData(oldRow[col._key])) &&
|
|
506
504
|
row[col._key] !== oldRow[col._key];
|
|
507
505
|
},
|
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
11
|
<div class="ZTree-tree">
|
|
12
|
-
<Tree
|
|
12
|
+
<Tree
|
|
13
|
+
:data="treeData"
|
|
14
|
+
:render="renderContent"
|
|
15
|
+
></Tree>
|
|
13
16
|
</div>
|
|
14
17
|
|
|
15
18
|
<!-- 添加节点弹窗 -->
|
|
@@ -38,7 +41,7 @@
|
|
|
38
41
|
</template>
|
|
39
42
|
|
|
40
43
|
<script>
|
|
41
|
-
import { resourceData } from "
|
|
44
|
+
import { resourceData } from "bri-datas";
|
|
42
45
|
|
|
43
46
|
const loop = (arr) => {
|
|
44
47
|
return arr.map(item => {
|
|
@@ -40,6 +40,10 @@
|
|
|
40
40
|
<span class="DshFormItem-label-name-sign">!有更新</span>
|
|
41
41
|
</template>
|
|
42
42
|
</slot>
|
|
43
|
+
<dsh-render
|
|
44
|
+
v-if="formItem._tipsRender"
|
|
45
|
+
:render="tipsRender(formItem,formData)"
|
|
46
|
+
></dsh-render>
|
|
43
47
|
</span>
|
|
44
48
|
</Ctooltip>
|
|
45
49
|
</span>
|
|
@@ -77,7 +81,6 @@
|
|
|
77
81
|
ref="control"
|
|
78
82
|
:is="componentNameMap[formItem._type] || 'DshUndeveloped'"
|
|
79
83
|
:mode="mode"
|
|
80
|
-
:isShare="isShare"
|
|
81
84
|
:canEdit="canEdit"
|
|
82
85
|
:value="formData"
|
|
83
86
|
:propsObj="formItem"
|
|
@@ -122,11 +125,12 @@
|
|
|
122
125
|
},
|
|
123
126
|
|
|
124
127
|
labelWidth: [String, Number],
|
|
125
|
-
formControlClass: String
|
|
126
|
-
isShare: Boolean
|
|
128
|
+
formControlClass: String
|
|
127
129
|
},
|
|
128
130
|
data () {
|
|
129
|
-
return {
|
|
131
|
+
return {
|
|
132
|
+
showTipModal: false
|
|
133
|
+
};
|
|
130
134
|
},
|
|
131
135
|
computed: {
|
|
132
136
|
selfLabelStyle () {
|
|
@@ -151,6 +155,9 @@
|
|
|
151
155
|
|
|
152
156
|
changeField (...params) {
|
|
153
157
|
this.$emit("changeField", ...params);
|
|
158
|
+
},
|
|
159
|
+
tipsRender (formItem, formData) {
|
|
160
|
+
return formItem._tipsRender.call(this, formItem, formData);
|
|
154
161
|
}
|
|
155
162
|
}
|
|
156
163
|
};
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
<component
|
|
18
18
|
:is="componentNameMap[formItem._type]"
|
|
19
19
|
:mode="mode"
|
|
20
|
-
:isShare="isShare"
|
|
21
20
|
:canEdit="canEdit"
|
|
22
21
|
:parentData="parentData"
|
|
23
22
|
:value="formData"
|
|
@@ -42,7 +41,6 @@
|
|
|
42
41
|
props: {
|
|
43
42
|
indexStr: String,
|
|
44
43
|
rowIndex: Number,
|
|
45
|
-
isShare: Boolean,
|
|
46
44
|
parentData: Array
|
|
47
45
|
},
|
|
48
46
|
data () {
|
package/src/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import utilMap from "./utils/index.js";
|
|
2
|
+
|
|
3
|
+
// 组件 -第三方
|
|
2
4
|
import ViewUI from "view-design";
|
|
3
5
|
import DshDraggable from "vuedraggable";
|
|
4
6
|
import DshCropper from "vue-cropperjs";
|
|
@@ -146,7 +148,6 @@ const map = {
|
|
|
146
148
|
DshFileShow
|
|
147
149
|
};
|
|
148
150
|
const install = function (Vue, opts = {}) {
|
|
149
|
-
const { globalMap } = opts;
|
|
150
151
|
ViewUI.LoadingBar.config({
|
|
151
152
|
color: "#2d8cf0",
|
|
152
153
|
failedColor: "red",
|
|
@@ -154,6 +155,13 @@ const install = function (Vue, opts = {}) {
|
|
|
154
155
|
});
|
|
155
156
|
Vue.use(ViewUI);
|
|
156
157
|
|
|
158
|
+
// 挂载方法
|
|
159
|
+
Object.keys(utilMap).forEach(key => {
|
|
160
|
+
Vue.prototype[`$${key}`] = utilMap[key];
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// 挂载组件
|
|
164
|
+
const { globalMap } = opts;
|
|
157
165
|
const componentMap = {
|
|
158
166
|
...map,
|
|
159
167
|
...(globalMap || {})
|