|
@@ -12,11 +12,11 @@
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
|
|
|
|
-<!-- <el-row v-if="isOnlyTime">-->
|
|
|
- <el-row>
|
|
|
+ <el-row v-if="isOnlyTime">
|
|
|
+<!-- <el-row>-->
|
|
|
<el-col :span="18">
|
|
|
<el-form-item :label="this.$t('deviceManage.ledAddCustom')">
|
|
|
- <el-input v-model="addCustom" :maxlength="50" />
|
|
|
+ <el-input v-model="formmodel.addCustom" :maxlength="50" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -24,27 +24,27 @@
|
|
|
<el-row>
|
|
|
<el-form-item>
|
|
|
<el-col :span="4">
|
|
|
- <el-button type="primary">{{ this.$t('deviceManage.ledTiming') }}</el-button>
|
|
|
+ <el-button type="primary" @click="timing">{{ this.$t('deviceManage.ledTiming') }}</el-button>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="4">
|
|
|
- <el-button type="primary">{{ this.$t('deviceManage.ledUpdateDefaultProgram') }}</el-button>
|
|
|
+ <el-button type="primary" @click="updateDefaultProgram">{{ this.$t('deviceManage.ledUpdateDefaultProgram') }}</el-button>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="4">
|
|
|
- <el-button type="primary">{{ this.$t('deviceManage.ledRemoveAllProgram') }}</el-button>
|
|
|
+ <el-button type="primary" @click="deleteAllPrograms">{{ this.$t('deviceManage.ledRemoveAllProgram') }}</el-button>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="4">
|
|
|
- <el-button type="primary">{{ this.$t('deviceManage.ledPowerOn') }}</el-button>
|
|
|
+ <el-button type="primary" @click="powerOn">{{ this.$t('deviceManage.ledPowerOn') }}</el-button>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="4">
|
|
|
- <el-button type="primary">{{ this.$t('deviceManage.ledPowerOff') }}</el-button>
|
|
|
+ <el-button type="primary" @click="powerOff">{{ this.$t('deviceManage.ledPowerOff') }}</el-button>
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :span="4">
|
|
|
- <el-button type="primary">{{ this.$t('deviceManage.ledRestart') }}</el-button>
|
|
|
+ <el-button type="primary" @click="powerRestart">{{ this.$t('deviceManage.ledRestart') }}</el-button>
|
|
|
</el-col>
|
|
|
</el-form-item>
|
|
|
</el-row>
|
|
@@ -62,8 +62,10 @@ export default {
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
+ formmodel: {},
|
|
|
+ rules: {},
|
|
|
isOnlyTime: false,
|
|
|
- addCustom: '',
|
|
|
+ // addCustom: '',
|
|
|
hospital_id: this.$store.getters.partId
|
|
|
}
|
|
|
},
|
|
@@ -73,16 +75,54 @@ export default {
|
|
|
methods: {
|
|
|
updateDefaultProgram() {
|
|
|
let text;
|
|
|
- if (this.addCustom !== '') {
|
|
|
- text = this.addCustom
|
|
|
+ if (this.isOnlyTime) {
|
|
|
+ text = this.formmodel.addCustom
|
|
|
}
|
|
|
const params = {}
|
|
|
params.hospital_id = this.hospital_id
|
|
|
- params.text = this.text
|
|
|
+ params.text = text
|
|
|
API_Led.updateDefaultProgramHospitalId(params).then(r => {
|
|
|
this.$message.success(this.$t('action.saveSuccess'))
|
|
|
})
|
|
|
-
|
|
|
+ },
|
|
|
+ powerOn() {
|
|
|
+ const params = {}
|
|
|
+ params.hospital_id = this.hospital_id
|
|
|
+ params.on_off = 0
|
|
|
+ API_Led.powerOnOffByHospitalId(params).then(r => {
|
|
|
+ this.$message.success(this.$t('action.saveSuccess'))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ powerOff() {
|
|
|
+ const params = {}
|
|
|
+ params.hospital_id = this.hospital_id
|
|
|
+ params.on_off = 1
|
|
|
+ API_Led.powerOnOffByHospitalId(params).then(r => {
|
|
|
+ this.$message.success(this.$t('action.saveSuccess'))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ powerRestart() {
|
|
|
+ const params = {}
|
|
|
+ params.hospital_id = this.hospital_id
|
|
|
+ params.on_off = 2
|
|
|
+ API_Led.powerOnOffByHospitalId(params).then(r => {
|
|
|
+ this.$message.success(this.$t('action.saveSuccess'))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ timing() {
|
|
|
+ const params = {}
|
|
|
+ params.hospital_id = this.hospital_id
|
|
|
+ API_Led.timing(params).then(r => {
|
|
|
+ this.$message.success(this.$t('action.saveSuccess'))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deleteAllPrograms() {
|
|
|
+ const params = {}
|
|
|
+ params.hospital_id = this.hospital_id
|
|
|
+ params.text = null
|
|
|
+ API_Led.removeAllProgramByHospitalId(params).then(r => {
|
|
|
+ this.$message.success(this.$t('action.saveSuccess'))
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|