lw-cdp-ui 1.3.2 → 1.3.3-ui-beta
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/dist/components/lwFormMini/FormItem.vue +1 -71
- package/dist/components/lwFormMini/ViewItem.vue +0 -74
- package/dist/components/lwFormMini/index.vue +76 -118
- package/dist/components/lwLayout/components/tags.vue +4 -7
- package/dist/components/lwLayout/index.vue +65 -221
- package/dist/components/lwLogin/index.vue +44 -11
- package/dist/components/lwSearch/index.vue +4 -13
- package/dist/components/lwTable/components/TableColumn.vue +26 -54
- package/dist/components/lwTable/index.js +16 -4
- package/dist/components/lwTable/index.scss +1 -4
- package/dist/components/lwTable/index.vue +3 -2
- package/dist/components/lwTable/useFullscreen.js +3 -0
- package/dist/lw-cdp-ui.esm.js +5513 -5772
- package/dist/lw-cdp-ui.umd.js +13 -13
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,83 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<!-- 通栏布局 -->
|
|
3
|
-
<template v-if="layout == 'header'">
|
|
4
|
-
<header class="adminui-header">
|
|
5
|
-
<div class="adminui-header-left">
|
|
6
|
-
<div class="logo-bar">
|
|
7
|
-
<img class="logo"
|
|
8
|
-
src="../../assets/images/logo.svg">
|
|
9
|
-
<span>{{ $config.APP_NAME }}</span>
|
|
10
|
-
</div>
|
|
11
|
-
<ul v-if="!ismobile"
|
|
12
|
-
class="nav">
|
|
13
|
-
<li v-for="item in menu"
|
|
14
|
-
:key="item"
|
|
15
|
-
:class="pmenu.path == item.path ? 'active' : ''"
|
|
16
|
-
@click="showMenu(item)">
|
|
17
|
-
<el-icon>
|
|
18
|
-
<component :is="item.meta.icon || 'el-icon-menu'" />
|
|
19
|
-
</el-icon>
|
|
20
|
-
<span>{{ item.meta.title }}</span>
|
|
21
|
-
</li>
|
|
22
|
-
</ul>
|
|
23
|
-
</div>
|
|
24
|
-
<div class="adminui-header-right">
|
|
25
|
-
<userbar :isShowBu="isShowBu"
|
|
26
|
-
:isShowTask="isShowTask"
|
|
27
|
-
:isInitialized="isInitialized">
|
|
28
|
-
<template #userbarActionBox>
|
|
29
|
-
<slot name="userbarActionBox"></slot>
|
|
30
|
-
</template>
|
|
31
|
-
</userbar>
|
|
32
|
-
</div>
|
|
33
|
-
</header>
|
|
34
|
-
<section class="aminui-wrapper">
|
|
35
|
-
<div v-if="!ismobile && nextMenu.length > 0 || !pmenu.component"
|
|
36
|
-
:class="menuIsCollapse ? 'aminui-side isCollapse' : 'aminui-side'">
|
|
37
|
-
<div v-if="!menuIsCollapse"
|
|
38
|
-
class="adminui-side-top">
|
|
39
|
-
<h2>{{ pmenu.meta.title }}</h2>
|
|
40
|
-
</div>
|
|
41
|
-
<div class="adminui-side-scroll">
|
|
42
|
-
<el-scrollbar>
|
|
43
|
-
<el-menu :default-active="active"
|
|
44
|
-
router
|
|
45
|
-
:collapse="menuIsCollapse"
|
|
46
|
-
:unique-opened="$config.MENU_UNIQUE_OPENED">
|
|
47
|
-
<NavMenu :navMenus="nextMenu"></NavMenu>
|
|
48
|
-
</el-menu>
|
|
49
|
-
</el-scrollbar>
|
|
50
|
-
</div>
|
|
51
|
-
<div class="adminui-side-bottom"
|
|
52
|
-
@click="$store.commit('TOGGLE_menuIsCollapse')">
|
|
53
|
-
<el-icon><el-icon-expand v-if="menuIsCollapse" /><el-icon-fold
|
|
54
|
-
v-else /></el-icon>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
<Side-m v-if="ismobile"></Side-m>
|
|
58
|
-
<div class="aminui-body el-container">
|
|
59
|
-
<Topbar v-if="!ismobile"></Topbar>
|
|
60
|
-
<Tags v-if="!ismobile && layoutTags"
|
|
61
|
-
:tagShowID="tagShowID"></Tags>
|
|
62
|
-
<div class="adminui-main"
|
|
63
|
-
id="adminui-main">
|
|
64
|
-
<slot name="routerView">
|
|
65
|
-
<router-view v-slot="{ Component }">
|
|
66
|
-
<keep-alive :include="this.$store.state.keepAlive.keepLiveRoute">
|
|
67
|
-
<component :is="Component"
|
|
68
|
-
:key="$route.fullPath"
|
|
69
|
-
v-if="$store.state.keepAlive.routeShow" />
|
|
70
|
-
</keep-alive>
|
|
71
|
-
</router-view>
|
|
72
|
-
</slot>
|
|
73
|
-
<iframe-view></iframe-view>
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</section>
|
|
77
|
-
</template>
|
|
78
|
-
|
|
79
2
|
<!-- 经典布局 -->
|
|
80
|
-
<template v-
|
|
3
|
+
<template v-if="layout == 'menu'">
|
|
81
4
|
<section class="aminui-body-menu">
|
|
82
5
|
<div class="aminui-side-split-left">
|
|
83
6
|
<Aside></Aside>
|
|
@@ -101,8 +24,10 @@
|
|
|
101
24
|
</div>
|
|
102
25
|
<div class="adminui-side-bottom"
|
|
103
26
|
@click="$store.commit('TOGGLE_menuIsCollapse')">
|
|
104
|
-
<el-icon
|
|
105
|
-
|
|
27
|
+
<el-icon>
|
|
28
|
+
<el-icon-expand v-if="menuIsCollapse" />
|
|
29
|
+
<el-icon-fold v-else />
|
|
30
|
+
</el-icon>
|
|
106
31
|
</div>
|
|
107
32
|
</div>
|
|
108
33
|
<Side-m v-if="ismobile"></Side-m>
|
|
@@ -122,8 +47,7 @@
|
|
|
122
47
|
</div>
|
|
123
48
|
<Tags v-if="!ismobile && layoutTags"
|
|
124
49
|
:tagShowID="tagShowID"></Tags>
|
|
125
|
-
<div class="adminui-main"
|
|
126
|
-
id="adminui-main">
|
|
50
|
+
<div class="adminui-main">
|
|
127
51
|
<slot name="routerView">
|
|
128
52
|
<router-view v-slot="{ Component }">
|
|
129
53
|
<keep-alive
|
|
@@ -141,139 +65,62 @@
|
|
|
141
65
|
</section>
|
|
142
66
|
</template>
|
|
143
67
|
|
|
144
|
-
<!-- 功能坞布局 -->
|
|
145
|
-
<template v-else-if="layout == 'dock'">
|
|
146
|
-
<header class="adminui-header">
|
|
147
|
-
<div class="adminui-header-left">
|
|
148
|
-
<div class="logo-bar">
|
|
149
|
-
<img class="logo"
|
|
150
|
-
src="../../assets/images/logo.svg">
|
|
151
|
-
<span>{{ $config.APP_NAME }}</span>
|
|
152
|
-
</div>
|
|
153
|
-
</div>
|
|
154
|
-
<div class="adminui-header-right">
|
|
155
|
-
<div v-if="!ismobile"
|
|
156
|
-
class="adminui-header-menu">
|
|
157
|
-
<el-menu mode="horizontal"
|
|
158
|
-
:default-active="active"
|
|
159
|
-
router
|
|
160
|
-
background-color="#222b45"
|
|
161
|
-
text-color="#fff"
|
|
162
|
-
active-text-color="var(--el-color-primary)">
|
|
163
|
-
<NavMenu :navMenus="menu"></NavMenu>
|
|
164
|
-
</el-menu>
|
|
165
|
-
</div>
|
|
166
|
-
<Side-m v-if="ismobile"></Side-m>
|
|
167
|
-
<userbar :isShowBu="isShowBu"
|
|
168
|
-
:isShowTask="isShowTask"
|
|
169
|
-
:isInitialized="isInitialized">
|
|
170
|
-
<template #userbarActionBox>
|
|
171
|
-
<slot name="userbarActionBox"></slot>
|
|
172
|
-
</template>
|
|
173
|
-
</userbar>
|
|
174
|
-
</div>
|
|
175
|
-
</header>
|
|
176
|
-
<section class="aminui-wrapper">
|
|
177
|
-
<div class="aminui-body el-container">
|
|
178
|
-
<Tags v-if="!ismobile && layoutTags"
|
|
179
|
-
:tagShowID="tagShowID"></Tags>
|
|
180
|
-
<div class="adminui-main"
|
|
181
|
-
id="adminui-main">
|
|
182
|
-
<slot name="routerView">
|
|
183
|
-
<router-view v-slot="{ Component }">
|
|
184
|
-
<keep-alive :include="this.$store.state.keepAlive.keepLiveRoute">
|
|
185
|
-
<component :is="Component"
|
|
186
|
-
:key="$route.fullPath"
|
|
187
|
-
v-if="$store.state.keepAlive.routeShow" />
|
|
188
|
-
</keep-alive>
|
|
189
|
-
</router-view>
|
|
190
|
-
</slot>
|
|
191
|
-
<iframe-view></iframe-view>
|
|
192
|
-
</div>
|
|
193
|
-
</div>
|
|
194
|
-
</section>
|
|
195
|
-
</template>
|
|
196
|
-
|
|
197
68
|
<!-- 默认布局 -->
|
|
198
69
|
<template v-else>
|
|
199
|
-
<
|
|
200
|
-
<div
|
|
201
|
-
|
|
202
|
-
<div class="aminui-side-split-top">
|
|
203
|
-
<Aside></Aside>
|
|
204
|
-
</div>
|
|
205
|
-
|
|
206
|
-
<div class="adminui-side-split-scroll">
|
|
207
|
-
<el-scrollbar>
|
|
208
|
-
<ul>
|
|
209
|
-
<li v-for="item in menu"
|
|
210
|
-
:key="item"
|
|
211
|
-
:class="pmenu.path == item.path ? 'active' : ''"
|
|
212
|
-
@click="showMenu(item)">
|
|
213
|
-
<el-icon>
|
|
214
|
-
<component :is="item.meta.icon || el - icon - menu" />
|
|
215
|
-
</el-icon>
|
|
216
|
-
<p>{{ item.meta.title }}</p>
|
|
217
|
-
</li>
|
|
218
|
-
</ul>
|
|
219
|
-
</el-scrollbar>
|
|
220
|
-
</div>
|
|
70
|
+
<div class="aminui-body-default">
|
|
71
|
+
<div class="aminui-title-name">
|
|
72
|
+
{{ menuIsCollapse ? $config.APP_NAME.charAt(0) : $config.APP_NAME }}
|
|
221
73
|
</div>
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
<el-
|
|
230
|
-
|
|
231
|
-
router
|
|
232
|
-
:collapse="menuIsCollapse"
|
|
233
|
-
:unique-opened="$config.MENU_UNIQUE_OPENED">
|
|
234
|
-
<NavMenu :navMenus="nextMenu"></NavMenu>
|
|
235
|
-
</el-menu>
|
|
236
|
-
</el-scrollbar>
|
|
237
|
-
</div>
|
|
238
|
-
<div class="adminui-side-bottom"
|
|
239
|
-
@click="$store.commit('TOGGLE_menuIsCollapse')">
|
|
240
|
-
<el-icon><el-icon-expand v-if="menuIsCollapse" /><el-icon-fold
|
|
241
|
-
v-else /></el-icon>
|
|
242
|
-
</div>
|
|
74
|
+
|
|
75
|
+
<Aside></Aside>
|
|
76
|
+
|
|
77
|
+
<div class="adminui-side-bottom"
|
|
78
|
+
@click="$store.commit('TOGGLE_menuIsCollapse')">
|
|
79
|
+
<el-icon>
|
|
80
|
+
<el-icon-expand v-if="menuIsCollapse" />
|
|
81
|
+
<el-icon-fold v-else />
|
|
82
|
+
</el-icon>
|
|
243
83
|
</div>
|
|
84
|
+
|
|
244
85
|
<Side-m v-if="ismobile"></Side-m>
|
|
245
|
-
<div class="aminui-body el-container">
|
|
246
|
-
<Topbar>
|
|
247
|
-
<userbar :isShowBu="isShowBu"
|
|
248
|
-
:isShowTask="isShowTask"
|
|
249
|
-
:isInitialized="isInitialized">
|
|
250
|
-
<template #userbarActionBox>
|
|
251
|
-
<slot name="userbarActionBox"></slot>
|
|
252
|
-
</template>
|
|
253
|
-
</userbar>
|
|
254
|
-
</Topbar>
|
|
255
|
-
<Tags v-if="!ismobile && layoutTags"
|
|
256
|
-
:tagShowID="tagShowID"></Tags>
|
|
257
|
-
<div class="adminui-main"
|
|
258
|
-
id="adminui-main">
|
|
259
|
-
<slot name="routerView">
|
|
260
|
-
<router-view v-slot="{ Component }">
|
|
261
|
-
<keep-alive :include="this.$store.state.keepAlive.keepLiveRoute">
|
|
262
|
-
<component :is="Component"
|
|
263
|
-
:key="$route.fullPath"
|
|
264
|
-
v-if="$store.state.keepAlive.routeShow" />
|
|
265
|
-
</keep-alive>
|
|
266
|
-
</router-view>
|
|
267
|
-
</slot>
|
|
268
|
-
<iframe-view></iframe-view>
|
|
269
|
-
</div>
|
|
270
|
-
</div>
|
|
271
|
-
</section>
|
|
272
|
-
</template>
|
|
273
86
|
|
|
274
|
-
|
|
275
|
-
|
|
87
|
+
<el-scrollbar>
|
|
88
|
+
<el-menu :default-active="active"
|
|
89
|
+
router
|
|
90
|
+
:collapse="menuIsCollapse"
|
|
91
|
+
:unique-opened="$config.MENU_UNIQUE_OPENED">
|
|
92
|
+
<NavMenu :navMenus="menu"></NavMenu>
|
|
93
|
+
</el-menu>
|
|
94
|
+
</el-scrollbar>
|
|
95
|
+
|
|
96
|
+
<Topbar v-if="!ismobile"></Topbar>
|
|
97
|
+
|
|
98
|
+
<userbar :isShowBu="isShowBu"
|
|
99
|
+
:isShowTask="isShowTask"
|
|
100
|
+
:isInitialized="isInitialized">
|
|
101
|
+
<template #userbarActionBox>
|
|
102
|
+
<slot name="userbarActionBox"></slot>
|
|
103
|
+
</template>
|
|
104
|
+
</userbar>
|
|
105
|
+
|
|
106
|
+
<Tags v-if="!ismobile && layoutTags"
|
|
107
|
+
:tagShowID="tagShowID"></Tags>
|
|
276
108
|
|
|
109
|
+
<div class="adminui-main">
|
|
110
|
+
<slot name="routerView">
|
|
111
|
+
<router-view v-slot="{ Component }">
|
|
112
|
+
<keep-alive :include="this.$store.state.keepAlive.keepLiveRoute">
|
|
113
|
+
<component :is="Component"
|
|
114
|
+
:key="$route.fullPath"
|
|
115
|
+
v-if="$store.state.keepAlive.routeShow" />
|
|
116
|
+
</keep-alive>
|
|
117
|
+
</router-view>
|
|
118
|
+
</slot>
|
|
119
|
+
<iframe-view></iframe-view>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</template>
|
|
123
|
+
<!-- 设置 -->
|
|
277
124
|
<div class="layout-setting"
|
|
278
125
|
@click="openSetting"><el-icon><el-icon-brush-filled /></el-icon></div>
|
|
279
126
|
|
|
@@ -352,7 +199,7 @@ export default {
|
|
|
352
199
|
}
|
|
353
200
|
},
|
|
354
201
|
beforeCreate() {
|
|
355
|
-
//
|
|
202
|
+
// 挂载菜单订阅
|
|
356
203
|
this.$bus.$on('setMenu', (menu) => {
|
|
357
204
|
this.changeMenu = true
|
|
358
205
|
this.menu = this.filterUrl(menu)
|
|
@@ -367,6 +214,12 @@ export default {
|
|
|
367
214
|
this.$store.state.global.menuIsCollapse = !!isMenuIsCollapse
|
|
368
215
|
},
|
|
369
216
|
async created() {
|
|
217
|
+
// 标识当前项目
|
|
218
|
+
let isCombined = this.$tool.data.get("MENUCOMBINED")
|
|
219
|
+
if (isCombined) {
|
|
220
|
+
this.$tool.data.set("MENUCOMBINEDNMAE", this.$config.APP_NAME);
|
|
221
|
+
}
|
|
222
|
+
|
|
370
223
|
this.onLayoutResize();
|
|
371
224
|
window.addEventListener('resize', this.onLayoutResize);
|
|
372
225
|
this.getUserInfo();
|
|
@@ -408,15 +261,10 @@ export default {
|
|
|
408
261
|
let application = [...new Set(user.userAuthInfo.menus.map(permission => permission.split('.')[0].split('_')[0]))]
|
|
409
262
|
user.userAuthInfo.grantedApplications = user.userAuthInfo.grantedApplications.filter(x => application.includes(x.code))
|
|
410
263
|
|
|
411
|
-
let userAuthInfo = {
|
|
412
|
-
...user.userAuthInfo,
|
|
413
|
-
combined: user.combined,
|
|
414
|
-
loginPage: user.loginPage,
|
|
415
|
-
menuContent: user.menuContent,
|
|
416
|
-
}
|
|
417
264
|
this.$tool.data.set('tenantId', user.userAuthInfo.tenantId)
|
|
418
|
-
this.$tool.data.set('userAuthInfo', userAuthInfo)
|
|
419
|
-
this.$
|
|
265
|
+
this.$tool.data.set('userAuthInfo', user.userAuthInfo)
|
|
266
|
+
this.$tool.data.set('MenuPath', user.userAuthInfo.grantedApplications)
|
|
267
|
+
this.$store.state.user = user.userAuthInfo
|
|
420
268
|
},
|
|
421
269
|
|
|
422
270
|
|
|
@@ -466,10 +314,6 @@ export default {
|
|
|
466
314
|
|
|
467
315
|
this.changeMenu = false
|
|
468
316
|
return newMap;
|
|
469
|
-
},
|
|
470
|
-
//退出最大化
|
|
471
|
-
exitMaximize() {
|
|
472
|
-
document.getElementById('app').classList.remove('main-maximize')
|
|
473
317
|
}
|
|
474
318
|
}
|
|
475
319
|
}
|
|
@@ -173,6 +173,11 @@ export default {
|
|
|
173
173
|
type: Boolean,
|
|
174
174
|
default: true
|
|
175
175
|
},
|
|
176
|
+
// 是否手动合并菜单到同一个项目
|
|
177
|
+
isCombined: {
|
|
178
|
+
type: Boolean,
|
|
179
|
+
default: true
|
|
180
|
+
},
|
|
176
181
|
// 是否加密登录
|
|
177
182
|
isEncryption: {
|
|
178
183
|
type: Boolean,
|
|
@@ -299,7 +304,6 @@ export default {
|
|
|
299
304
|
this.$store.commit("clearViewTags");
|
|
300
305
|
this.$store.commit("clearKeepLive");
|
|
301
306
|
this.$store.commit("clearIframeList")
|
|
302
|
-
this.$tool.data.remove("MENU_LIST")
|
|
303
307
|
},
|
|
304
308
|
methods: {
|
|
305
309
|
// 加密
|
|
@@ -320,7 +324,7 @@ export default {
|
|
|
320
324
|
username: this.ruleForm.user,
|
|
321
325
|
password: this.ruleForm.password,
|
|
322
326
|
};
|
|
323
|
-
|
|
327
|
+
|
|
324
328
|
if (this.isEncryption) {
|
|
325
329
|
const publicKey = await this.$api.auth.key()
|
|
326
330
|
if (publicKey) {
|
|
@@ -352,19 +356,14 @@ export default {
|
|
|
352
356
|
// 获取用户信息
|
|
353
357
|
let user = await this.$api.auth.user()
|
|
354
358
|
// 处理应用显示逻辑
|
|
355
|
-
let application
|
|
359
|
+
let application = [...new Set(user.userAuthInfo.menus.map(permission => permission.split('.')[0].split('_')[0]))]
|
|
356
360
|
user.userAuthInfo.grantedApplications = user.userAuthInfo.grantedApplications.filter(x => application.includes(x.code))
|
|
357
361
|
|
|
358
|
-
let userAuthInfo = {
|
|
359
|
-
...user.userAuthInfo,
|
|
360
|
-
combined: user.combined,
|
|
361
|
-
loginPage: user.loginPage,
|
|
362
|
-
menuContent: user.menuContent,
|
|
363
|
-
}
|
|
364
362
|
this.$tool.data.set('tenantId', user.userAuthInfo.tenantId)
|
|
365
|
-
this.$tool.data.set('userAuthInfo', userAuthInfo)
|
|
363
|
+
this.$tool.data.set('userAuthInfo', user.userAuthInfo)
|
|
366
364
|
// 用与应用菜单显示
|
|
367
|
-
this.$
|
|
365
|
+
this.$tool.data.set('MenuPath', user.userAuthInfo.grantedApplications)
|
|
366
|
+
this.$store.state.user = user.userAuthInfo
|
|
368
367
|
|
|
369
368
|
|
|
370
369
|
// 兼容旧项目设置信息
|
|
@@ -373,8 +372,42 @@ export default {
|
|
|
373
372
|
sessionStorage.setItem('easyweb_session_passport_bu_list', JSON.stringify({ v: bu }))
|
|
374
373
|
document.cookie = `Authorization=Bearer ${token}`;
|
|
375
374
|
|
|
375
|
+
// 获取合并菜单信息 isCombined 这参数后期要加是否要合并菜单展示 现在默认tue
|
|
376
|
+
/**
|
|
377
|
+
* 此处进行 获取的数据路由router文件进行合并
|
|
378
|
+
* 需要开发一个接口返回 权限与具体页面路径映射数据 (这个功能要开发)
|
|
379
|
+
* 需要在 platform 菜单管理中 配置isCombined参数 用于标识是否合并项目菜单
|
|
380
|
+
* 原有的数据要加两个配置项 icon path
|
|
381
|
+
* 返回的数据是
|
|
382
|
+
* [
|
|
383
|
+
* {
|
|
384
|
+
"id": "ma_menu.workplace",
|
|
385
|
+
"tenantId": "connext",
|
|
386
|
+
"name": "工作台",
|
|
387
|
+
"type": "MENU",
|
|
388
|
+
...
|
|
389
|
+
"applications": ["ma"],
|
|
390
|
+
"icon": 'el-icon-discount', // icon
|
|
391
|
+
"path": '/reach/flow-template/, // 菜单路径
|
|
392
|
+
"authority": [
|
|
393
|
+
"ma.marketing_center.locate",
|
|
394
|
+
"ma.marketing_center_operation.locate",
|
|
395
|
+
]
|
|
396
|
+
}
|
|
397
|
+
* ]
|
|
398
|
+
*/
|
|
399
|
+
if (user.combined || this.isCombined) {
|
|
400
|
+
let menu = await this.$api.auth.menu();
|
|
401
|
+
this.$tool.data.set("MENUCOMBINED", menu);
|
|
402
|
+
// 注入 用于判断子项目 是否扁平化
|
|
403
|
+
this.$tool.data.set("MENUCOMBINEDNMAE", this.$config.APP_NAME);
|
|
404
|
+
} else {
|
|
405
|
+
this.$tool.data.remove("MENUCOMBINED");
|
|
406
|
+
this.$tool.data.remove("MENUCOMBINEDNMAE");
|
|
407
|
+
}
|
|
376
408
|
|
|
377
409
|
// 检验是否初始化
|
|
410
|
+
|
|
378
411
|
if (this.isInitialized) {
|
|
379
412
|
let initialized = await this.$api.auth.initialized()
|
|
380
413
|
this.$tool.data.set('zoneInitialized', initialized)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div class="lw-search-card">
|
|
3
3
|
<div class="search-content">
|
|
4
4
|
<el-form ref="searchForm"
|
|
5
5
|
:model="form"
|
|
@@ -54,8 +54,7 @@
|
|
|
54
54
|
</template>
|
|
55
55
|
</el-row>
|
|
56
56
|
|
|
57
|
-
<div class="control"
|
|
58
|
-
:style="{bottom: ((options.length%columnNumber === 0) ? '0px' : '10px')}">
|
|
57
|
+
<div class="control">
|
|
59
58
|
<el-button class="reset"
|
|
60
59
|
@click="resetForm('searchForm')">
|
|
61
60
|
{{$t('btn.reset')}}
|
|
@@ -344,7 +343,7 @@ export default {
|
|
|
344
343
|
}
|
|
345
344
|
}
|
|
346
345
|
|
|
347
|
-
|
|
346
|
+
.lw-search-card {
|
|
348
347
|
width: 100%;
|
|
349
348
|
background: var(--color-bg-2);
|
|
350
349
|
// position: relative;
|
|
@@ -386,14 +385,6 @@ export default {
|
|
|
386
385
|
}
|
|
387
386
|
|
|
388
387
|
.search-content {
|
|
389
|
-
position: relative;
|
|
390
|
-
// border: 1px solid #e5e5e5;
|
|
391
|
-
box-sizing: border-box;
|
|
392
|
-
width: 100%;
|
|
393
|
-
// transition: width .3s linear;
|
|
394
|
-
margin-top: 0;
|
|
395
|
-
padding: 0 0 0px 0;
|
|
396
|
-
|
|
397
388
|
&.close {
|
|
398
389
|
width: 0;
|
|
399
390
|
height: 0;
|
|
@@ -411,7 +402,7 @@ export default {
|
|
|
411
402
|
.control {
|
|
412
403
|
position: absolute;
|
|
413
404
|
right: 0;
|
|
414
|
-
bottom:
|
|
405
|
+
bottom: 10px;
|
|
415
406
|
z-index: 9;
|
|
416
407
|
display: flex;
|
|
417
408
|
justify-content: flex-end;
|
|
@@ -162,76 +162,48 @@
|
|
|
162
162
|
:preview-teleported="true" />
|
|
163
163
|
</template>
|
|
164
164
|
|
|
165
|
-
<!--
|
|
166
|
-
<template
|
|
167
|
-
|
|
165
|
+
<!-- switch -->
|
|
166
|
+
<template v-else-if="col.switch">
|
|
167
|
+
<el-switch v-model="scope.row[col.dataIndex]"
|
|
168
|
+
inline-prompt
|
|
169
|
+
:active-text="col?.activeText || '是'"
|
|
170
|
+
:inactive-text="col?.inactiveText || '否'"
|
|
171
|
+
:active-value="col?.activeValue || true"
|
|
172
|
+
:inactive-value="col?.inactiveValue || false"
|
|
173
|
+
@click="col.callback(scope.row[col.dataIndex], scope.row)"></el-switch>
|
|
174
|
+
</template>
|
|
175
|
+
|
|
176
|
+
<!-- 选项列 -->
|
|
177
|
+
<template v-else-if="!col.switch && col.options?.length">
|
|
168
178
|
<template v-if="scope.row.isEdit && col.canEdit">
|
|
169
|
-
<el-select
|
|
179
|
+
<el-select v-model="scope.row[col.editSource]"
|
|
170
180
|
:value-key="col.editValue || 'code'"
|
|
171
|
-
|
|
181
|
+
class="select-select number"
|
|
172
182
|
placeholder=""
|
|
173
183
|
allow-clear
|
|
174
184
|
allow-search
|
|
175
185
|
filter-option
|
|
176
|
-
@change="
|
|
177
|
-
<el-option
|
|
178
|
-
|
|
179
|
-
:
|
|
186
|
+
@change="val => col.callback(val, scope.row)">
|
|
187
|
+
<el-option v-for="item in col.options"
|
|
188
|
+
:key="item"
|
|
189
|
+
:value="item">
|
|
190
|
+
{{ col.editValue ? item[col.editValue] : item.name }}
|
|
191
|
+
</el-option>
|
|
180
192
|
</el-select>
|
|
181
193
|
</template>
|
|
182
194
|
<template v-else>
|
|
183
195
|
<span v-for="(item, index) in col.options"
|
|
184
196
|
:key="item + index">
|
|
185
197
|
<span
|
|
186
|
-
v-if="scope.row[col.dataIndex] == item[col.editValue || 'code']"
|
|
187
|
-
|
|
188
|
-
:style="`background-color: ${item.statusColor}; border-radius: 100%; padding: 4px; display: inline-block; margin-right: 5px;`"
|
|
198
|
+
v-if="scope.row[col.dataIndex] == item[col.editValue || 'code']">
|
|
199
|
+
<span v-if="item.statusColor"
|
|
200
|
+
:style="`background-color: ${item.statusColor}; border-radius: 100%; padding: 4px; display: inline-block; margin-right: 5px;`" />
|
|
201
|
+
{{ col.editValue ? item[col.editValue] : item.name }}
|
|
202
|
+
</span>
|
|
189
203
|
</span>
|
|
190
204
|
</template>
|
|
191
205
|
</template>
|
|
192
206
|
|
|
193
|
-
<!-- 日期起始 -->
|
|
194
|
-
<template v-else-if="col.type === 'startToEnd'">
|
|
195
|
-
<div style="margin-bottom: 5px">
|
|
196
|
-
<span class="start-span">起</span>
|
|
197
|
-
{{ scope.row[col.dataIndexList[0]] ? dayjs(scope.row[col.dataIndexList[0]]).format('YYYY-MM-DD HH:mm:ss') : '--' }}
|
|
198
|
-
</div>
|
|
199
|
-
<div>
|
|
200
|
-
<span class="end-span">止</span>
|
|
201
|
-
{{ scope.row[col.dataIndexList[1]] ? dayjs(scope.row[col.dataIndexList[1]]).format('YYYY-MM-DD HH:mm:ss') : '--' }}
|
|
202
|
-
</div>
|
|
203
|
-
</template>
|
|
204
|
-
|
|
205
|
-
<!-- 日期转换 -->
|
|
206
|
-
<template v-else-if="col.dataType">
|
|
207
|
-
{{ dayjs(scope.row[col.dataIndex]).format('YYYY-MM-DD HH:mm:ss')}}
|
|
208
|
-
</template>
|
|
209
|
-
|
|
210
|
-
<!-- 开关 -->
|
|
211
|
-
<template v-else-if="col.switch">
|
|
212
|
-
<el-switch :inline-prompt="col.isShowMessage"
|
|
213
|
-
:active-text="col.isShowMessage ? col.activeText : '是'"
|
|
214
|
-
:inactive-text="col.isShowMessage ? col.inactiveText : '否'"
|
|
215
|
-
style="--el-switch-on-color: var(--el-color-primary); --el-switch-off-color: #c6c6c6"
|
|
216
|
-
v-model="scope.row[col.dataIndex]"
|
|
217
|
-
:active-value="col.activeValue ?? true"
|
|
218
|
-
:inactive-value="col.inactiveValue ?? false"
|
|
219
|
-
:disabled="col.disabled ? col.disabled(scope.row) : false"
|
|
220
|
-
@change="(v) => {col.clickFun(v, scope.row)}" />
|
|
221
|
-
</template>
|
|
222
|
-
|
|
223
|
-
<!-- 视频 -->
|
|
224
|
-
<template v-else-if="col.isVideo">
|
|
225
|
-
<video width="40"
|
|
226
|
-
:src="scope.row[col.dataIndex]"
|
|
227
|
-
style="margin: 5px 0" />
|
|
228
|
-
</template>
|
|
229
|
-
|
|
230
|
-
<!-- 数组转string -->
|
|
231
|
-
<template v-else-if="col.arrayList">
|
|
232
|
-
<span>{{ scope.row[col.dataIndex] !== null && scope.row[col.dataIndex].length > 0 ? scope.row[col.dataIndex].toString() : '' }}</span>
|
|
233
|
-
</template>
|
|
234
|
-
|
|
235
207
|
<!-- 自定义组件 -->
|
|
236
208
|
<template v-else-if="col.component">
|
|
237
209
|
<slot :name="col.component"
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { VueSelecto } from 'vue3-selecto'
|
|
2
2
|
import TableColumn from './components/TableColumn.vue'
|
|
3
3
|
import empty from '@/assets/images/empty.jpg'
|
|
4
|
+
import { useFullscreen } from './useFullscreen'
|
|
5
|
+
const { isFullscreen, toggle: toggleFullScreen } = useFullscreen()
|
|
4
6
|
export default {
|
|
5
7
|
name: 'lwTable',
|
|
6
8
|
components: { VueSelecto, TableColumn },
|
|
@@ -18,6 +20,7 @@ export default {
|
|
|
18
20
|
stripe: { type: Boolean, default: false }, // 是否显示斑马纹
|
|
19
21
|
hoverable: { type: Boolean, default: true }, // 是否启用鼠标悬停效果
|
|
20
22
|
maxHeight: { type: String, default: 'calc(100vh - 270px)' }, // 表格最大高度
|
|
23
|
+
height: { type: String, default: '' }, // 表格高度
|
|
21
24
|
|
|
22
25
|
// 选择功能配置
|
|
23
26
|
rowSelection: { type: Boolean, default: false }, // 是否可选择行
|
|
@@ -51,6 +54,7 @@ export default {
|
|
|
51
54
|
// 表格基础状态
|
|
52
55
|
tableHeaders: [], // 表格列配置
|
|
53
56
|
localTableSize: this.tableSize, // 表格大小
|
|
57
|
+
tableHeight: this.tableSize, // 表格高度
|
|
54
58
|
|
|
55
59
|
// 列设置相关
|
|
56
60
|
checkedKeys: [], // 选中的列
|
|
@@ -109,10 +113,13 @@ export default {
|
|
|
109
113
|
immediate: true
|
|
110
114
|
}
|
|
111
115
|
},
|
|
112
|
-
|
|
113
116
|
created() {
|
|
114
117
|
// 监听窗口大小变化
|
|
115
118
|
window.addEventListener('resize', this.handleResize)
|
|
119
|
+
|
|
120
|
+
this.$nextTick(() => {
|
|
121
|
+
this.handleResize()
|
|
122
|
+
})
|
|
116
123
|
},
|
|
117
124
|
|
|
118
125
|
beforeDestroy() {
|
|
@@ -228,9 +235,8 @@ export default {
|
|
|
228
235
|
* 切换全屏显示
|
|
229
236
|
*/
|
|
230
237
|
tableToggleFullScreen() {
|
|
231
|
-
this.$bus.$emit('tableFullScreen', !this.isFullscreen)
|
|
232
238
|
this.isFullscreen = !this.isFullscreen
|
|
233
|
-
|
|
239
|
+
toggleFullScreen()
|
|
234
240
|
},
|
|
235
241
|
|
|
236
242
|
/**
|
|
@@ -240,9 +246,15 @@ export default {
|
|
|
240
246
|
const isFull = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
|
|
241
247
|
|
|
242
248
|
if (!isFull) {
|
|
243
|
-
this.$bus.$emit('tableFullScreen', false)
|
|
244
249
|
this.isFullscreen = false
|
|
245
250
|
}
|
|
251
|
+
|
|
252
|
+
// 自动计算稿表格高度
|
|
253
|
+
const container = document.querySelector('.adminui-main > .el-container')
|
|
254
|
+
const searchCard = document.querySelector('.lw-search-card')
|
|
255
|
+
if (container && searchCard) {
|
|
256
|
+
this.tableHeight = container.clientHeight - searchCard.clientHeight - 160
|
|
257
|
+
}
|
|
246
258
|
},
|
|
247
259
|
// 拖动选中
|
|
248
260
|
onSelect({ selected }) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.
|
|
1
|
+
.lw-table-page {
|
|
2
2
|
position: relative;
|
|
3
3
|
|
|
4
4
|
.icon-more {
|
|
@@ -155,9 +155,6 @@
|
|
|
155
155
|
background: #f40c0c;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
-
:deep(.el-table th.el-table__cell) {
|
|
159
|
-
background-color: #f9f9f9 !important;
|
|
160
|
-
}
|
|
161
158
|
|
|
162
159
|
.table-button {
|
|
163
160
|
color: var(--el-color-primary);
|