lw-cdp-ui 1.4.13 → 1.4.14

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.
@@ -66,6 +66,49 @@
66
66
  </el-form>
67
67
  </div>
68
68
  </template>
69
+ <!-- 修改密码&忘记密码 -->
70
+ <template v-else-if="isPassword">
71
+ <div class="login_registered">
72
+ <el-button type="primary" link @click="isPassword = false">
73
+ <i class="iconfont icon-quit"></i>
74
+ </el-button>
75
+ </div>
76
+ <div class="login-form">
77
+ <el-form ref="passwordForm" class="form-body" :model="passwordForm" :rules="rules" label-width="0"
78
+ size="large">
79
+ <el-form-item>
80
+ <!-- 系统注册名称插槽 -->
81
+ <div class="title-name">
82
+ <slot name="titleRegister">
83
+ {{ $t('loginPage.passwordRequest') }}
84
+ </slot>
85
+ </div>
86
+
87
+ </el-form-item>
88
+ <el-form-item prop="oldPassword">
89
+ <el-input v-model="passwordForm.oldPassword" prefix-icon="el-icon-lock" clearable show-password
90
+ :placeholder="$t('loginPage.oldPassword')">
91
+ </el-input>
92
+ </el-form-item>
93
+ <el-form-item prop="newPassword">
94
+ <el-input v-model="passwordForm.newPassword" prefix-icon="el-icon-lock" clearable show-password
95
+ :placeholder="$t('loginPage.newPassword')">
96
+ </el-input>
97
+ </el-form-item>
98
+ <el-form-item prop="confirmPassword">
99
+ <el-input v-model="passwordForm.confirmPassword" prefix-icon="el-icon-lock" clearable show-password
100
+ :placeholder="$t('loginPage.confirmPassword')">
101
+ </el-input>
102
+ </el-form-item>
103
+
104
+ <el-form-item>
105
+ <el-button type="primary" style="width: 100%" :loading="islogin" @click="submitPassword">{{
106
+ $t('loginPage.passwordEmail') }}</el-button>
107
+ </el-form-item>
108
+ </el-form>
109
+ </div>
110
+ </template>
111
+
69
112
  <template v-else>
70
113
  <div class="login_config">
71
114
  <Lang />
@@ -89,16 +132,12 @@
89
132
  :placeholder="$t('loginPage.PWPlaceholder')">
90
133
  </el-input>
91
134
  </el-form-item>
92
- <el-form-item style="margin-bottom: 10px">
93
- <el-row>
94
- <el-col :span="12">
95
- <el-checkbox :label="$t('loginPage.rememberMe')" v-model="ruleForm.autologin"></el-checkbox>
96
- </el-col>
97
- <el-col :span="12" style="text-align: right">
98
- <el-button type="primary" text>{{ $t("loginPage.forgetPassword") }}?
99
- </el-button>
100
- </el-col>
101
- </el-row>
135
+ <el-form-item>
136
+ <div class="login-remember">
137
+ <el-checkbox :label="$t('loginPage.rememberMe')" v-model="ruleForm.autologin"></el-checkbox>
138
+ <el-button type="primary" @click="isPassword = true" link>{{ $t("loginPage.forgetPassword") }}?
139
+ </el-button>
140
+ </div>
102
141
  </el-form-item>
103
142
  <el-form-item>
104
143
  <el-button type="primary" style="width: 100%" :loading="islogin" @click="login">{{ $t("loginPage.signIn")
@@ -139,6 +178,7 @@ export default {
139
178
  data() {
140
179
  return {
141
180
  isRegistered: false,
181
+ isPassword: false,
142
182
  ruleForm: {
143
183
  user: '',
144
184
  password: '',
@@ -146,6 +186,7 @@ export default {
146
186
  autologin: false
147
187
  },
148
188
  registForm: {},
189
+ passwordForm: {},
149
190
  rules: {
150
191
  user: [
151
192
  {
@@ -161,6 +202,44 @@ export default {
161
202
  trigger: 'blur'
162
203
  }
163
204
  ],
205
+ email: [
206
+ {
207
+ required: true,
208
+ message: this.t('loginPage.enterEmail'),
209
+ trigger: 'blur'
210
+ }
211
+ ],
212
+ oldPassword: [
213
+ {
214
+ required: true,
215
+ message: this.t('loginPage.oldPassword'),
216
+ trigger: 'blur'
217
+ }
218
+ ],
219
+ newPassword: [
220
+ {
221
+ required: true,
222
+ message: this.t('loginPage.newPassword'),
223
+ trigger: 'blur'
224
+ }
225
+ ],
226
+ confirmPassword: [
227
+ {
228
+ required: true,
229
+ message: this.t('loginPage.confirmPassword'),
230
+ trigger: 'blur'
231
+ },
232
+ {
233
+ validator: (rule, value, callback) => {
234
+ if (value !== this.passwordForm.newPassword) {
235
+ callback(new Error(this.t('loginPage.confirmPasswordError')))
236
+ } else {
237
+ callback()
238
+ }
239
+ },
240
+ trigger: 'blur'
241
+ }
242
+ ],
164
243
  name: [
165
244
  {
166
245
  required: true,
@@ -260,10 +339,7 @@ export default {
260
339
  return encryptor.encrypt(txt) // 对数据进行加密
261
340
  },
262
341
  async login() {
263
- let validate = await this.$refs.loginForm.validate().catch(() => { })
264
- if (!validate) {
265
- return false
266
- }
342
+ await this.$refs.loginForm.validate()
267
343
 
268
344
  let data = {
269
345
  username: this.ruleForm.user,
@@ -352,13 +428,17 @@ export default {
352
428
  },
353
429
  // 申请试用
354
430
  async apply() {
355
- let validate = await this.$refs.registForm.validate().catch(() => { })
356
- if (!validate) {
357
- return false
358
- }
431
+ await this.$refs.registForm.validate()
359
432
  await this.$api.auth.apply(this.registForm)
360
433
  this.$message.success(this.t('loginPage.applySuccess'))
361
434
  },
435
+ // 修改密码
436
+ async submitPassword() {
437
+ await this.$refs.passwordForm.validate()
438
+ await this.$api.auth.password(this.passwordForm)
439
+ this.$message.success(this.t('loginPage.passwordSuccess'))
440
+ this.isPassword = false
441
+ },
362
442
  // 处理动态菜单
363
443
  exportMenu(originData) {
364
444
  // 主处理函数
@@ -486,4 +566,11 @@ export default {
486
566
  top: 20px;
487
567
  right: 20px;
488
568
  }
569
+
570
+ .login-remember {
571
+ display: flex;
572
+ align-items: center;
573
+ justify-content: space-between;
574
+ width: 100%;
575
+ }
489
576
  </style>
@@ -1,37 +1,40 @@
1
1
  export default {
2
- loginPage: {
3
- accountLoginNologo:'Marketing Cloud',
4
- accountLogin: 'Lianwei Marketing Cloud',
5
- rememberMe: 'Keep me logged in',
6
- forgetPassword: 'Forgot password',
7
- signIn: 'Account verification',
8
- userPlaceholder: 'Username / Mobile / Email',
9
- userError: 'Please enter your username',
10
- PWPlaceholder: 'Please enter your password',
11
- PWError: 'Please enter your password',
12
- mobileError: 'Please enter your mobile number',
13
- trialRequest: 'Request a trial',
14
- enterTitle: 'Please enter your title',
15
- enterPhone: 'Please enter your phone number',
16
- correctPhone: 'Please enter a valid phone number format',
17
- enterCompany: 'Please enter your company name',
18
- selectPosition: 'Please select your position',
19
- selectPurpose: 'Please select your purpose',
20
- noAccount: 'Don’t have an account?',
21
- applySuccess: 'You have applied for a trial, please check your SMS for a prompt.',
22
- loginSuccess: 'Login successful'
23
- },
24
- positions: {
25
- techStaff: 'Technical staff',
26
- businessStaff: 'Business staff',
27
- researchStaff: 'Research and development staff',
28
- marketingStaff: 'Marketing staff',
29
- operationStaff: 'Operations staff',
30
- otherStaff: 'Other professional staff'
31
- },
32
- purposes: {
33
- findSolution: 'Looking for suitable products to solve data, marketing, and other issues',
34
- compareProducts: 'Comparing other products, want to learn more',
35
- other: 'Other'
36
- }
2
+ loginPage: {
3
+ accountLoginNologo: 'Marketing Cloud',
4
+ accountLogin: 'Lenwee Marketing Cloud',
5
+ rememberMe: 'Stay logged in',
6
+ forgetPassword: 'Change Password',
7
+ signIn: 'Account Verification',
8
+ userPlaceholder: 'Username / Phone / Email',
9
+ userError: 'Please enter username',
10
+ PWPlaceholder: 'Please enter password',
11
+ PWError: 'Please enter password',
12
+ mobileError: 'Please enter phone number',
13
+ trialRequest: 'Request Trial',
14
+ passwordRequest: 'Change Password',
15
+ passwordEmail: 'Send Email',
16
+ enterTitle: 'Please enter your title',
17
+ enterPhone: 'Please enter phone number',
18
+ enterEmail: 'Please enter email',
19
+ correctPhone: 'Please enter correct phone number format',
20
+ enterCompany: 'Please enter your company name',
21
+ selectPosition: 'Please select your position',
22
+ selectPurpose: 'Please select your purpose',
23
+ noAccount: 'No account yet?',
24
+ applySuccess: 'Your trial request has been submitted. Please check your SMS notification.',
25
+ loginSuccess: 'Login successful'
26
+ },
27
+ positions: {
28
+ techStaff: 'Technical Staff',
29
+ businessStaff: 'Business Staff',
30
+ researchStaff: 'R&D Staff',
31
+ marketingStaff: 'Marketing Staff',
32
+ operationStaff: 'Operations Staff',
33
+ otherStaff: 'Other Professionals'
34
+ },
35
+ purposes: {
36
+ findSolution: 'Looking for suitable products to solve data, marketing, etc. issues',
37
+ compareProducts: 'Comparing with other products, interested in learning more',
38
+ other: 'Others'
39
+ }
37
40
  }
@@ -1,37 +1,45 @@
1
1
  export default {
2
- loginPage: {
3
- accountLoginNologo:'营销云',
4
- accountLogin: '联蔚营销云',
5
- rememberMe: '保持登录状态',
6
- forgetPassword: '忘记密码',
7
- signIn: '账号验证',
8
- userPlaceholder: '用户名 / 手机 / 邮箱',
9
- userError: '请输入用户名',
10
- PWPlaceholder: '请输入密码',
11
- PWError: '请输入密码',
12
- mobileError: '请输入手机号码',
13
- trialRequest: '申请试用',
14
- enterTitle: '请输入您的称谓',
15
- enterPhone: '请输入手机号',
16
- correctPhone: '请输入正确的手机号格式',
17
- enterCompany: '请输入您的公司名称',
18
- selectPosition: '请选择您的职位',
19
- selectPurpose: '请选择您的用途',
20
- noAccount: '还没有账号 ?',
21
- applySuccess: '您已申请试用,请注意查收短信提示。',
22
- loginSuccess: '登录成功'
23
- },
24
- positions: {
25
- techStaff: '技术人员',
26
- businessStaff: '业务人员',
27
- researchStaff: '研发人员',
28
- marketingStaff: '市场人员',
29
- operationStaff: '运营人员',
30
- otherStaff: '其他专业人员'
31
- },
32
- purposes: {
33
- findSolution: '寻找合适的产品来解决数据,营销等问题',
34
- compareProducts: '正在对比其他产品,想了解',
35
- other: '其他'
36
- }
2
+ loginPage: {
3
+ accountLoginNologo: '营销云',
4
+ accountLogin: '联蔚营销云',
5
+ rememberMe: '保持登录状态',
6
+ forgetPassword: '修改密码',
7
+ signIn: '账号验证',
8
+ userPlaceholder: '用户名 / 手机 / 邮箱',
9
+ userError: '请输入用户名',
10
+ PWPlaceholder: '请输入密码',
11
+ PWError: '请输入密码',
12
+ mobileError: '请输入手机号码',
13
+ trialRequest: '申请试用',
14
+ passwordRequest: '修改密码',
15
+ oldPassword: '旧的密码',
16
+ newPassword: '新的密码',
17
+ confirmPassword: '确认密码',
18
+ confirmPasswordError: '两次密码不一致,请确认!',
19
+ passwordSuccess: '修改成功,请重新登录!',
20
+ passwordEmail: '确认修改',
21
+ enterTitle: '请输入您的称谓',
22
+ enterPhone: '请输入手机号',
23
+ enterEmail: '请输入邮箱',
24
+ correctPhone: '请输入正确的手机号格式',
25
+ enterCompany: '请输入您的公司名称',
26
+ selectPosition: '请选择您的职位',
27
+ selectPurpose: '请选择您的用途',
28
+ noAccount: '还没有账号 ?',
29
+ applySuccess: '您已申请试用,请注意查收短信提示。',
30
+ loginSuccess: '登录成功'
31
+ },
32
+ positions: {
33
+ techStaff: '技术人员',
34
+ businessStaff: '业务人员',
35
+ researchStaff: '研发人员',
36
+ marketingStaff: '市场人员',
37
+ operationStaff: '运营人员',
38
+ otherStaff: '其他专业人员'
39
+ },
40
+ purposes: {
41
+ findSolution: '寻找合适的产品来解决数据,营销等问题',
42
+ compareProducts: '正在对比其他产品,想了解',
43
+ other: '其他'
44
+ }
37
45
  }
@@ -1,90 +1,90 @@
1
- <template>
2
- <el-tour v-model="isOpen" :current="currentStep">
3
- <el-tour-step v-for="(step, index) in formattedSteps" :key="index" :target="step.target" :title="step.title"
4
- :description="step.description" />
5
- </el-tour>
6
- </template>
7
-
8
- <script>
9
- import { ref, getCurrentInstance, onMounted, nextTick, onUnmounted } from 'vue'
10
-
11
- export default {
12
- name: 'LwTour',
13
- props: {
14
- steps: {
15
- type: Array,
16
- required: true,
17
- validator: (value) => {
18
- return value.every(step => {
19
- return step.css && step.title && step.description
20
- })
21
- }
22
- },
23
- // 是否在组件挂载后自动开始引导
24
- autoStart: {
25
- type: Boolean,
26
- default: false
27
- }
28
- },
29
- setup(props, { emit }) {
30
- const {
31
- proxy: { $api, $expression, t, $tool, $bus }
32
- } = getCurrentInstance()
33
- $bus.$emit(`lwTourOpen`, true)
34
- $bus.$on(`lwTourChange`, () => {
35
- startTour()
36
- })
37
-
38
- onUnmounted(() => {
39
- $bus.$emit(`lwTourOpen`, false)
40
- })
41
-
42
- const currentStep = ref(0)
43
- const isOpen = ref(false)
44
- const formattedSteps = ref([])
45
-
46
- // 开始引导
47
- const startTour = () => {
48
- const allElementsExist = props.steps.every(step => {
49
- return document.querySelector(step.css)
50
- })
51
-
52
- if (!allElementsExist) {
53
- console.warn('元素未加载完成')
54
- startTour()
55
- return
56
- }
57
-
58
- formattedSteps.value = props.steps.map(step => {
59
- const targetElement = document.querySelector(step.css)
60
- return {
61
- target: targetElement || undefined,
62
- title: step.title,
63
- description: step.description,
64
- // 可以添加更多el-tour支持的配置项
65
- placement: 'bottom'
66
- }
67
- })
68
- currentStep.value = 0
69
- isOpen.value = true
70
- }
71
-
72
-
73
- // 组件挂载后自动开始引导
74
- onMounted(() => {
75
- if (props.autoStart) {
76
- nextTick(() => {
77
- startTour()
78
- })
79
- }
80
- })
81
-
82
- return {
83
- currentStep,
84
- formattedSteps,
85
- isOpen,
86
- startTour
87
- }
88
- }
89
- }
90
- </script>
1
+ <template>
2
+ <el-tour v-model="isOpen" :current="currentStep">
3
+ <el-tour-step v-for="(step, index) in formattedSteps" :key="index" :target="step.target" :title="step.title"
4
+ :description="step.description" />
5
+ </el-tour>
6
+ </template>
7
+
8
+ <script>
9
+ import { ref, getCurrentInstance, onMounted, nextTick, onUnmounted } from 'vue'
10
+
11
+ export default {
12
+ name: 'LwTour',
13
+ props: {
14
+ steps: {
15
+ type: Array,
16
+ required: true,
17
+ validator: (value) => {
18
+ return value.every(step => {
19
+ return step.css && step.title && step.description
20
+ })
21
+ }
22
+ },
23
+ // 是否在组件挂载后自动开始引导
24
+ autoStart: {
25
+ type: Boolean,
26
+ default: false
27
+ }
28
+ },
29
+ setup(props, { emit }) {
30
+ const {
31
+ proxy: { $api, $expression, t, $tool, $bus }
32
+ } = getCurrentInstance()
33
+ $bus.$emit(`lwTourOpen`, true)
34
+ $bus.$on(`lwTourChange`, () => {
35
+ startTour()
36
+ })
37
+
38
+ onUnmounted(() => {
39
+ $bus.$emit(`lwTourOpen`, false)
40
+ })
41
+
42
+ const currentStep = ref(0)
43
+ const isOpen = ref(false)
44
+ const formattedSteps = ref([])
45
+
46
+ // 开始引导
47
+ const startTour = () => {
48
+ const allElementsExist = props.steps.every(step => {
49
+ return document.querySelector(step.css)
50
+ })
51
+
52
+ if (!allElementsExist) {
53
+ console.warn('元素未加载完成')
54
+ startTour()
55
+ return
56
+ }
57
+
58
+ formattedSteps.value = props.steps.map(step => {
59
+ const targetElement = document.querySelector(step.css)
60
+ return {
61
+ target: targetElement || undefined,
62
+ title: step.title,
63
+ description: step.description,
64
+ // 可以添加更多el-tour支持的配置项
65
+ placement: 'bottom'
66
+ }
67
+ })
68
+ currentStep.value = 0
69
+ isOpen.value = true
70
+ }
71
+
72
+
73
+ // 组件挂载后自动开始引导
74
+ onMounted(() => {
75
+ if (props.autoStart) {
76
+ nextTick(() => {
77
+ startTour()
78
+ })
79
+ }
80
+ })
81
+
82
+ return {
83
+ currentStep,
84
+ formattedSteps,
85
+ isOpen,
86
+ startTour
87
+ }
88
+ }
89
+ }
90
+ </script>