bri-components 1.3.83 → 1.3.85
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/DshSwitch/DshSwitch.vue +5 -3
- package/src/components/controls/controlMap.js +9 -7
- package/src/components/controls/extra/DshColor.vue +81 -0
- package/src/components/controls/mixins/controlMixin.js +1 -1
- package/src/components/controls/mixins/selectMixin.js +4 -2
- package/src/components/controls/mixins/switchMixin.js +24 -11
- package/src/components/form/DshDefaultSearch.vue +3 -1
- package/src/components/form/DshForm.vue +1 -2
- package/src/components/form/searchMixin.js +13 -11
- package/src/components/list/BriTable.vue +0 -2
- package/src/components/list/DshFlatTable.vue +1 -1
- package/src/components/list/mixins/DshCascaderTableMixin.js +4 -3
- package/src/components/list/mixins/DshFlatTableMixin.js +6 -6
- package/src/components/list/mixins/DshTreeTableMixin.js +31 -12
- package/src/components/list/mixins/tableBaseMixin.js +77 -75
- package/src/index.js +14 -9
- package/src/styles/components/other/BriLoading.less +10 -3
- package/src/utils/table.js +1 -1
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
:disabled="selfPropsObj._disabled"
|
|
10
10
|
:loading="selfPropsObj.loading"
|
|
11
11
|
:size="selfPropsObj._size"
|
|
12
|
-
:true-color="
|
|
13
|
-
:false-color="
|
|
12
|
+
:true-color="propsObj._openColor || $appData.themeColor"
|
|
13
|
+
:false-color="propsObj._closeColor || '#ccc'"
|
|
14
14
|
:true-value="selfPropsObj._openValue"
|
|
15
15
|
:false-value="selfPropsObj._closeValue"
|
|
16
16
|
>
|
|
@@ -49,7 +49,9 @@
|
|
|
49
49
|
<dsh-tags
|
|
50
50
|
:class="{
|
|
51
51
|
...commonClass,
|
|
52
|
-
'DshSwitch-show-ellipsis': true
|
|
52
|
+
'DshSwitch-show-ellipsis': true,
|
|
53
|
+
'DshSwitch-open': this.curVal,
|
|
54
|
+
'DshSwitch-close': !this.curVal
|
|
53
55
|
}"
|
|
54
56
|
:list="[curValObj]"
|
|
55
57
|
itemClass="DshSwitch-show-ellipsis-tag"
|
|
@@ -38,11 +38,12 @@ const componentNameMap = {
|
|
|
38
38
|
flatTable: "flatTable",
|
|
39
39
|
cascaderTable: "cascaderTable",
|
|
40
40
|
|
|
41
|
-
back: "DshBack",
|
|
42
|
-
undefined: "DshUndeveloped",
|
|
43
|
-
|
|
44
41
|
themeColor: "themeColor",
|
|
45
42
|
themeIcon: "themeIcon",
|
|
43
|
+
color: "DshColor",
|
|
44
|
+
|
|
45
|
+
back: "DshBack",
|
|
46
|
+
undefined: "DshUndeveloped",
|
|
46
47
|
|
|
47
48
|
...controlConfig.componentNameMap
|
|
48
49
|
};
|
|
@@ -70,13 +71,14 @@ const pathMap = {
|
|
|
70
71
|
flatTable: "./senior/flatTable.vue",
|
|
71
72
|
cascaderTable: "./senior/cascaderTable"
|
|
72
73
|
},
|
|
74
|
+
extra: {
|
|
75
|
+
themeColor: "./extra/themeColor.vue",
|
|
76
|
+
themeIcon: "./extra/themeIcon.vue",
|
|
77
|
+
DshColor: "./extra/DshColor.vue"
|
|
78
|
+
},
|
|
73
79
|
special: {
|
|
74
80
|
DshBack: "./special/DshBack.vue",
|
|
75
81
|
DshUndeveloped: "./special/DshUndeveloped.vue"
|
|
76
|
-
},
|
|
77
|
-
extra: {
|
|
78
|
-
themeColor: "./extra/themeColor.vue",
|
|
79
|
-
themeIcon: "./extra/themeIcon.vue"
|
|
80
82
|
}
|
|
81
83
|
};
|
|
82
84
|
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="DshColor">
|
|
3
|
+
<ColorPicker
|
|
4
|
+
class="DshColor-picker"
|
|
5
|
+
v-model="curVal"
|
|
6
|
+
:disabled="selfPropsObj._disabled"
|
|
7
|
+
:format="selfPropsObj._format"
|
|
8
|
+
:editable="selfPropsObj._editable"
|
|
9
|
+
:alpha="selfPropsObj._alpha"
|
|
10
|
+
:hue="selfPropsObj._hue"
|
|
11
|
+
:recommend="selfPropsObj._recommend"
|
|
12
|
+
:colors="colors"
|
|
13
|
+
:size="selfPropsObj._size"
|
|
14
|
+
:transfer="selfPropsObj._transfer"
|
|
15
|
+
@on-change="change"
|
|
16
|
+
@on-active-change="onActiveChange"
|
|
17
|
+
@on-open-change="onOpenChange"
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<script>
|
|
23
|
+
import controlMixin from "../mixins/controlMixin.js";
|
|
24
|
+
import { resourceData } from "bri-datas";
|
|
25
|
+
|
|
26
|
+
export default {
|
|
27
|
+
name: "DshColor",
|
|
28
|
+
mixins: [
|
|
29
|
+
controlMixin
|
|
30
|
+
],
|
|
31
|
+
components: {},
|
|
32
|
+
props: {},
|
|
33
|
+
data () {
|
|
34
|
+
return {};
|
|
35
|
+
},
|
|
36
|
+
computed: {
|
|
37
|
+
selfPropsObj () {
|
|
38
|
+
return {
|
|
39
|
+
_disabled: false,
|
|
40
|
+
_editable: true, // 是否可以输入色值
|
|
41
|
+
_alpha: false, // 是否支持透明度选择
|
|
42
|
+
_hue: true, // 是否支持色彩选择
|
|
43
|
+
_recommend: true, // 是否显示推荐的颜色预设
|
|
44
|
+
_colors: Object.values(resourceData.colorMap).slice(1), // 自定义颜色预设
|
|
45
|
+
_size: "default", // 尺寸,可选值为large、small、default或者不设置
|
|
46
|
+
_transfer: true,
|
|
47
|
+
...this.propsObj,
|
|
48
|
+
|
|
49
|
+
_format: this.propsObj._format || (this.propsObj._alpha ? "rgb" : "hex") // 颜色的格式,可选值 hsl、hsv、hex、rgb;开启alpha时为rgb,其它为hex
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
colors () {
|
|
53
|
+
return this.selfPropsObj._colors;
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
created () {},
|
|
57
|
+
methods: {
|
|
58
|
+
// 面板中当前显示的颜色发生改变时触发
|
|
59
|
+
onActiveChange () {
|
|
60
|
+
|
|
61
|
+
},
|
|
62
|
+
// 下拉框展开或收起时触发
|
|
63
|
+
onOpenChange () {
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<style lang="less" scoped>
|
|
71
|
+
.DshColor {
|
|
72
|
+
&-picker {
|
|
73
|
+
width: 100%;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
</style>
|
|
77
|
+
<style lang="less">
|
|
78
|
+
.ivu-color-picker-transfer {
|
|
79
|
+
max-width: 360px;
|
|
80
|
+
}
|
|
81
|
+
</style>
|
|
@@ -139,7 +139,7 @@ export default {
|
|
|
139
139
|
return ["users", "departments", "select", "checkbox", "regions", "cascaders", "switch", "labels", "refSelect"].includes(this.controlType);
|
|
140
140
|
},
|
|
141
141
|
commonDealPropsObj () {
|
|
142
|
-
const selectControlTypes = ["date", "switch", "select", "checkbox", "file", "region", "regions", "cascader", "cascaders", "
|
|
142
|
+
const selectControlTypes = ["coordinates", "date", "switch", "select", "checkbox", "file", "region", "regions", "cascader", "cascaders", "users", "departments", "reference"];
|
|
143
143
|
return {
|
|
144
144
|
// TODO: 此处的请输入可能还有请选择之类的,待处理
|
|
145
145
|
_placeholder: this.canEdit && this.propsObj._enterType !== "calculate"
|
|
@@ -170,7 +170,7 @@ export default {
|
|
|
170
170
|
// 获取某项的class集合 --flat方式在用
|
|
171
171
|
getItemClass (item) {
|
|
172
172
|
return [
|
|
173
|
-
this.useColor
|
|
173
|
+
this.useColor && !(item.color || "").includes("#")
|
|
174
174
|
? this.colorMap[item.color] ? item.color : "color-default"
|
|
175
175
|
: undefined,
|
|
176
176
|
item.class
|
|
@@ -178,7 +178,9 @@ export default {
|
|
|
178
178
|
},
|
|
179
179
|
// 获取某项的颜色相关style --flat方式在用
|
|
180
180
|
getItemColorStyle (item) {
|
|
181
|
-
const color =
|
|
181
|
+
const color = (item.color || "").includes("#")
|
|
182
|
+
? item.color
|
|
183
|
+
: this.colorMap[item.color] || this.colorMap["color-default"];
|
|
182
184
|
return this.useColor
|
|
183
185
|
? {
|
|
184
186
|
backgroundColor: this.$getColor(color, 0.1),
|
|
@@ -16,8 +16,6 @@ export default {
|
|
|
16
16
|
basePropsObj () {
|
|
17
17
|
return {
|
|
18
18
|
loading: false, // 是否为加载状态
|
|
19
|
-
_openColor: this.$appData.themeColor, // 打开时的背景色
|
|
20
|
-
_closeColor: "#ccc", // 关闭时的背景色
|
|
21
19
|
_openValue: true, // 打开时对应的值
|
|
22
20
|
_closeValue: false, // 关闭时对应的值
|
|
23
21
|
|
|
@@ -25,22 +23,36 @@ export default {
|
|
|
25
23
|
...this.commonDealPropsObj,
|
|
26
24
|
|
|
27
25
|
_openText: this.propsObj._openText || "是", // 此行放在 ...this.propsObj的下面目的是,处理_openText为空字符串的情况
|
|
28
|
-
_closeText: this.propsObj._closeText || "否"
|
|
26
|
+
_closeText: this.propsObj._closeText || "否",
|
|
27
|
+
_openColor: this.propsObj._openColor || "#37C45E", // 打开时的背景色
|
|
28
|
+
_closeColor: this.propsObj._closeColor || "#E83636" // 关闭时的背景色
|
|
29
29
|
};
|
|
30
30
|
},
|
|
31
|
+
openText () {
|
|
32
|
+
return this.selfPropsObj._openText;
|
|
33
|
+
},
|
|
34
|
+
closeText () {
|
|
35
|
+
return this.selfPropsObj._closeText;
|
|
36
|
+
},
|
|
37
|
+
openColor () {
|
|
38
|
+
return this.selfPropsObj._openColor;
|
|
39
|
+
},
|
|
40
|
+
closeColor () {
|
|
41
|
+
return this.selfPropsObj._closeColor;
|
|
42
|
+
},
|
|
31
43
|
mulPropsObj () {
|
|
32
44
|
return {
|
|
33
45
|
_optionKind: "flat",
|
|
34
46
|
_data: [
|
|
35
47
|
{
|
|
36
48
|
_key: "true",
|
|
37
|
-
name: this.
|
|
38
|
-
color: this.
|
|
49
|
+
name: this.openText,
|
|
50
|
+
color: this.openColor
|
|
39
51
|
},
|
|
40
52
|
{
|
|
41
53
|
_key: "false",
|
|
42
|
-
name: this.
|
|
43
|
-
color: this.
|
|
54
|
+
name: this.closeText,
|
|
55
|
+
color: this.closeColor
|
|
44
56
|
}
|
|
45
57
|
],
|
|
46
58
|
|
|
@@ -49,14 +61,15 @@ export default {
|
|
|
49
61
|
},
|
|
50
62
|
|
|
51
63
|
curValObj () {
|
|
64
|
+
const color = this.curVal === true ? this.openColor : this.closeColor;
|
|
52
65
|
return !this.$isEmptyData(this.curVal)
|
|
53
66
|
? {
|
|
54
67
|
_key: "1",
|
|
55
68
|
name: this.showVal,
|
|
56
69
|
style: {
|
|
57
70
|
...this.tagStyle,
|
|
58
|
-
backgroundColor: this.
|
|
59
|
-
color:
|
|
71
|
+
backgroundColor: this.$getColor(color, 0.1),
|
|
72
|
+
color: color
|
|
60
73
|
}
|
|
61
74
|
}
|
|
62
75
|
: undefined;
|
|
@@ -65,8 +78,8 @@ export default {
|
|
|
65
78
|
return this.$isEmptyData(this.curVal)
|
|
66
79
|
? this.emptyShowVal
|
|
67
80
|
: this.curVal === true
|
|
68
|
-
? this.
|
|
69
|
-
: this.
|
|
81
|
+
? this._openText
|
|
82
|
+
: this._closeText;
|
|
70
83
|
}
|
|
71
84
|
},
|
|
72
85
|
created () { },
|
|
@@ -109,7 +109,9 @@
|
|
|
109
109
|
},
|
|
110
110
|
computed: {
|
|
111
111
|
canSearchFormList () {
|
|
112
|
-
return this.formList.filter(formItem =>
|
|
112
|
+
return this.formList.filter(formItem =>
|
|
113
|
+
this.$formHasAbility(formItem, "canDefaultSearch") && formItem._displayType !== "hide"
|
|
114
|
+
);
|
|
113
115
|
},
|
|
114
116
|
|
|
115
117
|
// 总span
|
|
@@ -184,7 +184,6 @@
|
|
|
184
184
|
formControlClass: String,
|
|
185
185
|
|
|
186
186
|
/* 本组件使用 -不传递子组件的 */
|
|
187
|
-
monitorFormList: Array,
|
|
188
187
|
showRules: {
|
|
189
188
|
type: Boolean,
|
|
190
189
|
default: true
|
|
@@ -229,7 +228,7 @@
|
|
|
229
228
|
},
|
|
230
229
|
// 初始化监测 -监测所有字段
|
|
231
230
|
initMonitor () {
|
|
232
|
-
(this.
|
|
231
|
+
(this.allFormList || this.formList).forEach(formItem => {
|
|
233
232
|
this.$set(this.formData, formItem._key, this.formData[formItem._key]);
|
|
234
233
|
});
|
|
235
234
|
},
|
|
@@ -60,7 +60,10 @@ export default {
|
|
|
60
60
|
},
|
|
61
61
|
computed: {
|
|
62
62
|
canSearchFormList () {
|
|
63
|
-
return this.formList.filter(formItem =>
|
|
63
|
+
return this.formList.filter(formItem =>
|
|
64
|
+
this.$formHasAbility(formItem, "canSearch") &&
|
|
65
|
+
(this.mode === "set" ? true : formItem._displayType !== "hide")
|
|
66
|
+
);
|
|
64
67
|
},
|
|
65
68
|
dynamicFieldsMap () {
|
|
66
69
|
return this.$arrToCategoryArr(this.dynamicFormList);
|
|
@@ -220,15 +223,15 @@ export default {
|
|
|
220
223
|
return {
|
|
221
224
|
_id: this.$ObjectID().str,
|
|
222
225
|
logic: "field",
|
|
223
|
-
fieldKey
|
|
224
|
-
fieldType
|
|
225
|
-
fieldOperator
|
|
226
|
+
fieldKey,
|
|
227
|
+
fieldType,
|
|
228
|
+
fieldOperator,
|
|
226
229
|
fieldValue: [],
|
|
227
230
|
fieldSearch: {
|
|
228
231
|
logic: "and",
|
|
229
232
|
conditions: []
|
|
230
233
|
},
|
|
231
|
-
parameterType
|
|
234
|
+
parameterType,
|
|
232
235
|
fieldParams: [],
|
|
233
236
|
chainFieldKey: "",
|
|
234
237
|
...initContion,
|
|
@@ -236,11 +239,11 @@ export default {
|
|
|
236
239
|
// 下面的是前端所用
|
|
237
240
|
dynamicList: dynamicList,
|
|
238
241
|
parameterTypeName: parameterTypeName,
|
|
239
|
-
operators
|
|
242
|
+
operators,
|
|
240
243
|
fieldOperatorName: fieldOperatorName,
|
|
241
244
|
formItem: this.getFormItem(curFormItem),
|
|
242
245
|
subFormList: curFormItem._subForm || [],
|
|
243
|
-
finished:
|
|
246
|
+
finished: !operators.some(operator => ["subSearch"].includes(operator._key)) // 子集条件的 请求form数据 是否完成状态
|
|
244
247
|
};
|
|
245
248
|
} else {
|
|
246
249
|
return {
|
|
@@ -315,13 +318,12 @@ export default {
|
|
|
315
318
|
this.getModData(conditionItem.formItem, data => {
|
|
316
319
|
conditionItem.finished = true;
|
|
317
320
|
conditionItem.subFormList = (data.screens.find(screenItem =>
|
|
318
|
-
this.mode === "set"
|
|
321
|
+
this.mode === "set"
|
|
322
|
+
? screenItem.screenType === "all"
|
|
323
|
+
: screenItem._key === conditionItem.formItem._screen
|
|
319
324
|
) || { form: [] }).form;
|
|
320
325
|
});
|
|
321
326
|
}
|
|
322
|
-
} else if (["subTableSearch", "cascaderTableSearch", "treeTableSearch"].includes(conditionItem.fieldOperator)) {
|
|
323
|
-
conditionItem.finished = true;
|
|
324
|
-
conditionItem.subFormList = conditionItem.formItem._subForm;
|
|
325
327
|
}
|
|
326
328
|
},
|
|
327
329
|
// 加载 reference数据
|
|
@@ -187,11 +187,9 @@
|
|
|
187
187
|
},
|
|
188
188
|
mounted () {},
|
|
189
189
|
methods: {
|
|
190
|
-
// hidden columns
|
|
191
190
|
hideColumnsByKeys (keys = []) {
|
|
192
191
|
this.$refs.briTable.hideColumnsByKeys(keys);
|
|
193
192
|
},
|
|
194
|
-
// show cloumns
|
|
195
193
|
showColumnsByKeys (keys = []) {
|
|
196
194
|
this.$refs.briTable.showColumnsByKeys(keys);
|
|
197
195
|
}
|
|
@@ -105,6 +105,7 @@ export default {
|
|
|
105
105
|
computed: {
|
|
106
106
|
selfPropsObj () {
|
|
107
107
|
return {
|
|
108
|
+
_treeForm: [],
|
|
108
109
|
...this.commonPropsObj,
|
|
109
110
|
|
|
110
111
|
_contentHeight: this.propsObj._contentHeight || 400 // 表格最大高度
|
|
@@ -113,7 +114,7 @@ export default {
|
|
|
113
114
|
|
|
114
115
|
allTreeData () {
|
|
115
116
|
// console.log("allTreeData");
|
|
116
|
-
return this.getCalcuedTree(this.data, this.treeColumns, this.
|
|
117
|
+
return this.getCalcuedTree(this.data, this.treeColumns, this.selfColumns);
|
|
117
118
|
},
|
|
118
119
|
allListData () {
|
|
119
120
|
return this.$getTreeFlatArr(this.data, node => !(node.children && node.children.length));
|
|
@@ -156,7 +157,7 @@ export default {
|
|
|
156
157
|
loop(node.children);
|
|
157
158
|
} else {
|
|
158
159
|
// 根节点下所有表格字段加上监测,注入到节点对象中,必须$set,牵扯_rely值再出现并没有检测
|
|
159
|
-
this.
|
|
160
|
+
this.selfColumns.forEach(subFormItem => {
|
|
160
161
|
this.$set(node, subFormItem._key, node[subFormItem._key]);
|
|
161
162
|
});
|
|
162
163
|
}
|
|
@@ -812,7 +813,7 @@ export default {
|
|
|
812
813
|
},
|
|
813
814
|
getSummaryVal (col, row) {
|
|
814
815
|
if (col._calField && col._operator) {
|
|
815
|
-
const calFieldFormItem = this.
|
|
816
|
+
const calFieldFormItem = this.selfColumns.find(item => item._key === col._calField);
|
|
816
817
|
|
|
817
818
|
if (calFieldFormItem) {
|
|
818
819
|
let loop = (nodes, arr) => {
|
|
@@ -28,16 +28,16 @@ export default {
|
|
|
28
28
|
? []
|
|
29
29
|
: this.useSummary && this.allListData.length
|
|
30
30
|
? [
|
|
31
|
-
this.filterColumns.reduce((obj,
|
|
31
|
+
this.filterColumns.reduce((obj, column) => {
|
|
32
32
|
return {
|
|
33
33
|
...obj,
|
|
34
|
-
[
|
|
34
|
+
[column._key]: column._type === "number" && column._summaryType
|
|
35
35
|
? this.$calNumList(
|
|
36
|
-
this.allListData.map(item => item[
|
|
37
|
-
|
|
38
|
-
{ ...
|
|
36
|
+
this.allListData.map(item => item[column._key]),
|
|
37
|
+
column._summaryType,
|
|
38
|
+
{ ...column, _defaultDigit: 2 }
|
|
39
39
|
)
|
|
40
|
-
: (obj[
|
|
40
|
+
: (obj[column._key] || "--")
|
|
41
41
|
};
|
|
42
42
|
}, {
|
|
43
43
|
_id: this.$ObjectID().str,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { resourceData } from "bri-datas";
|
|
2
|
+
|
|
1
3
|
export default {
|
|
2
4
|
mixins: [],
|
|
3
5
|
components: {},
|
|
@@ -11,19 +13,36 @@ export default {
|
|
|
11
13
|
};
|
|
12
14
|
},
|
|
13
15
|
computed: {
|
|
16
|
+
selfColumns () {
|
|
17
|
+
return this.columns.map(column => {
|
|
18
|
+
// 层级表格类型,level字段的进行特殊处理(_treeForm加工成_data)
|
|
19
|
+
return column._key === "level"
|
|
20
|
+
? {
|
|
21
|
+
...column,
|
|
22
|
+
_data: this.selfPropsObj._treeForm.map((treeFormItem, treeFormIndex) => ({
|
|
23
|
+
name: treeFormItem._name,
|
|
24
|
+
_key: (treeFormIndex + 1),
|
|
25
|
+
color: Object.keys(resourceData.colorMap)[treeFormIndex + 1]
|
|
26
|
+
}))
|
|
27
|
+
}
|
|
28
|
+
: column;
|
|
29
|
+
});
|
|
30
|
+
},
|
|
14
31
|
selfPropsObj () {
|
|
15
32
|
return {
|
|
16
|
-
|
|
17
|
-
...this.commonPropsObj
|
|
33
|
+
_treeForm: [],
|
|
34
|
+
...this.commonPropsObj,
|
|
35
|
+
|
|
36
|
+
_maxLevel: this.commonPropsObj._maxLevel || 3 // 最大级数
|
|
18
37
|
};
|
|
19
38
|
},
|
|
20
39
|
maxLevel () {
|
|
21
|
-
return this.selfPropsObj._maxLevel
|
|
40
|
+
return this.selfPropsObj._maxLevel;
|
|
22
41
|
},
|
|
23
42
|
|
|
24
43
|
allTreeData () {
|
|
25
44
|
// console.log("allTreeData");
|
|
26
|
-
return this.getCalcuedTree(this.data, this.
|
|
45
|
+
return this.getCalcuedTree(this.data, this.selfColumns);
|
|
27
46
|
},
|
|
28
47
|
allListData () {
|
|
29
48
|
// console.log("allListData");
|
|
@@ -38,7 +57,7 @@ export default {
|
|
|
38
57
|
this.filterColumns.reduce((obj, column) => {
|
|
39
58
|
return {
|
|
40
59
|
...obj,
|
|
41
|
-
[column._key]: column._type === "number" &&
|
|
60
|
+
[column._key]: column._type === "number" && column._summaryType
|
|
42
61
|
? this.$calNumList(
|
|
43
62
|
this.allListData
|
|
44
63
|
.filter(item => item.level === 1)
|
|
@@ -322,13 +341,13 @@ export default {
|
|
|
322
341
|
|
|
323
342
|
/* ------ 工具方法 ------- */
|
|
324
343
|
// 加工树形数据
|
|
325
|
-
getCalcuedTree (treeData = [],
|
|
344
|
+
getCalcuedTree (treeData = [], cols = []) {
|
|
326
345
|
const loop = (list = [], parentRow) =>
|
|
327
346
|
list.forEach((row) => {
|
|
328
347
|
// 递归到叶子节点前 从上往下执行 要处理的
|
|
329
|
-
|
|
348
|
+
cols.reduce((newRow, column) => {
|
|
330
349
|
if (["number", "date"].includes(column._type)) {
|
|
331
|
-
if (
|
|
350
|
+
if (column._summaryType) {
|
|
332
351
|
// 不做处理,_summaryType和_writeSort互反,更安全的判断
|
|
333
352
|
}
|
|
334
353
|
else if (["upToDown"].includes(column._writeSort) && column._noLimitWrite !== true) {
|
|
@@ -349,9 +368,9 @@ export default {
|
|
|
349
368
|
loop(row.children, row);
|
|
350
369
|
|
|
351
370
|
// 递归到叶子节点后到 从下往上执行 要处理的(非叶子节点)
|
|
352
|
-
|
|
371
|
+
cols.reduce((newRow, column) => {
|
|
353
372
|
if (["number", "date"].includes(column._type)) {
|
|
354
|
-
if (
|
|
373
|
+
if (column._summaryType) {
|
|
355
374
|
const val = ["number"].includes(column._type)
|
|
356
375
|
? this.$calNumList(
|
|
357
376
|
newRow.children.map(subRow => subRow[column._key]),
|
|
@@ -383,9 +402,9 @@ export default {
|
|
|
383
402
|
row.isLeaf = true;
|
|
384
403
|
|
|
385
404
|
// 递归到叶子节点后到 从下往上执行 要处理的(叶子节点)
|
|
386
|
-
|
|
405
|
+
cols.reduce((newRow, column) => {
|
|
387
406
|
if (["number", "date"].includes(column._type)) {
|
|
388
|
-
if (
|
|
407
|
+
if (column._summaryType) {
|
|
389
408
|
this.$set(newRow, column._key, newRow[column._key]);
|
|
390
409
|
}
|
|
391
410
|
else if (["downToUp"].includes(column._writeSort) && column._noLimitWrite !== true) {
|
|
@@ -191,6 +191,13 @@ export default {
|
|
|
191
191
|
allScreenKey () {
|
|
192
192
|
return this.propsObj.allScreenKey;
|
|
193
193
|
},
|
|
194
|
+
selfColumns () {
|
|
195
|
+
return this.columns;
|
|
196
|
+
},
|
|
197
|
+
filterColumns () {
|
|
198
|
+
// console.log("filterColumns");
|
|
199
|
+
return this.selfColumns.filter(col => this.$isAdvRelyShow(col, this.allListData, this.parentObj, true));
|
|
200
|
+
},
|
|
194
201
|
|
|
195
202
|
commonPropsObj () {
|
|
196
203
|
return {
|
|
@@ -277,29 +284,10 @@ export default {
|
|
|
277
284
|
disabledOldDataRow () {
|
|
278
285
|
return this.selfPropsObj._disabledOldDataRow;
|
|
279
286
|
},
|
|
280
|
-
|
|
281
|
-
isImport () {
|
|
282
|
-
return this.selfPropsObj._isImport;
|
|
283
|
-
},
|
|
284
|
-
isExport () {
|
|
285
|
-
return this.selfPropsObj._isExport;
|
|
286
|
-
},
|
|
287
|
-
isQuote () {
|
|
288
|
-
return this.selfPropsObj._isQuote;
|
|
289
|
-
},
|
|
290
|
-
quoteDisabledColKeys () {
|
|
291
|
-
return this.selfPropsObj._quoteDisabledColKeys;
|
|
292
|
-
},
|
|
293
|
-
quoteListFields () {
|
|
294
|
-
return this.selfPropsObj._quoteListFields;
|
|
295
|
-
},
|
|
296
|
-
quoteAdvSearch () {
|
|
297
|
-
return this.$transformAdvSearch(this.selfPropsObj._quoteAdvSearch, this.allFormList, this.parentObj);
|
|
298
|
-
},
|
|
299
|
-
|
|
300
287
|
hideColKeys () {
|
|
301
288
|
return this.selfPropsObj._hideColKeys || [];
|
|
302
289
|
},
|
|
290
|
+
|
|
303
291
|
searchLabelWidth () {
|
|
304
292
|
return this.selfPropsObj._searchLabelWidth;
|
|
305
293
|
},
|
|
@@ -313,13 +301,12 @@ export default {
|
|
|
313
301
|
return this.searchList.map(searchItem => searchItem._key);
|
|
314
302
|
},
|
|
315
303
|
searchFormList () {
|
|
316
|
-
return this.$filterList(this.searchListFields, this.
|
|
304
|
+
return this.$filterList(this.searchListFields, this.selfColumns).map(formItem => ({
|
|
317
305
|
...formItem,
|
|
318
306
|
...this.searchListMap[formItem._key],
|
|
319
307
|
_name: formItem._name
|
|
320
308
|
}));
|
|
321
309
|
},
|
|
322
|
-
|
|
323
310
|
tableAdvSearch () {
|
|
324
311
|
return this.$transformAdvSearch(this.selfPropsObj._tableAdvSearch, this.allFormList, this.parentObj);
|
|
325
312
|
},
|
|
@@ -383,7 +370,7 @@ export default {
|
|
|
383
370
|
return this.parentObj._id;
|
|
384
371
|
},
|
|
385
372
|
selfRowDefault () {
|
|
386
|
-
return this.
|
|
373
|
+
return this.selfColumns.reduce((obj, column) => {
|
|
387
374
|
const defaultVal = this.rowDefault[column._key];
|
|
388
375
|
const initDftVal = this.initDftValMap[column._type];
|
|
389
376
|
|
|
@@ -433,53 +420,6 @@ export default {
|
|
|
433
420
|
}
|
|
434
421
|
};
|
|
435
422
|
},
|
|
436
|
-
modalPropsObj () {
|
|
437
|
-
return {
|
|
438
|
-
mode: "fullscreen",
|
|
439
|
-
title: this.controlName
|
|
440
|
-
};
|
|
441
|
-
},
|
|
442
|
-
quoteParams () {
|
|
443
|
-
return {
|
|
444
|
-
screenKey: this.allScreenKey,
|
|
445
|
-
fields: [
|
|
446
|
-
...this.quoteListFields,
|
|
447
|
-
this.controlKey,
|
|
448
|
-
"createdAt"
|
|
449
|
-
],
|
|
450
|
-
advSearch: {
|
|
451
|
-
logic: "and",
|
|
452
|
-
conditions: [
|
|
453
|
-
{
|
|
454
|
-
fieldKey: "_id",
|
|
455
|
-
fieldOperator: "ne",
|
|
456
|
-
fieldValue: [this.parentDataId]
|
|
457
|
-
},
|
|
458
|
-
this.quoteAdvSearch
|
|
459
|
-
]
|
|
460
|
-
}
|
|
461
|
-
};
|
|
462
|
-
},
|
|
463
|
-
importParams () {
|
|
464
|
-
return {
|
|
465
|
-
_id: this.parentDataId,
|
|
466
|
-
_key: this.controlKey,
|
|
467
|
-
importType: this.inTableType
|
|
468
|
-
};
|
|
469
|
-
},
|
|
470
|
-
exportParams () {
|
|
471
|
-
return {
|
|
472
|
-
screenKey: this.screenKey,
|
|
473
|
-
_id: this.parentDataId,
|
|
474
|
-
_key: this.controlKey,
|
|
475
|
-
advSearch: this.finalTableAdvSearch
|
|
476
|
-
};
|
|
477
|
-
},
|
|
478
|
-
|
|
479
|
-
filterColumns () {
|
|
480
|
-
// console.log("filterColumns");
|
|
481
|
-
return this.columns.filter(col => this.$isAdvRelyShow(col, this.allListData, this.parentObj, true));
|
|
482
|
-
},
|
|
483
423
|
contentColumns () {
|
|
484
424
|
// console.log("contentColumns");
|
|
485
425
|
return this.filterColumns.map(colItem => ({
|
|
@@ -511,7 +451,7 @@ export default {
|
|
|
511
451
|
canEdit: unitCanEdit,
|
|
512
452
|
formData: row,
|
|
513
453
|
formItem: column,
|
|
514
|
-
allFormList: this.
|
|
454
|
+
allFormList: this.selfColumns,
|
|
515
455
|
inTableType: this.inTableType,
|
|
516
456
|
allListRows: this.allListData,
|
|
517
457
|
rowIndex: rowIndex,
|
|
@@ -530,7 +470,7 @@ export default {
|
|
|
530
470
|
canEdit: unitCanEdit,
|
|
531
471
|
formData: row,
|
|
532
472
|
formItem: column,
|
|
533
|
-
allFormList: this.
|
|
473
|
+
allFormList: this.selfColumns,
|
|
534
474
|
inTableType: this.inTableType,
|
|
535
475
|
allListRows: this.allListData,
|
|
536
476
|
rowIndex: rowIndex,
|
|
@@ -603,6 +543,67 @@ export default {
|
|
|
603
543
|
};
|
|
604
544
|
},
|
|
605
545
|
|
|
546
|
+
isImport () {
|
|
547
|
+
return this.selfPropsObj._isImport;
|
|
548
|
+
},
|
|
549
|
+
importParams () {
|
|
550
|
+
return {
|
|
551
|
+
_id: this.parentDataId,
|
|
552
|
+
_key: this.controlKey,
|
|
553
|
+
importType: this.inTableType
|
|
554
|
+
};
|
|
555
|
+
},
|
|
556
|
+
isExport () {
|
|
557
|
+
return this.selfPropsObj._isExport;
|
|
558
|
+
},
|
|
559
|
+
exportParams () {
|
|
560
|
+
return {
|
|
561
|
+
screenKey: this.screenKey,
|
|
562
|
+
_id: this.parentDataId,
|
|
563
|
+
_key: this.controlKey,
|
|
564
|
+
advSearch: this.finalTableAdvSearch
|
|
565
|
+
};
|
|
566
|
+
},
|
|
567
|
+
isQuote () {
|
|
568
|
+
return this.selfPropsObj._isQuote;
|
|
569
|
+
},
|
|
570
|
+
quoteDisabledColKeys () {
|
|
571
|
+
return this.selfPropsObj._quoteDisabledColKeys;
|
|
572
|
+
},
|
|
573
|
+
quoteListFields () {
|
|
574
|
+
return this.selfPropsObj._quoteListFields;
|
|
575
|
+
},
|
|
576
|
+
quoteAdvSearch () {
|
|
577
|
+
return this.$transformAdvSearch(this.selfPropsObj._quoteAdvSearch, this.allFormList, this.parentObj);
|
|
578
|
+
},
|
|
579
|
+
quoteParams () {
|
|
580
|
+
return {
|
|
581
|
+
screenKey: this.allScreenKey,
|
|
582
|
+
fields: [
|
|
583
|
+
...this.quoteListFields,
|
|
584
|
+
this.controlKey,
|
|
585
|
+
"createdAt"
|
|
586
|
+
],
|
|
587
|
+
advSearch: {
|
|
588
|
+
logic: "and",
|
|
589
|
+
conditions: [
|
|
590
|
+
{
|
|
591
|
+
fieldKey: "_id",
|
|
592
|
+
fieldOperator: "ne",
|
|
593
|
+
fieldValue: [this.parentDataId]
|
|
594
|
+
},
|
|
595
|
+
this.quoteAdvSearch
|
|
596
|
+
]
|
|
597
|
+
}
|
|
598
|
+
};
|
|
599
|
+
},
|
|
600
|
+
modalPropsObj () {
|
|
601
|
+
return {
|
|
602
|
+
mode: "fullscreen",
|
|
603
|
+
title: this.controlName
|
|
604
|
+
};
|
|
605
|
+
},
|
|
606
|
+
|
|
606
607
|
topOperationBtns () {
|
|
607
608
|
return Object.keys(this.topOperationMap);
|
|
608
609
|
},
|
|
@@ -1031,7 +1032,7 @@ export default {
|
|
|
1031
1032
|
// 校验必填不通过 => 校验对比
|
|
1032
1033
|
const resultObj = {};
|
|
1033
1034
|
this.$getFieldRuleResult(col, row, resultObj) &&
|
|
1034
|
-
this.$normalComparedFunc(col, row, this.
|
|
1035
|
+
this.$normalComparedFunc(col, row, this.selfColumns, this.parentObj, this.allFormList, this.inTableType, resultObj) &&
|
|
1035
1036
|
this.$levelComparedFunc(col, row, this.allListData, this.inTableType, resultObj);
|
|
1036
1037
|
|
|
1037
1038
|
return resultObj;
|
|
@@ -1057,7 +1058,7 @@ export default {
|
|
|
1057
1058
|
getColCanEdit (col, row) {
|
|
1058
1059
|
return (
|
|
1059
1060
|
["treeTable"].includes(this.inTableType) && ["number", "date"].includes(col._type)
|
|
1060
|
-
?
|
|
1061
|
+
? col._summaryType
|
|
1061
1062
|
? row.isLeaf === true
|
|
1062
1063
|
: ["downToUp", "upToDown"].includes(col._writeSort)
|
|
1063
1064
|
? col._noLimitWrite === true
|
|
@@ -1068,6 +1069,7 @@ export default {
|
|
|
1068
1069
|
: true
|
|
1069
1070
|
: true
|
|
1070
1071
|
) &&
|
|
1072
|
+
!(["cascaderTable"].includes(this.controlType) && ["level", "children"].includes(col._key)) && // 级联表格类型,固定字段不编辑
|
|
1071
1073
|
(col._oldReadonly ? row.__old__ !== true : true) && // 老数据行里某些列不可编辑
|
|
1072
1074
|
(row.__isQuote__ ? !this.quoteDisabledColKeys.includes(col._key) : true) && // 引用过来的数据是否可编辑
|
|
1073
1075
|
col._enterType !== "calculate" && // 计算的不可编辑
|
|
@@ -1081,7 +1083,7 @@ export default {
|
|
|
1081
1083
|
this.$isAdvRelyShow(col, row, this.parentObj, true);
|
|
1082
1084
|
},
|
|
1083
1085
|
getRowFormList (row) {
|
|
1084
|
-
return this.
|
|
1086
|
+
return this.selfColumns.map(column => {
|
|
1085
1087
|
column = this.$transformDynamicProperty(column, row, this.parentObj);
|
|
1086
1088
|
const unitCanEdit = this.getColCanEdit(column, row);
|
|
1087
1089
|
|
package/src/index.js
CHANGED
|
@@ -9,12 +9,12 @@ import CN from "vue-easytable/libs/locale/lang/zh-CN.js";
|
|
|
9
9
|
|
|
10
10
|
// list
|
|
11
11
|
import BriTable from "./components/list/BriTable.vue";
|
|
12
|
-
import DshFlatTable from "./components/list/DshFlatTable.vue";
|
|
13
12
|
import DshBox from "./components/list/DshBox/DshBox.vue";
|
|
14
13
|
import DshList from "./components/list/DshBox/DshList.vue";
|
|
15
14
|
import DshTable from "./components/list/DshBox/DshTable.vue";
|
|
16
15
|
import DshPage from "./components/list/DshPage.vue";
|
|
17
16
|
import DshCrossTable from "./components/list/DshBox/DshCrossTable.vue";
|
|
17
|
+
import DshFlatTable from "./components/list/DshFlatTable.vue";
|
|
18
18
|
// import DshCascaderTable from "./components/list/DshCascaderTable.vue";
|
|
19
19
|
// import DshTreeTable from "./components/list/DshTreeTable.vue";
|
|
20
20
|
|
|
@@ -84,6 +84,8 @@ import selectUsers from "./components/controls/senior/selectUsers/selectUsers.vu
|
|
|
84
84
|
import departMenu from "./components/controls/senior/selectUsers/departMenu.vue";
|
|
85
85
|
import selectDepartments from "./components/controls/senior/selectDepartments.vue";
|
|
86
86
|
|
|
87
|
+
import DshColor from "./components/controls/extra/DshColor.vue";
|
|
88
|
+
|
|
87
89
|
// import DshBack from "./components/controls/special/DshBack.vue";
|
|
88
90
|
// import DshUndeveloped from "./components/controls/special/DshUndeveloped.vue";
|
|
89
91
|
|
|
@@ -188,6 +190,9 @@ export {
|
|
|
188
190
|
DshTable,
|
|
189
191
|
DshPage,
|
|
190
192
|
DshCrossTable,
|
|
193
|
+
DshFlatTable,
|
|
194
|
+
// DshCascaderTable,
|
|
195
|
+
// DshTreeTable,
|
|
191
196
|
|
|
192
197
|
// form
|
|
193
198
|
DshForm,
|
|
@@ -212,6 +217,8 @@ export {
|
|
|
212
217
|
DshColorPanel,
|
|
213
218
|
|
|
214
219
|
// small
|
|
220
|
+
DshRender,
|
|
221
|
+
DshListRender,
|
|
215
222
|
BriButton,
|
|
216
223
|
BriDrawer,
|
|
217
224
|
BriTooltip,
|
|
@@ -223,18 +230,12 @@ export {
|
|
|
223
230
|
DshTabsSet,
|
|
224
231
|
DshTags,
|
|
225
232
|
DshTitle,
|
|
226
|
-
DshRender,
|
|
227
|
-
DshListRender,
|
|
228
233
|
|
|
229
234
|
/* 只局部导出的 */
|
|
230
235
|
Error500,
|
|
231
236
|
Error403,
|
|
232
237
|
Error404,
|
|
233
238
|
|
|
234
|
-
DshFlatTable,
|
|
235
|
-
// DshCascaderTable,
|
|
236
|
-
// DshTreeTable,
|
|
237
|
-
|
|
238
239
|
BriCard,
|
|
239
240
|
BriTree,
|
|
240
241
|
BriTreeItem,
|
|
@@ -249,13 +250,17 @@ export {
|
|
|
249
250
|
DshCoordinates,
|
|
250
251
|
DshEditor,
|
|
251
252
|
DshDivider,
|
|
253
|
+
|
|
252
254
|
DshPackage,
|
|
253
|
-
// DshBack,
|
|
254
|
-
// DshUndeveloped,
|
|
255
255
|
selectUsers,
|
|
256
256
|
departMenu,
|
|
257
257
|
selectDepartments,
|
|
258
258
|
|
|
259
|
+
DshColor,
|
|
260
|
+
|
|
261
|
+
// DshBack,
|
|
262
|
+
// DshUndeveloped,
|
|
263
|
+
|
|
259
264
|
DshMenuNav,
|
|
260
265
|
BriCode,
|
|
261
266
|
BriCollapseTree,
|
|
@@ -20,8 +20,13 @@
|
|
|
20
20
|
height: 100%;
|
|
21
21
|
|
|
22
22
|
@keyframes spin {
|
|
23
|
-
from {
|
|
24
|
-
|
|
23
|
+
from {
|
|
24
|
+
transform: rotate(0deg);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
to {
|
|
28
|
+
transform: rotate(360deg);
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
|
|
27
32
|
.BriLoading-main {
|
|
@@ -31,16 +36,18 @@
|
|
|
31
36
|
|
|
32
37
|
&-loading {
|
|
33
38
|
border-radius: 50%;
|
|
34
|
-
background: conic-gradient(
|
|
39
|
+
background: conic-gradient(@themeColor 50%, white);
|
|
35
40
|
--mask: radial-gradient(closest-side, transparent 70%, black 71%);
|
|
36
41
|
-webkit-mask-image: var(--mask);
|
|
37
42
|
mask-image: var(--mask);
|
|
38
43
|
animation: spin 1s linear infinite;
|
|
39
44
|
}
|
|
45
|
+
|
|
40
46
|
&-loadingText {
|
|
41
47
|
margin-top: 8px;
|
|
42
48
|
color: @themeColor;
|
|
43
49
|
}
|
|
50
|
+
|
|
44
51
|
&-noText {
|
|
45
52
|
color: @textColor;
|
|
46
53
|
margin-top: 16px;
|