|
|
@@ -1,396 +1,111 @@
|
|
|
<template>
|
|
|
- <basic-container>
|
|
|
-<!-- 卡片数据展示-->
|
|
|
- <el-card style="margin-bottom: 20px">
|
|
|
-<!-- <template slot="header">-->
|
|
|
-<!-- 出入统计数据-->
|
|
|
- <el-tabs type="border-card">
|
|
|
- <el-tab-pane label="数据统计"><avue-data-box :option="AccessRecord"></avue-data-box></el-tab-pane>
|
|
|
-<!-- <el-tab-pane label="本周数据"><avue-data-icon :option="weekAccessRecord"></avue-data-icon></el-tab-pane>-->
|
|
|
-<!-- <el-tab-pane label="本月数据"><avue-data-icon :option="monthAccessRecord"></avue-data-icon></el-tab-pane>-->
|
|
|
-<!-- <el-tab-pane label="今年数据"><avue-data-icon :option="yearAccessRecord"></avue-data-icon></el-tab-pane>-->
|
|
|
- </el-tabs>
|
|
|
-<!-- </template>-->
|
|
|
- </el-card>
|
|
|
-
|
|
|
-
|
|
|
- <avue-crud :option="option"
|
|
|
- :table-loading="loading"
|
|
|
- :data="data"
|
|
|
- :page.sync="page"
|
|
|
- :permission="permissionList"
|
|
|
- :before-open="beforeOpen"
|
|
|
- v-model="form"
|
|
|
- ref="crud"
|
|
|
- @row-update="rowUpdate"
|
|
|
- @row-save="rowSave"
|
|
|
- @row-del="rowDel"
|
|
|
- @search-change="searchChange"
|
|
|
- @search-reset="searchReset"
|
|
|
- @selection-change="selectionChange"
|
|
|
- @current-change="currentChange"
|
|
|
- @size-change="sizeChange"
|
|
|
- @refresh-change="refreshChange"
|
|
|
- @on-load="onLoad">
|
|
|
- </avue-crud>
|
|
|
- </basic-container>
|
|
|
+ <div class="page" style="height: 55.5rem;">
|
|
|
+ <div class="tabs">
|
|
|
+ <div class="tabs_item center" @click="compsName=item.compsName"
|
|
|
+ :class="compsName==item.compsName?'tabs_active':''" v-for="(item,index) in tabList" :key="index">
|
|
|
+ <i class="tabs_icon " :class="item.icon"></i>
|
|
|
+ <span class="tabs_label">{{item.label}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="content" style="height: calc(90% - 40px)">
|
|
|
+ <keep-alive>
|
|
|
+ <component :is="compsName"></component>
|
|
|
+ </keep-alive>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
-
|
|
|
<script>
|
|
|
- import {getList, getDetail, add, update, remove, getAccessCount} from "@/api/estate/accessrecord";
|
|
|
- import {mapGetters} from "vuex";
|
|
|
-
|
|
|
export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- //今年数据
|
|
|
- AccessRecord:{
|
|
|
- span:6,
|
|
|
- data: [
|
|
|
- {
|
|
|
- title: '今日数据',
|
|
|
- count: 0,
|
|
|
- icon: 'el-icon-user-solid',
|
|
|
- color: 'rgb(49, 180, 141)',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '本周数据',
|
|
|
- count: 0,
|
|
|
- icon: 'el-icon-user-solid',
|
|
|
- color: 'rgb(56, 161, 242)',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '本月数据',
|
|
|
- count: 0,
|
|
|
- icon: 'el-icon-user-solid',
|
|
|
- color: 'rgb(117, 56, 199)',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '今年数据',
|
|
|
- count: 0,
|
|
|
- icon: 'el-icon-user-solid',
|
|
|
- color: 'rgb(143,119,0)',
|
|
|
- },
|
|
|
- ]
|
|
|
- },
|
|
|
- enterpriseColumn: {
|
|
|
- label: "所属企业",
|
|
|
- prop: "enterpriseId",
|
|
|
- type: "select",
|
|
|
- search: true,
|
|
|
- width:200,
|
|
|
- filterable: true,
|
|
|
- dicUrl: "/api/cyzh-enterprise/enterprise/list?size=9999",
|
|
|
- props:{
|
|
|
- label:"enterpriseName",
|
|
|
- value:"id"
|
|
|
- },
|
|
|
- dicFormatter: (res)=>{
|
|
|
- return res.data.records;
|
|
|
- },
|
|
|
- searchFilterable: true,
|
|
|
- },
|
|
|
- form: {},
|
|
|
- query: {},
|
|
|
- loading: true,
|
|
|
- page: {
|
|
|
- pageSize: 10,
|
|
|
- currentPage: 1,
|
|
|
- total: 0
|
|
|
- },
|
|
|
- selectionList: [],
|
|
|
- option: {
|
|
|
- height:'auto',
|
|
|
- // calcHeight: 30,
|
|
|
- tip: false,
|
|
|
- searchShow: true,
|
|
|
- searchMenuSpan: 6,
|
|
|
- border: true,
|
|
|
- index: true,
|
|
|
- addBtn: false,
|
|
|
- delBtn: false,
|
|
|
- editBtn: false,
|
|
|
- viewBtn: true,
|
|
|
- selection: true,
|
|
|
- dialogClickModal: false,
|
|
|
- column: [
|
|
|
- {
|
|
|
- label: "用户姓名",
|
|
|
- prop: "userName",
|
|
|
- width:80,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入用户姓名",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "人脸",
|
|
|
- prop: "faceUrl",
|
|
|
- type:'upload',
|
|
|
- width:100,
|
|
|
- listType: 'picture-img',
|
|
|
- propsHttp: {
|
|
|
- res: "data",
|
|
|
- url: "link"
|
|
|
- },
|
|
|
- tip: '只能生产jpg/png图片,且不超过500kb',
|
|
|
- action: "/api/blade-resource/oss/endpoint/put-file",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入人脸",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "开门方式",
|
|
|
- prop: "openType",
|
|
|
- type:"select",
|
|
|
- dicData:[
|
|
|
- {
|
|
|
- label:'刷脸开门',
|
|
|
- value:1
|
|
|
- },{
|
|
|
- label:'远程开门',
|
|
|
- value:2
|
|
|
- }
|
|
|
- ],
|
|
|
- },
|
|
|
- {
|
|
|
- label: "体温(℃)",
|
|
|
- prop: "temperature",
|
|
|
- width:80,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入体温",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "用户类型",
|
|
|
- prop: "userType",
|
|
|
- type: "select",
|
|
|
- value: 4,
|
|
|
- editDisplay: false,
|
|
|
- addDisplay: false,
|
|
|
- dicData:[
|
|
|
- {
|
|
|
- label: "企业员工",
|
|
|
- value: 2
|
|
|
- },
|
|
|
- {
|
|
|
- label: "服务人员",
|
|
|
- value: 3
|
|
|
- },
|
|
|
- {
|
|
|
- label: "访客",
|
|
|
- value: 4
|
|
|
- },
|
|
|
- {
|
|
|
- label: "管理员",
|
|
|
- value: 5
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "所属园区",
|
|
|
- prop: "agencyName",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "所属区域",
|
|
|
- prop: "residentialName",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "设备编码",
|
|
|
- prop: "deviceId",
|
|
|
- hide:true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入设备唯一标识",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "设备名称",
|
|
|
- prop: "deviceName",
|
|
|
- },
|
|
|
- {
|
|
|
- label: "设备mac码",
|
|
|
- prop: "deviceMac",
|
|
|
- hide:true,
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入设备mac码",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- {
|
|
|
- label: "开门时间",
|
|
|
- prop: "openTime",
|
|
|
- rules: [{
|
|
|
- required: true,
|
|
|
- message: "请输入开门时间",
|
|
|
- trigger: "blur"
|
|
|
- }]
|
|
|
- },
|
|
|
- ]
|
|
|
- },
|
|
|
- data: []
|
|
|
- };
|
|
|
+ components: {
|
|
|
+ trajectoryMap:()=>import('@/components/map/trajectory-map/trajectory-map.vue'),
|
|
|
+ facetrajectoryCrud:()=>import('./form/facetrajectory-crud.vue')
|
|
|
},
|
|
|
- computed: {
|
|
|
- ...mapGetters(["permission"]),
|
|
|
- permissionList() {
|
|
|
- return {
|
|
|
- addBtn: this.vaildData(this.permission.accessrecord_add, false),
|
|
|
- viewBtn: this.vaildData(this.permission.accessrecord_view, false),
|
|
|
- delBtn: this.vaildData(this.permission.accessrecord_delete, false),
|
|
|
- editBtn: this.vaildData(this.permission.accessrecord_edit, false)
|
|
|
- };
|
|
|
- },
|
|
|
- ids() {
|
|
|
- let ids = [];
|
|
|
- this.selectionList.forEach(ele => {
|
|
|
- ids.push(ele.id);
|
|
|
- });
|
|
|
- return ids.join(",");
|
|
|
+ provide() {
|
|
|
+ return {
|
|
|
+ 'changeTabs': this.changeTabs,
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
- const tenantType = localStorage.getItem("tenantType");
|
|
|
- let agencyNameProp = this.findObject(this.option.column,"agencyName");
|
|
|
- let residentialNameProp = this.findObject(this.option.column,"residentialName");
|
|
|
- if (tenantType == 0){
|
|
|
- //园区
|
|
|
- agencyNameProp.label="所属园区";
|
|
|
- residentialNameProp.label="所属区域";
|
|
|
- }else if (tenantType == 1){
|
|
|
- //园区
|
|
|
- agencyNameProp.label = "所属园区";
|
|
|
- this.option.column.splice(5,0,this.enterpriseColumn)
|
|
|
- residentialNameProp.label="所属区域";
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ compsName: 'trajectoryMap',
|
|
|
+ tabList: [{
|
|
|
+ icon: 'el-icon-place',
|
|
|
+ label: '轨迹地图',
|
|
|
+ compsName: 'trajectoryMap',
|
|
|
+ }, {
|
|
|
+ icon: 'el-icon-user',
|
|
|
+ label: '人员轨迹',
|
|
|
+ compsName: 'facetrajectoryCrud',
|
|
|
+ }]
|
|
|
}
|
|
|
},
|
|
|
- methods: {
|
|
|
- rowSave(row, done, loading) {
|
|
|
- add(row).then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- done();
|
|
|
- }, error => {
|
|
|
- loading();
|
|
|
- window.console.log(error);
|
|
|
- });
|
|
|
- },
|
|
|
- rowUpdate(row, index, done, loading) {
|
|
|
- update(row).then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- done();
|
|
|
- }, error => {
|
|
|
- loading();
|
|
|
- console.log(error);
|
|
|
- });
|
|
|
- },
|
|
|
- rowDel(row) {
|
|
|
- this.$confirm("确定将选择数据删除?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- return remove(row.id);
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- handleDelete() {
|
|
|
- if (this.selectionList.length === 0) {
|
|
|
- this.$message.warning("请选择至少一条数据");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.$confirm("确定将选择数据删除?", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning"
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- return remove(this.ids);
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.onLoad(this.page);
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "操作成功!"
|
|
|
- });
|
|
|
- this.$refs.crud.toggleSelection();
|
|
|
- });
|
|
|
- },
|
|
|
- beforeOpen(done, type) {
|
|
|
- if (["edit", "view"].includes(type)) {
|
|
|
- getDetail(this.form.id).then(res => {
|
|
|
- this.form = res.data.data;
|
|
|
- });
|
|
|
- }
|
|
|
- done();
|
|
|
- },
|
|
|
- searchReset() {
|
|
|
- this.query = {};
|
|
|
- this.onLoad(this.page);
|
|
|
- },
|
|
|
- searchChange(params, done) {
|
|
|
- this.query = params;
|
|
|
- this.page.currentPage = 1;
|
|
|
- this.onLoad(this.page, params);
|
|
|
- done();
|
|
|
- },
|
|
|
- selectionChange(list) {
|
|
|
- this.selectionList = list;
|
|
|
- },
|
|
|
- selectionClear() {
|
|
|
- this.selectionList = [];
|
|
|
- this.$refs.crud.toggleSelection();
|
|
|
- },
|
|
|
- currentChange(currentPage){
|
|
|
- this.page.currentPage = currentPage;
|
|
|
- },
|
|
|
- sizeChange(pageSize){
|
|
|
- this.page.pageSize = pageSize;
|
|
|
- },
|
|
|
- refreshChange() {
|
|
|
- this.onLoad(this.page, this.query);
|
|
|
- },
|
|
|
- onLoad(page, params = {}) {
|
|
|
- params.userType = 4;
|
|
|
- this.loading = true;
|
|
|
- getAccessCount().then(res=>{
|
|
|
- console.log(res,"打印res")
|
|
|
- this.AccessRecord.data[0].count = res.data.dayCount;
|
|
|
- this.AccessRecord.data[1].count = res.data.weekCount;
|
|
|
- this.AccessRecord.data[2].count = res.data.monthCount;
|
|
|
- this.AccessRecord.data[3].count = res.data.yearCount;
|
|
|
- });
|
|
|
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
|
|
|
- const data = res.data.data;
|
|
|
- this.page.total = data.total;
|
|
|
- this.data = data.records;
|
|
|
- this.loading = false;
|
|
|
- this.selectionClear();
|
|
|
- });
|
|
|
+ methods:{
|
|
|
+ changeTabs(name){
|
|
|
+ this.compsName=name
|
|
|
}
|
|
|
- }
|
|
|
- };
|
|
|
+ },
|
|
|
+ }
|
|
|
</script>
|
|
|
|
|
|
-<style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+ * {
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
+
|
|
|
+ .page {
|
|
|
+ background-color: #fff;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ /deep/ #avue-view {
|
|
|
+ margin-top: -10px !important;
|
|
|
+ }
|
|
|
+
|
|
|
+ .center {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-content: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .content {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%
|
|
|
+ }
|
|
|
+
|
|
|
+ .tabs {
|
|
|
+ display: flex;
|
|
|
+ justify-content: start;
|
|
|
+ align-content: center;
|
|
|
+ padding-left: 20px;
|
|
|
+ height: 40px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tabs_item {
|
|
|
+ margin-right: 40px;
|
|
|
+ cursor: pointer;
|
|
|
+ color: #303133;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tabs_item:hover {
|
|
|
+ color: #409EFF;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tabs_label {
|
|
|
+ margin-left: 4px;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .tabs_icon {
|
|
|
+ font-size: 14px;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .tabs_active {
|
|
|
+ color: #409EFF;
|
|
|
+ font-weight: 800;
|
|
|
+ border-bottom: 1px solid #409EFF
|
|
|
+ }
|
|
|
</style>
|