|
@@ -341,8 +341,7 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="handlerFormSubmit('deviceEditForm')">{{ this.$t('action.yes') }}
|
|
|
- </el-button>
|
|
|
+ <el-button type="primary" @click="handlerFormSubmit('deviceEditForm')">{{ this.$t('action.yes') }}</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
<!-- 设备编辑弹窗 -->
|
|
@@ -368,6 +367,47 @@
|
|
|
<el-button type="primary" @click="updateDevicesServerIp()">{{ this.$t('action.yes') }}</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-drawer
|
|
|
+ :title="s433TransferBox.name"
|
|
|
+ :visible.sync="s433TransferBoxDialogVisible"
|
|
|
+ direction="rtl"
|
|
|
+ :before-close="s433TransferBoxHandleClose"
|
|
|
+ size="40%"
|
|
|
+ v-loading="s433TransferBoxLoading"
|
|
|
+ >
|
|
|
+ <div class="drawer-content" style="margin: auto">
|
|
|
+ <div slot="toolbar" class="drawer-toolbar" style="margin: 20px 20px 20px 20px; text-align: right;">
|
|
|
+ <el-button type="primary" @click="addAllLoraButton()" :loading="s433TransferBoxHandleLoading">{{ this.$t('zy20240611.learnAll') }}</el-button>
|
|
|
+ <el-button type="danger" @click="delAllLoraButton()" :loading="s433TransferBoxHandleLoading">{{ this.$t('zy20240611.deleteAll') }}</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ :data="emergencyButtons"
|
|
|
+ border
|
|
|
+ style="width: 80%; margin: auto">
|
|
|
+ <el-table-column sortable fixed prop="id" label="ID" width="120" align="center"></el-table-column>
|
|
|
+ <el-table-column fixed prop="name" :label="this.$t('action.name')" width="150" align="center"></el-table-column>
|
|
|
+ <el-table-column fixed prop="eth_mac" :label="this.$t('board.ethMac')" width="150" align="center"></el-table-column>
|
|
|
+ <el-table-column fixed="right" :label="this.$t('action.handle')" width="180" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ :disabled="isLearn(scope.row)"
|
|
|
+ size="mini"
|
|
|
+ type="primary"
|
|
|
+ :loading="s433TransferBoxHandleLoading"
|
|
|
+ @click="addLoraButton(scope.$index, scope.row)">{{ $t('zy20240611.learn') }}</el-button>
|
|
|
+ <el-button
|
|
|
+ :disabled="!isLearn(scope.row)"
|
|
|
+ size="mini"
|
|
|
+ type="danger"
|
|
|
+ :loading="s433TransferBoxHandleLoading"
|
|
|
+ @click="delLoraButton(scope.$index, scope.row)">{{ $t('action.delete') }}</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </el-drawer>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -528,7 +568,13 @@
|
|
|
]
|
|
|
},
|
|
|
startTime: "06:00",
|
|
|
- endTime: "18:00"
|
|
|
+ endTime: "18:00",
|
|
|
+ s433TransferBoxDialogVisible: false,
|
|
|
+ s433TransferBoxLoading: false,
|
|
|
+ s433TransferBoxHandleLoading: false,
|
|
|
+ s433TransferBox: {},
|
|
|
+ emergencyButtons: [],
|
|
|
+ s433LearnEmergencyButtons: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
@@ -723,7 +769,7 @@
|
|
|
disabled: param.data['member_name'] === 'superadmin'
|
|
|
},
|
|
|
{
|
|
|
- onClick: this.openDebug,
|
|
|
+ onClick: param.data.device_type === DEVICE_TYPE.S433_TRANSFER_BOX ? this.s433TransferBoxHandleOpen : this.openDebug,
|
|
|
label: this.$t('action.opendebug'),
|
|
|
buttonType: 'success',
|
|
|
buttonSize: 'mini',
|
|
@@ -1089,7 +1135,8 @@
|
|
|
val === DEVICE_TYPE.DOCTOR_HOST ||
|
|
|
val === DEVICE_TYPE.TRANSFER_DEVICE ||
|
|
|
val === DEVICE_TYPE.DOOR_DEVICE ||
|
|
|
- val === DEVICE_TYPE.DIGIT_BED_DEVICE
|
|
|
+ val === DEVICE_TYPE.DIGIT_BED_DEVICE ||
|
|
|
+ val === DEVICE_TYPE.S433_TRANSFER_BOX
|
|
|
|
|
|
},
|
|
|
s485Device(param){
|
|
@@ -1377,7 +1424,87 @@
|
|
|
},
|
|
|
getDeviceType() {
|
|
|
return DEVICE_TYPE;
|
|
|
+ },
|
|
|
+ s433TransferBoxHandleOpen(param) {
|
|
|
+ this.s433TransferBoxLoading = true
|
|
|
+ this.s433TransferBoxDialogVisible = true
|
|
|
+ this.s433TransferBox = param
|
|
|
+
|
|
|
+ this.getEmergencyButtons()
|
|
|
+ this.getLoraButtons(param)
|
|
|
+ this.s433TransferBoxLoading = false
|
|
|
+
|
|
|
+ },
|
|
|
+ s433TransferBoxHandleClose(done) {
|
|
|
+ this.s433TransferBoxDialogVisible = false
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ getEmergencyButtons() {
|
|
|
+ API_Device.getDeviceByType(this.$store.getters.partId, DEVICE_TYPE.EMERGENCY_BUTTON).then(r => {
|
|
|
+ this.emergencyButtons = r;
|
|
|
+ console.log(this.emergencyButtons)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getLoraButtons(param) {
|
|
|
+ API_Device.getLoraButtons(param.eth_mac).then(r => {
|
|
|
+ this.s433LearnEmergencyButtons = r;
|
|
|
+ console.log('this.s433LearnEmergencyButtons:' + this.s433LearnEmergencyButtons)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ delAllLoraButton() {
|
|
|
+ this.s433TransferBoxHandleLoading = true
|
|
|
+ API_Device.delAllLoraButtons(this.s433TransferBox.eth_mac).then(r => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.getLoraButtons(this.s433TransferBox)
|
|
|
+ this.s433TransferBoxHandleLoading = false
|
|
|
+ }, 3 * 1000)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ delLoraButton(index, row) {
|
|
|
+ this.s433TransferBoxHandleLoading = true
|
|
|
+ API_Device.delLoraButtons(this.s433TransferBox.eth_mac, row.eth_mac).then(r => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.getLoraButtons(this.s433TransferBox)
|
|
|
+ this.s433TransferBoxHandleLoading = false
|
|
|
+ }, 3 * 1000)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ addAllLoraButton() {
|
|
|
+ this.s433TransferBoxHandleLoading = true
|
|
|
+ let notLearnMac = "";
|
|
|
+ this.emergencyButtons.forEach(p => {
|
|
|
+ if (!this.isLearn(p)) {
|
|
|
+ notLearnMac += p.eth_mac
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log("notLearnMac: " + notLearnMac)
|
|
|
+ if (notLearnMac !== "") {
|
|
|
+ API_Device.addLoraButtons(this.s433TransferBox.eth_mac, notLearnMac).then(r => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.getLoraButtons(this.s433TransferBox)
|
|
|
+ this.s433TransferBoxHandleLoading = false
|
|
|
+ }, 3 * 1000)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.s433TransferBoxHandleLoading = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addLoraButton(index, row) {
|
|
|
+ this.s433TransferBoxHandleLoading = true
|
|
|
+ API_Device.addLoraButtons(this.s433TransferBox.eth_mac, row.eth_mac).then(r => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.getLoraButtons(this.s433TransferBox)
|
|
|
+ this.s433TransferBoxHandleLoading = false
|
|
|
+ }, 3 * 1000)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ isLearn(row) {
|
|
|
+ const mac = row.eth_mac;
|
|
|
+ return this.s433LearnEmergencyButtons.includes(mac.toLowerCase());
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
</script>
|