Skip to content

Commit ad6ca5e

Browse files
committed
替换var 为const/let
删除未使用import 替换 == 为 ===
1 parent 6cd4214 commit ad6ca5e

File tree

66 files changed

+305
-319
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+305
-319
lines changed

build/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
1212
const port = 9526
1313
const publicPath = config.publicPath
1414

15-
var connect = require('connect')
16-
var serveStatic = require('serve-static')
15+
const connect = require('connect')
16+
const serveStatic = require('serve-static')
1717
const app = connect()
1818

1919
app.use(

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@
8989
"fs-extra": "^8.1.0",
9090
"lint-staged": "10.5.3",
9191
"runjs": "4.4.2",
92-
"sass": "1.32.13",
93-
"sass-loader": "10.1.1",
92+
"sass": "1.56.0",
93+
"sass-loader": "13.1.0",
9494
"script-ext-html-webpack-plugin": "2.1.5",
9595
"svg-sprite-loader": "5.1.1",
9696
"terser-webpack-plugin": "^4.2.3",

src/components/Breadcrumb/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<el-breadcrumb class="app-breadcrumb" separator="/">
33
<transition-group name="breadcrumb">
44
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
5-
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span>
5+
<span v-if="item.redirect==='noRedirect'||index===levelList.length-1" class="no-redirect">{{ item.meta.title }}</span>
66
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
77
</el-breadcrumb-item>
88
</transition-group>

src/components/Crontab/day.vue

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,25 +103,25 @@ export default {
103103
},
104104
// 周期两个值变化时
105105
cycleChange() {
106-
if (this.radioValue == '3') {
106+
if (this.radioValue === '3') {
107107
this.$emit('update', 'day', this.cycleTotal);
108108
}
109109
},
110110
// 平均两个值变化时
111111
averageChange() {
112-
if (this.radioValue == '4') {
112+
if (this.radioValue === '4') {
113113
this.$emit('update', 'day', this.averageTotal);
114114
}
115115
},
116116
// 最近工作日值变化时
117117
workdayChange() {
118-
if (this.radioValue == '5') {
118+
if (this.radioValue === '5') {
119119
this.$emit('update', 'day', this.workdayCheck + 'W');
120120
}
121121
},
122122
// checkbox值变化时
123123
checkboxChange() {
124-
if (this.radioValue == '7') {
124+
if (this.radioValue === '7') {
125125
this.$emit('update', 'day', this.checkboxString);
126126
}
127127
}
@@ -148,13 +148,12 @@ export default {
148148
},
149149
// 计算工作日格式
150150
workdayCheck: function () {
151-
const workday = this.checkNum(this.workday, 1, 31)
152-
return workday;
151+
return this.checkNum(this.workday, 1, 31);
153152
},
154153
// 计算勾选的checkbox值合集
155154
checkboxString: function () {
156155
let str = this.checkboxList.join();
157-
return str == '' ? '*' : str;
156+
return str === '' ? '*' : str;
158157
}
159158
}
160159
}

src/components/Crontab/hour.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,19 @@ export default {
6868
},
6969
// 周期两个值变化时
7070
cycleChange() {
71-
if (this.radioValue == '2') {
71+
if (this.radioValue === '2') {
7272
this.$emit('update', 'hour', this.cycleTotal);
7373
}
7474
},
7575
// 平均两个值变化时
7676
averageChange() {
77-
if (this.radioValue == '3') {
77+
if (this.radioValue === '3') {
7878
this.$emit('update', 'hour', this.averageTotal);
7979
}
8080
},
8181
// checkbox值变化时
8282
checkboxChange() {
83-
if (this.radioValue == '4') {
83+
if (this.radioValue === '4') {
8484
this.$emit('update', 'hour', this.checkboxString);
8585
}
8686
}
@@ -107,7 +107,7 @@ export default {
107107
// 计算勾选的checkbox值合集
108108
checkboxString: function () {
109109
let str = this.checkboxList.join();
110-
return str == '' ? '*' : str;
110+
return str === '' ? '*' : str;
111111
}
112112
}
113113
}

src/components/Crontab/index.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ export default {
143143
props: ["expression", "hideComponent"],
144144
methods: {
145145
shouldHide(key) {
146-
if (this.hideComponent && this.hideComponent.includes(key)) return false;
147-
return true;
146+
return !(this.hideComponent && this.hideComponent.includes(key));
147+
148148
},
149149
resolveExp() {
150150
// 反解析 表达式
@@ -215,10 +215,10 @@ export default {
215215
insValue = 4;
216216
this.$refs[refName].checkboxList = value.split(",");
217217
}
218-
} else if (name == "day") {
218+
} else if (name === "day") {
219219
if (value === "*") {
220220
insValue = 1;
221-
} else if (value == "?") {
221+
} else if (value === "?") {
222222
insValue = 2;
223223
} else if (value.indexOf("-") > -1) {
224224
let indexArr = value.split("-");
@@ -246,10 +246,10 @@ export default {
246246
this.$refs[refName].checkboxList = value.split(",");
247247
insValue = 7;
248248
}
249-
} else if (name == "week") {
249+
} else if (name === "week") {
250250
if (value === "*") {
251251
insValue = 1;
252-
} else if (value == "?") {
252+
} else if (value === "?") {
253253
insValue = 2;
254254
} else if (value.indexOf("-") > -1) {
255255
let indexArr = value.split("-");
@@ -275,10 +275,10 @@ export default {
275275
this.$refs[refName].checkboxList = value.split(",");
276276
insValue = 6;
277277
}
278-
} else if (name == "year") {
279-
if (value == "") {
278+
} else if (name === "year") {
279+
if (value === "") {
280280
insValue = 1;
281-
} else if (value == "*") {
281+
} else if (value === "*") {
282282
insValue = 2;
283283
} else if (value.indexOf("-") > -1) {
284284
insValue = 3;
@@ -343,7 +343,7 @@ export default {
343343
obj.month +
344344
" " +
345345
obj.week +
346-
(obj.year == "" ? "" : " " + obj.year);
346+
(obj.year === "" ? "" : " " + obj.year);
347347
return str;
348348
},
349349
},

src/components/Crontab/min.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,19 @@ export default {
6969
},
7070
// 周期两个值变化时
7171
cycleChange() {
72-
if (this.radioValue == '2') {
72+
if (this.radioValue === '2') {
7373
this.$emit('update', 'min', this.cycleTotal, 'min');
7474
}
7575
},
7676
// 平均两个值变化时
7777
averageChange() {
78-
if (this.radioValue == '3') {
78+
if (this.radioValue === '3') {
7979
this.$emit('update', 'min', this.averageTotal, 'min');
8080
}
8181
},
8282
// checkbox值变化时
8383
checkboxChange() {
84-
if (this.radioValue == '4') {
84+
if (this.radioValue === '4') {
8585
this.$emit('update', 'min', this.checkboxString, 'min');
8686
}
8787
},
@@ -109,8 +109,8 @@ export default {
109109
// 计算勾选的checkbox值合集
110110
checkboxString: function () {
111111
let str = this.checkboxList.join();
112-
return str == '' ? '*' : str;
112+
return str === '' ? '*' : str;
113113
}
114114
}
115115
}
116-
</script>
116+
</script>

src/components/Crontab/month.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,19 @@ export default {
6868
},
6969
// 周期两个值变化时
7070
cycleChange() {
71-
if (this.radioValue == '2') {
71+
if (this.radioValue === '2') {
7272
this.$emit('update', 'month', this.cycleTotal);
7373
}
7474
},
7575
// 平均两个值变化时
7676
averageChange() {
77-
if (this.radioValue == '3') {
77+
if (this.radioValue === '3') {
7878
this.$emit('update', 'month', this.averageTotal);
7979
}
8080
},
8181
// checkbox值变化时
8282
checkboxChange() {
83-
if (this.radioValue == '4') {
83+
if (this.radioValue === '4') {
8484
this.$emit('update', 'month', this.checkboxString);
8585
}
8686
}
@@ -107,7 +107,7 @@ export default {
107107
// 计算勾选的checkbox值合集
108108
checkboxString: function () {
109109
let str = this.checkboxList.join();
110-
return str == '' ? '*' : str;
110+
return str === '' ? '*' : str;
111111
}
112112
}
113113
}

0 commit comments

Comments
 (0)