|
@@ -1,6 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
<ag-grid-layout
|
|
<ag-grid-layout
|
|
|
|
+ v-if="show"
|
|
toolbar
|
|
toolbar
|
|
:table-height="tableHeight"
|
|
:table-height="tableHeight"
|
|
theme="ag-theme-alpine"
|
|
theme="ag-theme-alpine"
|
|
@@ -28,15 +29,7 @@
|
|
import ListFilter from '@/components/AgGridCustomFilter/ListFilter'
|
|
import ListFilter from '@/components/AgGridCustomFilter/ListFilter'
|
|
import RadioFilter from '@/components/AgGridCustomFilter/RadioFilter'
|
|
import RadioFilter from '@/components/AgGridCustomFilter/RadioFilter'
|
|
import * as API_NbDeviceConditon from '@/api/ncs_nbdevicecondition'
|
|
import * as API_NbDeviceConditon from '@/api/ncs_nbdevicecondition'
|
|
- import * as API_Frame from '@/api/ncs_hospitalFrame'
|
|
|
|
- import * as API_SosDeviceSetting from '@/api/ncs_sos_device_settings'
|
|
|
|
- import * as clerk_API from '@/api/ncs_clerk'
|
|
|
|
- import {FRAME_TYPE} from '@/utils/enum/FrameTypeEnum'
|
|
|
|
- import {DEVICE_TYPE} from '@/utils/enum/DeviceTypeEnum'
|
|
|
|
- import {SOS_DEVICE_SETTING_TYPE} from "@/utils/enum/SosDeviceSettingTypeEnum";
|
|
|
|
- import {VITAL_SIGNS_DEVICE_TYPE} from "@/utils/enum/VitalSignsDeviceEnum";
|
|
|
|
- import * as shop_API from "@/api/ncs_shop";
|
|
|
|
-
|
|
|
|
|
|
+ import * as API_DEVICE_TYPE from '@/api/ncs_device_type'
|
|
import ButtonCellRenderList from '@/components/AgGridCellRender/ButtonCellRenderList'
|
|
import ButtonCellRenderList from '@/components/AgGridCellRender/ButtonCellRenderList'
|
|
const DeviceUrl = domain.DeviceUrl
|
|
const DeviceUrl = domain.DeviceUrl
|
|
export default {
|
|
export default {
|
|
@@ -53,8 +46,6 @@
|
|
return {
|
|
return {
|
|
/** ag-grid参数 **/
|
|
/** ag-grid参数 **/
|
|
pageData: {}, // 翻页数据
|
|
pageData: {}, // 翻页数据
|
|
- errorId: null,
|
|
|
|
- shopVisible: false,
|
|
|
|
columnDefs: null,
|
|
columnDefs: null,
|
|
rowData: [],
|
|
rowData: [],
|
|
defaultColDef: {},
|
|
defaultColDef: {},
|
|
@@ -62,7 +53,6 @@
|
|
gridApi: {},
|
|
gridApi: {},
|
|
columnApi: {},
|
|
columnApi: {},
|
|
localeText: AG_GRID_LOCALE_CN,
|
|
localeText: AG_GRID_LOCALE_CN,
|
|
- filterState: null,
|
|
|
|
rowSelection: null,
|
|
rowSelection: null,
|
|
frameworkComponents: null,
|
|
frameworkComponents: null,
|
|
/** 列表参数 */
|
|
/** 列表参数 */
|
|
@@ -70,62 +60,17 @@
|
|
page_size: 20,
|
|
page_size: 20,
|
|
page_no: 1
|
|
page_no: 1
|
|
},
|
|
},
|
|
- /** device 弹窗 **/
|
|
|
|
- deviceDialogVisible: false,
|
|
|
|
- deviceEditTitle: this.$t('deviceManage.deviceAdd'),
|
|
|
|
- deviceModel: {},
|
|
|
|
- deviceTypeDisabled: false,
|
|
|
|
-
|
|
|
|
- partFrames: [],
|
|
|
|
- typeFrames: [],
|
|
|
|
- /** 设备类型转换数组 **/
|
|
|
|
- deviceTypeTransfer: DEVICE_TYPE.getKeyValueList(),
|
|
|
|
deviceStatusTransfer: [
|
|
deviceStatusTransfer: [
|
|
{key: this.$t('deviceManage.statusTure'), value: 1, color: 'green'},
|
|
{key: this.$t('deviceManage.statusTure'), value: 1, color: 'green'},
|
|
{key: this.$t('deviceManage.statusFalse'), value: 0, color: 'red'}
|
|
{key: this.$t('deviceManage.statusFalse'), value: 0, color: 'red'}
|
|
],
|
|
],
|
|
- rolesOptions: [],
|
|
|
|
- hasRoleId: false,
|
|
|
|
- audioOptions: [],
|
|
|
|
- rs485Options: [],
|
|
|
|
- hasAudioId: false,
|
|
|
|
- isVitalSigns: false,
|
|
|
|
- hasSosDeviceSettings: false,
|
|
|
|
- sosDeviceSetting: {},
|
|
|
|
- sosDeviceSettingsTypeOptions: [
|
|
|
|
- {
|
|
|
|
- value: 0,
|
|
|
|
- label: '不开启'
|
|
|
|
- }, {
|
|
|
|
- value: 1,
|
|
|
|
- label: '防控模式'
|
|
|
|
- }, {
|
|
|
|
- value: 2,
|
|
|
|
- label: '关爱模式'
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- sosDeviceSettingEnum: SOS_DEVICE_SETTING_TYPE.getValueList(),
|
|
|
|
- vitalSignsDeviceEnum: VITAL_SIGNS_DEVICE_TYPE.getValueList(),
|
|
|
|
- isLedDevice: false,
|
|
|
|
websock: null,
|
|
websock: null,
|
|
onlineDevice: [],
|
|
onlineDevice: [],
|
|
- // 请求当前科室的数据
|
|
|
|
- shop: {},
|
|
|
|
- serverAddress: {
|
|
|
|
- server_ip: '172.28.100.100',
|
|
|
|
- server_port: '8006'
|
|
|
|
- },
|
|
|
|
- serverAddressDialogVisible: false,
|
|
|
|
- serverAddressRules: {
|
|
|
|
- serverIp: [
|
|
|
|
- this.MixinRequired(this.$t('deviceManage.inputServerIp'))
|
|
|
|
- ],
|
|
|
|
- serverPort: [
|
|
|
|
- this.MixinRequired(this.$t('deviceManage.inputServerPort'))
|
|
|
|
- ]
|
|
|
|
- },
|
|
|
|
- startTime: "06:00",
|
|
|
|
- endTime: "18:00"
|
|
|
|
|
|
+ deviceTypeList: [],
|
|
|
|
+ typeParams: {
|
|
|
|
+ lg: this.$i18n.locale
|
|
|
|
+ },
|
|
|
|
+ show: false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -135,164 +80,138 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
beforeMount() {
|
|
beforeMount() {
|
|
|
|
+ this.API_GetDeviceTypeList()
|
|
this.gridOptions = {}
|
|
this.gridOptions = {}
|
|
- this.columnDefs = [
|
|
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ window.onresize = this.windowResize
|
|
|
|
+ this.gridApi = this.gridOptions.api
|
|
|
|
+ this.gridColumnApi = this.gridOptions.columnApi
|
|
|
|
+ this.gridColumnApi.applyColumnState({
|
|
|
|
+ state: [
|
|
|
|
+ {
|
|
|
|
+ colId: 'id',
|
|
|
|
+ sort: 'desc'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+ // this.initWebSocket()
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ API_GetDeviceTypeList() {
|
|
|
|
+ const _this = this
|
|
|
|
+ let data = []
|
|
|
|
+ API_DEVICE_TYPE.getList(this.typeParams).then(res => {
|
|
|
|
+ res.forEach(item => {
|
|
|
|
+ if (item.bool_device) {
|
|
|
|
+ item.key = item.title
|
|
|
|
+ data.push(item)
|
|
|
|
+ }
|
|
|
|
+ item.children.forEach(t => {
|
|
|
|
+ if (t.bool_device) {
|
|
|
|
+ t.key = t.title
|
|
|
|
+ data.push(t)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ _this.deviceTypeList = data
|
|
|
|
+ this.columnDefs = [
|
|
{
|
|
{
|
|
- headerName: '#',
|
|
|
|
- headerCheckboxSelection: true,
|
|
|
|
- headerCheckboxSelectionFilteredOnly: true,
|
|
|
|
- checkboxSelection: true,
|
|
|
|
- sortable: true, filter: false,
|
|
|
|
- width: 80,
|
|
|
|
- resizable: false,
|
|
|
|
- valueGetter: this.hashValueGetter
|
|
|
|
|
|
+ headerName: '#',
|
|
|
|
+ headerCheckboxSelection: true,
|
|
|
|
+ headerCheckboxSelectionFilteredOnly: true,
|
|
|
|
+ checkboxSelection: true,
|
|
|
|
+ sortable: true, filter: false,
|
|
|
|
+ width: 80,
|
|
|
|
+ resizable: false,
|
|
|
|
+ valueGetter: this.hashValueGetter
|
|
},
|
|
},
|
|
{headerName: 'ID', field: 'id', sortable: true, filter: 'agNumberColumnFilter', width: 100},
|
|
{headerName: 'ID', field: 'id', sortable: true, filter: 'agNumberColumnFilter', width: 100},
|
|
{
|
|
{
|
|
- headerName: this.$t('deviceManage.deviceType'), field: 'device_type', sortable: true,
|
|
|
|
- filterFramework: 'ListFilter', width: 160,
|
|
|
|
- filterParams: {
|
|
|
|
- listData: this.deviceTypeTransfer
|
|
|
|
- },
|
|
|
|
- valueGetter: this.deviceTypeGetter
|
|
|
|
|
|
+ headerName: this.$t('deviceManage.deviceType'), field: 'device_type', sortable: true,
|
|
|
|
+ filterFramework: 'ListFilter', width: 160,
|
|
|
|
+ filterParams: {
|
|
|
|
+ listData: this.deviceTypeList
|
|
|
|
+ },
|
|
|
|
+ valueGetter: this.deviceTypeGetter
|
|
},
|
|
},
|
|
// lockPosition 锁定位置,会在第一列
|
|
// lockPosition 锁定位置,会在第一列
|
|
// lockPinned = true 不能拖动然后固定
|
|
// lockPinned = true 不能拖动然后固定
|
|
// resizeable 单元个大小是否可以调整
|
|
// resizeable 单元个大小是否可以调整
|
|
{
|
|
{
|
|
- headerName: this.$t('deviceManage.ethMac'),
|
|
|
|
- field: 'eth_mac',
|
|
|
|
- sortable: true,
|
|
|
|
- filter: 'agTextColumnFilter'
|
|
|
|
|
|
+ headerName: this.$t('deviceManage.ethMac'),
|
|
|
|
+ field: 'eth_mac',
|
|
|
|
+ sortable: true,
|
|
|
|
+ filter: 'agTextColumnFilter'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- headerName: this.$t('deviceManage.frameFullName'),
|
|
|
|
- field: 'full_name',
|
|
|
|
- sortable: true,
|
|
|
|
- flex: 1,
|
|
|
|
- filter: 'agTextColumnFilter'
|
|
|
|
|
|
+ headerName: this.$t('deviceManage.frameFullName'),
|
|
|
|
+ field: 'full_name',
|
|
|
|
+ sortable: true,
|
|
|
|
+ flex: 1,
|
|
|
|
+ filter: 'agTextColumnFilter'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- headerName: this.$t('deviceManage.deviceName'),
|
|
|
|
- field: 'name',
|
|
|
|
- sortable: true,
|
|
|
|
- filter: 'agTextColumnFilter'
|
|
|
|
|
|
+ headerName: this.$t('deviceManage.deviceName'),
|
|
|
|
+ field: 'name',
|
|
|
|
+ sortable: true,
|
|
|
|
+ filter: 'agTextColumnFilter'
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- headerName: this.$t('deviceManage.status'), field: 'status', width: 120, sortable: true,
|
|
|
|
- filterFramework: 'RadioFilter',
|
|
|
|
- filterParams: {
|
|
|
|
- listData: this.deviceStatusTransfer
|
|
|
|
- },
|
|
|
|
- cellRenderer: this.deviceStatusFormatter
|
|
|
|
|
|
+ headerName: this.$t('deviceManage.status'), field: 'status', width: 120, sortable: true,
|
|
|
|
+ filterFramework: 'RadioFilter',
|
|
|
|
+ filterParams: {
|
|
|
|
+ listData: this.deviceStatusTransfer
|
|
|
|
+ },
|
|
|
|
+ cellRenderer: this.deviceStatusFormatter
|
|
},
|
|
},
|
|
{
|
|
{
|
|
- headerName: this.$t('deviceManage.connect'),
|
|
|
|
- field: 'online_state',
|
|
|
|
- sortable: false,
|
|
|
|
- width: 120,
|
|
|
|
- filter: 'agTextColumnFilter',
|
|
|
|
|
|
+ headerName: this.$t('deviceManage.connect'),
|
|
|
|
+ field: 'online_state',
|
|
|
|
+ sortable: false,
|
|
|
|
+ width: 120,
|
|
|
|
+ filter: 'agTextColumnFilter',
|
|
|
|
|
|
- filterParams: {
|
|
|
|
- textCustomComparator: (filter, value, filterText) => {
|
|
|
|
- if (filterText) {
|
|
|
|
- const filterTextLowerCase = filterText.toLowerCase()
|
|
|
|
- const valueLowerCase = value.toString().toLowerCase()
|
|
|
|
- switch (filter) {
|
|
|
|
- case 'contains':
|
|
|
|
- return valueLowerCase.indexOf(filterTextLowerCase) >= 0
|
|
|
|
- case 'notContains':
|
|
|
|
- return valueLowerCase.indexOf(filterTextLowerCase) === -1
|
|
|
|
- case 'equals':
|
|
|
|
- return valueLowerCase === filterTextLowerCase
|
|
|
|
- case 'notEqual':
|
|
|
|
- return valueLowerCase !== filterTextLowerCase
|
|
|
|
- case 'startsWith':
|
|
|
|
- return valueLowerCase.indexOf(filterTextLowerCase) === 0
|
|
|
|
- case 'endsWith':
|
|
|
|
- var index = valueLowerCase.lastIndexOf(filterTextLowerCase)
|
|
|
|
- return index >= 0 && index === (valueLowerCase.length - filterTextLowerCase.length)
|
|
|
|
- default:
|
|
|
|
- // should never happen
|
|
|
|
- console.warn('invalid filter type ' + filter)
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ filterParams: {
|
|
|
|
+ textCustomComparator: (filter, value, filterText) => {
|
|
|
|
+ if (filterText) {
|
|
|
|
+ const filterTextLowerCase = filterText.toLowerCase()
|
|
|
|
+ const valueLowerCase = value.toString().toLowerCase()
|
|
|
|
+ switch (filter) {
|
|
|
|
+ case 'contains':
|
|
|
|
+ return valueLowerCase.indexOf(filterTextLowerCase) >= 0
|
|
|
|
+ case 'notContains':
|
|
|
|
+ return valueLowerCase.indexOf(filterTextLowerCase) === -1
|
|
|
|
+ case 'equals':
|
|
|
|
+ return valueLowerCase === filterTextLowerCase
|
|
|
|
+ case 'notEqual':
|
|
|
|
+ return valueLowerCase !== filterTextLowerCase
|
|
|
|
+ case 'startsWith':
|
|
|
|
+ return valueLowerCase.indexOf(filterTextLowerCase) === 0
|
|
|
|
+ case 'endsWith':
|
|
|
|
+ var index = valueLowerCase.lastIndexOf(filterTextLowerCase)
|
|
|
|
+ return index >= 0 && index === (valueLowerCase.length - filterTextLowerCase.length)
|
|
|
|
+ default:
|
|
|
|
+ // should never happen
|
|
|
|
+ console.warn('invalid filter type ' + filter)
|
|
|
|
+ return false
|
|
}
|
|
}
|
|
- },
|
|
|
|
- cellRenderer: this.onlineStateFormatter
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ cellRenderer: this.onlineStateFormatter
|
|
},
|
|
},
|
|
|
|
|
|
{
|
|
{
|
|
- headerName: this.$t('deviceManage.operationAdvice'), field: '', width:230, sortable: true,
|
|
|
|
- filterFramework: 'RadioFilter',
|
|
|
|
- filterParams: {
|
|
|
|
- listData: this.deviceStatusTransfer
|
|
|
|
- },
|
|
|
|
- cellRenderer: ()=>{return "<span style='color:red;'>"+(this.viewType===0?this.$t('tab.checkNetwork'):this.$t('tab.changeBattery'))+"</span>"}
|
|
|
|
|
|
+ headerName: this.$t('deviceManage.operationAdvice'), field: '', width:230, sortable: true,
|
|
|
|
+ filterFramework: 'RadioFilter',
|
|
|
|
+ filterParams: {
|
|
|
|
+ listData: this.deviceStatusTransfer
|
|
|
|
+ },
|
|
|
|
+ cellRenderer: ()=>{return "<span style='color:red;'>"+(this.viewType===0?this.$t('tab.checkNetwork'):this.$t('tab.changeBattery'))+"</span>"}
|
|
},
|
|
},
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- // {
|
|
|
|
- // headerName: this.$t('action.edit'), field: 'id',
|
|
|
|
- // cellRendererFramework: 'ButtonCellRender',
|
|
|
|
- // cellRendererParams: {
|
|
|
|
- // onClick: this.handleEdit,
|
|
|
|
- // label: this.$t('action.edit'),
|
|
|
|
- // buttonType: 'primary',
|
|
|
|
- // buttonSize: 'mini'
|
|
|
|
- // },
|
|
|
|
- // filter: false,
|
|
|
|
- // pinned: 'right',
|
|
|
|
- // lockPinned: true,
|
|
|
|
- // width: 80,
|
|
|
|
- // resizable: false,
|
|
|
|
- // sortable: false
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // headerName: this.$t('action.delete'), field: 'id',
|
|
|
|
- // cellRendererFramework: 'ButtonCellRender',
|
|
|
|
- // cellRendererParams: param => {
|
|
|
|
- // return {
|
|
|
|
- // onClick: this.deleteSingle,
|
|
|
|
- // label: this.$t('action.delete'),
|
|
|
|
- // buttonType: 'danger',
|
|
|
|
- // buttonSize: 'mini',
|
|
|
|
- // disabled: param.data['member_name'] === 'superadmin'
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // pinned: 'right',
|
|
|
|
- // lockPinned: true,
|
|
|
|
- // width: 80,
|
|
|
|
- // resizable: false,
|
|
|
|
- // filter: false,
|
|
|
|
- // sortable: false
|
|
|
|
- // },
|
|
|
|
- //
|
|
|
|
- // {
|
|
|
|
- // headerName: this.$t('action.debug'), field: 'id',
|
|
|
|
- // cellRendererFramework: 'ButtonCellRender',
|
|
|
|
- // cellRendererParams: param => {
|
|
|
|
- // return {
|
|
|
|
- // onClick: this.deleteSingle,
|
|
|
|
- // label: this.$t('action.debug'),
|
|
|
|
- // buttonType: 'danger',
|
|
|
|
- // buttonSize: 'mini',
|
|
|
|
- // disabled: param.data['member_name'] === 'superadmin'
|
|
|
|
- // }
|
|
|
|
- // },
|
|
|
|
- // pinned: 'right',
|
|
|
|
- // lockPinned: true,
|
|
|
|
- // width: 80,
|
|
|
|
- // resizable: false,
|
|
|
|
- // filter: false,
|
|
|
|
- // sortable: false
|
|
|
|
- // }
|
|
|
|
- ]
|
|
|
|
- this.defaultColDef = {
|
|
|
|
|
|
+ ]
|
|
|
|
+ this.defaultColDef = {
|
|
// filter: 'agTextColumnFilter',
|
|
// filter: 'agTextColumnFilter',
|
|
sortable: true,
|
|
sortable: true,
|
|
resizable: true,
|
|
resizable: true,
|
|
@@ -300,29 +219,28 @@
|
|
filter: true,
|
|
filter: true,
|
|
// comparator: this.dateCustomComparator,
|
|
// comparator: this.dateCustomComparator,
|
|
filterParams: {
|
|
filterParams: {
|
|
- debounceMs: 500,
|
|
|
|
- newRowsAction: 'keep',
|
|
|
|
- textCustomComparator: this.textCustomComparator
|
|
|
|
|
|
+ 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: [
|
|
|
|
|
|
+ }
|
|
|
|
+ this.rowSelection = 'multiple'
|
|
|
|
+ this.show = true
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ window.onresize = this.windowResize
|
|
|
|
+ this.gridApi = this.gridOptions.api
|
|
|
|
+ this.gridColumnApi = this.gridOptions.columnApi
|
|
|
|
+ this.gridColumnApi.applyColumnState({
|
|
|
|
+ state: [
|
|
{
|
|
{
|
|
- colId: 'id',
|
|
|
|
- sort: 'desc'
|
|
|
|
|
|
+ colId: 'id',
|
|
|
|
+ sort: 'desc'
|
|
}
|
|
}
|
|
- ]
|
|
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+ }, 200)
|
|
})
|
|
})
|
|
- // this.getShop(this.$store.getters.partId)
|
|
|
|
- // this.initWebSocket()
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
|
|
+ },
|
|
windowResize() {
|
|
windowResize() {
|
|
this.$set(this, 'mainAreaHeight', Number(document.documentElement.clientHeight) - 100)
|
|
this.$set(this, 'mainAreaHeight', Number(document.documentElement.clientHeight) - 100)
|
|
},
|
|
},
|
|
@@ -368,30 +286,7 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
})
|
|
})
|
|
- this.typeFrames = this.partFrames
|
|
|
|
},
|
|
},
|
|
- getTypeFrame(partId) {
|
|
|
|
- if (this.shop.shop_type === "0" && this.shop.parent_id === -1) {
|
|
|
|
- API_Frame.getAllFrames(partId).then(res => {
|
|
|
|
- this.partFrames = [...res]
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- API_Frame.getFramesPartId(partId).then(res => {
|
|
|
|
- this.partFrames = [...res]
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- /** 将partFrames做分割 */
|
|
|
|
- getFramesByType(frame_type) {
|
|
|
|
- if (this.partFrames != null) {
|
|
|
|
- if (frame_type === FRAME_TYPE.HOSPITAL || frame_type === FRAME_TYPE.PART) {
|
|
|
|
- this.typeFrames = this.partFrames.filter(item => item.type === FRAME_TYPE.HOSPITAL || item.type === FRAME_TYPE.PART)
|
|
|
|
- } else {
|
|
|
|
- this.typeFrames = this.partFrames.filter(item => item.type === frame_type)
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 过滤状态发生变化,发送到服务器检索数据
|
|
* 过滤状态发生变化,发送到服务器检索数据
|
|
*/
|
|
*/
|
|
@@ -443,9 +338,8 @@
|
|
},
|
|
},
|
|
/** 获取设备类型文字显示,从deviceTypeTransfer 中找出value值对应的key显示出来 */
|
|
/** 获取设备类型文字显示,从deviceTypeTransfer 中找出value值对应的key显示出来 */
|
|
deviceTypeGetter(params) {
|
|
deviceTypeGetter(params) {
|
|
- const gridVal = params.data.device_type
|
|
|
|
- // return this.deviceTypeTransfer.filter(p => p.value === gridVal).map(p => p.key)
|
|
|
|
- return DEVICE_TYPE.getDescFromValue(gridVal)
|
|
|
|
|
|
+ const deviceType = this.deviceTypeList.find(type => type.value === params.data.device_type)
|
|
|
|
+ return deviceType.title;
|
|
},
|
|
},
|
|
/** 格式化时间函数 */
|
|
/** 格式化时间函数 */
|
|
unixDateFormatter(param) {
|
|
unixDateFormatter(param) {
|
|
@@ -474,298 +368,16 @@
|
|
return '<span style="color:gray;"> / </span>'
|
|
return '<span style="color:gray;"> / </span>'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- /** 删除设备 **/
|
|
|
|
- deleteSingle(row) {
|
|
|
|
- this.handlerDelete(row.id)
|
|
|
|
- },
|
|
|
|
- /** 删除设备 **/
|
|
|
|
- handlerDelete(id) {
|
|
|
|
- this.$confirm(this.$t('action.sureDelete'), this.$t('action.waring'), {
|
|
|
|
- confirmButtonText: this.$t('action.yes'),
|
|
|
|
- cancelButtonText: this.$t('action.cancel'),
|
|
|
|
- type: 'warning'
|
|
|
|
- }).then(() => {
|
|
|
|
- API_Device.remove(id).then(
|
|
|
|
- response => {
|
|
|
|
- this.getList()
|
|
|
|
- }
|
|
|
|
- ).catch(response => {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'info',
|
|
|
|
- message: response.message
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- if (this.hasSosDeviceSettings) {
|
|
|
|
- API_SosDeviceSetting.deleteByDeviceId(id).then(() => {
|
|
|
|
- this.hasSosDeviceSettings = false
|
|
|
|
- this.getList()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }).catch(() => {
|
|
|
|
- this.$message({
|
|
|
|
- type: 'info',
|
|
|
|
- message: this.$t('action.cancelDelete')
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- /** 设备类型选中变化 **/
|
|
|
|
- deviceTypeChange(val) {
|
|
|
|
- this.deviceTypeChangeToFrameTypeChange(val)
|
|
|
|
- this.deviceModel.name = DEVICE_TYPE.getDescFromValue(val)
|
|
|
|
- if (val === DEVICE_TYPE.SIMULATE_BED_DEVICE || // 只能直接在后面加设备,会判断错误,必须重新用val = 设备
|
|
|
|
- val === DEVICE_TYPE.RS485_DOOR ||
|
|
|
|
- val === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON ||
|
|
|
|
- val === DEVICE_TYPE.SIMULATE_DOOR_LIGHT ||
|
|
|
|
- val === DEVICE_TYPE.EMERGENCY_BUTTON) { // 模拟设备不需要mac地址
|
|
|
|
- this.deviceRules.eth_mac[0].required = false
|
|
|
|
- this.deviceRules.eth_mac[1].pattern = null
|
|
|
|
- } else if (val === DEVICE_TYPE.REMOTE_CONTROL) {
|
|
|
|
- this.deviceRules.eth_mac[1].pattern = null
|
|
|
|
- this.deviceRules.eth_mac[0].required = true
|
|
|
|
- } else if (val === DEVICE_TYPE.DIGIT_BED_DEVICE) {
|
|
|
|
- this.deviceRules.eth_mac[1].pattern = null
|
|
|
|
- this.deviceRules.eth_mac[0].required = true
|
|
|
|
- } else {
|
|
|
|
- // this.deviceRules.eth_mac[1].pattern = /^([0-9A-Fa-f]{2}:?){6}/gi
|
|
|
|
- this.deviceRules.eth_mac[1].pattern = null
|
|
|
|
- this.deviceRules.eth_mac[0].required = true
|
|
|
|
- }
|
|
|
|
- this.hasRoleId = val === DEVICE_TYPE.NURSE_WATCH
|
|
|
|
- this.hasAudioId = val === DEVICE_TYPE.SIMULATE_BED_DEVICE ||
|
|
|
|
- val === DEVICE_TYPE.RS485_DOOR ||
|
|
|
|
- val === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON ||
|
|
|
|
- val === DEVICE_TYPE.SIMULATE_DOOR_LIGHT
|
|
|
|
- this.isVitalSigns = val === DEVICE_TYPE.VITAL_SIGNS_DEVICE
|
|
|
|
- this.hasSosDeviceSettings = val === DEVICE_TYPE.ALARM_BODY_INDUCTIVE ||
|
|
|
|
- val === DEVICE_TYPE.DOOR_LOCK ||
|
|
|
|
- val === DEVICE_TYPE.ALARM_RESTRAINT_BAND || val === DEVICE_TYPE.BREASTPLATE
|
|
|
|
- this.isLedDevice = val === DEVICE_TYPE.LED_SCREEN
|
|
|
|
- },
|
|
|
|
- /** 设备类型选中对应的空间结构 **/
|
|
|
|
- deviceTypeChangeToFrameTypeChange(val) {
|
|
|
|
- if (val === DEVICE_TYPE.NURSE_HOST ||
|
|
|
|
- val === DEVICE_TYPE.OTHER_HOST ||
|
|
|
|
- val === DEVICE_TYPE.DOCTOR_HOST ||
|
|
|
|
- val === DEVICE_TYPE.LED_SCREEN ||
|
|
|
|
- val === DEVICE_TYPE.LCD_SCREEN ||
|
|
|
|
- val === DEVICE_TYPE.NURSE_WATCH ||
|
|
|
|
- val === DEVICE_TYPE.WORKER_WATCH ||
|
|
|
|
- val === DEVICE_TYPE.TRANSFER_DEVICE ||
|
|
|
|
- val === DEVICE_TYPE.INFORMATION_BOARD ||
|
|
|
|
- val === DEVICE_TYPE.RS485_TRANSFER) {
|
|
|
|
- this.getFramesByType(FRAME_TYPE.PART)
|
|
|
|
- } else if (val === DEVICE_TYPE.DOOR_DEVICE ||
|
|
|
|
- val === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON ||
|
|
|
|
- val === DEVICE_TYPE.RS485_DOOR ||
|
|
|
|
- val === DEVICE_TYPE.SIMULATE_DOOR_LIGHT) {
|
|
|
|
- this.getFramesByType(FRAME_TYPE.ROOM)
|
|
|
|
- } else if (val === DEVICE_TYPE.DIGIT_BED_DEVICE ||
|
|
|
|
- val === DEVICE_TYPE.SIMULATE_BED_DEVICE ||
|
|
|
|
- val === DEVICE_TYPE.REMOTE_CONTROL ||
|
|
|
|
- val === DEVICE_TYPE.CELL_PHONE ||
|
|
|
|
- val === DEVICE_TYPE.ALARM_433BUTTON ||
|
|
|
|
- val === DEVICE_TYPE.ALARM_INFUSION
|
|
|
|
- ) {
|
|
|
|
- this.getFramesByType(FRAME_TYPE.BED)
|
|
|
|
- } else {
|
|
|
|
- this.getTypeFrame(this.$store.getters.partId)
|
|
|
|
- this.typeFrames = this.partFrames
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- androidDevice(param){
|
|
|
|
- const val =param.data.device_type
|
|
|
|
- return val === DEVICE_TYPE.NURSE_HOST ||
|
|
|
|
- val === DEVICE_TYPE.OTHER_HOST ||
|
|
|
|
- val === DEVICE_TYPE.NURSE_HOST ||
|
|
|
|
- val === DEVICE_TYPE.DOCTOR_HOST ||
|
|
|
|
- val === DEVICE_TYPE.TRANSFER_DEVICE ||
|
|
|
|
- val === DEVICE_TYPE.DOOR_DEVICE ||
|
|
|
|
- val === DEVICE_TYPE.DIGIT_BED_DEVICE
|
|
|
|
-
|
|
|
|
- },
|
|
|
|
- s485Device(param){
|
|
|
|
- const val =param.data.device_type
|
|
|
|
- return val === DEVICE_TYPE.RS485_DOOR ||
|
|
|
|
- val === DEVICE_TYPE.SIMULATE_BED_DEVICE && param.data.trans_rs485_id!==null
|
|
|
|
- },
|
|
|
|
- /** 添加设备事件 **/
|
|
|
|
- handleAdd() {
|
|
|
|
- this.deviceModel = {
|
|
|
|
- soft_ver: 'SV1.0',
|
|
|
|
- hard_ver: 'HV1.0',
|
|
|
|
- priority: 1,
|
|
|
|
- code: 'C' + parseInt(Math.random() * 100000),
|
|
|
|
- model: 'M' + parseInt(Math.random() * 100000),
|
|
|
|
- status: 1,
|
|
|
|
- name: ''
|
|
|
|
- }
|
|
|
|
- this.sosDeviceSetting = {
|
|
|
|
- type: 0,
|
|
|
|
- unit: '小时',
|
|
|
|
- setting_time: 120
|
|
|
|
- }
|
|
|
|
- if (Object.keys(this.frame).length > 0) {
|
|
|
|
- this.$set(this.deviceModel, 'frame_id', this.frame.id)
|
|
|
|
- }
|
|
|
|
- delete this.deviceModel.id
|
|
|
|
- this.hasRoleId = false
|
|
|
|
- this.getRoles({
|
|
|
|
- page_size: 200,
|
|
|
|
- page_no: 1,
|
|
|
|
- fixedCondition: ' shop_id = -1',
|
|
|
|
- sort: ' role_id',
|
|
|
|
- dir: 'desc'
|
|
|
|
- })
|
|
|
|
- this.hasAudioId = false
|
|
|
|
- this.isVitalSigns = false
|
|
|
|
- this.hasSosDeviceSettings = false
|
|
|
|
- this.isLedDevice = false
|
|
|
|
- this.getDevices(this.$store.getters.partId)
|
|
|
|
- this.deviceEditTitle = this.$t('deviceManage.deviceAdd')
|
|
|
|
- this.deviceDialogVisible = true
|
|
|
|
- this.deviceTypeDisabled = false // 新增设备可以选择设备类型
|
|
|
|
- this.typeFrames = this.partFrames
|
|
|
|
- },
|
|
|
|
- /** 修改设备 **/
|
|
|
|
- handleEdit(params) {
|
|
|
|
- this.getRoles({
|
|
|
|
- page_size: 200,
|
|
|
|
- page_no: 1,
|
|
|
|
- fixedCondition: ' shop_id = -1',
|
|
|
|
- sort: ' role_id',
|
|
|
|
- dir: 'desc'
|
|
|
|
- })
|
|
|
|
- this.getDevices(params.part_id)
|
|
|
|
- this.deviceTypeChangeToFrameTypeChange(params.device_type)
|
|
|
|
- this.hasRoleId = params.device_type === DEVICE_TYPE.NURSE_WATCH
|
|
|
|
- this.hasAudioId = params.device_type === DEVICE_TYPE.SIMULATE_BED_DEVICE ||
|
|
|
|
- params.device_type === DEVICE_TYPE.RS485_DOOR ||
|
|
|
|
- params.device_type === DEVICE_TYPE.SIMULATE_EMERGENCY_BUTTON ||
|
|
|
|
- params.device_type === DEVICE_TYPE.SIMULATE_DOOR_LIGHT
|
|
|
|
- this.isVitalSigns = params.device_type === DEVICE_TYPE.VITAL_SIGNS_DEVICE
|
|
|
|
-
|
|
|
|
- if (params.device_type === DEVICE_TYPE.ALARM_BODY_INDUCTIVE ||
|
|
|
|
- params.device_type === DEVICE_TYPE.DOOR_LOCK ||
|
|
|
|
- params.device_type === DEVICE_TYPE.ALARM_RESTRAINT_BAND || params.device_type === DEVICE_TYPE.BREASTPLATE) {
|
|
|
|
- this.hasSosDeviceSettings = true
|
|
|
|
- this.getSosDeviceSetting(params.id)
|
|
|
|
- } else {
|
|
|
|
- this.hasSosDeviceSettings = false
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- this.isLedDevice = params.device_type === DEVICE_TYPE.LED_SCREEN
|
|
|
|
- this.deviceModel = {
|
|
|
|
- ...params
|
|
|
|
- }
|
|
|
|
- this.deviceEditTitle = this.$t('deviceManage.deviceEdit')
|
|
|
|
- this.deviceDialogVisible = true
|
|
|
|
- this.deviceTypeDisabled = true // 修改设备时,不能改变设备类型
|
|
|
|
- },
|
|
|
|
- /** 新增 提交表单 */
|
|
|
|
- handlerFormSubmit(formName) {
|
|
|
|
- this.$refs[formName].validate((valid) => {
|
|
|
|
- if (valid) {
|
|
|
|
- const _this = this;
|
|
|
|
- console.log('this.deviceModel', this.deviceModel)
|
|
|
|
- /** 新增 */
|
|
|
|
- if (!this.deviceModel.id) {
|
|
|
|
- if (this.frame.type != null) {
|
|
|
|
- this.deviceModel.part_id = this.frame.type === FRAME_TYPE.HOSPITAL ? this.frame.hospital_id : this.frame.part_id
|
|
|
|
- } else {
|
|
|
|
- this.deviceModel.part_id = this.$store.getters.partId
|
|
|
|
- }
|
|
|
|
- API_Device.add(this.deviceModel).then(r => {
|
|
|
|
- this.$message.success(this.$t('action.saveSuccess'))
|
|
|
|
- _this.device = r
|
|
|
|
- this.sosDeviceSetting.device_id = _this.device.id
|
|
|
|
- this.sosDeviceSetting.part_id = _this.device.part_id
|
|
|
|
- // 是报警设备
|
|
|
|
- if (this.hasSosDeviceSettings) {
|
|
|
|
- // 是胸牌/手表
|
|
|
|
- if (this.deviceModel.device_type === DEVICE_TYPE.BREASTPLATE) {
|
|
|
|
- this.sosDeviceSetting.cron_str = this.startTime + ',' + this.endTime
|
|
|
|
- }
|
|
|
|
- this.sosDeviceSetting.device_type = this.deviceModel.device_type
|
|
|
|
- this.sosDeviceSetting.device_eth_mac = this.deviceModel.eth_mac
|
|
|
|
- API_SosDeviceSetting.add(this.sosDeviceSetting).then(() => {
|
|
|
|
- this.$message.success(this.$t('action.saveSuccess'))
|
|
|
|
- this.hasSosDeviceSettings = false
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- this.deviceDialogVisible = false
|
|
|
|
- this.getList()
|
|
|
|
- })
|
|
|
|
- } else {
|
|
|
|
- /** 修改 */
|
|
|
|
- API_Device.update(this.deviceModel.id, this.deviceModel).then(() => {
|
|
|
|
- this.$message.success(this.$t('action.editSuccess'))
|
|
|
|
-
|
|
|
|
- if (this.hasSosDeviceSettings) {
|
|
|
|
- this.sosDeviceSetting.device_id = this.deviceModel.id
|
|
|
|
- this.sosDeviceSetting.part_id = this.deviceModel.part_id
|
|
|
|
- this.sosDeviceSetting.device_type = this.deviceModel.device_type
|
|
|
|
- // 是胸牌/手表
|
|
|
|
- if (this.deviceModel.device_type === DEVICE_TYPE.BREASTPLATE) {
|
|
|
|
- this.sosDeviceSetting.cron_str = this.startTime + ',' + this.endTime
|
|
|
|
- }
|
|
|
|
- API_SosDeviceSetting.updateById(this.sosDeviceSetting.id, this.sosDeviceSetting).then(() => {
|
|
|
|
- this.$message.success(this.$t('action.saveSuccess'))
|
|
|
|
- this.hasSosDeviceSettings = false
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- this.deviceDialogVisible = false
|
|
|
|
- this.getList()
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
/** 分页大小发生改变 */
|
|
/** 分页大小发生改变 */
|
|
handlePageSizeChange(size) {
|
|
handlePageSizeChange(size) {
|
|
this.params.page_size = size
|
|
this.params.page_size = size
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
-
|
|
|
|
/** 分页页数发生改变 */
|
|
/** 分页页数发生改变 */
|
|
handlePageCurrentChange(page) {
|
|
handlePageCurrentChange(page) {
|
|
this.params.page_no = page
|
|
this.params.page_no = page
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
- getRoles(param) {
|
|
|
|
- // 获取角色
|
|
|
|
- clerk_API.getRoles(param).then(response => {
|
|
|
|
- this.rolesOptions = response.data
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- getDevices(partId) {
|
|
|
|
- // 获取设备列表
|
|
|
|
- API_Device.getDeviceByType(partId, DEVICE_TYPE.TRANSFER_DEVICE).then(response => {
|
|
|
|
- this.audioOptions = response
|
|
|
|
- })
|
|
|
|
- API_Device.getDeviceByType(partId, DEVICE_TYPE.RS485_TRANSFER).then(response => {
|
|
|
|
- this.rs485Options = response
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- getSosDeviceSetting(deviceId) {
|
|
|
|
- API_SosDeviceSetting.getSosDeviceSetting(deviceId).then(r => {
|
|
|
|
- this.sosDeviceSetting = r;
|
|
|
|
- if (r.cron_str) {
|
|
|
|
- let str = r.cron_str.split(',')
|
|
|
|
- if (str.length === 2) {
|
|
|
|
- this.startTime = str[0]
|
|
|
|
- this.endTime = str[1]
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- getShop(shopId) {
|
|
|
|
- shop_API.getShop(shopId).then(res => {
|
|
|
|
- this.shop = res;
|
|
|
|
- this.getTypeFrame(shopId)
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
initWebSocket: function () {
|
|
initWebSocket: function () {
|
|
var stockbase = DeviceUrl.replace('http', 'ws')
|
|
var stockbase = DeviceUrl.replace('http', 'ws')
|
|
this.websock = new WebSocket(stockbase + '/deviceonline/' + this.$store.getters.uuid)
|
|
this.websock = new WebSocket(stockbase + '/deviceonline/' + this.$store.getters.uuid)
|
|
@@ -804,66 +416,12 @@
|
|
websocketclose: function (e) {
|
|
websocketclose: function (e) {
|
|
console.log('connection closed (' + e.code + ')')
|
|
console.log('connection closed (' + e.code + ')')
|
|
},
|
|
},
|
|
- batchDelete() {
|
|
|
|
- const rows = this.gridApi.getSelectedRows()
|
|
|
|
- if (rows.length === 0) {
|
|
|
|
- this.$message({type: 'info', message: this.$t('action.pleaseChoiceDelete')})
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
- const ids = []
|
|
|
|
- rows.forEach(function (item) {
|
|
|
|
- ids.push(item.id)
|
|
|
|
- })
|
|
|
|
- this.handlerDelete(ids.join(','))
|
|
|
|
- },
|
|
|
|
- deviceServerChange() {
|
|
|
|
- this.serverAddressDialogVisible = true
|
|
|
|
- },
|
|
|
|
- updateDevicesServerIp() {
|
|
|
|
- API_Device.updateDevicesServerIp(this.serverAddress).then(r => {
|
|
|
|
- this.$message.success(this.$t('action.settingsSuccess'))
|
|
|
|
- this.serverAddressDialogVisible = false
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- openDebug(param){
|
|
|
|
- API_Device.openDebug(param.id).then(res=>{
|
|
|
|
- this.$message.success(this.$t('action.handleSuccess'))
|
|
|
|
- }).catch(err=>{
|
|
|
|
- this.$message.error(this.$t('action.handleFailed'))
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- rebootDevice(params){
|
|
|
|
- API_Device.rebootDevice(params.id).then(res=>{
|
|
|
|
- this.$message.success(this.$t('action.handleSuccess'))
|
|
|
|
- }).catch(err=>{
|
|
|
|
- this.$message.error(this.$t('action.handleFailed'))
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
/**
|
|
/**
|
|
* 判断设备是否为模拟分机这种,无法在线是设备
|
|
* 判断设备是否为模拟分机这种,无法在线是设备
|
|
*/
|
|
*/
|
|
isCannotBeOnline(val) {
|
|
isCannotBeOnline(val) {
|
|
- return val === DEVICE_TYPE.NURSE_HOST ||
|
|
|
|
- val === DEVICE_TYPE.OTHER_HOST ||
|
|
|
|
- val === DEVICE_TYPE.NURSE_HOST ||
|
|
|
|
- val === DEVICE_TYPE.DOCTOR_HOST ||
|
|
|
|
- val === DEVICE_TYPE.NURSE_WATCH ||
|
|
|
|
- val === DEVICE_TYPE.WORKER_WATCH ||
|
|
|
|
- val === DEVICE_TYPE.TRANSFER_DEVICE ||
|
|
|
|
- val === DEVICE_TYPE.DOOR_DEVICE ||
|
|
|
|
- val === DEVICE_TYPE.DIGIT_BED_DEVICE ||
|
|
|
|
- val === DEVICE_TYPE.CELL_PHONE ||
|
|
|
|
- val === DEVICE_TYPE.ENTRANCE_GUARD ||
|
|
|
|
- val === DEVICE_TYPE.OWON_X5_GATEWAY ||
|
|
|
|
- val === DEVICE_TYPE.HUMAN_DETECTION_RADAR ||
|
|
|
|
- val === DEVICE_TYPE.INFORMATION_BOARD ||
|
|
|
|
- val === DEVICE_TYPE.ALARM_433BUTTON ||
|
|
|
|
- val === DEVICE_TYPE.ALARM_BODY_INDUCTIVE||
|
|
|
|
- val === DEVICE_TYPE.S433_TRANSFER_BOX;
|
|
|
|
- },
|
|
|
|
- getDeviceType() {
|
|
|
|
- return DEVICE_TYPE;
|
|
|
|
|
|
+ const deviceType = this.deviceTypeList.find(type => type.value === val)
|
|
|
|
+ return deviceType.bool_show_line
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|