lw-cdp-ui 1.2.62 → 1.2.63
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/lwLayout/components/iframeView.vue +1 -0
- package/dist/components/lwLayout/index.vue +10 -8
- package/dist/components/lwLogin/index.vue +9 -43
- package/dist/components/lwTable/components/TableColumn.vue +54 -26
- package/dist/lw-cdp-ui.esm.js +3961 -3928
- package/dist/lw-cdp-ui.umd.js +13 -13
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -365,14 +365,11 @@ export default {
|
|
|
365
365
|
}
|
|
366
366
|
let isMenuIsCollapse = this.$tool.data.get("APP_menuIsCollapse")
|
|
367
367
|
this.$store.state.global.menuIsCollapse = !!isMenuIsCollapse
|
|
368
|
+
|
|
369
|
+
// 标志当前应用
|
|
370
|
+
this.$tool.data.set("MENUCOMBINEDNMAE", this.$config.APP_NAME);
|
|
368
371
|
},
|
|
369
372
|
async created() {
|
|
370
|
-
// 标识当前项目
|
|
371
|
-
let isCombined = this.$tool.data.get("MENUCOMBINED")
|
|
372
|
-
if (isCombined) {
|
|
373
|
-
this.$tool.data.set("MENUCOMBINEDNMAE", this.$config.APP_NAME);
|
|
374
|
-
}
|
|
375
|
-
|
|
376
373
|
this.onLayoutResize();
|
|
377
374
|
window.addEventListener('resize', this.onLayoutResize);
|
|
378
375
|
this.getUserInfo();
|
|
@@ -414,10 +411,15 @@ export default {
|
|
|
414
411
|
let application = [...new Set(user.userAuthInfo.menus.map(permission => permission.split('.')[0].split('_')[0]))]
|
|
415
412
|
user.userAuthInfo.grantedApplications = user.userAuthInfo.grantedApplications.filter(x => application.includes(x.code))
|
|
416
413
|
|
|
414
|
+
let userAuthInfo = {
|
|
415
|
+
...user.userAuthInfo,
|
|
416
|
+
combined: user.combined,
|
|
417
|
+
menuContent: user.menuContent,
|
|
418
|
+
}
|
|
417
419
|
this.$tool.data.set('tenantId', user.userAuthInfo.tenantId)
|
|
418
|
-
this.$tool.data.set('userAuthInfo',
|
|
420
|
+
this.$tool.data.set('userAuthInfo', userAuthInfo)
|
|
419
421
|
this.$tool.data.set('MenuPath', user.userAuthInfo.grantedApplications)
|
|
420
|
-
this.$store.state.user =
|
|
422
|
+
this.$store.state.user = userAuthInfo
|
|
421
423
|
},
|
|
422
424
|
|
|
423
425
|
|
|
@@ -173,11 +173,6 @@ export default {
|
|
|
173
173
|
type: Boolean,
|
|
174
174
|
default: true
|
|
175
175
|
},
|
|
176
|
-
// 是否手动合并菜单到同一个项目
|
|
177
|
-
isCombined: {
|
|
178
|
-
type: Boolean,
|
|
179
|
-
default: true
|
|
180
|
-
},
|
|
181
176
|
// 是否加密登录
|
|
182
177
|
isEncryption: {
|
|
183
178
|
type: Boolean,
|
|
@@ -324,7 +319,7 @@ export default {
|
|
|
324
319
|
username: this.ruleForm.user,
|
|
325
320
|
password: this.ruleForm.password,
|
|
326
321
|
};
|
|
327
|
-
|
|
322
|
+
|
|
328
323
|
if (this.isEncryption) {
|
|
329
324
|
const publicKey = await this.$api.auth.key()
|
|
330
325
|
if (publicKey) {
|
|
@@ -356,14 +351,19 @@ export default {
|
|
|
356
351
|
// 获取用户信息
|
|
357
352
|
let user = await this.$api.auth.user()
|
|
358
353
|
// 处理应用显示逻辑
|
|
359
|
-
let application
|
|
354
|
+
let application = [...new Set(user.userAuthInfo.menus.map(permission => permission.split('.')[0].split('_')[0]))]
|
|
360
355
|
user.userAuthInfo.grantedApplications = user.userAuthInfo.grantedApplications.filter(x => application.includes(x.code))
|
|
361
356
|
|
|
357
|
+
let userAuthInfo = {
|
|
358
|
+
...user.userAuthInfo,
|
|
359
|
+
combined: user.combined,
|
|
360
|
+
menuContent: user.menuContent,
|
|
361
|
+
}
|
|
362
362
|
this.$tool.data.set('tenantId', user.userAuthInfo.tenantId)
|
|
363
|
-
this.$tool.data.set('userAuthInfo',
|
|
363
|
+
this.$tool.data.set('userAuthInfo', userAuthInfo)
|
|
364
364
|
// 用与应用菜单显示
|
|
365
365
|
this.$tool.data.set('MenuPath', user.userAuthInfo.grantedApplications)
|
|
366
|
-
this.$store.state.user =
|
|
366
|
+
this.$store.state.user = userAuthInfo
|
|
367
367
|
|
|
368
368
|
|
|
369
369
|
// 兼容旧项目设置信息
|
|
@@ -372,42 +372,8 @@ export default {
|
|
|
372
372
|
sessionStorage.setItem('easyweb_session_passport_bu_list', JSON.stringify({ v: bu }))
|
|
373
373
|
document.cookie = `Authorization=Bearer ${token}`;
|
|
374
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
|
-
}
|
|
408
375
|
|
|
409
376
|
// 检验是否初始化
|
|
410
|
-
|
|
411
377
|
if (this.isInitialized) {
|
|
412
378
|
let initialized = await this.$api.auth.initialized()
|
|
413
379
|
this.$tool.data.set('zoneInitialized', initialized)
|
|
@@ -162,48 +162,76 @@
|
|
|
162
162
|
:preview-teleported="true" />
|
|
163
163
|
</template>
|
|
164
164
|
|
|
165
|
-
<!--
|
|
166
|
-
<template
|
|
167
|
-
|
|
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">
|
|
165
|
+
<!-- 枚举options -->
|
|
166
|
+
<template
|
|
167
|
+
v-else-if="!col.switch && col.options && col.options.length > 0">
|
|
178
168
|
<template v-if="scope.row.isEdit && col.canEdit">
|
|
179
|
-
<el-select
|
|
169
|
+
<el-select class="select-select number"
|
|
180
170
|
:value-key="col.editValue || 'code'"
|
|
181
|
-
|
|
171
|
+
v-model="scope.row[col.editSource]"
|
|
182
172
|
placeholder=""
|
|
183
173
|
allow-clear
|
|
184
174
|
allow-search
|
|
185
175
|
filter-option
|
|
186
|
-
@change="val => col.callback(val, scope.row)">
|
|
187
|
-
<el-option
|
|
188
|
-
|
|
189
|
-
:
|
|
190
|
-
{{ col.editValue ? item[col.editValue] : item.name }}
|
|
191
|
-
</el-option>
|
|
176
|
+
@change="(val) => {col.callback(val, scope.row)}">
|
|
177
|
+
<el-option :value="item"
|
|
178
|
+
v-for="item in col.options"
|
|
179
|
+
:key="item">{{ col.editValue ? item[col.editValue] : item.name }}</el-option>
|
|
192
180
|
</el-select>
|
|
193
181
|
</template>
|
|
194
182
|
<template v-else>
|
|
195
183
|
<span v-for="(item, index) in col.options"
|
|
196
184
|
:key="item + index">
|
|
197
185
|
<span
|
|
198
|
-
v-if="scope.row[col.dataIndex] == item[col.editValue || 'code']"
|
|
199
|
-
|
|
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>
|
|
186
|
+
v-if="scope.row[col.dataIndex] == item[col.editValue || 'code']"><span
|
|
187
|
+
v-if="item.statusColor"
|
|
188
|
+
:style="`background-color: ${item.statusColor}; border-radius: 100%; padding: 4px; display: inline-block; margin-right: 5px;`"></span>{{ col.editValue ? item[col.editValue] : item.name }}</span>
|
|
203
189
|
</span>
|
|
204
190
|
</template>
|
|
205
191
|
</template>
|
|
206
192
|
|
|
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
|
+
|
|
207
235
|
<!-- 自定义组件 -->
|
|
208
236
|
<template v-else-if="col.component">
|
|
209
237
|
<slot :name="col.component"
|