lw-cdp-ui 1.4.53 → 1.4.54

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.
@@ -14,7 +14,6 @@
14
14
  <slot name="loginBg">
15
15
  <img v-show="!isRegistered" class="img" src="../../assets/images/login.svg" />
16
16
  </slot>
17
-
18
17
  </div>
19
18
  <div class="login_main">
20
19
  <template v-if="isRegistered">
@@ -32,20 +31,29 @@
32
31
  {{ $t('loginPage.trialRequest') }}
33
32
  </slot>
34
33
  </div>
35
-
36
34
  </el-form-item>
37
35
  <el-form-item prop="name">
38
- <el-input v-model="registForm.name" prefix-icon="el-icon-user" clearable
36
+ <el-input
37
+ v-model="registForm.name"
38
+ prefix-icon="el-icon-user"
39
+ clearable
39
40
  :placeholder="$t('loginPage.enterTitle')">
40
41
  </el-input>
41
42
  </el-form-item>
42
43
  <el-form-item prop="phone">
43
- <el-input v-model="registForm.phone" prefix-icon="el-icon-iphone" clearable maxlength="11"
44
+ <el-input
45
+ v-model="registForm.phone"
46
+ prefix-icon="el-icon-iphone"
47
+ clearable
48
+ maxlength="11"
44
49
  :placeholder="$t('loginPage.enterPhone')">
45
50
  </el-input>
46
51
  </el-form-item>
47
52
  <el-form-item prop="company">
48
- <el-input v-model="registForm.company" prefix-icon="el-icon-office-building" clearable
53
+ <el-input
54
+ v-model="registForm.company"
55
+ prefix-icon="el-icon-office-building"
56
+ clearable
49
57
  :placeholder="$t('loginPage.enterCompany')">
50
58
  </el-input>
51
59
  </el-form-item>
@@ -61,7 +69,8 @@
61
69
  </el-form-item>
62
70
  <el-form-item>
63
71
  <el-button type="primary" style="width: 100%" :loading="islogin" @click="apply">{{
64
- $t('loginPage.trialRequest') }}</el-button>
72
+ $t('loginPage.trialRequest')
73
+ }}</el-button>
65
74
  </el-form-item>
66
75
  </el-form>
67
76
  </div>
@@ -74,7 +83,12 @@
74
83
  </el-button>
75
84
  </div>
76
85
  <div class="login-form">
77
- <el-form ref="passwordForm" class="form-body" :model="passwordForm" :rules="rules" label-width="0"
86
+ <el-form
87
+ ref="passwordForm"
88
+ class="form-body"
89
+ :model="passwordForm"
90
+ :rules="rules"
91
+ label-width="0"
78
92
  size="large">
79
93
  <el-form-item>
80
94
  <!-- 系统注册名称插槽 -->
@@ -83,27 +97,39 @@
83
97
  {{ $t('loginPage.passwordRequest') }}
84
98
  </slot>
85
99
  </div>
86
-
87
100
  </el-form-item>
88
101
  <el-form-item prop="oldPassword">
89
- <el-input v-model="passwordForm.oldPassword" prefix-icon="el-icon-lock" clearable show-password
102
+ <el-input
103
+ v-model="passwordForm.oldPassword"
104
+ prefix-icon="el-icon-lock"
105
+ clearable
106
+ show-password
90
107
  :placeholder="$t('loginPage.oldPassword')">
91
108
  </el-input>
92
109
  </el-form-item>
93
110
  <el-form-item prop="newPassword">
94
- <el-input v-model="passwordForm.newPassword" prefix-icon="el-icon-lock" clearable show-password
111
+ <el-input
112
+ v-model="passwordForm.newPassword"
113
+ prefix-icon="el-icon-lock"
114
+ clearable
115
+ show-password
95
116
  :placeholder="$t('loginPage.newPassword')">
96
117
  </el-input>
97
118
  </el-form-item>
98
119
  <el-form-item prop="confirmPassword">
99
- <el-input v-model="passwordForm.confirmPassword" prefix-icon="el-icon-lock" clearable show-password
120
+ <el-input
121
+ v-model="passwordForm.confirmPassword"
122
+ prefix-icon="el-icon-lock"
123
+ clearable
124
+ show-password
100
125
  :placeholder="$t('loginPage.confirmPassword')">
101
126
  </el-input>
102
127
  </el-form-item>
103
128
 
104
129
  <el-form-item>
105
130
  <el-button type="primary" style="width: 100%" :loading="islogin" @click="submitPassword">{{
106
- $t('loginPage.passwordEmail') }}</el-button>
131
+ $t('loginPage.passwordEmail')
132
+ }}</el-button>
107
133
  </el-form-item>
108
134
  </el-form>
109
135
  </div>
@@ -116,34 +142,41 @@
116
142
  <div class="login-form">
117
143
  <el-form ref="loginForm" class="form-body" :model="ruleForm" :rules="rules" label-width="0" size="large">
118
144
  <el-form-item>
119
-
120
145
  <div class="title-name">
121
146
  <slot name="title">{{ $t('loginPage.accountLogin') }}</slot>
122
147
  </div>
123
-
124
148
  </el-form-item>
125
149
  <el-form-item prop="user">
126
- <el-input v-model="ruleForm.user" prefix-icon="el-icon-user" clearable
150
+ <el-input
151
+ v-model="ruleForm.user"
152
+ prefix-icon="el-icon-user"
153
+ clearable
127
154
  :placeholder="$t('loginPage.userPlaceholder')">
128
155
  </el-input>
129
156
  </el-form-item>
130
157
  <el-form-item prop="password">
131
- <el-input v-model="ruleForm.password" prefix-icon="el-icon-lock" clearable show-password
158
+ <el-input
159
+ v-model="ruleForm.password"
160
+ prefix-icon="el-icon-lock"
161
+ clearable
162
+ show-password
132
163
  :placeholder="$t('loginPage.PWPlaceholder')">
133
164
  </el-input>
134
165
  </el-form-item>
135
166
  <el-form-item>
136
167
  <div class="login-remember">
137
168
  <el-checkbox :label="$t('loginPage.rememberMe')" v-model="ruleForm.autologin"></el-checkbox>
138
- <el-button type="primary" @click="changePassword" link>{{ $t("loginPage.forgetPassword") }}?
169
+ <el-button v-if="isEditPassword" type="primary" @click="changePassword" link
170
+ >{{ $t('loginPage.forgetPassword') }}?
139
171
  </el-button>
140
172
  </div>
141
173
  </el-form-item>
142
174
  <el-form-item>
143
- <el-button type="primary" style="width: 100%" :loading="islogin" @click="login">{{ $t("loginPage.signIn")
175
+ <el-button type="primary" style="width: 100%" :loading="islogin" @click="login">{{
176
+ $t('loginPage.signIn')
144
177
  }}</el-button>
145
178
  </el-form-item>
146
- <el-form-item>
179
+ <el-form-item v-if="isTrial">
147
180
  {{ $t('loginPage.noAccount') }}
148
181
  <el-button type="primary" link @click="isRegistered = true">{{ $t('loginPage.trialRequest') }}</el-button>
149
182
  </el-form-item>
@@ -170,6 +203,16 @@ export default {
170
203
  isEncryption: {
171
204
  type: Boolean,
172
205
  default: true
206
+ },
207
+ // 是否修改密码
208
+ isEditPassword: {
209
+ type: Boolean,
210
+ default: true
211
+ },
212
+ // 是否试用
213
+ isTrial: {
214
+ type: Boolean,
215
+ default: true
173
216
  }
174
217
  },
175
218
  components: {
@@ -369,7 +412,7 @@ export default {
369
412
  }
370
413
  this.$tool.data.set('buList', bu)
371
414
  let code = this.$tool.data.get('buCode')
372
- let item = bu.find(x => {
415
+ let item = bu.find((x) => {
373
416
  return x.code == code
374
417
  })
375
418
  if (!item) {
@@ -380,7 +423,7 @@ export default {
380
423
  let user = await this.$api.auth.user()
381
424
 
382
425
  // 判断密码是否过期
383
- if (!user?.userAuthInfo && user?.loginPage?.includes("pwdChange")) {
426
+ if (!user?.userAuthInfo && user?.loginPage?.includes('pwdChange')) {
384
427
  this.$message.warning('您的密码已过期,请修改密码!')
385
428
  this.isPassword = true
386
429
  this.islogin = false
@@ -388,8 +431,10 @@ export default {
388
431
  }
389
432
 
390
433
  // 处理应用显示逻辑
391
- let application = [...new Set(user.userAuthInfo.menus.map(permission => permission.split('.')[0].split('_')[0]))]
392
- user.userAuthInfo.grantedApplications = user.userAuthInfo.grantedApplications.filter(x =>
434
+ let application = [
435
+ ...new Set(user.userAuthInfo.menus.map((permission) => permission.split('.')[0].split('_')[0]))
436
+ ]
437
+ user.userAuthInfo.grantedApplications = user.userAuthInfo.grantedApplications.filter((x) =>
393
438
  application.includes(x.code)
394
439
  )
395
440
 
@@ -495,7 +540,7 @@ export default {
495
540
 
496
541
  // 处理子节点
497
542
  if (node.children && node.children.length) {
498
- route.children = node.children.sort((a, b) => a.sort - b.sort).map(child => processNode(child, route))
543
+ route.children = node.children.sort((a, b) => a.sort - b.sort).map((child) => processNode(child, route))
499
544
  }
500
545
 
501
546
  return route
@@ -504,7 +549,7 @@ export default {
504
549
  // 按applications分组
505
550
  const groupedData = {}
506
551
 
507
- originData.forEach(item => {
552
+ originData.forEach((item) => {
508
553
  // 获取应用类型(如ec、cdp等)
509
554
  const appType = item.applications[0]
510
555
 
@@ -518,7 +563,7 @@ export default {
518
563
  })
519
564
 
520
565
  // 对每个应用类型的菜单进行排序
521
- Object.keys(groupedData).forEach(appType => {
566
+ Object.keys(groupedData).forEach((appType) => {
522
567
  groupedData[appType].sort((a, b) => a.sort - b.sort)
523
568
  })
524
569