n20-common-lib 2.4.34 → 2.4.36-alpha

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/package.json CHANGED
@@ -1,48 +1,8 @@
1
1
  {
2
- "name": "n20-common-lib",
3
- "version": "2.4.34",
4
- "private": false,
5
- "main": "src/index.js",
6
- "scripts": {
7
- "serve": "vue-cli-service serve",
8
- "serve:theme": "vue-cli-service serve --testTheme",
9
- "test": "vue-cli-service serve --test",
10
- "build": "node versionInfo.js && npm run build:css && vue-cli-service build --testTheme",
11
- "lint": "vue-cli-service lint",
12
- "info": "node versionInfo.js",
13
- "build:Jenkins_1": "vue-cli-service build --serverConfig ./server-config-jenkins.jsonc",
14
- "build:gzip": "vue-cli-service build --gzip",
15
- "build:report": "vue-cli-service build --analy",
16
- "build:css": "node build_css",
17
- "build:js": "vue-cli-service build --formats umd-min --target lib src/index.js --name index --dest lib --analy",
18
- "build:doc": "node versionInfo.js && vue-cli-service build --testTheme",
19
- "getI18n": "node ./node_modules/nstc-get-i18n"
20
- },
21
- "files": [
22
- "src/_qiankun",
23
- "src/assets",
24
- "src/components",
25
- "src/directives",
26
- "src/locale",
27
- "src/mixins",
28
- "src/utils",
29
- "src/plugins",
30
- "src/index.js",
31
- "src/i18n.json",
32
- "style/*.css",
33
- "style/*.css.map",
34
- "style/fonts",
35
- "theme/*.css",
36
- "theme/fonts",
37
- "bpmn2svg",
38
- "g6.js",
39
- "u-table.js",
40
- "vxe-table.js",
41
- "nstc-g6/index.js",
42
- "nstc-g6/assets",
43
- "nstc-g6/components",
44
- "nstc-g6/directives",
45
- "nstc-g6/utils"
2
+ "browserslist": [
3
+ "> 1%",
4
+ "last 2 versions",
5
+ "not dead"
46
6
  ],
47
7
  "dependencies": {
48
8
  "axios": "*",
@@ -103,15 +63,55 @@
103
63
  "vue-router": "^3.5.2",
104
64
  "vue-template-compiler": "^2.6.11",
105
65
  "vuex": "^3.6.2",
66
+ "vxe-table": "^3.6.17",
106
67
  "webpack-bundle-analyzer": "^3.9.0",
68
+ "xe-utils": "^3.5.11",
107
69
  "xlsx": "0.14.1",
108
- "xlsx-style": "^0.8.13",
109
- "vxe-table": "^3.6.17",
110
- "xe-utils": "^3.5.11"
70
+ "xlsx-style": "^0.8.13"
111
71
  },
112
- "browserslist": [
113
- "> 1%",
114
- "last 2 versions",
115
- "not dead"
116
- ]
117
- }
72
+ "files": [
73
+ "src/_qiankun",
74
+ "src/assets",
75
+ "src/components",
76
+ "src/directives",
77
+ "src/locale",
78
+ "src/mixins",
79
+ "src/utils",
80
+ "src/plugins",
81
+ "src/index.js",
82
+ "src/i18n.json",
83
+ "style/*.css",
84
+ "style/*.css.map",
85
+ "style/fonts",
86
+ "theme/*.css",
87
+ "theme/fonts",
88
+ "bpmn2svg",
89
+ "g6.js",
90
+ "u-table.js",
91
+ "vxe-table.js",
92
+ "nstc-g6/index.js",
93
+ "nstc-g6/assets",
94
+ "nstc-g6/components",
95
+ "nstc-g6/directives",
96
+ "nstc-g6/utils"
97
+ ],
98
+ "main": "src/index.js",
99
+ "name": "n20-common-lib",
100
+ "private": false,
101
+ "scripts": {
102
+ "build": "node versionInfo.js && npm run build:css && vue-cli-service build --testTheme",
103
+ "build:Jenkins_1": "vue-cli-service build --serverConfig ./server-config-jenkins.jsonc",
104
+ "build:css": "node build_css",
105
+ "build:doc": "node versionInfo.js && vue-cli-service build --testTheme",
106
+ "build:gzip": "vue-cli-service build --gzip",
107
+ "build:js": "vue-cli-service build --formats umd-min --target lib src/index.js --name index --dest lib --analy",
108
+ "build:report": "vue-cli-service build --analy",
109
+ "getI18n": "node ./node_modules/nstc-get-i18n",
110
+ "info": "node versionInfo.js",
111
+ "lint": "vue-cli-service lint",
112
+ "serve": "vue-cli-service serve",
113
+ "serve:theme": "vue-cli-service serve --testTheme",
114
+ "test": "vue-cli-service serve --test"
115
+ },
116
+ "version": "2.4.36-alpha"
117
+ }
@@ -1,6 +1,11 @@
1
1
  <template>
2
2
  <div v-loading="laoding">
3
- <el-form ref="cp-form" :model="form" :label-width="_lang == 'zh' ? '6em' : '11em'" @submit.native.prevent>
3
+ <el-form
4
+ ref="cp-form"
5
+ :model="form"
6
+ :label-width="_lang == 'zh' ? '6em' : '11em'"
7
+ @submit.native.prevent
8
+ >
4
9
  <el-form-item :label="'账号' | $lc">
5
10
  <el-input :value="form.username" disabled />
6
11
  </el-form-item>
@@ -9,27 +14,36 @@
9
14
  prop="orginPassword"
10
15
  :rules="[
11
16
  { required: true, message: $lc('请输入原始密码'), trigger: 'blur' },
12
- { validator: orginPasswordVd, trigger: 'blur' }
17
+ { validator: orginPasswordVd, trigger: 'blur' },
13
18
  ]"
14
19
  >
15
- <el-input v-model="form.orginPassword" type="password" :placeholder="'请输入原始密码' | $lc" />
20
+ <el-input
21
+ v-model="form.orginPassword"
22
+ type="password"
23
+ :placeholder="'请输入原始密码' | $lc"
24
+ />
16
25
  </el-form-item>
17
26
  <el-form-item
18
27
  :label="'新密码' | $lc"
19
28
  prop="newPassword"
20
29
  :rules="[
21
30
  { required: true, message: $lc('请输入新密码'), trigger: 'blur' },
22
- { validator: newPasswordVd, trigger: 'blur' }
31
+ { validator: newPasswordVd, trigger: 'blur' },
23
32
  ]"
24
33
  >
25
- <el-input v-model="form.newPassword" :placeholder="'请输入新密码' | $lc" show-password @change="newPwdChange" />
34
+ <el-input
35
+ v-model="form.newPassword"
36
+ :placeholder="'请输入新密码' | $lc"
37
+ show-password
38
+ @change="newPwdChange"
39
+ />
26
40
  </el-form-item>
27
41
  <el-form-item
28
42
  :label="'确认密码' | $lc"
29
43
  prop="validatePassword"
30
44
  :rules="[
31
45
  { required: true, message: $lc('请确认新密码'), trigger: 'blur' },
32
- { validator: validatePasswordVd, trigger: 'blur' }
46
+ { validator: validatePasswordVd, trigger: 'blur' },
33
47
  ]"
34
48
  >
35
49
  <el-input
@@ -42,22 +56,24 @@
42
56
  </el-form>
43
57
 
44
58
  <div class="dialog-footer">
45
- <el-button type="primary" @click="confirmFn">{{ '确认' | $lc }}</el-button>
46
- <el-button @click="closeFn">{{ '取消' | $lc }}</el-button>
59
+ <el-button type="primary" @click="confirmFn">{{
60
+ "确认" | $lc
61
+ }}</el-button>
62
+ <el-button @click="closeFn">{{ "取消" | $lc }}</el-button>
47
63
  </div>
48
64
  </div>
49
65
  </template>
50
66
 
51
67
  <script>
52
- import { $lc } from '../../../utils/i18n/index'
53
- import auth from '../../../utils/auth'
54
- import axios from '../../../utils/axios'
68
+ import { $lc } from "../../../utils/i18n/index";
69
+ import auth from "../../../utils/auth";
70
+ import axios from "../../../utils/axios";
55
71
  export default {
56
72
  props: {
57
73
  visible: {
58
74
  type: Boolean,
59
- default: false
60
- }
75
+ default: false,
76
+ },
61
77
  },
62
78
  data() {
63
79
  return {
@@ -66,136 +82,143 @@ export default {
66
82
  pwdRE: undefined,
67
83
  pwdReMsg: undefined,
68
84
  form: {
69
- username: sessionStorage.getItem('userNo'),
70
- orginPassword: '',
71
- newPassword: '',
72
- validatePassword: ''
85
+ username: sessionStorage.getItem("userNo"),
86
+ orginPassword: "",
87
+ newPassword: "",
88
+ validatePassword: "",
73
89
  },
74
- laoding: false
75
- }
90
+ laoding: false,
91
+ };
76
92
  },
77
93
  watch: {
78
94
  visible(v) {
79
95
  if (!v) {
80
- this.$refs['cp-form'].resetFields()
96
+ this.$refs["cp-form"].resetFields();
81
97
  }
82
- }
98
+ },
83
99
  },
84
100
  created() {
85
- this.getPwdRule()
101
+ this.getPwdRule();
86
102
  },
87
103
  methods: {
88
104
  getPwdRule() {
89
- axios.post('/bems/prod_1.0/user/api/userController/use').then(({ data }) => {
90
- let { minLength, maxLength, passwordStrength } = data
91
- this.pwdMin = minLength
92
- this.pwdMax = maxLength
93
- switch (passwordStrength) {
94
- case '0':
95
- this.pwdRE = [/[A-z0-9]+/]
96
- this.pwdReMsg = $lc(`密码只能为字母数字`)
97
- break
98
- case '1':
99
- this.pwdRE = [/[A-z]+/, /[0-9]+/]
100
- this.pwdReMsg = $lc(`密码只能包含数字 + 字母`)
101
- break
102
- case '2':
103
- this.pwdRE = [/[A-Z]+/, /[a-z]+/, /[0-9]+/]
104
- this.pwdReMsg = $lc(`密码只能包含数字 + 大写字母 + 小写字母`)
105
- break
106
- }
107
- })
105
+ axios
106
+ .post("/bems/prod_1.0/user/api/userController/use")
107
+ .then(({ data }) => {
108
+ let { minLength, maxLength, passwordStrength } = data;
109
+ this.pwdMin = minLength;
110
+ this.pwdMax = maxLength;
111
+ switch (passwordStrength) {
112
+ case "0":
113
+ this.pwdRE = [/[A-z0-9]+/];
114
+ this.pwdReMsg = $lc(`密码只能为字母数字`);
115
+ break;
116
+ case "1":
117
+ this.pwdRE = [/[A-z]+/, /[0-9]+/];
118
+ this.pwdReMsg = $lc(`密码只能包含数字 + 字母`);
119
+ break;
120
+ case "2":
121
+ this.pwdRE = [/[A-Z]+/, /[a-z]+/, /[0-9]+/];
122
+ this.pwdReMsg = $lc(`密码只能包含数字 + 大写字母 + 小写字母`);
123
+ break;
124
+ }
125
+ });
108
126
  },
109
127
 
110
128
  orginPasswordVd(r, value, callback) {
111
129
  axios
112
130
  .post(
113
- '/bems/prod_1.0/uas/api/authorization/password/validate',
131
+ "/bems/prod_1.0/uas/api/authorization/password/validate",
114
132
  {
115
- username: this.form.username,
116
- password: value
133
+ // username: this.form.username,
134
+ password: value,
117
135
  },
118
136
  { noMsg: true, loading: false }
119
137
  )
120
138
  .then(() => {
121
- callback()
139
+ callback();
122
140
  })
123
141
  .catch(() => {
124
- callback(new Error($lc('原始密码与旧密码不一致')))
125
- })
142
+ callback(new Error($lc("原始密码与旧密码不一致")));
143
+ });
126
144
  },
127
145
  newPasswordVd(r, value, callback) {
128
- let _re_1 = new RegExp(`^.{${this.pwdMin},${this.pwdMax}}$`)
146
+ let _re_1 = new RegExp(`^.{${this.pwdMin},${this.pwdMax}}$`);
129
147
  if (!_re_1.test(value)) {
130
- callback(new Error(`${$lc('密码长度范围:')}${this.pwdMin}-${this.pwdMax}${$lc('位')}`))
148
+ callback(
149
+ new Error(
150
+ `${$lc("密码长度范围:")}${this.pwdMin}-${this.pwdMax}${$lc("位")}`
151
+ )
152
+ );
131
153
  }
132
154
 
133
155
  if (this.pwdRE) {
134
156
  this.pwdRE.some((re) => {
135
157
  if (!re.test(value)) {
136
- callback(new Error(this.pwdReMsg))
137
- return true
158
+ callback(new Error(this.pwdReMsg));
159
+ return true;
138
160
  }
139
- })
161
+ });
140
162
  }
141
- callback()
163
+ callback();
142
164
  },
143
165
  validatePasswordVd(r, value, callback) {
144
166
  if (value === this.form.newPassword) {
145
- callback()
167
+ callback();
146
168
  } else {
147
- callback(new Error($lc('两次输入密码不一致!')))
169
+ callback(new Error($lc("两次输入密码不一致!")));
148
170
  }
149
171
  },
150
172
  newPwdChange(val) {
151
173
  if (!val) {
152
- this.form.validatePassword = ''
153
- this.$refs['cp-form'].clearValidate('validatePassword')
174
+ this.form.validatePassword = "";
175
+ this.$refs["cp-form"].clearValidate("validatePassword");
154
176
  }
155
177
  },
156
178
  confirmFn() {
157
- this.$refs['cp-form'].validate((v) => {
179
+ this.$refs["cp-form"].validate((v) => {
158
180
  if (v) {
159
181
  if (this.form.newPassword === this.form.orginPassword) {
160
- this.$message.error($lc('新密码不能与旧密码相同!'))
161
- this.form.newPassword = ''
162
- this.form.validatePassword = ''
163
- return
182
+ this.$message.error($lc("新密码不能与旧密码相同!"));
183
+ this.form.newPassword = "";
184
+ this.form.validatePassword = "";
185
+ return;
164
186
  }
165
187
 
166
- this.laoding = true
188
+ this.laoding = true;
167
189
  axios
168
190
  .post(
169
- '/bems/prod_1.0/uas/api/authorization/password/update',
191
+ "/bems/prod_1.0/uas/api/authorization/password/update",
170
192
  {
171
- username: this.form.username,
172
- newPassword: this.form.newPassword
193
+ // username: this.form.username,
194
+ password: this.form.orginPassword,
195
+ newPassword: this.form.newPassword,
173
196
  },
174
197
  {
175
198
  loading: () => {
176
- this.laoding = false
177
- }
199
+ this.laoding = false;
200
+ },
178
201
  }
179
202
  )
180
203
  .then(() => {
181
- this.confirmFnThen()
182
- })
204
+ this.confirmFnThen();
205
+ });
183
206
  }
184
- })
207
+ });
185
208
  },
186
209
  confirmFnThen() {
187
210
  this.$message({
188
- message: '密码修改成功!',
189
- type: 'success'
190
- })
191
- axios.delete('/bems/prod_1.0/uas/api/authorization/logout').then(() => {
192
- this.closeFn()
193
- auth.removeToken()
194
- })
211
+ message: "密码修改成功!",
212
+ type: "success",
213
+ });
214
+ axios.delete("/bems/prod_1.0/uas/api/authorization/logout").then(() => {
215
+ this.closeFn();
216
+ auth.removeToken();
217
+ });
195
218
  },
196
219
  closeFn() {
197
- this.$emit('update:visible', false)
198
- }
199
- }
200
- }
220
+ this.$emit("update:visible", false);
221
+ },
222
+ },
223
+ };
201
224
  </script>
@@ -426,14 +426,19 @@ export default {
426
426
  })
427
427
  },
428
428
  logoutA() {
429
- axios.delete('/bems/prod_1.0/uas/api/authorization/logout').then(() => {
430
- if (this.afterLogout) {
431
- let After = this.afterLogout()
432
- After.then && After.then(auth.removeToken())
433
- } else {
429
+ axios
430
+ .delete('/bems/prod_1.0/uas/api/authorization/logout', {}, { noMsg: true })
431
+ .then(() => {
432
+ if (this.afterLogout) {
433
+ let After = this.afterLogout()
434
+ After.then && After.then(auth.removeToken())
435
+ } else {
436
+ auth.removeToken()
437
+ }
438
+ })
439
+ .catch(() => {
434
440
  auth.removeToken()
435
- }
436
- })
441
+ })
437
442
  },
438
443
  // 检查是否代理中
439
444
  async getProxyAuthIing() {
@@ -188,7 +188,7 @@
188
188
  </div>
189
189
  <el-dropdown-menu slot="dropdown">
190
190
  <el-dropdown-item v-for="item in systemList" :key="item.id" @click.native="clickSystem(item)">
191
- <span>{{ item.systemName | $lc }}</span>
191
+ <span>{{ item.systemName }}</span>
192
192
  </el-dropdown-item>
193
193
  </el-dropdown-menu>
194
194
  </el-dropdown>
@@ -570,14 +570,19 @@ export default {
570
570
  })
571
571
  },
572
572
  logoutA() {
573
- axios.delete('/bems/prod_1.0/uas/api/authorization/logout').then(() => {
574
- if (this.afterLogout) {
575
- let After = this.afterLogout()
576
- After.then && After.then(auth.removeToken())
577
- } else {
573
+ axios
574
+ .delete('/bems/prod_1.0/uas/api/authorization/logout', {}, { noMsg: true })
575
+ .then(() => {
576
+ if (this.afterLogout) {
577
+ let After = this.afterLogout()
578
+ After.then && After.then(auth.removeToken())
579
+ } else {
580
+ auth.removeToken()
581
+ }
582
+ })
583
+ .catch(() => {
578
584
  auth.removeToken()
579
- }
580
- })
585
+ })
581
586
  },
582
587
  // 检查是否代理中
583
588
  async getProxyAuthIing() {