Forráskód Böngészése

门禁用户通行设置,门禁app升级

wuyunfeng 2 éve
szülő
commit
59180e0587

+ 14 - 1
languages/en.js

@@ -908,6 +908,7 @@ module.exports = {
     visitation: 'Visitor',
     transferDevice: 'Transfer box',
     lcdDevice: 'LCD corridor screen',
+    entraceguard_device: 'Access control APP',
     organizationAdd: 'New Organization',
     boardShowEmptyBed: 'The board shows empty beds',
     nursingColorRgb: 'Nursing door light color',
@@ -989,7 +990,8 @@ module.exports = {
     roleManage: 'Role management',
     debugging485: '485 debugging',
     deviceFrame: 'Device space',
-    ledDevice: 'LED devices'
+    ledDevice: 'LED devices',
+    entraceguardUser:'Passage setting'
   },
   deviceType: {
     NURSE_HOST: 'Nurse Host',
@@ -1138,5 +1140,16 @@ module.exports = {
     LICENSE_EXPIRE: 'The authorization expires, please contact after-sales service',
     LICENSE_FAILED: 'Invalid authorization, please contact after-sales service',
     FILE_UPLOAD_FAILED: 'No file storage directory configured!'
+  },
+  entraceguardUser:{
+    named: 'User Name',
+    idNo:'ID number',
+    ic:'IC Card No',
+    phone:'cell-phone number',
+    password:'Access code',
+    forbidden:'No Entry',
+    refreshUser:'Refresh Users',
+    yes:'YES',
+    nop:'NO'
   }
 }

+ 14 - 1
languages/es.js

@@ -908,6 +908,7 @@ module.exports = {
     visitation: 'Visitante',
     transferDevice: 'Caja de transferencia',
     lcdDevice: 'Pantalla de pasillo LCD',
+    entraceguard_device: 'Control de acceso APP',
     organizationAdd: 'Nueva Organización',
     boardShowEmptyBed: 'El tablero muestra camas vacías',
     nursingColorRgb: 'Color de la luz de la puerta de enfermería',
@@ -989,7 +990,8 @@ module.exports = {
     roleManage: 'Administración de roles',
     debugging485: '485 depurando',
     deviceFrame: 'Espacio del dispositivo',
-    ledDevice: 'Dispositivos LED'
+    ledDevice: 'Dispositivos LED',
+    entraceguardUser:'Configuración de paso'
   },
   deviceType: {
     NURSE_HOST: 'Enfermera anfitriona',
@@ -1137,5 +1139,16 @@ module.exports = {
     LICENSE_EXPIRE: 'La autorización expira, por favor póngase en contacto con post - venta',
     LICENSE_FAILED: 'Autorización inválida, por favor póngase en contacto con post - venta',
     FILE_UPLOAD_FAILED: '¡Directorio de almacenamiento de archivos no configurado!'
+  },
+  entraceguardUser:{
+    named: 'Nombre de usuario',
+    idNo:'Número de identificación',
+    ic:'Número de tarjeta IC',
+    phone:'Número de teléfono móvil',
+    password:'Código de acceso',
+    forbidden:'Prohibición de entrar',
+    refreshUser:'Actualizar usuarios',
+    yes:'Sí.',
+    nop:'No.'
   }
 }

+ 14 - 1
languages/ru-RU.js

@@ -904,6 +904,7 @@ module.exports = {
     visitation: 'Посетитель',
     transferDevice: 'Раздаточная коробка',
     lcdDevice: 'ЖК-экран коридора',
+    entraceguard_device: 'Вход',
     organizationAdd: 'Новая организация',
     boardShowEmptyBed: 'На доске показаны пустые кровати',
     nursingColorRgb: 'Светлый цвет двери медсестер',
@@ -966,7 +967,8 @@ module.exports = {
     roleManage: 'Управление ролями',
     debugging485: '485 отладка',
     deviceFrame: 'Пространство устройства',
-    ledDevice: 'Светодиодные устройства'
+    ledDevice: 'Светодиодные устройства',
+    entraceguardUser:'Параметры прохода'
   },
   deviceType: {
     NURSE_HOST: 'Устройство медсестры',
@@ -1114,5 +1116,16 @@ module.exports = {
     LICENSE_EXPIRE: 'срок действия разрешения истекает после продажи',
     LICENSE_FAILED: 'Неверный Авторизация после продажи',
     FILE_UPLOAD_FAILED: 'каталог без профиля!'
+  },
+  entraceguardUser:{
+    named: 'Имя пользователя',
+    idNo:'Номер удостоверения личности',
+    ic:'Номер карты IC',
+    phone:'Номер телефона',
+    password:'Пароль доступа',
+    forbidden:'Запрет на передвижение',
+    refreshUser:'Actualizar usuarios',
+    yes:'Да.',
+    nop:'Нет'
   }
 }

+ 14 - 1
languages/zh-CN.js

@@ -908,6 +908,7 @@ module.exports = {
     vistitation: '探视机',
     transferDevice: '转换盒',
     lcdDevice: 'LCD走廊屏',
+    entraceguard_device: '门禁设备APP',
     organizationAdd: '新建组织',
     boardShowEmptyBed: '看板显示空床',
     nursingColorRgb: '护理门灯颜色',
@@ -990,7 +991,8 @@ module.exports = {
     roleManage: '角色管理',
     debugging485: '485调试',
     deviceFrame: '设备空间',
-    ledDevice: 'LED点阵屏'
+    ledDevice: 'LED点阵屏',
+    entraceguardUser:'用户通行设置'
   },
   deviceType: {
     NURSE_HOST: '护士主机',
@@ -1139,5 +1141,16 @@ module.exports = {
     LICENSE_EXPIRE: '授权到期,请联系售后',
     LICENSE_FAILED: '无效授权,请联系售后',
     FILE_UPLOAD_FAILED: '未配置文件存放目录!'
+  },
+  entraceguardUser:{
+    named: '用户姓名',
+    idNo:'身份证号',
+    ic:'IC卡号',
+    phone:'手机号',
+    password:'通行密码',
+    forbidden:'禁止通行',
+    refreshUser:'刷新可用用户',
+    yes:'是',
+    nop:'否'
   }
 }

+ 28 - 0
src/api/ncs_entrace_guard_user.js

@@ -0,0 +1,28 @@
+import request from '@/utils/request'
+export function getList(params) {
+    return request({
+        url: '/ncs/entrace_guard_user/page',
+        method: 'POST',
+        loading: true,
+        data: params,
+        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
+    })
+}
+
+/** 更新用户设置 */
+export function update(id, params) {
+    return request({
+        url: `/ncs/entrace_guard_user/${id}`,
+        method: 'put',
+        loading: false,
+        data: params
+    })
+}
+
+/** 更新用户记录 */
+export function refreshUser(part_id) {
+    return request({
+        url: `/ncs/entrace_guard_user/refresh/${part_id}`,
+        method: 'post'
+    })
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1 - 0
src/icons/svg/pass_through.svg


+ 13 - 0
src/router/index.js

@@ -146,6 +146,19 @@ export const partRoutes = [
       }
     ]
   },
+  {
+    path: '/entrace-guard',
+    component: Layout,
+    redirect: '/entrace-guard/users',
+    children: [
+      {
+        path: 'users',
+        component: () => import('@/views/entrace-guard/users'),
+        name: 'users',
+        meta: { title: i18n.t('tab.entraceguardUser'), icon: 'pass_through', noCache: true }
+      }
+    ]
+  },
   // {
   //   path: '/customer',
   //   component: Layout,

+ 407 - 0
src/views/entrace-guard/users.vue

@@ -0,0 +1,407 @@
+<template>
+    <div>
+
+        <ag-grid-layout
+                toolbar
+                :table-height="tableHeight"
+                theme="ag-theme-alpine"
+                :column-defs="columnDefs"
+                :row-data="rowData"
+                :locale-text="localeText"
+                :grid-options="gridOptions"
+                :default-col-def="defaultColDef"
+                :animate-rows="true"
+                :row-selection="rowSelection"
+                :framework-components="frameworkComponents"
+                @filterChanged="filterModifed"
+                @sortChanged="gridSortChange"
+        >
+
+            <div slot="toolbar" class="inner-toolbar">
+                <div class="toolbar-search">
+                    <en-table-search :placeholder="this.$t('action.keywords')" @search="handlerSearch"/>
+                </div>
+                <div class="toolbar-btns">
+                    <el-button type="primary" size="mini" @click="refreshUser">{{ this.$t('entraceguardUser.refreshUser') }}
+                    </el-button>
+                </div>
+            </div>
+            <el-pagination
+                    v-if="pageData"
+                    slot="pagination"
+                    :current-page="pageData.page_no"
+                    :page-sizes="[10, 20, 50, 100]"
+                    :page-size="pageData.page_size"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="pageData.data_total"
+                    @size-change="handlePageSizeChange"
+                    @current-change="handlePageCurrentChange"
+            />
+        </ag-grid-layout>
+
+        <!-- 用户信息 -->
+        <el-dialog :visible.sync="customerFormVisible" :title="this.$t('customerManage.customerInfo')"
+                   class="customer-dialog" width="50%">
+
+            <el-form ref="editForm" :model="formmodel" :rules="rules" label-width="145px">
+                <el-row>
+                    <el-col :span="12">
+                        <el-form-item :label="this.$t('entraceguardUser.named')" prop="name">
+                            <el-input v-model="formmodel.name" clearable
+                                      :placeholder="this.$t('entraceguardUser.named')" :maxlength="20"/>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item :label="this.$t('entraceguardUser.idNo')">
+                            <el-input v-model="formmodel.id_card" clearable
+                                      :placeholder="this.$t('entraceguardUser.idNo')" :maxlength="20"/>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+                <el-row>
+                    <el-col :span="12">
+                        <el-form-item :label="this.$t('entraceguardUser.ic')" prop="name">
+                            <el-input v-model="formmodel.ic" clearable
+                                      :placeholder="this.$t('entraceguardUser.ic')" :maxlength="20"/>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item :label="this.$t('entraceguardUser.phone')">
+                            <el-input v-model="formmodel.phone" clearable
+                                      :placeholder="this.$t('entraceguardUser.phone')" :maxlength="13"/>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+
+                <el-row>
+                    <el-col :span="12">
+                        <el-form-item :label="this.$t('entraceguardUser.password')" prop="name">
+                            <el-input v-model="formmodel.password" clearable
+                                      :placeholder="this.$t('entraceguardUser.password')" :maxlength="20"/>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item :label="this.$t('entraceguardUser.forbidden')">
+                            <el-switch
+                                    v-model="formmodel.forbidden"
+                                    >
+                            </el-switch>
+
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+
+                <el-form-item>
+                    <el-button type="primary" class="save" @click="handlerSubmit('editForm')">{{ this.$t('action.save')
+                        }}
+                    </el-button>
+                </el-form-item>
+            </el-form>
+
+        </el-dialog>
+        <!-- 用户信息 -->
+
+    </div>
+</template>
+
+<script>
+    import {AG_GRID_LOCALE_CN} from '@/utils/AgGridVueLocaleCn'
+    import ButtonCellRender from '@/components/AgGridCellRender/ButtonCellRender'
+    import ButtonCellRenderList from '@/components/AgGridCellRender/ButtonCellRenderList'
+    import ListFilter from '@/components/AgGridCustomFilter/ListFilter'
+    import RadioFilter from '@/components/AgGridCustomFilter/RadioFilter'
+    import * as API_Customer from '@/api/ncs_entrace_guard_user'
+    import {unix2Date, unixToDate} from '@/utils/Foundation'
+
+    export default {
+        name: "users",
+        components: {ButtonCellRenderList, ButtonCellRender, ListFilter, RadioFilter},
+        data() {
+            return {
+                /** ag-grid参数 **/
+                pageData: {}, // 翻页数据
+                columnDefs: null,
+                rowData: null,
+                defaultColDef: null,
+                gridOptions: null,
+                gridApi: null,
+                columnApi: null,
+                localeText: AG_GRID_LOCALE_CN,
+                filterState: null,
+                rowSelection: null,
+                frameworkComponents: null,
+                formmodel: {},
+                customerFormVisible: false,
+                /** 列表参数 */
+                params: {
+                    page_size: 20,
+                    page_no: 1,
+                    fixedCondition: 'partment_id=' + this.$store.getters.partId
+                },
+                booleanRender: [
+                    {key: this.$t('entraceguardUser.yes'), value: true, color: 'green'},
+                    {key: this.$t('entraceguardUser.nop'), value: false, color: 'red'}
+                ],
+                rules: {}
+            }
+        },
+        computed: {
+            tableHeight() {
+                return this.mainAreaHeight - 130
+            }
+        },
+        beforeMount() {
+            const _this = this
+            this.gridOptions = {
+                onCellDoubleClicked: function (row) {
+                    _this.formmodel = {
+                        ...row.data
+                    }
+                    _this.detailsVisible = true
+                }
+            }
+            this.columnDefs = [
+                {
+                    headerName: '#',
+                    headerCheckboxSelection: true,
+                    headerCheckboxSelectionFilteredOnly: true,
+                    checkboxSelection: true,
+                    sortable: false, filter: false,
+                    width: 50,
+                    resizable: false,
+                    valueGetter: this.hashValueGetter
+                },
+                {headerName: 'ID', field: 'id', sortable: true, filter: 'agNumberColumnFilter', width: 100},
+                {
+                    headerName: this.$t('entraceguardUser.named'),
+                    field: 'name',
+                    sortable: true,
+                    filter: 'agTextColumnFilter',
+                    width: 160
+                },
+                {
+                    headerName: this.$t('entraceguardUser.idNo'),
+                    field: 'id_card',
+                    sortable: true,
+                    filter: 'agNumberColumnFilter',
+                    flex: 1
+                },
+
+                {
+                    headerName: this.$t('entraceguardUser.ic'),
+                    field: 'ic',
+                    sortable: true,
+                    filter: 'agTextColumnFilter',
+                    width: 160
+                },
+                {
+                    headerName: this.$t('entraceguardUser.phone'),
+                    field: 'phone',
+                    sortable: true,
+                    filter: 'agTextColumnFilter'
+                },
+                {
+                    headerName: this.$t('entraceguardUser.password'),
+                    field: 'password',
+                    sortable: true,
+                    filter: 'agTextColumnFilter',
+                    width: 160
+                },
+                // lockPosition 锁定位置,会在第一列
+                // lockPinned = true 不能拖动然后固定
+                // resizeable 单元个大小是否可以调整
+                {
+                    headerName: this.$t('entraceguardUser.forbidden'),
+                    field: 'forbidden',
+                    sortable: true,
+                    filterFramework: 'RadioFilter',
+                    filterParams: {
+                        listData: this.booleanRender
+                    },
+                    width: 150,
+                    cellRenderer: (para) => {
+                        return this.radioFilterFormatter(para, this.booleanRender)
+                    }
+                },
+
+
+                {
+                    headerName: this.$t('action.handle'), field: 'id',
+                    cellRendererFramework: 'ButtonCellRenderList',
+                    cellRendererParams: param => {
+                        return {
+                            list: [
+                                {
+                                    onClick: this.handleEdit,
+                                    label: this.$t('action.edit'),
+                                    buttonType: 'primary',
+                                    buttonSize: 'mini'
+                                }
+                            ]
+                        }
+                    },
+                    filter: false,
+                    pinned: 'right',
+                    lockPinned: true,
+                    minWidth: this.$i18n.locale === 'zh' ? 260 : 380,
+                    resizable: false,
+                    sortable: false
+                },
+            ]
+            this.defaultColDef = {
+                // filter: 'agTextColumnFilter',
+                sortable: true,
+                resizable: true,
+                // comparator: this.dateCustomComparator,
+                filterParams: {
+                    debounceMs: 500,
+                    newRowsAction: 'keep',
+                    textCustomComparator: this.textCustomComparator
+                }
+            }
+            this.rowSelection = 'multiple'
+        },
+        mounted() {
+            window.onresize = this.windowResize()
+            this.gridApi = this.gridOptions.api
+            this.gridColumnApi = this.gridOptions.columnApi
+            this.gridColumnApi.applyColumnState({
+                state: [
+                    {
+                        colId: 'id',
+                        sort: 'asc'
+                    }
+                ]
+            })
+        },
+
+        methods: {
+            windowResize() {
+                this.$set(this, 'mainAreaHeight', Number(document.documentElement.clientHeight) - 84)
+            },
+            /** 分页大小发生改变 */
+            handlePageSizeChange(size) {
+                this.params.page_size = size
+                this.getList()
+            },
+
+            /** 分页页数发生改变 */
+            handlePageCurrentChange(page) {
+                this.params.page_no = page
+                this.getList()
+            },
+            /** 加载列表数据 */
+            getList() {
+                const param = this.MixinClone(this.params)
+                this.gridApi.showLoadingOverlay()
+                API_Customer.getList(param).then(response => {
+                    this.rowData = [...response.data]
+                    this.pageData = {
+                        page_no: response.page_no,
+                        page_size: response.page_size,
+                        data_total: response.data_total
+                    }
+                    this.$nextTick(() => {
+                        const node = this.gridApi.getDisplayedRowAtIndex(0)
+                        if (node !== null && node !== undefined) {
+                            node.setSelected(true)
+                        }
+                    })
+                })
+            },
+            /**
+             * 过滤状态发生变化,发送到服务器检索数据
+             */
+            filterModifed(param) {
+                var model = param.api.getFilterModel()
+                this.params.filter = JSON.stringify(model)
+                this.getList()
+            },
+            gridSortChange(param) {
+                console.log('sortparam', param)
+                const columnState = param.columnApi.getColumnState()
+                // 排序状态
+                const sortState = columnState.filter(function (s) {
+                    return s.sort != null
+                }).map(function (s) {
+                    return {
+                        colId: s.colId,
+                        sort: s.sort,
+                        sortIndex: s.sortIndex
+                    }
+                }).sort(function (a, b) {
+                    return a.sortIndex - b.sortIndex
+                })
+                if (sortState.length > 0) {
+                    if (sortState.length === 1) {
+                        this.params.sort = sortState[0].colId
+                        this.params.dir = sortState[0].sort
+                    } else {
+                        let sortstring = ''
+                        sortState.forEach(function (item) {
+                            sortstring += item.colId + ' ' + item.sort + ','
+                        })
+                        this.params.sort = sortstring.substring(0, sortstring.length - 1)
+                        this.params.dir = ' '
+                    }
+                } else {
+                    delete this.params.sort
+                    delete this.params.dir
+                }
+
+                this.getList()
+            },
+            /** 处理搜索 */
+            handlerSearch(keywords) {
+                this.params.query = keywords
+                this.getList()
+            },
+
+            handleEdit(row) {
+                this.formmodel = {
+                    ...row
+                }
+                this.customerFormVisible = true
+            },
+            refreshUser() {
+                API_Customer.refreshUser(this.$store.getters.partId).then(res => {
+                    this.getList()
+                }).catch(err => {
+                    this.$message.error(err.message)
+                })
+            },
+            radioFilterFormatter(params, array) {
+                const item = array.filter(p => p.value === params.value)[0]
+                if (item) {
+                    if (item.color) {
+                        return '<span style="color:' + item.color + '">' + item.key + '</span>'
+                    } else {
+                        return item.key
+                    }
+                } else {
+                    return ''
+                }
+            },
+            handlerSubmit(formName){
+                this.$refs[formName].validate(valid => {
+                    if (valid) {
+
+                            API_Customer.update(this.formmodel.id,this.formmodel).then(res => {
+                                this.getList()
+                                this.$message.success(this.$t('action.editSuccess'))
+                                this.customerFormVisible = false
+                            })
+
+                    } else {
+                        this.$message.error(this.$t('action.fromError'))
+                        return false
+                    }
+                })
+            }
+        }
+    }
+</script>
+
+<style scoped>
+
+</style>

+ 5 - 0
src/views/ncs-orginazition/partInfoSetting.vue

@@ -89,6 +89,11 @@
           <app-version-manager :part-id="part_id" :device-type="131" />
         </keep-alive>
       </el-tab-pane>
+      <el-tab-pane :label="this.$t('partInfo.entraceguard_device')" name="entraceguardDevice">
+        <keep-alive>
+          <app-version-manager :part-id="part_id" :device-type="18" />
+        </keep-alive>
+      </el-tab-pane>
     </el-tabs>
   </div>
 </template>