bri-components 1.3.12 → 1.3.14
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/package.json +1 -1
- package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +1 -0
- package/src/components/controls/base/DshNumber/DshNumber.vue +1 -0
- package/src/components/controls/base/DshSelect/DshCheckbox.vue +8 -8
- package/src/components/controls/base/DshSelect/DshSelect.vue +8 -8
- package/src/components/controls/mixins/selectMixin.js +24 -15
- package/src/components/controls/senior/selectUsers/selectUsers.vue +6 -2
- package/src/components/list/BriFlatTable.vue +4 -2
- package/src/components/list/DshCascaderTable.vue +1 -0
- package/src/components/unit/DshFormUnit.vue +0 -6
- package/src/components/unit/DshListUnit.vue +1 -0
- package/src/components/unit/unitMixin.js +6 -0
- package/src/utils/table.js +4 -3
package/package.json
CHANGED
|
@@ -22,14 +22,14 @@
|
|
|
22
22
|
>
|
|
23
23
|
<Checkbox
|
|
24
24
|
v-for="(item, index) in listData"
|
|
25
|
-
:key="item
|
|
25
|
+
:key="item[saveKey]"
|
|
26
26
|
:class="getItemClass(item)"
|
|
27
27
|
:style="getItemColorStyle(item)"
|
|
28
|
-
:label="item
|
|
28
|
+
:label="item[saveKey]"
|
|
29
29
|
:disabled="getCheckItemDisabled(item, index)"
|
|
30
30
|
:border="useColor"
|
|
31
31
|
>
|
|
32
|
-
<span>{{ item.name || item._name }}</span>
|
|
32
|
+
<span>{{ item[nameKey] || item.name || item._name }}</span>
|
|
33
33
|
</Checkbox>
|
|
34
34
|
</CheckboxGroup>
|
|
35
35
|
</template>
|
|
@@ -61,16 +61,16 @@
|
|
|
61
61
|
>
|
|
62
62
|
<Option
|
|
63
63
|
v-for="(item, index) in listData"
|
|
64
|
-
:key="item
|
|
65
|
-
:value="item
|
|
66
|
-
:label="item.name || item._name"
|
|
64
|
+
:key="item[saveKey]"
|
|
65
|
+
:value="item[saveKey]"
|
|
66
|
+
:label="item[nameKey] || item.name || item._name"
|
|
67
67
|
:disabled="getCheckItemDisabled(item, index)"
|
|
68
68
|
>
|
|
69
69
|
<Checkbox :value="getItemCheckStatus(item)"></Checkbox>
|
|
70
70
|
|
|
71
71
|
<slot :item="item"></slot>
|
|
72
72
|
|
|
73
|
-
<span>{{ item.name || item._name }}</span>
|
|
73
|
+
<span>{{ item[nameKey] || item.name || item._name }}</span>
|
|
74
74
|
</Option>
|
|
75
75
|
</Select>
|
|
76
76
|
</template>
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
changeCheckValue (item) {
|
|
151
151
|
this.clickCheckItem({
|
|
152
152
|
...item,
|
|
153
|
-
|
|
153
|
+
[this.saveKey]: item.value
|
|
154
154
|
});
|
|
155
155
|
}
|
|
156
156
|
}
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
>
|
|
24
24
|
<Radio
|
|
25
25
|
v-for="(item, index) in listData"
|
|
26
|
-
:key="item
|
|
26
|
+
:key="item[saveKey]"
|
|
27
27
|
:class="getItemClass(item)"
|
|
28
28
|
:style="getItemColorStyle(item)"
|
|
29
|
-
:value="curVal === item
|
|
30
|
-
:label="item
|
|
29
|
+
:value="curVal === item[saveKey]"
|
|
30
|
+
:label="item[saveKey]"
|
|
31
31
|
:disabled="getRadioItemDisabled(item, index)"
|
|
32
32
|
:border="useColor"
|
|
33
33
|
@click.native.stop="cancelRadioItemSelect(item, index)"
|
|
34
34
|
>
|
|
35
|
-
<span @click.stop="0">{{ item.name || item._name }}</span>
|
|
35
|
+
<span @click.stop="0">{{ item[nameKey] || item.name || item._name }}</span>
|
|
36
36
|
</Radio>
|
|
37
37
|
</RadioGroup>
|
|
38
38
|
</template>
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
<!-- </Option>必须和输出内容在一行,否则出现空格导致_filterable出bug -->
|
|
62
62
|
<Option
|
|
63
63
|
v-for="(item, index) in listData"
|
|
64
|
-
:key="item
|
|
65
|
-
:value="item
|
|
66
|
-
:label="item.name || item._name"
|
|
64
|
+
:key="item[saveKey]"
|
|
65
|
+
:value="item[saveKey]"
|
|
66
|
+
:label="item[nameKey] || item.name || item._name"
|
|
67
67
|
:disabled="getRadioItemDisabled(item, index)"
|
|
68
68
|
>
|
|
69
69
|
<Icon
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
|
|
77
77
|
<slot :item="item"></slot>
|
|
78
78
|
|
|
79
|
-
<span>{{ item.name || item._name }}</span>
|
|
79
|
+
<span>{{ item[nameKey] || item.name || item._name }}</span>
|
|
80
80
|
</Option>
|
|
81
81
|
</Select>
|
|
82
82
|
</template>
|
|
@@ -15,6 +15,8 @@ export default {
|
|
|
15
15
|
computed: {
|
|
16
16
|
basePropsObj () {
|
|
17
17
|
return {
|
|
18
|
+
_saveKey: "_key",
|
|
19
|
+
_nameKey: "name",
|
|
18
20
|
_optionKind: "dropdown", // "flat"、"dropdown"
|
|
19
21
|
colorMap: resourceData.colorMap,
|
|
20
22
|
_useColor: false,
|
|
@@ -28,6 +30,12 @@ export default {
|
|
|
28
30
|
...this.commonDealPropsObj
|
|
29
31
|
};
|
|
30
32
|
},
|
|
33
|
+
saveKey () {
|
|
34
|
+
return this.selfPropsObj._saveKey;
|
|
35
|
+
},
|
|
36
|
+
nameKey () {
|
|
37
|
+
return this.selfPropsObj._nameKey;
|
|
38
|
+
},
|
|
31
39
|
showType () {
|
|
32
40
|
return this.selfPropsObj._optionKind;
|
|
33
41
|
},
|
|
@@ -49,8 +57,8 @@ export default {
|
|
|
49
57
|
if (this.selectFilterVals.length) {
|
|
50
58
|
listData = listData.filter(item =>
|
|
51
59
|
this.reverseFilter
|
|
52
|
-
? !this.selectFilterVals.includes(item.
|
|
53
|
-
: this.selectFilterVals.includes(item.
|
|
60
|
+
? !this.selectFilterVals.includes(item[this.saveKey])
|
|
61
|
+
: this.selectFilterVals.includes(item[this.saveKey])
|
|
54
62
|
);
|
|
55
63
|
}
|
|
56
64
|
|
|
@@ -64,7 +72,7 @@ export default {
|
|
|
64
72
|
curValName: {
|
|
65
73
|
get () {
|
|
66
74
|
return this.curValObj
|
|
67
|
-
? this.curValObj.name || this.curValObj._name
|
|
75
|
+
? this.curValObj[this.nameKey] || this.curValObj.name || this.curValObj._name
|
|
68
76
|
: "";
|
|
69
77
|
},
|
|
70
78
|
set (val) {
|
|
@@ -83,7 +91,7 @@ export default {
|
|
|
83
91
|
return this.curValList.map(key => this.getItemObj(key));
|
|
84
92
|
},
|
|
85
93
|
curValNameList () {
|
|
86
|
-
return this.curValObjList.map(item => item.name || item._name);
|
|
94
|
+
return this.curValObjList.map(item => item[this.nameKey] || item.name || item._name);
|
|
87
95
|
},
|
|
88
96
|
showMulVal () {
|
|
89
97
|
return this.$isEmptyData(this.curValList)
|
|
@@ -106,18 +114,18 @@ export default {
|
|
|
106
114
|
// 单选模式 点击选项
|
|
107
115
|
clickRadioItem (item, index) {
|
|
108
116
|
if (!this.getRadioItemDisabled(item)) {
|
|
109
|
-
if (this.curVal === item.
|
|
117
|
+
if (this.curVal === item[this.saveKey]) {
|
|
110
118
|
if (this.clearable) {
|
|
111
119
|
this.curVal = "";
|
|
112
120
|
}
|
|
113
121
|
} else {
|
|
114
|
-
this.curVal = item.
|
|
122
|
+
this.curVal = item[this.saveKey];
|
|
115
123
|
}
|
|
116
124
|
}
|
|
117
125
|
},
|
|
118
126
|
// 单选模式 取消选择项
|
|
119
127
|
cancelRadioItemSelect (item, index) {
|
|
120
|
-
if (this.curVal === item.
|
|
128
|
+
if (this.curVal === item[this.saveKey]) {
|
|
121
129
|
this.clickRadioItem(item, index);
|
|
122
130
|
}
|
|
123
131
|
},
|
|
@@ -125,21 +133,22 @@ export default {
|
|
|
125
133
|
clickCheckItem (item, index) {
|
|
126
134
|
if (!this.getCheckItemDisabled(item)) {
|
|
127
135
|
this.curValList = this.getItemCheckStatus(item)
|
|
128
|
-
? this.curValList.filter(key => key !== item.
|
|
129
|
-
: [...this.curValList, item.
|
|
136
|
+
? this.curValList.filter(key => key !== item[this.saveKey])
|
|
137
|
+
: [...this.curValList, item[this.saveKey]];
|
|
130
138
|
}
|
|
131
139
|
},
|
|
132
140
|
|
|
133
141
|
/* ------- 方法 ------- */
|
|
134
142
|
// 获取某项的对象数据
|
|
135
143
|
getItemObj (val) {
|
|
136
|
-
const obj = this.listData.find(item => item.
|
|
137
|
-
|
|
138
|
-
|
|
144
|
+
const obj = this.listData.find(item => item[this.saveKey] === val) || {
|
|
145
|
+
[this.saveKey]: val,
|
|
146
|
+
[this.nameKey]: `提示:选项${val}已不存在`
|
|
139
147
|
};
|
|
140
148
|
|
|
141
149
|
return !this.$isEmptyData(val)
|
|
142
150
|
? {
|
|
151
|
+
name: obj[this.nameKey],
|
|
143
152
|
...obj,
|
|
144
153
|
// 查看状态时tag用
|
|
145
154
|
style: {
|
|
@@ -152,7 +161,7 @@ export default {
|
|
|
152
161
|
},
|
|
153
162
|
// 获取某项的选中状态
|
|
154
163
|
getItemCheckStatus (item) {
|
|
155
|
-
return this.curValList.includes(item.
|
|
164
|
+
return this.curValList.includes(item[this.saveKey]);
|
|
156
165
|
},
|
|
157
166
|
// 获取某项的class集合 --flat方式在用
|
|
158
167
|
getItemClass (item) {
|
|
@@ -199,8 +208,8 @@ export default {
|
|
|
199
208
|
this.initListData = [
|
|
200
209
|
...this.initListData,
|
|
201
210
|
...data.list.map(dataItem => ({
|
|
202
|
-
|
|
203
|
-
|
|
211
|
+
[this.saveKey]: dataItem[this.saveKey],
|
|
212
|
+
[this.nameKey]: dataItem[this.nameKey]
|
|
204
213
|
}))
|
|
205
214
|
];
|
|
206
215
|
}
|
|
@@ -287,6 +287,10 @@
|
|
|
287
287
|
...this.commonDealPropsObj
|
|
288
288
|
};
|
|
289
289
|
},
|
|
290
|
+
// 禁止显示的部门以及部门下人员
|
|
291
|
+
userDepartFilterVals () {
|
|
292
|
+
return this.selfPropsObj._userDepartFilterVals || [];
|
|
293
|
+
},
|
|
290
294
|
highSearch () {
|
|
291
295
|
return this.isOnSearch ? true : this.selfPropsObj._highSearch;
|
|
292
296
|
},
|
|
@@ -411,7 +415,7 @@
|
|
|
411
415
|
},
|
|
412
416
|
loadingName: "loading",
|
|
413
417
|
callback: data => {
|
|
414
|
-
this.userList = data.list;
|
|
418
|
+
this.userList = data.list.filter(item => !this.userDepartFilterVals.includes(item.departmentKey));
|
|
415
419
|
this.total = data.total;
|
|
416
420
|
}
|
|
417
421
|
});
|
|
@@ -486,7 +490,7 @@
|
|
|
486
490
|
name: "全部",
|
|
487
491
|
_key: ""
|
|
488
492
|
},
|
|
489
|
-
...data.list
|
|
493
|
+
...data.list.filter(item => !this.userDepartFilterVals.includes(item._key))
|
|
490
494
|
];
|
|
491
495
|
}
|
|
492
496
|
});
|
|
@@ -235,7 +235,8 @@
|
|
|
235
235
|
formData: row,
|
|
236
236
|
formItem: this.resetCol(item),
|
|
237
237
|
rowIndex: rowIndex,
|
|
238
|
-
parentData: this.listData
|
|
238
|
+
parentData: this.listData,
|
|
239
|
+
allFormList: this.columns
|
|
239
240
|
},
|
|
240
241
|
on: {
|
|
241
242
|
blur: () => this.controlBlur(null, column, row, arguments),
|
|
@@ -250,7 +251,8 @@
|
|
|
250
251
|
formData: row,
|
|
251
252
|
formItem: this.resetCol(item),
|
|
252
253
|
rowIndex: rowIndex,
|
|
253
|
-
parentData: this.listData
|
|
254
|
+
parentData: this.listData,
|
|
255
|
+
allFormList: this.columns
|
|
254
256
|
},
|
|
255
257
|
on: {
|
|
256
258
|
blur: () => this.controlBlur(null, column, row, arguments),
|
package/src/utils/table.js
CHANGED
|
@@ -64,7 +64,7 @@ const transformToColumns = function (form, {
|
|
|
64
64
|
showRequired = false,
|
|
65
65
|
showDescription = false,
|
|
66
66
|
headHeightAuto = false
|
|
67
|
-
} = {}) {
|
|
67
|
+
} = {}, allFormList = []) {
|
|
68
68
|
return form
|
|
69
69
|
.map(col => {
|
|
70
70
|
const typeData = this.$modFieldMap[col._type] || {};
|
|
@@ -150,7 +150,8 @@ const transformToColumns = function (form, {
|
|
|
150
150
|
canEdit: false,
|
|
151
151
|
rowIndex: rowIndex,
|
|
152
152
|
formData: row,
|
|
153
|
-
formItem: col
|
|
153
|
+
formItem: col,
|
|
154
|
+
allFormList: allFormList
|
|
154
155
|
}
|
|
155
156
|
});
|
|
156
157
|
}
|
|
@@ -158,7 +159,7 @@ const transformToColumns = function (form, {
|
|
|
158
159
|
|
|
159
160
|
...col
|
|
160
161
|
};
|
|
161
|
-
|
|
162
|
+
});
|
|
162
163
|
};
|
|
163
164
|
|
|
164
165
|
export default {
|