|
|
@ -52,7 +52,7 @@ |
|
|
|
<el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="10"> |
|
|
|
<el-col :span="10"> |
|
|
|
<el-form-item label="创建时间" class="userRadio"> |
|
|
|
<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 v-for="(item,index) in dateList" :key="index" :label="item.id" border>{{item.name}}</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</el-radio-group> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
@ -60,12 +60,12 @@ |
|
|
|
<el-col :span="8"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="自定义"> |
|
|
|
<el-form-item label="自定义"> |
|
|
|
<el-date-picker v-model="form.date" align="right" unlink-panels type="daterange" |
|
|
|
<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-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item> |
|
|
|
<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-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
@ -83,7 +83,7 @@ |
|
|
|
<span>用户列表</span> |
|
|
|
<span>用户列表</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<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> |
|
|
|
<el-button type="primary" size="small" round @click="delAllSelection">批量删除</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</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="selection" width="55" align="center" :reserve-selection="true"></el-table-column> |
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"> |
|
|
|
<el-table-column type="index" width="100" label="序号" align="center"> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column prop="userAccount" label="用户账号" align="center"> |
|
|
|
<el-table-column prop="account" 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> |
|
|
|
</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> |
|
|
|
<el-table-column prop="cityName" label="城市" align="center"> |
|
|
|
<el-table-column prop="schoolName" label="学校" align="center"> |
|
|
|
</el-table-column> |
|
|
|
</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> |
|
|
|
<el-table-column prop="NewaccountRole" label="账号角色" align="center"> |
|
|
|
<el-table-column prop="phone" label="手机号" align="center"> |
|
|
|
</el-table-column> |
|
|
|
</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> |
|
|
|
<el-table-column prop="logInNumber" label="登录次数" align="center"> |
|
|
|
<el-table-column prop="logInNumber" label="登录次数" align="center"> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" align="center"> |
|
|
|
<el-table-column label="操作" width="270" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<!-- <el-button type="text">查看</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="edit(scope.row)">编辑</el-button> --> |
|
|
|
<el-button type="text" @click="handleDelete(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-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> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-table> |
|
|
|
<div class="pagination"> |
|
|
|
<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> |
|
|
|
</el-pagination> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</el-card> |
|
|
@ -133,6 +130,8 @@ export default { |
|
|
|
name: 'dashboard', |
|
|
|
name: 'dashboard', |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
platformId: this.$config.platformId, |
|
|
|
|
|
|
|
searchTimer: null, |
|
|
|
form: { |
|
|
|
form: { |
|
|
|
name: '', |
|
|
|
name: '', |
|
|
|
countries: '中国', |
|
|
|
countries: '中国', |
|
|
@ -189,12 +188,38 @@ export default { |
|
|
|
id: 12, |
|
|
|
id: 12, |
|
|
|
name: '1年内' |
|
|
|
name: '1年内' |
|
|
|
}], |
|
|
|
}], |
|
|
|
pageNo: 1, |
|
|
|
page: 1, |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 10, |
|
|
|
totals: 1, |
|
|
|
totals: 1, |
|
|
|
multipleSelection: [] |
|
|
|
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() { |
|
|
|
mounted() { |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
@ -210,27 +235,19 @@ export default { |
|
|
|
endTime: this.form.endTime, |
|
|
|
endTime: this.form.endTime, |
|
|
|
roleId: this.form.accountRole, |
|
|
|
roleId: this.form.accountRole, |
|
|
|
searchContent: this.form.keyword, |
|
|
|
searchContent: this.form.keyword, |
|
|
|
pageNo: this.pageNo, |
|
|
|
platformId: this.platformId, |
|
|
|
pageSize: this.pageSize |
|
|
|
page: this.page, |
|
|
|
|
|
|
|
size: this.pageSize |
|
|
|
} |
|
|
|
} |
|
|
|
this.$get(this.api.queryUser,data).then(res => { |
|
|
|
this.$get(this.api.queryUserInfoList,data).then(res => { |
|
|
|
res.message.rows.forEach(e => { |
|
|
|
this.userData = res.message.list |
|
|
|
if(e.roleId.length > 1) { |
|
|
|
this.totals = res.message.totalCount |
|
|
|
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 |
|
|
|
|
|
|
|
}).catch(res => {}); |
|
|
|
}).catch(res => {}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
initData(){ |
|
|
|
|
|
|
|
this.page = 1 |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
}, |
|
|
|
// 清除省份 |
|
|
|
// 清除省份 |
|
|
|
clearprovince(){ |
|
|
|
clearprovince(){ |
|
|
|
this.form.city = '', |
|
|
|
this.form.city = '', |
|
|
@ -240,7 +257,7 @@ export default { |
|
|
|
getCity(){ |
|
|
|
getCity(){ |
|
|
|
this.clearprovince() |
|
|
|
this.clearprovince() |
|
|
|
this.getCityData() |
|
|
|
this.getCityData() |
|
|
|
this.pageNo = 1 |
|
|
|
this.page = 1 |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
getCityData(){ |
|
|
|
getCityData(){ |
|
|
@ -259,7 +276,7 @@ export default { |
|
|
|
getSchool(){ |
|
|
|
getSchool(){ |
|
|
|
this.clearcity() |
|
|
|
this.clearcity() |
|
|
|
this.getSchoolData() |
|
|
|
this.getSchoolData() |
|
|
|
this.pageNo = 1 |
|
|
|
this.page = 1 |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
getSchoolData(){ |
|
|
|
getSchoolData(){ |
|
|
@ -271,30 +288,8 @@ export default { |
|
|
|
this.schoolList = res.message |
|
|
|
this.schoolList = res.message |
|
|
|
}).catch(res => {}); |
|
|
|
}).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) { |
|
|
|
currentChange(val) { |
|
|
|
this.pageNo = val; |
|
|
|
this.page = val; |
|
|
|
this.getData(); |
|
|
|
this.getData(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
permission(){ |
|
|
|
permission(){ |
|
|
@ -308,19 +303,22 @@ export default { |
|
|
|
this.$store.commit("userData", { user_id : row.userId}); |
|
|
|
this.$store.commit("userData", { user_id : row.userId}); |
|
|
|
this.$router.push('/adduser'); |
|
|
|
this.$router.push('/adduser'); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
show(row){ |
|
|
|
|
|
|
|
this.$store.commit("userData", { user_id : row.userId}); |
|
|
|
|
|
|
|
this.$router.push('/adduser'); |
|
|
|
|
|
|
|
}, |
|
|
|
handleDelete(row) { |
|
|
|
handleDelete(row) { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
this.$confirm('确定要删除吗?', '提示', { |
|
|
|
type: 'warning' |
|
|
|
type: 'warning' |
|
|
|
}) |
|
|
|
}).then(() => { |
|
|
|
.then(() => { |
|
|
|
this.$get(this.api.delUserAccount,{ |
|
|
|
let arr = [] |
|
|
|
userId: row.userId, |
|
|
|
arr.push(row.userId) |
|
|
|
isdel: 1 |
|
|
|
this.$post(this.api.deleteUser,arr).then(res => { |
|
|
|
}).then(res => { |
|
|
|
this.$message.success('删除成功'); |
|
|
|
this.$message.success('删除成功') |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}).catch(res => {}); |
|
|
|
}).catch(res => {}) |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
.catch(() => {}); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
resetPassword(row){ |
|
|
|
resetPassword(row){ |
|
|
|
this.$confirm(`重置后的密码为:${this.$config.initialPassword},确定重置?`, '提示', { |
|
|
|
this.$confirm(`重置后的密码为:${this.$config.initialPassword},确定重置?`, '提示', { |
|
|
@ -330,7 +328,7 @@ export default { |
|
|
|
userId: row.userId, |
|
|
|
userId: row.userId, |
|
|
|
} |
|
|
|
} |
|
|
|
this.$get(this.api.resetPwd,data).then(res => { |
|
|
|
this.$get(this.api.resetPwd,data).then(res => { |
|
|
|
if(res.errmessage == 'success'){ |
|
|
|
if(res.message == 'success'){ |
|
|
|
this.$message.success('重置成功') |
|
|
|
this.$message.success('重置成功') |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
this.$message.error('重置失败') |
|
|
|
this.$message.error('重置失败') |
|
|
@ -339,6 +337,16 @@ export default { |
|
|
|
}).catch(() => { |
|
|
|
}).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) { |
|
|
|
getRowKeys(row) { |
|
|
|
return row.userId; |
|
|
|
return row.userId; |
|
|
|
}, |
|
|
|
}, |
|
|
|