bri-components 1.0.0
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/README.md +30 -0
- package/lib/.DS_Store +0 -0
- package/lib/0.bri-components.min.js +2 -0
- package/lib/0.bri-components.min.js.map +1 -0
- package/lib/1.bri-components.min.js +2 -0
- package/lib/1.bri-components.min.js.map +1 -0
- package/lib/2.bri-components.min.js +2 -0
- package/lib/2.bri-components.min.js.map +1 -0
- package/lib/3.bri-components.min.js +2 -0
- package/lib/3.bri-components.min.js.gz +0 -0
- package/lib/3.bri-components.min.js.map +1 -0
- package/lib/4.bri-components.min.js +2 -0
- package/lib/4.bri-components.min.js.gz +0 -0
- package/lib/4.bri-components.min.js.map +1 -0
- package/lib/5.bri-components.min.js +2 -0
- package/lib/5.bri-components.min.js.map +1 -0
- package/lib/6.bri-components.min.js +2 -0
- package/lib/6.bri-components.min.js.map +1 -0
- package/lib/bri-components.min.js +21 -0
- package/lib/bri-components.min.js.gz +0 -0
- package/lib/bri-components.min.js.map +1 -0
- package/lib/styles/bri-components.css +1 -0
- package/lib/styles/bundle.css +14 -0
- package/lib/styles/font/fontello.eot +0 -0
- package/lib/styles/font/fontello.svg +32 -0
- package/lib/styles/font/fontello.ttf +0 -0
- package/lib/styles/font/fontello.woff +0 -0
- package/lib/styles/font/fontello.woff2 +0 -0
- package/package.json +121 -0
- package/src/.DS_Store +0 -0
- package/src/components/controls/base/DshBack.vue +36 -0
- package/src/components/controls/base/DshCascader.vue +366 -0
- package/src/components/controls/base/DshCascaderMultiple.vue +158 -0
- package/src/components/controls/base/DshCheckbox.vue +199 -0
- package/src/components/controls/base/DshCoordinates.vue +497 -0
- package/src/components/controls/base/DshDate.vue +148 -0
- package/src/components/controls/base/DshDaterange.vue +335 -0
- package/src/components/controls/base/DshDivider.vue +59 -0
- package/src/components/controls/base/DshEditor.vue +166 -0
- package/src/components/controls/base/DshInput.vue +139 -0
- package/src/components/controls/base/DshLabels.vue +302 -0
- package/src/components/controls/base/DshNumber/BriInputNumber/BriInputNumber.vue +425 -0
- package/src/components/controls/base/DshNumber/BriInputNumber/mixins/emitter.js +34 -0
- package/src/components/controls/base/DshNumber/BriInputNumber/mixins/form.js +14 -0
- package/src/components/controls/base/DshNumber/BriInputNumber/utils/assist.js +322 -0
- package/src/components/controls/base/DshNumber/DshNumber.vue +148 -0
- package/src/components/controls/base/DshNumberange.vue +137 -0
- package/src/components/controls/base/DshPackage.vue +72 -0
- package/src/components/controls/base/DshSelect.vue +231 -0
- package/src/components/controls/base/DshSwitch.vue +112 -0
- package/src/components/controls/base/DshUndeveloped.vue +39 -0
- package/src/components/controls/base/YSerialNumber.vue +37 -0
- package/src/components/controls/base/ZUpload/YUploadImage.vue +228 -0
- package/src/components/controls/base/ZUpload/index.vue +356 -0
- package/src/components/controls/base/ZUpload/upload-list.vue +277 -0
- package/src/components/controls/base/ZUpload/upload-listItem.vue +0 -0
- package/src/components/controls/base/ZUpload/uploadMixin.js +397 -0
- package/src/components/controls/base/selectMixin.js +110 -0
- package/src/components/controls/base/textMultiple/DshTextMultiple.vue +94 -0
- package/src/components/controls/base/textMultiple/MultipleInput.vue +106 -0
- package/src/components/controls/controlMap.js +94 -0
- package/src/components/controls/controlMixin.js +84 -0
- package/src/components/form/DshAdvSearchForm.vue +341 -0
- package/src/components/form/DshDefaultSearch.vue +203 -0
- package/src/components/form/DshForm.vue +364 -0
- package/src/components/form/searchMixin.js +205 -0
- package/src/components/list/DshBox/DshBox.vue +168 -0
- package/src/components/list/DshBox/DshCard.vue +219 -0
- package/src/components/list/DshBox/DshCrossTable.vue +624 -0
- package/src/components/list/DshBox/DshList.vue +442 -0
- package/src/components/list/DshBox/DshPanel.vue +407 -0
- package/src/components/list/DshBox/DshSingleData.vue +82 -0
- package/src/components/list/DshBox/DshTable.vue +273 -0
- package/src/components/list/DshCascaderTable.vue +817 -0
- package/src/components/list/DshFlatTable.vue +622 -0
- package/src/components/list/ZTree.vue +527 -0
- package/src/components/list/easyTable/index.js +23 -0
- package/src/components/list/easyTable/src/directives/clickoutside.js +32 -0
- package/src/components/list/easyTable/src/mixins/layerAdjustment.js +62 -0
- package/src/components/list/easyTable/src/settings/settings.js +11 -0
- package/src/components/list/easyTable/src/utils/deepClone.js +256 -0
- package/src/components/list/easyTable/src/utils/dom.js +41 -0
- package/src/components/list/easyTable/src/utils/utils.js +190 -0
- package/src/components/list/easyTable/v-checkbox/index.js +7 -0
- package/src/components/list/easyTable/v-checkbox/src/checkbox.vue +127 -0
- package/src/components/list/easyTable/v-checkbox-group/index.js +7 -0
- package/src/components/list/easyTable/v-checkbox-group/src/checkbox-group.vue +68 -0
- package/src/components/list/easyTable/v-dropdown/index.js +7 -0
- package/src/components/list/easyTable/v-dropdown/src/dropdown.vue +337 -0
- package/src/components/list/easyTable/v-table/index.js +7 -0
- package/src/components/list/easyTable/v-table/src/body-cell-merge-mixin.js +141 -0
- package/src/components/list/easyTable/v-table/src/cell-edit-mixin.js +102 -0
- package/src/components/list/easyTable/v-table/src/checkbox-selection-mixin.js +189 -0
- package/src/components/list/easyTable/v-table/src/classes-mixin.js +56 -0
- package/src/components/list/easyTable/v-table/src/drag-width-mixin.js +202 -0
- package/src/components/list/easyTable/v-table/src/export-csv.js +74 -0
- package/src/components/list/easyTable/v-table/src/frozen-columns-mixin.js +134 -0
- package/src/components/list/easyTable/v-table/src/loading.vue +49 -0
- package/src/components/list/easyTable/v-table/src/scroll-bar-control-mixin.js +21 -0
- package/src/components/list/easyTable/v-table/src/scroll-control-mixin.js +92 -0
- package/src/components/list/easyTable/v-table/src/sort-control-mixin.js +108 -0
- package/src/components/list/easyTable/v-table/src/table-empty-mixin.js +73 -0
- package/src/components/list/easyTable/v-table/src/table-empty.vue +66 -0
- package/src/components/list/easyTable/v-table/src/table-filters-mixin.js +126 -0
- package/src/components/list/easyTable/v-table/src/table-footer-mixin.js +122 -0
- package/src/components/list/easyTable/v-table/src/table-resize-mixin.js +279 -0
- package/src/components/list/easyTable/v-table/src/table-row-mouse-events-mixin.js +123 -0
- package/src/components/list/easyTable/v-table/src/table.vue +1565 -0
- package/src/components/list/easyTable/v-table/src/title-cell-merge-mixin.js +115 -0
- package/src/components/list/evTable/EvTable.vue +323 -0
- package/src/components/list/evTable/EvTableMixin.js +26 -0
- package/src/components/other/DshAvatar.vue +149 -0
- package/src/components/other/DshBtnModal.vue +64 -0
- package/src/components/other/DshColorPanel.vue +128 -0
- package/src/components/other/DshEditPanel.vue +130 -0
- package/src/components/other/InfoCascader.vue +258 -0
- package/src/components/other/YNoPermission.vue +45 -0
- package/src/components/other/ZCode.vue +125 -0
- package/src/components/other/ZCollapseTree.vue +84 -0
- package/src/components/other/ZGantt.vue +669 -0
- package/src/components/other/ZIframe.vue +105 -0
- package/src/components/other/ZLoading.vue +59 -0
- package/src/components/other/menu/DshMenu.vue +133 -0
- package/src/components/other/menu/DshMenuNav.vue +104 -0
- package/src/components/pages/Error/Error403.vue +34 -0
- package/src/components/pages/Error/Error404.vue +34 -0
- package/src/components/pages/Error/Error500.vue +34 -0
- package/src/components/pages/Error/error.less +163 -0
- package/src/components/pages/Error/errorBack.vue +38 -0
- package/src/components/small/Ctooltip.vue +90 -0
- package/src/components/small/DshButtons.vue +195 -0
- package/src/components/small/DshControlDefine.vue +110 -0
- package/src/components/small/DshCrumbs.vue +61 -0
- package/src/components/small/DshCrumbsItem.vue +107 -0
- package/src/components/small/DshDropdown.vue +159 -0
- package/src/components/small/DshFileShow.vue +212 -0
- package/src/components/small/DshIcons.vue +63 -0
- package/src/components/small/DshModal.vue +255 -0
- package/src/components/small/DshPage.vue +98 -0
- package/src/components/small/DshSteps.vue +68 -0
- package/src/components/small/DshTabs.vue +227 -0
- package/src/components/small/DshTags.vue +58 -0
- package/src/components/small/DshTdRender.js +21 -0
- package/src/components/small/DshTitle.vue +36 -0
- package/src/components/small/render.js +20 -0
- package/src/components/unit/DshFormItem.vue +157 -0
- package/src/components/unit/DshUnit.vue +72 -0
- package/src/components/unit/unitMixin.js +43 -0
- package/src/datas/.DS_Store +0 -0
- package/src/datas/common/region.json +1 -0
- package/src/datas/common/resourceData.json +20 -0
- package/src/datas/index.js +11 -0
- package/src/index.js +243 -0
- package/src/styles/animate.less +16 -0
- package/src/styles/bundle.css +14 -0
- package/src/styles/common/box.less +157 -0
- package/src/styles/common/common.less +31 -0
- package/src/styles/common/flex.less +282 -0
- package/src/styles/common/index.less +4 -0
- package/src/styles/common/text.less +43 -0
- package/src/styles/components/controls/DshCascader.less +75 -0
- package/src/styles/components/controls/DshCheckbox.less +156 -0
- package/src/styles/components/controls/DshCoordinates.less +72 -0
- package/src/styles/components/controls/DshDaterange.less +49 -0
- package/src/styles/components/controls/DshDivider.less +115 -0
- package/src/styles/components/controls/DshEditor.less +52 -0
- package/src/styles/components/controls/DshInput.less +40 -0
- package/src/styles/components/controls/DshLabels.less +187 -0
- package/src/styles/components/controls/DshNumberange.less +24 -0
- package/src/styles/components/controls/DshPackage.less +25 -0
- package/src/styles/components/controls/DshSelect.less +172 -0
- package/src/styles/components/controls/MultipleInput.less +55 -0
- package/src/styles/components/controls/ZUpload.less +446 -0
- package/src/styles/components/form/DshAdvSearchForm.less +159 -0
- package/src/styles/components/form/DshDefaultSearch.less +71 -0
- package/src/styles/components/index.less +49 -0
- package/src/styles/components/list/DshCascaderTable.less +113 -0
- package/src/styles/components/list/DshCrossTable.less +175 -0
- package/src/styles/components/list/DshFlatTable.less +98 -0
- package/src/styles/components/list/DshSingleData.less +30 -0
- package/src/styles/components/list/evTable.less +79 -0
- package/src/styles/components/list/evtable/animation.less +141 -0
- package/src/styles/components/list/evtable/font/fontello.eot +0 -0
- package/src/styles/components/list/evtable/font/fontello.svg +32 -0
- package/src/styles/components/list/evtable/font/fontello.ttf +0 -0
- package/src/styles/components/list/evtable/font/fontello.woff +0 -0
- package/src/styles/components/list/evtable/font/fontello.woff2 +0 -0
- package/src/styles/components/list/evtable/fontello.less +68 -0
- package/src/styles/components/list/evtable/index.less +5 -0
- package/src/styles/components/list/evtable/v-checkbox.less +167 -0
- package/src/styles/components/list/evtable/v-dropdown.less +235 -0
- package/src/styles/components/list/evtable/v-table.less +334 -0
- package/src/styles/components/list/ivu_reset.less +49 -0
- package/src/styles/components/other/DshEditPanel.less +70 -0
- package/src/styles/components/other/DshMenu.less +37 -0
- package/src/styles/components/other/DshMenuNav.less +82 -0
- package/src/styles/components/other/InfoCascader.less +55 -0
- package/src/styles/components/other/ZCode.less +1 -0
- package/src/styles/components/other/ZCollapseTree.less +62 -0
- package/src/styles/components/other/ZGantt.less +278 -0
- package/src/styles/components/other/ZLoading.less +36 -0
- package/src/styles/components/small/Ctooltip.less +5 -0
- package/src/styles/components/small/DshButtons.less +40 -0
- package/src/styles/components/small/DshControlDefine.less +64 -0
- package/src/styles/components/small/DshDropdown.less +61 -0
- package/src/styles/components/small/DshPage.less +94 -0
- package/src/styles/components/small/DshSteps.less +58 -0
- package/src/styles/components/small/DshTabs.less +82 -0
- package/src/styles/components/small/DshTitle.less +18 -0
- package/src/styles/components/unit/DshFormItem.less +124 -0
- package/src/styles/define.less +374 -0
- package/src/styles/index.less +10 -0
- package/src/styles/reset.less +83 -0
- package/src/styles/variables.less +98 -0
- package/src/styles/view_reset.less +446 -0
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
components: {},
|
|
3
|
+
props: {
|
|
4
|
+
formList: {
|
|
5
|
+
type: Array,
|
|
6
|
+
default () {
|
|
7
|
+
return [];
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
dynamicFieldsMap: {
|
|
12
|
+
type: Object,
|
|
13
|
+
default () {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
data () {
|
|
19
|
+
return {
|
|
20
|
+
fieldMap: this.$modFieldMap,
|
|
21
|
+
conditionFields: [
|
|
22
|
+
"_id", "logic", "conditions", "textSearch", "nativeSearch",
|
|
23
|
+
"fieldKey", "fieldType", "fieldValue", "fieldParams", "fieldOperator", "fieldSearch", "parameterType"
|
|
24
|
+
]
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
computed: {
|
|
28
|
+
searchFormList () {
|
|
29
|
+
return this.formList.filter(formItem => this.$formHasAbility(formItem, "canSearch"));
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
created () { },
|
|
33
|
+
methods: {
|
|
34
|
+
/* -------- 方法 ----------- */
|
|
35
|
+
// 生成筛选条件的值
|
|
36
|
+
createContionFunc (initContion = { logic: "field" }, curFormItem, fieldKey) {
|
|
37
|
+
if (["field", undefined].includes(initContion.logic)) {
|
|
38
|
+
const formItem = curFormItem || this.searchFormList.find(formItem => formItem._key === fieldKey);
|
|
39
|
+
|
|
40
|
+
if (formItem) {
|
|
41
|
+
const fieldData = this.fieldMap[formItem._type];
|
|
42
|
+
const subFormList = formItem._subForm || [];
|
|
43
|
+
|
|
44
|
+
const operators = fieldData[this.mode === "set" ? "operatorsSet" : this.mode === "rely" ? "operatorsRely" : "operators"] || fieldData.operators || [];
|
|
45
|
+
const fieldOperator = initContion.fieldOperator || (operators[0] || {})._key;
|
|
46
|
+
const fieldOperatorName = (operators.find(operatorItem => operatorItem._key === fieldOperator) || {}).name;
|
|
47
|
+
|
|
48
|
+
const fieldValue = initContion.fieldValue || [];
|
|
49
|
+
const dynamicList = this.dynamicFieldsMap[formItem._type] || [];
|
|
50
|
+
const parameterType = initContion.parameterType || (!dynamicList.length || fieldValue.length ? "fixedText" : "dynamicText");
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
_id: this.$ObjectID().str,
|
|
54
|
+
logic: "field",
|
|
55
|
+
fieldKey: formItem._key,
|
|
56
|
+
fieldType: formItem._type,
|
|
57
|
+
fieldValue: [],
|
|
58
|
+
fieldOperator: fieldOperator,
|
|
59
|
+
fieldParams: [],
|
|
60
|
+
fieldSearch: {
|
|
61
|
+
logic: "and",
|
|
62
|
+
conditions: []
|
|
63
|
+
},
|
|
64
|
+
...initContion,
|
|
65
|
+
|
|
66
|
+
// 下面的是前端所用
|
|
67
|
+
parameterType: parameterType,
|
|
68
|
+
dynamicList: dynamicList,
|
|
69
|
+
fieldOperatorName: fieldOperatorName,
|
|
70
|
+
operators: operators,
|
|
71
|
+
formItem: this.getFormItem(formItem),
|
|
72
|
+
subFormList: subFormList,
|
|
73
|
+
finished: false // 标记 reference类型请求form数据 是否完成状态
|
|
74
|
+
};
|
|
75
|
+
} else {
|
|
76
|
+
return {
|
|
77
|
+
...initContion,
|
|
78
|
+
__isDelete__: true, // 前端用它标识对应字段已被删除的筛选项
|
|
79
|
+
formItem: {
|
|
80
|
+
__realKey__: initContion.fieldKey
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
} else if (["and", "or"].includes(initContion.logic)) {
|
|
85
|
+
return {
|
|
86
|
+
logic: "and",
|
|
87
|
+
conditions: [],
|
|
88
|
+
...initContion
|
|
89
|
+
};
|
|
90
|
+
} else if (["text"].includes(initContion.logic)) {
|
|
91
|
+
return {
|
|
92
|
+
logic: "text",
|
|
93
|
+
textSearch: "",
|
|
94
|
+
...initContion
|
|
95
|
+
};
|
|
96
|
+
} else if (["native"].includes(initContion.logic)) {
|
|
97
|
+
return {
|
|
98
|
+
logic: "native",
|
|
99
|
+
nativeSearch: {},
|
|
100
|
+
...initContion
|
|
101
|
+
};
|
|
102
|
+
} else {
|
|
103
|
+
return initContion;
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
// 获取表单配置
|
|
107
|
+
getFormItem (formItem) {
|
|
108
|
+
return {
|
|
109
|
+
...this.formatFormItem(formItem),
|
|
110
|
+
...(
|
|
111
|
+
["default", "rely"].includes(this.mode)
|
|
112
|
+
? (
|
|
113
|
+
["date", "daterange"].includes(formItem._type)
|
|
114
|
+
? {
|
|
115
|
+
_useShortcuts: false
|
|
116
|
+
}
|
|
117
|
+
: {}
|
|
118
|
+
)
|
|
119
|
+
: {}
|
|
120
|
+
),
|
|
121
|
+
_line: false,
|
|
122
|
+
_span: 24,
|
|
123
|
+
_useColor: true
|
|
124
|
+
};
|
|
125
|
+
},
|
|
126
|
+
// 格式化表单配置,适合需要
|
|
127
|
+
formatFormItem (formItem) {
|
|
128
|
+
const fieldData = this.fieldMap[formItem._type];
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
...formItem,
|
|
132
|
+
...(fieldData.searchProps || {}),
|
|
133
|
+
_key: "fieldValue",
|
|
134
|
+
__realKey__: formItem._key,
|
|
135
|
+
_description: undefined,
|
|
136
|
+
_required: false,
|
|
137
|
+
_br: false,
|
|
138
|
+
_wrap: false,
|
|
139
|
+
_enterType: undefined,
|
|
140
|
+
canEdit: true,
|
|
141
|
+
_data: ["switch"].includes(formItem._type)
|
|
142
|
+
? [
|
|
143
|
+
{
|
|
144
|
+
_key: "true",
|
|
145
|
+
name: formItem._openText,
|
|
146
|
+
color: "#87e8de"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
_key: "false",
|
|
150
|
+
name: formItem._closeText,
|
|
151
|
+
color: "#87e8de"
|
|
152
|
+
}
|
|
153
|
+
]
|
|
154
|
+
: formItem._data
|
|
155
|
+
};
|
|
156
|
+
},
|
|
157
|
+
|
|
158
|
+
// operator为子集且为reference类型,请求form
|
|
159
|
+
dealSubSearch (conditionItem) {
|
|
160
|
+
if (conditionItem.fieldOperator === "subSearch" && conditionItem.finished !== true) {
|
|
161
|
+
this.getModData(conditionItem.formItem, data => {
|
|
162
|
+
conditionItem.finished = true;
|
|
163
|
+
conditionItem.subFormList = data.screens[0].form;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
// 加载 reference数据
|
|
168
|
+
getModData (obj, cb) {
|
|
169
|
+
this.$https({
|
|
170
|
+
url: {
|
|
171
|
+
module: "sheet",
|
|
172
|
+
name: "schema"
|
|
173
|
+
},
|
|
174
|
+
params: {
|
|
175
|
+
_key: obj._ref,
|
|
176
|
+
fields: obj._refFields
|
|
177
|
+
},
|
|
178
|
+
callback: data => {
|
|
179
|
+
cb(data);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
},
|
|
183
|
+
|
|
184
|
+
// 剔除conditions项里不要的属性
|
|
185
|
+
transformConditions (list = []) {
|
|
186
|
+
return list.map(item =>
|
|
187
|
+
this.conditionFields.reduce((obj, key) =>
|
|
188
|
+
Object.assign(obj, {
|
|
189
|
+
[key]: item[key]
|
|
190
|
+
? (
|
|
191
|
+
key === "fieldSearch"
|
|
192
|
+
? {
|
|
193
|
+
...item[key],
|
|
194
|
+
conditions: this.transformConditions(item[key].conditions)
|
|
195
|
+
}
|
|
196
|
+
: key === "conditions"
|
|
197
|
+
? this.transformConditions(item[key])
|
|
198
|
+
: item[key]
|
|
199
|
+
)
|
|
200
|
+
: item[key]
|
|
201
|
+
}), {})
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="DshBox">
|
|
3
|
+
<div class="DshBox-list">
|
|
4
|
+
<component
|
|
5
|
+
:is="`Dsh${$firstUpperCase(mode)}`"
|
|
6
|
+
ref="list"
|
|
7
|
+
:data="data"
|
|
8
|
+
:columns="columns"
|
|
9
|
+
:fixTitle="fixTitle"
|
|
10
|
+
:ownColumns="ownColumns"
|
|
11
|
+
:operationList="operationList"
|
|
12
|
+
:extraOperationList="extraOperationList"
|
|
13
|
+
:propsObj="listPropsObj"
|
|
14
|
+
:changedFields="changedFields"
|
|
15
|
+
:isLoading="listPropsObj && listPropsObj.isLoading"
|
|
16
|
+
:noDataText="listPropsObj && listPropsObj.noDataText || '暂无数据...'"
|
|
17
|
+
@clickRow="clickRow"
|
|
18
|
+
@sortChange="changeSort"
|
|
19
|
+
@selectChange="changeSelect"
|
|
20
|
+
@selectAll="selectAll"
|
|
21
|
+
@select="select"
|
|
22
|
+
@groupScroll="groupScroll"
|
|
23
|
+
@groupLoad="groupLoad"
|
|
24
|
+
@dsh="dshEmit"
|
|
25
|
+
>
|
|
26
|
+
<slot
|
|
27
|
+
name="col"
|
|
28
|
+
slot="col"
|
|
29
|
+
slot-scope="{ col }"
|
|
30
|
+
:col="col"
|
|
31
|
+
></slot>
|
|
32
|
+
</component>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<!-- 中间插槽 -->
|
|
36
|
+
<slot></slot>
|
|
37
|
+
|
|
38
|
+
<!-- 分页 -->
|
|
39
|
+
<div
|
|
40
|
+
v-if="!['panel', 'singleData'].includes(mode) && pagePropsObj"
|
|
41
|
+
class="DshBox-page"
|
|
42
|
+
>
|
|
43
|
+
<dsh-page
|
|
44
|
+
:mode="pageMode"
|
|
45
|
+
:total="total"
|
|
46
|
+
:propsObj="pagePropsObj"
|
|
47
|
+
@changePage="changePage"
|
|
48
|
+
@changePageSize="changePageSize"
|
|
49
|
+
></dsh-page>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script>
|
|
55
|
+
// 表格模式、竖向表格模式、卡片模式、看板模式
|
|
56
|
+
const tableTypes = ["table", "crossTable", "panel", "card", "list", "singleData"];
|
|
57
|
+
// 得到组件注册对象
|
|
58
|
+
function registerComponents (types) {
|
|
59
|
+
return types.reduce((obj, item) => {
|
|
60
|
+
const componentName = `Dsh${item.toString()[0].toUpperCase()}${item.toString().slice(1)}`;
|
|
61
|
+
return Object.assign(obj, {
|
|
62
|
+
[componentName]: () => import(`./${componentName}.vue`)
|
|
63
|
+
});
|
|
64
|
+
}, {});
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export default {
|
|
68
|
+
name: "DshBox",
|
|
69
|
+
components: registerComponents(tableTypes),
|
|
70
|
+
props: {
|
|
71
|
+
mode: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: "list",
|
|
74
|
+
validator: function (val) {
|
|
75
|
+
return ["table", "crossTable", "panel", "card", "list", "singleData"].includes(val);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
changedFields: Array,
|
|
80
|
+
data: Array,
|
|
81
|
+
columns: Array,
|
|
82
|
+
fixTitle: {
|
|
83
|
+
type: Boolean,
|
|
84
|
+
default: true
|
|
85
|
+
},
|
|
86
|
+
operationList: Array,
|
|
87
|
+
extraOperationList: Array,
|
|
88
|
+
listPropsObj: Object,
|
|
89
|
+
pageMode: String,
|
|
90
|
+
total: Number,
|
|
91
|
+
pagePropsObj: Object,
|
|
92
|
+
ownColumns: Array
|
|
93
|
+
},
|
|
94
|
+
data () {
|
|
95
|
+
return {};
|
|
96
|
+
},
|
|
97
|
+
computed: {},
|
|
98
|
+
created () {
|
|
99
|
+
},
|
|
100
|
+
methods: {
|
|
101
|
+
// 点击某行
|
|
102
|
+
clickRow (...params) {
|
|
103
|
+
this.$emit("clickRow", ...params);
|
|
104
|
+
},
|
|
105
|
+
|
|
106
|
+
// 改变选择项
|
|
107
|
+
changeSort (...params) {
|
|
108
|
+
this.$emit("sortChange", ...params);
|
|
109
|
+
},
|
|
110
|
+
// 改变选择项
|
|
111
|
+
changeSelect (...params) {
|
|
112
|
+
this.$emit("selectChange", ...params);
|
|
113
|
+
},
|
|
114
|
+
// 切换全选
|
|
115
|
+
selectAll (...params) {
|
|
116
|
+
this.$emit("selectAll", ...params);
|
|
117
|
+
},
|
|
118
|
+
// 切换选择
|
|
119
|
+
select (...params) {
|
|
120
|
+
this.$emit("select", ...params);
|
|
121
|
+
},
|
|
122
|
+
// 看板分组列表滚动事件
|
|
123
|
+
groupScroll (...params) {
|
|
124
|
+
this.$emit("groupScroll", ...params);
|
|
125
|
+
},
|
|
126
|
+
// 看板分组列表滚动至底部事件
|
|
127
|
+
groupLoad (...params) {
|
|
128
|
+
this.$emit("groupLoad", ...params);
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
// 转发
|
|
132
|
+
dshEmit (...params) {
|
|
133
|
+
this.$emit("dsh", ...params);
|
|
134
|
+
},
|
|
135
|
+
// 切换分页
|
|
136
|
+
changePage (...params) {
|
|
137
|
+
this.$emit("changePage", ...params);
|
|
138
|
+
},
|
|
139
|
+
// 切换分页条数
|
|
140
|
+
changePageSize (...params) {
|
|
141
|
+
this.$emit("changePageSize", ...params);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
</script>
|
|
146
|
+
|
|
147
|
+
<style lang="less">
|
|
148
|
+
.DshBox {
|
|
149
|
+
width: 100%;
|
|
150
|
+
height: 100%;
|
|
151
|
+
display: flex;
|
|
152
|
+
flex-direction: column;
|
|
153
|
+
|
|
154
|
+
&-list {
|
|
155
|
+
width: 100%;
|
|
156
|
+
flex: 1;
|
|
157
|
+
min-height: 60px;
|
|
158
|
+
margin-bottom: 10px;
|
|
159
|
+
background: #fff;
|
|
160
|
+
overflow: auto;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&-page {
|
|
164
|
+
width: 100%;
|
|
165
|
+
height: 30px;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
</style>
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="DshCard">
|
|
3
|
+
<!-- 无数据 -->
|
|
4
|
+
<div v-if="!data.length" class="dsh-tip">{{noDataText}}</div>
|
|
5
|
+
|
|
6
|
+
<!-- 有数据 -->
|
|
7
|
+
<template v-else>
|
|
8
|
+
<div
|
|
9
|
+
class="DshCard-item"
|
|
10
|
+
v-for="(dataItem, dataIndex) in data"
|
|
11
|
+
:key="dataIndex"
|
|
12
|
+
@click="clickRow(dataItem)"
|
|
13
|
+
>
|
|
14
|
+
<!-- 下拉操作(定位css) -->
|
|
15
|
+
<dsh-dropdown
|
|
16
|
+
class="DshCard-item-dropdown"
|
|
17
|
+
:dropdownObj="dropdownObj"
|
|
18
|
+
:list="operationList"
|
|
19
|
+
@click="$dshEmit($event, dataItem, dataIndex)"
|
|
20
|
+
@click.native.stop="0"
|
|
21
|
+
></dsh-dropdown>
|
|
22
|
+
|
|
23
|
+
<!-- 背景图 -->
|
|
24
|
+
<div
|
|
25
|
+
class="DshCard-item-image"
|
|
26
|
+
>
|
|
27
|
+
<img :src="getCardBgImgSrc(dataItem)" alt="">
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<!-- 内容 -->
|
|
31
|
+
<div class="DshCard-item-info">
|
|
32
|
+
<!-- 标题 -->
|
|
33
|
+
<div class="DshCard-item-info-title dsh-ellipsis">
|
|
34
|
+
<Ctooltip
|
|
35
|
+
placement="top"
|
|
36
|
+
:transfer="true"
|
|
37
|
+
:content="dataItem[propsObj.titleField]"
|
|
38
|
+
>
|
|
39
|
+
<div class="dsh-ellipsis">{{ dataItem[propsObj.titleField] }}</div>
|
|
40
|
+
</Ctooltip>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<!-- 显示字段 -->
|
|
44
|
+
<div
|
|
45
|
+
class="DshCard-item-info-col unit"
|
|
46
|
+
v-for="colItem in selfColumns"
|
|
47
|
+
:key="colItem._key"
|
|
48
|
+
>
|
|
49
|
+
<!-- 左 label -->
|
|
50
|
+
<Ctooltip
|
|
51
|
+
class="unit-label"
|
|
52
|
+
placement="top"
|
|
53
|
+
:transfer="true"
|
|
54
|
+
maxWidth="200"
|
|
55
|
+
:content="colItem._name"
|
|
56
|
+
>
|
|
57
|
+
<span class="dsh-ellipsis">{{ colItem._name }}</span>
|
|
58
|
+
</Ctooltip>
|
|
59
|
+
<span class="unit-colon">:</span>
|
|
60
|
+
|
|
61
|
+
<!-- 右 val -->
|
|
62
|
+
<div class="unit-value dsh-ellipsis">
|
|
63
|
+
<dsh-td-render
|
|
64
|
+
v-if="colItem.render"
|
|
65
|
+
:row="dataItem"
|
|
66
|
+
:column="colItem"
|
|
67
|
+
:index="0"
|
|
68
|
+
:render="colItem.render"
|
|
69
|
+
></dsh-td-render>
|
|
70
|
+
|
|
71
|
+
<div
|
|
72
|
+
v-else-if="colItem.formatter"
|
|
73
|
+
v-html="colItem.formatter(dataItem, 0)"
|
|
74
|
+
></div>
|
|
75
|
+
|
|
76
|
+
<span v-else class="unit-value-text">{{ dataItem[colItem._key] }}</span>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
</template>
|
|
82
|
+
</div>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<script>
|
|
86
|
+
export default {
|
|
87
|
+
name: "DshCard",
|
|
88
|
+
props: {
|
|
89
|
+
data: {
|
|
90
|
+
type: Array,
|
|
91
|
+
default () {
|
|
92
|
+
return [];
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
columns: {
|
|
96
|
+
type: Array,
|
|
97
|
+
default () {
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
|
|
102
|
+
propsObj: {
|
|
103
|
+
type: Object,
|
|
104
|
+
default () {
|
|
105
|
+
return {};
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
operationList: {
|
|
109
|
+
type: Array,
|
|
110
|
+
default () {
|
|
111
|
+
return [];
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
noDataText: {
|
|
115
|
+
type: String,
|
|
116
|
+
default: "暂无数据..."
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
data () {
|
|
120
|
+
return {
|
|
121
|
+
// 下拉菜单的配置
|
|
122
|
+
dropdownObj: {
|
|
123
|
+
icon: "ios-more",
|
|
124
|
+
size: 22,
|
|
125
|
+
color: "#E9ECF4",
|
|
126
|
+
showDropdownItemIcon: false
|
|
127
|
+
},
|
|
128
|
+
defaultImgObj: {
|
|
129
|
+
url: this.$imageSrcMap.app.projectCard
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
getCardBgImgSrc (dataItem) {
|
|
133
|
+
const fileList = dataItem[this.propsObj.imageField] || [];
|
|
134
|
+
const imgObj = fileList.find(fileItem => fileItem.mimetype.includes("image")) || this.defaultImgObj;
|
|
135
|
+
return imgObj.url;
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
},
|
|
139
|
+
computed: {
|
|
140
|
+
selfColumns () {
|
|
141
|
+
return this.columns.slice(0, 2);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
created () {
|
|
145
|
+
},
|
|
146
|
+
methods: {
|
|
147
|
+
// 点击某行
|
|
148
|
+
clickRow (row) {
|
|
149
|
+
this.$emit("clickRow", row);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
</script>
|
|
154
|
+
|
|
155
|
+
<style lang="less" scoped>
|
|
156
|
+
.DshCard {
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-wrap: wrap;
|
|
159
|
+
background-color: #ffffff;
|
|
160
|
+
padding: 0 40px;
|
|
161
|
+
&-item {
|
|
162
|
+
width: 250px;
|
|
163
|
+
height: 210px;
|
|
164
|
+
box-sizing: border-box;
|
|
165
|
+
margin: 10px 16px 30px;
|
|
166
|
+
border-radius: 6px;
|
|
167
|
+
overflow: hidden;
|
|
168
|
+
box-shadow: 0px 4px 8px 0px rgba(222, 222, 222, 0.75);
|
|
169
|
+
cursor: pointer;
|
|
170
|
+
display: flex;
|
|
171
|
+
flex-direction: column;
|
|
172
|
+
position: relative;
|
|
173
|
+
|
|
174
|
+
&-dropdown {
|
|
175
|
+
position: absolute;
|
|
176
|
+
top: 5px;
|
|
177
|
+
right: 5px;
|
|
178
|
+
}
|
|
179
|
+
&-image {
|
|
180
|
+
padding-top: 20px;
|
|
181
|
+
height: 122px;
|
|
182
|
+
}
|
|
183
|
+
&-info {
|
|
184
|
+
flex: 1;
|
|
185
|
+
padding: 8px 15px;
|
|
186
|
+
overflow: hidden;
|
|
187
|
+
background: #F7FBFF;
|
|
188
|
+
&-title {
|
|
189
|
+
font-size: 14px;
|
|
190
|
+
font-weight: 600;
|
|
191
|
+
}
|
|
192
|
+
&-col {
|
|
193
|
+
height: 24px;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.unit {
|
|
197
|
+
display: flex;
|
|
198
|
+
flex-direction: row;
|
|
199
|
+
&-label {
|
|
200
|
+
max-width: 60px;
|
|
201
|
+
font-weight: 400;
|
|
202
|
+
color: #515A6E;
|
|
203
|
+
}
|
|
204
|
+
&-colon {
|
|
205
|
+
|
|
206
|
+
}
|
|
207
|
+
&-value {
|
|
208
|
+
flex: 1;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
</style>
|
|
215
|
+
<style lang="less">
|
|
216
|
+
.DshCard {
|
|
217
|
+
|
|
218
|
+
}
|
|
219
|
+
</style>
|