Commit b49d0c00 authored by 拾柒's avatar 拾柒

Merge branch 'master' into dev-yingshi

parents 9c34256c 563e5c50
......@@ -6,6 +6,6 @@ ENV = 'development'
# 悦优享视频监控管理系统/开发环境
VUE_APP_BASE_API = ''
VUE_APP_BASE_API = '/api'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true
......@@ -6,29 +6,88 @@
@select="handleSelect"
style="margin-right: 120px"
>
<template v-for="(item, index) in newTopNev">
<el-menu-item class="menuStyle" style="font-size: small;background-color: #F6F6FA;border-top-right-radius: 15px;border-top-left-radius: 15px;text-align: center;margin-left: 1px" :index="item.path" :key="index"
<template>
<el-menu-item
class="menuStyle"
style="
font-size: small;
background-color: #f6f6fa;
border-top-right-radius: 15px;
border-top-left-radius: 15px;
text-align: center;
margin-left: 1px;
"
index="/monitoring/video"
>
<i :class="item.icon" style="width: 10px;height: 10px;margin-top: -12px"></i>
{{ item.name }}</el-menu-item
<i style="width: 10px; height: 10px; margin-top: -12px"></i>
首页
</el-menu-item>
<el-menu-item
class="menuStyle"
style="
font-size: small;
background-color: #f6f6fa;
border-top-right-radius: 15px;
border-top-left-radius: 15px;
text-align: center;
margin-left: 1px;
"
index="/employee/employee"
v-if="roles[0] === 'admin'"
>
<i style="width: 10px; height: 10px; margin-top: -12px"></i>
员工信息
</el-menu-item>
<el-menu-item
class="menuStyle"
style="
font-size: small;
background-color: #f6f6fa;
border-top-right-radius: 15px;
border-top-left-radius: 15px;
text-align: center;
margin-left: 1px;
"
index="/monitoringhistory/history"
v-if="!this.backTag"
>
<i style="width: 10px; height: 10px; margin-top: -12px"></i>
历史记录
</el-menu-item>
<el-menu-item
class="menuStyle"
style="
font-size: small;
background-color: #f6f6fa;
border-top-right-radius: 15px;
border-top-left-radius: 15px;
text-align: center;
margin-left: 1px;
"
index="/monitoringhistory/history"
v-if="this.backTag"
@click="changeBackTag()"
>
<i style="width: 10px; height: 10px; margin-top: -12px"></i>
返回历史记录
</el-menu-item>
</template>
<!-- 顶部菜单超出数量折叠 -->
<!-- <el-submenu :style="{'&#45;&#45;theme': theme}" index="more" v-if="topMenus.length > visibleNumber">-->
<!-- <template slot="title">更多菜单</template>-->
<!-- <template v-for="(item, index) in topMenus">-->
<!-- <el-menu-item-->
<!-- :index="item.path"-->
<!-- :key="index"-->
<!-- v-if="index >= visibleNumber">-->
<!-- <svg-icon-->
<!-- v-if="item.meta && item.meta.icon && item.meta.icon !== '#'"-->
<!-- :icon-class="item.meta.icon"/>-->
<!-- {{ item.meta.title }}-->
<!-- </el-menu-item>-->
<!-- </template>-->
<!-- </el-submenu>-->
<!-- <el-submenu :style="{'&#45;&#45;theme': theme}" index="more" v-if="topMenus.length > visibleNumber">-->
<!-- <template slot="title">更多菜单</template>-->
<!-- <template v-for="(item, index) in topMenus">-->
<!-- <el-menu-item-->
<!-- :index="item.path"-->
<!-- :key="index"-->
<!-- v-if="index >= visibleNumber">-->
<!-- <svg-icon-->
<!-- v-if="item.meta && item.meta.icon && item.meta.icon !== '#'"-->
<!-- :icon-class="item.meta.icon"/>-->
<!-- {{ item.meta.title }}-->
<!-- </el-menu-item>-->
<!-- </template>-->
<!-- </el-submenu>-->
</el-menu>
</template>
......@@ -37,12 +96,14 @@ import { constantRoutes } from "@/router";
import Menu from "@/views/system/menu/index.vue";
// 隐藏侧边栏路由
const hideList = ['/index', '/user/profile'];
const hideList = ["/index", "/user/profile"];
export default {
components: {Menu},
components: { Menu },
data() {
return {
roles: [],
backTag: false,
newTopNev: [
{
path: '/monitoring/video',
......@@ -95,11 +156,12 @@ export default {
this.routers.map((router) => {
for (var item in router.children) {
if (router.children[item].parentPath === undefined) {
if(router.path === "/") {
if (router.path === "/") {
router.children[item].path = "/" + router.children[item].path;
} else {
if(!this.ishttp(router.children[item].path)) {
router.children[item].path = router.path + "/" + router.children[item].path;
if (!this.ishttp(router.children[item].path)) {
router.children[item].path =
router.path + "/" + router.children[item].path;
}
}
router.children[item].parentPath = router.path;
......@@ -137,8 +199,20 @@ export default {
this.currentIndex = this.$route.path
this.$store.dispatch('app/toggleSideBarHide', true);
this.setVisibleNumber();
//获取用户角色
this.roles = this.$store.getters.roles;
},
created() {
this.getinfo();
},
methods: {
changeBackTag() {
this.backTag = false;
},
getinfo() {
let self = this;
self.backTag = this.$router.params.backTag;
},
// 根据宽度计算设置显示栏数
setVisibleNumber() {
const width = document.body.getBoundingClientRect().width / 3;
......@@ -220,48 +294,57 @@ export default {
// padding: 0 5px !important;
// margin: 0 10px !important;
//}
.menuStyle{
box-shadow: 0 0 8px #D4D9E5;
.menuStyle {
box-shadow: 0 0 8px #d4d9e5;
height: 60px;
border-bottom: transparent;
}
.menuStyle:hover{
color: #30B08F;
.menuStyle:hover {
color: #30b08f;
border-bottom: 0px transparent;
}
::v-deep .el-menu::before{
::v-deep .el-menu::before {
color: transparent;
}
::v-deep .el-submenu{
::v-deep .el-submenu {
height: 60px;
}
.el-menu--horizontal > .el-menu-item{
.el-menu--horizontal > .el-menu-item {
margin-top: 19px;
height: 60px;
line-height: 35px;
}
.el-menu--horizontal > .el-menu-item.is-active{
.el-menu--horizontal > .el-menu-item.is-active {
margin-top: 12px;
}
//.el-menu--horizontal > .el-menu-item.is-active{
// //margin-top: 30px;
// height: 60px;
// line-height: 30px;
//}
.el-menu-item.is-active{
.el-menu-item.is-active {
font-weight: bolder;
line-height: 45px;
color: white !important;
background-color: #0D8EEE !important;
background-color: #0d8eee !important;
}
.el-menu-item {
width: 130px;
color: #2E2E2E !important;
background-color:#F6F6FA !important;
color: #2e2e2e !important;
background-color: #f6f6fa !important;
}
.el-menu--horizontal > .el-submenu{
.el-menu--horizontal > .el-submenu {
height: 10px;
}
//.el-menu--horizontal > .el-submenu.is-active{
// height: 80px;
//}
......
......@@ -43,7 +43,7 @@
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item prop="userName">
<!-- <el-form-item prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入账号"
......@@ -60,7 +60,7 @@
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
</el-form-item>-->
<el-form-item prop="phonenumber">
<el-input
v-model="queryParams.phonenumber"
......@@ -155,14 +155,23 @@
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange" style="min-height: 650px" ref="table">
<el-table-column type="selection" width="60" align="center"/>
<!-- <el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />-->
<el-table-column label="序号" align="center" type="index" width="190" />
<el-table-column label="账号" align="center" key="userName" prop="userName" width="190" v-if="columns[1].visible" :show-overflow-tooltip="true" />
<el-table-column label="序号" align="center" width="100">
<template slot-scope="scope">
<span>{{
(queryParams.pageNum - 1) * queryParams.pageSize +
scope.$index +
1
}}</span>
</template>
</el-table-column>
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" width="300" v-if="columns[4].visible" />
<!-- <el-table-column label="账号" align="center" key="userName" prop="userName" width="190" v-if="columns[1].visible" :show-overflow-tooltip="true" />-->
<el-table-column label="员工姓名" align="center" key="nickName" prop="nickName" width="190" v-if="columns[2].visible" :show-overflow-tooltip="true" />
<!-- <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />-->
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" width="190" v-if="columns[4].visible" />
<el-table-column label="权重" align="center" key="weightNum" prop="weightNum" width="150" v-if="columns[8].visible" />
<el-table-column label="创建人" align="center" key="createBy" prop="createBy" width="190" v-if="columns[7].visible" />
<el-table-column label="创建时间" align="center" key="createTime" prop="createTime" width="190" v-if="columns[6].visible" >
<el-table-column label="创建时间" align="center" key="createTime" prop="createTime" width="300" v-if="columns[6].visible" >
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
......@@ -170,14 +179,14 @@
<el-table-column label="状态" align="center" key="status" width="190" v-if="columns[5].visible">
<template slot-scope="scope">
<span :class="{ 'status-enabled': scope.row.status === '0', 'status-disabled': scope.row.status === '1' }">
{{ scope.row.status === '0' ? '.已启用' : '.已禁用' }}
{{ scope.row.status === '0' ? '·已启用' : 已禁用' }}
</span>
</template>
</el-table-column>
<el-table-column
label="操作"
align="center"
width="232"
width="292"
class-name="small-padding fixed-width"
>
<template slot-scope="scope" v-if="scope.row.userId !== 1">
......@@ -220,7 +229,7 @@
<h3><span class="blue-square"></span> 用户详细信息</h3>
</div>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<!-- <el-row>
<el-col :span="12">
<el-form-item label="账号" prop="userName">
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="10px" />
......@@ -231,11 +240,11 @@
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/>
</el-form-item>
</el-col>
</el-row>
</el-row>-->
<el-row>
<el-col :span="12">
<el-form-item label="员工姓名" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" />
<el-input v-model="form.nickName" placeholder="请输入员工姓名" maxlength="30" />
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -283,18 +292,18 @@
<h3><span class="blue-square"></span> 用户详细信息</h3>
</div>
<el-form ref="form" :model="form" :rules="updaterules" label-width="80px">
<el-row>
<!-- <el-row>
<el-col :span="12">
<el-form-item label="账号" prop="userName">
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="10px" />
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-col :span="12">
<el-form-item label="用户密码" prop="password">
<el-input v-model="form.password" placeholder="请输入用户密码" type="password" maxlength="20" show-password/>
</el-form-item>
</el-col>-->
</el-row>
</el-col>
</el-row>-->
<el-row>
<el-col :span="12">
<el-form-item label="员工姓名" prop="nickName">
......@@ -533,38 +542,46 @@ export default {
],
// 表单校验
updaterules:{
userName: [
/* userName: [
{ required: true, message: "账号不能为空", trigger: "blur" },
{ min: 2, max: 20, message: '账号长度必须介于 2 和 20 之间', trigger: 'blur' }
],
],*/
nickName: [
{ required: true, message: "姓名不能为空", trigger: "blur" }
],
phonenumber: [
{
required: true,
pattern: /^1[3|4|5|6|7|8|9][0-9]{9}$/,
message: "请输入正确的手机号码",
trigger: "blur"
}
]
},
rules: {
userName: [
/* userName: [
{ required: true, message: "账号不能为空", trigger: "blur" },
{ min: 2, max: 20, message: '账号长度必须介于 2 和 20 之间', trigger: 'blur' }
],
],*/
nickName: [
{ required: true, message: "姓名不能为空", trigger: "blur" }
],
password: [
/* password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" },
{ min: 5, max: 20, message: '用户密码长度必须介于 5 和 20 之间', trigger: 'blur' },
{ pattern: /^[^<>"'|\\]+$/, message: "不能包含非法字符:< > \" ' \\\ |", trigger: "blur" }
],
email: [
],*/
/* email: [
{
type: "email",
message: "请输入正确的邮箱地址",
trigger: ["blur", "change"]
}
],
],*/
phonenumber: [
{
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
required: true,
pattern: /^1[3|4|5|6|7|8|9][0-9]{9}$/,
message: "请输入正确的手机号码",
trigger: "blur"
}
......@@ -759,13 +776,15 @@ export default {
},
/** 提交按钮 */
submitForm: function() {
//账号默认为手机号
this.form.userName = this.form.phonenumber;
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.userId !== undefined) {
// 更新现有记录
updateUser(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.userupdate = false;
this.getList();
});
} else {
......@@ -793,6 +812,17 @@ export default {
handleExport() {
// 获取选中的用户 ID
const userIds = this.ids;
if (userIds.length === 0) {
// 如果没有选中的数据,显示提示信息
this.$message({
message: '请至少选择一条数据进行导出。',
type: 'warning'
});
return;
}
// 如果有选中的数据,则继续导出操作
this.download('system/user/export', userIds, `user_${new Date().getTime()}.xlsx`);
},
/** 导入按钮操作 */
......
......@@ -60,7 +60,7 @@
<el-form-item prop="monitorTime">
<el-date-picker
placeholder="请选择监控时间"
placeholder="请选择开始时间"
value-format="yyyy-MM-dd"
v-model="queryParams.monitoringStarttime"
type="date"
......@@ -73,6 +73,15 @@
<!-- placeholder="请选择监控时间">-->
<!-- </el-date-picker>-->
</el-form-item>
<el-form-item>
<el-date-picker
placeholder="请选择结束时间"
value-format="yyyy-MM-dd"
v-model="queryParams.monitoringFinallytime"
type="date"
>
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="监控状态" prop="monitorState">-->
<!-- <el-input-->
<!-- v-model="queryParams.monitorState"-->
......@@ -107,7 +116,11 @@
<el-table-column label="序号" align="center" width="100">
<template slot-scope="scope">
<span>{{ calculateIndex(scope.$index) }}</span>
<span>{{
(queryParams.pageNum - 1) * queryParams.pageSize +
scope.$index +
1
}}</span>
</template>
</el-table-column>
<!-- <template slot-scope="scope">-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment