|
@@ -4,6 +4,8 @@
|
|
<el-select v-model="shopId" @change="changeShop" filterable>
|
|
<el-select v-model="shopId" @change="changeShop" filterable>
|
|
<el-option v-for="(item, index) in partList" :key="index" :label="item.shop_name" :value="item.shop_id" />
|
|
<el-option v-for="(item, index) in partList" :key="index" :label="item.shop_name" :value="item.shop_id" />
|
|
</el-select>
|
|
</el-select>
|
|
|
|
+ <el-button :disabled="multipleSelection.length === 0" type="primary" style="margin-left: 15px;" size="mini" @click="update485">修改转换盒</el-button>
|
|
|
|
+ <el-button :disabled="multipleSelection.length === 0" type="" style="margin-left: 15px;" size="mini" @click="setwifi">设置WiFi</el-button>
|
|
<el-tooltip class="item" effect="dark" content="是否开启485调试,开了的话485连接时,不会在自动刷新了" placement="top-start">
|
|
<el-tooltip class="item" effect="dark" content="是否开启485调试,开了的话485连接时,不会在自动刷新了" placement="top-start">
|
|
<el-switch v-model="boolOpenRs485Debug" active-text="开启485调试" inactive-text="不开启调试" style="margin-bottom: 10px;margin-left: 10px;" @change="open485Debug"></el-switch>
|
|
<el-switch v-model="boolOpenRs485Debug" active-text="开启485调试" inactive-text="不开启调试" style="margin-bottom: 10px;margin-left: 10px;" @change="open485Debug"></el-switch>
|
|
</el-tooltip>
|
|
</el-tooltip>
|
|
@@ -19,6 +21,16 @@
|
|
</el-button>
|
|
</el-button>
|
|
<el-switch v-model="boolOpen" active-text="打印具体消息" inactive-text="不打印具体消息" style="margin-left: 10px"></el-switch>
|
|
<el-switch v-model="boolOpen" active-text="打印具体消息" inactive-text="不打印具体消息" style="margin-left: 10px"></el-switch>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div>
|
|
|
|
+ <el-input v-model="searchDeviceStr" placeholder="输入搜索" clearable @change="clickSearch" style="width: 350px;margin-bottom: 5px">
|
|
|
|
+ <el-select v-model="frameType" slot="prepend" placeholder="请选择设备位置级别" @change="changeFrameType">
|
|
|
|
+ <el-option label="全部" value="-1"></el-option>
|
|
|
|
+ <el-option label="门口机" value="22"></el-option>
|
|
|
|
+ <el-option label="分机" value="12"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ <el-button slot="append" size="mini" icon="el-icon-search" @click="clickSearch"></el-button>
|
|
|
|
+ </el-input>
|
|
|
|
+ </div>
|
|
<el-table :data="deviceList" stripe border style="width: 100%" @selection-change="selectFun" height="520">
|
|
<el-table :data="deviceList" stripe border style="width: 100%" @selection-change="selectFun" height="520">
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
<el-table-column type="selection" width="55"></el-table-column>
|
|
<el-table-column prop="full_name" min-width="100" label="位置" align="center" />
|
|
<el-table-column prop="full_name" min-width="100" label="位置" align="center" />
|
|
@@ -67,14 +79,77 @@
|
|
</div>
|
|
</div>
|
|
</el-card>
|
|
</el-card>
|
|
</div>
|
|
</div>
|
|
|
|
+ <el-dialog :visible.sync="frameDialogVisible" width="50%">
|
|
|
|
+ <el-form ref="editForm" label-width="130px" style="min-height: 80px">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col>
|
|
|
|
+ <el-form-item label="转换盒">
|
|
|
|
+ <el-radio-group v-model="my485Id">
|
|
|
|
+ <el-radio v-for="(item, index) in zhhList" :key="index" :label="item.id">{{item.name}}</el-radio>
|
|
|
|
+ <el-radio label="-1">不设置转换盒</el-radio>
|
|
|
|
+ </el-radio-group>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col>
|
|
|
|
+ <el-button type="success" style="float: right;margin-right: 30px;" @click="save485">保存</el-button>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-dialog>
|
|
|
|
+
|
|
|
|
+ <el-dialog title="设置WiFi" :visible.sync="wifiDialogVisible" width="50%">
|
|
|
|
+ <el-form ref="setWiFi" :model="wifiFrom" :rules="wifiRules" label-width="120px">
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col>
|
|
|
|
+ <el-form-item label="WiFi名称" prop="ssid">
|
|
|
|
+ <el-input v-model="wifiFrom.ssid" clearable placeholder="请输入WiFi名称" :maxlength="30" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col>
|
|
|
|
+ <el-form-item label="WiFi密码" prop="passwd">
|
|
|
|
+ <el-input v-model="wifiFrom.passwd" clearable placeholder="请输入WiFi密码" :maxlength="30" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col>
|
|
|
|
+ <el-form-item label="服务器IP" prop="serverIp">
|
|
|
|
+ <el-input v-model="wifiFrom.serverIp" clearable placeholder="请输入服务器IP" :maxlength="30" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col>
|
|
|
|
+ <el-form-item label="服务器端口" prop="serverPort">
|
|
|
|
+ <el-input v-model="wifiFrom.serverPort" clearable placeholder="请输入器端口" :maxlength="30" />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-row>
|
|
|
|
+ <el-col>
|
|
|
|
+ <el-form-item label="是否连接WiFi">
|
|
|
|
+ <el-switch v-model="wifiFrom.nvmemSync" active-text="连接" inactive-text="不连接"></el-switch>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-row>
|
|
|
|
+ <el-form-item>
|
|
|
|
+ <el-button type="primary" class="save" @click="savewifi('setWiFi')">保存</el-button>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ </el-dialog>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import { listByType } from '@/api/ncs_partInfo'
|
|
import { listByType } from '@/api/ncs_partInfo'
|
|
-import { get485DeviceAndFrame, getDeviceByType } from '@/api/ncs_device'
|
|
|
|
|
|
+import {get485DeviceAndFrame, getDeviceByType, update485s} from '@/api/ncs_device'
|
|
import { unix2Date } from '@/utils/Foundation'
|
|
import { unix2Date } from '@/utils/Foundation'
|
|
import {changeRs485Debug} from "@/api/initialize";
|
|
import {changeRs485Debug} from "@/api/initialize";
|
|
|
|
+import * as API_Customer from "@/api/ncs_customer";
|
|
const DeviceUrl = domain.DeviceUrl
|
|
const DeviceUrl = domain.DeviceUrl
|
|
export default {
|
|
export default {
|
|
name: "index",
|
|
name: "index",
|
|
@@ -85,11 +160,30 @@ export default {
|
|
shopId: null,
|
|
shopId: null,
|
|
activeName: null,
|
|
activeName: null,
|
|
deviceList: [],
|
|
deviceList: [],
|
|
|
|
+ allList: [],
|
|
tid: null,
|
|
tid: null,
|
|
activities: [],
|
|
activities: [],
|
|
multipleSelection: [],
|
|
multipleSelection: [],
|
|
boolOpen: false,
|
|
boolOpen: false,
|
|
- boolOpenRs485Debug: false
|
|
|
|
|
|
+ boolOpenRs485Debug: false,
|
|
|
|
+ frameDialogVisible: false,
|
|
|
|
+ wifiDialogVisible: false,
|
|
|
|
+ wifiFrom: {
|
|
|
|
+ ssid: '',
|
|
|
|
+ passwd: '',
|
|
|
|
+ serverIp: '',
|
|
|
|
+ serverPort: 5086,
|
|
|
|
+ nvmemSync: true
|
|
|
|
+ },
|
|
|
|
+ my485Id: null,
|
|
|
|
+ frameType: '-1',
|
|
|
|
+ searchDeviceStr: '',
|
|
|
|
+ wifiRules: {
|
|
|
|
+ ssid: [{required: true, message: '请输入WiFi名称', trigger: 'blur'}],
|
|
|
|
+ passwd: [{required: true, message: '请输入WiFi密码', trigger: 'blur'}],
|
|
|
|
+ serverIp: [{required: true, message: '请输入需要连接的服务器地址', trigger: 'blur'}],
|
|
|
|
+ serverPort: [{required: true, message: '请输入需要连接的服务器端口', trigger: 'blur'}],
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -182,7 +276,13 @@ export default {
|
|
API_get485DeviceAndFrame() {
|
|
API_get485DeviceAndFrame() {
|
|
const _this = this
|
|
const _this = this
|
|
get485DeviceAndFrame(this.shopId, this.tid).then(res => {
|
|
get485DeviceAndFrame(this.shopId, this.tid).then(res => {
|
|
|
|
+ res.forEach(item => {
|
|
|
|
+ item.state = null
|
|
|
|
+ item.send_time = ''
|
|
|
|
+ item.receive_time = ''
|
|
|
|
+ })
|
|
_this.deviceList = res
|
|
_this.deviceList = res
|
|
|
|
+ _this.allList = _this.MixinClone(res)
|
|
})
|
|
})
|
|
},
|
|
},
|
|
changeShop() {
|
|
changeShop() {
|
|
@@ -190,6 +290,7 @@ export default {
|
|
},
|
|
},
|
|
handleClick() {
|
|
handleClick() {
|
|
this.tid = this.activeName.split('-')[1]
|
|
this.tid = this.activeName.split('-')[1]
|
|
|
|
+ this.frameType = '-1'
|
|
this.API_get485DeviceAndFrame()
|
|
this.API_get485DeviceAndFrame()
|
|
},
|
|
},
|
|
handlerEdit(index, row, type) {
|
|
handlerEdit(index, row, type) {
|
|
@@ -211,14 +312,15 @@ export default {
|
|
},
|
|
},
|
|
sendAll() {
|
|
sendAll() {
|
|
let list = []
|
|
let list = []
|
|
- this.multipleSelection.forEach(item => {
|
|
|
|
- const index = this.deviceList.indexOf(item)
|
|
|
|
|
|
+ const _this = this
|
|
|
|
+ _this.multipleSelection.forEach(item => {
|
|
|
|
+ const index = _this.deviceList.indexOf(item)
|
|
item.state = 0
|
|
item.state = 0
|
|
item.send_time = item.receive_time = ''
|
|
item.send_time = item.receive_time = ''
|
|
- this.$set(this.deviceList, index, item)
|
|
|
|
- list.push(item.sip_id + '-' + this.activeName.split('-')[0])
|
|
|
|
|
|
+ _this.$set(_this.deviceList, index, item)
|
|
|
|
+ list.push(item.sip_id + '-' + _this.activeName.split('-')[0])
|
|
})
|
|
})
|
|
- this.multipleSelection = []
|
|
|
|
|
|
+ // this.multipleSelection = []
|
|
this.websock.send(list.join(','))
|
|
this.websock.send(list.join(','))
|
|
},
|
|
},
|
|
//将秒转化为时分秒
|
|
//将秒转化为时分秒
|
|
@@ -243,11 +345,72 @@ export default {
|
|
message: '修改成功'
|
|
message: '修改成功'
|
|
})
|
|
})
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ update485() {
|
|
|
|
+ this.frameDialogVisible = true
|
|
|
|
+ },
|
|
|
|
+ setwifi() {
|
|
|
|
+ this.wifiDialogVisible = true
|
|
|
|
+ },
|
|
|
|
+ save485() {
|
|
|
|
+ let ids = []
|
|
|
|
+ this.multipleSelection.forEach(item => {
|
|
|
|
+ ids.push(item.id)
|
|
|
|
+ })
|
|
|
|
+ const data = {
|
|
|
|
+ ids: ids,
|
|
|
|
+ rs485Id: this.my485Id
|
|
|
|
+ }
|
|
|
|
+ this.frameDialogVisible = false
|
|
|
|
+ const _this = this
|
|
|
|
+ update485s(data).then(res => {
|
|
|
|
+ _this.$message.success('修改成功!')
|
|
|
|
+ _this.API_get485DeviceAndFrame()
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ changeFrameType() {
|
|
|
|
+ if (this.frameType === '-1') {
|
|
|
|
+ this.deviceList = this.MixinClone(this.allList)
|
|
|
|
+ } else {
|
|
|
|
+ this.deviceList = this.allList.filter(item => item.device_type === parseInt(this.frameType))
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ clickSearch() {
|
|
|
|
+ this.deviceList = this.allList.filter(item => item.full_name.indexOf(this.searchDeviceStr) !== -1 || item.sip_id.indexOf(this.searchDeviceStr) !== -1)
|
|
|
|
+ },
|
|
|
|
+ savewifi(formName ) {
|
|
|
|
+ const _this = this
|
|
|
|
+ this.$refs[formName].validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ let list = []
|
|
|
|
+ _this.multipleSelection.forEach(item => {
|
|
|
|
+ const index = _this.deviceList.indexOf(item)
|
|
|
|
+ item.state = 0
|
|
|
|
+ item.send_time = item.receive_time = ''
|
|
|
|
+ _this.$set(_this.deviceList, index, item)
|
|
|
|
+ list.push(item.sip_id + '-' + _this.activeName.split('-')[0])
|
|
|
|
+ })
|
|
|
|
+ _this.wifiFrom.voiceAddr = list.join(',')
|
|
|
|
+ _this.websock.send(JSON.stringify(_this.wifiFrom))
|
|
|
|
+ _this.wifiDialogVisible = false
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error(this.$t('action.fromError'))
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
-
|
|
|
|
-</style>
|
|
|
|
|
|
+.el-input .el-select {
|
|
|
|
+ width: 90px;
|
|
|
|
+}
|
|
|
|
+.el-input .el-button {
|
|
|
|
+ width: 40px;
|
|
|
|
+}
|
|
|
|
+.input-with-select .el-input-group__prepend {
|
|
|
|
+ background-color: #fff;
|
|
|
|
+}
|
|
|
|
+</style>
|