From 666c61a8dca571045e422e6c85f1b7a8179f0df5 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Wed, 29 Dec 2021 13:41:37 +0800
Subject: [PATCH] +搜索确认按钮位置 加上展开, 适应1366 768分辨率的缩放zoom ,
---
src/styles/tableSearchBut.scss | 41 +
src/store/onresize.js | 3
src/views/securityGuard/securityGuard.vue | 147 +++-
src/store/getters.js | 1
src/store/modules/control.js | 109 +++
src/views/securityGuard/data.js | 1324 +++++++++++++++++++++++-----------------------
src/App.vue | 6
src/styles/element-ui.scss | 26
8 files changed, 934 insertions(+), 723 deletions(-)
diff --git a/src/App.vue b/src/App.vue
index 2959c60..b8667f8 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -11,11 +11,9 @@
return {};
},
watch: {},
- created() {
-
- },
+ created() {},
methods: {},
- computed: {}
+ computed: {},
};
</script>
<style lang="scss">
diff --git a/src/store/getters.js b/src/store/getters.js
index 336af48..51e61df 100644
--- a/src/store/getters.js
+++ b/src/store/getters.js
@@ -30,5 +30,6 @@
clearOtherBut: state => state.control.clearOtherBut,
windowWidth: state => state.control.windowWidth,
windowHeight: state => state.control.windowHeight,
+ table_height: state => state.control.table_height,
}
export default getters
diff --git a/src/store/modules/control.js b/src/store/modules/control.js
index 2d6d484..d842cbd 100644
--- a/src/store/modules/control.js
+++ b/src/store/modules/control.js
@@ -2,7 +2,7 @@
// import {getDictionary} from '@/api/system/dict'
-const dict = {
+const control = {
state: {
clearOtherBut: {
refreshBtn: false,
@@ -17,15 +17,102 @@
pageSizes: [15, 30, 50, 100],
},
windowWidth: 1025,
- windowHeight: '',
+ windowHeight: 990,
+ heightTimesOut: '',
+ table_height: "",
+ butState: '',
+ oldOpens: ''
},
actions: {
WHchangeHight({ state, commit }, data) {
if (data.fn) {
- data.fn();
+ if (!state.heightTimesOut) {
+ data.fn(state.windowHeight);
+ }
+ state.heightTimesOut = setTimeout(() => {
+ clearTimeout(state.heightTimesOut);
+ state.heightTimesOut = '';
+ }, 300);
}
- data.option.height = +state.windowHeight + +data.add;
- // console.log(data);
+ },
+ TABLE_CHANGEBUTPOSITION({ state, commit, dispatch }, data) {
+ let changedom = function (val) {
+ let table = document.getElementsByClassName("tablesss")[0];
+ let heard = table.getElementsByClassName("avue-crud__search")[0];//获取搜索的长度
+ let buts = table.getElementsByClassName("avue-form__menu--center")[0];
+ let Open = buts.getElementsByClassName("el-button--text")[0]
+ let butsheight = heard.clientHeight;
+ let butX = 0;
+ if (data.from == "mounted") {
+ commit("setOldOpens", '')
+ commit("setButOpens", '')
+ }
+ // console.log(state.butState, val, butsheight)
+ if (state.butState == "展 开") {
+ commit("setOldOpens", '')
+ }
+ if (val == "收 缩") {
+ commit("setOldOpens", butsheight)
+ } else if (val == undefined && state.oldOpens) {
+ butsheight = state.oldOpens;
+ butX = state.oldOpens - heard.clientHeight;
+ // commit("setOldOpens", '')
+ }
+ // console.log(state.butState, val, butsheight, butX);
+ let sets = window.innerWidth <= 1376 && window.innerHeight <= 778;
+ let usNumOpens = sets ? -78 : -78;
+ if (butX || sets) {
+ Open.style.top = usNumOpens - +butX + "px";
+ }
+ buts.style.top = butsheight + "px";
+ if (val != "收 缩") {
+ let other = data.otherclass || [];
+ if (other && state.windowWidth >= 1024)
+ for (let k in other) {
+ let otherbuts = document.getElementsByClassName(other[k])[0]
+ otherbuts.style.top = butsheight + 27 + "px";
+ }
+ }
+ if (state.butState == "收 缩" && !val) {
+ Open.click();
+ }
+ if (data.haveOpen && !val) {// 是否有展开按钮
+ Open.onclick = function (e) {
+ changedom(e.srcElement.innerText);
+ //固定高度
+ //调用改变高度
+ if (e.srcElement.innerText == "展 开") {
+ state.windowHeight += 1;
+ } else {
+ state.windowHeight -= 1;
+ }
+ commit("setButOpens", e.srcElement.innerText)
+ }
+ }
+
+ }
+ changedom();
+ },
+ TABLE_CHANGEHEIGHT({ state, commit }, data) {
+ let h = +state.windowHeight - (+data.searchHeight + +data.flowHeight);
+ console.log(h)
+ state.table_height = h;
+ // commit("settable_height", h);
+ },
+ changeZoom({ state, commit }, data) {
+ if (window.innerWidth <= 1396 && window.innerHeight <= 798) {
+ // var devicewidth = document.documentElement.clientWidth; //获取当前分辨率下的可是区域宽度
+ // console.log(devicewidth)
+ let devicewidth = 1143;
+ var scale = devicewidth / 1366; // 分母——设计稿的尺寸
+ document.body.style.zoom = scale; //放大缩小相应倍数
+ // console.log("应用1366*768")
+ } else {
+ if (document.body.style.zoom != 1) {
+ document.body.style.zoom = 1;
+ // console.log("还原缩放")
+ }
+ }
}
},
mutations: {
@@ -34,8 +121,18 @@
state.windowHeight = data.innerHeight;
// console.log(data)
},
+ setWindowSizeHeightAdd: (state, data) => {
+ state.windowHeight += 1;
+ },
+ setButOpens(state, data) {
+ state.butState = data;
+ },
+ setOldOpens(state, data) {
+ state.oldOpens = data;
+ state.oldOpens = data;
+ }
}
};
-export default dict;
+export default control;
diff --git a/src/store/onresize.js b/src/store/onresize.js
index da66589..2169b6b 100644
--- a/src/store/onresize.js
+++ b/src/store/onresize.js
@@ -7,10 +7,13 @@
let innerWH = {
innerWidth: window.innerWidth,
innerHeight: window.innerHeight,
+ // innerWidth: document.documentElement.clientWidth,
+ // innerHeight: document.documentElement.clientHeight,
}
_this.$store.commit('setWindowSize', innerWH);
// console.log(' window.innerWidth', window.innerWidth);
// console.log(' window.innerHeight', window.innerHeight);
+ _this.$store.dispatch("changeZoom");
}
}
diff --git a/src/styles/element-ui.scss b/src/styles/element-ui.scss
index c1588fa..540646d 100644
--- a/src/styles/element-ui.scss
+++ b/src/styles/element-ui.scss
@@ -20,7 +20,7 @@
}
.el-menu--display,
-.el-menu--display+.el-submenu__icon-arrow {
+.el-menu--display + .el-submenu__icon-arrow {
display: none;
}
@@ -49,17 +49,17 @@
.el-dropdown-menu__item--divided:before,
.el-menu,
-.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,
-.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover,
-.el-menu--horizontal>.el-submenu .el-submenu__title:hover {
+.el-menu--horizontal > .el-menu-item:not(.is-disabled):focus,
+.el-menu--horizontal > .el-menu-item:not(.is-disabled):hover,
+.el-menu--horizontal > .el-submenu .el-submenu__title:hover {
background-color: transparent;
}
.el-dropdown-menu__item--divided:before,
.el-menu,
-.el-menu--horizontal>.el-menu-item:not(.is-disabled):focus,
-.el-menu--horizontal>.el-menu-item:not(.is-disabled):hover,
-.el-menu--horizontal>.el-submenu .el-submenu__title:hover {
+.el-menu--horizontal > .el-menu-item:not(.is-disabled):focus,
+.el-menu--horizontal > .el-menu-item:not(.is-disabled):hover,
+.el-menu--horizontal > .el-submenu .el-submenu__title:hover {
background-color: transparent !important;
}
@@ -243,7 +243,7 @@
}
//top 导航 按钮
-.el-menu--horizontal>.el-menu-item.is-active,
+.el-menu--horizontal > .el-menu-item.is-active,
.avue-top,
.el-dropdown {
color: #fff !important;
@@ -317,7 +317,7 @@
}
}
-.avue-form__group>div:last-child {
+.avue-form__group > div:last-child {
display: inline-block !important;
// width: auto !important;
}
@@ -329,4 +329,10 @@
width: 100% !important;
height: 100% !important;
box-sizing: border-box !important;
-}
\ No newline at end of file
+}
+
+// 整体缩放
+body {
+ zoom: 0.997;
+ // font-size: xx-small;
+}
diff --git a/src/styles/tableSearchBut.scss b/src/styles/tableSearchBut.scss
index ca30f37..48cdceb 100644
--- a/src/styles/tableSearchBut.scss
+++ b/src/styles/tableSearchBut.scss
@@ -1,9 +1,27 @@
+.ourOpen {
+ .el-button.el-button--text.el-button--small {
+ position: absolute;
+ top: -78px;
+ right: 10px;
+ }
+}
+// :nth-child(2)
+.tooRowSearch {
+ position: relative;
+}
.tooRowSearch .avue-crud__search .avue-form__group.avue-form__group--flex .avue-form__menu--center {
width: 222px !important;
- position: absolute !important;
- right: 0 !important;
- top: 126px !important;
- z-index: 100 !important;
+ // width: 264px !important;
+ // position: absolute !important;
+ // right: 0 !important;
+ // top: 126px !important;
+ // z-index: 100 !important;
+ // width: 264px;
+ position: absolute;
+ right: 0;
+ top: 91px;
+ z-index: 100;
+ @extend .ourOpen;
}
.tooRowSearch .el-card.is-never-shadow.avue-crud__search {
overflow: visible;
@@ -19,3 +37,18 @@
.oneRowSearch .el-card.is-never-shadow.avue-crud__search {
overflow: visible;
}
+
+// $varHeight: var(--height-primary); //Sass变量的值从CSS变量里取,间接操作Sass变量
+// .tablesss .avue-crud {
+// /deep/ el-table {
+// height: $varHeight !important;
+// }
+// }
+
+.el-card__body {
+ //卡片减少padding
+ padding: 10px !important;
+}
+.avue-crud__pagination {
+ padding: 15px 0 5px 5px;
+}
diff --git a/src/views/securityGuard/data.js b/src/views/securityGuard/data.js
index dbfc255..fa8b8f1 100644
--- a/src/views/securityGuard/data.js
+++ b/src/views/securityGuard/data.js
@@ -1,314 +1,314 @@
//保安员基本信息
export var securityBaseInfoColumn = [{
- label: "",
- labelWidth: "20",
- type: 'title',
- prop: "title",
- span: 24,
- styles: {
- fontSize: '24px'
- }
- },
- {
- label: "企业名称",
- prop: "deptId",
- type: "tree",
- dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
- // dicUrl: "/api/blade-system/dept/lazy-tree?parentId=0",
- props: {
- label: "title",
- value: "id",
- },
- disabled: true,
- span: 24,
- },
- {
- label: "登录账号",
- prop: "account",
- disabled: true
- },
- {
- label: "用户姓名",
- prop: "realName",
- disabled: true,
- },
- {
- label: "用户昵称",
- prop: "name",
- disabled: true
- },
- {
- label: "手机号码",
- prop: "phone",
- disabled: true
- },
- {
- label: "电子邮箱",
- prop: "email",
- disabled: true
- },
- {
- label: "身份证号",
- prop: "cardid",
- disabled: true
- },
- {
- label: "籍贯",
- prop: "nativeplace",
- disabled: true
- },
- {
- label: "民族",
- prop: "nation",
- disabled: true
- },
- {
- label: "是否持证",
- prop: "hold",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=equipage",
- props: {
- label: "dictValue",
- value: "dictKey",
- },
- type: "select",
- disabled: true
- },
- {
- label: "保安员证编号",
- prop: "securitynumber",
- disabled: true
- },
- {
- label: "所属辖区",
- prop: "jurisdiction",
- // multiple: true,
- type: "tree",
- dicUrl: "/api/jurisdiction/lazy-tree",
- props: {
- label: "title",
- value: "id",
- },
- disabled: true
- },
- {
- label: "最高学历",
- prop: "education",
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=educationType",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- dataType: "number",
- slot: true,
- disabled: true
- },
- {
- label: "政治面貌",
- prop: "politicaloutlook",
- disabled: true
- },
- {
- label: "身高",
- prop: "height",
- disabled: true
- },
- {
- label: "联系地址",
- prop: "address",
- disabled: true
- },
- {
- label: "户口所在地",
- prop: "registered",
- disabled: true
- },
- {
- label: "入职时间",
- prop: "rtime",
- type: 'date',
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd",
- disabled: true
- },
- {
- label: "用户性别",
- prop: "sex",
- type: "select",
- dicData: [{
- label: "男",
- value: 1
- },
- {
- label: "女",
- value: 2
- },
- {
- label: "未知",
- value: 3
- }
- ],
- disabled: true
- },
- {
- label: "用户生日",
- type: "date",
- prop: "birthday",
- disabled: true
+ label: "",
+ labelWidth: "20",
+ type: 'title',
+ prop: "title",
+ span: 24,
+ styles: {
+ fontSize: '24px'
}
+},
+{
+ label: "企业名称",
+ prop: "deptId",
+ type: "tree",
+ dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+ // dicUrl: "/api/blade-system/dept/lazy-tree?parentId=0",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ disabled: true,
+ span: 24,
+},
+{
+ label: "登录账号",
+ prop: "account",
+ disabled: true
+},
+{
+ label: "用户姓名",
+ prop: "realName",
+ disabled: true,
+},
+{
+ label: "用户昵称",
+ prop: "name",
+ disabled: true
+},
+{
+ label: "手机号码",
+ prop: "phone",
+ disabled: true
+},
+{
+ label: "电子邮箱",
+ prop: "email",
+ disabled: true
+},
+{
+ label: "身份证号",
+ prop: "cardid",
+ disabled: true
+},
+{
+ label: "籍贯",
+ prop: "nativeplace",
+ disabled: true
+},
+{
+ label: "民族",
+ prop: "nation",
+ disabled: true
+},
+{
+ label: "是否持证",
+ prop: "hold",
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=equipage",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ type: "select",
+ disabled: true
+},
+{
+ label: "保安员证编号",
+ prop: "securitynumber",
+ disabled: true
+},
+{
+ label: "所属辖区",
+ prop: "jurisdiction",
+ // multiple: true,
+ type: "tree",
+ dicUrl: "/api/jurisdiction/lazy-tree",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ disabled: true
+},
+{
+ label: "最高学历",
+ prop: "education",
+ type: "select",
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=educationType",
+ props: {
+ label: "dictValue",
+ value: "dictKey"
+ },
+ dataType: "number",
+ slot: true,
+ disabled: true
+},
+{
+ label: "政治面貌",
+ prop: "politicaloutlook",
+ disabled: true
+},
+{
+ label: "身高",
+ prop: "height",
+ disabled: true
+},
+{
+ label: "联系地址",
+ prop: "address",
+ disabled: true
+},
+{
+ label: "户口所在地",
+ prop: "registered",
+ disabled: true
+},
+{
+ label: "入职时间",
+ prop: "rtime",
+ type: 'date',
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ disabled: true
+},
+{
+ label: "用户性别",
+ prop: "sex",
+ type: "select",
+ dicData: [{
+ label: "男",
+ value: 1
+ },
+ {
+ label: "女",
+ value: 2
+ },
+ {
+ label: "未知",
+ value: 3
+ }
+ ],
+ disabled: true
+},
+{
+ label: "用户生日",
+ type: "date",
+ prop: "birthday",
+ disabled: true
+}
]
export var securityBaseInfoColumns = [{
- label: "所属保安单位",
- prop: "tenantId",
- type: "tree",
- dicUrl: "/api/blade-system/tenant/select",
- props: {
- label: "tenantName",
- value: "tenantId"
- },
- disabled: true,
- span: 24,
+ label: "所属保安单位",
+ prop: "tenantId",
+ type: "tree",
+ dicUrl: "/api/blade-system/tenant/select",
+ props: {
+ label: "tenantName",
+ value: "tenantId"
+ },
+ disabled: true,
+ span: 24,
+},
+{
+ label: "登录账号",
+ prop: "account",
+ disabled: true
+},
+{
+ label: "用户姓名",
+ prop: "realName",
+ rules: [{
+ required: true,
+ message: "请输入用户姓名",
+ trigger: "blur"
+ }, {
+ min: 2,
+ max: 5,
+ message: '姓名长度在2到5个字符'
+ }]
+},
+{
+ label: "用户昵称",
+ prop: "name"
+},
+{
+ label: "手机号码",
+ prop: "phone",
+ overHidden: true,
+ rules: [{
+ required: true,
+ message: "请输入手机号",
+ trigger: "blur"
+ }]
+},
+{
+ label: "电子邮箱",
+ prop: "email",
+ hide: true,
+ overHidden: true
+},
+{
+ label: "身份证号",
+ prop: "cardid",
+ hide: true,
+ overHidden: true,
+ rules: [{
+ required: true,
+ message: "请输入身份证号",
+ trigger: "blur"
+ }]
+},
+{
+ label: "籍贯",
+ prop: "nativeplace",
+ hide: true,
+ overHidden: true
+},
+{
+ label: "民族",
+ prop: "nation",
+ hide: true,
+ overHidden: true
+},
+{
+ label: "最高学历",
+ prop: "education",
+ type: "select",
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=educationType",
+ props: {
+ label: "dictValue",
+ value: "dictKey"
+ },
+ dataType: "number",
+ slot: true,
+ rules: [{
+ required: true,
+ message: "请选择学历",
+ trigger: "blur"
+ }]
+},
+{
+ label: "政治面貌",
+ prop: "politicaloutlook",
+ hide: true,
+ overHidden: true
+},
+{
+ label: "身高",
+ prop: "height",
+ hide: true,
+ overHidden: true
+},
+{
+ label: "联系地址",
+ prop: "address",
+ hide: true,
+ overHidden: true
+},
+{
+ label: "户口所在地",
+ prop: "registered",
+ hide: true,
+ overHidden: true
+},
+{
+ label: "入职时间",
+ prop: "rtime",
+ type: 'date',
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ hide: true,
+ overHidden: true
+},
+{
+ label: "用户性别",
+ prop: "sex",
+ type: "select",
+ dicData: [{
+ label: "男",
+ value: 1
},
{
- label: "登录账号",
- prop: "account",
- disabled: true
+ label: "女",
+ value: 2
},
{
- label: "用户姓名",
- prop: "realName",
- rules: [{
- required: true,
- message: "请输入用户姓名",
- trigger: "blur"
- }, {
- min: 2,
- max: 5,
- message: '姓名长度在2到5个字符'
- }]
- },
- {
- label: "用户昵称",
- prop: "name"
- },
- {
- label: "手机号码",
- prop: "phone",
- overHidden: true,
- rules: [{
- required: true,
- message: "请输入手机号",
- trigger: "blur"
- }]
- },
- {
- label: "电子邮箱",
- prop: "email",
- hide: true,
- overHidden: true
- },
- {
- label: "身份证号",
- prop: "cardid",
- hide: true,
- overHidden: true,
- rules: [{
- required: true,
- message: "请输入身份证号",
- trigger: "blur"
- }]
- },
- {
- label: "籍贯",
- prop: "nativeplace",
- hide: true,
- overHidden: true
- },
- {
- label: "民族",
- prop: "nation",
- hide: true,
- overHidden: true
- },
- {
- label: "最高学历",
- prop: "education",
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=educationType",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- dataType: "number",
- slot: true,
- rules: [{
- required: true,
- message: "请选择学历",
- trigger: "blur"
- }]
- },
- {
- label: "政治面貌",
- prop: "politicaloutlook",
- hide: true,
- overHidden: true
- },
- {
- label: "身高",
- prop: "height",
- hide: true,
- overHidden: true
- },
- {
- label: "联系地址",
- prop: "address",
- hide: true,
- overHidden: true
- },
- {
- label: "户口所在地",
- prop: "registered",
- hide: true,
- overHidden: true
- },
- {
- label: "入职时间",
- prop: "rtime",
- type: 'date',
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd",
- hide: true,
- overHidden: true
- },
- {
- label: "用户性别",
- prop: "sex",
- type: "select",
- dicData: [{
- label: "男",
- value: 1
- },
- {
- label: "女",
- value: 2
- },
- {
- label: "未知",
- value: 3
- }
- ],
- hide: true
- },
- {
- label: "用户生日",
- type: "date",
- prop: "birthday",
- hide: true
+ label: "未知",
+ value: 3
}
+ ],
+ hide: true
+},
+{
+ label: "用户生日",
+ type: "date",
+ prop: "birthday",
+ hide: true
+}
]
@@ -415,62 +415,62 @@
//表现
export var trackRecordColumn = [{
- label: "id",
- prop: "id",
- hide: true,
- editDisplay: false,
- addDisplay: false
- }, {
- label: '时间',
- type: 'date',
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd",
- prop: "time",
- formslot: true,
- },
- // {
- // label: '工作态度',
- // prop: "workingattitude",
- // formslot: true,
+ label: "id",
+ prop: "id",
+ hide: true,
+ editDisplay: false,
+ addDisplay: false
+}, {
+ label: '时间',
+ type: 'date',
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ prop: "time",
+ formslot: true,
+},
+// {
+// label: '工作态度',
+// prop: "workingattitude",
+// formslot: true,
+// },
+{
+ label: '工作表现',
+ prop: "achievements",
+ formslot: true,
+}, {
+ label: '表现评定',
+ prop: "score",
+ type: "select",
+ // dicUrl: "/api/blade-system/dict-biz/dictionary?code=scoreType",
+ // props: {
+ // label: "dictValue",
+ // value: "dictKey"
// },
+ dicData: [{
+ label: "优秀",
+ value: 0
+ },
{
- label: '工作表现',
- prop: "achievements",
- formslot: true,
- }, {
- label: '表现评定',
- prop: "score",
- type: "select",
- // dicUrl: "/api/blade-system/dict-biz/dictionary?code=scoreType",
- // props: {
- // label: "dictValue",
- // value: "dictKey"
- // },
- dicData: [{
- label: "优秀",
- value: 0
- },
- {
- label: "良好",
- value: 1
- },
- {
- label: "一般",
- value: 2
- },
- {
- label: "差",
- value: 3
- },
- ],
- dataType: "number",
- slot: true,
- rules: [{
- required: true,
- message: "请选择表现",
- trigger: "blur"
- }]
- }
+ label: "良好",
+ value: 1
+ },
+ {
+ label: "一般",
+ value: 2
+ },
+ {
+ label: "差",
+ value: 3
+ },
+ ],
+ dataType: "number",
+ slot: true,
+ rules: [{
+ required: true,
+ message: "请选择表现",
+ trigger: "blur"
+ }]
+}
// {
// label: '服务公司',
// prop: "departmentName",
@@ -480,338 +480,338 @@
export var securityFormPageColumn = [{
- label: "姓名",
- prop: "realName",
- search: true,
- searchSpan: 3,
- width: 60,
- searchLabelWidth: 50,
- display: false
+ label: "姓名",
+ prop: "realName",
+ search: true,
+ searchSpan: 3,
+ width: 65,
+ searchLabelWidth: 50,
+ display: false
+},
+{
+ label: "企业名称",
+ searchLabelWidth: "80",
+ // prop: "deptName",
+ prop: "deptId",
+ type: "tree",
+ // dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
+ props: {
+ label: "title",
+ value: "id",
+ },
+ // hide: true,
+ slot: true,
+ searchSpan: 5,
+ display: false,
+ search: true,
+ minWidth: 160
+},
+{
+ label: "性别",
+ prop: "sexs",
+ sortable: true,
+ width: 75,
+ type: "select",
+ dicData: [{
+ label: "男",
+ value: 1,
},
{
- label: "企业名称",
- searchLabelWidth: "80",
- // prop: "deptName",
- prop: "deptId",
- type: "tree",
- // dicUrl: "/api/blade-system/dept/security_lazy-tree?parentId=1413470343230877697",
- props: {
- label: "title",
- value: "id",
- },
- // hide: true,
- slot: true,
- searchSpan: 5,
- display: false,
- search: true,
- minWidth: 260
+ label: "女",
+ value: 2,
},
- {
- label: "性别",
- prop: "sexs",
- sortable: true,
- width: 70,
- type: "select",
- dicData: [{
- label: "男",
- value: 1,
- },
- {
- label: "女",
- value: 2,
- },
- // {
- // label: "未知",
- // value: 3,
- // },
- ],
- display: false
- },
- {
- label: "身份证号码",
- prop: "cardid",
- search: true,
- searchLabelWidth: 90,
- searchSpan: 5,
- width: 140,
- display: false
- },
- {
- label: "照片",
- prop: "avatar",
- type: "upload",
- listType: "picture-img",
- width: 60,
- display: false
- },
- {
- label: "籍贯",
- prop: "nativeplace",
- hide: true,
- display: false
- },
- {
- label: "民族",
- prop: "nation",
- hide: true,
- width: 55,
- display: false
- },
- {
- label: "出生日期",
- prop: "birthday",
- type: "date",
- format: "yyyy-MM-dd",
- valueFormat: "yyyy-MM-dd",
- display: false,
- hide: true,
- },
- {
- label: "年龄",
- prop: "age",
- width: 55,
+ // {
+ // label: "未知",
+ // value: 3,
+ // },
+ ],
+ display: false
+},
+{
+ label: "身份证号码",
+ prop: "cardid",
+ search: true,
+ searchLabelWidth: 90,
+ searchSpan: 5,
+ width: 140,
+ display: false
+},
+{
+ label: "照片",
+ prop: "avatar",
+ type: "upload",
+ listType: "picture-img",
+ width: 60,
+ display: false
+},
+{
+ label: "籍贯",
+ prop: "nativeplace",
+ hide: true,
+ display: false
+},
+{
+ label: "民族",
+ prop: "nation",
+ hide: true,
+ width: 55,
+ display: false
+},
+{
+ label: "出生日期",
+ prop: "birthday",
+ type: "date",
+ format: "yyyy-MM-dd",
+ valueFormat: "yyyy-MM-dd",
+ display: false,
+ hide: true,
+},
+{
+ label: "年龄",
+ prop: "age",
+ width: 55,
- display: false
- },
- // {
- // label: "学历",
- // prop: "education",
- // display: false,
- // width: 90,
- // dicUrl: "/api/blade-system/dict-biz/dictionary?code=educationType",
- // props: {
- // label: "dictValue",
- // value: "dictKey"
- // },
- // type: "select",
- // // hide: true,
- // rules: [{
- // required: true,
- // message: "请选择学历",
- // trigger: "blur"
- // }],
- // },
- {
- label: "联系电话",
- prop: "phone",
- minWidth: 70,
- display: false
+ display: false
+},
+// {
+// label: "学历",
+// prop: "education",
+// display: false,
+// width: 90,
+// dicUrl: "/api/blade-system/dict-biz/dictionary?code=educationType",
+// props: {
+// label: "dictValue",
+// value: "dictKey"
+// },
+// type: "select",
+// // hide: true,
+// rules: [{
+// required: true,
+// message: "请选择学历",
+// trigger: "blur"
+// }],
+// },
+{
+ label: "联系电话",
+ prop: "phone",
+ minWidth: 80,
+ display: false
+},
+{
+ label: "健康状态",
+ prop: "healstats",
+ hide: true,
+ display: false
+},
+{
+ label: "保安证编号",
+ prop: "securitynumber",
+ search: true,
+ searchLabelWidth: 90,
+ sortable: true,
+ width: 118,
+ searchSpan: 5,
+ addDisplay: false,
+ editDisplay: false,
+ // hide: true,
+},
+{
+ label: "入职时间",
+ prop: "rtime",
+ hide: true,
+ display: false
+},
+{
+ label: '是否派遣',
+ prop: 'dispatch',
+ type: 'select',
+ sortable: true,
+ editDisplay: false,
+ search: true,
+ width: 110,
+ searchSpan: 4,
+ addDisplay: false,
+ dicData: [{
+ label: '全部',
+ value: '2'
},
{
- label: "健康状态",
- prop: "healstats",
- hide: true,
- display: false
+ label: '已派遣',
+ value: '0'
},
{
- label: "保安证编号",
- prop: "securitynumber",
- search: true,
- searchLabelWidth: 90,
- sortable: true,
- width: 110,
- searchSpan: 5,
- addDisplay: false,
- editDisplay: false,
- // hide: true,
+ label: '未派遣',
+ value: '1'
+ }
+ ]
+},
+{
+ label: "是否持证",
+ prop: "hold",
+ slot: true,
+ sortable: true,
+ search: true,
+ searchSpan: 4,
+ width: 110,
+ type: "select",
+ dicData: [{
+ label: "是",
+ value: "1",
},
{
- label: "入职时间",
- prop: "rtime",
- hide: true,
- display: false
+ label: "否",
+ value: "2",
},
{
- label: '是否派遣',
- prop: 'dispatch',
- type: 'select',
- sortable: true,
- editDisplay: false,
- search: true,
- width: 80,
- searchSpan: 3,
- addDisplay: false,
- dicData: [{
- label: '全部',
- value: '2'
- },
- {
- label: '已派遣',
- value: '0'
- },
- {
- label: '未派遣',
- value: '1'
- }
- ]
+ label: "已吊销",
+ value: "3",
},
- {
- label: "是否持证",
- prop: "hold",
- slot: true,
- sortable: true,
- search: true,
- searchSpan: 3,
- width: 69,
- type: "select",
- dicData: [{
- label: "是",
- value: "1",
- },
- {
- label: "否",
- value: "2",
- },
- {
- label: "已吊销",
- value: "3",
- },
- ],
- display: false,
- rules: [{
- required: true,
- message: "请选择",
- trigger: "blur"
- }],
- },
+ ],
+ display: false,
+ rules: [{
+ required: true,
+ message: "请选择",
+ trigger: "blur"
+ }],
+},
- {
- label: "是否制证",
- prop: "userType",
- type: "select",
- sortable: true,
- slot: true,
- search: true,
- // searchValue: 7,
- editDisplay: false,
- addDisplay: false,
- searchSpan: 3,
- width: 69,
- dicData: [{
- label: "已制证",
- value: 6,
- },
- {
- label: "未制证",
- value: 7,
- }
- ],
+{
+ label: "是否制证",
+ prop: "userType",
+ type: "select",
+ sortable: true,
+ slot: true,
+ search: true,
+ // searchValue: 7,
+ editDisplay: false,
+ addDisplay: false,
+ searchSpan: 3,
+ width: 110,
+ dicData: [{
+ label: "已制证",
+ value: 6,
},
+ {
+ label: "未制证",
+ value: 7,
+ }
+ ],
+},
- // {
- // label: "发证日期",
- // prop: "papertime",
- // type: "date",
- // format: "yyyy-MM-dd",
- // valueFormat: "yyyy-MM-dd",
- // // searchRange: true,
- // // searchSpan: 6,
- // // hide: true,
- // // addDisplay: false,
- // // editDisplay: false,
- // // viewDisplay: false,
- // // search: true,
- // // rules: [{
- // // required: true,
- // // message: "请输入时间",
- // // trigger: "blur"
- // // }]
- // },
- {
- label: "有无照片",
- prop: "isAvatar",
- type: "select",
- search: true,
- minWidth: 105,
- searchSpan: 3,
- addDisplay: false,
- editDisplay: false,
- hide: true,
- display: false,
- dicData: [{
- label: "全部",
- value: 3,
- },
- {
- label: "有",
- value: 1,
- },
- {
- label: "无",
- value: 2,
- },
- ],
+// {
+// label: "发证日期",
+// prop: "papertime",
+// type: "date",
+// format: "yyyy-MM-dd",
+// valueFormat: "yyyy-MM-dd",
+// // searchRange: true,
+// // searchSpan: 6,
+// // hide: true,
+// // addDisplay: false,
+// // editDisplay: false,
+// // viewDisplay: false,
+// // search: true,
+// // rules: [{
+// // required: true,
+// // message: "请输入时间",
+// // trigger: "blur"
+// // }]
+// },
+{
+ label: "有无照片",
+ prop: "isAvatar",
+ type: "select",
+ search: true,
+ minWidth: 105,
+ searchSpan: 3,
+ addDisplay: false,
+ editDisplay: false,
+ hide: true,
+ display: false,
+ dicData: [{
+ label: "全部",
+ value: 3,
},
{
- label: "是否采集指纹",
- prop: "isFingerprint",
- type: "select",
- search: true,
- searchLabelWidth: 110,
- minWidth: 105,
- searchSpan: 4,
- addDisplay: false,
- editDisplay: false,
- hide: true,
- display: false,
- dicData: [{
- label: "全部",
- value: 3,
- },
- {
- label: "是",
- value: 1,
- },
- {
- label: "否",
- value: 2,
- },
- ],
+ label: "有",
+ value: 1,
},
{
- label: "在职状态",
- prop: "status",
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=workerState",
- props: {
- label: "dictValue",
- value: "dictKey"
- },
- dataType: "number",
- searchValue: 1,
- display: false,
- hide: true,
- searchSpan: 3,
- width: 80,
- search: true,
- rules: [{
- required: true,
- message: "请选择在职状态",
- trigger: "blur"
- }]
+ label: "无",
+ value: 2,
+ },
+ ],
+},
+{
+ label: "是否采集指纹",
+ prop: "isFingerprint",
+ type: "select",
+ search: true,
+ searchLabelWidth: 110,
+ minWidth: 105,
+ searchSpan: 4,
+ addDisplay: false,
+ editDisplay: false,
+ hide: true,
+ display: false,
+ dicData: [{
+ label: "全部",
+ value: 3,
},
{
- label: "审查状态",
- prop: "examinationType",
- type: "select",
- sortable: true,
- display: false,
- searchSpan: 3,
- search: false,
- hide: true,
- width: 80,
- dicData: [{
- label: "全部",
- value: 6,
- },
- {
- label: "正常",
- value: "0",
- },
- {
- label: "异常",
- value: "1",
- }
- ],
+ label: "是",
+ value: 1,
},
+ {
+ label: "否",
+ value: 2,
+ },
+ ],
+},
+{
+ label: "在职状态",
+ prop: "status",
+ type: "select",
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=workerState",
+ props: {
+ label: "dictValue",
+ value: "dictKey"
+ },
+ dataType: "number",
+ searchValue: 1,
+ display: false,
+ hide: true,
+ searchSpan: 3,
+ width: 80,
+ search: true,
+ rules: [{
+ required: true,
+ message: "请选择在职状态",
+ trigger: "blur"
+ }]
+},
+{
+ label: "审查状态",
+ prop: "examinationType",
+ type: "select",
+ sortable: true,
+ display: false,
+ searchSpan: 3,
+ search: false,
+ hide: true,
+ width: 110,
+ dicData: [{
+ label: "全部",
+ value: 6,
+ },
+ {
+ label: "正常",
+ value: "0",
+ },
+ {
+ label: "异常",
+ value: "1",
+ }
+ ],
+},
]
\ No newline at end of file
diff --git a/src/views/securityGuard/securityGuard.vue b/src/views/securityGuard/securityGuard.vue
index f997a1d..9cd362c 100644
--- a/src/views/securityGuard/securityGuard.vue
+++ b/src/views/securityGuard/securityGuard.vue
@@ -20,6 +20,8 @@
]"
>
<avue-crud
+ class="tablesss"
+ :key="option.height"
:option="option"
:search.sync="search"
:table-loading="loading"
@@ -168,7 +170,7 @@
:type="type"
v-if="permission.securityGuard_delete && row.status != 2"
@click.stop="rowStatus(row)"
- >离职登记
+ >离职
</el-button>
<el-button
icon="el-icon-edit"
@@ -397,6 +399,7 @@
</el-col>
<div
:class="[
+ 'downSFZ',
$store.state.control.windowWidth >= 1024
? 'downSFZqudong'
: 'downSFZqudongS',
@@ -601,6 +604,12 @@
callback();
}
};
+ // let table = document.getElementsByClassName("tablesss");
+ // let heard = table[0].getElementsByClassName("avue-crud__search");
+ // let usNum =
+ // this.windowWidth <= 1376 && this.windowHeight <= 778 ? 170 : 332;
+ // // that.option.height = +h - (+heard[0].clientHeight + 332);
+ // let optionHeight = +this.windowHeight - (+heard[0].clientHeight + +usNum);
return {
sort: "",
sortName: "",
@@ -750,6 +759,8 @@
},
choiceList: [],
option: {
+ searchIndex: 5, //收缩展示数量
+ searchIcon: true, //搜索是否收缩
height: "auto",
calcHeight: 80,
tip: true,
@@ -997,12 +1008,14 @@
label: "保安员证编号",
prop: "securitynumber",
hide: true,
- display:true,
- rules: [{
+ display: true,
+ rules: [
+ {
required: false,
message: "请输入保安员证编号",
trigger: "blur",
- }],
+ },
+ ],
},
// {
// label: "发证日期",
@@ -1275,19 +1288,54 @@
},
],
},
+ tablevisible: true,
+ isNotChangeSize: true, //取消表格loging
};
},
watch: {
- // windowHeight() {
- // let d = {
- // option: this.option,
- // fn: function () {
- // console.log(123);
- // },
- // add: 100,
- // };
- // this.$store.dispatch("WHchangeHight", d);
- // },
+ windowHeight() {
+ let that = this;
+ that.isNotChangeSize = false; //取消表格loging
+ let d = {
+ fn: function (h) {
+ let table = document.getElementsByClassName("tablesss");
+ let heard = table[0].getElementsByClassName("avue-crud__search");
+ let usNum =
+ that.windowWidth <= 1376 || that.windowHeight <= 778 ? 170 : 302;
+ // // that.option.height = +h - (+heard[0].clientHeight + 332);
+ // alert(h);
+ let doit = (height) => {
+ let hs = height || h;
+ // alert(hs);
+ // alert(heard[0].clientHeight);
+ // alert(usNum);
+ that.option.height = +hs - (+heard[0].clientHeight + +usNum);
+ that.$nextTick(() => {
+ that.refreshChange();
+ setTimeout(() => {
+ let d = {
+ that: this,
+ otherclass: ["downSFZ"],
+ haveOpen: true,
+ };
+ //刷新表格后再次调整按钮
+ that.$store.dispatch("TABLE_CHANGEBUTPOSITION", d);
+ that.isNotChangeSize = true; //恢复表格loging
+ }, 10);
+ });
+ };
+ if (that.option.height == "auto") {
+ //解决第一次未渲染成功会报错的问题
+ setTimeout(() => {
+ doit(window.innerHeight);
+ }, 150);
+ } else {
+ doit();
+ }
+ },
+ };
+ this.$store.dispatch("WHchangeHight", d);
+ },
radio() {
if (this.radio) {
this.SFZloding = true;
@@ -1306,31 +1354,34 @@
this.initData(this.form.tenantId);
}
},
- "form.hold":{
- handler(val){
- var securitynumbercolumn =this.findObject(this.option.group,'securitynumber')
+ "form.hold": {
+ handler(val) {
+ var securitynumbercolumn = this.findObject(
+ this.option.group,
+ "securitynumber"
+ );
// console.log(val,1234);
- if(val==1){
- securitynumbercolumn.display=true;
- securitynumbercolumn.rules=[
- {
- required: true,
- message: "请输入保安员证编号",
- trigger: "blur",
- }
+ if (val == 1) {
+ securitynumbercolumn.display = true;
+ securitynumbercolumn.rules = [
+ {
+ required: true,
+ message: "请输入保安员证编号",
+ trigger: "blur",
+ },
];
- }else{
- securitynumbercolumn.display=false;
- securitynumbercolumn.rules=[
- {
- required: false,
- message: "请输入保安员证编号",
- trigger: "blur",
- }
+ } else {
+ securitynumbercolumn.display = false;
+ securitynumbercolumn.rules = [
+ {
+ required: false,
+ message: "请输入保安员证编号",
+ trigger: "blur",
+ },
];
}
},
- immediate: true
+ immediate: true,
},
"form.fingerprint"() {
let that = this;
@@ -1371,7 +1422,7 @@
}
});
};
-
+
setTimeout(() => {
// var iframeDom = document.getElementById("zhiwen");
// console.log(iframeDom,111111);
@@ -1395,7 +1446,7 @@
},
},
computed: {
- ...mapGetters(["userInfo", "permission", "windowHeight"]),
+ ...mapGetters(["userInfo", "permission", "windowHeight", "windowWidth"]),
permissionList() {
return {
addBtn: this.vaildData(this.permission.securityGuard_add, false),
@@ -1483,6 +1534,15 @@
}
},
mounted() {
+ // let d = {
+ // that: this,
+ // otherclass: ["downSFZ"],
+ // haveOpen: true,
+ // flowHeight: 332,
+ // };
+ // this.$store.dispatch("TABLE_CHANGEBUTPOSITION", d);
+ // console.log((this.$refs.crud._props.option.height = 200));
+ this.changeButsPosition("TABLE_CHANGEBUTPOSITION");
// this.option.column[0].hide = true
// 非保安单位模式默认加载管理组数据
if (!website.tenantMode) {
@@ -1498,6 +1558,17 @@
// this.olondSFZ(); //检查身份证设备是否存在
},
methods: {
+ changeButsPosition(val) {
+ let d = {
+ that: this,
+ otherclass: ["downSFZ"],
+ haveOpen: true,
+ from: "mounted",
+ };
+ // 开始就适应高度
+ this.$store.commit("setWindowSizeHeightAdd");
+ this.$store.dispatch("TABLE_CHANGEBUTPOSITION", d);
+ },
openccc() {
console.log(this.zhiwenImg);
// console.log(this.zhiwenChart);
@@ -2477,6 +2548,9 @@
this.onLoad(this.page, this.query);
},
onLoad(page, params = {}) {
+ if (this.isNotChangeSize) {
+ this.loading = true;
+ }
params = this.search;
var that = this;
//获取当前登录人员的角色信息
@@ -2569,7 +2643,6 @@
...that.query,
};
- that.loading = true;
getList(page.currentPage, page.pageSize, values).then((res) => {
const data = res.data.data;
that.page.total = data.total;
--
Gitblit v1.9.3