Skip to content

Commit 6510283

Browse files
committed
1.代码逐步优化
1 parent 0790975 commit 6510283

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/components/page/UserManage.vue

+13-13
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
:picker-options="pickerOptions2">
1414
</el-date-picker>
1515
-
16-
1716
<el-date-picker
1817
v-model="filters.endTime"
1918
type="date"
@@ -23,7 +22,6 @@
2322
:picker-options="pickerOptions2">
2423
</el-date-picker>
2524
|
26-
2725
<el-input v-model="filters.userId" placeholder="tel/userId/SeqId"
2826
style="width: 20%;"></el-input>
2927
<el-button type="primary" v-on:click="getUserList">查询</el-button>
@@ -290,8 +288,8 @@
290288
},
291289
formattedConstellation(index) {
292290
293-
let constellationStrings = ["白羊", "金牛", "双子", "巨蟹", "狮子"
294-
, "处女", "天秤", "天蝎", "射手", "摩羯", "水瓶", "双鱼", "双鱼"];
291+
let constellationStrings = ["白羊座", "金牛座", "双子座", "巨蟹座", "狮子座"
292+
, "处女座", "天秤座", "天蝎座", "射手座", "摩羯座", "水瓶座", "双鱼座", "双鱼座"];
295293
return constellationStrings[index];
296294
297295
},
@@ -418,27 +416,29 @@
418416
//获取消息记录信息
419417
getUserList() {
420418
419+
let _this = this;
420+
421421
let userIdParam = ''
422422
423-
if (this.filters.userId) {
423+
if (_this.filters.userId) {
424424
userIdParam = ''
425-
if (this.filters.userId.match(this.regex.userIdRe)) {
426-
userIdParam = '"userId":"' + this.filters.userId + '"'
427-
} else if (this.filters.userId.match(this.regex.seqIdRe)) {
428-
userIdParam = '"seqid":' + this.filters.userId
429-
} else if (this.filters.userId.match(this.regex.tel)) {
430-
userIdParam = '"telphone":"' + this.filters.userId + '"'
425+
if (_this.filters.userId.match(_this.regex.userIdRe)) {
426+
userIdParam = '"userId":"' + _this.filters.userId + '"'
427+
} else if (_this.filters.userId.match(_this.regex.seqIdRe)) {
428+
userIdParam = '"seqid":' + _this.filters.userId
429+
} else if (this.filters.userId.match(_this.regex.tel)) {
430+
userIdParam = '"telphone":"' + _this.filters.userId + '"'
431431
}
432432
else {
433-
this.$message({
433+
_this.$message({
434434
message: '参数格式校验失败',
435435
type: 'error'
436436
});
437437
return
438438
}
439439
}
440440
441-
let dateParam = ('' != this.filters.beginTime && '' != this.filters.endTime ) ? '"_created":{"$gt":"' + moment(this.filters.beginTime).format('YYYY-MM-DD 0:0:0') + '","$lt":"' + moment(this.filters.endTime).format('YYYY-MM-DD 0:0:0') + '"}}' : '}';
441+
let dateParam = ('' != _this.filters.beginTime && '' != _this.filters.endTime ) ? '"_created":{"$gt":"' + moment(_this.filters.beginTime).subtract(8,'hours').format('YYYY-MM-DD HH:mm:ss') + '","$lt":"' + moment(_this.filters.endTime).add(16, 'hours').format('YYYY-MM-DD HH:mm:ss') + '"}}' : '}';
442442
443443
if ('' !== userIdParam) {
444444
if ('}' === dateParam) {

0 commit comments

Comments
 (0)