123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247 |
- <template>
- <view class="">
- <view class="line">
- </view>
- <view class="body">
- <p class="p">自测试模式</p>
- <!-- <input class="input" type="text" v-model="M17" /> -->
- <!-- <button type="primary" class="button" @click="update('M-17',M17)">
- <p class="p2">更新</P>
- </button> -->
- <button type="primary" class="button" @click="update('M17','0')">
- <p class="p2">启动</P>
- </button>
- <button type="primary" class="button" @click="update('M17','1')">
- <p class="p2">关闭</P>
- </button>
- </view>
- <view class="line2"></view>
- <view class="body">
- <p class="p">A轴正转</p>
- <!-- <input class="input" type="text" v-model="M311" /> -->
- <button type="primary" class="button" @click="update('M311','0')">
- <p class="p2">启动</P>
- </button>
- <button type="primary" class="button" @click="update('M311','1')">
- <p class="p2">关闭</P>
- </button>
- </view>
- <view class="line2"></view>
- <view class="body">
- <p class="p">A轴反转</p>
- <!-- <input class="input" type="text" v-model="M312" />
- <button type="primary" class="button" @click="update('M-312',M312)">
- <p class="p2">更新</P>
- </button> -->
- <button type="primary" class="button" @click="update('M312','0')">
- <p class="p2">启动</P>
- </button>
- <button type="primary" class="button" @click="update('M312','1')">
- <p class="p2">关闭</P>
- </button>
- </view>
- <view class="line2"></view>
- <view class="body">
- <p class="p">喷水泵启动</p>
- <!-- <input class="input" type="text" v-model="M313" />
- <button type="primary" class="button" @click="update('M-313',M313)">
- <p class="p2">更新</P>
- </button> -->
- <button type="primary" class="button" @click="update('M313','0')">
- <p class="p2">启动</P>
- </button>
- <button type="primary" class="button" @click="update('M313','1')">
- <p class="p2">关闭</P>
- </button>
- </view>
- <view class="line2"></view>
- <view class="body">
- <p class="p">气泵启动</p>
- <!-- <input class="input" type="text" v-model="M315" />
- <button type="primary" class="button" @click="update('M-315',M315)">
- <p class="p2">更新</P>
- </button> -->
- <button type="primary" class="button" @click="update('M315','0')">
- <p class="p2">启动</P>
- </button>
- <button type="primary" class="button" @click="update('M315','1')">
- <p class="p2">关闭</P>
- </button>
- </view>
- <view class="line2"></view>
- <view class="body">
- <p class="p">清洁消毒喷水泵</p>
- <!-- <input class="input" type="text" v-model="M316" />
- <button type="primary" class="button" @click="update('M-316',M316)">
- <p class="p2">更新</P>
- </button> -->
- <button type="primary" class="button" @click="update('M316','0')">
- <p class="p2">启动</P>
- </button>
- <button type="primary" class="button" @click="update('M316','1')">
- <p class="p2">关闭</P>
- </button>
- </view>
- <view class="line2"></view>
- <view class="body">
- <p class="p">清洗洁厕灵+水</p>
- <!-- <input class="input" type="text" v-model="M317" />
- <button type="primary" class="button" @click="update('M-317',M317)">
- <p class="p2">更新</P>
- </button> -->
- <button type="primary" class="button" @click="update('M317','0')">
- <p class="p2">启动</P>
- </button>
- <button type="primary" class="button" @click="update('M317','1')">
- <p class="p2">关闭</P>
- </button>
- </view>
- <view class="line2"></view>
- <view class="body">
- <p class="p">消毒液+水</p>
- <!-- <input class="input" type="text" v-model="M318" /> -->
- <!-- <button type="primary" class="button" @click="update('M-318',M318)">
- <p class="p2">更新</P>
- </button> -->
- <button type="primary" class="button" @click="update('M318','0')">
- <p class="p2">启动</P>
- </button>
- <button type="primary" class="button" @click="update('M318','1')">
- <p class="p2">关闭</P>
- </button>
- </view>
- </view>
- </template>
- <script>
- import {
- mapState,
- mapActions,
- mapMutations
- } from 'vuex'
- export default {
- data() {
- return {
- M17: 0,
- M311: 0,
- M312: 0,
- M313: 0,
- M315: 0,
- M316: 0,
- M317: 0,
- M318: 0,
- }
- },
- onShow() {
- this.getParam();
- },
- methods: {
- ...mapActions('chart', ['getParameters', 'updateParameters']),
- getParam() {
- const param = {};
- param['id'] = uni.getStorageSync("nowEquipmentId");
- param['code'] = '0';
- this.getParameters(param).then(data => {
- var info = data;
- if (info!=null||info!='') {
- for (var i = 0; i < info.length; i++) {
- if(info[i].name=='M-17'){
- this.M17=info[i].val;
- }
- if(info[i].name=='M-311'){
- this.M311=info[i].val;
- }
- if(info[i].name=='M-312'){
- this.M312=info[i].val;
- }
- if(info[i].name=='M-313'){
- this.M313=info[i].val;
- }
- if(info[i].name=='M-315'){
- this.M315=info[i].val;
- }
- if(info[i].name=='M-316'){
- this.M316=info[i].val;
- }
- if(info[i].name=='M-317'){
- this.M317=info[i].val;
- }
- if(info[i].name=='M-318'){
- this.M318=info[i].val;
- }
- }
- }
-
- }, _ => void uni.stopPullDownRefresh());
- },
- update(name, val) {
- const param = {};
- param['id'] = uni.getStorageSync("nowEquipmentId");
- param['name'] = name;
- param['val'] = val;
- this.updateParameters(param).then(data => {
- if (data == 'SUCCESS') {
- uni.showToast({
- title: '修改成功',
- duration: 1000
- });
- }
- }, _ => void uni.stopPullDownRefresh());
- },
- },
- }
- </script>
- <style>
- .line {
- height: 50upx;
- }
- .line2 {
- height: 10upx;
- }
- .body {
- padding-top: 10upx;
- background-color: #FFFFFF;
- width: 550upx;
- padding: 10upx 10upx 10upx 10upx;
- display: flex;
- flex-direction: row;
- justify-content: flex-start;
- font-size: 32upx;
- }
- .p {
- width: 250upx;
- padding-top: 3upx;
- text-align: right;
- }
- .input {
- width: 200upx;
- box-shadow: 0upx 0upx 20upx #D3D3D3;
- border-radius: 5upx;
- }
- .button {
- width: 120upx;
- height: 60upx;
- text-align: left;
- border-radius: 10upx;
- }
- .p2 {
- font-size: 30upx;
- /* #ifndef H5 */
- padding-top: 3upx;
- /* #endif */
- position: absolute;
- /* 水平居中 */
- left: 50%;
- -webkit-transform: translateX(-50%);
- transform: translateX(-50%);
- }
- </style>
|