首页新版开发跳转
This commit is contained in:
@@ -21,6 +21,9 @@
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="getUserList">查询</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="success" @click="addUserInfo"><i class="el-icon-plus"></i> 添加</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="padding: 10px;" v-loading="searchLoading">
|
||||
<el-table :data="searchResultList" border style="width: 100%; margin-bottom: 5px;" max-height="500">
|
||||
@@ -34,13 +37,12 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="creationTime" label="创建时间"></el-table-column>
|
||||
<el-table-column label="状态">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-on:change="delFlagChange" v-model="scope.row.delFlag" :active-value="0" active-text="正常" :inactive-value="1" inactive-text="停用"></el-switch>
|
||||
</template>
|
||||
<template slot-scope="scope">{{scope.row.delFlag==0?'正常':'停用'}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="240">
|
||||
<el-table-column label="操作" width="300">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" plain type="primary" v-on:click="editUserInfo(scope.row)">修改</el-button>
|
||||
<el-button size="mini" plain type="success" v-on:click="editUserAuthFun(scope.row)">权限</el-button>
|
||||
<el-button size="mini" plain type="warning" v-on:click="resetPassword(scope.row)">重置密码</el-button>
|
||||
<el-button size="mini" plain type="danger" v-on:click="deleteUser(scope.row)">删除</el-button>
|
||||
</template>
|
||||
@@ -59,8 +61,28 @@
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
<!--修改用户权限弹窗-->
|
||||
<el-dialog title="权限编辑" :visible.sync="editUserAuthDialogVisible" width="600px">
|
||||
<el-form ref="form" label-width="80px">
|
||||
<el-form-item label="账号">
|
||||
<el-input v-model="editUserForm.userNo" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户名">
|
||||
<el-input v-model="editUserForm.userName" disabled></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="权限">
|
||||
<el-select v-model="editUserAuth" multiple filterable placeholder="请选择" style="width: 100%;">
|
||||
<el-option v-for="item in allUserAuth" :key="item.id" :label="item.authDesc" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="editUserAuthSave">确定</el-button>
|
||||
<el-button @click="editUserAuthDialogVisible = false">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
<!--修改用户弹窗-->
|
||||
<el-dialog title="修改用户" :visible.sync="editUserDialogVisible" width="600px">
|
||||
<el-dialog :title="editUserForm.id > 0 ? '修改用户':'创建用户'" :visible.sync="editUserDialogVisible" width="600px">
|
||||
<el-form ref="form" :model="editUserForm" label-width="80px">
|
||||
<el-form-item label="账号">
|
||||
<el-input v-model="editUserForm.userNo"></el-input>
|
||||
@@ -74,17 +96,21 @@
|
||||
<el-form-item label="邮箱">
|
||||
<el-input v-model="editUserForm.email"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-switch v-model="editUserForm.delFlag" :active-value="0" active-text="正常" :inactive-value="2" inactive-text="停用"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="性别">
|
||||
<el-radio-group v-model="editUserForm.sex">
|
||||
<el-radio :label="1">男</el-radio>
|
||||
<el-radio :label="0">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色">
|
||||
<el-select v-model="editUserForm.role" multiple filterable placeholder="请选择">
|
||||
<el-option v-for="item in roleOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- 先不做角色,想清楚了再做-->
|
||||
<!-- <el-form-item label="角色">-->
|
||||
<!-- <el-select v-model="editUserForm.role" multiple filterable placeholder="请选择">-->
|
||||
<!-- <el-option v-for="item in roleOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="updateEditUser">确定</el-button>
|
||||
<el-button @click="editUserDialogVisible = false">取消</el-button>
|
||||
@@ -103,6 +129,7 @@
|
||||
return {
|
||||
searchLoading: false,
|
||||
editUserDialogVisible: false,
|
||||
editUserAuthDialogVisible: false,
|
||||
totalCount: 0,
|
||||
searchParam: {
|
||||
type: 1,
|
||||
@@ -115,6 +142,8 @@
|
||||
{value: '管理员'}
|
||||
],
|
||||
editUserForm: {},
|
||||
allUserAuth: [],
|
||||
editUserAuth: [],
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
@@ -130,9 +159,39 @@
|
||||
this.searchParam.pageNum = val;
|
||||
this.getUserList();
|
||||
},
|
||||
editUserAuthFun(row) {
|
||||
app.allUserAuth = [];
|
||||
app.editUserAuth = [];
|
||||
var param = {userIds: row.id};
|
||||
this.common.post(this.apilist1.userAuthList, param, function (json) {
|
||||
app.editUserAuth = [];
|
||||
app.allUserAuth = json.data;
|
||||
app.editUserAuthDialogVisible = true;
|
||||
app.editUserForm = JSON.parse(JSON.stringify(row));
|
||||
for (var i = 0; i < app.allUserAuth.length; i++) {
|
||||
if (app.allUserAuth[i].checked == 1) {
|
||||
app.editUserAuth.push(app.allUserAuth[i].id);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
editUserAuthSave() {
|
||||
var param = {
|
||||
userIds: this.editUserForm.id,
|
||||
authIds: this.editUserAuth.join(","),
|
||||
};
|
||||
this.common.post(this.apilist1.updateUserAuth, param, function (json) {
|
||||
toast.success("保存成功!");
|
||||
app.editUserAuthDialogVisible = false;
|
||||
});
|
||||
},
|
||||
editUserInfo(row) {
|
||||
app.editUserDialogVisible = true;
|
||||
app.editUserForm = JSON.parse(JSON.stringify(row));
|
||||
},
|
||||
addUserInfo() {
|
||||
this.editUserDialogVisible = true;
|
||||
this.editUserForm = row;
|
||||
this.editUserForm = {};
|
||||
},
|
||||
resetPassword(row) {
|
||||
this.$confirm('确定要重置此用户密码吗?', '提示', {
|
||||
@@ -140,7 +199,7 @@
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.editUserForm = row;
|
||||
this.editUserForm = JSON.parse(JSON.stringify(row));
|
||||
this.common.post(this.apilist1.resetPassword, this.editUserForm, function (json) {
|
||||
app.$confirm("重置成功!新的密码为:" + json.data).then(()=> {
|
||||
done();
|
||||
@@ -148,19 +207,17 @@
|
||||
});
|
||||
}).catch(()=>{});
|
||||
},
|
||||
delFlagChange(row, xx) {
|
||||
debugger
|
||||
// this.editUserForm = row;
|
||||
},
|
||||
deleteUser(row) {
|
||||
this.$confirm('确定要删除此用户吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.editUserForm = row;
|
||||
this.editUserForm.delFlag = 1;
|
||||
this.updateEditUser();
|
||||
this.editUserForm = JSON.parse(JSON.stringify(row));
|
||||
this.common.post(this.apilist1.deleteUserInfo, this.editUserForm, function (json) {
|
||||
toast.success("删除成功!");
|
||||
app.getUserList();
|
||||
});
|
||||
}).catch(()=>{});
|
||||
},
|
||||
updateEditUser() {
|
||||
|
||||
@@ -68,58 +68,12 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
totalCount: 0,
|
||||
searchParam: {
|
||||
spaceId: '',
|
||||
newsType: 1,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
},
|
||||
spacePageNews:[],
|
||||
newsTypes:["最近更新", "最新创建", "查看最多", "点赞最多", "查看+点赞最多"],
|
||||
};
|
||||
},
|
||||
beforeRouteUpdate(to, from, next) {
|
||||
this.initQueryParam(to);
|
||||
next();
|
||||
},
|
||||
mounted: function () {
|
||||
this.initQueryParam(this.$route);
|
||||
app = this;
|
||||
},
|
||||
methods: {
|
||||
getSpacePageNews() {
|
||||
this.common.post(this.apilist1.pageNews, this.searchParam, function (json) {
|
||||
app.spacePageNews = json.data || [];
|
||||
app.totalCount = json.total;
|
||||
});
|
||||
},
|
||||
jumpToDocPage(val) {
|
||||
window.open(val);
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.searchParam.pageSize = val;
|
||||
this.getSpacePageNews();
|
||||
},
|
||||
showPageDetail(row) {
|
||||
this.nowClickPath = {spaceId: row.spaceId, pageId: row.pageId};
|
||||
this.$router.push({path: '/page/show', query: this.nowClickPath});
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.searchParam.pageNum = val;
|
||||
this.getSpacePageNews();
|
||||
},
|
||||
initQueryParam(to) {
|
||||
this.searchParam = {
|
||||
spaceId: to.query.spaceId,
|
||||
newsType: 1,
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
};
|
||||
if (!!this.searchParam.spaceId) {
|
||||
this.getSpacePageNews();
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
49
zyplayer-doc-ui/console-ui/src/views/user/MyInfo.vue
Normal file
49
zyplayer-doc-ui/console-ui/src/views/user/MyInfo.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<template>
|
||||
<div class="my-info-vue">
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right" style="padding: 20px 10px;">
|
||||
<el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
|
||||
<el-breadcrumb-item>我的信息</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
<div style="margin: 0 auto;max-width: 1000px;">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">我的信息</div>
|
||||
<el-form class="search-form-box" label-width="100px">
|
||||
<el-form-item label="账号:">{{userInfo.userNo}}</el-form-item>
|
||||
<el-form-item label="用户名:">{{userInfo.userName}}</el-form-item>
|
||||
<el-form-item label="手机号:">{{userInfo.phone}}</el-form-item>
|
||||
<el-form-item label="邮箱:">{{userInfo.email}}</el-form-item>
|
||||
<el-form-item label="状态:">{{userInfo.delFlag==0?'正常':'停用'}}</el-form-item>
|
||||
<el-form-item label="性别:">{{userInfo.sex==0?'女':'男'}}</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var app;
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
userInfo: {}
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
app = this;
|
||||
this.getUserInfo();
|
||||
},
|
||||
methods: {
|
||||
getUserInfo() {
|
||||
this.common.post(this.apilist1.getSelfUserInfo, this.searchParam, function (json) {
|
||||
app.userInfo = json.data;
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.my-info-vue{}
|
||||
.my-info-vue .box-card{margin: 10px;}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user