用户信息
This commit is contained in:
parent
e98f0ecf1b
commit
e4a5f358d0
|
@ -1,5 +1,4 @@
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import qs from 'qs';
|
|
||||||
if (process.env.NODE_ENV === 'development') {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
axios.defaults.baseURL = '/';
|
axios.defaults.baseURL = '/';
|
||||||
} else if (process.env.NODE_ENV === 'production') {
|
} else if (process.env.NODE_ENV === 'production') {
|
||||||
|
@ -11,3 +10,15 @@ export const getZhanghData = params => {
|
||||||
params
|
params
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
//获取角色下拉
|
||||||
|
export const getRoleApi = params => {
|
||||||
|
return axios.get('api/GetJues', {
|
||||||
|
params
|
||||||
|
});
|
||||||
|
};
|
||||||
|
//删除角色
|
||||||
|
export const deleteRoleApi = params => {
|
||||||
|
return axios.get(`api/DeleteZhangh?UserId=${params}`, {
|
||||||
|
params
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
import axios from 'axios';
|
||||||
|
if (process.env.NODE_ENV === 'development') {
|
||||||
|
axios.defaults.baseURL = '/';
|
||||||
|
} else if (process.env.NODE_ENV === 'production') {
|
||||||
|
axios.defaults.baseURL = '/';
|
||||||
|
}
|
||||||
|
//获取用户信息
|
||||||
|
export const getUserApi = params => {
|
||||||
|
return axios.get('api/GetZhanghDetails', {
|
||||||
|
params
|
||||||
|
});
|
||||||
|
};
|
|
@ -1,33 +1,36 @@
|
||||||
var ipUurl = window.location.host.split(":")[0];
|
var ipUurl = window.location.host.split(':')[0];
|
||||||
export default {
|
export default {
|
||||||
// dataUrl: "http://172.16.1.22:8080/api/AddShipjk",
|
// dataUrl: "http://172.16.1.22:8080/api/AddShipjk",
|
||||||
// getSpareElementOrder: "http://172.16.1.22:8080/api/Upload",
|
// getSpareElementOrder: "http://172.16.1.22:8080/api/Upload",
|
||||||
// postSetQuanjsz: "http://172.16.1.22:8080/api/SetQuanjsz",
|
// postSetQuanjsz: "http://172.16.1.22:8080/api/SetQuanjsz",
|
||||||
// //新增图形接口
|
// //新增图形接口
|
||||||
// addFigure: "http://172.16.1.22:8080/api/AddJianktx",
|
// addFigure: "http://172.16.1.22:8080/api/AddJianktx",
|
||||||
// //编辑图形名称
|
// //编辑图形名称
|
||||||
// editFigure: "http://172.16.1.22:8080/api/EditTuxmc",
|
// editFigure: "http://172.16.1.22:8080/api/EditTuxmc",
|
||||||
// //编辑保存组件弹窗传参
|
// //编辑保存组件弹窗传参
|
||||||
// editComponent: "http://172.16.1.22:8080/api/SetMonqjkzjcs",
|
// editComponent: "http://172.16.1.22:8080/api/SetMonqjkzjcs",
|
||||||
|
|
||||||
|
dataUrl: 'http://172.16.1.168:5000/api/AddShipjk',
|
||||||
|
getSpareElementOrder: 'http://172.16.1.168:5000/api/Upload',
|
||||||
|
postSetQuanjsz: 'http://172.16.1.168:5000/api/SetQuanjsz',
|
||||||
|
saveRoleApi: 'http://172.16.1.168:5000/api/AddZhangh',
|
||||||
|
editRoleApi: 'http://172.16.1.168:5000/api/EditZhangh',
|
||||||
|
|
||||||
dataUrl: "http://172.16.1.168:5000/api/AddShipjk",
|
//新增图形接口
|
||||||
getSpareElementOrder: "http://172.16.1.168:5000/api/Upload",
|
addFigure: 'http://172.16.1.168:5000/api/AddJianktx',
|
||||||
postSetQuanjsz: "http://172.16.1.168:5000/api/SetQuanjsz",
|
//编辑图形名称
|
||||||
//新增图形接口
|
editFigure: 'http://172.16.1.168:5000/api/EditTuxmc',
|
||||||
addFigure: "http://172.16.1.168:5000/api/AddJianktx",
|
//编辑保存组件弹窗传参
|
||||||
//编辑图形名称
|
editComponent: 'http://172.16.1.168:5000/api/SetMonqjkzjcs'
|
||||||
editFigure: "http://172.16.1.168:5000/api/EditTuxmc",
|
|
||||||
//编辑保存组件弹窗传参
|
// `http://${ipUurl}:5000/api/AddShipjk`
|
||||||
editComponent: "http://172.16.1.168:5000/api/SetMonqjkzjcs",
|
// dataUrl: `http://${ipUurl}:5000/api/AddShipjk`,
|
||||||
// `http://${ipUurl}:5000/api/AddShipjk`
|
// getSpareElementOrder: `http://${ipUurl}:5000/api/Upload`,
|
||||||
// dataUrl: `http://${ipUurl}:5000/api/AddShipjk`,
|
// postSetQuanjsz: `http://${ipUurl}:5000/api/SetQuanjsz`,
|
||||||
// getSpareElementOrder: `http://${ipUurl}:5000/api/Upload`,
|
// //新增图形接口
|
||||||
// postSetQuanjsz: `http://${ipUurl}:5000/api/SetQuanjsz`,
|
// addFigure: `http://${ipUurl}:5000/api/AddJianktx`,
|
||||||
// //新增图形接口
|
// //编辑图形名称
|
||||||
// addFigure: `http://${ipUurl}:5000/api/AddJianktx`,
|
// editFigure: `http://${ipUurl}:5000/api/EditTuxmc`,
|
||||||
// //编辑图形名称
|
// //编辑保存组件弹窗传参
|
||||||
// editFigure: `http://${ipUurl}:5000/api/EditTuxmc`,
|
// editComponent: `http://${ipUurl}:5000/api/SetMonqjkzjcs`,
|
||||||
// //编辑保存组件弹窗传参
|
|
||||||
// editComponent: `http://${ipUurl}:5000/api/SetMonqjkzjcs`,
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,11 +16,11 @@
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div class="unforget" style="margin-left:15px">
|
<div class="unforget" style="margin-left:15px">
|
||||||
<el-checkbox v-model="checked">保存登录</el-checkbox>
|
<el-checkbox v-model="checked">保存登录</el-checkbox>
|
||||||
</div>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div class="login-btn">
|
<div class="login-btn">
|
||||||
<el-button type="primary" @click="submitForm()">登录</el-button>
|
<el-button type="primary" @click="submitForm()">登录</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -54,19 +54,18 @@ export default {
|
||||||
telephone: '13088888888',
|
telephone: '13088888888',
|
||||||
typeCode: 2
|
typeCode: 2
|
||||||
};
|
};
|
||||||
loginApi(datas).then((res) => {
|
loginApi(datas).then(res => {
|
||||||
console.log('c', res);
|
console.log('c', res);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
submitForm() {
|
submitForm() {
|
||||||
this.$refs.login.validate((valid) => {
|
this.$refs.login.validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.$message.success('登录成功');
|
this.$message.success('登录成功');
|
||||||
localStorage.setItem('ms_username', this.param.username);
|
localStorage.setItem('ms_username', this.param.username);
|
||||||
this.$router.push('/');
|
this.$router.push('/');
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('请输入账号和密码');
|
this.$message.error('请输入账号和密码');
|
||||||
console.log('error submit!!');
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -76,28 +75,28 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
/deep/ .el-form-item__label{
|
/deep/ .el-form-item__label {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
&::before{
|
&::before {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/deep/ .el-input{
|
/deep/ .el-input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
border: 1px solid rgb(231, 231, 231);
|
border: 1px solid rgb(231, 231, 231);
|
||||||
.el-input-group__prepend{
|
.el-input-group__prepend {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
.el-input__inner{
|
.el-input__inner {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.login-wrap {
|
.login-wrap {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -128,31 +127,29 @@ export default {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column nowrap;
|
flex-flow: column nowrap;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.welcome{
|
.welcome {
|
||||||
margin-top: 28px;
|
margin-top: 28px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
// color: black;
|
// color: black;
|
||||||
}
|
}
|
||||||
.ms-content{
|
.ms-content {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
margin-top: 25px;
|
margin-top: 25px;
|
||||||
}
|
}
|
||||||
.login-btn{
|
.login-btn {
|
||||||
width: 80%;
|
width: 80%;
|
||||||
margin-top: 45px;
|
margin-top: 45px;
|
||||||
/deep/ .el-button {
|
/deep/ .el-button {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
span{
|
span {
|
||||||
letter-spacing: 15px;
|
letter-spacing: 15px;
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,11 @@
|
||||||
<div class="content-box">
|
<div class="content-box">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<p class="title">账号管理</p>
|
<p class="title">账号管理</p>
|
||||||
<el-button @click="addAccountDialog = true" type="primary" style="margin-bottom: 10px;"
|
<el-button @click="addBtn" type="primary" style="margin-bottom: 10px;"
|
||||||
><i class="el-icon-circle-plus-outline" style="margin-right: 3px;"></i>新增</el-button
|
><i class="el-icon-circle-plus-outline" style="margin-right: 3px;"></i>新增</el-button
|
||||||
>
|
>
|
||||||
<el-table :data="tableData" :height="tableHeight" border style="width: 100%">
|
<el-table :data="tableData" :height="tableHeight" border style="width: 100%">
|
||||||
|
<el-table-column align="center" label="序号" type="index" width="80"></el-table-column>
|
||||||
<el-table-column align="center" prop="userName" label="用户名称" width="180"></el-table-column>
|
<el-table-column align="center" prop="userName" label="用户名称" width="180"></el-table-column>
|
||||||
<el-table-column align="center" prop="account" label="用户账号" width="180"></el-table-column>
|
<el-table-column align="center" prop="account" label="用户账号" width="180"></el-table-column>
|
||||||
<el-table-column align="center" prop="roleName" label="角色"></el-table-column>
|
<el-table-column align="center" prop="roleName" label="角色"></el-table-column>
|
||||||
|
@ -17,29 +18,44 @@
|
||||||
<el-table-column align="center" label="操作" width="160">
|
<el-table-column align="center" label="操作" width="160">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button @click="edit(scope.row)" type="text" size="small" class="">编辑</el-button>
|
<el-button @click="edit(scope.row)" type="text" size="small" class="">编辑</el-button>
|
||||||
<!-- <el-button @click="showView(scope.row)" type="text" size="small" class="el-icon-view"></el-button> -->
|
<el-button style="color:red" @click="clickDelete(scope.row)" type="text" size="small">删除</el-button>
|
||||||
<el-button @click="clickDelete(scope.row)" type="text" size="small">删除</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<div class="dialog">
|
<div class="dialog">
|
||||||
<el-dialog :title="dialogTitle" :visible.sync="addAccountDialog" width="30%">
|
<el-dialog :title="dialogTitle" :visible.sync="addAccountDialog" width="30%" @close="dialogClose">
|
||||||
<el-form label-position="left" label-width="80px" :model="formLabelAlign">
|
<el-form label-position="left" label-width="100px" :model="formLabelAlign">
|
||||||
<el-form-item label="名称:">
|
<el-form-item label="名称:">
|
||||||
<el-input v-model="formLabelAlign.name"></el-input>
|
<el-input v-model="formLabelAlign.userName"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="账号:">
|
<el-form-item label="账号:">
|
||||||
<el-input v-model="formLabelAlign.account"></el-input>
|
<el-input :disabled="dialogTitle == '编辑'" v-model="formLabelAlign.account"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="密码:">
|
||||||
|
<el-input v-model="formLabelAlign.passWord"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="角色:">
|
<el-form-item label="角色:">
|
||||||
<el-input v-model="formLabelAlign.role"></el-input>
|
<el-select
|
||||||
|
:disabled="dialogTitle == '编辑' && formLabelAlign.userName == 'admin'"
|
||||||
|
clearable
|
||||||
|
style="width:100%;"
|
||||||
|
v-model="formLabelAlign.roleId"
|
||||||
|
placeholder="请选择"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in options" :key="item.roleId" :label="item.roleName" :value="item.roleId">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="权限:">
|
<el-form-item label="是否启用:">
|
||||||
<el-input v-model="formLabelAlign.jurisdiction"></el-input>
|
<el-radio-group v-model="formLabelAlign.IsEnable">
|
||||||
|
<el-radio :label="'1'">启用</el-radio>
|
||||||
|
<el-radio :label="'0'">禁用</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="addAccountDialog = false">确 定</el-button>
|
<el-button type="primary" @click="saveBtn">确定</el-button>
|
||||||
|
<el-button @click="addAccountDialog = false">取消</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
@ -48,16 +64,20 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getZhanghData } from '@/api/management';
|
import axios from 'axios';
|
||||||
|
import { getZhanghData, getRoleApi, deleteRoleApi } from '@/api/management';
|
||||||
|
import serverUrl from '@/config/apiurl.js';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
options: [],
|
||||||
addAccountDialog: false,
|
addAccountDialog: false,
|
||||||
formLabelAlign: {
|
formLabelAlign: {
|
||||||
name: '',
|
userName: '',
|
||||||
account: '',
|
account: '',
|
||||||
role: '',
|
roleId: '',
|
||||||
jurisdiction: ''
|
IsEnable: '1',
|
||||||
|
passWord: ''
|
||||||
},
|
},
|
||||||
tableData: [],
|
tableData: [],
|
||||||
tableHeight: 0,
|
tableHeight: 0,
|
||||||
|
@ -72,26 +92,119 @@ export default {
|
||||||
let windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
|
let windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
|
||||||
this.tableHeight = windowHeight - 280;
|
this.tableHeight = windowHeight - 280;
|
||||||
this.getData();
|
this.getData();
|
||||||
|
//角色
|
||||||
|
this.getRoleList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getData() {
|
//点击新增按钮
|
||||||
getZhanghData().then(res => {
|
addBtn() {
|
||||||
console.log(res);
|
this.dialogTitle = '新增';
|
||||||
this.tableData = res.data.data;
|
this.addAccountDialog = true;
|
||||||
|
},
|
||||||
|
//弹框关闭
|
||||||
|
dialogClose() {
|
||||||
|
for (let i in this.formLabelAlign) {
|
||||||
|
if (i == 'IsEnable') {
|
||||||
|
this.formLabelAlign[i] = '1';
|
||||||
|
} else {
|
||||||
|
this.formLabelAlign[i] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//点击确定
|
||||||
|
saveBtn() {
|
||||||
|
let formData = new FormData();
|
||||||
|
formData.append('userName', this.formLabelAlign.userName);
|
||||||
|
formData.append('account', this.formLabelAlign.account);
|
||||||
|
formData.append('roleId', this.formLabelAlign.roleId);
|
||||||
|
formData.append('IsEnable', this.formLabelAlign.IsEnable);
|
||||||
|
formData.append('passWord', this.formLabelAlign.passWord);
|
||||||
|
if (this.dialogTitle === '编辑') {
|
||||||
|
formData.append('userId', this.formLabelAlign.userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
axios({
|
||||||
|
method: 'post',
|
||||||
|
url: this.dialogTitle === '新增' ? serverUrl.saveRoleApi : serverUrl.editRoleApi,
|
||||||
|
data: formData
|
||||||
|
}).then(res => {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
this.$message({
|
||||||
|
message: res.data.msg,
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
this.addAccountDialog = false;
|
||||||
|
this.getData();
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
message: res.data.msg,
|
||||||
|
type: 'warning'
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
edit(scope) {
|
//角色下拉
|
||||||
console.log(scope, '编辑');
|
getRoleList() {
|
||||||
|
var _this = this;
|
||||||
|
getRoleApi()
|
||||||
|
.then(res => {
|
||||||
|
_this.options = res.data.data;
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
_this.$message.error(err.msg);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//表格数据
|
||||||
|
getData() {
|
||||||
|
getZhanghData()
|
||||||
|
.then(res => {
|
||||||
|
this.tableData = res.data.data;
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
_this.$message.error(err.msg);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
edit(row) {
|
||||||
|
this.formLabelAlign.roleId = row.roleId;
|
||||||
|
this.formLabelAlign.IsEnable = row.isEnable;
|
||||||
|
this.formLabelAlign.userName = row.userName;
|
||||||
|
this.formLabelAlign.account = row.account;
|
||||||
|
this.formLabelAlign.userId = row.userId;
|
||||||
this.dialogTitle = '编辑';
|
this.dialogTitle = '编辑';
|
||||||
this.addAccountDialog = true;
|
this.addAccountDialog = true;
|
||||||
},
|
},
|
||||||
showView(scope) {
|
showView(scope) {
|
||||||
console.log(scope, '查看');
|
|
||||||
this.dialogTitle = '查看';
|
this.dialogTitle = '查看';
|
||||||
this.addAccountDialog = true;
|
this.addAccountDialog = true;
|
||||||
},
|
},
|
||||||
clickDelete(scope) {
|
clickDelete(row) {
|
||||||
console.log(scope, '删除');
|
this.$confirm('此操作将永久删除该角色, 是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
deleteRoleApi(row.userId).then(res => {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '删除成功!'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: res.data.msg
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.getData();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消删除'
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
console.log(`每页 ${val} 条`);
|
console.log(`每页 ${val} 条`);
|
||||||
|
|
|
@ -1,99 +1,214 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="content-box">
|
<div class="content-box">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<p class="title">通知/日志</p>
|
<p class="title">通知/日志</p>
|
||||||
<!-- <div class="test-div">
|
<el-form ref="form" :model="formData" label-width="100px" style="display:flex">
|
||||||
<i class="el-icon-edit"></i>
|
<el-form-item label="日期:">
|
||||||
<i class="el-icon-share"></i>
|
<el-date-picker
|
||||||
<i class="el-icon-delete"></i>
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
</div> -->
|
size="small"
|
||||||
<el-table :data="tableData" :height="tableHeight" border style="width: 100%">
|
v-model="formData.value1"
|
||||||
<el-table-column align="center" prop="date" label="通知类型" width="180"></el-table-column>
|
type="datetimerange"
|
||||||
<el-table-column align="center" prop="name" label="产生时机" width="180"></el-table-column>
|
range-separator="至"
|
||||||
<el-table-column align="center" prop="address" label="内容"></el-table-column>
|
start-placeholder="开始日期"
|
||||||
<el-table-column align="center" label="操作" width="160">
|
end-placeholder="结束日期"
|
||||||
<template slot-scope="scope">
|
>
|
||||||
<el-button @click="download(scope.row)" type="text" size="small" class="">下载</el-button>
|
</el-date-picker>
|
||||||
<el-button @click="showView(scope.row)" type="text" size="small" class="el-icon-view"></el-button>
|
</el-form-item>
|
||||||
<el-button @click="clickDelete(scope.row)" type="text" size="small" class="el-icon-delete"></el-button>
|
<el-form-item label="内容:">
|
||||||
</template>
|
<el-input size="small" v-model="formData.content"></el-input>
|
||||||
</el-table-column>
|
</el-form-item>
|
||||||
</el-table>
|
<el-form-item label="通知类型:">
|
||||||
|
<el-select size="small" clearable style="width:100%;" v-model="formData.notificationType" placeholder="请选择">
|
||||||
|
<el-option v-for="item in options" :key="item.name" :label="item.name" :value="item.name"> </el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button @click="lookForMessage" type="primary" size="small">查询</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<el-table :data="tableData" :height="tableHeight" border style="width: 100%">
|
||||||
|
<el-table-column align="center" prop="notificationType" label="通知类型" width="180"></el-table-column>
|
||||||
|
<el-table-column align="center" prop="journalTime" label="产生时机" width="180"></el-table-column>
|
||||||
|
<el-table-column show-overflow-tooltip align="center" prop="content" label="内容"></el-table-column>
|
||||||
|
<el-table-column align="center" label="操作" width="160">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button @click="showView(scope.row)" type="text" size="small">详情</el-button>
|
||||||
|
<el-button @click="clickDelete(scope.row)" style="color:red" type="text" size="small">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
<el-pagination
|
||||||
:current-page.sync="currentPage" :page-sizes="[100, 200, 300, 400]" :page-size="pageSize"
|
@size-change="handleSizeChange"
|
||||||
layout="sizes, prev, pager, next" :total="totalNumber" style="padding-top: 10px;">
|
@current-change="handleCurrentChange"
|
||||||
</el-pagination>
|
:current-page.sync="currentPage"
|
||||||
|
:page-sizes="[10, 20, 30, 40]"
|
||||||
|
:page-size="pageSize"
|
||||||
|
layout="sizes, total,prev, pager, next"
|
||||||
|
:total="totalNumber"
|
||||||
|
style="padding-top: 10px;"
|
||||||
|
>
|
||||||
|
</el-pagination>
|
||||||
|
|
||||||
|
<el-dialog :title="concetData.notificationType" :visible.sync="dialogVisible" width="30%" @close="notificClosed">
|
||||||
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
|
<span>{{ concetData.content }}</span>
|
||||||
<span>这是一段信息</span>
|
</el-dialog>
|
||||||
<!-- <span slot="footer" class="dialog-footer">
|
</div>
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
|
||||||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
|
||||||
</span> -->
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { getTongzrzApi, deleteTongzrzApi, getTongzrzDetailsApi } from '@/api/logs';
|
||||||
|
import moment from 'moment';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
tableData: [
|
concetData: {
|
||||||
{
|
notificationType: '',
|
||||||
date: '2016-05-02',
|
content: ''
|
||||||
name: '王小虎',
|
},
|
||||||
address: '上海市普陀区金沙江路 1518 弄'
|
options: [
|
||||||
}, {
|
{
|
||||||
date: '2016-05-04',
|
name: '通知'
|
||||||
name: '王小虎',
|
},
|
||||||
address: '上海市普陀区金沙江路 1517 弄'
|
{
|
||||||
}, {
|
name: '警告'
|
||||||
date: '2016-05-01',
|
},
|
||||||
name: '王小虎',
|
{
|
||||||
address: '上海市普陀区金沙江路 1519 弄'
|
name: '报警'
|
||||||
}, {
|
},
|
||||||
date: '2016-05-03',
|
{
|
||||||
name: '王小虎',
|
name: '成功'
|
||||||
address: '上海市普陀区金沙江路 1516 弄'
|
}
|
||||||
|
],
|
||||||
|
formData: {
|
||||||
|
value1: [],
|
||||||
|
content: '',
|
||||||
|
notificationType: ''
|
||||||
|
},
|
||||||
|
tableData: [],
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
totalNumber: 0,
|
||||||
|
tableHeight: 0,
|
||||||
|
dialogVisible: false
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
let windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
|
||||||
|
this.tableHeight = windowHeight - 270;
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.setTimes();
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
setTimes() {
|
||||||
|
let arr = [];
|
||||||
|
//当前时间
|
||||||
|
let s = moment().format('YYYY-MM-DD HH:mm:ss'); //1,day就代表前一天
|
||||||
|
//两天前
|
||||||
|
let i = moment(s)
|
||||||
|
.subtract(2, 'days')
|
||||||
|
.format('YYYY-MM-DD HH:mm:ss');
|
||||||
|
arr = [s, i];
|
||||||
|
this.formData.value1 = arr;
|
||||||
|
this.$forceUpdate();
|
||||||
},
|
},
|
||||||
],
|
notificClosed() {
|
||||||
currentPage: 1,
|
for (let i in this.concetData) {
|
||||||
pageSize: 100,
|
this.concetData[i] = '';
|
||||||
totalNumber: 1000,
|
}
|
||||||
tableHeight: 0,
|
},
|
||||||
dialogVisible: false
|
clickDelete(row) {
|
||||||
|
this.$confirm('此操作将永久删除该日志, 是否继续?', '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
deleteTongzrzApi(row.journalId).then(res => {
|
||||||
|
if (res.data.code == 200) {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '删除成功!'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: res.data.msg
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.getData();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消删除'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//获取详情数
|
||||||
|
getTongzrzDetails(JournalId) {
|
||||||
|
getTongzrzDetailsApi(JournalId)
|
||||||
|
.then(res => {
|
||||||
|
if (res.data.code === 200) {
|
||||||
|
this.concetData = res.data.data;
|
||||||
|
this.dialogVisible = true;
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.data.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
this.$message.error(err.data.msg);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//点击查询按钮
|
||||||
|
lookForMessage() {
|
||||||
|
this.currentPage = 1;
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
//表格数据
|
||||||
|
getData() {
|
||||||
|
getTongzrzApi({
|
||||||
|
Content: this.formData.content,
|
||||||
|
Type: this.formData.notificationType,
|
||||||
|
CurrentPage: this.currentPage,
|
||||||
|
PageSize: this.pageSize,
|
||||||
|
StartTime: this.formData.value1.length > 0 ? this.formData.value1[0] : '',
|
||||||
|
EndTime: this.formData.value1.length > 0 ? this.formData.value1[1] : ''
|
||||||
|
})
|
||||||
|
.then(res => {
|
||||||
|
if (res.data.code === 200) {
|
||||||
|
this.tableData = res.data.data.data;
|
||||||
|
this.totalNumber = res.data.data.total;
|
||||||
|
} else {
|
||||||
|
this.$message.error(res.data.msg);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
this.$message.error(err.data.msg);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
showView(scope) {
|
||||||
|
this.getTongzrzDetails(scope.journalId);
|
||||||
|
},
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.pageSize = val;
|
||||||
|
this.getData();
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.currentPage = val;
|
||||||
|
this.getData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
};
|
||||||
created() {
|
|
||||||
let windowHeight = document.documentElement.clientHeight || document.body.clientHeight;
|
|
||||||
this.tableHeight = windowHeight - 170;
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
download(scope) {
|
|
||||||
console.log(scope, '下载');
|
|
||||||
},
|
|
||||||
showView(scope) {
|
|
||||||
console.log(scope, '查看');
|
|
||||||
this.dialogVisible = true;
|
|
||||||
},
|
|
||||||
clickDelete(scope) {
|
|
||||||
console.log(scope, '删除');
|
|
||||||
},
|
|
||||||
handleSizeChange(val) {
|
|
||||||
console.log(`每页 ${val} 条`);
|
|
||||||
},
|
|
||||||
handleCurrentChange(val) {
|
|
||||||
console.log(`当前页: ${val}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.test-div i {
|
.test-div i {
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,43 +1,48 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="content-box">
|
<div class="content-box">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<p class="title">我的账号</p>
|
<p class="title">我的账号</p>
|
||||||
<!-- <div class="test-div">
|
<el-form label-position="left" label-width="60px" :model="formLabelAlign">
|
||||||
<i class="el-icon-edit"></i>
|
<el-form-item label="名称:">
|
||||||
<i class="el-icon-share"></i>
|
{{ formLabelAlign.name }}
|
||||||
<i class="el-icon-delete"></i>
|
</el-form-item>
|
||||||
</div> -->
|
<el-form-item label="账号:">
|
||||||
<el-form label-position="left" label-width="60px" :model="formLabelAlign">
|
{{ formLabelAlign.account }}
|
||||||
<el-form-item label="名称:">
|
</el-form-item>
|
||||||
{{ formLabelAlign.name }}
|
<el-form-item label="密码:">
|
||||||
</el-form-item>
|
{{ formLabelAlign.password }}
|
||||||
<el-form-item label="账号:">
|
</el-form-item>
|
||||||
{{ formLabelAlign.account }}
|
</el-form>
|
||||||
</el-form-item>
|
</div>
|
||||||
<el-form-item label="密码:">
|
|
||||||
{{ formLabelAlign.password }}
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { getUserApi } from '@/api/myld.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
formLabelAlign: {
|
formLabelAlign: {
|
||||||
name: 'admin',
|
name: 'admin',
|
||||||
account: 'admin',
|
account: 'admin',
|
||||||
password: '123456',
|
password: '123456'
|
||||||
},
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getUser() {
|
||||||
|
console.log(window.localStorage.getItem(''));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getUser();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.test-div i {
|
.test-div i {
|
||||||
font-size: 25px;
|
font-size: 25px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue