|
@@ -0,0 +1,133 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-card style="margin: 15px">
|
|
|
+ <el-form ref="editform" :rules="rules" label-width="140px" :model="formmodel">
|
|
|
+ <fieldset>
|
|
|
+ <legend>{{ this.$t('tab.ledDevice') }}</legend>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-form-item :label="this.$t('deviceManage.ledUpdateDefaultProgram')">
|
|
|
+ <el-radio v-model="isOnlyTime" :label="false">{{ this.$t('deviceManage.ledOnlyTime') }}</el-radio>
|
|
|
+ <el-radio v-model="isOnlyTime" :label="true">{{ this.$t('deviceManage.ledAddCustom') }}</el-radio>
|
|
|
+ </el-form-item>
|
|
|
+ </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="formmodel.addCustom" :maxlength="50" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
+ <el-row>
|
|
|
+ <el-form-item>
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-button type="primary" @click="timing">{{ this.$t('deviceManage.ledTiming') }}</el-button>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-button type="primary" @click="updateDefaultProgram">{{ this.$t('deviceManage.ledUpdateDefaultProgram') }}</el-button>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-button type="primary" @click="deleteAllPrograms">{{ this.$t('deviceManage.ledRemoveAllProgram') }}</el-button>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-button type="primary" @click="powerOn">{{ this.$t('deviceManage.ledPowerOn') }}</el-button>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-button type="primary" @click="powerOff">{{ this.$t('deviceManage.ledPowerOff') }}</el-button>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+ <el-col :span="4">
|
|
|
+ <el-button type="primary" @click="powerRestart">{{ this.$t('deviceManage.ledRestart') }}</el-button>
|
|
|
+ </el-col>
|
|
|
+ </el-form-item>
|
|
|
+ </el-row>
|
|
|
+ </fieldset>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+import * as API_Led from '@/api/ncs_led'
|
|
|
+export default {
|
|
|
+ name: "ledManager",
|
|
|
+
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ formmodel: {},
|
|
|
+ rules: {},
|
|
|
+ isOnlyTime: false,
|
|
|
+ // addCustom: '',
|
|
|
+ shop_id: this.$store.getters.partId
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async mounted() {
|
|
|
+ this.isOnlyTime === false
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ updateDefaultProgram() {
|
|
|
+ let text;
|
|
|
+ if (this.isOnlyTime) {
|
|
|
+ text = this.formmodel.addCustom
|
|
|
+ }
|
|
|
+ const params = {}
|
|
|
+ params.shop_id = this.shop_id
|
|
|
+ params.text = text
|
|
|
+ API_Led.updateDefaultProgramShopId(params).then(r => {
|
|
|
+ this.$message.success(this.$t('action.saveSuccess'))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ powerOn() {
|
|
|
+ const params = {}
|
|
|
+ params.shop_id = this.shop_id
|
|
|
+ params.on_off = 0
|
|
|
+ API_Led.powerOnOffByShopId(params).then(r => {
|
|
|
+ this.$message.success(this.$t('action.saveSuccess'))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ powerOff() {
|
|
|
+ const params = {}
|
|
|
+ params.shop_id = this.shop_id
|
|
|
+ params.on_off = 1
|
|
|
+ API_Led.powerOnOffByShopId(params).then(r => {
|
|
|
+ this.$message.success(this.$t('action.saveSuccess'))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ powerRestart() {
|
|
|
+ const params = {}
|
|
|
+ params.shop_id = this.shop_id
|
|
|
+ params.on_off = 2
|
|
|
+ API_Led.powerOnOffByShopId(params).then(r => {
|
|
|
+ this.$message.success(this.$t('action.saveSuccess'))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ timing() {
|
|
|
+ const params = {}
|
|
|
+ params.shop_id = this.shop_id
|
|
|
+ API_Led.timing(params).then(r => {
|
|
|
+ this.$message.success(this.$t('action.saveSuccess'))
|
|
|
+ })
|
|
|
+ },
|
|
|
+ deleteAllPrograms() {
|
|
|
+ const params = {}
|
|
|
+ params.shop_id = this.shop_id
|
|
|
+ params.text = null
|
|
|
+ API_Led.removeAllProgramByShopId(params).then(r => {
|
|
|
+ this.$message.success(this.$t('action.saveSuccess'))
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+
|
|
|
+</style>
|