.
This commit is contained in:
parent
d8eba3c7c4
commit
a50dba0f2b
@ -332,9 +332,10 @@
|
||||
<uni-tag class="bg-red" :circle="true" text="离线" v-else />
|
||||
</view>
|
||||
<view class="right">
|
||||
<!-- <u-button type="success" size="mini" text="刷新"
|
||||
:loading="dc.dataObj[item.deviceCode]?.refresh"
|
||||
@click="dc.refreshDeviceItem(item.deviceCode, item)" /> -->
|
||||
<view v-if="item.data && item.data.items">
|
||||
<text>运行模式:</text>
|
||||
{{ item.data.items.m.value == "1" ? "自动" : "手动" }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cards-content">
|
||||
@ -512,6 +513,9 @@
|
||||
<script>
|
||||
import plugins from "@/plugins";
|
||||
import * as DevOpsApi from "@/api/dev-ops/index.js"
|
||||
import {
|
||||
controlHeadSwitch
|
||||
} from "@/api/controlHeadInterface.js"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -776,7 +780,23 @@
|
||||
|
||||
/************************************************** 墒情 **************************************************/
|
||||
cqRunModel(item) {
|
||||
console.error("item:", item)
|
||||
if (!item.data || !item.data.items.m || item.data.items.m.value == "offline") {
|
||||
plugins.modal.msg("设备离线,不能操作!")
|
||||
return;
|
||||
}
|
||||
let m = item.data.items.m.value == 1 ? 0 : 1;
|
||||
let par = {
|
||||
controlKey: "m",
|
||||
deviceTypeId: 7,
|
||||
operationType: 11,
|
||||
deviceCode: item.deviceCode,
|
||||
controlValve: item.data.items.m.value == 1 ? 0 : 1
|
||||
};
|
||||
this.$showConfirm(`切换运行模式为"${(m == 1 ? "自动" : "手动" )}"?`).then(res => {
|
||||
controlHeadSwitch(par).then(res => {
|
||||
item.data.items.m.value = m;
|
||||
})
|
||||
}).catch(() => {});
|
||||
},
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user