|
|
|
@ -52,7 +52,7 @@ |
|
|
|
|
<el-row> |
|
|
|
|
<el-col :span="10"> |
|
|
|
|
<el-form-item label="创建时间" class="userRadio"> |
|
|
|
|
<el-radio-group v-model="form.month" @change="itemRadio"> |
|
|
|
|
<el-radio-group v-model="form.month"> |
|
|
|
|
<el-radio v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
@ -60,12 +60,12 @@ |
|
|
|
|
<el-col :span="8"> |
|
|
|
|
<el-form-item label="自定义"> |
|
|
|
|
<el-date-picker v-model="form.date" align="right" unlink-panels type="daterange" |
|
|
|
|
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="selectTime" clearable></el-date-picker> |
|
|
|
|
start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="6"> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-input placeholder="请输入用户姓名/学校名称" prefix-icon="el-icon-search" v-model="form.keyword" clearable @keyup.enter.native="onSearch"></el-input> |
|
|
|
|
<el-input placeholder="请输入用户姓名/学校名称" prefix-icon="el-icon-search" v-model="form.keyword" clearable></el-input> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
</el-row> |
|
|
|
@ -83,7 +83,7 @@ |
|
|
|
|
<span>用户列表</span> |
|
|
|
|
</div> |
|
|
|
|
<div> |
|
|
|
|
<el-button type="primary" size="small" round class="mag" @click="adduser">新增用户</el-button> |
|
|
|
|
<!-- <el-button type="primary" size="small" round @click="adduser">新增用户</el-button> --> |
|
|
|
|
<el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -91,35 +91,32 @@ |
|
|
|
|
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<!-- <el-table-column prop="userAccount" label="用户账号" align="center"> |
|
|
|
|
</el-table-column> --> |
|
|
|
|
<el-table-column prop="userName" label="姓名" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="countries" label="国家" align="center"> |
|
|
|
|
<el-table-column prop="account" label="用户账号" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="provinceName" label="省份" align="center"> |
|
|
|
|
<el-table-column prop="userName" label="姓名" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="cityName" label="城市" align="center"> |
|
|
|
|
<el-table-column prop="schoolName" label="学校" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="schoolName" label="学校名称" align="center"> |
|
|
|
|
<el-table-column prop="platformName" label="来源" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="NewaccountRole" label="账号角色" align="center"> |
|
|
|
|
<el-table-column prop="phone" label="手机号" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="creationTime" label="创建时间" align="center"> |
|
|
|
|
<el-table-column prop="createTime" label="创建时间" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column prop="logInNumber" label="登录次数" align="center"> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
|
<el-table-column label="操作" width="270" align="center"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<!-- <el-button type="text">查看</el-button> --> |
|
|
|
|
<el-button type="text" @click="edit(scope.row)">编辑</el-button> |
|
|
|
|
<el-button type="text" @click="show(scope.row)">查看</el-button> |
|
|
|
|
<!-- <el-button type="text" @click="edit(scope.row)">编辑</el-button> --> |
|
|
|
|
<el-button type="text" @click="handleDelete(scope.row)">删除</el-button> |
|
|
|
|
<el-button type="text" @click="resetPassword(scope.row)">重置密码</el-button> |
|
|
|
|
<el-switch v-model="scope.row.disableAccount" :active-value="0" :inactive-value="1" style="margin: 0 10px 0 5px" :active-text="scope.row.disableAccount ? '禁用' : '启用'" @change="switchOff($event,scope.row,scope.$index)"></el-switch> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
<div class="pagination"> |
|
|
|
|
<el-pagination background @current-change="currentChange" :current-page="pageNo" layout="total, prev, pager, next" :total="totals"> |
|
|
|
|
<el-pagination background @current-change="currentChange" :current-page="page" layout="total, prev, pager, next" :total="totals"> |
|
|
|
|
</el-pagination> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
@ -133,6 +130,8 @@ export default { |
|
|
|
|
name: 'dashboard', |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
platformId: this.$config.platformId, |
|
|
|
|
searchTimer: null, |
|
|
|
|
form: { |
|
|
|
|
name: '', |
|
|
|
|
countries: '中国', |
|
|
|
@ -189,12 +188,38 @@ export default { |
|
|
|
|
id: 12, |
|
|
|
|
name: '1年内' |
|
|
|
|
}], |
|
|
|
|
pageNo: 1, |
|
|
|
|
page: 1, |
|
|
|
|
pageSize: 10, |
|
|
|
|
totals: 1, |
|
|
|
|
multipleSelection: [] |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
|
'form.keyword': function(val) { |
|
|
|
|
clearTimeout(this.searchTimer) |
|
|
|
|
this.searchTimer = setTimeout(() => { |
|
|
|
|
this.initData() |
|
|
|
|
},500) |
|
|
|
|
}, |
|
|
|
|
'form.month': function(val){ |
|
|
|
|
if(val){ |
|
|
|
|
let unit = 24 * 60 * 60 * 1000 |
|
|
|
|
this.form.date = [this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() - unit * 30 * val)),this.formatDate('yyyy-MM-dd',new Date(new Date().getTime() + unit))] |
|
|
|
|
}else{ |
|
|
|
|
this.form.date = [] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
'form.date': function(val){ |
|
|
|
|
if(val.length){ |
|
|
|
|
this.form.startTime = val[0] |
|
|
|
|
this.form.endTime = val[1] |
|
|
|
|
}else{ |
|
|
|
|
this.form.startTime = '' |
|
|
|
|
this.form.endTime = '' |
|
|
|
|
} |
|
|
|
|
this.initData() |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
@ -210,27 +235,19 @@ export default { |
|
|
|
|
endTime: this.form.endTime, |
|
|
|
|
roleId: this.form.accountRole, |
|
|
|
|
searchContent: this.form.keyword, |
|
|
|
|
pageNo: this.pageNo, |
|
|
|
|
pageSize: this.pageSize |
|
|
|
|
platformId: this.platformId, |
|
|
|
|
page: this.page, |
|
|
|
|
size: this.pageSize |
|
|
|
|
} |
|
|
|
|
this.$get(this.api.queryUser,data).then(res => { |
|
|
|
|
res.message.rows.forEach(e => { |
|
|
|
|
if(e.roleId.length > 1) { |
|
|
|
|
let NewaccountRole = [] |
|
|
|
|
let roleIds = e.roleId.split(',') |
|
|
|
|
roleIds.forEach((n,k) => { |
|
|
|
|
NewaccountRole.push(this.roleStatus(n)) |
|
|
|
|
}) |
|
|
|
|
e.NewaccountRole = NewaccountRole.join(',') |
|
|
|
|
}else{ |
|
|
|
|
e.NewaccountRole = this.roleStatus(e.roleId) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
this.userData = res.message.rows |
|
|
|
|
this.totals = res.message.total |
|
|
|
|
this.$get(this.api.queryUserInfoList,data).then(res => { |
|
|
|
|
this.userData = res.message.list |
|
|
|
|
this.totals = res.message.totalCount |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}, |
|
|
|
|
initData(){ |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
// 清除省份 |
|
|
|
|
clearprovince(){ |
|
|
|
|
this.form.city = '', |
|
|
|
@ -240,7 +257,7 @@ export default { |
|
|
|
|
getCity(){ |
|
|
|
|
this.clearprovince() |
|
|
|
|
this.getCityData() |
|
|
|
|
this.pageNo = 1 |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
getCityData(){ |
|
|
|
@ -259,7 +276,7 @@ export default { |
|
|
|
|
getSchool(){ |
|
|
|
|
this.clearcity() |
|
|
|
|
this.getSchoolData() |
|
|
|
|
this.pageNo = 1 |
|
|
|
|
this.page = 1 |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
getSchoolData(){ |
|
|
|
@ -271,30 +288,8 @@ export default { |
|
|
|
|
this.schoolList = res.message |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}, |
|
|
|
|
onSearch(){ |
|
|
|
|
this.pageNo = 1 |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
itemRadio(val){ |
|
|
|
|
this.form.month = val |
|
|
|
|
this.form.date = '' |
|
|
|
|
this.form.startTime = '' |
|
|
|
|
this.form.endTime = '' |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
selectTime(val){ |
|
|
|
|
if(val){ |
|
|
|
|
this.form.startTime = val[0] |
|
|
|
|
this.form.endTime = val[1] |
|
|
|
|
}else{ |
|
|
|
|
this.form.startTime = '' |
|
|
|
|
this.form.endTime = '' |
|
|
|
|
} |
|
|
|
|
this.form.month = '' |
|
|
|
|
this.getData() |
|
|
|
|
}, |
|
|
|
|
currentChange(val) { |
|
|
|
|
this.pageNo = val; |
|
|
|
|
this.page = val; |
|
|
|
|
this.getData(); |
|
|
|
|
}, |
|
|
|
|
permission(){ |
|
|
|
@ -308,19 +303,22 @@ export default { |
|
|
|
|
this.$store.commit("userData", { user_id : row.userId}); |
|
|
|
|
this.$router.push('/adduser'); |
|
|
|
|
}, |
|
|
|
|
show(row){ |
|
|
|
|
this.$store.commit("userData", { user_id : row.userId}); |
|
|
|
|
this.$router.push('/adduser'); |
|
|
|
|
}, |
|
|
|
|
handleDelete(row) { |
|
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
|
type: 'warning' |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
let arr = [] |
|
|
|
|
arr.push(row.userId) |
|
|
|
|
this.$post(this.api.deleteUser,arr).then(res => { |
|
|
|
|
this.$message.success('删除成功'); |
|
|
|
|
}).then(() => { |
|
|
|
|
this.$get(this.api.delUserAccount,{ |
|
|
|
|
userId: row.userId, |
|
|
|
|
isdel: 1 |
|
|
|
|
}).then(res => { |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.getData() |
|
|
|
|
}).catch(res => {}); |
|
|
|
|
}) |
|
|
|
|
.catch(() => {}); |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}).catch(() => {}) |
|
|
|
|
}, |
|
|
|
|
resetPassword(row){ |
|
|
|
|
this.$confirm(`重置后的密码为:${this.$config.initialPassword},确定重置?`, '提示', { |
|
|
|
@ -330,7 +328,7 @@ export default { |
|
|
|
|
userId: row.userId, |
|
|
|
|
} |
|
|
|
|
this.$get(this.api.resetPwd,data).then(res => { |
|
|
|
|
if(res.errmessage == 'success'){ |
|
|
|
|
if(res.message == 'success'){ |
|
|
|
|
this.$message.success('重置成功') |
|
|
|
|
}else{ |
|
|
|
|
this.$message.error('重置失败') |
|
|
|
@ -339,6 +337,16 @@ export default { |
|
|
|
|
}).catch(() => { |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
switchOff(val,row,index) { |
|
|
|
|
let data = { |
|
|
|
|
id: row.id, |
|
|
|
|
isDisable: val |
|
|
|
|
} |
|
|
|
|
this.$post(this.api.updateClient,data).then((res) => { |
|
|
|
|
this.$message.success(val ? '启用成功' : '禁用成功') |
|
|
|
|
}).catch((res) => { |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getRowKeys(row) { |
|
|
|
|
return row.userId; |
|
|
|
|
}, |
|
|
|
|