From 95e6a41e02794f6d908cae8f5a7eb33981cf3680 Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Thu, 14 Dec 2023 14:37:14 +0800
Subject: [PATCH] 浏览器标题修改,考勤管理员登录跳到考勤记录
---
src/config/website.js | 4
src/lang/zh.js | 2
src/page/login/index.vue | 3
src/views/wel/index.vue | 24 ++
public/index.html | 1
src/router/views/index.js | 17 +
src/views/securityGuard/securityGuard.vue | 3
src/page/login/checkIndex.vue | 2
src/page/index/logo.vue | 21 +
src/router/avue-router.js | 3
src/store/modules/common.js | 4
src/views/check/record.vue | 389 +++++++++++++++++++++++++++++++++++++++++++
src/api/check/checkRecord.js | 49 +++++
src/lang/index.js | 2
src/page/login/userlogin.vue | 10
src/store/getters.js | 2
16 files changed, 517 insertions(+), 19 deletions(-)
diff --git a/public/index.html b/public/index.html
index 74009d2..3d582fa 100644
--- a/public/index.html
+++ b/public/index.html
@@ -37,7 +37,6 @@
<link rel="icon" href="<%= BASE_URL %>favicon.png">
- <title>保安服务企业管理</title>
<style>
html,
body,
diff --git a/src/api/check/checkRecord.js b/src/api/check/checkRecord.js
new file mode 100644
index 0000000..576968c
--- /dev/null
+++ b/src/api/check/checkRecord.js
@@ -0,0 +1,49 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+ return request({
+ url: '/api/checkRecord/page',
+ method: 'get',
+ params: {
+ ...params,
+ current,
+ size,
+ }
+ })
+}
+
+export const add = (row) => {
+ return request({
+ url: '/api/checkRecord/save',
+ method: 'post',
+ data: row
+ })
+}
+
+export const update = (row) => {
+ return request({
+ url: '/api/checkRecord/update',
+ method: 'post',
+ data: row
+ })
+}
+
+export const remove = (ids) => {
+ return request({
+ url: '/api/checkRecord/remove',
+ method: 'post',
+ params: {
+ ids,
+ }
+ })
+}
+
+export const getDetail = (params) => {
+ return request({
+ url: '/api/checkRecord/detail',
+ method: 'get',
+ params: {
+ ...params
+ }
+ })
+}
diff --git a/src/config/website.js b/src/config/website.js
index 79c4a83..dbb0533 100644
--- a/src/config/website.js
+++ b/src/config/website.js
@@ -18,7 +18,7 @@
title: "saber",
logo: "S",
key: 'saber', //配置主键,目前用于存储
- indexTitle: '保安服务企业管理',
+ indexTitle: '保安员分级统筹管理系统',
clientId: 'saber', // 客户端id
clientSecret: 'saber_secret', // 客户端密钥
tenantMode: true, // 是否开启保安单位模式 租户ID
@@ -193,4 +193,4 @@
flowDesignUrl: 'http://localhost:9999',
// 报表设计器地址(cloud端口为8108,boot端口为81)
reportUrl: 'http://localhost:81/ureport',
-}
\ No newline at end of file
+}
diff --git a/src/lang/index.js b/src/lang/index.js
index a453e2a..39132e2 100644
--- a/src/lang/index.js
+++ b/src/lang/index.js
@@ -25,4 +25,4 @@
messages
})
-export default i18n
\ No newline at end of file
+export default i18n
diff --git a/src/lang/zh.js b/src/lang/zh.js
index 0e3d7bf..b1cb732 100644
--- a/src/lang/zh.js
+++ b/src/lang/zh.js
@@ -112,4 +112,4 @@
closeOthers: '关闭其它',
closeAll: '关闭所有'
}
-}
\ No newline at end of file
+}
diff --git a/src/page/index/logo.vue b/src/page/index/logo.vue
index 31332a5..c29a1c2 100644
--- a/src/page/index/logo.vue
+++ b/src/page/index/logo.vue
@@ -8,7 +8,7 @@
<img v-if="keyCollapse" src="../../../public/img/top/shield.png" />
<transition-group name="fade">
<template v-if="!keyCollapse">
- <span class="avue-logo_title" key="1">{{ website.indexTitle }} </span>
+ <span class="avue-logo_title" key="1">{{title}} </span>
</template>
</transition-group>
</div>
@@ -16,14 +16,25 @@
<script>
import { mapGetters } from "vuex";
+import website from "@/config/website";
export default {
name: "logo",
data() {
- return {};
+ return {
+ title:"",
+ };
},
- created() {},
+ created() {
+ console.log(this.userInfo,"+++++++++")
+ if (this.userInfo.role_name.indexOf("考勤管理员")>-1){
+ this.title = "保安员定点考勤系统"
+ }else {
+ this.title = website.indexTitle
+ }
+
+ },
computed: {
- ...mapGetters(["website", "keyCollapse"]),
+ ...mapGetters(["userInfo","website", "keyCollapse"]),
},
methods: {},
};
@@ -80,4 +91,4 @@
color: #fff;
}
}
-</style>
\ No newline at end of file
+</style>
diff --git a/src/page/login/checkIndex.vue b/src/page/login/checkIndex.vue
index a6f2e89..1f88f52 100644
--- a/src/page/login/checkIndex.vue
+++ b/src/page/login/checkIndex.vue
@@ -80,6 +80,8 @@
},
},
created() {
+ document.title = "保安员定点考勤系统"
+ this.$store.commit("SET_WEBTITLE", '保安员定点考勤系统')
this.handleLogin();
this.getTime();
geterweima(9).then((res) => {
diff --git a/src/page/login/index.vue b/src/page/login/index.vue
index da65bc7..08277c1 100644
--- a/src/page/login/index.vue
+++ b/src/page/login/index.vue
@@ -79,6 +79,9 @@
},
},
created() {
+ document.title = "保安员分级统筹管理系统"
+ this.$store.commit("SET_WEBTITLE", '保安员分级统筹管理系统')
+
this.handleLogin();
this.getTime();
geterweima(9).then((res) => {
diff --git a/src/page/login/userlogin.vue b/src/page/login/userlogin.vue
index a8c3582..a9a4c0e 100644
--- a/src/page/login/userlogin.vue
+++ b/src/page/login/userlogin.vue
@@ -132,7 +132,7 @@
},
mounted() {},
computed: {
- ...mapGetters(["tagWel"]),
+ ...mapGetters(["tagWel","userInfo"]),
},
props: [],
methods: {
@@ -159,7 +159,13 @@
this.$store
.dispatch("LoginByUsername", this.loginForm)
.then(() => {
- this.$router.push({ path: this.tagWel.value });
+
+ console.log(this.userInfo)
+ let path = this.tagWel.value
+ if (this.userInfo.role_name.indexOf("考勤管理员")>-1){
+ path = "check/record"
+ }
+ this.$router.push({ path: path });
loading.close();
})
.catch(() => {
diff --git a/src/router/avue-router.js b/src/router/avue-router.js
index f616be9..e85906a 100644
--- a/src/router/avue-router.js
+++ b/src/router/avue-router.js
@@ -33,7 +33,8 @@
setTitle: (title) => {
// console.log(title,'luyou')
const defaultTitle = this.$vue.$t('title');
- title = title ? `${title}-${defaultTitle}` : defaultTitle;
+
+ title = title ? `${title}-${ this.$store.getters.webTitle}` : this.$store.getters.webTitle;
document.title = title;
},
closeTag: (value) => {
diff --git a/src/router/views/index.js b/src/router/views/index.js
index b3727d0..fc86a3a 100644
--- a/src/router/views/index.js
+++ b/src/router/views/index.js
@@ -22,7 +22,22 @@
component: () =>
import( /* webpackChunkName: "views" */ '@/views/wel/dashboard')
}]
- }, {
+ },
+ {
+ path: '/check/record',
+ component: Layout,
+ redirect: '/check/record',
+ children: [{
+ path: '/check/record',
+ name: '考勤记录',
+ meta: {
+ i18n: 'record'
+ },
+ component: () =>
+ import( /* webpackChunkName: "views" */ '@/views/check/record.vue')
+ }]
+ }
+ , {
path: '/test',
component: Layout,
redirect: '/test/index',
diff --git a/src/store/getters.js b/src/store/getters.js
index 8d63a65..36556e8 100644
--- a/src/store/getters.js
+++ b/src/store/getters.js
@@ -37,5 +37,7 @@
//面
polygons: state => state.control.polygons,
+ webTitle: state => state.common.webTitle,
+
};
export default getters;
diff --git a/src/store/modules/common.js b/src/store/modules/common.js
index e7ecff6..c017373 100644
--- a/src/store/modules/common.js
+++ b/src/store/modules/common.js
@@ -28,8 +28,12 @@
themeName: getStore({ name: 'themeName' }) || 'theme-bule',
lockPasswd: getStore({ name: 'lockPasswd' }) || '',
website: website,
+ webTitle: ''
},
mutations: {
+ SET_WEBTITLE: (state, webTitle) => {
+ state.webTitle = webTitle
+ },
SET_LANGUAGE: (state, language) => {
state.language = language
setStore({
diff --git a/src/views/check/record.vue b/src/views/check/record.vue
new file mode 100644
index 0000000..16f283f
--- /dev/null
+++ b/src/views/check/record.vue
@@ -0,0 +1,389 @@
+<template>
+ <basic-container :class="[
+ 'securityUnit',
+ $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
+ $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : ''
+ ]">
+ <avue-crud class="tablesss" :option="option" v-model="form" :data="data" :page.sync="page" ref="crud" :permission="permissionList"
+ :search.sync="questionBankSearch" @on-load="onLoad" :table-loading="loading" @row-save="rowSave"
+ @search-change="searchChange" @search-reset="searchReset" @row-update="rowUpdate" @row-del="rowDel" :before-open="beforeOpen"
+ @selection-change="selectionChange" @refresh-change="refreshChange">
+ <template slot="menuLeft">
+ <el-button type="danger" size="small" plain icon="el-icon-delete" v-if="permission.clock_delete"
+ @click="handleDelete">删 除
+ </el-button>
+ <el-button type="warning" size="small" plain icon="el-icon-download" v-if="permission.clock_export"
+ @click="handleExport">导出
+ </el-button>
+ </template>
+ </avue-crud>
+ </basic-container>
+</template>
+
+<script>
+import {
+ getList,
+ add,
+ update,
+ remove,
+ getDetail
+} from "@/api/check/checkRecord";
+import { mapGetters } from "vuex";
+import { getToken } from "@/util/auth";
+import Qs from "qs";
+export default {
+ data() {
+ return {
+ loading: true,
+ selectionList: [],
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ ...this.$store.state.control.changePageSize
+ },
+ form:{},
+ query: {},
+ questionBankSearch: {},
+ data: [],
+ option: {
+ index: true,
+ tip: false,
+ viewBtn: true,
+ searchSize: "mini",
+ searchMenuSpan: 6,
+ height: 583,
+ menuWidth: 280,
+ border: true,
+ align: "center",
+ selection: true,
+ header:true,
+ addBtn:false,
+ menu:false,
+ column: [
+ {
+ label: "打卡时间",
+ prop: "checkTime",
+ search:true,
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ span: 24,
+ hide:true,
+ },
+ {
+ label: "打卡时间",
+ prop: "checkTime",
+ type: "date",
+ format: "yyyy-MM-dd hh:mm:ss",
+ valueFormat: "yyyy-MM-dd hh:mm:ss",
+ span: 24,
+ },
+ {
+ label: "人员",
+ prop: "userName",
+ span: 24,
+ },
+ {
+ label: "点位",
+ prop: "postName",
+ span: 24,
+ },
+ {
+ label: "打卡距离(m)",
+ prop: "mile",
+ span: 24,
+ },
+ {
+ label: "图片",
+ prop: "urls",
+ type: "img",
+ dataType: 'string',
+ // listType: "picture-img",
+ span: 24,
+ },
+
+ ],
+ ...this.$store.state.control.clearOtherBut
+ },
+
+
+ };
+ },
+ created() {
+ },
+ computed: {
+ ...mapGetters(["userInfo", "permission"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission.postFiling_add, true),
+ viewBtn: this.vaildData(this.permission.postFiling_view, true),
+ delBtn: this.vaildData(this.permission.postFiling_delete, true),
+ editBtn: this.vaildData(this.permission.postFiling_edit, true)
+ };
+ },
+ ids() {
+ let ids = [];
+ this.selectionList.forEach(ele => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
+ },
+ },
+ mounted() {
+ this.$store.commit("setWindowSizeHeightAdd");
+ },
+ methods: {
+ beforeOpen(done, type) {
+ if (["edit", "view"].includes(type)) {
+ getDetail({id:this.form.id}).then(res => {
+ this.form = res.data.data;
+ this.form['address'] = [this.form.lon,this.form.lat,this.form.position]
+
+ });
+ }
+ done();
+ },
+
+ sizeChange(val) {
+ this.page1.currentPage = 1;
+ this.page1.pageSize = val;
+ this.onLoad(this.page, this.query);
+ },
+ currentChange(val) {
+ this.page1.currentPage = val;
+ // this.getData();
+ this.onLoad(this.page, this.query);
+ },
+ rowSave(form, done, loading) {
+
+ add(form).then(res => {
+ if (res.data.success) {
+ this.$message({
+ message: "操作成功",
+ type: "success"
+ });
+ this.refreshChange();
+ done();
+ } else {
+ this.$message({
+ message: "操作失败",
+ type: "warning"
+ });
+ done();
+ }
+ });
+ },
+ searchChange(params, done) {
+ this.query = params;
+ this.page.currentPage = 1;
+ this.onLoad(this.page, params);
+ done();
+ },
+ searchReset() {
+ this.query = {};
+ this.onLoad(this.page);
+ },
+ rowUpdate(row, index, done, loading) {
+ update(row).then(
+ () => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ done();
+ },
+ error => {
+ window.console.log(error);
+ loading();
+ }
+ );
+ },
+ rowDel(row) {
+ this.$confirm(
+ "确定删除当前合同信息数据?",
+ {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ }
+ )
+ .then(() => {
+ console.log(row);
+ return remove(row.id);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ });
+ },
+ selectionChange(list) {
+ this.selectionList = list;
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定批量将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(this.ids).then(res => {
+ this.refreshChange();
+ });
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ this.$refs.crudrec.toggleSelection();
+ })
+ .catch(res => { });
+ },
+ refreshChange() {
+ this.onLoad(this.page, this.query);
+ },
+ //保安员证信息导出
+ handleExport() {
+ this.$confirm("是否导出考勤打卡信息数据?", "提示", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ }).then(() => {
+ //获取查询条件
+ const { releaseTimeRange } = this.questionBankSearch;
+ if (releaseTimeRange) {
+ this.questionBankSearch["beginTime"] = releaseTimeRange[0];
+ this.questionBankSearch["endTime"] = releaseTimeRange[1];
+ }
+ var data = {
+ clockType: this.questionBankSearch.clockType,
+ attendanceType: this.questionBankSearch.attendanceType,
+ realName: this.questionBankSearch.realName,
+ beginTime: this.questionBankSearch.beginTime,
+ endTime: this.questionBankSearch.endTime
+ };
+ //导出
+ if (this.userInfo.role_name == "保安公司管理员") {
+ //如果是保安公司管理员
+ data["deptId"] = this.userInfo.dept_id;
+ }
+ //序列号url形式,用&拼接
+ data = Qs.stringify(data);
+ window.open(
+ `/api/attendance/export-Attendance?${this.website.tokenHeader
+ }=${getToken()}&` + data
+ );
+ });
+ },
+ onLoad(page, params = {}) {
+ params = this.questionBankSearch;
+
+ const { releaseTimeRange } = this.query;
+ let values = {
+ ...params
+ };
+ // if (releaseTimeRange) {
+ // values = {
+ // ...params,
+ // beginTime: releaseTimeRange[0],
+ // endTime: releaseTimeRange[1],
+ // ...this.query,
+ // };
+ // values.releaseTimeRange = null;
+ // }
+ this.loading = true;
+ //固定岗
+ getList(
+ page.currentPage,
+ page.pageSize,
+ Object.assign(values, this.query)
+ ).then(res => {
+ const data = res.data.data;
+ this.page.total = data.total;
+ this.data = data.records;
+
+ // this.data = this.tableData
+
+
+
+ window.localStorage.setItem("danweidataS", JSON.stringify(this.data));
+ this.$store.commit("setWindowSizeHeightAdd");
+ this.loading = false;
+ });
+ }
+ },
+};
+</script>
+
+<style lang="scss">
+.securityUnit {
+ width: 100%;
+ height: 100%;
+ // border: 1px solid #000;
+ box-sizing: border-box;
+}
+
+// .el-card__body {
+// padding-bottom: 5px !important;
+// }
+// .avue-crud__tip,
+// .el-tag,
+// .el-tag--light {
+// padding: 0 !important;
+// }
+
+.lod {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-color: rgba($color: #000000, $alpha: 0.5);
+ padding: 100px 0 0 0;
+ z-index: 1500 !important;
+ display: flex;
+ // align-items: center;
+ justify-content: center;
+
+ .trees {
+ z-index: 501 !important;
+ position: absolute;
+ width: 15%;
+ top: 100px;
+ left: 0;
+ // display: none;
+ }
+
+ .lod-in {
+ width: 70%;
+ height: auto;
+ background-color: transparent;
+
+ // padding: 10px 0 0 0;
+ }
+
+ .el-collapse-item {
+ padding-top: 15px !important;
+ }
+}
+
+.el-collapse {
+ border-top: 1px solid transparent !important;
+}
+
+.rowClickSelf {
+ &:hover {
+ cursor: pointer;
+ }
+}
+</style>
diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index c5546c2..d1da295 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -2862,6 +2862,9 @@
// // d[key].securitynumber = "赣洪202100009";
// }
that.data = data.records;
+
+ console.log(this.data,"++++++++++")
+
that.loading = false;
that.selectionClear();
that.$store.commit("setWindowSizeHeightAdd");
diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue
index 169914d..1c3d82e 100644
--- a/src/views/wel/index.vue
+++ b/src/views/wel/index.vue
@@ -1,8 +1,8 @@
<template>
<div id="homeL">
<div class="homeL-up">
- <span class="h1">保安服务企业管理平台</span>
- <span class="h2">Security service enterprise management platform</span>
+ <span class="h1">{{titleCh}}</span>
+ <span class="h2">{{ titleEn }}</span>
<img class="img" :src="img" v-if="isImg"/>
</div>
<div class="homeL-bar">
@@ -48,6 +48,8 @@
usedata: {},
img:"",
isImg:false,
+ titleCh:"",
+ titleEn:"",
};
},
mounted() {
@@ -62,9 +64,21 @@
...mapGetters(["userInfo"]),
},
created(){
+
+ if (this.userInfo.role_name.indexOf("考勤管理员")>-1){
+ this.titleCh = "保安员定点考勤系统"
+ this.titleEn = "Security Officer Designated Attendance System"
+ }else {
+ this.titleCh = "保安员分级统筹管理系统"
+ this.titleEn="Security Officer Grading and Coordination Management System"
+ }
+
+
+
+
//获取二维码图片
- if(this.userInfo.role_name == "公安管理员" ||
- this.userInfo.role_name == "administrator" ||
+ if(this.userInfo.role_name == "公安管理员" ||
+ this.userInfo.role_name == "administrator" ||
this.userInfo.role_name == "admin" ||
this.userInfo.role_name == "民警"){
this.isImg = true;
@@ -186,4 +200,4 @@
// }
}
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.3