|
@@ -42,14 +42,10 @@
|
|
|
</div>
|
|
|
<div class="pl-10px pr-10px">
|
|
|
<div class="mb-10px">
|
|
|
- <APopconfirm title="确认操作?" @confirm="controlDevice('dianwei', 'zhi')">
|
|
|
- <AButton class="w-full" type="primary">超值启动注氮机</AButton>
|
|
|
- </APopconfirm>
|
|
|
+ <AButton class="w-full" type="primary" @click="controlDevice('dianwei', 'zhi')">启动注氮机</AButton>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <APopconfirm title="确认操作?" @confirm="controlDevice('dianwei', 'zhi')">
|
|
|
- <AButton class="w-full" type="primary">启动应急控制</AButton>
|
|
|
- </APopconfirm>
|
|
|
+ <AButton class="w-full" type="primary" @click="controlDevice('dianwei', 'zhi')">关闭注氮机</AButton>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -117,11 +113,11 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
- import { ref, reactive, watch, defineProps, inject } from 'vue';
|
|
|
+ import { ref, reactive, watch, defineProps, inject, h } from 'vue';
|
|
|
import echartLine1 from './echartLine1.vue';
|
|
|
import warnZb from './warnZb.vue';
|
|
|
import PredictionCurve from './predictionCurve.vue';
|
|
|
- import { message } from 'ant-design-vue';
|
|
|
+ import { Modal, Input } from 'ant-design-vue';
|
|
|
import { deviceControlApi } from '/@/api/vent/index';
|
|
|
|
|
|
let props = defineProps({
|
|
@@ -404,6 +400,23 @@
|
|
|
|
|
|
// 设备控制
|
|
|
function controlDevice(code, value?) {
|
|
|
+ const passWord = ref('');
|
|
|
+ Modal.confirm({
|
|
|
+ title: '是否确认执行该操作?',
|
|
|
+ content: () => {
|
|
|
+ return h(Input, {
|
|
|
+ placeholder: '请输入密码',
|
|
|
+ type: 'password',
|
|
|
+ modelValue: passWord.value,
|
|
|
+ 'onUpdate:value'(val) {
|
|
|
+ passWord.value = val;
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ onOk() {
|
|
|
+ console.log('OK', passWord);
|
|
|
+ },
|
|
|
+ });
|
|
|
// Promise.all(
|
|
|
// [].map(({ deviceID, deviceType }) => {
|
|
|
// return deviceControlApi({
|