|
@@ -1,33 +1,26 @@
|
|
<template>
|
|
<template>
|
|
<div class="app-container">
|
|
<div class="app-container">
|
|
- <en-table-layout
|
|
|
|
|
|
+ <ag-grid-layout
|
|
toolbar
|
|
toolbar
|
|
- pagination
|
|
|
|
- :table-data="tableData"
|
|
|
|
- :height="tableHeight"
|
|
|
|
- :loading="loading"
|
|
|
|
- @selection-change="selectFun"
|
|
|
|
- @sort-change="tableSort"
|
|
|
|
|
|
+ :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"
|
|
|
|
+ :enable-cell-change-flash="true"
|
|
|
|
+ @filterChanged="filterModifed"
|
|
|
|
+ @sortChanged="gridSortChange"
|
|
>
|
|
>
|
|
- <!--工具栏-->
|
|
|
|
- <div slot="toolbar" class="inner-toolbar" />
|
|
|
|
- <!--表头-->
|
|
|
|
- <template slot="table-columns">
|
|
|
|
- <el-table-column prop="id" sortable="custom" label="识别码" width="200" align="center" />
|
|
|
|
- <el-table-column prop="device_name" sortable="custom" label="别名" width="200" align="center" />
|
|
|
|
- <el-table-column prop="device_wifi_mac" sortable="custom" label="mac地址" width="200" align="center" />
|
|
|
|
- <el-table-column prop="device_eth_ip" sortable="custom" label="IP地址" width="200" align="center" />
|
|
|
|
- <el-table-column prop="partid" sortable="custom" label="科室ID" width="200" align="center" />
|
|
|
|
- <el-table-column label="操作" align="center">
|
|
|
|
- <template slot-scope="scope">
|
|
|
|
- <el-button type="primary" size="mini" @click="setPartBoard(scope.row)">设定</el-button>
|
|
|
|
- <el-button type="primary" size="mini" @click="setBoard(scope.row)">设置</el-button>
|
|
|
|
- <el-button type="danger" size="mini" @click="handlerDelete(scope.row.id)">删除</el-button>
|
|
|
|
- </template>
|
|
|
|
- </el-table-column>
|
|
|
|
- </template>
|
|
|
|
-
|
|
|
|
- <!--翻页-->
|
|
|
|
|
|
+ <!-- @rowDoubleClicked="getList"-->
|
|
|
|
+ <div slot="toolbar" class="inner-toolbar">
|
|
|
|
+ <div class="toolbar-search">
|
|
|
|
+ <en-table-search placeholder="请输入搜索关键字" @search="handlerSearch" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<el-pagination
|
|
<el-pagination
|
|
v-if="pageData"
|
|
v-if="pageData"
|
|
slot="pagination"
|
|
slot="pagination"
|
|
@@ -39,30 +32,77 @@
|
|
@size-change="handlePageSizeChange"
|
|
@size-change="handlePageSizeChange"
|
|
@current-change="handlePageCurrentChange"
|
|
@current-change="handlePageCurrentChange"
|
|
/>
|
|
/>
|
|
- </en-table-layout>
|
|
|
|
|
|
+ </ag-grid-layout>
|
|
|
|
+
|
|
|
|
+ <!-- <en-table-layout-->
|
|
|
|
+ <!-- toolbar-->
|
|
|
|
+ <!-- pagination-->
|
|
|
|
+ <!-- :table-data="tableData"-->
|
|
|
|
+ <!-- :height="tableHeight"-->
|
|
|
|
+ <!-- :loading="loading"-->
|
|
|
|
+ <!-- @selection-change="selectFun"-->
|
|
|
|
+ <!-- @sort-change="tableSort"-->
|
|
|
|
+ <!-- >-->
|
|
|
|
+ <!-- <!–工具栏–>-->
|
|
|
|
+ <!-- <div slot="toolbar" class="inner-toolbar" />-->
|
|
|
|
+ <!-- <!–表头–>-->
|
|
|
|
+ <!-- <template slot="table-columns">-->
|
|
|
|
+ <!-- <el-table-column prop="id" sortable="custom" label="识别码" width="200" align="center" />-->
|
|
|
|
+ <!-- <el-table-column prop="device_name" sortable="custom" label="别名" width="200" align="center" />-->
|
|
|
|
+ <!-- <el-table-column prop="device_wifi_mac" sortable="custom" label="mac地址" width="200" align="center" />-->
|
|
|
|
+ <!-- <el-table-column prop="device_eth_ip" sortable="custom" label="IP地址" width="200" align="center" />-->
|
|
|
|
+ <!-- <el-table-column prop="partid" sortable="custom" label="科室ID" width="200" align="center" />-->
|
|
|
|
+ <!-- <el-table-column label="操作" align="center">-->
|
|
|
|
+ <!-- <template slot-scope="scope">-->
|
|
|
|
+ <!-- <el-button type="primary" size="mini" @click="setPartBoard(scope.row)">设定</el-button>-->
|
|
|
|
+ <!-- <el-button type="primary" size="mini" @click="setBoard(scope.row)">设置</el-button>-->
|
|
|
|
+ <!-- <el-button type="danger" size="mini" @click="handlerDelete(scope.row.id)">删除</el-button>-->
|
|
|
|
+ <!-- </template>-->
|
|
|
|
+ <!-- </el-table-column>-->
|
|
|
|
+ <!-- </template>-->
|
|
|
|
+
|
|
|
|
+ <!-- <!–翻页–>-->
|
|
|
|
+ <!-- <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"-->
|
|
|
|
+ <!-- />-->
|
|
|
|
+ <!-- </en-table-layout>-->
|
|
|
|
|
|
<el-dialog title="设置看板" :visible.sync="formshow" width="50%">
|
|
<el-dialog title="设置看板" :visible.sync="formshow" width="50%">
|
|
- <el-form>
|
|
|
|
|
|
+ <el-form ref="editform" v-model="boardConfig" label-width="120px">
|
|
<fieldset>
|
|
<fieldset>
|
|
<legend>设置停留时长</legend>
|
|
<legend>设置停留时长</legend>
|
|
- <el-form ref="editform" label-width="120px">
|
|
|
|
- <el-form-item label="第1屏">
|
|
|
|
- <el-input v-model="staySeconds[0]" clearable placeholder="第1屏停留时长" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item label="第2屏">
|
|
|
|
- <el-input v-model="staySeconds[1]" clearable placeholder="第2屏停留时长" />
|
|
|
|
- </el-form-item>
|
|
|
|
- <el-form-item v-for="(item,index) in boardTitles" v-if="boardTitles.length>0" :key="index" :label="'第'+(index+3)+'屏'">
|
|
|
|
- <el-input v-model="staySeconds[index+2]" clearable :placeholder="'第'+(index+3)+'屏停留时长'" />
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
|
|
+ <el-form-item label="第1屏">
|
|
|
|
+ <el-input v-model="boardConfig.staySeconds[0]" clearable placeholder="第1屏停留时长" type="number">
|
|
|
|
+ <template slot="append">秒</template>
|
|
|
|
+ </el-input>
|
|
|
|
+
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="第2屏">
|
|
|
|
+ <el-input v-model="boardConfig.staySeconds[1]" clearable placeholder="第2屏停留时长" type="number">
|
|
|
|
+ <template slot="append">秒</template>
|
|
|
|
+ </el-input>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item v-for="(item,index) in boardTitles" :key="index" :label="'第'+(index+3)+'屏'">
|
|
|
|
+ <el-input v-model="boardConfig.staySeconds[index+2]" clearable :placeholder="'第'+(index+3)+'屏停留时长'" type="number">
|
|
|
|
+ <template slot="append">秒</template>
|
|
|
|
+ </el-input>
|
|
|
|
+ </el-form-item>
|
|
</fieldset>
|
|
</fieldset>
|
|
- <fieldset>
|
|
|
|
|
|
+ <fieldset class="margin-top-sm">
|
|
<legend>设置固定屏显示</legend>
|
|
<legend>设置固定屏显示</legend>
|
|
- <el-form-item>
|
|
|
|
- <el-radio-group v-model="stayIndex">
|
|
|
|
- <el-radio label="1">第1屏</el-radio>
|
|
|
|
- <el-radio label="2">第2屏</el-radio>
|
|
|
|
|
|
+ <el-form-item label-width="80">
|
|
|
|
+ <el-radio-group v-model="boardConfig.stayIndex">
|
|
|
|
+ <el-radio :label="0">不固定</el-radio>
|
|
|
|
+ <el-radio :label="1">第1屏</el-radio>
|
|
|
|
+ <el-radio :label="2">第2屏</el-radio>
|
|
<el-radio v-for="(item,index) in boardTitles" :key="index" :label="(index+3)">第{{ index+3 }}屏</el-radio>
|
|
<el-radio v-for="(item,index) in boardTitles" :key="index" :label="(index+3)">第{{ index+3 }}屏</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -77,29 +117,50 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import { AG_GRID_LOCALE_CN } from '@/utils/AgGridVueLocaleCn'
|
|
|
|
+import ButtonCellRender from '../../components/AgGridCellRender/ButtonCellRender'
|
|
|
|
+import ListFilter from '@/components/AgGridCustomFilter/ListFilter'
|
|
|
|
+import RadioFilter from '@/components/AgGridCustomFilter/RadioFilter'
|
|
|
|
+import { DeviceUrl } from '@/utils/domain'
|
|
import * as API_Device from '@/api/ncs_device'
|
|
import * as API_Device from '@/api/ncs_device'
|
|
-import * as API_Board from '@/api/calling-board'
|
|
|
|
-import { runtimeUrl } from '@/utils/domain'
|
|
|
|
-
|
|
|
|
|
|
+import * as API_FrameGroup from '@/api/ncs_frameGroup'
|
|
|
|
+import * as API_Board from '@/api/ncs_board'
|
|
export default {
|
|
export default {
|
|
name: 'Index',
|
|
name: 'Index',
|
|
|
|
+ components: { ButtonCellRender, ListFilter, RadioFilter },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- tableData: [],
|
|
|
|
/** 列表参数 */
|
|
/** 列表参数 */
|
|
params: {
|
|
params: {
|
|
page_size: 20,
|
|
page_size: 20,
|
|
page_no: 1,
|
|
page_no: 1,
|
|
- fixedCondition: '(PARTID=' + this.$store.getters.partId + ' OR PARTID is null) AND DEVICE_TYPE=17'
|
|
|
|
|
|
+ fixedCondition: '(part_id=' + this.$store.getters.partId + ' OR part_id=0) AND device_type=17'
|
|
},
|
|
},
|
|
|
|
+ treeData: [],
|
|
|
|
+ /** ag-grid参数 **/
|
|
pageData: [],
|
|
pageData: [],
|
|
loading: false,
|
|
loading: false,
|
|
|
|
+ errorId: null,
|
|
|
|
+ shopVisible: false,
|
|
|
|
+ columnDefs: null,
|
|
|
|
+ rowData: null,
|
|
|
|
+ defaultColDef: null,
|
|
|
|
+ gridOptions: null,
|
|
|
|
+ gridApi: null,
|
|
|
|
+ columnApi: null,
|
|
|
|
+ localeText: AG_GRID_LOCALE_CN,
|
|
|
|
+ filterState: null,
|
|
|
|
+ rowSelection: null,
|
|
|
|
+ frameworkComponents: null,
|
|
|
|
|
|
websock: null,
|
|
websock: null,
|
|
boardObj: {},
|
|
boardObj: {},
|
|
- staySeconds: [5, 5],
|
|
|
|
|
|
+ boardConfig: {
|
|
|
|
+ staySeconds: [30, 30],
|
|
|
|
+ stayIndex: 0
|
|
|
|
+ },
|
|
boardTitles: [],
|
|
boardTitles: [],
|
|
- stayIndex: 0,
|
|
|
|
|
|
+
|
|
formshow: false,
|
|
formshow: false,
|
|
rules: {
|
|
rules: {
|
|
device_type: [
|
|
device_type: [
|
|
@@ -113,8 +174,109 @@ export default {
|
|
return this.mainAreaHeight - 130
|
|
return this.mainAreaHeight - 130
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+
|
|
|
|
+ beforeMount() {
|
|
|
|
+ this.gridOptions = {}
|
|
|
|
+ this.columnDefs = [
|
|
|
|
+ {
|
|
|
|
+ headerName: '#',
|
|
|
|
+ headerCheckboxSelection: true,
|
|
|
|
+ headerCheckboxSelectionFilteredOnly: true,
|
|
|
|
+ checkboxSelection: true,
|
|
|
|
+ sortable: false, filter: false,
|
|
|
|
+ width: 100,
|
|
|
|
+ resizable: false,
|
|
|
|
+ valueGetter: this.hashValueGetter
|
|
|
|
+ },
|
|
|
|
+ { headerName: 'ID', field: 'id', sortable: true, filter: 'agNumberColumnFilter', width: 130 },
|
|
|
|
+ {
|
|
|
|
+ headerName: '别名', field: 'name', sortable: true, filter: 'agTextColumnFilter', width: 150
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ headerName: 'mac地址', field: 'eth_mac', sortable: true, filterFramework: 'agTextColumnFilter', flex: 1
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ headerName: '科室ID', field: 'part_id', sortable: true, filterFramework: 'agNumberColumnFilter', width: 150
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ headerName: '设定', field: 'id',
|
|
|
|
+ cellRendererFramework: 'ButtonCellRender',
|
|
|
|
+ cellRendererParams: {
|
|
|
|
+ onClick: this.handEdit,
|
|
|
|
+ label: '设定到本科室',
|
|
|
|
+ buttonType: 'primary',
|
|
|
|
+ buttonSize: 'mini'
|
|
|
|
+ },
|
|
|
|
+ filter: false,
|
|
|
|
+ pinned: 'right',
|
|
|
|
+ lockPinned: true,
|
|
|
|
+ width: 150,
|
|
|
|
+ resizable: false,
|
|
|
|
+ sortable: false
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ headerName: '设置', field: 'id',
|
|
|
|
+ cellRendererFramework: 'ButtonCellRender',
|
|
|
|
+ cellRendererParams: {
|
|
|
|
+ onClick: this.setBoard,
|
|
|
|
+ label: '设置看板',
|
|
|
|
+ buttonType: 'primary',
|
|
|
|
+ buttonSize: 'mini'
|
|
|
|
+ },
|
|
|
|
+ filter: false,
|
|
|
|
+ pinned: 'right',
|
|
|
|
+ lockPinned: true,
|
|
|
|
+ width: 150,
|
|
|
|
+ resizable: false,
|
|
|
|
+ sortable: false
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ headerName: '删除', field: 'shop_id',
|
|
|
|
+ cellRendererFramework: 'ButtonCellRender',
|
|
|
|
+ cellRendererParams: param => {
|
|
|
|
+ return {
|
|
|
|
+ onClick: this.deleteSingle,
|
|
|
|
+ label: '删除',
|
|
|
|
+ buttonType: 'danger',
|
|
|
|
+ buttonSize: 'mini'
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ pinned: 'right',
|
|
|
|
+ lockPinned: true,
|
|
|
|
+ width: 100,
|
|
|
|
+ resizable: false,
|
|
|
|
+ filter: false,
|
|
|
|
+ sortable: false
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ this.defaultColDef = {
|
|
|
|
+ sortable: true,
|
|
|
|
+ resizable: true,
|
|
|
|
+ comparator: this.dateCustomComparator,
|
|
|
|
+ filterParams: {
|
|
|
|
+ debounceMs: 200,
|
|
|
|
+ newRowsAction: 'keep',
|
|
|
|
+ textCustomComparator: this.textCustomComparator,
|
|
|
|
+ comparator: this.dateCustomComparator
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.rowSelection = 'multiple'
|
|
|
|
+ },
|
|
mounted() {
|
|
mounted() {
|
|
- this.getList()
|
|
|
|
|
|
+ window.onresize = this.windowResize
|
|
|
|
+ this.gridApi = this.gridOptions.api
|
|
|
|
+ this.gridColumnApi = this.gridOptions.columnApi
|
|
|
|
+ // 设置默认排序字段,应用列状态之后会触发 gridSortChange 函数,会调用getlist,后面不需要再调用this.getlist
|
|
|
|
+ this.gridColumnApi.applyColumnState({
|
|
|
|
+ state: [
|
|
|
|
+ {
|
|
|
|
+ colId: 'id',
|
|
|
|
+ sort: 'asc'
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ })
|
|
|
|
+ this.getFrameTree()
|
|
this.getBoardTitles()
|
|
this.getBoardTitles()
|
|
this.initWebSocket()
|
|
this.initWebSocket()
|
|
},
|
|
},
|
|
@@ -123,6 +285,12 @@ export default {
|
|
selectFun: function(val) {
|
|
selectFun: function(val) {
|
|
this.multipleSelection = val
|
|
this.multipleSelection = val
|
|
},
|
|
},
|
|
|
|
+ windowResize() {
|
|
|
|
+ this.$set(this, 'mainAreaHeight', Number(document.documentElement.clientHeight) - 84)
|
|
|
|
+ },
|
|
|
|
+ deleteSingle(row) {
|
|
|
|
+ this.handlerDelete(row.id)
|
|
|
|
+ },
|
|
handlerDelete(ids) {
|
|
handlerDelete(ids) {
|
|
this.$confirm('删除操作后数据不可复原,您确定要删除此数据?', '警告', {
|
|
this.$confirm('删除操作后数据不可复原,您确定要删除此数据?', '警告', {
|
|
confirmButtonText: '确定',
|
|
confirmButtonText: '确定',
|
|
@@ -165,9 +333,9 @@ export default {
|
|
getList() {
|
|
getList() {
|
|
this.loading = true
|
|
this.loading = true
|
|
const param = this.MixinClone(this.params)
|
|
const param = this.MixinClone(this.params)
|
|
- API_Device.getBoardPage(param).then(response => {
|
|
|
|
|
|
+ API_Device.getList(param).then(response => {
|
|
this.loading = false
|
|
this.loading = false
|
|
- this.tableData = [...response.data]
|
|
|
|
|
|
+ this.rowData = [...response.data]
|
|
this.pageData = {
|
|
this.pageData = {
|
|
page_no: response.page_no,
|
|
page_no: response.page_no,
|
|
page_size: response.page_size,
|
|
page_size: response.page_size,
|
|
@@ -194,10 +362,67 @@ export default {
|
|
this.getList()
|
|
this.getList()
|
|
},
|
|
},
|
|
|
|
|
|
- setBoard(obj) {
|
|
|
|
- this.boardObj = obj
|
|
|
|
|
|
+ gridSortChange(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()
|
|
|
|
+ console.log(sortState)
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取空间结构树形数据
|
|
|
|
+ * */
|
|
|
|
+ getFrameTree() {
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ API_FrameGroup.getframestruct(this.$store.getters.partId, 3).then(res => {
|
|
|
|
+ this.treeData = res.frameTree
|
|
|
|
+ resolve()
|
|
|
|
+ }).catch(err => {
|
|
|
|
+ reject(err)
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ setBoard(row) {
|
|
|
|
+ this.boardObj = { ...row }
|
|
this.formshow = true
|
|
this.formshow = true
|
|
- if (this.boardObj.device_soft_ver) this.staySeconds = this.boardObj.device_soft_ver.split(',')
|
|
|
|
|
|
+ if (this.boardObj.config === null || this.boardObj.config === '') { // 没有配置看板时,设置默认值
|
|
|
|
+ if (this.boardTitles.length > 0) {
|
|
|
|
+ this.boardTitles.forEach((item, index) => {
|
|
|
|
+ this.boardConfig.staySeconds[index + 2] = 30 // 添加默认时间
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ this.boardConfig = JSON.parse(this.boardObj.config)
|
|
|
|
+ }
|
|
// if (this.boardObj.device_hard_ver) this.stayIndex = Number(this.boardObj.device_hard_ver)
|
|
// if (this.boardObj.device_hard_ver) this.stayIndex = Number(this.boardObj.device_hard_ver)
|
|
},
|
|
},
|
|
getBoardTitles() {
|
|
getBoardTitles() {
|
|
@@ -205,42 +430,51 @@ export default {
|
|
this.boardTitles = res
|
|
this.boardTitles = res
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- setPartBoard(obj) {
|
|
|
|
- obj.partid = this.$store.getters.partId
|
|
|
|
- API_Device.saveBoard(obj).then(() => {
|
|
|
|
- this.$message.success('设定成功!')
|
|
|
|
- this.getList()
|
|
|
|
- }).catch(response => {
|
|
|
|
- this.$message.warning(response.message)
|
|
|
|
- this.getList()
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
updateBoard() {
|
|
updateBoard() {
|
|
- if (this.staySeconds.length !== this.boardTitles.length + 2) {
|
|
|
|
|
|
+ if (this.boardConfig.staySeconds.length !== this.boardTitles.length + 2) {
|
|
this.$message.success('时长必须每项都设置!')
|
|
this.$message.success('时长必须每项都设置!')
|
|
return false
|
|
return false
|
|
- } else {
|
|
|
|
- this.boardObj.device_soft_ver = this.staySeconds.join(',')
|
|
|
|
}
|
|
}
|
|
- if (this.stayIndex > 0) {
|
|
|
|
- this.boardObj.device_hard_ver = this.stayIndex
|
|
|
|
- } else {
|
|
|
|
- this.boardObj.device_hard_ver = null
|
|
|
|
- }
|
|
|
|
- API_Device.saveBoard(this.boardObj).then(() => {
|
|
|
|
|
|
+ this.boardConfig.staySeconds = this.boardConfig.staySeconds.map(p => Number(p))
|
|
|
|
+ this.boardObj.config = JSON.stringify(this.boardConfig)
|
|
|
|
+ API_Device.update(this.boardObj.id, this.boardObj).then(() => {
|
|
this.$message.success('设置成功!')
|
|
this.$message.success('设置成功!')
|
|
this.getList()
|
|
this.getList()
|
|
this.formshow = false
|
|
this.formshow = false
|
|
}).catch(response => {
|
|
}).catch(response => {
|
|
- this.$message.warning(response.message)
|
|
|
|
|
|
+ this.$message.error(response.message)
|
|
this.getList()
|
|
this.getList()
|
|
this.formshow = false
|
|
this.formshow = false
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
+ /**
|
|
|
|
+ * 设定到科室
|
|
|
|
+ * @param row
|
|
|
|
+ */
|
|
|
|
+ handEdit(row) {
|
|
|
|
+ row.part_id = this.$store.getters.partId
|
|
|
|
+ row.frame_id = this.treeData[0].id
|
|
|
|
+ API_Device.update(row.id, row).then(res => {
|
|
|
|
+ this.$message.success('设定成功!')
|
|
|
|
+ this.gridApi.redrawRows()
|
|
|
|
+ }).catch(response => {
|
|
|
|
+ this.$message.error(response.message)
|
|
|
|
+ this.getList()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ filterModifed(param) {
|
|
|
|
+ console.log(param)
|
|
|
|
+ var model = param.api.getFilterModel()
|
|
|
|
+ console.log('model', JSON.stringify(model))
|
|
|
|
+ this.params.filter = JSON.stringify(model)
|
|
|
|
+ this.getList()
|
|
|
|
+ },
|
|
|
|
|
|
initWebSocket: function() {
|
|
initWebSocket: function() {
|
|
- var stockbase = runtimeUrl.replace('http', 'ws')
|
|
|
|
- this.websock = new WebSocket(stockbase + '/board/0/' + this.$store.getters.partId)
|
|
|
|
|
|
+ var stockbase = DeviceUrl.replace('http', 'ws')
|
|
|
|
+ this.websock = new WebSocket(stockbase + '/boardinfo/0/' + this.$store.getters.uuid)
|
|
this.websock.onopen = this.websocketonopen
|
|
this.websock.onopen = this.websocketonopen
|
|
this.websock.onerror = this.websocketonerror
|
|
this.websock.onerror = this.websocketonerror
|
|
this.websock.onmessage = this.websocketonmessage
|
|
this.websock.onmessage = this.websocketonmessage
|
|
@@ -264,5 +498,10 @@ export default {
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
-
|
|
|
|
|
|
+ fieldset{
|
|
|
|
+ border-style: solid;
|
|
|
|
+ border-color: #DCDFE6;
|
|
|
|
+ border-width: 1px;
|
|
|
|
+ }
|
|
|
|
+ .margin-top-sm{margin-top: 20px}
|
|
</style>
|
|
</style>
|