修改页面逻辑 增加js

This commit is contained in:
liuwu 2023-08-10 10:04:15 +08:00
parent 318f6c1190
commit ce093a86cd
3 changed files with 22 additions and 9 deletions

View File

@ -8,8 +8,12 @@
<preference name="avm" value="true"/>
<!-- <feature name="autoStartUp"/> -->
<preference name="pageBounce" value="false"/>
<preference name="softInputMode" value="resize"/>
<preference name="appBackground" value="rgba(0,0,0,0.0)"/>
<preference name="windowBackground" value="rgba(0,0,0,0.0)"/>

View File

@ -1,6 +1,6 @@
<template>
<view class="index_wrap">
<text class="index_title">运行状态</text>
<text class="index_title" @click="closeApp">运行状态</text>
<view class="index_list">
<view
class="index_inline"
@ -58,6 +58,13 @@ export default {
vm.initAll()
},
methods: {
closeApp(){
api.closeWidget({
id: api.appId, //应用ID
retData: { name: 'closeWidget' },
silent: true
});
},
initAll(){
const vm = this
clearInterval(vm.data.jidianqiInte)
@ -115,6 +122,7 @@ export default {
dbUtils.execute(db, "INSERT INTO Sb (Id,sbId,circuitName,current,typeName,isTypeOpen) VALUES ('3','0D','3','3.21','低压风冷',1);", function(ret, err) {})
dbUtils.execute(db, "INSERT INTO Sb (Id,sbId,circuitName,current,typeName,isTypeOpen) VALUES ('4','0E','4','3.21','闭锁调压',1);", function(ret, err) {})
console.log('创建设备表成功');
vm.initAll()
}
});
} else {

View File

@ -14,10 +14,11 @@
</view>
</view> -->
<view class="inline_item">
<text class="item_label">电流通道</text>
<text class="item_label">{{item.typeName}}</text>
<view class="item_content">
<text class="item_label" @click="handleSelectChange(index,item)">{{item.circuitName}}路电流</text>
<input class="input" v-model="item.current" type="number" keyboard-type="decimal" confirm-type="done" :disabled="item.isTypeOpen==='0'" placeholder="请输入电流值" />
<text class="item_label">{{item.circuitName}}路电流</text>
<!-- @click="handleSelectChange(index,item)" -->
<input class="input" v-model="item.current" type="number" adjust-position="false" keyboard-type="decimal" confirm-type="done" :disabled="item.isTypeOpen==='0'" placeholder="请输入电流" />
<text class="item_label">A</text>
<button class="btn" style="display:inline" @click="setDianliu(item)">保存</button>
</view>
@ -200,7 +201,7 @@ export default {
<style>
.set_wrap{
width: 100%;
height: 100vh;
height: 100%;
box-sizing: border-box;
padding: 20px;
background-image: url("../../image/login.png");
@ -218,7 +219,7 @@ export default {
left: 20px;
}
.set_list{
margin-top: 60px;
margin-top: 40px;
display: flex;
align-items: center;
}
@ -259,8 +260,8 @@ export default {
padding: 5px;
border: 1px solid silver;
font-size: 32px;
height: 100px;
width: 140px;
height: 60px;
width: 180px;
margin-left: 20px;
border-radius: 10px;
}
@ -269,7 +270,7 @@ export default {
border-radius: 10px;
font-size: 32px;
width: 90px;
height: 100px;
height: 60px;
margin-left: 20px;
color: #fff;
background-image: linear-gradient(to bottom, #00b, #006);