meixioacomponent 0.1.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 +19 -0
- package/babel.config.js +5 -0
- package/lib/demo.html +10 -0
- package/lib/meixicomponent.common.js +40065 -0
- package/lib/meixicomponent.common.js.map +1 -0
- package/lib/meixicomponent.css +1 -0
- package/lib/meixicomponent.umd.js +40075 -0
- package/lib/meixicomponent.umd.js.map +1 -0
- package/lib/meixicomponent.umd.min.js +20 -0
- package/lib/meixicomponent.umd.min.js.map +1 -0
- package/package.json +37 -0
- package/packages/components/base/baseAnchor/baseAnchor.vue +156 -0
- package/packages/components/base/baseAnchor/index.js +6 -0
- package/packages/components/base/baseAppendix/baseAppendix.vue +78 -0
- package/packages/components/base/baseAppendix/index.js +7 -0
- package/packages/components/base/baseArea/area.js +14978 -0
- package/packages/components/base/baseArea/areaConfig.js +6 -0
- package/packages/components/base/baseArea/baseArea.vue +531 -0
- package/packages/components/base/baseArea/index.js +7 -0
- package/packages/components/base/baseAvatar/baseAvatar.vue +101 -0
- package/packages/components/base/baseAvatar/index.js +6 -0
- package/packages/components/base/baseButtonHandle/baseButtonHandle.vue +64 -0
- package/packages/components/base/baseButtonHandle/index.js +6 -0
- package/packages/components/base/baseDefaultSvg/baseDefaultSvg.vue +52 -0
- package/packages/components/base/baseDefaultSvg/index.js +7 -0
- package/packages/components/base/baseDialog/index.js +7 -0
- package/packages/components/base/baseDialog/index.vue +146 -0
- package/packages/components/base/baseDialogTable/dialogTable.vue +186 -0
- package/packages/components/base/baseDialogTable/index.js +7 -0
- package/packages/components/base/baseDrawer/index.js +8 -0
- package/packages/components/base/baseDrawer/index.vue +196 -0
- package/packages/components/base/baseEdito/baseEdito.vue +202 -0
- package/packages/components/base/baseEdito/index.js +6 -0
- package/packages/components/base/baseFixedHeader/baseFixedHeader.vue +168 -0
- package/packages/components/base/baseFixedHeader/index.js +6 -0
- package/packages/components/base/baseIcon/index.js +6 -0
- package/packages/components/base/baseIcon/index.vue +146 -0
- package/packages/components/base/baseImageViewer/image-viewer.vue +348 -0
- package/packages/components/base/baseImageViewer/index.js +7 -0
- package/packages/components/base/baseImg/baseImg.vue +160 -0
- package/packages/components/base/baseImg/index.js +6 -0
- package/packages/components/base/baseInforWrap/baseInforWrap.vue +66 -0
- package/packages/components/base/baseInforWrap/index.js +6 -0
- package/packages/components/base/baseLineInfoGroup/baseLineInfoGroup.vue +93 -0
- package/packages/components/base/baseLineInfoGroup/index.js +6 -0
- package/packages/components/base/baseLineInfoItem/baseLineInfoItem.vue +173 -0
- package/packages/components/base/baseLineInfoItem/index.js +6 -0
- package/packages/components/base/basePageHeader/basePageHeader.vue +55 -0
- package/packages/components/base/basePageHeader/index.js +6 -0
- package/packages/components/base/basePagination/index.js +6 -0
- package/packages/components/base/basePagination/index.vue +75 -0
- package/packages/components/base/basePlainTable/basePlainTable.vue +90 -0
- package/packages/components/base/basePlainTable/index.js +6 -0
- package/packages/components/base/baseSection/baseSection.vue +121 -0
- package/packages/components/base/baseSection/index.js +6 -0
- package/packages/components/base/baseSkeleton/baseSkeleton.vue +147 -0
- package/packages/components/base/baseSkeleton/index.js +6 -0
- package/packages/components/base/baseSvg/index.js +7 -0
- package/packages/components/base/baseSvg/index.vue +66 -0
- package/packages/components/base/baseTimeTypeSelect/base_time_type_select.vue +293 -0
- package/packages/components/base/baseTimeTypeSelect/config.js +47 -0
- package/packages/components/base/baseTimeTypeSelect/index.js +6 -0
- package/packages/components/base/baseToggle/index.js +7 -0
- package/packages/components/base/baseToggle/toggle.vue +131 -0
- package/packages/components/base/baseUpload/baseUpload.js +6 -0
- package/packages/components/base/baseUpload/baseUpload.vue +111 -0
- package/packages/components/base/baseUpload/baseUploadItem.js +6 -0
- package/packages/components/base/baseUpload/baseUploadItem.vue +205 -0
- package/packages/components/base/baseUpload/mixins.js +46 -0
- package/packages/components/base/brieflyItem.vue +198 -0
- package/packages/components/base/upload/index.js +6 -0
- package/packages/components/base/upload/upload.vue +245 -0
- package/packages/components/base/upload/uploadItem.vue +157 -0
- package/packages/components/dynamicmount/DynamicMount.js +55 -0
- package/packages/components/dynamicmount/dynamicMount.vue +95 -0
- package/packages/components/dynamicmount/index.js +46 -0
- package/packages/components/index.js +114 -0
- package/packages/components/proForm/dialogForm/baseDialogForm.vue +163 -0
- package/packages/components/proForm/dialogForm/dialogFormIndex.js +6 -0
- package/packages/components/proForm/proForm/index.js +6 -0
- package/packages/components/proForm/proForm/pro_form.vue +279 -0
- package/packages/components/proForm/proForm/pro_form_item.vue +459 -0
- package/packages/components/proForm/proFormWrap/index.js +6 -0
- package/packages/components/proForm/proFormWrap/pro_form_wrap.vue +83 -0
- package/packages/components/proPageTable/index.js +6 -0
- package/packages/components/proPageTable/oa_pro-table-search.vue +190 -0
- package/packages/components/proPageTable/oa_pro_colum_config.vue +219 -0
- package/packages/components/proPageTable/oa_pro_footer.vue +104 -0
- package/packages/components/proPageTable/oa_pro_header.vue +31 -0
- package/packages/components/proPageTable/oa_pro_screen.vue +81 -0
- package/packages/components/proPageTable/oa_pro_screen_item.vue +174 -0
- package/packages/components/proPageTable/oa_pro_table-header.vue +150 -0
- package/packages/components/proPageTable/oa_pro_table.vue +804 -0
- package/packages/components/proPageTable/oa_pro_table_skeleton.vue +33 -0
- package/packages/components/searchHeader/searchHeader.vue +118 -0
- package/packages/config/selectStore/SelectStore.js +24 -0
- package/packages/config/selectStore/UseSelectStoreClass.js +27 -0
- package/packages/config/selectStore/testSelectStore.js +40 -0
- package/packages/config/uploadRequest.js +66 -0
- package/packages/config/use/UseImg.js +39 -0
- package/packages/config/use/UseSelectStore.js +2 -0
- package/packages/config/use/UseUpload.js +47 -0
- package/packages/config/use/useFixedHeader.js +36 -0
- package/packages/utils/upload.js +35 -0
- package/packages/utils/uploadRequest.js +66 -0
- package/packages/utils/utils.js +186 -0
- package/public/favicon.ico +0 -0
- package/public/img/icons/android-chrome-192x192.png +0 -0
- package/public/img/icons/android-chrome-512x512.png +0 -0
- package/public/img/icons/android-chrome-maskable-192x192.png +0 -0
- package/public/img/icons/android-chrome-maskable-512x512.png +0 -0
- package/public/img/icons/apple-touch-icon-120x120.png +0 -0
- package/public/img/icons/apple-touch-icon-152x152.png +0 -0
- package/public/img/icons/apple-touch-icon-180x180.png +0 -0
- package/public/img/icons/apple-touch-icon-60x60.png +0 -0
- package/public/img/icons/apple-touch-icon-76x76.png +0 -0
- package/public/img/icons/apple-touch-icon.png +0 -0
- package/public/img/icons/favicon-16x16.png +0 -0
- package/public/img/icons/favicon-32x32.png +0 -0
- package/public/img/icons/msapplication-icon-144x144.png +0 -0
- package/public/img/icons/mstile-150x150.png +0 -0
- package/public/img/icons/safari-pinned-tab.svg +3 -0
- package/public/index.html +17 -0
- package/public/robots.txt +2 -0
- package/src/assets/logo.png +0 -0
- package/src/main.js +9 -0
- package/src/router/index.js +29 -0
- package/src/store/index.js +15 -0
|
@@ -0,0 +1,804 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="oa-pro-table-wrap" :style="{ height: height }">
|
|
3
|
+
<!-- 表格的头部 -->
|
|
4
|
+
<div
|
|
5
|
+
class="oa-pro-header-wrap"
|
|
6
|
+
v-if="headerConfig"
|
|
7
|
+
:style="{ height: `${config.headerHeight}px` }"
|
|
8
|
+
>
|
|
9
|
+
<!-- 表格头部 -->
|
|
10
|
+
<oaProHeader :headerText="headerConfig.headerText">
|
|
11
|
+
<template slot="prefix">
|
|
12
|
+
<slot name="prefix"></slot>
|
|
13
|
+
</template>
|
|
14
|
+
<div class="header-extend" slot="headerExtend">
|
|
15
|
+
<slot name="headerExtend"></slot>
|
|
16
|
+
</div>
|
|
17
|
+
<template slot="suffix">
|
|
18
|
+
<slot name="suffix"></slot>
|
|
19
|
+
</template>
|
|
20
|
+
</oaProHeader>
|
|
21
|
+
</div>
|
|
22
|
+
<!-- 表格搜索 -->
|
|
23
|
+
|
|
24
|
+
<div class="oa-pro-table-search">
|
|
25
|
+
<oa_pro_table_searchVue
|
|
26
|
+
v-model="module"
|
|
27
|
+
:screenList="screenList"
|
|
28
|
+
:placeholder="placeholder"
|
|
29
|
+
:proScreenList="proScreenList"
|
|
30
|
+
:proScreenConfig="_proScreenConfig"
|
|
31
|
+
@searchContentHeightChange="searchContentHeightChange"
|
|
32
|
+
></oa_pro_table_searchVue>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<!-- 表格内容 -->
|
|
36
|
+
|
|
37
|
+
<div
|
|
38
|
+
:class="{
|
|
39
|
+
'oa-pro-table': true,
|
|
40
|
+
'check-type-single': tableCheckboxConfig.type == 'single',
|
|
41
|
+
'check-type-multiple': tableCheckboxConfig.type == 'multiple',
|
|
42
|
+
}"
|
|
43
|
+
>
|
|
44
|
+
<el-table
|
|
45
|
+
ref="elTable"
|
|
46
|
+
:stripe="true"
|
|
47
|
+
:data="tableData"
|
|
48
|
+
:height="tableHeight"
|
|
49
|
+
@cell-mouse-enter="cellMouseEnter"
|
|
50
|
+
@cell-mouse-leave="cellMouseLeave"
|
|
51
|
+
@selection-change="handleSelectionChange"
|
|
52
|
+
:style="{
|
|
53
|
+
width: width,
|
|
54
|
+
}"
|
|
55
|
+
border
|
|
56
|
+
>
|
|
57
|
+
<!-- 表格暂无数据 -->
|
|
58
|
+
<template slot="empty">
|
|
59
|
+
<baseDefaultSvgVue
|
|
60
|
+
:width="280"
|
|
61
|
+
:height="280"
|
|
62
|
+
v-show="defaultSvg"
|
|
63
|
+
:svgName="`no-data`"
|
|
64
|
+
:text="`暂无表格数据`"
|
|
65
|
+
></baseDefaultSvgVue>
|
|
66
|
+
<!-- 加载骨架屏 -->
|
|
67
|
+
<oa_pro_table_skeletonVue
|
|
68
|
+
slot="append"
|
|
69
|
+
:height="`${tableHeight}px`"
|
|
70
|
+
v-show="loading"
|
|
71
|
+
></oa_pro_table_skeletonVue>
|
|
72
|
+
<span></span>
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<el-table-column type="selection" width="60px"></el-table-column>
|
|
76
|
+
<el-table-column
|
|
77
|
+
:key="index"
|
|
78
|
+
:align="align"
|
|
79
|
+
:fixed="item.lock"
|
|
80
|
+
v-show="item.show"
|
|
81
|
+
:prop="item.key"
|
|
82
|
+
:label="item.label"
|
|
83
|
+
:width="item.width"
|
|
84
|
+
v-for="(item, index) in showTableHeader"
|
|
85
|
+
sortable
|
|
86
|
+
>
|
|
87
|
+
<template slot="header" slot-scope="scope">
|
|
88
|
+
<oaProtableHeader
|
|
89
|
+
:scope="scope"
|
|
90
|
+
:config="item"
|
|
91
|
+
:index="index"
|
|
92
|
+
@headerItemLock="headerItemLock"
|
|
93
|
+
@headerItemUnlock="headerItemUnlock"
|
|
94
|
+
@handleScreenItem="handleScreenItem"
|
|
95
|
+
></oaProtableHeader>
|
|
96
|
+
</template>
|
|
97
|
+
|
|
98
|
+
<template slot-scope="scope">
|
|
99
|
+
<slot :name="item.key" :scope="scope.row" v-if="item.template">
|
|
100
|
+
</slot>
|
|
101
|
+
|
|
102
|
+
<span
|
|
103
|
+
v-else
|
|
104
|
+
:class="
|
|
105
|
+
item.click
|
|
106
|
+
? 'cell-content-text active'
|
|
107
|
+
: `cell-content-text ${item.color}`
|
|
108
|
+
"
|
|
109
|
+
@click="rowClick(item, scope.row)"
|
|
110
|
+
>{{ scope.row[`${item.key}`] }}</span
|
|
111
|
+
>
|
|
112
|
+
</template>
|
|
113
|
+
</el-table-column>
|
|
114
|
+
</el-table>
|
|
115
|
+
|
|
116
|
+
<div class="table-suffix">
|
|
117
|
+
<oa_pro_colum_configVue
|
|
118
|
+
:config="tableConfig"
|
|
119
|
+
@setTableHeaderConfig="setTableHeaderConfig"
|
|
120
|
+
></oa_pro_colum_configVue>
|
|
121
|
+
</div>
|
|
122
|
+
<!-- 每一个单元格提示内容 -->
|
|
123
|
+
<el-tooltip
|
|
124
|
+
class="item"
|
|
125
|
+
effect="dark"
|
|
126
|
+
:manual="true"
|
|
127
|
+
placement="top"
|
|
128
|
+
ref="tableTooltip"
|
|
129
|
+
v-model="tooltip.show"
|
|
130
|
+
:visible-arrow="false"
|
|
131
|
+
:content="`${tooltip.content}`"
|
|
132
|
+
>
|
|
133
|
+
<span class="table-tooltip-wrap" :style="toolTipsStyle"> </span>
|
|
134
|
+
</el-tooltip>
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
<!-- 表格尾部 -->
|
|
138
|
+
<div
|
|
139
|
+
class="oa-pro-table-footer"
|
|
140
|
+
:style="{ height: `${config.footHeight}px` }"
|
|
141
|
+
>
|
|
142
|
+
<oa_pro_footerVue
|
|
143
|
+
:pageProps="pageProps"
|
|
144
|
+
:totalList="totalList"
|
|
145
|
+
:pageConfig="pageConfig"
|
|
146
|
+
></oa_pro_footerVue>
|
|
147
|
+
</div>
|
|
148
|
+
|
|
149
|
+
<!-- 高级筛选的弹框 -->
|
|
150
|
+
<base-dialog
|
|
151
|
+
:title="`高级筛选`"
|
|
152
|
+
ref="dialog"
|
|
153
|
+
:width="`1000px`"
|
|
154
|
+
:modal="proScreenModel"
|
|
155
|
+
:modallAppendToBody="false"
|
|
156
|
+
>
|
|
157
|
+
<oa_pro_screenVue
|
|
158
|
+
slot="dialog-content"
|
|
159
|
+
:proScreenList="proScreenList"
|
|
160
|
+
:proScreenConfig="_proScreenConfig"
|
|
161
|
+
@insertDefaultItem="insertDefaultItem"
|
|
162
|
+
@deleteProscreenItem="deleteProscreenItem"
|
|
163
|
+
></oa_pro_screenVue>
|
|
164
|
+
|
|
165
|
+
<baseButtonHandle
|
|
166
|
+
slot="dialog-footer"
|
|
167
|
+
:config="footerHandleConfig"
|
|
168
|
+
></baseButtonHandle>
|
|
169
|
+
</base-dialog>
|
|
170
|
+
</div>
|
|
171
|
+
</template>
|
|
172
|
+
|
|
173
|
+
<script>
|
|
174
|
+
import oaProHeader from "./oa_pro_header.vue"; //表格头部
|
|
175
|
+
import oa_pro_footerVue from "./oa_pro_footer.vue"; //表格尾部
|
|
176
|
+
import oa_pro_screenVue from "./oa_pro_screen.vue"; //表格高级搜索组件
|
|
177
|
+
import oaProtableHeader from "./oa_pro_table-header.vue"; //表格自定义列表头组件
|
|
178
|
+
import oa_pro_table_searchVue from "./oa_pro-table-search.vue"; //表格搜索组件
|
|
179
|
+
import oa_pro_colum_configVue from "./oa_pro_colum_config.vue"; //表格列配置组件
|
|
180
|
+
import oa_pro_table_skeletonVue from "./oa_pro_table_skeleton.vue"; //表格骨架屏
|
|
181
|
+
import baseDefaultSvgVue from "../base/baseDefaultSvg/baseDefaultSvg.vue"; //缺省页组件
|
|
182
|
+
import baseButtonHandle from "../base/baseButtonHandle/baseButtonHandle.vue"; //通用组件 排列尾部按钮的组件
|
|
183
|
+
export default {
|
|
184
|
+
name: "baseProTable",
|
|
185
|
+
data() {
|
|
186
|
+
return {
|
|
187
|
+
/* 表格数据 */
|
|
188
|
+
tableData: [],
|
|
189
|
+
/* 尾部显示当前列表的统计 */
|
|
190
|
+
totalList: [],
|
|
191
|
+
/* 搜索内容的高度*/
|
|
192
|
+
searchContentHeight: 70,
|
|
193
|
+
/* 高级筛选的配置 */
|
|
194
|
+
_proScreenConfig: [],
|
|
195
|
+
/* 需要高级筛选的列表 */
|
|
196
|
+
proScreenList: [],
|
|
197
|
+
/* 对话框的尾部的按钮 */
|
|
198
|
+
footerHandleConfig: [],
|
|
199
|
+
/* 控制loading动画 */
|
|
200
|
+
loading: false,
|
|
201
|
+
defaultSvg: false,
|
|
202
|
+
/* 黑色提示框数据 */
|
|
203
|
+
tooltip: {
|
|
204
|
+
top: null,
|
|
205
|
+
left: null,
|
|
206
|
+
width: null,
|
|
207
|
+
height: null,
|
|
208
|
+
show: false,
|
|
209
|
+
content: "",
|
|
210
|
+
},
|
|
211
|
+
/* 单选表格 记录之前选择的表格数据 */
|
|
212
|
+
preSingleTableValue: null,
|
|
213
|
+
};
|
|
214
|
+
},
|
|
215
|
+
created() {
|
|
216
|
+
this.init();
|
|
217
|
+
},
|
|
218
|
+
mounted() {
|
|
219
|
+
// this.init();
|
|
220
|
+
},
|
|
221
|
+
beforeDestroy() {},
|
|
222
|
+
computed: {
|
|
223
|
+
config() {
|
|
224
|
+
return {
|
|
225
|
+
footHeight: 60,
|
|
226
|
+
headerHeight: this.headerConfig ? 36 : 0,
|
|
227
|
+
searchContentHeight: this.searchContentHeight,
|
|
228
|
+
};
|
|
229
|
+
},
|
|
230
|
+
|
|
231
|
+
tableHeight() {
|
|
232
|
+
return (
|
|
233
|
+
this.$props.height -
|
|
234
|
+
this.config.footHeight -
|
|
235
|
+
this.config.headerHeight -
|
|
236
|
+
this.config.searchContentHeight
|
|
237
|
+
);
|
|
238
|
+
},
|
|
239
|
+
fixedList() {
|
|
240
|
+
return this.$props.tableConfig.filter((item) => {
|
|
241
|
+
return item.lock;
|
|
242
|
+
});
|
|
243
|
+
},
|
|
244
|
+
|
|
245
|
+
module: {
|
|
246
|
+
get() {
|
|
247
|
+
return this.$props.value;
|
|
248
|
+
},
|
|
249
|
+
set(val) {
|
|
250
|
+
this.$emit("input", val);
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
|
|
254
|
+
showTableHeader() {
|
|
255
|
+
return this.$props.tableConfig.filter((item) => {
|
|
256
|
+
return item.show;
|
|
257
|
+
});
|
|
258
|
+
},
|
|
259
|
+
|
|
260
|
+
toolTipsStyle() {
|
|
261
|
+
return {
|
|
262
|
+
top: `${this.tooltip.top}px`,
|
|
263
|
+
left: `${this.tooltip.left}px`,
|
|
264
|
+
width: `${this.tooltip.width}px`,
|
|
265
|
+
height: `${this.tooltip.height}px`,
|
|
266
|
+
};
|
|
267
|
+
},
|
|
268
|
+
},
|
|
269
|
+
props: {
|
|
270
|
+
// 网络请求
|
|
271
|
+
httpRequire: {
|
|
272
|
+
type: Function,
|
|
273
|
+
|
|
274
|
+
default: () => {},
|
|
275
|
+
},
|
|
276
|
+
// 头部的配置
|
|
277
|
+
headerConfig: {
|
|
278
|
+
type: Object,
|
|
279
|
+
require: false,
|
|
280
|
+
},
|
|
281
|
+
// 表格的配置
|
|
282
|
+
tableConfig: {
|
|
283
|
+
type: Array,
|
|
284
|
+
require: true,
|
|
285
|
+
},
|
|
286
|
+
|
|
287
|
+
// 是否显示统计:
|
|
288
|
+
totalPropsList: {
|
|
289
|
+
type: Array,
|
|
290
|
+
default: () => [],
|
|
291
|
+
},
|
|
292
|
+
|
|
293
|
+
// 对齐方式
|
|
294
|
+
align: {
|
|
295
|
+
type: String,
|
|
296
|
+
require: false,
|
|
297
|
+
default: "left",
|
|
298
|
+
},
|
|
299
|
+
// 宽度
|
|
300
|
+
width: {
|
|
301
|
+
type: String,
|
|
302
|
+
require: false,
|
|
303
|
+
default: "100%",
|
|
304
|
+
},
|
|
305
|
+
// 宽度
|
|
306
|
+
height: {
|
|
307
|
+
type: Number,
|
|
308
|
+
require: true,
|
|
309
|
+
},
|
|
310
|
+
/*
|
|
311
|
+
keyword需要展现的提示
|
|
312
|
+
*/
|
|
313
|
+
placeholder: {
|
|
314
|
+
type: String,
|
|
315
|
+
default: "回车键进行搜索",
|
|
316
|
+
},
|
|
317
|
+
/*
|
|
318
|
+
快捷筛选的列表
|
|
319
|
+
*/
|
|
320
|
+
screenList: {},
|
|
321
|
+
/* 高级筛选的配置 */
|
|
322
|
+
proScreenConfig: {
|
|
323
|
+
type: Array,
|
|
324
|
+
default: () => [],
|
|
325
|
+
},
|
|
326
|
+
|
|
327
|
+
/* keyword的搜索关键字 */
|
|
328
|
+
value: {},
|
|
329
|
+
|
|
330
|
+
/* 分页属性 */
|
|
331
|
+
pageProps: {
|
|
332
|
+
type: Object,
|
|
333
|
+
require: true,
|
|
334
|
+
},
|
|
335
|
+
|
|
336
|
+
// 分页配置
|
|
337
|
+
pageConfig: {
|
|
338
|
+
type: Object,
|
|
339
|
+
require: true,
|
|
340
|
+
},
|
|
341
|
+
|
|
342
|
+
// 表格选择框的配置
|
|
343
|
+
tableCheckboxConfig: {
|
|
344
|
+
type: Object,
|
|
345
|
+
default: () => {
|
|
346
|
+
return {
|
|
347
|
+
value: [],
|
|
348
|
+
type: "single",
|
|
349
|
+
};
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
|
|
353
|
+
// 打开高级筛选是否需要model层
|
|
354
|
+
proScreenModel: {
|
|
355
|
+
type: Boolean,
|
|
356
|
+
default: true,
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
components: {
|
|
360
|
+
oaProHeader,
|
|
361
|
+
baseButtonHandle,
|
|
362
|
+
oa_pro_screenVue,
|
|
363
|
+
oa_pro_footerVue,
|
|
364
|
+
oaProtableHeader,
|
|
365
|
+
baseDefaultSvgVue,
|
|
366
|
+
oa_pro_table_searchVue,
|
|
367
|
+
oa_pro_colum_configVue,
|
|
368
|
+
oa_pro_table_skeletonVue,
|
|
369
|
+
},
|
|
370
|
+
methods: {
|
|
371
|
+
init() {
|
|
372
|
+
this.initProScreenConfig();
|
|
373
|
+
this.initFooterHandleConfig();
|
|
374
|
+
this.$props.tableConfig.forEach((item, index) => {
|
|
375
|
+
item.preIndex = index;
|
|
376
|
+
this.$set(item, "show", true);
|
|
377
|
+
if (!item.width || item.width < 150) {
|
|
378
|
+
item.width = 150;
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
this.$props.tableConfig.push({
|
|
383
|
+
label: "",
|
|
384
|
+
key: "noData",
|
|
385
|
+
lock: false,
|
|
386
|
+
width: 80,
|
|
387
|
+
show: true,
|
|
388
|
+
template: false,
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
this.startHttp();
|
|
392
|
+
},
|
|
393
|
+
searchContentHeightChange(height) {
|
|
394
|
+
this.searchContentHeight = height;
|
|
395
|
+
},
|
|
396
|
+
|
|
397
|
+
cellMouseEnter(row, column, cell, event) {
|
|
398
|
+
let content = row[`${column.property}`];
|
|
399
|
+
this.tooltip.show = false;
|
|
400
|
+
if (!content) return;
|
|
401
|
+
let style = event.target;
|
|
402
|
+
let position = style.getBoundingClientRect();
|
|
403
|
+
this.tooltip.width = style.clientWidth;
|
|
404
|
+
this.tooltip.height = style.clientHeight;
|
|
405
|
+
this.tooltip.top = position.top;
|
|
406
|
+
this.tooltip.left = position.left;
|
|
407
|
+
this.tooltip.content = content;
|
|
408
|
+
|
|
409
|
+
this.$nextTick(() => {
|
|
410
|
+
this.tooltip.show = true;
|
|
411
|
+
});
|
|
412
|
+
},
|
|
413
|
+
|
|
414
|
+
cellMouseLeave() {
|
|
415
|
+
this.tooltip.show = false;
|
|
416
|
+
},
|
|
417
|
+
headerItemLock(params) {
|
|
418
|
+
let { preIndex, index } = { ...params };
|
|
419
|
+
let tableConfig = this.$props.tableConfig;
|
|
420
|
+
tableConfig[index].lock = true;
|
|
421
|
+
if (tableConfig[index].preIndex == undefined) {
|
|
422
|
+
tableConfig[index].preIndex = preIndex;
|
|
423
|
+
}
|
|
424
|
+
if (this.fixedList.length == 0) {
|
|
425
|
+
tableConfig.unshift(tableConfig[index]);
|
|
426
|
+
} else {
|
|
427
|
+
const _fixedList = this.fixedList;
|
|
428
|
+
for (let i = 0; i < _fixedList.length; i++) {
|
|
429
|
+
if (tableConfig[index].preIndex < _fixedList[i].preIndex) {
|
|
430
|
+
tableConfig.splice(i, 0, tableConfig[index]);
|
|
431
|
+
break;
|
|
432
|
+
} else if (i == _fixedList.length - 1) {
|
|
433
|
+
tableConfig.splice(_fixedList.length - 1, 0, tableConfig[index]);
|
|
434
|
+
break;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
tableConfig.splice(index + 1, 1);
|
|
439
|
+
},
|
|
440
|
+
headerItemUnlock(params) {
|
|
441
|
+
let { preIndex, index } = { ...params };
|
|
442
|
+
let tableConfig = this.$props.tableConfig;
|
|
443
|
+
tableConfig[index].lock = false;
|
|
444
|
+
|
|
445
|
+
tableConfig.splice(
|
|
446
|
+
preIndex - index + this.fixedList.length,
|
|
447
|
+
0,
|
|
448
|
+
tableConfig.splice(index, 1)[0]
|
|
449
|
+
);
|
|
450
|
+
},
|
|
451
|
+
rowClick(config, row) {
|
|
452
|
+
if (!config.fun) return;
|
|
453
|
+
config.fun(row);
|
|
454
|
+
},
|
|
455
|
+
computedTotalList() {
|
|
456
|
+
this.totalList = [];
|
|
457
|
+
this.totalList = this.$props.totalPropsList;
|
|
458
|
+
if (this.totalList.length > 0 && this.tableData.length > 0) {
|
|
459
|
+
for (let i = 0; i < this.totalList.length; i++) {
|
|
460
|
+
if (
|
|
461
|
+
typeof this.tableData[0][`${this.totalList[i].value}`] == "number"
|
|
462
|
+
) {
|
|
463
|
+
let total = this.tableData.reduce(
|
|
464
|
+
(preTotal, currentItem) =>
|
|
465
|
+
preTotal + currentItem[`${this.totalList[i].value}`],
|
|
466
|
+
0
|
|
467
|
+
);
|
|
468
|
+
|
|
469
|
+
this.totalList[i].total = total;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
/* 当快捷筛选的按钮被点击后 */
|
|
475
|
+
handleScreen(index) {
|
|
476
|
+
this.$props.screenList.index = index;
|
|
477
|
+
this.startHttp();
|
|
478
|
+
},
|
|
479
|
+
// 初始化高级筛选
|
|
480
|
+
initProScreenConfig() {
|
|
481
|
+
let proScreenConfig = this.$props.proScreenConfig;
|
|
482
|
+
if (proScreenConfig.length > 0) {
|
|
483
|
+
this._proScreenConfig = proScreenConfig.map((item) => {
|
|
484
|
+
let index = this.$props.tableConfig.findIndex((citem) => {
|
|
485
|
+
console.log(citem);
|
|
486
|
+
return citem.key == item.key;
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
if (index > -1) {
|
|
490
|
+
this.$set(item, "label", this.$props.tableConfig[index].label);
|
|
491
|
+
this.$set(item, "isCheck", false);
|
|
492
|
+
return item;
|
|
493
|
+
}
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
console.log(this._proScreenConfig);
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
// 打开高级筛选
|
|
500
|
+
handleOpenProScreen() {
|
|
501
|
+
this.$refs.dialog.showDialog();
|
|
502
|
+
},
|
|
503
|
+
// 插入默认的高级筛选item
|
|
504
|
+
insertDefaultItem() {
|
|
505
|
+
let obj = {
|
|
506
|
+
key: "",
|
|
507
|
+
value: "",
|
|
508
|
+
exposed: false,
|
|
509
|
+
type: undefined,
|
|
510
|
+
};
|
|
511
|
+
this.proScreenList.push(obj);
|
|
512
|
+
},
|
|
513
|
+
|
|
514
|
+
handleScreenItem(config) {
|
|
515
|
+
console.log(config);
|
|
516
|
+
|
|
517
|
+
let index = this.proScreenList.findIndex((item) => {
|
|
518
|
+
return item.key == config.value;
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
if (index < 0) {
|
|
522
|
+
let _configIndex = this.$props.proScreenConfig.findIndex((item) => {
|
|
523
|
+
return item.key == config.value;
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
if (_configIndex >= 0) {
|
|
527
|
+
let _configItem = this.$props.proScreenConfig[_configIndex];
|
|
528
|
+
this.proScreenList.push({
|
|
529
|
+
key: _configItem.key,
|
|
530
|
+
value: "",
|
|
531
|
+
exposed: false,
|
|
532
|
+
type: _configItem.type,
|
|
533
|
+
configIndex: _configIndex,
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
this.$nextTick(() => {
|
|
539
|
+
this.$refs.dialog.showDialog();
|
|
540
|
+
});
|
|
541
|
+
},
|
|
542
|
+
// 删除高级筛选的item
|
|
543
|
+
deleteProscreenItem(index) {
|
|
544
|
+
this.proScreenList.splice(index, 1);
|
|
545
|
+
},
|
|
546
|
+
// 弹框确定的按钮
|
|
547
|
+
dialogProscreenConfirm(type) {
|
|
548
|
+
if (type) {
|
|
549
|
+
this.startHttp();
|
|
550
|
+
}
|
|
551
|
+
this.$refs.dialog.closeDialog();
|
|
552
|
+
},
|
|
553
|
+
// 初始化对话框尾部按钮
|
|
554
|
+
initFooterHandleConfig() {
|
|
555
|
+
this.footerHandleConfig = [
|
|
556
|
+
{
|
|
557
|
+
text: "取消",
|
|
558
|
+
type: "info",
|
|
559
|
+
plain: true,
|
|
560
|
+
click: () => {
|
|
561
|
+
this.dialogProscreenConfirm(false);
|
|
562
|
+
},
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
text: "确定",
|
|
566
|
+
type: "primary",
|
|
567
|
+
plain: false,
|
|
568
|
+
click: () => {
|
|
569
|
+
this.dialogProscreenConfirm(true);
|
|
570
|
+
},
|
|
571
|
+
},
|
|
572
|
+
];
|
|
573
|
+
},
|
|
574
|
+
// 返回筛选条件的
|
|
575
|
+
returnProScreenResult() {
|
|
576
|
+
let result = {};
|
|
577
|
+
if (this.$props.screenList) {
|
|
578
|
+
let _screenListIndexItem =
|
|
579
|
+
this.$props.screenList.list[this.$props.screenList.index];
|
|
580
|
+
result[`keyword`] = this.module;
|
|
581
|
+
result[`${_screenListIndexItem.key}`] = _screenListIndexItem.value;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
this.proScreenList.forEach((item) => {
|
|
585
|
+
result[`${item.key}`] = item.value;
|
|
586
|
+
});
|
|
587
|
+
result = Object.assign(result, this.$props.pageProps);
|
|
588
|
+
return result;
|
|
589
|
+
},
|
|
590
|
+
// 开始调用http请求
|
|
591
|
+
async startHttp(init = true) {
|
|
592
|
+
this.loading = true;
|
|
593
|
+
this.defaultSvg = false;
|
|
594
|
+
this.cleanCheckValue();
|
|
595
|
+
if (init) {
|
|
596
|
+
this.$props.pageProps[this.$props.pageConfig.page] = 1;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
let screenResult = this.returnProScreenResult();
|
|
600
|
+
this.$props.httpRequire(screenResult).then((res) => {
|
|
601
|
+
this.setTableData(res);
|
|
602
|
+
});
|
|
603
|
+
},
|
|
604
|
+
// 设置表格数据
|
|
605
|
+
setTableData(data) {
|
|
606
|
+
this.tableData = [];
|
|
607
|
+
setTimeout(() => {
|
|
608
|
+
this.tableData = data;
|
|
609
|
+
if (this.tableData.length == 0) {
|
|
610
|
+
this.defaultSvg = true;
|
|
611
|
+
}
|
|
612
|
+
this.loading = false;
|
|
613
|
+
|
|
614
|
+
this.computedTotalList();
|
|
615
|
+
}, 500);
|
|
616
|
+
},
|
|
617
|
+
// element表格的重新渲染方法
|
|
618
|
+
daLayoutTable() {
|
|
619
|
+
this.$nextTick(() => {
|
|
620
|
+
console.log(this.$props.tableConfig);
|
|
621
|
+
this.$refs.elTable.doLayout();
|
|
622
|
+
});
|
|
623
|
+
},
|
|
624
|
+
// 清空高级筛选的条件
|
|
625
|
+
cleanProscreenCondition() {
|
|
626
|
+
if (this.proScreenList.length <= 0) return;
|
|
627
|
+
this.proScreenList.forEach((item) => {
|
|
628
|
+
item.value = null;
|
|
629
|
+
});
|
|
630
|
+
},
|
|
631
|
+
// 自定义表格的列
|
|
632
|
+
setTableHeaderConfig(configList) {
|
|
633
|
+
console.log(configList);
|
|
634
|
+
const index = this.$props.tableConfig.filter((item) => {
|
|
635
|
+
return item.lock;
|
|
636
|
+
}).length;
|
|
637
|
+
this.$props.tableConfig.splice(index, configList.length + 1);
|
|
638
|
+
this.$nextTick(() => {
|
|
639
|
+
configList.forEach((item) => {
|
|
640
|
+
this.$props.tableConfig.push(item);
|
|
641
|
+
});
|
|
642
|
+
this.$props.tableConfig.push({
|
|
643
|
+
label: "",
|
|
644
|
+
key: "noData",
|
|
645
|
+
lock: false,
|
|
646
|
+
width: 80,
|
|
647
|
+
show: true,
|
|
648
|
+
template: false,
|
|
649
|
+
});
|
|
650
|
+
});
|
|
651
|
+
},
|
|
652
|
+
// 表格行被选中时
|
|
653
|
+
handleSelectionChange(val) {
|
|
654
|
+
let tableCheckboxConfig = this.$props.tableCheckboxConfig;
|
|
655
|
+
if (tableCheckboxConfig.type == "single") {
|
|
656
|
+
if (!this.preSingleTableValue) {
|
|
657
|
+
this.preSingleTableValue = val[0];
|
|
658
|
+
tableCheckboxConfig.value = val;
|
|
659
|
+
} else {
|
|
660
|
+
let index = val.findIndex((item) => {
|
|
661
|
+
return item == this.preSingleTableValue;
|
|
662
|
+
});
|
|
663
|
+
if (index > -1) {
|
|
664
|
+
this.$refs.elTable.toggleRowSelection(
|
|
665
|
+
tableCheckboxConfig.value[index],
|
|
666
|
+
false
|
|
667
|
+
);
|
|
668
|
+
val.splice(index, 1);
|
|
669
|
+
tableCheckboxConfig.value = val;
|
|
670
|
+
this.preSingleTableValue = val[0];
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
} else {
|
|
674
|
+
tableCheckboxConfig.value = val;
|
|
675
|
+
}
|
|
676
|
+
console.log(tableCheckboxConfig.value);
|
|
677
|
+
},
|
|
678
|
+
|
|
679
|
+
// 返回被选中的值
|
|
680
|
+
returnCheckValue() {
|
|
681
|
+
return this.$props.tableCheckboxConfig.value;
|
|
682
|
+
},
|
|
683
|
+
|
|
684
|
+
// 清空被单选框选中的值
|
|
685
|
+
cleanCheckValue() {
|
|
686
|
+
this.preSingleTableValue = null;
|
|
687
|
+
this.tableCheckboxConfig.value = [];
|
|
688
|
+
this.$refs.elTable?.clearSelection();
|
|
689
|
+
},
|
|
690
|
+
},
|
|
691
|
+
watch: {
|
|
692
|
+
fixedList(newValue, oldValue) {
|
|
693
|
+
console.log("fixedList:");
|
|
694
|
+
console.log(newValue);
|
|
695
|
+
},
|
|
696
|
+
},
|
|
697
|
+
};
|
|
698
|
+
</script>
|
|
699
|
+
|
|
700
|
+
<style lang="less" scoped>
|
|
701
|
+
.oa-pro-table-wrap {
|
|
702
|
+
position: relative;
|
|
703
|
+
.oa-pro-header-wrap {
|
|
704
|
+
width: 100%;
|
|
705
|
+
background: inherit;
|
|
706
|
+
.header-extend {
|
|
707
|
+
display: flex;
|
|
708
|
+
flex-flow: row nowrap;
|
|
709
|
+
justify-content: flex-start;
|
|
710
|
+
align-items: center;
|
|
711
|
+
margin-right: var(--margin-5);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
.table-suffix {
|
|
715
|
+
top: 0px;
|
|
716
|
+
right: 0px;
|
|
717
|
+
width: 40px;
|
|
718
|
+
height: 40px;
|
|
719
|
+
display: flex;
|
|
720
|
+
align-items: center;
|
|
721
|
+
background: inherit;
|
|
722
|
+
position: absolute;
|
|
723
|
+
justify-content: center;
|
|
724
|
+
flex-flow: row nowrap;
|
|
725
|
+
}
|
|
726
|
+
/deep/ .caret-wrapper {
|
|
727
|
+
display: none;
|
|
728
|
+
}
|
|
729
|
+
.oa-pro-table {
|
|
730
|
+
position: relative;
|
|
731
|
+
/deep/ th {
|
|
732
|
+
padding: 0px 0px;
|
|
733
|
+
.cell {
|
|
734
|
+
padding-left: 0px !important;
|
|
735
|
+
padding-right: 0px !important;
|
|
736
|
+
.el-checkbox {
|
|
737
|
+
margin: 0px var(--margin-5);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
/deep/ td {
|
|
742
|
+
padding: var(--padding-4) var(--padding-5);
|
|
743
|
+
.cell {
|
|
744
|
+
padding-left: 0px !important;
|
|
745
|
+
padding-right: 0px !important;
|
|
746
|
+
.el-checkbox {
|
|
747
|
+
margin: 0px var(--margin-5);
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
.table-tooltip-wrap {
|
|
752
|
+
z-index: -1;
|
|
753
|
+
position: fixed;
|
|
754
|
+
visibility: hidden;
|
|
755
|
+
}
|
|
756
|
+
.cell-content-text {
|
|
757
|
+
width: 100%;
|
|
758
|
+
overflow: hidden;
|
|
759
|
+
white-space: nowrap;
|
|
760
|
+
text-overflow: ellipsis;
|
|
761
|
+
font-weight: var(--font-weight-g);
|
|
762
|
+
color: var(--form-label-color) !important;
|
|
763
|
+
font-size: calc(var(--font-size-s) * 1.1) !important;
|
|
764
|
+
}
|
|
765
|
+
.active {
|
|
766
|
+
cursor: pointer;
|
|
767
|
+
font-weight: var(--font-weight-g);
|
|
768
|
+
font-size: var(--font-size-base) !important;
|
|
769
|
+
color: var(--color-primary) !important;
|
|
770
|
+
&:hover {
|
|
771
|
+
text-decoration: underline;
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
.warn {
|
|
776
|
+
font-size: var(--font-size-base) !important;
|
|
777
|
+
color: var(--color-warn) !important;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
.error {
|
|
781
|
+
font-size: var(--font-size-base) !important;
|
|
782
|
+
color: var(--color-error) !important;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.success {
|
|
786
|
+
font-size: var(--font-size-base) !important;
|
|
787
|
+
color: var(--color-success) !important;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
.check-type-single {
|
|
791
|
+
/deep/ th {
|
|
792
|
+
.el-checkbox {
|
|
793
|
+
visibility: hidden;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
.oa-pro-table-footer {
|
|
798
|
+
width: 100%;
|
|
799
|
+
background: inherit;
|
|
800
|
+
box-sizing: border-box;
|
|
801
|
+
padding-top: var(--padding-5);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
</style>
|